- Services Offered
- Why Should I Use WISE ?
- Who Should Benefit ?
- Research Activities
- Available Tools & Testbeds
- Related links
An ns-2 MAC satellite module
Author: Raffaello Secchi Year: 2006
Simulator Architecture and Internals
The NS2 support for satellite networking enables the simulation of both geo-stationary satellite (repeater or regenerative) and polar orbiting constellations. The supported MAC are Unslotted-Aloha (with or without collision detection) and TDMA. The figure below illustrates the main elements of a TDMA satellite node.
Packets coming from upper layers are first processed by a link layer (LL) agent, which is responsible for packet filtering and collision detection, then enqueued into IFq queue. When is time to trasmit, the Mac/Tdma agent deques a packet (if any) from IFq and forwards it to the physical layer. At the end of transmission packet the Mac/Tdma agent will deliver another packet if the time-slot is not yet finished. Furthermore, partial transmission of packets is supported. This means that, if at the end of time-slot the transmission of packet is not finished, the remaing amount of data will be delivered in the next slot. The requester/allocator blocks take part in the time-slot assignment procedure. Every predetermined number of frames each node's Requester submits a request to the master controller. Various mechanism of request computation are supported based on the monitoring of the amount of data enqueued in IFq during the previous allocation period. The Allocator reads the vector of requests of all traffic terminal and generates a vector of allocations, which is scheduled delay_ seconds (configurable parameter) in the future in order to account for allocation delay. Note that, while a different Requester is installed for every terminal (which in case could have different behaviors), only one terminal is chosen as Allocator.
The currently supported allocation algorithm is the proportional method. According to proportional scheme the bandwidth assigned to each active terminal is proportional to the submitted request. The Allocator agents computes the sum R of all elements of the request vector Ri and assign to traffic terminal a number time-slot equals to Ns*(Ri/R), where Ns is the number of slot per frame. Since Ns*(Ri/R) isn't generally an integer, the number of assigned slot is approximated to the smaller integer larger (or equal) than Ns*(Ri/R). Also, the Allocator store the extra fraction of slot assigned to every terminal in a vector, that must be subtracted from allocation in subsequent period.
Installation Instruction & Validation
This web page reports the instructions to install and configure simulation interface.
2) Unpack ns-allinone-2.29.tar.gz and apply patch:
tar xvzf ns-allinone-2.29.tar.gz patch -p0 < ns-allinone-2.29-tdma.patch
3) Install the package (possibly) using gcc version 3.3.6:
A previous patch (no further developed) for simulator NS-2.26 is also available ns-allinone-2.26-tdma.patch. In order to apply this patch follow the above procedure substituting the tag 2.29 with 2.26.
Alternatively, the manual installation of simulator sources is also possible.
tar xvzf sources-ns-2.29.tar.gz
3) Compile ns-2.29 following standard procedure. In order to validate the compiled simulator download and run the script file test-tdma.tcl. This script file generate a scenario with two satellite terminals (ter(0) and ter(1)) and a geostationary bent pipe satellitar node. It then schedule a TCP Sack connection with source on ter(0) and receiver on ter(1). The simulation outputs two trace files: event.tr and out.tr. While the out.tr is the trace of terminal queues in ns-2 format, the event.tr dumps all the events that occur in MAC layer, such as marking the beginning of a frame or the complete delivery of a packet from the terminal.
Simulator Interface & Configuration
The TDMA simulator is provided with a TCL interface that allows the configuration of TDMA frame and the definition of the allocation mechanism. The following table reports the TDMA parameters together with their meaning:
Number of slots per frame (excluded preamble)
Size of a slot (bytes)
Number of frames between successive bandwidth requests bandwidth_ Overall satellite link capacity
Thus, we could introduce the following positions at the beginning of simulation script in order to correctly configure the terminals and satellite objects
Mac/Tdma set max_slot_num_ 47
Mac/Tdma set slot_packet_len_ 1504
Mac/Tdma set num_frame_ 3
Mac/Tdma set bandwidth_ 2112Kb
set opt(chan) Channel/Sat
set opt(bw_up) 2.112Mb ;# uplink bandwidth
set opt(bw_down) 38.016Mb ;# downlink bandwidth
set opt(phy) Phy/Sat
set opt(mac) Mac/Tdma
set opt(ifq) Queue/DropTail
set opt(qlim) 1500 ;# queue size (pkts)
set opt(ll) LL/Sat
set opt(wiredRouting) OFF
;# configure and create the satellite node "sat"
node-config -satNodeType geo-repeater \
-phyType Phy/Repeater \
-channelType $opt(chan) \
-downlinkBW $opt(bw_down) \
set sat [$ns node]
;# configure and create the terminal node "ter"
$ns node-config -satNodeType terminal \
-llType $opt(ll) \
-ifqType $opt(ifq) \
-ifqLen $opt(qlim) \
-macType $opt(mac) \
-phyType $opt(phy) \
-channelType $opt(chan) \
-downlinkBW $opt(bw_down) \
set ter [$ns node]
$ter add-gsl geo $opt(ll) $opt(ifq) $opt(qlim) $opt(mac) \
$opt(bw_up) $opt(phy) [$sat set downlink_] [$sat set uplink_]
The last command setups a bidirectional connection between satellite node and the terminal node using parameters previously indicated opt. Once that the sat and ter objects have been created and connected, the Allocator and Requester objects must be installed into terminals. Note that a Requester object is needed for each terminal, but only one Allocator object for the whole satellite network is needed.
set alc [$ter install-requester Allocator/Proportional]
set req [$ter install-requester Requester/Constant]
set ev_file [open event.tr w]
$ter trace-event $ev_file
|ISTI - Area della Ricerca CNR, via G. Moruzzi 1, 56124 PISA, Italy - tel +39 050 3152878, fax +39 050 3152040 - P.IVA 02118311006 - C.F. 80054330586|