0% found this document useful (0 votes)
506 views

Click Tutorial

This document provides an introduction to the Click modular software router and describes how to download, build, and run Click on a Linux machine or in the NS-3 network simulator. It also provides details on how to generate configuration files to run the Roofnet wireless routing protocol using Click either on Linux or in NS-3. Key elements, their inputs/outputs, and how they are connected to implement the Roofnet configuration are shown.

Uploaded by

gon1332
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
506 views

Click Tutorial

This document provides an introduction to the Click modular software router and describes how to download, build, and run Click on a Linux machine or in the NS-3 network simulator. It also provides details on how to generate configuration files to run the Roofnet wireless routing protocol using Click either on Linux or in NS-3. Key elements, their inputs/outputs, and how they are connected to implement the Roofnet configuration are shown.

Uploaded by

gon1332
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Click tutorial

NITLab
June 22, 2013
Introduction to Click Router
Click [1] is exible modular software architecture for creating routers. Click routers are built from ne-grained
components, named elements, which support and extend the basic functions of the packet forwarding path.
Each element represents a conceptually simple computation or packet processing, like header encapsula-
tion/decapsulation, packet duplication or rejection, etc. To build a router conguration, the user chooses a
collection of elements and connects them into a directed graph. The graphs edges, which are called connec-
tions, represent possible paths for packet hando. The simplest router conguration includes three elements,
named FromDevice, Queue and ToDevice, which are sequentially connected, as it is depicted in the Figure
1, and implements a router that retransmits all received packets. The boxes represent the elements and
the arrows the connections. FromDevice and ToDevice are specic elements that get connected with a net-
Figure 1: Simplest conguration
work interface and handle (with use of libpcap [2] library) all packets received or have to be sent through
this interface. Through these elements, Click intercepts to the usual kernel packet forwarding process and
implements easily and clearly a new one. More specically, in the previous example, FromDevice receives
packets from the interface and forwards them to Queue for storage, while ToDevice retrieves these packets
from Queue for retransmission.
Download and build Click software
Click framework is provided through a git-repository and can be downloaded using the following command:
git clone git:// github.com/kohoumas/click.git
This command downloads the click folder in your working directory. This folder contains a variety of
subfolders, including the click/conf, click/elements and click/userlevel folders.
click/userlevel includes the executable le, named click, which is produced after a successful compile
click/conf includes perl (and python) les that create congurations of routers (setups of elements
with appropriate connections)
click/elements includes c++ les that describe the elements behavior
(Also, folders click/conf and click/elements, include a subfolder named wi that contains the les
related to WiFi.)
For utilization of extra elements, like these of the Roofnet project [3] (that is a famous wireless routing
protocol implemented in Click), the click-packages git-repository should be also downloaded to the same
working directory with click folder, typing:
git clone git :// github.com/kohoumas/click -packages.git
The subfolder click/elements/wi includes some links to the subfolders click-packages/sr and click-packages/bp.
If sb doesnt want to use the elements of these subfolders, then he should delete these links.
After downloading the two repositories, the next step is the conguration and compilation of the click
software. Click uses also the OML [4] framework for measurement collection, that requires the liboml2-dev
library. In order for sb to compile click, he/she should add deb http://pkg.mytestbed.net/ubuntu precise/
to the /etc/apt/sources.list le, and run:
sudo apt -get update
sudo apt -get install liboml2 -dev
1
After this step, he/she is ready to congure and compile click, by running the following commands:
cd click
./ configure --enable -userlevel --disable -linuxmodule
--enable -wifi LIBS=-loml2
make
Download and build Click software for NS-3
Click framework for NS-3 is provided as git-repositories and can be downloaded using the following com-
mands:
git clone git:// github.com/kohoumas/click -ns3.git
git clone git:// github.com/kohoumas/click -packages.git
The next step after downloading the two repositories is the conguration and compilation of the click software:
cd click -ns3
./ configure --enable -nsclick --enable -wifi
make
The NS-3 software should be downloaded by typing:
cd /usr/local/src
git clone git:// github.com/kohoumas/ns -3-click -mac -dev.git
If it is the rst time that the NS-3 project is built in this system, download and install the ns-3-allinone
repository in the same directory typing (in other case ignore the following commands):
hg clone http :// code.nsnam.org/ns -3-allinone
cd ns -3-allinone
./ build.py --enable -examples --enable -tests
cd ..
Then change to the ns-3-click-mac-dev repository, congure and compile it by typing:
cd ns -3-click -mac -dev
CXXFLAGS="-Wall" ./waf configure -d debug
--enable -sudo --enable -examples --enable -tests
--with -nsclick =/ full_path_to_click/click -ns3/
./waf
If sb wants to create a new network simulation, he adds the appropriate .cc le in the subfolder ns-3-
click-mac-dev/scratch and then runs this simulation, typing:
./waf --run scratch/file_name
(The le name should be without the .cc prex.)
Create Click conguration les and run Click router in Linux ma-
chine or NS-3 environment
For running either Roofnet or Enhanced-Backpressure in a Linux machine using e.g. the
802.11a channel 36,
use the following commands for Roofnet (SRCR):
cd click
sudo perl ./conf/wifi/bp/gen_config_roofnet_bp.pl
--channel =36 > /tmp/tmp.click
sudo userlevel/click /tmp/tmp.click
2
or these commands for Enhanced-Backpressure (EBoW):
cd click
sudo perl ./conf/wifi/bp/gen_config_roofnet_bp.pl
--bp --channel =36 > /tmp/tmp.click
sudo userlevel/click /tmp/tmp.click
For running NS-3 simulations with e.g. 12 nodes,
run the following commands for Roofnet (SRCR):
cd click -ns3
perl ./conf/wifi/bp/roofnet_bp.py --ns --channel =36 12
cd ../ns -3-click -mac -dev
./waf --run scratch/roofnet -bp -click -simulator
or these commands for Enhanced-Backpressure (EBoW):
cd click -ns3
perl ./conf/wifi/bp/roofnet_bp.py --ns --bp --channel =36 12
cd ../ns -3-click -mac -dev
./waf --run scratch/roofnet -bp -click -simulator
(NOTE: click-ns3/conf/wi/bp is a link to the corresponding subfolder click/conf/wi/bp, so download of
click repository is also necessary in this case.)
Description of Roofnet conguration le
Figure 2: Roofnet conguration
Figure 2 describes the Roofnet-SRCR conguration, using the same notation as Kohler used in his thesis
(The Click Modular Router, MIT, Feb 2001), describing the Click architecture. Keep in mind that:
Every box is a module-element.
srcr, srcr host and sni dev are compound elements.
Each box has at least one triangle and one square. Each triangle is an input port and each square is
an output port.
Full-lled triangles or squares mean that they are push ports.
Empty triangles or squares are pull ports.
srcr host is the interface between the router and the user-level applications, while sni dev is the
interface between the router and the wireless monitor.
3
Figure 3: srcr compound element
Figure 3 provides a more analytical view of the compound element of srcr ett.
4
Bibliography
[1] Click Modular Router, www.read.cs.ucla.edu/click/click.
[2] Library for Network Trac Capture, www.tcpdump.org.
[3] Roofnet project, pdos.csail.mit.edu/roofnet/doku.php.
[4] OML project, mytestbed.net/projects/oml/wiki/OML_Overview.
5

You might also like