Not seeing UDP packets via wireshark using sendto function
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: Not seeing UDP packets via wireshark using sendto function
by Eugeny ·
Any? Even no ARP packets?
RE: RE: Not seeing UDP packets via wireshark using sendto function
by jmorganj ·
Nothing shows up. It is like nothing was ever sent out. I have seen normal TCP and UDP messages without issue by using the loopback functions provided in the example library. The only difference I see between those and trying to use the DNS library is that DNS uses the sendto() function vs. just send() in the loopback examples. Of course the loop backs get their destination address by receiving a message while in the DNS library, the destination port and IP are set before calling send(). Setting seems to work properly using these built in functions:
I did have to fix an issue in the DNS library. In socket.c in the sendto() function, the following lines except for the second line were commented out
Therefore since the socket was for UDP, an error was always returned, preventing reaching the wiz_send_data() function. I just uncommented the entire preprocessor defines and the other if statement and now get to the send functionality. I also have verified that the tx buffer on the chip has plenty of room to send out the message. In fact, it is completely free.
Is there really anything outside of setting up the socket and then sending any arbitrary message where I should be seeing results show up in wireshark? I’d assume even wrongly formatted packets should still be seen, even if it meant the MDNS server was unable to parse them and make a reply. Also, I am running bonjour on my laptop in order to process MDNS messages.
RE: Not seeing UDP packets via wireshark using sendto function
by Eugeny ·
Two suggestions:
You must see ARP packets. If you do not see them then your Wireshark does not get all the traffic.
RE: Not seeing UDP packets via wireshark using sendto function
by jmorganj ·
Thanks for your suggestions Eugeny. I went ahead and used the disconnect() function on socket initialization as you suggested and then I changed the port to 5004 for opening the socket. I can now see MDNS messages in Wireshark. I have one more question before resolving this thread. I consistently get a timeout when sending the query. It looks like the status “Sn_IR_SENDOK” is expected to return in order to avoid a timeout. What are the conditions of this status being sent back? Is it just an ACK from the MDNS server in this case?
RE: RE: Not seeing UDP packets via wireshark using sendto function
by Eugeny ·
Where do you get timeout? SENDOK is socket indication of the successful send of the packet into the wire. It has nothing to do with another node replying to that packet. If you get timeout because of bad communication with another network node, then problem is in different location of the algorithm/code, or in contents of the packet being sent (which is being dropped at the remote node’s end and not answered).
That’s why I was constantly asking you if you see anything on the wire. SEND command performs ARP first to identify MAC address of the remove node, and you normally see this packet in the Wireshark. As soon as 224.0.0.251 is not a valid local network IP address, ARP request will not be answered, and SEND will time out/return the error. And it seems you are correct in your case you must bypass ARP phase, and SEND_MAC is the one to use. However take care about DHAR field value to be in accordance to the protocol definition (e.g. 0:0:0:0:0:0).
RE: Not seeing UDP packets via wireshark using sendto function
by jmorganj ·
Eugeny ,
I went ahead and looked at other answers based on timeouts and found one here. Using Andrej_Buryachenko’s answer, I changed the Sn_CR_SEND to Sn_CR_SEND_MAC and I don’t see anymore issues and I see a full MDNS query in WireShark coming from the W5500 chip.