In a TCP header, how many bits does each source port and destination port…

2021

In a TCP header, how many bits does each source port and destination port field contain?

Answer: B. 16 bitsConceptA fixed-width unsigned field of n bits can represent 2n distinct bit patterns, spanning 0 through 2n − 1. TCP uses source and destination port fields…

  1. A.

    8 bits

  2. B.

    16 bits

  3. C.

    32 bits

  4. D.

    128 bits

Attempted by 64 students.

Show answer & explanation

Correct answer: B

Concept

A fixed-width unsigned field of n bits can represent 2n distinct bit patterns, spanning 0 through 2n − 1.

TCP uses source and destination port fields to identify the sending and receiving application endpoints within a segment.

Application

  1. In the TCP header layout defined by RFC 9293, Source Port occupies the first half of the opening 32-bit row.

  2. Destination Port occupies the second half of that same 32-bit row.

  3. Each half spans 16 bit positions, so both port fields are 16 bits wide.

Cross-check

An unsigned 16-bit field supplies 216 = 65,536 values, numbered 0 through 65,535. This matches the TCP port-number space.

Contrast

  • 8 bits would provide only 256 values.

  • 32 bits is the width of TCP sequence and acknowledgment fields, not either port field.

  • 128 bits is not the width assigned to a TCP port field.

Therefore, each source port and destination port field contains 16 bits.

Explore the full course: Up Police Computer Operator

Loading lesson…