[Re-sending with attachment .sh -> .txt to avoid being blocked]

Hi folks,

I'm working with multiple VPP instances on a same (virtual) machine, in order 
to simulate a topology. Now, I'd like to simulate a topology between ASes with 
BGP. For that, I followed the process described on this page [1], which is for 
one single VPP instance running on the virtual machine. The hardest part is to 
tell FRRouting to run in multiple-instance mode (or something similar, I 
think). I created namespaces for ASes (including hosts) while routers are VPP 
instances (with the router plugin from the VPP Sandbox).

My question is... Is it possible to use FRR (BGP, actually) with multiple VPP 
instances on a same machine ? I get the whole thing about VRF etc on FRR/Quagga 
documentation, but how does it work in order to integrate things with multiple 
VPP instances ? I can't use VRF (at least, I think so), since VPP instances (my 
routers) are NOT running in namespaces. Also, how does FRR know how to 
communicate (do they?) with VPP instances ? The same question could be applied 
to the VPP+BIRD alternative [2].

In attachment, for those who want (or if it helps understanding the use case), 
you will find a graphical representation of the topology as well as a script 
that sets the topology up.

Thanks for your help.
Cheers,

Justin

   [1] https://github.com/FRRouting/frr/wiki/Alternate-forwarding-planes:-VPP
   [2] https://wiki.fd.io/view/VPP_Sandbox/router
# enable kernel forwarding
sudo sysctl -w net.ipv4.ip_forward=1

# VPP Routers
sudo vpp unix { cli-listen /run/vpp/cli-r10.sock } api-segment { prefix r10 }
sudo vpp unix { cli-listen /run/vpp/cli-r20.sock } api-segment { prefix r20 }
sudo vpp unix { cli-listen /run/vpp/cli-r30.sock } api-segment { prefix r30 }
sudo vpp unix { cli-listen /run/vpp/cli-r40.sock } api-segment { prefix r40 }
sleep 1

# AS10 Namespace
sudo ip netns add ns_as10
sudo ip link add name peer_u10 type veth peer name peer_r10
sudo ip link set dev peer_r10 up group 1
sudo ip link set dev peer_u10 up netns ns_as10
sudo ip netns exec ns_as10 \
  bash -c "
    ip link set dev lo up
    ip addr add 80.5.3.2/24 dev peer_u10
    ip route add default via 80.5.3.1
    ethtool -K peer_u10 rx off tx off"

# AS20 Namespace
sudo ip netns add ns_as20
sudo ip link add name peer_u20 type veth peer name peer_r20
sudo ip link set dev peer_r20 up group 1
sudo ip link set dev peer_u20 up netns ns_as20
sudo ip netns exec ns_as20 \
  bash -c "
    ip link set dev lo up
    ip addr add 76.35.2.2/24 dev peer_u20
    ip route add default via 76.35.2.1
    ethtool -K peer_u20 rx off tx off"

# AS30 Namespace
sudo ip netns add ns_as30
sudo ip link add name peer_u30 type veth peer name peer_r30
sudo ip link set dev peer_r30 up group 1
sudo ip link set dev peer_u30 up netns ns_as30
sudo ip netns exec ns_as30 \
  bash -c "
    ip link set dev lo up
    ip addr add 36.7.1.2/24 dev peer_u30
    ip route add default via 36.7.1.1
    ethtool -K peer_u30 rx off tx off"

# AS40 Namespace
sudo ip netns add ns_as40
sudo ip link add name peer_u40_1 type veth peer name peer_r40_1
sudo ip link add name peer_u40_2 type veth peer name peer_r40_2
sudo ip link set dev peer_r40_1 up group 1
sudo ip link set dev peer_r40_2 up group 1
sudo ip link set dev peer_u40_1 up netns ns_as40
sudo ip link set dev peer_u40_2 up netns ns_as40
sudo ip netns exec ns_as40 \
  bash -c "
    ip link set dev lo up
    ip addr add 18.9.5.2/24 dev peer_u40_1
    ip addr add 18.9.4.2/24 dev peer_u40_2
    ip route add 18.9.5.0/24 via 18.9.5.1 dev peer_u40_1
    ip route add 18.9.4.0/24 via 18.9.4.1 dev peer_u40_2
    ethtool -K peer_u40_1 rx off tx off
    ethtool -K peer_u40_2 rx off tx off"

# AS10 <-> R10
sudo vppctl -s /run/vpp/cli-r10.sock create host-interface name peer_r10
sudo vppctl -s /run/vpp/cli-r10.sock set interface state host-peer_r10 up
sudo vppctl -s /run/vpp/cli-r10.sock set interface ip address host-peer_r10 
80.5.3.1/24

# AS20 <-> R20
sudo vppctl -s /run/vpp/cli-r20.sock create host-interface name peer_r20
sudo vppctl -s /run/vpp/cli-r20.sock set interface state host-peer_r20 up
sudo vppctl -s /run/vpp/cli-r20.sock set interface ip address host-peer_r20 
76.35.2.1/24

# AS30 <-> R30
sudo vppctl -s /run/vpp/cli-r30.sock create host-interface name peer_r30
sudo vppctl -s /run/vpp/cli-r30.sock set interface state host-peer_r30 up
sudo vppctl -s /run/vpp/cli-r30.sock set interface ip address host-peer_r30 
36.7.1.1/24

# AS40 <-> R40
sudo vppctl -s /run/vpp/cli-r40.sock create host-interface name peer_r40_1
sudo vppctl -s /run/vpp/cli-r40.sock create host-interface name peer_r40_2
sudo vppctl -s /run/vpp/cli-r40.sock set interface state host-peer_r40_1 up
sudo vppctl -s /run/vpp/cli-r40.sock set interface state host-peer_r40_2 up
sudo vppctl -s /run/vpp/cli-r40.sock set interface ip address host-peer_r40_1 
18.9.5.1/24
sudo vppctl -s /run/vpp/cli-r40.sock set interface ip address host-peer_r40_2 
18.9.4.1/24

# R10 <-> R20
sudo vppctl -s /run/vpp/cli-r10.sock create memif socket id 1 filename 
/run/vpp/memif-r10r20.sock
sudo vppctl -s /run/vpp/cli-r10.sock create interface memif id 0 socket-id 1 
master
sudo vppctl -s /run/vpp/cli-r10.sock set int state memif1/0 up
sudo vppctl -s /run/vpp/cli-r10.sock set int ip address memif1/0 90.6.7.1/30

sudo vppctl -s /run/vpp/cli-r20.sock create memif socket id 1 filename 
/run/vpp/memif-r10r20.sock
sudo vppctl -s /run/vpp/cli-r20.sock create interface memif id 0 socket-id 1 
slave
sudo vppctl -s /run/vpp/cli-r20.sock set int state memif1/0 up
sudo vppctl -s /run/vpp/cli-r20.sock set int ip address memif1/0 90.6.7.2/30

# R10 <-> R30
sudo vppctl -s /run/vpp/cli-r10.sock create memif socket id 2 filename 
/run/vpp/memif-r10r30.sock
sudo vppctl -s /run/vpp/cli-r10.sock create interface memif id 0 socket-id 2 
master
sudo vppctl -s /run/vpp/cli-r10.sock set int state memif2/0 up
sudo vppctl -s /run/vpp/cli-r10.sock set int ip address memif2/0 4.5.8.1/30

sudo vppctl -s /run/vpp/cli-r30.sock create memif socket id 1 filename 
/run/vpp/memif-r10r30.sock
sudo vppctl -s /run/vpp/cli-r30.sock create interface memif id 0 socket-id 1 
slave
sudo vppctl -s /run/vpp/cli-r30.sock set int state memif1/0 up
sudo vppctl -s /run/vpp/cli-r30.sock set int ip address memif1/0 4.5.8.2/30

# R10 <-> R40
sudo vppctl -s /run/vpp/cli-r10.sock create memif socket id 3 filename 
/run/vpp/memif-r10r40.sock
sudo vppctl -s /run/vpp/cli-r10.sock create interface memif id 0 socket-id 3 
master
sudo vppctl -s /run/vpp/cli-r10.sock set int state memif3/0 up
sudo vppctl -s /run/vpp/cli-r10.sock set int ip address memif3/0 30.5.6.1/30

sudo vppctl -s /run/vpp/cli-r40.sock create memif socket id 1 filename 
/run/vpp/memif-r10r40.sock
sudo vppctl -s /run/vpp/cli-r40.sock create interface memif id 0 socket-id 1 
slave
sudo vppctl -s /run/vpp/cli-r40.sock set int state memif1/0 up
sudo vppctl -s /run/vpp/cli-r40.sock set int ip address memif1/0 30.5.6.2/30

# R20 <-> R30
sudo vppctl -s /run/vpp/cli-r20.sock create memif socket id 2 filename 
/run/vpp/memif-r20r30.sock
sudo vppctl -s /run/vpp/cli-r20.sock create interface memif id 0 socket-id 2 
master
sudo vppctl -s /run/vpp/cli-r20.sock set int state memif2/0 up
sudo vppctl -s /run/vpp/cli-r20.sock set int ip address memif2/0 63.1.2.2/30

sudo vppctl -s /run/vpp/cli-r30.sock create memif socket id 2 filename 
/run/vpp/memif-r20r30.sock
sudo vppctl -s /run/vpp/cli-r30.sock create interface memif id 0 socket-id 2 
slave
sudo vppctl -s /run/vpp/cli-r30.sock set int state memif2/0 up
sudo vppctl -s /run/vpp/cli-r30.sock set int ip address memif2/0 63.1.2.1/30

# R30 <-> R40
sudo vppctl -s /run/vpp/cli-r30.sock create memif socket id 3 filename 
/run/vpp/memif-r30r40.sock
sudo vppctl -s /run/vpp/cli-r30.sock create interface memif id 0 socket-id 3 
master
sudo vppctl -s /run/vpp/cli-r30.sock set int state memif3/0 up
sudo vppctl -s /run/vpp/cli-r30.sock set int ip address memif3/0 12.3.3.1/30

sudo vppctl -s /run/vpp/cli-r40.sock create memif socket id 2 filename 
/run/vpp/memif-r30r40.sock
sudo vppctl -s /run/vpp/cli-r40.sock create interface memif id 0 socket-id 2 
slave
sudo vppctl -s /run/vpp/cli-r40.sock set int state memif2/0 up
sudo vppctl -s /run/vpp/cli-r40.sock set int ip address memif2/0 12.3.3.2/30

Attachment: BGP_simple_topo.pdf
Description: Adobe PDF document

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#11524): https://lists.fd.io/g/vpp-dev/message/11524
Mute This Topic: https://lists.fd.io/mt/28637428/21656
Group Owner: vpp-dev+ow...@lists.fd.io
Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to