UDP broadcast, no response
used HW and SW:
* LM3S9B92 board with code sample: enet_lwip
* Stellaris Board Finder (Finder.exe)
PC Network card address: 192.168.33.254 (255.255.255.0)
LM3S9B92 IP address: 192.168.34.4 (255.255.255.0)
The problem:
1. The Finder.exe send an UDP broadcast to all connected devices
2. The UDP packet is received from the LM3S9B92 board
3. The LM3S9B92 board should send the UDP respond to the PC
(see debug output below, I added additional lines when enter and leave LocaterReceive() )
==> BUG: no data are transmitted from the board to the PC.(see wireshark dump)
The lwip stack seems to work correctly,
maybe there is a bug in the port from the lwip stack to the LM3S9B92,
or a problem with the processor
Note: If I change the IP Address from the PC network card to 192.168.34.254, the data are received from the PC
see debug output from the lwip stack:
ip_input: iphdr->dest 0xffffffff netif->ip_addr 0x422a8c0 (0xffffff, 0x22a8c0, 0xff000000)
ip_input: packet accepted on interface lm
ip_input:
IP header:
+-------------------------------+
| 4 | 5 | 0x00 | 32 | (v, hl, tos, len)
+-------------------------------+
| 1232 |000| 0 | (id, flags, offset)
+-------------------------------+
| 128 | 17 | 0x5357 | (ttl, proto, chksum)
+-------------------------------+
| 192 | 168 | 33 | 254 | (src)
+-------------------------------+
| 255 | 255 | 255 | 255 | (dest)
+-------------------------------+
ip_input: p->len 32 p->tot_len 32
udp_input: received datagram of length 12
UDP header:
+-------------------------------+
| 23 | 23 | (src port, dest port)
+-------------------------------+
| 12 | 0x1b02 | (len, chksum)
+-------------------------------+
udp (255.255.255.255, 23) <-- (192.168.33.254, 23)
pcb (0.0.0.0, 23) --- (0.0.0.0, 0)
udp_input: calculating checksum
inet_chksum_pseudo(): checksumming pbuf 20008064 (has next 0)
inet_chksum_pseudo(): pbuf chain lwip_chksum()=ffff
now in LocaterReceive()---------------------------------
udp_send
udp_send: added header in given pbuf 20000008
udp_send: sending datagram of length 92
udp_send: UDP packet length 92
inet_chksum_pseudo(): checksumming pbuf 20000008 (has next 0)
inet_chksum_pseudo(): pbuf chain lwip_chksum()=ed2d
udp_send: UDP checksum 0x12d2
udp_send: ip_output_if (,,,,IP_PROTO_UDP,)
ip_output_if: lm0
IP header:
+-------------------------------+
| 4 | 5 | 0x00 | 112 | (v, hl, tos, len)
+-------------------------------+
| 4 |000| 0 | (id, flags, offset)
+-------------------------------+
| 255 | 17 | 0xf625 | (ttl, proto, chksum)
+-------------------------------+
| 192 | 168 | 34 UDP Broadcast, no response
| 4 | (src)
+-------------------------------+
| 192 | 168 | 33 | 254 | (dest)
+-------------------------------+
netif->output()
now exit LocaterReceive()--------------------------------
---- received Wireshark data ---------------------------------------------------------------
Frame 11: 46 bytes on wire (368 bits), 46 bytes captured (368 bits)
Ethernet II, Src: AsustekC_29:c2:10 (bc:ae:c5:29:c2:10), Dst: Broadcast (ff:ff:ff:ff:ff:ff)
Internet Protocol, Src: 192.168.33.254 (192.168.33.254), Dst: 255.255.255.255 (255.255.255.255)
User Datagram Protocol, Src Port: telnet (23), Dst Port: telnet (23)
Data (4 bytes)
--------------------------------------------------------------------------------------------
Regards,
Anton
