Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++

Iniche UDP package length

Altera_Forum
Honored Contributor II
945 Views

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
0 Kudos
2 Replies
Altera_Forum
Honored Contributor II
263 Views

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
0 Kudos
Altera_Forum
Honored Contributor II
263 Views

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
0 Kudos
Reply