Jump to content

I don't understand how you calculate the offset for IP fragmentation. I know you should divide the length of the datagram with 8 to get the offset.

 

In the example below: If we divide 1480 with 8 we get 185 which is the correct value for the second offset.

But if we add the offset of 1020 divided by 8 we get 312,5 and not 370 as is shown in this case.

And even if we divide 1040 by 8 it still isn't enough.

Spoiler

image.png.0bf43372179121d1e284d09293343dfb.png

 Please help and thank you for your answers.

Link to comment
https://linustechtips.com/topic/915719-offset-in-ip-fragmentation/
Share on other sites

Link to post
Share on other sites

12 hours ago, RageAx said:

I don't understand how you calculate the offset for IP fragmentation. I know you should divide the length of the datagram with 8 to get the offset.

 

In the example below: If we divide 1480 with 8 we get 185 which is the correct value for the second offset.

But if we add the offset of 1020 divided by 8 we get 312,5 and not 370 as is shown in this case.

And even if we divide 1040 by 8 it still isn't enough.

  Hide contents

image.png.0bf43372179121d1e284d09293343dfb.png

 Please help and thank you for your answers.

the size of the offset isn't based on the current packet's length, but the total of all prior packets. so for the 3rd datagram, the offset is calculated from 1480*2=2960, not from 1480+1040.

Looking to buy GTX690, other multi-GPU cards, or single-slot graphics cards: 

 

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×