Total length IP header and 65535 bytes relation-:

In summary, the IPv4 header has a field called "total header length" which is 16 bits or 2 bytes in size. This allows for a maximum value of 65535 bytes for the entire IP datagram, with the minimum size being 20 bytes. This concept may seem familiar to those who have studied COA and microprocessors, but it can also be confusing. However, the unit of measurement for data sizes in the field of computers is usually in bytes. This is why the book mentions a maximum size of 65535 bytes, which is represented by 16 bits. It is important to note that in more recent versions, such as IPv6, the maximum size has increased to 4,294,967,
  • #1
shivajikobardan
674
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
  • #2
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
  • #3
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.
 
  • #4
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.
 
  • #5
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.
 
  • #6
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

FAQ: Total length IP header and 65535 bytes relation-:

What is the total length of an IP header?

The total length of an IP header is typically 20 bytes, but it can vary depending on the options and data included in the packet.

What is the maximum length of an IP header?

The maximum length of an IP header is 60 bytes, including the 20 byte mandatory fields and up to 40 bytes of optional fields.

What is the significance of the 65535 bytes in relation to IP headers?

The number 65535 represents the maximum value of a 16-bit field, which is used to indicate the total length of a packet. This means that the maximum size of an IP packet, including the header, is 65535 bytes.

What happens if the total length of an IP header exceeds 65535 bytes?

If the total length of an IP header exceeds 65535 bytes, the packet will be dropped and an error message will be sent back to the sender. This is because the maximum value of a 16-bit field cannot accommodate a larger packet size.

Why is it important to consider the relation between total length of IP headers and 65535 bytes?

Understanding the relation between total length of IP headers and 65535 bytes is important for ensuring that packets are properly formatted and can be successfully transmitted across a network. It also helps to prevent errors and ensure efficient use of network resources.

Similar threads

Back
Top