Transcript powerpoint

Modifying Network Packet
Buffering in Network Layer
CS518 Final Presentation and
Instruction Guide
Li Zhang
Contents







Notations
Very Brief Introduction
Hardware And Software Preparations
Modifying the Code
Experiments Design
Results and Conclusion
References
Background

1.
2.
3.
4.
Five Network Layers in Linux :
MAC and Logical-Link Layer
Network Layer
Transport Layer
Application Layer
Traffic Control in Linux and My
Goal



1.
2.
In the Linux world, the term traffic control
represents all the possibilities to influence incoming
and outgoing network traffic in one way or another.
This project focus on modifying the queuing
disciplines in network layer in order to create an
bigger size buffer which will drop less packets
because of time slots used up.
Two reasons to drop packets in network layer:
Buffer overflow.
Policing mechanism detected violation of a rule
For example, packet format fault, firewall blocks.
Hardware and Software
Preparation


1.
2.
3.
4.
Hardware:
An x86 networked computer running
Windows XP
Software:
VMware
CentOS 5.2 and its applications
linux kernel 2.6.26
Two tools to monitor network flows:
ntop and bing
Preparation 1: Create a virtual
machine and install CentOS 5.2

Download VMware Server 1.0.3 from
http://www.vmware.com/download/server/

Install VMware server and register it online. The registration is free.

Create a virtual machine under the guide of video ‘Create_Virtual_
Machine.avi’

Download and install CentOS 5.2 in the virtual machine from
http://img.cs.montana.edu/linux/centos/5.2/isos/i386/
Preparation 2: Recompile the
Linux kernel


Start Linux and log in as ‘root’
Download the kernel code and decompressed it into /usr/src
$
$
$
$

cd /tmp
wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.26.tar.bz2
tar -xjvf linux-2.6.25.tar.bz2 -C /usr/src
cd /usr/src/linux-2.6.26
Install gcc, a C compiler
$ yum install gcc

Configure the kernel, do not change anything, just select ‘exit’
$ make menuconfig

Make and install modules and kernel
$
$
$
$
make
make modules
make modules_install
make install
Preparation 2-continue

Create an initrd image which contains device drivers which needed to
loaded
$ cd /boot
$ mkinitrd -o initrd.img-2.6.26 2.6.26

1.
2.
3.


Modify the grub file
Open /boot/grub/menu.lst with text editor
Modify the default booting kernel pointing to 2.6.26
If there is a line like this ‘menu hidden’, delete the whole line
Restart Linux
Select the kernel 2.6.26 from the boot loader menu
Preparation 3: Install ntop and
bing

Step 1:Download and install rpmforge-release
$ wget http://dag.wieers.com/rpm/packages/rpmforgerelease/rpmforge-release-0.3.6-1.el5.rf.i386.rpm
$ rpm -Uvh rpmforge-release-0.3.6-1.el5.rf.i386.rpm

Step 2: Intsall ntop
$yum install rrdtool
$yum install ntop

Step 3: Install bing
$yum install bing
Preparation 4: Duplicate
Virtual Machine





A virtual machine can be duplicated very
easily.
Duplicate the file folder you created in
Preparation 1 and rename it as Linux-modify
Use VMware to open the .vmx file in the file
folder Linux-modify.
Select ‘Edit virtual machine setting’ and
rename the new machine as ‘Linux-modify’
Only modify the kernel in the new machine.
Modify the code


First double the buffer size by editing the
function tbf_change() in netsched/sch_tbf.c.
The variable max_size is the max buffer size.
The watchdog() function is invoked when the
timer for a packet expires. This function will
be used in tbf_dequeue() to determine
whether the process of transmitting a packet
should be interrupted. Modify the condition to
invoke the watchdog().
Recompile again


1.
2.
3.
4.
5.


$ cd /usr/src/linux-2.6.26
$ make menuconfig
Select ‘General setup---’
Select ‘Local version-append to kernel release’
Enter a name you want, press ‘OK’
‘Exit’ twice
Watch video ‘recompile_again_menuconfig.avi’
Then follow the steps after ‘make menuconfig’ described in
Preparation 2. Remember using the version name you created.
Restart and select the kernel 2.6.26_with_your_name from
the boot loader menu
Experiments

1.
Using bing which is a tool to identify the bandwidth currently
available between two computers.
Get local host IP address:
$ ifconfig
2.

1.
Use bing to test the bandwidth betwwen the local host and
www.joyo.com
$ bing –e 50 –i 1 –s 100 –S 1200 Your_Local_IP www.joyo.com
Using ntop to monitor the network in the long term
Start ntop and keep the terminal running ntop open
$ ntop
2.

Open a web browserr, for example Firefox
Visit http://localhost:3000/
Watch video ntop_and_bing.avi
Results
Results-continue
References





K. Wehrle, F. Pahlke, H. Ritter, D. Muller and M.
Bechler, ‘The Linux Networking architecture’, Pearson
Education Inc, 2005
http://www.cndev.org/forum/msg.aspx?pid=22736
https://www.redhat.com/docs/enUS/Red_Hat_Enterprise_Linux/5.2/pdf/Deployment_G
uide/Deployment_Guide.pdf
http://gzmaster.blog.51cto.com/299556/77883
http://www.cyberciti.biz/tips/compiling-linux-kernel26.html
The End
Thank you!