set ns [new Simulator] set nam_file lab-ex.nam set nf [open $nam_file w] $ns namtrace-all $nf # Create the topology # Frist, the nodes ...... # Then create the links ...... # Set the routing protocol ...... # Now create agents and attach them to the appropriate nodes ...... # Start transmitting packets from 0 to 2 ...... # Bring down the link between 1 and 2 using this command $ns rtmodel-at 0.25 down $n(0) $n(1) # Final wrapup proc finish {} { global ns nf nam_file $ns flush-trace close $nf exec nam $nam_file & exit 0 } $ns at 1.00 "finish" # Start simulator $ns run