Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
19 years ago

Iniche UDP package length

Hi,

we have designed a video streamer based on the simple socket server example in 6.1.

Works fine, but we would like to transmit packets larger than 1500 bytes, say 8K.

The UDP spec says that the size can be as high as 64K(...)

Anyone know if this is feasible?

-apus

2 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hi,

    i thinkt, that the max. packet length depends on the MTU Size (max. transmission unit) which is 1500 bytes max. allowed by ethernet. Also, be aware, that there is no guarantee that the udp packets you send a received in the order they have been send (on large networks)

    Regards
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Here's what the Linux kernel documentation has to say about UDP and packet length:

    <div class='quotetop'>QUOTE </div>

    --- Quote Start ---

    By default Linux UDP does path MTU (Maximum Transmission Unit) discovery. This means the kernel will keep track of the MTU to a specific target IP address and return EMSGSIZE when a UDP packet write exceeds it. When this happens the application should decrease the packet size.

    Path MTU discovery can be also turned off using the IP_MTU_DISCOVER socket option or the ip_no_pmtu_disc sysctl, see ip(7) for details. When turned off UDP will fragment outgoing UDP packets that exceed the interface MTU. However disabling it is not recommended for performance and reliability reasons.[/b]

    --- Quote End ---

    So, what I take out of this, is that you shouldn&#39;t exceed your MTU, and, when you do, be prepared for poor performance (i.e.: dropped packets, lost data, etc.), especially in a shared network environment.

    Cheers,

    - slacker