You are on page 1of 5

GPRS network simulation model in NS-2

Qinlong Qiu
National Key Lab of Switching echnology and
elecommunication Network!
"ei#ing $ni%ersity of Posts & elecommunications!
"ei#ing '(()*+! P, R, -hina
el. /)+ '( +22) 0*+'1 2a3. /)+ '( +22) 04'21
5mail. 6iu6inlong7sohu,com
8ongmei 9hang! :ian ;a
Nokia Research -enter! -hina
Nokia <ouse '! No,''! <e Ping Li 8ong :ie!
"ei#ing '((('0! P, R, -hina
5mail. dongmei,=hang7nokia,com
:ian,:,;a7nokia,com
Abstract The objective of the General Packet Radio Service
(GPRS) network simulation is to obtain accurate enough
implementation of GPRS network in etwork Simulation ! (S"
!)# so that $P optimi%ation features can be tested& $n this paper#
we tr' to afford such a model& The simulation model concentrates
on the (m $nterface# Gb $nterface# Gn $nterface and Gi $nterface
respectivel'& )ach part is represented as node# agent# *ueue or
link in S"!& +t last# a simple anal'sis of one scenario is given to
demonstrate how to use this model&
>, >NR?8$->?N
GPRS is a new bearer ser%ice for the Global System
;obile -ommunication @GS;A that greatly imBro%es and
simBlifies wireless access to Backet data networks! e,g,! to the
>nternet, >t adds two new nodes to GS;. ser%ing GPRS suBBort
node @SGSNA and gateway GPRS suBBort node @GGSNA! refer
to 2ig, ', >t aBBlies a Backet radio BrinciBle to transfer user data
Backets in an efficient way between mobile stations and
e3ternal Backet data networks C'D,
2igure ', GPRS system
2irstly! this BaBer describes the elements of GPRS network!
which mainly affect the network Berformance, Secondly! the
imBlementation model in NS-2 is introduced, Et last! we gi%e
an e3amBle to demonstrate how to use the model to analy=e the
Berformance of the network,
A. GPRS overview
GPRS imBro%es the utili=ation of the radio resources!
offers %olume-based billing! higher transfer rates! shorter
access times! and simBlifies the access to Backet data networks
C2D, he 5uroBean elecommunications Standards >nstitute
@5S>A has standardi=ed GPRS during the last fi%e years, >t
finds great interest among many GS; network Bro%iders,
2ig, 2 is the GPRS Brotocol stack, he Logical Link
-ontrol @LL-A layer is resBonsible for deli%ering user data
between mobile stations @;SA and the network, he Radio
Link -ontrol @RL-A layer allows data to be transmitted across
the air interface, E ;edium Eccess -ontrol @;E-A layer is
introduced! to control data transmission in Backet oriented
mode, he RL-F;E- layer will ensure the concurrent access
to radio resource among se%eral ;S, 5ach RL- block is
di%ided into four normal bursts that ha%e the same structure as
GS; radio bursts, he GPRS allows se%eral GLogical
channelsH to share Bhysical channels C0D, Sub-Network
8eBendant -on%ergence Protocol @SN8-PA uses the ser%ices
Bro%ided by the LL- layer, he main functions of SN8-P are.
Segmentation of a network Brotocol data unit @N-P8$A into
LL- Brotocol data units @LL-P8$sA and re-assembly of LL-
P8$s into an N-P8$ C4D, hese layersI main functions are
imBlemented in our model CJD,
I P
n e t w o r k
T C P / U D P
I P
S N D C P
L L C
R L C
M A C
G S M R F
T C P / U D P
I P
S e r v e r
R L C
M A C
G S M R F
B S S G P
N e t w o r k
s e r v i c e
L 1 b i s
R e l !
L 1 b i s
N e t w o r k
s e r v i c e
B S S G P
L L C
S N D C P
R e l !
G T P
L 1
L "
I P
U D P /
T C P
G T P
U D P /
T C P
I P
L "
L 1
I P
L i n k
l ! e r #
P $ ! s i c l
l ! e r #
L i n k
l ! e r #
P $ ! s i c l
l ! e r #
U % G b G n G i
G P R S
A & & l i c t i o n A & & l i c t i o n
2igure 2, GPRS Brotocal stack
B. NS-2 overview
?ne of the recurring Broblems in telecommunication
network is their dimensioning and testing, o achie%e this
effecti%ely models are re6uired by the network, >t is easy to
generate test scenarios and ine3Bensi%e in changing test setuB
and running test case through modeling and simulation, Ell
data is a%ailable in the network! thus the Berformance of
network can be easily analy=ed C+D, NS-2 is free and oBen
source code! so we use it to simulate the GPRS network,
NS-2 is a discrete e%ent simulator targeted at networking
research, NS-2 Bro%ides substantial suBBort for simulation of
-P! routing! and multicast Brotocols o%er wired and wireless
@local and satelliteA networks,
NS-2 began as a %ariant of the R5EL network simulator in
'K)K and has e%ol%ed substantially o%er the Bast few years, >n
'KKJ NS de%eloBment was suBBorted by 8ERPE through the
L>N Bro#ect at L"L! Mero3 PER-! $-"! and $S-F>S>,
-urrently NS de%eloBment is suBBort through 8ERPE with
SE;EN and through NS2 with -?NS5R! both in
collaboration with other researchers including E->R>, NS has
always included substantial contributions from other
researchers! including wireless code from the $-" 8aedelus
and -;$ ;onarch Bro#ects and Sun ;icrosystems C*D,
>>, N5N?RK -?N2>G$RE>?N EN8 RE22>- ;?85L
>n our model! some network configuration Barameters can
easily be changed in -L @ool -ommand LanguageA! for
e3amBle we can define any number of "S and any amount of
traffic1 others can not be changed so easily! because -//
source code need to be changed! such as GGSN and SGSN
number, Ne will discuss it in detail in the following sections,
A. Network configuration
>n our simulated GPRS network! the following network
elements are included.
' ser%er @Bro%ide <P! 2P and signaling ser%icesA,
' GGSN,
' SGSN,
' "S-,
0( "Ss,
here are three sectors in each "S and three time
slots @SLsA in each sector! altogether K GPRS SLs in
his work is suBBorted by Nokia Research -enter! -hina,

down link @8LA direction Ber "S1 while in uB link
@$LA direction! there are only 0 GPRS SLs in each
"S for GPRS traffic is asymmetric normally,
2our different coding schemes! -S-' to -S-4! are
defined for the GPRS Radio "locks carrying RL- data
blocks, 2or the Radio "locks carrying RL-F;E-
-ontrol blocks code -S-' is always used, he
e3ceBtions are messages that use the e3isting Eccess
"urst @see 0GPP S 4J,((0! e,g, Packet -hannel
Re6uestA C)D, Ne only use one coding scheme -S-2
that is not true in real world, >t should be changed in
the further study,
2ig, 0 is about the network configuration in our model,
SGSN GGSN BSS
'(ne PCU)
Server
DL
UL
DL
UL
UL* CS"
DL* CS"
DL
UL
BW: 512kbps;
link delay: 10ms
BW: 512kbps;
link delay: 10ms
BW: 100Mbps;
link delay: 5ms
BW: 100Mbps;
link delay: 5ms
BW: 100Mbps;
link delay: 5ms
BW: 100Mbps;
link delay: 5ms
BTS 1
BTS 30
BTS 2
MS1
MS2
MS800
MS1
MS2
MS800
2igure 0, GPRS network configuration
E"L5 >, Q?S S$PP?R>NG >N GPRS
-lass raffic tyBe Simulated
traffic
Gb interface
@6uantumA
Eir interface
@weightA
( Signalling
trafficF
Streaming
-"R
@constant bit
rateA
'(( '
' >nteracti%e
traffic '
<P J 0
2 >nteracti%e
traffic 2
<P 0 4
0 >nteracti%e
traffic 0
<P 2 J
4 "ackground
traffic
2P ' K
B. Traffic model
he QoS suBBorting in GPRS network is simulated in our
simulation model, here are fi%e different QoS classes! which
will be treated differently in Gb and air interface CKD,
>n Gb interface! each tyBe of class is scheduled by NRR
@Neighted Round RobinA algorithm based on different Briority
weight! and stored in the buffer with different si=e, >n air
interface! each tyBe of class is scheduled by N2Q @Neighted
2air QueueA algorithm, he QoS class definition and related
QoS Barameters are listed in Gab, 'H, he BarametersI %alue
of quantum and weight is defined according to the
re6uirements of different aBBlications, >n the Gb interface! the
bigger the quantum is! the more chance the class gets to be
scheduled, >n the air interface! the smaller the weight is! the
more chance the class gets to be scheduled,
>>>, N5N $N>S ?2 GPRS >N NS-2
>n order to simulate GPRS in NS-2! we add new units of
Packet! Egent and Queue described in the following,
A. Packet
>n NS! the original Backet tyBe is mainly >P Backet, wo
additional tyBes! RL- block and LL- frame are added in our
model, Ne add GP header in Backet header to suBBort GP!
and some other header, 2or e3amBle! statistic header for our
analysis of the Berformance of the GPRS network is added! too,
8uring the whole transmission Beriod! the Backets are
treated indeBendently in each network element, >n the
simulation! the different Brotocols and their header length
should be taken into account,
>n our simulation! the segmentation and reassembly due to
different header and Backet length in each Brotocol are
simulated! howe%er! other detail Brocedures for each Brotocol
are not considered, he header length for each Brotocol is listed
in Gab, 2H,
E"L5 >>, PE-K5 PR?-5SS>NG >N 5E-< N5N?RK 5L5;5NS
<eader Length
@?ctetsA
;a3 Backet length
@?ctetsA
Ser%er -PF>P 4( '4+(FJ0+
GGSN GPF$8PF>P 4( '4+(FJ0+/4(O'J((FJ*+
SGSN LL- 2 'J2(
"SS RL- 2 -S2. 02/2O04
;S -PF>P 4( '4+(FJ0+
>n our simulation! we mainly analy=e two tyBes of >P Backets. '4+( and J0+
A + e n t
G G S N A + e n t
S G S N A + e n t
B S S A + e n t
M S A + e n t
G P R S A + e n t
2igure 4, Egent deri%ation chart,
B. Agent
Se%eral Egents such as ;SEgent! "SSEgent! SGSNEgent
and GGSNEgent are used to handle data Backets transmission
on the ;S! "SS! SGSN and GGSN resBecti%ely, Eccordingly!
se%eral classes! class ;SEgent! class "SSEgent! class
SGSNEgent! class GGSNEgent are defined to identify each
agent, Since these agents ha%e some common features! a base
class GPRSEgent is defined! and the other agents are deri%ed
from GPRSEgent, End the GPRSEgent is deri%ed from NS
Egent, he inheritance structure and relationshiB between
GPRSEgent and other agents is illustrated in 2ig, 4,
! "SAgent
;SEgent recei%es LL- frame from "SSEgent!
reassembles LL- frame and Basses to GPRS PassEgent
@GPRS PassEgent is another agent we add in NS! #ust for the
connection between agents and ser%er or clientA, ?n the
oBBosite direction! ;SEgent gets Backets from GPRS
PassEgent and does LL- fragmentation and sends the LL-
Backets to "SSEgent,
2! BSSAgent
BSSAgent recei%es LL- Backets from SGSNAgent sends
the LL- Packets to "SAgent, ?n the oBBosite direction! "SS
recei%es LL- frame from "SAgent and forwards the LL-
frame to SGSNAgent,
#! SGSNAgent
SGSNAgent recei%es data Backets from GGSNAgent!
remo%es the GP header from Backets! Berforms LL-
segmentation and sends it to BSSAgent. ?n the oBBosite
direction! SGSNAgent reassembles the data Backets coming
from BSSAgent and sends them to GGSNAgent,
$! GGSNAgent
GGSNAgent recei%es data Backets from GPRS Pa%%Agent!
adds GP header to Backets and sends it to SGSNAgent, ?n
the oBBosite direction! GGSNAgent recei%es data Backets from
SGSNAgent! then remo%es GP header and Basses Backets to
GPRS Pa%%Agent,
&. 'ueue
>n the GPRS simulation model! we concentrate on three tyBe
of 6ueuing mechanism,
GPRSQueue. used in air interface @added by usA,
8L-SGSN-Queue. used from SGSN to "SS @added by
usA,
8roBail. used in other links @e3ists in NS-2A,
! GPRS'ueue
GPRSQueue is basically #ust a flow-based 8eficit Round
Robin @8RRA system combined with ime 8i%ision ;ultiBle
Eccess @8;EA and emBorary "lock 2low @"2A
management suBBort, Ne also imBlement channel allocation!
channel schedule and channel release here, >f too many users
access the GPRS network! the network will become unsteady!
we configure K users @acti%e usersA Ber SL, >f more than K
users Ber SL! the result is that the allocation re6uest is
refused in release ', ?ther Bossibilities! e,g,! Blacing the
mobile into a waiting 6ueue! granting the re6uest but with a
starting time! BreemBting an e3isting lower Brioriti=ed "2
and so on,
2! ()-SGSN-'ueue
Nhen coming a Backet from GGSN! get its cla%%id! then
enter corresBonding 6ueue according to its cla%%id, 53ecute the
R58 @Random 5arly 8etectionA algorithm in the 6ueue,
"ecause there are J kinds of cla%%id! there are J 6ueues, Ne
adoBt N2Q @Neighted 2air QueuingA algorithm to schedule
these 6ueues! refer to 2ig, J, "ecause class ( is signaling or
stream traffic! it is imBortant and cannot be droBBed at random,
So class ( doesnIt need R58, he R58 algorithm in our model
is a little different from the normal algorithm1 we call it 5R58
@53tended Random 5arly 8etectionA,
8ue to the fact many Backets are buffered in SGSN! some
of them wait for a too long time! esBecially when there are too
many users while the network resource is limited so that it is
useless to transmit them to "SS! we should droB these Backets
to imBro%e throughBut and reduce a%erage delay! so we add
P8P life time control here! too,
, R , D , R , D , R , D , R , D
D e l !
C l s s
-
D e l !
C l s s
"
D e l !
C l s s
1
D e l !
C l s s
.
/ F 0
F l o w C o n t r o l b ! 1 i 2
D e l !
C l s s
3
2igure J, 8L-SGSN-QueueIs main algorithm
a! *R*(
he 5R58 algorithm calculates the a%erage 6ueue si=e
using a low Bass filter with an e3Bonential weighted mo%ing
a%erage, he a%erage 6ueue si=e is comBared to two thresholds.
a minimum and a ma+imum threshold, Nhen the a%erage 6ueue
si=e is less than the minimum threshold! no Backets are marked,
Nhen the a%erage 6ueue si=e is greater than the ma3imum
threshold! e%ery arri%ing Backet is marked, >f marked Backets
are! in fact! droBBed or if all source nodes are cooBerati%e! this
ensures that the a%erage 6ueue si=e does not significantly
e3ceed the ma3imum threshold, Nhen the a%erage 6ueue si=e
is between the minimum and ma3imum thresholds! each
arri%ing Backet is marked with Brobability ,a! where ,a is a
function of the a%erage 6ueue si=e avg, 5ach time a Backet is
marked! the Brobability that a Backet is marked from a
Barticular connection is roughly BroBortional to that
connectionIs share of the bandwidth at the router, he
BarametersI %alue of minimum and ma+imum are defined by
according to the networkIs re6uirement! such as minimum
e6uals to (,J and ma+imum e6uals to (,K C'(D,
-! ./'
Ne adoBt N2Q @Neighted 2air QueuingA algorithm to
schedule these 6ueues, >f some 6ueue is scheduled! we use a
flow control algorithm to #udge whether this Backet can be sent
or not, >f it can! we #ust use deque function to send1 if it cannot!
@we must reschedule it to send or it will lead to 6ueue header
congestion,A we #ust start a timer and wait a Beriod of time,
Nhen the timer e3Bires! we try to send it again, Ne reBeat it
until send the Backet successfully C'(D,
c! /low &ontrol
2rom "SS to ;S we use GPRSQueue that has each flowIs
basic information such as its leak bucket a%erage rate! leak
bucket buffer si=e and flowid, Ne renew the flowIs %alue
whose %alue %aries most in the recent second, he 8L-SGSN-
Queue that is from SGSN to "SS uses the information that
GPRSQueue gi%es to control the flows, GPRSQueue and 8L-
SGSN-Queue use tcl @tool command languageA to bind these
%ariables, hrough the 8L-SGSN-6ueueIs flow control! the
droB rate in GPRSQueue decreases, 8ue to using a%erage rate
to control flows! GPRSQueue will droB Backets inescaBably
C''D C'2D,
>L, E S>;PL5 5ME;PL5
>n this section! we will gi%e an e3amBle to demonstrate how
to use our model to analysis the Berformance of GPRS
network,
', 8efine network toBology and itIs Barameter like
2ig, 0,
2, 8efine traffic tyBe and number like Gab, 0H,
0, 8efine each classIs buffer in 8L-SGSN-Queue
like Gab, 0H,
4, 8efine simulation time! then start to simulate,
J, Nhen simulation is o%er! analy=e the result
according to the statistic file, Refer to Gab, 4H and
2ig, +,
+, 2rom the analysis of abo%e! we can get some
conclusion.
he throughBut increases as the Briority
imBro%es,
he a%erage delay decreases as the
Briority imBro%es,
he lost Bercent decreases as the Briority
imBro%es,
E"L5 >>>, RE22>- PP5 EN8 N$;"5R
-lassid ( ' 2 0 4
raffic
tyBe
Signaling
@-"RA
<P <P <P 2P
Number 0( '(( '(( '(( '((
buffer '; @hard
configurationA
'(Q
@2;A
2(Q
@4;A
0(Q
@+;A
4(Q
@);A
>n this scenario! total buffer is defined 2(;
E"L5 >L, <5 SE>S>- R5S$L ?2 5E-< -LESS
-lass>8
Recei%e
Backets Recei%e bytes
E%erage
delay @sA Lost Backets
Lost
Bercent @QA
( 22J(( K((((( (,04 ( (
' 22J*J 'K0J*)0* (,)J KJ (,42
2 'K+)' '+(0'J)+ 4,J) 020 ',+'
0 'J0+' '2*44'+2 '0,JJ *00 4,JJ
4 '42J( 2(44)J)( 2*,J+ ')(J '',24
2igure +, Statistic result of each classIs throughBut
hus! we can simulate all kinds of scenarios and analy=e some
conclusions that is #ust the ob#ecti%e why we gi%e such a
model,
L, -?N-$S>?N
>n this BaBer! we Bresent a GPRS network model and its
imBlementation in NS-2, >n order to get more e3act model!
some additional work needs to be done! such as link adaBtation
C'0D @imBlement all coding scheme! not only -S-'A and
mobility management C'4D, Ne will study some algorithm of
>P oBtimi=ation based on this model to imBro%e the
Berformance of the GPRS network,
R525R5N-5S
C'D 8igital cellular telecommunications system @Phase 2/A! network
architecture @GS; (0,(2 %ersion *,',( Release 'KK)A,
C2D 8igital cellular telecommunications system @Phase 2/A! technical
Berformance ob#ecti%es! @GS; (0,(J %ersion ),(,( Release 'KKKA,
C0D 0rd Generation PartnershiB Pro#ect1 echnical SBecification GrouB
GS;F58G5 Radio Eccess Network1 General Packet Radio Ser%ice
@GPRSA1 ;obile Station @;SA - "ase Station System @"SSA interface1
Radio Link -ontrolF ;edium Eccess -ontrol @RL-F;E-A Brotocol
@Release 'KKKA,
C4D 0rd Generation PartnershiB Pro#ect1 echnical SBecification GrouB -ore
Network1 8igital cellular telecommunications system @Phase 2/A1
General Packet Radio Ser%ice @GPRSA1 ;obile Station @;SA - Ser%ing
GPRS SuBBort Node @SGSNA1 Subnetwork 8eBendent -on%ergence
Protocol @SN8-PA @Release 'KKKA,
CJD Rei#o Lahti! GPRS P-$ -< ;G;! Nokia NR-! 'KKK! unBublished,
C+D :arosla% $her! ;artti ;oisio! R-S;ER Real ime - GS; Network
Simulator Release ','0 2unction 8escriBtion! 'KKK,
C*D NS-2 notes and documents! L>N Bro#ect! httB.FFwww,isi,eduFnsnamFns,
C)D 0rd Generation PartnershiB Pro#ect1 echnical SBecification GrouB
GS;F58G51 Radio Eccess Network1 Physical layer on the radio Bath1
General descriBtion @Release +A,
CKD <ilkka <eiskari! 0GPP RK* GPRS and 0G RKK QoS! Nokia NR-! 2((0!
unBublished,
C'(D <, ;ontes! etc! Enalysis of the 5-2-5 QoS solution for GPRS! G5REN
QoS Bro#ect! 2((0,
C''D Petri Gronberg! Simulation studies for "SSGP 2low -ontrol Procedure!
Nokia NR-! 2(((! unBublished,
C'2D 0rd Generation PartnershiB Pro#ect1 echnical SBecification GrouB GS;
58G5 Radio Eccess Network1 General Packet Radio Ser%ice @GPRSA1
"ase Station System @"SSA-Ser%ing GPRS SuBBort Node @SGSNA1 "SS
GPRS Protocol @"SSGPA @Release 'KKKA,
C'0D 0rd Generation PartnershiB Pro#ect1 echnical SBecification GrouB
GS;F58G5 Radio Eccess Network1 Link adaBtation @Release +A,
C'4D 0rd Generation PartnershiB Pro#ect1 echnical SBecification GrouB -ore
Network1 mobile radio interface Layer 0 sBecification1 core network
Brotocols1 Stage 0 @Release +A,

receive b!tes in ec$ clss
-
4------
1-------
14------
"-------
"4------
- 1 " 3 .

You might also like