AnsweredAssumed Answered

LWIP max UDP packet size

Question asked by wek on Oct 21, 2013
Latest reply on Oct 23, 2013 by CraigG

I am unable to send a UDP packet larger than 59192 bytes, which fits exactly in 40 Ethernet frames.  Only 40 frames of larger UDP packets are sent.  I am using  Visual Dsp++ 5.0 update 7.

 

From lwip_sysboot_threadtype.c

/**
  *  Add Application Code here
  **/
{
  int   ipAddr;
  struct sockaddr_in saddr;
  int sendId;
  int len;

   
// create broadcast IP address
  ipAddr = user_net_config_info[0].ipaddr | 0xff;
  
  if ( 0 > ( sendId = socket ( AF_INET, SOCK_DGRAM, 0 ) ) )
  {
   printf ( "Call to socket() failed.\n" );
   abort();
  }

//    
  memset ( &saddr, 0, sizeof ( saddr ) );
  saddr.sin_family = AF_INET;
  saddr.sin_addr.s_addr = htonl ( ipAddr );
  saddr.sin_port = htons ( 50000 ); // port 50000

  len = 59194;
  
  if( 0 > (sendto(sendId, encodeData, len, 0, (struct sockaddr*)&saddr, sizeof(saddr) ) ) )
  {
   printf ( "Call to sendto failed.\n" );
  }
  else
  {
   printf ( "%i Bytes sent.\n", len );
  }
}

/* Put the thread's exit from "main" HERE */
/* A thread is automatically Destroyed when it exits its run function */

Outcomes