UDP packet not sent. ARP issue
Ethernet Chips
No replies yet. Be the first to reply.
Join the discussion.
Ethernet Chips
No replies yet. Be the first to reply.
Join the discussion.
Share projects and connect with makers.
Joined before the site update? first.
New to WIZnet Makers?
We sent a verification link to your address. Open it to activate your account, then log in.
Accounts from this email provider are reviewed by an administrator after verification. Approval usually takes one business day.
Already have an account?
Enter your email address. If it belongs to an account, we'll send a link to set a new password. Members who joined before the site update use this to set their password.
If an account uses that address, we sent a link to set a new password. The link works once and expires in 30 minutes.
Know your password?
Need an account?
RE: UDP packet not sent. ARP issue
by Eugeny ·
Antoine, your W5100 seems to have MAC address of a4:0d:76:48:c9:00. It sends ARP packet from already set IP address 192.168.188.181 trying to find out MAC address of the host with IP address 0.0.0.0. Thus W5100 just does not see IP address you write to its socket. I checked my code which works, and see that I write destination IP address and destination port after I open socket in UDP mode. Source port is initialized before I open UDP connection. Try doing the same way.
RE: UDP packet not sent. ARP issue
by Stratehm ·
Thank you for your reply.
Unfortunately, I think it is already what I do. Here are the steps I use to send the packet (after the DHCP process which configure the w5100 with the 192.168.188.181 address):
-Write value 0x02 (UDP mode) to address 0x04000 (S0_MR register) to configure Socket0 to UDP mode.
-Write value 0x07D0 (2000, my source port number) to address 0x0404-0x0405 (S0_PORT register) to set the source port.
-Write value 0x01 (SOCK_OPEN) to address 0x0401 (S0_CR register) to open the Socket0.
-Check value of address 0x403 (S0_SR register) against value 0x22 (SOCK_UDP)
-Write value 0xC0, 0xA8, 0xBC, 0xEB (192.168.188.235, the IP of the remote host) to addresses 0x040C, 0x040D, 0x040E, 0x040F (S0_DIPR register)
-Write value 0x0FA0 (4000, the port of the remote host) to address 0x0410 (S0_DPORT register)
-Write 0xFF (the value I want to send) to address (0x4000 + (S0_TX_WR & 0x07FF)) to set the packet payload.
-Write S0_TX_WR value + 1 to address S0_TX_WR to update Write pointer for the packet payload.
-Write 0x20 (SEND) to address 0x0401 (S0_CR register) to send the packet.
-Check the value of address 0x0401 (S0_CR register) against value 0 to check that the send command is over.
Then I immediatly see the ARP requests with the 0.0.0.0 address.
Maybe you will see something bad in the previous steps.
Thanks.
RE: UDP packet not sent. ARP issue
by Eugeny ·
Looks correct, and I assume (as you can get packets from remote host) you use big endian for register access.
I searched through internet, and found the following:
Subject: RE: what's the meaning of the 0.0.0.0? It's a way of indicating the default gateway. It appears like something is trying to identify the default gateway IP address.[url]Bugtraq
Do you have correct GAR configured? You usually obtain GAR from the DHCP offer/ack packets.
RE: UDP packet not sent. ARP issue
by Stratehm ·
Awesome !
It was indeed the GAR register that was badly set (a bug in my DHCP code. I used the Subnet register instead of the the Gateway Address one).
I would never thought about that, thank you very much.