0

i just make a simple simulation setting, but im confused when i increase the buffer size it causes more packet loss. can someone explain the reason?

set ns [new Simulator]
set tr [open out1.tr w]
$ns trace-all $tr
set ftr [open "out.nam" w]
$ns namtrace-all $ftr
set n0 [$ns node]
set n0 [$ns node]
set n0 [$ns node]
set n1 [$ns node]
set n2 [$ns node]
set n3 [$ns node]
set n4 [$ns node]
set n5 [$ns node]
$ns duplex-link $n0 $n2 10mb 10ms DropTail
$ns duplex-link $n1 $n2 10mb 10ms DropTail
$ns duplex-link $n2 $n3 1mb 10ms DropTail
$ns duplex-link $n4 $n3 10mb 10ms DropTail
$ns duplex-link $n5 $n3 10mb 10ms DropTail
$ns queue-limit $n2 $n3 50
set tcp0 [new Agent/TCP/Newreno]
$tcp0 set fid_ 1
$tcp0 set window_ 1000
set tcp1 [new Agent/TCP/Newreno]
$tcp1 set fid_ 2
$tcp1 set window_ 1000
set sink1 [new Agent/TCPSink]
set sink0 [new Agent/TCPSink]
$ns attach-agent $n0 $tcp0
$ns attach-agent $n1 $tcp1
$ns attach-agent $n4 $sink0
$ns attach-agent $n4 $sink1
$ns connect $tcp0 $sink0
$ns connect $tcp1 $sink1
set ftp0 [new Application/FTP]
$ftp0 attach-agent $tcp0
set ftp1 [new Application/FTP]
$ftp1 attach-agent $tcp1
proc finish { } {
global ns tr ftr
$ns flush-trace
close $tr
close $ftr
#exec nam out.nam &
exec awk -f output.awk out1.tr &
exec awk -f throughputtest.awk out1.tr &
exec awk -f throughputtest.awk out1.tr > dataout.xg &
exit 0
}
$ns at 0.1 "$ftp0 start"
$ns at 0.1 "$ftp1 start"
$ns at 300 "finish"
$ns run

i was set my buffer size from 50/100/150/200 but when i run the simulation, the result is packet drop increase when i increase the buffer size,please someone give me an explanation, im beginner in NS2 simulator.

  • Please explain »» from 50/100/150/200 ««. Please add the code for "buffer change" to your question. ... About ´packets dropped´ : When packets are in a queue too long they will be dropped, AFAIK. – Knud Larsen Jun 09 '18 at 09:55
  • its on line 20, i change queue limit(buffer) from 50 to 100 until 200 but each time buffer increase its also increase the drop, does it make sense? – Yoseph Teki Jun 10 '18 at 05:15
  • Line 20 : `set tcp0 [new Agent/TCP/Newreno]`. .... I.e. the file in your question. – Knud Larsen Jun 10 '18 at 09:10
  • sorry its on line 19. $ns queue-limit $n2 $n3 50 i set the buffer from 50 to 200 each simulation but drop rate is increasing. – Yoseph Teki Jun 11 '18 at 04:52
  • General info, TCP/FTP_Queue_Size : https://www.researchgate.net/publication/301601765_TCPFTP_Queue_Size_and_Packets_Drop_Performance_Simulation_Using_NS2 ..... ← Google, ns2 increasing buffer https://www.google.com/webhp?hl=all&gws_rd=ssl#hl=en&q=ns2+increasing+buffer – Knud Larsen Jun 11 '18 at 14:09
  • thankyou so much sir! its help me a lot – Yoseph Teki Jun 12 '18 at 03:42

0 Answers0