Lab 1 - MLN Introduction
From SOFTICE
|
Pedagogical Objectives
- Build an MLN network
- Connect to an MLN network
- Test connectivity between MLN hosts
Developed by:
Synopsis
This lab's objectives are to introduce you to MLN. We introduce MLN, then build and start up a virtual MLN network. We will conclude by testing connectivity between our newly created network's hosts. During this process you will be introduced to some Linux fundamentals.
[Briefing] MLN and screen
In Lab 0, we discussed SOFTICE's five core components. We will be using two additional components in the networking labs:
- Manage Large Networks (MLN) - setting up virtual networks using UML commands can be tedious, time-consuming, and error-prone. MLN is a software package you will use that will automate, to a great extent, creating, starting and stopping virtual networks.
- console - an (often text-based) input and output interface that is used to control a computing system. An example is using a keyboard (input) and monitor (output) to control a PC. In Linux, it is possible to access a console both locally, with a keyboard and mouse, and remotely, by using SSH.
- screen - this utility is a window manager that is used in conjunction with UML to provide consoles for your virtual UML-based Linux hosts (machines).
- host - an addressable device on a network. Examples include servers, workstations and routers. Hubs and switches are typically not referred to as hosts.
[Solved]
Complete the following solved exercises, recording your findings, and the procedures used to obtain them in your log. By doing this, you may be able to obtain partial credit if you are unable to complete any of the exercises.
Solved 1-1: The mln Directory
You should now have an mln directory located within your home directory. Let's take a look at its structure.
1. Change your current working directory to your mln directory.
cd ~/mln
2. View the mln directory's contents.
ls -l
- The above command should produce output similar to the following:
drwxr-xr-x 3 mrideout students 4096 2006-11-13 21:45 files lrwxrwxrwx 1 mrideout students 27 2006-11-13 21:45 mln_files -> /home/sys/net/mln/mln_files drwxr-xr-x 2 mrideout students 4096 2006-11-13 21:45 projects drwxr-xr-x 2 mrideout students 4096 2006-11-13 21:45 uml
4. For now, we only need to concern ourselves with the contents of the mln_files directory. This directory is actually a symbolic link (Linux's version of a Windows shortcut) to a public directory containing pre-written MLN configuration files. Let's change to the mln_files directory and take a look at the available configuration files.
cd mln_files ls -l
- This directory's contents should appear similar to the following. Notice the tcpdump.mln file. We will use this configuration file in this lab's next two sections.
total 16 -rw-r--r-- 1 root root 1185 2007-01-23 15:12 ring.mln -rw-r--r-- 1 armitage softice 916 2006-11-13 13:17 tcpdump.mln -rw-r--r-- 1 root root 1796 2007-01-23 15:12 threeLocations.mln -rw-r--r-- 1 root root 1229 2007-01-23 15:12 twoLocations.mln
Solved 1-2: Examine an MLN Configuration File
1. View the tcpdump.mln file using that cat command:
cat tcpdump.mln
2. This file breaks configuration information down into a hierarchy of blocks - similarly to how many programming languages use functions.
global {
project tcpdump # project name
$console = screen
}
switch lan {
hub
}
superclass hosts {
term $console
kernel = /home/sys/net/bin/linux-2.6.18.1/linux
template = DebianNet-3.1-v1.ext2
size 300M
network eth0 {
switch lan
netmask 255.255.255.0
broadcast 10.0.0.255
}
}
host server {
superclass hosts
cow_filesystem server.cow
network eth0 {
address 10.0.0.1
}
}
host client {
superclass hosts
cow_filesystem client.cow
network eth0 {
address 10.0.0.2
}
}
host observer {
superclass hosts
cow_filesystem observer.cow
network eth0 {
address 10.0.0.3
}
}
3. Let's start with the server{} block and work our way out to determine the server host's network configuration. The first information that we should spot is that server's eth0 network interface has an IP address of 10.0.0.1. In Linux, eth0 is the name assigned to a host's first Ethernet-based interface. If there is a second Ethernet-based interface, it is named eth1, and so on.
host server {
superclass hosts
cow_filesystem server.cow
network eth0 {
address 10.0.0.1
}
}
4. The host server belongs to the hosts superclass. This means that we should examine the hosts{} configuration block for further configuration information.
host server {
superclass hosts
cow_filesystem server.cow
network eth0 {
address 10.0.0.1
}
}
5. The hosts{} block tells us that the server host's eth0 network interface is connected to the lan networking device, and has a subnet mask of 255.255.255.0.
superclass hosts {
term $console
kernel = /home/sys/net/bin/linux-2.6.18.1/linux
template = DebianNet-3.1-v1.ext2
size 300M
network eth0 {
switch lan
netmask 255.255.255.0
broadcast 10.0.0.255
}
}
6. Let's take a look at the lan{} block to determine what kind of device it is.
switch lan {
hub
}
7. The lan device is a hub. Hubs are simple repeaters that hosts attach to in order to communicate. When a host sends a signal, the hub receives it, and forwards it out through all of its remaining ports.
8. In summary, we were able learn from the tcpdump.mln file that the server host has an IP address of 10.0.0.1, a subnet mask of 255.255.255.0, and is connected to a hub. This is all that you'll need to know about the syntax of .mln configuration files for now, but you can learn more by reading the MLN Syntax section of the MLN Manual.
Solved 1-3: Build an MLN Network
1. It's now time to build the tcpdump network, including its 3 hosts. The tcpdump network is illustrated below:
We will build this network by using the mln program's build argument.
mln build -f tcpdump.mln
Solved 1-4: Startup the Network
1. Startup the tcpdump network using the mln program's start argument.
mln start -p tcpdump
Solved 1-5: Check Network Status
1. Check what MLN hosts and devices are currently running with the mln utility's status argument.
mln status
2. This should produce the following output:
tcpdump host client up tcpdump host server up tcpdump host observer up tcpdump switch lan up
Solved 1-6: Console In
We will use the screen utility to access a console on each host on the MLN network. A list of hosts currently available to console into can be generated by executing the following command:
screen -list
This should generate output similar to the following:
There are screens on:
26879.client.tcpdump (Detached)
26892.observer.tcpdump (Detached)
26904.server.tcpdump (Detached)
3 Sockets in /var/run/screen/S-mrideout.
As you can see above, the three hosts in the MLN network are client, observer and server. You can console into any of these hosts with the screen -r hostname command. Let's console into the client host:
screen -r client
When prompted to login, enter root as your user name. The password is blank.
You can disconnect from client at any time by pressing:
Ctrl-a-d
This key combination will only disconnect you. client will continue to run in the background, and can be reconnected to by executing screen -r client again.
[Exercises]
Complete the following exercises, recording your findings, and the procedures used to obtain them in your log.
Note: If you need to disconnect from SOFTICE before completing these exercises, skip ahead to Exercise 1-3: Shutdown the Network, to shut your virtual hosts down before disconnecting. This is an important step which must be done in order to conserve system resources on the SOFTICE cluster.
Exercise 1-1: Verify Connectivity
1. Use the ifconfig command to determine IP address of each host's eth0 interface. This will be listed in ifconfig's output as inet addr.
ifconfig
2. Verify connectivity between all hosts by using the ping command. Be sure to record ping times.
ping -c 5 <remote IP address>
Exercise 1-2: Learning More About the Network
1. Determine the subnet mask of each host's eth0 interface.
2. Determine what kind of network device each host's eth0 interface is plugged into.
Exercise 1-3: Shutdown the Network
1. When you are finished working with each host, issuing the halt command will shut it down. It will take a moment for each host to shutdown.
halt
2. Execute screen -list, and record its output your log. Are any hosts still running?
screen -list
3. After all hosts are shutdown, shut down the networking device you identified in Exercise 1.2 by using the mln program's stop argument.
mln stop -p tcpdump
References
- [1] The MLN Manual


