Operating in the Transport layer of the OSI model
, TCP is a connection-oriented protocol, not only providing flow control but also ensuring data delivery through sequencing and checksums.
The figure below depicts the format of a TCP segment, the entity that becomes encapsulated by the
IP datagram in the Network layer (and thus becomes the IP datagram’s “data”).

The above depicted fields of the TCP segment are described as follows:
-
Source port: Indicating the port # at the source node, a port is address on
a host, which an application makes itself available to for incoming or outgoing data.
-
-
Sequence #: 32 bits long, it identifies the data segment’s position in the data stream segments already sent.
-
-
header length: The length of the TCP header held in a 4 bits long field.
-
Reserved: A 6-bit field reserved for later use.
-
Flags: A collection of six 1-bit fields that signal special conditions through flags.
-
Sliding-window size: A 16 bits long field, it indicates how many bytes the sender can issue to
a receiver while acknowledgment for this segment is outstanding. This is where flow control is done, preventing the receiver from being deluged with bytes.
-
Checksum: A 16 bits long field that allows the receiving node to determine whether the TCP segment
became corrupted during transmission.
-
Urgent pointer: A 16 bits long field which can indicate a location in the data field where urgent data resides.
This field is 16 bits long.
-
Options: Used to specify special options, such as the maximum segment size a network
can handle. The size of this field can vary between 0 and 32 bits.
-
Padding: Contains filler information to ensure that the size of the TCP header is a
multiple of 32 bits. The size of this field varies; it is often 0.
-
Data: Contains original data from the source node. The size of the Data field
depends on how much data needs to be transmitted, the constraints on the TCP
segment size imposed by the network type, and the limitation that the segment must
fit within an IP datagram.
|