Professional Documents
Culture Documents
1. Acknowledgement 2
2. Introduction 3
3. System Configuration 6
4. NIC Installation 7
5. Cabling 9
6. Network Configuration 13
8. DiffServ Configuration 18
9. VLC Client 25
1
Acknowledgement
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
Experiment procedure:
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.
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).
Note: The commands given hereby are applicable to RedHat Linux 9 and may vary
with respect to other versions of Linux.
2. To verify
/sbin/ifconfig <dev>
eg , /sbin/ifconfig eth0
/sbin/route
7
5. To activate the device
/sbin/ifconfig eth0 up
/sbin/ifconfig -a
start, stop, status are the other options to perform corresponding operations in the place of
restart in the above command.
Alternate methods
/etc/sysconfig/network-scripts/ifcfg-eth0
/etc/sysconfig/network
(2) The easiest method is through network configuration menu by giving the command
redhat-config-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.
Figure 1 – Cable
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:
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.
10
5 Blue Unused BI_DC-
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
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'.
Step 2.
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/
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.
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 .
gives a X-Window system to configure, here mouse can be also used for the selection
operation of the modules.
Step 7.
make dep
Step 8.
compile the code for kernel image; this is where the real process of compilation takes
place,
make bzImage
15
Step 9.
make modules
Step 10.
make modules_install
Step 11.
make install
this will do many internal operation like copying the kernel image to the /boot partition,
editing the grub etc.
Step 12.
init 6
Tips:-
uname -r
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.
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
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
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
eg 2 . 4 . 25 - 3
The other developing kernel is normally used for kernel side research purposes and to get
the next stable kernel.
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):
The following kernel configuration options should be enabled in the section Networking
options, 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
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:
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
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.
1. The OSPF cost can be assigned for each card by going to the interface configuration
prompt using “interface” command
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.
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.
This command tells as to which all networks is the current system directly connected to.
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
21
# Script for eth2 (to C4)
clear
#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
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 handle 1:0 root dsmark indices 64 set_tc_index
echo -e "DSMARK queue deleted ****"
Edge Router
23
Script for implementation of queuing discipline for an edge router:
# a script for edge router which mark the packet as EF type PHB by
setting TOS value as 0xb8
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
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:
24
To disable the service
#!/bin/sh
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
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.
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
27