Abstract

Study of using TTCN-3 for specifying tests for SIP. This TR should describe the technical approach used including experiences of implementing the tests on a real test platform. It will include example test purposes and TTCN-3 tests. However, it will not define a complete SIP conformance test suite but should lay the foundations for producing one in the future if required.

Status
Published
Publication Date
31-Mar-2004
Current Stage
6060 - National Implementation/Publication (Adopted Project)
Start Date
01-Apr-2004
Due Date
01-Apr-2004
Completion Date
01-Apr-2004

Buy Documents

Technical report

SIST-TP TR 102 026 V1.1.1:2004

English language (39 pages)
Preview
Preview
e-Library read for
×1 day

SIST-TP TR 102 026 V1.1.1:2004 is the Slovenian publication of an ETSI Technical Report on Telecommunications and Internet Protocol Harmonization Over Networks (TIPHON). It studies whether Testing and Test Control Notation version 3 (TTCN-3) can be used to specify tests for TIPHON protocols, especially Session Initiation Protocol (SIP) and Open Settlement Protocol (OSP), for people writing test specifications and building test tools.

The report is a technical study, not a complete conformance suite. Its value is in the test architecture, the SIP and OSP modelling examples, and the practical guidance it gives for TTCN-3-based test development.

What does SIST-TP TR 102 026 V1.1.1:2004 specify?

SIST-TP TR 102 026 V1.1.1:2004 analyses how suitable TTCN-3 is for TIPHON test specifications, with special focus on the TIPHON profile of SIP and on OSP. The study is restricted to the TTCN-3 Core Language, so it is about how to express tests, not about defining a full protocol test suite.

The document is organized as follows: background and rationale, SIP testing, OSP testing, practical experience, tool availability, maintenance, and training. Annex A gives style guidance for TTCN-3 Abstract Test Suites (ATS), and Annex B is a bibliography.

AnnexWhat it covers
Annex ASuggested style guidelines for TTCN-3 ATS development
Annex BBibliography

What are the key requirements of SIST-TP TR 102 026 V1.1.1:2004?

Although this is a Technical Report, it gives clear recommendations on how SIP and OSP tests should be structured in TTCN-3.

  • Clause 5.1 recommends a higher-level SIP adaptation layer rather than coding all message handling directly in TTCN-3.
    The preferred option is to place the Point of Control and Observation (PCO) above UDP or TCP, so the test system parses SIP messages before they reach the TTCN-3 tester. In practice, this keeps test cases focused on test purpose instead of low-level text handling.

  • Clause 5.2 recommends asynchronous communication for SIP testing.
    SIP message exchange is described as simple enough for TTCN-3 timers and communication mechanisms to model it directly. This matters because SIP tests can be written as message-driven scenarios without forcing a synchronous style.

  • Clause 5.3 recommends structuring SIP messages in TTCN-3 instead of treating them as single text strings.
    Requests and responses are modelled with records, sets, optional fields, parameterized templates, wildcards, and modified templates. In practice, this gives better reuse and more flexible matching of incoming messages, while still keeping the test readable.

  • Clause 5.3.1 and clause 5.3.2 show how SIP headers and patterns can be made more precise.
    The report discusses representing headers either as structured fields or as concatenated strings, and it introduces TTCN-3 regular expression patterns for matching variable text. This helps when a test must accept controlled variation, such as spacing or header values.

  • Clause 6.1 recommends an OSP adaptation layer that decodes XML or ASN.1 before TTCN-3 sees the data.
    For normal OSP message exchange, the adaptation layer receives XML, decodes it using the OSP DTD, maps it to TTCN-3 types, and preserves the raw payload. In practice, this makes it easier to separate protocol errors from parsing errors.

  • Clause 6.1.2 shows that OSP token carriage may arrive as ASN.1, XML ASCII, or XML BIN.
    The adaptation layer converts these forms into the TTCN-3 types defined in the companion OSP material. This matters for interoperability because the same logical test may need to cope with different encodings.

  • Clause 6.3 demonstrates how OSP messages are modelled as TTCN-3 types and templates.
    The AuthorizationRequest example splits the XML structure into attribute, content, and payload parts, and the PricingIndication and Status examples show parameterization and wildcards. That gives a concrete pattern for defining reusable tests for XML-based messages.

  • Clauses 7 to 10 emphasize implementation support, not just language theory.
    The report records practical TTCN-3 use on real test platforms, lists the kinds of tools needed, and notes that training and maintenance support are part of successful adoption. For a reader, this means the document is about buildable test specifications, not just notation.

What terms does SIST-TP TR 102 026 V1.1.1:2004 define?

  • Testing and Test Control Notation version 3 (TTCN-3) - A modern test specification language used here to express SIP and OSP test behavior, data, and matching rules.
  • Session Initiation Protocol (SIP) - The text-based IP signaling protocol studied here for testing via TTCN-3.
  • Open Settlement Protocol (OSP) - The XML-based protocol studied here for TTCN-3 test specification and adaptation-layer handling.
  • Implementation Under Test (IUT) - The implementation being exercised by the test case.
  • System Under Test (SUT) - The system or platform as a whole that is being tested.
  • Point of Control and Observation (PCO) - The interface where TTCN-3 exchanges test data with the system or adaptation layer.
  • Abstract Test Suite (ATS) - The coded test suite that applies the test cases and control logic described in TTCN-3.
  • (Protocol) Implementation Conformance Statement ((P)ICS) and (P)IXIT - Configuration information used to decide which tests apply and what test setup details are needed.

Who uses SIST-TP TR 102 026 V1.1.1:2004?

The report is meant for people creating and implementing telecom protocol tests for SIP and OSP. That includes TIPHON test spec writers, TTCN-3 developers, interoperability engineers, and tool vendors.

It is also useful to quality managers and lab teams who need to understand how a TTCN-3 test system should be structured before they build or review an ATS. The report specifically speaks to practical work on real test platforms, so it is relevant to conformance labs, interoperability events, and teams maintaining SIP or OSP test suites.

What changed in SIST-TP TR 102 026 V1.1.1:2004 from the previous edition?

SIST-TP TR 102 026 V1.1.1:2004 is stated to be identical to TR 102 026 Version 1.1.1. The document history in the report records publication in January 2002.

Which standards are used with SIST-TP TR 102 026 V1.1.1:2004?

StandardWhat it contributes
ETSI ES 201 873-1The TTCN-3 Core Language used as the basis for the study
ISO/IEC 9646-3The older TTCN-2 conformance testing framework used for comparison
ETSI TS 101 321The OSP specification used for the protocol model and DTD reference
ITU-T Recommendation Z.140The parallel publication of TTCN-3 Core Language
ETSI ES 201 873-2TTCN-3 Tabular Presentation Format, listed in the bibliography
ETSI TR 101 873-3TTCN-3 Graphical Presentation Format, listed in the bibliography
ITU-T Recommendation X.680ASN.1 basic notation, listed in the bibliography
IETF RFC 2543The SIP reference listed in the bibliography

What does the SIST-TP TR 102 026 V1.1.1:2004 document contain?

This report contains side-by-side TTCN-3 examples for SIP and OSP, including message templates, matching techniques, and a sample test case for each protocol area. It also includes a SIP architecture figure, an OSP test architecture figure, and an adaptation-layer figure.

The document discusses TTCN-3 pattern matching, parameterization, wildcards, record and set types, and XML-to-TTCN-3 mapping for OSP. Annex A then gives detailed style guidance for ATS development, covering module organization, comments, type definitions, functions, whitespace, naming, alternates, test case style, and PICS/PIXIT parameters.

It also records practical experience from real events, names the kinds of TTCN-3 tools needed to write and run tests, and explains why maintenance and training support matter for the adoption of TTCN-3 in TIPHON test development.

Buy Documents

Technical report

SIST-TP TR 102 026 V1.1.1:2004

English language (39 pages)
Preview
Preview
e-Library read for
×1 day

Get Certified

Connect with accredited certification bodies for this standard

ANCE

Mexican certification and testing association.

EMA Mexico Verified

Intertek Slovenia

Intertek testing, inspection, and certification services in Slovenia.

UKAS Slovenia Verified

LNE (Laboratoire National de Métrologie et d'Essais)

French national laboratory for metrology and testing.

COFRAC France Verified

Sponsored listings

Frequently Asked Questions

SIST-TP TR 102 026 V1.1.1:2004 is a technical report published by the Slovenian Institute for Standardization (SIST). Its full title is "Telecommunications and Internet Protocol Harmonization Over Networks (TIPHON); Study of the use of TTCN-3 for SIP and for OSP test specifications". This standard covers: Study of using TTCN-3 for specifying tests for SIP. This TR should describe the technical approach used including experiences of implementing the tests on a real test platform. It will include example test purposes and TTCN-3 tests. However, it will not define a complete SIP conformance test suite but should lay the foundations for producing one in the future if required.

Study of using TTCN-3 for specifying tests for SIP. This TR should describe the technical approach used including experiences of implementing the tests on a real test platform. It will include example test purposes and TTCN-3 tests. However, it will not define a complete SIP conformance test suite but should lay the foundations for producing one in the future if required.

SIST-TP TR 102 026 V1.1.1:2004 is classified under the following ICS (International Classification for Standards) categories: 33.020 - Telecommunications in general. The ICS classification helps identify the subject area and facilitates finding related standards.

SIST-TP TR 102 026 V1.1.1:2004 is available in PDF format for immediate download after purchase. The document can be added to your cart and obtained through the secure checkout process. Digital delivery ensures instant access to the complete standard document.

Standards Content (Sample)

Contents

  • 1 Scope
  • 2 References
  • 3 Abbreviations
  • 7 ETSI TR 102 026 V1.1.1 (2002-01)
  • 4 Background
  • 8 ETSI TR 102 026 V1.1.1 (2002-01)
  • 5 Suitability of TTCN-3 for SIP testing
  • 5.1 Architectural considerations for testing SIP
  • 9 ETSI TR 102 026 V1.1.1 (2002-01)
  • 10 ETSI TR 102 026 V1.1.1 (2002-01)
  • 11 ETSI TR 102 026 V1.1.1 (2002-01)
  • 12 ETSI TR 102 026 V1.1.1 (2002-01)
  • 13 ETSI TR 102 026 V1.1.1 (2002-01)
  • 14 ETSI TR 102 026 V1.1.1 (2002-01)
  • 15 ETSI TR 102 026 V1.1.1 (2002-01)
  • 16 ETSI TR 102 026 V1.1.1 (2002-01)
  • 6 Suitability of TTCN-3 for OSP testing
  • 6.1 Architectural considerations for testing OSP
  • 17 ETSI TR 102 026 V1.1.1 (2002-01)
  • 18 ETSI TR 102 026 V1.1.1 (2002-01)
  • 19 ETSI TR 102 026 V1.1.1 (2002-01)
  • 20 ETSI TR 102 026 V1.1.1 (2002-01)
  • 21 ETSI TR 102 026 V1.1.1 (2002-01)
  • 8 Availability of tools
  • 9 Maintenance of the TTCN-3 standard
  • 22 ETSI TR 102 026 V1.1.1 (2002-01)
  • 10 Training
  • 23 ETSI TR 102 026 V1.1.1 (2002-01)
  • 24 ETSI TR 102 026 V1.1.1 (2002-01)
  • 25 ETSI TR 102 026 V1.1.1 (2002-01)
  • 26 ETSI TR 102 026 V1.1.1 (2002-01)
  • 27 ETSI TR 102 026 V1.1.1 (2002-01)
  • 28 ETSI TR 102 026 V1.1.1 (2002-01)
  • 29 ETSI TR 102 026 V1.1.1 (2002-01)
  • 30 ETSI TR 102 026 V1.1.1 (2002-01)
  • 31 ETSI TR 102 026 V1.1.1 (2002-01)
  • 32 ETSI TR 102 026 V1.1.1 (2002-01)
  • 33 ETSI TR 102 026 V1.1.1 (2002-01)
  • 34 ETSI TR 102 026 V1.1.1 (2002-01)
  • 35 ETSI TR 102 026 V1.1.1 (2002-01)
  • 36 ETSI TR 102 026 V1.1.1 (2002-01)
  • 37 ETSI TR 102 026 V1.1.1 (2002-01)
  • 38 ETSI TR 102 026 V1.1.1 (2002-01)
  • Bibliography
  • 39 ETSI TR 102 026 V1.1.1 (2002-01)

1 Scope

The present document provides an analysis on the suitability of using TTCN-3 as defined in ES 210 873-1 [1] to specify the test specifications for TIPHON protocols, in particular the TIPHON profile of SIP (Session Initiation Protocol) and the TIPHON OSP (Open Settlement Protocol). This study is restricted to the use of the TTCN-3 Core Language.

2 References

For the purposes of this Technical Report (TR) the following references apply:

[1] ETSI ES 201 873-1: "Methods for Testing and Specification (MTS); The Tree and Tabular Combined Notation version 3; Part 1: TTCN-3 Core Language".

[2] ISO/IEC 9646-3: "Information technology - Open Systems Interconnection - Conformance testing methodology and framework - Part 3: The Tree and Tabular Combined Notation (TTCN) Edition 2".

[3] ETSI TS 101 321: "Telecommunications and Internet Protocol Harmonization Over Networks (TIPHON); Open Settlement Protocol (OSP) for Inter-Domain pricing, authorization, and usage exchange".

[4] ITU-T Recommendation Z.140: "The tree and tabular combined notation version 3 (TTCN-3):

Core language".

3 Abbreviations

For the purposes of the present document, the following abbreviations apply:

ASN.1 Abstract Syntax Notation One ATS Abstract Test Suite DTD Document Type Definition IUT Implementation Under Test MTC Master Test Component OSP Open Settlement Protocol (P)ICS (Protocol) Implementation Conformance Statement (P)IXIT (Protocol) Implementation eXtra Information for Testing PDU Protocol Data Unit SIP Session Initiation Protocol SUT System Under Test TCP Transfert Control Protocol TTCN-2 Tree and Tabular Combined Notation version 2 TTCN-3 Testing and Test Control Notation version 3 UDP User Datagram Protocol XML eXtensible Markup Language PCO Point of Control and Observation DE Development Environment ETSI

SIST-TP TR 102 026 V1.1.1:2004

7 ETSI TR 102 026 V1.1.1 (2002-01)

4 Background

The detailed code for nearly all ETSI (conformance) Abstract Test Suites (ATS) is written in TTCN. There are two versions of TTCN, version 2 (TTCN-2) as defined in ISO/IEC-9646-3 [2] and the recently published ETSI version 3 ES 201 873-1 [1].

NOTE: Version 1 of TTCN is not now used by ETSI.

Version 2 is oriented towards conformance testing and has been widely applied in testing telecommunications protocols and services for over 10 years. TTCN-3 is a modernization of TTCN-2. It has been developed to apply to a wide range of testing applications (i.e. it is not limited to conformance testing) and the syntax of the language has been brought into line with that of other modern programming languages.

While it is not anticipated that TTCN-2 will immediately replace TTCN-3 (from ETSI's point of view the transition to TTCN-3 is expected to occur over several years) there are good reasons to consider using TTCN-3 for "new" protocols such as SIP or OSP.

EP TIPHON is writing test specifications for H.225, H.245, H.248, SIP and OSP. The tests for the first three protocols are being written in TTCN-2. This is mainly due to timing (the work was started several months prior to the publication of TTCN-3) and the fact that they are "traditional" protocols (for example H.225 is very close to Q.931). It is also more likely that, in the short-term, the actual test systems for these protocols will be based on TTCN-2. However, the nature of SIP and OSP (e.g., text-based, datacom-oriented) makes them an ideal candidate for TTCN-3. The present document makes an initial analysis on the suitability of using TTCN-3 to for SIP and OSP test specifications.

ETSI

SIST-TP TR 102 026 V1.1.1:2004

8 ETSI TR 102 026 V1.1.1 (2002-01)

5 Suitability of TTCN-3 for SIP testing

In order to understand the suitability of TTCN-3 for testing SIP it is necessary to consider three main aspects:

  • the basic testing architecture, i.e. the location of the test interfaces;
  • the expression of dynamic behaviour (i.e. SIP message exchanges);
  • the representation of data (i.e. SIP messages).

These aspects are described in clauses 5.1, 5.2 and 5.3 respectively.

5.1 Architectural considerations for testing SIP

Two conceptual SIP test systems are illustrated in figure 1. The TTCN-3 parts of the test system are represented by the white boxes, which in the present document we refer to as the "TTCN-3 Tester". The light grey box represents sub-structured parts of the test system. The dark grey boxes indicate the underlying transport layer, either UDP or TCP.

Option 1 Option 2 High level (intelligent) processing of the SIP All processing of PCO Initial low - level SIP messages messages done processing o f the SIP in TTCN -3 messages done in test system

PCO TTCN UDP/TCP UDP/TCP

Figure 1: Basic test system architecture TTCN-3 behaviour is executed over test ports, sometimes called PCOs (Points of Control and Observation). For SIP testing there are basically two options for the placement of the PCO. - directly over UDP (or TCP); - higher than UDP (or TCP), i.e. "embedded" in the test system. In the first option of figure 1 all processing of the SIP messages is expressed in TTCN-3. For received messages this means that the PCO delivers a SIP message to the TTCN-3 tester as a single text string. The TTCN-3 code must then (somehow) parse this text string and break it down into data structures on which the TTCN-3 matching mechanisms etc. can operate. For send messages the reverse occurs i.e. TTCN-3 data structures representing the SIP message are encoded as a single text string.

It is certainly possible to use TTCN-3 this way but this would probably be inefficient. It would also overload the TTCN-3 test cases (not to mention the test suite writers) with detail not explicitly relevant to the test purposes. In the second option, the test system receives a SIP message over the UDP (or TCP) port and does the initial parsing before passing the structure to the TTCN-3 Tester via the PCO. In its simplest form this parser need only recognize the basic "outline" of the message with no detailed knowledge of individual headers. This structure would be mapped to the corresponding TTCN-3 template on a best possible fit basis. The TTCN-3 Tester then operates directly on this data structure rather than the incoming text string (by pattern matching). ETSI

SIST-TP TR 102 026 V1.1.1:2004

9 ETSI TR 102 026 V1.1.1 (2002-01)

If the tester is to deliver more complex TTCN-3 structures then the underlying parser will need to be correspondingly complex. As this will effect how a TTCN-3 test case is expressed (i.e. place restrictions on how TTCN-3 is used) it is important that this functionality is defined by EP TIPHON at an early stage. In conventional protocol testing (especially when using, say, ASN.1) this sub-layer (shaded light grey in figure 1) is often referred to as an encoder-decoder. Here, the incoming data is a bit stream which is decoded by the test system and passed to the TTCN-3 tester in structured form.

Discussions with several tool implementer's indicate that option 2 should be the favoured approach. The present document therefore recommends that EP TIPHON follow option 2 when writing TTCN-3 test cases for SIP. 5.2 Expressing SIP dynamic behaviour in TTCN-3 SIP has very simple dynamic behaviour. The TTCN-3 communication and timer mechanisms etc. are entirely adequate to specify the exchange of SIP messages. The present document recommends that TIPHON SIP tests are expressed using asynchronous communication.

NOTE: Generally, SIP testing would be based on asynchronous message exchanges, however TTCN-3 does have synchronous communication if it is desired to express the test that way. A typical piece of SIP behaviour could be:

testcase SIP_RG_RT_V_001() runs on SipComponent system SipInterfaces // Selection: To be defined // Status: Mandatory // SUT: A UA, a proxy, or a redirect server.

// Precondition: None // Ref: 2.2 [1], 7.1 [1], 10.14 [1] // Purpose: Ensure that the IUT, in order to be registered, sends a REGISTER request // t to its proxy (Home server, outbound proxy) with the action field set to "proxy" // in the Contact header field, without user name in the Request-URI, // with a Via header field and with a SIP URL as request-URI.

var REG_Request V_REGISTER_Request; var ContactAddress_List V_ContactList; var GenericParam_List V_GenericParamList; var integer i,j, nbelement, nbparam; var boolean hasBeenFound:=false;

sut.action ("Please REGISTER"); TWait.start(PX_TWAIT); alt

[] SIP1.receive (REGISTER_Request_r_2) from rcv_label -> value V_REGISTER_Request

TWait.stop; // Catch and prepare informations to answer iutContact := getContactAddr(V_REGISTER_Request.reqHeader.contact.contactBody.contactAddress_List[1]);

V_CallId := V_REGISTER_Request.reqHeader.callId; V_CSeq := V_REGISTER_Request.reqHeader.cSeq; V_From := V_REGISTER_Request.reqHeader.fromField; V_To := V_REGISTER_Request.reqHeader.toField; V_Via := V_REGISTER_Request.reqHeader.via; // update sent_label according to received via header field getViaReplyAddr(V_Via.viaBody); //Add a Tag in the TO field V_To.toParams := {{TAG_ID, GetAValueTag()}};

// Check Contact content V_ContactList := V_REGISTER_Request.reqHeader.contact.contactBody.contactAddress_List; nbelement := sizeof(V_ContactList); for (i:=1;i==nbelement;i:=i+1)

hasBeenFound:=false; // Check that parameters are present in the contact if (match(V_ContactList[i], ContactAdress_r_1))

V_GenericParamList := V_ContactList[i].contactParams; nbparam := sizeof(V_GenericParamList); j:=1; //Check that at least one parameter is set to action="proxy" ETSI

SIST-TP TR 102 026 V1.1.1:2004

10 ETSI TR 102 026 V1.1.1 (2002-01)

do

if (match(V_GenericParamList[j],GenericParam_r_1))

hasBeenFound:=true;

// Check that contact does not include a parameter set to action="redirect" if (match(V_GenericParamList[j],GenericParam_r_2))

hasBeenFound:=false; j:= nbparam;

j:=j+1;

while (j<=nbparam) //end loop on contact parameters

if(not hasBeenFound)

verdict.set(fail); //Answer with a 409 status message SIP1.send (Response_409_s_1(V_CallId, V_CSeq, V_From, V_To, V_Via )) to sent_label; stop

} //end For on Contact list verdict.set(pass); //Send a 200OK Answer to the UA with an Expire header field set //to PX_DELTA_REGISTRATION and the contact list SIP1.send (Response_200_s_2(V_CallId, V_CSeq, V_From, V_To, V_Via, V_REGISTER_Request.reqHeader.contact, PX_DELTA_REGISTRATION )) to sent_label

[] SIP1.trigger from rcv_label

all timer.stop; verdict.set(fail); stop

[] Twait.timeout {verdict.set(inconc); stop}

} // end testcase SIP_RG_RT_V_001

5.3 Expressing SIP messages in TTCN-3 Currently many SIP test suites specify one single text string for each instance of a message. Changing one element in a message means that a complete, new message needs to written. The end result is many hundreds of individual SIP messages. No rationalization. No reuse. Worse still, matches on incoming messages have to be exact, where in practice a degree of flexibility is often desirable.

The TTCN-3 approach allows to set and match individual elements of data in complex messages. To give a high degree of controllability and observability. Because SIP messages are text based they have no explicit structure, contrary to conventional telecommunications protocol. For example:

INVITE sip:test@sip.com SIP/2.1 From: userB<sip:xxx@yyy.zzz> To: userA<sip:aaa@bbb.ccc> CSeq: 1 INVITE Content-Length: 0

In order to test SIP using TTCN-3 it is necessary to give the messages at least some level of structuring. Highly structured SIP data will give a good degree of control but will probably lead to a humanly unreadable test suite. Conversely, little or no structuring will give good readability but very little control. In this clause we present a style of using TTCN-3 that attempts to achieve controllability while retaining a good degree of readability. ETSI

SIST-TP TR 102 026 V1.1.1:2004

11 ETSI TR 102 026 V1.1.1 (2002-01)

A SIP message has three basic parts, the Request (or Status) line, the headers and the (optional) message body. The components of a Request or Status line appear in a given order. In TTCN-3 this can be represented using a record type, for example:

// SIP Message Request type record SIP_REQUEST { charstring Method optional, // even mandatory fields are optional charstring Request_URI optional, // so that we can specify invalid messages charstring SIP_Version optional,

Actual messages can be defined using TTCN-3 templates. For example:

template SIP_REQUEST MyRequest := { Method := "INVITE ", Request_URI := "sip:test@sip.com ", SIP_Version := "SIP/2.1\r\n" // where \r\n represents %d13%d10 the CR + LF characters

Explicit spaces could be included in the structure rather than having them as part of the actual string value (see clause 5.3.1).

For the sake of this discussion let us assume that SIP headers are text strings terminated by an end of line character (e.g., CR or LF or CRLF). Generally, SIP messages allow headers to appear in any order. However, for sent messages (i.e. SIP Requests) the TTCN-3 Tester should specify messages with the SIP headers in a given order. In TTCN-3 this can be expressed using the record of type.

// Unbounded array of character strings (i.e. headers) type record of charstring REQUEST_HEADERS;

// Unbounded array of character strings (i.e. body elements) type record of charstring REQUEST_BODY;

// SIP Message = Request Line + Headers + Body type record SIP_REQUEST { charstring Method optional, // even mandatory fields are optional charstring Request_URI optional, // so that we can specify invalid messages charstring SIP_Version optional, REQUEST_HEADERS Message_Headers optional, REQUEST_BODY Message_Body optional

For received messages (i.e. SIP Responses) the TTCN-3 Tester should be prepared to accept messages with the SIP headers appearing in an arbitrary order. In TTCN-3 this can be expressed using the set of type. // Unbounded set of character strings (i.e. headers) type set of charstring RESPONSE_HEADERS;

// Unbounded set of character strings (i.e. body elements) type set of charstring RESPONSE_BODY;

// SIP Message = Response Line + Headers + Body type record SIP_RESPONSE { charstring SIP_Version optional, // even mandatory fields are optional charstring Status_Code optional, // so that we can specify invalid messages charstring Reason_Phrase optional, RESPONSE_HEADERS Message_Headers optional, RESPONSE_BODY Message_Body optional

ETSI

SIST-TP TR 102 026 V1.1.1:2004

12 ETSI TR 102 026 V1.1.1 (2002-01)

5.3.1 SIP headers

In its simplest form a SIP header can be represented as a single text string, as described in clause 5.3. For example:

"CSeq: 1 INVITE\r\n"

However, the CSeq header could be represented as a structured type of several elements:

type record CSEQ { tag charstring, sp1 charstring, counter charstring, sp2 charstring, method charstring // could also be enumerated type

// with the value:

template CSEQ MyCSeq := { tag := "CSeq:", sp1 := " ", counter := "1", sp2 := " ", method := "INVITE", eol := "\r\n"

Representing headers in this way gives a wide range of control (we can explicitly access individual fields in SIP headers). However, readability can be seriously affected if this approach is not used care. Note also that the REQUEST_HEADERS type (for example) can no longer be a simple record of charstring but would need, for example, to be a union of the different message header structures. See also clause 3.3.2.2. One method to give some form of pseudo-structure to the charstring and yet retain readability is to use the concatenator operator, for example (where CRLF = "\r\n" and SP = " "):

"CSeq:" & SP & "1" & SP & "INVITE" & CRLF

NOTE: Regular expressions (patterns) will be introduced into TTCN-3 see clause 5.3.2 for a description and clause 5.3.2.3 for a SIP example.

template SIP_RESPONSE MyResponse := { SIP_Version := "INVITE" & SP, Status_Code := "200" & SP, Reason_Phrase := "OK" & CRLF,

Message_Headers := { "From:" & "userB<sip:xxx@yyy.zzz>" & CRLF, "To:" & "userA<sip:aaa@bbb.ccc>" & CRLF, "CSeq:" & "1" & "INVITE" & CRLF, "Content-Length: " & "0", * // All other headers are ignored

Message_Body := omit

This approach makes more sense when used with parameterized templates and wildcards, as explained in clauses 5.3.1.1 and 5.3.1.2.

See annex A for a full example (test case) which applies the various approaches described in the previous clauses.

5.3.1.1 Parameterization

TTCN-3 templates can be parameterized. For example, we could parameterize the counter in the CSeq header:

template SIP_RESPONSE MyResponse (charstring COUNTER) :=

Message_Headers := { :

"CSeq:" & COUNTER & "INVITE" & CRLF

Message_Body := omit

// And in the receive line we could write:

pco.receive(MyRespons("1"))

ETSI

SIST-TP TR 102 026 V1.1.1:2004

13 ETSI TR 102 026 V1.1.1 (2002-01)

5.3.1.2 Wildcards

The TTCN-3 matching mechanisms (wildcards) can also be used. For example, we could wildcard the counter in the CSeq header:

template SIP_RESPONSE MyResponse :=

Message_Headers := { :

"CSeq:" & <?> & "INVITE" & CRLF

Message_Body := omit

NOTE: The exact syntax of TTCN-3 wildcards and patterns is still under review.

5.3.1.3 Using modified templates

Another mechanism that could be used is derived, or modified, templates. For example, a complete SIP message would contain all the headers, say, from "Allow" to "WWWAuthenticate". // SIP Message Request type record SIP_REQUEST { charstring Method optional, // even mandatory fields are optional charstring Request_URI optional, // so that we can specify invalid messages charstring SIP_Version optional,

charstring Allow optional,

charstring From optional, charstring To optional, charstring CSeq optional, charstring Content-Length optional

charstring WWWAuthenticate optional,

RESPONSE_BODY Message_Body optional

A base response template where all headers are omitted:

NOTE: For SIP Responses the wildcard "*" would probably be used instead of omit. template SIP_REQUEST MyBaseRequest := { Method := "INVITE" & SP, Request_URI := "sip:test@sip.com" & SP, SIP_Version := "SIP/2.1" & CRLF,

Allow := omit,

From := omit, To := omit, CSeq := omit, ContentLength := omit,

WWWAuthenticate := omit,

MessageBody := omit

The following template produces the same SIP message as the example in clause 5.3. That is, by default all other headers are omitted.

template SIP_REQUEST MyRequest modifies SIP_REQUEST MyBaseRequest := { Method := "INVITE" & SP, Request_URI := "sip:test@sip.com" & SP, SIP_Version := "SIP/2.1" & CRLF,

From := "From:" & "userB<sip:xxx@yyy.zzz>" & CRLF, To := "To:" & "userA<sip:aaa@bbb.ccc>" & CRLF, CSeq := "CSeq:" & "1" & "INVITE" & CRLF, ContentLength := "Content-Length: " & "0"

ETSI

SIST-TP TR 102 026 V1.1.1:2004

14 ETSI TR 102 026 V1.1.1 (2002-01)

5.3.2 TTCN-3 regular expressions

TTCN-3 now supports limited regular expressions, or patterns. These may be used to match character string values anywhere that wildcards and matching mechanisms are currently allowed in TTCN-3. Work is progressing to introduce more complicated pattern-matching into the language. It is expected that tool-makers will implement these proposals as they develop. This will ensure that, for EP TIPHON at least, pattern matching capabilities will be available in a timely manner.

5.3.2.1 Simple patterns

In addition to literal characters, character patterns allow the use of meta characters "?" and "*" to mean any character and any number of any character respectively. For example:

template charstring MyTemplate:= pattern "ab??xyz*";

This template would match any character string that consists of the characters "ab", followed by any two characters, followed by the characters "xyz", followed by any number of any characters. The metacharacter "\" is used as an escape character. For example:

template charstring MyTemplate:= pattern "ab?\?xyz*";

...