3 .NC "Network Service Interface"
4 .sh 1 "Connectionless Network Service"
6 This section describes the interface to the ISO connectionless network service.
7 There are really two interfaces to the CLNS: the internal interface
9 The internal interface is based on
10 procedure calls. It is used only within the kernel. The IPC interface
11 allows a user process to access the CLNS directly. This is used only
12 for testing and debugging purposes.
15 The CLNS is, by definition, connectionless. Therefore, there are no
16 primitives associated with connection establishment or connection release.
17 There is one primitive associated with data transfer: N-UNITDATA.
18 The parameters to a N-UNITDATA request are: source NSAP address,
19 destination NSAP address, quality of service, and user data.
20 The parameters of a N-UNITDATA indication are identical to those of the
22 In this implementation, the quality of service parameter is not supported.
23 .sh 2 "Internal Interface"
25 Within the kernel, an N-UNITDATA request is effected by the procedure
32 clnp_output(m0, isop, datalen, flags)
35 +struct mbuf+*m0;+/* data */
36 +struct isopcb+*isop;+/* ISO protocol control block */
38 +int+flags;+/* flags */
42 This procedure will construct a DT NPDU, route it, and transmit it on
43 the appropriate subnetwork. \fIM0\fR is an mbuf chain containing the
44 user data portion of the N-UNITDATA request. \fIIsopcb\fR is the iso protocol
45 control block previously allocated. \fIClnp_output\fR will use the following
46 fields: \fIisop_laddr\fR, isop_faddr, isop_route, isop_options,
47 isop_optindex, \fI and \fRisop_clnpcache\fR.
48 \fIDatalen\fR specifies the number of bytes of user data.
49 The \fIflags\fR parameter will be discussed in a subsequent chapter.
51 A N-UNITDATA indication occurs when a DT NPDU arrives. The indication is
52 generated by calling the appropriate upper layer protocol input routine.
53 In the case of TP, the procedure \fItpclnp_input()\fR is called:
59 tpclnp_input(m, src, dst, len)
62 +struct mbuf+*m;+/* DT NPDU */
63 +struct iso_addr+*src;+/* source of packet */
64 +struct iso_addr+*dst;+/* destination of packet */
65 +int+len;+/* length of clnp header */
69 \fIM\fR contains the entire DT NPDU packet. \fILen\fR indicates the size
70 of the CLNP header. In other words, the user data of the DT NPDU begins
71 \fIlen\fR bytes into \fIm\fR. \fISrc\fR and \fIdst\fR indicate the
72 source and destination NSAP addresses of the packet.
73 .sh 3 "CLNP/Subnetwork Interface"
75 The design of the interface between the subnetwork and the CLNP is
76 determined by the design of the Unix network interface drivers. CLNP
77 follows the conventional mechanisms for exchanging packets with a network
78 interface. See the section on Network Interface Drivers in Chapter Five
79 for more information on these conventions.
80 .sh 2 "IPC (\*(lqRaw\*(rq) Interface"
82 The IPC interface to the CLNS allows direct (called \*(lqraw\*(rq)
84 This interface is intended for testing and debugging only.
85 Its use results in the
86 transmission of CLNP datagrams with nonstandard identification fields.
87 These raw packets may be rejected by a system not employing the same
88 convention. See the section on network implementation for more information
89 about the conventions.
91 In order to gain access to the raw interface
92 a \fIsocket\fR, with address family AF_ISO and type SOCK_RAW must be created.
93 With this socket in hand,
94 the system calls \fIsendto()\fR and \fIrecvfrom()\fR can be used to
95 transmit and receive raw CLNP datagrams.
96 .sh 3 "Sending raw datagrams"
98 The format of the \fIsendto()\fR system call is:
104 cc = sendto(s, msg, len, flags, to, tolen)
115 \f\fIS\fR is the socket previously created. \fIMsg\fR is a pointer to
116 the data for the NPDU. CLNP will prepend a header to this data before
117 transmission. \fILen\fR specifies the number of bytes of data. The
118 \fIflags\fR parameter is unused and should be zero. \fITo\fR specifies the
119 NSAP address to be used as the destination address. The size (in bytes)
120 of \fIto\fR is given in \fItolen\fR. CLNP will automatically insert
121 the source address based upon the route taken by the packet. The number of
122 user data bytes transmitted is returned as \fIcc\fR. See \fIsendto(2)\fR
123 for more information on this system call.
124 .sh 3 "Receiving raw datagrams"
126 The format of the \fIrecvfrom()\fR system call is:
132 cc = recvfrom(s, buf, len, flags, from, fromlen)
138 struct sockaddr+*from;
143 When used with a CLNP raw socket \fIs\fR, \fIrecvfrom()\fR will read a
144 NPDU from the CLNS. If no packet is available, the call will block.
145 \fIBuf\fR specifies a buffer of \fIlen\fR bytes into which the NPDU will
146 be read. The entire packet, including the header, will be read into the
147 buffer. The \fIflags\fR parameter is unused, and should be zero. If
148 \fIfrom\fR is non-zero, the source address of the NPDU is filled in.
149 \fIFromlen\fR is a value-result parameter, initialized to the size of
150 the buffer associated with \fIfrom\fR, and modified on return to
151 indicate the actual size of the address stored there. The total number
152 of bytes received (header and data) is returned as \fIcc\fR.
153 See \fIrecvfrom(2)\fR for more information about this system call.
154 .sh 1 "Connection Oriented Network Service"
156 The ARGO Connection Oriented Network Service (CONS) is not a complete
157 implementation of the
159 It is that subset of the OSI network service that is used
160 by ARGO Transport and by ARGO CLNP.
162 .so figs/NS_primitives.nr
165 shows which CONS service elements are provided.