From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lb0-x236.google.com (mail-lb0-x236.google.com [IPv6:2a00:1450:4010:c04::236]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by huchra.bufferbloat.net (Postfix) with ESMTPS id 70C9321F358 for ; Thu, 19 Feb 2015 06:48:07 -0800 (PST) Received: by lbjb6 with SMTP id b6so246838lbj.2 for ; Thu, 19 Feb 2015 06:48:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=wxPPrF+twnXPh0nq5sawF4jDZUrHDJiDv4stsg3e5Q0=; b=G21M4/TCVx++WJMDQ3w0KCMlgTwcZV/GJl7LALyNTrV9nJS4+l0BmBU2h+YwqMrF4W 5uS5zog9iabPpuUb+/G9p7P+xIh7fwzoDyKR6Nw37uA8KSB9q5uviuS4Y8bkQA5z7FFf pWTRP7VDrYsaYBbU2fFyB8Uqb4xSbu6AWPpweqDHBPgxb+62Xw7hlNaPLBp4UiZkpR+W 0E3l9SW/w/D8+noZy52LithDRSc+9Waj7HnpEtLeXnHbT5guDwoj49ym6F6id4gJuhn6 T60u3y5++O95FALBqEPSksISdSvTDqUxuKSlA33WiMNsb2XiWLxtAsSOLrhdjcuO/Ftg 3hhw== MIME-Version: 1.0 X-Received: by 10.152.181.196 with SMTP id dy4mr4215808lac.45.1424357284905; Thu, 19 Feb 2015 06:48:04 -0800 (PST) Received: by 10.112.98.138 with HTTP; Thu, 19 Feb 2015 06:48:04 -0800 (PST) In-Reply-To: References: Date: Thu, 19 Feb 2015 06:48:04 -0800 Message-ID: From: Anjali Chawla To: codel@lists.bufferbloat.net Content-Type: multipart/alternative; boundary=001a11340efc0009a4050f72063d Subject: Re: [Codel] Codel Digest, Vol 29, Issue 2 X-BeenThere: codel@lists.bufferbloat.net X-Mailman-Version: 2.1.13 Precedence: list List-Id: CoDel AQM discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Feb 2015 14:48:38 -0000 --001a11340efc0009a4050f72063d Content-Type: text/plain; charset=UTF-8 okay Thanks a lot :) On Thu, Feb 19, 2015 at 6:18 AM, wrote: > Send Codel mailing list submissions to > codel@lists.bufferbloat.net > > To subscribe or unsubscribe via the World Wide Web, visit > https://lists.bufferbloat.net/listinfo/codel > or, via email, send a message with subject or body 'help' to > codel-request@lists.bufferbloat.net > > You can reach the person managing the list at > codel-owner@lists.bufferbloat.net > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Codel digest..." > > > Today's Topics: > > 1. [Reply] tcl code of CoDel (Anjali Chawla) (Mohit P. Tahiliani) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Thu, 19 Feb 2015 19:48:09 +0530 > From: "Mohit P. Tahiliani" > To: codel@lists.bufferbloat.net > Subject: [Codel] [Reply] tcl code of CoDel (Anjali Chawla) > Message-ID: > < > CA+4Fxsi4R_FJJD1Q3zA+sRYdG1RzAmGt8Z0V6bxgn4YB3BGQxQ@mail.gmail.com> > Content-Type: text/plain; charset="utf-8" > > Hi Anjali, > > You can test CoDel on wired as well as wireless networks. > > CoDel's code is available for Linux, ns-2 and ns-3. > > See the following link for more details: > > http://www.bufferbloat.net/projects/codel/wiki/Wiki/#Simulations > > Hope it helps. > > Best Regards, > Mohit P. Tahiliani > > On Thu, Feb 19, 2015 at 12:50 PM, > wrote: > > > Send Codel mailing list submissions to > > codel@lists.bufferbloat.net > > > > To subscribe or unsubscribe via the World Wide Web, visit > > https://lists.bufferbloat.net/listinfo/codel > > or, via email, send a message with subject or body 'help' to > > codel-request@lists.bufferbloat.net > > > > You can reach the person managing the list at > > codel-owner@lists.bufferbloat.net > > > > When replying, please edit your Subject line so it is more specific > > than "Re: Contents of Codel digest..." > > > > > > Today's Topics: > > > > 1. tcl code of CoDel (Anjali Chawla) > > 2. Codel code (kanu monga) > > > > > > ---------------------------------------------------------------------- > > > > Message: 1 > > Date: Thu, 19 Feb 2015 11:59:50 +0530 > > From: Anjali Chawla > > To: codel@lists.bufferbloat.net > > Subject: [Codel] tcl code of CoDel > > Message-ID: > > > qYsjQ@mail.gmail.com> > > Content-Type: text/plain; charset="utf-8" > > > > Hi > > i want to know can we test CoDel with wired network??? > > or should we go for wireless only??? > > anybody please reply because i am new to all this. > > your suggestions can help me in taking one step further. > > Thanks > > -------------- next part -------------- > > An HTML attachment was scrubbed... > > URL: < > > > https://lists.bufferbloat.net/pipermail/codel/attachments/20150219/5c072359/attachment-0001.html > > > > > > > ------------------------------ > > > > Message: 2 > > Date: Thu, 19 Feb 2015 12:49:34 +0530 > > From: kanu monga > > To: codel@lists.bufferbloat.net > > Subject: [Codel] Codel code > > Message-ID: > > > H0fB3+g@mail.gmail.com> > > Content-Type: text/plain; charset="utf-8" > > > > is there anyone who can help me in understanding tcl code of codel(given > > below) > > This one is quite complex for me. > > please help if you can. > > Thanks in advance. > > > > ################################################################### > > > > > > # ns codel.tcl f w c {b}Mb s d r > > # where: > > # f = # ftps > > # w = # PackMime connections per second > > # c = # CBRs > > # b = bottleneck bandwidth in Mbps > > # s = filesize for ftp, -1 for infinite > > # d = dynamic bandwidth, if non-zero, changes (kind of kludgey) > > # have to set the specific change ratios in this file (below) > > # r = number of "reverse" ftps > > > > set stopTime 300 > > set ns [new Simulator] > > > > # These are defaults if values not set on command line > > > > set num_ftps 1 > > set web_rate 0 > > set revftp 0 > > set num_cbrs 0 > > #rate and packetSize set in build_cbr > > set bottleneck 3Mb > > #for a 10MB ftp > > set filesize 10000000 > > set dynamic_bw 0 > > set greedy 0 > > > > # Parse command line > > > > if {$argc >= 1} { > > set num_ftps [lindex $argv 0] > > if {$argc >= 2} { > > set web_rate [lindex $argv 1] > > if {$argc >= 3} { > > set num_cbrs [lindex $argv 2] > > if {$argc >= 4} { > > set bottleneck [lindex $argv 3] > > if {$argc >= 5} { > > set filesize [lindex $argv 4] > > if {$argc >= 6} { > > set dynamic_bw [lindex $argv 5] > > if {$argc >= 7} { > > set revftp [lindex $argv 6] > > } > > } > > } > > } > > } > > } > > } > > > > set bw [bw_parse $bottleneck] > > if { $revftp >= 1} { > > set num_revs $revftp > > } else { > > set num_revs 0 > > } > > puts "ftps $num_ftps webrate $web_rate cbrs $num_cbrs bw $bw filesize > > $filesize reverse $num_revs" > > > > # experiment settings > > set psize 1500 > > if { $bw < 1000000} { set psize 500 } > > set nominal_rtt [delay_parse 100ms] > > set accessdly 20 > > set bdelay 10 > > set realrtt [expr 2*(2*$accessdly + $bdelay)] > > puts "accessdly $accessdly bneckdly $bdelay realrtt $realrtt bneckbw $bw" > > > > # CoDel values > > # interval to keep min over > > set interval [delay_parse 100ms] > > # target in ms. > > set target [delay_parse 5ms] > > > > global defaultRNG > > $defaultRNG seed 0 > > ns-random 0 > > #$defaultRNG seed 54321 > > #ns-random 23145 > > > > # ------- config info is all above this line ---------- > > > > #bdp in packets, based on the nominal rtt > > set bdp [expr round($bw*$nominal_rtt/(8*$psize))] > > > > Trace set show_tcphdr_ 1 > > set startTime 0.0 > > > > #TCP parameters - have to set both for FTPs and PackMime > > > > Agent/TCP set window_ [expr $bdp*16] > > Agent/TCP set segsize_ [expr $psize-40] > > Agent/TCP set packetSize_ [expr $psize-40] > > Agent/TCP set windowInit_ 4 > > Agent/TCP set segsperack_ 1 > > Agent/TCP set timestamps_ true > > set delack 0.4 > > Agent/TCP set interval_ $delack > > > > Agent/TCP/FullTcp set window_ [expr $bdp*16] > > Agent/TCP/FullTcp set segsize_ [expr $psize-40] > > Agent/TCP/FullTcp set packetSize_ [expr $psize-40] > > Agent/TCP/FullTcp set windowInit_ 4 > > Agent/TCP/FullTcp set segsperack_ 1 > > Agent/TCP/FullTcp set timestamps_ true > > Agent/TCP/FullTcp set interval_ $delack > > > > > > Agent/TCP/Linux instproc done {} { > > global ns filesize > > #this doesn't seem to work, had to hack tcp-linux.cc to do repeat ftps > > $self set closed_ 0 > > #needs to be delayed by at least .3sec to slow start > > puts "[$ns now] TCP/Linux proc done called" > > $ns at [expr [$ns now] + 0.3] "$self send $filesize" > > } > > > > # problem is that idle() in tcp.cc never seems to get called... > > Application/FTP instproc resume {} { > > puts "called resume" > > global filesize > > $self send $filesize > > # $ns at [expr [$ns now] + 0.5] "[$self agent] reset" > > $ns at [expr [$ns now] + 0.5] "[$self agent] send $filesize" > > } > > > > Application/FTP instproc fire {} { > > global filesize > > $self instvar maxpkts_ > > set maxpkts_ $filesize > > [$self agent] set maxpkts_ $filesize > > $self send $maxpkts_ > > puts "fire() FTP" > > } > > > > #buffersizes > > set buffersize [expr $bdp] > > set buffersize1 [expr $bdp*10] > > > > Queue/CoDel set target_ $target > > Queue/CoDel set interval_ $interval > > > > #set Flow_id 1 > > > > proc build_topology { ns } { > > # nodes n0 and n1 are the server and client side gateways and > > # the link between them is the congested slow link. n0 -> n1 > > # handles all the server to client traffic. > > # > > # if the web_rate is non-zero, node n2 will be the packmime server > > cloud > > # and node n3 will be the client cloud. > > # > > # num_ftps server nodes and client nodes are created for the ftp > > sessions. > > # the first client node is n{2+w} and the first server node is > n{2+f+w} > > # where 'f' is num_ftps and 'w' is 1 if web_rate>0 and 0 otherwise. > > # servers will be even numbered nodes, clients odd > > # Warning: the numbering here is ridiculously complicated > > > > global bw bdelay accessdly buffersize buffersize1 filesize node_cnt > > set node_cnt 2 > > > > # congested link > > global n0 n1 > > set n0 [$ns node] > > set n1 [$ns node] > > $ns duplex-link $n0 $n1 $bw ${bdelay}ms CoDel > > $ns duplex-link-op $n0 $n1 orient right > > $ns duplex-link-op $n0 $n1 queuePos 0.5 > > $ns duplex-link-op $n1 $n0 queuePos 1.5 > > $ns queue-limit $n0 $n1 $buffersize > > $ns queue-limit $n1 $n0 $buffersize > > set node_cnt 2 > > > > #dynamic bandwidth > > # these are the multipliers for changing bw, times initial set bw > > # edit these values to get different patterns > > global stopTime dynamic_bw > > array names bw_changes > > set bw_changes(1) 0.1 > > set bw_changes(2) 0.01 > > set bw_changes(3) 0.5 > > set bw_changes(4) 0.01 > > set bw_changes(5) 1.0 > > > > puts "bottleneck starts at [[[$ns link $n0 $n1] link] set > > bandwidth_]bps" > > for {set k 1} {$k <= $dynamic_bw} {incr k 1} { > > set changeTime [expr $k*$stopTime/($dynamic_bw+1)] > > set f $bw_changes($k) > > set newBW [expr $f*$bw] > > puts "change at $changeTime to [expr $newBW/1000000.]Mbps" > > $ns at $changeTime "[[$ns link $n0 $n1] link] set bandwidth_ $newBW" > > $ns at $changeTime "[[$ns link $n1 $n0] link] set bandwidth_ $newBW" > > $ns at $changeTime "puts $newBW" > > } > > > > set li_10 [[$ns link $n1 $n0] queue] > > set li_01 [[$ns link $n0 $n1] queue] > > > > set tchan_ [open /tmp/redqvar.tr w] > > $li_01 trace curq_ > > $li_01 trace d_exp_ > > $li_01 attach $tchan_ > > > > global num_ftps web_rate num_cbrs greedy num_revs > > set linkbw [expr $bw*10] > > > > set w [expr $web_rate > 0] > > if {$w} { > > global n2 n3 > > #server > > set n2 [$ns node] > > $ns duplex-link $n2 $n0 $linkbw ${accessdly}ms DropTail > > $ns queue-limit $n2 $n0 $buffersize1 > > $ns queue-limit $n0 $n2 $buffersize1 > > > > #client > > set n3 [$ns node] > > $ns duplex-link $n1 $n3 $linkbw ${accessdly}ms DropTail > > $ns queue-limit $n1 $n3 $buffersize1 > > $ns queue-limit $n3 $n1 $buffersize1 > > set node_cnt 4 > > } > > #need to fix the angles if use nam > > for {set k 0} {$k < $num_ftps} {incr k 1} { > > # servers > > set j $node_cnt > > global n$j > > set n$j [$ns node] > > if {$greedy > 0 && $k == 0} { > > $ns duplex-link [set n$j] $n0 $linkbw 1ms DropTail > > } else { > > $ns duplex-link [set n$j] $n0 $linkbw ${accessdly}ms DropTail > > } > > $ns queue-limit [set n$j] $n0 $buffersize1 > > $ns queue-limit $n0 [set n$j] $buffersize1 > > set angle [expr $num_ftps>1? 0.75+($k-1)*.5/($num_ftps-1) : 1] > > $ns duplex-link-op $n0 [set n$j] orient $angle > > incr node_cnt > > > > # clients > > set j $node_cnt > > global n$j > > set n$j [$ns node] > > set dly [expr ${accessdly} +($k+1)] > > $ns duplex-link $n1 [set n$j] $linkbw ${dly}ms DropTail > > $ns queue-limit $n1 [set n$j] $buffersize1 > > $ns queue-limit [set n$j] $n1 $buffersize1 > > set angle [expr $num_ftps>1? fmod(2.25-($k-1)*.5/($num_ftps-1), > 2) > > : 0] > > $ns duplex-link-op $n1 [set n$j] orient $angle > > incr node_cnt > > } > > for {set k 0} {$k < $num_cbrs} {incr k 1} { > > # servers > > set j $node_cnt > > global n$j > > set n$j [$ns node] > > $ns duplex-link [set n$j] $n0 $linkbw ${accessdly}ms DropTail > > $ns queue-limit [set n$j] $n0 $buffersize1 > > $ns queue-limit $n0 [set n$j] $buffersize1 > > # set angle [expr $num_cbrs>1? 0.75+($k-1)*.5/($num_cbrs-1) : 1] > > $ns duplex-link-op $n0 [set n$j] orient $angle > > incr node_cnt > > > > # clients > > set j $node_cnt > > global n$j > > set n$j [$ns node] > > $ns duplex-link $n1 [set n$j] $linkbw ${accessdly}ms DropTail > > $ns queue-limit $n1 [set n$j] $buffersize1 > > $ns queue-limit [set n$j] $n1 $buffersize1 > > # set angle [expr $num_cbrs>1? fmod(2.25-($k-1)*.5/($num_ftps-1), > 2) > > : 0] > > $ns duplex-link-op $n1 [set n$j] orient $angle > > incr node_cnt > > } > > #reverse direction ftps > > for {set k 0} {$k < $num_revs} {incr k 1} { > > # clients > > set j $node_cnt > > global n$j > > set n$j [$ns node] > > $ns duplex-link [set n$j] $n0 $linkbw ${accessdly}ms DropTail > > $ns queue-limit [set n$j] $n0 $buffersize1 > > $ns queue-limit $n0 [set n$j] $buffersize1 > > set angle [expr $num_ftps>1? 0.75+($k-1)*.5/($num_ftps-1) : 1] > > $ns duplex-link-op $n0 [set n$j] orient $angle > > incr node_cnt > > > > # servers > > set j $node_cnt > > global n$j > > set n$j [$ns node] > > set dly [expr ($accessdly)*1.1 +($k+1)] > > $ns duplex-link $n1 [set n$j] $linkbw ${dly}ms DropTail > > $ns queue-limit $n1 [set n$j] $buffersize1 > > $ns queue-limit [set n$j] $n1 $buffersize1 > > set angle [expr $num_ftps>1? fmod(2.25-($k-1)*.5/($num_ftps-1), > 2) > > : 0] > > $ns duplex-link-op $n1 [set n$j] orient $angle > > incr node_cnt > > } > > } > > > > proc build_cbr {cnd snd startTime timeToStop Flow_id} { > > global ns > > set udp [$ns create-connection UDP $snd LossMonitor $cnd $Flow_id] > > set cbr [new Application/Traffic/CBR] > > $cbr attach-agent $udp > > # change these for different types of CBRs > > $cbr set packetSize_ 100 > > $cbr set rate_ 0.064Mb > > $ns at $startTime "$cbr start" > > $ns at $timeToStop "$cbr stop" > > } > > > > # cnd is client node, snd is server node > > proc build_ftpclient {cnd snd startTime timeToStop Flow_id} { > > > > global ns filesize greedy revftp > > set ctcp [$ns create-connection TCP/Linux $snd TCPSink/Sack1 $cnd > > $Flow_id] > > $ctcp select_ca cubic > > set ftp [$ctcp attach-app FTP] > > $ftp set enableResume_ true > > $ftp set type_ FTP > > > > #set up a single infinite ftp with smallest RTT > > if {$greedy > 0 || $filesize < 0} { > > $ns at $startTime "$ftp start" > > set greedy 0 > > } else { > > $ns at $startTime "$ftp send $filesize" > > } > > $ns at $timeToStop "$ftp stop" > > } > > > > proc build_webs {cnd snd rate startTime timeToStop} { > > set CLIENT 0 > > set SERVER 1 > > > > # SETUP PACKMIME > > set pm [new PackMimeHTTP] > > $pm set-TCP Sack > > $pm set-client $cnd > > $pm set-server $snd > > $pm set-rate $rate; # new connections per second > > $pm set-http-1.1; # use HTTP/1.1 > > > > # create RandomVariables > > set flow_arrive [new RandomVariable/PackMimeHTTPFlowArrive $rate] > > set req_size [new RandomVariable/PackMimeHTTPFileSize $rate $CLIENT] > > set rsp_size [new RandomVariable/PackMimeHTTPFileSize $rate $SERVER] > > > > # assign RNGs to RandomVariables > > $flow_arrive use-rng [new RNG] > > $req_size use-rng [new RNG] > > $rsp_size use-rng [new RNG] > > > > # set PackMime variables > > $pm set-flow_arrive $flow_arrive > > $pm set-req_size $req_size > > $pm set-rsp_size $rsp_size > > > > global ns > > $ns at $startTime "$pm start" > > $ns at $timeToStop "$pm stop" > > } > > > > proc uniform {a b} { > > expr $a + (($b- $a) * ([ns-random]*1.0/0x7fffffff)) > > } > > > > proc finish {} { > > global ns > > $ns halt > > $ns flush-trace > > exit 0 > > } > > > > # $ns namtrace-all [open out.nam w] > > # $ns color 2 blue > > # $ns color 3 red > > # $ns color 4 yellow > > # $ns color 5 green > > > > build_topology $ns > > > > #$ns trace-queue $n0 $n1 [open out_n0ton1.tr w] > > #set fname f${num_ftps}w${web_rate}b${bottleneck}.tr > > set fname f.tr > > puts $fname > > $ns trace-queue $n0 $n1 [open /tmp/$fname w] > > #reverse direction > > #$ns trace-queue $n1 $n0 [open /tmp/$fname w] > > > > set node_cnt 2 > > if {$web_rate > 0} { > > build_webs $n3 $n2 $web_rate 0 $stopTime > > set node_cnt 4 > > } > > > > for {set k 1} {$k <= $num_ftps} {incr k 1} { > > set j $node_cnt > > incr node_cnt > > set i $node_cnt > > build_ftpclient [set n$i] [set n$j] \ > > $startTime $stopTime $i > > # [expr 1.0*($k-1)] $stopTime $i > > # [expr $startTime+($k-1)*[uniform 0.0 2.0]] $stopTime $i > > incr node_cnt > > } > > > > for {set k 1} {$k <= $num_cbrs} {incr k 1} { > > set j $node_cnt > > incr node_cnt > > set i $node_cnt > > build_cbr [set n$i] [set n$j] \ > > [expr $startTime+($k-1)*[uniform 0.0 2.0]] $stopTime $i > > incr node_cnt > > } > > > > #for reverse direction, give client smaller number > > for {set k 1} {$k <= $num_revs} {incr k 1} { > > set j $node_cnt > > incr node_cnt > > set i $node_cnt > > build_ftpclient [set n$j] [set n$i] $startTime $stopTime $j > > incr node_cnt > > } > > > > $ns at [expr $stopTime ] "finish" > > $ns run > > exit 0 > > ################################################################### > > -------------- next part -------------- > > An HTML attachment was scrubbed... > > URL: < > > > https://lists.bufferbloat.net/pipermail/codel/attachments/20150219/e21c3125/attachment.html > > > > > > > ------------------------------ > > > > _______________________________________________ > > Codel mailing list > > Codel@lists.bufferbloat.net > > https://lists.bufferbloat.net/listinfo/codel > > > > > > End of Codel Digest, Vol 29, Issue 1 > > ************************************ > > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > https://lists.bufferbloat.net/pipermail/codel/attachments/20150219/b67e540c/attachment.html > > > > ------------------------------ > > _______________________________________________ > Codel mailing list > Codel@lists.bufferbloat.net > https://lists.bufferbloat.net/listinfo/codel > > > End of Codel Digest, Vol 29, Issue 2 > ************************************ > --001a11340efc0009a4050f72063d Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
okay Thanks a lot
:)

On Thu, Feb 19, 2015 at 6:18 AM, <codel-request@lists.bufferbloat.net> wrote:
Send Codel mailing list submissions to
=C2=A0 =C2=A0 =C2=A0 =C2=A0 = codel@lists.bufferbloat.net

To subscribe or unsubscribe via the World Wide Web, visit
=C2=A0 =C2=A0 =C2=A0 =C2=A0 https://lists.bufferbloat.net/listinfo/codel
or, via email, send a message with subject or body 'help' to
=C2=A0 =C2=A0 =C2=A0 =C2=A0
codel-request@lists.bufferbloat.net

You can reach the person managing the list at
=C2=A0 =C2=A0 =C2=A0 =C2=A0 codel-owner@lists.bufferbloat.net

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Codel digest..."


Today's Topics:

=C2=A0 =C2=A01. [Reply] tcl code of CoDel (Anjali Chawla) (Mohit P. Tahilia= ni)


----------------------------------------------------------------------

Message: 1
Date: Thu, 19 Feb 2015 19:48:09 +0530
From: "Mohit P. Tahiliani" <tahiliani.nitk@gmail.com>
To: codel@lists.bufferbloat.= net
Subject: [Codel] [Reply] tcl code of CoDel (Anjali Chawla)
Message-ID:
=C2=A0 =C2=A0 =C2=A0 =C2=A0 <CA+4Fxsi4R_FJJD1Q3zA+sRYdG1R= zAmGt8Z0V6bxgn4YB3BGQxQ@mail.gmail.com>
Content-Type: text/plain; charset=3D"utf-8"

Hi Anjali,

You can test CoDel on wired as well as wireless networks.

CoDel's code is available for Linux, ns-2 and ns-3.

See the following link for more details:

http://www.bufferbloat.net/projects/codel/wiki/Wiki/#Si= mulations

Hope it helps.

Best Regards,
Mohit P. Tahiliani

On Thu, Feb 19, 2015 at 12:50 PM, <codel-request@lists.bufferbloat.net>
wrote:

> Send Codel mailing list submissions to
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0codel@lists.bufferbloat.net
>
> To subscribe or unsubscribe via the World Wide Web, visit
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0https://lists.bufferbloat.net/listinf= o/codel
> or, via email, send a message with subject or body 'help' to >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0codel-request@lists.bufferbloat.net
>
> You can reach the person managing the list at
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0codel-owner@lists.bufferbloat.net
>
> When replying, please edit your Subject line so it is more specific > than "Re: Contents of Codel digest..."
>
>
> Today's Topics:
>
>=C2=A0 =C2=A0 1. tcl code of CoDel (Anjali Chawla)
>=C2=A0 =C2=A0 2. Codel code (kanu monga)
>
>
> ----------------------------------------------------------------------=
>
> Message: 1
> Date: Thu, 19 Feb 2015 11:59:50 +0530
> From: Anjali Chawla <= anjaliachawla013@gmail.com>
> To: codel@lists.bufferb= loat.net
> Subject: [Codel] tcl code of CoDel
> Message-ID:
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<CAL6QuG_pujPYrB6r0gcOhyPUgy6SV0gG= FCTfsuQ_i35E=3D
> qYsjQ@mail.gmail.com> > Content-Type: text/plain; charset=3D"utf-8"
>
> Hi
> i want to know can we test CoDel with wired network???
> or should we go for wireless only???
> anybody please reply because i am new to all this.
> your suggestions can help me in taking one step further.
> Thanks
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> https://lists.buff= erbloat.net/pipermail/codel/attachments/20150219/5c072359/attachment-0001.h= tml
> >
>
> ------------------------------
>
> Message: 2
> Date: Thu, 19 Feb 2015 12:49:34 +0530
> From: kanu monga <kanumon= ga013@gmail.com>
> To: codel@lists.bufferb= loat.net
> Subject: [Codel] Codel code
> Message-ID:
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<CAJ0uZqx6aWUTEuHHAn1g--5H3nwQv-mR= 8GbWD7wubt=3D
> H0fB3+g@mail.gmail.com= >
> Content-Type: text/plain; charset=3D"utf-8"
>
> is there anyone who can help me in understanding tcl code of codel(giv= en
> below)
> This one is quite complex for me.
> please help if you can.
> Thanks in advance.
>
> ################################################################### >
>
> # ns codel.tcl f w c {b}Mb s d r
> # where:
> # f =3D # ftps
> # w =3D # PackMime connections per second
> # c =3D # CBRs
> # b =3D bottleneck bandwidth in Mbps
> # s =3D filesize for ftp, -1 for infinite
> # d =3D dynamic bandwidth, if non-zero, changes (kind of kludgey)
> # have to set the specific change ratios in this file (below)
> # r =3D number of "reverse" ftps
>
> set stopTime 300
> set ns [new Simulator]
>
> # These are defaults if values not set on command line
>
> set num_ftps 1
> set web_rate 0
> set revftp 0
> set num_cbrs 0
> #rate and packetSize set in build_cbr
> set bottleneck 3Mb
> #for a 10MB ftp
> set filesize 10000000
> set dynamic_bw 0
> set greedy 0
>
> # Parse command line
>
> if {$argc >=3D 1} {
>=C2=A0 =C2=A0 =C2=A0set num_ftps [lindex $argv 0]
>=C2=A0 =C2=A0 =C2=A0if {$argc >=3D 2} {
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0set web_rate [lindex $argv 1]
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if {$argc >=3D 3} {
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0set num_cbrs [lindex $a= rgv 2]
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if {$argc >=3D 4} {<= br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0set bottleneck [lindex = $argv 3]
>=C2=A0 =C2=A0 =C2=A0 if {$argc >=3D 5} {
> set filesize [lindex $argv 4]
>=C2=A0 =C2=A0 =C2=A0if {$argc >=3D 6} {
> set dynamic_bw [lindex $argv 5]
>=C2=A0 =C2=A0 =C2=A0if {$argc >=3D 7} {
> set revftp [lindex $argv 6]
>=C2=A0 =C2=A0 =C2=A0 }
>=C2=A0 =C2=A0 =C2=A0 }
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0}
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 }
> }
>=C2=A0 =C2=A0 =C2=A0}
> }
>
> set bw [bw_parse $bottleneck]
> if { $revftp >=3D 1} {
> set num_revs $revftp
> } else {
> set num_revs 0
> }
> puts "ftps $num_ftps webrate $web_rate cbrs $num_cbrs bw $bw file= size
> $filesize reverse $num_revs"
>
> # experiment settings
> set psize 1500
> if { $bw < 1000000} { set psize 500 }
> set nominal_rtt [delay_parse 100ms]
> set accessdly 20
> set bdelay 10
> set realrtt [expr 2*(2*$accessdly + $bdelay)]
> puts "accessdly $accessdly bneckdly $bdelay realrtt $realrtt bnec= kbw $bw"
>
> # CoDel values
> # interval to keep min over
> set interval [delay_parse 100ms]
> # target in ms.
> set target [delay_parse 5ms]
>
> global defaultRNG
> $defaultRNG seed 0
> ns-random 0
> #$defaultRNG seed 54321
> #ns-random 23145
>
> # ------- config info is all above this line ----------
>
> #bdp in packets, based on the nominal rtt
> set bdp [expr round($bw*$nominal_rtt/(8*$psize))]
>
> Trace set show_tcphdr_ 1
> set startTime 0.0
>
> #TCP parameters - have to set both for FTPs and PackMime
>
> Agent/TCP set window_ [expr $bdp*16]
> Agent/TCP set segsize_ [expr $psize-40]
> Agent/TCP set packetSize_ [expr $psize-40]
> Agent/TCP set windowInit_ 4
> Agent/TCP set segsperack_ 1
> Agent/TCP set timestamps_ true
> set delack 0.4
> Agent/TCP set interval_ $delack
>
> Agent/TCP/FullTcp set window_ [expr $bdp*16]
> Agent/TCP/FullTcp set segsize_ [expr $psize-40]
> Agent/TCP/FullTcp set packetSize_ [expr $psize-40]
> Agent/TCP/FullTcp set windowInit_ 4
> Agent/TCP/FullTcp set segsperack_ 1
> Agent/TCP/FullTcp set timestamps_ true
> Agent/TCP/FullTcp set interval_ $delack
>
>
> Agent/TCP/Linux instproc done {} {
> global ns filesize
> #this doesn't seem to work, had to hack tcp-linux.cc to do repeat = ftps
> $self set closed_ 0
> #needs to be delayed by at least .3sec to slow start
> puts "[$ns now] TCP/Linux proc done called"
> $ns at [expr [$ns now] + 0.3] "$self send $filesize"
> }
>
> # problem is that idle() in tcp.cc never seems to get called...
> Application/FTP instproc resume {} {
> puts "called resume"
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0global filesize
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0$self send $filesize
> # $ns at [expr [$ns now] + 0.5] "[$self agent] reset"
> $ns at [expr [$ns now] + 0.5] "[$self agent] send $filesize"=
> }
>
> Application/FTP instproc fire {} {
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0global filesize
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0$self instvar maxpkts_
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0set maxpkts_ $filesize
> [$self agent] set maxpkts_ $filesize
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0$self send $maxpkts_
> puts "fire() FTP"
> }
>
> #buffersizes
> set buffersize [expr $bdp]
> set buffersize1 [expr $bdp*10]
>
> Queue/CoDel set target_ $target
> Queue/CoDel set interval_ $interval
>
> #set Flow_id 1
>
> proc build_topology { ns } {
>=C2=A0 =C2=A0 =C2=A0# nodes n0 and n1 are the server and client side ga= teways and
>=C2=A0 =C2=A0 =C2=A0# the link between them is the congested slow link.= n0 -> n1
>=C2=A0 =C2=A0 =C2=A0# handles all the server to client traffic.
>=C2=A0 =C2=A0 =C2=A0#
>=C2=A0 =C2=A0 =C2=A0# if the web_rate is non-zero, node n2 will be the = packmime server
> cloud
>=C2=A0 =C2=A0 =C2=A0# and node n3 will be the client cloud.
>=C2=A0 =C2=A0 =C2=A0#
>=C2=A0 =C2=A0 =C2=A0# num_ftps server nodes and client nodes are create= d for the ftp
> sessions.
>=C2=A0 =C2=A0 =C2=A0# the first client node is n{2+w} and the first ser= ver node is n{2+f+w}
>=C2=A0 =C2=A0 =C2=A0# where 'f' is num_ftps and 'w' is = 1 if web_rate>0 and 0 otherwise.
>=C2=A0 =C2=A0 =C2=A0# servers will be even numbered nodes, clients odd<= br> >=C2=A0 =C2=A0 =C2=A0# Warning: the numbering here is ridiculously compl= icated
>
>=C2=A0 =C2=A0 =C2=A0global bw bdelay accessdly buffersize buffersize1 f= ilesize node_cnt
>=C2=A0 =C2=A0 =C2=A0set node_cnt 2
>
>=C2=A0 =C2=A0 =C2=A0# congested link
>=C2=A0 =C2=A0 =C2=A0global n0 n1
>=C2=A0 =C2=A0 =C2=A0set n0 [$ns node]
>=C2=A0 =C2=A0 =C2=A0set n1 [$ns node]
>=C2=A0 =C2=A0 =C2=A0$ns duplex-link $n0 $n1 $bw ${bdelay}ms CoDel
>=C2=A0 =C2=A0 =C2=A0$ns duplex-link-op $n0 $n1 orient right
>=C2=A0 =C2=A0 =C2=A0$ns duplex-link-op $n0 $n1 queuePos 0.5
>=C2=A0 =C2=A0 =C2=A0$ns duplex-link-op $n1 $n0 queuePos 1.5
>=C2=A0 =C2=A0 =C2=A0$ns queue-limit $n0 $n1 $buffersize
>=C2=A0 =C2=A0 =C2=A0$ns queue-limit $n1 $n0 $buffersize
>=C2=A0 =C2=A0 =C2=A0set node_cnt 2
>
>=C2=A0 =C2=A0 =C2=A0#dynamic bandwidth
>=C2=A0 =C2=A0 =C2=A0# these are the multipliers for changing bw, times = initial set bw
>=C2=A0 =C2=A0 =C2=A0# edit these values to get different patterns
>=C2=A0 =C2=A0 =C2=A0global stopTime dynamic_bw
>=C2=A0 =C2=A0 =C2=A0array names bw_changes
>=C2=A0 =C2=A0 =C2=A0set bw_changes(1) 0.1
>=C2=A0 =C2=A0 =C2=A0set bw_changes(2) 0.01
>=C2=A0 =C2=A0 =C2=A0set bw_changes(3) 0.5
>=C2=A0 =C2=A0 =C2=A0set bw_changes(4) 0.01
>=C2=A0 =C2=A0 =C2=A0set bw_changes(5) 1.0
>
>=C2=A0 =C2=A0 =C2=A0puts "bottleneck starts at [[[$ns link $n0 $n1= ] link] set
> bandwidth_]bps"
>=C2=A0 =C2=A0 =C2=A0for {set k 1} {$k <=3D $dynamic_bw} {incr k 1} {=
> set changeTime [expr $k*$stopTime/($dynamic_bw+1)]
> set f $bw_changes($k)
> set newBW [expr $f*$bw]
> puts "change at $changeTime to [expr $newBW/1000000.]Mbps" > $ns at $changeTime "[[$ns link $n0 $n1] link] set bandwidth_ $new= BW"
> $ns at $changeTime "[[$ns link $n1 $n0] link] set bandwidth_ $new= BW"
> $ns at $changeTime "puts $newBW"
>=C2=A0 =C2=A0 =C2=A0}
>
>=C2=A0 =C2=A0 =C2=A0set li_10 [[$ns link $n1 $n0] queue]
>=C2=A0 =C2=A0 =C2=A0set li_01 [[$ns link $n0 $n1] queue]
>
>=C2=A0 =C2=A0 =C2=A0set tchan_ [open /tmp/redqvar.tr w]
>=C2=A0 =C2=A0 =C2=A0$li_01 trace curq_
>=C2=A0 =C2=A0 =C2=A0$li_01 trace d_exp_
>=C2=A0 =C2=A0 =C2=A0$li_01 attach $tchan_
>
>=C2=A0 =C2=A0 =C2=A0global num_ftps web_rate num_cbrs greedy num_revs >=C2=A0 =C2=A0 =C2=A0set linkbw [expr $bw*10]
>
>=C2=A0 =C2=A0 =C2=A0set w [expr $web_rate > 0]
>=C2=A0 =C2=A0 =C2=A0if {$w} {
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0global n2 n3
> #server
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0set n2 [$ns node]
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0$ns duplex-link $n2 $n0 $linkbw ${acc= essdly}ms DropTail
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0$ns queue-limit $n2 $n0 $buffersize1<= br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0$ns queue-limit $n0 $n2 $buffersize1<= br> >
> #client
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0set n3 [$ns node]
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0$ns duplex-link $n1 $n3 $linkbw ${acc= essdly}ms DropTail
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0$ns queue-limit $n1 $n3 $buffersize1<= br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0$ns queue-limit $n3 $n1 $buffersize1<= br> > set node_cnt 4
>=C2=A0 =C2=A0 =C2=A0}
> #need to fix the angles if use nam
>=C2=A0 =C2=A0 =C2=A0for {set k 0} {$k < $num_ftps} {incr k 1} {
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0# servers
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0set j $node_cnt
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0global n$j
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0set n$j [$ns node]
> if {$greedy > 0 && $k =3D=3D 0} {
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 $ns duplex-link [set n$j] $n0 $linkb= w 1ms DropTail
> } else {
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 $ns duplex-link [set n$j] $n0 $linkb= w ${accessdly}ms DropTail
> }
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0$ns queue-limit [set n$j] $n0 $buffer= size1
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0$ns queue-limit $n0 [set n$j] $buffer= size1
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0set angle [expr $num_ftps>1? 0.75+= ($k-1)*.5/($num_ftps-1) : 1]
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0$ns duplex-link-op $n0 [set n$j] orie= nt $angle
> incr node_cnt
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0# clients
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0set j $node_cnt
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0global n$j
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0set n$j [$ns node]
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0set dly [expr ${accessdly} +($k+1)] >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0$ns duplex-link $n1 [set n$j] $linkbw= =C2=A0 ${dly}ms=C2=A0 DropTail
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0$ns queue-limit $n1 [set n$j] $buffer= size1
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0$ns queue-limit [set n$j] $n1 $buffer= size1
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0set angle [expr $num_ftps>1? fmod(= 2.25-($k-1)*.5/($num_ftps-1), 2)
> : 0]
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0$ns duplex-link-op $n1 [set n$j] orie= nt $angle
> incr node_cnt
>=C2=A0 =C2=A0 =C2=A0}
>=C2=A0 =C2=A0 =C2=A0for {set k 0} {$k < $num_cbrs} {incr k 1} {
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0# servers
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0set j $node_cnt
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0global n$j
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0set n$j [$ns node]
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0$ns duplex-link [set n$j] $n0 $linkbw= ${accessdly}ms DropTail
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0$ns queue-limit [set n$j] $n0 $buffer= size1
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0$ns queue-limit $n0 [set n$j] $buffer= size1
> #=C2=A0 =C2=A0 =C2=A0 =C2=A0 set angle [expr $num_cbrs>1? 0.75+($k-= 1)*.5/($num_cbrs-1) : 1]
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0$ns duplex-link-op $n0 [set n$j] orie= nt $angle
> incr node_cnt
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0# clients
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0set j $node_cnt
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0global n$j
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0set n$j [$ns node]
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0$ns duplex-link $n1 [set n$j] $linkbw= =C2=A0 ${accessdly}ms=C2=A0 DropTail
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0$ns queue-limit $n1 [set n$j] $buffer= size1
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0$ns queue-limit [set n$j] $n1 $buffer= size1
> #=C2=A0 =C2=A0 =C2=A0 =C2=A0 set angle [expr $num_cbrs>1? fmod(2.25= -($k-1)*.5/($num_ftps-1), 2)
> : 0]
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0$ns duplex-link-op $n1 [set n$j] orie= nt $angle
> incr node_cnt
>=C2=A0 =C2=A0 =C2=A0}
> #reverse direction ftps
>=C2=A0 =C2=A0 =C2=A0for {set k 0} {$k < $num_revs} {incr k 1} {
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0# clients
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0set j $node_cnt
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0global n$j
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0set n$j [$ns node]
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0$ns duplex-link [set n$j] $n0 $linkbw= ${accessdly}ms DropTail
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0$ns queue-limit [set n$j] $n0 $buffer= size1
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0$ns queue-limit $n0 [set n$j] $buffer= size1
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0set angle [expr $num_ftps>1? 0.75+= ($k-1)*.5/($num_ftps-1) : 1]
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0$ns duplex-link-op $n0 [set n$j] orie= nt $angle
> incr node_cnt
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0# servers
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0set j $node_cnt
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0global n$j
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0set n$j [$ns node]
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0set dly [expr ($accessdly)*1.1 +($k+1= )]
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0$ns duplex-link $n1 [set n$j] $linkbw= =C2=A0 ${dly}ms=C2=A0 DropTail
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0$ns queue-limit $n1 [set n$j] $buffer= size1
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0$ns queue-limit [set n$j] $n1 $buffer= size1
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0set angle [expr $num_ftps>1? fmod(= 2.25-($k-1)*.5/($num_ftps-1), 2)
> : 0]
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0$ns duplex-link-op $n1 [set n$j] orie= nt $angle
> incr node_cnt
>=C2=A0 =C2=A0 =C2=A0}
> }
>
> proc build_cbr {cnd snd startTime timeToStop Flow_id} {
>=C2=A0 =C2=A0 =C2=A0global ns
>=C2=A0 =C2=A0 =C2=A0set udp [$ns create-connection UDP $snd LossMonitor= $cnd $Flow_id]
>=C2=A0 =C2=A0 =C2=A0set cbr [new Application/Traffic/CBR]
>=C2=A0 =C2=A0 =C2=A0$cbr attach-agent $udp
>=C2=A0 =C2=A0 =C2=A0# change these for different types of CBRs
>=C2=A0 =C2=A0 =C2=A0$cbr set packetSize_ 100
>=C2=A0 =C2=A0 =C2=A0$cbr set rate_ 0.064Mb
>=C2=A0 =C2=A0 =C2=A0$ns at $startTime "$cbr start"
>=C2=A0 =C2=A0 =C2=A0$ns at $timeToStop "$cbr stop"
> }
>
> # cnd is client node, snd is server node
> proc build_ftpclient {cnd snd startTime timeToStop Flow_id} {
>
>=C2=A0 =C2=A0 =C2=A0global ns filesize greedy revftp
>=C2=A0 =C2=A0 =C2=A0set ctcp [$ns create-connection TCP/Linux $snd TCPS= ink/Sack1 $cnd
> $Flow_id]
>=C2=A0 =C2=A0 =C2=A0$ctcp select_ca cubic
>=C2=A0 =C2=A0 =C2=A0set ftp [$ctcp attach-app FTP]
>=C2=A0 =C2=A0 =C2=A0$ftp set enableResume_ true
>=C2=A0 =C2=A0 =C2=A0$ftp set type_ FTP
>
> #set up a single infinite ftp with smallest RTT
>=C2=A0 =C2=A0 =C2=A0if {$greedy > 0 || $filesize < 0} {
>=C2=A0 =C2=A0 =C2=A0 $ns at $startTime "$ftp start"
>=C2=A0 =C2=A0 =C2=A0 set greedy 0
>=C2=A0 =C2=A0 =C2=A0} else {
>=C2=A0 =C2=A0 =C2=A0 $ns at $startTime "$ftp send $filesize"<= br> >=C2=A0 =C2=A0 =C2=A0}
>=C2=A0 =C2=A0 =C2=A0$ns at $timeToStop "$ftp stop"
> }
>
> proc build_webs {cnd snd rate startTime timeToStop} {
>=C2=A0 =C2=A0 =C2=A0set CLIENT 0
>=C2=A0 =C2=A0 =C2=A0set SERVER 1
>
>=C2=A0 =C2=A0 =C2=A0# SETUP PACKMIME
>=C2=A0 =C2=A0 =C2=A0set pm [new PackMimeHTTP]
>=C2=A0 =C2=A0 =C2=A0$pm set-TCP Sack
>=C2=A0 =C2=A0 =C2=A0$pm set-client $cnd
>=C2=A0 =C2=A0 =C2=A0$pm set-server $snd
>=C2=A0 =C2=A0 =C2=A0$pm set-rate $rate;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 # new connections per second
>=C2=A0 =C2=A0 =C2=A0$pm set-http-1.1;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 # use HTTP/1.1
>
>=C2=A0 =C2=A0 =C2=A0# create RandomVariables
>=C2=A0 =C2=A0 =C2=A0set flow_arrive [new RandomVariable/PackMimeHTTPFlo= wArrive $rate]
>=C2=A0 =C2=A0 =C2=A0set req_size [new RandomVariable/PackMimeHTTPFileSi= ze $rate $CLIENT]
>=C2=A0 =C2=A0 =C2=A0set rsp_size [new RandomVariable/PackMimeHTTPFileSi= ze $rate $SERVER]
>
>=C2=A0 =C2=A0 =C2=A0# assign RNGs to RandomVariables
>=C2=A0 =C2=A0 =C2=A0$flow_arrive use-rng [new RNG]
>=C2=A0 =C2=A0 =C2=A0$req_size use-rng [new RNG]
>=C2=A0 =C2=A0 =C2=A0$rsp_size use-rng [new RNG]
>
>=C2=A0 =C2=A0 =C2=A0# set PackMime variables
>=C2=A0 =C2=A0 =C2=A0$pm set-flow_arrive $flow_arrive
>=C2=A0 =C2=A0 =C2=A0$pm set-req_size $req_size
>=C2=A0 =C2=A0 =C2=A0$pm set-rsp_size $rsp_size
>
>=C2=A0 =C2=A0 =C2=A0global ns
>=C2=A0 =C2=A0 =C2=A0$ns at $startTime "$pm start"
>=C2=A0 =C2=A0 =C2=A0$ns at $timeToStop "$pm stop"
> }
>
> proc uniform {a b} {
> expr $a + (($b- $a) * ([ns-random]*1.0/0x7fffffff))
> }
>
> proc finish {} {
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0global ns
> $ns halt
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0$ns flush-trace
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0exit 0
> }
>
> # $ns namtrace-all [open out.nam w]
> # $ns color 2 blue
> # $ns color 3 red
> # $ns color 4 yellow
> # $ns color 5 green
>
> build_topology $ns
>
> #$ns trace-queue $n0 $n1 [open out_n0ton1.tr w]
> #set fname f${num_ftps}w${web_rate}b${bottleneck}.tr
> set fname f.tr
> puts $fname
> $ns trace-queue $n0 $n1 [open /tmp/$fname w]
> #reverse direction
> #$ns trace-queue $n1 $n0 [open /tmp/$fname w]
>
> set node_cnt 2
> if {$web_rate > 0} {
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0build_webs $n3 $n2 $web_rate 0 $stopT= ime
> set node_cnt 4
> }
>
> for {set k 1} {$k <=3D $num_ftps} {incr k 1} {
>=C2=A0 =C2=A0 =C2=A0set j $node_cnt
>=C2=A0 =C2=A0 =C2=A0incr node_cnt
>=C2=A0 =C2=A0 =C2=A0set i $node_cnt
>=C2=A0 =C2=A0 =C2=A0build_ftpclient [set n$i] [set n$j]=C2=A0 \
>=C2=A0 =C2=A0$startTime $stopTime $i
> # [expr 1.0*($k-1)] $stopTime $i
> # [expr $startTime+($k-1)*[uniform 0.0 2.0]] $stopTime $i
>=C2=A0 =C2=A0 =C2=A0incr node_cnt
> }
>
> for {set k 1} {$k <=3D $num_cbrs} {incr k 1} {
>=C2=A0 =C2=A0 =C2=A0set j $node_cnt
>=C2=A0 =C2=A0 =C2=A0incr node_cnt
>=C2=A0 =C2=A0 =C2=A0set i $node_cnt
>=C2=A0 =C2=A0 =C2=A0build_cbr [set n$i] [set n$j]=C2=A0 \
>=C2=A0 =C2=A0[expr $startTime+($k-1)*[uniform 0.0 2.0]] $stopTime $i >=C2=A0 =C2=A0 =C2=A0incr node_cnt
> }
>
> #for reverse direction, give client smaller number
> for {set k 1} {$k <=3D $num_revs} {incr k 1} {
>=C2=A0 =C2=A0 =C2=A0set j $node_cnt
>=C2=A0 =C2=A0 =C2=A0incr node_cnt
>=C2=A0 =C2=A0 =C2=A0set i $node_cnt
>=C2=A0 =C2=A0 =C2=A0build_ftpclient [set n$j] [set n$i] $startTime $sto= pTime $j
>=C2=A0 =C2=A0 =C2=A0incr node_cnt
> }
>
> $ns at [expr $stopTime ] "finish"
> $ns run
> exit 0
> ################################################################### > -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> https://lists.bufferblo= at.net/pipermail/codel/attachments/20150219/e21c3125/attachment.html > >
>
> ------------------------------
>
> _______________________________________________
> Codel mailing list
> Codel@lists.bufferbloat= .net
> https://lists.bufferbloat.net/listinfo/codel
>
>
> End of Codel Digest, Vol 29, Issue 1
> ************************************
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.buffe= rbloat.net/pipermail/codel/attachments/20150219/b67e540c/attachment.html>

------------------------------

_______________________________________________
Codel mailing list
Codel@lists.bufferbloat.net<= /a>
= https://lists.bufferbloat.net/listinfo/codel


End of Codel Digest, Vol 29, Issue 2
************************************

--001a11340efc0009a4050f72063d--