Thursday, February 13, 2014

Transmission Control Protocol

Transmission Control Protocol (TCP) supports the network at the transport layer. Transmission Control
Protocol (TCP) provides a reliable connection oriented service. Connection oriented means both the
client and server must open the connection before data is sent. TCP is defined by RFC 793 and 1122.
TCP provides:
  • End to end reliability.
  • Data packet re sequencing.
  • Flow control.
TCP relies on the IP service at the network layer to deliver data to the host. Since IP is not reliable with regard to message quality or delivery, TCP must make provisions to be sure messages are delivered on time and correctly (Federal Express?).

TCP Message Format

The format of the TCP header is as follows:
 
1. Source port number (16 bits)
 
2. Destination port number (16 bits)
 
3. Sequence number (32 bits) - The byte in the data stream that the first byte of this packet
represents.
 
4. Acknowledgement number (32 bits) - Contains the next sequence number that the sender of the
acknowledgement expects to receive which is the sequence number plus 1 (plus the number of
bytes received in the last message?). This number is used only if the ACK flag is on.
 
5. Header length (4 bits) - The length of the header in 32 bit words, required since the options field
is variable in length.
 
6. Reserved (6 bits)
 
7. URG (1 bit) - The urgent pointer is valid.
 
8. ACK (1 bit) - Makes the acknowledgement number valid.
 
9. PSH (1 bit) - High priority data for the application.
 
10. RST (1 bit) - Reset the connection.
 
11. SYN (1 bit) - Turned on when a connection is being established and the sequence number field
will contain the initial sequence number chosen by this host for this connection.
 
12. FIN (1 bit) - The sender is done sending data.
 
13. Window size (16 bits) - The maximum number of bytes that the receiver will to accept.
 
14. TCP checksum (16 bits) - Calculated over the TCP header, data, and TCP pseudo header.
 
15. Urgent pointer (16 bits) - It is only valid if the URG bit is set. The urgent mode is a way to
transmit emergency data to the other side of the connection. It must be added to the sequence
number field of the segment to generate the sequence number of the last byte of urgent data.

16. Options (variable length)
The header is followed by data. TCP data is full duplex.

No comments: