documentation:examples:ecmp
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| documentation:examples:ecmp [2022/12/11 17:52] – [R2 (ECMP router)] olivier | documentation:examples:ecmp [2025/01/17 18:53] (current) – [R2 (ECMP router)] olivier | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== Equal-cost multi-path routing (ECMP) ====== | ====== Equal-cost multi-path routing (ECMP) ====== | ||
| - | This lab need a FreeBSD 13-head r366390 minimum ([[https:// | ||
| ===== Presentation ===== | ===== Presentation ===== | ||
| Line 22: | Line 21: | ||
| ==== Client ==== | ==== Client ==== | ||
| - | A simple host with multiples aliases: | + | A simple host with static routes: |
| < | < | ||
| Line 29: | Line 28: | ||
| ipv6_gateway_enable=NO \ | ipv6_gateway_enable=NO \ | ||
| ifconfig_igb1=" | ifconfig_igb1=" | ||
| - | ifconfig_igb1_alias1=" | ||
| - | ifconfig_igb1_alias2=" | ||
| - | ifconfig_igb1_alias3=" | ||
| - | ifconfig_igb1_alias4=" | ||
| - | ifconfig_igb1_alias5=" | ||
| ifconfig_igb1_ipv6=" | ifconfig_igb1_ipv6=" | ||
| - | ifconfig_igb1_alias61=" | ||
| - | ifconfig_igb1_alias62=" | ||
| - | ifconfig_igb1_alias63=" | ||
| - | ifconfig_igb1_alias64=" | ||
| - | ifconfig_igb1_alias65=" | ||
| - | static_routes=" | ||
| route_LAB=" | route_LAB=" | ||
| + | static_routes=" | ||
| ipv6_static_routes=" | ipv6_static_routes=" | ||
| ipv6_route_LAB=" | ipv6_route_LAB=" | ||
| Line 131: | Line 120: | ||
| ifconfig_igb2=" | ifconfig_igb2=" | ||
| ifconfig_igb2_ipv6=" | ifconfig_igb2_ipv6=" | ||
| - | static_routes=" | + | static_routes=" |
| - | | + | |
| - | | + | |
| - | route_SRC1=" | + | ipv6_static_routes=" |
| - | route_SRC2=" | + | ipv6_route_MPATH1=" |
| - | ipv6_static_routes=" | + | ipv6_route_MPATH2=" |
| - | ipv6_route_MPATH1=" | + | |
| - | ipv6_route_MPATH2=" | + | |
| - | ipv6_route_SRC1=" | + | |
| - | ipv6_route_SRC2=" | + | |
| service hostname restart | service hostname restart | ||
| service netif restart | service netif restart | ||
| Line 148: | Line 133: | ||
| ==== Server ==== | ==== Server ==== | ||
| - | A simple host with multiple aliases: | + | A simple host with some static routes: |
| < | < | ||
| Line 154: | Line 139: | ||
| gateway_enable=NO \ | gateway_enable=NO \ | ||
| ipv6_gateway_enable=NO \ | ipv6_gateway_enable=NO \ | ||
| - | | + | |
| - | | + | |
| - | ifconfig_vr0_alias2=" | + | |
| - | ifconfig_vr0_alias3=" | + | |
| - | ifconfig_vr0_alias4=" | + | |
| - | ifconfig_vr0_alias5=" | + | |
| - | ifconfig_vr0_ipv6=" | + | |
| - | ifconfig_vr0_alias61=" | + | |
| - | ifconfig_vr0_alias62=" | + | |
| - | ifconfig_vr0_alias63=" | + | |
| - | ifconfig_vr0_alias64=" | + | |
| - | ifconfig_vr0_alias65=" | + | |
| static_routes=" | static_routes=" | ||
| - | route_LAB=" | + | route_LAB=" |
| ipv6_static_routes=" | ipv6_static_routes=" | ||
| - | ipv6_route_LAB=" | + | ipv6_route_LAB=" |
| service hostname restart | service hostname restart | ||
| service netif restart | service netif restart | ||
| Line 182: | Line 157: | ||
| ==== R1 (ECMP router) ==== | ==== R1 (ECMP router) ==== | ||
| - | In place of static routes, FRR is enabled: | + | In place of static routes, |
| < | < | ||
| Line 192: | Line 167: | ||
| cat > / | cat > / | ||
| - | frr version | + | frr version |
| frr defaults traditional | frr defaults traditional | ||
| - | hostname | + | hostname |
| ! | ! | ||
| interface igb0 | interface igb0 | ||
| + | ip ospf passive | ||
| + | ipv6 ospf6 area 0.0.0.0 | ||
| ipv6 ospf6 passive | ipv6 ospf6 passive | ||
| + | exit | ||
| + | ! | ||
| + | interface igb1 | ||
| + | ipv6 ospf6 area 0.0.0.0 | ||
| + | exit | ||
| + | ! | ||
| + | interface igb2 | ||
| + | ipv6 ospf6 area 0.0.0.0 | ||
| + | exit | ||
| ! | ! | ||
| router ospf | router ospf | ||
| ospf router-id 1.1.1.1 | ospf router-id 1.1.1.1 | ||
| - | passive-interface igb0 | + | |
| - | network 10.0.31.0/24 area 0 | + | |
| - | | + | |
| - | | + | exit |
| ! | ! | ||
| router ospf6 | router ospf6 | ||
| - | | + | exit |
| - | | + | |
| - | | + | |
| - | ! | + | |
| - | line vty | + | |
| ! | ! | ||
| EOF | EOF | ||
| Line 220: | Line 202: | ||
| ==== R2 (ECMP router) ==== | ==== R2 (ECMP router) ==== | ||
| - | In place of static routes, | + | Same as R1 with OSPF and FRR: |
| < | < | ||
| sysrc frr_vtysh_boot=" | sysrc frr_vtysh_boot=" | ||
| frr_enable=" | frr_enable=" | ||
| - | frr_daemons=" | + | frr_daemons=" |
| watchfrr_flags=" | watchfrr_flags=" | ||
| watchfrr_enable=" | watchfrr_enable=" | ||
| cat > / | cat > / | ||
| - | frr version | + | frr version |
| frr defaults traditional | frr defaults traditional | ||
| - | hostname | + | hostname |
| + | ! | ||
| + | ip route 10.0.0.0/16 10.0.34.4 | ||
| + | ipv6 route 2001: | ||
| ! | ! | ||
| interface igb0 | interface igb0 | ||
| + | ip ospf passive | ||
| + | ipv6 ospf6 area 0.0.0.0 | ||
| ipv6 ospf6 passive | ipv6 ospf6 passive | ||
| + | exit | ||
| + | ! | ||
| + | interface igb1 | ||
| + | ipv6 ospf6 area 0.0.0.0 | ||
| + | exit | ||
| + | ! | ||
| + | interface igb2 | ||
| + | ipv6 ospf6 area 0.0.0.0 | ||
| + | exit | ||
| ! | ! | ||
| router ospf | router ospf | ||
| ospf router-id 2.2.2.2 | ospf router-id 2.2.2.2 | ||
| - | passive-interface igb0 | + | redistribute static |
| - | | + | |
| - | | + | |
| - | | + | |
| + | exit | ||
| ! | ! | ||
| router ospf6 | router ospf6 | ||
| - | interface igb0 area 0.0.0.0 | + | redistribute static |
| - | interface igb1 area 0.0.0.0 | + | exit |
| - | | + | |
| - | ! | + | |
| - | line vty | + | |
| ! | ! | ||
| EOF | EOF | ||
| Line 259: | Line 253: | ||
| On R1: | On R1: | ||
| < | < | ||
| - | [root@router1]~# vtysh | + | root@R1:~ # vtysh |
| - | + | Hello, this is FRRouting (version | |
| - | Hello, this is FRRouting (version | + | |
| Copyright 1996-2005 Kunihiro Ishiguro, et al. | Copyright 1996-2005 Kunihiro Ishiguro, et al. | ||
| - | router1# sh ip route 10.0.24.0/24 | + | R1# sh ip route 10.0.0.0 |
| - | Routing entry for 10.0.24.0/24 | + | Routing entry for 10.0.0.0/16 |
| Known via " | Known via " | ||
| - | Last update 00:06:39 ago | + | Last update 00:02:26 ago |
| - | * 10.0.112.2, via igb1, weight 1 | + | * 10.0.231.3, via igb1, weight 1 |
| - | * 10.0.212.2, via igb2, weight 1 | + | * 10.0.232.3, via igb2, weight 1 |
| - | route1# sh ipv6 route 2001:db8:24::/64 | + | R1# sh ipv6 route 2001: |
| - | Routing entry for 2001:db8:24::/64 | + | Routing entry for 2001:db8::/32 |
| Known via " | Known via " | ||
| - | Last update 00:02:42 ago | + | Last update 00:02:39 ago |
| * fe80:: | * fe80:: | ||
| * fe80:: | * fe80:: | ||
| + | </ | ||
| + | ===== Test Load balancing IP packets ===== | ||
| - | router1# exit | + | Flows from the client to the server should be " |
| - | [root@router1]~# netstat | + | On server: |
| - | 10.0.24.0/24 | + | < |
| - | 10.0.24.0/ | + | root@server:~ # pkt-gen -i igb1 -f rx |
| + | </code> | ||
| - | [root@router1]~# netstat | + | On client: |
| - | 2001:db8:24::/64 fe80::20d:b9ff:fe45:7ad6%igb2 UG1 | + | < |
| - | 2001: | + | root@client:~ # pkt-gen -i igb1 -f tx -n 8000000 -l 60 -d 10.0.255.1:2000-10.0.255.254 -D 00:0d:b9:41:ca:3c -s 10.0.254.1:2000-10.0.254.254 -S 00:0d:b9:45:7f:b0 -w 4 -R 20000 |
| + | </ | ||
| + | |||
| + | On R1: | ||
| + | < | ||
| + | systat -ifstat -match igb0,igb1,igb2 -pps | ||
| + | |||
| + | /0 / | ||
| + | Load Average | ||
| + | |||
| + | Interface | ||
| + | igb2 | ||
| + | out 9.762 Kp/s 9.777 Kp/s | ||
| + | |||
| + | igb1 | ||
| + | | ||
| + | | ||
| + | | ||
| + | |||
| </ | </ | ||
| - | ===== Test Load balancing IP packets ===== | + | => We confirm that 20 Kps entering igb0 and are equally split by exiting by igb1 and igb2 |
| + | |||
| + | On R2: | ||
| + | < | ||
| + | systat -ifstat -match igb0, | ||
| + | |||
| + | /0 / | ||
| + | Load Average | ||
| + | |||
| + | Interface | ||
| + | | ||
| + | | ||
| + | |||
| + | | ||
| + | | ||
| + | |||
| + | | ||
| + | | ||
| + | </ | ||
| - | Flows from the client to the server should be " | + | => R2 has no choice than receiving packets |
| - | ^ Source ^ Destination ^ Ongoing path selected by R1 ^ Returning path selected by R2^ | ||
| - | | 10.0.31.3 | 10.0.24.4 | igb1 | igb2 | | ||
| - | | 10.0.31.3 | 10.0.24.14 | igb2 | igb1 | | ||
| - | | 10.0.31.13 | 10.0.24.14 | igb2 | igb1 | | ||
| - | | 10.0.31.23 | 10.0.24.24 | igb1 | igb2 | | ||
| - | | 10.0.31.33 | 10.0.24.34 | igb2 | igb2 | | ||
| - | | 10.0.31.43 | 10.0.24.44 | igb1 | igb2 | | ||
| - | | 10.0.31.53 | 10.0.24.54 | igb1 | igb1 | | ||
| - | | 2001: | ||
| - | | 2001: | ||
| - | | 2001: | ||
| - | | 2001: | ||
| - | | 2001: | ||
documentation/examples/ecmp.1670777533.txt.gz · Last modified: 2022/12/11 17:52 by olivier
