hash
stringlengths
32
32
doc_id
stringlengths
7
13
section
stringlengths
3
121
content
stringlengths
0
2.2M
fca3cac42b688b0e5246c551f4c213c2
118 116
7.7.2 <identity> Resource Procedures
fca3cac42b688b0e5246c551f4c213c2
118 116
7.7.2.1 CREATE <identity>
This procedure shall be used for creating a <identity> resource. Table 7.7.2.1-1: <identity> CREATE <identity> CREATE request message parameters Associated Reference Point Mcs Information in Request message All parameters defined in table 8.1.2-3 of ETSI TS 118 101 [2] apply with the specific details for: To: contains M2M-SE-ID or SE hosted AE-ID or CSE-ID Content: The resource content shall provide the information as defined in clause 7.7.1 Processing at Originator before sending Request According to clause 10.1.1.1 of ETSI TS 118 101 [2] Processing at Receiver According to clause 10.1.1.1 of ETSI TS 118 101 [2] Information in Response message All parameters defined in table 8.1.3-1 of ETSI TS 118 101 [2] apply with the specific details for: Content: Address of the created <identity> resource, according to clause 10.1.1.1 of ETSI TS 118 101 [2] Processing at Originator after receiving Response According to clause 10.1.1.1 of ETSI TS 118 101 [2] Exceptions According to clause 10.1.1.1 of ETSI TS 118 101 [2] If <generateKey> is created, the key to be used shall be generated and stored in keyData, in such a case keyInformation shall be filled with the public part of the generated key.
fca3cac42b688b0e5246c551f4c213c2
118 116
7.7.2.2 RETRIEVE <identity>
This procedure shall be used for retrieving the identity and retrieve authentication data according the used authentication protocol. Table 7.7.2.2-1: <identity> RETRIEVE <identity> RETRIEVE request message parameters Associated Reference Point Mcs Information in Request message According to clause 10.1.2 of ETSI TS 118 101 [2] with the specific details for: To: contains M2M-SE-ID or SE hosted AE-ID or CSE-ID Processing at Originator before sending Request According to clause 10.1.2 of ETSI TS 118 101 [2] Processing at Receiver According to clause 10.1.2 of ETSI TS 118 101 [2] Information in Response message All parameters defined in table 8.1.3-1 of ETSI TS 118 101 [2] apply with specific details for: Content: Attributes of the <identity> resources as defined in clause 7.7.1 Processing at Originator after receiving Response According to clause 10.1.2 of ETSI TS 118 101 [2] Exceptions According to clause 10.1.2 of ETSI TS 118 101 [2] ETSI ETSI TS 118 116 V4.0.1 (2023-11) 46 oneM2M TS-0016 version 4.0.1 Release 4
fca3cac42b688b0e5246c551f4c213c2
118 116
7.7.2.3 UPDATE <identity>
This procedure shall be used for updating the <identity resource> and sending authentication data according the used authentication protocol. Table 7.7.2.3-1: <identity> UPDATE <identity> UPDATE request message parameters Associated Reference Point Mcs Information in Request message All parameters defined in table 8.1.2-3 of ETSI TS 118 101 [2] apply with the specific details for: To: contains M2M-SE-ID or SE hosted AE-ID or CSE-ID Content: attributes of the <cipher> resource which is to be updated as defined in clause 7.5.1 Processing at Originator before sending Request According to clause 10.1.3 of ETSI TS 118 101 [2] Processing at Receiver According to clause 10.1.3 of ETSI TS 118 101 [2] Information in Response message According to clause 10.1.3 of ETSI TS 118 101 [2] Processing at Originator after receiving Response According to clause 10.1.3 of ETSI TS 118 101 [2] Exceptions According to clause 10.1.3 of ETSI TS 118 101 [2]
fca3cac42b688b0e5246c551f4c213c2
118 116
7.7.2.4 DELETE <identity>
This procedure shall be used for deleting an <identity> resource. Table 7.7.2.4-1: <identity> DELETE <Identity> DELETE request message parameters Associated Reference Point Mcs Information in Request message All parameters defined in table 8.1.2-3 of ETSI TS 118 101 [2] apply with the specific details for: To: contains M2M-SE-ID or SE hosted AE-ID or CSE-ID Processing at Originator before sending Request According to clause 10.1.4.1 of ETSI TS 118 101 [2] Processing at Receiver According to clause 10.1.4.1 of ETSI TS 118 101 [2] Information in Response message According to clause 10.1.4.1 of ETSI TS 118 101 [2] Processing at Originator after receiving Response According to clause 10.1.4.1 of ETSI TS 118 101 [2] Exceptions According to clause 10.1.4.1 of ETSI TS 118 101 [2]
fca3cac42b688b0e5246c551f4c213c2
118 116
7.7.3 <authenticate> Resource
The <authenticate> resource is a virtual resource because it does not have a representation. It is the child resource of an <identity> resource. When a RETRIEVE request addresses the <authenticate> resource, the originatorAuthenticationData, keyData and idData shall be used to calculate a value which shall be stored in retrieverAuthenticationData. Depending on the authentication protocol it may be necessary to repeat the process of UPDATE originatorAuthenticationData , RETRIEVE <authenticate> and RETRIEVE retrieverAuthenticationData several times. The <authenticate> resource inherits access control policies that apply to the parent <identity> resource.
fca3cac42b688b0e5246c551f4c213c2
118 116
7.7.4 <generateKey> Resource
The <generateKey> resource is a virtual resource because it does not have a representation. When a RETRIEVE request addresses the <generateKey> resource, the keyData attribute shall be filled with a key generated according the algorithm attribute. ETSI ETSI TS 118 116 V4.0.1 (2023-11) 47 oneM2M TS-0016 version 4.0.1 Release 4 The <generateKey> resource inherits access control policies that apply to the parent resource.
fca3cac42b688b0e5246c551f4c213c2
118 116
8 Physical Interface
The present release does not specify how the Mcs reference point can be bound to physical interfaces used by specific Secure Environments. Organizations specifying technologies applicable for Secure Environments, such as GlobalPlatform, specify bindings that can be applicable.
fca3cac42b688b0e5246c551f4c213c2
118 116
9 Resource type definitions for the Mcs reference point
fca3cac42b688b0e5246c551f4c213c2
118 116
9.1 Mcs specific enumeration values of m2m:resourceType
The following values are defined specifically for the Mcs interface, as an extension to applicable values inherited from ETSI TS 118 104 [14]. Table 9.1-1: Mcs enumeration values Value Resource type 20001 algorithmSpecificParameter 20002 cipher 20003 connectionInstance 20004 hash 20005 identity 20007 rand 20008 secureConnection 20009 sensitiveDataObject 20010 SEReboot 20011 SE 20012 signature
fca3cac42b688b0e5246c551f4c213c2
118 116
9.2 senv:SEType
The values in table 9.2-1 are defined as per table 7.2.1-2. Table 9.2-1: SEType defined values Value Meaning 1 UICC as per ETSI 2 GlobalPlatform Secure Element 3 TEE as per GlobalPlatform 4 Software cryptographic library
fca3cac42b688b0e5246c551f4c213c2
118 116
9.3 senv:securityLevel
The values in table 9.3-1 are defined as per clause 6.2. Table 9.3-1: securityLevel defined values Value Meaning 1 Low security 2 Medium security 3 High security ETSI ETSI TS 118 116 V4.0.1 (2023-11) 48 oneM2M TS-0016 version 4.0.1 Release 4
fca3cac42b688b0e5246c551f4c213c2
118 116
9.4 senv:rebootType
The values in table 9.4-1 are defined. Table 9.4-1: rebootType defined values Value Meaning 1 Cold Reset as defined in ISO/IEC 7816-3 [7] 2 Warm Reset as defined in ISO/IEC 7816-3 [7]
fca3cac42b688b0e5246c551f4c213c2
118 116
9.5 senv:cipherLabel
The values in table 9.5-1 are defined. Table 9.5-1: cipherLabel defined values Value Meaning 1 EXPORTER-oneM2M-Bootstrap 2 EXPORTER-oneM2M-Connection
fca3cac42b688b0e5246c551f4c213c2
118 116
9.6 senv:cipherAlgorithm
The values in table 9.6-1 are defined. Table 9.6-1: cipherAlgorithm defined values Value Meaning 1001 ALG_AEAD_AES_128_GCM 1002 ALG_AEAD_AES_256_GCM 1003 ALG_AEAD_AES_128_CCM 1004 ALG_AEAD_AES_256_CCM 1018 ALG_AEAD_AES_128_CCM_8 1019 ALG_AEAD_AES_256_CCM_8 13 ALG_AES_BLOCK_128_CBC_NOPAD 22 ALG_AES_CBC_ISO9797_M1 23 ALG_AES_CBC_ISO9797_M2 24 ALG_AES_CBC_PKCS5 NOTE: Values for AEAD algorithms were taken from IANA with an offset of 1000. Values for other algorithms were taken from JavaCard API.
fca3cac42b688b0e5246c551f4c213c2
118 116
9.7 senv:rngType
The values in table 9.7-1 are defined. Table 9.7-1: rngType defined values Value Meaning 1 Pseudo RNG 2 True (physical) RNG
fca3cac42b688b0e5246c551f4c213c2
118 116
9.8 senv:hashAlgorithm
The values in table 9.8-1 are defined. ETSI ETSI TS 118 116 V4.0.1 (2023-11) 49 oneM2M TS-0016 version 4.0.1 Release 4 Table 9.8-1: hashAlgorithm defined values Value Meaning 4 SHA256 5 SHA384 6 SHA512 NOTE: These values were taken from the JavaCard API.
fca3cac42b688b0e5246c551f4c213c2
118 116
9.9 senv:signatureAlgorithm
The values in table 9.9-1 are defined. Table 9.9-1: signatureAlgorithm defined values Value Meaning 49 ALG_AES_CMAC_128 18 ALG_AES_MAC_128_NOPAD 33 ALG_ECDSA_SHA_256 34 ALG_ECDSA_SHA_384 38 ALG_ECDSA_SHA_512 25 ALG_HMAC_SHA_256 26 ALG_HMAC_SHA_384 27 ALG_HMAC_SHA_512 NOTE: These values were taken from the JavaCard API.
fca3cac42b688b0e5246c551f4c213c2
118 116
9.10 senv:connectionTypeID
The values in table 9.10-1 are defined. Table 9.10-1: connectionTypeID defined values Value Meaning 1 TLS 2 DTLS 3 SMS 4 E2EKey
fca3cac42b688b0e5246c551f4c213c2
118 116
10 Short Name definitions for the Mcs reference point
fca3cac42b688b0e5246c551f4c213c2
118 116
10.1 Short Names for Mcs specific resource attributes
The mapping between the full names and their shortened form is given in the following clauses. These names are case-sensitive. A oneM2M implementation shall use the letter casing given in these clauses. In protocol bindings, resource attributes names shall be translated into short names shown in table 10.1-1. All attributes name not mentioned in this table that match defined attributes in ETSI TS 118 104 are assumed to reuse the short names defined in ETSI TS 118 104 [14]. ETSI ETSI TS 118 116 V4.0.1 (2023-11) 50 oneM2M TS-0016 version 4.0.1 Release 4 Table 10.1-1: Mcs Resource attribute short names Attribute Name Occurs in Short Name SEType SE seT securityLevel SE seL rebootType SEReboot rbT SEReboot SEReboot rb label algorithmSpecificParameter Clab algorithm cipher Calg rngType rand rgT randomData rand rndD requestedDataSize rand Dsz algorithm hash Halg algorithm signature Salg connectionType secureConnection cnT idName identity idN keyData identity, secureConnection, signature, cipher kDt idData identity idDt originatorAuthenticationData identity oAD receiverAuthenticationData identity rAD destinationURI connectionInstance dst outgoingPayloadData connectionInstance oD incomingPayloadData connectionInstance iD negotiatedKey connectionInstance ngK negotiatedCipherSuite connectionInstance ngCS maxNrOfInstances secureConnection mni currentNrOfInstances secureConnection cni connectionType secureConnection cnT keyInformation secureConnection, signature kInf cipherSuite secureConnection aCS message signature, hash msg signature signature Sgn verificationResult signature vR hashValue hash Hv initialVector algorithmSpecificParameter iV nonce algorithmSpecificParameter nc associatedData algorithmSpecificParameter aD sensitiveData cipher, sensitiveData msg currentByteSize cipher, sensitiveData cbs maxByteSize cipher mbs calculatedData cipher cD m2mSeID SE sID supportedResourceType SE srt hostedCSELink SE hcl hostedAELinks SE hal e2eSecInfo SE esi
fca3cac42b688b0e5246c551f4c213c2
118 116
10.2 Short Names for Mcs specific resource types
In protocol bindings resource type names shall be translated into short names of table 10.2-1. ETSI ETSI TS 118 116 V4.0.1 (2023-11) 51 oneM2M TS-0016 version 4.0.1 Release 4 Table 10.2-1: Mcs Resource type short names Resource Type Name Short Name SE Senv SEReboot Srbt sensitiveDataObject Sdo cipher Cph encrypt Enc decrypt Dec generateKey gnK algorithmSpecificParameter algP rand Rnd generateRand gnR hash Hsh calculateHash cHsh signature Sgn calculateSignature cSgn verifySignature vSgn secureConnection Ssc connectionInstance Isc connect cnt send snd identity Sidn authenticate Sauth ETSI ETSI TS 118 116 V4.0.1 (2023-11) 52 oneM2M TS-0016 version 4.0.1 Release 4 History Document history V4.0.1 November 2023 Publication
9f25db803a4d03590d7c1361d4bb9675
118 115
1 Scope
The present document specifies a testing framework defining a methodology for development of conformance and interoperability test strategies, test systems and the resulting test specifications for oneM2M standards.
9f25db803a4d03590d7c1361d4bb9675
118 115
2 References
9f25db803a4d03590d7c1361d4bb9675
118 115
2.1 Normative references
References are either specific (identified by date of publication 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 the expected location might be found at https://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. The following referenced documents are necessary for the application of the present document. [1] ETSI TS 118 001: "oneM2M; Functional Architecture (oneM2M TS-0001)". [2] ETSI TS 118 004: "Service layer Core Protocol (oneM2M TS-0004)".
9f25db803a4d03590d7c1361d4bb9675
118 115
2.2 Informative references
References are either specific (identified by date of publication 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. NOTE: While any hyperlinks included in this clause were valid at the time of publication, ETSI cannot guarantee their long term validity. 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] oneM2M Drafting Rules. NOTE: Available at http://www.onem2m.org/images/files/oneM2M-Drafting-Rules.pdf. [i.2] ISO/IEC 9646 (all parts): "Information technology - Open Systems Interconnection - Conformance testing methodology and framework". [i.3] ETSI EG 202 237: "Methods for Testing and Specification (MTS); Internet Protocol Testing (IPT); Generic approach to interoperability testing". [i.4] ETSI ES 201 873-1: "Methods for Testing and Specification (MTS); The Testing and Test Control Notation version 3; Part 1: TTCN-3 Core Language".
9f25db803a4d03590d7c1361d4bb9675
118 115
3 Definitions and abbreviations
9f25db803a4d03590d7c1361d4bb9675
118 115
3.1 Definitions
For the purposes of the present document, the following terms and definitions apply: conformance: compliance with requirements specified in applicable standards ISO/IEC 9646 [i.2] ETSI ETSI TS 118 115 V2.0.0 (2016-09) 7 (oneM2M TS-0015 version 2.0.0 Release 2) conformance testing: process for testing that an implementation is compliant with a protocol standard, which is realized by test systems simulating the protocol with test scripts executed against the implementation under test Device Under Test (DUT): combination of software and/or hardware items which implement the functionality of standards and interact with other DUTs via one or more reference points ICS proforma: document, in the form of a questionnaire, which when completed for an implementation or system becomes an ICS Implementation Conformance Statement (ICS): statement made by the supplier of an implementation or system claimed to conform to a given specification, stating which capabilities have been implemented Implementation eXtra Information for Testing (IXIT): checklist which contains or references all of the information (in addition to that given in the ICS) related to the IUT and its testing environment, which will enable the test laboratory to run an appropriate test suite against the IUT Implementation Under Test (IUT): implementation of one or more Open Systems Interconnection (OSI) protocols in an adjacent user/provider relationship, being the part of a real open system which is to be studied by testing (ISO/IEC 9646-1 [i.2]) Inopportune Behaviour (BO): test group that handles invalid exchanges of messages, which are properly structured and correctly encoded interoperability: ability of two systems to interoperate using the same communication protocol interoperability testing: activity of proving that end-to-end functionality between (at least) two devices is as required by the base standard(s) on which those devices are based InterWorking Function (IWF): translation of one protocol into another one so that two systems using two different communication protocols are able to interoperate Invalid Behaviour (BI): test group that handles valid exchanges of messages, which are either not properly structured or incorrectly encoded IXIT proforma: document, in the form of a questionnaire, which when completed for an implementation or system, becomes an IXIT Qualified Equipment (QE): grouping of one or more devices that has been shown and certified, by rigorous and well-defined testing, to interoperate with other equipment NOTE 1: Once an DUT has been successfully tested against a QE, it may be considered to be a QE, itself. NOTE 2: Once a QE is modified, it loses its status as QE and becomes again an DUT. test case: specification of the actions required to achieve a specific test purpose, starting in a stable testing state, ending in a stable testing state and defined in either natural language for manual operation or in a machine-readable language (such as TTCN-3) for automatic execution testing framework: document providing guidance and examples necessary for the development and implementation of a test specification test purpose: description of a well-defined objective of testing, focussing on a single requirement or a set of related requirements Valid Behaviour (BV): test group that handles valid exchanges of messages, which are properly structured and correctly ETSI ETSI TS 118 115 V2.0.0 (2016-09) 8 (oneM2M TS-0015 version 2.0.0 Release 2)
9f25db803a4d03590d7c1361d4bb9675
118 115
3.2 Abbreviations
For the purposes of the present document, the terms and definitions given in ETSI TS 118 001 [1] and the following apply: API Application Programming Interface APT Abstract Protocol Tester ATS Abstract Test Suite BI Invalid Behaviour BO Inopportune Behaviour BV Valid Behaviour CoAP Constrained Application Protocol EUT Equipment Under Test FQDN Fully Qualified Domain Name HTTP HyperText Transfer Protocol IFS Interoperable Features Statement IOP Interoperability IUT Implementation Under Test IWF InterWorking Function JSON JavaScript Object Notation MMI Man-Machine Interface MQTT Message Queue Telemetry Transport PICS Protocol Implementation Conformance Statement QE Qualified Equipment SUT System Under Test TC Test Case TCP Transmission Control Protocol TD Test Description TP Test Purpose TSS Test Suite Structure TTCN-3 Testing and Test Control Notation version 3 UDP User Datagram Protocol URI Uniform Resource Identifier XML eXtensible Markup Language
9f25db803a4d03590d7c1361d4bb9675
118 115
4 Conventions
The key words "Shall", "Shall not", "May", "Need not", "Should", "Should not" in the present document are to be interpreted as described in the oneM2M Drafting Rules [i.1].
9f25db803a4d03590d7c1361d4bb9675
118 115
5 Introduction to the oneM2M testing methodology
The present document provides: • Identification of the implementations under test (IUT) for conformance testing and the device under test (DUTs) for interoperability, i.e. answering the question "what is to be tested". • Definition of the applicable test procedures, i.e. answering the question "how is it to be tested". • Definition of the procedure for development of test specifications and deliverables (for instance: TSS&TP, TP proforma, TTCN-3 test suite and documentation). Figure 1 illustrates the oneM2M testing framework and the interactions with oneM2M base standards and test specifications. The oneM2M testing framework is based on concepts defined in ISO/IEC 9646 [i.2], TTCN-3 [i.4], ETSI EG 202 237 [i.3]. ETSI ETSI TS 118 115 V2.0.0 (2016-09) 9 (oneM2M TS-0015 version 2.0.0 Release 2) Figure 5-1: oneM2M testing methodology interactions The test specifications are usually developed for a single base protocol standard or for a coherent set of standards. As such, it is possible to follow the methodology specified for conformance test development in ISO/IEC 9646-1 [i.2] without much difficulty. However, oneM2M testing requirements are, in many cases, distributed across a wide range of documents and, thus, an adaptation of the ISO/IEC 9646 [i.2] approach to test development is necessary. Also, for readability, consistency and to ease reusability of TTCN-3 code it is necessary to apply some guidelines on the use of TTCN-3. It is this approach that is referred to as the "oneM2M testing framework". As its name implies, the framework is oriented towards the production of Test specifications. The oneM2M testing Framework comprises: • a documentation structure: - catalogue of capabilities/features/functions (PICS or IFS); - Test Suite Structure (TSS); - Test Purposes: Conformance; Interoperability. • a methodology linking the individual elements of a test specification together: - style guidelines and examples; - naming conventions; - a structured notation for TP; - guidelines on the development of TTCN-3 Test Cases (TCs); - guidelines on the use of tabulated English Test Descriptions (TDs). Conformance Test Specifications oneM2M Test Methodology IUTs PICS Identification of IUTs and DUTs Development of test specifications Abstract Test Method TSS&TP ATS TTCN-3 Interoperability Test Specifications DUTs IFS TDs IOP Test Bed Base specifications ETSI ETSI TS 118 115 V2.0.0 (2016-09) 10 (oneM2M TS-0015 version 2.0.0 Release 2)
9f25db803a4d03590d7c1361d4bb9675
118 115
6 Conformance testing
9f25db803a4d03590d7c1361d4bb9675
118 115
6.1 Introduction
The clause 6 shows how to apply the oneM2M conformance testing methodology in order to properly produce oneM2M conformance test specifications. The Conformance testing can show that a product correctly implements a particular standardized protocol, that is, it establishes whether or not the implementation under test meets the requirements specified for the protocol itself. EXAMPLE: It will test protocol message contents and format as well as the permitted sequences of messages. In that context, tests are performed at open standardized interfaces that are not (usually) accessible to an end user, and executed by a dedicated test system that has full control of the system under test and the ability to observe all incoming and out coming communications; the high degree of control of the test system over the sequence and contents of the protocol messages allows to test both valid and invalid behaviour. Figure 6.1-1: Conformance testing Conformance test specifications should be produced following the methodology described in ISO/IEC 9646-1 [i.2]. In summary, this methodology begins with the collation and categorization of the features and options to be tested into a tabular form which is normally referred to as the " Implementation Conformance Statement" (ICS). All implemented capabilities supported by the Implementation Under Test (IUT) are listed by the implementer in the ICS, so that the tester knows which options have to be tested. This ensures that complete coverage is obtained. The next step is to collect the requirements from the specification that is tested. For each requirement, one or more tests should be identified and classified into a number of groups which will provide a structure to the overall test suite (TSS). A brief Test Purpose (TP) should then be written for each identified test and this should make it clear what is to be tested but not how this should be done. Although not described or mandated in ISO/IEC 9646-1 [i.2], in many situations (particularly where the TPs are complex) it may be desirable to develop a Test Description (TD) for each TP. The TD describes in plain language (often tabulated) the actions required to reach a verdict on whether an implementation passes or fails the test. Finally, a detailed Test Case (TC) is written for each TP. In the interests of test automation, TCs are usually combined into an Abstract Test Suite (ATS) using a specific testing language such as TTCN-3. The TCs in the ATS are then "Verified" against a number of IUTs for correct operation according to some agreed procedures, before being released for use by the industry. An Implementation eXtra Information for Test (IXIT) proforma associated to the ATS, should be produced in supplement of the ICS document and Test Cases to help to execute Protocol conformance testing using oneM2M dedicated test equipment. In summary, the oneM2M Conformance Testing methodology consists of: • Selection of Implementations Under Test (IUT). • Identification of reference points. • Development of test specifications, which includes: - Development of "Implementation Conformance Statements" (ICS), if not already provided as part of the base standard. - Development of "Test Suite Structure and Test Purposes" (TSS&TP). - Development of "Abstract Test Suite and Implementation eXtra Information for Test" (ATS&IXIT) including: Definition of the Abstract Protocol Tester (APT). Definition of TTCN-3 test architecture. Conformance Test System Implementation Under Test ETSI ETSI TS 118 115 V2.0.0 (2016-09) 11 (oneM2M TS-0015 version 2.0.0 Release 2) Development of TTCN-3 test suite, e.g. naming conventions, code documentation, test case structure. Verification of ATS (TTCN-3) IXIT proforma.
9f25db803a4d03590d7c1361d4bb9675
118 115
6.2 Test architecture
9f25db803a4d03590d7c1361d4bb9675
118 115
6.2.1 Selection of Implementation Under Test
9f25db803a4d03590d7c1361d4bb9675
118 115
6.2.1.1 Definition
The "Implementation Under Test" (IUT) is a protocol implementation considered as an object for testing. This means that the test process will focus on verifying the compliance of this protocol implementation (IUT) with requirements set up in the related base standard. An IUT normally is implemented in a "System Under Test" (SUT). For testing, a SUT is connected to a test system over at least a single interface. Such an interface is identified as "Reference Point" (RP) in the present document. Further details on RPs are presented in clause 6.2.2. NOTE: Other interfaces between the test system and the IUT may be used to control the behaviour of the IUT during the test process. Figure 6.2.1.1-1 shows a complete view of communication layer for oneM2M domain. Further details are presented in the following clauses. Management oneM2M oneM2M HTTP/CoAP/MQTT WiFi/6LoWPAN/ Ethernet, Zigbee,... Security Service Layer Network & Transport Access oneM2M Management oneM2M Security IUT Figure 6.2.1.1-1: Example of IUT in the oneM2M reference architecture ETSI ETSI TS 118 115 V2.0.0 (2016-09) 12 (oneM2M TS-0015 version 2.0.0 Release 2)
9f25db803a4d03590d7c1361d4bb9675
118 115
6.2.1.2 oneM2M Service Layer Communication
Table 6.2.1.2-1 shows the IUTs for oneM2M reference architecture as defined in ETSI TS 118 001 [1]. Table 6.2.1.2-1: IUTs for oneM2M IUT (node) Entities Interfaces Notes ASN Application Entity (AE) Mca Common Services Entity (CSE) Mca, Mcc, Mcn ADN Application Entity (AE) Mca MN Application Entity (AE) Mca Common Services Entity (CSE) Mca, Mcc, Mcn IN Application Entity (AE) Mca Common Services Entity (CSE) Mca, Mcc, Mcn, Mcc’, Mch ASN/MN/IN Network Services Entity (NSE) Mcn Table 6.2.1.2-1 needs to be amended in the following cases: • A new node or entity is defined on the base specifications. • A new interface is defined on the base specifications between any of the existing nodes or entities.
9f25db803a4d03590d7c1361d4bb9675
118 115
6.2.2 Identification of the Reference Points
This clause illustrates candidate reference points (RPs) where test systems can be connected in order to test conformance of oneM2M protocols (IUTs) with oneM2M base standards. Table 6.2.2-1: RPs for oneM2M RP Identifier RP Type oneM2M node- entity oneM2M node- entity Network RP-oneM2M-1 Mca ASN-AE ASN-CSE RP-oneM2M-2 Mca MN-AE MN-CSE RP-oneM2M-3 Mca IN-AE IN-CSE RP-oneM2M-4 Mca ADN-AE IN-CSE RP-oneM2M-5 Mca ADN-AE MN-CSE RP-oneM2M-6 Mcc ASN-CSE IN-CSE RP-oneM2M-7 Mcc ASN-CSE MN-CSE RP-oneM2M-8 Mcc MN-CSE MN-CSE RP-oneM2M-9 Mcc MN-CSE IN-CSE RP-oneM2M-10 Mcn ASN-CSE NSE RP-oneM2M-11 Mcn MN-CSE NSE RP-oneM2M-12 Mcn IN-CSE NSE RP-oneM2M-13 Mcc’ IN-CSE IN-CSE’ RP-oneM2M-14 Mch IN-CSE Charging Server
9f25db803a4d03590d7c1361d4bb9675
118 115
6.3 Development of Conformance Test Specifications
9f25db803a4d03590d7c1361d4bb9675
118 115
6.3.1 Implementation Conformance Statement (ICS)
The purpose of an ICS is to identify those standardized functions which an IUT shall support, those which are optional and those which are conditional on the presence of other functions. It helps to provide a means for selection of the suite of tests which will subsequently be developed. In addition, the ICS can be used as a proforma for identifying which functions an IUT will support when performing conformance testing. The purpose of this ICS proforma is to provide a mechanism whereby an oneM2M implementation supplier may provide information about the implementation in a standardized manner. The information in a ICS is usually presented in tabular form as recommended in ISO/IEC 9646-7 [i.2]. ETSI ETSI TS 118 115 V2.0.0 (2016-09) 13 (oneM2M TS-0015 version 2.0.0 Release 2) The ICS can be considered as a set of "switches" which specify the capability of supporting the requirement in base standards to be tested. It is possible that with different choices in a ICS proforma, several different set of TPs will be necessary. The ICS proforma is subdivided into clauses for the following categories of information: • guidance for completing the ICS proforma; • identification of the implementation; • identification of the <reference specification type>; • global statement of conformance Part of an example ICS table can be found in Annex A.1.
9f25db803a4d03590d7c1361d4bb9675
118 115
6.3.2 Test Suite Structure & Test Purposes (TSS&TP)
9f25db803a4d03590d7c1361d4bb9675
118 115
6.3.2.1 Introduction
A test purpose is a prose description of a well-defined objective of testing. Applying to conformance testing, it focuses on a single conformance requirement or a set of related conformance requirements from the base standards. Several types of presentation of the test purposes exist. These presentations are combining text with graphical presentations, mainly tables, and include sometimes message sequence charts. The present document presents a proposed table template to write test purposes with recommendations concerning the wording and the organization of the test purposes. There are usually numerous test purposes, which need to be organized in structured groups. The organization of the test purposes in groups is named "Test Suite Structure". The development of the test purposes follows the analysis of the conformance requirements, clearly expressed in the base standards. Furthermore, the analysis of a base standard leads to the identification of different groups of functionalities, which are used to define the first levels of the test suite structure.
9f25db803a4d03590d7c1361d4bb9675
118 115
6.3.2.2 Test Suite Structure
Defining the test suite structure consists of grouping the test purposes according to different criteria like for instance: • The functional groups and sub-groups of procedures in the base standard, from which the requirement of the test purpose is derived. • The category of test applying to the test purposes, for instance: - valid behaviour test; - invalid behaviour test; - timer test; - etc. Usually the identification of the different functional groups of procedures leads to the definition of the top levels of the TSS. Then further levels at the bottom of the TSS is used to group test purposes belonging to the same type of test. Table 6.3.2.2-1 shows an example of a two level TSS used in the TSS&TP for the oneM2M system. ETSI ETSI TS 118 115 V2.0.0 (2016-09) 14 (oneM2M TS-0015 version 2.0.0 Release 2) Table 6.3.2.2-1: Example of test suite structure for oneM2M system TP/<root>/<gr>/<sgr>/<xx>/<nnn> <root> = root oneM2M oneM2M <gr> = group AE Application Entity CSE Common Services Entity <sgr> = sub- group REG Registration DMR Data Management and Repository SUB Subscription and Notification GMG Group Management DIS Discovery LOC Location DMG Device Management CMDH Communication Management and Delivery Handling SEC Security <xx> = type of testing BI Invalid Behaviour tests BO Inopportune Behaviour tests BV Valid Behaviour tests <nnn> = sequential number 001 to 999
9f25db803a4d03590d7c1361d4bb9675
118 115
6.3.2.3 Test Purpose
9f25db803a4d03590d7c1361d4bb9675
118 115
6.3.2.3.1 Introduction
A test purpose is an informal description of the expected test behaviour. As such it is written in prose. When needed to clarify the TP, it is helpful to add some graphical presentations, mainly tables, and include message sequence charts. In order to increase the readability of the TP, the following two recommendations should be followed: • Each TP should be presented in a table, containing two main parts: - The TP header, which contains the TP identifier, the TP objective and the external references (ICS, and base standard). - The behaviour part, which contains the test behaviour description. This part can be optionally divided in the three following parts, in order to increase the readability: the initial conditions; the expected behaviour; the final conditions. • The prose describing the test behaviour (including initial and final conditions) should follow some rules, as for instance the use of reserved keywords and syntax. Table 6.3.2.3.1-1: TP proforma template TP Id Test objective Reference Config Id PICS Selection Initial conditions Expected behaviour Test events Direction when { } IUT AE then { } IUT  AE ETSI ETSI TS 118 115 V2.0.0 (2016-09) 15 (oneM2M TS-0015 version 2.0.0 Release 2) Table 6.3.2.3.1-2: Description of the fields of the TP proforma TP Header TP ID The TP ID is a unique identifier. It shall be specified according to the TP naming conventions defined in the above clause. Test objective Short description of test purpose objective according to the requirements from the base standard. Reference The reference indicates the clauses of the reference standard specifications in which the conformance requirement is expressed. ICS selection Reference to the ICS statement involved for selection of the TP. Contains a Boolean expression. TP Behaviour Initial conditions The initial conditions defines in which initial state the IUT has to be to apply the actual TP. In the corresponding Test Case, when the execution of the initial condition does not succeed, it leads to the assignment of an Inconclusive verdict. Expected behaviour (TP body) Definition of the events, which are parts of the TP objective, and the IUT are expected to perform in order to conform to the base specification. In the corresponding Test Case, Pass or Fail verdicts can be assigned there. Final conditions Definition of the events that the IUT is expected to perform or shall not perform, according to the base standard and following the correct execution of the actions in the expected behaviour above. In the corresponding Test Case, the execution of the final conditions is evaluated for the assignment of the final verdict. Defining the initial and final conditions, separately from the expected behaviour, makes the reading of the TP easier and avoid misinterpretations. The "expected behaviour", which matches the events corresponding to the TP objective, can also be named "TP body", which is similar to the "test case body" in an abstract test suite (ATS).
9f25db803a4d03590d7c1361d4bb9675
118 115
6.3.2.3.2 TP identifier
The TP identifier identifies uniquely the test purposes. In order to ensure the uniqueness of the TP identifier, it follows a naming convention. The more useful and straightforward naming convention consists of using the test suite structure, to form the first part of the TP identifier. Then the final part consists of a number to identify the TP order within a TP group. Table 6.3.2.3.2-1 shows an example of TP naming convention applying to the TSS described in clause 6.3.2.2-1. The TP identifier is formed by the abbreviation "TP", followed by abbreviation representing the group of the following TSS levels, ending with a number representing the TP order. Each field of the TP identifier is separated by a "/". Table 6.3.2.3.2-1: Example of TP naming convention for oneM2M TP/<root>/<gr>/<sgr>/<xx>/<nnn> <root> = root oneM2M oneM2M <gr> = group AE Application Entity CSE Common Services Entity <sgr> = sub- group REG Registration DMR Data Management and Repository SUB Subscription and Notification GMG Group Management DIS Discovery LOC Location DMG Device Management CMDH Communication Management and Delivery Handling SEC Security <xx> = type of testing BI Invalid Behaviour tests BO Inopportune Behaviour tests BV Valid Behaviour tests <nnn> = sequential number 001 to 999 A TP identifier, following the TP naming convention of the table could be for instance TP/oneM2M/CSE/DMR/BV/001. ETSI ETSI TS 118 115 V2.0.0 (2016-09) 16 (oneM2M TS-0015 version 2.0.0 Release 2) The TP numbering uses two digits for presentation, and starts with 01 rather than with 00. Exceeding 99 TPs per group is not recommended. In such a case, it is rather recommended to create sub-groups, in order to keep clarity in the Test Suite Structure.
9f25db803a4d03590d7c1361d4bb9675
118 115
6.3.2.3.3 Test objective
The test objective clearly indicates which requirement is intended to be tested in the test purpose. This part eases the understanding of the TP behaviour. This also eases the identification of the requirements, which were used as a basis for the test purpose. It is recommended to limit the length of the test objective to one sentence. See also the example in table 6.3.2.3.6-2.
9f25db803a4d03590d7c1361d4bb9675
118 115
6.3.2.3.4 Reference
In the reference row, the TP writer indicates, in which clauses of the protocol standards, the requirement are expressed. This information is critical, because it justifies the existence and the behaviour of the TP. The reference row may refer to several clauses. When the clause containing the requirement is big (for instance, more than ½ page), it is recommended to indicate the paragraph of the clause where the requirement was identified. The reference to the base standard actually is precise enough to enable the TP reader to identify quickly and precisely the requirement. See also the example in table 6.3.2.3.6-2.
9f25db803a4d03590d7c1361d4bb9675
118 115
6.3.2.3.5 ICS selection
The ICS selection row contains a Boolean expression, made of ICS parameters. It is recommended to use ICS acronym, which clearly identify the role of the ICS. A mapping table is included in the TP document to link the ICS acronym with its corresponding reference in the ICS document. Table 6.3.2.3.5-1: Example of pre-defined keywords for ICS Mnemonic ICS item PICS_REGISTRATION A.5.2. 1/1 [ICS document] PICS_DATA_MGMT A.5.2. 2/2 [ICS document] PICS_AE A.2/1 [ICS document] PICS_CSE A.2/2 [ICS document] PICS_ASN A.1/1 [ICS document] PICS_ADN A.1/2 [ICS document] PICS_IN A.1/3 [ICS document]
9f25db803a4d03590d7c1361d4bb9675
118 115
6.3.2.3.6 TP behaviour
First of all, the following global rules apply, when writing the behaviour description: • The behaviour description is written in an explicit, exhaustive and unambiguous manner. • The behaviour description only refers to externally observable test events (send/receive PDUs, timer, counters, etc.) or to events or states, which can be directly or indirectly observed externally. • All test events used in the behaviour description are part of the procedures specified in the standards. • The wording of the test events in the behaviour description is explicit, so that the ATS writers do not have to interpret the behaviour description. • All test events in the behaviour description should result as far as possible in one ATS statement (for instance a TTCN statement). ETSI ETSI TS 118 115 V2.0.0 (2016-09) 17 (oneM2M TS-0015 version 2.0.0 Release 2) The test behaviour is described in prose. This enables to use different ways to express similar behaviour. But using different expressions to define identical behaviours can lead to some misinterpretation of the test purposes. Also the meaning and the expected order of the test event have a clear and unique meaning for different readers. Thus, the present document recommends to use pre-defined keywords in order to express clearly and uniquely the test behaviour. Table 6.3.2.3.6-1 shows some recommended pre-defined keywords and their context of usage. The pre-defined keywords are also likely to be used in combination with the "{" "}"delimiters, in order to clearly delimitate their action in the test behaviour description. Table 6.3.2.3.6-1 does not present an exhaustive list, so that additional keywords might be defined as necessary. The definition of additional keywords is included in the corresponding TSS&TP document. Table 6.3.2.3.6-1: List of pre-defined keywords for the behaviour description Behavioural keywords with with, together with "{" "}" delimiters is used to express the initial conditions, which consist of a set of events, to be executed before starting with the test behaviour corresponding to the test objective. EXAMPLE: With { the IUT having sent a container create request message and ... } ensure that ensure that, together with "{" "}" delimiters is used to define the place of the expected behaviour (TP body) or the final conditions. EXAMPLE: ensure that { when { the IUT receives a valid container create request message... } when/then when combined with then enables to define the test behaviour involving a combination of stimuli and response events. The when/then combination is used when the occurrence of an event is triggered by the realization of a previous event. EXAMPLE: ensure that { when { a XXX signal is activated } then { the IUT sends a message containing YYY Value indicating "True"} } Event keywords the IUT Event in the TP is expressed from the point of view of the IUT. This avoid any misinterpretation. receives states for an event corresponding to the receipt of a message by the IUT. having received states for a condition where the IUT has received a message. sends states for an event corresponding to the sending of a message by the IUT. having sent states for a condition where the IUT has sent a message. from/to Indicates the destination or the origin of a message as necessary (interface, ...) EXAMPLE: ensure that { when { the IUT receives a valid XXX message from the YYY port.. } on expiry of Indicate the expiry of a timer, being a stimulus for forthcoming event. EXAMPLE: ensure that { on expiry of the Timer T1, the IUT sends a valid XXX message... after expiry of Used to indicate that an event is expected to occur after the expiry of a timer. EXAMPLE: ensure that { the IUT sends a valid XXX message after expiry of the minimum timer interval } before expiry of Used to indicate that an event is expected to occur before the expiry of a timer. EXAMPLE: ensure that { the IUT sends a valid XXX message before expiry of the maximum timer interval } ETSI ETSI TS 118 115 V2.0.0 (2016-09) 18 (oneM2M TS-0015 version 2.0.0 Release 2) Event attribute keywords valid Indicates that the event sent or received is a valid message according to the protocol standard, thus: • containing all mandatory parameters, with valid field values; • containing required optional fields according to the protocol context, with valid field values. invalid Indicates that the event sent or received is a invalid message according to the protocol standard. Further details describing the invalid fields of the message is added. EXAMPLE: With { the IUT having sent an invalid XXX message containing no mandatory YYY parameter... } containing Enables to describe the content of a sent or received message indicating Enables to specify the interpretation of the value allocated to a message parameter. EXAMPLE: With { the IUT having sent a valid XXX message containing a mandatory YYY parameter indicating "ZZZ supported"... } Logical keywords and Used to combine statements of the behaviour description. or not Table 6.3.2.3.6-2: TP example for oneM2M TP Id TP/oneM2M/CSE/DMR/RET/BO/002 Test objective Check that the IUT responds with an error when the AE tries to retrieve the resource TARGET_RESOURCE_ADDRESS which does not exist Reference TS-0001 10.1.2 - item 13) Config Id CF01 PICS Selection PICS_CSE Initial conditions with { the IUT being in the "initial state" and the IUT having registered the AE and the IUT not having created a resource TARGET_RESOURCE_ADDRESS } Expected behaviour Test events Direction when { the IUT receives a valid RETRIEVE request from AE containing To set to TARGET_RESOURCE_ADDRESS and From set to AE_ID and no Content attribute } IUT AE then { the IUT sends a Response message containing Response Status Code set to 4004 (NOT_FOUND) } IUT  AE
9f25db803a4d03590d7c1361d4bb9675
118 115
6.3.3 Abstract Test Suite (ATS)
9f25db803a4d03590d7c1361d4bb9675
118 115
6.3.3.1 Abstract protocol tester
An abstract protocol tester presented in figure 6.3.3.1-1 is a process providing the test behaviour for testing an IUT. Thus it will emulate a peer IUT of the same layer/the same entity. This type of test architecture provides a situation of communication which is equivalent to real operation between real oneM2M systems. The oneM2M test system will simulate valid and invalid protocol behaviour, and will analyse the reaction of the IUT. Then the test verdict, e.g. pass or fail, will depend on the result of this analysis. Thus this type of test architecture enables to focus the test objective on the IUT behaviour only. In order to access an IUT, the corresponding abstract protocol tester needs to use lower layers to establish a proper connection to the system under test (SUT) over a physical link (Lower layers link). ETSI ETSI TS 118 115 V2.0.0 (2016-09) 19 (oneM2M TS-0015 version 2.0.0 Release 2) Figure 6.3.3.1-1: Generic abstract protocol tester The "Protocol Data Units" (PDUs) are the messages exchanged between the IUT and the abstract protocol tester as specified in the base standard of the IUT. These PDUs are used to trigger the IUT and to analyse the reaction from the IUT on a trigger. Comparison of the result of the analysis with the requirements specified in the base standard allows to assign the test verdict. Further control actions on the IUT may be necessary from inside the SUT, for instance to simulate a primitive from the upper layer or the management/security entity. Further details on such control actions are provided by means of an upper tester presented in clause 6.3.2. The above "Abstract Test Method" (ATM) is defined in ISO/IEC 9646-1 [i.2] and supports a wide range of approaches for testing including the TTCN-3 abstract test language [i.4]. For instance, to test the oneM2M IUT, the abstract protocol tester will emulate the oneM2M primitives. use e.g HTTP, CoAP or MQTT in the OSI Application Layer, TCP/UDP and IPV4/IPV6 protocol in the transport and networking layer and Ethernet/WiFi technology in the access layer. ETSI ETSI TS 118 115 V2.0.0 (2016-09) 20 (oneM2M TS-0015 version 2.0.0 Release 2) Figure 6.3.3.1-2: Abstract protocol tester for oneM2M A current snap-shot of protocols to be tested (IUT) is shown in table 6.3.3.1-1. Table 6.3.3.1-1 indicates which lower layer protocols (may) belong to which IUT in order to build the proper M2M test system. Table 6.3.3.1-1: Mapping between protocols (IUTs) and lower layer protocols for Reference Point Protocol to be tested (IUT) Protocols of lower layers IUT base standards oneM2M IP, UDP, CoAP TS-0008 IP, TCP, HTTP TS-0009 IP, TCP, MQTT TS-0010 Test System ATS Lower Layers HTTP/CoAP/MQTT TCP/UDP IP System Under Test IUT Lower Layers HTTP/CoAP/MQT TCP/UDP IP Lower Layers link ETSI ETSI TS 118 115 V2.0.0 (2016-09) 21 (oneM2M TS-0015 version 2.0.0 Release 2)
9f25db803a4d03590d7c1361d4bb9675
118 115
6.3.3.2 TTCN-3 test architecture
This clause illustrates how to implement the abstract test architecture presented in clause 6.3.3.1 in a functional test environment. There are many possibilities to implement this abstract test architecture using different types of programming languages and test devices. This oneM2M testing framework uses TTCN-3 being a standardized testing methodology including a standardized testing language [i.4], which is fully compliant with the ISO/IEC 9646 [i.2] abstract test methodology. Figure 6.3.3.2-1: Conformance test system architecture The "System Under Test" (SUT) contains: • The "Implementation Under Test" (IUT), i.e. the object of the test. • The "Upper tester application" enables to simulate sending or receiving service primitives from protocol layers above the IUT or from the management/security entity. • The lower layers enable to establish a proper connection to the system under test (SUT) over a physical link (Lower layers link). The lower layers link is located at a "Reference Point" (RP), see clause 6.2. • The "Upper tester transport" is a functionality, which enables the test system to communicate with the upper tester application. Then the upper tester can be controlled by a TTCN-3 test component as part of the test process. The "test system" contains: • The "TTCN-3 test components" are processes providing the test behaviour. The test behaviour may be provided as one single process or may require several independent processes. • The "Codec" is a functional part of the test system to encode and decode messages between the TTCN-3 internal data representation and the format required by the related base standard. • The "Test Control" enables the management of the TTCN-3 test execution (parameter input, logs, test selection, etc.). • The "Test adapter" (TA) realizes the interface between the TTCN-3 ports using TTCN-3 messages, and the physical interfaces provided by the IUT. ETSI ETSI TS 118 115 V2.0.0 (2016-09) 22 (oneM2M TS-0015 version 2.0.0 Release 2)
9f25db803a4d03590d7c1361d4bb9675
118 115
6.3.3.3 Test configurations
The test suite uses test configurations in order to cover the different test scenarios. In following 2 examples, the IUT is tested by the test system simulating an AE in CF01 (no hop configuration) or an AE and a CSE in a CF02 (single hop configuration). EXAMPLE 1: Test configuration 1 (CF01): EXAMPLE 2: Test configuration 2 (CF02):
9f25db803a4d03590d7c1361d4bb9675
118 115
6.3.3.4 ATS conventions
9f25db803a4d03590d7c1361d4bb9675
118 115
6.3.3.4.1 Importing XSD definition
The oneM2M set of standards uses XSD for the definition of the message types. The process for using XSD data types and values in TTCN-3 modules consists of importing the existing XSD productions. For this purpose, the TTCN-3 "import from" statement should be used, in association with the "language" statement.
9f25db803a4d03590d7c1361d4bb9675
118 115
6.3.3.4.2 The TTCN-3 naming conventions
TTCN-3 core language contains several types of elements with different rules of usage. Applying naming conventions aims to enable the identification of the type when using specific identifiers according to the type of element. For instance, a variable declared in a component has different scoping rules than a local variable declared in a test case. Then identifiers of component variables are different from identifiers of local variables, in order to recognize which type of variable the identifier belongs to. Furthermore, applying naming conventions maintains the consistency of the TTCN-3 code across the test suites, and thus increase the readability for multiple users and ease the maintenance. IUT TEST SYSTEM AE CSE Mca Mcc IUT TEST SYSTEM AE CSE Mca CSE ETSI ETSI TS 118 115 V2.0.0 (2016-09) 23 (oneM2M TS-0015 version 2.0.0 Release 2) Table 6.3.3.4.2-1 Language element Naming convention Prefix Example identifier Module Use upper-case initial letter none OneM2M_Templates Group within a module Use lower-case initial letter none messageGroup Data type Use upper-case initial letter none SetupContents Message template Use lower-case initial letter m_ m_setupInit Message template with wildcard or matching expression Use lower-case initial letters mw_ mw_anyUserReply Signature template Use lower-case initial letter s_ s_callSignature Port instance Use lower-case initial letter none signallingPort Test component instance Use lower-case initial letter none userTerminal Constant Use lower-case initial letter c_ c_maxRetransmission Constant (defined within component type) Use lower-case initial letter cc_ cc_minDuration External constant Use lower-case initial letter cx_ cx_macId Function Use lower-case initial letter f_ f_authentication() External function Use lower-case initial letter fx_ fx_calculateLength() Altstep (incl. Default) Use lower-case initial letter a_ a_receiveSetup() Test case Use a naming convention TC_ TC_COR_0009_47_ND Variable (local) Use lower-case initial letter v_ v_macId Variable (defined within a component type) Use lower-case initial letters vc_ vc_systemName Timer (local) Use lower-case initial letter t_ t_wait Timer (defined within a component) Use lower-case initial letters tc_ tc_authMin Module parameters for PICS Use all upper case letters PICS_ PICS_DOOROPEN Module parameters for other parameters Use all upper case letters PX_ PX_TESTER_STATION_ID Formal Parameters Use lower-case initial letter p_ p_macId Enumerated Values Use lower-case initial letter e_ e_syncOk
9f25db803a4d03590d7c1361d4bb9675
118 115
6.3.3.5 Verification of TTCN-3
Before release for use by industry and external organisations (for example Certification Bodies) the TTCN-3 should be Verified for correct operation against a number of IUTs. A list of all TTCN-3 test cases and their Verification status is maintained in the associated ATS. An example table to be used to record this status is given in table 6.3.3.5-1. Table 6.3.3.5-1: Example table for TTCN-3 Test Case Verification Status TTCN-3 Test Case Verification Status TTCN-3 version used for Verification Binding(s) used duringVerification (for information only) TP/oneM2M/CSE/DMR/CRE/BV/004 TP/oneM2M/CSE/DMR/CRE/BV/002 Verified V1.3.4 HTTP, CoAP TP/oneM2M/CSE/DMR/CRE/BV/003
9f25db803a4d03590d7c1361d4bb9675
118 115
6.3.4 Implementation eXtra Information for Testing (IXIT)
The ICS contains base specification dependent information. To derive executable tests this is insufficient; also information about the IUT and its environment shall be supplied. Such information is called Implementation eXtra Information for Testing (IXIT). An IXIT proforma identifies which ICS items are to be tested and which parameters to be instantiated for the TSS&TP being developed. The production of a IXIT Proforma is specified in ISO/IEC 9646-6 [i.2]. A supplier, providing an IUT for conformance testing, is required to complete a IXIT proforma, which contains additional questions that need to be answered in order to turn on/off the "switches" and identify Means of Testing for a particular Implementation Under Test (IUT). ETSI ETSI TS 118 115 V2.0.0 (2016-09) 24 (oneM2M TS-0015 version 2.0.0 Release 2) The IXIT may contain address information of the IUT, or parameter and timer values which are necessary for the execution of the test suite. The IXIT information , is supplied by the supplier of the IUT to the testing laboratory. To guide production of the IXIT the testing laboratory provides an IXIT proforma. The selected and implemented test cases with parameter values according to the IXIT form the executable test suite, which are executed on a test system. The testing laboratory uses the IXIT values stated in the IXIT proforma for executing test cases according to the capabilities of the Implementation Under Test. Supported values are given as a single value or a range depending on the nature of the parameter.
9f25db803a4d03590d7c1361d4bb9675
118 115
7 Interoperability testing
9f25db803a4d03590d7c1361d4bb9675
118 115
7.1 Introduction
Interoperability testing can demonstrate that a product will work with other like products: it proves that end-to-end functionality between (at least) two devices is as required by the standard(s) on which those devices are based. In that context, the system under test is made of the combination of different devices under test coming from different suppliers. The important factors which characterize interoperability testing are: • interoperability tests are performed at interfaces that offer only normal control and observation (i.e. not at specialized interfaces introduced solely for testing purposes); • interoperability tests are based on functionality as experienced by a user (i.e. they are not specified at the protocol level). In this context a user may be human or a software application; • the tests are performed and observed at functional interfaces such as Man-Machine Interfaces (MMIs), protocol service interfaces and Application Programming Interfaces (APIs). The fact that interoperability tests are performed at the end points and at functional interfaces means that interoperability test cases can only specify functional behaviour. They cannot explicitly cause or test protocol error behaviour. The present clause provides users with guidelines on the main steps associated with interoperability testing. The intention is that the guidelines should be simple and pragmatic so that the document can be used as a "cook-book" rather than a rigid prescription of how to perform interoperability testing. The main components of these guidelines are as follows: • basic concepts definition; • development of interoperability test specifications, including: - definition of a generic SUT architecture; - definition of Test bed architecture; - specification of Test scenarios and configurations; - identification of interoperable functions; - development of interoperability test descriptions; • interoperability testing process. ETSI ETSI TS 118 115 V2.0.0 (2016-09) 25 (oneM2M TS-0015 version 2.0.0 Release 2)
9f25db803a4d03590d7c1361d4bb9675
118 115
7.2 Basic Concepts
9f25db803a4d03590d7c1361d4bb9675
118 115
7.2.1 Overview
Interoperability testing consists simply in inter-operating different vendor implementations, which are supposed to be inter-operable according to the expected conformance with the base standards. Even if this process looks easy, it requires specifying a complete environment enabling to operate vendors implementation as in real conditions. The complete set of all vendors implementation involved in interoperability tests, together with the set of equipment required to enable vendors implementations to execute the test process is named the "Test Bed". There are a number of different terms and concepts that can be used when describing a test methodology. The following sections describe the most important concepts used by these guidelines, which can been categorized either as part of the System Under Test (SUT) or as part of the Test Environment. Figure 7.2.1-1 presents the main concepts used in the context of interoperability testing and described in the following sections Figure 7.2.1-1: Illustration of basic concepts
9f25db803a4d03590d7c1361d4bb9675
118 115
7.2.2 System Under Test (SUT)
9f25db803a4d03590d7c1361d4bb9675
118 115
7.2.2.0 Introduction
In the context of interoperability testing, the System Under Test (SUT) is made of a number of Devices Under Test (DUTs) coming from different suppliers. Depending on the complexity of the end-to-end system, the overall amount of DUTs under study, and the interactions among them, it might be advisable to define different SUT configuration addressing specific functional areas or groups of tests. The first steps towards defining an Interoperability Tests Specification are identifying the Devices Under Test and describing a generic architecture where all the required SUT configurations will fit in. ETSI ETSI TS 118 115 V2.0.0 (2016-09) 26 (oneM2M TS-0015 version 2.0.0 Release 2)
9f25db803a4d03590d7c1361d4bb9675
118 115
7.2.2.1 Devices Under Test (DUT)
In the context of oneM2M, a Device Under Test is a combination of software and/or hardware items which implement the functionality of oneM2M and interact with other DUTs via one or more reference points. NOTE: When using Interoperability Test Specifications in a certification scheme, the notion of Qualified Equipment (QE) or Qualified Device (QD) applies. A QD is a DUT that has successfully been tested with other QDs. The usage of interoperability Test Specifications in a certification scheme is out of the scope of this document. Further details on this topic can be found at ETSI EG 202 237 [i.3].
9f25db803a4d03590d7c1361d4bb9675
118 115
7.2.2.2 Test interfaces
The interfaces that are made available by the SUT to enable the testing are usually known as the test interfaces. These interfaces are accessed by the test drivers to trigger and verify the test behaviour, Other interfaces offered by the SUT can be used for monitoring, log analysis, etc. In the simplest case, the test interfaces will be the normal user interfaces offered by some of the DUTs (command line, GUI, web interface, etc.). In other cases, DUTs may offer APIs over which interoperability testing can be performed either manually using a dedicated application, or automatically using a programmable test device. In some cases, observing and verifying the functional behaviour or responses of one DUT may require to analyse its logs or records. Additionally, while in the context of interoperability testing interfaces between the DUTs are not considered to be test interfaces, combining interoperability testing with conformance checks may require to monitor those interfaces to assess the conformance of the exchanged information or messages.
9f25db803a4d03590d7c1361d4bb9675
118 115
7.2.3 Test Environment
9f25db803a4d03590d7c1361d4bb9675
118 115
7.2.3.0 Introduction
Interoperability testing involves control and observation at the functional (rather than protocol) level. The Test Environment is the combination of equipment and procedures enabling testing the interoperability of the DUTs. Entities in the test environment access the different Devices Under Test via the Test Interfaces offered by the SUT. These entities ensure the selection, interpretation and execution of the test descriptions, coordination and synchronization of the actions on the test interfaces, and provide mechanisms for logging, reporting, monitoring and observing the interactions among the DUTs, etc. The main entities in the test environment are described in the following sections.
9f25db803a4d03590d7c1361d4bb9675
118 115
7.2.3.1 Test Descriptions
A test description provides the detailed set of instructions (or steps) that need to be followed in order to perform a test. Most often, interoperability tests are described in terms of actions that can be performed by the user(s) of the endpoint device(s). In the case where the test is executed by a human operator, test will be described in natural language. In the case where the tests are automated, a programming or test language will be used to implement the test descriptions. The steps in the test description can be of different nature, depending on the kind of action required: trigger a behaviour on one DUT, verify the functional response on another DUT, configure the SUT (add/remove a DUT), check a log, etc. Each step should clearly identify the DUT and/or interface targeted by the action.
9f25db803a4d03590d7c1361d4bb9675
118 115
7.2.3.2 Test drivers
The test driver realizes the steps specified in a test description at one specific test interface. Testing efficiency and consistency can be improved by implementing the role of the test driver via an automatic device programmed to carry out the specified test steps. This approach may require standardized test interfaces in the DUTs. In any given instance of testing, there may be more than one test interface over which the tests will be executed. In that case, coordination among the different test drivers and synchronization of the actions performed by them will be required. This test coordination role can be played by one of the test drivers, or by and additional entity in the test environment. ETSI ETSI TS 118 115 V2.0.0 (2016-09) 27 (oneM2M TS-0015 version 2.0.0 Release 2)
9f25db803a4d03590d7c1361d4bb9675
118 115
7.3 Development of Interoperability Test Specifications
9f25db803a4d03590d7c1361d4bb9675
118 115
7.3.1 Overview
The main steps involved in the process of developing an interoperability test specification are as follows: • describing a generic architecture for the System Under Test; • defining test scenarios; • identifying the test bed architecture; • collecting requirements in the Interoperable Features Statement (IFS); • defining a structure for the Test Specification; • writing a Test Descriptions (TDs) for each item in the IFS. Figure 7.3.1-1: Interoperability Test Specification Development process
9f25db803a4d03590d7c1361d4bb9675
118 115
7.3.2 Generic SUT Architecture
A generic SUT architecture provides an abstract framework within which any specific SUT configuration should fit in. The starting point for defining a generic SUT architecture is most often the functional architecture described in the base standards, in combination with pragmatic input on how the industry and open source projects are actually implementing these functional blocks (grouping, bundling, etc.). As described in the previous sections, in a complex system, it may be required to define several SUT configurations to cover all the specified groups of tests. Defining the generic architecture and identifying the SUT configurations at an early stage helps to provide a structure for the test descriptions later. The generic test architecture is usually specified as a diagram and should clearly identify: • the Devices Under Test, and the functional blocks implemented by them; • the communications paths between the DUTs; • if required, the protocols, APIs and/or data models to be used for communication between the DUTs. Base Standards Industry practise Test Specifications SUT Configurations Test Suite Structure Test Descriptions IFS Collect IOP Requirements Define SUT Architecture Generic SUT Architecture ETSI ETSI TS 118 115 V2.0.0 (2016-09) 28 (oneM2M TS-0015 version 2.0.0 Release 2)
9f25db803a4d03590d7c1361d4bb9675
118 115
7.3.3 Test scenarios
In oneM2M, a large number of use cases is identified. In order to perform interoperability tests, EUTs supporting the same use cases are required. This classification of interoperability tests is given by test scenarios. A test scenario thus selects a set of use cases and is restricted to a sub-set of the full functionality of such a set. In other words, EUTs considered for defining the test scenarios are implementations of oneM2M entities with various roles, but sharing a common functionality. In order to cover the test scenarios, different test configurations are defined.
9f25db803a4d03590d7c1361d4bb9675
118 115
7.3.4 Test bed architecture and Interfaces
A test bed architecture is an abstract description of logical entities as well as their interfaces and communication links involved in a test. It describes all implementation (DUTs) involved in the interoperability tests, together with the set of equipment and procedures required to enable implementations to execute the tests. This test architecture is mainly composed of several functional entities: • SUT: It is composed of a set of DUTs (oneM2M nodes). It is supposed that the DUTs are equipped with all the devices (sensors, etc.) needed to perform the tests. • Test bed control module: This entity manages the whole test bed. It is considered to be the core of the test bed. This module synchronizes, configures, controls and runs the other entities and even the SUT. In addition, this entity gathers all the information generated by each entity in term of traces with the aim of having a global overview of the execution of the tests. Depending of the implementation of the test bed, this module might also assign the test verdicts. • Test stimulation environment: This entity is in charge of stimulating the SUT for a specific test conditions. • Monitor: This entity checks and gathers messages on relevant communication links. • oneM2M architecture element: It provides oneM2M applications for some use cases. • Networks: the test bed identifies two types of network depending on the type of information which is going to be carried out. One of the networks is used for carrying out data, and the other one is used for control. NOTE: The definition of the test bed architecture should be done simultaneously with the test description specification. The test bed classifies the interfaces in three groups: • Data: this group contains the interfaces where data is exchanged. Depending on the type of data being exchanged, the interfaces are classified into three categories: - Stimulating: this interface carries information generated by the test bed in order to stimulate the DUTs for a specific behaviour. - Monitoring: this interface carries the protocol message exchanged between the DUTs during the execution of the tests. - Tracing: this interface carries information about the status of the execution of the DUTs and the test bed entities in order to be able to analyze as much as possible the execution of a test. • Control: this group is used to configure and control the various entities in the test bed, and even the DUTs, by passing necessary parameters. • Test Operator: this group provides the capability of controlling the test bed control module. Through this interface, a test operator would be able to select the test to be executed, to configure the different entities involved in the tests and to analyse the results obtained during the test execution. ETSI ETSI TS 118 115 V2.0.0 (2016-09) 29 (oneM2M TS-0015 version 2.0.0 Release 2) Figure 7.3.4-1 illustrates interfaces involved in the test bed. Figure 7.3.4-1: Interfaces of a test bed architecture
9f25db803a4d03590d7c1361d4bb9675
118 115
7.3.5 Interoperable Functions Statement (IFS)
An "Interoperable Functions Statement" (IFS) identifies standardized functions that an DUT shall support. These functions are either mandatory, optional or conditional (depending on other functions). In addition, the IFS can be used as a proforma by a manufacturer to identify the functions an DUT will support when interoperating with corresponding equipment from other manufacturers. The ideal starting point in the development of an IFS is the "Implementation Conformance Statement" (ICS) which should clearly identify the tested protocol's options and conditions. Like the ICS, the IFS should be considered part of the base protocol specification and not a testing document. The guidance to produce IFS proforma is provided in ETSI EG 202 237 [i.3] and no extra guidance is required for the context of oneM2M.
9f25db803a4d03590d7c1361d4bb9675
118 115
7.3.6 Test Descriptions (TD)
A "Test Description" (TD) is a well detailed description of a process that pretends to test one or more functionalities of an implementation. Applying to interoperability testing, these testing objectives address the interoperable functionalities between two or more vendor implementations. In order to ensure the correct execution of an interoperability test, the following information should be provided by the test description: • The proper configuration of the vendor implementations. • The availability of additional equipment (protocol monitors, functional equipment, etc.) requires to achieve the correct behaviour of the vendor implementations. • The correct initial conditions. SUT oneM2M Architecture Element Test bed control module Test stimulation environment Protocol analyser Test operator Configuration / control interface Stimulating interface Monitoring interface Tracing interface Test Operator interface ETSI ETSI TS 118 115 V2.0.0 (2016-09) 30 (oneM2M TS-0015 version 2.0.0 Release 2) • The correct sequence of the test events and test results. TDs are based on the test scenarios. The test descriptions use test configurations in order to cover the different test scenarios. In order to facilitate the specification of test cases an interoperability test description should include as a minimum the items of the table 7.3.6-1. Table 7.3.6-1: Interoperability test description Identifier a unique test description ID Objective a concise summary of the test which should reflect the purpose of the test and enable readers to easily distinguish this test from any other test in the document References a list of references to the base specification section(s), use case(s), requirement(s), TP(s) which are either used in the test or define the functionality being tested Applicability a list of features and capabilities which are required to be supported by the SUT in order to execute this test (e.g. if this list contains an optional feature to be supported, then the test is optional) Configuration or Architecture a list of all required equipment for testing and possibly also including a (reference to) an illustration of a test architecture or test configuration Pre-Test Conditions a list of test specific pre-conditions that need to be met by the SUT including information about equipment configuration, i.e. precise description of the initial state of the SUT required to start executing the test sequence Test Sequence an ordered list of equipment operation and observations. In case of a conformance test description the test sequence contains also the conformance checks as part of the observations The TDs play a similar role as TPs for conformance testing. Table 7.3.6-2: Example of Test Description Interoperability Test Description Identifier: TD_M2M_NH_06 Objective: AE registers to its registrar CSE via an AE Create Request Configuration: M2M_CFG_01 References: ETSI TS 118 101 [1], clause 10.2.1.1 ETSI TS 118 104 [2], clause 7.3.5.2.1 Pre-test conditions: • CSEBase resource has been created in CSE with name {CSEBaseName} • AE does not have an AE-ID, i.e. it registers from scratch Test Sequence Step RP Type Description 1 Stimulus AE is requested to send a AE Create request to register to the Registrar CSE 2 Mca PRO Check Primitive • op = 1 (Create) • to = {CSEBaseName} • fr = AE-ID • rqi = (token-string) • ty = 2 (AE) • pc = Serialized representation of <AE> resource PRO Check HTTP Sent request contains • Request method = POST • Request-Target:{CSEBaseName} • Host: IP address or the FQDN of Registrar CSE • X-M2M-RI: (token-string) • X-M2M-Origin: AE-ID • Content-Type: application/vnd.onem2m-res+xml; ty=2 or application/vnd.onem2m-res+json; ty=2 • Message-body: Serialized representation of <AE> resource ETSI ETSI TS 118 115 V2.0.0 (2016-09) 31 (oneM2M TS-0015 version 2.0.0 Release 2) Interoperability Test Description PRO Check CoAP Sent request contains • Method: 0.02 (POST) • Uri-Host: IP address or the FQDN of Registrar CSE • Uri-Path: {CSEBaseName} • Content-type: application/vnd.onem2m-res+xml or application/vnd.onem2m- res+json • oneM2M-TY: 2 • oneM2M-FR: AE-ID • oneM2M-RQI: (token-string) • Payload: Serialized representation of <AE> resource PRO Check MQTT Sent MQTT PUBLISH message: Topic: "/oneM2M/req/<AE-ID>/<Registrar CSE-ID>" Payload: • op = 1 (Create) • to = {CSEBaseName} • fr = AE-ID • rqi = (token-string) • ty = 2 (AE) • pc = Serialized representation of <AE> resource 3 IOP Check Check if possible that the <AE> resource is created in registrar CSE. 4 Mca PRO Check Primitive • rsc = 2001 (CREATED) • rqi = (token-string) same as received in request message • pc = Serialized representation of <AE> resource PRO Check HTTP Registrar CSE sends response containing: • Status Code = 201 (OK) • X-M2M-RSC: 2001 • X-M2M-RI: (token-string) same as received in request message • Content-Location: URI of the created AE resource. • Content-Type: application/vnd.onem2m-res+xml or application/vnd.onem2m- res+json • Message-body: Serialized representation of <AE> resource PRO Check CoAP Registrar sends response containing: • Response Code = 2.01 • oneM2M-RSC: 2001 • oneM2M-RQI: (token-string) same as received in request message • Location-Path: URI of the created AE resource • Payload: Serialized representation of <AE> resource PRO Check MQTT Sent MQTT PUBLISH message: Topic: "/oneM2M/resp/<AE-ID>/<Registrar CSE-ID>" Payload: • to = AE-ID • fr = Registrar CSE-ID • rsc = 2001 (CREATED) • rqi = (token-string) same as received in request message • pc = Serialized representation of <AE> resource 5 IOP Check AE indicates successful operation Types of events: • A stimulus corresponds to an event that enforces an DUT to proceed with a specific protocol action, like sending a message for instance. • A configure corresponds to an action to modify the DUT configuration. • An IOP check consists of observing that one DUT behaves as described in the standard: i.e. resource creation, update, deletion, etc. For each IOP check in the Test Sequence, a result can be recorded. The overall IOP Verdict will be considered OK if all the IOP checks in the sequence are OK. • In the context of Interoperability Testing with Conformance Checks, an additional step type, PRO checks can be used to verify the appropriate sequence and contents of protocol messages, helpful for debugging purpose. PRO Verdict will be PASS if all the PRO checks are PASS. ETSI ETSI TS 118 115 V2.0.0 (2016-09) 32 (oneM2M TS-0015 version 2.0.0 Release 2) Annex A (informative): Example of ICS table A.1 Capability Statement A list of capabilities defined in the ETSI TS 118 101 [1] are presented in table A.1-1. The capability list can be used to check whether the IUT supports part or whole of the capabilities listed as below. Table A.1-1: Capabilities for oneM2M Conformance Testing Item Capability Mnemonic Reference Status Support 1 Registration [1] 10.2.1 C.1 O Yes O No 2 Data Management [1] 10.2.4, [1] 10.2.19 C.1 O Yes O No 3 Subscription and Notification [1] 10.2.11 C.2 O Yes O No 4 Group Management [1] 10.2.7 C.2 O Yes O No 5 Discovery [1] 10.2.6 C.2 O Yes O No 6 Location Management [1] 10.2.10 C.2 O Yes O No 7 Device Management [1]10.2.8 C.2 O Yes O No 8 Communication Management and Delivery Handling [1] 10.2.5, [1] 10.2.20 C.2 O Yes O No C.1: Mandatory IF the IUT is declaimed to be developed conforming to ETSI TS 118 101 [1]. C.2: Optional IF the IUT is declaimed to be developed conforming to ETSI TS 118 101 [1]. ETSI ETSI TS 118 115 V2.0.0 (2016-09) 33 (oneM2M TS-0015 version 2.0.0 Release 2) History Document history V2.0.0 September 2016 Publication
5884f20096a929755c7228996f24adba
118 109
1 Scope
The present document will cover the protocol specific part of communication protocol used by oneM2M compliant systems as RESTful HTTP binding. The scope of the present document is (not limited to as shown below): • Binding oneM2M Protocol primitive types to HTTP method. • Binding oneM2M response status codes (successful/unsuccessful) to HTTP response codes. • Binding oneM2M RESTful resources to HTTP resources. The present document is depending on Core Protocol specification (ETSI TS 118 104 [3]) for data types.
5884f20096a929755c7228996f24adba
118 109
2 References
5884f20096a929755c7228996f24adba
118 109
2.1 Normative references
References are either specific (identified by date of publication 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 reference document (including any amendments) applies. The following referenced documents are necessary for the application of the present document. [1] IETF RFC 7230 (June 2014): "Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing". [2] ETSI TS 118 103: "oneM2M; Security solutions (oneM2M TS-0003)". [3] ETSI TS 118 104: "oneM2M; Service Layer Core Protocol Specification (oneM2M TS-0004)". [4] IETF RFC 7235 (June 2014): "Hypertext Transfer Protocol (HTTP/1.1): Authentication". [5] IETF RFC 6750 (October 2012): "The Oauth 2.0 Authorization Framework: Bearer Token Usage". [6] ETSI TS 118 111: "oneM2M; Common Terminology (oneM2M TS-0011)". [7] ETSI TS 118 101: "oneM2M; Functional Architecture (oneM2M TS-0001)". [8] IETF RFC 7232 (June 2014): "Hypertext Transfer Protocol (HTTP/1.1): Conditional Requests". [9] IETF RFC 3986 (January 2005): "Uniform Resource Identifier (URI): Generic Syntax". [10] IETF RFC 7231 (June 2014): "HTTP/1.1 Semantics and Content".
5884f20096a929755c7228996f24adba
118 109
2.2 Informative references
References are either specific (identified by date of publication 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 reference document (including any amendments) applies. 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] oneM2M Drafting Rules. [i.2] Void. [i.3] Void. ETSI ETSI TS 118 109 V4.4.1 (2023-12) 7 oneM2M TS-0009 version 4.4.1 Release 4 [i.4] IETF RFC 6455 (December 2011): "The WebSocket Protocol". [i.5] Void.
5884f20096a929755c7228996f24adba
118 109
3 Definition of terms, symbols and abbreviations
5884f20096a929755c7228996f24adba
118 109
3.1 Terms
Void.
5884f20096a929755c7228996f24adba
118 109
3.2 Symbols
Void.
5884f20096a929755c7228996f24adba
118 109
3.3 Abbreviations
For the purposes of the present document, the abbreviations given in ETSI TS 118 111 [Error! Reference source not found.] apply and the following apply: HTTP Hyper Text Transfer Protocol TLS Transport Layer Security URI Uniform Resource Identifier
5884f20096a929755c7228996f24adba
118 109
4 Conventions
The keywords "Shall", "Shall not", "May", "Need not", "Should", "Should not" in this document are to be interpreted as described in the oneM2M Drafting Rules [i.1].
5884f20096a929755c7228996f24adba
118 109
5 Overview on HTTP Binding
5884f20096a929755c7228996f24adba
118 109
5.0 Overview
HTTP binding specifies the equivalence between oneM2M request and response primitives and HTTP request and response messages, respectively. This clause provides a brief overview on the mapping relationship between oneM2M and HTTP message parameters. This clause describes how oneM2M request/response primitives can be mapped to HTTP request/response messages and vice versa.
5884f20096a929755c7228996f24adba
118 109
5.1 Introduction
Figure 5.1-1 illustrates an example oneM2M system configuration and its correspondence to an HTTP-based information system if HTTP binding as defined in this specification is applied. The upper diagram in figure 5.1-1 shows with solid line arrows the flow of a request primitive originating from an AE which is registered to an MN-CSE (Registrar of AE). The request primitive is assumed to address a resource which is hosted by another MN-CSE (Host of Resource). Both MN-CSEs are registered to the same IN-CSE. When applying HTTP binding, the oneM2M entities of the upper diagram take the roles outlined in the lower diagram of a corresponding HTTP information system as defined in IETF RFC 7230 [1]. The AE takes the role of an HTTP client, the MN-CSE (Registrar of AE) takes the role of a HTTP Proxy Server, and both the IN-CSE and MN-CSE (Host of Resource) take the role of a HTTP server for this particular request message. ETSI ETSI TS 118 109 V4.4.1 (2023-12) 8 oneM2M TS-0009 version 4.4.1 Release 4 CSEs may also issue unsolicited request messages, shown with dashed line arrows in figure 5.1-1, and receive associated response messages. Therefore, for HTTP protocol binding, CSEs generally provides capability of both HTTP Server and HTTP Client. Aes may provide HTTP Server capability optionally in order to be able to serve Notification request messages (see ETSI TS 118 104 [3] and ETSI TS 118 101 [Error! Reference source not found.]). Figure 5.1-1: Correspondence between oneM2M entities and HTTP Client and Server Each individual request primitive will be mapped to single HTTP request message, and each individual response primitive will be mapped to a single HTTP response message, and vice-versa. An HTTP request message consists of Request-Line, headers and message-body. An HTTP response message consists of Status-Line, headers and message-body [1]. HTTP header names are case-insensitive and a Receiver shall accept headers that are either lower or upper or any mixture thereof. This clause describes how oneM2M request/response primitives are mapped to HTTP messages at a high level. Corresponding details are specified in clause 6.
5884f20096a929755c7228996f24adba
118 109
5.2 Request-Line
The HTTP method of a request message is mapped to the Operation parameter, and vice-versa. At the message originator side the HTTP Request-Target is derived from the To parameter of the request primitive, including a query string which carries other specific primitive parameters. HTTP-Version is specified in clause 6.
5884f20096a929755c7228996f24adba
118 109
5.3 Status-Line
HTTP Version is specified in clause 6. The Status-Code of HTTP response messages is derived from the Response Status Code parameter of the response primitive. The Reason-Phrase is not applicable to oneM2M systems and is omitted. ETSI ETSI TS 118 109 V4.4.1 (2023-12) 9 oneM2M TS-0009 version 4.4.1 Release 4
5884f20096a929755c7228996f24adba
118 109
6 HTTP Message Mapping
5884f20096a929755c7228996f24adba
118 109
6.1 Introduction
Mapping between oneM2M primitives and HTTP messages shall be applied in the following four use cases: 1) Mapping of request primitive to HTTP request message at the request originator (HTTP client). 2) Mapping of HTTP request message to request primitive at the request receiver (HTTP server). 3) Mapping of response primitive to HTTP response message at the request receiver (HTTP server). 4) Mapping of HTTP response message to response primitive at the request originator (HTTP client). All four use cases also appear at transit CSEs. The following clauses specify the mapping between each oneM2M primitive parameter and a corresponding HTTP message field to compose a HTTP request/response message.
5884f20096a929755c7228996f24adba
118 109
6.2 Parameter Mappings on Request-Line
5884f20096a929755c7228996f24adba
118 109
6.2.1 Method
The HTTP 'Method' shall be derived from the Operation request primitive parameter of the request primitive. Table 6.2.1-1: HTTP Method Mapping oneM2M Operation HTTP Method Create POST Retrieve GET Update PUT Delete DELETE Notify POST At the Receiver, an HTTP request message with POST method shall be mapped either to a Create or Notify Operation parameter. Discrimination between Create and Notify operations can be accomplished by inspection of the content-type header. The Resource Type parameter is present in the content-type header only when the HTTP POST request represents a Create request (see clause 6.4.3). The Resource Type parameter is not present in the content-type header when the HTTP POST request represents a Notify request.
5884f20096a929755c7228996f24adba
118 109
6.2.2 Request-Target
5884f20096a929755c7228996f24adba
118 109
6.2.2.1 Path component
The path component of the origin-form HTTP Request-Target shall be interpreted as the mapping of the resource identifier part of the To request primitive parameter. If the HTTP message is sent directly to the next hop CSE, the origin-form of Request-Target shall be employed (see clause 5.3.1 of IETF RFC 7230 [1]). The resource identifier part of the To parameter can be represented in three different forms (see clause 6.2.3 of ETSI TS 118 104 [3] and clause 7.2 of ETSI TS 118 101 [Error! Reference source not found.]): • CSE-Relative-Resource-ID; • SP-Relative-Resource-ID; • Absolute-Resource-ID. ETSI ETSI TS 118 109 V4.4.1 (2023-12) 10 oneM2M TS-0009 version 4.4.1 Release 4 Each of the above three formats may include either a structured Resource ID (used for hierarchical addressing) or an unstructured Resource ID (used for non-hierarchical addressing) as defined in clause 7.2 of ETSI TS 118 101 [Error! Reference source not found.]. For CSE-relative Resource ID representation, the path component of the HTTP request message shall be constructed as the concatenation of the literal "/" and the To request primitive parameter. For SP-relative Resource ID representation, the path component of the HTTP request message shall be constructed as the concatenation of the literal "/~" and the To request primitive parameter. For Absolute Resource ID representation, the path component of the HTTP request message shall be constructed by replacing the first "/" character of the To request primitive parameter with "/_". Table 6.2.2.1-1 shows valid mappings between the To request primitive parameter and the path component of the origin-form HTTP request target. In the shown examples, /myCSEID and /CSE178 represent applicable CSI-IDs, CSEBase represents the resource name of a <CSEBase> resource, CSEBase/ae12/cont27/contInst696 represents a structured CSE-relative resource ID, and cin00856 an unstructured CSE-relative resource ID. Table 6.2.2.1-1: Mapping examples between To parameter and path component of request-line Resource-ID Type To parameter value path component (origin-form) structured CSE- Relative CSEBase/ae12/cont27/contInst696 /CSEBase/ae12/cont27/contInst696/ unstructured CSE- Relative cin00856 /cin00856 structured SP-Relative /CSE178/CSEBase/ae12/cont27/contInst696 /~/CSE178/CSEBase/ae12/cont27/contInst696 unstructured SP- Relative /CSE178/cin00856 /~/CSE178/cin00856 structured Absolute //mym2msp.org/CSE178/CSEBase/ ae12/cont27/contInst696 /_/mym2msp.org/CSE178/CSEBase/ ae12/cont27/contInst696 unstructured Absolute //mym2msp.org/CSE178/cin00856 /_/mym2msp.org/CSE178/cin00856 At the HTTP server side, the reverse operations shall be applied to the path component of request-line to derive a replica of the original To request primitive parameter. If the HTTP message is sent to a HTTP proxy instead directly to the next hop CSE, the absolute-form of Request-Target shall be employed (see clause 5.3.2 of IETF RFC 7230 [1]). The absolute-form is derived by prefixing the origin-form with the schema and the host address of the next hop CSE: http://{host address of next hop CSE}{origin-form path-component}
5884f20096a929755c7228996f24adba
118 109
6.2.2.2 Query component
The query component (e.g. query-string) may include the optional primitive parameters listed in table 6.2.2.2-1 compliant with IETF RFC 7230 [1]. Each applicable request primitive parameters and elements of Filter Criteria parameter shown in table 6.2.2.2-1 shall be represented as pair of field-name and value in query-string. Multiple such pairs shall be concatenated with an ampersand '&' character used as separator between two pairs. Table 6.2.2.2-1 also shows the permitted multiplicity of occurrence of field names in the query-string. Multiplicity '0..1' means that a parameter is optional and can occur at most once. Parameters with multiplicity '0..n', may occur multiple times in the query-string in the form of <query field name> = value. For example, if the resourceType element of the Filter Criteria parameter is represented by a list of 3 values '2 3 4' (see clause 6.3.4.7 in ETSI TS 118 104 [3]), it would be mapped to ty=2+3+4 in the query-string. At the receiver side, this query string can be reverted back into the list type of representation. The same representation shall be applied for multiple occurrences of contentType and labels elements. The 'attribute' element of the Filter Criteria request primitive parameter consists of two elements, name and value, which in XML notation would look for example as follows in case of multiplicity 2 (see clause 6.2.4.8 in ETSI TS 118 104 [3]): <attribute> <name>attname1</name> <value>attvalue1</value> </attribute> <attribute> <name>attname2</name> ETSI ETSI TS 118 109 V4.4.1 (2023-12) 11 oneM2M TS-0009 version 4.4.1 Release 4 <value>attvalue2</value> </attribute> Each name (e.g. attname1 and attname2) shall represent a valid resource attribute name of the resource types indicated in the ty field of the query-string. The sequence of attribute elements as shown in the above example will be mapped into the query-string as attname1=attvalue1&attname2=attvalue2. The attribute names (i.e. attname1 and attname2 in the above example) shall be expressed in the form of short names as defined in clause 8.2.3 of ETSI TS 118 104 [3]. Note that the <attribute> tag of the XML representation is omitted in the HTTP binding. The 'childAttribute' and 'parentAttribute' elements of the Filter Criteria request primitive are handled in a similar way to the 'attribute' element. Those sequences of attribute elements will be mapped in the query string by adding a prefix to each attribute name respectively: 'c.' for 'childAttribute' and 'p.' for 'parentAttribute'. This results, using the example above, in the mappings as c.attname1=attvalue1&c.attname2=attvalue2 for 'childAttribute', and p.attname1=attvalue1&p.attname2=attvalue2 for 'parentAttribute'. Examples of valid Request-Target representations are the following: EXAMPLE 1: Request-Target for 'nonBlockingRequestSynch' Primitive parameters: To: /CSE1234/RCSE78/container234 (SP-Relative-Resource-ID) Response Type: responseType = 1 (nonBlockingRequestSynch) Result Persistence: P1Y2M3DT10H1M0S Request-Target: /CSE1234/RCSE78/container234?rt=1&rp=P1Y2M3DT10H1M0S EXAMPLE 2: Request-Target for Discovery When the entity wants to discover container resources where the creator attribute has the value 'Sam': Primitive parameters: To: /CSE1234/RCSE78 Filter Criteria: resourceType = 3 (container) attribute name: creator attribute value: Sam filterUsage = discovery Request-Target: /CSE1234/RCSE78?ty=3&cr=Sam&fu=1 EXAMPLE 3: Semantic Discovery The entity wants to discover resources whose semantic description stored in the descriptor attribute of a <semanticDescriptor> child resource fulfils the semantic filter specified in SPARQL. In this case, the semantic descriptor of the resource to discover has to contain information about a Thing of type Car based on the concept defined in the "myOnt" ontology. Due to the use of reserved characters in SPARQL, the semanticsFilter requires "percent-encoding" [Error! Reference source not found.]. Primitive parameters: To: /CSE1234/RCSE78 Filter Criteria: semanticsFilter = PREFIX rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns# PREFIX myOnt: http://www.onem2m.org/ontology/myontology# SELECT ?car WHERE { ?car rdf:type myOnt:Car } Request-Target: /CSE1234/RCSE78?smf=PREFIX%20rdf%3A%20%3Chttp%3A%2F%2 Fwww.w3.org%2F1999%2F02%2F22-rdf-syntax-ns%23%3E%20PREFI X%20myOnt%3A%20%3Chttp%3A%2F%2Fwww.onem2m.org%2Fonto logy%2Fmyontology%23%3E%20SELECT%20%3Fcar%20WHERE%20 %7B%20%3Fcar%20%20rdf%3Atype%20myOnt%3Acar%20%7D ETSI ETSI TS 118 109 V4.4.1 (2023-12) 12 oneM2M TS-0009 version 4.4.1 Release 4 EXAMPLE 4: Geo-query When an application wants to query a resource having its geo-location within the rectangle: Primitive parameters: To: /CSE1234/RCSE78 Filter Criteria: geometryType = 3 (Polygon) geometry = [[0.0, 0.0], [0.0, 100.0], [100.0, 100.0], [100.0, 0.0], [0.0, 0.0]] geoSpatialFunction = 1 (Within) filterUsage = discovery Request-Target: CSE1234/RCSE78?fu=1&gmty=3&geom=[[0.0,0.0],[0.0,100.0], [100.0,100.0], [100.0,0.0],[0.0,0.0]]&gsf=1 Note that, in the HTTP Request-Target, longitude and latitude are separated by an empty space and each pair of longitude and latitude are separated by comma. Any of the short names listed in table 6.2.2.2-1, with the exception of 'atr', may be used in the query-string. The short name 'atr' itself is not used. Instead, any of the resource attribute short names as listed in tables 8.2.3-1 to 8.2.3-5 in ETSI TS 118 104 [3] may be used in the query-string in representations of attname=attvalue expressions, except those that shall be omitted (see clause 7.3.3.17.9 in ETSI TS 118 104 [3]). ETSI ETSI TS 118 109 V4.4.1 (2023-12) 13 oneM2M TS-0009 version 4.4.1 Release 4 Table 6.2.2.2-1: oneM2M request parameters mapped as query-string field Request Primitive Parameter Query Field Name Multiplicity Note Response Type rt 0..1 responseType element of data type responseTypeInfo (cf. clause 6.3.4.29 of ETSI TS 118 104 [3]) Result Persistence rp 0..1 Result Content rcn 0..1 Delivery Aggregation da 0..1 Allowed values are boolean-typed parameter. 'false', 'true', '0' and '1' createdBefore crb 0..1 filterCriteria condition createdAfter cra 0..1 filterCriteria condition modifiedSince ms 0..1 filterCriteria condition unmodifiedSince us 0..1 filterCriteria condition stateTagSmaller sts 0..1 filterCriteria condition stateTagBigger stb 0..1 filterCriteria condition expireBefore exb 0..1 filterCriteria condition expireAfter exa 0..1 filterCriteria condition labels lbl 0..n filterCriteria condition resourceType ty 0..n filterCriteria condition sizeAbove sza 0..1 filterCriteria condition sizeBelow szb 0..1 filterCriteria condition contentType cty 0..n filterCriteria condition limit lim 0..1 filterCriteria condition attribute atr 0..n filterCriteria condition filterUsage fu 0..1 filterCriteria condition semanticsFilter smf 0..n filterCriteria condition, shall use "percent- encoding" [Error! Reference source not found.] where required, see example 3) filterOperation fo 0..1 filterCriteria condition contentFilterSyntax cfs 0..1 filterCriteria condition contentFilterQuery cfq 0..1 filterCriteria condition level lvl 0..1 filterCriteria condition offset ofst 0..1 filterCriteria condition geometryType gmty 0..1 filterCriteria condition geometry geom 0..1 filterCriteria condition geoSpatialFunction gsf 0..1 filterCriteria condition Discovery Result Type drt 0..1 Role IDs rids 0..n Token IDs tids 0..n LocalTokenIDs ltids 0..n Token Request Indicator tqi 0..n Allowed values are boolean-typed parameter. 'false', 'true', '0' and '1' Authorization Signature Indicator asi 0..1 Allowed values are boolean-typed parameter. 'false', 'true', '0' and '1' Authorization Relationship Indicator auri 0..1 Allowed values are boolean-typed parameter. 'false', 'true', '0' and '1' Semantic Query Indicator sqi 0..1 Allowed values are boolean-typed parameter. 'false', 'true', '0' and '1' For partial Retrieve request primitives, the To parameter may include the name of a single attribute separated by a '#' character from the resource ID. If multiple resource attributes are to be retrieved with a partial retrieve request primitive, these attributes are included in form of an attributeList object (as specified in table 6.3.3-1 of ETSI TS 118 104 [3]) in the Content parameter. In both cases, the short resource attribute name(s) shall be included into the fragment component of request-target, i.e. it shall follow any required query-string separated by '#' character. If more than a single attribute name is included into the fragment component, these shall be separated by a '+' character. For example, if three resource attributes with long names resourceID, labels and requestReachability are indicated in the Content primitive parameter, the query component atrl=ri+lbl+rr is attached to the request-target. In case just a single attribute "rr" is indicated in the To parameter separated by '#' character, the query component atrl=rr is attached to the request-target. The '#' character and following attribute name shall be omitted from the path component of the request line. ETSI ETSI TS 118 109 V4.4.1 (2023-12) 14 oneM2M TS-0009 version 4.4.1 Release 4 Case 1 Primitive Example: <?xml version="1.0" encoding="UTF-8"?> <m2m:rqp xmlns:m2m="http://www.onem2m.org/xml/protocols"> <op>1</op> <to>//example.net/myCSE/-/Cont1</to> <fr>/myCSE/C2345</fr> <rqi>0002bf63</rqi> <ty>4</ty> <pc> <atrl>ri lbl rr</atrl> </pc> </m2m:rqp> Case 1 HTTP Binding: //example.net/myCSE/-/Cont1?atrl=ri+lbl+rr Case 2 Primitive Example: <?xml version="1.0" encoding="UTF-8"?> <m2m:rqp xmlns:m2m="http://www.onem2m.org/xml/protocols"> <op>2</op> <to>//example.net/myCSE/-/Cont1#rr</to> <fr>/myCSE/C2345</fr> <rqi>0002bf63</rqi> <ty>4</ty> </m2m:rqp> Case 2 HTTP Binding: //example.net/myCSE/-/Cont1?atrl=rr At the HTTP server side, the reverse operation shall take place, when constructing the retrieve request primitive from the receive HTTP request message. Single attribute names in the query component may either be mapped back into the To parameter following a '#' character, or included into the Content parameter using the attributeList format with just a single list element included. Multiple attributes shall be included into the Content parameter as specified in ETSI TS 118 104 [3].
5884f20096a929755c7228996f24adba
118 109
6.2.3 HTTP-Version
This specification defines binding compliant with HTTP 1.1 [1]. The HTTP version field in HTTP request messages shall be set to "HTTP/1.1".