Usage
Back to DtnAgent Home
The following tcl excerpt deploys a DTN overlay in the topology shown at the top of the script. A full sample file is included in the tarball provided on the download page. The data transfer is originated at the dtn0 agent attached to the wiredNode(0) and targeted to the dtnSink (in this case a mobile node connected through the BS). TCP is used as the convergence layer on all nodes, while the dtnBS employs the RV mechanism as described in the Description section.
# dtn1
# / \
# dtnSink <-> dtnBS – dtn2 - dtn0
# \ /
# dtn3
set dtnSource [new Agent/DTN]
$ns_ attach-dtnagent $wiredNode(0) $dtnSource
set ftp0 [new Application/FTP]
$ftp0 attach-agent $dtnSource
set dtn1 [new Agent/DTN]
$ns_ attach-dtnagent $wiredNode(1) $dtn1
set dtn2 [new Agent/DTN]
$ns_ attach-dtnagent $wiredNode(2) $dtn2
set dtn3 [new Agent/DTN]
$ns_ attach-dtnagent $wiredNode(3) $dtn3
set dtnBS [new Agent/DTN]
$dtnBS set nIsBSNode_ 1
$ns_ attach-dtnagent $baseStationNode(0) $dtnBS
set dtnSink [new Agent/DTN]
$ns_ attach-dtnagent $wirelessNode(0) $dtnSink
$ns_ connect-dtn $dtnSource $dtn1
$ns_ connect-dtn $dtnSource $dtn2
$ns_ connect-dtn $dtnSource $dtn3
$ns_ connect-dtn $dtn1 $dtnBS
$ns_ connect-dtn $dtn2 $dtnBS
$ns_ connect-dtn $dtn3 $dtnBS
$ns_ connect-dtn $dtnBS $dtnSink
The nIsBSNode_ variable set at the dtnBS instructs the DtnAgents to employ the RV mechanism. By default the agents immediately forwards incoming data in a cut-through fashion. The DtnAgent exposes several parameters, some of which can be seen, along with the corresponding default values, in the following list:
nTCPPacketSize_ 1500
nUDPPacketSize_ 35000
nIsBSNode_ 0 # Switches the RV mechanism.
nMaxBundleSize_ 30000
fTimeout_ 2.0 # Retransmission timeout (a value of 0 disables retransmissions).
nStorageSpace_ 50000 # Available storage space at the bundle layer.
nUseTCP_ 1 # TCP or UDP convergence layer selection.
Tracing can be enabled with the Trace set show_dtnhdr_ 1 and the CMUTrace set show_dtnhdr_ 1 command as can be seen in the sample script file.