lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-users] RE: ICMP port unreachable when using netconn UDP


From: Ben Bobbitt
Subject: [lwip-users] RE: ICMP port unreachable when using netconn UDP
Date: Sat, 16 Feb 2008 22:16:19 -0600

I think I’ve finally got this figured out.   I think that the problem was the use of the IP_ADDR_ANY (or just NULL )  in the netconn_bind() call… I had tried several variations and this one must have slipped through the cracks.   Apparently the use of IP_ADDR_ANY doesn’t work like the document that I was using indicated ( that it would default to either all interfaces or to the “default” interface, either of which should have been ok).  In this case, the netconn struct ipaddr value for the UDP netconn was NULL, so incoming UDP packets were rejected as not being for us. 

 

The other trick I found is that it seems that you have to call netbuf_delete() on the netbuf ptr that is returned by the netconn_recv() call, otherwise, you run out of netbufs, according to the settings in lwipopts.h  

 

 

 

 

 

From: Ben Bobbitt [mailto:address@hidden
Sent: Saturday, February 16, 2008 2:33 PM
To: 'address@hidden'
Subject: ICMP port unreachable when using netconn UDP

 

I’m running out of ideas for debugging UDP receive under lwip.  

 

I’ve modified an existing app ( for the EVK1100 Atmel ) where I am changing a module from using TCP to using UDP.   This should be trivial, but something just isn’t working

 

All I have done is to make the UDP related changes to the lwipopts.h file, and then in the module that was previously a webserver example:  

 

pxHTTPListener = netconn_new( NETCONN_UDP );

addr.addr = htonl(0xc0a80002);  // my local ip 192.168.0.2

netconn_bind(pxHTTPListener, &addr, webHttpPort );

addr.addr = htonl(0xc0a80065);  // ip of the remote system

netconn_connect(pxHTTPListener,&addr,webHttpPort);

nbRecv = netconn_recv(pxHTTPListener);

while (1)

  vTaskDelay( webSHORT_DELAY );

 

 

When sending a UDP packet from a remote system, the ARP exchange works and resolves to the correct IP, but then the Atmel system returns an ICMP port unreachable response.   The target port is the defined webHttpPort (yes, I know it isn’t logically named, its been defined as 5001 ).   I’m just using netcat to send the UDP packets.   

 

Has anyone had luck getting UDP messaging working under lwip using the netconn api?  I’ve been fighting this for a couple of weeks now and have been able to send UDP packets, but never receive them properly.   I’m not sure what else to check.  The debug mode doesn’t really give much information, and stepping though with the debugger with the JTAGICE is also somewhat useless. 

 

Any insight would be oh so very much appreciated.  

 

No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.516 / Virus Database: 269.20.7/1283 - Release Date: 2/16/2008 2:16 PM


No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.516 / Virus Database: 269.20.7/1283 - Release Date: 2/16/2008 2:16 PM


reply via email to

[Prev in Thread] Current Thread [Next in Thread]