3 testing sip
TRANSCRIPT
-
8/20/2019 3 Testing SIP
1/33
Testing SIP
Using XML Protocol TemplatesM. RanganathanOlivier Deruelle
Doug Montgomery
Avance !et"or#ing Technologies Division$!ational Institute o% Stanars an Technology$&aithers'urg$ MD ()*++$ USA.
http,--""".ant.nist.gov-
-
8/20/2019 3 Testing SIP
2/33
Introucing SIP
Peertopeer Signaling Protocol use%or IP Telephony$ /on%erencing an
Instant Messaging Introuce in 0+++
+ revisions an ( R1/s since then2
3iely eploye Microso%t RT/Server$ IM /lient$ /isco gate"ays etc.
-
8/20/2019 3 Testing SIP
3/33
Introucing SIP
Te4t 'ase
unli#e 5.6(6 7Stateless8
Protocol state encoe in message
94tensi'le Many e4tensions e4ist.
/an run over unrelia'le or relia'le transports Out o% orer - roppe signaling messages.
-
8/20/2019 3 Testing SIP
4/33
Simple SIP /all 1lo"
INVITE
100 Trying
180 Ringing200 OK
ACK
RTP Media Stream
BYE
OK
UAC UAS
UAS U!er Agent
Ser"er
UAC U!er Agent
C#ient
T$ere %an &e intermediate
Signa#ing n'de! (Pr')y Ser"er!
t$at *ee+ %a## !tate,-
-
8/20/2019 3 Testing SIP
5/33
Protocol /haracteristics
Protocol is ro'ust an e4tensi'le, SIP #eeps enough state in the Messages to eal "ith
all these complications. /orrect implementation is tric#y.
Signaling may have to go through multiplehops.
Pro4y servers may go o"n "ithout "arning. Peers may go o"n "ithout "arning. Sessions can move "ithout prior planning. !et"or# can %ail "ithout "arning.
-
8/20/2019 3 Testing SIP
6/33
SIP Testing
Loa Testing &enerate 0)):s o% simultaneous sessions.
/all 1lo" Testing Unit testing the SIP Protocol
Implementation 'y generation o%
scenarios. Primary moe o% testing uring SIP
interopera'ility test events.
-
8/20/2019 3 Testing SIP
7/33
&enerating SIP Test /ases
9ntoen testing is %easi'le protocol state an causality is encoe
in the Messages-/all 1lo"s.
94haustive testing generates toomany test cases. Unerstaning implementation - protocol
comple4ities results in goo test cases.
-
8/20/2019 3 Testing SIP
8/33
SIP Application Structure
A++#i%ati'n
Net.'r* (Ra. Byte!,
Par!er En%'der
Re/Re/ Re!
SIP Sta%*
T r a n ! a % t i ' n
T r a n ! a % t i ' n
T r a n ! a % t i ' n
Re/ Re!
ia#'g ia#'g
Me!!age!
E"ent!
Me!!age!
E"ent!
Me!!age!
E"ent!
-
8/20/2019 3 Testing SIP
9/33
/onstructing Test /ases 1or
SIP Layer the Test /ases li#e
Applications-Stac#s are layere Message Layer$ Transaction Layer an
Dialog Layer tests
This prunes the num'er o% tests an
ma#es the tests more meaning%ul.
-
8/20/2019 3 Testing SIP
10/33
SIP Messages
Protocol encoes all the state it nees inthe message.
5TTP-Mail ; li#e heaers an a Re
-
8/20/2019 3 Testing SIP
11/33
Message Layer
5anle Incoming Re
-
8/20/2019 3 Testing SIP
12/33
Message Layer
&rammar is conte4t sensitive an e>neusing A?!1
&rammar has change 'et"een R1/s &rammar is compositional @mail$ URL$ 5TTP Parser generators have trou'le "ith R1/
grammar
usually han coe parsers are use Some tools are availa'le ; antlr
5eaers are Te4t @?oy can 'e ?inary
-
8/20/2019 3 Testing SIP
13/33
Transaction Layer
SIP Applications are transaction orientean usually interact irectly "ith a
transaction layer. Primary uties o% the Transaction Layer
Re
-
8/20/2019 3 Testing SIP
14/33
I!=IT9 /lient Transaction
Calling
Proceeding
Completed
Terminated
Invite from TU
Invite Sent
Timer A
1xx to TU
300-699
ACK ent
300 !699
ACK ent300-699 ACK Sent
"xx to TU
Tranport #rr
"xx to TU
Timer $ fire%& Tranport #rr
Timer ' fire
-
8/20/2019 3 Testing SIP
15/33
I!=IT9 Server Transaction
Proceeding
Completed
Confirmed
Terminated
Pa I()IT# to TU
I()IT# Send
&epone
I()IT# Send &epone
300-699 ACK ent
Timer I fire
0)00++ %rom TU
Transport 9rr (44 %rom TU
6))B++ %rom TU
Timer G FiresSend
ResponseA/C
Timer I fres
-
8/20/2019 3 Testing SIP
16/33
Transaction Layer, /ommon
?ugs Implementations o not implement the Transaction State
Machine correctly ?ac#"ar compati'ility
In R1/ 6(B0 the 'ranch ID o% the topmost 7=ia8 heaerienti>es the Transaction R1/ (E6 use a hash over 1rom$ To$ Re
-
8/20/2019 3 Testing SIP
17/33
Testing The Transaction
Layer 5o" to &enerate /overage to
e4haustively test !ee to rive TSM to ta#e each Transition %or each State.
Simulate lost messages Drop Re
-
8/20/2019 3 Testing SIP
18/33
Testing The Transaction
Layer Simulate timing variations
Delay Responses
&enerate out o% orer responses$ StrayMessages
Testing the State Machine
-
8/20/2019 3 Testing SIP
19/33
Dialog Layer
Dialog is a peertopeer association'et"een communicating SIP enpoints
Dialogs esta'lishe 'y Dialog creating Transactions.
!ot all transactions create Dialogs.
A Transaction may 'elong to e4actly one Dialog.
SIP messages carry enough state toienti%y the Dialog irectly %rom themessage
-
8/20/2019 3 Testing SIP
20/33
Dialog Layer
Manages Dialog /reation-Tearo"n Dialogs create 'y transaction completion
Manages Route Sets Test agent must test %or e4pecte Route - Recor
Route heaers in re
-
8/20/2019 3 Testing SIP
21/33
Dialog Layer, /ommon
?ugs Dialogs are ienti>e 'y portions o% a
message, /allID$ 1rom$ To tags in R1/ 6(B0
/allID$ 1rom$ To aresses R1/(E6
Stac#s try to #eep 'ac#"ar
compati'ility ?ugs are %re
-
8/20/2019 3 Testing SIP
22/33
Testing the Dialog Layer
Re
-
8/20/2019 3 Testing SIP
23/33
/all 1lo" Testing Approach
Test the causal se
-
8/20/2019 3 Testing SIP
24/33
Motivation
/ompact representation that matches theR1/
XML is hierarchical goo "ay to represent SIPprotocol a'stractions
Interopera'ility testing "ith control Typically components are teste in call Go"
scenarios Typically operating in an uncontrolle
environment Reproucing comple4 scenarios is iHcult
-
8/20/2019 3 Testing SIP
25/33
XML representation o% SIP
De>ne a set o% XML tags to representthe rene XML tags to e4press call Go"state machine
Input to 9vent 9ngine that can run the
call Go" &enerate variations o% the call Go" 'y
moi%ying the XML script
-
8/20/2019 3 Testing SIP
26/33
Test Scripting Architecture
Ca## #'. Te!ting Pr't'%'# Tem+#ate
E"ent Engine
NISTSIP Sta%*
Ser"i%e 3n%ti'n
Net.'r*
Ser"i%e S%ri+t a %a##'3t t'
a !er"i%e 43n%ti'n at tran!iti'n
+'int! in t$e %a## 4#'.-
Ser"i%e C'ntainer
5M6 Engine 7 a"a9yt$'n
inter+reter
Unit Uner
Test
-
8/20/2019 3 Testing SIP
27/33
Test Script
Pattern matching$ timer events an transitionsuse %or triggering transitions in test script.
Test script is represente 'y a set o% Transactionsthat may 'e neste "ithin a ialog.
The entire transaction state machine is e4posean e>ne using XML. Timing can 'e varie an controlle errors can 'e
create. Service coe can 'e calle "hen messages arrive$
transactions are starte$ transactions complete$ialogs are create or ialogs complete.
-
8/20/2019 3 Testing SIP
28/33
XML Tags Mirror Protocol
Structure
-
8/20/2019 3 Testing SIP
29/33
3hy Do It
Simple$ clear e4pression o% test scenarios Protocol maps to XML script one to one
/an generate multiple scenarios 'aseon small variations %or the same call Go".
/an simulate common enpoint @UserAgent 'ehavior.
/an generate controlle errorconitions-timing variations.
-
8/20/2019 3 Testing SIP
30/33
Test Log 1ile /ollection
Log >le is a iagnostic tool to help e'ugprotocol pro'lems.
Stac# generates log >les using XML %ormat. Distri'ute traces are collate at test pro4y
Trace vie"er pairs arcs 'y Transactions
Pr')y Tra%e "ie.er (a"a A++#et,
Re!+'nder UA6'%a# Tra%e
6'%a# Tra%eRMI
-
8/20/2019 3 Testing SIP
31/33
=isualiFing the Trace
Java Appletcollects anvisualiFesistri'ute call
Go" trace >les. Augmente
"ith XML scriptstatein%ormation.
9na'lese'ugging callGo"s K testscripts.
-
8/20/2019 3 Testing SIP
32/33
Relate "or#
TT/! testing o% SIP Proceural test cases
/an generate these %rom templates.
Using our approach Simpli>es logical esign
XML tools can 'e use %or test case esign.
$tt+:99...)-antd-ni!t-g'"9+r';9i+te#
-
8/20/2019 3 Testing SIP
33/33
94tensions an 1uture
3or# O line veri>cation - /all 1lo" &eneration
&eneration o% /all Go"s 'ase on message logs =eri>cation o% traces 'ase on message logs
/ustomiFa'le test scripts User Uploaing o% Scripts
StanariFe XML representation o% the SIP protocol 94tensions to service creation
Integration "ith other istri'ute scripting technologies JXTA$ SOAP