Comp Sci Total length IP header and 65535 bytes relation-:

AI Thread Summary
The IPv4 header's "total length" field is 16 bits, allowing it to represent values from 0 to 65,535. This means that the maximum size of an IP datagram, including both header and data, is 65,535 bytes. The confusion arises from the understanding that while 16 bits can represent 65,536 values (0-65,535), the count starts at zero, leading to the maximum being 65,535 bytes. Fragmentation may occur if the packet size exceeds the limits imposed by network links. The discussion also touches on IPv6, which has a significantly larger maximum payload size.
shivajikobardan
Messages
637
Reaction score
54
Homework Statement
IPV4 header confusion
Relevant Equations
None
So IPV4 header has a topic called "total header length" and it is of 16 bits. That means it can count from 0-65535. Book says it means IP datagram is limited to 65535 bytes. how do we get to idea of 65535 bytes? is it 1 memory location=1 byte idea?
It doesn't make any sense to me(I have studied COA, microprocessor and I realize that this concept sounds familiar but I think I forgot)

Do you have any easier way to deal with these kinds of issues?
 
Physics news on Phys.org
shivajikobardan said:
So IPV4 header has a topic called "total header length" and it is of 16 bits. That means it can count from 0-65535. Book says it means IP datagram is limited to 65535 bytes. how do we get to idea of 65535 bytes? is it 1 memory location=1 byte idea?
It doesn't make any sense to me(I have studied COA, microprocessor and I realize that this concept sounds familiar but I think I forgot)

Do you have any easier way to deal with these kinds of issues?
Why doesn't it make sense to you? It's very common in anything to do with computers for sizes or lengths to be in units of bytes.

Here's a relevant wikipedia article, a resource you could have looked up for yourself (emphasis added):
https://en.wikipedia.org/wiki/IPv4
Total Length
This 16-bit field defines the entire packet size in bytes, including header and data. The minimum size is 20 bytes (header without data) and the maximum is 65,535 bytes. All hosts are required to be able to reassemble datagrams of size up to 576 bytes, but most modern hosts handle much larger packets. Links may impose further restrictions on the packet size, in which case datagrams must be fragmented. Fragmentation in IPv4 is performed in either the sending host or in routers. Reassembly is performed at the receiving host.
 
  • Like
Likes shivajikobardan
idk man..i don't get what it is trying to say. my confusion isn't with ipv4 but just-:
how 16 bit represents 65535 bytes.
i am not getting the sequence.

i know that 16 bit number means possible values are from

0-65,535

now ig every possible value is like 1 memory location worth 1 byte and thus making 65535 bytes(still that should be 65536 bytes if that's the case as 0 is also occupying a memory location)..but i don't understand how that makes sense in this scenario.

it is getting complicated for me.
 
It's not complicated. With 16 bits you can represent anyone of 65,536 different bytes (or characters), numbered from 0 through 65,535. Most computer languages start counting from zero.
 
Mark44 said:
It's not complicated. With 16 bits you can represent anyone of 65,536 different bytes (or characters), numbered from 0 through 65,535. Most computer languages start counting from zero.
Hmm I think i am close to it.
so 16 1s=65535 that means the maximum size of total ip datagram will be 65535 units.
And maybe that unit is byte in ipv4. And maybe that unit could be any word as well if future enhancments could come.
 
shivajikobardan said:
Hmm I think i am close to it.
so 16 1s=65535 that means the maximum size of total ip datagram will be 65535 units.
And maybe that unit is byte in ipv4. And maybe that unit could be any word as well if future enhancments could come.
There already is a more recent version -- IPv6. The basic units are still bytes, or octets as they call them. The maximum payload of an IPv4 packet is ##2^16 - 1## bytes; for IPv6 this maximum is ##2^32 - 1##, or 4,294,967,295 octets. I doubt very much that the basic unit will change in size.
 
  • Like
Likes shivajikobardan and FactChecker
Back
Top