Hoi folks,

Currently, SRv6 encap sits on the device-input arc. This means one cannot use a sub-interface to be the ingress point for L2 transport. It's quite common for me to have a 100G interface from VPP to a breakout switch, so being able to pick up SRv6 L2 transport on a sub-interface is a useful feature.

I took a look at src/vnet/srv6/ and noticed that the original intention was to be able to provide behavior DX2 (egress L2 cross connect) but using a field called vlan_index; however two problems with it:
1) that assumes single tagged dot1q interfaces. Other encapsulations exist.
2) it was never implemented :) the code throws an error when trying to use DX2 with a 'vlan' argument.

On egress, we can already send the frame in sr-localsid-d to output using sw_if_index, and VLAN encapsulation will happen there. It actually already worked as-is. On ingress, we force the interface to be a hardware interface. I've changed it to allow sub-interfaces, after which an L2 feature is enabled and the frames are forwarded to the sr-pl-rewrite-encaps-l2 node.

I've given this a go at https://gerrit.fd.io/r/c/vpp/+/44899 and it includes tests for L2 encap/decap on PHY and sub-int. It is not ready for submission yet, there is one remaining issue.

## PHY
set sr encaps source addr 2001:678:d78:200::
sr policy add bsid 8298::2:1 next 2001:678:d78:20F::3:1 encap
sr steer l2 GigabitEthernet10/0/2 via bsid 8298::2:1
sr localsid address 2001:678:d78:20f::0:1 behavior end.dx2 GigabitEthernet10/0/2
set int state GigabitEthernet10/0/2 up

## SUB
sr policy add bsid 8298::2:2 next 2001:678:d78:20F::3:2 encap
create sub-interfaces GigabitEthernet10/0/2 100
sr steer l2 GigabitEthernet10/0/2.100 via bsid 8298::2:2
sr localsid address 2001:678:d78:20f::0:2 behavior end.dx2 GigabitEthernet10/0/2.100
set int state GigabitEthernet10/0/2.100 up

There is one outstanding issue, and that is that traffic on sub is still accounted towards the localsid for PHY
vpp# show sr localsids
SRv6 - My LocalSID Table:
=========================
        Address:        2001:678:d78:20f::1/128
        Behavior:       DX2 (Endpoint with decapulation and Layer-2 cross-connect)
        Iface:          GigabitEthernet10/0/2
        Good traffic:   [638368223 packets : 934459293795 bytes]
        Bad traffic:    [0 packets : 0 bytes]
--------------------
        Address:        2001:678:d78:20f::2/128
        Behavior:       DX2 (Endpoint with decapulation and Layer-2 cross-connect)
        Iface:          GigabitEthernet10/0/2.100
        Good traffic:   [0 packets : 0 bytes]
        Bad traffic:    [0 packets : 0 bytes]

I'll try to get to the bottom of that next week. If anybody wants to take a look in the mean while, please let me know what you think.

groet,
Pim

--
Pim van Pelt<[email protected]>
PBVP1-RIPEhttps://ipng.ch/

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#26802): https://lists.fd.io/g/vpp-dev/message/26802
Mute This Topic: https://lists.fd.io/mt/117772452/21656
Group Owner: [email protected]
Unsubscribe: https://lists.fd.io/g/vpp-dev/leave/14379924/21656/631435203/xyzzy 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to