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

Initial support of VxLAN BGP EVPN #99

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
VxLAN: initial support of VxLAN EVPN
- Implemented create/remove VxLAN tunnel offloading to VPP
- Enabled VPP's vxlan_plugin.so by default
- Implemented but not used create/remove VxLAN-GRE tunnel offloading

Signed-off-by: Oleksiy Holubnychyy <oleksiy.holubnychyy@globallogic.com>
oholubnychyy committed Jul 5, 2024
commit 8a0cae55086dd43d35cdb556f4095554c96b25f4
144 changes: 144 additions & 0 deletions docs/vxlan-evpn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
VxLAN EVPN
==========

## Setup

Build the following virtual setup in your favorite way (e.g. in GNS3).
Leaf-1 and Leaf-2 are VM's running sonic_vm (sonic-platform-vpp one).
Host-1 and Host-2 are VM's of your choice.

```
Ethernet1 Ethernet3 Ethernet3 Ethernet1
Host-1 <------------------------> Leaf-1 <-------------------------------> Leaf-2 <--------------------------> Host-2
192.168.1.1 10.10.10.1 10.10.10.2 192.168.1.1
```

## Configuration

### Leaf-1

```
config hostname Leaf-1
config save -y


config interface ip add Ethernet3 10.10.10.1/24
config interface ip add Loopback0 1.1.1.1/32
config route add prefix 1.1.1.2/32 nexthop 10.10.10.2

config vlan add 100
config vlan member add -u 100 Ethernet1
config vlan member add -u 100 Ethernet2

config vxlan add vtep0 1.1.1.1
config vxlan evpn_nvo add nvo vtep0
config vxlan map add vtep0 100 7000



# Configure BGP (IPv4 + EVPN)

vtysh
!
configure
hostname Leaf-1
log syslog informational
log facility local4
agentx
no service integrated-vtysh-config
!
password zebra
enable password zebra
!
router bgp 65100
bgp router-id 1.1.1.1
bgp log-neighbor-changes
no bgp ebgp-requires-policy
bgp bestpath as-path multipath-relax
neighbor 10.10.10.2 remote-as 65100
!
address-family ipv4 unicast
network 1.1.1.1/32
maximum-paths 64
exit-address-family
!
address-family l2vpn evpn
neighbor 10.10.10.2 activate
advertise-all-vni
exit-address-family
exit
!
end
write
exit
```

### Leaf-2

```
config hostname Leaf-2
config save -y


config interface ip add Ethernet3 10.10.10.2/24
config interface ip add Loopback0 1.1.1.2/32
config route add prefix 1.1.1.1/32 nexthop 10.10.10.1

config vlan add 100
config vlan member add -u 100 Ethernet1
config vlan member add -u 100 Ethernet2

config vxlan add vtep0 1.1.1.2
config vxlan evpn_nvo add nvo vtep0
config vxlan map add vtep0 100 7000


# Configure BGP (IPv4 + EVPN)

vtysh
!
configure
hostname Leaf-2
log syslog informational
log facility local4
agentx
no service integrated-vtysh-config
!
password zebra
enable password zebra
!
router bgp 65100
bgp router-id 1.1.1.2
bgp log-neighbor-changes
no bgp ebgp-requires-policy
bgp bestpath as-path multipath-relax
neighbor 10.10.10.1 remote-as 65100
!
address-family ipv4 unicast
network 1.1.1.2/32
maximum-paths 64
exit-address-family
!
address-family l2vpn evpn
neighbor 10.10.10.1 activate
advertise-all-vni
exit-address-family
exit
!
end
write
exit

```

## Test

BGP needs some time to update VxLan endpoints so wait 1-2 minutes (or less).
Then try to ping.
From Host-1:
```
ping 192.168.1.2
```
Ping should work

If you capture traffic between Lefa-1 and Leaf-2 you can observe encapsulated ICMP packets.
21 changes: 21 additions & 0 deletions platform/saivpp/vpplib/SwitchStateBase.h
Original file line number Diff line number Diff line change
@@ -755,6 +755,27 @@ namespace saivpp
_In_ const sai_attribute_t *attr_list,
_Out_ nexthop_grp_config_t **nxthop_group_cfg);

protected:
// VXLAN
sai_status_t vpp_create_vxlan_tunnel(
_In_ sai_object_id_t br_port_id,
_In_ sai_object_id_t vlan_oid,
_Out_ uint32_t *if_ind);
sai_status_t vpp_create_vxlan_tunnel(
_In_ const sai_attribute_t *sip_attr,
_In_ const sai_attribute_t *dip_attr,
_In_ const sai_attribute_t *vni_attr,
_Out_ uint32_t *if_ind);
sai_status_t vpp_remove_vxlan_tunnel(
_In_ uint32_t if_ind);
sai_status_t vpp_find_vni(
_In_ sai_uint16_t vlan,
_In_ const sai_attribute_t *decap_attr,
_Out_ const sai_attribute_t **vni_attr);

std::map<sai_object_id_t , uint32_t> m_tunnel_oid_to_iface_map;


protected:
sai_status_t createRouterif(
_In_ sai_object_id_t object_id,
Loading