documentation:examples:ecmp
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
documentation:examples:ecmp [2019/10/30 14:45] – [Router 1 (client)] olivier | documentation:examples:ecmp [2020/09/19 17:36] – [VM 2 (ECMP router)] olivier | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Equal-cost multi-path routing (ECMP) ====== | ====== Equal-cost multi-path routing (ECMP) ====== | ||
- | This lab show an ECMP (feature called RADIX_MPATH on FreeBSD) | + | This lab is testing new ECMP routing |
===== Presentation ===== | ===== Presentation ===== | ||
Line 84: | Line 84: | ||
< | < | ||
- | sysrc hostname=R1 | + | sysrc hostname=VM1 \ |
- | sysrc gateway_enable=NO | + | gateway_enable=NO |
- | sysrc ipv6_gateway_enable=NO | + | ipv6_gateway_enable=NO |
- | sysrc ifconfig_vtnet0=" | + | ifconfig_vtnet0=" |
- | sysrc ifconfig_vtnet0_alias1=" | + | ifconfig_vtnet0_alias1=" |
- | sysrc ifconfig_vtnet0_alias2=" | + | ifconfig_vtnet0_alias2=" |
- | sysrc ifconfig_vtnet0_alias3=" | + | ifconfig_vtnet0_alias3=" |
- | sysrc ifconfig_vtnet0_alias4=" | + | ifconfig_vtnet0_alias4=" |
- | sysrc ifconfig_vtnet0_alias5=" | + | ifconfig_vtnet0_alias5=" |
- | sysrc ifconfig_vtnet0_ipv6=" | + | ifconfig_vtnet0_ipv6=" |
- | sysrc ifconfig_vtnet0_alias61=" | + | ifconfig_vtnet0_alias61=" |
- | sysrc ifconfig_vtnet0_alias62=" | + | ifconfig_vtnet0_alias62=" |
- | sysrc ifconfig_vtnet0_alias63=" | + | ifconfig_vtnet0_alias63=" |
- | sysrc ifconfig_vtnet0_alias64=" | + | ifconfig_vtnet0_alias64=" |
- | sysrc ifconfig_vtnet0_alias65=" | + | ifconfig_vtnet0_alias65=" |
- | sysrc defaultrouter=" | + | defaultrouter=" |
- | sysrc ipv6_defaultrouter=" | + | ipv6_defaultrouter=" |
service hostname restart | service hostname restart | ||
service netif restart | service netif restart | ||
Line 107: | Line 107: | ||
</ | </ | ||
- | ==== Router | + | ==== VM 2 (ECMP router) ==== |
- | R2 is a router with ECMP: 2 static routes toward the same destination but using 2 different next-hop. | + | VM 2 is a router with ECMP: 2 static routes toward the same destination but using 2 different next-hop. |
< | < | ||
- | sysrc hostname=R2 | + | sysrc hostname=VM2 \ |
- | sysrc ifconfig_vtnet0=" | + | ifconfig_vtnet0=" |
- | sysrc ifconfig_vtnet1=" | + | ifconfig_vtnet1=" |
- | sysrc ifconfig_vtnet2=" | + | ifconfig_vtnet2=" |
- | sysrc ifconfig_vtnet0_ipv6=" | + | ifconfig_vtnet0_ipv6=" |
- | sysrc ifconfig_vtnet1_ipv6=" | + | ifconfig_vtnet1_ipv6=" |
- | sysrc ifconfig_vtnet2_ipv6=" | + | ifconfig_vtnet2_ipv6=" |
- | sysrc static_routes=" | + | static_routes=" |
- | sysrc route_R3R6="-net 10.0.56.0/ | + | route_VM3VM6="-net 10.0.56.0/ |
- | sysrc route_R3R5="-net 10.0.35.0/ | + | route_VM3VM5="-net 10.0.35.0/ |
- | sysrc route_R4R6="-net 10.0.56.0/ | + | route_VM4VM6="-net 10.0.56.0/ |
- | sysrc route_R4R5="-net 10.0.45.0/ | + | route_VM4VM5="-net 10.0.45.0/ |
- | sysrc ipv6_static_routes=" | + | ipv6_static_routes=" |
- | sysrc ipv6_route_R3R6=" | + | ipv6_route_VM3VM6=" |
- | sysrc ipv6_route_R3R5=" | + | ipv6_route_VM3VM5=" |
- | sysrc ipv6_route_R4R6=" | + | ipv6_route_VM4VM6=" |
- | sysrc ipv6_route_R4R5=" | + | ipv6_route_VM4VM5=" |
service hostname restart | service hostname restart | ||
service netif restart | service netif restart | ||
Line 135: | Line 135: | ||
</ | </ | ||
- | ==== Router 3 (simple router) ==== | + | Checking static route with multiple next-hop: |
- | R3 is a simple router. | + | < |
+ | [root@VM2]~# | ||
+ | 10.0.56.0/ | ||
+ | 10.0.56.0/ | ||
+ | [root@VM2]~# | ||
+ | route to: 10.0.56.0 | ||
+ | destination: | ||
+ | mask: 255.255.255.0 | ||
+ | gateway: 10.0.24.4 | ||
+ | fib: 0 | ||
+ | interface: vtnet2 | ||
+ | flags: < | ||
+ | | ||
+ | | ||
+ | [root@VM2]~# | ||
+ | Nexthop data | ||
+ | |||
+ | Internet: | ||
+ | Idx | ||
+ | 4 | ||
+ | 6 | ||
+ | 2 | ||
+ | 1 | ||
+ | 7 | ||
+ | 5 | ||
+ | 3 | ||
+ | 9 v4/gw 10.0.24.2 | ||
+ | 8 v4/gw 10.0.23.2 | ||
+ | Nexthop groups data | ||
+ | BUF: 192 | ||
+ | |||
+ | Internet: | ||
+ | MpIdx NHIdx Weigh Slots Gateway Netif Refcnt | ||
+ | 1 ---- ---- ---- ---- ---- 1 | ||
+ | 9 | ||
+ | 8 | ||
+ | |||
+ | [root@VM2]~# | ||
+ | route to: 2001: | ||
+ | destination: | ||
+ | mask: ffff: | ||
+ | gateway: 2001: | ||
+ | fib: 0 | ||
+ | interface: vtnet2 | ||
+ | flags: < | ||
+ | | ||
+ | | ||
+ | </ | ||
+ | ==== VM 3 (router) ==== | ||
+ | |||
+ | VM 3 is a simple router. | ||
< | < | ||
- | sysrc hostname=R3 | + | sysrc hostname=VM3 \ |
- | sysrc ifconfig_vtnet1=" | + | ifconfig_vtnet1=" |
- | sysrc ifconfig_vtnet3=" | + | ifconfig_vtnet3=" |
- | sysrc ifconfig_vtnet1_ipv6=" | + | ifconfig_vtnet1_ipv6=" |
- | sysrc ifconfig_vtnet3_ipv6=" | + | ifconfig_vtnet3_ipv6=" |
- | sysrc static_routes=" | + | static_routes=" |
- | sysrc route_R1="-net 10.0.12.0/ | + | route_VM1="-net 10.0.12.0/ |
- | sysrc route_R6="-net 10.0.56.0/ | + | route_VM6="-net 10.0.56.0/ |
- | sysrc ipv6_static_routes=" | + | ipv6_static_routes=" |
- | sysrc ipv6_route_R1=" | + | ipv6_route_VM1=" |
- | sysrc ipv6_route_R6=" | + | ipv6_route_VM6=" |
service hostname restart | service hostname restart | ||
service netif restart | service netif restart | ||
Line 157: | Line 207: | ||
</ | </ | ||
- | ==== Router | + | ==== VM 4 (router) ==== |
- | R4 is like R3, a simple router. | + | VM 4 is like VM 3, a simple router. |
< | < | ||
- | sysrc hostname=R4 | + | sysrc hostname=VM4 \ |
- | sysrc ifconfig_vtnet1=" | + | ifconfig_vtnet1=" |
- | sysrc ifconfig_vtnet3=" | + | ifconfig_vtnet3=" |
- | sysrc ifconfig_vtnet1_ipv6=" | + | ifconfig_vtnet1_ipv6=" |
- | sysrc ifconfig_vtnet3_ipv6=" | + | ifconfig_vtnet3_ipv6=" |
- | sysrc static_routes=" | + | static_routes=" |
- | sysrc route_R1="-net 10.0.12.0/ | + | route_VM1="-net 10.0.12.0/ |
- | sysrc route_R6="-net 10.0.56.0/ | + | route_VM6="-net 10.0.56.0/ |
- | sysrc ipv6_static_routes=" | + | ipv6_static_routes=" |
- | sysrc ipv6_route_R1=" | + | ipv6_route_VM1=" |
- | sysrc ipv6_route_R6=" | + | ipv6_route_VM6=" |
service hostname restart | service hostname restart | ||
service netif restart | service netif restart | ||
Line 179: | Line 229: | ||
</ | </ | ||
- | ==== Router | + | ==== VM 5 (ECMP router) ==== |
- | R5 is like R2, a router with ECMP: 2 static routing toward the same destination but using 2 different next-hop.. | + | VM 5 is like VM 2, a router with ECMP: 2 static routing toward the same destination but using 2 different next-hop.. |
< | < | ||
- | sysrc hostname=R5 | + | sysrc hostname=VM5 \ |
- | sysrc ifconfig_vtnet2=" | + | ifconfig_vtnet2=" |
- | sysrc ifconfig_vtnet3=" | + | ifconfig_vtnet3=" |
- | sysrc ifconfig_vtnet4=" | + | ifconfig_vtnet4=" |
- | sysrc ifconfig_vtnet2_ipv6=" | + | ifconfig_vtnet2_ipv6=" |
- | sysrc ifconfig_vtnet3_ipv6=" | + | ifconfig_vtnet3_ipv6=" |
- | sysrc ifconfig_vtnet4_ipv6=" | + | ifconfig_vtnet4_ipv6=" |
- | sysrc static_routes=" | + | static_routes=" |
- | sysrc route_R3R1="-net 10.0.12.0/ | + | route_VM3VM1="-net 10.0.12.0/ |
- | sysrc route_R3R2="-net 10.0.23.0/ | + | route_VM3VM2="-net 10.0.23.0/ |
- | sysrc route_R4R1="-net 10.0.12.0/ | + | route_VM4VM1="-net 10.0.12.0/ |
- | sysrc route_R4R2="-net 10.0.24.0/ | + | route_VM4VM2="-net 10.0.24.0/ |
- | sysrc ipv6_static_routes=" | + | ipv6_static_routes=" |
- | sysrc ipv6_route_R3R1=" | + | ipv6_route_VM3VM1=" |
- | sysrc ipv6_route_R3R2=" | + | ipv6_route_VM3VM2=" |
- | sysrc ipv6_route_R4R1=" | + | ipv6_route_VM4VM1=" |
- | sysrc ipv6_route_R4R2=" | + | ipv6_route_VM4VM2=" |
service hostname restart | service hostname restart | ||
service netif restart | service netif restart | ||
Line 207: | Line 257: | ||
</ | </ | ||
- | ==== Router | + | ==== VM 6 (server) ==== |
- | R6, like R1 is configured as a simple host with multiple aliases: | + | VM 6, like VM 1 is configured as a simple host with multiple aliases: |
< | < | ||
- | sysrc hostname=R6 | + | sysrc hostname=VM6 \ |
- | sysrc gateway_enable=NO | + | gateway_enable=NO |
- | sysrc ipv6_gateway_enable=NO | + | ipv6_gateway_enable=NO |
- | sysrc ifconfig_vtnet4=" | + | ifconfig_vtnet4=" |
- | sysrc ifconfig_vtnet4_alias1=" | + | ifconfig_vtnet4_alias1=" |
- | sysrc ifconfig_vtnet4_alias2=" | + | ifconfig_vtnet4_alias2=" |
- | sysrc ifconfig_vtnet4_alias3=" | + | ifconfig_vtnet4_alias3=" |
- | sysrc ifconfig_vtnet4_alias4=" | + | ifconfig_vtnet4_alias4=" |
- | sysrc ifconfig_vtnet4_alias5=" | + | ifconfig_vtnet4_alias5=" |
- | sysrc ifconfig_vtnet4_ipv6=" | + | ifconfig_vtnet4_ipv6=" |
- | sysrc ifconfig_vtnet4_alias61=" | + | ifconfig_vtnet4_alias61=" |
- | sysrc ifconfig_vtnet4_alias62=" | + | ifconfig_vtnet4_alias62=" |
- | sysrc ifconfig_vtnet4_alias63=" | + | ifconfig_vtnet4_alias63=" |
- | sysrc ifconfig_vtnet4_alias64=" | + | ifconfig_vtnet4_alias64=" |
- | sysrc ifconfig_vtnet4_alias65=" | + | ifconfig_vtnet4_alias65=" |
- | sysrc defaultrouter=" | + | defaultrouter=" |
- | sysrc ipv6_defaultrouter=" | + | ipv6_defaultrouter=" |
service hostname restart | service hostname restart | ||
service netif restart | service netif restart | ||
Line 237: | Line 287: | ||
==== Testing Load balancing ==== | ==== Testing Load balancing ==== | ||
- | Flows from R1 to R6 should be load-balanced | + | Flows from VM1 to VM6 should be "flow-id shared" |
+ | Using ping record feature like with this example: | ||
+ | < | ||
+ | [root@VM1]~# | ||
+ | PING 10.0.56.26 (10.0.56.26) from 10.0.12.21: 56 data bytes | ||
+ | 64 bytes from 10.0.56.26: icmp_seq=0 ttl=61 time=0.455 ms | ||
+ | RR: | ||
+ | 10.0.45.4 | ||
+ | 10.0.56.5 | ||
+ | 10.0.56.26 | ||
+ | 10.0.45.5 | ||
+ | 10.0.24.4 | ||
+ | 10.0.12.2 | ||
+ | 10.0.12.21 | ||
- | ^ Source ^ Destination ^ Ongoing path selected by R2 ^ Returning path selected by R5^ | + | --- 10.0.56.26 |
- | | 10.0.12.1 | 10.0.56.6 | R3 | R3 | | + | 1 packets transmitted, |
- | | 10.0.12.11 | 10.0.56.16 | R3 | R3 | | + | round-trip min/ |
- | | 10.0.12.21 | 10.0.56.26 | + | </ |
- | | 10.0.12.31 | 10.0.56.36 | R3 | R3 | | + | |
- | | 10.0.12.41 | 10.0.56.46 | R3 | R3 | | + | |
- | | 10.0.12.51 | 10.0.56.56 | R3 | R3 | | + | |
- | | 2001: | + | |
- | | 2001: | + | |
- | | 2001: | + | |
- | | 2001: | + | |
- | | 2001: | + | |
- | | 2001: | + | |
- | | 10.0.12.1 | 10.0.45.5 | R4 | R3 | | + | |
- | < | + | ^ Source ^ Destination ^ Ongoing path selected by VM2 ^ Returning path selected by VM5^ |
+ | | 10.0.12.1 | 10.0.35.5 | VM3 | VM4 | | ||
+ | | 10.0.12.1 | 10.0.45.5 | VM4 | VM4 | | ||
+ | | 10.0.12.1 | 10.0.56.6 | VM4 | VM4 | | ||
+ | | 10.0.12.11 | 10.0.56.16 | VM4 | VM4 | | ||
+ | | 10.0.12.21 | 10.0.56.26 | VM4 | VM4 | | ||
+ | | 10.0.12.31 | 10.0.56.36 | VM4 | VM4 | | ||
+ | | 10.0.12.41 | 10.0.56.46 | VM4 | VM4 | | ||
+ | | 10.0.12.51 | 10.0.56.56 | VM4 | VM4 | | ||
+ | | 2001: | ||
+ | | 2001: | ||
+ | | 2001: | ||
+ | | 2001: | ||
+ | | 2001: | ||
+ | | 2001: | ||
+ | |||
+ | Notice inet6 bug: Cannot ping itself neither neighbor | ||
+ | < | ||
+ | [root@VM1]~# | ||
+ | vtnet0: flags=8943< | ||
+ | options=80028< | ||
+ | inet6 fe80:: | ||
+ | inet6 2001: | ||
+ | inet6 2001: | ||
+ | inet6 2001: | ||
+ | inet6 2001: | ||
+ | inet6 2001: | ||
+ | inet6 2001: | ||
+ | nd6 options=21< | ||
+ | [root@VM1]~# | ||
+ | PING6(56=40+8+8 bytes) fe80:: | ||
+ | |||
+ | --- fe80:: | ||
+ | 1 packets transmitted, | ||
+ | [root@VM1]~# | ||
+ | ping6: illegal number of packets -- 12001: | ||
+ | [root@VM1]~# | ||
+ | PING6(56=40+8+8 bytes) 2001: | ||
+ | |||
+ | --- 2001: | ||
+ | 1 packets transmitted, | ||
+ | </ | ||
+ | |||
+ | ==== Testing Fail Over ==== | ||
+ | |||
+ | VM4 is the preferred hop, so shutdown this VM to check behavior: | ||
+ | |||
+ | < | ||
+ | [root@VM4]~# | ||
+ | Shutdown NOW! | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | [root@VM2]~# | ||
+ | Nexthop data | ||
+ | |||
+ | Internet: | ||
+ | Idx | ||
+ | 4 | ||
+ | 6 | ||
+ | 2 | ||
+ | 1 | ||
+ | 7 | ||
+ | 5 | ||
+ | 3 | ||
+ | 9 v4/gw 10.0.24.2 | ||
+ | 8 v4/gw 10.0.23.2 | ||
+ | Nexthop groups data | ||
+ | BUF: 192 | ||
+ | |||
+ | Internet: | ||
+ | MpIdx NHIdx Weigh Slots Gateway Netif Refcnt | ||
+ | 1 ---- ---- ---- ---- ---- 1 | ||
+ | 9 | ||
+ | 8 | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | [root@VM1]~# | ||
+ | PING 10.0.56.26 (10.0.56.26) from 10.0.12.21: 56 data bytes | ||
+ | |||
+ | --- 10.0.56.26 ping statistics --- | ||
+ | 1 packets transmitted, | ||
+ | </ |
documentation/examples/ecmp.txt · Last modified: 2024/03/28 23:19 by olivier