• Tidak ada hasil yang ditemukan

4. Analisis

5.2 Saran

Untuk pengembangan lebih lanjut, terdapat beberapa saran dari penulis diantaranya :

1. Melakukan pengujian dengan variant TCP lainnya. 2. Melakukan pengujian dengan mekanisme antrian lainnya.

41

DAFTAR PUSTAKA

1. http://blog.mdp.ac.id/nurrachmat/tag/wired-network/, diakses pada 3 Desember 2015.

2. http://ramadhaniulansari.blogspot.co.id/2011/08/network-simulator-ns2.html, diakses pada 8 Desember 2016

3. http://aprilsafa.blogspot.co.id/2013/08/perbedaan-tcp-tahoe-reno-sack-vegas.html, diakses pada 30 November 2015.

4. Ashish Kumar , Ajay K Sharma , Arun Singh, Comparison and Analysis of Drop Tail and RED Queuing Methodoly in PIM-DM Multicasting Network, National Institute of Technology, Jalandhar, India.

5. A Comparative Analysis of TCP Tahoe, Reno, New-Reno, SACK and Vegas.

6. Yuliana Wahyu Putri Utami, Jusak, Anjik Sukmaaji, ANALISIS PERBANDINGAN UNJUK KERJA ALGORITMA CONGESTION CONTROL

PADA TCP TAHOE, RENO DAN SACK (SELECTIVE

ACKNOWLEDGMENT), Sekolah Tinggi Manajemen Komputer & Teknik Komputer Surabaya.

7. Sally Floyd and Van Jacobson, Random Early Detection Gateways for Congestion Avoidance, IEEE/ACM TRANSACTIONS ON NETWORKING. VOL I . NO 1. AUGLlST 1993

42 LAMPIRAN

LISTING PROGRAM 1. DT.tcl

# Make a simulator (scheduler) set ns [new Simulator]

#Define different colors for data flows (for NAM) $ns color 1 Blue

$ns color 2 Red

# Open the Trace files

set file1 [open uji_Reno_3.tr w] $ns trace-all $file1

# Open the Window trace file

set winfile [open uji_Reno_3.xg w]

# Open the NAM trace file # set file2 [open Reno3.nam w] # $ns namtrace-all $file2

# Define a 'finish' procedure proc finish {} {

global ns file1 $ns flush-trace close $file1

#exec nam Reno2.nam & exit 0

# Create the nodes: set n0 [$ns node] set n1 [$ns node] set n2 [$ns node] set n3 [$ns node] set n4 [$ns node] set n5 [$ns node]

# Create the links:

$ns duplex-link $n0 $n2 10Mb 2ms DropTail $ns duplex-link $n1 $n2 10Mb 2ms DropTail $ns duplex-link $n2 $n3 2Mb 2ms DropTail # $ns simplex-link $n3 $n2 2Mb 2ms DropTail $ns duplex-link $n3 $n4 10Mb 2ms DropTail $ns duplex-link $n3 $n5 10Mb 2ms DropTail

# Give node position (for NAM)

$ns duplex-link-op $n0 $n2 orient right-down $ns duplex-link-op $n1 $n2 orient right-up $ns duplex-link-op $n2 $n3 orient right # $ns simplex-link-op $n3 $n2 orient left $ns duplex-link-op $n3 $n4 orient right-up $ns duplex-link-op $n3 $n5 orient right-down

# Set Queue Size of link (n2-n3) to 10 (default is 50 ?) $ns queue-limit $n2 $n3 30

#Monitor the queue for link (n0-n1). (for NAM) $ns duplex-link-op $n2 $n3 queuePos 0.1

# Setup a TCP connection set tcp [new Agent/TCP/Reno] #set tcp [new Agent/TCP] $ns attach-agent $n0 $tcp

set sink [new Agent/TCPSink] $ns attach-agent $n4 $sink

$ns connect $tcp $sink $tcp set fid_ 1

#$tcp set window_ 8000 $tcp set packetSize_ 1024B

# Setup a FTP over TCP connection set ftp [new Application/FTP] $ftp attach-agent $tcp

$ftp set type_ FTP

# Setup a UDP connection set udp [new Agent/UDP] $ns attach-agent $n1 $udp

set null [new Agent/Null] $ns attach-agent $n5 $null $ns connect $udp $null $udp set fid_ 2

# Setup a CBR over UDP connection set cbr [new Application/Traffic/CBR] $cbr attach-agent $udp

$cbr set type_ CBR

$cbr set packetSize_ 1000B $cbr set rate_ 0.7mb

$cbr set random_ 1

# Schedule start/stop times $ns at 1.0 "$cbr start" $ns at 0.1 "$ftp start" $ns at 200.0 "$ftp stop" $ns at 200.0 "$cbr stop"

proc plotWindow {tcpSource file} { global ns

set time 0.1 set now [$ns now]

set cwnd [$tcpSource set cwnd_] set wnd [$tcpSource set window_] puts $file "$now $cwnd"

$ns at [expr $now+$time] "plotWindow $tcpSource $file" }

#tcp output file

set tcpfile [open Reno3.tcp w]

# Agent/TCP/Reno set trace_all_oneline_ true Agent/TCP set trace_all_oneline_ true

$tcp trace rtt_ $tcp attach $tcpfile $tcp set tcpTick_ 0.01

# Start plotWindow

$ns at 0.1 "plotWindow $tcp $winfile"

# Set simulation end time $ns at 200.0 "finish"

$ns run 2. RED.tcl

# Make a simulator (scheduler) set ns [new Simulator]

#Define different colors for data flows (for NAM) $ns color 1 Blue

$ns color 2 Red

# Open the Trace files

set file1 [open Reno_red_1.tr w] $ns trace-all $file1

# Open the Window trace file

set winfile [open Reno_ red_1.xg w]

# Open the NAM trace file

# set file2 [open Newreno2.nam w] # $ns namtrace-all $file2

# Define a 'finish' procedure proc finish {} { global ns file1 $ns flush-trace close $file1 exit 0 }

# Create the nodes: set n0 [$ns node] set n1 [$ns node] set n2 [$ns node] set n3 [$ns node] set n4 [$ns node] set n5 [$ns node]

Queue/RED set bytes_ false # default changed on 10/11/2004. Queue/RED set queue_in_bytes_ false # default changed on 10/11/2004. Queue/RED set q_weight_ 0.002 Queue/RED set thresh_ 5

Queue/RED set maxthresh_ 20

# Create the links:

$ns duplex-link $n0 $n2 10Mb 2ms DropTail $ns duplex-link $n1 $n2 10Mb 2ms DropTail

$ns duplex-link $n2 $n3 2Mb 2ms RED $ns duplex-link $n3 $n4 10Mb 2ms DropTail $ns duplex-link $n3 $n5 10Mb 2ms DropTail

# Give node position (for NAM)

$ns duplex-link-op $n0 $n2 orient right-down $ns duplex-link-op $n1 $n2 orient right-up $ns duplex-link-op $n2 $n3 orient right #$ns simplex-link-op $n3 $n2 orient left $ns duplex-link-op $n3 $n4 orient right-up $ns duplex-link-op $n3 $n5 orient right-down

# Set Queue Size of link (n2-n3) to 10 (default is 50 ?) $ns queue-limit $n2 $n3 30

# Setup a TCP connection set tcp [new Agent/TCP/Reno] $ns attach-agent $n0 $tcp

set sink [new Agent/TCPSink] $ns attach-agent $n4 $sink

$ns connect $tcp $sink $tcp set fid_ 1

#$tcp set window_ 8000 $tcp set packetSize_ 1024

# Setup a FTP over TCP connection set ftp [new Application/FTP] $ftp attach-agent $tcp

$ftp set type_ FTP

# Setup a UDP connection set udp [new Agent/UDP] $ns attach-agent $n1 $udp

set null [new Agent/Null] $ns attach-agent $n5 $null $ns connect $udp $null $udp set fid_ 2

# Setup a CBR over UDP connection set cbr [new Application/Traffic/CBR] $cbr attach-agent $udp

$cbr set type_ CBR

$cbr set packet_size_ 1024 $cbr set rate_ 0.7mbps $cbr set random_ 1

# Schedule start/stop times $ns at 1.0 "$cbr start" $ns at 0.1 "$ftp start" $ns at 200.0 "$ftp stop" $ns at 200.0 "$cbr stop"

proc plotWindow {tcpSource file} { global ns

set time 0.1 set now [$ns now]

set cwnd [$tcpSource set cwnd_] set wnd [$tcpSource set window_] puts $file "$now $cwnd"

$ns at [expr $now+$time] "plotWindow $tcpSource $file" }

# Start plotWindow

$ns at 0.1 "plotWindow $tcp $winfile"

# Set simulation end time $ns at 200.0 "finish"

#seed

$defaultRNG seed 0

Dokumen terkait