Difference between revisions of "Example-olive"

From VNX
Jump to: navigation, search
(Scenario)
(Scenario)
Line 23: Line 23:
 
After that you will see the consoles of the 6 virtual machines created. To access the Ubuntu hosts just use the standard login/password (root/xxxx). To access the Olive routers use whatever you have configured in your Olive root-file-system (remember that we cannot distribute root-file-systems for Olive; you have to create it yourself and be aware of the legal restrictions).
 
After that you will see the consoles of the 6 virtual machines created. To access the Ubuntu hosts just use the standard login/password (root/xxxx). To access the Olive routers use whatever you have configured in your Olive root-file-system (remember that we cannot distribute root-file-systems for Olive; you have to create it yourself and be aware of the legal restrictions).
  
Once the scenario has completely started (after login window is available, Olive routers take some time to finish their configuration) you can access the systems and test connectivity. For example, from h1 console:
+
Once the scenario has completely started (after login window is available, Olive routers take some time to finish their configuration) you can access the systems and test connectivity. For example, from h1 console you can traceroute to h3:
 
<pre>
 
<pre>
 
root@h1:~# traceroute -n 10.0.3.2
 
root@h1:~# traceroute -n 10.0.3.2
Line 31: Line 31:
 
  3  10.0.3.2  2.990 ms  2.792 ms  2.784 ms
 
  3  10.0.3.2  2.990 ms  2.792 ms  2.784 ms
 
root@h1:~#  
 
root@h1:~#  
 +
</pre>
 +
 +
Or from r1 you can have a look at the router configuration:
 +
<pre>
 +
root@r1% cli
 +
root@r1> show configuration
 +
## Last commit: 2011-07-13 13:17:00 UTC by root
 +
version 9.5R1.8;
 +
system {
 +
    host-name r1;
 +
    root-authentication {
 +
        encrypted-password "$1$9zJOSJpW$.IDbxn9XPgZKNKfJTRtMk."; ## SECRET-DATA
 +
    }
 +
    services {
 +
        ssh;
 +
    }
 +
}
 +
interfaces {
 +
    fxp0 {
 +
 +
        unit 0 {
 +
            family inet {
 +
                address 10.0.1.1/24;
 +
            }
 +
            family inet6 {
 +
                address 2001:db8:1::1/64;
 +
            }
 +
        }
 +
    }
 +
    fxp1 {
 +
        unit 0 {   
 +
            family inet {
 +
                address 10.0.0.1/30;
 +
            }
 +
            family inet6 {
 +
                address 2001:db8:12::1/64;
 +
            }
 +
        }
 +
    }
 +
    fxp2 {
 +
 +
        unit 0 {
 +
            family inet {
 +
                address 10.0.0.9/30;
 +
            }
 +
            family inet6 {
 +
                address 2001:db8:13::1/64;
 +
            }
 +
        }
 +
    }
 +
}
 +
routing-options {
 +
    rib inet6.0 {
 +
        static {
 +
            route 2001:db8:2::/64 next-hop 2001:db8:12::2;
 +
            route 2001:db8:3::/64 next-hop 2001:db8:13::2;
 +
        }
 +
    }
 +
    static {
 +
        route 10.0.2.0/24 next-hop 10.0.0.2;
 +
        route 10.0.3.0/24 next-hop 10.0.0.10;
 +
    }
 +
}
 +
 +
root@r1
 
</pre>
 
</pre>
  

Revision as of 14:25, 13 July 2011

Olive example

Authors:
David Fernández (david at dit.upm.es)
version 1.9, July 8th, 2011


Scenario

A simple example scenario designed to show and experiment with the Olive based Juniper router emulation capabilities of VNX. The scenario is made of 6 virtual machines: three Olive routers (r1, r2, r3) interconected in a triangle topology; and three Linux (Ubuntu) hosts (h1, h2, h3), each connected to a LAN serviced by one of the routers (see figure below). The host has an interface on the scenario connected to one of the LANs.

Olive example scenario map
(generated using "vnx -f example_olive.xml -v --show-map")

To start the scenario just type:

cd /usr/share/vnx/examples/
vnx -f example_olive.xml -v --create

After that you will see the consoles of the 6 virtual machines created. To access the Ubuntu hosts just use the standard login/password (root/xxxx). To access the Olive routers use whatever you have configured in your Olive root-file-system (remember that we cannot distribute root-file-systems for Olive; you have to create it yourself and be aware of the legal restrictions).

Once the scenario has completely started (after login window is available, Olive routers take some time to finish their configuration) you can access the systems and test connectivity. For example, from h1 console you can traceroute to h3:

root@h1:~# traceroute -n 10.0.3.2
traceroute to 10.0.3.2 (10.0.3.2), 30 hops max, 60 byte packets
 1  10.0.1.1  0.664 ms  0.557 ms  0.609 ms
 2  10.0.0.10  1.729 ms  1.664 ms  2.101 ms
 3  10.0.3.2  2.990 ms  2.792 ms  2.784 ms
root@h1:~# 

Or from r1 you can have a look at the router configuration:

root@r1% cli
root@r1> show configuration 
## Last commit: 2011-07-13 13:17:00 UTC by root
version 9.5R1.8;
system {
    host-name r1;
    root-authentication {
        encrypted-password "$1$9zJOSJpW$.IDbxn9XPgZKNKfJTRtMk."; ## SECRET-DATA
    }
    services {
        ssh;
    }
}
interfaces {
    fxp0 {

        unit 0 {
            family inet {
                address 10.0.1.1/24;
            }
            family inet6 {
                address 2001:db8:1::1/64;
            }
        }
    }
    fxp1 {
        unit 0 {    
            family inet {
                address 10.0.0.1/30;
            }
            family inet6 {
                address 2001:db8:12::1/64;
            }
        }
    }
    fxp2 {

        unit 0 {
            family inet {
                address 10.0.0.9/30;
            }
            family inet6 {
                address 2001:db8:13::1/64;
            }
        }
    }
}
routing-options {
    rib inet6.0 {
        static {
            route 2001:db8:2::/64 next-hop 2001:db8:12::2;
            route 2001:db8:3::/64 next-hop 2001:db8:13::2;
        }
    }
    static {
        route 10.0.2.0/24 next-hop 10.0.0.2;
        route 10.0.3.0/24 next-hop 10.0.0.10;
    }
}

root@r1

Olive routers configuration

At startup, the Olive routers load a configuration that is made of two parts:

  • the configuration specified in the <conf> tag of each router:
  • <conf>conf/example_olive/r1.conf</conf>
    
  • the configuration commands derived from the interfaces and routes (<if> and <route> tags) values in the VNX XML specification. For example, in the case of router r1, the interfaces specified:
  •    <if id="1" net="Lan1" name="fxp0">
         <ipv4>10.0.1.1/24</ipv4>
         <ipv6>2001:db8:1::1/64</ipv6>
       </if>
       <if id="2" net="ptp12" name="fxp1">
         <ipv4>10.0.0.1/30</ipv4>
         <ipv6>2001:db8:12::1/64</ipv6>
       </if>
       <if id="3" net="ptp13" name="fxp2">
         <ipv4>10.0.0.9/30</ipv4>
         <ipv6>2001:db8:13::1/64</ipv6>
       </if>
    

    are translated into the following commands added to the router configuration:

    interfaces {
        fxp0 {
            unit 0 {
                family inet {
                    address 10.0.1.1/24;
                }
                family inet6 {
                    address 2001:db8:1::1/64;
                }
            }
        }
        fxp1 {
            unit 0 {    
                family inet {
                    address 10.0.0.1/30;
                }       
                family inet6 {
                    address 2001:db8:12::1/64;
                }       
            }           
        }               
        fxp2 {          
            unit 0 {    
                family inet {
                    address 10.0.0.9/30;
                }       
                family inet6 {
                    address 2001:db8:13::1/64;
                }       
            }           
        }               
    }             
    

    You can see the results of the configuration commands executed over Olive routers in the VNX ACE daemon log file:

    root@r1% less /var/log/vnxolived.log
    




    You can show the map of the scenario with:

    vnx -f example_olive.xml -v --show-map
    

    VNX Description

    <vnx xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:noNamespaceSchemaLocation="/usr/share/xml/vnx/vnx-1.97.xsd">
      <global>
        <version>1.92</version>
        <scenario_name>example_olive</scenario_name>
        <automac offset="0"/>
        <vm_mgmt type="none" />
        <vm_defaults>
                <console id="0" display="no"/>
                <console id="1" display="yes"/>
        </vm_defaults>
        <!--olive_ext>simple_olive-olext.xml</olive_ext-->
      </global>
        
      <net name="Lan1" mode="virtual_bridge" />
      <net name="Lan2" mode="virtual_bridge" />
      <net name="Lan3" mode="virtual_bridge" />
      <net name="ptp12" mode="virtual_bridge" />
      <net name="ptp13" mode="virtual_bridge" />
      <net name="ptp23" mode="virtual_bridge" />
          
      <!-- NODES -->
      <vm name="r1" type="libvirt" subtype="kvm" os="olive">
        <filesystem type="cow">/usr/share/vnx/filesystems/root_fs_olive</filesystem>
        <mem>256M</mem>
        <conf>conf/example_olive/r1.conf</conf>
        <if id="1" net="Lan1" name="fxp0">
          <ipv4>10.0.1.1/24</ipv4>
          <ipv6>2001:db8:1::1/64</ipv6>
        </if>
        <if id="2" net="ptp12" name="fxp1">
          <ipv4>10.0.0.1/30</ipv4>
          <ipv6>2001:db8:12::1/64</ipv6>
        </if>
        <if id="3" net="ptp13" name="fxp2">
          <ipv4>10.0.0.9/30</ipv4>
          <ipv6>2001:db8:13::1/64</ipv6>
        </if>
      </vm>
    
      <vm name="r2" type="libvirt" subtype="kvm" os="olive">
        <filesystem type="cow">/usr/share/vnx/filesystems/root_fs_olive</filesystem>
        <mem>256M</mem>
        <conf>conf/example_olive/r2.conf</conf>
        <if id="1" net="Lan2" name="fxp0">
          <ipv4>10.0.2.1/24</ipv4>
          <ipv6>2001:db8:2::1/64</ipv6>
        </if>
        <if id="2" net="ptp12" name="fxp1">
          <ipv4>10.0.0.2/30</ipv4>
          <ipv6>2001:db8:12::2/64</ipv6>
        </if>
        <if id="3" net="ptp23" name="fxp2">
          <ipv4>10.0.0.5/30</ipv4>
          <ipv6>2001:db8:23::1/64</ipv6>
        </if>
      </vm>
    
      <vm name="r3" type="libvirt" subtype="kvm" os="olive">
        <filesystem type="cow">/usr/share/vnx/filesystems/root_fs_olive</filesystem>
        <mem>256M</mem>
        <conf>conf/example_olive/r3.conf</conf>
        <if id="1" net="Lan3" name="fxp0">
          <ipv4>10.0.3.1/24</ipv4>
          <ipv6>2001:db8:3::1/64</ipv6>
        </if>
        <if id="2" net="ptp13" name="fxp1">
          <ipv4>10.0.0.10/30</ipv4>
          <ipv6>2001:db8:12::2/64</ipv6>
        </if>
        <if id="3" net="ptp23" name="fxp2">
          <ipv4>10.0.0.6/30</ipv4>
          <ipv6>2001:db8:13::2/64</ipv6>
        </if>
      </vm>
    
      <vm name="h1" type="libvirt" subtype="kvm" os="linux">
        <filesystem type="cow">/usr/share/vnx/filesystems/root_fs_ubuntu</filesystem>
        <mem>256M</mem>
        <if id="1" net="Lan1">
          <ipv4>10.0.1.2/24</ipv4>
          <ipv6>2001:db8:1::2/64</ipv6>
        </if>
      </vm>
    
      <vm name="h2" type="libvirt" subtype="kvm" os="linux">
        <filesystem type="cow">/usr/share/vnx/filesystems/root_fs_ubuntu</filesystem>
        <mem>256M</mem>
        <if id="1" net="Lan2">
          <ipv4>10.0.2.2/24</ipv4>
          <ipv6>2001:db8:2::2/64</ipv6>
        </if>
      </vm>
    
      <vm name="h3" type="libvirt" subtype="kvm" os="linux">
        <filesystem type="cow">/usr/share/vnx/filesystems/root_fs_ubuntu</filesystem>
        <mem>256M</mem>
        <if id="1" net="Lan3">
          <ipv4>10.0.3.2/24</ipv4>
          <ipv6>2001:db8:3::2/64</ipv6>
        </if>
      </vm>
    
      <host>
        <hostif net="Lan1">
           <ipv4>10.0.1.3/24</ipv4>
           <ipv6>2001:db8:1::3/64</ipv6>
        </hostif>
      </host>
      
    </vnx>
    

    Download

    The example is included in VNX distribution.

    Known issues

    • Network interface problems. Sometimes olive router network interfaces do not work properly. Everything seems to be correctly configured (ifconfig or show configuration results are correct), but pings to other virtual machines do not work or show very long delays:
    • root@h1:~# ping 10.0.3.2
      PING 10.0.3.2 (10.0.3.2) 56(84) bytes of data.
      64 bytes from 10.0.3.2: icmp_req=1 ttl=62 time=48536 ms
      64 bytes from 10.0.3.2: icmp_req=2 ttl=62 time=47537 ms
      64 bytes from 10.0.3.2: icmp_req=3 ttl=62 time=46537 ms
      64 bytes from 10.0.3.2: icmp_req=4 ttl=62 time=45537 ms
      64 bytes from 10.0.3.2: icmp_req=5 ttl=62 time=44537 ms
      64 bytes from 10.0.3.2: icmp_req=6 ttl=62 time=43537 ms
      64 bytes from 10.0.3.2: icmp_req=7 ttl=62 time=42537 ms
      64 bytes from 10.0.3.2: icmp_req=8 ttl=62 time=41537 ms
      64 bytes from 10.0.3.2: icmp_req=9 ttl=62 time=40537 ms
      64 bytes from 10.0.3.2: icmp_req=10 ttl=62 time=39537 ms
      

      Besides, the following messages are shown in the console or when executing dmesg:

      swap_pager: indefinite wait buffer: bufobj: 0, blkno: 10, size: 4096
      fxp2: device timeout, recovered (A) 
      

      This problem seems to be be caused by timeouts when writting to disk during virtual machine startup. No solution has been found yet to this problem but executing the scenario in a more powerfull machine. Olive routers startup seems to be very CPU intensive.