Design of IMS Prepaid Application Server for SIP-based Services
Step 5. The IP-Message Gateway sends the SIP 200 OK message to UE1 through the PAS and the CSCF
2.4 Simulation Validation
X
x=Tm
x−Tm
tc=0 tc2fc(tc)fx(x)dtcdx
X x=Tm
x−Tm
tc=0 tcfc(tc)fx(x)dtcdx
=X − Tm−X
x=Tme−µx[1 + µx +12(µx)2]fx(x)dx µ[X − Tm−X
x=Tme−µx(1 + µx)fx(x)dx] (2.13) where fx(x) is expressed in (2.11).
2.4 Simulation Validation
We also developed a simulation model for the PAS. The simulation experiments are val-idated against the analytic model developed in this section. Base on (2.12) and (2.13), Table 2.1 lists the analytic and the simulation results for the unnecessary force-termination probability PU F T and the expected unnecessary delay E[td]. Table 2.1 indicates that for all cases considered in our study, the errors are within 0.6%. Therefore, the analytic and the simulation results are consistent.
In this discrete event simulation model for the prepaid application server, an event e consists of two fields: e.ts is the timestamp of the event and e.type is the event type. There are three event types: CALL ARRIVAL (a new prepaid call arrival), CALL COMPLETION (a prepaid call completion) and MSG ARRIVAL (a prepaid message arrival). These events are inserted into an event list, and are deleted/processed from the event list in the non-decreasing timestamp order. The output measures of the simulation are C (the number of call arrivals), N (the number of unnecessary force-terminated calls), M (the number of message deliveries which arrive during the in-progress calls), and Td (the accumulated delay for these M messages). These output measures are used to compute PU F T and E[td] as follows:
PU F T = N/C and E[td] = Td/M
Start
N=N+1;
End
Update x=x - sTm; s=0;
Generate the next
CALL_ARRIVAL event and insert it into the event queue.
Clear the event list and generate the first CALL_ARRIVAL and MSG_ARRIVAL events.
Set F_Flag=False and C_Flag=False; s=0;
x ≥ 0 n<10,000,000 Compute the output measures
Yes C_Flag==True?
Set C_Flag=True and C=C+1;
Generate call holding time tc and set td=tc; Generate CALL_COMPLETION event and insert it into the event queue;
Yes
Set X; XT; x=X;
N= 0; C=0;
Td= 0; M = 0;
Process the next event from the event list.
No Update x and set
C_Flag=False;
No
x ≥ (XT+Tm)?
Generate the next
MSG_ARRIVAL event and insert it into the event queue.
No Yes
Yes Set
F_Flag=False;
e.type =?
x=x-Tm; M=M+1;
Update x and td;
Yes MSG_
ARRIVAL CALL_
COMPLETION
CALL_
ARRIVAL No
x ≥ Tm? No
x=x-Tm;
x ≥ tc? Yes
Set F_Flag=True;
s=s+1;
M=M+1;
Td=Td+td; (x - td - sTm) No
≥ Tm? Yes n=n+1;
No 1
2
3
4
5
6
7 8
18
10
11 16
17 12
13 9
15 14 20
19 23
21
24 25
F_Flag==True 22
Yes
No
Figure 2.5: Simulation Flow Chart.
Table 2.1: Comparison of the Analytic and Simulation Results (Xc > 0, Tm = 5 CU, X = 20Tm, 1/λc = 50 TU)
1/λm (Unit: TU) 1 5 10 50 100
Simulation 43.086% 13.172% 6.409% 1.079% 0.520%
Analytic 42.960% 13.196% 6.419% 1.078% 0.520%
Error −0.29% 0.18% 0.16% −0.09% −0.00%
(a) PU F T (XT = 0, E[tc] = 5λ1
c)
E[tc] (Unit: TU) 1 5 10 50 100
Simulation (Unit: TU) 0.990 4.678 8.520 18.128 20.056 Analytic (Unit: TU) 0.985 4.681 8.534 18.172 20.050
Error −0.51% 0.06% 0.16% 0.24% −0.03%
(b) E[td] (XT ≥ X, λm = λc)
To simulate the behavior of the prepaid account, several variables are maintained in the simulation. When a call is in-progress, C Flag is set to “True”. If the remaining credit units x is larger than the call holding time tc, then F Flag is set to “False”. The period td
represents the residual life of the call and s indicates the number of messages which are stored and are delivered when the call is completed.
The flowchart of the simulation is shown in Fig. 2.5. Step 1 initializes the input parameters (X, XT, x, N, C, Td and M) of a prepaid account. Step 2 generates the first CALL ARRIVAL and MSG ARRIVAL events, and inserts these events into the event list. Initially, F Flag and C Flag are set to “False” ands is set to 0. In Steps 3 and 4, the next event e in the event list is processed based on its type.
If e.type== CALL ARRIVAL event at Step 4, then at step 5, C Flag is set to
“True” and C is incremented by one. Then the call holding time tc for the prepaid call is generated. The residual life tdis set to tc. Step 5 also generates a CALL COMPLETION event e1, where e1.ts=e.ts+tc. Event e1 is inserted into the event list. At Step 6, if the remaining CUs x is larger than tc, then F Flag is set to “False” (Step7). Otherwise, F Flag is set to “True” (Step 8).
If e.type== MSG ARRIVAL at Step 4, the next MSG ARRIVAL event is gen-erated and inserted into the event list at Step 9. If a prepaid call is in-progress (i.e., C Flag=True at Step 10), it first updates the values of the remaining CUs x and the
residual call time td. At Step 12, if the remaining CUs x ≥ (XT + Tm), then at Step 13 the message is sent immediately and x is reduced to x − Tm. The number M of message deliveries is incremented by one. If x < (XT + Tm) at Step 12, then Step 14 checks if the remaining credits x suffices to support the message delivery when the call is completed (i.e., (x − td− sTm)≥ Tm). If so, at Step 15 the message is stored and will be processed when the call is completed. Both s and M are incremented by one. The accumulated delivery delay Td is increased by td. If no prepaid call is in-progress (i.e., C Flag=“False”) at Step 10, the simulation proceeds to Step 16. If the remaining credits x is larger than Tm, the message is sent and x is reduced to x = x − Tm (Step 17). If x < Tm at Step 16, all CUs are consumed and n is incremented by one at Step 23, and the simulation proceeds to Step 24.
If e.type== CALL COMPLETION at Step 4, then the simulation proceeds to Step 18. This step first updates the remaining CUs x and sets C Flag to “False”. At Step 19, if the remaining CUs are not depleted (i.e., x ≥ 0), the stored messages can be delivered and x is updated as x − sTm. The number s of stored messages is set to 0, the next CALL ARRIVAL event is generated and inserted into the event list. If the remaining CUs is insufficient (i.e., x < 0 at Step 19) and the the call need not be force-terminated (i.e., F Flag=“False” at Step 20), then the number N of unnecessary false-terminated calls is incremented by one (Step 22), and the simulation proceeds to Step 23. If F Flag=“True” at Step 20, the simulation also proceeds to Step 23. At Step 23, all CUs are consumed, n is incremented by one and the simulation proceeds to Step 24.
If 10, 000, 000 prepaid accounts have been processed at Step 24, the simulation termi-nates and the output measures are calculated.