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

Import IPv4/6 routes from VRF tables to the Global RIB as EVPN IP Prefix #2856

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

lucasolim
Copy link

Adding the option to import IPv4/6 routes from VRF tables to the Global table as EVPN Type 5

The current behavior is:

For neighbors attached to VRFs, IPv4/6 routes are imported as VPNv4/6 to the Global RIB. For example:

root@9652c769b373:/go# gobgp vrf blue neighbor
Peer          AS  Up/Down State       |#Received  Accepted
172.17.0.5 65001 00:00:48 Establ      |        1         1
172.17.0.6 65001 00:00:48 Establ      |        1         1

root@9652c769b373:/go# gobgp vrf blue neighbor
Peer          AS  Up/Down State       |#Received  Accepted
172.17.0.5 65001 00:00:48 Establ      |        1         1
172.17.0.6 65001 00:00:48 Establ      |        1         1

root@9652c769b373:/go# gobgp vrf blue rib
   Network              Next Hop             AS_PATH              Age        Attrs
*  10.0.0.0/24          172.17.0.5                                00:01:50   [{Origin: ?} {LocalPref: 100}]

root@9652c769b373:/go# gobgp vrf red rib
   Network              Next Hop             AS_PATH              Age        Attrs
*  10.0.0.0/24          172.17.0.2                                00:01:50   [{Origin: ?} {LocalPref: 100}]

root@9652c769b373:/go# gobgp global rib -a vpnv4
   Network              Labels     Next Hop             AS_PATH              Age        Attrs
*> 10:10:10.0.0.0/24    [0]        172.17.0.2                                00:02:43   [{Origin: ?} {LocalPref: 100} {Extcomms: [10:10]}]
*> 20:20:10.0.0.0/24    [0]        172.17.0.5                                00:02:43   [{Origin: ?} {LocalPref: 100} {Extcomms: [20:20]}]

After this change, we can configure the VRF to convert to EVPN Type 5 (IP Prefix) instead of VPNv4/v6:

config file:

...
...
[[vrfs]]
    [vrfs.config]
        name = "blue"
        rd = "20:20"
        both-rt-list = ["20:20"]
        import-as-evpn-ipprefix = true
        routers-mac = "ca:fe:00:00:fe:ed"
        ethernet-tag = 200
[[vrfs]]
    [vrfs.config]
        name = "red"
        rd = "10:10"
        both-rt-list = ["10:10"]
        import-as-evpn-ipprefix = true
        routers-mac = "ca:fe:00:00:be:ef"
        ethernet-tag = 100

and

root@dc00a25785dd:/go# gobgp vrf
  Name                 RD                   Import RT            Export RT            Router's MAC         ID    Import as EVPN       Ethernet Tag
  blue                 20:20                20:20                20:20                ca:fe:00:00:fe:ed    0     true                 200
  red                  10:10                10:10                10:10                ca:fe:00:00:be:ef    0     true                 100

root@dc00a25785dd:/go# gobgp global rib -a evpn
*> [type:Prefix][rd:20:20][etag:200][prefix:10.0.0.0/24] [0]        172.17.0.5                                00:00:41   [{Origin: ?} {LocalPref: 100} {Extcomms: [20:20], [router's mac: ca:fe:00:00:fe:ed]} [ESI: single-homed] [GW: 0.0.0.0]]
*> [type:Prefix][rd:10:10][etag:100][prefix:10.0.0.0/24] [0]        172.17.0.2                                00:00:28   [{Origin: ?} {LocalPref: 100} {Extcomms: [10:10], [router's mac: ca:fe:00:00:be:ef]} [ESI: single-homed] [GW: 0.0.0.0]]

Lucas Lima and others added 5 commits November 15, 2024 15:25
…al table as EVPN Type 5

The current behavior is:

For neighbors attached to VRFs, IPv4/6 routes are imported as VPNv4/6 to the
Global RIB. For example:

```
root@9652c769b373:/go# gobgp vrf blue neighbor
Peer          AS  Up/Down State       |#Received  Accepted
172.17.0.5 65001 00:00:48 Establ      |        1         1
172.17.0.6 65001 00:00:48 Establ      |        1         1

root@9652c769b373:/go# gobgp vrf blue neighbor
Peer          AS  Up/Down State       |#Received  Accepted
172.17.0.5 65001 00:00:48 Establ      |        1         1
172.17.0.6 65001 00:00:48 Establ      |        1         1

root@9652c769b373:/go# gobgp vrf blue rib
   Network              Next Hop             AS_PATH              Age        Attrs
*  10.0.0.0/24          172.17.0.5                                00:01:50   [{Origin: ?} {LocalPref: 100}]

root@9652c769b373:/go# gobgp vrf red rib
   Network              Next Hop             AS_PATH              Age        Attrs
*  10.0.0.0/24          172.17.0.2                                00:01:50   [{Origin: ?} {LocalPref: 100}]

root@9652c769b373:/go# gobgp global rib -a vpnv4
   Network              Labels     Next Hop             AS_PATH              Age        Attrs
*> 10:10:10.0.0.0/24    [0]        172.17.0.2                                00:02:43   [{Origin: ?} {LocalPref: 100} {Extcomms: [10:10]}]
*> 20:20:10.0.0.0/24    [0]        172.17.0.5                                00:02:43   [{Origin: ?} {LocalPref: 100} {Extcomms: [20:20]}]
```

After this change, we can configure the VRF to convert to EVPN Type 5 (IP Prefix)
instead of VPNv4/v6:

```
config file:
...
...
[[vrfs]]
    [vrfs.config]
        name = "blue"
        rd = "20:20"
        both-rt-list = ["65000:200"]
        import-as-evpn-ipprefix = true
        routers-mac = "ca:fe:00:00:be:ef"
        ethernet-tag = 100

root@dc00a25785dd:/go# gobgp vrf
  Name                 RD                   Import RT            Export RT            Router's MAC         ID    Import as EVPN       Ethernet Tag
  blue                 20:20                20:20                20:20                ca:fe:00:00:fe:ed    0     true                 200
  red                  10:10                10:10                10:10                ca:fe:00:00:be:ef    0     true                 100

root@dc00a25785dd:/go# gobgp global rib -a evpn
*> [type:Prefix][rd:20:20][etag:200][prefix:10.0.0.0/24] [0]        172.17.0.5                                00:00:41   [{Origin: ?} {LocalPref: 100} {Extcomms: [20:20], [router's mac: ca:fe:00:00:fe:ed]} [ESI: single-homed] [GW: 0.0.0.0]]
*> [type:Prefix][rd:10:10][etag:100][prefix:10.0.0.0/24] [0]        172.17.0.2                                00:00:28   [{Origin: ?} {LocalPref: 100} {Extcomms: [10:10], [router's mac: ca:fe:00:00:be:ef]} [ESI: single-homed] [GW: 0.0.0.0]]

```
@lucasolim
Copy link
Author

Tests fixed

@fujita
Copy link
Member

fujita commented Dec 30, 2024

What use cases is this feature intended for?

@lucasolim
Copy link
Author

The scenario where this feature would be useful is the following:

  • A server running a hypervisor to deploy VMs
  • The network virtualization layer is implemented by the DPU attached to the server
  • VMs live in overlay networks (VXLAN), same server can deploys VMs in different VXLANs (VXLAN encap/decap layer is in the DPU)
  • GoBGP runs in the DPU, that is a linux box
  • Each VXLAN overlay network has its correspondent network namespace in the DPU, so VMs can access link-local services. For example, if a server deploys VM 1 in VXLAN 1, VM2 and VM3 in VXLAN2, the DPU implements 2 netns, one related to VXLAN1 and one related to VXLAN2
  • GoBGP also runs in every netns, so VMs can peer with them to announce anycasts
  • GoBGP in net namespaces peer with GoBGP in the standard namespace, each one in a separate VRF to allow overlapping anycast ranges
  • IP4/6 Routes in the VRFs are imported to the global rib as EVPN Type 5 routes (instead of L3VPN)
  • Anycast routes are propagated to other DPUs through Route Reflectors.

@fujita
Copy link
Member

fujita commented Jan 10, 2025

Any other BGP implementation to support such feature?

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