Tech-invite3GPPspaceIETFspace
21222324252627282931323334353637384‑5x

Content for  ETSI TS 102 221   PDF version:  18.2.0

Top   Top   Up   Prev   Next
0…   4…   5…   6…   7…   7.2.3…   7.3…   7.3.2…   7.4…   8…   9…   10…   10.2…   11…   11.1.2…   11.1.9…   11.1.14…   11.1.19…   11.1.20…   11.1.21…   11.2…   11.3…   12…   13…   14…   15   A   B   C…   D   E…   F…   G…   H…   I   J…   K…   L…   M…   N…   O…

 

7  Transmission protocolsp. 38

7.0  Introductionp. 38

The provisions of clause 7 apply to the LSE base with the following exceptions:
Clause 7 defines the transmission protocols used to exchange data between the terminal and the UICC. The structure and processing of commands initiated by the terminal for transmission control and for specific control in asynchronous half duplex transmission protocols will be described.
Two different protocols are defined, the character based protocol T = 0 and the block based protocol T = 1.
Both protocols T = 0 and T = 1 are mandatory for the terminal. The UICC shall support either T = 0 or T = 1 or both protocols. The protocols shall be supported as specified in the present document.
The protocol starts after either the answer to reset or a successful PPS exchange. Other parameters provided in the ATR and relevant to a specific protocol are defined in the respective parts of this clause.
The protocol applies a layering principle of the OSI-reference model. Four layers are considered. The layers are:
  • the physical layer. The contained definitions are valid for T = 0 and T = 1;
  • the data link layer, which consists of:
    • a character component;
    • a block component;
    • block identification;
    • send blocks;
    • detect transmission and sequence errors;
    • handle errors;
    • synchronize the protocol;
  • the transport layer, which defines the transmission of application-oriented messages specific to each protocol;
  • the application layer, which defines the exchange of messages according to an application protocol that is common to both protocols.
Reproduction of ETSI TS 31.ETSI-102-221, Fig. 7.1: Layers
Up

7.1  Physical layerp. 39

Both protocols T = 0 and T = 1 shall use the physical layer and character frame as defined in clause 7.2.1.

7.2  Data link layerp. 40

7.2.0  Introductionp. 40

This clause describes the timing, specific options and error handling for the protocols T = 0 and T = 1.

7.2.1  Character framep. 40

7.2.1.0  Structure, coding and timingp. 40

A character that is transmitted over the I/O line is embedded in a character frame.
Before the transmission of a character, the I/O line shall be in state H. Depending upon the convention used, the logical '1' in a character is either represented by state H on the I/O line, direct convention, or state L on the I/O line, inverse convention.
A character consists of 10 consecutive bits (see Figure 7.2):
  • 1 start bit in state L;
  • 8 bits, which comprise the data byte;
  • 1 even parity checking bit.
The parity bit is set, in a way, that there is an even number of bits set to '1' including the parity bit in the character frame.
The time origin is fixed as the mean between the last observation of state H and the first observation of state L. The receiver shall confirm the existence of a start bit before 0,7 etu (receiver time). Then the subsequent bits shall be received at intervals of (n + 0,5 ± 0,2) etu (n being the rank of the bit). The start bit is bit 1.
Within a character, the time from the leading edge of the start bit to the trailing edge of the nth bit is (n ± 0,2) etu.
The interval between the leading edges of the start bits of two consecutive characters comprises the character duration (10 ± 0,2) etu, plus a guardtime. Under error free transmission, during the guardtime both the UICC and the terminal shall be in reception mode (I/O line in state H), unless specified otherwise.
Reproduction of ETSI TS 31.ETSI-102-221, Fig. 7.2: Character frame
Up
The data shall always be passed over the I/O line with the most significant byte first. The order of bits within a byte (that is, whether the least significant or most significant bit is transferred first) is specified in character TS returned in the answer to reset (see ISO/IEC 7816-3 [11]).

7.2.1.1  Low impedance I/O line behaviourp. 40

If the low impedance driver on the I/O line has been selected, as the result of a successful PPS exchange, the following protocol on the I/O line applies.
The transmission state is defined as the period starting from the start bit of the first character to the end of the guardtime of the last character to transmit. During the transmission state the transmitter shall drive the I/O line to the desired level using the low impedance driver, with the exception of the error indication period, e.g. character guardtime of T = 0.
After reception of the last character in a command or response sequence when the communication direction is changed, the entity that is in turn to transmit, terminal or UICC, shall drive the I/O line to the high level using the low impedance driver during the interface inactivity period During clock stop the terminal shall drive the I/O line to high state.
The interface inactivity period ends when the transmission of a new command or its response starts.
Up

7.2.2  Transmission protocol T = 0p. 41

7.2.2.0  Introductionp. 41

The T = 0 is a half-duplex asynchronous character based transmission protocol.
All commands using the protocol T = 0 are initiated from the terminal by sending a five byte header, which informs the UICC what to do. The terminal will always act as master and the UICC as a slave. The direction of the transmission is assumed to be known to both the UICC and the terminal.

7.2.2.1  Timing and specific options for characters in T = 0p. 41

The minimum interval between the leading edge of the start bits of two consecutive characters shall be at least 12 etu.
The maximum interval between the start leading edge of any character sent by the UICC and the start leading edge of the previous character sent either by the UICC or the terminal is the WWT. The value of the WWT shall not exceed 960 × WI × Fi/f. WI is an integer received in the specific interface byte TC2. If no TC2 is available, default value of WI is 10. The clock rate conversion factor, Fi, and the baud rate conversion factor Di, may be indicated in TA1. If TA1 is absent the default values 372 and 1 respectively are used.
If the WWT is exceeded, the terminal shall initiate a deactivation within 960 etu.
Up

7.2.2.2  Command headerp. 41

A command is always initiated by the terminal which sends an instruction to the UICC in the form of a five byte-header called the command header. The command header comprises five consecutive bytes, CLA, INS, P1, P2 and P3.
These bytes together with any data to be sent with the command form the Command-Transport Protocol Data Unit (C-TPDU) for T = 0. The mapping of the C-APDU onto the C-TPDU is described in clause 7.3.
The terminal transmits the header to the UICC and waits for a procedure byte or a status byte.
Up

7.2.2.3  Command processingp. 41

7.2.2.3.0  General descriptionp. 41
When the UICC has received the command header, a response containing a procedure byte or a status byte shall be sent to the terminal. Both the terminal and the UICC shall be able to keep track of the direction of the data flow and who has the access to the I/O-line.
7.2.2.3.1  Procedure bytesp. 41
The procedure byte indicates to the terminal what action it shall take next.
Procedure bytes are used to keep up the communication between the terminal and the UICC. They shall not be transmitted to the application layer.
The coding of the procedure byte and the action that shall be taken by the terminal is shown in Table 7.1.
Byte Value Action
ACKEqual to INS byteAll remaining data bytes shall be transferred by the terminal, or the terminal shall be ready to receive all remaining data bytes from the UICC.
Equal to complement of INS byte (INS)The next data byte shall be transferred by the terminal, or the terminal shall be ready to receive the next data byte from the UICC.
NULL '60' The NULL-byte requests no further data transfer and the terminal shall only wait for a character conveying a procedure byte. This behaviour provides additional work waiting time as defined in this clause.
SW1 '61' The terminal shall wait for a second procedure byte then send a GET RESPONSE command header to the UICC with a maximum length of 'XX', where 'XX' is the value of the second procedure byte (SW2).
'6C' The terminal shall wait for a second procedure byte then immediately repeat the previous command header to the UICC using a length of 'XX', where 'XX' is the value of the second procedure byte (SW2).
After these actions, the terminal shall wait for a further procedure byte or status word.
Up
7.2.2.3.2  Status bytesp. 42
The status bytes SW1 SW2 form an end sequence indicating the status of the UICC at the end of a command. A normal ending of a command is indicating by SW1 SW2 = '90 00'.
Byte Value Action
SW1 '6X' or '9X'
(except '60', '61' and '6C')
The terminal shall wait for a further status word (SW2).
The terminal shall return the status words (together with any appropriate data) to the application layer and shall wait for another C-APDU.
Up

7.2.2.4  Error detection and correctionp. 42

The error detection and correction procedure is mandatory for T = 0 protocol except for the terminal during the ATR-procedure.
An error, from the receiver's point of view, is defined by an incorrect parity. The error is indicated on the I/O line, which is set to state L at (10,5 ± 0,2) etu after the leading edge of the start bit for the character. The I/O line shall be in state L for a maximum of 2 etu and a minimum of 1 etu. The transmitter shall check the I/O line for parity error indication at (11 ± 0,2) etu starting from the leading edge of the start bit, in the character being transmitted.
If the UICC or terminal as receiver detects a parity error in a character just received, it shall set the I/O line to state L at (10,5 ± 0,2) etu after the leading edge of the start bit for the character for a maximum of 2 etu to indicate the error to the sender (see Figure 7.2).
If the transmitter detects an error indication at (11 ± 0,2) etu starting from the leading edge of the start bit, in the character being transmitted, the character shall be sent again after a minimum delay of 2 etu.
Up

Up   Top   ToC