Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid source MAC address used? #678

Open
autoditac opened this issue Feb 21, 2023 · 2 comments · May be fixed by #683
Open

Invalid source MAC address used? #678

autoditac opened this issue Feb 21, 2023 · 2 comments · May be fixed by #683

Comments

@autoditac
Copy link

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 :-)

@ArthurKetels
Copy link
Contributor

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.

@nt15
Copy link

nt15 commented Mar 6, 2023

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 nt15 linked a pull request Mar 7, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants