You are on page 1of 2

TCP IP Users Guide

May 1982
Introduction to TCP

The TCP allows two processes to create a connection in order


to exchange zero or more octets of data, where an octet consists
of eight data bits. A connection is uniquely specified by the
48-bit identifiers of its local and foreign ends. The 48-bit
identifier is composed of a 32-bit internet address, which
identifies the host, and a 16-bit port number, which identifies a
process at that host. Since connections are full-duplex, each
end may both send and receive data.
TCP data transfer has high reliability: both the headers and all
data octets are checksummed. If a packet is received and its
checksum is not correct, it is immediately discarded.
Each octet of data is conceptually assigned a 32-bit sequence
number. The sequence numbers are used by the receiver to discard
duplicated packets and to detect lost, or out-of-sequence
packets. The receipt of data is acknowledged by returning to the
sender the sequence number of the next octet the receiver wants
to receive; this implies that all lower numbered octets have
been received.
The sender continues to retransmit data until it is
acknowledged. The retransmission rate is a user-specified
parameter. If data unacknowledged for a period of time, the
connection is broken and the user is notified of a Transmission
Timeout error. This time period is also specified by the user.
TCP automatically provides flow control for each connection.
The data receiving TCP periodically notifies the sending TCP of
the number of additional data octets it is willing to accept (the
"window"). This number is based on the amount of buffer space
available at the receiving TCP. The sending TCP is not to exceed
this window.
The TOPS20 monitor has nine TCP related JSYSi which will be
explained in following sections. They are:
OPEN,
SEND,
RECV,
CLOSE,
ABORT,
STAT,
CHANL,
ATNVT,
SCSLV,

to
to
to
to
to
to
to
to
to

specify the ends of, and synchronize, a connection;


send data to the foreign end;
receive data from the foreign end;
begin closing a connection;
break a connection;
obtain status information about a connection or TCP;
specify interrupt channels;
translate a connection into an NVT descriptor; and
specify security levels.

- 3 -

TCP IP Users Guide


Creating a TCP Connection

May 1982

A connection is created by passing the address of a Connection


Descriptor block (which identifies the two ends of the
connection), a Transmission Timeout, and a Retransmission
Parameters word to the OPEN JSYS. A successful OPEN will return
a Job Connection Number or "JCN". The JCN is a small
job-relative number which is given to the other JSYSi to identify
the connection. (The use of a JCN with the TCP JSYSi is
analogous to the use of JFNs with the file system JSYSi. The DEC
user interface uses JFNs and file system JSYSi instead of the
JSYSi documented here.)
Each connection must be unique. This is guaranteed by the
selection of a 16-bit local port value. Unfortunately, there is
no easy way to find which port values are unused other than by
trial and error. Use of local port values less than 256 is
discouraged as they have been reserved for "well known"
functions. A suggested local port value contains the user's job
number in the left-most 8 bits and anything else in the
right-most 8 bits. If the connection is not unique, OPEN will
return a Connection Already Exists error and another local port
value should be selected and tried.
There are three basic ways to specify a connection. They are
a fully specified active open, a fully specified passive open,
and a partially wild passive open.
A fully specified active open is used to initiate a
connection; the identifier of the foreign end of the connection
must be known. In this case, the Connection Descriptor block
contains a non-zero, 16-bit local port; the foreign host's 32-bit
internet address; and the 16-bit foreign port. The TCP%FS flag
must also be set. It causes a SYN packet to be sent to the
foreign host/port specified in the Connection Descriptor block.
If the SYN packet is acknowledged and a SYN is received from the
foreign TCP, the connection is synchronized and OPEN succeeds.
If the foreign end of the connection does not exist, a RESET will
be returned causing the OPEN to fail.
A fully specified passive open is used to wait for a
connection request from a particular foreign TCP.
If a
connection with a specific foreign host and port is desired, the
Connection Descriptor block specifies the desired local port,
foreign host, and foreign port. The TCP%FS flag is not set. In
this case, no SYN packet will be sent. TCP will wait
indefinitely until a SYN (or RESET) packet is received from the
foreign TCP. When a SYN is received, an acknowledgement/SYN
packet is returned to the foreign TCP; its acknowledgement of the
SYN successfully opens the connection.

You might also like