Total length IP header and 65535 bytes relation-:

  • Context: Comp Sci 
  • Thread starter Thread starter shivajikobardan
  • Start date Start date
  • Tags Tags
    bytes Length Relation
Click For Summary
SUMMARY

The IPv4 header includes a "total length" field that is 16 bits in size, allowing it to represent values from 0 to 65,535. This means that the maximum size of an IP datagram, which includes both header and data, is limited to 65,535 bytes. The confusion arises from the interpretation of the 16-bit representation, where each value corresponds to a byte, starting from zero. The IPv6 protocol has since been introduced, allowing for a maximum payload size of 4,294,967,295 bytes.

PREREQUISITES
  • Understanding of IPv4 and its header structure
  • Basic knowledge of binary number representation
  • Familiarity with networking concepts, particularly packet transmission
  • Awareness of IPv6 and its enhancements over IPv4
NEXT STEPS
  • Study the structure of the IPv4 header in detail
  • Learn about binary to decimal conversion and its applications in networking
  • Explore the differences between IPv4 and IPv6, focusing on packet size limits
  • Investigate how fragmentation works in IPv4 and its implications for data transmission
USEFUL FOR

Network engineers, students studying computer networking, and anyone interested in understanding IP protocols and data transmission limits.

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   Reactions: 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   Reactions: shivajikobardan and FactChecker

Similar threads

  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K
Replies
1
Views
4K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
Replies
3
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 23 ·
Replies
23
Views
4K
  • · Replies 2 ·
Replies
2
Views
3K
Replies
23
Views
6K