Welcome, Guest. Please login or register.

Author Topic: Maximum size of network packets in TCP/UDP etc. ..etc.  (Read 2155 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline JoseTopic starter

  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 2871
    • Show only replies by Jose
Maximum size of network packets in TCP/UDP etc. ..etc.
« on: August 27, 2007, 05:24:51 PM »
Can anyone tell me if there is a maximum size for each network packet arriving ? I suppose it will depend on if the application is using UDP or TCP or whatever but I don't know the specifics.
This will have an impact on my serialization library, on if I can maintain the same buffer design I have for serializer code or have to make one for the reader (reads serialized streams back to memory) with variable size chunks to cover variable incoming sizes (if maximum size is undefined). Doesn't the TCP stack holds on data transfer if the read() is taking to much to be processed and it's buffer get's full ?

Finally do you see any other serialization situations where this would be important ?

Cheers
\\"We made Amiga, they {bleep}ed it up\\"
 

Offline JoseTopic starter

  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 2871
    • Show only replies by Jose
Re: Maximum size of network packets in TCP/UDP etc. ..etc.
« Reply #1 on: August 27, 2007, 06:38:58 PM »
576 for IP datagrams and 536 for TCP

Nothing like doing your homework..:)
\\"We made Amiga, they {bleep}ed it up\\"
 

Offline Zac67

  • Hero Member
  • *****
  • Join Date: Nov 2004
  • Posts: 2890
    • Show only replies by Zac67
Re: Maximum size of network packets in TCP/UDP etc. ..etc.
« Reply #2 on: August 27, 2007, 08:43:19 PM »
Size of MTU depends on the network topology and conventions. On most Ethernet networks it's actually a bit larger.

MTU on Ethernet is (mostly) 1500 (1518 bytes/frame - 18 bytes header&checksum). UDP overhead reduces this by 16 bytes, TCP by 32 bytes.

Sending large packets over unknown territory can lead to fragmentation and reassembly: MTU

The values you've stated are the largest packets guaranteed not to be fragmented, regardless of layer and topology - if that's what you were looking for. ;-)
 

Offline JoseTopic starter

  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 2871
    • Show only replies by Jose
Re: Maximum size of network packets in TCP/UDP etc. ..etc.
« Reply #3 on: August 28, 2007, 09:06:24 PM »
Well, I don't even know well what I was looking for TBH, but thanks for the info. I just realized that when dealing with it's own buffer, a serialzing code knows each chunk size beforehand. But to deal with incoming data the buffer needs to not be overwritten due to unknown size of incoming datagrams through a network for example. In other words, the buffer design will have to be more complex.  :boohoo: But I'll find a way...
\\"We made Amiga, they {bleep}ed it up\\"