lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] Can't process incoming UDP packets after one of hosts i


From: Grzegorz Niemirowski
Subject: Re: [lwip-users] Can't process incoming UDP packets after one of hosts is powered down
Date: Sat, 25 Jul 2015 01:10:31 +0200

Hello.
I'm still looking for solution. With MEMP_DEBUG enabled I see there are no free NETBUFs to allocate. Normally the UDP communication looks like this:

NTP start
netconn_send: sending 48 bytes
memp_malloc: pool NETBUF
netconn_recv_data: received 0x200038d8, len=48
memp_free: pool NETBUF
NTP finished
TCP start
TCP finished

Attempts to make a TCP connection with no service running don't cause any NETBUF allocation. "start" and "finish" here mean entering and exiting functions for TCP and UDP communication. They run in separate tasks and are asynchronous. NETBUF allocations are only for UDP communication (two packets and then socket is closed). When the computer to which my board tries to connect is being turned off, situation changes:

TCP start
NTP start
netconn_send: sending 48 bytes
memp_malloc: pool NETBUF
netconn_recv_data: received 0x200038d8, len=48
memp_free: pool NETBUF
NTP finished
memp_malloc: pool NETBUF
memp_malloc: pool NETBUF
memp_malloc: out of memory in pool NETBUF
memp_malloc: out of memory in pool NETBUF
TCP finished
memp_malloc: out of memory in pool NETBUF
TCP start
memp_malloc: out of memory in pool NETBUF
NTP start
netconn_send: sending 48 bytes
memp_malloc: out of memory in pool NETBUF
memp_malloc: out of memory in pool NETBUF
NTP timeout
memp_malloc: out of memory in pool NETBUF
memp_malloc: out of memory in pool NETBUF
memp_malloc: out of memory in pool NETBUF
memp_malloc: out of memory in pool NETBUF
memp_malloc: out of memory in pool NETBUF
TCP finished
memp_malloc: out of memory in pool NETBUF
TCP start
memp_malloc: out of memory in pool NETBUF
memp_malloc: out of memory in pool NETBUF
memp_malloc: out of memory in pool NETBUF
NTP start
netconn_send: sending 48 bytes
memp_malloc: out of memory in pool NETBUF
memp_malloc: out of memory in pool NETBUF
NTP timeout
memp_malloc: out of memory in pool NETBUF
memp_malloc: out of memory in pool NETBUF

So my questions are: why are there NETBUF allocations during TCP connections attempt? Why these allocations affect UDP? What is the size of NETBUF pool? Does ARP functions use NETBUF?

Best regards,
Grzegorz Niemirowski
http://www.grzegorz.net/

Grzegorz Niemirowski <address@hidden> napisaƂ(a):
Hello
I have a strange problem with UDP packets on my STM32 board. It
communicates  with four hosts:
A - an NTP server in Internet (UDP "connection")
B - a PC running a simple TCP server
C - second board runnging UDP server
D - a WWW server in Internet (providing weather data using JSON)
There is also a WWW server running on my board. I use lwip 1.4.1 with FreeRTOS and socket API. Everything works fine and there are no problems. Except when host B is turned off. Then UDP stops working on my board. It
no  longer synchronizes time over NTP and can't exchange data with host
C. Local  WWW server works OK and the board downloads weather data from
server D. In  other words TCP still works but UDP doesn't.
The problem occurs after B is powered down. There is no problem when B
was  turned off while my lwip board was powered on. There is no problem
when  network service on B is turned off or was turned off. The problem
is only  when the operating system of B is shot down during my board
operating. I can't explain this behavior. My only idea is that there is
a problem with  ARP cache. Maybe powering down host B removes its entry
from ARP cache in  some uncontrolled way which affects UDP memory
allocation? I also traced  down UDP handling. I discovered that in
recv_udp the  memp_malloc(MEMP_NETBUF) function returns NULL. It doesn't
happen during  normal operation. I don't understand why memory can't be
allocated.
Best regards,
Grzegorz Niemirowski
http://www.grzegorz.net/




reply via email to

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