Port address in TCP/IP is ________ bits long.

2013

Port address in TCP/IP is ________ bits long.

  1. A.

    32

  2. B.

    48

  3. C.

    16

  4. D.

    None of the above

Attempted by 6 students.

Show answer & explanation

Correct answer: C

Concept

A port number is the transport-layer address that identifies a specific process or service running on a host. In both the TCP and the UDP segment headers, the Source Port and Destination Port are each stored in a fixed 16-bit field. A field of n bits can encode 2n distinct values, so the size of this field is what fixes how many ports can exist.

Application

  1. The TCP/UDP header reserves a 16-bit field for the port address (one for source, one for destination).

  2. With 16 bits, the number of distinct port values is 216 = 65,536.

  3. These are numbered 0 to 65,535, which is exactly the standard port range used by every operating system.

Cross-check

The well-known fact that valid ports run from 0 to 65,535 is the give-away: 65,535 = 216 − 1, which is only possible if the field holds 16 bits. A 32-bit field would allow over 4 billion ports, and a 48-bit field even more — neither matches the observed 0–65,535 range. Hence the port address is 16 bits long.

Explore the full course: Up Police Computer Operator