diff options
author | Dimitri Staessens <[email protected]> | 2021-02-14 17:42:22 +0100 |
---|---|---|
committer | Dimitri Staessens <[email protected]> | 2021-02-14 17:42:22 +0100 |
commit | 20df52a54fc03ef067cb4bce3e176e19129b4a84 (patch) | |
tree | 191014dce7f5ae907cee22f6e38dd2207590e7d4 /content/en/blog/20200216-ecmp.md | |
parent | c279eee663c376e9f9f032057e247eaf6023c203 (diff) | |
download | website-20df52a54fc03ef067cb4bce3e176e19129b4a84.tar.gz website-20df52a54fc03ef067cb4bce3e176e19129b4a84.zip |
content: Move releases to docs and add 0.18 notes
Diffstat (limited to 'content/en/blog/20200216-ecmp.md')
-rw-r--r-- | content/en/blog/20200216-ecmp.md | 118 |
1 files changed, 118 insertions, 0 deletions
diff --git a/content/en/blog/20200216-ecmp.md b/content/en/blog/20200216-ecmp.md new file mode 100644 index 0000000..ce632c9 --- /dev/null +++ b/content/en/blog/20200216-ecmp.md @@ -0,0 +1,118 @@ +--- +date: 2020-02-16 +title: "Equal-Cost Multipath (ECMP) routing" +linkTitle: "Equal-Cost multipath (ECMP) example" +description: "A very quick example of ECMP" +author: Dimitri Staessens +--- + +As promised, I added equal cost multipath routing to the Ouroboros +unicast IPCP. I will add some more explanations later when it's fully +tested and merge into the master branch, but you can already try it. +You will need to pull the _be_ branch. You will also need to have +_fuse_ installed to monitor the flows from _/tmp/ouroboros/_. The +following script will bootstrap a 4-node unicast network on your +machine that routes using ECMP: + +```bash +#!/bin/bash + +# create a local IPCP. This emulates the "Internet" +irm i b t local n local l local + +#create the first unicast IPCP with ecmp +irm i b t unicast n uni.a l net routing ecmp + +#bind the unicast IPCP to the names net and uni.a +irm b i uni.a n net +irm b i uni.a n uni.a + +#register these 2 names in the local IPCP +irm n r net l local +irm n r uni.a l local + +#create 3 more unicast IPCPs, and enroll them with the first +irm i e t unicast n uni.b l net +irm b i uni.b n net +irm b i uni.b n uni.b +irm n r uni.b l local + +irm i e t unicast n uni.c l net +irm b i uni.c n net +irm b i uni.c n uni.c +irm n r uni.c l local + +irm i e t unicast n uni.d l net +irm b i uni.d n net +irm b i uni.d n uni.d +irm n r uni.d l local + +#connect uni.b to uni.a this creates a DT flow and a mgmt flow +irm i conn name uni.b dst uni.a + +#now do the same for the others, creating a square +irm i conn name uni.c dst uni.b +irm i conn name uni.d dst uni.c +irm i conn name uni.d dst uni.a + +#register the oping application at 4 different locations +#this allows us to check the multipath implementation +irm n r oping.a i uni.a +irm n r oping.b i uni.b +irm n r oping.c i uni.c +irm n r oping.d i uni.d + +#bind oping program to oping names +irm b prog oping n oping.a +irm b prog oping n oping.b +irm b prog oping n oping.c +irm b prog oping n oping.d + +#good to go! +``` + +In order to test the setup, start an irmd (preferably in a terminal so +you can see what's going on). In another terminal, run the above +script and then start an oping server: + +```bash +$ ./ecmpscript +$ oping -l +Ouroboros ping server started. +``` + +This single server program will accept all flows for oping from any of +the unicast IPCPs. Ouroboros _multi-homing_ in action. + +Open another terminal, and type the following command: + +```bash +$ watch -n 1 'grep "sent (packets)" /tmp/ouroboros/uni.a/dt.*/6* | sed -n -e 1p -e 7p' +``` + +This will show you the packet statistics from the 2 data transfer +flows from the first IPCP (uni.a). + +On my machine it looks like this: + +``` +Every 1,0s: grep "sent (packets)" /tmp/ouroboros/uni.a/dt.*/6* | sed -n -e 1p -e 7p + +/tmp/ouroboros/uni.a/dt.1896199821/65: sent (packets): 10 +/tmp/ouroboros/uni.a/dt.1896199821/67: sent (packets): 6 +``` + +Now, from yet another terminal, run connect an oping client to oping.c +(the client should attach to the first IPCP, so oping.c should be the +one with 2 equal cost paths) and watch both counters increase: + +```bash +oping -n oping.c -i 100ms +``` + +When you do this to the other destinations (oping.b and oping.d) you +should see only one of the flow counters increasing. + +Hope you enjoyed this little demo! + +Dimitri |