Sie sind auf Seite 1von 28

A Tutorial on MFTDMA DAMA

26 August, 2011

ERG University of Aberdeen

This presentation will show how to:

Install MF-TDMA DAMA Single terminal Run the example script Analyse the state of queue and the traffic rate Analyse the dynamics of allocation (CRs and TBTP) Enable BoD ATM and Mpeg Multiple terminals Evaluate VoIP traffic performance RRM algorithm for timeslot allocation Traffic multiplexing

26 August, 2011

ERG University of Aberdeen

Installation
Install first ns-2 (current release 2.34) MFTDMA-DAMA is installed in a different directory
Download the bundle from http://www.erg.abdn.ac.uk/users/raffaello/dvbrcs_ns2.htm Initialise the variable NSDIR=/path/to/ns Run the Makefile

Make will produce the ns-2 binary in $NSDIR


Users may want to add $NSDIR to $PATH to avoid typing the entire path every time they run a simulation To check installation type ns-version under ns-2 prompt. The output should be 2.34-mftdma-dama

26 August, 2011

ERG University of Aberdeen

An example for VoIP traffic

We will simulate
Start Transparent satellite scenario RCSTs connect to HQ through the gateway 26.5 ms superframe duration (1ATM=16kb/s) 16 ATMs/carrier (=>256 kb/s carrier)

VoIP traffic
Packet size = 76 B ON/OFF with 46% activity 40 ms inter-packet time in ON 21.2 kb/s peak, 9.75 kb/s avg.
VoIP sources VoIP receivers

HQ

26 August, 2011

ERG University of Aberdeen

Example script
voip_atm.tcl: contains the network configuration including terminal configuration, traffic instantiation, bandwidth allocation methods and superframe definition

To see the simulation parameters, we type on prompt


ns example.tcl usage: ns example.tcl <CRA kbps> <RBDC=0/1> <VBDC=0/1> <# streams/term> <smoothing par.>

<CRA kbps> <RBDC=0/1>, <VBDC=0/1> <# streams/term> <smoothing par.>

Number of bursts/superframe allocated permanently to each terminal (1 burst/superframe = 16 kb/s) These two parameters enable/disable the RBDC and the VBDC bandwidth request methods respectively Number of VoIP flows per terminal Smoothing parameter (alpha in [0:1]) used for rate calculation in RBDC REQUEST = alpha*RATE + (1-alpha)*PREV_REQUEST

26 August, 2011

ERG University of Aberdeen

First simulation
The following run a simulation initialising the random number generator at random:
> ns voip_atm.tcl 1 0 0 1 0

This allocates 16 kb/s in CRA to the terminal. No capacity requests are made (The smoothing par. is not significant in this simulation). Each terminal carries one VoIP flow. The simulator generates an output on screen and the following files: out.tr event.tr supeframe.ps Trace of packet that traverse each simulated queue Trace of MAC messages (TBTP and CRs) Animation of superframe dynamics

NB: set testing 1 in example.tcl is needed to generate these outputs


26 August, 2011 ERG University of Aberdeen

Format of out.tr
Time
h + + h + + 1.102258 1.102258 1.102258 1.102258 1.126786 1.142258 1.142258 1.142258 1.153286 1.179786

Nodes
3 3 3 3 3 3 3 3 3 3 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 exp exp exp exp exp exp exp exp exp exp

LEN
76 53 53 53 53 76 53 53 53 53 ------------------------------------------------------------0 0 0 0 0 0 0 0 0 0

Addrs
3.1 3.1 3.1 3.1 3.1 3.1 3.1 3.1 3.1 3.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1

seq_no
0 0 0 0 0 1 1 1 1 1 0 0 0 0 0 1 1 1 1 1

IP packets TX (h lines)

IP packets RX

Encap Decap
MAC packets enqueued (+ lines) MAC packets received (r lines)

... r 1.379072 h 1.382258 + 1.382258 + 1.382258 - 1.391786 r 1.405572 ... ...

Queue
-1 2 3 -1 3 -1 3 -1 3 -1 -1 2 exp exp exp exp exp exp 53 76 53 53 53 53 ------------------------------------0 0 0 0 0 0 3.1 3.1 3.1 3.1 3.1 3.1 0.1 0.1 0.1 0.1 0.1 0.1 0 7 7 7 5 0 0 7 7 7 5 0

MAC packets dequeued (- lines)

Burst forming Channel


Bursts TX Bursts RX

out.tr

26 August, 2011

ERG University of Aberdeen

The journey of a packet


We follow packet 0
h + + 1.102258 1.102258 1.102258 1.102258 1.126786 3 3 3 3 3 -1 -1 -1 -1 -1 exp exp exp exp exp 76 53 53 53 53 ------------------------------0 0 0 0 0 3.1 3.1 3.1 3.1 3.1 0.1 0.1 0.1 0.1 0.1 0 0 0 0 0 0 0 0 0 0 An IP packet (76 bytes) arrives at satellite interface at simulated time 1.1022 Encapsulator produces two ATM cells. The first is dequeued immediately. The second after 26.5 ms (the next superframe)

... r 1.379072 -1 2 exp 53 ------- 0 3.1 0.1 0 0 ... r 1.405572 -1 2 exp 53 + 1.405572 2 0 exp 76 - 1.405572 2 0 exp 76 r 1.405578 2 0 exp 76 ... ... ------------------------0 0 0 0 3.1 3.1 3.1 3.1 0.1 0.1 0.1 0.1 0 0 0 0 0 0 0 0 The first MAC cell is received (satellite RTT)

The second MAC cell is received. The decapsulator can rebuild the IP packet and forward it to the HQ

Packet eventually recv at 1.405s

IP 76 B

Packet reassembled at 1.405s and routed to HQ Encap and enqueue at 1.102s The first cell is recv at 1.379s 2 ATM cells The second cell is recv at 1.405s Form the first burst at 1.102s and send

IP 76 B

IP 76 B

LL TX

LL RX

Form the second burst at 1.126s and send

26 August, 2011

ERG University of Aberdeen

Trace Analysis
On Unix prompt
ns voip_atm.tcl 16 0 0 1 0 grep 3 \-1 out.tr > in analy in gnuplot plot in.dat u 1:7 w l plot in.dat u 1:($2/0.1) w l

16kb/s

1 flow
Selects lines for the queue 3 1 Produces statistics of queue 3 1 Uses gnuplot to print the queue size in MAC cells and input rate in kb/s

Peak Rate (21.2 kb/s)


QUEUE SIZE (ATMs)

RATE (b/s)

Avg Rate (9.75kb/s)

TIME (sec)

TIME (sec)

26 August, 2011

ERG University of Aberdeen

A run with 2 flows


16kb/s ns voip_atm.tcl 16 0 0 2 0 grep 3 \-1 out.tr > in analy in gnuplot plot in.dat u 1:7 w l plot in.dat u 1($2/0.1) w l 2 flows

Now we have 2 flows (42.4 kb/s peak, 19.5 kb/s avg.) but still 16 kb/s capacity

Peak Rate (42.4 kb/s)


QUEUE SIZE (ATMs)

Buffer overflows

RATE (b/s)

Avg. Rate (19.5kb/s)

TIME (sec)

TIME (sec)

26 August, 2011

ERG University of Aberdeen

Bandwidth Allocation dynamics

16kb/s CRA

RBDC Enabled VBDC Disabled

5 flows

=0.8

ns voip_atm.tcl 16 1 0 5 0.8 grep 3 \-1 out.tr > in analy in grep CR event.tr > cr.tr grep ^1.*BTP event.tr > btp.tr gnuplot set key left box plot cr.tr u 2:($4*1000) w l, in.dat u 1:($2*8) w l, btp.tr u 2:($4*16000) w l

RATE (b/s)

TIME (sec)

26 August, 2011

ERG University of Aberdeen

Bandwidth on Demand methods


CRs in RBDC are calculated in this simulation as follows: 1. 2. 3. A bitrate sample is taken every second Bitrate samples are filtered:

Req = PrevReq + (1 ) RateEst

Capacity Request are integers in kb/s

BoD dynamics can be found by analysing the file event.tr

Term.

Time

Type

1 1 0 1 0 1 0 1 1 0

0.0000 0.2523 0.2523 0.2788 0.2788 0.3053 0.3053

CR BTP BTP BTP BTP BTP BTP

0 2 0 2 0 2 0

The CR records in event.tr are traces of CR messages generated by terminals. These report the RBDC and VBDC requests in kb/s and ATM cells respectively

1.0000 CR 1.0113 BTP 1.0113 BTP

0 2 0

The TBTP records in event.tr are traces of TBTPs received by terminals. These report the number of ATM cells allocated in every superframe to each terminal

event.tr 26 August, 2011 ERG University of Aberdeen

Reducing the rate of CR


example.tcl
#!/home/raffaello/ns-allinone-2.34/ns-2.34/ns # ERG-UoA Aberdeen (UK), May 2008 # CONFIGURATION VARIABLES ########################################### ;# testing == 1 enables tracing for debugging purposes

The variable req_period in example.tcl configures the duration of request interval The CR interval is 200ms and the smoothing parameter alpha=0.0 in this example

if { $argc != 5 } { puts "usage: ns example.tcl <CRA> <RBDC=0/1> <VBDC=0/1> <# streams/term> <smoothing par.>" exit 0 } set testing 1 ns-random 0 Allocator/MFTDMA set testing_ 0 Allocator/MFTDMA set layout_ 0 ;# First-Fit=0, Best-Fit=1 Allocator/MFTDMA set mode_ 1 ;# Slot-based=0, Continuous=1 Allocator/MFTDMA set no_carry 1 ;# Carry-Next-Frame=0, Not-CarryRequester/Combiner set req_period_ 0.2 Requester/Combiner set alpha_ [lindex $argv 4] set testing set frame_duration 1 0.0265 0ms 100Mb

set terrestrial_delay set terrestrial_capacity

26 August, 2011

ERG University of Aberdeen

Volume-based CRs

ns voip_atm.tcl 32 0 1 5 0.0 grep 3 \-1 out.tr > in analy in grep CR event.tr > cr.tr grep ^1.*BTP event.tr > btp.tr gnuplot plot in.dat u 1:7 w l, cr.tr u 2:($5/53) w l, btp.tr u 2:4 w l

In this example the request is entirely based on queue size. The system shows an oscillating behaviour

ATM cells

TIME (sec)

26 August, 2011

ERG University of Aberdeen

R-score
The R-score (ITU-T) provides a measure of perceived audio quality that:
Takes into account codec type, mouth-to-ear delay, and packet loss rate The playout delay can be adjusted dynamically using silence periods Ranges from 0 (worse) to 100 (best). Scores above 60 are acceptable Can be mapped to MOS

The script outputs the R-score at each run:


ns voip_atm.tcl 2 0 1 5 0.0 557.81 28.95 1.56
(on Unix prompt)

0.36

(output)

Estimated E2E delay

R-score

Equivalent MOS

Allocation efficiency

26 August, 2011

ERG University of Aberdeen

Mpeg-2 encapsulation
[]

voip_atm.tcl

# GEO satellite at 13 degrees longitude East (Hotbird 6) set sat [$ns node] $sat set-position 13 LL/Mpeg set pack_thresh 0.1 $ns node-config -satNodeType terminal \ -llType LL/Mpeg \ -ifqLen 250 \ -requesterType Requester/Combiner \ -phyType Phy/Sat set hub [$ns node] $hub set-position 43.71 10.38 $ns setup-geolink $hub $sat set hub_mac [$hub set mac_(0)] for {set i 0} { $i < $no_terminals } {incr i} { set rcst($i) [$ns node] $rcst($i) set-position 43.71 10.38 $ns at 0.0 "$rcst($i) start-req" $ns setup-geolink $rcst($i) $sat set ter_mac($i) [$rcst($i) set mac_(0)] } [] set f0 [$rrm new-frame 1 16 188] for {set i 0} {$i<$no_terminals} {incr i} { $rrm add-rule $ter_mac($i) $f0 $rrm cra $ter_mac($i) [lindex $argv 0] [$rcst($i) set requester_] set rbdc_ [lindex $argv 1] [$rcst($i) set requester_] set vbdc_ [lindex $argv 2] } []

We can simulate Mpeg2 bursts. A node has to be configured for this purpose in voip_atm.tcl
This set the default packing threshold in Mpeg2 encapsulation algorithm to 100ms

This enables the Mpeg encapsulation. Each terminal will be created using this encapsulation type

Now the cell size is 188B, so we need 188B in the a burst send a cell

The burst contains now one Mpeg cell (188B). The carrier bitrate is then: 16*8*188/26.5ms = 908kb/s and a single burst allocation in a superframe is 57kb/s

Lets see run a simulation with Mpeg and analyse the traces: ns voip_atm.tcl 104 0 0 1 0.0

26 August, 2011

ERG University of Aberdeen

A simulation with Mpeg


out.tr
h 1.093356 h 1.126196 h 1.133356 [...] + 1.133356 - 1.133356 [...] + 1.166196 - 1.166196 [...] r 1.405572 + 1.405572 - 1.405572 + 1.405572 r 1.405578 - 1.405578 r 1.405584 [...] r 1.432072 + 1.432072 - 1.432072 r 1.432078 [...] 3 -1 exp 76 ------- 0 3.7 0.7 0 0 3 -1 exp 76 ------- 0 3.2 0.2 0 1 3 -1 exp 76 ------- 0 3.7 0.7 1 2 3 -1 exp 188 ------- 0 3.7 0.7 0 0 3 -1 exp 188 ------- 0 3.7 0.7 0 0 3 -1 exp 188 ------- 0 3.7 0.7 1 2 3 -1 exp 188 ------- 0 3.7 0.7 1 2 -1 2 exp 188 ------2 0 exp 76 ------- 0 2 0 exp 76 ------- 0 2 0 exp 76 ------- 0 2 0 exp 76 ------- 0 2 0 exp 76 ------- 0 2 0 exp 76 ------- 0 -1 2 exp 188 ------2 0 exp 76 ------- 0 2 0 exp 76 ------- 0 2 0 exp 76 ------- 0 0 3.7 0.7 3.7 0.7 0 3.7 0.7 0 3.2 0.2 0 3.7 0.7 0 3.2 0.2 0 3.2 0.2 0 0 3.7 0.7 3.7 0.7 1 3.7 0.7 1 3.7 0.7 1 0 0 0 0 1 0 1 1 1 2 2 2 2 76 B 76 B 76 B The first packet is not sufficient to saturate the Mpeg PDU. So the encapsulator waits until enough data is available. At time 1.33s the first Mpeg cell can be released. This contains the first two IP packet and part of the third. The cell is immediately dequeued because a timeslot allocation is available for the terminal. The rest of packet is sent in next Mpeg cell. Three IP packets arrive at the network interface respectively at 1.093, 1.126 and 1.133.

MAC buffer

188B

Form the first burst at 1.133s and send

Burst is received at 1.407 and IP packets decapsulated

76 B 76 B

When the Mpeg cell is received at 1.405, two IP packets are decapsulated and forwarded

When the subsequent burst arrives, the third packet is also decapsulated

26 August, 2011

ERG University of Aberdeen

Multiplexing of traffic over the link


In this experiment we have more than one terminal. These share the uplink capacity. From original example script voip_atm.tcl, set the terminal number to four: set no_terminals 4

ns voip_atm.tcl 32 1 0 10 0.0 grep 3 \-1 out.tr > in1 grep 4 \-1 out.tr > in2 grep 5 \-1 out.tr > in3 grep 6 \-1 out.tr > in4 analy in1 1 analy in2 1 analy in3 1 analy in4 1 grep ^1.*BTP event.tr > btp1.tr grep ^2.*BTP event.tr > btp2.tr grep ^3.*BTP event.tr > btp3.tr grep ^4.*BTP event.tr > btp4.tr gnuplot set xlabel time (sec) set ylabel rate (kb/s) plot in1.dat u 1:($3*0.424) w lp, in2.dat u 1:($3*0.424) w lp, in3.dat u 1:($3*0.424) w lp, in4.dat u 1:($3*0.424) w lp plot btp1.tr u 2:($4*16) w l, btp2.tr u 2:($4*16) w l, btp3.tr u 2:($4*16) w l, btp4.tr u 2:($4*16) w l

26 August, 2011

ERG University of Aberdeen

RRM Algorithm
The RRM first assigns timeslots in CRA. In our example, each terminal receives 2 timeslots

NB: The animation in superframe.ps can be viewed using ghostview (type gv superframe.ps)
26 August, 2011 ERG University of Aberdeen

RRM Algorithm
The remaining timeslots are assigned on demand (first RBDC requests, then VBDC). The number of timeslots depends on the request. In this example two additional timeslots are given to terminal 1 and 2, and one to terminal 4. This satisfies their RBDC requests.

26 August, 2011

ERG University of Aberdeen

Confidence intervals and convergence

S
Run 10 Simulations with different seed numbers

In our case we are interested in VoIP performance. Each simulation outputs a sample of R-score, an ITU-T metric to estimate perceived voice quality. This procedure is embedded in fullrun: http://www.abdn.ac.uk/~eng863/fullrun.htm This is called setting fullrun before the command

Output Results (Xi)

fullrun ns voip_atm.tcl 64 0 0 10 0.0 voip_atm.tcl 64 0 0 10 0.0 318.0 0.052


Input parameters Estimated E2E delay

55.97 0.050

2.965 0.039

0.3824 0.085

Calculate Mean and variance 2 For the whole vector

R-score and relative err.

Equivalent MOS and relative err.

Allocation Efficiency and relative err.

1.96

< 0.01 N

This is relative error of E2E estimation with 95% confidence. This means that the E2E delay is estimated with an error of 5.2%. Then, the avg. E2E has 95% probability to be between 301.5 and 334.5

E
NB: testing var. in voip_atm.tcl must be set to 0 to avoid generating the out.tr at each run!

26 August, 2011

ERG University of Aberdeen

Comparison between CRA and DBA

The number of connections is a binomial distribution

fullrun ns voip_atm.tcl 64 0 0 10 0.0 voip_atm.tcl 64 0 0 10 0.0 321.1 0.018 fullrun ns voip_atm.tcl 32 1 0 10 0.0 voip_amtl.tcl 32 1 0 10 0.0 322.2 0.010

56.60 0.018

2.981 0.014

0.3856 0.033

60.43 0.008

3.122 0.007

0.3586 0.023

RBDC+CRA achieves higher score than CRA only 26 August, 2011 ERG University of Aberdeen

Evaluation of Allocation Strategies

ACCEPTABLE

Analogously, we can evaluate the r-score for other allocation strategies. In the figure we show the r-score for a VoIP flow competing with several others when allocating:
A fixed capacity (32 to 128 kb/s) RBDC RBDC and a fixed capacity (16 to 64 kb/s)

POOR

26 August, 2011

ERG University of Aberdeen

Defining the superframe


[]
# Network Control Center set rrm [$hub install-allocator Allocator/MFTDMA] ################### RRM CONF ###################### #### FORWARD LINK set DL_frame [$rrm new-frame 1 16 1] $rrm add-rule $hub_mac $DL_frame #### RETURN LINK $rrm cra $hub_mac 16 set f0 [$rrm new-frame 1 16 53] for {set i 0} {$i<$no_terminals} {incr i} { $rrm add-rule $ter_mac($i) $f0 $rrm cra $ter_mac($i) [lindex $argv 0] [$rcst($i) set requester_] set rbdc_ [lindex $argv 1] [$rcst($i) set requester_] set vbdc_ [lindex $argv 2] }

voip_atm.tcl This part of script configures the superframe and RRM


This line tells the RRM to instantiate a new Frame for allocation This Frame consists of 1 carrier (first param.), 16 timeslot/carrier (second param.) and 1 ATM cell per timeslot (third param.).

if { $testing == 1 } { $ns at 19.0 { set ps_anim [open "superframe.ps" w] $rrm trace-sf $ps_anim } } ###################################################

< Return Link

[]
26 August, 2011 ERG University of Aberdeen

< Forward Link

Granularity of bandwidth allocation


Lets try to change the superframe. We use a carrier with 8 bursts with 2 ATM cell per burst. The bitrate is still 256 kb/s but the granularity of allocation is 32 kb/s. The line in voip_atm.tcl is then: set f0 [$rrm new-frame 1 8 106]

Return Link

Forward Link

ns voip_atm.tcl 32 1 0 5 0.0 grep 3 \-1 out.tr > in analy in grep ^1.*BTP event.tr > btp.tr gnuplot set xlabel time (s) set ylabel rate (b/s) plot in.dat u 1:($2*10) w l, btp.tr u 2:($4*16000) w l

26 August, 2011

ERG University of Aberdeen

Comparison between 1 ATM and 2 ATM bursts

edit voip_atm.tcl to include set f0 [$rrm 1 16 53]


for i in 1 2 4 6 10; do fullrun ns voip_atm.tcl 32 1 0 $i 0.0 > $i.rs & done cat *.rs | sort k 4 n > r1atm

edit voip_atm.tcl to include set f0 [$rrm 1 8 106]


for i in 1 2 4 6 10; do fullrun ns voip_atm.tcl 1 0 $i 0.0 > $i.rs & done cat *.rs | sort k 4 n > r2atm gnuplot plot r1atm u 4:8:($8*$9) w ye 1, r1atm u 4:8 w l 1, r1atm u 4:8:($8*$9) w ye 3, r1atm u 4:8 w l 3 plot r1atm u 4:12:($12*$13) w ye 1, r1atm u 4:8 w l 1, r1atm u 4:12:($12*$13) w ye 3, r1atm u 4:12 w l 3

26 August, 2011

ERG University of Aberdeen

Quality/Efficiency

gnuplot set xlabel util. eff set ylabel r-score plot r1atm u 12:8:($12*$13):($8*$9) w xye 1, r1atm u 12:8 w l 1, r2atm u 12:8:($12*$13):($8*$9) w xye 3, r2atm u 12:8 w l 3

26 August, 2011

ERG University of Aberdeen

ATM vs Mpeg
We compare ATM and Mpeg with two packing thresholds under CRA. We allocate 2 Mpeg cells per superframe (113kb/s) and 7 ATM/superframe (112kb/s) for a fair comparison
Edit voip_atm.tcl to enable ATM
for i in 1 2 4 6 10 11 12 13 14; do fullrun ns voip_atm.tcl 112 0 0 $i 0.0 > $i.atm & done cat *.atm | sort k 4 n > atm

Edit voip_atm.tcl to enable Mpeg and packing thr. 100ms


for i in 1 2 4 6 10 11 12 13 14; do fullrun ns voip_atm.tcl 113 0 0 $i 0.0 > $i.mpg1 & done cat *.mpg1 | sort k 4 n > mpg1

Edit voip_atm.tcl to enable Mpeg and packing thr. 40ms


for i in 1 2 4 6 10 11 12 13 14; do fullrun ns voip_atm.tcl 113 0 0 $i 0.0 > $i.mpg2 & done cat *.mpg2 | sort k 4 n > mpg2

26 August, 2011

ERG University of Aberdeen

Das könnte Ihnen auch gefallen