Ex - No 8
Ex - No 8
Aim:
Algorithm:
Step 3: Using the foresaid object write all the trace output into the file
Step 4: Using an object create a file to write all nam window output into it
Step 10: Create a TCP agent and attach to node 0 and TCP sink to node 3
Step 11: Create a UDP agent and attach to node 1 and null agent to node 3
Step 13: Invoke ftp agent to generate traffic of 1 mbps and attach to UDP agent
Step 14: Invoke CBR agent to generate traffic of 1 mbps and attach to TCP agent
Step 15: Invoke the data transmission process for TCP and UDP at 0.1 second
Step 17: Vary the bandwidth of the link and check the how TCP and UDP behaves in NAM
window
Program:
$ns trace-all $f
proc finish {} {
global ns nf
$ns flush-trace
close $nf
exit 0
$ns run
Output:
Result: