|
| |

Notes:
Although TCP supports full, duplex, byte-stream-oriented communication between processes the data stream must still be broken into segments that can be encapsulated in IP datagrams. Each segment has control information attached and is then transmitted in an IP datagram.
The SOURCE PORT and DESTINATION PORT identify the sending and receiving applications.
The SEQUENCE NUMBER indicates the position of this segment in the data stream. The sender and receiver synchronise the sequence number during connection establishment (see TCP Handshaking). The TCP layer will reject incoming segments with incorrect sequence numbers, these can either be from an old connection using the same 4-tuple or (as a mild security side-effect) from a hacker attack masquerading as a trust services.
In order for the sender to ensure that the receiver has successfully received its data, the receiver will use the ACKNOWLEDGEMENT NUMBER. This indicates how much of the data stream has been received successfully. The acknowledgment of data is usually “piggybacked” onto the next segment of data sent in the other direction. The ACKNOWLEDGEMENT NUMBER in this segment is valid only if the ACK bit in the CODE BITS field is set.
Flags for certain control purposes (reset, synchronise, finish, etc.) are set in the CODE BITS field.
The WINDOW field indicates how many bytes the receiver can accept (see TCP Flow Control).
The CHECKSUM covers the data in the segment, its header and also the source and destination IP addresses and protocol value from the IP address. In a similar way to UDP, if the receiver detects that the datagram has been corrupted it discards it. However, TCP has built-in mechanisms for re-sending data that has not been acknowledged. This ensures that the data will definitely arrive.
|