Trying to understand TCP/IP PDU sizes

Bodisha

New Member
Joined
May 19, 2019
Messages
13
Reaction score
1
Credits
151
I'm trying to understand the PDU sizes as it traverse the TCP/IP model.

The way I'm reading these RFC's, (RFC 791) is the IP protocol is required to accept a "datagram" of 576 bytes. My interpretation of the term datagram is it's equivalent to a payload. So I'm trying to take that value and figure out how large a PDU will be at the remaining layers.

Listed below are the PDU sizes if I do the math then. Unfortunately, I can't find any confirming information out there that says these values are accurate or not though.

Transport layer
TCP segment size = Header 60 bytes + payload 516 bytes = 576 bytes
UDP datagram = Header 8 bytes + payload 568 bytes = 576 bytes

Internet layer
IP packet size = Header 60 bytes + payload 576 bytes = 636 bytes

Link layer
Ethernet Frame = Headed & FCS 18 bytes + payload 636 = 654 Bytes
 
Last edited:



Total Length is the length of the datagram, measured in octets,
including internet header and data. This field allows the length of
a datagram to be up to 65,535 octets. Such long datagrams are
impractical for most hosts and networks. All hosts must be prepared
to accept datagrams of up to 576 octets (whether they arrive whole
or in fragments). It is recommended that hosts only send datagrams
larger than 576 octets if they have assurance that the destination
is prepared to accept the larger datagrams.

The number 576 is selected to allow a reasonable sized data block to
be transmitted in addition to the required header information. For
example, this size allows a data block of 512 octets plus 64 header
octets to fit in a datagram. The maximal internet header is 60
octets, and a typical internet header is 20 octets, allowing a
margin for headers of higher level protocols.

First of all, an "octet" is not necessarily the same thing as "byte". It's technically 8 bits.
576 is the "recommended" number of octets, but you could theoretically send up to 65,000.

The data would be up to 512 octets, plus up to 64 octets for header of the datagram.
You have 60 and 516. Your values are slightly off.
 



First of all, an "octet" is not necessarily the same thing as "byte". It's technically 8 bits.
576 is the "recommended" number of octets, but you could theoretically send up to 65,000.

The data would be up to 512 octets, plus up to 64 octets for header of the datagram.
You have 60 and 516. Your values are slightly off.
Thanks for the reply. The 2 points out of your reply I'd like to clear up if we could.

1) I'm assuming the term datagram here is analogous with an IP Packet at the Internet Layer of the TCP/IP model
2) If we're talking about an IP packet, how is the header 64 octets? My understanding is the IP header is a maximum of 60 octets

ip-v4-datagram-header.png
 
Last edited:
) If we're talking about an IP packet, how is the header 64 octets? My understanding is the IP header is a maximum of 60 octets

This protocol is called on by host-to-host protocols in an internet
environment. This protocol calls on local network protocols to carry
the internet datagram to the next gateway or destination host.

For example, a TCP module would call on the internet module to take a
TCP segment (including the TCP header and user data) as the data
portion of an internet datagram. The TCP module would provide the
addresses and other parameters in the internet header to the internet
module as arguments of the call. The internet module would then
create an internet datagram and call on the local network interface to
transmit the internet datagram.

The number 576 is selected to allow a reasonable sized data block to
be transmitted in addition to the required header information. For
example, this size allows a data block of 512 octets plus 64 header
octets to fit in a datagram. The maximal internet header is 60
octets, and a typical internet header is 20 octets,
allowing a
margin for headers of higher level protocols.

The packet header is not exactly the same thing as the internet header.
The datagram ( packet ) header size is 64.
The internet header maximum size is 60.
The typical internet header size is about 20.
 
The packet header is not exactly the same thing as the internet header.
The datagram ( packet ) header size is 64.
The internet header maximum size is 60.
The typical internet header size is about 20.
First... thank you for your assistance and replying! Unfortunately, I'm a very lost.

I've read RFC 791 several times, and I've been examining headers of the network/internet layer and I can't figure out where those extra 4 octets should appear. Every thing I've seen has the maximum header at 60 octets. All I can figure out is it must have something to do with the comment "allowing a margin for headers of higher level protocols.". Like I said though, I can't figure out where in the header those last 4 octets are.... I hate to keep at this, but could I ask you to connect the dots for me hear.

Thanks you it's very appreciated
 
The packet header is not exactly the same thing as the internet header.
The datagram ( packet ) header size is 64.
The internet header maximum size is 60.
The typical internet header size is about 20.
I admit, I saw this response and was confused by the terminology too. I got out my copy of Stevens, looked at the RFC, and did some web searches, but none made it clear to me.

To me, a "datagram" is an "IP datagram", which consists of the IP header and the IP data. IP datagram headers are always 20 octets. I have never seen a datagram with a non-empty Option field. An IP datagram may be fragmented, in which case each fragment is also an IP datagram.

From my experience, the term "packet" is used in different ways. Some people say "packet" when they really mean "datagram", but I never had trouble understanding what they meant. Sometimes I say "packet" too, to help others understand and follow along.
 
I admit, I saw this response and was confused by the terminology too. I got out my copy of Stevens, looked at the RFC, and did some web searches, but none made it clear to me.

To me, a "datagram" is an "IP datagram", which consists of the IP header and the IP data. IP datagram headers are always 20 octets. I have never seen a datagram with a non-empty Option field. An IP datagram may be fragmented, in which case each fragment is also an IP datagram.

From my experience, the term "packet" is used in different ways. Some people say "packet" when they really mean "datagram", but I never had trouble understanding what they meant. Sometimes I say "packet" too, to help others understand and follow along.

I found RFC 1594, which attempts to define these terms. It has 2 separate definitions for datagram & has a definition for packet, but doesn't specify what a segment is. The term "IP datagram" is at odds with what I've seen in diagrams, books, etc about network/internet layer "IP packets. Unfortunately, I'm still no closer to understanding what this 64 octet header is mentioned in RFC 791


packet The unit of data sent across a network. "Packet" a generic
term used to describe unit of data at all levels of the
protocol stack, but it is most correctly used to describe
application data units.
UDP User Datagram Protocol
An Internet Standard transport layer protocol defined in STD
6, RFC 768. It is a connectionless protocol which adds a
level of multiplexing to IP.
Datagram
A self-contained, independent entity of data carrying
sufficient information to be routed from the source
to the destination computer without reliance on earlier
exchanges between this source and destination computer and
the transporting network.
 
Last edited:
I found RFC 1594, which attempts to define these terms. It has 2 separate definitions for datagram & has a definition for packet, but doesn't specify what a segment is. The term "IP datagram" is at odds with what I've seen in diagrams, books, etc about network/internet layer "IP packets. Unfortunately, I'm still no closer to understanding what this 64 octet header is mentioned in RFC 791

If you read RFC 791 carefully, you will find this description of the Total Length field. (Second paragraph was highlighted by Sphen):
Total Length: 16 bits
Total Length is the length of the datagram, measured in octets,
including internet header and data. This field allows the length of
a datagram to be up to 65,535 octets. Such long datagrams are
impractical for most hosts and networks. All hosts must be prepared
to accept datagrams of up to 576 octets (whether they arrive whole
or in fragments). It is recommended that hosts only send datagrams
larger than 576 octets if they have assurance that the destination
is prepared to accept the larger datagrams.
The number 576 is selected to allow a reasonable sized data block to
be transmitted in addition to the required header information. For
example, this size allows a data block of 512 octets plus 64 header
octets to fit in a datagram. The maximal internet header is 60
octets, and a typical internet header is 20 octets, allowing a

margin for headers of higher level protocols.

Could this second paragraph be the source of your confusion?

That second paragraph provides an example, and the "64 header octets" mentioned here are a hypothetical 64 octet header that may not exist. It is only an example that is not used in the real world. The example is not the regular "20 to 60 octet IP header" ... and that regular IP header is always 20 octets in actual use, as you know.

What RFC 791 calls "internet header" is what I call the "IP datagram header" - they are the same thing.
 
Last edited:
If you read RFC 791 carefully, you will find this description of the Total Length field. (Second paragraph was highlighted by Sphen):




Could this second paragraph be the source of your confusion?

That second paragraph provides an example, and the "64 header octets" mentioned here are a hypothetical 64 octet header that may not exist. It is only an example that is not used in the real world. The example is not the regular "20 to 60 octet IP header" ... and that regular IP header is always 20 octets in actual use, as you know.

What RFC 791 calls "internet header" is what I call the "IP datagram header" - they are the same thing.

I saw where it mentioned a 64 octet header, which caused me to dig into every header I could find in the TCP/IP stack to see if a protocol actually had 64 octet header. Not going to lie, can't say I like the idea of an unmentioned hypothetical 64 octet header in this RFC... But I guess it is what it is.

Thanks for everything
 


Latest posts

Top