Changes between Version 2 and Version 3 of GENIExperimenter/Tutorials/SystematicExprCaseStudy/SmallTopoQuagga/DesignSetup


Ignore:
Timestamp:
06/23/16 13:27:16 (3 years ago)
Author:
pjayanth@bbn.com
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • GENIExperimenter/Tutorials/SystematicExprCaseStudy/SmallTopoQuagga/DesignSetup

    v2 v3  
    4141=== i. Create VMs and Virtual Links ===
    4242
    43 Create four VMs from the same InstaGENI aggregate and add the links. Modify each VM's name, set the Sliver Type to `emulab-xen`, and load the custom image by following the steps in the [wiki:GENIExperimenter/Tutorials/SystematicExprCaseStudy/InstallSoftwareQuagga#a4.VerifyInstaGENICustomImage Load Custom Image] section. You may use the the value `https://www.instageni.clemson.edu/image_metadata.php?uuid=5417bcef-224e-11e4-aa5a-000000000000` in the `Disk Image` option for each router in this topology.
     43Create four VMs from the same InstaGENI aggregate and add the links. Modify each VM's name, set the Sliver Type to `emulab-xen`, and load the custom image by following the steps in the [wiki:GENIExperimenter/Tutorials/SystematicExprCaseStudy/InstallSoftwareQuagga#a4.VerifyInstaGENICustomImage Load Custom Image] section. You may use the the value `urn:publicid:IDN+utahddc.geniracks.net+image+ch-geni-net:UbuntuQuagga` in the `Disk Image` option for each router in this topology.
    4444
    4545[[Image(GENIExperimenter/Tutorials/SystematicExprCaseStudy/SmallTopo/DesignSetup:SmallTopo.jpg, 60%)]]
     
    9191== b. Manually Configure OSPF for Quagga ==
    9292
    93 In this tutorial we configure each VM as a virtual router running the `OSPF` routing protocol.  Examples of `XORP` configurations can be found at [http://www.xorp.org/getting_started.html#configuring XORPExamples]. For each VM running as a software router, the `OSPF` configuration file will be named `ospfd.conf` and is stored in `/etc/xorp/`. We provide sample `OSPF` configuration file that can be downloaded to each router.
    94 
    95 Download the sample OSPF configuration to router-1:
    96 {{{
    97 sudo mkdir /etc/xorp
    98 cd /etc/xorp
    99 sudo wget http://groups.geni.net/geni/raw-attachment/wiki/GENIExperimenter/Tutorials/SystematicExprCaseStudy/SmallTopo/DesignSetup/r1-ospf.conf
    100 sudo mv r1-ospf.conf ospfd.conf
    101 }}}
    102 
    103 The interface information in the sample files may be different from the routers interfaces, you must check that the interface information is properly mapped in the `ospfd.conf` on each router before you start `xorp`.   
    104 
    105 There are several key configuration items in the `OSPF` configuration file for `router-1`.
    106 
    107 __Interface Information:__
    108 {{{
    109 interface eth1 {
    110     description: "virtual interface-eth1"
    111     disable: false
    112     discard: false
    113     vif eth1 {
    114         disable: false
    115         address 192.168.4.2 {
    116                  prefix-length: 24
    117                  disable: false
    118         }
    119     }
    120   }
    121 interface eth2 {
    122 ......
    123 }
    124 }}}
    125 
    126 __OSPF Metrics:__
    127 {{{
    128 protocols {
    129     ospf4 {
    130         router-id: 192.168.1.1
    131         area 0.0.0.0 {
    132             area-type:"normal"
    133             interface eth1 {
    134                 vif eth1 {
    135                   address 192.168.4.2 {
    136                     interface-cost 10
    137                     hello-interval 5
    138                     router-dead-interval 10
    139                     disable: false
    140                   }
    141                 }
    142             }
    143             interface eth2 {
    144             ......
    145             }
    146       }
    147    }
    148 }
    149 }}}
    150 
    151 To simplify the configuration process, we assume the `interface-cost` and the `hello-interval` are both set to 10 seconds for every virtual interface. The main information needed from each node is the virtual interface's `address` and its `prefix-length`, as well as the router's `router-id` that is required for the `protocol` section in the configuration file.
    152 
    153 Now download the configuration on the remaining routers and verify that the interfaces addresses are properly mapped in the `ospfd.conf` file.
    154 
    155 Download the sample OSPF configuration to router-2 and check interfaces address mappings:
    156 {{{
    157 sudo mkdir /etc/xorp
    158 cd /etc/xorp
    159 sudo wget http://groups.geni.net/geni/raw-attachment/wiki/GENIExperimenter/Tutorials/SystematicExprCaseStudy/SmallTopo/DesignSetup/r2-ospf.conf
    160 sudo mv r2-ospf.conf ospfd.conf
    161 }}}
    162 Download the sample OSPF configuration to router-3 and check interfaces address mappings:
    163 {{{
    164 sudo mkdir /etc/xorp
    165 cd /etc/xorp
    166 sudo wget http://groups.geni.net/geni/raw-attachment/wiki/GENIExperimenter/Tutorials/SystematicExprCaseStudy/SmallTopo/DesignSetup/r3-ospf.conf
    167 sudo mv r3-ospf.conf ospfd.conf
    168 }}}
    169 
    170 Download the sample OSPF configuration to router-4 and check interfaces address mappings:
    171 {{{
    172 sudo mkdir /etc/xorp
    173 cd /etc/xorp
    174 sudo wget http://groups.geni.net/geni/raw-attachment/wiki/GENIExperimenter/Tutorials/SystematicExprCaseStudy/SmallTopo/DesignSetup/r4-ospf.conf
    175 sudo mv r4-ospf.conf ospfd.conf
    176 }}}
    177 
    178 
    179 == c. Start `XORP` and Verify Routing ==
    180 
    181 === i. Start `XORP` Process ===
    182 
    183 First, we must add the `xorp` user group. Login to each router and run the following command:
    184 {{{
    185 sudo groupadd xorp
    186 }}}
    187 Start `XORP` by specifying the routing protocol configuration file.
    188 {{{
    189 lnevers@router-1:/etc/xorp$ cd /usr/local/xorp/sbin/
    190 lnevers@router-1:/usr/local/xorp/sbin$ sudo ./xorp_rtrmgr -b /etc/xorp/ospfd.conf -l /tmp/xorp_rtrmgr_log -d
    191 Not doing pidfile...
    192 lnevers@router-1:/usr/local/xorp/sbin$
    193 }}}
    194 
    195 Verify the `XORP` process is running:
    196 {{{
    197 lnevers@router-1:/usr/local/xorp/sbin$ ps -ef | grep xorp
    198 root      9658     1  0 06:06 pts/0    00:00:00 xorp_fea
    199 root      9659     1  0 06:06 pts/0    00:00:00 xorp_rib
    200 root      9660     1  0 06:06 pts/0    00:00:00 xorp_policy
    201 root      9661     1  0 06:06 pts/0    00:00:00 xorp_ospfv2
    202 root      9662     1  0 06:06 ?        00:00:00 ./xorp_rtrmgr -b /etc/xorp/ospfd.conf -l /tmp/xorp_rtrmgr_log -d
    203 lnevers@router-1:/usr/local/xorp/sbin$
    204 }}}
    205 
    206 Now you have routing running on all four router!
    207 
    208 If you need to stop `XORP`, use the kill command as shown below to stop each the 5 xorp processes:
    209 
    210 {{{
    211 ps -ef | grep xorp_ | /usr/bin/awk '{ if ( $1 == "root" ) {print "sudo kill -9 " $2}}' | sh
    212 }}}
    213 
    214 === ii. Verify Routing ===
    215 
    216 Login to `router-1` and view the `OSPF` routing table:
    217 
    218 {{{
    219 xuanliu@router-1:/usr/local/xorp/sbin$ sudo ./xorpsh
    220 Welcome to XORP v1.8.5 on router-1.xuan-wiki-prep.ch-geni-net.instageni.stanford.edu
    221 Version tag: 00000000  Build Date: 2014-06-05 17:11 64-bit
    222 root@router-1.xuan-wiki-prep.ch-geni-net.instageni.stanford.edu> show route table ipv4 unicast ospf
    223 192.168.2.0/24  [ospf(110)/20]
    224                 > to 192.168.1.2 via eth2/eth2
    225 192.168.3.0/24  [ospf(110)/20]
    226                 > to 192.168.4.1 via eth1/eth1
    227 192.168.5.0/24  [ospf(110)/20]
    228                 > to 192.168.1.2 via eth2/eth2
    229 }}}
    230 
    231 
    232 Login to `router-3` and view the `OSPF` routing table:
    233 {{{
    234 xuanliu@router-3:/usr/local/xorp/sbin$ sudo ./xorpsh
    235 Welcome to XORP v1.8.5 on router-3.xuan-wiki-prep.ch-geni-net.instageni.stanford.edu
    236 Version tag: 00000000  Build Date: 2014-06-05 17:11 64-bit
    237 root@router-3.xuan-wiki-prep.ch-geni-net.instageni.stanford.edu> show route table ipv4 unicast ospf
    238 192.168.1.0/24  [ospf(110)/20]
    239                 > to 192.168.2.1 via eth2/eth2
    240 192.168.4.0/24  [ospf(110)/20]
    241                 > to 192.168.3.1 via eth1/eth1
    242 192.168.5.0/24  [ospf(110)/20]
    243                 > to 192.168.2.1 via eth2/eth2
    244 root@router-3.xuan-wiki-prep.ch-geni-net.instageni.stanford.edu>
     93In this tutorial we configure each VM as a virtual router running the `OSPF` routing protocol. The commands used for configuring `OSPF` can be found at http://www.nongnu.org/quagga/docs/docs-info.html#OSPFv2
     94
     95To configure `OSPF` on router 1, do the following steps:
     96{{{
     97pjayant@router-1:~$ sudo su
     98root@router-1:/users/pjayant# vtysh
     99
     100Hello, this is Quagga (version 0.99.22.4).
     101Copyright 1996-2005 Kunihiro Ishiguro, et al.
     102
     103router-1.quagga.ch-geni-net.utahddc.geniracks.net# conf t
     104router-1.quagga.ch-geni-net.utahddc.geniracks.net(config)# router ospf
     105router-1.quagga.ch-geni-net.utahddc.geniracks.net(config-router)# network 192.168.1.0/24 area 0
     106router-1.quagga.ch-geni-net.utahddc.geniracks.net(config-router)# network 192.168.4.0/24 area 0
     107
     108}}}
     109
     110Similarly on routers 2,3 & 4; configure `OSPF` by following the above steps and adding networks 192.168.1.0/24, 192.168.2.0/24, 192.168.3.0/24, 192.168.4.0/24 & 192.168.5.0/24 to `area 0`.
     111
     112== c. Verify Routing ==
     113
     114View the `OSPF` routing table on router 1:
     115
     116{{{
     117router-1.quagga.ch-geni-net.utahddc.geniracks.net(config-router)# do sh ip ospf  route 
     118============ OSPF network routing table ============
     119N    192.168.1.0/24        [10] area: 0.0.0.0
     120                           directly attached to eth3
     121N    192.168.2.0/24        [20] area: 0.0.0.0
     122                           via 192.168.1.2, eth3
     123N    192.168.3.0/24        [20] area: 0.0.0.0
     124                           via 192.168.4.1, eth1
     125N    192.168.4.0/24        [10] area: 0.0.0.0
     126                           directly attached to eth1
     127N    192.168.5.0/24        [20] area: 0.0.0.0
     128                           via 192.168.1.2, eth3
     129                           via 192.168.4.1, eth1
     130
     131============ OSPF router routing table =============
     132}}}
     133
     134View the `OSPF` routing table on router-3:
     135{{{
     136router-3.quagga.ch-geni-net.utahddc.geniracks.net(config-router)# do sh ip ospf  route 
     137============ OSPF network routing table ============
     138N    192.168.1.0/24        [20] area: 0.0.0.0
     139                           via 192.168.2.1, eth2
     140N    192.168.2.0/24        [10] area: 0.0.0.0
     141                           directly attached to eth2
     142N    192.168.3.0/24        [10] area: 0.0.0.0
     143                           directly attached to eth3
     144N    192.168.4.0/24        [20] area: 0.0.0.0
     145                           via 192.168.3.2, eth3
     146N    192.168.5.0/24        [20] area: 0.0.0.0
     147                           via 192.168.2.1, eth2
     148                           via 192.168.3.2, eth3
     149
    245150}}}
    246151
     
    248153
    249154{{{
    250 xuanliu@router-3:/usr/local/xorp/sbin$ ping 192.168.1.1
     155router-3.quagga.ch-geni-net.utahddc.geniracks.net(config-router)# do ping 192.168.1.1
    251156PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.
    252 64 bytes from 192.168.1.1: icmp_req=1 ttl=63 time=2.15 ms
    253 64 bytes from 192.168.1.1: icmp_req=2 ttl=63 time=1.45 ms
    254 64 bytes from 192.168.1.1: icmp_req=3 ttl=63 time=1.41 ms
     15764 bytes from 192.168.1.1: icmp_seq=1 ttl=63 time=2.03 ms
     15864 bytes from 192.168.1.1: icmp_seq=2 ttl=63 time=1.86 ms
     15964 bytes from 192.168.1.1: icmp_seq=3 ttl=63 time=1.72 ms
    255160^C
    256161--- 192.168.1.1 ping statistics ---
    257 3 packets transmitted, 3 received, 0% packet loss, time 2003ms
    258 rtt min/avg/max/mdev = 1.411/1.673/2.152/0.342 ms
    259 xuanliu@router-3:/usr/local/xorp/sbin$ traceroute 192.168.1.1
     1623 packets transmitted, 3 received, 0% packet loss, time 2002ms
     163rtt min/avg/max/mdev = 1.722/1.871/2.031/0.131 ms
     164router-3.quagga.ch-geni-net.utahddc.geniracks.net(config-router)# do traceroute 192.168.1.1
    260165traceroute to 192.168.1.1 (192.168.1.1), 30 hops max, 60 byte packets
    261  1  router-2-lan1 (192.168.2.1)  0.652 ms  0.595 ms  0.563 ms
    262  2  router-1-lan0 (192.168.1.1)  1.146 ms  1.106 ms  1.076 ms
    263 xuanliu@router-3:/usr/local/xorp/sbin$
    264 }}}
    265 
    266 == d. Automate `OSPF` Configuration ==
    267 
    268 By understanding the syntax of the `OSPF` configuration file for `XORP`, we are able to automate the `OSPF` configuration for every virtual router in a topology, assuming these virtual routers are identical. You can download the automation scripts from [http://www.gpolab.bbn.com/exp/sysexpr/xorp_autostart.tar.gz XORPAutoStart].
    269 
    270 === i. Test the Automation ===
    271 
    272 To test it, you will need to login to each router (e.g., `router-3`) and run the `start-xorp.sh`. You will see the output similar to the following:
    273 
    274 {{{
    275 dhcp89-69-127:~ xliu$ ssh -p 30781  -i /Users/xliu/.ssh/id_rsa xuanliu@pc3.instageni.stanford.edu
    276 Welcome to Ubuntu 12.04 LTS (GNU/Linux 3.2.0-56-generic x86_64)
    277 
    278  * Documentation:  https://help.ubuntu.com/
    279 Last login: Mon Jun 30 14:56:51 2014 from 128.89.69.127
    280 xuanliu@router-3:~$ cd /local
    281 xuanliu@router-3:/local$ sudo wget http://www.gpolab.bbn.com/exp/sysexpr/xorp_autostart.tar.gz
    282 xuanliu@router-3:/local$ sudo tar -zxvf xorp_autostart.tar.gz
    283 xuanliu@router-3:/local/xorp_autostart$ /bin/bash start-xorp.sh
    284 router-3.xuan-wiki-prep.ch-geni-net.instageni.stanford.edu
    285 2014-07-01 06:56:28 AM
    286 XORP dir exist
    287 xorp is already added to the group
    288 xorp is running, stop it first
    289 XORP is starting ......
    290 Not doing pidfile...
    291 }}}
    292 
    293 The key procedure is to obtain the virtual interface's `address` and its `prefix` of the subnet information.
    294 
    295 In the install script `start-xorp.sh`, the Following components are the key parts to generate `ospfd.conf`.
    296 
    297  * Get Hostname and virtual interface information, and store it into a file (`vm_info.txt`)
    298 {{{
    299 hostname | sudo tee vm_info.txt > /dev/null
    300 /sbin/ifconfig | egrep 'eth|inet addr' | sudo tee -a vm_info.txt > /dev/null
    301 }}} 
    302   A sample `vm_info.txt` is available at [http://groups.geni.net/geni/attachment/wiki/GENIExperimenter/Tutorials/SystematicExprCaseStudy/SmallTopo/DesignSetup/vm_info.txt.example SampleVMInfo]
    303 
    304  * Create `ospfd.conf` by running an `awk` script, available from [http://groups.geni.net/geni/raw-attachment/wiki/GENIExperimenter/Tutorials/SystematicExprCaseStudy/SmallTopo/DesignSetup/ospfd-conf-gen.awk here]
    305 {{{
    306 sudo /usr/bin/awk -f $ABS_PATH/ospfd-conf-gen.awk $vm_info_file "$timestamp" 24 | sudo tee $ABS_PATH/ospfd.conf > /dev/null
    307 }}}
    308   A sample `ospfd.conf` is available at [http://groups.geni.net/geni/attachment/wiki/GENIExperimenter/Tutorials/SystematicExprCaseStudy/SmallTopo/DesignSetup/ospfd.conf.example SampleOSPFConf]
    309  
    310  * Start `XORP` Process
    311 {{{
    312 $sudo ./xorp_rtrmgr -b /etc/xorp/ospfd.conf -l /tmp/xorp_rtrmgr_log -d
    313 }}}
    314  
    315 The complete shell script to wrap up the above procedures is available at [http://groups.geni.net/geni/raw-attachment/wiki/GENIExperimenter/Tutorials/SystematicExprCaseStudy/SmallTopo/DesignSetup/start-xorp.sh StartXORP]
    316 
    317 
    318 {{{
    319 #!html
    320 <table border="0" cellpadding="0" cellspacing="0"><tr><td><img src="http://trac.gpolab.bbn.com/gcf/raw-attachment/wiki/Graphics/stock_notes.png" width="40" height="40" alt="Note"></td><td> Please go to <a href="http://groups.geni.net/geni/wiki/HowTo/WriteInstallScript"> HowToWriteInstallScript</a> for details on how to write an install script. </td></tr></table>
    321   </li></ol></td></tr></table>
    322 }}}
    323 
    324 Next we are going to install the automate script as an install script at the postboot stage.
    325 
    326 {{{
    327 #!html
    328 <table border="0" cellpadding="0" cellspacing="0"><tr><td><img src="http://groups.geni.net/geni/attachment/wiki/GENIExperimenter/Tutorials/Graphics/atention_92.jpg?format=raw" width='40' height='40'/></td><td>If you plan to use the same slice to do the next step, please delete your existing resources in your slice at this time, otherwise you can create a new slice to continue.</td></tr></table>
    329   </li>
    330 </ol>
    331 </td>
    332 </tr>
    333 </table>
    334 }}}
    335 
    336 == e. Install Script ==
     166 1  router-2-link-1 (192.168.2.1)  1.161 ms  1.117 ms  1.042 ms
     167 2  router-1-link-0 (192.168.1.1)  2.213 ms  2.161 ms  2.101 ms
     168
     169}}}
     170
     171
     172== d. Install Script ==
    337173
    338174Launch Flack for your slice, and import the RSpec `4node-v1.rspec` we just saved.
     
    443279
    444280
    445 '''[wiki:GENIExperimenter/Tutorials/SystematicExprCaseStudy/SmallTopo Small Topology: Introduction]'''
    446 
    447 '''[wiki:GENIExperimenter/Tutorials/SystematicExprCaseStudy/SmallTopo/Execute Small Topology: Execute]'''
     281'''[wiki:GENIExperimenter/Tutorials/SystematicExprCaseStudy/SmallTopoQuagga Small Topology: Introduction]'''
     282
     283'''[wiki:GENIExperimenter/Tutorials/SystematicExprCaseStudy/SmallTopoQuagga/Execute Small Topology: Execute]'''