• Tidak ada hasil yang ditemukan

Analisis Kinerja Content Delivery Network yang Menggunakan Load Balancer

N/A
N/A
Protected

Academic year: 2017

Membagikan "Analisis Kinerja Content Delivery Network yang Menggunakan Load Balancer"

Copied!
91
0
0

Teks penuh

(1)

LAMPIRAN

SCRIPT PROGRAM SINGLE SERVER

1. Single Server Server

#Pembuatan jaringan CDN

set ns [new Simulator]

(2)

set f [open out.tr w] $ns trace-all $f

set nf [open out.nam w] $ns namtrace-all $nf

$ns duplex-link $n0 $n3 5Mb 2ms DropTail $ns duplex-link $n1 $n3 5Mb 2ms DropTail $ns duplex-link $n2 $n3 5Mb 2ms DropTail $ns duplex-link $n10 $n3 1.5Mb 10ms DropTail $ns duplex-link $n9 $n10 1.5Mb 10ms DropTail $ns duplex-link $n10 $n16 1.5Mb 10ms DropTail $ns duplex-link $n10 $n11 1.5Mb 10ms DropTail $ns duplex-link $n10 $n17 1.5Mb 10ms DropTail $ns duplex-link $n3 $n4 1.5Mb 10ms DropTail $ns duplex-link $n4 $n5 1.5Mb 10ms DropTail $ns duplex-link $n4 $n11 1.5Mb 10ms DropTail $ns duplex-link $n5 $n6 1.5Mb 10ms DropTail $ns duplex-link $n6 $n7 1.5Mb 10ms DropTail $ns duplex-link $n6 $n8 1.5Mb 10ms DropTail $ns duplex-link $n11 $n12 1.5Mb 10ms DropTail $ns duplex-link $n12 $n13 1.5Mb 10ms DropTail $ns duplex-link $n12 $n14 1.5Mb 10ms DropTail $ns duplex-link $n12 $n15 1.5Mb 10ms DropTail $ns duplex-link $n11 $n18 1.5Mb 10ms DropTail $ns duplex-link $n18 $n19 1.5Mb 10ms DropTail $ns duplex-link $n18 $n20 1.5Mb 10ms DropTail $ns duplex-link $n5 $n21 1.5Mb 10ms DropTail $ns duplex-link $n5 $n22 1.5Mb 10ms DropTail

$ns duplex-link-op $n0 $n3 orient right-up $ns duplex-link-op $n1 $n3 orient right-down $ns duplex-link-op $n2 $n3 orient down $ns duplex-link-op $n10 $n3 orient up $ns duplex-link-op $n9 $n10 orient right-up $ns duplex-link-op $n10 $n11 orient right $ns duplex-link-op $n10 $n16 orient down $ns duplex-link-op $n10 $n17 orient right-down $ns duplex-link-op $n3 $n4 orient right

(3)

$ns duplex-link-op $n6 $n7 orient right-up $ns duplex-link-op $n6 $n8 orient right $ns duplex-link-op $n11 $n12 orient right $ns duplex-link-op $n12 $n13 orient right-up $ns duplex-link-op $n12 $n14 orient right $ns duplex-link-op $n12 $n15 orient right-down $ns duplex-link-op $n11 $n18 orient right-down $ns duplex-link-op $n18 $n19 orient left-down $ns duplex-link-op $n18 $n20 orient right-down $ns duplex-link-op $n5 $n21 orient right-up $ns duplex-link-op $n5 $n22 orient left-up

$ns duplex-link-op $n2 $n3 queuePos 0.5

#Penambahan Background Traffic

set udp0 [new Agent/UDP] $ns attach-agent $n0 $udp0

set cbr0 [new Application/Traffic/CBR] $cbr0 attach-agent $udp0

set udp1 [new Agent/UDP] $ns attach-agent $n3 $udp1 $udp1 set class_ 1

set cbr1 [new Application/Traffic/CBR] $cbr1 attach-agent $udp1

set udp2 [new Agent/UDP] $ns attach-agent $n9 $udp2 $udp2 set class_ 2

set cbr2 [new Application/Traffic/CBR] $cbr2 attach-agent $udp2

set udp3 [new Agent/UDP] $ns attach-agent $n16 $udp3 $udp3 set class_ 3

set cbr3 [new Application/Traffic/CBR] $cbr3 attach-agent $udp3

(4)

set cbr4 [new Application/Traffic/CBR] $cbr4 attach-agent $udp4

set udp5 [new Agent/UDP] $ns attach-agent $n7 $udp5 $udp5 set class_ 5

set cbr5 [new Application/Traffic/CBR] $cbr5 attach-agent $udp5

set udp6 [new Agent/UDP] $ns attach-agent $n14 $udp6 $udp6 set class_ 6

set cbr6 [new Application/Traffic/CBR] $cbr6 attach-agent $udp6

set udp7 [new Agent/UDP] $ns attach-agent $n13 $udp7 $udp7 set class_ 7

set cbr7 [new Application/Traffic/CBR] $cbr7 attach-agent $udp7

set udp8 [new Agent/UDP] $ns attach-agent $n1 $udp8 $udp8 set class_ 8

set cbr8 [new Application/Traffic/CBR] $cbr8 attach-agent $udp8

set null0 [new Agent/Null] $ns attach-agent $n14 $null0

set null1 [new Agent/Null] $ns attach-agent $n13 $null1

set null2 [new Agent/Null] $ns attach-agent $n8 $null2

set null3 [new Agent/Null] $ns attach-agent $n20 $null3

(5)

set null5 [new Agent/Null] $ns attach-agent $n20 $null5

set null6 [new Agent/Null] $ns attach-agent $n21 $null6

set null7 [new Agent/Null] $ns attach-agent $n22 $null7

set null8 [new Agent/Null] $ns attach-agent $n17 $null8

$ns connect $udp0 $null0 $ns connect $udp1 $null1 $ns connect $udp2 $null2 $ns connect $udp3 $null3 $ns connect $udp4 $null4 $ns connect $udp5 $null5 $ns connect $udp6 $null6 $ns connect $udp7 $null7 $ns connect $udp8 $null8

#Penambahan Traffic Video

# creation trace traffic

set max_fragmented_size 1024

#add udp header(8 bytes) and IP header (20bytes) set packetSize 1052

set original_file_name trafik set trace_file_name video1.dat

set original_file_id [open $original_file_name r] set trace_file_id [open $trace_file_name w] set pre_time 0

while {[eof $original_file_id] == 0} { gets $original_file_id current_line

scan $current_line "%d%s%d%d%f" no_ frametype_ length_ tmp1_ tmp2_ set time [expr int(($tmp2_ - $pre_time)*1000000.0)]

if { $frametype_ == "I" } { set type_v 1

set prio_p 0 }

(6)

set type_v 2

puts $trace_file_id "$time $length_ $type_v $prio_p $max_fragmented_size" set pre_time $tmp2_

}

close $original_file_id close $trace_file_id set end_sim_time $tmp2_ puts "$end_sim_time"

set trace_file [new Tracefile]

$trace_file filename $trace_file_name

#Sistem Load Balancer

#Attach video to server #create source traffic

#Create a UDP agent and attach it to node n0 set udp_0 [new Agent/myUDP]

$udp_0 set_filename udpSend0 $udp_0 set packetSize_ 1052

$ns attach-agent $n2 $udp_0 ;#Server 2

set udp_1 [new Agent/myUDP] $udp_1 set_filename udpSend1 $udp_1 set packetSize_ 1052

$ns attach-agent $n2 $udp_1 ;#Server 2

set udp_7 [new Agent/myUDP] $udp_7 set_filename udpSend7 $udp_7 set packetSize_ 1052

(7)

set udp_8 [new Agent/myUDP] $udp_8 set_filename udpSend8 $udp_8 set packetSize_ 1052

$ns attach-agent $n2 $udp_8 ;#Server 2

set udp_9 [new Agent/myUDP] $udp_9 set_filename udpSend9 $udp_9 set packetSize_ 1052

$ns attach-agent $n2 $udp_9 ;#Server 2

set udp_14 [new Agent/myUDP] $udp_14 set_filename udpSend14 $udp_14 set packetSize_ 1052

$ns attach-agent $n2 $udp_14 ;#Server 2

set udp_15 [new Agent/myUDP] $udp_15 set_filename udpSend15 $udp_15 set packetSize_ 1052

$ns attach-agent $n2 $udp_15 ;#Server 2

set udp_16 [new Agent/myUDP] $udp_16 set_filename udpSend16 $udp_16 set packetSize_ 1052

$ns attach-agent $n2 $udp_16 ;#Server 2

set udp_19 [new Agent/myUDP] $udp_19 set_filename udpSend19 $udp_19 set packetSize_ 1052

$ns attach-agent $n2 $udp_19 ;#Server 2

set udp_21 [new Agent/myUDP] $udp_21 set_filename udpSend21 $udp_21 set packetSize_ 1052

$ns attach-agent $n2 $udp_21 ;#Server 2

# Attach video traffic source

set video0 [new Application/Traffic/myEvalvid] $video0 attach-tracefile $trace_file

$video0 attach-agent $udp_0

(8)

$video1 attach-tracefile $trace_file $video1 attach-agent $udp_1

set video2 [new Application/Traffic/myEvalvid] $video2 attach-tracefile $trace_file

$video2 attach-agent $udp_7

set video3 [new Application/Traffic/myEvalvid] $video3 attach-tracefile $trace_file

$video3 attach-agent $udp_8

set video4 [new Application/Traffic/myEvalvid] $video4 attach-tracefile $trace_file

$video4 attach-agent $udp_9

set video5 [new Application/Traffic/myEvalvid] $video5 attach-tracefile $trace_file

$video5 attach-agent $udp_14

set video6 [new Application/Traffic/myEvalvid] $video6 attach-tracefile $trace_file

$video6 attach-agent $udp_15

set video7 [new Application/Traffic/myEvalvid] $video7 attach-tracefile $trace_file

$video7 attach-agent $udp_16

set video8 [new Application/Traffic/myEvalvid] $video8 attach-tracefile $trace_file

$video8 attach-agent $udp_19

set video9 [new Application/Traffic/myEvalvid] $video9 attach-tracefile $trace_file

$video9 attach-agent $udp_21

# Create the Null agent to sink traffic set null_0 [new Agent/myEvalvid_Sink] $null_0 set_filename udpRec0

$ns attach-agent $n0 $null_0

(9)

$ns attach-agent $n1 $null_1

set null_7 [new Agent/myEvalvid_Sink] $null_7 set_filename udpRec7

$ns attach-agent $n7 $null_7

set null_8 [new Agent/myEvalvid_Sink] $null_8 set_filename udpRec8

$ns attach-agent $n8 $null_8

set null_9 [new Agent/myEvalvid_Sink] $null_9 set_filename udpRec9

$ns attach-agent $n9 $null_9

set null_14 [new Agent/myEvalvid_Sink] $null_14 set_filename udpRec14

$ns attach-agent $n14 $null_14

set null_15 [new Agent/myEvalvid_Sink] $null_15 set_filename udpRec15

$ns attach-agent $n15 $null_15

set null_16 [new Agent/myEvalvid_Sink] $null_16 set_filename udpRec16

$ns attach-agent $n16 $null_16

set null_19 [new Agent/myEvalvid_Sink] $null_19 set_filename udpRec19

$ns attach-agent $n19 $null_19

set null_21 [new Agent/myEvalvid_Sink] $null_21 set_filename udpRec21

$ns attach-agent $n21 $null_21

# Attach the 2 agents

(10)

$ns connect $udp_16 $null_16 $ns connect $udp_19 $null_19 $ns connect $udp_21 $null_21

$ns at 1.0 "$cbr0 start" $ns at 6.1 "$cbr1 start" $ns at 1.3 "$cbr2 start" $ns at 2.6 "$cbr3 start" $ns at 1.8 "$cbr4 start" $ns at 3.0 "$cbr5 start" $ns at 2.1 "$cbr6 start" $ns at 5.2 "$cbr7 start" $ns at 7.3 "$cbr8 start"

$ns at 4.0 "$cbr5 stop" $ns at 5.1 "$cbr6 stop" $ns at 5.8 "$cbr7 stop"

#Evaluated traffics $ns at 2.0 "$video0 start" $ns at 2.5 "$video1 start" $ns at 3.0 "$video2 start" $ns at 3.5 "$video3 start" $ns at 4.0 "$video4 start" $ns at 4.5 "$video5 start" $ns at 5.0 "$video6 start" $ns at 5.5 "$video7 start" $ns at 6.0 "$video8 start" $ns at 6.5 "$video9 start"

set tcp [new Agent/TCP] $tcp set class_ 2

set sink [new Agent/TCPSink] $ns attach-agent $n0 $tcp $ns attach-agent $n3 $sink $ns connect $tcp $sink

set ftp [new Application/FTP] $ftp attach-agent $tcp

$ns at 1.2 "$ftp start"

(11)

puts [$cbr0 set packetSize_] puts [$cbr0 set interval_]

$ns at 500.0 "finish"

proc finish {} { global ns f nf $ns flush-trace close $f close $nf

puts "running nam..." exec nam out.nam & exit 0

}

(12)

LAMPIRAN

SCRIPT PROGRAM LEAST CONNECTION

set ns [new Simulator]

$ns color 0 pink $ns namtrace-all $nf

(13)

$ns duplex-link $n1 $n3 5Mb 2ms DropTail $ns duplex-link $n2 $n3 5Mb 2ms DropTail $ns duplex-link $n10 $n3 1.5Mb 10ms DropTail $ns duplex-link $n9 $n10 1.5Mb 10ms DropTail $ns duplex-link $n10 $n16 1.5Mb 10ms DropTail $ns duplex-link $n10 $n11 1.5Mb 10ms DropTail $ns duplex-link $n10 $n17 1.5Mb 10ms DropTail $ns duplex-link $n3 $n4 1.5Mb 10ms DropTail $ns duplex-link $n4 $n5 1.5Mb 10ms DropTail $ns duplex-link $n4 $n11 1.5Mb 10ms DropTail $ns duplex-link $n5 $n6 1.5Mb 10ms DropTail $ns duplex-link $n6 $n7 1.5Mb 10ms DropTail $ns duplex-link $n6 $n8 1.5Mb 10ms DropTail $ns duplex-link $n11 $n12 1.5Mb 10ms DropTail $ns duplex-link $n12 $n13 1.5Mb 10ms DropTail $ns duplex-link $n12 $n14 1.5Mb 10ms DropTail $ns duplex-link $n12 $n15 1.5Mb 10ms DropTail $ns duplex-link $n11 $n18 1.5Mb 10ms DropTail $ns duplex-link $n18 $n19 1.5Mb 10ms DropTail $ns duplex-link $n18 $n20 1.5Mb 10ms DropTail $ns duplex-link $n5 $n21 1.5Mb 10ms DropTail $ns duplex-link $n5 $n22 1.5Mb 10ms DropTail

$ns duplex-link-op $n0 $n3 orient right-up $ns duplex-link-op $n1 $n3 orient right-down $ns duplex-link-op $n2 $n3 orient down $ns duplex-link-op $n10 $n3 orient up $ns duplex-link-op $n9 $n10 orient right-up $ns duplex-link-op $n10 $n11 orient right $ns duplex-link-op $n10 $n16 orient down $ns duplex-link-op $n10 $n17 orient right-down $ns duplex-link-op $n3 $n4 orient right

$ns duplex-link-op $n4 $n5 orient right-up $ns duplex-link-op $n4 $n11 orient down $ns duplex-link-op $n5 $n6 orient right $ns duplex-link-op $n6 $n7 orient right-up $ns duplex-link-op $n6 $n8 orient right $ns duplex-link-op $n11 $n12 orient right $ns duplex-link-op $n12 $n13 orient right-up $ns duplex-link-op $n12 $n14 orient right $ns duplex-link-op $n12 $n15 orient right-down $ns duplex-link-op $n11 $n18 orient right-down $ns duplex-link-op $n18 $n19 orient left-down $ns duplex-link-op $n18 $n20 orient right-down $ns duplex-link-op $n5 $n21 orient right-up $ns duplex-link-op $n5 $n22 orient left-up

(14)

set udp0 [new Agent/UDP] $ns attach-agent $n0 $udp0

set cbr0 [new Application/Traffic/CBR] $cbr0 attach-agent $udp0

set udp1 [new Agent/UDP] $ns attach-agent $n3 $udp1 $udp1 set class_ 1

set cbr1 [new Application/Traffic/CBR] $cbr1 attach-agent $udp1

set udp2 [new Agent/UDP] $ns attach-agent $n9 $udp2 $udp2 set class_ 2

set cbr2 [new Application/Traffic/CBR] $cbr2 attach-agent $udp2

set udp3 [new Agent/UDP] $ns attach-agent $n16 $udp3 $udp3 set class_ 3

set cbr3 [new Application/Traffic/CBR] $cbr3 attach-agent $udp3

set udp4 [new Agent/UDP] $ns attach-agent $n19 $udp4 $udp4 set class_ 4

set cbr4 [new Application/Traffic/CBR] $cbr4 attach-agent $udp4

set udp5 [new Agent/UDP] $ns attach-agent $n7 $udp5 $udp5 set class_ 5

set cbr5 [new Application/Traffic/CBR] $cbr5 attach-agent $udp5

set udp6 [new Agent/UDP] $ns attach-agent $n14 $udp6 $udp6 set class_ 6

set cbr6 [new Application/Traffic/CBR] $cbr6 attach-agent $udp6

set udp7 [new Agent/UDP] $ns attach-agent $n13 $udp7 $udp7 set class_ 7

(15)

set udp8 [new Agent/UDP] $ns attach-agent $n1 $udp8 $udp8 set class_ 8

set cbr8 [new Application/Traffic/CBR] $cbr8 attach-agent $udp8

set null0 [new Agent/Null] $ns attach-agent $n14 $null0

set null1 [new Agent/Null] $ns attach-agent $n13 $null1

set null2 [new Agent/Null] $ns attach-agent $n8 $null2

set null3 [new Agent/Null] $ns attach-agent $n20 $null3

set null4 [new Agent/Null] $ns attach-agent $n14 $null4

set null5 [new Agent/Null] $ns attach-agent $n20 $null5

set null6 [new Agent/Null] $ns attach-agent $n21 $null6

set null7 [new Agent/Null] $ns attach-agent $n22 $null7

set null8 [new Agent/Null] $ns attach-agent $n17 $null8

$ns connect $udp0 $null0 $ns connect $udp1 $null1 $ns connect $udp2 $null2 $ns connect $udp3 $null3 $ns connect $udp4 $null4 $ns connect $udp5 $null5 $ns connect $udp6 $null6 $ns connect $udp7 $null7 $ns connect $udp8 $null8

# creation trace traffic

set max_fragmented_size 1024

#add udp header(8 bytes) and IP header (20bytes) set packetSize 1052

(16)

set trace_file_name video1.dat

set original_file_id [open $original_file_name r] set trace_file_id [open $trace_file_name w] set pre_time 0

while {[eof $original_file_id] == 0} { gets $original_file_id current_line

scan $current_line "%d%s%d%d%f" no_ frametype_ length_ tmp1_ tmp2_ set time [expr int(($tmp2_ - $pre_time)*1000000.0)]

if { $frametype_ == "I" } {

puts $trace_file_id "$time $length_ $type_v $prio_p $max_fragmented_size" set pre_time $tmp2_

}

close $original_file_id close $trace_file_id set end_sim_time $tmp2_ puts "$end_sim_time"

set trace_file [new Tracefile]

$trace_file filename $trace_file_name

#Attach video to server #create source traffic

#Create a UDP agent and attach it to node n0 set udp_0 [new Agent/myUDP]

$udp_0 set_filename udpSend0 $udp_0 set packetSize_ 1052

$ns attach-agent $n2 $udp_0 ;#Server 2

set udp_1 [new Agent/myUDP] $udp_1 set_filename udpSend1 $udp_1 set packetSize_ 1052

(17)

set udp_4 [new Agent/myUDP] $udp_4 set_filename udpSend7 $udp_4 set packetSize_ 1052

$ns attach-agent $n2 $udp_4 ;#Server 2

set udp_7 [new Agent/myUDP] $udp_7 set_filename udpSend8 $udp_7 set packetSize_ 1052

$ns attach-agent $n2 $udp_7 ;#Server 2

set udp_2 [new Agent/myUDP] $udp_2 set_filename udpSend9 $udp_2 set packetSize_ 1052

$ns attach-agent $n20 $udp_2 ;#Server 20

set udp_5 [new Agent/myUDP] $udp_5 set_filename udpSend14 $udp_5 set packetSize_ 1052

$ns attach-agent $n20 $udp_5 ;#Server 20

set udp_8 [new Agent/myUDP] $udp_8 set_filename udpSend15 $udp_8 set packetSize_ 1052

$ns attach-agent $n20 $udp_8 ;#Server 20

set udp_3 [new Agent/myUDP] $udp_3 set_filename udpSend16 $udp_3 set packetSize_ 1052

$ns attach-agent $n22 $udp_3 ;#Server 22

set udp_6 [new Agent/myUDP] $udp_6 set_filename udpSend19 $udp_6 set packetSize_ 1052

$ns attach-agent $n22 $udp_6 ;#Server 22

set udp_9 [new Agent/myUDP] $udp_9 set_filename udpSend21 $udp_9 set packetSize_ 1052

$ns attach-agent $n22 $udp_9 ;#Server 22

# Attach video traffic source

set video0 [new Application/Traffic/myEvalvid] $video0 attach-tracefile $trace_file

$video0 attach-agent $udp_0

set video1 [new Application/Traffic/myEvalvid] $video1 attach-tracefile $trace_file

(18)

set video2 [new Application/Traffic/myEvalvid] $video2 attach-tracefile $trace_file

$video2 attach-agent $udp_2

set video3 [new Application/Traffic/myEvalvid] $video3 attach-tracefile $trace_file

$video3 attach-agent $udp_3

set video4 [new Application/Traffic/myEvalvid] $video4 attach-tracefile $trace_file

$video4 attach-agent $udp_4

set video5 [new Application/Traffic/myEvalvid] $video5 attach-tracefile $trace_file

$video5 attach-agent $udp_5

set video6 [new Application/Traffic/myEvalvid] $video6 attach-tracefile $trace_file

$video6 attach-agent $udp_6

set video7 [new Application/Traffic/myEvalvid] $video7 attach-tracefile $trace_file

$video7 attach-agent $udp_7

set video8 [new Application/Traffic/myEvalvid] $video8 attach-tracefile $trace_file

$video8 attach-agent $udp_8

set video9 [new Application/Traffic/myEvalvid] $video9 attach-tracefile $trace_file

$video9 attach-agent $udp_9

# Create the Null agent to sink traffic set null_0 [new Agent/myEvalvid_Sink] $null_0 set_filename udpRec0

$ns attach-agent $n0 $null_0

set null_1 [new Agent/myEvalvid_Sink] $null_1 set_filename udpRec1

$ns attach-agent $n1 $null_1

set null_7 [new Agent/myEvalvid_Sink] $null_7 set_filename udpRec7

$ns attach-agent $n7 $null_7

(19)

$ns attach-agent $n8 $null_8

set null_9 [new Agent/myEvalvid_Sink] $null_9 set_filename udpRec9

$ns attach-agent $n9 $null_9

set null_14 [new Agent/myEvalvid_Sink] $null_14 set_filename udpRec14

$ns attach-agent $n14 $null_14

set null_15 [new Agent/myEvalvid_Sink] $null_15 set_filename udpRec15

$ns attach-agent $n19 $null_15

set null_16 [new Agent/myEvalvid_Sink] $null_16 set_filename udpRec16

$ns attach-agent $n19 $null_16

set null_19 [new Agent/myEvalvid_Sink] $null_19 set_filename udpRec19

$ns attach-agent $n19 $null_19

set null_21 [new Agent/myEvalvid_Sink] $null_21 set_filename udpRec21

$ns attach-agent $n21 $null_21

# Attach the 2 agents

$ns connect $udp_0 $null_0 $ns connect $udp_1 $null_1 $ns connect $udp_2 $null_7 $ns connect $udp_3 $null_8 $ns connect $udp_4 $null_9 $ns connect $udp_5 $null_14 $ns connect $udp_6 $null_15 $ns connect $udp_7 $null_16 $ns connect $udp_8 $null_19 $ns connect $udp_9 $null_21

(20)

$ns at 4.0 "$cbr5 stop" $ns at 5.1 "$cbr6 stop" $ns at 5.8 "$cbr7 stop"

#Evaluated traffics $ns at 2.0 "$video0 start" $ns at 2.5 "$video1 start" $ns at 3.0 "$video2 start" $ns at 3.4 "$video3 start" $ns at 3.8 "$video4 start" $ns at 4.0 "$video5 start" $ns at 4.5 "$video6 start" $ns at 5.0 "$video7 start" $ns at 5.5 "$video8 start" $ns at 6.0 "$video9 start"

set tcp [new Agent/TCP] $tcp set class_ 2

set sink [new Agent/TCPSink] $ns attach-agent $n0 $tcp $ns attach-agent $n3 $sink $ns connect $tcp $sink

set ftp [new Application/FTP] $ftp attach-agent $tcp

$ns at 1.2 "$ftp start"

$ns at 1.35 "$ns detach-agent $n0 $tcp ; $ns detach-agent $n3 $sink"

puts [$cbr0 set packetSize_] puts [$cbr0 set interval_]

$ns at 500.0 "finish"

proc finish {} { global ns f nf $ns flush-trace close $f close $nf

puts "running nam..." exec nam out.nam & exit 0

}

(21)

LAMPIRAN

SCRIPT PROGRAM ROUND ROBIN

set ns [new Simulator]

$ns color 0 pink $ns namtrace-all $nf

(22)

$ns duplex-link $n1 $n3 5Mb 2ms DropTail $ns duplex-link $n2 $n3 5Mb 2ms DropTail $ns duplex-link $n10 $n3 1.5Mb 10ms DropTail $ns duplex-link $n9 $n10 1.5Mb 10ms DropTail $ns duplex-link $n10 $n16 1.5Mb 10ms DropTail $ns duplex-link $n10 $n11 1.5Mb 10ms DropTail $ns duplex-link $n10 $n17 1.5Mb 10ms DropTail $ns duplex-link $n3 $n4 1.5Mb 10ms DropTail $ns duplex-link $n4 $n5 1.5Mb 10ms DropTail $ns duplex-link $n4 $n11 1.5Mb 10ms DropTail $ns duplex-link $n5 $n6 1.5Mb 10ms DropTail $ns duplex-link $n6 $n7 1.5Mb 10ms DropTail $ns duplex-link $n6 $n8 1.5Mb 10ms DropTail $ns duplex-link $n11 $n12 1.5Mb 10ms DropTail $ns duplex-link $n12 $n13 1.5Mb 10ms DropTail $ns duplex-link $n12 $n14 1.5Mb 10ms DropTail $ns duplex-link $n12 $n15 1.5Mb 10ms DropTail $ns duplex-link $n11 $n18 1.5Mb 10ms DropTail $ns duplex-link $n18 $n19 1.5Mb 10ms DropTail $ns duplex-link $n18 $n20 1.5Mb 10ms DropTail $ns duplex-link $n5 $n21 1.5Mb 10ms DropTail $ns duplex-link $n5 $n22 1.5Mb 10ms DropTail

$ns duplex-link-op $n0 $n3 orient right-up $ns duplex-link-op $n1 $n3 orient right-down $ns duplex-link-op $n2 $n3 orient down $ns duplex-link-op $n10 $n3 orient up $ns duplex-link-op $n9 $n10 orient right-up $ns duplex-link-op $n10 $n11 orient right $ns duplex-link-op $n10 $n16 orient down $ns duplex-link-op $n10 $n17 orient right-down $ns duplex-link-op $n3 $n4 orient right

$ns duplex-link-op $n4 $n5 orient right-up $ns duplex-link-op $n4 $n11 orient down $ns duplex-link-op $n5 $n6 orient right $ns duplex-link-op $n6 $n7 orient right-up $ns duplex-link-op $n6 $n8 orient right $ns duplex-link-op $n11 $n12 orient right $ns duplex-link-op $n12 $n13 orient right-up $ns duplex-link-op $n12 $n14 orient right $ns duplex-link-op $n12 $n15 orient right-down $ns duplex-link-op $n11 $n18 orient right-down $ns duplex-link-op $n18 $n19 orient left-down $ns duplex-link-op $n18 $n20 orient right-down $ns duplex-link-op $n5 $n21 orient right-up $ns duplex-link-op $n5 $n22 orient left-up

(23)

set udp0 [new Agent/UDP] $ns attach-agent $n0 $udp0

set cbr0 [new Application/Traffic/CBR] $cbr0 attach-agent $udp0

set udp1 [new Agent/UDP] $ns attach-agent $n3 $udp1 $udp1 set class_ 1

set cbr1 [new Application/Traffic/CBR] $cbr1 attach-agent $udp1

set udp2 [new Agent/UDP] $ns attach-agent $n9 $udp2 $udp2 set class_ 2

set cbr2 [new Application/Traffic/CBR] $cbr2 attach-agent $udp2

set udp3 [new Agent/UDP] $ns attach-agent $n16 $udp3 $udp3 set class_ 3

set cbr3 [new Application/Traffic/CBR] $cbr3 attach-agent $udp3

set udp4 [new Agent/UDP] $ns attach-agent $n19 $udp4 $udp4 set class_ 4

set cbr4 [new Application/Traffic/CBR] $cbr4 attach-agent $udp4

set udp5 [new Agent/UDP] $ns attach-agent $n7 $udp5 $udp5 set class_ 5

set cbr5 [new Application/Traffic/CBR] $cbr5 attach-agent $udp5

set udp6 [new Agent/UDP] $ns attach-agent $n14 $udp6 $udp6 set class_ 6

set cbr6 [new Application/Traffic/CBR] $cbr6 attach-agent $udp6

set udp7 [new Agent/UDP] $ns attach-agent $n13 $udp7 $udp7 set class_ 7

(24)

set udp8 [new Agent/UDP] $ns attach-agent $n1 $udp8 $udp8 set class_ 8

set cbr8 [new Application/Traffic/CBR] $cbr8 attach-agent $udp8

set null0 [new Agent/Null] $ns attach-agent $n14 $null0

set null1 [new Agent/Null] $ns attach-agent $n13 $null1

set null2 [new Agent/Null] $ns attach-agent $n8 $null2

set null3 [new Agent/Null] $ns attach-agent $n20 $null3

set null4 [new Agent/Null] $ns attach-agent $n14 $null4

set null5 [new Agent/Null] $ns attach-agent $n20 $null5

set null6 [new Agent/Null] $ns attach-agent $n21 $null6

set null7 [new Agent/Null] $ns attach-agent $n22 $null7

set null8 [new Agent/Null] $ns attach-agent $n17 $null8

$ns connect $udp0 $null0 $ns connect $udp1 $null1 $ns connect $udp2 $null2 $ns connect $udp3 $null3 $ns connect $udp4 $null4 $ns connect $udp5 $null5 $ns connect $udp6 $null6 $ns connect $udp7 $null7 $ns connect $udp8 $null8

# creation trace traffic

set max_fragmented_size 1024

#add udp header(8 bytes) and IP header (20bytes) set packetSize 1052

(25)

set trace_file_name video1.dat

set original_file_id [open $original_file_name r] set trace_file_id [open $trace_file_name w] set pre_time 0

while {[eof $original_file_id] == 0} { gets $original_file_id current_line

scan $current_line "%d%s%d%d%f" no_ frametype_ length_ tmp1_ tmp2_ set time [expr int(($tmp2_ - $pre_time)*1000000.0)]

if { $frametype_ == "I" } {

puts $trace_file_id "$time $length_ $type_v $prio_p $max_fragmented_size" set pre_time $tmp2_

}

close $original_file_id close $trace_file_id set end_sim_time $tmp2_ puts "$end_sim_time"

set trace_file [new Tracefile]

$trace_file filename $trace_file_name

#Attach video to server #create source traffic

#Create a UDP agent and attach it to node n0 set udp_0 [new Agent/myUDP]

$udp_0 set_filename udpSend0 $udp_0 set packetSize_ 1052

$ns attach-agent $n2 $udp_0 ;#Server 2

set udp_3 [new Agent/myUDP] $udp_3 set_filename udpSend1 $udp_3 set packetSize_ 1052

(26)

set udp_6 [new Agent/myUDP] $udp_6 set_filename udpSend7 $udp_6 set packetSize_ 1052

$ns attach-agent $n2 $udp_6 ;#Server 2

set udp_9 [new Agent/myUDP] $udp_9 set_filename udpSend8 $udp_9 set packetSize_ 1052

$ns attach-agent $n2 $udp_9 ;#Server 2

set udp_1 [new Agent/myUDP] $udp_1 set_filename udpSend9 $udp_1 set packetSize_ 1052

$ns attach-agent $n20 $udp_1 ;#Server 20

set udp_4 [new Agent/myUDP] $udp_4 set_filename udpSend14 $udp_4 set packetSize_ 1052

$ns attach-agent $n20 $udp_4 ;#Server 20

set udp_7 [new Agent/myUDP] $udp_7 set_filename udpSend15 $udp_7 set packetSize_ 1052

$ns attach-agent $n20 $udp_7 ;#Server 20

set udp_2 [new Agent/myUDP] $udp_2 set_filename udpSend16 $udp_2 set packetSize_ 1052

$ns attach-agent $n22 $udp_2 ;#Server 22

set udp_5 [new Agent/myUDP] $udp_5 set_filename udpSend19 $udp_5 set packetSize_ 1052

$ns attach-agent $n22 $udp_5 ;#Server 22

set udp_8 [new Agent/myUDP] $udp_8 set_filename udpSend21 $udp_8 set packetSize_ 1052

$ns attach-agent $n22 $udp_8 ;#Server 22

# Attach video traffic source

set video0 [new Application/Traffic/myEvalvid] $video0 attach-tracefile $trace_file

$video0 attach-agent $udp_0

(27)

$video1 attach-agent $udp_1

set video2 [new Application/Traffic/myEvalvid] $video2 attach-tracefile $trace_file

$video2 attach-agent $udp_2

set video3 [new Application/Traffic/myEvalvid] $video3 attach-tracefile $trace_file

$video3 attach-agent $udp_3

set video4 [new Application/Traffic/myEvalvid] $video4 attach-tracefile $trace_file

$video4 attach-agent $udp_4

set video5 [new Application/Traffic/myEvalvid] $video5 attach-tracefile $trace_file

$video5 attach-agent $udp_5

set video6 [new Application/Traffic/myEvalvid] $video6 attach-tracefile $trace_file

$video6 attach-agent $udp_6

set video7 [new Application/Traffic/myEvalvid] $video7 attach-tracefile $trace_file

$video7 attach-agent $udp_7

set video8 [new Application/Traffic/myEvalvid] $video8 attach-tracefile $trace_file

$video8 attach-agent $udp_8

set video9 [new Application/Traffic/myEvalvid] $video9 attach-tracefile $trace_file

$video9 attach-agent $udp_9

# Create the Null agent to sink traffic set null_0 [new Agent/myEvalvid_Sink] $null_0 set_filename udpRec0

$ns attach-agent $n0 $null_0

set null_1 [new Agent/myEvalvid_Sink] $null_1 set_filename udpRec1

$ns attach-agent $n1 $null_1

set null_7 [new Agent/myEvalvid_Sink] $null_7 set_filename udpRec7

(28)

set null_8 [new Agent/myEvalvid_Sink] $null_8 set_filename udpRec8

$ns attach-agent $n8 $null_8

set null_9 [new Agent/myEvalvid_Sink] $null_9 set_filename udpRec9

$ns attach-agent $n9 $null_9

set null_14 [new Agent/myEvalvid_Sink] $null_14 set_filename udpRec14

$ns attach-agent $n14 $null_14

set null_15 [new Agent/myEvalvid_Sink] $null_15 set_filename udpRec15

$ns attach-agent $n19 $null_15

set null_16 [new Agent/myEvalvid_Sink] $null_16 set_filename udpRec16

$ns attach-agent $n19 $null_16

set null_19 [new Agent/myEvalvid_Sink] $null_19 set_filename udpRec19

$ns attach-agent $n19 $null_19

set null_21 [new Agent/myEvalvid_Sink] $null_21 set_filename udpRec21

$ns attach-agent $n21 $null_21

# Attach the 2 agents

$ns connect $udp_0 $null_0 $ns connect $udp_1 $null_1 $ns connect $udp_2 $null_7 $ns connect $udp_3 $null_8 $ns connect $udp_4 $null_9 $ns connect $udp_5 $null_14 $ns connect $udp_6 $null_15 $ns connect $udp_7 $null_16 $ns connect $udp_8 $null_19 $ns connect $udp_9 $null_21

(29)

$ns at 7.3 "$cbr8 start"

$ns at 4.0 "$cbr5 stop" $ns at 5.1 "$cbr6 stop" $ns at 5.8 "$cbr7 stop"

#Evaluated traffics $ns at 2.0 "$video0 start" $ns at 2.5 "$video1 start" $ns at 3.0 "$video2 start" $ns at 3.4 "$video3 start" $ns at 3.8 "$video4 start" $ns at 4.0 "$video5 start" $ns at 4.5 "$video6 start" $ns at 5.0 "$video7 start" $ns at 5.5 "$video8 start" $ns at 6.0 "$video9 start"

set tcp [new Agent/TCP] $tcp set class_ 2

set sink [new Agent/TCPSink] $ns attach-agent $n0 $tcp $ns attach-agent $n3 $sink $ns connect $tcp $sink

set ftp [new Application/FTP] $ftp attach-agent $tcp

$ns at 1.2 "$ftp start"

$ns at 1.35 "$ns detach-agent $n0 $tcp ; $ns detach-agent $n3 $sink"

puts [$cbr0 set packetSize_] puts [$cbr0 set interval_]

$ns at 500.0 "finish"

proc finish {} { global ns f nf $ns flush-trace close $f close $nf

puts "running nam..." exec nam out.nam & exit 0

}

(30)

LAMPIRAN

SCRIPT PROGRAM WEIGHTED ROUND ROBIN

set ns [new Simulator]

$ns color 0 pink $ns namtrace-all $nf

(31)

$ns duplex-link $n2 $n3 5Mb 2ms DropTail $ns duplex-link $n10 $n3 1.5Mb 10ms DropTail $ns duplex-link $n9 $n10 1.5Mb 10ms DropTail $ns duplex-link $n10 $n16 1.5Mb 10ms DropTail $ns duplex-link $n10 $n11 1.5Mb 10ms DropTail $ns duplex-link $n10 $n17 1.5Mb 10ms DropTail $ns duplex-link $n3 $n4 1.5Mb 10ms DropTail $ns duplex-link $n4 $n5 1.5Mb 10ms DropTail $ns duplex-link $n4 $n11 1.5Mb 10ms DropTail $ns duplex-link $n5 $n6 1.5Mb 10ms DropTail $ns duplex-link $n6 $n7 1.5Mb 10ms DropTail $ns duplex-link $n6 $n8 1.5Mb 10ms DropTail $ns duplex-link $n11 $n12 1.5Mb 10ms DropTail $ns duplex-link $n12 $n13 1.5Mb 10ms DropTail $ns duplex-link $n12 $n14 1.5Mb 10ms DropTail $ns duplex-link $n12 $n15 1.5Mb 10ms DropTail $ns duplex-link $n11 $n18 1.5Mb 10ms DropTail $ns duplex-link $n18 $n19 1.5Mb 10ms DropTail $ns duplex-link $n18 $n20 1.5Mb 10ms DropTail $ns duplex-link $n5 $n21 1.5Mb 10ms DropTail $ns duplex-link $n5 $n22 1.5Mb 10ms DropTail

$ns duplex-link-op $n0 $n3 orient right-up $ns duplex-link-op $n1 $n3 orient right-down $ns duplex-link-op $n2 $n3 orient down $ns duplex-link-op $n10 $n3 orient up $ns duplex-link-op $n9 $n10 orient right-up $ns duplex-link-op $n10 $n11 orient right $ns duplex-link-op $n10 $n16 orient down $ns duplex-link-op $n10 $n17 orient right-down $ns duplex-link-op $n3 $n4 orient right

$ns duplex-link-op $n4 $n5 orient right-up $ns duplex-link-op $n4 $n11 orient down $ns duplex-link-op $n5 $n6 orient right $ns duplex-link-op $n6 $n7 orient right-up $ns duplex-link-op $n6 $n8 orient right $ns duplex-link-op $n11 $n12 orient right $ns duplex-link-op $n12 $n13 orient right-up $ns duplex-link-op $n12 $n14 orient right $ns duplex-link-op $n12 $n15 orient right-down $ns duplex-link-op $n11 $n18 orient right-down $ns duplex-link-op $n18 $n19 orient left-down $ns duplex-link-op $n18 $n20 orient right-down $ns duplex-link-op $n5 $n21 orient right-up $ns duplex-link-op $n5 $n22 orient left-up

(32)

set udp0 [new Agent/UDP] $ns attach-agent $n0 $udp0

set cbr0 [new Application/Traffic/CBR] $cbr0 attach-agent $udp0

set udp1 [new Agent/UDP] $ns attach-agent $n3 $udp1 $udp1 set class_ 1

set cbr1 [new Application/Traffic/CBR] $cbr1 attach-agent $udp1

set udp2 [new Agent/UDP] $ns attach-agent $n9 $udp2 $udp2 set class_ 2

set cbr2 [new Application/Traffic/CBR] $cbr2 attach-agent $udp2

set udp3 [new Agent/UDP] $ns attach-agent $n16 $udp3 $udp3 set class_ 3

set cbr3 [new Application/Traffic/CBR] $cbr3 attach-agent $udp3

set udp4 [new Agent/UDP] $ns attach-agent $n19 $udp4 $udp4 set class_ 4

set cbr4 [new Application/Traffic/CBR] $cbr4 attach-agent $udp4

set udp5 [new Agent/UDP] $ns attach-agent $n7 $udp5 $udp5 set class_ 5

set cbr5 [new Application/Traffic/CBR] $cbr5 attach-agent $udp5

set udp6 [new Agent/UDP] $ns attach-agent $n14 $udp6 $udp6 set class_ 6

set cbr6 [new Application/Traffic/CBR] $cbr6 attach-agent $udp6

set udp7 [new Agent/UDP] $ns attach-agent $n13 $udp7 $udp7 set class_ 7

set cbr7 [new Application/Traffic/CBR] $cbr7 attach-agent $udp7

(33)

$ns attach-agent $n1 $udp8 $udp8 set class_ 8

set cbr8 [new Application/Traffic/CBR] $cbr8 attach-agent $udp8

set null0 [new Agent/Null] $ns attach-agent $n14 $null0

set null1 [new Agent/Null] $ns attach-agent $n13 $null1

set null2 [new Agent/Null] $ns attach-agent $n8 $null2

set null3 [new Agent/Null] $ns attach-agent $n20 $null3

set null4 [new Agent/Null] $ns attach-agent $n14 $null4

set null5 [new Agent/Null] $ns attach-agent $n20 $null5

set null6 [new Agent/Null] $ns attach-agent $n21 $null6

set null7 [new Agent/Null] $ns attach-agent $n22 $null7

set null8 [new Agent/Null] $ns attach-agent $n17 $null8

$ns connect $udp0 $null0 $ns connect $udp1 $null1 $ns connect $udp2 $null2 $ns connect $udp3 $null3 $ns connect $udp4 $null4 $ns connect $udp5 $null5 $ns connect $udp6 $null6 $ns connect $udp7 $null7 $ns connect $udp8 $null8

# creation trace traffic

set max_fragmented_size 1024

#add udp header(8 bytes) and IP header (20bytes) set packetSize 1052

(34)

set original_file_id [open $original_file_name r] set trace_file_id [open $trace_file_name w] set pre_time 0

while {[eof $original_file_id] == 0} { gets $original_file_id current_line

scan $current_line "%d%s%d%d%f" no_ frametype_ length_ tmp1_ tmp2_ set time [expr int(($tmp2_ - $pre_time)*1000000.0)]

if { $frametype_ == "I" } {

puts $trace_file_id "$time $length_ $type_v $prio_p $max_fragmented_size" set pre_time $tmp2_

}

close $original_file_id close $trace_file_id set end_sim_time $tmp2_ puts "$end_sim_time"

set trace_file [new Tracefile]

$trace_file filename $trace_file_name

#Attach video to server #create source traffic

#Create a UDP agent and attach it to node n0 set udp_0 [new Agent/myUDP]

$udp_0 set_filename udpSend0 $udp_0 set packetSize_ 1052

$ns attach-agent $n2 $udp_0 ;#Server 2

set udp_1 [new Agent/myUDP] $udp_1 set_filename udpSend1 $udp_1 set packetSize_ 1052

(35)

set udp_4 [new Agent/myUDP] $udp_4 set_filename udpSend7 $udp_4 set packetSize_ 1052

$ns attach-agent $n2 $udp_4 ;#Server 2

set udp_5 [new Agent/myUDP] $udp_5 set_filename udpSend8 $udp_5 set packetSize_ 1052

$ns attach-agent $n2 $udp_5 ;#Server 2

set udp_8 [new Agent/myUDP] $udp_8 set_filename udpSend9 $udp_8 set packetSize_ 1052

$ns attach-agent $n2 $udp_8 ;#Server 2

set udp_9 [new Agent/myUDP] $udp_9 set_filename udpSend14 $udp_9 set packetSize_ 1052

$ns attach-agent $n2 $udp_9 ;#Server 2

set udp_2 [new Agent/myUDP] $udp_2 set_filename udpSend15 $udp_2 set packetSize_ 1052

$ns attach-agent $n20 $udp_2 ;#Server 20

set udp_6 [new Agent/myUDP] $udp_6 set_filename udpSend16 $udp_6 set packetSize_ 1052

$ns attach-agent $n20 $udp_6 ;#Server 20

set udp_3 [new Agent/myUDP] $udp_3 set_filename udpSend19 $udp_3 set packetSize_ 1052

$ns attach-agent $n22 $udp_3 ;#Server 22

set udp_7 [new Agent/myUDP] $udp_7 set_filename udpSend21 $udp_7 set packetSize_ 1052

$ns attach-agent $n22 $udp_7 ;#Server 22

# Attach video traffic source

set video0 [new Application/Traffic/myEvalvid] $video0 attach-tracefile $trace_file

$video0 attach-agent $udp_0

set video1 [new Application/Traffic/myEvalvid] $video1 attach-tracefile $trace_file

(36)

set video2 [new Application/Traffic/myEvalvid] $video2 attach-tracefile $trace_file

$video2 attach-agent $udp_2

set video3 [new Application/Traffic/myEvalvid] $video3 attach-tracefile $trace_file

$video3 attach-agent $udp_3

set video4 [new Application/Traffic/myEvalvid] $video4 attach-tracefile $trace_file

$video4 attach-agent $udp_4

set video5 [new Application/Traffic/myEvalvid] $video5 attach-tracefile $trace_file

$video5 attach-agent $udp_5

set video6 [new Application/Traffic/myEvalvid] $video6 attach-tracefile $trace_file

$video6 attach-agent $udp_6

set video7 [new Application/Traffic/myEvalvid] $video7 attach-tracefile $trace_file

$video7 attach-agent $udp_7

set video8 [new Application/Traffic/myEvalvid] $video8 attach-tracefile $trace_file

$video8 attach-agent $udp_8

set video9 [new Application/Traffic/myEvalvid] $video9 attach-tracefile $trace_file

$video9 attach-agent $udp_9

# Create the Null agent to sink traffic set null_0 [new Agent/myEvalvid_Sink] $null_0 set_filename udpRec0

$ns attach-agent $n0 $null_0

set null_1 [new Agent/myEvalvid_Sink] $null_1 set_filename udpRec1

$ns attach-agent $n1 $null_1

set null_7 [new Agent/myEvalvid_Sink] $null_7 set_filename udpRec7

$ns attach-agent $n7 $null_7

(37)

$null_8 set_filename udpRec8 $ns attach-agent $n8 $null_8

set null_9 [new Agent/myEvalvid_Sink] $null_9 set_filename udpRec9

$ns attach-agent $n9 $null_9

set null_14 [new Agent/myEvalvid_Sink] $null_14 set_filename udpRec14

$ns attach-agent $n14 $null_14

set null_15 [new Agent/myEvalvid_Sink] $null_15 set_filename udpRec15

$ns attach-agent $n19 $null_15

set null_16 [new Agent/myEvalvid_Sink] $null_16 set_filename udpRec16

$ns attach-agent $n19 $null_16

set null_19 [new Agent/myEvalvid_Sink] $null_19 set_filename udpRec19

$ns attach-agent $n19 $null_19

set null_21 [new Agent/myEvalvid_Sink] $null_21 set_filename udpRec21

$ns attach-agent $n21 $null_21

# Attach the 2 agents

$ns connect $udp_0 $null_0 $ns connect $udp_1 $null_1 $ns connect $udp_2 $null_7 $ns connect $udp_3 $null_8 $ns connect $udp_4 $null_9 $ns connect $udp_5 $null_14 $ns connect $udp_6 $null_15 $ns connect $udp_7 $null_16 $ns connect $udp_8 $null_19 $ns connect $udp_9 $null_21

(38)

$ns at 4.0 "$cbr5 stop" $ns at 5.1 "$cbr6 stop" $ns at 5.8 "$cbr7 stop"

#Evaluated traffics $ns at 2.0 "$video0 start" $ns at 2.5 "$video1 start" $ns at 3.0 "$video2 start" $ns at 3.4 "$video3 start" $ns at 3.8 "$video4 start" $ns at 4.0 "$video5 start" $ns at 4.5 "$video6 start" $ns at 5.0 "$video7 start" $ns at 5.5 "$video8 start" $ns at 6.0 "$video9 start"

set tcp [new Agent/TCP] $tcp set class_ 2

set sink [new Agent/TCPSink] $ns attach-agent $n0 $tcp $ns attach-agent $n3 $sink $ns connect $tcp $sink

set ftp [new Application/FTP] $ftp attach-agent $tcp

$ns at 1.2 "$ftp start"

$ns at 1.35 "$ns detach-agent $n0 $tcp ; $ns detach-agent $n3 $sink"

puts [$cbr0 set packetSize_] puts [$cbr0 set interval_]

$ns at 20.0 "finish"

proc finish {} { global ns f nf $ns flush-trace close $f close $nf

puts "running nam..." exec nam out.nam & exit 0

}

(39)

DAFTAR PUSTAKA

[1] Konsep dan Aplikasi Pemorograman Client Server dan Sistem

Terdistribusi, Budi Sutedjo Dharma Oetomo, S.Kom.,MM, Penerbit Andi,

Yogyakarta.2006

[2] James F. Kurose1, Keith W. Ross2, “Computer Networking” A Top-Down

Approach, 2008

[3] Mohammad Johan Rajabi. “Analisa Pemanfaatan Content Delivery

Network” FASILKOM UI, 2008.

[4] Spiridon Bakiras, “Approximate Server Selection Algorithms in Content

Distribution Networks” IEEE,2005. [Online]. Tersedia:

2016]

[5] V. Cardellini, M. Colajanni, P.S. Y

June 1999.

[6] YU SHENGSHENG, YANG LIHUI, LU SONG, ZHOU JINGLI,”

Least-Connection Algorithm based on variable weight for multimedia

Transmission” Huazhong University of Science & Technology, China.

[7] Mustafa ElGili Mustafa,dkk.”Load Balancing Algorithms Round-Robin

(RR), Least-Connection and Least Loaded Efficiency”.International

Journal of Computer and Information Technology. March 2015.

[8] Teerawat Issariyakul, Ekram Hossain. “Introduction to Network Simulator

(40)

[9] Jirka Klaue, “EvalVid - A Video Quality Evaluation Tool-set” [Online].

Tersedia:

[10] Chih-Heng Ke, Ce-Kuen Shieh, Wen-Shyang Hwang, Artur Ziviani, “An

Evaluation Framework for More Realistic Simulations of MPEG Video

Transmission”, Journal of Information Science and Engineering (accepted)

(SCI, EI), 2006 [Online]. Tersedia:

Februari 2016]

[11] Muhammad Mulia Maulana, Suherman, “Analisis Kualitas Transmisi

Video dengan Decodable Frame Rate” [Online]. Tersedia

2016]

[12] European Telecommunications Standards Institute (ETSI).

Telecommunications and Internet Protocol Harmonization Over Networks

(TIPHON). “In General aspects of Quality of Service (QoS) (pp. 24-27)”.

France, 1998

[13] Yanto, “Analisis QoS (Quality Of Service) pada Jaringan Internet”

[Online].

Tersedia:http://download.portalgaruda.org/articel.php?article=32511&val=

(41)

BAB 3

PERANCANGAN SIMULASI

3.1. Perancangan Alur Penelitian

Guna mencapai tujuan penelitian, perancangan alur penelitian dilakukan

sesuai alur pada Gambar 3.1.Perancangan terlebih dahulu melakukan instalasi dan

pengujian perangkat yang digunakan, yaitu network simulator NS-2.Kemudian

dibangunlah model jaringan CDN, pemilihan server, client dan background

traffic.

(42)

Untuk menguji penggunaan multimedia pada jaringan CDN, maka piranti

lunak evaluasi video Evalvid diintegrasikan ke NS-2 pada sistem operasi ubuntu.

Trafik dipilih berdasarkan kerangka Evalvid dengan mengubah kecepatan atau bit

rate video.

Penerapan model CDN dilakukan dengan Load Balancer dengan

menganalisis penerimaan data (download). Analisis dilakukan dengan menghitung

kinerja dari hasil simulasi dengan membandingkan jaringan tanpa CDN atau

single server dengan jaringan setelah dilakukan penerapan CDN.

3.2. Spesifikasi Perangkat Penelitian 3.2.1 Perangkat Keras

Perangkat keras yang digunakan untuk menjalankan simulasi pada Tugas

Akhir ini adalah satu buah laptop Hp Pavilion G4-1311AU dengan spesifikasi

sebagai berikut:

- Processor AMD Dual-Core A4-3305M

- Kecepatan Prosessor (1,9 GHz, 2MB L3 cache)

- Memory 4 GB DDR3

- HDD 500 GB

3.2.2 Perangkat Lunak

Spesifikasi perangkat lunak yang digunakan adalah:

- Sistem operasi Ubuntu 14.04 LTS.

- Network simulator NS-2.35

(43)

3.3. Spesifikasi Trafik Simulasi CDN

Tugas akhir ini dilakukan dengan menggunakan softwareNS-2 (Network

Simulator-2) yang merupakan perangkat lunak yang digunakan untuk

mensimulasikan jaringan berbasis TCP/IP dengan berbagai jenis medianya.

Adapun spesifikasi trafik video yang digunakan pada simulasi ditunjukkan pada

Tabel 3.1, dimana kecepatan video memiliki bit rate:286435,406 bps.

Tabel 3.1: Spesifikasi Trafik Video

Parameter Keterangan

Nama video

Kecepatan frame

Tipe frame

Codec

bit rate (bps)

akiyo_cif.yuv

30fps

IPP

MPEG4

286435 bps

Video memiliki kecepatan frame 30 frame setiap detik dengan codec mpeg4

berframe IPP.

3.4. Spesifikasi Fisik Simulasi CDN

Konfigurasi jaringan yang disimulasikan menirukan jaringan CDN seperti

ditunjukkan pada Gambar 3.2, dimana jaringan CDN yang dimodelkan dengan

jaringan CDN terdiri dari 3 server dan 19 client dimana dari 19 client

yangmelakukan permintaan layanan ada 10 client. Sementara 9 client lain

(44)

Gambar 3.4Network Configuration

3.5. Implementasi Sistem Load Balancer

Implementasi sistem Load Balancer pada jaringan CDN ditempatkan

diantara client dan server seperti yang ditunjukkan pada Gambar 3.3. Ketika ada

client yang ingin terhubung ke server maka Load Balancer akan memilih server

mana yang akan melayani client tersebut dengan salah satu dari tiga algoritma

yaitu Least Connection (LC), Round Robin (RR), dan Weighted Round Robin

(WRR).

Load Balancer dengan algoritma least connection menghubungkan client ke

server berdasarkan jumlah client paling sedikit yang terhubung ke server. Jadi

ketika ada client yang merequest situs maka Load Balancer akan mendeteksi Server1

(45)

server mana yang memiliki koneksi paling sedikit dan kemudian

menghubungkannya.

Gambar 3.3 Implementasi Load Balancer pada Jaringan CDN

Load Balancer dengan algoritma round robin menghubungkan client

dengan server berdasarkan waktu kedatangan dan urutan server yang ada. Ketika

client pertama melakukan request maka Load Balancer akan menghubungkan

client tersebut ke server1. Request dari client kedua Load Balancer akan

menghubungkannya ke server2. Reqest dari client ketiga Load Balancerakan

menghubngkannya ke server3. Request dari client keempat Load Balancer akan

menghubungkannya kembali ke server1. Begitu seterusnya setiap ada request dari

(46)

Load Balancer dengan algoritma weighted round robin menghubungkan

client dengan server berdasarkan waktu kedatangan dan urutan server yang ada

tetapi urutannya dibebankan ke salah satu server yang terbaik. Ketika client

pertama melakukan request maka Load Balancer akan menghubungkan client

tersebut ke server1. Request dari client kedua Load Balancer akan

menghubungkannya ke server1 juga. Reqest dari client ketiga Load Balancerakan

menghubngkannya ke server2. Request dari client keempat Load Balancer akan

menghubungkannya ke server3. Begitu seterusnya setiap ada request dari client.

3.6. Parameter Evaluasi 3.6.1. Delay

Delay adalah waktu tunda yang dibutuhkan packet data dari pengirim ke

penerima, Rumus mencari dekay ditunjukkan oleh Persamaan 1. [11]

����� =(����� ������������ −���������������� )

����� ℎ������ (1)

Delay juga dapat dipengaruhi oleh jarak, media fisik, kongesti atau juga

waktu proses yang lama. Menurut versi TIPHON (Telecommunications and

Internet Protocol HarmonizationOverNetworks), besarnya delay dapat

diklasifikasikan pada Tabel 3.2 [12].

Tabel 3.2One-Way Delay (Letency) versi TIPHON[12]

Kategori Delay (Letency) Besar Delay (Letency)

Sangat bagus < 150 ms

(47)

3.6.2. Packet Loss

Packet Loss merupakan suatu parameter yang menggambarkan suatu

kondisi yang menunjukkan jumlah paket, dapat terjadi karena collision dan

congestion pada jaringan.[11]

Rumus dari Packet Loss ditunjukkan pada Pers. 2 [11]

���������� =(��ℎ���������������� −��ℎ����������������� )

��ℎ���������������� �100%(2)

Menurut versi TIPHON (Telecommunications and Internet Protocol

HarmonizationOverNetworks), besarnya paketlossdapat diklasifikasikan pada

Tabel 3.2 [12].

Tabel 3.3 Paket Loss versi TIPHON[12]

Kategori Packet Loss

Packet Loss

Sangat Bagus 0%

Bagus 3%

Sedang 15%

Jelek 25%

3.6.3. Throughput

Throughput adalah kecepatan (rate) transfer data efektif, yang diukur

dalam bps. Throughput merupakan jumlah total kedatangan paket yang sukses

yang diamati pada tujuan selama interval waktu tertentu dibagi oleh durasi

interval waktu tersebut. Persamaan Throughput ditunjukkan pada Pers. 3. [13]

�ℎ����ℎ���= ��������� ��������

(48)

3.7. Langkah Pelaksanaan Simulasi

Urutan langkah pelaksanaan simulasi dapat dilihat pada Gambar 3.4.

(49)

Pada Gambar 3.4 dapat dilihat diagram alir pelaksanaan simulasi, dimana

langkah pertama yang dilakukan menginisilalisasi konfigurasi jaringan CDN,

setelah jaringan CDN dikonfigurasi maka jaringan diimplementasikan ke CDN

agar dapat disimulasikan.

Sebelum melakukan simulasikan CDN terlebih dahulu melakukan

pengaturan (setting) pada bit rate video, setelah itu akan melakukan proses

simulasi dengan salah satu algoritma. Kemudian simulasi diulang sampai 20 kali

percobaan, sesudah simulasi selesai dijalankan maka akan dihasilkan output

proses simulasi berformat .txt yang merekam semua kejadian selama simulasi

berlangsung.

Pada simulasi ini, Load Balancer menggunakan 3 algoritma, yaitu: Least

Connection, Round Robin, dan Weighted Round Robin. Setelah salah satu

algoritma dilakukan 20 kali percobaan, maka akan diulangi ke algoritma yang lain

(50)

BAB 4

HASIL SIMULASI DAN ANALISIS DATA

4.1 Umum

Bab ini menganalisis output yang dihasilkan dari 20 kali percobaan pada

simulasi di NS-2. Analisis data output tersebut diklasifikasikan untuk mengetahui

hasil penggunaan beberapa algoritma pada teknik Load Balancer. Parameter

kinerja yang diperoleh antara laindelay, packet loss, throughtput, dan jitter.

4.2 Hasil Pengujian

4.2.1 Pengujian Jaringan Tanpa CDN

Pada subbab ini, akan ditunjukkan hasil pengujian jaringan tanpa

CDN(Single Server), dimana hanya ada 1 server yang melayani permintaan

downling video oleh 10 client.

4.2.1.1 Delay

Data percobaan dari singleserver dapat kita lihat pada Tabel 4.1. Dari Tabel

4.1 dapat dilihat bahwa nilai rata-rata delay dari 20 kali percobaan untuk single

server paling besar di server2 yaitu sebesar 0.416722 detik dan yang paling kecil

di server1 yaitu sebesar 0.112162 detik. Sedangkan server3 memiliki delay

sebesar 0.281631 detik. Grafik perubahan setiap percobaan dapat dilihat pada

Gambar 4.1. Dari Gambar 4.1 dapat dilihat bahwa perubahan setiap percobaan

(51)

Tabel 4.1 Data Delay Tanpa CDN (Single Server)

Percobaan Delay (s)

Server1 Server2 Server3 1 0.1099322 0.3921887 0.2909992 2 0.1122998 0.4195775 0.3091178 3 0.1120770 0.4192706 0.3097415 4 0.1128405 0.4178899 0.3098287 5 0.1119700 0.4180505 0.3109928 6 0.1122763 0.4177114 0.3092474 7 0.1117363 0.4179326 0.3094052 8 0.1124550 0.4193903 0.3090790 9 0.1123683 0.4178714 0.3108748 10 0.1126332 0.4183929 0.3095861 11 0.1122535 0.4190800 0.3097842 12 0.1128767 0.4177008 0.3108304 13 0.1114728 0.4175245 0.3088737 14 0.1119828 0.4191586 0.3099724 15 0.1125740 0.4181406 0.3101293 16 0.1126670 0.4175157 0.3095538 17 0.1131148 0.4187423 0.3090414 18 0.1119567 0.4174677 0.3101206 19 0.1115251 0.4180761 0.3093305 20 0.1124168 0.4183835 0.3077867 Rata-Rata 0.1121714 0.4170033 0.3087148

Gambar 4.1 KarateristikDelay Single Server

(52)

Gambar 4.3 menunjukkan perbandingan nilai rata-rata 20 kali percobaan

dari sistem jaringan Single Server.

Gambar 4.2 Karateristik Rata-Rata Delay Single Server

4.2.1.2 Packet Loss

Untuk Grafik data packet loss untuk single server dapat dilihat pada

Tabel 4.2. Dari Tabel 4.2 dapat dilihat bahwa packet loss paling rendah terdapat

pada server1 yaitu sebesar 35.41% dan paling tinggi pada server2 yaitu sebesar

55.82%. Sedangkan untuk server3 packet loss sebesar 49.38%.

Tabel 4.2 Data Packet Loss Tanpa CDN (Single Server)

Percobaan Packet Loss

Server1 Server2 Server3

(53)

9 34.93% 55.82% 45.08%

Perubahan nilai rata-rata packet losssetiap percobaan tidak terlalu

signifikan, hanya pada percobaan ke-20 ketiga Single Server mengalami

peningkatan yang ditunjukkan Gambar 4.3 yang menunjukkan perubahan nilai

rata-rata tiap percobaan pada tiga Single Server.

Gambar 4.3 KarateristikPacket Loss Single Server

(54)

Untuk perbandingan nilai rata-rata packet loss 20 kali percobaan dapat

dilihat pada Gambar 4.4.

Gambar 4.4 Karateristik Rata-Rata Packet Loss Single Server

4.2.1.3 Throughput

Nilai throughput yang dihasilkan pada pengujian single server paling

tinggi pada server1 yaitu 189274.875 bps dan terendah pada server2 yaitu

130256.078 bps. Sedangkan server3 memiliki throughput sebesar 172152.600

bps.Nilai throughput ini berbanding terbalik dengan nilai packet loss.Karena nilai

throughput berpengaruh pada besarnya packet yang berhasil terkirim.Grafik

throughput dapat dilihat pada Tabel 4.3.

Tabel 4.3 Data Throughput Tanpa CDN (Single Server)

Percobaan Throughput (bps)

Server1 Server2 Server3 1 192719.400 134696.433 166113.593 2 190155.100 130402.567 160544.852 3 190188.333 130787.967 160500.852

0,00% 10,00% 20,00% 30,00% 40,00% 50,00% 60,00%

1 2 3

P

ac

ke

t L

os

s

(55)

4 190787.767 130511.167 513913.567 5 189199.900 130426.600 144157.467 6 189809.333 130537.600 160130.185 7 188265.400 130488.300 160337.667 8 190858.000 130280.433 160556.000 9 189921.000 130278.933 159639.963 10 190407.533 130655.800 144944.333 11 190066.333 130779.933 160351.037 12 190864.767 129995.000 144057.467 13 188967.367 130962.067 144448.167 14 189747.533 130586.333 144330.667 15 190521.700 130527.500 144276.100 16 189995.967 130703.100 144673.433 17 191257.467 130519.700 160200.815 18 189295.600 130345.200 144075.400 19 188625.333 130127.100 160809.593 20 173843.667 121509.833 164990.852 Rata-Rata 189274.875 130256.078 172152.600

Untuk melihat perubahan tiap perobaan dapat dilihat pada Gambar 4.5.Dari

Gambar 4.5 dapat dilihat bahwa pada Single Server1 dan Single Server3

perubahan nilai throughtput lebih stabil daripada Single Server2 yang nilainya

lebih bervariasi.

Gambar 4.5 KarateristikThroughput Single Server

(56)

Perbandingan nilai rata-rata 20 kali percobaan untuk parameter throughput

dapat dilihat pada Gambar 4.6.

Gambar 4.6 Karateristik Rata-Rata Throughput Single Server

4.2.2 Penerapan Jaringan CDN

Setelah dilakukan pengujian jaringan dengan single server dan jaringan

CDN, maka dilakukan analisis perbandingan antara hasil pengujian dengan single

server dan setelah pengimplementasian jaringan CDN yang sudah dirancang pada

BAB 3.

4.2.2.1 Delay

Data perbandingan nilai rata-rata delay single server dan jaringan CDN dari

20 kali percobaan dapat dilihat pada Tabel 4.4. Gambar 4.7 menunjukkan

perubahan pada setiap percobaan single server dan jaringan CDN. Dimana delay

rata-rata yang ditampilkan adalah nilai rata-rata dari ketiga single server. Dari

tabel dan grafik dapat dilihat bahwa besar delay dari single server lebih besar

dibandingkan dengan setelah penerapan CDN. Karena dengan menggunakan 0

50000 100000 150000 200000

Server1 Server2 Server3

T

hr

o

g

hp

ut

(bps

)

(57)

jaringan CDN maka kerja single server akan terbagi dan tidak hanya diberatkan

ke satu server saja.

Tabel 4.4 PerbandinganDelay Single Server dan Jaringan CDN

Percobaan Delay (s)

Single Server LC RR WRR

1 0.2643734 0.0746518 0.1308019 0.0867261 2 0.2803317 0.0753887 0.1332597 0.0873026 3 0.2803630 0.0754475 0.1329682 0.0873266 4 0.2801863 0.0754226 0.1324716 0.0875090 5 0.2803377 0.0754603 0.1312684 0.0874620 6 0.2797450 0.0755161 0.1343835 0.0873571 7 0.2796914 0.0754689 0.1344546 0.0875764 8 0.2803081 0.0753665 0.1341323 0.0872529 9 0.2803715 0.0753349 0.1322128 0.0875321 10 0.2802040 0.0753718 0.1333128 0.0878038 11 0.2803726 0.0753445 0.1313691 0.0875302 12 0.2804693 0.0753225 0.1258215 0.0876810 13 0.2792903 0.0749631 0.1352767 0.0873321 14 0.2803713 0.0753554 0.1358861 0.0871902 15 0.2802813 0.0753685 0.1338490 0.0872989 16 0.2799121 0.0753075 0.1332214 0.0874576 17 0.2802995 0.0754791 0.1324805 0.0873271 18 0.2798484 0.0753961 0.1326009 0.0875185 19 0.2796439 0.0754741 0.1346084 0.0876176 20 0.2795290 0.0760313 0.1473450 0.0882532 Rata-Rata 0.2792965 0.0753736 0.1335862 0.0874527

(58)

Gambar 4.7 menunjukkan delay pada setiap percobaan ketiga algoritma

Load Balancer lebih baik dibandingkan dengan rata-rata ketiga single server.

Rata-rata nilai total delay pada jaringan CDN dan single server ditunjukkan pada

Gambar 4.8.

Gambar 4.8 PerbandinganDelaySingle Server dan Jaringan CDN

Menurut standard TIPHON (Telecommunicationsand Internet Protocol

HarmonizationOverNetworks), maka delay pada ketiga algoritma CDN masuk ke

kategori sangat bagus (<150 ms), dan nilai delaysingle server masuk ke kategori

bagus (150 s/d 300 ms).

4.2.2.2 Packet Loss

Perbandingan hasil simulasi dari single server dan jaringan CDN untuk

parameter packet loss dapat dilihat pada Tabel 4.5.Dari Tabel 4.5 dapat dilihat

bahwa kinerja jaringan CDN untuk parameter packet loss jauh lebih baik daripada

single server.Hal ini juga disebabkan kinerja tunggal single server terlalu berat

untuk melayani permintaan downling video dari 10 client secara bersama-sama.

Dengan jaringan CDN kinerja akan lebih baik karena tugas server utama akan 0,00

0,05 0,10 0,15 0,20 0,25 0,30

D

ela

y

(s

)

Single Server Jaringan CDN

Single Server

(59)

lebih ringan dengan membagi tugas dengan server bayangan pada jaringan CDN

yang telah dibangun.

Tabel 4.5 PerbandinganPacket Loss Single Server dan Jaringan CDN

Percobaan Packet Loss

Single Server LC RR WRR

1 42.72% 2.25% 12.54% 14.68% 2 43.95% 2.48% 13.53% 13.72% 3 43.89% 2.52% 13.26% 13.50% 4 43.88% 2.42% 13.26% 13.62% 5 43.79% 2.40% 13.40% 13.70% 6 43.92% 2.58% 13.51% 13.78% 7 43.95% 2.30% 13.58% 14.07% 8 43.76% 2.50% 13.52% 13.85% 9 45.28% 2.56% 13.58% 13.81% 10 43.95% 2.48% 13.26% 13.79% 11 43.82% 2.54% 12.98% 13.68% 12 43.93% 2.49% 12.51% 13.53% 13 43.95% 2.51% 13.71% 13.72% 14 43.85% 2.40% 13.55% 13.91% 15 43.92% 2.31% 13.31% 13.84% 16 43.84% 2.45% 13.55% 13.52% 17 43.79% 2.49% 13.42% 13.76% 18 44.01% 2.32% 13.28% 13.49% 19 44.10% 2.56% 13.49% 13.70% 20 49.56% 10.25% 20.16% 20.14% Rata-Rata 44.19% 2.84% 13.67% 14.09%

Untuk melihat pergerakan perubahan packet loss pada seetiap percobaan

dapat dilihat pada Gambar 4.9 yang menunjukkan bahwa perubahan pada single

server dan ketiga algoritma Load Balancer stabil.Tetapi Grafik menunjukkan

bahwa besarnya nilai packet loss dari Single Server jauh lebih besar daripada

(60)

Gambar 4.9 KarateristikPacket Loss Single Server dan Jaringan CDN

Gambar 4.10 PerbandinganPacket Loss Single Server dan jaringan CDN

Menurut standard TIPHON (Telecommunicationsand Internet Protocol

HarmonizationOverNetworks) besar nilai rata-rata dari 20 kali percobaan single

server masuk dalam kategori jelek/buruk (>25%). Sedangkan jaringan CDN untuk

algoritma Least Connection (LC) masuk dalam kategori bagus (<3%) dan untuk

dua algoritma lainnya Round Robin (RR) dan Weighted Round Robin (WRR)

(61)

4.2.2.3 Throughput

Nilai perbandingan throughput dari 20 kali percobaanSingle Server dan

jaringan CDN ditunjukkan pada Tabel 4.6.

Tabel 4.6 PerbandinganThroughput Single Server dan Jaringan CDN

Percobaan Throughput (bps)

Single Server LC RR WRR

1 164509.809 281036.167 253021.033 250925.400 2 160367.506 280361.367 250547.000 249443.600

3 160492.384 271078.000 251187.967 250129.100

4 146886.398 280532.133 250932.733 249870.900 5 154594.656 280970.400 250541.667 249427.400

6 160159.040 280150.767 250467.633 249657.033 7 159697.122 280792.267 246542.533 248756.800

8 160564.811 280110.833 247307.500 249474.933

9 159946.632 280046.567 249940.867 249601.067 10 155335.889 280215.300 251406.200 249725.900

11 160399.101 280173.833 251726.000 250564.500 12 154972.411 280384.867 253235.000 250367.867

13 154792.533 280321.900 249307.967 249985.167

14 154888.178 280545.567 250235.600 249315.800 15 155108.433 280665.633 250680.200 249042.700 16 155124.167 254785.739 250275.067 249894.300 17 160659.327 280420.433 250594.967 249595.567 18 154572.067 280672.000 251065.167 250291.967 19 159854.009 279955.400 250593.567 249471.467 20 153448.117 258499.800 231759.100 230527.033 Rata-Rata 157318.629 277585.949 249568.388 248803.425

Dari Tabel 4.6 dapat dilihat bahwa dengan menggunakan jaringan CDN

maka nilai throughput akan semakin tinggi dan dengan demikian besarnya packet

(62)

rata-rata throughput setelah 20 kali percobaan diatas 200000 bps, dibandingakan

dengan single server yang memiliki nilai throughput lebih kecil dari 200000 bps.

Gambar 4.11 menunjukkan perubahan nilai throughput dalam 20 kali

percobaan.Dapat dilihat bahwa nilai throughput 20 kali percobaan pada single

server dibawah jaringan CDN.

Gambar 4.11Karateristik Perbandingan ThroughputSetiap Percobaan

Gambar 4.12 menunjukkan perbandingan throughput antara single server

dan jaringan CDN.

(63)

Nilaithroughput jaringan CDN lebih tinggi daripada jaringan Single Server.

Ini berarti dengan jaringan CDN maka kemampuan jaringan akan lebih meningkat

dalam mentransmisikan bit-bit video.

Dari simulasi yang sudah dilakukan, nilai delay, packet loss, dan throughput

dari algoritma least connection lebih baik daripada algorima round robin dan

(64)

BAB 5

KESIMPULAN DAN SARAN

5.1.Kesimpulan

Berdasarkan simulasi dan analisa data, adapun beberapa kesimpulan pada

Tugas Akhir ini adalah sebagai berikut:

1. Dari hasil simulasi single server dan jaringan CDN, penggunaan jaringan

CDN akan meningkatkan QoS dari jaringan internet, ini dibuktikan dengan

nilai parameter delay, packet loss, dan throughtput yang semakin membaik

dengan menggunakan algoritma jaringan CDN.

2. Nilai rata-rata 20 kali percobaan delay pada single server yaitu0.279 detik.

Setelah penerapan jaringan CDN dengan Load Balancer ketiga algoritma

maka delay yang diperoleh lebih baik. Dengan algoritma LC diperoleh delay

0,075 detik atau turun 0.204 detik. Dengan algoritma RR diperoleh delay

0,134 detik atau turun 0,145 detik. Dengan algoritma WRR diperoleh delay

0,087 detik atau turun 0,192 detik.

3. Nilai rata-rata 20 kali percobaan packet loss pada single server yaitu44,19%.

Setelah penerapan CDN dengan Load Balancer ketiga algoritma diperoleh

packet loss yang lebih baik. Dengan algoritma LC diperoleh packet

loss2.82% atau turun 41,35%. Dengan algoritma RR diperoleh packet

loss13.95% atau turun 30,52%. Dan dengan algoritma WRR diperoleh packet

loss14,09% atau turun 30,1%.

4. Nilai rata-rata 20 kali percobaan throughput pada single server yaitu157319

(65)

maka delay yang diperoleh lebih baik. Dengan algoritma LC diperoleh

throughput 277586 bps atau naik 43,33%. Dengan algoritma RR diperoleh

throughput 249568 bps atau naik 36,96%. Dan dengan algoritma WRR

diperoleh throughput248803 bps atau naik 36,77%.

5. Dari ketiga algoritma Load Balancer least connection, round robin (RR), dan

weighted round robin (WRR) yang memiliki nilai rata-rata dari parameter

yang lebih baik adalah algoritma least connection.

5.2. Saran

Adapun saran untuk tugas akhir ini adalah:

1. Untuk tugas akhir selanjutnya dapat dilakukan dengan penambahan jumlah

client dan server.

2. Untuk tugas akhir selanjutnya dapat dilakukan penerapan Load Balancer

(66)

BAB 2

TINJAUAN PUSTAKA

2.1. Content Delivery Network (CDN)

CDN adalah sebuah sistem jaringan server untuk mendistribusikan konten

yang ada dalam sebuah aplikasi/web ke berbagai pengakses/pengguna di berbagai

belahan dunia agar data/konten yang dikirim dan diterima lebih cepat. CDN

diperuntukkan untuk website atau aplikasi yang pengaksesnya dari berbagai

belahan dunia. [1]

Server jaringan CDN terdistribusi secara global dengan tujuan untuk

melayani konten ke pengguna dengan ketersediaan yang besar dan performa

tinggi. CDN melayani sebagian besar konten di internet saat ini, termasuk objek

web (teks, grafis dan script), obyek download (file media, software), aplikasi

(e-commerce, portal), media live streaming, on-demand streaming media, dan

jaringan sosial. [2]

Konsep CDN adalah dengan meletakkan beberapa server pada belahan

dunia, sehingga server utama (asli) tidak akan langsung melayani permintaan web

request secara langsung melainkan melalui server-server pada jaringan CDN.

Keuntungannya, server asli tidak akan mengalami drop akibat banyaknya

permintaan dari pengguna internet, dan efisiensi terhadap delay dan packet loss

Gambar

Gambar 3.3Diagram Alir Rancangan Penelitian
Tabel 3.1: Spesifikasi Trafik Video
Gambar 3.4Network Configuration
Gambar 3.3 Implementasi Load Balancer pada Jaringan CDN
+7

Referensi

Dokumen terkait

Expenditure Cycle Planning raw materiaL PayroLL Cycle Estimate Labor cost..

Sehubungan dengan surat penawaran saudara untuk paket pekerjaan Pemagaran Lahan Tempat Sandar Kapal Kantor SAR Kupang, berdasarkan hasil evaluasi Pokja Kantor SAR

Sehubungan dengan surat penawaran saudara untuk paket pekerjaan Pematangan Lahan Tempat Sandar Kapal Kantor SAR Kupang berdasarkan hasil evaluasi Pokja Kantor SAR

KBSN- 45/II/BSN-2016 Tanggal 29 Februari 2016, dengan ini menetapkan calon pemenang Seleksi Sederhana Jasa Konsultansi Badan Usaha Perencanaan Pembangunan Gedung

Perusahaan yang telah mengikuti pelelangan pada pekerjaan tersebut diatas yang keberatan dengan pengumuman ini dapat mengajukan sanggahan.. Sanggahan harus

KBSN-45/II/BSN-2016 tanggal 29 Pebruari 2016, dengan ini menetapkan calon pemenang e-Lelang Pemilihan Langsung Pemagaran Lahan Tempat Sandar Kapal Kantor SAR Kupang

Berdasarkan Berita Acara Hasil Pelelangan Pekerjaan Pematangan Lahan Tempat Sandar Kapal Kantor SAR Kupang Nomor: KU.002.20/10/POKJA/SAR KPG-2016 tanggal 29 April

Jadi dapat disimpulkan bahwa kinerja pegawai adalah prestasi kerja atau hasil kerja baik dari kualitas dan kuantitas yang dicapai pegawai persatuan periode waktu dalam