- Asked 2/11
- 2074 Asoj · 5 marks
- 2070 Asar · 4 marks
TCP header and its fields
Short answer
TCP is a connection-oriented, reliable, byte-stream transport protocol. Its header (20–60 bytes) contains source/destination ports, 32-bit sequence and acknowledgement numbers for ordering/reliability, flags (SYN, FIN, ACK etc.), window size for flow control, checksum, and optional MSS.
Explain the TCP protocol with its header (structure of the TCP header and the purpose of its fields).
TCP is a connection-oriented, reliable, byte-stream transport protocol (RFC 793). It provides full-duplex communication, sequence numbering, acknowledgements, retransmission, flow control (sliding window), congestion control and error checking. Data from the application is divided into segments; each segment has a TCP header followed by data.
TCP header (20 bytes minimum, 60 maximum)
0 15 16 31
+-----------------+-----------------+
| Source port | Destination port|
+-----------------+-----------------+
| Sequence number (32) |
+-----------------------------------+
| Acknowledgement number (32) |
+------+-----+------+---------------+
| HLEN | Rsv | Flags| Window size |
+------+-----+------+---------------+
| Checksum | Urgent pointer |
+-----------------+-----------------+
| Options (0-40 bytes) + padding |
+-----------------------------------+
| Data |
+-----------------------------------+
Fields
| Field | Size | Purpose |
|---|---|---|
| Source port | 16 | Port of sending application |
| Destination port | 16 | Port of receiving application |
| Sequence number | 32 | Number of the first data byte in the segment |
| Acknowledgement number | 32 | Next byte expected by the receiver |
| HLEN (data offset) | 4 | Header length in 32-bit words (5 to 15) |
| Reserved | 6 | Future use |
| Flags | 6 | URG, ACK, PSH, RST, SYN, FIN |
| Window size | 16 | Receiver's available buffer (flow control) |
| Checksum | 16 | Error detection over header, data and pseudo-header |
| Urgent pointer | 16 | Offset of urgent data when URG is set |
| Options | up to 40 B | MSS, window scale, timestamps, SACK |
Flags
- URG: urgent pointer is valid. ACK: acknowledgement number is valid. PSH: deliver data to the application immediately.
- RST: reset the connection. SYN: open a connection (synchronise sequence numbers). FIN: close the connection.
✓ Answer checked by Claude Opus 5.5 (high effort)
Related questions
- Compare IPv6/IPv4 headers; migration · Computer Networks and Security, chapter 7 · asked 2×
- Why two transport protocols exist · Computer Networks and Security, chapter 5
- UNIX goals; NFS protocol and structure · Operating System, chapter 5
- SS7 protocol structure · Telecommunications, chapter 5
- Types and purpose of admixtures · Concrete Technology and Masonry Structure, chapter 1 · asked 7×
- Red-Black tree and its purpose · Data Structure and Algorithm, chapter 6 · asked 2×