1 .\" $NetBSD: tp.4,v 1.16 2003/08/07 10:31:04 agc Exp $
3 .\" Copyright (c) 1990, 1991, 1993
4 .\" The Regents of the University of California. All rights reserved.
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\" notice, this list of conditions and the following disclaimer.
11 .\" 2. Redistributions in binary form must reproduce the above copyright
12 .\" notice, this list of conditions and the following disclaimer in the
13 .\" documentation and/or other materials provided with the distribution.
14 .\" 3. Neither the name of the University nor the names of its contributors
15 .\" may be used to endorse or promote products derived from this software
16 .\" without specific prior written permission.
18 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
19 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
22 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 .\" @(#)tp.4 8.4 (Berkeley) 4/19/94
42 .In netiso/iso_errno.h
46 .Fn socket "[AF_INET, AF_ISO]" SOCK_SEQPACKET 0
50 protocol provides reliable, flow-controlled, two-way
51 transmission of data and record boundaries.
52 It is a byte-stream protocol and is accessed according to
58 protocol makes use of a standard
61 including a Network Service Access Point, and a Transport Service Entity
63 Subclass 4 may make use of the
64 Internet address format.
66 Sockets using the TP protocol are either
70 Active sockets initiate connections to passive
73 sockets are created active; to create a
76 system call must be used
77 after binding the socket with the
80 passive sockets may use the
82 call to accept incoming connections. Only active sockets may
85 call to initiate connections.
89 their location to match
90 incoming connection requests from multiple networks. This
92 .Dq wildcard addressing ,
94 server to provide service to clients on multiple networks.
95 To create a socket which listens on all networks, the
98 of the bound address must be void (of length zero).
99 The Transport Selector may still be specified
100 at this time; if the port is not specified the system will assign one.
101 Once a connection has been established the socket's address is
102 fixed by the peer entity's location. The address assigned the
103 socket is the address associated with the network interface
104 through which packets are being transmitted and received.
108 Transport Protocol implemented for
110 at the University of Wisconsin - Madison,
111 and modified for inclusion in the Berkeley Software Distribution,
112 includes classes 0 and 4
117 the June 1986 version of
120 Class 4 of the protocol provides reliable, sequenced,
121 flow-controlled, two-way
122 transmission of data packets with an alternative stop-and-wait data path called
123 the "expedited data" service.
124 Class 0 is essentially a null transport protocol, which is used
125 when the underlying network service provides reliable, sequenced,
126 flow-controlled, two-way data transmission.
127 Class 0 does not provide the expedited data service.
128 The protocols are implemented as a single transport layer entity
129 that coexists with the Internet protocol suite.
130 Class 0 may be used only in the
133 Class 4 may be used in the Internet domain as well as in the
137 Two system calls were modified from the previous
138 release of the Berkeley Software Distribution
139 to permit the support of the end-of-transport-service-data-unit
141 indication, and for the receipt and transmission of user
142 connect, confirm, and disconnect data.
147 and further discussion
148 below for the formats of the data in the ancillary data buffer.
151 is not needed, the normal
155 system calls may be used.
163 supports several options
164 to control such things as negotiable options
165 in the protocol and protocol strategies.
166 The options are defined in
167 .Aq Pa netiso/tp_user.h ,
168 and are described below.
171 the options marked with a pound sign
175 after a connection is established.
176 Others must be used before the connection is established, in other
177 words, before calling
181 All options may be used
184 before or after a connection is established.
185 .Bl -tag -width TPOPT_PSTATISTICS
186 .It Dv TPOPT_CONN_DATA
191 The passive user may issue a
193 call to retrieve a connection request's user data,
194 after having done the
196 system call without implying confirmation of the connection.
198 The data may also be retrieved by issuing a
200 request for ancillary data only,
201 without implying confirmation of the connection.
212 .It Dv TPOPT_DISC_DATA \&#
217 Disconnect data may be sent by the side initiating the close
218 but not by the passive side ("passive" with respect to the closing
219 of the connection), so there is no need to read disconnect data
222 This may be sent by a
224 system call, or by issuing a
226 request specifying ancillary data only.
237 Sending of disconnect data will in of itself tear down (or reject)
239 .It Dv TPOPT_CFRM_DATA \&#
242 Data to send when confirming a connection.
243 This may also be sent by a
245 system call, or by issuing a
248 Sending of connect confirm data will cause the connection
249 to be confirmed rather than rejected.
250 .It Dv TPOPT_PERF_MEAS \&#
254 performance measurements will be kept
256 When set before a connection is established, the
257 active side will use a locally defined parameter on the
258 connect request packet; if the peer is another
260 implementation, this will cause performance measurement to be
262 on the passive side as well.
265 .It Dv TPOPT_PSTATISTICS
266 No associated value on input.
268 .Ar struct tp_pmeas .
270 This command is used to read the performance statistics accumulated
271 during a connection's lifetime.
272 It can only be used with
274 The structure it returns is described in
275 .Aq Pa netiso/tp_stat.h .
279 unsigned integer. [0x0]
281 This command can only be used with
283 See the description of the flags below.
285 .Ar struct tp_conn_param
287 Used to get or set a group parameters for a connection.
289 .Ar struct tp_conn_param
290 is the argument used with the
296 .Aq Pa netiso/tp_user.h .
304 .Em Values for TPOPT_PARAMS :
305 .Bl -tag -width p_sendack_ticks
307 nonzero short integer [1]
309 Number of times a TPDU
310 will be retransmitted before the
311 local TP entity closes a connection.
313 nonzero short integer [various]
315 Number of clock ticks between retransmissions of disconnect request
318 nonzero short integer [various]
320 Number of clock ticks between retransmissions of data
322 This parameter applies only to class 4.
324 nonzero short integer [various]
326 Number of clock ticks between retransmissions of connection request
329 nonzero short integer [various]
331 Number of clock ticks between retransmissions of connection confirm
333 This parameter applies only to class 4.
335 nonzero short integer [various]
337 Number of clock ticks between retransmissions of expedited data
339 This parameter applies only to class 4.
340 .It Ar p_sendack_ticks
341 nonzero short integer [various]
343 Number of clock ticks that the local TP entity
344 will wait before sending an acknowledgment for normal data
345 (not applicable if the acknowledgement strategy is
347 This parameter applies only to class 4.
349 nonzero short integer [various]
351 Number of clock ticks for which a reference will
352 be considered frozen after the connection to which
353 it applied is closed.
354 This parameter applies to classes 4 and 0 in the
356 implementation, despite the fact that
357 the frozen reference function is required only for
360 nonzero short integer [various]
362 Number of clock ticks without an incoming packet from the peer after which
364 close the connection.
365 This parameter applies only to class 4.
366 .It Ar p_keepalive_ticks
367 nonzero short integer [various]
369 Number of clock ticks between acknowledgments that are sent
370 to keep an inactive connection open (to prevent the peer's
371 inactivity control function from closing the connection).
372 This parameter applies only to class 4.
374 short integer between 128 and 16384. [4096 bytes]
376 The buffer space limits in bytes for incoming and outgoing data.
377 There is no way to specify different limits for incoming and outgoing
379 The actual window size at any time
380 during the lifetime of a connection
381 is a function of the buffer size limit, the negotiated
384 rate at which the user program receives data.
385 This parameter applies only to class 4.
387 unsigned char between 0x7 and 0xd.
388 [0xc for class 4] [0xb for class 0]
390 Log 2 of the maximum TPDU size to be negotiated.
395 8473) gives an upper bound of
396 0xd for class 4 and 0xb for class 0.
399 implementation places upper bounds of
400 0xc on class 4 and 0xb on class 0.
407 This parameter applies only to class 4.
408 Two acknowledgment strategies are supported:
410 .Dv TPACK_EACH means that each data TPDU
415 means that upon receipt of the packet that represents
416 the high edge of the last window advertised, an AK TPDU is generated.
419 .Bq Dv TPRX_USE_CW No \&|\ Dv TPRX_FASTSTART
421 connectionless network protocols]
424 connection-oriented network protocols]
426 This parameter applies only to class 4.
427 The bit mask may include the following values:
430 When a retransmission timer expires, retransmit
431 each packet in the send window rather than
432 just the first unacknowledged packet.
435 Use a "congestion window" strategy borrowed
436 from Van Jacobson's congestion window strategy for TCP.
437 The congestion window size is set to one whenever
438 a retransmission occurs.
441 Begin sending the maximum amount of data permitted
442 by the peer (subject to availability).
443 The alternative is to start sending slowly by
444 pretending the peer's window is smaller than it is, and letting
445 it slowly grow up to the peer window's real size.
446 This is to smooth the effect of new connections on a congested network
447 by preventing a transport connection from suddenly
448 overloading the network with a burst of packets.
449 This strategy is also due to Van Jacobson.
452 .Bq Dv TP_CLASS_4 No \&|\ Dv TP_CLASS_0
454 Bit mask including one or both of the values
458 The higher class indicated is the preferred class.
459 If only one class is indicated, negotiation will not occur
460 during connection establishment.
465 Boolean indicating that extended format is negotiated.
466 This parameter applies only to class 4.
471 Boolean indicating that
472 the expedited data transport service will be negotiated.
473 This parameter applies only to class 4.
474 .It Ar p_use_checksum
478 Boolean indicating the use of checksums will be negotiated.
479 This parameter applies only to class 4.
481 Reserved for future use.
483 Reserved for future use.
485 Reserved for future use.
486 .It Ar p_no_disc_indications
490 Boolean indicating that the local
492 entity will not issue
493 indications (signals) when a
495 connection is disconnected.
496 .It Ar p_dont_change_params
503 entity will not override
504 any of the other values given in this structure.
505 If the values cannot be used, the
507 entity will drop, disconnect,
508 or refuse to establish the connection to which this structure pertains.
517 Indicates which network service is to be used.
520 indicates the connectionless network service provided
526 indicates the connection-oriented network service provided
535 connectionless network service running over a
536 connection-oriented subnetwork service: CLNP
544 DARPA Internet connectionless network service provided by IP (RFC 791).
546 Reserved for future use.
551 option is used for obtaining
552 various boolean-valued options.
553 Its meaning is as follows.
554 The bit numbering used is that of the RT PC, which means that bit
555 0 is the most significant bit, while bit 8 is the least significant bit.
557 .Em Values for TPOPT_FLAGS :
558 .Bl -tag -width Bitsx
560 .Sy Description [Default]
562 .Dv TPFLAG_NLQOS_PDN :
563 set when the quality of the
565 similar to that of a public data network.
567 .Dv TPFLAG_PEER_ON_SAMENET :
571 is considered to be on the same network as the local
577 .Dv TPFLAG_XPD_PRES :
578 set when expedited data are present
588 error values as defined in
591 .Aq Pa netiso/iso_errno.h .
592 .\" User programs may print messages associated with these value by
593 .\" using an expanded version of
598 .\" .Pa libisodir.a .
602 entity encounters asynchronous events
603 that will cause a transport connection to be closed,
605 timing out while retransmitting a connect request TPDU,
606 or receiving a DR TPDU,
611 signal, indicating that
612 disconnection has occurred.
613 If the signal is issued during a system call, the system call
614 may be interrupted, in which case the
616 value upon return from the system call is
620 is being handled by reading
621 from the socket, and it was an
624 timed out, the read may result in
628 call had not yet returned a
629 legitimate socket descriptor when the signal was handled.
631 (or a some other errno value appropriate to the
632 type of error) is returned if
635 for the duration of the system call.
636 A user program should take one of the following approaches:
639 If the program is servicing
640 only one connection, it can block or ignore
644 The advantage of this is that the
647 returned is somewhat meaningful.
648 The disadvantage of this is that
649 if ignored, disconnection and expedited data indications could be
651 For some programs this is not a problem.
653 If the program is servicing more than one connection at a time
654 or expedited data may arrive or both, the program may elect to
658 .Fn getsockopt ...TPOPT_FLAGS...
659 system call to see if the signal
660 was due to the arrival of expedited data or due to a disconnection.
674 The protocol definition of expedited data is slightly problematic,
675 in a way that renders expedited data almost useless,
676 if two or more packets of expedited data are sent within
677 time epsilon, where epsilon depends on the application.
678 The problem is not of major significance since most applications
679 do not use transport expedited data.
680 The problem is this: the expedited data acknowledgment TPDU has
681 no field for conveying credit, thus it is not possible for a
683 entity to inform its peer
684 that "I received your expedited data but have no room to receive more."
687 entity has the choice of acknowledging receipt of the
690 .It "when the user receives the" XPD TSDU
691 which may be a fairly long time, which may cause the sending
693 entity to retransmit the packet,
694 and possibly to close the connection after retransmission, or
695 .It "when the" Tn TP No "entity receives it"
696 so the sending entity does not retransmit or close the connection.
697 If the sending user then tries to send more expedited data
699 the expedited data will not be acknowledged (until the
700 receiving user receives the first XPD TSDU).
705 implementation acknowledges XPD TPDUs immediately, in the hope that
706 most users will not use expedited data frequently enough for this