HI NS2 user, I'm facing 2 problems when I try to simulate RTP in NS2.
- The first, I don't known exactly what is the port of RTP, RTCP protocol
in NS2. I must write the new code in C++, so I need to know this
information. Can you tell me?
- The second, I simulate success the RTP in NS2 and create tracefile with
this example code:
> #End simulation time ($end_sim_time)
> # this file contain the variable end_sim_time
> #source last_time.tcl
>
> set ns [new Simulator]
> set end_sim_time 10.0
>
> #Open the nam trace file
> set nf [open final.nam w]
> set tf [open final.tr w]
>
> $ns namtrace-all $nf
> $ns trace-all $tf
>
> #Define a 'finish' procedure
> proc finish {} {
> global ns nf tf
> $ns flush-trace
> #Close the trace file
> close $nf
> close $tf
> #Execute nam on the trace file
> exec nam final.nam &
> exit 0
> }
>
> set node_(s1) [$ns node]
> set node_(s2) [$ns node]
> set node_(r1) [$ns node]
>
> $ns duplex-link $node_(s1) $node_(r1) 10Mb 5ms DropTail
> $ns duplex-link $node_(s2) $node_(r1) 10Mb 5ms DropTail
>
> set trace_file [new Tracefile]
> $trace_file filename starwars.nsformat
>
> set RTP_s [new Agent/RTP]
> set RTCP_r [new Agent/RTCP]
>
> set self [new Session/RTP]
>
> $ns attach-agent $node_(s1) $RTP_s
> $ns attach-agent $node_(s2) $RTCP_r
> $ns connect $RTP_s $RTCP_r
>
> set video [new Application/Traffic/Trace]
> $video attach-tracefile $trace_file
> $video attach-agent $RTP_s
>
> $RTCP_r session $self
> $RTP_s session $self
>
> $RTCP_r set interval_ 100ms
>
> $RTP_s set packetSize_ 1064
>
> $ns at 0.0 "$video start"
> $ns at 0.0 "$RTCP_r start"
> $ns at $end_sim_time {
> $video stop
> $RTCP_r stop
> #$RTP_s stop
> finish
> }
>
> $ns run
>
> In this Tracefile I saw the protocol rtp. But when I try to add one node to
> change the topology like this:
set node_(s1) [$ns node]
set node_(s2) [$ns node]
>
set node_(r1) [$ns node]
> set node_(r2) [$ns node]
> $ns duplex-link $node_(s1) $node_(r1) 10Mb 5ms DropTail
$ns duplex-link $node_(s2) $node_(r2) 10Mb 5ms DropTail
> $ns duplex-link $node_(r1) $node_(r2) 10Mb 5ms DropTail
>
In new tracefile after add the r2 node, I can't see the RTP protocol,
It just have RTCP protocol. What's the reason of this Problem?
Thanks and Best regard!