Download Experimental Evaluation Linux Routing Performance - Final Project | CS 898 and more Study Guides, Projects, Research Computer Science in PDF only on Docsity!
Experimental Evaluation Linux Routing
Performance
CS898 Project Final Report
Chaoxing Lin
Dec 20, 2001
Content
Chapter 1 Linux Network Infrastructure
This chapter gives the computer system information, network configuration.
1.1 Computer System Information
Table 1.1 shows the CPU, memory, OS information of the computers that are used in the
project. This information is from /proc/cpuinfo, /proc/meminfo, uname -a
Machine CPU Information Memory Info OS Info
Dublin.cs.unh.edu Pentium III
(728.455MHz)
Mem:256MB
Swap:1GB
Red Hat Linux 7.
kernel2.4.
Madrid.cs.unh.edu Pentium III
(728.448MHz)
Mem:512MB
Swap: 1GB
Red Hat Linux 7.
kernel2.2.
Prague.cs.unh.edu Pentium III
(728.458MHz)
Mem:256MB
Swap:1GB
Red Hat Linux 7.
kernel2.2.
Table 1.1 Computers used in this project.
1.2 Network Configuration Information
Table 1.2 shows the Network interfaces setting in the project. This information is got
from the result of command “ifconfig” and “/sbin/lsmod”. The basic diagram is
shown at Figure 1.1.
Machine Interface Chip IP address Mac Address
100Mb/s Eth0 3Com 3c90x 132.177.8.28/25 00:B0:D0:FE:D8:
100Mb/s Eth1 Tulip 192.168.2.1/24 00:C0:F0:6A:56:
Dublin.cs.unh.edu
100Mb/s Eth2 Tulip 192.168.1.1/24 00:C0:F0:6A:6D:0C
100Mb/s Eth0 3Com 3c90x 132.177.8.27/25 00:B0:D0:D8:FD:EA
100Mb/s Eth1 Tulip 192.168.1.2/24 00:C0:F0:6A:74:F
Madrid.cs.unh.edu
100Mb/s Eth2 Tulip 192.168.3.1/24 00:C0:F0:6A:74:ED
100Mb/s Eth0 3Com 3c90x 132.177.8.29/25 00:B0:D0:D8:FE:
100Mb/s Eth1 Tulip 192.168.2.2/24 00:C0:F0:6A:6D:4E
Prague.cs.unh.edu
100Mb/s Eth2 Tulip 192.168.3.2/24 00:C0:F0:6A:75:
Table 1.2 Network interfaces settings.
1.2.1 Basic Diagram
| switch | | |
| 10 9 11 |
| | | | | | | | | 132.177.8.0/ ------------------- | ------------------- | | | | | | | | | | | |
| eth0 | | eth0 | | eth0 | | | | | | | | Madrid | | Dublin | | Prague | | | | | | | | eth2 eth1 | | eth2 eth1 | | eth1 eth2 |
3.1| |1.2 1.1| |2.1 2.2 | | 3. | ---------------- ---------------- | | 192.168.1.0/24 192.168.2.0/24 |
| |
192.168.3.0/
Figure 1.1 Infrastructure diagram.
Experiments in this chapter refer to this route:
Madrid:eth1 ==> Dublin:eth2 ==> Dublin:eth1 ==> Prague:eth
Dublin is used as router.
1.2.2 Static Route Setting:
Now we show the route setting in these machines. We get this information by command
“route”.
? Madrid.cs.unh.edu
Destination Gateway Genmask Flags Metric Ref Use Iface
132.177.8.0 * 255.255.255.128 U 0 0 0 eth
192.168.3.0 * 255.255.255.0 U 0 0 0 eth
192.168.2.0 192.168.1.1 255.255.255.0 UG 0 0 0 eth
192.168.1.0 * 255.255.255.0 U 0 0 0 eth
127.0.0.0 * 255.0.0.0 U 0 0 0 lo
default phub0.cs.unh.edu 0.0.0.0 UG 0 0 0 eth
tcp_max_tw_buckets N/A tcp_ecn N/A
tcp_mem N/A tcp_syn_retries 10
tcp_orphan_retries N/A tcp_fack N/A
tcp_reordering N/A tcp_synack_retries 5
tcp_retrans_collapse 1 tcp_fin_timeout 180
tcp_retries1 7 tcp_syncookies 0
tcp_retries2 15 tcp_keepalive_intvl N/A
tcp_abort_on_overflow N/A tcp_timestamps 1
tcp_rfc1337 0 tcp_keepalive_probes 9
tcp_adv_win_scale N/A tcp_tw_recycle N/A
tcp_rmem N/A tcp_keepalive_time 7200
tcp_app_win N/A tcp_window_scaling 1
tcp_sack 1 tcp_max_orphans N/A
tcp_dsack N/A tcp_wmem N/A
tcp_max_ka_probes 5
tcp_stdurg 0 tcp_max_syn_backlog 128
Table 1.4 TCP version information on Madrid and Prague.
Chapter 2 Tools used in the project
This chapter introduces the tools that will be used in this project and their source codes.
2.1 Blast Test Code (By Prof. Bob Russell, UDP version is by Chaoxing Lin)
Most of the performance experiments will use blast test tools. Here is how it works.
Client side sends a number ( iteration times, specified from command line ) of packets of
given request size ( specified from command line ) on end and close the connection. Server
side keeps receiving packets and swallows it. Then when client closes connection it sends
1 byte back. For the complete blast test code, please refer to
http://www.cs.unh.edu/cnrg/lin/linuxProject/phase3/nettest
2.2 Packet Dropper Code (By Glenn Herrin, Modified by Chaoxing Lin)
The first impairment we introduce to the router kernel is packet dropper module. This is a
kernel module. It randomly drops packet with a specified destination address at a given
rate. Code are inserted and executed on virtual DEVICE layer.
On receiving each packet, the Dropper checks the destination IP address. If the
destination is the target IP, we get a 16-bit random number, if the random number is less
than the dropping threshold value which is rate *65535, we drop this packet, otherwise,
process it normally.
/************************packet_dropper***************** This is what dev_queue_xmit will call while this module is installed ****/
int packet_dropper(struct sk_buff *skb) { unsigned short t; if (skb->nh.iph->daddr == target) {
/* the following code is modified by lin: begin (/ t = getUnsignedShortRandom(); if (t < cutoff) { number_of_packet_dropped++; return 1; / drop this packet / } / modified by lin : end ) */
return 0; /* continue with normal routine / } / packet_dropper */
The random number is generated in this way. This way is only good for Intel processor
933 for (i=0; i<skb_shinfo(skb)->nr_frags; i++) 934 if (skb_shinfo(skb)->frags[i].page >=highmem_start_page) 935 return 1; 936 937 return 0; 938 } 939 #else 940 #define illegal_highdma(dev, skb) (0) 941 #endif 942 943 /* ADDED BY LIN to test packet-dropper:begin ( / 944 945 int (xmit_test_function)( struct sk_buff * ) = 0; 946 /* ADDED BY LIN to test packet-dropper:end ) */
_* dev_queue_xmit - transmit a buffer
- @skb: buffer to transmit
- Queue a buffer for transmission to a network device. The caller
- must have set the device and priority and built the buffer *before calling this function. The function can be called from an *interrupt A negative errno code is returned on a failure. A *success does not
- guarantee the frame will be transmitted as it may be dropped due
- to congestion or traffic shaping. */ ........_
In function: int dev_queue_xmit(struct sk_buff *skb)
At the very beginning, add:
if ( xmit_test_function && ( *xmit_test_function )(skb) ) { kfree_skb( skb ); return 0; }
See the context:
int dev_queue_xmit(struct sk_buff *skb) { struct net_device *dev = skb->dev; struct Qdisc *q;
/* ADDED BY LIN TO TEST PACKET-DROPPER : BEGIN ( */ if ( xmit_test_function && ( xmit_test_function )(skb) ) { kfree_skb( skb ); return 0; } / ADDED BY LIN TO TEST PACKET-DROPPER : END ) */
if (skb_shinfo(skb)->frag_list &&
!(dev->features&NETIF_F_FRAGLIST) && skb_linearize(skb, GFP_ATOMIC) != 0) { kfree_skb(skb); return -ENOMEM; } ...........
/usr/src/linux/net/netsyms.c
at line: 570 Add:
extern int ( *xmit_test_function ) ( struct sk_buff * );
EXPORT_SYMBOL_NOVERS( xmit_test_function );
After changing kernel source code, don’t forget to re-compile the kernel.
For the complete packet_dropper code, please refer to
http://www.cs.unh.edu/cnrg/lin/linuxProject/phase3/random_dropper/
2.3 Proc File System Operation Code
In order to check the exact number of packets dropped by the packet dropper and to
easily change dropping rate and destination IP address, we develop a kernel module to do
this job. It dynamically probes current dropping rate, destination packet, number of
packet dropped. It can also set these values.
static struct proc_dir_entry *dropperInfo, *fileEntry; static int proc_reset_num(struct file *file,const char * buffer,unsigned long count,void *data); static int proc_read_num(char *buf, char **start, off_t off, int count,int *eof, void *data); static int proc_read_dropper(char *buf, char **start, off_t off, int count,int *eof, void *data); static int proc_write_dropper(struct file *file,const char *buffer,unsigned long count,void *data);
int init_module() { int rv = 0; EXPORT_NO_SYMBOLS; /* create directory */ dropperInfo = proc_mkdir(“dropperInfo”, NULL); if(dropperInfo == NULL) { printk("<1> dropperInfo failed\n"); rv = -ENOMEM; goto out; } dropperInfo->owner = THIS_MODULE;
/* create “dropper” and "numDropped" files */ fileEntry = create_proc_entry("dropper", 0644, dropperInfo); if(fileEntry == NULL) {
Our goal is to reduce the human interactions to the minimum when we do these
experiments. The automation tool will also make it easy to repeat the experiments with
the same settings sometime later.
Based on this, we develop a simple tool to synchronize the router and sending host. This
tool contains 2 applications
“dublin” is to be run as server on dublin.cs.unh.edu:5678.
“madrid” is to be run as client on madrid.cs.unh.edu.
Step 1. Dublin installs “packet dropper” module.
Step 2. Dublin installs “proc file system manipulation” module.
Step 3. Dublin opens server port 5678 and waits for connection. And after connection is
created, it waits for control message from Madrid and do as instructed. Control
messages are:
SET_RATE rate : Dublin sets dropping rate to rate. It also creates a directory
with the name rate. Number of packet loss at this rate will be put under this
directory.
RECORD_LOSS: Dublin checks the proc file system, get the number of
packets dropped since last reset. And then it resets the number_of_packet to 0.
SET_ITERATION times : (used only in regular dropping test with dropping rate
1/6 ). Dublin creates a directory with the name times. Number_of_packet loss
will be put under this directory.
Step 4 Prague opens “blast test server”( using port 1026 because it’s hard coded in this
tools )
Step 5.Madrid opens tool client. It sends control message to Dublin to set rate. After it
gets acknowledgement, it does experiment(blastclient 1026 192.168.2.2 100000
1448). After each experiment, Madrid sends control message to Dublin to record
the packet loss. For each specific rate, Madrid does 10 times experiments and
then increment the rate and set it to Dublin.
Note: Don’t forget to redirect the result to a file. We will use this file to do statistics.
Step 6 On Dublin, run script “collectRawDropNum” whose content is:
cd dirName
for d in ls;
do
cd $d
echo $d >> /home/lin/Tools/rawDrop
for f in ls;
do
cat $f >> /home/lin/Tools/rawDrop
done
cd ..
done
cd ..
(Suppose that dirName is the directory created by “dublin”) we will get a file with
the number of packets dropped for each experiment.
Run “getNum rawDrop dropStat ”, we will get the statistical result of “number of
packet dropped during each experiment”
Step 7. On Madrid, Suppose that we redirect the experiment result to a file “ rawElapse “,
run “getElapse rawElapse elapseStat ” we can get the statistical result. By this
result we can run gnuplot to draw the graph.
For the complete AutoTools code,
please refer to http://www.cs.unh.edu/cnrg/lin/linuxProject/phase3/AutoTools/
Table 3.2 Performance got by UDP test.
The elapse time original data is:
http://www.cs.unh.edu/cnrg/lin/linuxProject/phase1/clientInfoOptimal
The packet loss original data is:
http://www.cs.unh.edu/cnrg/lin/linuxProject/phase1/serverInfoOptimal
It's pretty interesting that the Average Elapse Time is the same as that in TCP optimal
case. Incredible!!
So actual throughput = 1526*1000000/123.316 = 12374712 Bytes/Sec
It is (12500000 - 12374712)/12500000 = 1.0023% less than the Ideal Theoretical
throughput 100Mb/sec
3.2 Infrastructure Delay
In this section we will find the delay of the infrastructure that we will use to do
experiments. This parameter will also be used in NS (network simulator).
We will use ICMP ping packet with different packet size to find out the packet delay in
our infrastructure.
madrid$ ping -U -c 12 -s requestSize 192.168.2.
Table 3.3 shows the result of ping requests with different ICMP packet request size.
ICMP RequestSize 56byte^ 64Byte^ 128Byte^ 256byte^ 384Byte^ 512Byte^ 640byte^ 768Byte^ 896Byte^ 1024Byte^
1152 Byte 1280Byte^ 1408Byte^ 1472Byte
1st^158 173 197 255 291 351 379 420 473 507 570 587 642
2nd^150 182 222 245 282 333 370 410 453 496 541 593 629
3rd 160 173 197 257 288 327 379 421 468 528 558 636 649 651
4th^174 195 224 239 284 337 376 410 464 501 538 597 666
5th^160 176 202 244 311 321 376 451 468 518 549 585 645
6th^151 189 204 244 286 329 367 413 482 494 538 595 629
7th 163 172 193 263 303 321 375 421 463 506 550 583 639 647
8th^159 179 202 250 284 332 371 420 453 500 540 600 632
9th^157 177 210 247 295 335 399 447 461 508 562 593 651
10th^160 182 215 239 283 332 373 410 453 497 537 591 627
Average 159.2 179.8 206.6 248.3 290.7 331.8 376.5 422.3 463.8 505.5 548.3 596 640.9 656.
Variation 4.2 5.76 8.92 6.36 7.44 5.84 5.5 10.68 7.2 7.9 9.5 9 9.7 5.
Table 3.3 Data from ICMP ping test
Figure 3.1 shows the relation between RTT and packet request size:
RTT = a * Request_Size + b
Figure 3.1 Relations between ICMP Packet Request Size and RTT
In Figure 3.1, we can use the line passing point (256,248.3) and point (1408,640.9) to
approximate this line
RTT = a * Request_Size + b
so
248.3 = a*256 + b
640.9 = a*1408 + b
Solve the above equations, we can get a = 0.3408 , b = 161.
Theoretically,
RTT/2 = delay + 2*(Packet_Size/Rate)
(Packet_Size = Request_size + ICMP header(8) + IP header (20)+Ethernet Wrapper(26) )
Chapter 4 Performance Test Result with Packet Dropper
In this chapter, we will introduce packet dropper, both random dropping version and
regular dropping ve rsion.
4.1 Random Dropping
On receiving each packet, the Dropper checks the destination IP address. If the
destination is the target IP, we get a 16-bit random number, if the random number is less
than the dropping threshold value which is rate *65535, we drop this packet, otherwise,
process it normally.
The random number is generated in this way. Because the assembly instruction “rdtsc” is
specific to Intel processor, this way is only good for it.
Get a CPU cycle
unsigned l, h;
asm volatile("rdtsc": "=a" (l), "=d" (h));
Get the lower 16 bit from the CPU cycle. Swap the lower byte with the higher byte.
In the following calculation:
The AVG refers to the average value of 10 times’ experiments result (either elapse time
or number of packet dropped).
The Var is the variation of the 10 times’ experiment result.
It is: sqrt( ( (t1-avg)2 + (t2-avg)2 + .....+ (t10-avg)**2 )/10) Where t i is the
experiment result (either elapse time or number of packets dropped). And i is 1…10.
The throughput is: 1526*100000/ AVG
Figure 4.1 shows the relation chart of throughput and dropping rate.
Table 4.1 shows the detail data of the test result.
Drop
- Introduction.................................................................................................
- Chapter 1 Linux Network Infrastructure ...............................................
- 1.1 Computer System Information ...................................................................
- 1.2 Network Configuration Information ..........................................................
- 1.2.1 Basic Diagram ................................................................................
- 1.2.2 Static Route Setting........................................................................
- 1.2.3 TCP parameters on the machines ...............................................
- Chapter 2 Tools used in the project ..........................................................
- 2.1 Blast Test Code ............................................................................................
- 2.2 Packet Dropper Code...................................................................................
- 2.3 Proc File System Operation Code...............................................................
- 2.4 Tool used for synchronization ...................................................................
- Chapter 3 Performance Test Result without Packet Dropper ..............
- 3.1 Max Throughput got from the infrastructure........................................
- 3.1.1 Get throughput by TCP blast test.............................................
- 3.1.2 Get throughput by UDP blast test............................................
- 3.2 Infrastructure Delay.................................................................................
- Chapter 4 Performance Test Result with Packet Dropper....................
- 4.1 Random Dropping.....................................................................................
- 4.2 Regular Dropping......................................................................................
- 4.3 Interesting Result on Regular Dropping.................................................
- Chapter 5 Comparison between experimental and simulation result..
- Chapter 6 Future Work.........................................................................
- Chapter 7 Conclusion.............................................................................
- Chapter 8 References.............................................................................
- 0.000 12.32 12.31 12.31 12.31 12.31 12.31 12.31 12.31 12.31 12.31 12.311 0.003 Rate 1st 2nd 3rd 4th 5th 6th 7th 8th 9th 10th AVG VAR Throughput(B/s)
- 0.004 12.58 12.59 12.60 12.78 12.40 12.59 12.79 12.79 12.59 12.59 12.630 0.117
- 0.008 13.63 13.43 13.22 13.92 13.21 13.78 13.81 13.40 14.38 14.37 13.715 0.402
- 0.012 14.93 14.43 16.20 15.59 15.91 16.09 16.76 15.41 15.60 15.98 15.690 0.629
- 0.016 18.21 17.94 16.63 18.59 18.19 15.77 18.68 16.64 18.65 18.91 17.821 1.026
- 0.020 19.03 19.29 21.32 20.36 18.80 20.64 20.73 22.64 21.26 19.39 20.346 1.159
- 0.024 23.72 25.32 22.86 23.00 23.81 26.15 23.38 24.46 22.97 23.08 23.875 1.055
- 0.028 27.50 27.87 30.08 27.19 28.50 31.01 27.45 33.13 32.90 30.96 29.659 2.155
- 0.032 34.62 37.09 35.42 37.10 31.75 33.26 29.71 33.38 35.41 35.08 34.282 2.198
- 0.036 40.21 36.55 38.61 37.46 39.47 36.10 43.48 40.70 39.05 42.04 39.367 2.224
- 0.040 47.50 43.83 49.85 48.76 51.44 50.21 48.39 48.02 51.76 46.92 48.668 2.222
- 0.044 57.63 58.25 56.20 58.41 60.10 57.71 59.47 61.01 63.59 57.05 58.942 2.064
- 0.048 60.53 62.69 60.53 62.10 60.77 64.72 69.53 63.17 61.82 64.32 63.018 2.585
- 0.052 69.94 71.16 77.68 71.36 81.50 78.39 75.87 83.58 80.62 72.28 76.238 4.610
- 0.056 81.00 81.88 87.80 88.41 80.69 83.04 86.63 82.62 82.11 83.47 83.765 2.672
- 0.060 94.69 88.28 85.34 98.35 100.85 91.36 93.02 100.69 91.31 99.59 94.348 5.138
- 0.064 102.81 113.83 112.53 119.74 118.44 107.60 111.76 101.93 108.02 110.67 110.733 5.584
- 0.068 128.40 118.65 107.80 123.88 121.82 122.60 129.09 121.18 132.55 120.71 122.668 6.459
- 0.072 137.22 140.05 129.92 136.85 142.88 138.54 133.10 148.12 135.43 143.60 138.571 5.066
- 0.076 149.76 138.79 158.41 152.24 167.07 154.32 150.96 164.03 154.89 157.76 154.823 7.489
- 0.080 157.50 168.43 172.89 171.53 184.27 166.37 155.31 173.43 160.68 160.15 167.056 8.432
- 0.084 194.28 196.97 186.59 181.34 190.61 189.30 193.47 201.84 206.89 194.90 193.619 6.964
- 0.088 209.22 205.81 224.02 217.21 214.00 216.19 227.36 210.13 207.06 221.41 215.241 6.975
- 0.092 228.31 220.76 224.77 241.97 223.95 229.48 227.43 213.72 205.09 230.78 224.626 9.485
- 0.096 250.06 252.02 270.32 248.97 244.95 237.94 249.31 249.61 266.07 307.15 257.640 18.789
- 0.100 268.61 275.46 280.16 279.69 283.42 268.90 288.08 253.52 274.59 271.92 274.435 9.147
- 0.104 317.36 276.15 307.06 292.50 310.21 326.06 321.80 330.96 318.36 305.04 310.550 15.630
- 0.108 325.51 344.83 340.28 295.20 302.02 334.39 327.88 351.86 285.12 306.06 321.315 21.620
- 0.112 359.97 352.99 353.36 370.75 352.03 347.78 319.44 353.36 346.82 375.23 353.173 14.319
- 0.116 405.68 385.94 393.06 419.70 373.77 391.31 379.12 370.57 368.25 387.88 387.528 15.269
- 0.120 426.30 422.77 401.62 424.46 426.22 376.22 420.19 400.01 418.08 403.23 411.910 15.461
- 0.124 446.80 508.11 445.87 503.94 491.30 440.11 444.95 435.18 460.41 464.42 464.109 25.861
- 0.128 486.39 469.44 539.99 473.81 467.21 535.21 497.34 466.53 506.08 434.08 487.608 31.134
- 0.132 527.16 532.07 586.13 511.39 543.10 536.87 563.76 492.69 491.36 546.67 533.120 28.166
- 0.136 600.00 566.77 558.85 608.03 556.17 592.22 558.70 579.79 570.13 625.97 581.663 22.720
- 0.140 644.62 616.15 631.62 633.08 633.37 624.63 579.93 594.24 594.61 572.06 612.431 24.013
- 0.144 692.91 616.93 645.45 626.70 630.92 643.30 628.59 767.10 695.61 683.01 663.052 44.209
- 0.148 720.46 696.01 706.25 703.32 717.07 744.12 728.69 675.32 713.80 724.99 713.003 18.108