Numerical Practice (IP Datagram & Fragmentation)

Important points about Fragments

  • To identify that datagram is fragmented or not look at( M bit, offset), M bit 1 and offset other than 0 means data gram is fragmented
  • To identify that all fragments belongs to the same datagram look to Identification (ID field of all fragments are same
  • To Identify the first fragment, check offset value (offset =0 for first fragment)
  • To get details of the subsequent fragments look to (TL,HL, offset)
  • To find the first byte of fragment, look to offset value and multiple it with 8, the resultant value is first byte
  • To identify that the last fragment check the M bit value ( if M=0 then this is the last fragment)
Question: A datagram is carrying 1024 bytes of data. If there is no option information, what is the value of the header length field? What is the value of the total length field?
Solution:
Given, Data-size = 1024 bytes. 
=>     Header-size = 20 bytes (since no option bytes present)
therefore, HLEN = 20/4 = 5.
Total length of datagram = 1024 + 20 = 1044 bytes

Question: A host is sending 100 datagrams to another host. If the identification number of the first datagram is 1024, what is the identification number of the last ?
Solution
Since Identification numbers are given in sequence
=> the identification of last datagram = 1024+99 = 1123

Question: A datagrams is divided into 10 fragments. if the identification number of first fragment is 2091 then what is the identification number of the last fragment ?
Solution
Since Identification numbers for all fragments remain same
=> the identification of last fragment = 2091

Question: In an IP packet, the value of HLEN is 616 and the value of the total length field is 003816. How many bytes of data are being carried by this packet? 
Solution: The HLEN value is 4, it means HLEN in decimal is => 6X160 = 6, therefore, Header-size = 6 X 4 = 24 bytes
Given => Total length is 003816, it means length in decimal 
=> 3X161+8X160= 48+8 = 56 bytes  [Total length = Header + Data]
Data = Total length - Header => 56-24 = 32 bytes 
 
Question: A datagram of size 824 bytes has arrived in which the offset value is 100. What is the number of the first byte and last byte ? (Given HLEN=6)
Solution
Given => HLEN = 6 => header-size= 6X4= 24 bytes 
      => Datagram size = 820 bytes, therefore data-size = 824-24 =  800 bytes
      => offset = 100 , therefore first byte = 100X8 = 800
since the data-size is 800 bytes=>last byte = 1599

Question: Calculate the HLEN value if the total length is 1200 bytes, 1176 of which is data from the upper layer.
Solution:
Given Total length = 1200 bytes
=>   Data-size = 1176 bytes ( upper-layer data will be data-size  in datagram)
=> Header-size = 1200 - 1176 = 24 bytes
Therefore, HLEN = 24/4 = 6

Question: . An IP packet of size 1600 bytes passes through network segment before it reaches its destination. The header size of this packet is 30 bytes. The maximum size of an IP packet in intermediate network (MTU) is 1400 bytes. How the IP packet would be fragmented in a router. Find all the information for each fragments.
Solution
Packet size = 1600 B => 30 + 1570
Given MTU is 1400 bytes => Permitted Pkt size =  30 + 1370 => 1400 bytes
Since 1370 is not multiple of 8, therefore feasible data-size is = 1368 
=> So total data-bytes (1570) is fragmented as 1368 + 202 bytes 
First Fragment
Packet Size = 30 + 1368 = 1398 bytes  [header = 30 bytes , data = 1368 bytes]
Bytes Range = 0000 to 1367
M bit = 1
offset = 0000/8 = 0
Second Fragment
Packet Size = 30 + 202 = 232 bytes    [header = 30 bytes , data = 232 bytes]
Bytes Range = 1368 to 1569
M bit = 0
offset = 1368/8 = 171

Published by Expert_Talk

I like sharing article and discussion on emerging technologies. Love to share my knowledge on various latest trends and technologies.

2 thoughts on “Numerical Practice (IP Datagram & Fragmentation)

  1. Help me to solve this question

    Packet size 4000B
    MTU size 1000
    Header length 20
    And further refragmentation 500 mtu

    and make the table

    1. From the given scenario
      Packet size would be
      =>4000 B = 20 (header) + 3980 (data)

      With restriction of MTU 1000 bytes
      Feasible packet size would be
      => 996 B = 20 (header) + 976 (data)

      To send 3980 bytes
      it is initially fragmented into 5 packet (4+1)
      3980 bytes = 4 x 976 + 1 X 76

      With another restriction of MTU 500 bytes
      Feasible packet size = 20 (header) + 480 (data)

      Further,each fragment of 996 bytes carrying 976 data bytes be fragments as
      976 bytes = 2 X 480 + 1 x 16

      I hope this calculation, answers to your question

Leave a reply to Muhammad Ammar Yasir Cancel reply