Modifying Network Packet Buffering in Network Layer CS518 Final Presentation and Instruction Guide...

17
Modifying Network Packet Buffering in Network Layer CS518 Final Presentation and Instruction Guide Li Zhang

Transcript of Modifying Network Packet Buffering in Network Layer CS518 Final Presentation and Instruction Guide...

Page 1: Modifying Network Packet Buffering in Network Layer CS518 Final Presentation and Instruction Guide Li Zhang.

Modifying Network Packet Buffering in Network Layer

CS518 Final Presentation and Instruction Guide

Li Zhang

Page 2: 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

Page 3: Modifying Network Packet Buffering in Network Layer CS518 Final Presentation and Instruction Guide Li Zhang.

Background

Five Network Layers in Linux :1. MAC and Logical-Link Layer2. Network Layer3. Transport Layer4. Application Layer

Page 4: Modifying Network Packet Buffering in Network Layer CS518 Final Presentation and Instruction Guide Li Zhang.

Traffic Control in Linux and My Goal 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:1. Buffer overflow.2. Policing mechanism detected violation of a rule For example, packet format fault, firewall blocks.

Page 5: Modifying Network Packet Buffering in Network Layer CS518 Final Presentation and Instruction Guide Li Zhang.

Hardware and Software Preparation Hardware: An x86 networked computer running Win

dows XP Software:1. VMware2. CentOS 5.2 and its applications3. linux kernel 2.6.264. Two tools to monitor network flows:

ntop and bing

Page 6: Modifying Network Packet Buffering in Network Layer CS518 Final Presentation and Instruction Guide Li Zhang.

Preparation 1: Create a virtual machine and install CentOS 5.2 Download VMware Server 1.0.3 from http://www.vmware.com/do

wnload/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/

Page 7: Modifying Network Packet Buffering in Network Layer CS518 Final Presentation and Instruction Guide Li Zhang.

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

Page 8: Modifying Network Packet Buffering in Network Layer CS518 Final Presentation and Instruction Guide Li Zhang.

Preparation 2-continue Create an initrd image which contains device drivers which needed t

o loaded $ cd /boot $ mkinitrd -o initrd.img-2.6.26 2.6.26 Modify the grub file1. Open /boot/grub/menu.lst with text editor2. Modify the default booting kernel pointing to 2.6.263. 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

Page 9: Modifying Network Packet Buffering in Network Layer CS518 Final Presentation and Instruction Guide Li Zhang.

Preparation 3: Install ntop and bing Step 1 : Download and install rpmforge-release $ wget http://dag.wieers.com/rpm/packages/rpmforge-release/rpmf

orge-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

Page 10: Modifying Network Packet Buffering in Network Layer CS518 Final Presentation and Instruction Guide Li Zhang.

Preparation 4: Duplicate Virtual Machine A virtual machine can be duplicated very ea

sily. Duplicate the file folder you created in Prep

aration 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.

Page 11: Modifying Network Packet Buffering in Network Layer CS518 Final Presentation and Instruction Guide Li Zhang.

Modify the code First double the buffer size by editing the fu

nction 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().

Page 12: Modifying Network Packet Buffering in Network Layer CS518 Final Presentation and Instruction Guide Li Zhang.

Recompile again $ cd /usr/src/linux-2.6.26 $ make menuconfig1. Select ‘General setup---’2. Select ‘Local version-append to kernel release’3. Enter a name you want, press ‘OK’4. ‘Exit’ twice5. Watch video ‘recompile_again_menuconfig.avi’ Then follow the steps after ‘make menuconfig’ describe

d 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

Page 13: Modifying Network Packet Buffering in Network Layer CS518 Final Presentation and Instruction Guide Li Zhang.

Experiments Using bing which is a tool to identify the bandwidth currently avai

lable between two computers. 1. Get local host IP address: $ ifconfig 2. 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 term1. Start ntop and keep the terminal running ntop open $ ntop2. Open a web browserr, for example Firefox Visit http://localhost:3000/ Watch video ntop_and_bing.avi

Page 14: Modifying Network Packet Buffering in Network Layer CS518 Final Presentation and Instruction Guide Li Zhang.

Results

Page 15: Modifying Network Packet Buffering in Network Layer CS518 Final Presentation and Instruction Guide Li Zhang.

Results-continue

Page 16: Modifying Network Packet Buffering in Network Layer CS518 Final Presentation and Instruction Guide Li Zhang.

References K. Wehrle, F. Pahlke, H. Ritter, D. Muller and M. Bec

hler, ‘The Linux Networking architecture’, Pearson Education Inc, 2005

http://www.cndev.org/forum/msg.aspx?pid=22736 https://www.redhat.com/docs/en-US/Red_Hat_En

terprise_Linux/5.2/pdf/Deployment_Guide/Deployment_Guide.pdf

http://gzmaster.blog.51cto.com/299556/77883 http://www.cyberciti.biz/tips/compiling-linux-kern

el-26.html

Page 17: Modifying Network Packet Buffering in Network Layer CS518 Final Presentation and Instruction Guide Li Zhang.

The End

Thank you!