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

Discussion Overview

The discussion revolves around the relationship between the 16-bit total length field in the IPv4 header and the maximum size of an IP datagram, which is stated to be 65535 bytes. Participants explore the implications of this bit representation and seek clarification on how it translates to the byte limit, as well as the concept of memory locations in this context.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested

Main Points Raised

  • Some participants express confusion about how a 16-bit number can represent a maximum of 65535 bytes, questioning the logic behind this representation.
  • One participant suggests that each possible value of the 16-bit field corresponds to a memory location worth 1 byte, leading to the conclusion of 65535 bytes, but they also note that this should account for 65536 bytes if including zero.
  • Another participant clarifies that with 16 bits, it is possible to represent 65536 different values, numbered from 0 to 65535, and emphasizes that most programming languages start counting from zero.
  • A later reply indicates that the maximum size of an IPv4 datagram is indeed 65535 units, which may be interpreted as bytes, but also speculates on the potential for future enhancements where the unit could change.
  • Another participant mentions IPv6, stating that while the basic unit remains bytes (or octets), the maximum payload size differs significantly from IPv4.

Areas of Agreement / Disagreement

Participants generally agree on the numerical representation of the 16-bit field but express differing levels of understanding regarding its implications for the maximum datagram size. The discussion remains unresolved as participants continue to seek clarity on the relationship between bits, bytes, and memory locations.

Contextual Notes

There are limitations in the discussion regarding the assumptions made about memory locations and the interpretation of the total length field. The relationship between the number of values represented by the 16 bits and the maximum datagram size is not fully clarified, leading to ongoing confusion.

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