Difference between revisions of "Example-basic"

From VNUML-WIKI
Jump to: navigation, search
(Scenario)
Line 15: Line 15:
 
Following example builds the basic topology shown in figure. We provide an [basic-ipv4.xml IPv4 version] and a [basic-ipv6.xml IPv6 version]. The IPv6 version is slightly different; it uses the eth0 host interface as external connection for UML3.
 
Following example builds the basic topology shown in figure. We provide an [basic-ipv4.xml IPv4 version] and a [basic-ipv6.xml IPv6 version]. The IPv6 version is slightly different; it uses the eth0 host interface as external connection for UML3.
  
Note that the /root/uml1-conf directory must exists in the host machine in order the [../../1.7/reference/index.html#filetree <filetree>] tag works in UML1 (for example, you can create it with 'mkdir /root/uml1-conf' and create and empty file inside with 'touch /root/uml1-conf/foobar.conf' to test). In addition, the [../../1.7/reference/index.html#exec <exec>] tags are intented to test the command execution mode (more information in the [../../1.7/user/index.html#execute_commands User Manual]). For example, use 'vnumlparser.pl -x start@basic.xml -v' to run the commands with seq="start" (in addition, the /root/uml1-conf file will be copied to the virtual machine uml1) and 'vnumlparser.pl -x stop@basic.xml -v' to run the commands with seq="stop".<center>[[Image:basic-ipv4.png|Basic IPv4]]</center><br /><center>[[Image:basic-ipv6.png|Basic IPv6]]</center><br />
+
Note that the /root/uml1-conf directory must exists in the host machine in order the [[Reference#<filetree>|<filetree>]] tag works in UML1 (for example, you can create it with 'mkdir /root/uml1-conf' and create and empty file inside with 'touch /root/uml1-conf/foobar.conf' to test). In addition, the [[Reference#<exec>|<exec>] tags are intented to test the command execution mode (more information in the [../../1.7/user/index.html#execute_commands User Manual]). For example, use 'vnumlparser.pl -x start@basic.xml -v' to run the commands with seq="start" (in addition, the /root/uml1-conf file will be copied to the virtual machine uml1) and 'vnumlparser.pl -x stop@basic.xml -v' to run the commands with seq="stop".
|-
+
 
| class="title" colspan="2" | VNUML Description (IPv4)
+
<center>[[Image:basic-ipv4.png|Basic IPv4]]</center><br />
|-
+
 
| colspan="2" |
+
<center>
<br />
+
[[Image:basic-ipv6.png|Basic IPv6]]
 +
</center><br />
 +
 
 +
 
 +
== VNUML Description (IPv4) ==
 +
 
 
  <?xml version="1.0" encoding="UTF-8"?>
 
  <?xml version="1.0" encoding="UTF-8"?>
 
  <!DOCTYPE vnuml SYSTEM "/usr/share/xml/vnuml/vnuml.dtd">
 
  <!DOCTYPE vnuml SYSTEM "/usr/share/xml/vnuml/vnuml.dtd">
Line 118: Line 123:
 
     </host>
 
     </host>
 
  </vnuml>
 
  </vnuml>
<br />
+
 
|-
+
== VNUML Description (IPv6) ==
| class="title" colspan="2" | VNUML Description (IPv6)
+
 
|-
 
| colspan="2" |
 
<br />
 
 
  <?xml version="1.0" encoding="UTF-8"?>
 
  <?xml version="1.0" encoding="UTF-8"?>
 
  <!DOCTYPE vnuml SYSTEM "/usr/share/xml/vnuml/vnuml.dtd">
 
  <!DOCTYPE vnuml SYSTEM "/usr/share/xml/vnuml/vnuml.dtd">
Line 227: Line 229:
 
     </host>
 
     </host>
 
  </vnuml>
 
  </vnuml>
<br />
 
|-
 
| class="title" colspan="2" | Old Releases
 
|-
 
| colspan="2" |
 
<br />
 
* [1.3/tutorial.html 1.3] (note that in this version the example was named "Tutorial" instead of "Basic").
 
* [1.6/basic.html 1.6]<br />
 
|-
 
| colspan="2" |
 
----
 
<center><font face="Tahoma">''Last update: <br />''</font><br /><center>[http://validator.w3.org/check/referer [[Image:valid-html401.png|Valid HTML 4.01!]]]</center></center>
 
|}
 
  
</div>
+
 
 +
 
 +
== Old Releases ==
 +
 
 +
* [http://jungla.dit.upm.es/~vnuml/doc/examples/basic/1.3/tutorial.html 1.3] (note that in this version the example was named "Tutorial" instead of "Basic").
 +
* [http://jungla.dit.upm.es/~vnuml/doc/examples/basic/1.6/basic.html 1.6]<br />

Revision as of 04:26, 18 February 2007

VNUML Basic Example

Authors:
Fermín Galán (galan at dit.upm.es)
David Fernández (david at dit.upm.es)
version 1.7, November 21st, 2006


Scenario

Following example builds the basic topology shown in figure. We provide an [basic-ipv4.xml IPv4 version] and a [basic-ipv6.xml IPv6 version]. The IPv6 version is slightly different; it uses the eth0 host interface as external connection for UML3.

Note that the /root/uml1-conf directory must exists in the host machine in order the <filetree> tag works in UML1 (for example, you can create it with 'mkdir /root/uml1-conf' and create and empty file inside with 'touch /root/uml1-conf/foobar.conf' to test). In addition, the [[Reference#<exec>|<exec>] tags are intented to test the command execution mode (more information in the [../../1.7/user/index.html#execute_commands User Manual]). For example, use 'vnumlparser.pl -x start@basic.xml -v' to run the commands with seq="start" (in addition, the /root/uml1-conf file will be copied to the virtual machine uml1) and 'vnumlparser.pl -x stop@basic.xml -v' to run the commands with seq="stop".

Basic IPv4

Basic IPv6



VNUML Description (IPv4)

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE vnuml SYSTEM "/usr/share/xml/vnuml/vnuml.dtd">

<vnuml>
   <global>
      <version>1.7</version>
      <simulation_name>basic</simulation_name>
      <ssh_key>/root/.ssh/identity.pub</ssh_key>

      <automac offset="0"/>
      <vm_mgmt type="private" network="192.168.0.0" mask="24" offset="100">

         <host_mapping/>
      </vm_mgmt>
      <vm_defaults>
         <filesystem type="cow">/usr/share/vnuml/filesystems/root_fs_tutorial</filesystem>
         <shell>/bin/sh</shell>         
      </vm_defaults>

   </global>
   <net name="Net0" mode="uml_switch" />
   <net name="Net1" mode="uml_switch"/>

   <net name="Net2" mode="uml_switch"/>
   <net name="Net3" mode="uml_switch"/>
   <vm name="uml1">

      <mem>50M</mem>
      <if id="1" net="Net0">
         <ipv4>10.0.0.1</ipv4>

      </if>
      <route type="ipv4" gw="10.0.0.3">default</route>
      <filetree root="/" when="start">/root/uml1-conf</filetree>

      <exec seq="start" type="verbatim">ls</exec>
      <exec seq="start" type="verbatim">pwd</exec>

      <exec seq="start" type="verbatim">touch /root/example.start</exec>
      <exec seq="stop" type="verbatim">rm /root/example.start</exec>

      <exec seq="stop" type="verbatim">touch /root/example.stop</exec>
   </vm>
   <vm name="uml2">
      <if id="1" net="Net0">

         <ipv4>10.0.0.2</ipv4>
      </if>
      <route type="ipv4" gw="10.0.0.3">default</route>

   </vm>
   <vm name="uml3">
      <if id="1" net="Net0">
         <ipv4>10.0.0.3</ipv4>

      </if>
      <if id="2" net="Net1">
         <ipv4>10.0.1.1</ipv4>
      </if>

      <if id="3" net="Net3">
         <ipv4>10.0.3.1</ipv4>
      </if>
      <route type="ipv4" gw="10.0.1.2">10.0.2.0/24</route>

      <route type="ipv4" gw="10.0.3.2">default</route>
      <forwarding type="ip"/>
   </vm>

   <vm name="uml4">
      <if id="1" net="Net1">
         <ipv4>10.0.1.2</ipv4>
      </if>

      <if id="2" net="Net2">
         <ipv4>10.0.2.1</ipv4>
      </if>
      <route type="ipv4" gw="10.0.1.1">default</route>

      <forwarding type="ip"/>
   </vm>
   <vm name="uml5">
      <if id="1" net="Net2">

         <ipv4 mask="255.255.255.0">10.0.2.2</ipv4>
      </if>
      <route type="ipv4" gw="10.0.2.1">default</route>

   </vm>
   <host>
      <hostif net="Net3">
         <ipv4>10.0.3.2</ipv4>
      </hostif>

      <route type="ipv4" gw="10.0.3.1">10.0.0.0/16</route>
   </host>
</vnuml>

VNUML Description (IPv6)

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE vnuml SYSTEM "/usr/share/xml/vnuml/vnuml.dtd">

<vnuml>
   <global>
      <version>1.7</version>
      <simulation_name>basic</simulation_name>
      <ssh_key>/root/.ssh/identity.pub</ssh_key>

      <automac offset="0"/>
      <vm_mgmt type="private" network="192.168.0.0" mask="24" offset="0">

         <host_mapping/>
      </vm_mgmt>
      <vm_defaults>
         <filesystem type="cow">/usr/share/vnuml/filesystems/root_fs_tutorial</filesystem>
         <shell>/bin/sh</shell>

      </vm_defaults>
   </global>
   <net name="Net0" mode="uml_switch" />
   <net name="Net1" mode="uml_switch" />

   <net name="Net2" mode="uml_switch" />
   <net name="Net3" mode="virtual_bridge" external="eth0" />

   <vm name="uml1">
      <mem>50M</mem>
      <if id="1" net="Net0">
         <ipv6>3ffe:ffff:0::1/48</ipv6>

      </if>
      <route type="ipv6" gw="3ffe:ffff:0::3">2000::/3</route>
      <filetree root="/" when="start">/root/uml1-conf</filetree>

      <exec seq="start" type="verbatim">ls</exec>
      <exec seq="start" type="verbatim">pwd</exec>

      <exec seq="start" type="verbatim">touch /root/example.start</exec>
      <exec seq="stop" type="verbatim">rm /root/example.start</exec>

      <exec seq="stop" type="verbatim">touch /root/example.stop</exec>
   </vm>
   <vm name="uml2">  
      <if id="1" net="Net0">

         <ipv6>3ffe:ffff:0::2/48</ipv6>
      </if>
      <route type="ipv6" gw="3ffe:ffff:0::3">2000::/3</route>

   </vm>
   <vm name="uml3">   
      <if id="1" net="Net0">
         <ipv6>3ffe:ffff:0::3/48</ipv6>

      </if>
      <if id="2" net="Net1">
         <ipv6>3ffe:ffff:1::3/48</ipv6>
      </if>

      <if id="3" net="Net3">
         <ipv6>3ffe:ffff:3::3/48</ipv6>
      </if>
      <route type="ipv6" gw="3ffe:ffff:1::4">3ffe:ffff:2::/48</route>

      <route type="ipv6" gw="3ffe:ffff:3::254">2000::/3</route>
      <forwarding type="ipv6"/>
      <exec seq="start" type="verbatim">touch filesample</exec>

   </vm>
   <vm name="uml4">   
      <if id="1" net="Net1">
         <ipv6>3ffe:ffff:1::4/48</ipv6>

      </if>
      <if id="2" net="Net2">
         <ipv6>3ffe:ffff:2::4/48</ipv6>
      </if>

      <route type="ipv6" gw="3ffe:ffff:1::3">2000::/3</route>
      <forwarding type="ipv6"/>
   </vm>

   <vm name="uml5">
      <if id="1" net="Net2">
         <ipv6>3ffe:ffff:2::5/48</ipv6>
      </if>

      <route type="ipv6" gw="3ffe:ffff:2::4">2000::/3</route>
   </vm>
   <host>
      <hostif net="Net3">

         <ipv4 mask="255.255.255.192">138.4.7.148</ipv4>
         <ipv6>3ffe:ffff:3::254/48</ipv6>
      </hostif>
      <physicalif name="eth0" type="ipv4" ip="138.4.7.148" mask="255.255.255.192" gw="138.4.7.189"/>

      <route type="ipv4" gw="138.4.7.189">default</route>
      <route type="ipv6" gw="3ffe:ffff:3::3">3ffe:ffff::/32</route>

   </host>
</vnuml>


Old Releases

  • 1.3 (note that in this version the example was named "Tutorial" instead of "Basic").
  • 1.6