0

I am developing a networking library (that uses exclusively UDP) and I want to support both IPv4 and IPv6 by using a dual-mode socket. I want to limit the size of the packet user can send to a value that is guaranteed to always go through when using IPv6. According to RFC (https://datatracker.ietf.org/doc/html/rfc2460), minimum value that should always be supported is MTU of 1280 bytes.

So am I right to assume that the maximum payload limit (number of raw bytes that user writes) I should set for my user is:

1280 (MTU required by IPv6) - IPv6 header size (40 bytes) - UDP header size (8 bytes) = 1232 bytes

Is this correct or am I missing something? This is really important to me, so I just want to make sure I get it right. Thanks.

3
  • 1
    IPv6 requires PMTUD, and that will tell you the smallest MTU in the path.
    – Ron Maupin
    May 31, 2022 at 15:43
  • @RonMaupin Yeah, but what if I don't care about MTU discovery and only want to use the smallest safe MTU? Is my statement above correct in that case?
    – FICHEKK
    May 31, 2022 at 15:56
  • IPv6 requires PMTUD, and it will size its packets based on that, using the fragmentation extension header if necessary. That is how IPv6 works. IPv6 will pre-fragment packets (there is no in-path fragmentation as IPv4 has) based on the PMTUD.
    – Ron Maupin
    May 31, 2022 at 16:00

0

Browse other questions tagged or ask your own question.