Information Technology Reference
In-Depth Information
Error detection and recovery - each packet has a checksum, which is checked by the
receiver. If it is incorrect the receiver discards it, and can use the acknowledgements
to indicate the retransmission of the packets.
Flow control - TCP returns a window with every ACK. This window indicates a range
of acceptable sequence numbers beyond the last segment successfully received. This
window also indicates the number of bytes that the sender can transmit before receiving
further acknowledgements.
Multiplexing - to support multiple connections to a single host, TCP provides a set of
ports within each host. This, along with the IP addresses of the source and destination,
makes a socket. Each connection is uniquely identified by a pair of sockets. Ports are
normally associated with various services and allow service programs to listen for de-
fined port numbers.
Connections - a connection is defined by the sockets, sequence numbers and window
sizes. Each host must maintain this information for the length of the connection. When
the connection is closed, all associated resources are freed. As TCP connections can be
made with unreliable hosts and over unreliable communication channels, TCP uses a
handshake mechanism with clock-based sequence numbers to avoid inaccurate connec-
tion initialisation.
Precedence and security - TCP allows for different security and precedence levels.
TCP information contains simple acknowledgement messages and a set of sequential num-
bers. It also supports multiple simultaneous connections using destination and source port
numbers, and manages them for both transmission and reception. As with IP, it supports data
fragmentation and reassembly, and data multiplexing/demultiplexing.
The set-up and operation of TCP is as follows:
1. When a host wishes to make a connection, TCP sends out a request message to the desti-
nation machine that contains unique numbers called a socket number, and a port number.
The port number has a value which is associated with the application (for example a
TELNET connection has the port number 23 and an FTP connection has the port number
21). The message is then passed to the IP layer, which assembles a datagram for trans-
mission to the destination.
2. When the destination host receives the connection request, it returns a message contain-
ing its own unique socket number and a port number. The socket number and port num-
ber thus identify the virtual connection between the two hosts.
3. After the connection has been made the data can flow between the two hosts (called a
data stream).
After TCP receives the stream of data, it assembles the data into packets, called TCP seg-
ments. After the segment has been constructed, TCP adds a header (called the protocol data
unit) to the front of the segment. This header contains information such as a checksum, the
port number, the destination and source socket numbers, the socket number of both machines
and segment sequence numbers. The TCP layer then sends the packaged segment down to
the IP layer, which encapsulates it and sends it over the network as a datagram.
24.2.1 Ports and sockets
As previously mentioned, TCP adds a port number and socket number for each host. The
port number identifies the required service, whereas the socket number is a unique number
Search WWH ::




Custom Search