Back to the 2020 paper

Module 4: Transport Layer & Congestion Control

20207m

Show the entries for the header of a TCP segment that carries a message from an FTP client to an FTP server. Fill the checksum field with Os. Choose an appropriate ephemeral port number and the correct well-known port number. The length of the data is 40 bytes.

Worked SolutionAI Assisted

TCP Header for an FTP Client → Server Message

Ports chosen

  • Well-known port (destination) = 21 — FTP control connection is always terminated at port 21 on the server.
  • Ephemeral port (source) = 52345 — any unused port in the dynamic/private range 49152–65535 chosen by the client (e.g. 15151 or 52345 are both acceptable).

Lengths

  • TCP header with no options = 5 words × 4 = 20 bytes → Data Offset = 5.
  • Data = 40 bytes → total segment length = 20 + 40 = 60 bytes; total TCP length field in IP = 60.
  • Checksum field is filled with 0000 as instructed (in real transmission it would be computed over the pseudo-header + TCP header + data).

Header entries

# Field Value Notes
1 Source Port 52345 ephemeral port (client)
2 Destination Port 21 FTP well-known port (server)
3 Sequence Number 1000 (example) sequence number of first data byte
4 Acknowledgment Number 5000 (example) next byte expected from server
5 Data Offset 5 20-byte header, no options
6 Reserved 0 3 bits (4 bits + 4-bit NS in some texts)
7 Control Bits URG=0, ACK=1, PSH=1, RST=0, SYN=0, FIN=0 acknowledging earlier data + pushing this data
8 Window 8192 advertised receive window (example)
9 Checksum 0x0000 all zeros, as specified
10 Urgent Pointer 0 URG bit is 0, field not used
11 Options none Data Offset stays 5 (20 bytes)
12 Data (payload) 40 bytes e.g. an FTP command or file block
 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|      Source Port = 52345       |    Dest Port = 21            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                     Sequence Number = 1000                    |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                  Acknowledgment Number = 5000                 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|  Data |r|A|P|R|S|F|            Window = 8192                   |
| Offset| |C|S|S|Y|I|                                    0 0 0 0  |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|       Checksum = 0x0000       |     Urgent Pointer = 0        |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                    Data (40 bytes) ...                        |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Result: Source 52345 → Destination 21, 20-byte header + 40 bytes of data = 60-byte TCP segment, checksum 0000.

Similar questions

AI LearningWeb Platform

Coursify — Personal AI Course Generator

Struggling with a difficult subject or concept? Turn any engineering topic into a structured course with interactive lessons, quizzes, and research-backed explanations.