1、 ETSI TR 103 277 V1.1.1 (2014-11) Core Network and Interoperability Testing (INT); Coding Guidelines for TTCN-3 Libraries Based on the Example of the SIP and IMS TTCN-3 Libraries TECHNICAL REPORT ETSI ETSI TR 103 277 V1.1.1 (2014-11) 2Reference DTR/INT-00099 Keywords IMS, INT, SIP, TTCN-3 ETSI 650 R
2、oute des Lucioles F-06921 Sophia Antipolis Cedex - FRANCE Tel.: +33 4 92 94 42 00 Fax: +33 4 93 65 47 16 Siret N 348 623 562 00017 - NAF 742 C Association but non lucratif enregistre la Sous-Prfecture de Grasse (06) N 7803/88 Important notice The present document can be downloaded from: http:/www.et
3、si.org The present document may be made available in electronic versions and/or in print. The content of any electronic and/or print versions of the present document shall not be modified without the prior written authorization of ETSI. In case of any existing or perceived difference in contents bet
4、ween such versions and/or in print, the only prevailing document is the print of the Portable Document Format (PDF) version kept on a specific network drive within ETSI Secretariat. Users of the present document should be aware that the document may be subject to revision or change of status. Inform
5、ation on the current status of this and other ETSI documents is available at http:/portal.etsi.org/tb/status/status.asp If you find errors in the present document, please send your comment to one of the following services: http:/portal.etsi.org/chaircor/ETSI_support.asp Copyright Notification No par
6、t may be reproduced or utilized in any form or by any means, electronic or mechanical, including photocopying and microfilm except as authorized by written permission of ETSI. The content of the PDF version shall not be modified without the written authorization of ETSI. The copyright and the forego
7、ing restriction extend to reproduction in all media. European Telecommunications Standards Institute 2014. All rights reserved. DECTTM, PLUGTESTSTM, UMTSTMand the ETSI logo are Trade Marks of ETSI registered for the benefit of its Members. 3GPPTM and LTETMare Trade Marks of ETSI registered for the b
8、enefit of its Members and of the 3GPP Organizational Partners. GSM and the GSM logo are Trade Marks registered and owned by the GSM Association. ETSI ETSI TR 103 277 V1.1.1 (2014-11) 3Contents Intellectual Property Rights 4g3Foreword . 4g3Modal verbs terminology 4g31 Scope 5g32 References 5g32.1 Nor
9、mative references . 5g32.2 Informative references 5g33 Abbreviations . 8g34 Coding Guidelines for TTCN-3 Libraries 8g34.1 Use of Module Parameters . 8g34.2 Correct Use of Template and Functions . 8g34.2.1 Parameters. 9g34.2.2 Duplicate Resolution. 9g34.2.3 Inline Templates . 9g34.3 Consistent Format
10、ting and Layout . 9g34.4 Warning Free Code 10g34.5 Use of T3Doc . 10g34.6 Further recommendations . 10g34.7 Quality Checking 11g34.7.1 Use of TTCN-3 Tools . 11g34.7.2 Use of T3Q . 11g34.7.3 External Types 12g35 LibSip and LibIms Version 3 Libraries 12g35.1 Historical Background 12g35.2 Structure . 1
11、3g35.2.1 LibSip . 13g35.2.2 LibIms. 14g35.3 Configuration . 14g35.4 Further details . 15g35.5 Summary of changes 17g3Annex A: History of the LibSip and LibIms sources 18g3History 20g3ETSI ETSI TR 103 277 V1.1.1 (2014-11) 4Intellectual Property Rights IPRs essential or potentially essential to the pr
12、esent document may have been declared to ETSI. The information pertaining to these essential IPRs, if any, is publicly available for ETSI members and non-members, and can be found in ETSI SR 000 314: “Intellectual Property Rights (IPRs); Essential, or potentially Essential, IPRs notified to ETSI in
13、respect of ETSI standards“, which is available from the ETSI Secretariat. Latest updates are available on the ETSI Web server (http:/ipr.etsi.org). Pursuant to the ETSI IPR Policy, no investigation, including IPR searches, has been carried out by ETSI. No guarantee can be given as to the existence o
14、f other IPRs not referenced in ETSI SR 000 314 (or the updates on the ETSI Web server) which are, or may be, or may become, essential to the present document. Foreword This Technical Report (TR) has been produced by ETSI Technical Committee Core Network and Interoperability Testing (INT). Modal verb
15、s terminology In the present document “shall“, “shall not“, “should“, “should not“, “may“, “may not“, “need“, “need not“, “will“, “will not“, “can“ and “cannot“ are to be interpreted as described in clause 3.2 of the ETSI Drafting Rules (Verbal forms for the expression of provisions). “must“ and “mu
16、st not“ are NOT allowed in ETSI deliverables except when used in direct citation. ETSI ETSI TR 103 277 V1.1.1 (2014-11) 51 Scope The present document describes guidelines for the production of TTCN-3 libraries for protocol families or whole technologies. TTCN-3 is the Testing and Test Control Notati
17、on version 3 as defined in ETSI ES 201 873-1 i.1. The guidelines are based on the overhaul work performed on two TTCN-3 libraries that have been in use for several years in the production of abstract test suites (ATS) for testing IMS components: LibSip and LibIms. LibSip is a collection of reusable
18、TTCN-3 definitions related to SIP standards including type definitions for the SIP base IETF RFC 3261 i.3 and other RFCs extending the scope, SIP templates and functions for sending and receiving SIP requests and answers. LibIms is a collection of reusable TTCN-3 definitions extending LibSip to cove
19、r IMS specific aspects as defined in ETSI TS 124 229 i.2. LibIms is made up of TTCN-3 modules that extend the modules of LibSip from IETF style SIP as found in IETF RFC 3261 i.3 to IMS SIP as described in ETSI TS 124 229 i.2. 2 References References are either specific (identified by date of publica
20、tion and/or edition number or version number) or non-specific. For specific references, only the cited version applies. For non-specific references, the latest version of the referenced document (including any amendments) applies. Referenced documents which are not found to be publicly available in
21、the expected location might be found at http:/docbox.etsi.org/Reference. NOTE: While any hyperlinks included in this clause were valid at the time of publication ETSI cannot guarantee their long term validity. 2.1 Normative references The following referenced documents are necessary for the applicat
22、ion of the present document. Not applicable. 2.2 Informative references The following referenced documents are not necessary for the application of the present document but they assist the user with regard to a particular subject area. i.1 ETSI ES 201 873-1: “Methods for Testing and Specification (M
23、TS); The Testing and Test Control Notation version 3; Part 1: TTCN-3 Core Language“. i.2 ETSI TS 124 229: “Digital cellular telecommunications system (Phase 2+); Universal Mobile Telecommunications System (UMTS); LTE; IP multimedia call control protocol based on Session Initiation Protocol (SIP) and
24、 Session Description Protocol (SDP); Stage 3 (3GPP TS 24.229)“. i.3 IETF RFC 3261 (2002): “SIP: Session Initiation Protocol“. i.4 ETSI TS 186 009-3: “Telecommunications and Internet converged Services and Protocols for Advanced Networking (TISPAN); Interworking between Session Initiation Protocol (S
25、IP) and Bearer Independent Call Control Protocol (BICC) or ISDN User Part (ISUP); Part 3: Abstract Test Suite (ATS) and partial Protocol Implementation eXtra Information for Testing (PIXIT)“. i.5 ETSI TS 186 005-3: “IMS Network Testing (INT); Terminating Identification Presentation (TIP) and Termina
26、ting Identification Restriction (TIR) Conformance Testing; Part 3: Abstract Test Suite (ATS) and partial Protocol Implementation eXtra Information for Testing (PIXIT) proforma specification“. ETSI ETSI TR 103 277 V1.1.1 (2014-11) 6i.6 ETSI TS 186 007-3: “IMS Network Testing (INT); Communication HOLD
27、 (HOLD) using IP Multimedia (IM) Core Network (CN) subsystem; Conformance Testing; Part 3: Abstract Test Suite (ATS) and partial Protocol Implementation eXtra Information for Testing (PIXIT) proforma specification“. i.7 ETSI TS 186 010-3: “IMS Network Testing (INT); Conference (CONF) using IP Multim
28、edia (IM) Core Network (CN) subsystem; Conformance Testing; Part 3: Abstract Test Suite (ATS) and partial Protocol Implementation eXtra Information for Testing (PIXIT) proforma specification“. i.8 ETSI TS 186 014-3: “IMS Network Testing (INT); Communication Diversion (CDIV) using IP Multimedia (IM)
29、Core Network (CN) subsystem; Conformance Testing; Part 3: Abstract Test Suite (ATS) and partial Protocol Implementation eXtra Information for Testing (PIXIT) proforma specification“. i.9 ETSI TS 186 016-3: “Technical Committee for IMS Network Testing (INT); Closed User Group (CUG); Conformance Testi
30、ng; Part 3: Abstract Test Suite (ATS) and partial Protocol Implementation eXtra Information for Testing (PIXIT) proforma specification“. i.10 ETSI TS 186 017-3: “Technical Committee for IMS Network Testing (INT); Anonymous Communication Rejection (ACR) and Communication Barring (CB) conformance test
31、ing; Part 3: Abstract Test Suite (ATS) and partial Protocol Implementation eXtra Information for Testing (PIXIT) proforma specification“. i.11 ETSI TS 186 018-3: “IMS Network Testing (INT); Malicious Communication Identification (MCID) Conformance Testing; Part 3: Abstract Test Suite (ATS) and parti
32、al Protocol Implementation eXtra Information for Testing (PIXIT) proforma specification“. i.12 ETSI TS 186 022-3: “IMS Network Testing (INT); Communication Waiting (CW) using IP Multimedia (IM) Core Network (CN) subsystem; Conformance Testing; Part 3: Abstract Test Suite (ATS) and partial Protocol I
33、mplementation eXtra Information for Testing (PIXIT) proforma specification“. i.13 ETSI TS 102 890-3: “Intelligent Transport System (ITS); Facilities layer function; Position and time facility specification“. i.14 ETSI TS 186 001-4: “IMS Network Testing (INT); Network Integration Testing; Part 4: Abs
34、tract Test Suite (ATS) and partial Protocol Implementation eXtra Information for Testing (PIXIT) proforma specification“. i.15 ETSI TS 186 011-3: “IMS Network Testing (INT); IMS NNI Interoperability Test Specifications; Part 3: Abstract Test Suite (ATS) and partial Protocol Implementation eXtra Info
35、rmation for Testing (PIXIT)“. i.16 ETSI TS 101 580-3: “Core Network and Interoperability Testing (INT); Diameter Conformance testing for Rx interface (3GPP Release 10); Part 3: Abstract Test Suite (ATS) and partial Protocol Implementation eXtra Information for Testing (PIXIT) proforma specification“
36、. i.17 ETSI TS 101 606-3: “Core Network and Interoperability Testing (INT); Diameter Conformance testing for Gx interface (3GPP Relase 10); Part 3: Abstract Test Suite (ATS) and partial Protocol Implementation eXtra Information for Testing (PIXIT) proforma specification“. i.18 ETSI TS 102 790-3: “Co
37、re Network and Interoperability Testing (INT); IMS specific use of Session Initiation Protocol (SIP) and Session Description Protocol (SDP); Conformance Testing; (3GPP Release 10); Part 3: Abstract Test Suite (ATS) and partial Protocol Implementation eXtra Information for Testing (PIXIT) proforma sp
38、ecification“. i.19 ETSI TS 123 040: “Digital cellular telecommunications system (Phase 2+); Universal Mobile Telecommunications System (UMTS); Technical realization of the Short Message Service (SMS) (3GPP TS 23.040)“. i.20 ETSI TS 124 011: “Digital cellular telecommunications system (Phase 2+); Uni
39、versal Mobile Telecommunications System (UMTS); LTE; Point-to-Point (PP) Short Message Service (SMS) support on mobile radio interface (3GPP TS 24.011)“. ETSI ETSI TR 103 277 V1.1.1 (2014-11) 7i.21 ETSI TS 124 341: “Digital cellular telecommunications system (Phase 2+); Universal Mobile Telecommunic
40、ations System (UMTS); LTE; Support of SMS over IP networks; Stage 3 (3GPP TS 24.341)“. i.22 IETF RFC 3262: “Reliability of Provisional Responses in the Session Initiation Protocol (SIP)“. i.23 IETF RFC 3265: “Session Initiation Protocol (SIP)-Specific Event Notification“. i.24 IETF RFC 3313: “Privat
41、e Session Initiation Protocol (SIP) Extensions for Media Authorization“. i.25 IETF RFC 3323: “A Privacy Mechanism for the Session Initiation Protocol (SIP)“. i.26 IETF RFC 3325: “Private Extensions to the Session Initiation Protocol (SIP) for Asserted Identity within Trusted Networks“. i.27 IETF RFC
42、 3326: “The Reason Header Field for the Session Initiation Protocol (SIP)“. i.28 IETF RFC 3327: “Session Initiation Protocol (SIP) Extension Header Field for Registering Non-Adjacent Contacts“. i.29 IETF RFC 3329: “Security Mechanism Agreement for the Session Initiation Protocol (SIP)“. i.30 IETF RF
43、C 3455: “Private Header (P-Header) Extensions to the Session Initiation Protocol (SIP) for the 3rd-Generation Partnership Project (3GPP)“. i.31 IETF RFC 3515: “The Session Initiation Protocol (SIP) Refer Method“. i.32 IETF RFC 3608: “Session Initiation Protocol (SIP) Extension Header Field for Servi
44、ce Route Discovery During Registration“. i.33 IETF RFC 3841: “Caller Preferences for the Session Initiation Protocol (SIP)“. i.34 IETF RFC 3891: “The Session Initiation Protocol (SIP) “Replaces“ Header“. i.35 IETF RFC 3892: “The Session Initiation Protocol (SIP) Referred-By Mechanism“. i.36 IETF RFC
45、 4028: “Session Timers in the Session Initiation Protocol (SIP)“. i.37 IETF RFC 4244: “An Extension to the Session Initiation Protocol (SIP) for Request History Information“. i.38 IETF RFC 4488: “Suppression of Session Initiation Protocol (SIP) REFER Method Implicit Subscription“. i.39 IETF RFC 5009
46、: “Private Header (P-Header) Extension to the Session Initiation Protocol (SIP) for Authorization of Early Media“. i.40 IETF RFC 6442: “Location Conveyance for the Session Initiation Protocol“. i.41 IETF draft-johnston-sipping-cc-uui: “Transporting User to User Call Control Information in SIP for IS
47、DN Interworking“. i.42 IETF RFC 2617: “HTTP Authentication: Basic and Digest Access Authentication“. i.43 IETF RFC 5031: “A Uniform Resource Name (URN) for and Other Well-Known Services“. i.44 ETSI ES 201 873-10: “Methods for Testing and Specification (MTS); The Testing and Test Control Notation ver
48、sion 3; Part 10: TTCN-3 Documentation Comment Specification“. ETSI ETSI TR 103 277 V1.1.1 (2014-11) 83 Abbreviations For the purposes of the present document, the following abbreviations apply: ATS Abstract Test Suite EPC Extended Packet Core IMS IP Multimedia core network Subsystem ISDN Integrated
49、Services Digital Network ISUP ISDN User Part ITS Intelligent Transport Systems LTE Long Term Evolution PIXIT Protocol Implementation eXtra Information for Testing SDP Session Description Protocol SIP Session Initiation Protocol SMS Short Message Service STF Specialized Task Force TTCN-3 Testing and Test Control Notation version 3 XML eXtensible Markup Language 4 Coding Guidelines for TTCN-3 Libraries The following clauses describe guidelines for coding of TTCN-3 modules for librar