Set up a ns-2 simulation with co-existing TCP and UDP Multicast Traffic:
# Creating the core event scheduler set ns [new Simulator] # Turn on multicast support $ns multicast $ns color 1 red $ns color 2 blue # Creating 11 nodes ...FILL IN... # Outputs nam traces set nf [open out.nam w] $ns namtrace-all $nf # Creating 10 links # All with bandwidth 10Mb, delay 10ms, and DropTail queue # Except the bottleneck link with bw 1.5Mb, delay 20ms, and RED queue ...FILL IN... # Set queue limit (buffer size) to 5 packets in the bottleneck link $ns queue-limit $n(3) $n(4) ...FILL IN... $ns queue-limit $n(4) $n(3) ...FILL IN... # Set link orientation for nam ...FILL IN... # Set queue position for nam $ns duplex-link-op $n(3) $n(4) queuePos -0.5 $ns duplex-link-op $n(4) $n(3) queuePos -0.5 # Set multicast routing to dense mode ...FILL IN... # Use nam trace format for TCP variable trace, this is required by # nam visualization of TCP. Agent/TCP set nam_tracevar_ true # Create a TCP connection from node 9 to node 1 ...FILL IN... $tcp set fid_ 1 $tcp set window_ 20 # Create an FTP source and attach it to the TCP connection ...FILL IN... # Create a UDP connection from node 7 to a multicast group ...FILL IN... $udp set fid_ 2 # Create a CBR source and attach it to the UDP connection ...FILL IN... # Create dummy receivers and attach them to the receiving nodes set rcvr0 [new Agent/Null] $ns attach-agent $n(0) $rcvr0 set rcvr1 [new Agent/Null] $ns attach-agent $n(2) $rcvr1 # Schedule events to happen ...FILL IN... # A finish proc to flush traces and out call nam ...FILL IN... # Start the event scheduler $ns runprompt> ns lab2a.tcl
prompt> tcl8.0.4/unix/tclsh nam-1.0a8/bin/namfilter.tcl lab2a.nam prompt> nam lab2a.namThen click on Analysis menu, then Active Sessions. See the tcp sequence plot you get. What does it look like? Is there any packet loss? If not, can you bring some by adjusting link bandwidth, queue limit, etc.?
References: