Simulator Manual
MFTDMA-DAMA for ns-2 is an extension of the satellite networking support (see Section 17 of
ns-2 manual Error! Reference source not found.) implementing MF-TDMA access over uplink
and BoD. This manual describes the user interface of MFTDMA-DAMA and provides a TCL
example to show its usage.
10.1
User
Interface
Satellite nodes configuration and creation
Satellite nodes need to be configured before being created by means of the node-config
command. The description of this command is given in section 5.3 (Node Configuration Interface)
of ns-2 manual. MFTDMA-DAMA uses two new types of network nodes: terminal and georepeater, which configure terrestrial nodes and the satellite node respectively. The parameter
satNodeType in node-config determines the type of node to be configured. The following lines of
code configures the satellite node and creates in memory (using $ns node command) the object:
node-config -satNodeType geo-repeater \
-phyType Phy/Repeater \
-channelType Channel/Sat \
-downlinkBW 36Mbps \
-wiredRouting ON
set sat [$ns node]
The geo-repeater is a “bent-pipe” satellite, which introduces any processing but amplify input
signal. The parameter downlinkBW determines the maximum data-rate that Forward Link
transport stream can support. Channel/Sat and Phy/Repeater parameters are the types of blocks
describing satellite physical layer and forward link channel. The following code configures and
instantiate a terrestrial node (either an Hub or an RCST):
$ns node-config -satNodeType terminal \
-llType LL/Atm \
-ifqType Queue/DropTail \
-ifqLen 50 \
-macType Mac/TdmaDama \
-phyType Phy/Sat \
-channelType Channel/Sat \
-requesterType Requester/Combiner \
-wiredRouting ON
set ter [$ns node]
1
The parameters llType, macType, phyType, channelType and RequesterType indicate the type
of blocks used to build the satellite interface of RCST and Hub. Table A2.1 summarises
configuration parameters of MFTDMA-DAMA terrestrial node.
Figure A.1 - MFTDMA-DAMA block-set diagram for RCST or Hub satellite interface.
After being instantiated, terminal nodes need to be connected to the satellite using the
Simulator command setup-geolink as follow:
$ns setup-geolink $ter $sat
where the first parameter is an handler for the terminal node and the second an handler for the
satellite node. This command creates the set of blocks shown in Figure A.1 and setup a
geostationary link. This diagram reflects the satellite interface described in Section 16.3.3
(Detailed look at satellite links) of ns-2 manual.
The routing agent forwards incoming IP packets to the LinkHead block to be transmitted through
the satellite link. Hence the link-layer block LL/Atm performs IP packets encapsulation into ATM
cells and then serialises the cells to a MAC queue (IFQ). An Integrator is set at the input and
output of the MAC queue to collect statistics about IFQ for the Queue Monitor block. The Queue
Monitor makes available queue length and input rate at the Requester/Combiner block, which is
in charge of generating capacity requests.
2
The Mac/TdmaDama block generates transmission bursts draining ATM cells from IFQ. This
block also regulates transmission timings releasing the burst when a transmission opportunity for
the RCST is made available. The TX and RX Phy/Sat blocks form an interface to the satellite
channel. MFTDMA-DAMA adopts the physical layer and channel model of ns-2 (see chapter 17
of ns-2 manual). A set of monitor can be optionally installed to collect statistics of IFQ for the
users. This consists of a collection of tracer objects and a monitoring block (Output file).
Table A-3. Configuration options for MFTDMA-DAMA terrestrial node
Option name
Value
-satNodeType
terminal or geo-repeater
-ifqType
Queue/DropTail
-ifqLen
-macType
integer
Mac/TdmaDama
-phyType
Phy/Repeater
-channelType
Channel/Sat
-llType
-downlinkBW
LL/Atm
Integer value
-wiredRouting
Boolean
Description
Typeof node belonging to
the satellite network
Interface MAC queue type.
Block 820
Parameter of MAC queues
Main object for RCST mac
Typology of satellite
networking model (set to
geo-rep)
Model of channel link (set
to ideal channel)
Model of encapsulator
Total downlink bandwidth
Indicates that ns-2 has to
use default IP Routing
mechanisms over satellite
User interface for Allocator configuration
HUB is a special terminal node where an Allocator object has been installed. The command
install-allocator is an interface of Node object to perform this task that takes the type of Allocator
object as argument:
set rrm [$hub install-allocator Allocator/MFTDMA]
The command returns a handler to the Allocator object itself that can be used to set the Allocator
mode of operation. The allocation algorithm is defined by three parameters of Allocator interface:
•
layout_: selects the layout algorithm between first-fit (FF) and best-fit (BF)
•
mode_: selects the continuous mode (CONT) or slot mode (SLOT)
•
no_carry_: enable/disables request queues
whose meaning is described in Section 4. As an example, the following code snippet sets the
configuration variables of Allocator $rrm to values stored in $layout_, $mode_ and $no_carry_:
3
# Set layout, mode and carry parameters for the RRM (Allocator)
$rrm set layout_ $layout_
$rrm set mode_ $mode_
$rrm set no_carry_ $no_carry_
Figure A.2. Super-frame composition.
Superframe composition
Uplink super-frame is composition is configured through the command new-frame-atm of
Allocator interface. This adds a Frame to the uplink Super-frame format. The command takes
three parameters: the number of carriers, the number of timeslots for each carrier per superframe, and the number of cells per burst, and returns an handler to the Frame.
As an example let us suppose that we are interested to simulate the 26.5 ms super-frame
composition of Figure A.2. This consists of two Frames: the first with 2 carriers, 18 timeslots per
carrier per super-frame and transmission bursts of 1ATM, the second 6 carriers, 6
timeslot/superframe and 4-ATM bursts cell. The data-rate of one of these carriers is 288 kb/s and
384 kb/s respectively. This super-frame can be instantiated by the following list of command:
$rrm set frame_duration_ 0.0265
set f0 [$rrm new-frame-atm 6 6 4]
set f1 [$rrm new-frame-atm 2 18 1]
The first line sets the super-frame duration to 26.5 ms; the second and third line add new frames
to the super-frame. The Frame handlers $f0 and $f1 can be used to setup the rule-list to regulate
access to super-frames from satellite terminals.
Rules are inserted using add-rule command from Allocator interface. The first argument of addrule is the terminal for which a rule is inserted. The following arguments contain access list rules.
The syntax is given as follows:
4
$rrm add-rule $rcst “<rule1>” “<rule2>” ...
where $rrm is a handler to the Allocator object, $rcst a handler to the Node object and <rule1>,
<rule2>, … <ruleN> a list of rules. Each rule consists of two parameters: an access condition and
a frame. When an access condition is met for a rule, a timeslot is allocate on the corresponding
Frame. Conditions may be applied to request parameters and signal quality measures. As an
example, consider the following rules:
$rrm add-rule $ter_mac($i) "SMALL $f1" $f0 $f1
This code specifies that an allocation of one timeslot has to be tried first in $f1 if the request
queue (namely the amount of capacity per superframe requested) is small. Hence, if <condition>
is not met or the allocation in $f1 fails, $f0 is tried. Finally, $f1 has to be tried again.
Other examples of Allocator configuration are provided in the example script. The table below
summarises the commands to configure the Allocator.
TCL Interface for Allocator object
TCL Method name
install-allocator
add-rule
new-frame-atm
Description
Installs an RRM allocator
supporting MF-TDMA in the HUB
object
return value
Node
RRM
$rcst install-requester
Allocator/MFTDMA
bool
$rrm add-rule <rcst> <rule1>
<rule2> ...
Installs a list of rules for a RCST in
the RRM allocator object. Each rule
Allocator
consists of a condition and a Frame
pointer.
Instantiates a new Frame into the
RRM allocation specifying the
number of TRF carriers, the number Allocator
of timeslots per carrier and the
number of ATM cells per timeslot.
Frame
Syntax
$rrm new-frame-atm <carriers>
<ts_carrier> <cells_timeslot>
trace-sf
Provides tracing support, showing
an eps animation of allocation
procedure.
Allocator
none
$rrm trace-sf <file_handler>
layout_
This variable selects the type of
layout_ between best-fit and first-fit
Allocator
none
$rrm set layout_ [B|F]
mode_
This variable set the mode to
continuous or slot-based
Allocator
none
$rrm set mode_ [C|S]
This variable disable/enable the
carry of CR from one frame to the
next.
Allocator
none
$rrm set no_carry_ [T|F]
no_carry_
5
10.2
Example
script
# File example.tcl
# Initialise random number generator sequence
ns-random 1
expr srand(1)
# Creates a simulator instance
set ns [new Simulator]
#------- Configuration Variables ------------------------------------------#
set
set
set
set
set
set
set
duration
frame_duration
ter_no
delayTER
capTER
rcst_buffer_
hub_buffer_
20
0.0265
30
50ms
100Mb
500
500
;#
;#
;#
;#
;#
;#
;#
#------- Request Generator and RRM
---------------------------------------#
set req_period
0.6
Requester/Combiner set alpha_ 1.0
Requester/Combiner set k_ 1.0
Requester/Combiner set min_rvbdc_ 0.0
Requester/Combiner set max_rvbdc_ 100
set layout_
0
set mode_
0
set no_carry_ 0
;#
;#
;#
Duration of a simulation run
Duration of the super-frame
Number of RCSTs in simulated scenario
Propagation delay of terrestrial segment
Capacity of the terrestrial link
Buffer size of RCST
Buffer size of Hub terminal
;#
;#
;#
;#
;#
;#
Interval between RBDC requests
Weight of RBDC and VBDC request
alpha=1.0 VBDC, alpha=0.0 RBDC
Request multiplier
Minimum allowed request
Maximum allowed request
layout option for RRM (0==First-Fit, 1==Best-Fit)
mode option for RRM (0==Slot-based, 1==Continuous)
carry option for RRM (0==Carry-Next-Frame 1=Not-Carry-Next-Frame)
Mac/TdmaDama set slot_packet_len_ $slotsize_
#------- Traffic Scenario -----------------------------------------------#
set
set
set
set
set
voip(interval)
voip(plen)
voip(bursttime)
voip(idletime)
voip(no_voip)
0.04
124
0.35
0.65
500
;#
;#
;#
;#
;#
Inter-departure (sec) between during ON periods
VoIP packet size
Average duration of ON periods
Average duration of OFF periods
Number of VoIP flows in simulation
# Routine new-voip creates a connection between an RCST (chosen at random)
# and HQ. A VoIP application (Application/Traffic/Voice) is built
# on top of an UDP agent (Agent/UDP)
set voip(index) 0
proc new-voip { i } {
global ns voip rcst hq
global start stop ter_no rcst
set
set
set
set
voip(s$i) [new Application/Traffic/Voice]
voip(r$i) [new Application/Traffic/Voice]
udp_s [new Agent/UDP]
udp_r [new Agent/UDP]
$voip(s$i)
$voip(s$i)
$voip(s$i)
$voip(r$i)
attach-agent $udp_s
set interval_ $voip(interval)
set packetSize_ $voip(plen)
attach-agent $udp_r
$udp_s set index $i
$udp_r set index $i
6
set
$ns
$ns
$ns
n [expr [ns-random] % $ter_no]
attach-agent $rcst($n) $udp_s
attach-agent $hq $udp_r
connect $udp_s $udp_r
$ns at $start "$voip(s$i) start"
$ns at $stop "$voip(s$i) stop"
}
#------- Creating scenario -----------------------------------------------#
# Create HQ terrestrial node
set hq [$ns node]
# Configure a bent-pipe satellite
$ns node-config -wiredRouting ON
$ns node-config -satNodeType geo-repeater -phyType Phy/Repeater -channelType Channel/Sat
# Create the satellite and set its position
set sat [$ns node]
$sat set-position 0
# Configure a satellite terminal
$ns node-config -satNodeType terminal\
-llType LL/Mpeg\
-requesterType Requester/Combiner\
-phyType Phy/Sat
# Create the HUB terminal and set its position (lat, lon)
set hub [$ns node]
$hub set-position 43.71 10.38
# Connect HUB to HQ through an ns-2 serial link
$ns duplex-link $hq $hub $capTER $delayTER DropTail
# Connect HUB to satellite
$ns setup-geolink $hub $sat
# Cycle to create and connect satellite terminals
for {set i 0} { $i < $ter_no } {incr i} {
set rcst($i) [$ns node]
$rcst($i) set-position 43.71 10.38
# schedule the beginning of request generation
$ns at 0.0 "$rcst($i) start-req"
# Connect terminal to satellite
$ns setup-geolink $rcst($i) $sat
# Obtain an handler to MAC block
set ter_mac($i) [$rcst($i) set mac_(0)]
}
# Install an allocator block into the HUB
set rrm [$hub install-allocator Allocator/MFTDMA]
#------- Configuring RRM -----------------------------------------------#
# Set layout, mode and carry parameters for the RRM (Allocator)
$rrm set layout_ $layout_
$rrm set mode_ $mode_
$rrm set no_carry_ $no_carry_
# Creates a frame of 6 carriers, 6 bursts/carrier and 4 cells/burst
# for bandwidth allocation over RL
set f0 [$rrm new-frame-atm 6 6 4]
# Creates a frame of 2 carriers, 18 bursts/carrier and 1 cell/burst
# for bandwidth allocation over RL
7
set f1 [$rrm new-frame-atm 2 18 1]
# For each terminal set up the following rule:
#
If the request is SMALL, use $f1
#
Else use $f0
#
Else use $f1
for {set i 0} {$i<$ter_no} {incr i} {
$rrm add-rule $ter_mac($i) "SMALL $f1" $f0 $f1
}
set satrouteobject_ [new SatRouteObject]
$satrouteobject_ compute_routes
;# We use centralized routing
#------- Schedule events --------------------------------------------#
set start 1.0
set stop 20.0
# Procedure finish-sim called at the end of the simulation
$ns at $duration "finish-sim"
proc finish-sim {} {
global testing ns
$ns flush-trace
$ns halt
}
# Schedule start of VoIP flows
for {set i 0} { $i < $voip(no_voip)} {incr i} {
$ns at $start "new-voip $i"
}
$ns run
8
© Copyright 2026 Paperzz