The files described in this section are too numerous to enumerate here. Basically it covers most files matching the regular expression ~ns/dccp*.{cc, h}.
Applications can access DCCP agents via the []sendmsg function in C++,
or via the send or sendmsg methods in OTcl, as described in
section
.
The following is a simple example of how a DCCP CCID2 agent may be used in a program. In the example, the CBR traffic generator is started at time 1.0, at which time the generator begins to periodically call the DCCP agent []sendmsg function.
set ns [new Simulator]
set sender [$ns node]
set receiver [$ns node]
$ns duplex-link $sender $receiver 5Mb 2ms DropTail
set dccp0 [new Agent/DCCP/TCPlike]
$dccp0 set window_ 7000
set dccpsink0 [new Agent/DCCP/TCPlike]
$ns attach-agent $sender $dccp0
$ns attach-agent $receiver $dccpsink0
set cbr0 [new Application/Traffic/CBR]
$cbr0 attach-agent $dccp0
$cbr0 set packetSize_ 160
$cbr0 set rate_ 80Kb
$ns connect $dccp0 $dccpsink0
$ns at 1.0 "$cbr0 start"
The following example uses DCCP CCID3.
set ns [new Simulator]
set sender [$ns node]
set receiver [$ns node]
$ns duplex-link $sender $receiver 5Mb 2ms DropTail
set dccp0 [new Agent/DCCP/]
set dccpsink0 [new Agent/DCCP/TFRC]
$ns attach-agent $sender $dccp0
$ns attach-agent $receiver $dccpsink0
set cbr0 [new Application/Traffic/CBR]
$cbr0 attach-agent $dccp0
$cbr0 set packetSize_ 160
$cbr0 set rate_ 80Kb
$ns connect $dccp0 $dccpsink0
$ns at 1.0 "$cbr0 start"
Tom Henderson 2014-12-17