int
socket(
[AF_INET, AF_ISO]
, SOCK_SEQPACKET
, 0
)
SOCK_SEQPACKET
abstraction.
The
TP
protocol makes use of a standard
ISO
address format,
including a Network Service Access Point, and a Transport Service Entity
Selector.
Subclass 4 may make use of the
Internet address format.
Sockets using the TP protocol are either ``active'' or ``passive''. Active sockets initiate connections to passive sockets. By default TCP sockets are created active; to create a passive socket the listen(2) system call must be used after binding the socket with the bind(2) system call. Only passive sockets may use the accept(2) call to accept incoming connections. Only active sockets may use the connect(2) call to initiate connections.
Passive sockets may ``underspecify'' their location to match incoming connection requests from multiple networks. This technique, termed ``wildcard addressing'', allows a single server to provide service to clients on multiple networks. To create a socket which listens on all networks, the NSAP portion of the bound address must be void (of length zero). The Transport Selector may still be specified at this time; if the port is not specified the system will assign one. Once a connection has been established the socket's address is fixed by the peer entity's location. The address assigned the socket is the address associated with the network interface through which packets are being transmitted and received.
The ISO Transport Protocol implemented for AOS R2 at the University of Wisconsin - Madison, and modified for inclusion in the Berkeley Software Distribution, includes classes 0 and 4 of the ISO transport protocols as specified in the June 1986 version of IS 8073. Class 4 of the protocol provides reliable, sequenced, flow-controlled, two-way transmission of data packets with an alternative stop-and-wait data path called the "expedited data" service. Class 0 is essentially a null transport protocol, which is used when the underlying network service provides reliable, sequenced, flow-controlled, two-way data transmission. Class 0 does not provide the expedited data service. The protocols are implemented as a single transport layer entity that coexists with the Internet protocol suite. Class 0 may be used only in the ISO domain. Class 4 may be used in the Internet domain as well as in the ISO domain.
Two system calls were modified from the previous
release of the Berkeley Software Distribution
to permit the support of the end-of-transport-service-data-unit
(EOTSDU
)
indication, and for the receipt and transmission of user
connect, confirm, and disconnect data.
See
sendmsg(2)
and
recvmsg(2),
and further discussion
below for the formats of the data in the ancillary data buffer.
If the
EOTSDU
is not needed, the normal
read(2)
and
write(2)
system calls may be used.
Through the
getsockopt(2)
and
setsockopt(2)
system calls,
TP
supports several options
to control such things as negotiable options
in the protocol and protocol strategies.
The options are defined in
<netiso/tp_user.h
>,
and are described below.
In the tables below, the options marked with a pound sign `#' may be used with setsockopt(2) after a connection is established. Others must be used before the connection is established, in other words, before calling connect(2) or accept(2). All options may be used with getsockopt(2) before or after a connection is established.
TPOPT_CONN_DATA
The data may also be retrieved by issuing a
recvmsg(2)
request for ancillary data only,
without implying confirmation of the connection.
The returned
cmsghdr
will contain
SOL_TRANSPORT
for the
csmg_level
and
TPOPT_CONN_DATA
for
cmsg_type.
TPOPT_DISC_DATA
#
SOL_TRANSPORT
for
csmg_level
and
TPOPT_DISC_DATA
for
cmsg_type.
Sending of disconnect data will in of itself tear down (or reject)
the connection.
TPOPT_CFRM_DATA
#
TPOPT_PERF_MEAS
#
TPOPT_PSTATISTICS
This command is used to read the performance statistics accumulated
during a connection's lifetime.
It can only be used with
getsockopt(2).
The structure it returns is described in
<netiso/tp_stat.h
>.
TPOPT_FLAGS
TPOPT_PARAMS
netiso/tp_user.h
>.
The fields of the tp_conn_param structure are described below.
Values for TPOPT_PARAMS:
TPACK_EACH
).
This parameter applies only to class 4.
TPACK_EACH
or
TPACK_WINDOW
.
[
TPACK_WINDOW
]
TPACK_EACH
means
that
each
data
TPDU
is acknowledged
with an AK TPDU.
TPACK_WINDOW
means that upon receipt of the packet that represents
the high edge of the last window advertised, an AK TPDU is generated.
TPRX_USE_CW
|
TPRX_FASTSTART
]
over
connectionless network protocols]
[
TPRX_USE_CW
over
connection-oriented network protocols]
TPRX_EACH
:
When a retransmission timer expires, retransmit
each packet in the send window rather than
just the first unacknowledged packet.
TPRX_USE_CW
:
Use a "congestion window" strategy borrowed
from Van Jacobson's congestion window strategy for TCP.
The congestion window size is set to one whenever
a retransmission occurs.
TPRX_FASTSTART
:
Begin sending the maximum amount of data permitted
by the peer (subject to availability).
The alternative is to start sending slowly by
pretending the peer's window is smaller than it is, and letting
it slowly grow up to the peer window's real size.
This is to smooth the effect of new connections on a congested network
by preventing a transport connection from suddenly
overloading the network with a burst of packets.
This strategy is also due to Van Jacobson.
TP_CLASS_4
|
TP_CLASS_0
]
TP_CLASS_4
and
TP_CLASS_0
.
The higher class indicated is the preferred class.
If only one class is indicated, negotiation will not occur
during connection establishment.
Boolean indicating that the local TP entity will not issue indications (signals) when a TP connection is disconnected.
ISO_CLNS
,
ISO_CONS
,
ISO_COSNS
,
IN_CLNS
}.
[
ISO_CLNS
]
ISO_CLNS
indicates the connectionless network service provided
by CLNP
(ISO
8473).
ISO_CONS
indicates the connection-oriented network service provided
by X.25
(ISO
8208) and
ISO
8878.
ISO_COSNS
indicates the
connectionless network service running over a
connection-oriented subnetwork service: CLNP
(ISO
8473) over X.25
(ISO
8208).
IN_CLNS
indicates the
DARPA Internet connectionless network service provided by IP (RFC 791).
The
TPOPT_FLAGS
option is used for obtaining
various boolean-valued options.
Its meaning is as follows.
The bit numbering used is that of the RT PC, which means that bit
0 is the most significant bit, while bit 8 is the least significant bit.
Values for TPOPT_FLAGS:
TPFLAG_NLQOS_PDN
:
set when the quality of the
network service is
similar to that of a public data network.
TPFLAG_PEER_ON_SAMENET
:
set when the peer
TP
entity
is considered to be on the same network as the local
TP
entity.
TPFLAG_XPD_PRES
:
set when expedited data are present
[0]
sys/errno.h
>
and
<
netiso/iso_errno.h
>.
If the
TP
entity encounters asynchronous events
that will cause a transport connection to be closed,
such as
timing out while retransmitting a connect request TPDU,
or receiving a DR TPDU,
the
TP
entity issues a
SIGURG
signal, indicating that
disconnection has occurred.
If the signal is issued during a system call, the system call
may be interrupted, in which case the
errno
value upon return from the system call is
EINTR
.
If the signal
SIGURG
is being handled by reading
from the socket, and it was an
accept(2)
that
timed out, the read may result in
ENOTSOCK
,
because the
accept(2)
call had not yet returned a
legitimate socket descriptor when the signal was handled.
ETIMEDOUT
(or a some other errno value appropriate to the
type of error) is returned if
SIGURG
is blocked
for the duration of the system call.
A user program should take one of the following approaches:
SIGURG
SIGURG
during connection
establishment.
The advantage of this is that the
errno
value
returned is somewhat meaningful.
The disadvantage of this is that
if ignored, disconnection and expedited data indications could be
missed.
For some programs this is not a problem.
SIGURG
SIGURG
.
It can use the
getsockopt(
...TPOPT_FLAGS...
)
system call to see if the signal
was due to the arrival of expedited data or due to a disconnection.
In the latter case,
getsockopt(2)
will return
ENOTCONN
.
The ARGO implementation acknowledges XPD TPDUs immediately, in the hope that most users will not use expedited data frequently enough for this to be a problem.