1、 ETSI TS 102 127 V6.13.0 (2009-04)Technical Specification Smart Cards;Transport protocol for CAT applications;Stage 2(Release 6)ETSI ETSI TS 102 127 V6.13.0 (2009-04)2Release 6 Reference RTS/SCP-T0015rc Keywords protocol, smart card, transport ETSI 650 Route des Lucioles F-06921 Sophia Antipolis Ced
2、ex - FRANCE Tel.: +33 4 92 94 42 00 Fax: +33 4 93 65 47 16 Siret N 348 623 562 00017 - NAF 742 C Association but non lucratif enregistre la Sous-Prfecture de Grasse (06) N 7803/88 Important notice Individual copies of the present document can be downloaded from: http:/www.etsi.org The present docume
3、nt may be made available in more than one electronic version or in print. In any case of existing or perceived difference in contents between such versions, the reference version is the Portable Document Format (PDF). In case of dispute, the reference shall be the printing on ETSI printers of the PD
4、F version kept on a specific network drive within ETSI Secretariat. Users of the present document should be aware that the document may be subject to revision or change of status. Information on the current status of this and other ETSI documents is available at http:/portal.etsi.org/tb/status/statu
5、s.asp If you find errors in the present document, please send your comment to one of the following services: http:/portal.etsi.org/chaircor/ETSI_support.asp Copyright Notification No part may be reproduced except as authorized by written permission. The copyright and the foregoing restriction extend
6、 to reproduction in all media. European Telecommunications Standards Institute 2009. All rights reserved. DECTTM, PLUGTESTSTM, UMTSTM, TIPHONTM, the TIPHON logo and the ETSI logo are Trade Marks of ETSI registered for the benefit of its Members. 3GPPTM is a Trade Mark of ETSI registered for the bene
7、fit of its Members and of the 3GPP Organizational Partners. LTE is a Trade Mark of ETSI currently being registered for the benefit of its Members and of the 3GPP Organizational Partners. GSM and the GSM logo are Trade Marks registered and owned by the GSM Association. ETSI ETSI TS 102 127 V6.13.0 (2
8、009-04)3Release 6 Contents Intellectual Property Rights 6g3Foreword . 6g31 Scope 7g32 References 7g32.1 Normative references . 7g32.2 Informative references 8g33 Definitions, symbols, abbreviations and coding conventions 8 g33.1 Definitions 8g33.2 Symbols 8g33.3 Abbreviations . 9g33.4 Coding convent
9、ions 9g34 Description . 9g35 CAT_TP layer 10g35.1 Data communication. 10g35.2 Segmentation management . 11g35.2.1 Segmentation and re-assembly . 11g35.2.1.1 N-SDU and N-PDU when segmentation is needed . 11g35.2.1.2 N-SDU and N-PDU when no segmentation 11g35.2.2 Limitations 12g35.2.3 CAT_TP segmentat
10、ion management 12g35.3 Transport management . 13g35.3.1 CAT_TP connection management 13g35.3.1.1 Opening a connection 13g35.3.1.2 Ports 13g35.3.1.3 Connection states 13g35.3.1.3.1 CLOSED state . 14g35.3.1.3.2 LISTEN state . 14g35.3.1.3.3 SYN-SENT state . 14g35.3.1.3.4 SYN-RCVD state 14g35.3.1.3.5 OP
11、EN state 15g35.3.1.3.6 CLOSE-WAIT state 15g35.3.1.4 Connection record . 15g35.3.1.4.1 STATE. 15g35.3.1.4.2 Variables for CAT_TP sending activity 15g35.3.1.4.3 Variables for CAT_TP receiving activity 15g35.3.1.4.4 Variables from current PDU 16g35.3.1.4.5 Variables from SYN PDU . 16g35.3.1.5 Closing a
12、 connection . 16g35.3.1.6 Detecting an Half-Open and/or inactive connection . 16g35.3.1.7 Version Number Management 16g35.3.2 Reliable Communication 17g35.3.2.1 Sequence number 17g35.3.2.2 Checksum 17g35.3.2.3 Positive acknowledgement of PDUs . 17g35.3.2.4 Retransmission timeout . 18g35.3.3 Flow con
13、trol and window management 18g35.4 Events processing . 19g35.4.1 Upper layer events 20g35.4.1.1 Open request . 20g35.4.1.2 Close request . 22g35.4.1.3 Receive request . 25g35.4.1.4 Send request 27g35.4.2 PDU arrival events 31g3ETSI ETSI TS 102 127 V6.13.0 (2009-04)4Release 6 5.4.2.1 Initial state: C
14、LOSE 31g35.4.2.2 Initial state: OPEN 32g35.4.2.3 Initial state: LISTEN . 36g35.4.2.4 Initial state: SYN-SENT . 37g35.4.2.5 Initial state: SYN-RCVD 38g35.4.2.6 Initial state: CLOSE-WAIT 41g35.4.3 Timeout events 41g35.4.3.1 Retransmission timeout . 42g35.4.3.2 Close-wait timeout 43g35.5 Identification
15、 43g35.6 CAT_TP header format 44g35.6.1 First octet 45g35.6.2 Header length 45g35.6.3 Source and destination ports . 45g35.6.4 Data length 46g35.6.5 Sequence number 46g35.6.6 Acknowledgement number . 46g35.6.7 Window size . 46g35.6.8 Checksum . 46g35.6.9 Variable header area . 46g35.6.10 RFU field 4
16、6g35.7 SYN PDU . 47g35.7.1 SYN PDU fields . 47g35.7.1.1 Data length 47g35.7.1.2 Sequence number 47g35.7.1.3 Acknowledgment number . 47g35.7.1.4 Maximum PDU size 48g35.7.1.5 Maximum SDU size 48g35.7.1.6 Identification . 48g35.8 ACK PDU 48g35.8.1 ACK PDU field . 49g35.8.1.1 Data length 49g35.8.1.2 Seq
17、uence number 49g35.8.1.3 Acknowledgment number . 49g35.9 EACK PDU 50g35.9.1 EACK PDU Field . 51g35.9.1.1 Data length 51g35.9.1.2 Sequence number 51g35.9.1.3 Acknowledgment number . 51g35.9.1.4 Variable header area 51g35.10 RST PDU 51g35.10.1 RST PDU fields 52g35.10.1.1 Data length 52g35.10.1.2 Seque
18、nce number 52g35.10.1.3 Acknowledgment number . 52g35.10.1.4 Reason code 52g35.11 NUL PDU . 53g35.11.1 NUL PDU fields . 53g35.11.1.1 Data length 53g35.11.1.2 Sequence number 53g35.11.1.3 Acknowledgment number . 53g35.11.1.4 Variable header area 53g35.12 Header flags combinations . 54g36 Implementati
19、on on BIP 55g36.1 Sending and receiving data . 55g36.2 Timers 55g3Annex A (informative): Scenarios examples 56g3A.1 Connection establishment. 56g3A.2 Lost PDUs 56g3ETSI ETSI TS 102 127 V6.13.0 (2009-04)5Release 6 A.3 PDUs received out of order 57g3A.4 Communication over long delay path. 57g3A.5 Comm
20、unication over long delay path with lost PDUs . 58g3A.6 Detecting a half open connection on crash recovery 58g3A.7 Detecting a half open connection from the active side . 59g3A.8 Dynamic window management 59g3Annex B (informative): CAT_TP-Upper layer interface definition . 61g3B.1 OPEN . 61g3B.2 Sen
21、d 62g3B.3 Receive . 62g3B.4 CLOSE . 62g3B.5 Status 63g3Annex C (informative): Change history . 64g3History 67g3ETSI ETSI TS 102 127 V6.13.0 (2009-04)6Release 6 Intellectual Property Rights IPRs essential or potentially essential to the present document may have been declared to ETSI. The information
22、 pertaining to these essential IPRs, if any, is publicly available for ETSI members and non-members, and can be found in ETSI SR 000 314: “Intellectual Property Rights (IPRs); Essential, or potentially Essential, IPRs notified to ETSI in respect of ETSI standards“, which is available from the ETSI S
23、ecretariat. Latest updates are available on the ETSI Web server (http:/webapp.etsi.org/IPR/home.asp). Pursuant to the ETSI IPR Policy, no investigation, including IPR searches, has been carried out by ETSI. No guarantee can be given as to the existence of other IPRs not referenced in ETSI SR 000 314
24、 (or the updates on the ETSI Web server) which are, or may be, or may become, essential to the present document. Foreword This Technical Specification (TS) has been produced by ETSI Technical Committee Smart Card Platform (SCP). The contents of the present document are subject to continuing work wit
25、hin TC SCP and may change following formal TC SCP approval. If TC SCP modifies the contents of the present document, it will then be republished by ETSI with an identifying change of release date and an increase in version number as follows: Version x.y.z where: x: the first digit: 0 early working d
26、raft; 1 presented to TC SCP for information; 2 presented to TC SCP for approval; 3 or greater indicates TC SCP approved document under change control. y: the second digit is incremented for all changes of substance, i.e. technical enhancements, corrections, updates, etc. z: the third digit is increm
27、ented when editorial only changes have been incorporated in the document. ETSI ETSI TS 102 127 V6.13.0 (2009-04)7Release 6 1 Scope The present document defines the stage two description of the Card Application Toolkit Transport Protocol (CAT_TP), for CAT applications based on TS 102 223 2. The prese
28、nt document contains the core functionalities for the CAT_TP between two CAT_TP entities hosting for instance on a UICC and on a remote entity. The CAT_TP described in the present document is based on RDP version 2 as specified in RFC 908 4 and RFC 1151 5. The present document describes, according r
29、equirements defined in TS 102 124 1: The core functionalities of CAT_TP (data structures, state diagrams, protocol procedures, etc.). Usage of CAT_TP on top of the Bearer Independent Protocol (BIP). The following items are out of the scope of the present document: The specific implementation of an A
30、PI. Anything dealing with the security above CAT_TP. 2 References References are either specific (identified by date of publication and/or edition number or version number) or non-specific. For a specific reference, subsequent revisions do not apply. In the case of a reference to a TC SCP document,
31、a non specific reference implicitly refers to the latest version of that document in the same Release as the present document. Non-specific reference may be made only to a complete document or a part thereof and only in the following cases: - if it is accepted that it will be possible to use all fut
32、ure changes of the referenced document for the purposes of the referring document; - for informative references. Referenced documents which are not found to be publicly available in the expected location might be found at http:/docbox.etsi.org/Reference. NOTE: While any hyperlinks included in this c
33、lause were valid at the time of publication ETSI cannot guarantee their long term validity. 2.1 Normative references The following referenced documents are indispensable for the application of the present document. For dated references, only the edition cited applies. For non-specific references, th
34、e latest edition of the referenced document (including any amendments) applies. 1 ETSI TS 102 124: “Smart Cards; Transport Protocol for UICC based Applications; Stage 1 (Release 6)“. 2 ETSI TS 102 223: “Smart Cards; Card Application Toolkit (CAT) (Release 7)“. 3 IETF RFC 793 (1981): “Transmission Co
35、ntrol Protocol“. 4 IETF RFC 908 (1984): “Reliable Data Protocol“. ETSI ETSI TS 102 127 V6.13.0 (2009-04)8Release 6 5 IETF RFC 1151 (1990): “Version 2 of the Reliable Data Protocol (RDP)“. 2.2 Informative references The following referenced documents are not essential to the use of the present docume
36、nt but they assist the user with regard to a particular subject area. For non-specific references, the latest version of the referenced document (including any amendments) applies. Not applicable. 3 Definitions, symbols, abbreviations and coding conventions 3.1 Definitions For the purposes of the pr
37、esent document, the following terms and definitions apply: Bearer Independent Protocol (BIP): mechanism by which the TE provides the UICC with access to the data bearers supported by the terminal and the network, as defined in TS 102 223 2 CAT_TP client: entity which initiates a CAT_TP link to the C
38、AT_TP server, and applies during the connection phase only NOTE: It could be on the UICC or on the remote entity. CAT_TP entity: entity able to open a CAT_TP link, exchange CAT_TP PDUs, and close the CAT_TP link CAT_TP link: logical link between CAT_TP entities over which CAT_TP PDUs are exchanged C
39、AT_TP Port: this 16-bit identifier is used to identify the CAT_TP upper layer process CAT_TP server: entity which receives a CAT_TP link establishment request from a CAT_TP client, and applies during the connection phase only NOTE: It could be on the UICC or on the remote entity. CAT_TP service data
40、 unit: in the reference model for OSI, amount of information whose identity is preserved when transferred between peer (N+1)-layer entities and which is not interpreted by the supporting (N)-layer entities NOTE: Here (N)-layer is the CAT_TP layer. lower layer: within consideration a (N)-layer, the l
41、ower layer is the just below layer which is the (N-1)-layer NOTE: For the CAT_TP, the lower layer may be the Physical layer. physical link: composed of the Bearer Independent Protocol channel between the UICC and the TE and a bearer specific link between the TE and the remote entity upper layer: wit
42、hin consideration a (N)-layer, the upper layer is the just above layer which is the (N+1)-layer NOTE: For the CAT_TP, the upper layer may be the Application layer. 3.2 Symbols For the purposes of the present document, the following symbols apply: 0 to 9 and A to F are the sixteen hexadecimal digits.
43、 ETSI ETSI TS 102 127 V6.13.0 (2009-04)9Release 6 3.3 Abbreviations For the purposes of the present document, the following abbreviations apply: ACK ACKnowledgement BIP Bearer Independent Protocol CAT Card Application Toolkit CAT_TP Card Application Toolkit Transport Protocol FFS For Further Study L
44、SB Least Significant Bit MSB Most Significant Bit OSI Open System Interconnection PDU Protocol Data Unit RFU Reserved for Further Use RST ReSeT SDU Service Data Unit TE Terminal Equipment 3.4 Coding conventions For the purposes of the present document, the following coding conventions apply: All len
45、gths are presented in bytes, unless otherwise stated. Each byte is represented by bits b8 to b1, where b8 is the Most Significant Bit (MSB) and b1 is the Least Significant Bit (LSB). In each representation, the leftmost bit is the MSB. All bytes specified as RFU shall be set to00 and all bits specif
46、ied as RFU shall be set to 0. 4 Description The CAT_TP is a transport protocol providing the UICC with a reliable data transmission with a remote entity. Main actors of the environment are the UICC, the TE and the remote entity. Figure 1: Environment description The CAT_TP protocol provides followin
47、g functionalities: CAT_TP provides a full-duplex communications channel between the two ports of each transport connection. CAT_TP reliably delivers all upper layer data and reports any failure to the upper layer. CAT_TP attempts to detect and discard all damaged and duplicated PDUs. CAT_TP provides
48、 sequenced delivery of SDUs. Out of sequence delivery of SDUs is FFS. CAT_TP segments large SDUs into PDUs on a CAT_TP sending entity and re-assembles segmented PDUs into SDUs on a CAT_TP receiving entity. ETSI ETSI TS 102 127 V6.13.0 (2009-04)10Release 6 The CAT_TP ensures an end to end reliable da
49、ta communication between the UICC and a remote entity over UDP/IP or other networks. IP UDP ISO 7816-3/4 IP UDP CAT_TP Upper Layer(s) User Equipment Remote entity CAT_TP Upper Layer(s) TE UICC SCP 102 223 BIP SCP 102 221 BIP ISO 7816-3/4 SCP 102 223 SCP 102 221 IP Network Figure 2: CAT_TP layer position 5 CAT_TP layer The present clause describes the core protocol. The CAT_TP layer is composed of two entities. Transport Management Segmentation Management CAT_TP layer Figure 3: CAT_TP layer description 5.1 Data communicati