Sn Labwork Whole

38
Practical-01 Aim:-Consider a small network with five nodes n0,n1, n2, n3, n4, forming a star topology. The node n4 is at the center. Node n0 is a TCP source, which transmits packets to node n3 (a TCP sink) through the node n4. Node n1 is another traffic source, and sends UDP packets to node n2 through n4. The duration of the simulation time is 10 seconds. Write a Tclscript to simulate this scenario. #Create a simulator object set ns [new Simulator] #Define different colors for data flows $ns color 1 Blue $ns color 2 Red #Open the nam trace file set nf [open out.nam w] $ns namtrace-all $nf #Define a 'finish' procedure proc finish {} { global ns nf $ns flush-trace #Close the trace file close $nf #Execute nam on the trace file exec nam out.nam & exit 0 } #Create four nodes set n0 [$ns node] set n1 [$ns node] set n2 [$ns node] set n3 [$ns node] set n4 [$ns node] #Create links between the nodes $ns duplex-link $n0 $n4 1Mb 10ms DropTail Rollno-M11CE09 Page 1

Transcript of Sn Labwork Whole

Practical-01

Aim:-Consider a small network with five nodes n0,n1, n2, n3, n4, forming a star topology. The node n4 is at the center. Node n0 is a TCP source, which transmits packets to node n3 (a TCP sink) through the node n4. Node n1 is another traffic source, and sends UDP packets to node n2 through n4. The duration of the simulation time is 10 seconds. Write a Tclscript to simulate this scenario.

#Create a simulator objectset ns [new Simulator]

#Define different colors for data flows$ns color 1 Blue$ns color 2 Red

#Open the nam trace fileset nf [open out.nam w]$ns namtrace-all $nf

#Define a 'finish' procedureproc finish {} { global ns nf $ns flush-trace

#Close the trace file close $nf

#Execute nam on the trace file exec nam out.nam & exit 0}

#Create four nodesset n0 [$ns node]set n1 [$ns node]set n2 [$ns node]set n3 [$ns node]set n4 [$ns node]

#Create links between the nodes$ns duplex-link $n0 $n4 1Mb 10ms DropTail$ns duplex-link $n1 $n4 1Mb 10ms DropTail$ns duplex-link $n2 $n4 1Mb 10ms SFQ$ns duplex-link $n3 $n4 2Mb 10ms SFQ

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

#Monitor the queue for the link between node 2 and node 3

Rollno-M11CE09 Page 1

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

#Create a TCP agent and attach it to node n0set tcp0 [new Agent/TCP]$tcp0 set class_ 1$ns attach-agent $n0 $tcp0

# Create a CBR traffic source and attach it to udp0set cbr0 [new Application/Traffic/CBR]$cbr0 set packetSize_ 500$cbr0 set interval_ 0.005$cbr0 attach-agent $tcp0

#Create a UDP agent and attach it to node n1set udp0 [new Agent/UDP]$udp0 set class_ 2$ns attach-agent $n1 $udp0

# Create a CBR traffic source and attach it to udp1set cbr1 [new Application/Traffic/CBR]$cbr1 set packetSize_ 500$cbr1 set interval_ 0.005$cbr1 attach-agent $udp0

#Create a Null agent (a traffic sink) and attach it to node n3set tsink0 [new Agent/TCPSink]$ns attach-agent $n2 $tsink0

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

#Connect the traffic sources with the traffic sink$ns connect $tcp0 $tsink0 $ns connect $udp0 $null1

#Schedule events for the CBR agents$ns at 0.5 "$cbr0 start"$ns at 1.0 "$cbr1 start"$ns at 4.0 "$cbr1 stop"$ns at 4.5 "$cbr0 stop"#Call the finish procedure after 5 seconds of simulation time$ns at 5.0 "finish"

#Run the simulation$ns run

Rollno-M11CE09 Page 2

Practical-02

Aim:- Aim:- Consider a client and a server. The server is running a FTP application (over

TCP). The client sends a request to download a file of size 10 MB from the server. Write a script to simulate this scenario. Let node #0 be the server and node #1 be the client. TCP packetsize is 1500 B. Assume typical values for other parameters.

#Create a simulator objectset ns [new Simulator]

#Open the nam trace fileset nf [open out.nam w]$ns namtrace-all $nf

#Define a 'finish' procedureproc finish {} { global ns nf $ns flush-trace

#Close the trace file close $nf

#Execute nam on the trace file exec nam out.nam & exit 0}

#Create two nodesset n0 [$ns node]set n1 [$ns node]

#Create a duplex link between the nodes$ns duplex-link $n0 $n1 10Mb 10ms DropTail

# Insert your own code for topology creation# and agent definitions, etc. here

set src [new Agent/TCP]set sink [new Agent/TCPSink]$ns attach-agent $n0 $src$ns attach-agent $n1 $sink$ns connect $src $sink$src set packetSize_ 1500

$src listen# $src set window 100

set ftp1 [new Application/FTP]$ftp1 attach-agent $src# $ftp1 produce 6850

Rollno-M11CE09 Page 3

set n [expr 10*1024*1024]$ns at 1.0 "$ftp1 start"

$ns at 1.5 "$ftp1 send n"$ns at 3.0 "$ftp1 stop"#Call the finish procedure after 5 seconds simulation time$ns at 10.0 "finish"

#Run the simulation$ns run

Rollno-M11CE09 Page 4

Practical-03Part-A

Write a .tcl file for various TCP flavors

(1)TCP Reno(2)TCP New Reno(3)TCP Sack(4)TCP Taheo(5)TCP Vegas

Scenario-1

set ns [new Simulator]

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

#Open the Trace filesset file1 [open out.tr w]set winfile [open WinFile w]$ns trace-all $file1

#Open the NAM trace fileset file2 [open out.nam w]$ns namtrace-all $file2

#Define a 'finish' procedureproc finish {} { global ns file1 file2 $ns flush-trace close $file1 close $file2 exec nam out.nam & exit 0}

#Create six nodesset n0 [$ns node]set n1 [$ns node]set n2 [$ns node]set n3 [$ns node]set n4 [$ns node]set n5 [$ns node]

#Create links between the nodes

Rollno-M11CE09 Page 5

$ns duplex-link $n0 $n2 2Mb 10ms DropTail$ns duplex-link $n1 $n2 2Mb 10ms DropTail$ns simplex-link $n2 $n3 0.3Mb 100ms DropTail$ns simplex-link $n3 $n2 0.3Mb 100ms DropTail$ns duplex-link $n3 $n4 0.5Mb 40ms DropTail$ns duplex-link $n3 $n5 0.5Mb 30ms 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 simplex-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$ns queue-limit $n2 $n3 20

#Setup a TCP connectionset tcp [new Agent/TCP/Vegas]$ns attach-agent $n0 $tcpset sink [new Agent/TCPSink/DelAck]$ns attach-agent $n4 $sink$ns connect $tcp $sink$tcp set fid_ 1$tcp set window_ 8000$tcp set packetSize_ 552

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

#Setup a UDP connectionset udp [new Agent/UDP]$ns attach-agent $n1 $udpset null [new Agent/Null]$ns attach-agent $n5 $null$ns connect $udp $null$udp set fid_ 2

#Setup a CBR over UDP connectionset cbr [new Application/Traffic/CBR]$cbr attach-agent $udp$cbr set type_ CBR$cbr set packet_size_ 1000$cbr set rate_ 0.01mb$cbr set random_ false

$ns at 0.1 "$cbr start"$ns at 1.0 "$ftp start"$ns at 124.0 "$ftp stop"$ns at 124.5 "$cbr stop"

# next procedure gets two arguments: the name of the

Rollno-M11CE09 Page 6

# tcp source node, will be called here "tcp",# and the name of output file.

proc plotWindow {tcpSource file} {global nsset time 0.1set 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" }$ns at 0.1 "plotWindow $tcp $winfile"

$ns at 125.0 "finish"$ns run

Graph for Time Vs Congestion Window size

Tahoe cwnd

Rollno-M11CE09 Page 7

Reno

Newreno

Rollno-M11CE09 Page 8

Vegas

Sack1

Rollno-M11CE09 Page 9

Scenariao-2set ns [new Simulator]

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

#Open the Trace filesset file1 [open out.tr w]set winfile [open WinFile w]$ns trace-all $file1

#Open the NAM trace fileset file2 [open out.nam w]$ns namtrace-all $file2

#Define a 'finish' procedureproc finish {} { global ns file1 file2 $ns flush-trace close $file1 close $file2 exec nam out.nam & exit 0}

#Create six nodesset n0 [$ns node]set n1 [$ns node]set n2 [$ns node]set n3 [$ns node]set n4 [$ns node]set n5 [$ns node]

#Create links between the nodes$ns duplex-link $n0 $n2 2Mb 10ms DropTail$ns duplex-link $n1 $n2 2Mb 10ms DropTail$ns simplex-link $n2 $n3 2Mb 100ms DropTail$ns simplex-link $n3 $n2 1Mb 100ms DropTail$ns duplex-link $n3 $n4 2Mb 40ms DropTail$ns duplex-link $n3 $n5 2Mb 30ms 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 simplex-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$ns queue-limit $n2 $n3 20

Rollno-M11CE09 Page 10

#Setup a TCP connectionset tcp [new Agent/TCP/Vegas]$ns attach-agent $n0 $tcpset sink [new Agent/TCPSink]$ns attach-agent $n4 $sink$ns connect $tcp $sink$tcp set fid_ 1$tcp set window_ 8000$tcp set packetSize_ 552

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

#Setup a UDP connectionset udp [new Agent/UDP]$ns attach-agent $n1 $udpset null [new Agent/Null]$ns attach-agent $n5 $null$ns connect $udp $null$udp set fid_ 2

#Setup a CBR over UDP connectionset cbr [new Application/Traffic/CBR]$cbr attach-agent $udp$cbr set type_ CBR$cbr set packet_size_ 1000$cbr set rate_ 0.01mb$cbr set random_ false

$ns at 0.1 "$cbr start"$ns at 1.0 "$ftp start"$ns at 124.0 "$ftp stop"$ns at 124.5 "$cbr stop"

# next procedure gets two arguments: the name of the# tcp source node, will be called here "tcp",# and the name of output file.

proc plotWindow {tcpSource file} {global nsset time 0.1set 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" }$ns at 0.1 "plotWindow $tcp $winfile"

$ns at 125.0 "finish"$ns run

Rollno-M11CE09 Page 11

Graph for Time Vs Congestion Window size

Conclusion:- average window size of vegas is more compared to other tcp flavers and after some time window size of vegas become constant.

Rollno-M11CE09 Page 12

Part-B

largeQ size(scenario-1)

Conclusion:- for the large queue size the average window size become more by reducing the number of times going into the slowstart pahse.

Rollno-M11CE09 Page 13

Part-C

Bottleneck bw 1mb(scenario-1)

Conclusion:- By increasing the bottleneck bandwidth average window size of tcp(tahoe) is increase by readucing the number of times going in to slow start phase.

Rollno-M11CE09 Page 14

Practical-04

To analyze the throughput achieved by Various TCP flavours

(1)TCP Reno(2)TCP New Reno(3)TCP Sack(4)TCP Taheo(5)TCP Vegas

Part-A

Scenario-1

set ns [new Simulator]

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

#Open the Trace filesset file1 [open out.tr w]set winfile [open WinFile w]$ns trace-all $file1

#Open the NAM trace fileset file2 [open out.nam w]$ns namtrace-all $file2

#Define a 'finish' procedureproc finish {} { global ns file1 file2 $ns flush-trace close $file1 close $file2 exec nam out.nam & exit 0}

#Create six nodesset n0 [$ns node]set n1 [$ns node]set n2 [$ns node]set n3 [$ns node]set n4 [$ns node]set n5 [$ns node]

#Create links between the nodes

Rollno-M11CE09 Page 15

$ns duplex-link $n0 $n2 2Mb 10ms DropTail$ns duplex-link $n1 $n2 2Mb 10ms DropTail$ns simplex-link $n2 $n3 0.3Mb 100ms DropTail$ns simplex-link $n3 $n2 0.3Mb 100ms DropTail$ns duplex-link $n3 $n4 0.5Mb 40ms DropTail$ns duplex-link $n3 $n5 0.5Mb 30ms 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 simplex-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$ns queue-limit $n2 $n3 20

#Setup a TCP connectionset tcp [new Agent/TCP/Vegas]$ns attach-agent $n0 $tcpset sink [new Agent/TCPSink/DelAck]$ns attach-agent $n4 $sink$ns connect $tcp $sink$tcp set fid_ 1$tcp set window_ 8000$tcp set packetSize_ 552

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

#Setup a UDP connectionset udp [new Agent/UDP]$ns attach-agent $n1 $udpset null [new Agent/Null]$ns attach-agent $n5 $null$ns connect $udp $null$udp set fid_ 2

#Setup a CBR over UDP connectionset cbr [new Application/Traffic/CBR]$cbr attach-agent $udp$cbr set type_ CBR$cbr set packet_size_ 1000$cbr set rate_ 0.01mb$cbr set random_ false

$ns at 0.1 "$cbr start"$ns at 1.0 "$ftp start"$ns at 124.0 "$ftp stop"$ns at 124.5 "$cbr stop"

# next procedure gets two arguments: the name of the

Rollno-M11CE09 Page 16

# tcp source node, will be called here "tcp",# and the name of output file.

proc plotWindow {tcpSource file} {global nsset time 0.1set 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" }$ns at 0.1 "plotWindow $tcp $winfile"

$ns at 125.0 "finish"$ns run

Throughput at node-2

New reno

Rollno-M11CE09 Page 17

Reno

Sack

Rollno-M11CE09 Page 18

Tcp tahoe

Vegas

Rollno-M11CE09 Page 19

Scenariao-2set ns [new Simulator]

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

#Open the Trace filesset file1 [open out.tr w]set winfile [open WinFile w]$ns trace-all $file1

#Open the NAM trace fileset file2 [open out.nam w]$ns namtrace-all $file2

#Define a 'finish' procedureproc finish {} { global ns file1 file2 $ns flush-trace close $file1 close $file2 exec nam out.nam & exit 0}

#Create six nodesset n0 [$ns node]set n1 [$ns node]set n2 [$ns node]set n3 [$ns node]set n4 [$ns node]set n5 [$ns node]

#Create links between the nodes$ns duplex-link $n0 $n2 2Mb 10ms DropTail$ns duplex-link $n1 $n2 2Mb 10ms DropTail$ns simplex-link $n2 $n3 2Mb 100ms DropTail$ns simplex-link $n3 $n2 1Mb 100ms DropTail$ns duplex-link $n3 $n4 2Mb 40ms DropTail$ns duplex-link $n3 $n5 2Mb 30ms 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 simplex-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$ns queue-limit $n2 $n3 20

Rollno-M11CE09 Page 20

#Setup a TCP connectionset tcp [new Agent/TCP/Vegas]$ns attach-agent $n0 $tcpset sink [new Agent/TCPSink]$ns attach-agent $n4 $sink$ns connect $tcp $sink$tcp set fid_ 1$tcp set window_ 8000$tcp set packetSize_ 552

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

#Setup a UDP connectionset udp [new Agent/UDP]$ns attach-agent $n1 $udpset null [new Agent/Null]$ns attach-agent $n5 $null$ns connect $udp $null$udp set fid_ 2

#Setup a CBR over UDP connectionset cbr [new Application/Traffic/CBR]$cbr attach-agent $udp$cbr set type_ CBR$cbr set packet_size_ 1000$cbr set rate_ 0.01mb$cbr set random_ false

$ns at 0.1 "$cbr start"$ns at 1.0 "$ftp start"$ns at 124.0 "$ftp stop"$ns at 124.5 "$cbr stop"

# next procedure gets two arguments: the name of the# tcp source node, will be called here "tcp",# and the name of output file.

proc plotWindow {tcpSource file} {global nsset time 0.1set 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" }$ns at 0.1 "plotWindow $tcp $winfile"

$ns at 125.0 "finish"$ns run

Rollno-M11CE09 Page 21

Throughput at node-4(tcp sink)

Rollno-M11CE09 Page 22

Conclusion:- from above we can conclude that the performance of the different flaver of tcp are as bellow in increasing order

1)vegas 2)sack1 3) newreno 4)reno 5) tahoe

Due to the losses tahoe goes into the slowstart several times. Due to the time out because of losses reno goes into slowstart several times. The newreno ,vegas and seck1 perform good.

Rollno-M11CE09 Page 23

Part-B

For large queue(Scenario-01)

(for Tahoe)

Conclusion:- for the larger queue size the throughput of tcp(tahoe) is increase by readucing the number of times going in to slow start phase.

Rollno-M11CE09 Page 24

Part-C

Bottleneck bandwith 1Mb

(for Tahoe)

Conclusion:- By increasing the bottleneck bandwidth throughput of tcp(tahoe) is increase by readucing the number of times going in to slow start phase.

Rollno-M11CE09 Page 25

Part-D

Window size variation effect

(Scenario-2)(for tahoe)

Conclusion:- As the window size increases the throughput also increase upto certain initial values of window size.

Rollno-M11CE09 Page 26

Practical-05

Aim:-to study fairness issue between tcp and udp .

Fairness issue( tcp and udp):-set ns [new Simulator]

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

#Open the Trace filesset file1 [open out.tr w]set winfile [open WinFile w]$ns trace-all $file1

#Open the NAM trace fileset file2 [open out.nam w]$ns namtrace-all $file2

#Define a 'finish' procedureproc finish {} { global ns file1 file2 $ns flush-trace close $file1 close $file2 exec nam out.nam & exit 0}

#Create six nodesset n0 [$ns node]set n1 [$ns node]set n2 [$ns node]set n3 [$ns node]set n4 [$ns node]set n5 [$ns node]

#Create links between the nodes$ns duplex-link $n0 $n2 2Mb 10ms DropTail$ns duplex-link $n1 $n2 2Mb 10ms DropTail$ns simplex-link $n2 $n3 2Mb 100ms DropTail$ns simplex-link $n3 $n2 1Mb 100ms DropTail$ns duplex-link $n3 $n4 2Mb 40ms DropTail$ns duplex-link $n3 $n5 2Mb 30ms 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 simplex-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

Rollno-M11CE09 Page 27

#Set Queue Size of link (n2-n3) to 10$ns queue-limit $n2 $n3 20

#Setup a TCP connectionset tcp [new Agent/TCP/Vegas]$ns attach-agent $n0 $tcpset sink [new Agent/TCPSink]$ns attach-agent $n4 $sink$ns connect $tcp $sink$tcp set fid_ 1$tcp set window_ 20$tcp set packetSize_ 1000

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

#Setup a UDP connectionset udp [new Agent/UDP]$ns attach-agent $n1 $udpset null [new Agent/Null]$ns attach-agent $n5 $null$ns connect $udp $null$udp set fid_ 2

#Setup a CBR over UDP connectionset cbr [new Application/Traffic/CBR]$cbr attach-agent $udp$cbr set type_ CBR$cbr set packet_size_ 1000$cbr set rate_ 0.01mb$cbr set random_ false

$ns at 0.1 "$cbr start"$ns at 1.0 "$ftp start"$ns at 124.0 "$ftp stop"$ns at 124.5 "$cbr stop"

# next procedure gets two arguments: the name of the# tcp source node, will be called here "tcp",# and the name of output file.

proc plotWindow {tcpSource file} {global nsset time 0.1set 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" }$ns at 0.1 "plotWindow $tcp $winfile"

$ns at 125.0 "finish"

Rollno-M11CE09 Page 28

$ns run

Results:- 01

number of tcp packets sent:7764 lost:0 recived:7764number of udp packets sent:156 lost:0 recived:156number of tcp bytes transfered:8074560number of udp bytes transfered:156000tcp utilization:0.516791 Mbpsudp utilization:0.009984 Mbpstcp performance:172.905620 udp performance:3.340526

Results:- 02(change cbr rate from 0.01 to 0.4bmb)

number of tcp packets sent:7744 lost:0 recived:7744number of udp packets sent:6221 lost:0 recived:6221number of tcp bytes transfered:8053760number of udp bytes transfered:6221000tcp utilization:0.515459 Mbpsudp utilization:0.398159 Mbpstcp performance:172.460217 udp performance:133.214177

Results:- 03 (change cbr rate to 1mb)

number of tcp packets sent:7744 lost:0 recived:7744number of udp packets sent:15551 lost:0 recived:15551number of tcp bytes transfered:8053760number of udp bytes transfered:15551000tcp utilization:0.515459 Mbpsudp utilization:0.995300 Mbpstcp performance:172.460217 udp performance:333.003322

Results:- 04 (change tcp packet size from 1000 to 4000)

Rollno-M11CE09 Page 29

number of tcp packets sent:3800 lost:0 recived:3800number of udp packets sent:15551 lost:0 recived:15551number of tcp bytes transfered:3952000number of udp bytes transfered:15551000tcp utilization:0.252937 Mbpsudp utilization:0.995300 Mbpstcp performance:84.626656 udp performance:333.003322

Conclusion:- when udp and tcp use same channel for sufficient load the link utilization by udp is more as compared to tcp.

Practical-06

Rollno-M11CE09 Page 30

Aim:-Consider an INSAT-3A multipurpose geostationary satellite and two satellite terminals, one at Bangkok and the other at Baghdad. The position of Bangkok is 13.9 degree latitude north and100.9 degree longitude east. The position of Baghdad is 33.8 degree latitude north and 44.4 degree longitude east. INSAT-3A is used to provide television broadcasting from Bangkok to Baghdad. INSAT-3A is positioned at 93.5 degrees longitude East. The traffic consists of a FTP source and a CBR stream. The simulation lasts for 50 secs.

Analyze the trace file and find the following:

· End-to-end delay between two terminals

· What is the nature of the delay that you expect in this scenario

Rollno-M11CE09 Page 31

Rollno-M11CE09 Page 32

global nsset ns [new Simulator]

# Global configuration parameters# Set these global options for the satellite terminals

global optset opt(chan) Channel/Satset opt(bw_up) 2Mbset opt(bw_down) 2Mbset opt(phy) Phy/Satset opt(mac) Mac/Satset opt(ifq) Queue/DropTailset opt(qlim) 50set opt(ll) LL/Satset opt(wiredRouting) OFF

# This tracing enabling must precede link and node creation set outfile [open outinsatsol.tr w]$ns trace-all $outfile

# Set up satellite and terrestrial nodes

# Configure the node generator for bent-pipe satellite# geo-repeater uses type Phy/Repeater$ns node-config -satNodeType geo-repeater \ -phyType Phy/Repeater \ -channelType $opt(chan) \ -downlinkBW $opt(bw_down) \ -wiredRouting $opt(wiredRouting)

# GEO satellite at 93.5 degrees longitude Eastset n1 [$ns node]$n1 set-position 93.5

# Configure the node generator for satellite terminals$ns node-config -satNodeType terminal \ -llType $opt(ll) \ -ifqType $opt(ifq) \ -ifqLen $opt(qlim) \ -macType $opt(mac) \ -phyType $opt(phy) \ -channelType $opt(chan) \ -downlinkBW $opt(bw_down) \ -wiredRouting $opt(wiredRouting)

# Two terminals: one in Bangkok and one in Baghdadset n2 [$ns node]$n2 set-position 13.9 100.9; # BKset n3 [$ns node]

Output:

Rollno-M11CE09 Page 33