Home > other >  About W5500 chip UDP sends a message to a different IP
About W5500 chip UDP sends a message to a different IP

Time:09-15

Ask the masters about W5500 chip UDP sends a message to a different IP problem!


DSP W5500 through SPI configuration on printed circuit boards, set up three socket, using UDP point-to-point model through a switch to 3 PCS (three IP address) to send the same message, each socket send 1 per second, problem description is as follows:
1, 3 a computer connection cable, receiving UDP packets are normal;
2, only 2 computer connection cables, per second, expect every computer only received 1 set of messages, but the actual testing a computer message received 1 group, 2 group message another computer received;
3, when only one computer connection cables, per second, expect the computer only received 1 set of messages, but the actual test when the computer received 3 groups of message, not through the switch is also the same phenomenon,


Problem:
1, W5500 to three IP, UDP packets, regardless of the connected computers are 1, 2, or 3, the total number of packets received is always 3 groups, only the 3 groups will be assigned to the connected message network computer;
2, connect the computer 1 or 2 sets, can be seen from the three groups per second, time scale of a message, message is one of a second, there are 2 set of message is this,


Question:
1, I understand is: before the UDP send message just set the destination IP and destination port, not connected IP is ignored, lost packets, and should not be sent to the other IP?
2, whether to need to query the real-time connected IP, confirm the connection can be sent, not connected is not sent, if so, how to implement?
3, W5500 ARP is involved in this?

Thank you very much!

CodePudding user response:

Three IP? Don't own our destination IP datagram can receive?
Add a serial number or timestamp should be able to,

CodePudding user response:

One of the characteristics of UDP is a connectionless, unless the other party will reply message, otherwise you won't know each other whether can reach, don't know whether received;
You met in the question situation, should be the logic of the code itself you have any question, please carefully check code, once the IP, protocol, port, will not happen this kind of hair wrong,

CodePudding user response:

refer to the second floor X - I - n reply:
one of the characteristics of UDP is a connectionless, unless the other party will reply message, otherwise you won't know each other whether can reach, don't know whether to receive;
You met in the question situation, should be the logic of the code itself you have any question, please carefully check code, once the IP, protocol, port, will not happen to the hair wrong situation,


Checked the code logic, found only initialize a socket 0, UDP mode, respectively after cycles per second to send the same three IP packet (packet with a little delay added),

This way of use if there is a problem, should establish three socket, then respectively to three IP packet?

CodePudding user response:

Can be a three, the problem should be still in your code,
  • Related