# Create event scheduler set ns [new Simulator] # Turn on tracing set nam_file lab-ex-2.nam set nf [open $nam_file w] $ns namtrace-all $nf # Create the topology # First the nodes ...... # Make the links ...... # Define the topology layout in nam $ns duplex-link-op $n(0) $n(1) orient right $ns duplex-link-op $n(1) $n(2) orient right $ns duplex-link-op $n(2) $n(3) orient right $ns duplex-link-op $n(1) $n(3) orient down $ns duplex-link-op $n(1) $n(4) orient up # Create the multicast group. Use the following line ...... # Choose the routing protocol ...... # Create the UDP agent and tie it to the multicast group ...... # Set the timing and run the script. ...... # Final wrapup proc finish {} { global ns nf nam_file $ns flush-trace close $nf exec nam $nam_file & exit 0 } $ns at 5.0 "finish" # Start the simulator $ns run