Project

General

Profile

Ethercard and udp: unicast, broadcast and multicast

Added by jostor about 5 years ago

Hi,
I am having some problems with ethercard and UDP.
First of all: everything is working fine when sending broadcast (DestIP=255.255.255.255). All computers listening on the right port receives what I am sending.

When I try sending only to one specific IP address (unicast) i get problems. I am running wireshark on both a computer placed between the Arduino and the ethernet, and on another computer on the network. I see in wireshark that a UDP packet is sent. But it is not received by the other computer in the network. The destination IP address on the packet is correct, but the destination MAC address is the MAC address of the gateway, not the receiver computer. Isn’t this wrong? I am also looking at the ARP messages sent after the Arduino boots, It only asks for the MAC address of the gateway, not for the MAC address of the destination IP. I think there are some problems with the library here. Am I correct?

When I am sending to a multicast address, I see that the MAC address is set to FF FF FF FF FF FF (broadcast address). Is this correct? Would not this this mean that all messages are broadcasted on the entire network instead of only being sent to the multicast group? From what I understand the multicast MAC address should look like described here: http://subnettingmadeeasy.blogspot.no/2011/02/how-to-calculate-multicast-mac-address.html

Hope someone can answer me on this. I may have misunderstood a couple of things here, so please feel free to correct me!