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

Add support for the SRv6 End.DT46 behavior #1037

Merged
merged 2 commits into from
Oct 3, 2022

Conversation

cscarpitta
Copy link
Contributor

@cscarpitta cscarpitta commented Oct 3, 2022

This PR adds the support for the SRv6 End.DT46 behavior.

The SRv6 End.DT46 behavior is used to implement L3VPN use-cases in multi-tenants environments. It decapsulates the received packets and it performs IPv4 or IPv6 routing lookup in the routing table of the tenant.

The SRv6 End.DT46 behavior has been introduced in the Linux kernel in the commit [1] and it is available since kernel version 5.15.
The iproute2 suite has been extended as well for supporting the SRv6 End.DT46 behavior [2].

An example iproute2 command to instantiate an SRv6 End.DT46 behavior is the following:

$ ip -6 route add 2001:db8::1 encap seg6local action End.DT46 vrftable 100 dev vrf100.

In the above command, the vrftable attribute indicates the routing table associated with the VRF device used by SRv6 End.DT46 for routing IP packets.

The only prerequisite to instantiate an End.DT46 behavior is enabling the VRF strict_mode sysctl parameter

$ sysctl -wq net.vrf.strict_mode=1

Hereafter, we provide an example of how to instantiate an SRv6 End.DT46 behavior with pyroute2.

First, a VRF needs to be created:

	ip.link('add',
	           ifname='vrf-foo',
	           kind='vrf',
	           vrf_table=100)

Then, the following command can be used to instantiate the behavior:

	ip.route('add',
	             dst='2001:db8::1/128',
	             oif=idx,
	             encap={'type': 'seg6local',
	                          action': 'End.DT46',
	                          'vrf_table': 100})

[1] https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/commit/?id=8b532109bf885b7b59b93487bc4672eb6d071b78
[2] https://www.spinics.net/lists/netdev/msg749223.html

This PR adds the support for the SRv6 End.DT4 behavior.

The SRv6 End.DT46 behavior is used to implement L3VPN use-cases
in multi-tenants environments. It decapsulates the received packets
and it performs IPv4 or IPv6 routing lookup in the routing table
of the tenant.

The SRv6 End.DT46 behavior has been introduced in the Linux kernel
in the commit [1] and it is available since kernel version 5.15.
The iproute2 suite has been extended as well for supporting the SRv6
End.DT46 behavior [2].

An example iproute2 command to instantiate an SRv6 End.DT46 behavior
is the following::

`  $ ip -6 route add 2001:db8::1 encap seg6local action End.DT46 vrftable 100 dev vrf100.`

In the above command, the `vrftable` attribute indicates the routing
table associated with the VRF device used by SRv6 End.DT46 for routing
IP packets.

The only prerequisite to instantiate an End.DT46 behavior is enabling
the VRF `strict_mode` sysctl parameter

` $ sysctl -wq net.vrf.strict_mode=1`

Hereafter, we provide an example of how to instantiate an SRv6 End.DT46
behavior with pyroute2.

First, a VRF needs to be created:

```
	ip.link('add',
	           ifname='vrf-foo',
	           kind='vrf',
	           vrf_table=100)
```

Then, the following command can be used to instantiate the behavior:

```
	ip.route('add',
	             dst='2001:db8::1/128',
	             oif=idx,
	             encap={'type': 'seg6local',
	                          action': 'End.DT46',
	                          'vrf_table': 100})
```

[1] https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/commit/?id=8b532109bf885b7b59b93487bc4672eb6d071b78
[2] https://www.spinics.net/lists/netdev/msg749223.html
@svinota svinota merged commit 62dd04c into svinota:master Oct 3, 2022
@svinota
Copy link
Owner

svinota commented Oct 3, 2022

Wow. Great, thanks a lot!

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 this pull request may close these issues.

2 participants