IPv4 Header MCQ in Network Layer for Gate-net and other competitive exam

1. If an IPv4 datagram packet has HLEN field is (1011)2. Then find out options size carry by this datagram packet.

  • A. 44 Byte
  • B. 14 Byte
  • C. 36 Byte
  • D. 24 Byte
  • None of the above
Solution:- Here we have given HLEN (1011)2. Now when we convert this binary to decimal we get 11.
Now Multiply this 11 with scaling factor which is 4.
Total size of Header :- 11×4 =44 Byte
Fixed length of header = 20 Byte
extra byte/overhead/ Size of Options is = 44-20= 24 Byte

2. If an IPv4 datagram packet Total Length field value is (0044)16 and the value of HLEN is 6 Then find out actual data size carry by this datagram packet.

  • A. 44 Byte
  • B. 48 Byte
  • C. 36 Byte
  • D. 24 Byte
  • None of the above

Solution:- Here we have given Total Length field value is (0044)16 . Now when we convert this Hexadecimal to decimal.
Total size of datagram is 4×161+ 4×160=68 Byte

value of HLEN is 6 than size of header => 6×4 = 24 Byte

Data size= Total length – Header size

=> Data size = 68-24 => 44 Bytes

3. When an IPv4 packet arrived from transport layer its hexadecimal digit value is (4500005D00030006006)16. Find out before drooping this packet by router how many hopes this packet will travel.

  • A. 60
  • B. 94
  • C. 96
  • D. 80
  • None of the above

Solution:- Here we have given hexadecimal digit value is (4500005D000300006006)16. In this question examiner asking for TTL(Time to Live) field value in decimal. TTL field is in third row of IPv4 header means after completing 64 bits TTL Field start.

In above question each and every digit is taking 4 bit so first 32 bit 4500005D and next 32 bit is 00030000

Next 8 bit represents TTL Field (60)16 convert this to decimal

6×161+ 0x160=>96

Total number of hops travel by this packet is 96.

4. When an IPv4 packet arrived from transport layer its hexadecimal digit value is (4500005D00030006006)16. Find out which protocol is using by this datagram.

  • A. TCP
  • B. UDP
  • C. STCP
  • D. SNMP
  • None of the above

Solution:- Here we have given hexadecimal digit value is (4500005D000300006006)16. In this question examiner asking for Protocol field value in decimal. Protocol field is in third row of IPv4 header means after completing 72 bits Protocol Field start.

In above question each and every digit is taking 4 bit so first 32 bit 4500005D and next 32 bit is 00030000

Next 8 bit represents TTL Field (60)16 than comes the protocol field which 8 bit (06)16

0x161+ 6×160=>06

This port number is associated with TCP.

5. value of header length field in an IPv4 packet is 9 and total length of this packet is given in hexadecimal by ‘0082’. Find out the size of data in this packet.

  • A. 94 Byte
  • B. 48 Byte
  • C. 36 Byte
  • D. 24 Byte
  • None of the above

Solution:- Here we have given Total Length field value is (0082)16 . Now when we convert this Hexadecimal to decimal.
Total size of datagram is 8×161+ 2×160=130 Byte

value of HLEN is 9 than size of header => 9×4 = 36 Byte

Data size= Total length – Header size

=> Data size = 130-36 => 94 Bytes

6. The main purpose of using Time to live field in IPv4 Datagram Header is….

  • A. To give the time stamp to every field
  • B. To destroy useless data packet
  • C. It prevent infinite looping of Packet
  • D. To send packet from source to destination
  • None of the above

7. Which one of the below is not a part of TCP/IP IP datagram Header…

  • A. Time to live
  • B. Data Checksum
  • C. Header Checksum
  • D. Services Type
  • None of the above

Comments

No comments yet. Why don’t you start the discussion?

Leave a Reply

Your email address will not be published. Required fields are marked *