-
Notifications
You must be signed in to change notification settings - Fork 328
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
MAC learning #180
Comments
Hi Christian, AFAIK, learning has been fully implemented. Note that all |
Hi Antonin, I followed your instructions. I started l2_switch with the additional parameter
to enable forwarding of notifications to the address that the Thank you! |
There might be a bug in the learning engine: If I pass the first time a network packet to switch port 1, the new SRC MAC of the packet is notified and the
So far, so good, but when I send a following packet with a different SRC MAC to switch port 2, the client outputs:
Subsequently port 101 (instead of port 2) is associated with the SRC MAC address in table 'dmac':
Where the magic numbers 257 and 101 might come from? |
Well 0x101 is 257 so that's really one magic number :) |
I launched the switch by command:
Thereafter I sent the first network packet (SRC MAC aabbccddeef1, DST MAC aabbccddeef2) on port 1 and subsequently the second packet (SRC MAC aabbccddeef2, DST MAC aabbccddeef1) on port 2. For the second packet the switch generated the following output:
Some output removed for brevity...
OK - port 1 is the right output port!
Everything is fine up to here, but the last line of switch logging output contains the magic number that associates MAC aabbccddeef2 with port 257:
Content of table 'dmac':
|
This was addressed in ff0cdf4 |
If the l2_switch example is not enough for you, I believe @jafingerhut has an example here: https://github.com/jafingerhut/p4-guide/tree/master/control-plane-types |
FYI, I do not recall any code example in my p4-guide Github repository have working examples of digests sent to control software, at least not yet. The program you link to does have P4_16 source code that calls the v1model digest extern function, but I have never tried to get those messages to control software before. |
The question didn't specifically mention control plane software.
And I believe the P4Runtime spec is pretty comprehensive regarding digest generation. |
Hi,
I am trying to set up an P4 Switch with MAC learning support. My P4 program is based on your behavioral-model 2 and your l2_switch implementation https://github.com/p4lang/behavioral-model/tree/master/targets/l2_switch
I guess this switch support MAC learning by calling the method generate_digest(). But actually it doesn't work. Source and destination MACs are not recognized for incoming packets. I checked via runtime_CLI if all tables and default actions are installed correctly - seems to be fine.
Is the learning functionality still under development?
Best regards,
Christian
The text was updated successfully, but these errors were encountered: