# This file is hw1-2.tmpl.txt # # Create the core event scheduler set ns [new Simulator] # Set up nam trace file set f [open p2.nam w] $ns namtrace-all $f # Create 6 nodes for {set i 0} {$i < 6} {incr i} { ... FILL IN HERE ... } # Create links # All links are of 10Mbps bandwidth and 10ms delay # except for the link between node 2 and 3 ... FILL IN HERE ... # Show queue length at the bottleneck link $ns duplex-link-op $n(2) $n(3) queuePos 0.5 # Set up queue limit of the bottleneck link ... FILL IN HERE ... # Set up routing protocol $ns rtproto DV # Create a UDP agent and attach it to node node 0 ... FILL IN HERE ... # Create a CBR traffic source and attach it to udp ... FILL IN HERE ... # Create a NULL agent and attach it to node 4 ... FILL IN HERE ... # Connect the CBR source and the destination ... FILL IN HERE ... # Create a TCP source and attach it to node 1 ... FILL IN HERE ... # Create a TCP sink and attach it to node 5 ... FILL IN HERE ... # Establish the TCP connection ... FILL IN HERE ... # Create a FTP traffic source and attach it to the TCP source ... FILL IN HERE ... # Distinguish flows by different colors $ns color 1 Blue $ns color 2 Red $udp set class_ 1 $tcp set class_ 2 # Schedule events to happen ... FILL IN HERE ... $ns at 3.0 "finish" proc finish {} { global ns f $ns flush-trace close $f exec ~csci551/nam p2.nam & exit 0 } $ns run