|
|
1.1 root 1: .\" Copyright (c) 1990 The Regents of the University of California.
2: .\" All rights reserved.
3: .\"
4: .\" Redistribution and use in source and binary forms are permitted
5: .\" provided that: (1) source distributions retain this entire copyright
6: .\" notice and comment, and (2) distributions including binaries display
7: .\" the following acknowledgement: ``This product includes software
8: .\" developed by the University of California, Berkeley and its contributors''
9: .\" in the documentation or other materials provided with the distribution
10: .\" and in all advertising materials mentioning features or use of this
11: .\" software. Neither the name of the University nor the names of its
12: .\" contributors may be used to endorse or promote products derived
13: .\" from this software without specific prior written permission.
14: .\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
15: .\" IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
16: .\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
17: .\"
18: .\" @(#)tp.4 6.2 (Berkeley) 5/30/90
19: .\"
20: .TH TP 4 "May 30, 1990"
21: .UC 5
22: .SH NAME
23: .UC 4
24: .SH NAME
25: TP \- ISO Transport Protocol
26: .SH SYNOPSIS
27: .nf
28: \fB#include <sys/socket.h>\fR
29: \fB#include <netiso/iso_errno.h>\fR
30: \fB#include <netiso/tp_param.h>\fR
31: \fB#include <netiso/tp_user.h>\fR
32: .PP
33: \fBs = socket( [ AF_INET, AF_ISO ] , SOCK_SEQPACKET, 0);\fR
34: .SH DESCRIPTION
35: .PP
36: The TP protocol provides reliable, flow-controlled, two-way
37: transmission of data and record boundaries.
38: It is a byte-stream protocol and is accessed according to
39: the SOCK_SEQPACKET abstraction.
40: The TP protocol makes use of a standard ISO address format,
41: including a Network Service Access Point, and a Transport Service Entity
42: Selector.
43: Subclass 4 may make use of the internet
44: Internet address format.
45: .PP
46: Sockets utilizing the tp protocol are either \*(lqactive\*(rq or
47: \*(lqpassive\*(rq. Active sockets initiate connections to passive
48: sockets. By default TCP sockets are created active; to create a
49: passive socket the
50: .IR listen (2)
51: system call must be used
52: after binding the socket with the
53: .IR bind (2)
54: system call. Only
55: passive sockets may use the
56: .IR accept (2)
57: call to accept incoming connections. Only active sockets may
58: use the
59: .IR connect (2)
60: call to initiate connections.
61: .PP
62: Passive sockets may \*(lqunderspecify\*(rq their location to match
63: incoming connection requests from multiple networks. This
64: technique, termed \*(lqwildcard addressing\*(rq, allows a single
65: server to provide service to clients on multiple networks.
66: To create a socket which listens on all networks, the NSAP portion
67: of the bound address must be void (of length zero).
68: The Transport Selector may still be specified
69: at this time; if the port is not specified the system will assign one.
70: Once a connection has been established the socket's address is
71: fixed by the peer entity's location. The address assigned the
72: socket is the address associated with the network interface
73: through which packets are being transmitted and received.
74: .PP
75: The ISO Transport Protocol implemented for AOS R2
76: at the University of Wisconsin - Madison,
77: and modified for inclusion in the Berkeley Software Distribution,
78: includes classes 0 and 4
79: of the ISO transport protocols
80: as specified in
81: the June 1986 version of IS 8073.
82: Class 4 of the protocol provides reliable, sequenced,
83: flow-controlled, two-way
84: transmission of data packets with an alternate stop-and-wait data path called
85: the "expedited data" service.
86: Class 0 is essentially a null transport protocol, which is used
87: when the underlying network service provides reliable, sequenced,
88: flow-controlled, two-way data transmission.
89: Class 0 does not provide the expedited data service.
90: The protocols are implemented as a single transport layer entity
91: that coexists with the Internet protocol suite.
92: Class 0 may be used only in the ISO domain.
93: Class 4 may be used in the Internet domain as well as in the ISO domain.
94: .PP
95: Two system calls were modified from the previous
96: release of the Berkeley Software Distribution
97: to permit the support the end-of-transport-service-data-unit (EOTSDU)
98: indication, and for the receipt and transmission of user
99: connect, confirm, and disconnect data.
100: See \fIsendmsg(2)\fR and \fIrecmsgv(2)\fR, and further discussion
101: below for the formats of the data in the ancillary data buffer.
102: If the EOTSDU is not needed, the normal
103: .IR read (2),
104: and
105: .IR write (2)
106: system calls may be used.
107: .PP
108: Through the
109: \fIgetsockopt\fR and \fIsetsockopt\fR
110: system calls,
111: TP supports several options
112: to control such things as negotiable options
113: in the protocol and protocol strategies.
114: The options are defined in \fB<netiso/tp_user.h>\fR,
115: and are described below.
116: .\".PP
117: .\"The options marked with a percent sign ( \fB%\fR )
118: .\"are limited to use by the super-user.
119: .PP
120: In the tables below,
121: the options marked with a pound sign ( \fB#\fR )
122: may be used
123: with \fIsetsockopt()\fR
124: after a connection is established.
125: Others must be used before the connection
126: is established, in other words,
127: before calling
128: \fIconnect()\fR or
129: \fIaccept()\fR.
130: All options may be used
131: with \fIgetsockopt()\fR
132: before or
133: after a connection is established.
134: .\"
135: .\" .PP
136: .\" The options marked with an exclamation point ( \fB!\fR )
137: .\" may be used after a connection is released,
138: .\" but before
139: .\" the TP reference timer (which generally
140: .\" has a value in minutes) expires, and before
141: .\" a \fIclose()\fR system call.
142: .\" In other words, these commands may be used when the peer closes
143: .\" a connection (possibly causing a disconnect indication), as long as the command
144: .\" is issued "soon" after the disconnection occurred.
145: .sp 1
146: .TP 25
147: \fBName\fR
148: \fBValue [default]\fR
149: .IP
150: \fBDescription\fR
151: .TP 25
152: TPOPT_CONN_DATA
153: (char *) [none]
154: .IP
155: Data to send on \fIconnect()\fR.
156: The passive user may issue a
157: .IR getsockopt ()
158: call to retrieve a connection request's user data,
159: after having done the
160: .IR accept ()
161: system call without implying confirmation of the connection.
162: .IP
163: The data may also be retrieved by issuing a
164: .IR recvmsg ()
165: request for ancillary data only,
166: without implying confirmation of the connection.
167: The returned cmsghdr will contain SOL_TRANSPORT for the csmg_level
168: and TPOPT_CONN_DATA for cmsg_type.
169: .TP 25
170: TPOPT_DISC_DATA\fB #\fR
171: (char *) [none]
172: .IP
173: Data to send on \fIclose()\fR.
174: Disconnect data may be sent by the side initiating the close
175: but not by the passive side ("passive" with respect to the closing
176: of the connection), so there is no need to read disconnect data
177: after calling \fIclose()\fR.
178: This may be sent by a
179: .IR setsockopt ()
180: system call, or by issuing a
181: .IR sendmsg ()
182: request specifying ancillary data only.
183: The user-provided cmsghdr must contain SOL_TRANSPORT for csmg_level
184: and TPOPT_DISC_DATA for cmsg_type.
185: Sending of disconnect data will in of itself tear down (or reject)
186: the connection.
187: .TP 25
188: TPOPT_CFRM_DATA\fB #\fR
189: (char *) [none]
190: .IP
191: Data to send when confirming a connection.
192: This may aslo be sent by a
193: .IR setsockopt ()
194: system call, or by issuing a
195: .IR sendmsg ()
196: request, as above.
197: Sending of connect confirm data will cause the connection
198: to be confirmed rather than rejected.
199: .\".TP 25
200: .\"TPOPT_CDDATA_CLEAR\fB #\fR
201: .\"No associated value.
202: .\".IP
203: .\"Erase outgoing connect or disconnect data.
204: .TP 25
205: TPOPT_PERF_MEAS\fB #\fR
206: Boolean.
207: .IP
208: When \fBtrue\fR, performance measurements will be kept
209: for this connection.
210: When set before a connection is established, the
211: active side will use a locally defined parameter on the
212: connect request packet; if the peer is another ARGO
213: implementation, this will cause performance measurement to be
214: turned on
215: on the passive side as well.
216: See \fItpperf(8)\fR.
217: .TP 25
218: TPOPT_PSTATISTICS\fB\fR
219: No associated value on input.
220: On output, struct tp_pmeas.
221: .IP
222: This command is used to read the performance statistics accumulated
223: during a connection's lifetime.
224: It can only be used with \fIgetsockopt()\fR.
225: The structure it returns is described in \fB<netiso/tp_stat.h>\fR.
226: See \fItpperf(8)\fR.
227: .TP 25
228: TPOPT_FLAGS
229: unsigned integer. [ 0x0 ]
230: .IP
231: This command can only be used with \fIgetsockopt()\fR.
232: See the description of the flags below.
233: .TP 25
234: TPOPT_PARAMS\fB\fR
235: struct tp_conn_param.
236: .IP
237: Used to get or set a group parameters for a connection.
238: The struct tp_conn_param is the argument used with the
239: \fIgetsockopt()\fR or \fIsetsockopt()\fR system call.
240: It is described in
241: \fB<netiso/tp_user.h>\fR.
242: .PP
243: The fields of the \fItp_conn_param\fR structure are
244: described below.
245: .nf
246: .sp 1
247: \fIValues for TPOPT_PARAMS:\fR
248: .fi
249: .TP 25
250: \fBField\fR
251: \fBValue [default]\fR
252: .IP
253: \fBDescription\fR
254: .\" ******************8
255: .TP 25
256: p_Nretrans
257: nonzero short integer [ 1 ]
258: .IP
259: Number of times a TPDU will be retransmitted before the
260: local TP entity closes a connection.
261: .\" ******************8
262: .TP 25
263: p_dr_ticks
264: nonzero short integer [ various ]
265: .IP
266: Number of clock ticks between retransmissions of disconnect request TPDUs.
267: .\" ******************8
268: .TP 25
269: p_dt_ticks
270: nonzero short integer [ various ]
271: .IP
272: Number of clock ticks between retransmissions of data TPDUs.
273: This parameter applies only to class 4.
274: .\" ******************8
275: .TP 25
276: p_cr_ticks
277: nonzero short integer [ various ]
278: .IP
279: Number of clock ticks between retransmissions of connection request TPDUs.
280: .\" ******************8
281: .TP 25
282: p_cc_ticks
283: nonzero short integer [ various ]
284: .IP
285: Number of clock ticks between retransmissions of connection confirm TPDUs.
286: This parameter applies only to class 4.
287: .\" ******************8
288: .TP 25
289: p_x_ticks
290: nonzero short integer [ various ]
291: .IP
292: Number of clock ticks between retransmissions of expedited data TPDUs.
293: This parameter applies only to class 4.
294: .\" ******************8
295: .TP 25
296: p_sendack_ticks
297: nonzero short integer [ various ]
298: .IP
299: Number of clock ticks that the local TP entity
300: will wait before sending an acknowledgment for normal data
301: (not applicable if the acknowlegement strategy is TPACK_EACH).
302: This parameter applies only to class 4.
303: .\" ******************8
304: .TP 25
305: p_ref_ticks
306: nonzero short integer [ various ]
307: .IP
308: Number of clock ticks for which a reference will
309: be considered frozen after the connection to which
310: it applied is closed.
311: This parameter applies to classes 4 and 0 in the
312: ARGO implementation, despite the fact that
313: the frozen reference function is required only for
314: class 4.
315: .\" ******************8
316: .TP 25
317: p_inact_ticks
318: nonzero short integer [ various ]
319: .IP
320: Number of clock ticks without an incoming packet from the peer after which
321: TP close the connection.
322: This parameter applies only to class 4.
323: .\" ******************8
324: .TP 25
325: p_keepalive_ticks
326: nonzero short integer [ various ]
327: .IP
328: nonzero short integer [ various ]
329: Number of clock ticks between acknowledgments that are sent
330: to keep an inactive connection open (to prevent the peer's
331: inactivity control function from closing the connection).
332: This parameter applies only to class 4.
333: .\" ******************8
334: .TP 25
335: p_winsize
336: short integer between 128 and 16384. [4096 bytes]
337: .IP
338: The buffer space limits in bytes for incoming and outgoing data.
339: There is no way to specify different limits for incoming and outgoing
340: paths.
341: The actual window size at any time
342: during the lifetime of a connection
343: is a function of the buffer size limit, the negotiated
344: maximum TPDU size, and the
345: rate at which the user program receives data.
346: This parameter applies only to class 4.
347: .\" ******************8
348: .TP 25
349: p_tpdusize
350: unsigned char between 0x7 and 0xd.
351: [ 0xc for class 4 ] [ 0xb for class 0 ]
352: .IP
353: Log 2 of the maximum TPDU size to be negotiated.
354: The TP standard (ISO 8473) gives an upper bound of
355: 0xd for class 4 and 0xb for class 0.
356: The ARGO implementation places upper bounds of
357: 0xc on class 4 and 0xb on class 0.
358: .\" ******************8
359: .TP 25
360: p_ack_strat
361: TPACK_EACH or TPACK_WINDOW. [ TPACK_WINDOW ]
362: .IP
363: This parameter applies only to class 4.
364: Two acknowledgment strategies are supported:
365: .IP
366: TPACK_EACH means that each data TPDU is acknowledged
367: with an AK TPDU.
368: .IP
369: TPACK_WINDOW
370: means that upon receipt of the packet that represents
371: the high edge of the last window advertised, and AK TPDU is generated.
372: .\" ******************8
373: .TP 25
374: p_rx_strat
375: 4 bit mask
376: [ TPRX_USE_CW | TPRX_FASTSTART over
377: connectionless network protocols ]
378: [ TPRX_USE_CW over
379: connection-oriented network protocols ]
380: .IP
381: This parameter applies only to class 4.
382: The bit mask may include the following values:
383: .IP
384: TPRX_EACH: When a retransmission timer expires, retransmit
385: each packet in the send window rather than
386: just the first unacknowledged packet.
387: .IP
388: TPRX_USE_CW: Use a "congestion window" strategy borrowed
389: from Van Jacobson's congestion window strategy for TCP.
390: The congestion window size is set to one whenever
391: a retransmission occurs.
392: .IP
393: TPRX_FASTSTART: Begin sending the maximum amount of data permitted
394: by the peer (subject to availability).
395: The alternative is to start sending slowly by
396: pretending the peer's window is smaller than it is, and letting
397: it slowly grow up to the real peer's window size.
398: This is to smooth the effect of new connections on a congested network
399: by preventing a transport connection from suddenly
400: overloading the network with a burst of packets.
401: This strategy is also due to Van Jacobson.
402: .\" ******************8
403: .TP 25
404: p_class
405: 5 bit mask
406: [ TP_CLASS_4 | TP_CLASS_0 ]
407: .IP
408: Bit mask including one or both of the values TP_CLASS_4 and TP_CLASS_0.
409: The higher class indicated is the preferred class.
410: If only one class is indicated, negotiation will not occur
411: during connection establishment.
412: .\" ******************8
413: .TP 25
414: p_xtd_format
415: Boolean.
416: [ false ]
417: .IP
418: Boolean indicating that extended format shall be negotiated.
419: This parameter applies only to class 4.
420: .\" ******************8
421: .TP 25
422: p_xpd_service
423: Boolean.
424: [ true ]
425: .IP
426: Boolean indicating that
427: the expedited data transport service will be negotiated.
428: This parameter applies only to class 4.
429: .\" ******************8
430: .TP 25
431: p_use_checksum
432: Boolean.
433: [ true ]
434: .IP
435: Boolean indicating the the use of checksums will be negotiated.
436: This parameter applies only to class 4.
437: .\" ******************8
438: .TP 25
439: p_use_nxpd
440: Reserved for future use.
441: .\" ******************8
442: .TP 25
443: p_use_rcc
444: Reserved for future use.
445: .\" ******************8
446: .TP 25
447: p_use_efc
448: Reserved for future use.
449: .\" ******************8
450: .TP 25
451: p_no_disc_indications
452: Boolean.
453: [ false ]
454: .IP
455: Boolean indicating that the local TP entity shall not issue
456: indications (signals) when a TP connection is disconnected.
457: .\" ******************8
458: .TP 25
459: p_dont_change_params
460: Boolean.
461: [ false ]
462: .IP
463: If \fBtrue\fR the TP entity will not override
464: any of the other values given in this structure.
465: If the values cannot be used, the TP entity will drop, disconnect,
466: or refuse to establish the connection to which this structure pertains.
467: .\" ******************8
468: .TP 25
469: p_netservice
470: One of { ISO_CLNS, ISO_CONS, ISO_COSNS, IN_CLNS }.
471: [ ISO_CLNS ]
472: .IP
473: Indicates which network service is to be used.
474: .IP
475: ISO_CLNS indicates the connectionless network service provided
476: by CLNP (ISO 8473).
477: .IP
478: ISO_CONS indicates the connection-oriented network service provided
479: by X.25 (ISO 8208) and ISO 8878.
480: .IP
481: ISO_COSNS indicates the
482: connectionless network service running over a
483: connection-oriented subnetwork service : CLNP (ISO 8473) over X.25 (ISO 8208).
484: .IP
485: IN_CLNS indicates the
486: DARPA Internet connectionless network service provided by IP (RFC 791).
487: .\" ******************8
488: .TP 25
489: p_dummy
490: Reserved for future use.
491: .sp 1
492: .PP
493: The TPOPT_FLAGS option is used for obtaining
494: various boolean-valued options.
495: Its meaning is as follows.
496: The bit numbering used is that of the RT PC, which means that bit
497: 0 is the most significant bit, while bit 8 is the least significant bit.
498: .nf
499: .sp 1
500: \fIValues for TPOPT_FLAGS:\fR
501: .fi
502: .TP 10
503: \fBBits\fR
504: \fBDescription [Default]\fR
505: .TP 10
506: 0
507: TPFLAG_NLQOS_PDN : set when the quality of the
508: network service is
509: similar to that of a public data network.
510: .TP 10
511: 1
512: TPFLAG_PEER_ON_SAMENET : set when the peer TP entity
513: is considered to be on the same network as the local
514: TP entity.
515: .TP 10
516: 2
517: Not used.
518: .TP 10
519: 3
520: TPFLAG_XPD_PRES : set when expedited data are present
521: [ 0 ]
522: .TP 10
523: 4..7
524: Reserved.
525: .\".TP 10
526: .\"4
527: .\"Reserved.
528: .\".TP 10
529: .\"5
530: .\"TPFLAG_DISC_DATA_IN : read only flag, if set indicates that
531: .\"data from a disconnect TPDU are present.
532: .\".TP 10
533: .\"6
534: .\"Reserved.
535: .\".TP 10
536: .\"7
537: .\"TPFLAG_CONN_DATA_IN : read only flag, if set indicates that
538: .\"data from a connect TPDU are present.
539: .SH "ERROR VALUES
540: .PP
541: The TP entity returns \fIerrno\fR error values as defined in
542: \fB<sys/errno.h>\fR
543: and
544: \fB<netiso/iso_errno.h>\fR.
545: User programs may print messages associated with these value by
546: using an expanded version of \fIperror()\fR
547: found in the ISO library, \fIlibisodir.a\fR.
548: .PP
549: If the TP entity encounters asynchronous events
550: that will cause a transport connection to be closed,
551: such as
552: timing out while retransmitting a connect request TPDU,
553: or receiving a DR TPDU,
554: the TP entity issues a SIGURG signal, indicating that
555: disconnection has occurred.
556: If the signal is issued during a
557: a system call, the system call may be interrupted,
558: in which case the
559: \fIerrno\fR value upon return from the system call is EINTR.
560: If the signal SIGURG
561: is being handled by reading
562: from the socket, and it was a \fIaccept()\fR that
563: timed out, the read may result in ENOTSOCK,
564: because the \fIaccept()\fR call had not yet returned a
565: legitimate socket descriptor when the signal was handled.
566: ETIMEDOUT (or a some other errno value appropriate to the
567: type of error) is returned if SIGURG is blocked
568: for the duration of the system call.
569: A user program should take one of the following approaches:
570: .IP "Block SIGURG." 5
571: If the program is servicing
572: only one connection, it can block or ignore SIGURG during connection
573: establishment.
574: The advantage of this is that the \fIerrno\fR value
575: returned is somewhat meaningful.
576: The disadvantage of this is that
577: if ignored, disconnection and expedited data indications could be
578: missed.
579: For some programs this is not a problem.
580: .IP "Handle SIGURG." 5
581: If the program is servicing more than one connection at a time
582: or expedited data may arrive or both, the program may elect to
583: service SIGURG.
584: It can use the \fIgetsockopt(...TPOPT_FLAGS...)\fR system
585: call to see if the signal
586: was due to the arrival of expedited data or due to a disconnection.
587: In the latter case,
588: \fIgetsockopt()\fR
589: will return ENOTCONN.
590: .SH BUGS
591: .PP
592: The protocol definition of expedited data is slightly problematic,
593: in a way that renders expedited data almost useless,
594: if two or more packets of expedited data are send within
595: time
596: \(*e,
597: where \(*e
598: depends on the application.
599: The problem is not of major significance since most applications
600: do not use transport expedited data.
601: The problem is this:
602: the expedited data acknowledgment TPDU has no field for conveying
603: credit, thus it is not possible for a TP entity to inform its peer
604: that "I received your expedited data but have no room to receive more."
605: The TP entity has the choice of acknowledging receipt of the
606: XPD TPDU
607: .TP 10
608: when the user receives the XPD TSDU
609: which may be a fairly long time,
610: which may cause the sending TP entity to retransmit the packet,
611: and possibly to close the connection after retransmission, or
612: .TP 10
613: when the TP entity receives it
614: so the sending entity does not retransmit or close the connection.
615: If the sending user then tries to send more expedited data
616: "soon", the expedited data will not be acknowledged (until the
617: receiving user receives the first XPD TSDU).
618: .PP
619: The ARGO implementation acknowledges XPD TPDUs immediately,
620: in the hope that most users will not use expedited data requently
621: enough for this to be a problem.
622: .SH SEE ALSO
623: .PP
624: tcp(4),
625: netstat(1),
626: iso(4), clnp(4),
627: cltp(4),
628: ifconfig(8).
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.