All Exams Test series for 1 year @ ₹349 only
Question

An IP packet has arrived with the first 8 bits as 0100 0101. Which of the following is correct?

The correct answer is

The total number of bytes in the header is 20 bytes.

IP Packet Header Analysis from First 8 Bits

The question asks to interpret the first 8 bits of an IP packet header: $0100 0101$. These bits contain crucial information about the IP version and the header length.

Deconstructing the IP Header Fields

The first 8 bits of an IPv4 header are structured as follows:

  • The first 4 bits represent the IP Version.
  • The next 4 bits represent the Internet Header Length (IHL).

Determining IP Version

The first 4 bits are $0100$.

  • Converting binary $0100$ to decimal: $0 \times 2^3 + 1 \times 2^2 + 0 \times 2^1 + 0 \times 2^0 = 4$.
  • An IP version of 4 indicates that this is an IPv4 packet, not IPv6.

Calculating Internet Header Length (IHL)

The next 4 bits are $0101$.

  • Converting binary $0101$ to decimal: $0 \times 2^3 + 1 \times 2^2 + 0 \times 2^1 + 1 \times 2^0 = 5$.
  • This value, 5, is the IHL.

Calculating Total Header Size

The IHL specifies the header length in units of 32-bit words. Since 32 bits equal 4 bytes, the total header size in bytes is calculated as:

$ \text{Header Length (bytes)} = \text{IHL} \times 4 $ $ \text{Header Length (bytes)} = 5 \times 4 = 20 \text{ bytes} $

Evaluating the Options

  • Option 1: The IP version of the packet is 6. Incorrect. The version is 4 ($0100$).
  • Option 2: The Time To Live ($TTL$) value is 5. Incorrect. The $TTL$ field is located later in the header and is not determined by the first 8 bits.
  • Option 3: The packet is malformed and will be rejected. Incorrect. An IHL of 5 is valid for IPv4, resulting in a standard header size of 20 bytes.
  • Option 4: The total number of bytes in the header is 20 bytes. Correct. As calculated, the header length is $5 \times 4 = 20$ bytes.

Conclusion

Based on the analysis of the first 8 bits ($0100 0101$), the IP version is 4 and the Internet Header Length (IHL) is 5. This means the total header size is 20 bytes.

Was this answer helpful?

Important Questions from IPv4

  1. An organization is granted the block 130.56.0.0/16. The administrator wants to create 1024 subnets. Find first and last addresses of last subnet.

    1.

    130.56.0.0

    130.56.254.255

    2.

    130.56.255.0

    130.56.255.255

    3.

    130.56.0.192

    130.255.255.255

    4.

    130.56.255.192 

    130.56.255.255

  2. An organization is granted the block 130.56.0.0/16. The administrator wants to create 1024 subnets. Find the subnet prefix.

  3. An organization is granted the block 130.56.0.0/16. The administrator wants to create 1024 subnets.

    Find first and last addresses of First subnet.

    1.

    130.56.0.0

    130.56.254.254

    2.

    130.56.0.0

    130.56.0.63

    3.

    130.0.0.0

    130.255.255.255

    4.

    130.56.0.0

    130.56.255.63

  4. Suppose a message of size 15000 bytes is transmitted from a source to a destination using IPv4 protocol via two routers as shown in the figure. Each router has a defined maximum transmission unit (MTU) as shown in the figure, including IP header. The number of fragments that will be delivered to the destination is ________ . (Answer in integer)

  5. A machine receives an IPv4 datagram. The protocol field of the IPv4 header has the protocol number of a protocol X.
    Which ONE of the following is NOT a possible candidate for X?
Need Expert Advice?

Start Your Preparation with Prepp Mobile App

Download the app from Google Play & App Store
Download the app from Google Play & App Store
Prepp Mobile App