NS2 Assignment #4 ECE6607 Fall 2010 Marion Le Borgne
Turn out : 1. 2. 3. 4. 5. Ns source code Scripts (awk, perl, gnuplot) Results Plots Brief explanations
A. No packet loss Answers to section A : 1. Plots General behavior of TCP Tahoe
slow start Regions (exponentials)
Congestion avoidance Regions (lines)
2. General behavior of TCP Reno
Congestion Avoidance (strait lines)
Slow start regions (exponentials)
3. Slow-start and congestion avoidance regions are labelled by hand on the plots “cwnd VS time” Strait lines correspond to congestion avoidance regions Exponential parts corespond to slow-start regions. 4. What difference(s) do you observe between TCP Tahoe and TCP RENO congestion window? At first, there’s no difference difference between TCP Tahoe and TCP Reno. Indeed, both Reno and Tahoe start by sending an Synsignal. Then the servers replies with an ACK. And Both Reno and Tahoe will go into slow start phase. When tcongestion occurs, TCP reno and tahoe begin to behave differently : Reno will go only one time into the slow start phase, contraty to tahoe that does it twice beforre beginin the congestion avoidance phase.
5. If you cut in half the bandwidth delay product (by reducing the delay from 100 to 50 ms) what happens to the maximum value of the cwnd (is is bigger or smaller)? The maximal value of cwnd is smaller. It is logical that maximum value of the congestion windows decreases since it is a gess of the maximum throughput. It the throughput decraeses, the congestions window has to be smaller. To get these results I used the following codes and scripts. PART 1 is for the general behaviour of TCP TAHOE, and PART 2 is for TCP RENO
The Term Paper on Lake Tahoe And The Growing Importance For Environmental Preservation
Lake Tahoe, an enormous expanse of clear, blue, fresh water surrounded by meadows and dense forests and rimmed by snow-capped peaks, is one of the world's great scenic and ecological wonders. Tahoe's water is world famous for its amazing clarity. Even today, one can see objects 70 feet below the surface, a clarity matched almost nowhere in the world. The Tahoe Basin had a slowly evolving and ...
Part 1: General behavior of TCP Tahoe
Codes and scripts of these part are made to generate plots of Sequence number VS time, Ack number VS time, Cwnd VS time. There are four steps : NS code, Awk scripts (to parse the trace file), Gnuplot scripts (ploting), and finally the runscript. Step 1 : NS code It’s the code modified from Ning Shang. Modifiacations in bold. set ns [new Simulator] set nf [open “nam.out” w] set trace [open “trace.tr” w] $ns namtrace-all $nf $ns trace-all $trace proc finish {} { global ns nf trace $ns flush-trace close $nf close $trace exit 1 } set router1 [$ns node] set router2 [$ns node]
$ns duplex-link $router1 $router2 .2Mb 50ms DropTail
set tcpSender1 [$ns create-connection TCP $router1 TCPSink $router2 0] set ftpSender1 [new Application/FTP] $ftpSender1 attach-agent $tcpSender1 #window size, packet size, queue size set window 64 set packetsize 64 set queuesize 10 Agent/TCP set window_ $window Agent/TCP set packetSize_ $packetsize $ns queue-limit $router1 $router2 $queuesize
$ns add-agent-trace $tcpSender1 tcpSender1 $ns monitor-agent-trace $tcpSender1 $tcpSender1 tracevar cwnd_ $ns at 0.0 “$ftpSender1 start” $ns at 50 “finish” $ns run Step 2 : awk scripts I parsed the simulation output ”trace.tr” for ploting . I made 3 awk scripts to get : • • • Sequence Number and sent time. Parsed with awk in “SeqNb.tr” Ack Number and ACK time received. Parsed with awk in “AckNb.tr” Congestion window and time. Parsed with awk in “cwnd.tr” Sequence number #!/usr/bin/awk -f BEGIN { } {
•
if ($5==”ack”&& $1==”r”) { print $2,$11 } } END { print $2,$11 } • ACK number #!/usr/bin/awk -f BEGIN { } { if ($5==”tcp”&& $1==”+”) { print $2,$11 } } END { print $2,$11 } • Congestion window #!/usr/bin/awk -f BEGIN { } { print $1,$7 } END { print $1,$7 } Step 3 : gnuplot scripts • set set set set Sequence Number VS time term gif title “Sequence Number vs Time” xlabel “Time (s)” ylabel ” Sequence Number”
The Essay on A Favorite Place I Like To Spend Time
A Favorite Place I Like to Spend Time Sometimes, when I feel tired and exhausted, I need a place for relaxation. Although there are many places, where one can feel relaxed, such as reading in a library with a cup of coffee, or sitting in a comfortable chair, covered with a cozy warm rug, holding a cup of fresh hot tea with scents of flowers, herbs, and jasmine and looking through the window, where ...
set output “SeqNb.gif” plot “SeqNb.tr” with lines • ACK Number VS time
set term gif set title “ACK Number vs Time” set xlabel “Time (s)” set ylabel ” ACK Number” set output “AckNb.gif” plot “AckNb.tr” with lines • Congestion Window vs Time
set term gif set title “Congestion window vs Time” set xlabel “Time (s)” set ylabel ” congestion window” set output “cwnd.gif” plot “cwnd.tr” with lines Step 4 : Runscript : #!/bin/bash #exectution of ns code (lab4.tcl) ns lab4.tcl #Parsing the tracefile for gnuplot ./SeqNb.awk trace.tr > SeqNb.tr ./AckNb.awk trace.tr > AckNb.tr grep ‘ cwnd_ ‘ nam.out > cwnd_data ./cwnd.awk cwnd_data > cwnd.tr #Ploting with gnuplot gnuplot SeqNb.gp gnuplot AckNb.gp gnuplot cwnd.gp
Part 2: General behavior of TCP Reno
In this part I generate plots of Sequence number versus time , Ack number versus time , Cwnd versus time. Scripts and code are almost the same as in part 1: • • • • NS code : slightly modified (see below) Awk scripts : not modified Gnuplot scripts : not modified Runscript : not modified
NS code I just replaced TCP/Tahoe by TCP in the code (in bold) #assignment4_part1.tcl #tcp tahoe cwnd analysis #code modified from Ning Shang set ns [new Simulator] set nf [open “nam.out” w] set trace [open “trace.tr” w] $ns namtrace-all $nf $ns trace-all $trace proc finish {} { global ns nf trace $ns flush-trace close $nf close $trace exit 1 } set router1 [$ns node] set router2 [$ns node] $ns duplex-link $router1 $router2 .2Mb 50ms DropTail
set tcpSender1 [$ns create-connection TCP $router1 TCPSink
$router2 0] set ftpSender1 [new Application/FTP] $ftpSender1 attach-agent $tcpSender1 #window size, packet size, queue size set window 64 set packetsize 64 set queuesize 10 Agent/TCP set window_ $window Agent/TCP set packetSize_ $packetsize $ns queue-limit $router1 $router2 $queuesize
The Term Paper on Running Wwp Price Game Windows
EUROPEAN SUPPLEMENTARY DOCUMENTATION 3 rd November 2000 Version 1. 0 Worms World Party and WWP Copyright (c) 2000 Team 17 Software Ltd All rights reserved Marketing / Distribution by Focus Multimedia Ltd Worms World Party official web site at web > Worms World Party automated email FAQ at Focus Multimedia official web site at web > Note: All web site and email support documents are in ...
$ns add-agent-trace $tcpSender1 tcpSender1 $ns monitor-agent-trace $tcpSender1 $tcpSender1 tracevar cwnd_ $ns at 0.0 “$ftpSender1 start” $ns at 50 “finish” $ns run
Step 2, step 3, and step 4 are the same than in Part 1
B. Now adding in packet loss show the general behavior of TCP As proposed, I added the following lines in the ns code “TCP Tahoe” and “TCP Reno”. #create a loss_module set lossmod [new ErrorModel] $lossmod set rate_ .001 $lossmod unit pkt $lossmod ranvar [new RandomVariable/Uniform]
#insert loss mudule between nodes $lossmod drop-target [new Agent/Null] set LossLink [$ns link $router1 $router2] $LossLink install-error $lossmod Then, it’s exactly the same steps than in paragraph A. I parsed tracefiles with awk scripts and plotted “Sequence VS time”, “Ack Number VS time”, and “Congestion Window VS time” with the same gnuplot scripts
Answers to section B 6. Plots TCP Reno
Slow start Congestion avoidance
TCP TAHOE
Slow start
Congestion avoidance
7. Slow-start and congestion avoidance regions. What difference(s) do you observe between TCP Tahoe and TCP RENO congestion window? The plot below s hows how the congestion window behaves for Tcp Reno in case of a packet drop. Again, exponential regions corespond to slow-start regions. And lines, to congestion avoidance regions.
For TCP Tahoe, when a packet drops o ccurs, thenit will go over slow start from scratch. Contrary to TCP Reno that implements a fast recovery phase and doesn’t go over slow-start from sratch.
8. If you cut in half the bandwidth delay product (by reducing the delay from 100 to 50 ms) what happens to the maximum value of the cwnd (is is bigger or smaller)? It decreases for the same reason (part 1 : The maximal value of cwnd is smaller. It is logical that maximum value of the congestion windows decreases since it is a gess of the maximum throughput. It the throughput decraeses, the congestions window has to be smaller)
C.
Define goodput as the number of packets received per second
Answers :
1. Plot goodput in packets/second versus RTT in milliseconds for TCP Reno with a fixed loss probability of 0.001 Also put on the same plot the values from the equation. How well does the equation model the goodput as compared to the simulation? The equation for the good put models well the simulation goodput
The Term Paper on Sequence Number Tcp Data Kernel
(Taken from ph rack. com, the best Hacker zine ever) Defeating Sniffers and Intrusion Detection Systems Overview The purpose of this article is to demonstrate some techniques that can be used to defeat sniffers and intrusion detection systems. This article focuses mainly on confusing your average 'hacker's sniffer, with some rough coverage of Intrusion Detection Systems (IDS). However, the methods ...
2. Plot the goodput in packets/second versus loss probability for TCP Reno for a fixed RTT of 30 ms. Also put on the same plot the values from the equation. How well does the equation model the goodput as compared to the simulation? Again, The equation for the good put models well the simulation goodput
3. Why does goodput become lower and lower with increased loss probability? When loss probability increases, more and more packets are lost. Therefore the goodput decreases. Less packets are sucessfully transmitted.
Scripts and codes : – ns code – PERL scripts – gnuplot scripts – runscript NS CODE # code modified from Ning Shang set ns [new Simulator] #input arguments : delay and [loss probability]*100. these variables are going to be modified through an awk script to plot [RTT vs Goodput] and [Loss probability vs Goodput]
set delay [lindex $argv 0] set errprob [lindex $argv 1] # Rq:errprob varies from 1 to 100 => eb varies from 0.001 to 1 #using script, will increment errprob thus changing eb in steps of.001 set eb [ expr .001 * $errprob ] set rtt [ expr 2 * $delay] #Set advertised window large enough so does not affect results Agent/TCP set window_ 128 proc finish {} { global tcpSender1 rtt eb set ackRcvd [$tcpSender1 set ack_]; puts “RTT(ms) $rtt errorProb $eb time 40.0 ack $ackRcvd goodput [expr $ackRcvd/40.0]” exit 0 } #Set losses set lossmod [new ErrorModel] $lossmod set rate_ $eb $lossmod unit pkt $lossmod ranvar [new RandomVariable/Uniform] $lossmod drop-target [new Agent/Null] #Create routers, links, etc. set router1 [$ns node] set router2 [$ns node] $ns duplex-link $router1 $router2 10Mb $delayms DropTail set LossLink [$ns link $router1 $router2] $LossLink install-error $lossmod set tcpSender1 [$ns create-connection TCP/Reno $router1 TCPSink $router2 0] set ftpSender1 [new Application/FTP] #window size $tcpSender1 set window_ 128 $ftpSender1 attach-agent $tcpSender1 $ns add-agent-trace $tcpSender1 tcpSender1 $ns monitor-agent-trace $tcpSender1 $tcpSender1 tracevar cwnd_ $ns at 0.1 “$ftpSender1 start” $ns at 40.0 “finish”
$ns at 40.5 “exit 0” $ns run PERL SCRIPT “renotcp_Reb001.pl” #!/usr/bin/perl BEGIN {} { #Ns simulation with variable RTT and fixed Loss Probability. Results will be saved in “renotcp_RTT30ms.tr” after execution of this script #Loss proba=0.001 => eb=1 (remember ns code “ns Lab4c.tcl ” ) for ($d=15; $d RTT =30ms ) (remember ns code “ns Lab4c.tcl “
The Term Paper on Nutrition Weight Loss
Introduction Nutrition plays a very important role in our lives, it could help to extend or decrease our life span as well as define our degree of livelihood as we progress into old age. With our potential to live longer than ever before comes the urgent need to monitor and adjust the amounts, the types of food and supplements that we ingest into our bodies. Proper nutrition in our early years ...
for ($l=1; $lrenotcp_rtt30ms.tr #Perl script. Save simulation for “tcpreno_eb001.tr” ./renotcp_eb001.pl>renotcp_eb001.tr #Gnuplot scripts : plots printing gnuplot renotcp_eb001.gp gnuplot renotcp_rtt30ms.gp a variable RTT in file