Link to home
Start Free TrialLog in
Avatar of jskfan
jskfanFlag for Cyprus

asked on

Maximum size of IP and TCP Packet.

Maximum size of IP and TCP  Packet.

There is a little bit of confusion when it comes to the Maximum size of IP and TCP  Packet
I did some reading nline, I have seen numbers of 65Kbytes and 1500 Kbytes but not clear which number goes with IP packet and which goes with TCP Packet.

Any Clarification?

Thanks
Avatar of David Favor
David Favor
Flag of United States of America image

65535 bytes is max size.
To add further clarification to David above - the 1500Kb you are quoting is most likely going to be referencing MTU, not the packet size.
Both answers are correct, but i want to clarify that the MTU is in bytes not Kb...
the MTU can be larger than 1500 bytes and those are called Jumbo Frames... can go from 2000 to 9000 bytes.

The absolute limitation on TCP packet size is 64K (65535 bytes), but in practicality this is far larger than the size of any packet you will see, because the lower layers (e.g. ethernet) have lower packet sizes. The MTU (Maximum Transmission Unit) for Ethernet, for instance, is 1500 bytes.
A good question is why you care about packet size.

If you're trying to resolve a specific problem, then likely best to close out this question, as it's been answered.

Then open another question... with you're real question, describing exactly the problem you're trying to resolve.
Avatar of noci
noci

hm.... mostly the previous answers are correct....
(B = bytes , b= bits... 1B = 8b so capitalization (aka character size) matters )

Maximum TCP/UDP packet size is 64K -1B  (65535 bytes).  [ The size field = 2 bytes unsigned integer).
If a packet of this size is sent it will get broken down in fragments... if the size doesn't fit in one wire packet. size of which depends on the medium used.
(in most cases fragments are sent with the last part first, ending with the front & packet header), this is a speed optimization)

Most packetswitching networks are based on Ethernet which use 1500B of data or in the case of "jumbo frames" up to 9KB  packets
This can be mostly found as the MTU of an interface.  On linux the MTU of lo (loopback interface) = 65536, allowing for the max. packet size.
Toking Ring networks can be 4K - 16K packet sizes.  Some other wire protocols may allow for different packet sizes.
So the Actual amount of data on the Wire may be different.
There will never be multiple IP packets in a wire frame.

Also sockets may enforce that packets cannot be fragmented, requiring each packet to fit in any wire frame on the route. (That means a sender may never send more than the smallest wireframe it can encounter on a circuit).
Avatar of jskfan

ASKER

OK
 TCP packet size is 65535 bytes

what about IP packet's size  ?
IP is at the Routing layer of the OSI, those include IP address routing information in the header of the packet.
TCP is at the transport layer.  

you can't just create a TCP/IP packet with just IP or just TCP, you need the transport medium to get there.

I would use the analogy of a train, the wagons are the packet size, holding cargo (information), however the Locomotive has the guidance system for it's indentification and destination.   (routing of IP contain, source IP destination IP).  

So ultimately, your Packet size is the limit of the TCP layer.
I agree to  SirDragons comment with one addition:   when a large packet is fragmented across multiple medium packets (f.e. ethernet 1500)  then the IP header is repeated the TCP header is only in packet #1 (commonly sent as last part).  As such the IP Packet (Header + payload) maximizes on media size packet limit.
ASKER CERTIFIED SOLUTION
Avatar of atlas_shuddered
atlas_shuddered
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jskfan

ASKER

If I understand the Max MTU is the Max size for IP Packet

TCP Max packet size is 65535 bytes
No MTU is the Maximum Transfer Unit.  The amount of bytes that can be transported as ONE chunk over the selected interface.
So yes it can be for one packet on THAT interface.
There is also something called Path-MTU the largest packet that can be sent to the endpoint passing though all routers etc.
Atlas_Shuddered already explaned that.

Actualy TCP is a Stream, so it starts then the session starts and it stops when the sockets are closed. (undefined size).
The maximum segment can be is 65535 bytes. The actual data in flight can be up to windowsize in bytes.
Segments are usualy limited so packets fit in one (P)MTU  sized frame.  Which makes the stream transfer the most efficient for the available connections.
Avatar of jskfan

ASKER

Thank you Guys!