Freebsd12 Imunes Guia Usuario
Freebsd12 Imunes Guia Usuario
Freebsd12 Imunes Guia Usuario
12 November, 2018
Contents
1 Changelog 4
2 Introduction 5
2.1 Document overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
4 Quick Intro 14
4.1 Simple Network Scenario . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
4.1.1 Building a simple network . . . . . . . . . . . . . . . . . . . . . . . . . 14
4.1.2 Configuring a simple network . . . . . . . . . . . . . . . . . . . . . . . 16
4.1.3 Simulating a simple network . . . . . . . . . . . . . . . . . . . . . . . 23
4.2 Configuration files management . . . . . . . . . . . . . . . . . . . . . . . . . 26
4.2.1 Saving a virtual network configuration . . . . . . . . . . . . . . . . . . 26
4.2.2 Opening a virtual network configuration . . . . . . . . . . . . . . . . . 27
5 Advanced Usage 28
5.1 Extended Network Scenario . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
5.1.1 Canvas Management . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
5.1.2 Attaching an external interface . . . . . . . . . . . . . . . . . . . . . . 31
5.1.3 Attaching to a running experiment . . . . . . . . . . . . . . . . . . . . 31
5.2 Additional Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
5.2.1 Custom configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
5.2.2 Physical and logical interfaces . . . . . . . . . . . . . . . . . . . . . . 33
5.3 Additional Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
1
Contents Contents
A Installation 58
A.1 Installation of IMUNES on FreeBSD 8 . . . . . . . . . . . . . . . . . . . . . . 58
A.1.1 Installing FreeBSD . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
A.1.2 Step by step guide through the FreeBSD installation . . . . . . . . . . 58
A.1.3 Installing the FreeBSD X11 system - GUI . . . . . . . . . . . . . . . . 59
A.1.4 Installing IMUNES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
A.1.5 Recompiling the FreeBSD kernel with VIMAGE support . . . . . . . . . 61
A.1.6 Running IMUNES on FreeBSD . . . . . . . . . . . . . . . . . . . . . . 62
A.2 Installation of IMUNES on FreeBSD 9 . . . . . . . . . . . . . . . . . . . . . . 62
A.2.1 Installing FreeBSD . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
A.2.2 Step by step guide through the FreeBSD installation . . . . . . . . . . 62
A.2.3 Installing the FreeBSD X11 system - GUI . . . . . . . . . . . . . . . . 63
A.2.4 Installing IMUNES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
A.2.5 Recompiling the FreeBSD kernel with VIMAGE support . . . . . . . . . 65
A.2.6 Running IMUNES on FreeBSD . . . . . . . . . . . . . . . . . . . . . . 65
A.3 Installation of IMUNES on FreeBSD 10 . . . . . . . . . . . . . . . . . . . . . 66
A.3.1 Installing FreeBSD . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
2
A.3.2 Step by step guide through the FreeBSD installation . . . . . . . . . . 66
A.3.3 Installing the FreeBSD X11 system - GUI . . . . . . . . . . . . . . . . 67
A.3.4 Installing IMUNES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
A.3.5 Recompiling the FreeBSD kernel with VIMAGE support . . . . . . . . . 68
A.3.6 Running IMUNES on FreeBSD . . . . . . . . . . . . . . . . . . . . . . 69
A.4 Running IMUNES with VMware Player . . . . . . . . . . . . . . . . . . . . . . 69
A.4.1 Installing VMware . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
A.4.2 Downloading the VMware image . . . . . . . . . . . . . . . . . . . . . 69
A.4.3 Running the VMware image . . . . . . . . . . . . . . . . . . . . . . . 69
A.5 Installation of the IMUNES GUI on Linux . . . . . . . . . . . . . . . . . . . . . 70
A.6 Installation of the IMUNES GUI on Windows . . . . . . . . . . . . . . . . . . . 71
B Troubleshooting 72
B.1 Terminating all active experiments . . . . . . . . . . . . . . . . . . . . . . . . 72
B.1.1 Cleaning up hanging ZFS mounts . . . . . . . . . . . . . . . . . . . . 72
B.2 Restoring original ZFS snapshot . . . . . . . . . . . . . . . . . . . . . . . . . 72
B.3 Obtaining kernel panic traces . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
3
1 Changelog
4
2 Introduction
5
3 User Interface Layout
IMUNES can be used either through the simple Tcl/Tk based graphical user interface (GUI)
or through the command line interface (CLI).
We will run IMUNES on FreeBSD with some kind of X11 window manager and explain the
main GUI components. If X11 is not running you can start it using startx command. To run
IMUNES GUI use imunes command.
IMUNES GUI is a simple Tcl/Tk based management console, allowing specification and
management of virtual network topologies. Its main parts are the work space in the middle,
called canvas, the menubar on the top, the toolbox on the left side and the statusbar at the
bottom (Figure 3.1)
The default working mode after the initial start (or after creating a new virtual network con-
figuration file with the File → New option from the menubar) is edit mode. The edit mode
is used to build and configure network topologies, contrary to the execute mode whose pur-
pose is the network simulation. The network simulation will be explained later in the Section
4.1.3.
3.1 Toolbox
The toolbox, placed on the left side of the GUI, contains tools for building network topologies
and tools for adding annotations (Figure 3.2).These tools are all available in the edit mode.
In the execute mode, these tools (except for the Select tool) are shaded and cannot be used.
6
3.1. Toolbox 3. User Interface Layout
7
3.2. Menubar 3. User Interface Layout
3.2 Menubar
The menubar consists of menus that provide access to various functions (Figure 3.3). Some
options from the menubar are automatically disabled in the execute mode.
8
3.2. Menubar 3. User Interface Layout
• Undo - Undo the last change on the canvas reverting it to an older state.
• Redo - Reverse the undo command.
• Cut, Copy, Paste - Cut or copy elements from source and paste them to destination.
• Select all - Select a whole network topology.
• Select adjacent - Select nodes connected to the selected node(s). This feature is also
available through the node menu.
9
3.2. Menubar 3. User Interface Layout
• Background image - Change background on the current canvas (see Section 5.4.2).
• Previous, Next, First, Last - Switch between available canvases.
• Icon size - Change the size (normal or small) of all network elements (see Section
5.4.3).
• Show [network element parameter] - Show or hide information such as interface
names, IPv4/IPv6 addresses, etc. These options are usually saved in the .imn files,
providing consistent look of scenarios running on different computers.
• Show Topology Tree - Show or hide the tree with a list of all network topology elements.
• Show Background Image - Show or hide background image.
• Show Annotations - Show or hide annotations (text, oval, rectangle).
• Show Grid - Show or hide grid.
• Zoom In, Zoom Out - Magnify (Zoom In) or reduce (Zoom Out) the size of the display.
• Themes - Choose one of the themes from the submenu. Each theme represents a
collection of styles, where a style describes the appearance (or appearances) of a Ttk
widget class.
10
3.2. Menubar 3. User Interface Layout
• Auto rearrange all - Automatically rearrange position of all network elements on can-
vas.
• Auto rearrange selected - Automatically rearrange position of the selected group of
network elements.
• Align to grid - Arrange all network elements on canvas aligning them to grid.
• IPv4 auto-assign addresses/routes - Automatically assign IPv4 addresses and routes
upon creating a new node.
• IPv6 auto-assign addresses/routes - Automatically assign IPv6 addresses and routes
upon creating a new node.
• Auto-generate /etc/hosts file - Create a hosts file on every node and map every other
node hostname with its address.
• Randomize MAC bytes - Randomizes the 4th and 5th byte of the automatically gener-
ated MAC address.
• IPv4 address pool - Set variable-mask IPv4 address pool through the invoked dialog
in order to replace default 10.0.0.0/24 address pool (see Section 5.3.3). This will be
applied to all the subsequentially created network layer elements.
• IPv6 address pool - Set variable-mask IPv6 address pool through the invoked dialog
in order to replace default fc00::/64 address pool (see Section 5.3.4). This will be
applied to all the subsequentially created network layer elements.
• Routing protocol defaults - Set the routing protocol defaults (routing model and proto-
cols) through the invoked dialog (see Section 5.3.5). This will be applied to all selected
routers (if any) at the time of change, as well as to all the subsequentially created ones.
11
3.2. Menubar 3. User Interface Layout
12
3.2. Menubar 3. User Interface Layout
• Execute - Start an experiment and switch to the execute mode. In the process of
starting an experiment, IMUNES creates and configures the virtual network. All events
during that process will be shown in the statusbar.
• Terminate - Terminate an experiment and switch to the edit mode. During the ter-
mination process, IMUNES will shut down all network elements and it will terminate
active services on each node. The termination is finished when the message about
the successful cleanup shows up in the statusbar.
• Restart - Terminate and restart the running experiment.
• Attach to experiment - This option opens opens a window with the list of running
experiments on the current computer. It allows to resume running experiments that
are shown in the Attach to experiment window shown in Figure 5.9.
13
4 Quick Intro
14
4.1. Simple Network Scenario 4. Quick Intro
When nodes are connected with the Link tool (the direction does not matter), the source
node, the destination node and the link automatically get preconfigured parameters. When
a mouse pointer is above a node or a link, some of the configured parameters are shown on
the left side of the statusbar placed at the bottom of the window (Figure 4.2).
Some of the parameters can be visible on the canvas: interface names (link layer: e0, e1, e2
and network layer: eth0, eth1), IPv4/IPv6 addresses of network layer elements (PC, host,
router), node names (router1, host1, switch1, pc1, pc2) and link labels (Bandwidth, Delay,
BER or Duplicate if their values are not default).
You can manipulate with the visibility of nodes and links parameters from the View menu
(Figure 4.3). In this simple scenario we do not want for IPv6 addresses to be visible, so we
will turn the Show IPv6 Addresses option off.
15
4.1. Simple Network Scenario 4. Quick Intro
To delete the network element select it using the Select tool and then use the Delete key-
board button. You can also delete it by right clicking on it and clicking on the Delete label in
the popped up menu. The node deletion is automatically followed by the deletion of associ-
ated links.
16
4.1. Simple Network Scenario 4. Quick Intro
Network elements configuration parameters can be also changed through the topology tree.
To show the topology tree turn on the Show Topology Tree option from the View menu. The
tree with a list of network topology elements (nodes and links) will be shown on the right
side of the window (Figure 4.5). To open the network element configuration window double
click or use the Enter keyboard button on node, interface or link label in the topology tree.
Depending on the type of a network element in our topology, there are 4 types of configura-
tion windows:
• Hub/LAN switch configuration window
• PC/Host/Click router configuration window
• Router configuration window
17
4.1. Simple Network Scenario 4. Quick Intro
Packet scheduling method is now applied and you can see new queuing discipline for inter-
face e0 in the column Queue disc (Figure 4.7).
18
4.1. Simple Network Scenario 4. Quick Intro
Repeat the same procedure for the other link layer interfaces. Changed configuration is
already applied so you can close the configuration window with the Cancel button but you
can also use the Apply and Close button.
Besides a node name field, PC/Host/Click router configuration window contains startup ser-
vices, routing parameters and custom configuration parameters (in the window associated
with the Configuration tab) and network interface parameters (in the window associated with
the Interfaces tab).
We will change the node name, network interface parameters and routing parameters.
Change the host node name to office-host and PC node names to office-pc1 and office-pc2.
To change IPv4 address left click on the Interfaces tab, select interface eth0 from the list of
interfaces, change the IPv4 address field and click on the Apply button (Figure 4.9). We will
change the host IPv4 address field to 192.168.2.5/24 (now it belongs to 192.168.2.0/24) and
PC IPv4 address fields to 192.168.1.5/24 and 192.168.1.7/24 (now they belong to network
192.168.1.0/24). IP address fields require the CIDR notation, so the IPv4 address is followed
by a slash and a network length.
19
4.1. Simple Network Scenario 4. Quick Intro
Static routes
PCs and Hosts both use static routing. The preconfigured routing table contains only the
default route. Every static route, as well as the default route, consists of:
1. the destination network: an IP address which is followed by a slash and a network
prefix and
2. the next hop network interface IP address (which is an IP address without a slash and
without a network prefix).
If the route syntax is wrong, that route will be silently ignored.
We will add the static route on office-pc1 and office-pc2 for the network 192.168.2.0/24
through the gateway 192.168.1.1 (Figure 4.10).
IPv6 addresses and default routes (placed below IPv4 addresses and routes) can be
deleted.
20
4.1. Simple Network Scenario 4. Quick Intro
To apply the changed configuration and close the configuration window click on the Apply
and Close button.
21
4.1. Simple Network Scenario 4. Quick Intro
Default values are as follows: the link which transmits packets without errors and without
any possibility for the packet duplication with the unlimited link bandwidth and the zero pro-
pagation delay. The link width is set to value 2 and the link color is red.
We will leave default values on all links except on the link between office-switch and office-
router (Figure 4.14). On that link we will set up the delay of 30000 µs. Delay will be tested
during the network simulation with the traceroute tool (see Section 4.1.3).
22
4.1. Simple Network Scenario 4. Quick Intro
23
4.1. Simple Network Scenario 4. Quick Intro
In addition to configured parameters, each node will be set with the loopback interface, a
router will have the kernel forwarding enabled, and a host node will have portmap and inetd
started.
Information about the time spent instantiating the network topology is shown in the statusbar
(Figure 4.17).
In the right corner of the statusbar you can also see that IMUNES now works in the execute
mode, as well as experiment unique identifier.
Note that both the node and the link menu in the execute menu offer the possibility to open
the configuration window (Configure label).
24
4.1. Simple Network Scenario 4. Quick Intro
From the node configuration window in the execute mode it is possible to change only the
node name. Other node parameters such as link layer interface parameters, network inter-
face parameters and routing parameters can be changed from the shell window on each
node. To change those parameters from the node configuration window, stop the node (us-
ing the Stop label), change parameters and then start the node agin (using the Start label).
On the other side, from the link configuration window in the execute mode it is possible to
change the following link parameters: link bandwidth, the propagation delay, the bit error rate
and the probability of package duplication. It is also possible to change display properties:
the link width and the link color.
We will now check if the virtual network topology is properly configured. Open the shell
window (e.g. Shell window → csh or simply double click on the node) on the network
element (e.g. office-pc1).
• To check the network interface eth0 parameters type the following command:
ifconfig eth0. The result is shown in Figure 4.19.
• To check static routes type the following command: netstat -nrf inet. The result
is shown in Figure 4.20.
• To test if a particular network element is reachable (e.g office-host) type the following
command: ping 192.168.2.5. The result is shown in Figure 4.21. To stop transmit-
ting packets press Control-C keyboard button.
25
4.2. Configuration files management 4. Quick Intro
We will test delay on the link between office-switch and office-router, which is set to 30000
µs (30 ms), by using the traceroute tool:
• In the shell window on office-pc1 type the following command:
traceroute 192.168.1.1. The result is shown in Figure 4.22.
Terminating an experiment
To terminate an experiment and switch from the execute mode to the edit mode use the
Experiment → Execute option from the menubar. During the termination process, IMUNES
will terminate active services on each node and shut down all network elements (links and
nodes with both virtual and physical interfaces). The termination is finished when the mes-
sage about the successful cleanup shows up in the statusbar (Figure 4.24).
26
4.2. Configuration files management 4. Quick Intro
The structure of the configuration file is simple and suitable for changing with a text editor
(see Appendix C).
The other way to open an imn file is to start IMUNES with that file as an argument: imunes
simple-topology.imn
27
5 Advanced Usage
To add a new canvas use the Canvas → New option from the menubar or double click on
the empty space in the canvas tabs list at the bottom of the window.
You can rename the canvas with the Canvas → Rename option from the menubar or double
click on the canvas tab in the canvas tabs list. (Figure 5.2) Similarly the Canvas → Delete
option deletes the active canvas.
There is also the option Canvas → Resize that allows you to define a custom canvas size in
pixels. The default canvas size is 900*620 pixels. (Figure 5.3)
28
5.1. Extended Network Scenario 5. Advanced Usage
Canvas selection can be done with the options from the Canvas menu (Previous, Next, First,
Last) or simply by clicking the tab with the canvas name on it.
Rename the existing canvas Canvas0 into office-canvas. Add a new canvas, rename it into
roadwarrior-canvas and select it as the active canvas.
This canvas is empty so we will add a router by selecting the router tool and clicking on the
empty canvas. Rename this router into roadwarrior-router. Switch to the office-canvas. Now
we will connect the office-router and the roadwarrior-router. To do that, right click on the
office-router and select Create link to → roadwarrior-canvas → roadwarrior-router option
(Figure 5.4) from the popped up menu. This will create a link between roadwarrior-router
and office-router.
On the office-router set the eth2 interface IPv4 address to 192.168.3.1/24. On the
roadwarrior-router set the eth0 interface IPv4 address to 192.168.3.2/24. We will add an-
other PC to the roadwarrior-canvas, name it roadwarrior and connect it with the roadwarrior-
router. On the roadwarrior set the eth0 IPv4 address to 161.53.19.100/24. On the
roadwarrior-router set the eth1 IPv4 address to 161.53.19.1/24.
The roadwarrior-router uses the same dynamic routing model (quagga) as the office-router
and we do not need to configure anything else on the router. The roadwarrior uses static
routes and we will need to change the default route gateway in static routes field of the
roadwarrior configuration window to 0.0.0.0/0 161.53.19.1.
Finally, the configured network topology should look like the following (Figure 5.5 and Figure
5.6):
29
5.1. Extended Network Scenario 5. Advanced Usage
Both the roadwarrior and roadwarrior-router can be easily moved from roadwarrior-canvas
30
5.1. Extended Network Scenario 5. Advanced Usage
to office-canvas with the Move To → office-canvas from the node menu. The link between
roadwarrior-router and office-router, as well as any other link, can be deleted with the Delete
option from the Link menu. To open the link menu, use the right click on the link and choose
the Delete option.
When we are done with network configuration, we can start the experiment with Experi-
ment → Execute from the menubar. We can now check that the roadwarrior can ping both
networks (192.168.1.0/24, 192.168.2.0/24) and additionally, that the network 192.168.1.0/24
does not have an access to the roadwarrior, but it has access to the 192.168.2.0/24 network.
Check that roadwarrior-router has a properly configured IP address on the network interface
connected to the physical interface. Additionally, check that routes which route packets
between virtual network and the external network through the physical interface exist in both
the external network and in the virtual network (on roadwarrior-router ).
Save this configuration to a new file by selecting the Save as option from the File menu.
Name the file extended-topology.imn.
31
5.2. Additional Configuration 5. Advanced Usage
the IMUNES GUI. In the Experiment menu, select the option Attach to experiment. A dialog
similar to 5.9 is opened. Here you can select on which experiment you would like to attach.
You can attach to all experiments, those that were started using batch mode and those that
were executed from the GUI. The window shows the following experiment parameters:
• Experiment ID
• Filename of the topology
• Time when the experiment was started.
• Experiment screenshot (only if it was started through the GUI)
To attach to the you can double-click it’s entry or use the Resume selected experiment
button.
In a newly opened window, write a new configuration name and click Create. An empty
configuration file will be created. By clicking on Fill defaults, in case of a non-router network
layer node or a router node with the static routing model, the default configuration consists of
32
5.2. Additional Configuration 5. Advanced Usage
ifconfig and route commands with the /bin/sh shell. Figure 5.11 shows the created default
configuration.
It is possible to add custom commands that will be executed at the boot time. When finished,
click on the Apply or Apply and Close button to save the changes. When you have multiple
configurations, you can choose the default one in the Default configuration drop-down menu.
To delete a configuration, select its tab and click Delete config button.
NOTE: After starting the network simulation, the new/custom configuration will be consid-
ered only if Custom startup configuration is enabled. This is done by checking the Enabled
check box in the Custom startup config field in Figure 5.10.
33
5.2. Additional Configuration 5. Advanced Usage
Users can configure additional logical interfaces by clicking on the Logical Interfaces item in
the Interfaces list. The Logical Interfaces configuration window is show in Figure 5.13. At
the moment IMUNES supports two types of logical interfaces: lo and vlan.
Figure 5.14 shows an example for setting up a vlan logical interface vlan0 on a physical
interface eth0 with an arbitrary tag 10 and an IPv4 address 10.0.0.1/24.
34
5.3. Additional Tools 5. Advanced Usage
35
5.3. Additional Tools 5. Advanced Usage
Some examples can be seen in Figure 5.17, Figure 5.18 and Figure 5.19. In order to gener-
ate a topology first select the network layer nodes (router, host or PC) from the toolbox and
then the desired topology type e.g. bipartite graph K(2,3) (see Figure 5.18).
36
5.3. Additional Tools 5. Advanced Usage
37
5.3. Additional Tools 5. Advanced Usage
the nodes it is also necessary to specify the number of links. The nodes in the random
topology will be randomly connected with the number of links specified before. An example
of generating a random topology:
1. Select the router tool from the toolbox.
2. Choose the random topology: TopoGen → Random
3. Choose the desired number of nodes and links e.g. n = 6; m = 5, where n is the number
of nodes and m the number of links in the generated network topology (Random →
R(6,m) → R(6,5)).
The result is shown in Figure 5.20.
Using the TopoGen tool you can generate topologies containing one type of node (router,
host or PC). In that case, new nodes of the same type are created and placed on the canvas.
Another option is to add new nodes to canvas and then connect them using the topology
generator:
1. Add nodes to the canvas (don’t have to be same type).
2. Select nodes that should be included in the new topology
3. Right click on one of the selected nodes and choose the option Create Link to from the
menu. Choose the option Selected and select one of the offered topologies (Chain,
Star, Cycle, Clique or Random). An example is shown in Figure 5.21.
In addition to that, it is also possible to transform existing nodes:
1. Select nodes that should be transformed
2. Right click on one of the selected nodes and choose the option Transform to from the
menu. Select one of the offered options (Router, PC or Host). An example is shown
in Figure 5.22.
38
5.3. Additional Tools 5. Advanced Usage
39
5.3. Additional Tools 5. Advanced Usage
40
5.3. Additional Tools 5. Advanced Usage
In order to replace default 10.0.0.0/24 address pool, set variable-mask IPv4 address pool
through the invoked dialog. CIDR notation is required, so the IPv4 address needs to be
followed by a slash and a network length. To apply changes click on the Apply button. The
given address pool will be applied to all the subsequentially created network layer elements
(Figure 5.24).
In order to apply the given address pool to selected elements, right click on the network layer
element and choose the option IPv4 autorenumber from the popped up menu. In example
shown in Figure 5.25 we have set IPv4 address pool to 160.153.1.1/24, selected all network
elements and selected the option IPv4 autorenumber from the node menu to apply the given
address pool to selected elements.
41
5.3. Additional Tools 5. Advanced Usage
42
5.4. Customizing Look 5. Advanced Usage
43
5.4. Customizing Look 5. Advanced Usage
To add an annotation to the canvas, select the appropriate tool and click (and drag) where
you want to add the annotation. A popup window will be shown. There you can define how
will the annotation look.
When created, annotations can be moved around on the canvas. This is done by using the
select tool. Click on the annotation and then drag it to its destination.
Text
The text annotation lets you define the following options(Figure 5.31):
• Text color - color of the text in RGB values
• Font - which system font, size and style you want to use
Freeform
The freeform configuration window includes:
• Line color - which line color to use
• Width - line width to use
44
5.4. Customizing Look 5. Advanced Usage
Oval
The size of the oval annotation is defined by dragging the cursor on the canvas while keeping
the left mouse button pressed. When the annotation size seems to be fine, release the
mouse button. The oval configuration window will popup (Figure 5.33).
The oval annotation lets you define the following additional options (Figure 5.33):
• Fill color - color of the annotation fill in RGB values.
• Border color - color of the annotation border in RGB values.
• Border width - width of the annotation border.
Rectangle
The rectangle configuration window has the same options as the oval configuration window.
The rectangle size is defined the same way as the size of the oval.
The rectangle annotation lets you define the following additional options (Figure 5.34):
• Radius of the bend at the corners - defines roundness of the rectangle edges.
45
5.4. Customizing Look 5. Advanced Usage
All options related to the canvas background are accessible in the Background image menu
(Figure 5.36):
• Show background - Show or hide the canvas background.
• Change background - Opens the Change canvas background window (Figure 5.37).
• Remove background - Removes the background from the current canvas.
• Set background from - Sets the background from an another canvas.
To set a canvas background you need to open the Change canvas background window
(Figure 5.37).
46
5.4. Customizing Look 5. Advanced Usage
When the image is selected there are four image setting modes that can be chosen:
• Use original/cropped image - If the image is smaller it will be placed in the position
defined by the image alignment. If the image is larger it will be cropped. The image
alignment will define which part of the image will be taken as the background.
• Stretch/shrink image - If the image is smaller it will be stretched without changing
the proportions. If the image is larger it will be shrunk without changing the propor-
tions. The image alignment will define which part of the image will be taken as the
background.
• Adjust canvas to image - The canvas will be resized to the image size and then the
background image will be set.
47
5.4. Customizing Look 5. Advanced Usage
• Adjust image to canvas - The image will be forcibly resized to the canvas size with
changed proportions if needed.
48
5.4. Customizing Look 5. Advanced Usage
5.4.3 Icons
IMUNES lets you choose custom node icons. First, select the nodes whose icons you want
to change. Then right click on the selection and then go to the Node icon → Change node
icons option (Figure 5.42). This menu has also the Set default icons option that sets the
default node icon for the selected icons.
The Change node icons option opens the Set custom icon window (Figure 5.43).
49
5.4. Customizing Look 5. Advanced Usage
50
5.5. User-configurable Event Scheduling 5. Advanced Usage
Icon size
If you want to emphasize the information about nodes, interfaces and links instead of node
icons you can change the icon size through the View → Icon size option (Figure 5.45).
Let’s take the simple-topology.imn example and set the icon size to small. (Figure 5.46)
Currently, only two sizes are available, normal and small. Otherwise, custom icons can be
used.
51
5.5. User-configurable Event Scheduling 5. Advanced Usage
• bandwidth
• delay
• bit error rate
• packet duplication
• visual attributes
– line width
– line color
The event scheduler supports two general classes of schedulable events: one-time changes
and periodic functions.
One-time events update the selected parameter at requested point in time, leaving that pa-
rameter constant throughout rest of the experiment execution, or until another event updates
it to a new value at some later point in time.
Periodic functions allow for time-variant functions to be applied to selected parameters by
specifying those functions as single events. Subsequently scheduled events acting upon the
same parameter will cancel the current periodic function and replace it with either a constant
value or another periodic function.
Each event entry occupies a single line of text, consisting of four fields: deadline, target pa-
rameter, function and function parameters. The first field, deadline, is specified as an integer
number of seconds since experiment instantiation. The second field, target parameter, may
be one of the following: bandwidth, delay, ber, duplicate, width or color. The remainder of
the line is further parsed as a function. The type of the function is determined by the leading
keyword, which may be either const, ramp, rand or square. When saving the configura-
tion through the events editor a syntax check will be performed. If the syntax is wrong the
configuration will not be saved and a popup dialog will show the first line that has a syntax
error.
52
5.5. User-configurable Event Scheduling 5. Advanced Usage
Const
The const function accepts one parameter, the target value. After the deadline time the
parameter will constantly be equal to the target value.
Ramp
Behavior of the ramp function is determined by three arguments: initial value, delta, and
period, which are all integers. The first argument represents the initial function value. The
second is the delta value, which may be both positive or negative, which is added to the
previous value of the function at each period. The third argument is the period, determining
how often will the delta value be added to the current function value.
Rand
The rand function is determined by three arguments: lower bound, upper bound, and period;
all of which are integers. The function will assume a random value between lower and upper
bound after each period (in seconds) expires.
Square
Finally, the square function has three arguments as well: low value, high value, and period;
all integer numbers. The resulting function will flip from low value to high and vice versa
after each period (in second) expires.
Example
The following example illustrates a possible event scheduling scenario that can be entered
in the Event editor window (Figure 5.47):
30 bandwidth ramp 128000 8000 2
30 delay rand 80000 120000 8
60 delay square 100000 200000 10
60 ber const 1
90 ber const 0
120 delay const 0
At t = 30 s, bandwidth of the selected link will be set to 128 Kbps, and will continue to grow
at a rate of 8 Kbps each 2 s.
Also at t = 30 s, the delay will begin assuming a random value between 80 ms and 120 ms,
and will continue to change the setting to new random values in the same range each 8 s.
At t = 60 s, the delay will cease to assume random values, and instead it will begin to oscillate
between two discrete values, 100 ms and 200ms, each 10 s.
Also at t = 60 s, the bit error rate (BER) will be set to 1, resulting in all frames traversing the
link to be silently dropped.
At t = 90 s, the BER is reset back to 0, allowing for all frames to traverse the link without
artificial losses.
At t = 120 s, the oscillation of the delay parameter will stop, and delay will be reset to 0 ms
for the rest of the experiment execution time.
The current time is shown on the status bar after the zoom value. (Figure 4.17)
53
5.6. Starting and terminating a simulation through CLI 5. Advanced Usage
IMUNES experiments are defined via plain-text configuration files, which currently describe
virtual nodes and links, as well as additional objects related only to GUI visual properties and
annotations. The other way to configure events is manual editing of an existing configuration
file.
The example bellow shows a configuration section describing a virtual link in an IMUNES
experiment. The link l0 connects virtual nodes n0 and n1, has the bandwidth constraint
set to 128 Kbps, and has the thickness of the line representing the link in the GUI set to 6
pixels. All of the mentioned properties are directly controllable via the IMUNES GUI. The
configuration for link l0 also includes an empty placeholder for schedulable events, meaning
that no events have been programmed for this link.
link l0 {
width 6
nodes {n0 n1}
bandwidth 128000
events {
}
}
The events section in the configuration file accepts the same commands as does the Events
editor in the GUI.
54
5.8. Himage tool 5. Advanced Usage
5.7.1 Examples
Execute the ifconfig command in the jail with the jail name n1:
# jexec n1 ifconfig
Execute the csh command in the IMUNES virtual node named host1:
First we need to find out the jail ID or jail name to execute the wanted command:
# jls -h jid name host.hostname | grep host1
The first parameter output is the jail ID, the second is the jail name and the last is the
hostname. To execute the command you need the jail ID or jail name:
# jexec jid csh
# jexec jname csh
55
5.9. Hcp tool 5. Advanced Usage
5.8.1 Examples
Example of usage of the command himage on a node with the hostname "pc" to get a list of
running processes:
# himage pc ps ax
If there are multiple experiments running and there are nodes with the same hostnames
in these experiments the himage command accepts the following node specification where
vi_hostname is specified as hostname@eid, where eid is the experiments’ ID.
# himage hostname@eid command ...
i.e:
# himage pc@i3d05a ps ax
where i3d05a is the experiment ID of the running experiments. To find out which exper-
iments are running the himage -l command can be used as well as jls -h jid name
host.hostname.
Execute the ifconfig command the IMUNES node named server:
# himage server ifconfig
5.9.1 Examples
Copy file dhcpd.conf from a local folder to the virtual node DHCP:
# hcp dhcpd.conf DHCP:/usr/local/etc/
Copy file message.txt from the virtual node PC to a local folder:
# hcp PC:/root/message.txt .
Copy file index.html from the virtual node HOST to the virtual node HTTP:
# hcp HOST:/usr/local/www/data/index.html HTTP:/usr/local/www/data/
56
5.11. Vlink tool 5. Advanced Usage
5.11.1 Examples
Setting the bandwidth to 10 Mb/s with a delay of 30 ms to the link connecting router1 and
pc1:
# vlink -bw 10000000 -dly 30000 router1-pc1
Generate an error on one bit in a million:
# vlink -BER 1000000 router1-pc1
Set packet duplication to 20
# vlink -dup 20 router1-pc1
Modifying a link in a specific experiment (i.e. Experiment ID = i56ad1):
# vlink -dup 20 router1-pc1@i56ad1
To reset the link settings to the default values the -r flag is used:
# vlink -r router1-pc1@i56ad1
57
Appendix A Installation
58
A.1. Installation of IMUNES on FreeBSD 8 Appendix A. Installation
ad0s1a / 1024MB
ad0s1b swap 2006MB
ad0s1d /var 5099MB
ad0s1e /tmp 1024MB
ad0s1f /usr 11326MB
59
A.1. Installation of IMUNES on FreeBSD 8 Appendix A. Installation
zfs_enable="YES"
Save changes and exit.
# pkg_add -r xorg bash xpdf vim geany zip unzip xterm firefox
You can choose between multiple desktop environments:
• Gnome2-lite - complete, user-friendly desktop
# pkg_add -r gnome2-lite
• XFCE 4 - lightweight desktop environment
# pkg_add -r xfce4
• IceWM - extremely lightweight window manager, low resource usage
# pkg_add -r icewm
After the installation of one or multiple window manager we need to configure which will be
used. Edit the file .xinitrc in the user folder and add a line depending on which window
manager you want to use:
• Gnome2-lite
exec gnome-session
• XFCE 4
exec startxfce4
• IceWM
exec icewm-session
Reboot the machine by issuing the reboot command:
# reboot
After the machine has rebooted, log in and issue the startx command to start the chosen
window manager:
# startx
60
A.1. Installation of IMUNES on FreeBSD 8 Appendix A. Installation
options DDB
options KDB
61
A.2. Installation of IMUNES on FreeBSD 9 Appendix A. Installation
# config VIMAGE
# cd ../compile/VIMAGE
# make cleandepend && make depend
# make
# make install
When the last command ends use the reboot command to restart the computer:
# reboot
62
A.2. Installation of IMUNES on FreeBSD 9 Appendix A. Installation
After finishing partitioning, choose "Finish" and then "Commit". NOTE: freebsd-boot
boot partition will be created upon creation of the first freebsd-ufs partition.
7. Archive extraction - Wait for the installation to complete.
8. FreeBSD Installer - Enter your system administrator (root) password. Repeat the pass-
word.
9. Network Configuration - Choose a network interface to configure (if any available).
(a) Select "Yes" to configure IPv4 network if you use it. Then select "Yes" to configure
DHCP if you use it.
(b) Select "Yes" to configure IPv6 network if you use it. Then select "Yes" to configure
SLAAC if you use it.
(c) Resolver Configuration - If DHCP/SLAAC is used to configure the interface, some
values may already be present. Otherwise, enter them yourself.
10. Timezones - If your timezone is not UTC, select "No" and choose your region and
country (e.g. Europe->Croatia) and select "Yes" if asked for confirmation.
11. System Configuration
(a) FreeBSD 9.3 - Choose the "sshd" service to be started at boot and select
"dumpdev" to enable crash dumps in /var.
(b) FreeBSD 9.2 - Choose the "sshd" service to be started at boot.
12. (FreeBSD 9.2 only) Dumpdev Configuration - Select "Yes" for enabling crash dumps
in /var folder.
13. Add User Accounts - If necessary, add additional users now.
14. Final Configuration - Choose "Exit".
15. Manual Configuration - Nothing else is needed, so choose "No" to skip manual confi-
guration.
16. Complete - Reboot. (Don’t forget to remove your FreeBSD boot media.)
63
A.2. Installation of IMUNES on FreeBSD 9 Appendix A. Installation
64
A.2. Installation of IMUNES on FreeBSD 9 Appendix A. Installation
options IPSEC
device crypto
options IPSEC_DEBUG
options DDB
options KDB
65
A.3. Installation of IMUNES on FreeBSD 10 Appendix A. Installation
Now you can create an arbitrary network topology or something like shown in Figure 4.1 and
execute the experiment.
After finishing partitioning, choose "Finish" and then "Commit". NOTE: freebsd-boot
boot partition will be created upon creation of the first freebsd-ufs partition.
7. Archive extraction - Wait for the installation to complete.
8. FreeBSD Installer - Enter your system administrator (root) password. Repeat the pass-
word.
9. Network Configuration - Choose a network interface to configure (if any available).
(a) Select "Yes" to configure IPv4 network if you use it. Then select "Yes" to configure
DHCP if you use it.
(b) Select "Yes" to configure IPv6 network if you use it. Then select "Yes" to configure
SLAAC if you use it.
66
A.3. Installation of IMUNES on FreeBSD 10 Appendix A. Installation
67
A.3. Installation of IMUNES on FreeBSD 10 Appendix A. Installation
options IPSEC
device crypto
options IPSEC_DEBUG
options IPSEC_NAT_T
68
A.4. Running IMUNES with VMware Player Appendix A. Installation
69
A.5. Installation of the IMUNES GUI on Linux Appendix A. Installation
pop-up asking you wheter you moved or copied the image. Select the option "I copied it"
and click on the "OK" button.
After a few minutes FreeBSD with the graphical interface will start. On the desktop there is
an IMUNES icon to start IMUNES.
70
A.6. Installation of the IMUNES GUI on Windows Appendix A. Installation
71
Appendix B Troubleshooting
72
B.3. Obtaining kernel panic traces Appendix B. Troubleshooting
# REQUIRE: LOGIN
#
73
Appendix C IMUNES network configuration file
Here is the example of IMUNES network configuration file for the network topology shown
in Figure C.1
node n0 {
type router
model quagga
network-config {
hostname office-router
!
interface eth0
mac address 42:00:aa:00:00:02
ip address 192.168.1.1/24
!
interface eth1
ipv6 address fc00:1::1/64
mac address 42:00:aa:00:00:03
ip address 192.168.2.1/24
!
interface lo0
type lo
ip address 127.0.0.1/8
74
Appendix C. IMUNES network configuration file
node n1 {
type host
network-config {
hostname office-host
!
interface eth0
mac address 42:00:aa:00:00:04
ip address 192.168.2.5/24
!
interface lo0
type lo
ip address 127.0.0.1/8
ipv6 address ::1/128
!
ip route 0.0.0.0/0 192.168.2.1
!
!
}
canvas c0
iconcoords {408 528}
labelcoords {408 564}
interface-peer {eth0 n0}
}
node n2 {
type lanswitch
network-config {
hostname office-switch
!
interface e2
fair-queue
!
interface e1
fair-queue
75
Appendix C. IMUNES network configuration file
!
interface e0
fair-queue
!
}
canvas c0
iconcoords {408 192}
labelcoords {408 215}
interface-peer {e0 n3}
interface-peer {e1 n4}
interface-peer {e2 n0}
}
node n3 {
type pc
network-config {
hostname office-pc1
!
interface lo0
type lo
ip address 127.0.0.1/8
ipv6 address ::1/128
!
interface eth0
mtu 1500
mac address 42:00:aa:00:00:00
ip address 192.168.1.5/24
!
!
ip route 192.168.2.0/24 192.168.1.1
!
}
canvas c0
iconcoords {192 48}
labelcoords {192 79}
interface-peer {eth0 n2}
custom-configs {
custom-config-id newconf {
custom-command /bin/sh
config {
ifconfig lo0 inet 127.0.0.1/8
ifconfig eth0 inet 192.168.1.5/24
ifconfig lo0 inet6 ::1
node n4 {
76
Appendix C. IMUNES network configuration file
type pc
network-config {
hostname office-pc2
!
interface eth0
mac address 42:00:aa:00:00:01
ip address 192.168.1.7/24
!
interface lo0
type lo
ip address 127.0.0.1/8
ipv6 address ::1/128
!
ip route 192.168.2.0/24 192.168.1.1
!
!
}
canvas c0
iconcoords {192 360}
labelcoords {192 391}
interface-peer {eth0 n2}
}
link l0 {
nodes {n3 n2}
}
link l1 {
nodes {n4 n2}
}
link l2 {
delay 30000
nodes {n2 n0}
bandwidth 0
}
link l3 {
nodes {n0 n1}
bandwidth 0
}
annotation a0 {
type rectangle
iconcoords {53 16 517 409}
color #ffffff
bordercolor black
width 3
rad 53.6
canvas c0
}
annotation a1 {
type text
iconcoords {281 40}
label {Office}
77
Appendix C. IMUNES network configuration file
labelcolor #000000
font {-family {DejaVu Sans} -size 10 -weight bold -slant roman -underline 0 -overs
canvas c0
}
annotation a2 {
type rectangle
iconcoords {338 254 716 584}
color #b8d4e6
bordercolor #000000
width 3
rad 30.78918918918919
canvas c0
}
annotation a3 {
type text
iconcoords {559 552}
label {Server room}
labelcolor black
font {-family {DejaVu Sans} -size 10 -weight bold -slant roman -underline 0 -overs
canvas c0
}
annotation a4 {
type text
iconcoords {560 201}
label {Simple network topology}
labelcolor black
font {-family {DejaVu Sans} -size 14 -weight normal -slant italic -underline 0 -ov
canvas c0
}
canvas c0 {
name {office-canvas}
}
option show {
interface_names yes
ip_addresses no
ipv6_addresses no
node_labels yes
link_labels no
background_images no
annotations yes
hostsAutoAssign no
grid no
iconSize normal
zoom 1.0
}
78