Suppose consider the Datagram size of 1700. MTU =1500
1. first fragment packet will be
identifier = 1, R=0, DF=0, MF=1, Flag offset = 0
Header size + data gram size = 1500
2. Second fragment packet will be
identifier = 2, R=0 DF=0 MF=0 Flag offset = 1480
Header size + Data gram size = 240
a) In cisco routers, flag offset is calculated as sum of datagram size that has been sent. i.e., 1480
b) But it RFC 791, Flag offset is calculated as sum of datagram size divisible by 8. i.e., 1480/8 = 185
Which one of the above is correct??????? either a or b. Please clarify it.
I have one more question W.r.to RFC791.
In RFC791, they given fragmentation example, Datagram size = 452 and MTU = 280.
First fragmented packet size is 276[header 20+ datagram 256]. Even though the MTU is 280. RFC provided the data gram size as 276.
Because it is the nearest value that divisible by 8. so it can be used as offset value for next packet.
When i try the same on cisco router, first fragmentated packet size is 280. 280 is offset value for second packet on cisco routers.
This is checked by enabling "debug ip packet detail" on the router.
Which one is correct??????
Please let me know your comments
Fragment Offset value is calculated as a multiple of eight bytes so,FO for 2nd fragment will be 185 ( i.e.185x8 = 1480) which means that the data portion of 2nd fragment starts 1480 bytes into the original IP datagram
Suppose an IP datagram is divided into 2 fragments, all fragments will have SAME identifier value.So, as per your scenario :
1st Fragment : ID = 1, DF=0, MF=1, FO = 0
2nd Fragment: ID = 1, DF=0, MF=0 , FO= 185
The length of 1st fragment is 1500(Including 20 bytes for IP header) resulting in datagram size of 1480 thus FO = 185 for 2nd fragment.
If you need detailed insight, refer to following link esp. study this visual diagram for better understanding
Hope this helps.