You are on page 1of 28

Manual For Network

Setup and DiffServ


Configuration in
Network Research Lab
Contents

1. Acknowledgement 2

2. Introduction 3

3. System Configuration 6

4. NIC Installation 7

5. Cabling 9

6. Network Configuration 13

7. Linux Kernel Recompilation 14

8. DiffServ Configuration 18

9. VLC Client 25

10. HTTP Server 25

11. Traffic Generator 25

12. Testing Tools 27

1
Acknowledgement

This project work entitled “Performance analysis of DiffServ in Linux


Network” has been done by us under the guidance of Prof Anirudha Sahoo at
Networks Research Lab, KReSIT, IIT Bombay. As a part of this project, we have
generated a private network consisting of around 12 machines, loaded with Linux. These
machines are then configured into routers and users as per the topology. They are
interconnected to form a network and we have configured DiffServ on the core machines
and edge machines as well. Thereafter we use a video streaming application to stream a
video file from a user across the domain to another user at the other end. And we analyze
the performance when the DiffServ is active and when it is not.

We are thankful to Prof Anirudha Sahoo for the valuable guidance he has given us and
for all the support that he has provided without which this work would not have been
possible. We thank him for his patience at all the times when we had some problems and
were not able to generate an output. And we are always thankful to him for the resources
that was allocated to us for this project without which such a good simulation of the
project would have been nearly impossible.

Also we are thankful to Mrs. VijayaLakshmi (Systems Manager) and Prof. Krishna
Paul who have also rendered support for this project completion. Again we would like to
thank all those people who have some or the other way helped us in this project.

Regards,

Avinash K.
Avinash P.V.

2
INTRODUCTION

About the Experiment:


The experiment goes like this; connect the systems as per the given topology, thus
develop a full network. Enable the QoS modules in the kernel and configure the edge and
core routers. A video file resides in a user machine, acting as an HTTP Server, on one
end of the domain, This file is being played in another machine, which is on the other
side of the network, using a video streaming tool like VLC. Congest the network with
some packet generating programs, and analyze the video in both DiffServ enabled and
disabled states of the network. More precise packet level analysis can be performed with
the built in tool, ethereal that is shipped in along with Linux.

Experiment procedure:

The experiment title is performance analysis of DiffServ in Linux. It includes both


implementation of the DiffServ and observation of its performance. The steps for the
procedure are stated below.

Here we observe how DiffServ support the real time flow of a video stream through a
congested network and compare its performance with normal Best Effort (BE) traffic.

The steps for the experiment are

step 1.
Configure the systems as per the given specification.

step 2.
Enable the QoS in the kernel by adding the required modules and recompile the kernel.

step 3.
Prepare the cables and configure the network cards properly.

step 4.
Establish the network with given topology.

step 5.
Configure and start the service ospf on all the routers.

step 6.
Figure out two user machines as source and destination, which come at both sides of the
DiffServ domain.

3
step 7.
Figure out the path from source to destination and mark the routers, which come in the
path.

step 8.
Turn up the Apache server and store video file in a server directory in the source user
machine.

step 9.
Install VLC client on the other user machine.

step 10.
Configure the edge and core routers using the scripts and make it DiffServ enabled.

step 11.
Put some packet-generating program in any user machine, which can overlap with the
path of the video stream.

step 12.
Play the VLC in the network mode and stream the packets from the apache server.

step 13.
Tune the packet generator to get a jerking effect for the video.

step 14.
Enable the DiffServ and observe the changes.

step 15.
More precise packet level observation can be performed with the tool, ethereal.

step 16.
Record the results.

4
The Topology:

This is the basic topology that was decided upon. This topology consists of 12 machines
loaded with RedHat Linux 9. Of this, 4 machines act as Core Routers and 4 machines act
as Edge Routers. And the rest four are maintained as Users, which will be configured as
Servers and Clients who would communicate with each other across the domain. The
domain consists of only 8 machines; 4 core and 4 edge routers.

5
SYSTEM CONFIGURATION

User
System Type Core Routers Edge Routers
Machines
RAM 1GB 512 MB 256 MB
C1: 4 E1: 2 U1: 1
C2: 3 E2: 3 U2: 1
# NIC C3: 3 E3: 3 U3: 1
C4: 4 E4: 2 U4: 1
C1 :
eth0 192.168.1.1 E1 : U1 :
eth1 192.168.2.1 eth0 192.168.6.2 eth0 192.168.8.2
eth2 192.168.3.1 eth1 192.168.8.1 eth1 192.168.9.2
eth3 192.168.6.1
C2 : E2 :
eth0 192.168.4.1 eth0 192.168.7.2 U2 :
eth1 192.168.2.2 eth1 192.168.9.1 eth0 192.168.10.2
IP ADDRESS eth2 192.168.11.1 eth2 192.168.10.1
C3 : E3 :
U3 :
eth0 192.168.1.2 eth0 192.168.11.2
eth0 192.168.15.2
eth1 192.168.7.1 eth1 192.168.14.1
eth1 192.168.14.2
eth2 192.168.5.1 eth2 192.168.13.1
C4 :
eth0 192.168.4.2 E4 :
U4 :
eth1 192.168.5.2 eth0 192.168.12.2
eth0 192.168.13.2
eth2 192.168.3.2 eth1 192.168.15.1
eth3 192.168.12.1
NET MASK 255.255.255.0 255.255.255.0 255.255.255.0

6
NIC INSTALLATION AND CONFIGURATION
The NICs (Network Interface Cards) were installed as per the requirements based on the
topological requirements. The machines have one on-board NIC and the rest were
manually installed. These NICs were to be fixed into the PCI slots provided on the
motherboard. There are 3 PCI slots in the machines. Thus a machine can have a
maximum of 4 NICs (including the on-board card).

How to configure network interface card (NIC) in


Linux

Assume there is root privilege and eth0 is the network device.

Note: The commands given hereby are applicable to RedHat Linux 9 and may vary
with respect to other versions of Linux.

1. To set IP address and netmask

/sbin/ifconfig -a <dev> <ip of the device> netmask <netmask of the network>

eg , /sbin/ifconfig -a eth0 192.168.1.2 netmask 255.255.255.0

2. To verify

/sbin/ifconfig <dev>

eg , /sbin/ifconfig eth0

3. To add the default gateway

/sbin/route add default gw <ip of the default gate way>

4. To verify the default gateway setting.

/sbin/route

7
5. To activate the device

/sbin/ifconfig eth0 up

6. To deactivate the device

/sbin/ifconfig eth0 down

7. To display the configuration of all devices including inactive

/sbin/ifconfig -a

8. To restart the network service

service network restart

start, stop, status are the other options to perform corresponding operations in the place of
restart in the above command.

Alternate methods

(1) Edit the file

/etc/sysconfig/network-scripts/ifcfg-eth0

To set hostname edit the file

/etc/sysconfig/network

(2) The easiest method is through network configuration menu by giving the command

redhat-config-network

OR the same by selecting

Main menu -> System settings -> Network

This is just for one NIC. Similarly configure all the NICs present in all the
systems. Assign the proper IPs and the netmasks and turn up all the network cards.

8
CABLING

The basic information you will need to make your own Ethernet cables. For the
experiment we had the cables made manually.

Parts: You'll need several feet of CAT 5/5e/6 cable, RJ45 ends and an RJ45 crimping
tool to complete this. You'll also need a nice cut-off plier. A wire striper and a cable
tester are greatly helpful as well.

Cable: First, start off with good quality cable, it has to be UTP (Unshielded Twisted
Pair) Category 5/5e/6 cable, don't skimp on this (Shielded works too, but isn't necessary).
Bulk cable comes in many types; there are 2 basic categories, solid and braided cable.
Braided cable tends to work better in "patch" applications for desktop use. It is more
flexible and resilient than solid cable and easier to work with, but really meant for shorter
lengths. Solid cable is meant for longer runs in a fixed position. Plenum rated cable
should/must be used whenever the cable travels through an air circulation space. For
example, above a false ceiling or below a raised floor. We have used the CAT 5e UTP
kind ones to make the connection cables.

Here is what the internals of the cable look like:

Figure 1 – Cable

Internal Cable Structure and Color Coding:


There are 8 color-coded wires. These wires are twisted into 4 pairs of wires; each
pair has a common color theme. One wire in the pair being a solid or primarily solid
colored wire and the other being a primarily white wire with a colored stripe (Sometimes
cheap cable doesn’t have any color on the striped cable, the only way to tell is to check
which other wire it is twisted around). Examples of the naming schemes used are: Orange
(alternatively Orange/White) for the solid colored wire and White/Orange for the striped
cable. The twists are extremely important. They are there to counteract noise and
interference. It is important to wire according to a standard to get proper performance
from the cable. The hardware expects the cable to have certain properties, a cable that

9
does not fall within tolerance will cause errors and/or failures. Besides, this maintains all
your cables to the standards and makes it easy to find errors and cross-over cables.

RJ45 Ends:
The RJ45 (Registered Jack 45) end is an 8-position modular connector that looks
like a large phone plug. There are a couple variations available. The primary variation
you need to pay attention to be whether the connector is intended for braided or solid
wire. For braided/stranded wires, the connector has contacts that actually pierce the wire.
For solid wires, the connector has fingers, which pierce the insulation and make contact
with the wire by grasping it from both sides. The connector is the weak point in an
Ethernet cable, choosing the wrong one will often cause problems. Here is a diagram and
pin out:

Figure 2 - RJ45 Jack and Plug Pinout

Ethernet Cables: Now, on to the cables. There are two basic cables. A straight
through cable, which is used to connect to a hub or switch, and a cross-over cable used to
operate in a peer-to-peer fashion without a hub/switch. Some gigabit copper interfaces
can cross and un-cross a cable automatically as needed. Since we intended to have a
network with no hub or switch included we needed the cross-over cables.

Standard, Straight-Through Wiring (both ends are the same):

RJ45 Wire 10Base-T/100Base- 1000Base-T


Wire Color
Pin # Diagram TX Signal Signal

1 White/Orange Transmit+ BI_DA+

2 Orange Transmit- BI_DA-

3 White/Green Receive+ BI_DB+

4 White/Blue Unused BI_DC+

10
5 Blue Unused BI_DC-

6 Green Receive- BI_DB-

7 White/Brown Unused BI_DD+

8 Brown Unused BI_DD-

Table 1 - Straight-Through Cable Pinout

Note: Always make sure that the order of the wires is correct before crimping it on
to the jack.

Cross-Over Cable:

RJ45 Pin #
Wire Color Diagram End #1
(END 1)

1 White/Orange

2 Orange

3 White/Green

4 White/Blue

5 Blue

6 Green

7 White/Brown

8 Brown

11
RJ45 Pin #
Wire Color Diagram End #2
(END2)

1 White/Green

2 Green

3 White/Orange

4 White/Blue

5 Blue

6 Orange

7 White/Brown

8 Brown

Tables 2 & 3 - Cross-Over Cable Pinouts

Procedure: To create the cable, strip off about 2 inches of the cable sheath. When
you get to the second side, cut the wire to length and make sure it is more than long
enough for your needs. Remember, an end-to-end connection should extend at least 1m
(3ft) and not more than 100m (~328ft). Yes, there is a minimum, it’s little known, little
referred to and not usually important. The longer the cable becomes, the more it may
affect the performance, and usually it is a gradual decrease in speed and increase in
latency.

Next untwist the pairs, don't untwist them beyond what you have exposed, the
more untwisted cable you have the worse the problems you can run into.

Now you want to align the colored wires according to the diagrams above. When nicely
aligned, hold them in line together and trim them all to the same length, about 1/2" to
3/4" left exposed from the sheath. And then you want to insert them into the RJ45 end
and make sure each wire is fully inserted to the front of the RJ45 end and in the correct
order. The sheath of the cable should extend into the RJ45 end by about 1/2" and will be
held in place by the crimp. Crimp the end with the crimping tool and once again verify

12
the wires ended up the right order and that the wires extend to the front of the RJ45 end
and make good contact with the metal contacts in the RJ45 end. If you have a cable
tester, put it to use, and verify the proper connectivity of your newly made cable.

That should be it, if your cable doesn't turn out, look closely at each end and see if you
can find the problem. Usually a wire ended up in the wrong place or more commonly,
one of the wires didn't extend to the front of the RJ45 connector and is making no, or
poor contact. If you see a mistake or problem, cut the end off and start again.

NETWORK CONFIGURATION

After the NICs were installed and the cables created, the systems were interconnected to
form the above network. Here the systems labeled Cx are the Core routers and those
labeled Ex are the Edge routers. Those labeled Ux are the User machines. When the
topology was decided it was also decided as to what router-ids should be allotted to the
machines and the OSPF costs (numbers in blue color) that have to be assigned to the links
connecting the whole network. The details on router-id and OSPF cost are mentioned in
the later part.

13
LINUX KERNEL RECOMPILATION

The Kernel is the 'heart and soul' of the Linux Operating System. The Linux Kernel
contains all of the drivers and support for new hardware and should be kept as up to date
as possible. The QoS modules are already present in Linux kernels of version 2.4 and
later ones. We need to add the modules necessary for DiffServ and recompile the Linux
kernel. For this purpose of recompiling, “root” privilege is required .The time taken for
the compilation process is based on the system resources like memory size, processor
speed etc. It varies from system to system.

Note: The list of the necessary modules is given at the end of this section.

Step 1.

Download the required version of kernel from any mirror site that provides Linux kernel.
‘www.kernel.org’ is official site for getting the downloads for the Linux Kernel. The
kernel may be in any of the compressed format like '*.tar.gz'.

For example: Like the one we downloaded; linux-2.4.25.tar.gz

Step 2.

Uncompress the downloaded file using the command

tar -zxvf <the downloaded file>

eg, tar -zxvf linux-2.4.25.tar.gz

Then you will get directory 'linux-2.4.25' containing the whole source files for the version
2.4.25

Step 3.

Move the 'linux-2.4.25' directory to the normal source location '/usr/src/' by the command

mv linux-2.4.25 /usr/src/

and go to the top directory of the new kernel by the command

cd /usr/src/linux-2.4.25

Step 4.

If u want to change the extra version number, then edit the 'Makefile' and put the number
(if you need to put as 3 then give as -3 ). Save and close the file.

14
Otherwise leave this step.

Step 5.

Delete all the unwanted object files, which may exist with the kernel source, using any
one of the commands:

make clean

or

make mrproper

Step 6.

Customizing the kernel; in this step you can decide which all modules are to be added to
the kernel. There are 3 ways to do it.

(a) make config

Prompts whether to add or not, a particular module in the new kernel. You have to press
y/n. Keep pressing the return key if you want to take the default value .

(b) make menuconfig

gives a menu driven environment to the configuration

(c) make xconfig

gives a X-Window system to configure, here mouse can be also used for the selection
operation of the modules.

Step 7.

generating the dependencies, just give the command

make dep

Step 8.

compile the code for kernel image; this is where the real process of compilation takes
place,

make bzImage

This will make the executable kernel at /usr/src/linux<version>/arch/i386/boot/bzImage

15
Step 9.

compile the modules

make modules

Step 10.

install the modules

make modules_install

Step 11.

to install the new kernel

make install

this will do many internal operation like copying the kernel image to the /boot partition,
editing the grub etc.

Step 12.

reboot the machine

init 6

boot up with new kernel by selecting proper choice in the grub.

Tips:-

1. To check which kernel is currently used, command is

uname -r

gives the currently working kernel's version number.

2. If u get a kernel panic while running new kernel, boot up with old kernel and shift to
/usr/src directory, then check if the new kernel supports the ext3 file system using any of
the kernel configuration command mentioned in the step 6; if it is not included then
repeat the compilation from step 5 and include ext3 support from the file system option
while doing step 6 and continue with the remaining steps.

16
If the problem is not regarding with ext3, then edit the grub for the new kernel's kernel
parameter line by removing all after the parameter 'ro'. Save and reboot with the new
kernel once again.

3. To edit the grub

vi /boot/grub/grub.conf

or

vi /etc/grub.conf

4. To install kernel source, it is also available in rpm form. It is very easy; in that case to
get the source, use the command

rpm -ivh <kernel file .rpm>

In this case take care about the old kernel.

5. To make a boot up disk. It is better to make and keep a boot-up floppy; will be helpful
for facing any critical situation, the command is

mkbootdisk --device /dev/fd0 <version number>

eg mkbootdisk --device /dev/fd0 2.4.25

6. It is recommended to take stable kernel for normal usage, which will be with even
number for its minor version number. The format of kernel version number is

<major>.<minor>.<patch level>-<extra version>

eg 2 . 4 . 25 - 3

The other developing kernel is normally used for kernel side research purposes and to get
the next stable kernel.

7. It is possible to do all the compilation steps with a single command

make clean menuconfig dep bzImage modules modules_install install

17
List of Kernel Modules to be included for QoS:

Support for DiffServ is already integrated into 2.4 kernels. In order to enable it, you may
have to reconfigure and rebuild your kernel, or at least some modules.

The following kernel configuration options have to be enabled in the section Networking
options while configuring the kernel source (in step 6 of the kernel configuration):

• Kernel/User netlink socket (CONFIG_NETLINK)


• Network packet filtering (CONFIG_NETFILTER)
• QoS and/or fair queueing (CONFIG_NET_SCHED)

The following kernel configuration options should be enabled in the section Networking
options, QoS and/or fair queueing:

• CBQ packet scheduler (CONFIG_NET_SCH_CBQ)


• The simplest PRIO pseudoscheduler (CONFIG_NET_SCH_PRIO)
• RED queue (CONFIG_NET_SCH_RED)
• GRED queue (CONFIG_NET_SCH_GRED)
• Diffserv field marker (CONFIG_NET_SCH_DSMARK)
• Ingress Qdisc (CONFIG_NET_SCH_INGRESS)
• QoS support (CONFIG_NET_QOS)
• Packet classifier API (CONFIG_NET_CLS)
• TC index classifier (CONFIG_NET_CLS_TCINDEX)
• Firewall based classifier (CONFIG_NET_CLS_FW)
• U32 classifier (CONFIG_NET_CLS_U32)
• Traffic policing (CONFIG_NET_CLS_POLICE)

In some cases, additional elements may be needed. It is therefore recommended to enable


all options in QoS and/or fair queueing.

DIFFSERV CONFIGURATION

First of all we have to configure OSPF in the all the Core and Edge routers to
generate routing tables. After that develop the required tc scripts to enable the queuing
disciplines for DiffServ.

18
Router Configuration Through OSPF

OSPF (Open Shortest Path First) is s routing protocol used to generate routing tables
dynamically. OSPF runs under Zebra engine so we need to configure both Zebra and
OSPF for the service to be running correctly.

Zebra

A minimal zebra configuration file, “/etc/zebra/zebra.conf” is created.

This contains just the hostname, password and the enable password. The hostname is for
recognition, password is the password used to enter into the telnet prompt of zebra and
enable password is the password for entering into the privileged mode.

There after when we telnet to the port used by Zebra, i.e., port number 2601 and enter
into the enhanced mode, Zebra engine detects the number of network interface cards, that
has been installed on the machine.

Once in the Zebra configuration interface we can have a list of possible commands at the
press of the key “?” or by the command “list”.

At the Zebra configuration prompt, we have to use the following commands for our
purpose:

1. to assign IPs to the cards using the interface configuration prompt.

ip address <ip address/mask>

eg: ip address 192.168.1.1/24

where 192.168.1.1 is the IP for corresponding NIC and 24 is the bits used for netmask,;
which in this case is 255.255.255.0.

In Zebra, after the Zebra engine has detected the network interfaces you can end the
session by giving the command “end”

Before exiting from the Zebra session take care to use the command “write file” to save
your configurations to the “zebra.conf file”.

OSPF

A minimal ospf configuration file, “/etc/zebra/ospfd.conf” contains just the


hostname, password and the enable password just like the case of the zebra.conf file. The

19
hostname is for recognition, password is the password used to enter into the telnet prompt
of OSPF and enable password is the password for entering into the supervisory mode.

There after when we telnet to the port used by ospfd (OSPF daemon), i.e., port
number 2604 and enter into the enhanced mode.

The commands to be used in the OSPF configuration interface are:

1. The OSPF cost can be assigned for each card by going to the interface configuration
prompt using “interface” command

ip ospf cost <cost>

eg: ip ospf cost 25

This command allocates a cost of 25 to the corresponding NIC. This cast was pre-
decided. Also there is no rule as to what should be the cost of a particular link. There still
is a recommendation that the OSPF cost of a link should be inversely proportional to the
bandwidth of the link, but this is not mandatory.

2. After assigning the cost you can give the network router -id for the router, using the
command “router-id” from the “router ospf” configuration mode.

router –id <router-id>

eg: router-id 1.1.1.1

This command allocates the router id of the particular system as 1.1.1.1., which serves as
an identification for the neighboring routers/systems.

3.After having done that you have to specify to the router as to which all networks are
directly connected to it. This can be achieved by using the “network” command from the
“router ospf” prompt.

network <network address/mask> area <area>

eg: network 192.168.1.0/24 area 0

This command tells as to which all networks is the current system directly connected to.

Save the configuration file and exit to the local prompt.

20
Start the services of Zebra and OSPF with commands “service zebra restart” and
“service ospfd restart”.

This will re-run the daemon and in a few seconds the routing table can be seen using the
command “route” or “route -n”.

The “route –n” command will give detailed list of the network addresses, the gateways,
netmask, metric, network device, etc.

DiffServ Implementation:
Core Router

figure : queuing diagram for core routers

Script for implementation of queuing discipline for a core router:

To enable the service


#!/bin/sh
# a core script with PRIO queue with higher priority for EF traffic ,
TBF for avoid starvation

21
# Script for eth2 (to C4)

clear

echo -e "Enter the rate for TBF (like xMbit):"


read RATE

echo -e "Enter the burst for TBF (like xKB):"


read BURST

echo -e "Enter the limit for TBF (like xMB):"


read LIMIT

# Setting the root Qdisc


tc qdisc add dev eth2 handle 1:0 root dsmark indices 64 set_tc_index

# Setting the main tcindex filter


tc filter add dev eth2 parent 1:0 protocol ip prio 1 tcindex mask 0xfc
shift 2

# Adding the priority Qdisc


tc qdisc add dev eth2 parent 1:0 handle 2:0 prio

# Add a TBF to avoid starvation due to higher priority by put some


limits
tc qdisc add dev eth2 parent 2:1 tbf rate $RATE burst $BURST limit
$LIMIT

# Add a tcindex filter to direct the EF traffic to higher priority


queue
tc filter add dev eth2 parent 2:0 protocol ip prio 1 handle 0x2e
tcindex classid 2:1 pass_on

#BE class(2:2)

tc filter add dev eth2 parent 2:0 protocol ip prio 2 handle 0 tcindex
mask 0 classid 2:2 pass_on

echo -e "\n\n\tCore router C3 is activated !!!\n\n"

To disable the service


#!/bin/sh

# Script to delete the Qdiscs

clear

tc filter del dev eth2 parent 2:0 protocol ip prio 1 handle 0x2e
tcindex classid 2:1 pass_on
echo -e "tcindex filter deleted *****\n"

22
tc filter del dev eth2 parent 2:0 protocol ip prio 2 handle 0 tcindex
mask 0 classid 2:2 pass_on
echo -e "tcindex filter deleted *****\n"

tc filter del dev eth2 parent 1:0 protocol ip prio 1 tcindex mask 0xfc
shift 2
echo -e "tcindex filter deleted *****\n"

tc qdisc del dev eth2 parent 2:1 tbf


#rate 1.5Mbit burst 1.5kB limit 1.6kB
echo -e "TBF queue deleted ****\n"
tc qdisc del dev eth2 parent 1:0 handle 2:0 prio
echo -e "PRIO queue deleted ****\n"

tc qdisc del dev eth2 handle 1:0 root dsmark indices 64 set_tc_index
echo -e "DSMARK queue deleted ****"

echo -e "\n\n\tCore Router C3 is Deactivated !!!\n\n"

Edge Router

figure : queuing diagram for edge routers

23
Script for implementation of queuing discipline for an edge router:

To enable the service


#!/bin/sh

# a script for edge router which mark the packet as EF type PHB by
setting TOS value as 0xb8

# script for eth0 (to C3)


# ------------------------

clear

echo -n "Enter rate for policing the EF traffic (like xmbps) : "
read RATE
echo -n "Enter burst for policing the EF traffic (like xK) : "
read BURST

# to add qdisc to the device eth0 as the root queue


tc qdisc add dev eth0 handle 1: root dsmark indices 8

# to set the class 1:1 DS field as 0xb8


tc class change dev eth0 classid 1:1 dsmark mask 0x3 value 0xb8

#to make filters 1: , 2:

tc filter add dev eth0 parent 1:0 prio 4 protocol ip u32


tc filter add dev eth0 parent 1:0 prio 4 handle 2: protocol ip u32
divisor 1

tc filter add dev eth0 protocol ip parent 1:0 prio 4 u32 ht 2:0:
match ip dst 192.168.15.2 police rate $RATE burst $BURST drop flowid
1:1

tc filter add dev eth0 protocol ip parent 1:0 prio 4 u32 ht 800:: match
ip dst 192.168.0.0/16 hashkey mask 0x0000ffff at 16 link 2:

echo -e "\n\n\tEdge Router (E2) is UP now !!!!\n\n "

24
To disable the service
#!/bin/sh

# Script to delete the Qdiscs

tc qdisc del dev eth0 root

echo -e "\n\n\tEdge Router is DOWN !!!\n\n"

VLC CLIENT

A VLC (Video LAN Client) can be installed using the rpms available for the
same. VLC is free software available easily and can be downloaded from the net. After
installation of VLC the video file can be streamed using the network option in the file
menu of the VLC. Here we can specify the IP address of the source machine (in our case
the IP address of the machine with the HTTP server running).

HTTP SERVER

HTTP server comes in as built-in feature with Linux. We can turn up the server using the
command “service httpd start” httpd uses the TCP port numbered 80.

The video file to be streamed has to be put inside the default directory of httpd;
“/var/www/html/”

TRAFFIC GENERATOR
TG (traffic generator) is an application used to pump packets into the traffic to
congest it and thus generate a real life scenario in our network. The binary files for tg was
downloaded. It is also free software available on the net. This was then installed and later
configured so as to pump UDP packets into the network. Then the following tg scripts
were generated; one for the tg server and one for the tg client:

25
Script for tg server
# This script instructs TG to execute in the server or the sink mode
# in which it only receives packets and records the information in the
# binary log file. TG is initialized at time 15 secs from the start,
and
# starting at 1.1 secs after initialization it waits for clients to
# send data.
#
on 0:15 udp 192.168.10.1. 4336 server
at 1.1 wait

Script for tg client


# This file specifies the following to TG:
# 1. At 15 secs open a UDP socket to send packets to the server waiting
at
# 192.168.10.1 and port 4336
# 2. after 5 secs setup (times specified are relative to the start time
-
# 15 secs here.)
# 3. starting at time 6 secs send constant packets to the server with
# interpacket transmission time being 0.01 secs ( == 100
packets/sec)
# for 20 secs.

on 0:15 udp 192.168.13.2.4336


at 5 setup
at 6 arrival uniform 0.00007 0.00016 length uniform 1300 1400
time 60:0

Commands for executing the tg scripts.


First we turn up the server by the following command

./tg –i udpserver.tg –o foo

Here the udpserver.tg is the script file for the tg server and foo is the output file.

Then we turn up the client, which starts sending UDP packets after a particular interval of
time.

./tg –i udpclient.tg –o foo

26
Here the udpclient.tg is the script file for the tg client and foo is the output file.

TESTING TOOLS

Ethereal

For the purpose of detail testing of packets we can use ethereal that is in-built in
Linux. Ethereal is a freely available packet analyzer. Using ethereal we can see that
DSCP value of the EF packets are marked as b8 and the BE packets as 0.

mtr

mtr (Matt’s TraceRoute) is a built-in feature of Linux, that provides the


functionalities of both the ping command and traceroute command together. This also
shows us the packets sent, packets received and percentage packet loss in a particular
path. We have used mtr inorder to test the network connectivity between the systems.

27

You might also like