Warning: preg_match(): Delimiter must not be alphanumeric, backslash, or NUL in /var/www/html/activities/books/networking/labbook/exp/emulab/exp15.1.php on line 2

Warning: preg_match(): Delimiter must not be alphanumeric, backslash, or NUL in /var/www/html/activities/books/networking/labbook/exp/emulab/exp15.1.php on line 2

Warning: preg_match(): Delimiter must not be alphanumeric, backslash, or NUL in /var/www/html/activities/books/networking/labbook/exp/emulab/exp15.1.php on line 3

Warning: preg_match(): Delimiter must not be alphanumeric, backslash, or NUL in /var/www/html/activities/books/networking/labbook/exp/emulab/exp15.1.php on line 4

Warning: preg_match(): Delimiter must not be alphanumeric, backslash, or NUL in /var/www/html/activities/books/networking/labbook/exp/emulab/exp15.1.php on line 5

Warning: preg_match(): Delimiter must not be alphanumeric, backslash, or NUL in /var/www/html/activities/books/networking/labbook/exp/emulab/exp15.1.php on line 8

Warning: include(net.top.html): Failed to open stream: No such file or directory in /var/www/html/activities/books/networking/labbook/exp/emulab/exp15.1.php on line 12

Warning: include(): Failed opening 'net.top.html' for inclusion (include_path='.:/usr/local/lib/php') in /var/www/html/activities/books/networking/labbook/exp/emulab/exp15.1.php on line 12
Hands-On Networking: Experiment 15.1 (An Emulab Approach) Home > Student > Experiments > Emulab > 15.1

Chapter 15: Experiment 15.1 - Configure IP Addresses

The Emulab approach to Experiment 15.1 involved using the NetBuild Gui to draw the basic setup. The NS script was then saved and modified to override the Gui's assumptions as to IP addresses. Here is the script generated by the NetBuild Gui:

  
#generated by Netbuild 1.03
set ns [new Simulator]
source tb_compat.tcl

set node12 [$ns node]
set node13 [$ns node]
set node14 [$ns node]
set node15 [$ns node]
set node16 [$ns node]



set lan2 [$ns make-lan "$node12 $node13 $node16 " 100Mb 0ms]
set lan3 [$ns make-lan "$node14 $node15 $node16 " 100Mb 0ms]



$ns rtproto Static
$ns run
#netbuild-generated ns file ends.

The only thing wrong with this solution is that the IP addresses are not correct. Hence the revised version:

set ns [new Simulator]
source tb_compat.tcl

set node12 [$ns node]
set node13 [$ns node]
set node14 [$ns node]
set node15 [$ns node]
set node16 [$ns node]



set lan2 [$ns make-lan "$node12 $node13 $node16 " 100Mb 0ms]
set lan3 [$ns make-lan "$node14 $node15 $node16 " 100Mb 0ms]

tb-set-ip-lan $node12 $lan2 10.0.0.1
tb-set-ip-lan $node13 $lan2 10.0.0.2
tb-set-ip-lan $node16 $lan2 10.0.0.3

tb-set-ip-lan $node14 $lan3 192.168.0.1
tb-set-ip-lan $node15 $lan3 192.168.0.2
tb-set-ip-lan $node16 $lan3 192.168.0.3

$ns rtproto Static
$ns run

Notice that six lines have been added to specify the desired IP addresses.
Warning: include(net.bottom.html): Failed to open stream: No such file or directory in /var/www/html/activities/books/networking/labbook/exp/emulab/exp15.1.php on line 87

Warning: include(): Failed opening 'net.bottom.html' for inclusion (include_path='.:/usr/local/lib/php') in /var/www/html/activities/books/networking/labbook/exp/emulab/exp15.1.php on line 87