13 Ciphering
3GPP44.160General Packet Radio Service (GPRS)Mobile Station (MS) - Base Station System (BSS) interfaceRadio Link Control / Medium Access Control (RLC/MAC) protocol Iu modeRelease 16TS
13.1 General
The ciphering function is performed either in the RLC sublayer or in the MAC sublayer according to the following rules:
– The RLC sublayer is responsible for ciphering/deciphering RLC data blocks in case of non-transparent RLC mode (unacknowledged or acknowledged).
– The MAC sublayer is responsible for ciphering/deciphering user data in case of transparent RLC mode. It is also responsible for ciphering/deciphering some RLC/MAC control messages.
The ciphering function shall use the ciphering algorithm f8 specified in 3GPP TS 35.201. Four input parameters are necessary to configure the ciphering algorithm:
– Ciphering key: the 128-bit ciphering key is received from RRC by means of interlayer primitive.
– Bearer: the 5-bit bearer indicates, when available, the radio bearer identity of the radio bearer to cipher. It is received from RRC by means of interlayer primitive.
– Direction: the 1-bit direction indicates the direction of transmission, uplink or downlink, of the flow to cipher.
– Count: the 32-bit count is used to ensure that the blocks of a same flow are all ciphered differently.
A fifth parameter, Length, is used to indicate the length in bits of the plain data to cipher. Plain, ciphered and deciphered data are of the same length. Length is not input to the ciphering algorithm.
13.2 Applicability of ciphering
Ciphering may apply only between the mobile station and the serving BSS when contention resolution is successfully completed, i.e. uplink data (respectively downlink data) between the mobile station and the serving BSS may be ciphered after contention is successfully completed on mobile station side (respectively serving BSS side).
13.3 Ciphering at RLC sublayer
13.3.1 General
The RLC sublayer is responsible for ciphering/deciphering RLC data blocks in case of non-transparent RLC mode (unacknowledged or acknowledged).
For a given radio bearer, ciphering/deciphering is ordered by RRC by means of the CRLC-CONFIG-Req primitive containing the necessary ciphering elements (see sub-clause 4.3.3). Upon receipt of the CRLC-CONFIG-Req primitive containing the ciphering elements, ciphering shall be performed at RLC sublayer according to these ciphering elements for the corresponding radio bearer. Ciphering shall not be performed at RLC sublayer otherwise.
13.3.2 Parameter settings
13.3.2.1 Input parameters to the ciphering algorithm
Table 13.3.2.1.1 defines how to set the input parameters to the ciphering algorithm.
Table 13.3.2.1.1: Input parameters to the ciphering algorithm
Input parameters |
Size in bits |
Settings |
|||||
TBF mode (see note 1) |
DCCH |
TCH |
GPRS |
EGPRS |
|||
Count |
32 |
MSB |
HFN (see note 2) |
27 bits 0…134217727 |
23 bits 0…8388607 |
24 bits 0…16777215 |
20 bits 0…1048575 |
RBid indicator |
1 bit 1 (RBid available) |
||||||
LSB |
BSN |
4 bits 0…15 |
8 bits 0…255 |
7 bits 0…127 |
11 bits 0…2047 |
||
Direction |
1 |
Direction |
1 bit 0 (uplink) 1 (downlink) |
||||
Bearer |
5 |
RBid |
5 bits 0…31 |
||||
Length |
10 |
Length in bits of the plain data to cipher |
10 bits 0…592 |
||||
NOTE 1: Four cases are distinguished as per the format of the BSN used in the RLC data block to cipher, according to the TBF mode: DCCH TBF mode, TCH TBF mode, GPRS TBF mode and EGPRS TBF mode. NOTE 2: The handling of the HFN is described in sub-clause 13.3.2.2. NOTE 3: The values in italic represent the range for a given parameter. |
Table 13.3.2.1.2: Input parameters to the ciphering algorithm (FLO)
Input parameters |
Size in bits |
Settings |
||||
TBF mode (see note 1) |
UDCH (RLC AM) |
UDCH (RLC UM) |
CDCH |
|||
Count |
32 |
MSB |
HFN (see note 2) |
21 bits 0…2097171 |
See DCCH TBF Mode |
|
RBid indicator |
1 bit 1 (RBid available) |
|||||
LSB |
BSN |
10 bits 0…1023 |
||||
Direction |
1 |
Direction |
1 bit 0 (uplink) 1 (downlink) |
|||
Bearer |
5 |
RBid |
5 bits 0…31 |
|||
Length |
10 |
Length in bits of the plain data to cipher |
11 bits 0…1370 |
|||
NOTE 1: Four cases are distinguished as per the format of the BSN used in the RLC data block to cipher, according to the TBF mode: UDCH TBF mode, CDCH TBF mode. NOTE 2: The handling of the HFN is described in sub-clause 13.3.2.2. NOTE 3: The values in italic represent the range for a given parameter. |
13.3.2.2 Handling of the HFN
The HFN is radio bearer specific.
In RLC acknowledged mode, the HFN used at retransmission of an RLC data block shall be the same as the one used at original transmission of this RLC data block.
The HFN shall be increased by one at every cycle of the BSN, when the BSN reaches 0.
Further handling of the HFN is described in 3GPP TS 44.118.
13.3.3 Ciphering of RLC PDUs in non-transparent RLC mode
Ciphering may only apply on the payload of the RLC PDUs. For instance, if MCS-9 is used, only the 592 bits of the payload of each of the two RLC data blocks in the RLC/MAC block may be ciphered.
13.4 Ciphering at MAC sublayer
13.4.1 General
The MAC sublayer is responsible for ciphering/deciphering user data in case of transparent RLC mode. It is also responsible for ciphering some RLC/MAC control messages.
For a given radio bearer, ciphering/deciphering is ordered by RRC by means of the CMAC-CONFIG-Req primitive containing the necessary ciphering elements (see sub-clause 4.3.4). Upon receipt of the CMAC-CONFIG-Req primitive containing the ciphering elements, ciphering/deciphering shall be performed at MAC sublayer according to these ciphering elements for the corresponding radio bearer. Ciphering shall not be performed at MAC sublayer otherwise.
13.4.2 Parameter settings
13.4.2.1 Input parameters to the ciphering algorithm
Table 13.4.2.1.1 defines how to set the input parameters to the ciphering algorithm in case of transparent RLC mode.
Table 13.4.2.1.1: Input parameters to the ciphering algorithm
for layer 2 data in transparent RLC mode
Input parameters |
Size in bits |
Settings |
||
Count |
32 |
MSB |
HFN (see note 1) |
11 bits 0…2047 |
TDMA Frame Number (see note 2) |
17 bits |
|||
RBid indicator |
1 bit 1 (RBid available) |
|||
LSB |
Timeslot number |
3 bits 0…7 |
||
Direction |
1 |
Direction |
1 bit 0 (uplink) 1 (downlink) |
|
Bearer |
5 |
RBid |
5 bits 0…31 |
|
Length |
N |
Length in bits of the plain data to cipher |
Size of the RLC PDU (see note 3) |
|
NOTE 1: The handling of the HFN is described in sub-clause 13.4.2.2.1. NOTE 2: The 17-bit TDMA Frame Number is described below. NOTE 3: In transparent RLC mode, the size of an RLC PDU equals that of the RLC SDU it carries. NOTE 4: The values in italic represent the range for a given parameter. |
Table 13..4.2.1.2 defines how to set the input parameters to the ciphering algorithm for ciphering of RLC/MAC control messages. The rules for ciphering RLC/MAC control messages are given in sub-clause 13.4.3.
Table 13.4.2.1.2: Input parameters to the ciphering algorithm for RLC/MAC control messages
Input parameters |
Size in bits |
Settings |
||
Count |
32 |
MSB |
HFN (see note 1) |
11 bits 0…2047 |
TDMA Frame Number (see note 2) |
17 bits |
|||
RBid indicator |
1 bit 0 (RBid not available) |
|||
LSB |
Timeslot number |
3 bits 0…7 |
||
Direction |
1 |
Direction |
1 bit 0 (uplink) 1 (downlink) |
|
Bearer |
5 |
RBid |
5 bits "00000" |
|
Length |
9 |
Length in bits of the plain data to cipher |
9 bits 0…368 (see note 3) |
|
NOTE 1: The handling of the HFN is described in sub-clause 13.4.2.2.2. NOTE 2: The 17-bit TDMA Frame Number is described below. NOTE 3: The length in bits of the plain data to cipher can be derived from the rules given in sub-clause 13.4.3 on a per RLC/MAC control message basis. NOTE 4: The values in italic represent the range for a given parameter. |
The 17-bit TDMA Frame Number is constructed as follows:
Bit |
||||||||||||||||
17 |
16 |
15 |
14 |
13 |
12 |
11 |
10 |
9 |
8 |
7 |
6 |
5 |
4 |
3 |
2 |
1 |
T1′ |
T2 |
T3 |
Figure 13.4.2.1.1: 17-bit TDMA Frame Number
T1′ (6 bits) range 0 to 63 = T1 mod 64.
T2 (5 bits) range 0 to 25 = FN mod 26 as defined in 3GPP TS 45.002.
T3 (6 bits) range 0 to 50 = FN mod 51 as defined in 3GPP TS 45.002.
where
T1 = FN div (26 x 51) as defined in 3GPP TS 45.002.
and
FN = TDMA frame number as defined in 3GPP TS 45.002.
13.4.2.2 Handling of the HFN
13.4.2.2.1 Ciphering in transparent RLC mode
The HFN is radio bearer specific. It shall obey the following rules for the lifetime of the corresponding radio bearer:
– It shall be incremented by 1 every time the TDMA Frame Number is smaller than the previous one.
– It shall also be incremented by 1 at every cell change.
Further handling of the HFN is described in 3GPP TS 44.118.
13.4.2.2.2 Ciphering of RLC/MAC control messages
The HFN presented in table 13.3 shall obey the following rules:
– It shall be reset to START value every time a new authentication is made.
– During an RRC connection:
– It shall be incremented by 1 every time the TDMA Frame Number is smaller than the previous one.
– It shall also be incremented by 1 at every cell change.
– It shall be incremented by 1 at every new RRC connection and notified to the network at RRC connection set-up see 3GPP TS 44.118.
13.4.3 Ciphering of RLC/MAC control messages
The following RLC/MAC control messages may be ciphered:
– PACKET RESOURCE REQUEST, PACKET UPLINK ASSIGNMENT, MULTIPLE TBF UPLINK ASSIGNMENT, PACKET DOWNLINK ASSIGNMENT, MULTIPLE TBF DOWNLINK ASSIGNMENT, PACKET DBPSCH ASSIGNMENT, PACKET UPLINK ACK/NACK, PACKET DBPSCH UPLINK ACK/NACK, PACKET DBPSCH UPLINK ACK/NACK TYPE 2, PACKET DOWNLINK ACK/NACK, EGPRS PACKET DOWNLINK ACK/NACK, PACKET DBPSCH DOWNLINK ACK/NACK, PACKET DBPSCH DOWNLINK ACK/NACK TYPE 2, PACKET TIMESLOT RECONFIGURE, MULTIPLE TBF TIMESLOT RECONFIGURE, PACKET TBF RELEASE and PACKET CELL CHANGE ORDER, PHYSICAL INFORMATION.
NOTE 1: This list should be updated according to the RLC/MAC development i.e. if new messages are created or if some of the messages in this list are no more applicable to Iu mode. The list of Fields and IEs in the table below will also be updated according to the RLC/MAC development.
Within these messages, all CSN-1 syntax bits shall be kept unciphered. Furthermore, the ciphering of these messages shall obey the rules given in table 13.4.3.1.
NOTE 2: An informative annex will be introduced to illustrate an example of ciphering of an RLC/MAC control message.
Table 13.4.3.1: Ciphering of RLC/MAC control messages
RLC/MAC Control Message |
Direction |
Fields and IEs that shall be kept unciphered |
Packet Resource Request |
Uplink |
Message type, GLOBAL_TFI, Length of MS RA capabilities, Length |
Packet Uplink Assignment |
Downlink |
Message type, PAGE_MODE, PERSISTENCE_LEVEL, GLOBAL_TFI, TLLI/G-RNTI, G-RNTI extension, TQI, Length of MA Frequency List contents, MA_LENGTH |
Multiple TBF Uplink Assignment |
Downlink |
Message type, PAGE_MODE, PERSISTENCE_LEVEL, GLOBAL_TFI, TLLI/G-RNTI, G-RNTI extension |
Packet Downlink Assignment |
Downlink |
Message type, PAGE_MODE, PERSISTENCE_LEVEL, GLOBAL_TFI, TLLI/G-RNTI, G-RNTI extension, Length of MA Frequency List contents, MA_LENGTH |
Multiple TBF Downlink Assignment |
Downlink |
Message type, PAGE_MODE, PERSISTENCE_LEVEL, GLOBAL_TFI, TLLI/G-RNTI, G-RNTI extension |
Packet DBPSCH Assignment |
Downlink |
Message type, PAGE_MODE, PERSISTENCE_LEVEL, GLOBAL_TFI, G-RNTI |
Packet Uplink Ack/Nack |
Downlink |
Message type, PAGE_MODE, UPLINK_TFI, CONTENTION_RESOLUTION_ G-RNTI, G-RNTI extension, Extension length, COMPRESSED_BITMAP_LENGTH |
Packet DBPSCH Uplink Ack/Nack |
Downlink |
Message type, RBId |
Packet DBPSCH Uplink Ack/Nack Type 2 |
Downlink |
Message type, RBId |
Packet Downlink Ack/Nack |
Uplink |
Message type, DOWNLINK_TFI |
EGPRS Packet Downlink Ack/Nack |
Uplink |
Message type, DOWNLINK_TFI, Extension length, COMPRESSED_BITMAP_LENGTH |
Packet DBPSCH Downlink Ack/Nack |
Uplink |
Message type, RBId |
Packet DBPSCH Downlink Ack/Nack Type 2 |
Downlink |
Message type, RBId |
Packet Timeslot Reconfigure |
Downlink |
Message type, PAGE_MODE, GLOBAL_TFI, Length of MA Frequency List contents, MA_LENGTH |
Multiple TBF Timeslot Reconfigure |
Downlink |
Message type, PAGE_MODE, GLOBAL_TFI |
Packet TBF Release |
Downlink |
Message type, PAGE_MODE, GLOBAL_TFI |
Packet Cell Change Order |
Downlink |
Message type, PAGE_MODE, GLOBAL_TFI, TLLI/G-RNTI, G-RNTI extension, NR_OF_REMOVED_FREQ, NR_OF_FREQUENCIES, FREQ_DIFF_LENGTH |
Physical Information |
Downlink |
Message type |
13.4.4 Ciphering of RLC PDUs in transparent RLC mode
Ciphering applies on the complete RLC PDUs.