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.3  Transport layerp. 50

7.3.0  Introductionp. 50

This clause describes how the APDU are transported between the terminal and the UICC. For definition of the cases for Data in APDUs see clause 7.4.

7.3.1  Transportation of an APDU using T = 0p. 50

7.3.1.0  Introductionp. 50

This clause describes the mapping of C-APDUs and R-APDUs for T = 0 protocol, the APDU exchange and the use of the GET RESPONSE command for case 2 and case 4.

7.3.1.1  Mapping of APDUs to TPDUsp. 50

7.3.1.1.0  General behaviourp. 50
The mapping of the C-APDU onto the T = 0 command header is dependent upon the case of the command. The mapping of the data (if present) and status returned by the UICC onto the R-APDU is dependent upon the length of the data returned.
Procedure bytes '61XX' and '6CXX' are returned by the UICC to control exchanges between the transport layer of the terminal and the UICC, and should never be returned to the application layer of the terminal. Command processing in the UICC is not complete if it has returned procedure bytes '61XX' or '6CXX'.
Normal status on completion of processing a command is indicated if the UICC returns status words '9000' to the transport layer of the terminal. The transport layer of the terminal shall discontinue processing of a command (i.e. pass the R-APDU to the application layer and wait for a further C-APDU from the application layer) on receipt of any status words (but not on receipt of procedure bytes '61xx' and '6Cxx') from the UICC. For case 4 commands only, immediately following successful transmission of command data to the UICC, the transport layer of the terminal shall continue processing the command if warning status bytes ('62xx' or '63xx', with the specific case of '6282' response for SEARCH RECORD command being described in the corresponding section) or application related status bytes ('9xxx' except '9000') are received.
The following descriptions of the mapping of data and status returned by the UICC onto the R-APDU are for information, and apply only after the UICC has completed processing of the command, successfully or otherwise, and all data (if present) has been returned by the UICC under the control of '61XX' and '6CXX' procedure bytes. Detailed use of the INS, INS, and '60' procedure bytes is not described.
The status returned by the UICC shall relate to the most recently received command. Where a GET RESPONSE command is used to complete the processing of a case 2 or case 4 command, any status returned by the UICC after receipt of the GET RESPONSE command shall relate to GET RESPONSE command, not to the case 2 or case 4 command which it completes.
Up
7.3.1.1.1  Case 1p. 50
The C-APDU is mapped onto the C-TPDU by assigning the value '00' to the body part (P3 = '00').
Reproduction of ETSI TS 31.ETSI-102-221, Fig. 7.6:
Up
The flow of the exchange is as follows:
  1. The transport layer of the terminal shall send the T = 0 command header to the UICC.
  2. On receipt of the command header the UICC, under normal or abnormal processing, shall return status to the transport layer of the terminal.
    The UICC shall analyse the T = 0 command header to determine whether it is processing a case 1 command or a case 2 command requesting all data up to the maximum length available.
  3. On receipt of status from the UICC, the transport layer of the terminal shall discontinue processing of the command.
See Annex C for details of the exchanges between the transport layer of the terminal and the UICC.
The status words returned to the transport layer of the terminal from the UICC after completion of processing of the command are mapped onto the mandatory trailer of the R-APDU without change.
Up
7.3.1.1.2  Case 2p. 51
The C-APDU is mapped onto the C-TPDU without any change.
Reproduction of ETSI TS 31.ETSI-102-221, Fig. 7.7:
Up
The flow of the exchange is as follows:
  1. The transport layer of the terminal shall send the T = 0 command header to the UICC.
  2. On receipt of the command header the UICC:
    1. under normal processing shall return data and status to the transport layer of the terminal. The UICC shall use procedure bytes '6Cxx' (and if required, procedure bytes '61xx') to control the return of data (see below); or
    2. under abnormal processing shall return status only to the transport layer of the terminal.
  3. On receipt of the data (if present) and status from the UICC, the transport layer of the terminal shall discontinue processing the command.
See Annex C for details of the exchanges between the transport layer of the terminal and the UICC, including use of the '61XX' and '6CXX' procedure bytes.
The R-TPDU is mapped onto the R-APDU without any change.
The data (if present) and status returned to the transport layer of the terminal from the UICC after completion of processing of the command are mapped onto the R-APDU as follows:
  • The data returned (if present) is mapped onto the conditional body of the R-APDU. If no data is returned, the
    conditional body of R-APDU is left empty.
  • The status returned is mapped onto the mandatory trailer of the R-APDU without change.
Up
7.3.1.1.3  Case 3p. 52
The C-APDU is mapped onto the C-TPDU without any change. Lc is a value between 1 and 255.
Reproduction of ETSI TS 31.ETSI-102-221, Fig. 7.8:
Up
The flow of the exchange is as follows:
  1. The transport layer of the terminal shall send the T = 0 command header to the UICC.
  2. On receipt of the command header, if the UICC:
    1. returns a procedure byte, the transport layer of the terminal shall send the data portion of the conditional body of the C-APDU to the UICC under the control of procedure bytes returned by the UICC; or
    2. returns status, the transport layer of the terminal shall discontinue processing of the command.
  3. If processing was not discontinued in step 2b), the UICC shall return status following receipt of the conditional body of the C-APDU and completion of processing the command.
  4. On receipt of status from the UICC, the transport layer of the terminal shall discontinue processing the command.
See Annex C for details of the exchanges between the transport layer of the terminal and the UICC.
The status words returned to the transport layer of the terminal from the UICC after completion of processing of the command, or the status words returned by the UICC that caused the transport layer of the terminal to discontinue processing of the command, are mapped onto the R-APDU without change.
Up
7.3.1.1.4  Case 4p. 52
The C-APDU is mapped onto the C-TPDU by cutting off the last byte (Le) of the body.
Reproduction of ETSI TS 31.ETSI-102-221, Fig. 7.9:
Up
The flow of the exchange is as follows:
  1. The transport layer of the terminal shall send the T = 0 command header to the UICC.
  2. On receipt of the command header, if the UICC:
    1. returns a procedure byte, the transport layer of the terminal shall send the data portion of the conditional body of the C-APDU to the UICC under the control of procedure bytes returned by the UICC; or
    2. returns status, the transport layer of the terminal shall discontinue processing of the command.
  3. If processing was not discontinued in step 2b), following receipt of the conditional body of the C-APDU, the UICC:
    1. under normal processing, shall return procedure bytes '61xx' to the transport layer of the terminal requesting the transport layer of the terminal to issue a GET RESPONSE command to retrieve the data from the UICC; or
    2. under abnormal processing, shall return status only to the transport layer of the terminal.
  4. On receipt of the procedure bytes or status returned in step 3), if the UICC:
    1. returned '61xx' procedure bytes as in step 3a), the transport layer of the terminal shall send a GET RESPONSE command header to the UICC with P3 set to a value less than or equal to the value contained in the 'xx' byte of '61xx' procedure bytes; or
    2. returned status as in step 3b) that indicates a warning ('62xx' or '63xx', with the specific case of '6282' response for SEARCH RECORD command being described in the corresponding section), or which is application related ('9xxx' but not '9000'), the transport layer of the terminal shall send a GET RESPONSE command with Le = '00'; or
    3. returned status as in step 3b) other than that described in step 4b), the transport layer of the terminal shall discontinue processing of the command.
  5. If processing was not discontinued in step 4c), the GET RESPONSE command shall be processed according to the rules for case 2 commands.
The first R-TPDU from the UICC indicates that the UICC performed the command correct and that the UICC has more data of length Luicc bytes to transfer. The first R-TPDU is mapped without any changes onto the R-APDU.
See Annex C for details of the exchanges between the transport layer of the terminal and the UICC, including use of the '61XX' and '6CXX' procedure bytes.
Up
7.3.1.1.5  Use of procedure bytes '61xx' and '6Cxx'p. 53
7.3.1.1.5.0  Overall descriptionp. 53
The UICC returns procedure bytes '61xx 'and '6Cxx' to the transport layer of the terminal to indicate to it the manner in which it should retrieve the data requested by the command currently being processed. These procedure bytes are only used when processing case 2 and 4 commands using T = 0.
Procedure bytes '61xx' instruct the transport layer of the terminal to issue a GET RESPONSE command to the UICC. P3 of the GET RESPONSE command header is set to 'xx'.
Procedure bytes '6Cxx' instruct the transport layer of the terminal to immediately resend the previous command header setting P3 = 'xx'.
Usage of these procedure bytes during error free processing with case 2 and 4 commands is as defined in clauses 7.3.1.1.5.1 and 7.3.1.1.5.2. In the case of an error, the UICC may return status indicating error or warning conditions instead of the '61xx' or '6Cxx' response.
Up
7.3.1.1.5.1  Case 2 commandsp. 53
  1. If the UICC receives a case 2 command header and Le = '00' (with Luicc < 256 bytes) or Le > Luicc, it shall return:
    1. procedure bytes '6C Luicc' instructing the transport layer of the terminal to immediately resend the command header with P3 = Luicc; or
    2. status indicating a warning or error condition (but not SW1 SW2 = '90 00').
  2. If the UICC receives a case 2 command header and Le = '00' (with Luicc = 256 bytes) or Le = Luicc, it shall return:
    1. data of length Le (= Luicc) under the control of the INS, INS, or '60' procedure bytes followed by the associated status; or
    2. procedure bytes '61xx' instructing the transport layer of the terminal to issue a GET RESPONSE command with a maximum length of 'xx', 'xx' being less than Luicc (this could happen if the card buffer size is smaller than Luicc); or
    3. status indicating a warning or error condition (but not SW1 SW2 = '90 00').
  3. If the UICC receives a case 2 command header and Le < Luicc it shall return:
    1. data of length Le under the control of the INS, INS, or '60' procedure bytes followed by procedure bytes '61xx' instructing the transport layer of the terminal to issue a GET RESPONSE command with a maximum length of 'xx'; or
    2. status indicating a warning or error condition (but not SW1 SW2 = '90 00').
Up
7.3.1.1.5.2  Case 4 commandsp. 53
If the UICC receives a case 4 command, after processing the data sent with the C-APDU, it shall return:
  1. procedure bytes '61 xx' instructing the transport layer of the terminal to issue a GET RESPONSE command with a maximum length of 'xx'; or
  2. status indicating a warning or error condition (but not SW1 SW2 = '90 00').
The GET RESPONSE command so issued is then treated as described for case 2 commands.

Up   Top   ToC