SOEM icon indicating copy to clipboard operation
SOEM copied to clipboard

Invalid source MAC address used?

Open autoditac opened this issue 2 years ago • 2 comments

Hi,

we have discovered that the Hyper-V VMSwitch (we are using this for VLAN segmentation on our test setups) drops all packets coming from SOEM.

After playing around a bit it seems that Hyper-V VMSwitch does not like the src MAC address SOEM is using by default 01:01:01:01:01:01 since it is set to being multicast, which doesn't really make sense for a source address:

image

After we manually changed the packet to being unicast (the MAC being rewritten to 00:01:01:01:01:01) and retransmitting it, Hyper-V VMSwitch correctly forwards the packet:

image

Is this intended that way and a misunderstanding on our side or is this a bug in SOEM?

Thanks and kind regards :-)

autoditac avatar Feb 21 '23 14:02 autoditac

SOEM was never tested to be used in a VLAN environment. But as you see, the solution to your problem is very simple.

You can set any source MAC address you like. There is one requirement, the U/L bit must not be set as that is used to differentiate outgoing from returning packets. EtherCAT slaves set the U/L bit to signal they have passed the ESC.

The original intend to set the I/G bit was to be able to use switches as star topology elements. It did work on a few old switches, but nowadays this is very rare to succeed. So consider it legacy.

ArthurKetels avatar Feb 23 '23 10:02 ArthurKetels

https://github.com/OpenEtherCATsociety/SOEM/blob/master/oshw/erika/nicdrv.c and https://github.com/OpenEtherCATsociety/SOEM/blob/master/oshw/rtems/nicdrv.c

are setting U/L bit

I can make a fix to this and have sent signed Contributor License Agreement, let's see if i get access :)

nt15 avatar Mar 06 '23 09:03 nt15