Amiga.org
Operating System Specific Discussions => Amiga OS => Amiga OS -- Development => Topic started by: Jose 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
-
576 for IP datagrams and 536 for TCP
Nothing like doing your homework..:)
-
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 (http://en.wikipedia.org/wiki/Maximum_transmission_unit)
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. ;-)
-
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...