Ipv4 fragmentation number of bytes not in multiple of 8

  • Comp Sci
  • Thread starter shivajikobardan
  • Start date
  • Tags
    bytes Multiple
In summary, the conversation discusses the topic of understanding the theory behind fragmentation in networking. The solution to a specific question involving 1440 bytes being routed through an interface with an MTU of 576 bytes is provided, along with an explanation of the process of fragmentation into three packets. The conversation then delves into further questions and clarifications about the solution and how to handle cases where the total length or "only data" part is not divisible by 8. The conversation also references an example from Wikipedia which may be helpful in understanding the concept further.
  • #1
shivajikobardan
674
54
Homework Statement
What should we do if the number of bytes to be transferred are not in multiples of eight in ipv4?
Relevant Equations
ipv4 header
Theory that I am trying to understand-:

s6zSUxOoKSLCjZx18cPGSRYDSSUKZKh-JOq0RYAa-TTmDb_vfQ.png

So i found a question that is relevant to this-:
->a total of 1440 bytes that is routed through an interface with MTU of 576 bytes. Calculate flag, fragmented offset, total length and data transmitted in each packet after fragmentation. Assume IP header to be 20 bytes.

Solution-:

1440=20+1420

MTU is 576.
Number of fragments=1420/576=3

So let’s call 3 packets P1,P2,P3.

P1=>20+556
P2=>20+556
P3=>20+308

So I am trying to understand what the above picture is trying to say.

There are 2 cases-:
-> Is it trying to say that total length of P1 should be divisible by 8?

-> Is it trying to say that “only data” part should be divisible by 8?

I have even further questions about it.

->Say, the total length of P1 should be divisible by 8. What will we do if it is not?

->(I believe) Say the “only data” part should be divisible by 8, then what should we do as neither 556 nor 308 is divided by 8.

So say I reiterate and do this arrangement(I believe this is correct way)-:
P1->20+552
P2>20+552
P3->20+316

Still 316 isn’t divisible by 8, what should I do now?

i don't understand the solution that is written in the picture that i attested above. how can we use that solution to our case?

IRRESPECTIVE OF WHATEVER I WROTE,if you want,YOU CAN EXPLAIN LIKE I AM BEGINNER TO ALL THESE
 
Physics news on Phys.org
  • #3
Tom.G said:
A rather detailed explanation/example can be found at:
https://en.wikipedia.org/wiki/IPv4#Fragmentation_and_reassembly
See especially REASSEMBLY.
wikipedia feels slightly above my level of understanding. i don't find it that simple. anyway i will try reading that. it would be nice if you would help me with this case.
 
  • #4
Well, slightly above is good, it means your view is enlarging and you are learning something!

See also the sentence immediately above the REASSEMBLY heading that reads:
The last offset and last data size are used to calculate the total data size

That implies that any leftover room in the last octet is to be considered irrelevant and should be ignored.

Cheers,
Tom
 
  • Like
Likes shivajikobardan

FAQ: Ipv4 fragmentation number of bytes not in multiple of 8

What is Ipv4 fragmentation?

Ipv4 fragmentation is a process in which a large packet of data is broken into smaller fragments to be transmitted over a network. This is necessary because different networks have different maximum transmission unit (MTU) sizes, and a packet may need to travel through multiple networks to reach its destination.

Why does the number of bytes in Ipv4 fragmentation need to be a multiple of 8?

The number of bytes in Ipv4 fragmentation must be a multiple of 8 because the header of an Ipv4 packet is always 20 bytes long, and each fragment also has a header of 20 bytes. This means that the remaining data in a fragment must be a multiple of 8 to ensure proper alignment and parsing of the packet.

What happens if the number of bytes in Ipv4 fragmentation is not a multiple of 8?

If the number of bytes in Ipv4 fragmentation is not a multiple of 8, the packet will not be properly aligned and may not be able to be parsed correctly. This can result in errors or the packet being dropped by the receiving device.

Can the number of bytes in Ipv4 fragmentation be a multiple of any number other than 8?

No, the number of bytes in Ipv4 fragmentation must be a multiple of 8. This is because the 20-byte header and 20-byte fragment header are fixed sizes, and any remaining data in a fragment must be a multiple of 8 to ensure proper alignment.

How does Ipv4 fragmentation affect network performance?

Ipv4 fragmentation can negatively affect network performance because it adds overhead to the transmission of data. The process of breaking up and reassembling packets takes time and resources, which can slow down the overall network speed. Additionally, if a packet is fragmented too many times, it may be dropped, resulting in the need for retransmission and further slowing down the network.

Back
Top