原始来源:https://www.sharetechnote.com/html/BasicCallFlow_LTE.html
正文
本节将梳理 LTE 分组呼叫的典型协议流程。它是所有其他呼叫处理的主干结构。
| 本节将讲解以下主题。理解完整的呼叫处理步骤,意味着理解这项技术的全部内容,因此不可能把呼叫处理的所有细节都塞进这一节。本节主要讨论建立基本 LTE 呼叫所需的整体信道结构以及 RRC/NAS 信令。希望你借此把握 LTE 呼叫流程的全貌,并把本节当作学习 LTE 的框架(或动力)。基本状态机 先看整体图 呼叫处理全程的信道映射表 呼叫处理过程中的小区配置与信道配置 接下来是更详细的图解 与 WCDMA 的总体比较 信令消息细节 阶段性点评 参考文献 获取测试流程与日志 / Amarisoft TechAcademy |
|---|
本节将讲解以下主题。理解完整的呼叫处理步骤,意味着理解这项技术的全部内容,因此不可能把呼叫处理的所有细节都塞进这一节。本节主要讨论建立基本 LTE 呼叫所需的整体信道结构以及 RRC/NAS 信令。希望你借此把握 LTE 呼叫流程的全貌,并把本节当作学习 LTE 的框架(或动力)。
- 基本状态机
- 先看整体图
- 呼叫处理全程的信道映射表
- 呼叫处理过程中的小区配置与信道配置
- 接下来是更详细的图解
- 与 WCDMA 的总体比较
- 信令消息细节
- 阶段性点评
- 参考文献
- 获取测试流程与日志 / Amarisoft TechAcademy 下面是 UE 与网络之间交互的总体协议流程。真正理解这些步骤的全部细节,几乎可以说是你整个 LTE 职业生涯的目标。
-
<小区搜索与检测>
-
MIB
-
SIB 1
-
<检查小区选择准则>
-
SIB 2 及其他 SIB
-
RRC : PRACH 前导码
-
RRC : RACH Response
-
RRC : RRC Connection Request
-
RRC : RRC Connection Setup
-
RRC : RRC Connection Setup Complete + NAS : Attach Request + ESM : PDN Connectivity Request
-
RRC : DL Information Transfer + NAS : Authentication Request
-
RRC : UL Information Transfer + NAS : Authentication Response
-
RRC : DL Information Transfer + NAS : Security Mode Command
-
RRC : UL Information Transfer + NAS : Security Mode Complete
-
RRC : Security M ode Command
-
RRC : Security Mode Complete
O1) RRC : UE Capability Enquiry
O2) RRC : UE Capability Information
O3) ESM : ESM Information Request
O4) ESM : ESM Information Response
O5) EMM : EMM Identity Request
O6) EMM : EMM Identity Response
-
RRC : RRC Connection Reconfiguration + NAS : Attach Accept + NAS : Activate Default EPS Bearer Context Req
-
RRC : RRC Connection Reconfiguration Complete + NAS : Attach Complete + NAS : Activate Default EPS Bearer Context Accept
O7) EMM : EMM Information
-
RRC : RRC Connection Release
-
<执行邻小区测量>
-
<检查小区重选准则 >
-
<MO 或 MT 呼叫>:MT 呼叫时应发送 Paging。
-
RRC : PRACH Preamble
-
RRC : RACH Response
-
RRC : RRC Connection Request
-
RRC : RRC Connection Setup
-
RRC : RRC Connection Setup Complete + NAS : Service Request
-
RRC : Security Mode Command
-
RRC : Security Mode Complete
-
RRC : RRC Connection Reconfiguration + NAS : Activate Dedicated EPS Bearer Context Request
-
RRC : RRC Connection Reconfiguration Complete + NAS : Activate Dedicated EPS Bearer Context Accept
-
RRC : RRC Connection Release
下图给出 UE 开机后可能经历的一种状态机。本文讨论的状态转移是 (s0)->(a)-> (b1) -> (c1) -> (d1) -> (e1) -> (f1) -> (g1) -> (h1)。其他大部分转移将在「Handover」一节中描述。
图注:从开机经 RRC 建立、空闲态、寻呼到专用 EPS 承载的 LTE UE 状态机
关于步骤 23)32) 的说明:初始注册和默认 EPS 承载建立流程在几乎所有 LTE 网络中都是通用的,当然会有一些细微差别,但整体概念基本相同。而 32)在不同运营商之间差异相当大,主要有以下两种变体。
- 建立 RRC 连接并执行 RRC Connection Reconfiguration,但不创建任何专用 EPS 承载(此时 UE 使用已有的默认 EPS 承载传输业务)。
- 建立 RRC 连接并执行 RRC Connection Reconfiguration,同时创建专用 EPS 承载(此时 UE 视具体情况使用已有的默认 EPS 承载或专用 EPS 承载)。 本文的示例测试流程对应第二种情况。
把图中的字母与上面流程列表的步骤编号对应起来:路径从 (s0) 开机出发,小区选择进入 (a1) RRC 建立,对应步骤 6) 至 9)。状态 (b1) 是步骤 10) 至 18) 的附着与默认 EPS 承载建立。步骤 19) 释放 RRC 连接,对应 (c1)。随后 UE 停留在 (d1) 空闲态,并在步骤 20) 和 21) 中测量邻小区。
步骤 22) 的寻呼对应 (e1),网络只在 MT 呼叫时发送它。步骤 23) 至 29) 重新建立 RRC 连接和 AS 安全,对应 (f1)。步骤 30) 和 31) 增加专用 EPS 承载,对应 (g1);步骤 32) 是 (h1) 的释放。从 (h1) 箭头回到 (d1) 空闲态,因此每次新呼叫都会重复序列中的业务部分。
右列是第二个小区中的同一生命周期。连接态 UE 通过切换(标记 HO)跨小区移动;空闲态 UE 通过小区重选(标记 CR)移动。RD 箭头表示重定向,即 RRC Connection Release 携带 redirectedCarrierInfo,把 UE 指向另一小区所在的载波。
- 本节只沿图中的一列展开:下文每一节都走左侧从 (s0) 到 (h1) 的路径,且都在单个小区内。
- 注册只执行一次,而业务建立会执行多次:步骤 6) 至 19) 在开机后执行一次,步骤 22) 至 32) 则在 UE 每次离开空闲态时重复。
- 默认 EPS 承载上下文在释放后依然保留:UE 与 MME 在 (d1) 空闲态中维持它,因此 (g1) 只需增加专用 EPS 承载。 在 UE 开发/测试流程中,你所处的层级不同,需要掌握的知识量也不同。但我认为有几幅整体图,几乎对任何从事完整协议栈工作的人都有帮助。
我想介绍的第一幅整体图是如下所示的信道映射。试着任选一条 RRC 消息,顺着该消息的箭头走一遍。如果你读过关于 MAC 和 RLC 的章节,它会帮你回忆起很多细节。
总体流程与层映射
下面的时序图不仅展示消息,还展示各层的基本配置。在完整协议栈语境下对各层的更详细描述将在「Full Stack」一节中讲解。
有空就把这份流程从头到尾读一遍,直到不看本节也能复述出整个流程为止。它可以成为你学习的良好框架,也是排障的好向导。
| 步骤 | 方向 | 信道 | 消息 |
|---|---|---|---|
| 1 | UE <---- NW | BCCH -> BCH,无 MAC 头,RLC TM,无 PDCP | MIB |
| 2 | UE <---- NW | BCCH -> DL SCH,无 MAC 头,RLC TM,无 PDCP | SIBs |
| 3 | UE ----> NW | PRACH -> RACH,无 MAC 头,无 RLC,无 PDCP | PRACH 前导码 |
| 4 | UE <---- NW | RACH -> DL SCH,无 MAC 头,无 RLC,无 PDCP | RACH Response |
| 5 | UE ----> NW | UL SCH -> UL CCCH,MAC 头,无 RLC,无 PDCP | RRC Connection Request |
| 6 | UE <---- NW | DL CCCH -> DL SCH,MAC 头,无 RLC,无 PDCP | RRC Connection Setup |
| 7 | UE ----> NW | UL SCH -> UL DCCH,MAC 头,RLC AM,PDCP | RRC : RRC Connection Setup Complete + NAS : Attach Request (ESM:PDN Connectivity Request) |
| 8 | UE <---- NW | DL DCCH -> DL SCH,MAC 头,RLC AM,PDCP | RRC : dlInformationTransfer EMM : Authentication Request |
| 9 | UE ----> NW | UL SCH -> UL DCCH,MAC 头,RLC AM,PDCP | RRC : ulInformationTransfer EMM : Authentication Response |
| 10 | UE <---- NW | DL DCCH -> DL SCH,MAC 头,RLC AM,PDCP | RRC : dlInformationTransfer EMM : Security Mode Command |
| 11 | UE ----> NW | UL SCH -> UL DCCH,MAC 头,RLC AM,PDCP | RRC : ulInformationTransfer EMM : Security Mode Complete |
| 12 | UE <---- NW | DL DCCH -> DL SCH,MAC 头,RLC AM,PDCP | RRC : Security Mode Command |
| 13 | UE ----> NW | UL SCH -> UL DCCH,MAC 头,RLC AM,PDCP | RRC : Security Mode Complete |
| 14 | UE <---- NW | DL DCCH -> DL SCH,MAC 头,RLC AM,PDCP | RRC : RRC Connection Reconfiguration EMM : Attach Accept ESM : Activate Default EPS Bearer Context Request |
| 15 | UE ----> NW | UL SCH -> UL DCCH,MAC 头,RLC AM,PDCP | RRC : RRC Connection Reconfiguration Complete |
| 16 | UE ----> NW | UL SCH -> UL DCCH,MAC 头,RLC AM,PDCP | RRC : ulInformationTransfer EMM : Attach Complete ESM : Activate Default EPS Bearer Context Accept |
| 17 | UE <---- NW | DL DCCH -> DL SCH,MAC 头,RLC AM,PDCP | RRC : RRC Connection Release |
步骤
方向
信道
消息
UE <---- NW
BCCH -> BCH,
无 MAC 头,RLC TM,无 PDCP
MIB
BCCH -> DL SCH,
SIBs
UE ----> NW
PRACH -> RACH,
无 MAC 头,无 RLC,无 PDCP
PRACH 前导码
RACH -> DL SCH,
RACH Response
UL SCH -> UL CCCH
MAC 头,无 RLC,无 PDCP
RRC Connection Request
DL CCCH -> DL SCH
RRC Connection Setup
UL SCH -> UL DCCH
MAC 头,RLC AM,PDCP
RRC : RRC Connection Setup Complete +
NAS : Attach Request (ESM:PDN Connectivity Request)
DL DCCH -> DL SCH
RRC : dlInformationTransfer
EMM : Authentication Request
RRC : ulInformationTransfer
EMM : Authentication Response
10
EMM : Security Mode Command
11
EMM : Security Mode Complete
12
RRC : Security Mode Command
13
RRC : Security Mode Complete
14
RRC : RRC Connection Reconfiguration
EMM : Attach Accept
ESM : Activate Default EPS Bearer Context Request
15
RRC : RRC Connection Reconfiguration Complete
16
EMM : Attach Complete
ESM : Activate Default EPS Bearer Context Accept
17
RRC : RRC Connection Release
下行信道映射
前面看到的那张图是按时间顺序展开的消息流(事件图)。下面这张图则不按时间排列,而是展示信道映射(即数据在完整协议栈各层之间的流动)。从上面的图中任选一条消息,试着在这张图里找到它的正确路径,看看你能补充出多少细节。
例如,如果你选的是「RRC Connection Setup」这条消息,那么起点就是「RRC Message msg4」。
图注:LTE 下行信道映射:从逻辑信道经传输信道到 PHY
下面是下行信道映射的表格形式。(LCID 和 TrCH 编号会因网络或网络模拟器的不同而不同)
| RB | Lo CH | PDCP | RLC | Lo CH | LCID | MAC Hdr | HARQ | RNTI | Tr CH |
|---|---|---|---|---|---|---|---|---|---|
| PCCH | TM | PCCH | N/A | NONE | NONE | NONE | PCH | ||
| BCCH 0 | TM | BCCH 0 | N/A | NONE | NONE | NONE | BCH 0 | ||
| BCCH 1 | TM | BCCH 1 | N/A | NONE | Broadcast | SI RNTI | DL SCH 0 | ||
| RA_RES | TM | RA_RES | N/A | NONE | NONE | RA RNTI | DL SCH 1 | ||
| SRB0 | DL CCCH | USED | TM | DL CCCH | 0 | NONE | NORMAL | T-CRNTI | DL SCH 1 |
| SRB1 | DL DCCH 0 | USED | AM | DL DCCH 0 | 1 | NORMAL | NORMAL | CRNTI | DL SCH 1 |
| SRB2 | DL DCCH 1 | USED | AM | DL DCCH 0 | 2 | NORMAL | NORMAL | CRNTI | DL SCH 1 |
| DRB 0 | DL DTCH0 | USED | UM/AM | DL DTCH0 | 3 | NORMAL | NORMAL | CRNTI | DL SCH 1 |
| DRB 1 | DL DTCH1 | USED | UM/AM | DL DTCH1 | 4 | NORMAL | NORMAL | CRNTI | DL SCH 1 |
| DRB 2 | DL DTCH2 | USED | UM/AM | DL DTCH2 | 5 | NORMAL | NORMAL | CRNTI | DL SCH 1 |
RB
Lo CH
PDCP
RLC
LCID
MAC Hdr
HARQ
RNTI
Tr CH
PCCH
TM
N/A
NONE
PCH
BCCH 0
BCH 0
BCCH 1
Broadcast
SI RNTI
DL SCH 0
RA_RES
RA RNTI
DL SCH 1
SRB0
DL CCCH
USED
NORMAL
T-CRNTI
SRB1
DL DCCH 0
AM
CRNTI
SRB2
DL DCCH 1
DRB 0
DL DTCH0
UM/AM
DRB 1
DL DTCH1
DRB 2
DL DTCH2
上行信道映射
上行映射要按相反方向来读,从底部的 PHY 硬件向上读到顶部的逻辑信道。RA Preamble 方框位于 RACH 之上,但前导码由 MAC 处理,永远不会到达 RLC 或 RRC。RRC msg3 上行到 CCCH,从 Msg5 开始的 RRC 消息上行到 DCCH,用户面数据上行到 DTCH。注意,图中把物理信道方框标为 PDSCH 0 和 PDSCH 1,而在上行方向上,前导码经 PRACH 到达,其余业务则经 PUSCH 到达。
图注:LTE 上行信道映射:从 PHY 经传输信道到逻辑信道
下面是上行信道映射的表格形式。(LCID 和 TrCH 编号会因网络或网络模拟器的不同而不同)
| RB | Lo CH | PDCP | RLC | Lo CH | LCID | MAC Hdr | HARQ | RNTI | Tr CH |
|---|---|---|---|---|---|---|---|---|---|
| RA_PRE | TM | RA_PRE | N/A | NONE | NONE | NONE | UL SCH 0 | ||
| SRB0 | UL CCCH | USED | TM | UL CCCH | 0 | NONE | NORMAL | T-CRNTI | UL SCH 0 |
| SRB1 | UL DCCH 0 | USED | AM | UL DCCH 0 | 1 | NORMAL | NORMAL | CRNTI | UL SCH 0 |
| SRB2 | UL DCCH 1 | USED | AM | UL DCCH 0 | 2 | NORMAL | NORMAL | CRNTI | UL SCH 0 |
| DRB 0 | UL DTCH0 | USED | UM/AM | UL DTCH0 | 3 | NORMAL | NORMAL | CRNTI | UL SCH 0 |
| DRB 1 | UL DTCH1 | USED | UM/AM | UL DTCH1 | 4 | NORMAL | NORMAL | CRNTI | UL SCH 0 |
| DRB 2 | UL DTCH2 | USED | UM/AM | UL DTCH2 | 5 | NORMAL | NORMAL | CRNTI | UL SCH 0 |
RA_PRE
UL SCH 0
UL CCCH
UL DCCH 0
UL DCCH 1
UL DTCH0
UL DTCH1
UL DTCH2
这只是一个示例,映射关系(尤其是逻辑信道编号)会随情况而变化。关键在于:如果你为自己的场景建立这样一张表,对排障和设计测试用例会非常有帮助。
| 消息 | RB | Lo CH | LoCH No | LCID |
|---|---|---|---|---|
| MIB | - | BCCH | 0 | - |
| SIB 1 | - | BCCH | 1 | - |
| SIB 2 | - | BCCH | 1 | - |
| RRC : PRACH Preamble | - | - | - | - |
| RRC : RACH Response | - | - | - | - |
| RRC : RRC Connection Request | SRB0 | UL CCCH | 0 | 0 |
| RRC : RRC Connection Setup | SRB0 | DL CCCH | 0 | 0 |
| RRC : RRC Connection Setup Complete + NAS : Attach Request + ESM : PDN Connectivity Request | SRB1 | UL DCCH | 0 | 1 |
| RRC : DL Information Transfer + NAS : Authentication Request | SRB1 | DL DCCH | 0 | 1 |
| RRC : UL Information Transfer + NAS : Authentication Response | SRB1 | UL DCCH | 0 | 1 |
| RRC : DL Information Transfer + NAS : Security Mode Command | SRB1 | DL DCCH | 0 | 1 |
| RRC : UL Information Transfer + NAS : Security Mode Complete | SRB1 | UL DCCH | 0 | 1 |
| RRC : Security Mode Command | SRB1 | DL DCCH | 0 | 1 |
| RRC : Security Mode Complete | SRB1 | UL DCCH | 0 | 1 |
| RRC : RRC Connection Reconfiguration | SRB1 | DL DCCH | 0 | 1 |
| RRC : RRC Connection Reconfiguration Complete | SRB1 | UL DCCH | 0 | 1 |
| RRC : UL InformationTransfer + NAS : Attach Complete + NAS : Activate Default EPS Bearer | SRB2 | UL DCCH | 1 | 2 |
| RRC : UL Information Transfer + ESM : PDN Connectivity Request | SRB2 | UL DCCH | 1 | 2 |
LoCH No
BCCH
SIB 1
SIB 2
RRC : PRACH Preamble
RRC : RACH Response
RRC : RRC Connection Request
RRC : RRC Connection Setup
RRC : RRC Connection Setup Complete + NAS : Attach Request + ESM : PDN Connectivity Request
UL DCCH
RRC : DL Information Transfer + NAS : Authentication Request
DL DCCH
RRC : UL Information Transfer + NAS : Authentication Response
RRC : DL Information Transfer + NAS : Security Mode Command
RRC : UL Information Transfer + NAS : Security Mode Complete
RRC : UL InformationTransfer + NAS : Attach Complete + NAS : Activate Default EPS Bearer
RRC : UL Information Transfer + ESM : PDN Connectivity Request
注:参见 TS 36.331 - 9.1.1 Logical channel configurations(逻辑信道配置)
网络侧必须先配置好承载某条消息的各层,这条消息才能通过。下面的列表把这些配置步骤(标记为 Config 1) 及之后)穿插在需要它们的消息步骤之间。当你在网络模拟器上构建测试用例时,这种视角最有用:缺少某个 Config 步骤,就会表现为对端永远收不到某条消息。
Config 1) 激活小区物理层
- MIB
Config 2) 激活用于 SIB 传输的 PHY、MAC、RLC(BCCH-DL DSCH)
-
SIB 1
-
SIB 2
Config 3) 配置用于 PRACH 接收和 RACH Response 传输的 PHY、MAC
-
RRC : PRACH Preamble
-
RRC : RACH Response
Config 3) 配置用于 Msg3(RRC Connection Request)接收的 PHY、MAC、RLC(UL-CCCH)
- RRC : RRC Connection Request
Config 4) 为 DL DCCH、UL DCCH 配置 MAC、RLC、PDCH
-
RRC : RRC Connection Setup
-
RRC : RRC Connection Setup Complete + NAS : Attach Request + ESM : PDN Connectivity Request
-
RRC : DL Information Transfer + NAS : Authentication Request
-
RRC : UL Information Transfer + NAS : Authentication Response
-
RRC : DL Information Transfer + NAS : Security Mode Command
-
RRC : UL Information Transfer + NAS : Security Mode Complete
Config 5) 为完整性保护和加密配置 PDCP(在某些测试环境中我们可以禁用完整性保护/加密)
-
RRC : Security Mode Command
-
RRC : Security Mode Complete
-
RRC : RRC Connection Reconfiguration + NAS : Attach Accept + NAS : Activate Default EPS Bearer Context Req
Config 6) 为 DL/UL DTCH+DCCH 配置 MAC、RLC、PDCP
-
RRC : RRC Connection Reconfiguration Complete + NAS : Attach Complete + NAS : Activate Default EPS Bearer Context Accept
-
RRC : RRC Connection Release
Config 7) 去激活所有与 DCCH、DTCH 相关的信道
Config 8) 激活用于 PCCH 的信道
< MO or MT call > : In MT call, Paging should be sent.
Config 9) 配置用于 PRACH 接收和 RACH Response 传输的 PHY、MAC
-
RRC : PRACH Preamble
-
RRC : RACH Response
Config 10) 配置用于 Msg3(RRC Connection Request)接收的 PHY、MAC、RLC(UL-CCCH)
- RRC : RRC Connection Request
Config 11) 为 DL DCCH、UL DCCH 配置 MAC、RLC、PDCH
-
RRC : RRC Connection Setup
-
RRC : RRC Connection Setup Complete + NAS : Service Request
-
RRC : Security Mode Command
-
RRC : Security Mode Complete
-
RRC : RRC Connection Reconfiguration + NAS : Activate Dedicated EPS Bearer Context Request
Config 12) 为 DL/UL DTCH+DCCH 配置 MAC、RLC、PDCP
-
RRC : RRC Connection Reconfiguration Complete + NAS : Activate Dedicated EPS Bearer Context Accept
-
RRC : RRC Connection Release
接下来的任务是尽可能详细地描述每一个步骤。你能描述得越详细,开发、测试和排障就越容易。这里有很多步骤没有展开,因为其中大部分涉及公司机密(当然,你可以说「所有细节都在 3GPP 规范里」。没错,但 3GPP 只讲「做什么」,对「怎么做」着墨不多。而在实际实现中,「怎么做」与「做什么」同样重要)。你可以把这张表视为尽可能详细描述的最低限度。通读这张表时,想想你能在「Memo」栏里补充多少内容。(如果你想了解现网中究竟发生了什么,请看 Full Stack 一节中的实网空口示例)
注意:下面的流程基于 eNB 侧会看到的序列。当然,UE 侧也应看到相同的序列,只是 UE 还要有与 < NW > 对应的另一侧序列。也许有人觉得我写这张表只是为了把人搞糊涂 :),但这张表正是我在协议排障中最常用的一张。
注意:如果你想用 Amarisoft Log viewer 查看完整日志内容,请进入 LogAnalysis 板块,在 Amarisoft TechAcademy 的这份教程中点击「Sample Log」。Amarisoft 日志的格式与下面展示的并不完全相同,但除了 _REQ、_IND 原语部分之外,你能在日志中看到这里的大多数组成要素。
| 步骤 | 方向 | 消息 | 备注 |
|---|---|---|---|
| 1 | UE <--- SS | MIB | |
| 2 | UE <--- SS | SIB1 | |
| 3 | UE <--- SS | SIB2、3 及其他 SIB | |
| 4 | UE ---> SS | PRACH (RACH Preamble)-Msg1 | |
| 5 | < NW > | PHY_PRACH_IND | |
| 6 | < NW > | MAC_DATA_IND | |
| 7 | UE <--- SS | RACH Response - Msg2 | |
| 8 | < NW > | MAC_DATA_REQ | |
| 9 | < NW > | PHY_PRACH_REQ | |
| 10 | UE <--- SS | DCI 1A | 用于在 UE 侧解码 RAR |
| 11 | < NW > | PHY_PRACH_IND | |
| 12 | < NW > | MAC_DATA_IND | |
| 13 | < NW > | RLC_DATA_IND | |
| 14 | UE ---> SS | RRC Connection Request - Msg3 | |
| 15 | < UE > | UE MAC 启动 mac-ContentionResolutionTimer | 3GPP 36.321 5.1.5 CR 定时器数值在 SIB2 中设置 |
| 16 | UE <--- SS | ACK (PHICH) | 用于确认 Msg3 已被接收 |
| 17 | UE <--- SS | DCI 1A or DCI1 | 用于在 UE 侧解码 CR |
| 18 | UE <--- SS | Contention Resolution - Msg4 | SS 必须在 CRtimer 过期前发送 CR |
| 19 | UE ---> SS | HARQ ACK | 用于在 PHY 层确认 CR 已被接收 |
| 20 | < UE > | UE MAC stop mac-ContentionResolutionTimer | |
| 21 | < NW > | MAC_DATA_REQ | |
| 22 | < NW > | PHY_PRACH_REQ | |
| 23 | UE <--- SS | DCI 1A | 用于在 UE 侧解码 RRC Conn Setup |
| 24 | UE <--- SS | RRC Connection Setup | 在某些情况下,该消息会捎带在步骤 18 中。 |
| 25 | < NW > | RLC_DATA_REQ | RLC 层携带步骤 24 的消息 |
| 26 | < NW > | MAC_DATA_REQ | MAC 层携带步骤 24 的消息 |
| 27 | UE <--- SS | DCI 1A | 用于解码 RRC Conn Setup |
| 28 | < NW > | PHY_DATA_REQ | PHY 层携带步骤 24 的消息 |
| 29 | UE ---> SS | HARQ ACK | 对步骤 28 的响应 |
| 30 | UE ---> SS | Scheduling Request | 用于让 UE 发送 RLC ACK |
| 31 | UE <--- SS | DCI 0 (UL Grant, PDCCH) | 用于让 UE 发送 RLC ACK |
| 32 | < NW > | PHY_DATA_REQ | |
| 33 | < NW > | MAC_DATA_REQ | |
| 34 | UE <--- SS | HARQ ACK (PHICH) | |
| 35 | UE ---> SS | RLC ACK | |
| 36 | UE ---> SS | Scheduling Request | 用于让 UE 发送 RRC Conn Setup Complete |
| 37 | UE <--- SS | DCI 0 (UL Grant, PDCCH) | 用于让 UE 发送 RRC Conn Setup Complete |
| 38 | < NW > | PHY_DATA_IND | |
| 39 | < NW > | MAC_DATA_IND | |
| 40 | < NW > | RLC_DATA_IND | |
| 41 | < NW > | PDCP_DATA_IND | |
| 42 | UE ---> SS | RRC Connection Setup Complete + Attach Requeset + (PDN Conn Request) | |
| 43 | UE <--- SS | HARQ ACK (PHICH) | |
| 44 | UE <--- SS | RLC ACK | |
| 45 | < NW > | MAC_DATA_REQ | |
| 46 | < NW > | PHY_DATA_REQ | |
| 47 | UE <--- SS | DCI 1A | 用于在 UE 侧解码 RLC ACK |
| 48 | UE <--- SS | Authentication Request | |
| 49 | < NW > | PDCP_DATA_REQ | |
| 50 | < NW > | RLC_DATA_REQ | |
| 51 | < NW > | MAC_DATA_REQ | |
| 52 | < NW > | PHY_DATA_REQ | |
| 53 | UE <--- SS | DCI 0 (UL Grant, PDCCH) | 用于在 UE 侧解码 Authentication Request |
| 54 | UE ---> SS | HARQ ACK | |
| 55 | UE ---> SS | Scheduling Request | 用于让 UE 发送 RLC ACK |
| 56 | UE <--- SS | DCI 0 (UL Grant, PDCCH) | 用于让 UE 发送 RLC ACK |
| 57 | UE ---> SS | RLC ACK | |
| 58 | UE <--- SS | HARQ ACK (PHICH) | |
| 59 | < NW > | PHY_DATA_REQ | |
| 60 | < NW > | MAC_DATA_REQ | |
| 61 | UE ---> SS | Scheduling Request | |
| 62 | UE <--- SS | DCI 0 (UL Grant, PDCCH) | |
| 63 | < NW > | PHY_DATA_IND | |
| 64 | < NW > | MAC_DATA_IND | |
| 65 | < NW > | RLC_DATA_IND | |
| 66 | < NW > | PDCP_DATA_IND | |
| 67 | UE ---> SS | Authentication Response | |
| 68 | UE <--- SS | HARQ ACK (PHICH) | |
| 69 | UE <--- SS | RLC ACK | |
| 70 | < NW > | MAC_DATA_REQ | |
| 71 | < NW > | PHY_DATA_REQ | |
| 72 | UE <--- SS | DCI 1A | 用于在 UE 侧解码 RLC ACK |
| 73 | UE <--- SS | NAS Security Mode Command | |
| 74 | < NW > | PDCP_DATA_REQ | |
| 75 | < NW > | RLC_DATA_REQ | |
| 76 | < NW > | MAC_DATA_REQ | |
| 77 | < NW > | PHY_DATA_REQ | |
| 78 | UE <--- SS | DCI 1A | 用于在 UE 侧解码 NAS Security Mode Command |
| 79 | UE ---> SS | HARQ ACK | |
| 80 | UE ---> SS | Scheduling Request(PUCCH) | 用于让 UE 发送 RLC ACK |
| 81 | UE <--- SS | DCI 0 (UL Grant, PDCCH) | 用于让 UE 发送 RLC ACK |
| 82 | < NW > | PHY_DATA_IND | |
| 83 | < NW > | MAC_DATA_IND | |
| 84 | UE ---> SS | RLC ACK | |
| 85 | UE <--- SS | HARQ ACK (PHICH) | |
| 86 | UE ---> SS | Scheduling Request(PUCCH) | 用于发送 NAS Security Mode Complete |
| 87 | UE <--- SS | DCI 0 (UL Grant, PDCCH) | 用于发送 NAS Security Mode Complete |
| 88 | < NW > | PHY_DATA_IND | |
| 89 | < NW > | MAC_DATA_IND | |
| 90 | < NW > | RLC_DATA_IND | |
| 91 | < NW > | PDCP_DATA_IND | |
| 92 | UE ---> SS | NAS Security Mode Complete | |
| 93 | UE <--- SS | HARQ ACK (PHICH) | |
| 94 | UE <--- SS | RLC ACK | |
| 95 | < NW > | MAC_DATA_REQ | |
| 96 | < NW > | PHY_DATA_REQ | |
| 97 | UE <--- SS | DCI 1A | 用于在 UE 侧解码 RLC ACK |
| 98 | UE <--- SS | RRC Security Mode Command | |
| 99 | < NW > | PDCP_DATA_REQ | |
| 100 | < NW > | RLC_DATA_REQ | |
| 101 | < NW > | MAC_DATA_REQ | |
| 102 | < NW > | PHY_DATA_REQ | |
| 103 | UE <--- SS | DCI 1A | 用于在 UE 侧解码 RRC Security Mode Command |
| 104 | UE ---> SS | HARQ ACK | |
| 105 | UE ---> SS | Scheduling Request | 用于让 UE 发送 RLC ACK |
| 106 | UE <--- SS | DCI 0 (UL Grant, PDCCH) | 用于让 UE 发送 RLC ACK |
| 107 | < NW > | PHY_DATA_IND | |
| 108 | < NW > | MAC_DATA_IND | |
| 109 | UE ---> SS | RLC ACK | |
| 110 | UE <--- SS | HARQ ACK (PHICH) | |
| 111 | UE ---> SS | Scheduling Request | 用于让 UE 发送 RRC Security Mode Complete |
| 112 | UE <--- SS | DCI 0 (UL Grant, PDCCH) | 用于让 UE 发送 RRC Security Mode Complete |
| 113 | < NW > | PHY_DATA_IND | |
| 114 | < NW > | MAC_DATA_IND | |
| 115 | < NW > | RLC_DATA_IND | |
| 116 | < NW > | PDCP_DATA_IND | |
| 117 | UE ---> SS | RRC Security Mode Complete | |
| 118 | UE <--- SS | HARQ ACK (PHICH) | |
| 119 | UE <--- SS | RLC ACK | |
| 120 | < NW > | MAC_DATA_REQ | |
| 121 | < NW > | PHY_DATA_REQ | |
| 122 | UE <--- SS | DCI 1A | 用于在 UE 侧解码 RLC ACK |
| 123 | < 根据网络的不同,这里还可以加入许多其他消息 > | ||
| 124 | UE <--- SS | RRC Connection Reconfiguration + Attach Accept + Activate Default EPS Bearer Context Request | |
| 125 | < NW > | PDCP_DATA_REQ | |
| 126 | < NW > | RLC_DATA_REQ | |
| 127 | < NW > | MAC_DATA_REQ | |
| 128 | < NW > | PHY_DATA_REQ | |
| 129 | UE ---> SS | HARQ ACK | |
| 130 | UE ---> SS | Scheduling Request(PUCCH) | 用于让 UE 发送 RLC ACK |
| 131 | UE <--- SS | DCI 0 (UL Grant, PDCCH) | 用于让 UE 发送 RLC ACK |
| 132 | < NW > | PHY_DATA_IND | |
| 133 | < NW > | MAC_DATA_IND | |
| 134 | UE ---> SS | RLC ACK | |
| 135 | UE ---> SS | Scheduling Request(PUCCH) | 用于让 UE 发送 RRC Connection Reconfig Complete |
| 136 | UE <--- SS | DCI 0 (UL Grant, PDCCH) | 用于让 UE 发送 RRC Connection Reconfig Complete |
| 137 | < NW > | PHY_DATA_IND | |
| 138 | < NW > | MAC_DATA_IND | |
| 139 | < NW > | RLC_DATA_IND | |
| 140 | < NW > | PDCP_DATA_IND | |
| 141 | UE ---> SS | RRC Connection Reconfiguration Complete + Attach Complete + Activate Default EPS Bearer Context Accept | |
| 142 | UE <--- SS | HARQ ACK (PHICH) | |
| 143 | UE <--- SS | RLC ACK | |
| 144 | < NW > | MAC_DATA_REQ | |
| 145 | < NW > | PHY_DATA_REQ | |
| 146 | UE <--- SS | DCI 1A | 用于在 UE 侧解码 RLC ACK |
| 147 | < 如有需要,进行 IP 数据业务 > | ||
| 148 | UE <--- SS | RRC Connection Release | |
| 149 | < NW > | PDCP_DATA_REQ | |
| 150 | < NW > | RLC_DATA_REQ | |
| 151 | < NW > | MAC_DATA_REQ | |
| 152 | < NW > | PHY_DATA_REQ | |
| 153 | UE <--- SS | DCI 1A | 用于在 UE 侧解码 RRC Connection Release |
| 154 | UE ---> SS | HARQ ACK | |
| 155 | UE ---> SS | Scheduling Request(PUCCH) | 用于让 UE 发送 RLC ACK |
| 156 | UE <--- SS | DCI 0 (UL Grant, PDCCH) | 用于让 UE 发送 RLC ACK |
| 157 | < NW > | PHY_DATA_IND | |
| 158 | < NW > | MAC_DATA_IND | |
| 159 | UE ---> SS | RLC ACK | |
| 160 | UE <--- SS | HARQ ACK (PHICH) | |
| 161 | UE | < 此时 UE 应处于 IDLE 模式 > |
Memo
UE <--- SS
SIB1
SIB2、3 及其他 SIB
UE ---> SS
PRACH (RACH Preamble)-Msg1
< NW >
PHY_PRACH_IND
MAC_DATA_IND
RACH Response - Msg2
MAC_DATA_REQ
PHY_PRACH_REQ
DCI 1A
用于在 UE 侧解码 RAR
RLC_DATA_IND
RRC Connection Request - Msg3
< UE >
UE MAC start mac-ContentionResolutionTimer
3GPP 36.321 5.1.5
CR 定时器数值在 SIB2 中设置
ACK (PHICH)
用于确认 Msg3 已被接收
DCI 1A or DCI1
用于在 UE 侧解码 CR
18
Contention Resolution - Msg4
SS 必须在 CRtimer 过期前发送 CR
19
HARQ ACK
用于在 PHY 层确认 CR 已被接收
20
UE MAC stop mac-ContentionResolutionTimer
21
22
23
用于在 UE 侧解码 RRC Conn Setup
24
在某些情况下,该消息会捎带在步骤 18 中。
25
RLC_DATA_REQ
RLC 层携带步骤 24 的消息
26
MAC 层携带步骤 24 的消息
27
用于解码 RRC Conn Setup
28
PHY_DATA_REQ
PHY 层携带步骤 24 的消息
29
对步骤 28 的响应
30
Scheduling Request
用于让 UE 发送 RLC ACK
31
DCI 0 (UL Grant, PDCCH)
32
33
34
HARQ ACK (PHICH)
35
RLC ACK
36
用于让 UE 发送 RRC Conn Setup Complete
37
38
PHY_DATA_IND
39
40
41
PDCP_DATA_IND
42
RRC Connection Setup Complete
-
Attach Requeset
-
(PDN Conn Request)
43
44
45
46
47
用于在 UE 侧解码 RLC ACK
48
Authentication Request
49
PDCP_DATA_REQ
50
51
52
53
用于在 UE 侧解码 Authentication Request
54
55
56
57
58
59
60
61
62
63
64
65
66
67
Authentication Response
68
69
70
71
72
73
NAS Security Mode Command
74
75
76
77
78
用于在 UE 侧解码 NAS Security Mode Command
79
80
Scheduling Request(PUCCH)
81
82
83
84
85
86
用于发送 NAS Security Mode Complete
87
88
89
90
91
92
NAS Security Mode Complete
93
94
95
96
97
98
RRC Security Mode Command
99
100
101
102
103
用于在 UE 侧解码 RRC Security Mode Command
104
105
106
107
108
109
110
111
用于让 UE 发送 RRC Security Mode Complete
112
113
114
115
116
117
RRC Security Mode Complete
118
119
120
121
122
123
< Many other message can be added here depending on NW >
124
RRC Connection Reconfiguration
-
Attach Accept
-
Activate Default EPS Bearer Context Request
125
126
127
128
129
130
131
132
133
134
135
用于让 UE 发送 RRC Connection Reconfig Complete
136
137
138
139
140
141
RRC Connection Reconfiguration Complete
-
Attach Complete
-
Activate Default EPS Bearer Context Accept
142
143
144
145
146
147
< IP Data Traffic if needed >
148
RRC Connection Release
149
150
151
152
153
用于在 UE 侧解码 RRC Connection Release
154
155
156
157
158
159
160
161
UE
< Now UE should be in IDLE mode >
如果你已经熟悉 WCDMA 呼叫流程,这份 LTE 序列的大部分内容都会显得似曾相识。差别集中在三处:一是运行随机接入的层,二是 NAS 消息的传递方式,三是 UE 需要读取的系统信息量。下面逐一来看。
虽然整体流程与 WCDMA 相当相似,但与 WCDMA 序列相比仍有几个不同点。
首先要看的一点是:在 LTE 中,「RACH 前导码」是作为 MAC 层处理的一部分发送的。如你所知,RACH 流程在 WCDMA 中也存在,但在 WCDMA 中它属于物理层处理的一部分。
我注意到的另一点是:RRC Connection Setup Complete 和 Attach Request 在同一个步骤中携带。这只是其中一个例子。在 LTE 中,许多 NAS 消息都捎带在 RRC 消息上。这会使消息的编解码过程变得复杂,但能有效减少 UE 与 eNodeB 之间的消息交互次数。
这些只是从消息类型上就能看出的差异。随着你深入到每条消息的信息元素中,还会发现更多差异,后面几节会讲到。
下一个你会注意到的地方是:与 WCDMA 相比,LTE 传输的 SIB 数量少得多。当然,这条流程里还有更多未传输的 SIB,但仅凭这两个 SIB 就足以让 UE 驻留网络所需的全部信息。WCDMA 共有 18 个 SIB,即使在最基础的配置中,通常也至少要用到 SIB1、3、5、7、11。而且 WCDMA 的某些 SIB(如 SIB5 和 SIB11)还分多个段。LTE 中 SIB 数量少,且都不分段。
这一部分按页面顶部流程列表的顺序,逐条讲解呼叫流程中的消息。每个小节先说明该消息的用途,然后给出一个解码示例。解码示例取自测试网络,因此字段值反映的是某一种可用的配置,而非唯一有效的配置。
MIB 是 UE 找到小区后读取的第一条消息,它只携带 UE 解码其他一切内容所需的信息。它在 BCH 上发送,BCH 映射到 PBCH,因此 UE 无需任何调度信息就能读到它。
LTE 的 MIB 信息量极少(这是与 WCDMA MIB 的重大区别)。它携带的信息只有:
i) BandWidth
ii) PHICH
iii) SystemFrameNumber
当然,其中最重要的信息是「BandWidth」(带宽)。
根据 36.331 第 5.2.1.2 节,MIB 的调度方式如下:
MIB 采用固定调度,周期为 40 ms,并在 40 ms 内重复发送。MIB 的首次传输安排在 SFN mod 4 = 0 的无线帧的子帧 #0 中,重复传输则安排在其他所有无线帧的子帧 #0 中。
以上三项是 MIB 的 Release 8 内容。在 36.331 v19.3.0 中,MIB 还携带面向 BL UE 和 CE UE 的 schedulingInfoSIB1-BR-r13、systemInfoUnchanged-BR-r15 以及 partEARFCN-r17。Release 8 UE 把这些比特当作 spare 读取。另需注意 systemFrameNumber 只有 8 比特长,因此它只给出 SFN 的最高 8 位。UE 从 40 ms PBCH TTI 的时间位置获得最低 2 位。
SIB1 是 UE 必须解码的 DL-SCH 上的第一条消息,它告诉 UE 是否可以使用该小区。它还告诉 UE 其他每个 SIB 的发送时刻,因此 SIB1 一旦出错,其后所有 SIB 都会被掩盖。
LTE 的 SIB 1 包含的信息类似 WCDMA MIB & SIB1 & SIB3 中的内容。SIB 1 中的重要信息有:
i) PLMN
ii) 跟踪区编码(Tracking Area Code)
iii) 小区选择信息
iv) 频段指示(Frequency Band Indicator)
v) 其他 SIB 的调度信息(周期)
你可能会注意到,LTE SIB1 与 WCDMA MIB 非常相似。
尤其是在测试用例开发的初期,必须对第 v) 项格外小心。如果这个值设置错误,UE 将无法解码所有其他 SIB,结果就是 UE 无法识别小区,并显示「No Service」(无服务)。
根据 36.331 第 5.2.1.2 节,SIB1 的调度方式如下:
SystemInformationBlockType1 采用固定调度,周期为 80 ms,并在 80 ms 内重复发送。SystemInformationBlockType1 的首次传输安排在 SFN mod 8 = 0 的无线帧的子帧 #5 中,重复传输则安排在 SFN mod 2 = 0 的其他所有无线帧的子帧 #5 中。
这意味着虽然 SIB1 的周期是 80 ms,但 SIB1 的不同副本(冗余版本:RV)每 20 ms 发送一次。也就是说,在 L3 上每 80 ms 看到 SIB1,而在 PHY 层每 20 ms 就能看到它。每次传输的 RV 分配细节请参见 36.321 第 5.3.1 节(该节末尾部分)。
图注:SFN 0 至 19 内 MIB 与 SIB1 的发送调度
LTE SIB1 的一个示例如下:
解码消息截取,来自协议测试仪日志。字段值取自捕获的消息,而非规范。
RRC_LTE:BCCH-DL-SCH-Message BCCH-DL-SCH-Message ::= SEQUENCE +-message ::= CHOICE [c1] +-c1 ::= CHOICE [systemInformationBlockType1] +-systemInformationBlockType1 ::= SEQUENCE +-cellAccessRelatedInfo ::= SEQUENCE | +-plmn-IdentityList ::= SEQUENCE OF SIZE(1..6) | | +-PLMN-IdentityInfo ::= SEQUENCE | | +-plmn-Identity ::= SEQUENCE | | | +-mcc ::= SEQUENCE OF SIZE(3) OPTIONAL:Exist | | | | +-MCC-MNC-Digit ::= INTEGER (0..9) | | | | +-MCC-MNC-Digit ::= INTEGER (0..9) | | | | +-MCC-MNC-Digit ::= INTEGER (0..9) | | | +-mnc ::= SEQUENCE OF SIZE(2..3) | | | +-MCC-MNC-Digit ::= INTEGER (0..9) | | | +-MCC-MNC-Digit ::= INTEGER (0..9) | | +-cellReservedForOperatorUse ::= ENUMERATED [notReserved] | +-trackingAreaCode ::= BIT STRING SIZE(16) | +-cellIdentity ::= BIT STRING SIZE(28) | +-cellBarred ::= ENUMERATED [notBarred] | +-intraFreqReselection ::= ENUMERATED [notAllowed] | +-csg-Indication ::= BOOLEAN [FALSE] | +-csg-Identity ::= BIT STRING OPTIONAL:Omit +-cellSelectionInfo ::= SEQUENCE | +-q-RxLevMin ::= INTEGER (-70..-22) [-53] | +-q-RxLevMinOffset ::= INTEGER OPTIONAL:Omit +-p-Max ::= INTEGER OPTIONAL:Omit +-freqBandIndicator ::= INTEGER (1..64) +-schedulingInfoList ::= SEQUENCE OF SIZE(1..maxSI-Message) | +-SchedulingInfo ::= SEQUENCE | | +-si-Periodicity ::= ENUMERATED [rf8] | | +-sib-MappingInfo ::= SEQUENCE OF SIZE(0..maxSIB-1) | +-SchedulingInfo ::= SEQUENCE | +-si-Periodicity ::= ENUMERATED [rf8] | +-sib-MappingInfo ::= SEQUENCE OF SIZE(0..maxSIB-1) | +-SIB-Type ::= ENUMERATED [sibType3] +-tdd-Config ::= SEQUENCE OPTIONAL:Omit +-si-WindowLength ::= ENUMERATED [ms20] +-systemInfoValueTag ::= INTEGER (0..31) +-nonCriticalExtension ::= SEQUENCE OPTIONAL:Omit
SIB2 告诉 UE 该小区的公共无线配置,而 SIB1 已经告诉 UE 何时能找到它。没有 SIB2,UE 无法启动随机接入,因为 PRACH 和 RACH 参数都携带在这里。
SIB2 中的重要信息有:
i) RACH 配置
ii) bcch、pcch、pdsch、pusch、pucch 配置
iii) 探测参考信号(sounding RS)配置
iv) UE 定时器
可以说 SIB2 是 LTE 中最重要的 SIB。在实现协议栈和排障时,你查阅最多的也是这个 SIB,因为它定义了大多数物理信道的特性。
如果你在注册流程中遇到问题,尤其是在「RRC Connection Reconfiguration」之前出问题,首先要检查的就是 SIB2:确认 UE 是否正确解码了它,并根据 SIB2 正确完成自身配置。有时网络与 UE 之间仅一个 SIB2 参数不匹配,就会导致整个注册流程成败有别。
下面是 SIB2 的一个示例。在我看来,LTE SIB2 类似于 WCDMA 中配置各种公共信道的 SIB5。
RRC_LTE:BCCH-DL-SCH-Message BCCH-DL-SCH-Message ::= SEQUENCE +-message ::= CHOICE [c1] +-c1 ::= CHOICE [systemInformation] +-systemInformation ::= SEQUENCE +-criticalExtensions ::= CHOICE [systemInformation-r8] +-systemInformation-r8 ::= SEQUENCE +-sib-TypeAndInfo ::= SEQUENCE OF SIZE(1..maxSIB) | +- ::= CHOICE [sib2] | +-sib2 ::= SEQUENCE | +-ac-BarringInfo ::= SEQUENCE OPTIONAL:Omit | +-radioResourceConfigCommon ::= SEQUENCE | | +-rach-Config ::= SEQUENCE | | | +-preambleInfo ::= SEQUENCE | | | | +-numberOfRA-Preambles ::= ENUMERATED [n52] | | | | +-preamblesGroupAConfig ::= SEQUENCE OPTIONAL:Omit | | | +-powerRampingParameters ::= SEQUENCE | | | | +-powerRampingStep ::= ENUMERATED [dB2] | | | | +-preambleInitialReceivedTargetPower ::= ENUMERATED [dBm-104] | | | +-ra-SupervisionInfo ::= SEQUENCE | | | | +-preambleTransMax ::= ENUMERATED [n6] | | | | +-ra-ResponseWindowSize ::= ENUMERATED [sf10] | | | | +-mac-ContentionResolutionTimer ::= ENUMERATED [sf48] | | | +-maxHARQ-Msg3Tx ::= INTEGER (1..8) | | +-bcch-Config ::= SEQUENCE | | | +-modificationPeriodCoeff ::= ENUMERATED [n4] | | +-pcch-Config ::= SEQUENCE | | | +-defaultPagingCycle ::= ENUMERATED [rf128] | | | +-nB ::= ENUMERATED [oneT] | | +-prach-Config ::= SEQUENCE | | | +-rootSequenceIndex ::= INTEGER (0..837) | | | +-prach-ConfigInfo ::= SEQUENCE | | | +-prach-ConfigIndex ::= INTEGER (0..63) | | | +-highSpeedFlag ::= BOOLEAN [FALSE] | | | +-zeroCorrelationZoneConfig ::= INTEGER (0..15) | | | +-prach-FreqOffset ::= INTEGER (0..94) | | +-pdsch-Config ::= SEQUENCE | | | +-referenceSignalPower ::= INTEGER (-60..50) | | | +-p-b ::= INTEGER (0..3) | | +-pusch-Config ::= SEQUENCE | | | +-pusch-ConfigBasic ::= SEQUENCE | | | | +-n-SB ::= INTEGER (1..4) | | | | +-hoppingMode ::= ENUMERATED [interSubFrame] | | | | +-pusch-HoppingOffset ::= INTEGER (0..98) | | | | +-enable64QAM ::= BOOLEAN [FALSE] | | | +-ul-ReferenceSignalsPUSCH ::= SEQUENCE | | | +-groupHoppingEnabled ::= BOOLEAN [TRUE] | | | +-groupAssignmentPUSCH ::= INTEGER (0..29) | | | +-sequenceHoppingEnabled ::= BOOLEAN [FALSE] | | | +-cyclicShift ::= INTEGER (0..7) | | +-pucch-Config ::= SEQUENCE | | | +-deltaPUCCH-Shift ::= ENUMERATED [ds2] | | | +-nRB-CQI ::= INTEGER (0..98) | | | +-nCS-AN ::= INTEGER (0..7) | | | +-n1PUCCH-AN ::= INTEGER (0..2047) | | +-soundingRS-UL-Config ::= CHOICE [setup] | | | +-setup ::= SEQUENCE | | | +-srs-BandwidthConfig ::= ENUMERATED [bw3] | | | +-srs-SubframeConfig ::= ENUMERATED [sc0] | | | +-ackNackSRS-SimultaneousTransmission ::= BOOLEAN [TRUE] | | | +-srs-MaxUpPts ::= ENUMERATED OPTIONAL:Omit | | +-uplinkPowerControl ::= SEQUENCE | | | +-p0-NominalPUSCH ::= INTEGER (-126..24) [-85] | | | +-alpha ::= ENUMERATED [al08] | | | +-p0-NominalPUCCH ::= INTEGER (-127..-96) [-117] | | | +-deltaFList-PUCCH ::= SEQUENCE | | | | +-deltaF-PUCCH-Format1 ::= ENUMERATED [deltaF0] | | | | +-deltaF-PUCCH-Format1b ::= ENUMERATED [deltaF3] | | | | +-deltaF-PUCCH-Format2 ::= ENUMERATED [deltaF0] | | | | +-deltaF-PUCCH-Format2a ::= ENUMERATED [deltaF0] | | | | +-deltaF-PUCCH-Format2b ::= ENUMERATED [deltaF0] | | | +-deltaPreambleMsg3 ::= INTEGER (-1..6) | | +-ul-CyclicPrefixLength ::= ENUMERATED [len1] | +-ue-TimersAndConstants ::= SEQUENCE | | +-t300 ::= ENUMERATED [ms1000] | | +-t301 ::= ENUMERATED [ms1000] | | +-t310 ::= ENUMERATED [ms1000] | | +-n310 ::= ENUMERATED [n1] | | +-t311 ::= ENUMERATED [ms1000] | | +-n311 ::= ENUMERATED [n1] | +-freqInfo ::= SEQUENCE | | +-ul-CarrierFreq ::= INTEGER OPTIONAL:Omit | | +-ul-Bandwidth ::= ENUMERATED OPTIONAL:Omit | | +-additionalSpectrumEmission ::= INTEGER (1..32) | +-mbsfn-SubframeConfigList ::= SEQUENCE OF OPTIONAL:Omit | +-timeAlignmentTimerCommon ::= ENUMERATED [sf750] +-nonCriticalExtension ::= SEQUENCE OPTIONAL:Omit
RRC : PRACH Preamble / RRC : RACH Response
PRACH 前导码和 RACH Response 在流程列表中被标注为 RRC,但它们其实是 MAC 和 PHY 流程。它们为 UE 提供上行授权和临时 C-RNTI,使其能够发送第一条 RRC 消息。在下图中,响应中的 RAPID 是 15,与 eNB 检测到的 PreambleIndex 相同。这一匹配告诉 UE:这条响应是针对它自己发送的前导码的。
我认为用下面这张图最能概括这两个步骤。细节请参见 RACH_LTE。
图注:PRACH 前导码与 RACH Response:解码出的前导码索引和 RAR 字段
从这里开始,L3 消息同时承载 RRC 和 NAS 消息。因此你既需要理解 RRC 消息,也需要对 NAS 消息有整体把握。
要处理 NAS 消息中与数据业务相关的 IE,你需要理解 TS 29.274 的全部细节。当然,一天之内吃透这些细节是不可能的。我的做法是尽可能反复浏览下面这些表,直到在头脑中建立起整体框架。你可能需要在 36.331 和 29.274 之间来回查阅。
- 表 7.2.2-1:Create Session Response 中的信息元素
- 表 7.2.3-1:Create Bearer Request 中的信息元素
- 表 7.2.3-2:Create Bearer Request 中的承载上下文(Bearer Context)
- 表 7.2.5-1:Bearer Resource Command 中的信息元素
- 表 7.2.7-1:Modify Bearer Request 中的信息元素
- 表 7.2.8-1:Modify Bearer Response 中的信息元素
- 表 7.2.9.1-1:Delete Session Request 中的信息元素
- 表 7.2.9.2-1:Delete Bearer Request 中的信息元素
- 表 7.2.10.2-1:Delete Bearer Response 中的信息元素
- 表 7.3.5-1:Context Request 中的信息元素
- 表 7.3.6-2:Context Response 中的 MME/SGSN UE EPS PDN 连接
- 表 7.3.8-1:Identification Request 中的信息元素 「RRC Connection Request」和「RRC Connection Setup」流程可以用下图概括。细节请参见 RACH_LTE(方框中展示的消息内容只是一个示例。你在自己的设备和网络上看到的 HEX 数组会与这里不同,但整体结构应当与此类似)。
图注:RRC Connection Request 与 RRC Connection Setup:含竞争解决 UE ID
注意:这个示例展示的是竞争解决(Contention Resolution)与 RRC Connection Setup 在同一步骤中传输的情形,但两者也可能作为两个独立的过程分别传输。
如下面的图所示,RRC Connection Setup 消息中最重要的信息元素(IE)是「RadioResourceConfigDedicated」,在它之下可以配置 SRB、DRB、MAC 和 PHY。虽然有与 DRB 相关的 IE,但在大多数情况下,我们在 RRC Connection Setup 中只配置 SRB。这一点与 WCDMA 的 RRC Connection Setup 消息类似:尽管有用于 RB(数据业务)的 IE,通常也只配置 SRB(控制信道部分)。
需要注意的一点是,「RadioResourceConfigDedicated」(原文拼写为 RadioResourceCondigDedicated)这个 IE 不仅出现在 RRC Connection Setup 消息中,也出现在 RRC Connection Reconfiguration 消息中。在这种情况下要格外小心,确保在 RRC Connection Reconfig 消息中设置的内容与在 RRC Connection Setup 消息中设置的内容正确匹配。也就是说,你必须非常清楚地理解 RRC Connection Setup 消息与 RRC Connection Reconfig 消息之间的关联。这一点也与 WCDMA 的情况非常相似。
图注:RRC Connection Setup 消息树:RadioResourceConfigDedicated 与 PhysicalConfigDedicated
下面是 RRC Connection Setup 的一个示例。正如你看到的内容,RRC Connection Setup 消息的主要目的是指定 SRB 0 和 SRB 1 承载的 MAC/RLC/PHY 配置。因此,如果这条消息出任何差错,网络或 UE 将无法解码其后到来的消息。
尤其是 PhysicalConfigDedicated 部分,必须格外小心。如果在「RRC Connection Setup」之后看到下列问题之一,首先要检查的就是 PhysicalConfigDedicated(需要检查所有详细参数,并确认 UE 正确解码了这些信息,并根据其内容正确完成自身配置)。
i) PUSCH 出现 CRC 错误
ii) UE 日志显示已发送 PUSCH,但网络日志中看不到任何 PUSCH,甚至连 CRC 错误都没有
DL-CCCH-Message ::= SEQUENCE +-message ::= CHOICE [c1] +-c1 ::= CHOICE [rrcConnectionSetup] +-rrcConnectionSetup ::= SEQUENCE +-rrc-TransactionIdentifier ::= INTEGER (0..3) +-criticalExtensions ::= CHOICE [c1] +-c1 ::= CHOICE [rrcConnectionSetup-r8] +-rrcConnectionSetup-r8 ::= SEQUENCE +-radioResourceConfigDedicated ::= SEQUENCE | +-srb-ToAddModList ::= SEQUENCE OF SIZE(1..2) OPTIONAL:Exist | | +-SRB-ToAddMod ::= SEQUENCE | | +-srb-Identity ::= INTEGER (1..2) | | +-rlc-Config ::= CHOICE [defaultValue] OPTIONAL:Exist | | | +-defaultValue ::= NULL | | +-logicalChannelConfig ::= CHOICE [defaultValue] OPTIONAL:Exist | | +-defaultValue ::= NULL | +-drb-ToAddModList ::= SEQUENCE OF OPTIONAL:Omit | +-drb-ToReleaseList ::= SEQUENCE OF OPTIONAL:Omit | +-mac-MainConfig ::= CHOICE [explicitValue] OPTIONAL:Exist | | +-explicitValue ::= SEQUENCE | | +-ul-SCH-Config ::= SEQUENCE OPTIONAL:Exist | | | +-maxHARQ-Tx ::= ENUMERATED [n5] OPTIONAL:Exist | | | +-periodicBSR-Timer ::= ENUMERATED [sf20] OPTIONAL:Exist | | | +-retxBSR-Timer ::= ENUMERATED [sf320] | | | +-ttiBundling ::= BOOLEAN [FALSE] | | +-drx-Config ::= CHOICE [release] OPTIONAL:Exist | | | +-release ::= NULL | | +-timeAlignmentTimerDedicated ::= ENUMERATED [infinity] | | +-phr-Config ::= CHOICE [setup] OPTIONAL:Exist | | +-setup ::= SEQUENCE | | +-periodicPHR-Timer ::= ENUMERATED [sf500] | | +-prohibitPHR-Timer ::= ENUMERATED [sf200] | | +-dl-PathlossChange ::= ENUMERATED [dB3] | +-sps-Config ::= SEQUENCE OPTIONAL:Omit | +-physicalConfigDedicated ::= SEQUENCE OPTIONAL:Exist | +-pdsch-ConfigDedicated ::= SEQUENCE OPTIONAL:Exist | | +-p-a ::= ENUMERATED [dB-3] | +-pucch-ConfigDedicated ::= SEQUENCE OPTIONAL:Exist | | +-ackNackRepetition ::= CHOICE [release] | | | +-release ::= NULL | | +-tdd-AckNackFeedbackMode ::= ENUMERATED OPTIONAL:Omit | +-pusch-ConfigDedicated ::= SEQUENCE OPTIONAL:Exist | | +-betaOffset-ACK-Index ::= INTEGER (0..15) | | +-betaOffset-RI-Index ::= INTEGER (0..15) | | +-betaOffset-CQI-Index ::= INTEGER (0..15) | +-uplinkPowerControlDedicated ::= SEQUENCE OPTIONAL:Exist | | +-p0-UE-PUSCH ::= INTEGER (-8..7) | | +-deltaMCS-Enabled ::= ENUMERATED [en0] | | +-accumulationEnabled ::= BOOLEAN [TRUE] | | +-p0-UE-PUCCH ::= INTEGER (-8..7) | | +-pSRS-Offset ::= INTEGER (0..15) | | +-filterCoefficient ::= ENUMERATED [fc4] OPTIONAL:Exist | +-tpc-PDCCH-ConfigPUCCH ::= CHOICE OPTIONAL:Omit | +-tpc-PDCCH-ConfigPUSCH ::= CHOICE OPTIONAL:Omit | +-cqi-ReportConfig ::= SEQUENCE OPTIONAL:Exist | | +-cqi-ReportModeAperiodic ::= ENUMERATED [rm30] OPTIONAL:Exist | | +-nomPDSCH-RS-EPRE-Offset ::= INTEGER (-1..6) | | +-cqi-ReportPeriodic ::= CHOICE OPTIONAL:Omit | +-soundingRS-UL-ConfigDedicated ::= CHOICE OPTIONAL:Omit | +-antennaInfo ::= CHOICE [defaultValue] OPTIONAL:Exist | | +-defaultValue ::= NULL | +-schedulingRequestConfig ::= CHOICE [setup] OPTIONAL:Exist | +-setup ::= SEQUENCE | +-sr-PUCCH-ResourceIndex ::= INTEGER (0..2047) | +-sr-ConfigIndex ::= INTEGER (0..155) | +-dsr-TransMax ::= ENUMERATED [n4] +-nonCriticalExtension ::= SEQUENCE OPTIONAL:Omit
< Note 1 >
+-pdsch-ConfigDedicated ::= SEQUENCE OPTIONAL:Exist | +-p-a ::= ENUMERATED [dB-3]
:发射功率按 3GPP TS36.213 第 5.2 节的规定,由参考信号功率以及为本流程指定的 P_A 和 P_B 参数值计算得到。这两个参数设定有 RS 和无 RS 的符号之间 PDSCH 发射功率的差值。
这一数值设置不当,会导致 UE 侧接收 PDSCH 时出现大量 CRC 错误,进而产生大量来自 UE 的 HARQ NACK。
该参数含义的详细说明请参见这篇笔记。
< Note 2 >
如果你看到 SRB-ToAddMod IE,会发现其中出现了几个 Default Value。这是什么意思?
36.331 的下面两节会给你答案。
- 9.1.2 SRB 配置
- 9.2 默认无线配置 这一步是初始注册过程中非常重要的步骤之一,主要原因在于 UE 会向核心网发送大量自身能力信息(尤其是 NAS 层能力信息)。
图注:RRC Connection Setup Complete 消息树:携带 Attach Request 与 PDN Connectivity Request
如你所见,这一步承载了两条重要的 NAS 消息,如下。
NAS : Attach Request:这条消息携带的最重要信息是 UE 在加密和完整性保护方面的能力。如果后续步骤(尤其是 Attach accept 步骤)没有基于这些信息正确执行,UE 将注册失败。更大的麻烦在于,注册失败的表现形式随 UE 协议栈实现的不同而不同,因此在很多情况下很难定位问题的根本原因。
ESM : PDN Connectivity Request:这条消息中最重要的信息是协议配置选项(PCO)。通过它可以了解 UE 支持或希望获得哪种分组业务。如果不正确处理这一信息,同样会导致注册失败,且失败的表现形式也随 UE 实现的不同而不同。
Attach request ::= DIVISION +-Security header type ::= V | +-Security header type ::= CHOICE [Plain NAS message, not security protected] +-EPS mobility management protocol discriminator ::= V | +-Protocol discriminator ::= PD +-Attach request message identity ::= V | +-Message type ::= MSG +-NAS key set identifier ::= V | +-TSC ::= CHOICE [native security context (for KSI ASME)] | +-NAS key set identifier ::= CHOICE [possible values for the NAS key set identifier 1] +-EPS attach type ::= V | +-Spare ::= FIX | +-EPS attach type value ::= CHOICE [EPS attach] +-Old GUTI or IMSI ::= LV | +-Octet1 ::= DIVISION | | +-Length of EPS mobile identity contents ::= LEN (0..255) | +-Octet2 ::= DIVISION | | +-Spare ::= FIX [F] | | +-Odd/even indication ::= CHOICE [even number of identity digits and also when the GUTI is used] | | +-Type of identity ::= CHOICE [GUTI] | +-Octet3 ::= DIVISION | | +-MCC digit 2 ::= INT (0..15) | | +-MCC digit 1 ::= INT (0..15) | +-Octet4 ::= DIVISION | | +-MNC digit 3 ::= INT (0..15) | | +-MCC digit 3 ::= INT (0..15) | +-Octet5 ::= DIVISION | | +-MNC digit 2 ::= INT (0..15) | | +-MNC digit 1 ::= INT (0..15) | +-Octet6 ::= DIVISION | | +-MME Group ID ::= INT (0..255) | +-Octet7 ::= DIVISION | | +-MME Group ID(continued) ::= INT (0..255) | +-Octet8 ::= DIVISION | | +-MME Code ::= INT (0..255) | +-Octet9 ::= DIVISION | | +-M-TMSI ::= INT (0..255) | +-Octet10 ::= DIVISION | | +-M-TMSI(continued) ::= INT (0..255) | +-Octet11 ::= DIVISION | | +-M-TMSI(continued) ::= INT (0..255) | +-Octet12 ::= DIVISION | +-M-TMSI(continued) ::= INT (0..255) +-UE network capability ::= LV | +-Octet1 ::= DIVISION | | +-Length of UE network capability contents ::= LEN (0..255) | +-Octet2 ::= DIVISION | | +-EEA0 ::= CHOICE [EPS encryption algorithm EEA0 supported] | | +-128-EEA1 ::= CHOICE [EPS encryption algorithm 128-EEA1 supported] | | +-128-EEA2 ::= CHOICE [EPS encryption algorithm 128-EEA2 supported] | | +-EEA3 ::= CHOICE [EPS encryption algorithm EEA3 not supported] | | +-EEA4 ::= CHOICE [EPS encryption algorithm EEA4 not supported] | | +-EEA5 ::= CHOICE [EPS encryption algorithm EEA5 not supported] | | +-EEA6 ::= CHOICE [EPS encryption algorithm EEA6 not supported] | | +-EEA7 ::= CHOICE [EPS encryption algorithm EEA7 not supported] | +-Octet3 ::= DIVISION | | +-spare ::= FIX | | +-128-EIA1 ::= CHOICE [EPS integrity algorithm 128-EIA1 supported] | +-128-EIA2 ::= CHOICE [EPS integrity algorithm 128-EIA2 supported] | | +-EIA3 ::= CHOICE [EPS integrity algorithm EIA3 not supported] | | +-EIA4 ::= CHOICE [EPS integrity algorithm EIA4 not supported] | | +-EIA5 ::= CHOICE [EPS integrity algorithm EIA5 not supported] | | +-EIA6 ::= CHOICE [EPS integrity algorithm EIA6 not supported] | | +-EIA7 ::= CHOICE [EPS integrity algorithm EIA7 not supported] | +-Octet4 ::= DIVISION | | +-UEA0 ::= CHOICE [UMTS encryption algorithm UEA0 not supported] | | +-UEA1 ::= CHOICE [UMTS encryption algorithm UEA1 not supported] | | +-UEA2 ::= CHOICE [UMTS encryption algorithm UEA2 not supported] | | +-UEA3 ::= CHOICE [UMTS encryption algorithm UEA3 not supported] | | +-UEA4 ::= CHOICE [UMTS encryption algorithm UEA4 not supported] | | +-UEA5 ::= CHOICE [UMTS encryption algorithm UEA5 not supported] | | +-UEA6 ::= CHOICE [UMTS encryption algorithm UEA6 not supported] | | +-UEA7 ::= CHOICE [UMTS encryption algorithm UEA7 not supported] | +-Octet5 ::= DIVISION | | +-UCS2 ::= CHOICE [The UE has a preference for the default alphabet (defined in 3GPP TS 23.038 ) over UCS2 (see ISO/IEC 10646 )] | | +-UIA1 ::= CHOICE [UMTS integrity algorithm UIA1 not supported] | | +-UIA2 ::= CHOICE [UMTS integrity algorithm UIA2 not supported] | | +-UIA3 ::= CHOICE [UMTS integrity algorithm UIA3 not supported] | | +-UIA4 ::= CHOICE [UMTS integrity algorithm UIA4 not supported] | | +-UIA5 ::= CHOICE [UMTS integrity algorithm UIA5 not supported] | | +-UIA6 ::= CHOICE [UMTS integrity algorithm UIA6 not supported] | | +-UIA7 ::= CHOICE [UMTS integrity algorithm UIA7 not supported] | +-Octet6 ::= DIVISION | | +-spare ::= FIX | | +-1xSRVCC ::= CHOICE [SRVCC from E-UTRAN to cdma2000 1xCS not supported] | | +-spare ::= FIX | +-Octet7-14 ::= DIVISION | +-Spare ::= OCTETARRAY SIZE(0..8) +-ESM message container ::= LV-E | +-Octet1-Octet2 ::= DIVISION | | +-Length of ESM message container ::= LEN (0..65535) | +-Octet3- ::= DIVISION | +-ESM message container contents ::= OCTETARRAY SIZE(0..65535) [0201D031D1271080000100000300000A00000C00000D00] +-Old P-TMSI signature ::= TV OPTIONAL:Omit | +-Octet1 ::= DIVISION | | +-P-TMSI signature IEI ::= IEI | +-Octet2-4 ::= DIVISION | +-P-TMSI signature value ::= INT (0..16777215) +-Additional GUTI ::= TLV OPTIONAL:Omit | +-Octet1 ::= DIVISION | | +-EPS mobile identity IEI ::= IEI | +-Octet2 ::= DIVISION | | +-Length of mobile identity IEI ::= LEN (0..255) | +-Octet3 ::= DIVISION | | +-Identity digit 1 ::= INT (0..15) | | +-Odd/even indication ::= CHOICE [even number of identity digits and also when the GUTI is used] | | +-Type of identity ::= CHOICE [IMSI] | +-Octet4 ::= DIVISION | +-Identity digit p ::= OCTETARRAY SIZE(0..10) +-Last visited registered TAI ::= TV OPTIONAL:Exist | +-Octet1 ::= DIVISION | | +-Tracking area identity IEI ::= IEI | +-Octet2 ::= DIVISION | | +-MCC digit 2 ::= INT (0..15) | | +-MCC digit 1 ::= INT (0..15) | +-Octet3 ::= DIVISION | | +-MNC digit 3 ::= INT (0..15) | | +-MCC digit 3 ::= INT (0..15) | +-Octet4 ::= DIVISION | | +-MNC digit 2 ::= INT (0..15) | | +-MNC digit 1 ::= INT (0..15) | +-Octet5 ::= DIVISION | | +-TAC ::= INT (0..255) | +-Octet6 ::= DIVISION | +-TAC(continued) ::= INT (0..255) +-DRX parameter ::= TV OPTIONAL:Omit +-MS network capability ::= TLV OPTIONAL:Omit +-Old location area identification ::= TV OPTIONAL:Omit +-TMSI status ::= TV OPTIONAL:Omit +-Mobile Station Classmark 2 ::= TLV OPTIONAL:Omit +-Mobile Station Classmark 3 ::= TLV OPTIONAL:Omit +-Supported Codecs ::= TLV OPTIONAL:Omit
如果解码 ESM message container contents 部分,会得到以下内容。
NAS_LTE:ESM,PDN connectivity request PDN connectivity request ::= DIVISION +-EPS bearer identity ::= V | +-EPS bearer identity value ::= CHOICE [No EPS bearer identity assigned] +-EPS session management protocol discriminator ::= V | +-Protocol discriminator ::= PD +-Procedure transaction identity ::= V | +-Procedure transaction identity ::= CHOICE [Procedure transaction identity value 1] +-PDN connectivity request message identity ::= V | +-Message type ::= MSG [D0] +-PDN type ::= V | +-spare ::= FIX | +-PDN type value ::= CHOICE [IPv4v6] +-Request type ::= V | +-Spare ::= FIX | +-Request type value ::= CHOICE [initial request] +-ESM information transfer flag ::= TV OPTIONAL:Exist | +-Octet1 ::= DIVISION | +-ESM information transfer flag IEI ::= IEI [D-] | +-spare ::= FIX | +-EIT value ::= CHOICE [security protected ESM information transfer required] +-Access point name ::= TLV OPTIONAL:Omit | +-Octet1 ::= DIVISION | | +-Access point name IEI ::= IEI | +-Octet2 ::= DIVISION | | +-Length of access point name contents ::= LEN (0..255) | +-Octet3-Octet102 ::= DIVISION | +-Access point name value ::= OCTETARRAY SIZE(0..100) +-Protocol configuration options ::= TLV OPTIONAL:Exist +-Octet1 ::= DIVISION | +-Protocol configuration options IEI ::= IEI +-Octet2 ::= DIVISION | +-Length of protocol config options contents ::= LEN (0..255) +-Octet3 ::= DIVISION | +-ext ::= EXT1 | +-spare ::= FIX | +-Configuration protocol ::= CHOICE [PPP for use with IP PDP type] +-Octet4-Octet253 ::= DIVISION +-protocol config options contents ::= OCTETARRAY SIZE(0..250) [000100000300000A00000C00000D00]
如下所述,这条消息里有几个重要信息。
ESM information transfer flag:根据 36.508 中「表 4.5.2.3-1:UE 注册流程(状态 1 到状态 2)」的第 9a1 步,网络必须按下面的描述执行 ESM : Information Request。
如果 UE 在最后一条 PDN CONNECTIVITY REQUEST 消息中设置了 ESM information transfer flag,那么 SS 将发送一条 ESM INFORMATION REQUEST 消息,以启动协议配置选项和/或 APN 的交换。
PDN Type:指定 UE 希望在 EPS 承载上使用的 IP 版本。网络在 Default(或 Dedicated)EPS Bearer Context Request 中可以采用相同的 IP 版本,也可以不采用。有些 UE 会接受网络在 EPS 承载建立步骤指定的任何 IP 版本,但也有些 UE 在网络于 Default(或 Dedicated)EPS Bearer Context Request 中指定的 IP 版本与本消息中的 PDN type 不一致时,无法建立 EPS 承载。
Access Point Name:围绕这个 APN 名称,UE 会表现出许多不同的行为。以下是我在几款不同设备上观察到的一些行为。
i) UE 在此不指定任何 APN,接受网络在 Activate Default EPS Bearer Context Request 中指定的任何 APN。
ii) UE 在此指定一个特定 APN,但接受网络在 Activate Default EPS Bearer Context Request 中指定的任何 APN。
iii) UE 在此指定一个特定 APN,若网络在 Activate Default EPS Bearer Context Request 中指定的 APN 与其不一致,则予以拒绝。
Protocol Configuration Options:关于协议配置选项内容的详细信息可从 TS24_008 的 10.5.6.3 Protocol configuration options 获得,可归纳如下。
这是一个相当复杂的话题,所以我会在单独的一篇笔记中展开。
接下来的两个步骤是首次以 RRC information transfer 消息作为容器的 NAS 交互。网络在 DLInformationTransfer 中发送 Authentication Request,UE 在 ULInformationTransfer 中以 Authentication Response 应答。两个步骤将在下一个标题下一并讲解。
「鉴权」(Authentication)流程类似于使用计算机时的「登录」流程。在 C2K 和 GSM 中,这个鉴权流程是「单向」的,即只有网络鉴权 UE,UE 不鉴权网络。你很容易想到,这会造成严重的安全问题。如果我搭建一个接受任何 UE 的假网络,就能诱骗 UE 驻留到假网络上,而不是它本应驻留的网络。(不过这种「单向」鉴权也让用网络模拟器测试 UE 变得非常容易 :-))
为了改善这一安全问题,LTE(WCDMA 同样)采用「双向」鉴权,即 UE 必须通过鉴权流程,网络也必须通过鉴权流程。
整个鉴权流程如下。(注意:该流程的完整细节请参见这篇笔记)
图注:UE 与网络之间的 LTE 鉴权序列:RAND、AUTN 与 RES
这个鉴权流程有三个主要组成部分:
i) 输入参数
ii) 鉴权算法
iii) 输出值(由鉴权算法用输入参数计算得到)。
UE 和网络使用相同的输入参数和相同的鉴权算法,因此两者应产生相同的输出值,否则鉴权失败。
需要牢记的一点是:UE 和网络之间只交换输入参数和输出值,而不交换鉴权算法。UE 侧的鉴权算法存储在 USIM 中,网络侧的鉴权算法存储在鉴权中心(Authentication Center)中。双方只是假设彼此使用完全相同的算法。
通常,测试和现网会使用不同的鉴权算法。测试中最常用的是我们常说的「Dummy XOR」算法,它定义在 36.508 第 4.9 节「LTE 通用测试 USIM 参数」和 34.408 第 8 节「WCDMA 测试 USIM 参数」中。
据我所知,现网中最常用的算法是 Milenage 算法。
下面是 Authentication Request 和 Authentication Response 的一个示例。你会注意到,RAND 和 AUTN 由 Authentication Request 消息携带,而 RES 值由 Authentication Response 携带。
NAS_LTE:EMM,Authentication request Authentication request ::= DIVISION +-Security header type ::= V | +-Security header type ::= CHOICE [Plain NAS message, not security protected] +-EPS mobility management protocol discriminator ::= V | +-Protocol discriminator ::= PD +-Authentication request message type ::= V | +-Message type ::= MSG +-Spare half octet ::= V | +-Spare half octet ::= FIX +-NAS key set identifier ASME ::= V | +-TSC ::= CHOICE [native security context (for KSI ASME)] | +-NAS key set identifier ::= CHOICE [possible values for the NAS key set identifier 0] +-Authentication parameter RAND ::= V | +-Octet1-Octet16 ::= DIVISION | +-RAND value ::= OCTETARRAY SIZE(16..16) [A3DE0C6D363E30C364A4078F1BF8D577] +-Authentication parameter AUTN ::= LV +-Octet1 ::= DIVISION | +-Length of AUTN contents ::= LEN (0..255) +-Octet2-Octet17 ::= DIVISION +-AUTN ::= OCTETARRAY SIZE(0..16) [5E726B56B4EC9001A3CF2E5E726BC6B5]
NAS_LTE:EMM,Authentication response Authentication response ::= DIVISION +-Security header type ::= V | +-Security header type ::= CHOICE [Plain NAS message, not security protected] +-EPS mobility management protocol discriminator ::= V | +-Protocol discriminator ::= PD +-Authentication response message identity ::= V | +-Message type ::= MSG +-Authentication response parameter ::= LV +-Octet1 ::= DIVISION | +-Length of Authentication response parameter contents ::= LEN (0..255) +-Octet2-17 ::= DIVISION +-RES ::= OCTETARRAY SIZE(0..16) [A3CF2E5E726B56B4]
鉴权完成后,UE 与 MME 共享新的 KASME,但此时 NAS 消息仍未受保护。NAS Security Mode Command 用于启动 NAS 完整性保护和加密。MME 发送这条消息时已用新的 NAS 安全上下文做了完整性保护,但尚未加密。
Security Mode Command 消息用于告知 UE 以下信息(指令)。
i) 我(网络)支持以下这些加密(ciphering)算法
ii) 我(网络)支持以下这些完整性保护算法
iii) 在我支持的加密算法中,与你的(UE)通信将使用「这个特定算法」。
iv) 在我支持的完整性保护算法中,与你的(UE)通信将使用「这个特定算法」。
在 LTE 中,NAS 和 RRC 使用各自独立的 Security Mode 流程;而在 WCDMA 中只有一个安全模式流程(仅 RRC)(NAS 消息嵌入在 RRC 消息中并作为 RRC 消息的一部分受到保护,因此是间接保护的)。标成蓝色的部分对应上面第 i) 和 ii) 项,标成红色的部分对应第 iii) 和 iv) 项。
NAS_LTE:EMM,Security mode command Security mode command ::= DIVISION +-Security header type ::= V | +-Security header type ::= CHOICE [Plain NAS message, not security protected] +-EPS mobility management protocol discriminator ::= V | +-Protocol discriminator ::= PD +-Security mode command message identity ::= V | +-Message type ::= MSG [5D] +-Selected NAS security algorithms ::= V | +-Octet1 ::= DIVISION | +-spare ::= FIX | +-Type of ciphering algorithm ::= CHOICE [EPS encryption algorithm EEA0(ciphering not used)] | +-spare ::= FIX | +-Type of integrity protection algorithm ::= CHOICE [Reserved 0] +-Spare half octet ::= V | +-Spare half octet ::= FIX +-NAS key set identifier ::= V | +-TSC ::= CHOICE [native security context (for KSI ASME)] | +-NAS key set identifier ::= CHOICE [possible values for the NAS key set identifier 0] +-Replayed UE security capabilities ::= LV | +-Octet1 ::= DIVISION | | +-Length of UE security capability contents ::= LEN (0..255) | +-Octet2 ::= DIVISION | | +-EEA0 ::= CHOICE [EPS encryption algorithm EEA0 supported] | | +-128-EEA1 ::= CHOICE [EPS encryption algorithm 128-EEA1 supported] | | +-128-EEA2 ::= CHOICE [EPS encryption algorithm 128-EEA2 supported] | | +-EEA3 ::= CHOICE [EPS encryption algorithm EEA3 not supported] | | +-EEA4 ::= CHOICE [EPS encryption algorithm EEA4 not supported] | | +-EEA5 ::= CHOICE [EPS encryption algorithm EEA5 not supported] | | +-EEA6 ::= CHOICE [EPS encryption algorithm EEA6 not supported] | | +-EEA7 ::= CHOICE [EPS encryption algorithm EEA7 not supported] | +-Octet3 ::= DIVISION | | +-spare ::= FIX | | +-128-EIA1 ::= CHOICE [EPS integrity algorithm 128-EIA1 supported] | | +-128-EIA2 ::= CHOICE [EPS integrity algorithm 128-EIA2 supported] | | +-EIA3 ::= CHOICE [EPS integrity algorithm EIA3 not supported] | | +-EIA4 ::= CHOICE [EPS integrity algorithm EIA4 not supported] | | +-EIA5 ::= CHOICE [EPS integrity algorithm EIA5 not supported] | | +-EIA6 ::= CHOICE [EPS integrity algorithm EIA6 not supported] | | +-EIA7 ::= CHOICE [EPS integrity algorithm EIA7 not supported] | +-Octet4 ::= DIVISION | | +-UEA0 ::= CHOICE [UMTS encryption algorithm UEA0 not supported] | | +-UEA1 ::= CHOICE [UMTS encryption algorithm UEA1 not supported] | | +-UEA2 ::= CHOICE [UMTS encryption algorithm UEA2 not supported] | | +-UEA3 ::= CHOICE [UMTS encryption algorithm UEA3 not supported] | | +-UEA4 ::= CHOICE [UMTS encryption algorithm UEA4 not supported] | | +-UEA5 ::= CHOICE [UMTS encryption algorithm UEA5 not supported] | | +-UEA6 ::= CHOICE [UMTS encryption algorithm UEA6 not supported] | | +-UEA7 ::= CHOICE [UMTS encryption algorithm UEA7 not supported] | +-Octet5 ::= DIVISION | | +-spare ::= FIX | | +-UIA1 ::= CHOICE [UMTS integrity algorithm UIA1 not supported] | | +-UIA2 ::= CHOICE [UMTS integrity algorithm UIA2 not supported] | | +-UIA3 ::= CHOICE [UMTS integrity algorithm UIA3 not supported] | | +-UIA4 ::= CHOICE [UMTS integrity algorithm UIA4 not supported] | | +-UIA5 ::= CHOICE [UMTS integrity algorithm UIA5 not supported] | | +-UIA6 ::= CHOICE [UMTS integrity algorithm UIA6 not supported] | | +-UIA7 ::= CHOICE [UMTS integrity algorithm UIA7 not supported] | +-Octet6 ::= DIVISION | +-spare ::= FIX | +-GEA1 ::= CHOICE [GPRS encryption algorithm GEA1 not supported] | +-GEA2 ::= CHOICE [GPRS encryption algorithm GEA2 not supported] | +-GEA3 ::= CHOICE [GPRS encryption algorithm GEA3 not supported] | +-GEA4 ::= CHOICE [GPRS encryption algorithm GEA4 not supported] | +-GEA5 ::= CHOICE [GPRS encryption algorithm GEA5 not supported] | +-GEA6 ::= CHOICE [GPRS encryption algorithm GEA6 not supported] | +-GEA7 ::= CHOICE [GPRS encryption algorithm GEA7 not supported] +-IMEISV request ::= TV OPTIONAL:Omit | +-Octet1 ::= DIVISION | +-IMEISV request IEI ::= IEI [C-] | +-spare ::= FIX | +-IMEISV request value ::= CHOICE [IMEISV not requested] +-Replayed nonce UE ::= TV OPTIONAL:Omit | +-Octet1 ::= DIVISION | | +-Nonce IEI ::= IEI | +-Octet2-Octet5 ::= DIVISION | +-Nonce value ::= OCTETARRAY SIZE(4..4) +-Nonce MME ::= TV OPTIONAL:Omit +-Octet1 ::= DIVISION | +-Nonce IEI ::= IEI +-Octet2-Octet5 ::= DIVISION +-Nonce value ::= OCTETARRAY SIZE(4..4)
Security Mode Complete 是对「Security Mode Command」消息的应答,因此很简单。如果 UE 也支持网络想使用的完整性保护、安全算法,就发送「Security Mode Complete」;如果不支持,就发送「Security Mode Failure」。
NAS_LTE:EMM,Security mode complete Security mode complete ::= DIVISION +-Security header type ::= V | +-Security header type ::= CHOICE [Plain NAS message, not security protected] +-EPS mobility management protocol discriminator ::= V | +-Protocol discriminator ::= PD +-Security mode complete message identity ::= V | +-Message type ::= MSG [5E] +-IMEISV ::= TLV OPTIONAL:Omit +-Octet1 ::= DIVISION | +-Mobile Identity IEI ::= IEI +-Octet2 ::= DIVISION | +-Length of mobile identity contents ::= LEN (0..255) +-Octet3 ::= DIVISION | +-Identity digit 1 ::= INT (0..15) | +-Odd/even indication ::= CHOICE [even number of identity digits and also when the TMSI/P-TMSI is used] | +-Type of identity ::= CHOICE [No Identity] +-Octet4-Octet11 ::= DIVISION +-Identity digit p ::= OCTETARRAY SIZE(0..8)
NAS Security Mode Command 保护 UE 与 MME 之间的 NAS 消息。AS 仍需要自己的密钥来保护 UE 与 eNB 之间的 SRB1、SRB2 和 DRB,这条消息就是用来激活它们的。命令及其应答都受完整性保护,加密只在流程完成后才启动。
这一步与 NAS:Security Mode Command 相同,唯一的区别是它只针对 RRC 消息。
RRC_LTE:DL-DCCH-Message DL-DCCH-Message ::= SEQUENCE +-message ::= CHOICE [c1] +-c1 ::= CHOICE [securityModeCommand] +-securityModeCommand ::= SEQUENCE +-rrc-TransactionIdentifier ::= INTEGER (0..3) +-criticalExtensions ::= CHOICE [c1] +-c1 ::= CHOICE [securityModeCommand-r8] +-securityModeCommand-r8 ::= SEQUENCE +-securityConfigSMC ::= SEQUENCE | +-securityAlgorithmConfig ::= SEQUENCE | +-cipheringAlgorithm ::= ENUMERATED [eea1] | +-integrityProtAlgorithm ::= ENUMERATED [eia1] +-nonCriticalExtension ::= SEQUENCE OPTIONAL:Omit
- 加密算法参数请参见 EEA 一节。
- 完整性保护算法参数请参见 EIA 一节。
UL-DCCH-Message ::= SEQUENCE +-message ::= CHOICE [c1] +-c1 ::= CHOICE [securityModeComplete] +-securityModeComplete ::= SEQUENCE +-rrc-TransactionIdentifier ::= INTEGER (0..3) +-criticalExtensions ::= CHOICE [securityModeComplete-r8] +-securityModeComplete-r8 ::= SEQUENCE +-nonCriticalExtension ::= SEQUENCE OPTIONAL:Omit
RRC : UE Capability Enquiry
随着移动业务的种类越来越丰富,网络需要准确了解 UE 的能力,才能为每个 UE 提供合适的服务。举例来说,如果网络对一个不支持某项能力的 UE 触发 interRAT 切换会怎样?那将导致通信中断。
在 WCDMA 中,网络可以在 RRC Connection Setup Complete 消息中掌握 UE 能力的全部细节,因为 UE 会在这条消息中上报其能力的全部细节。然而,LTE 的 RRC Connection Setup Complete 消息并不携带这类信息。取而代之,LTE 设计了专门用于探询 UE 能力的新消息,这就是 UE Capability Enquiry 和 UE Capability Information 消息的作用。
严格来说,这是一个可选步骤,但随着 LTE 业务的演进,它正变得越来越关键。
下面是 ue-CapabilityRequest 消息的一个示例,它的含义是「上报你的全部 LTE 能力和 UTRA 能力」。
DL-DCCH-Message ::= SEQUENCE +-message ::= CHOICE [c1] +-c1 ::= CHOICE [ueCapabilityEnquiry] +-ueCapabilityEnquiry ::= SEQUENCE +-rrc-TransactionIdentifier ::= INTEGER (0..3) +-criticalExtensions ::= CHOICE [c1] +-c1 ::= CHOICE [ueCapabilityEnquiry-r8] +-ueCapabilityEnquiry-r8 ::= SEQUENCE +-ue-CapabilityRequest ::= SEQUENCE OF SIZE(1..maxRAT-Capabilities) | +-RAT-Type ::= ENUMERATED [eutra] | +-RAT-Type ::= ENUMERATED [utra] +-nonCriticalExtension ::= SEQUENCE OPTIONAL:Omit
RRC : UE Capability Information
这条消息是对 UE Capability Request 消息的应答,携带 UE 能力的全部细节。由于这是一条非常复杂、种类繁多的消息,我为 UE Capability Information 单独建了一节。
RRC : RRC Connection Reconfiguration + NAS : Attach Accept + NAS : Activate Default EPS Bearer Context Request
这一步是网络完成附着并为 UE 提供数据路径的环节。一条 RRC Connection Reconfiguration 承载了三层内容:RRC 部分建立 SRB2 和 DRB;NAS 部分是 Attach Accept;而 Attach Accept 内又携带 ESM 的 Activate Default EPS Bearer Context Request。
这一步执行的一个重要流程是「ESM : Activate Default EPS Bearer Context Request」。
这里你会注意到一点:在 LTE 中,分组呼叫由网络发起;而在 UMTS 中,大多数分组呼叫由 UE 发起。网络在这里为 UE 指定一个 IP 地址。
如果你有 WCDMA 协议的经验,可以把这条消息理解为「Radio Bearer Setup」+「Attach Accept」+「Activate PDP Context Accept」的类似物。
在这一步,UE 从网络获得一个 IP 地址。即使之后执行「RRC Connection Release」、UE 进入 IDLE 模式,这个 IP 也不会交还给网络。
图注:RRC Connection Reconfiguration 消息树:携带 Attach Accept 与 Activate Default EPS Bearer Request
下面是 RRC Connection Reconfiguration 的一个示例。本节中的示例来自非常早期的 LTE UE,因此与较新的设备相比可能过于简化。我会持续补充来自各种不同条件下的该消息示例。
- 仅 IPv4 的示例:RRC Connection Reconfiguration+Attach Complete+Activate Default EPS Bearer Req
- 仅 IPv6 的示例:RRC Connection Reconfiguration+Activate Default EPS Bearer Req
- IPv4v6 的示例:RRC Connection Reconfiguration+Activate Default EPS Bearer Req 不要试图钻研这条消息的所有细节,它是 LTE 中最复杂的消息之一。只需理解整体结构,并把上面的树状图与下面的真实消息做对比即可。
要理解所有这些元素的全部细节可能需要几个月,所以不用着急。
每当你把上面树状图中的某个主题再钻研得深一点,就回到本节,看看你所学主题下的细节。如果你能完全理解下面展示的所有信息元素,就可以说已精通 LTE。再次提醒,不要试图一次全部弄懂,那只会让你血压升高。尽可能频繁地浏览这些条目,先熟悉整体结构。
DL-DCCH-Message ::= SEQUENCE +-message ::= CHOICE [c1] +-c1 ::= CHOICE [rrcConnectionReconfiguration] +-rrcConnectionReconfiguration ::= SEQUENCE +-rrc-TransactionIdentifier ::= INTEGER (0..3) +-criticalExtensions ::= CHOICE [c1] +-c1 ::= CHOICE [rrcConnectionReconfiguration-r8] +-rrcConnectionReconfiguration-r8 ::= SEQUENCE +-measConfig ::= SEQUENCE OPTIONAL:Omit +-mobilityControlInfo ::= SEQUENCE OPTIONAL:Omit +-dedicatedInfoNASList ::= SEQUENCE OF SIZE(1..maxDRB) OPTIONAL:Exist | +-DedicatedInfoNAS ::= OCTET STRING SIZE(ALIGNED) [074201E0060000F1100001002C5201C101091003777777 07616E726974737503636F6D05010A012037270E808021 0A0300000A81060A000001500BF600F11080010100000001] +-radioResourceConfigDedicated ::= SEQUENCE OPTIONAL:Exist | +-srb-ToAddModList ::= SEQUENCE OF SIZE(1..2) OPTIONAL:Exist | | +-SRB-ToAddMod ::= SEQUENCE | | +-srb-Identity ::= INTEGER (1..2) | | +-rlc-Config ::= CHOICE [defaultValue] OPTIONAL:Exist | | | +-defaultValue ::= NULL | | +-logicalChannelConfig ::= CHOICE [defaultValue] OPTIONAL:Exist | | +-defaultValue ::= NULL | +-drb-ToAddModList ::= SEQUENCE OF SIZE(1..maxDRB) OPTIONAL:Exist | | +-DRB-ToAddMod ::= SEQUENCE | | +-eps-BearerIdentity ::= INTEGER (0..15) OPTIONAL:Exist | | +-drb-Identity ::= INTEGER (1..32) | | +-pdcp-Config ::= SEQUENCE OPTIONAL:Exist | | | +-discardTimer ::= ENUMERATED [infinity] OPTIONAL:Exist | | | +-rlc-AM ::= SEQUENCE OPTIONAL:Omit | | | +-rlc-UM ::= SEQUENCE OPTIONAL:Exist | | | | +-pdcp-SN-Size ::= ENUMERATED [len12bits] | | | +-headerCompression ::= CHOICE [notUsed] | | | +-notUsed ::= NULL | | +-rlc-Config ::= CHOICE [um-Bi-Directional] OPTIONAL:Exist | | | +-um-Bi-Directional ::= SEQUENCE | | | +-ul-UM-RLC ::= SEQUENCE | | | | +-sn-FieldLength ::= ENUMERATED [size10] | | | +-dl-UM-RLC ::= SEQUENCE | | | +-sn-FieldLength ::= ENUMERATED [size10] | | | +-t-Reordering ::= ENUMERATED [ms50] | | +-logicalChannelIdentity ::= INTEGER (3..10) OPTIONAL:Exist | | +-logicalChannelConfig ::= SEQUENCE OPTIONAL:Exist | | +-ul-SpecificParameters ::= SEQUENCE OPTIONAL:Exist | | +-priority ::= INTEGER (1..16) | | +-prioritisedBitRate ::= ENUMERATED [infinity] | | +-bucketSizeDuration ::= ENUMERATED [ms100] | | +-logicalChannelGroup ::= INTEGER (0..3) OPTIONAL:Exist | +-drb-ToReleaseList ::= SEQUENCE OF OPTIONAL:Omit | +-mac-MainConfig ::= CHOICE [explicitValue] OPTIONAL:Exist | | +-explicitValue ::= SEQUENCE | | +-ul-SCH-Config ::= SEQUENCE OPTIONAL:Exist | | | +-maxHARQ-Tx ::= ENUMERATED [n5] OPTIONAL:Exist | | | +-periodicBSR-Timer ::= ENUMERATED [sf20] OPTIONAL:Exist | | | +-retxBSR-Timer ::= ENUMERATED [sf320] | | | +-ttiBundling ::= BOOLEAN [FALSE] | | +-drx-Config ::= CHOICE [release] OPTIONAL:Exist | | | +-release ::= NULL | | +-timeAlignmentTimerDedicated ::= ENUMERATED [infinity] | | +-phr-Config ::= CHOICE [setup] OPTIONAL:Exist | | +-setup ::= SEQUENCE | | +-periodicPHR-Timer ::= ENUMERATED [sf500] | | +-prohibitPHR-Timer ::= ENUMERATED [sf200] | | +-dl-PathlossChange ::= ENUMERATED [dB3] | +-sps-Config ::= SEQUENCE OPTIONAL:Omit | +-physicalConfigDedicated ::= SEQUENCE OPTIONAL:Exist | +-pdsch-ConfigDedicated ::= SEQUENCE OPTIONAL:Omit | +-pucch-ConfigDedicated ::= SEQUENCE OPTIONAL:Omit | +-pusch-ConfigDedicated ::= SEQUENCE OPTIONAL:Omit | +-uplinkPowerControlDedicated ::= SEQUENCE OPTIONAL:Omit | +-tpc-PDCCH-ConfigPUCCH ::= CHOICE [setup] OPTIONAL:Exist | | +-setup ::= SEQUENCE | | +-tpc-RNTI ::= BIT STRING SIZE(16) | | +-tpc-Index ::= CHOICE [indexOfFormat3] | | +-indexOfFormat3 ::= INTEGER (1..15) | +-tpc-PDCCH-ConfigPUSCH ::= CHOICE [setup] OPTIONAL:Exist | | +-setup ::= SEQUENCE | | +-tpc-RNTI ::= BIT STRING SIZE(16) | | +-tpc-Index ::= CHOICE [indexOfFormat3] | | +-indexOfFormat3 ::= INTEGER (1..15) | +-cqi-ReportConfig ::= SEQUENCE OPTIONAL:Omit | +-soundingRS-UL-ConfigDedicated ::= CHOICE OPTIONAL:Omit | +-antennaInfo ::= CHOICE [explicitValue] OPTIONAL:Exist | | +-explicitValue ::= SEQUENCE | | +-transmissionMode ::= ENUMERATED [tm1] | | +-codebookSubsetRestriction ::= CHOICE OPTIONAL:Omit | | +-ue-TransmitAntennaSelection ::= CHOICE [release] | | +-release ::= NULL | +-schedulingRequestConfig ::= CHOICE OPTIONAL:Omit +-securityConfigHO ::= SEQUENCE OPTIONAL:Omit +-nonCriticalExtension ::= SEQUENCE OPTIONAL:Omit
虽然上面展示的解码消息看起来已经很复杂,但它并未完全解码,只展示了 RRC 部分的解码。如果解码这条消息中的 NAS 部分,会得到以下内容。
必须牢记的一点是:填充这条消息时要非常小心,使它能正确处理/匹配 UE 通过 Attach Request 发来的信息,否则将导致注册失败。
AS_LTE:EMM,Attach accept Attach accept ::= DIVISION +-Security header type ::= V | +-Security header type ::= CHOICE [Plain NAS message, not security protected] +-EPS mobility management protocol discriminator ::= V | +-Protocol discriminator ::= PD +-Attach accept message identity ::= V | +-Message type ::= MSG +-Spare half octet ::= V | +-Spare half octet ::= FIX +-EPS attach result ::= V | +-Spare ::= FIX | +-EPS attach result value ::= CHOICE [EPS only] +-T3412 value ::= V | +-Octet1 ::= DIVISION | +-Unit ::= CHOICE [value indicates that the timer is deactivated] | +-Timer value ::= INT (0..31) +-TAI list ::= LV | +-Octet1 ::= DIVISION | | +-Length of tracking area identity list contents ::= LEN (0..255) | +-Octet2-97 ::= DIVISION | +-tracking area identity list contents ::= OCTETARRAY SIZE(0..96) [0000F1100001] +-ESM message container ::= LV-E | +-Octet1-Octet2 ::= DIVISION | | +-Length of ESM message container ::= LEN (0..65535) | +-Octet3- ::= DIVISION | +-ESM message container contents ::= OCTETARRAY SIZE(0..65535) [5201C10109100377777707616E726974737503636F6D 05010A012037270E8080210A0300000A81060A000001] +-GUTI ::= TLV OPTIONAL:Exist | +-Octet1 ::= DIVISION | | +-EPS mobile identity IEI ::= IEI | +-Octet2 ::= DIVISION | | +-Length of EPS mobile identity contents ::= LEN (0..255) | +-Octet3 ::= DIVISION | | +-Spare ::= FIX [F] | | +-Odd/even indication ::= CHOICE [even number of identity digits and also when the GUTI is used] | | +-Type of identity ::= CHOICE [GUTI] | +-Octet4 ::= DIVISION | | +-MCC digit 2 ::= INT (0..15) | | +-MCC digit 1 ::= INT (0..15) | +-Octet5 ::= DIVISION | | +-MNC digit 3 ::= INT (0..15) | | +-MCC digit 3 ::= INT (0..15) | +-Octet6 ::= DIVISION | | +-MNC digit 2 ::= INT (0..15) | | +-MNC digit 1 ::= INT (0..15) | +-Octet7 ::= DIVISION | | +-MME Group ID ::= INT (0..255) | +-Octet8 ::= DIVISION | | +-MME Group ID(continued) ::= INT (0..255) | +-Octet9 ::= DIVISION | | +-MME Code ::= INT (0..255) | +-Octet10 ::= DIVISION | | +-M-TMSI ::= INT (0..255) | +-Octet11 ::= DIVISION | | +-M-TMSI(continued) ::= INT (0..255) | +-Octet12 ::= DIVISION | | +-M-TMSI(continued) ::= INT (0..255) | +-Octet13 ::= DIVISION | +-M-TMSI(continued) ::= INT (0..255) +-Location area identification ::= TV OPTIONAL:Omit | +-Octet1 ::= DIVISION | | +-Location Area Identification IEI ::= IEI | +-Octet2 ::= DIVISION | | +-MCC digit 2 ::= INT (0..15) | | +-MCC digit 1 ::= INT (0..15) | +-Octet3 ::= DIVISION | | +-MNC digit 3 ::= INT (0..15) | | +-MCC digit 3 ::= INT (0..15) | +-Octet4 ::= DIVISION | | +-MNC digit 2 ::= INT (0..15) | | +-MNC digit 1 ::= INT (0..15) | +-Octet5 ::= DIVISION | | +-LAC ::= INT (0..255) | +-Octet6 ::= DIVISION | +-LAC (continued) ::= INT (0..255) +-MS identity ::= TLV OPTIONAL:Omit | +-Octet1 ::= DIVISION | | +-Mobile Identity IEI ::= IEI | +-Octet2 ::= DIVISION | | +-Length of mobile identity contents ::= LEN (0..255) | +-Octet3 ::= DIVISION | | +-Identity digit 1 ::= INT (0..15) | | +-Odd/even indication ::= CHOICE [even number of identity digits and also when the TMSI/P-TMSI is used] | | +-Type of identity ::= CHOICE [No Identity] | +-Octet4-Octet10 ::= DIVISION | +-Identity digit p ::= OCTETARRAY SIZE(0..7) +-EMM cause ::= TV OPTIONAL:Omit | +-Octet1 ::= DIVISION | | +-EMM cause IEI ::= IEI | +-Octet2 ::= DIVISION | +-Cause value ::= CHOICE [#2:IMSI unknown in HSS] +-T3402 value ::= TV OPTIONAL:Omit | +-Octet1 ::= DIVISION | | +-GPRS Timer IEI ::= IEI | +-Octet2 ::= DIVISION | +-Unit ::= CHOICE [value is incremented in multiples of 2 seconds] | +-Timer value ::= INT (0..31) +-T3423 value ::= TV OPTIONAL:Omit | +-Octet1 ::= DIVISION | | +-GPRS Timer IEI ::= IEI | +-Octet2 ::= DIVISION | +-Unit ::= CHOICE [value is incremented in multiples of 2 seconds] | +-Timer value ::= INT (0..31) +-Equivalent PLMNs ::= TLV OPTIONAL:Omit | +-Octet1 ::= DIVISION | | +-PLMN List IEI ::= IEI [4A] | +-Octet2 ::= DIVISION | | +-Length of PLMN List contents ::= LEN (0..255) | +-Octet3 ::= DIVISION | | +-MCC digit 2 PLMN 1 ::= INT (0..15) | | +-MCC digit 1 PLMN 1 ::= INT (0..15) ..... Octet 4 - Octet 45 ..... | +-Octet46 ::= DIVISION | | +-MNC digit 3 PLMN 15 ::= INT (0..15) | | +-MCC digit 3 PLMN 15 ::= INT (0..15) | +-Octet47 ::= DIVISION | +-MNC digit 2 PLMN 15 ::= INT (0..15) | +-MNC digit 1 PLMN 15 ::= INT (0..15) +-Emergency Number List ::= TLV OPTIONAL:Omit | +-Octet1 ::= DIVISION | | +-Emergency Number List IEI ::= IEI | +-Octet2 ::= DIVISION | | +-Length of Emergency Number List IE contents ::= LEN (0..255) | +-Octet3-50 ::= DIVISION | +-Emergency Number List IE contents ::= OCTETARRAY SIZE(0..48) +-EPS network feature support ::= TLV OPTIONAL:Omit | +-Octet1 ::= DIVISION | | +-EPS network feature support IEI ::= IEI | +-Octet2 ::= DIVISION | | +-Length of EPS network feature support contents ::= LEN (0..255) | +-Octet3 ::= DIVISION | +-Spare ::= FIX | +-IMS VoPS ::= CHOICE [IMS voice over PS session in S1 mode not supported] +-Additional update result ::= TV OPTIONAL:Omit +-Octet1 ::= DIVISION +-Additional update result IEI ::= IEI [F-] +-Spare ::= FIX +-Additional update result value ::= CHOICE [no additional information]
查看上面的内容可以看到「ESM message container contents」,它还可以进一步解码如下。标成蓝色的信息元素(IE)是 UE 接入数据业务应用时最重要的几个 IE。
NAS_LTE:ESM,Activate default EPS bearer context request Activate default EPS bearer context request ::= DIVISION +-EPS bearer identity ::= V | +-EPS bearer identity value ::= CHOICE [EPS bearer identity value 5] +-EPS session management protocol discriminator ::= V | +-Protocol discriminator ::= PD +-Procedure transaction identity ::= V | +-Procedure transaction identity ::= CHOICE [Procedure transaction identity value 1] +-Activate default EPS bearer context request message identity ::= V | +-Message type ::= MSG [C1] +-EPS QoS ::= LV | +-Octet1 ::= DIVISION | | +-Length of EPS quality of service contents ::= LEN (0..255) | +-Octet2 ::= DIVISION | | +-QCI ::= CHOICE [QCI 9] | +-Octet3 ::= DIVISION | | +-Maximum bit rate for uplink ::= CHOICE [Reserved(network to UE direction)/Subscribed maximum bit rate for uplink(UE to network direction)] | +-Octet4 ::= DIVISION | | +-Maximum bit rate for downlink ::= CHOICE [Reserved(network to UE direction)/Subscribed maximum bit rate for uplink(UE to network direction)] | +-Octet5 ::= DIVISION | | +-Guaranteed bit rate for uplink ::= CHOICE [Reserved(network to UE direction)/Subscribed maximum bit rate for uplink(UE to network direction)] | +-Octet6 ::= DIVISION | | +-Guaranteed bit rate for downlink ::= CHOICE [Reserved(network to UE direction)/Subscribed maximum bit rate for uplink(UE to network direction)] | +-Octet7 ::= DIVISION | | +-Maximum bit rate for uplink (extended) ::= CHOICE [Use the value indicated by the maximum bit rate for uplink in octet 4] | +-Octet8 ::= DIVISION | | +-Maximum bit rate for downlink (extended) ::= CHOICE [Use the value indicated by the maximum bit rate for uplink in octet 4] | +-Octet9 ::= DIVISION | | +-Guaranteed bit rate for uplink (extended) ::= CHOICE [Use the value indicated by the guaranteed bit rate for uplink in octet 6] | +-Octet10 ::= DIVISION | +-Guaranteed bit rate for downlink (extended) ::= CHOICE [Use the value indicated by the guaranteed bit rate for uplink in octet 6] +-Access point name ::= LV | +-Octet1 ::= DIVISION | | +-Length of access point name contents ::= LEN (0..255) | +-Octet2-Octet101 ::= DIVISION | +-Access point name value ::= OCTETARRAY SIZE(0..100) [0377777707616E726974737503636F6D] +-PDN address ::= LV | +-Octet1 ::= DIVISION | | +-Length of PDN address contents ::= LEN (0..255) | +-Octet2 ::= DIVISION | | +-spare ::= FIX | | +-PDN type value ::= CHOICE [IPv4] | +-Octet3-14 ::= DIVISION | +-PDN address information ::= OCTETARRAY SIZE(0..12) [0A012037] +-Transaction identifier ::= TLV OPTIONAL:Omit | +-Octet1 ::= DIVISION | | +-Transaction identifier IEI ::= IEI [5D] | +-Octet2 ::= DIVISION | | +-Length of Transaction identifier contents ::= LEN (0..255) | +-Octet3 ::= DIVISION | | +-TI flag ::= CHOICE [The message is sent from the side that originates the TI] | | +-TIO ::= CHOICE [TI value 0] | | +-Spare ::= FIX | +-Octet4 ::= DIVISION | +-ext ::= EXT (0..1) | +-TIE ::= CHOICE [Reserved] +-Negotiated QoS ::= TLV OPTIONAL:Omit | +-Octet1 ::= DIVISION | | +-Quality of service IEI ::= IEI | +-Octet2 ::= DIVISION | | +-Length of quality of service IE ::= LEN (0..255) | +-Octet3 ::= DIVISION | | +-spare ::= FIX | | +-Delay class ::= CHOICE [Subscribed delay class(MS to network direction)/Reserved(network to MS direction)] | | +-Reliability class ::= CHOICE [Subscribed reliability class(MS to network direction)/Reserved(network to MS direction)] | +-Octet4 ::= DIVISION | | +-Peak throughput ::= CHOICE [Subscribed peak throughput(MS to network direction)/Reserved(network to MS direction)] | | +-spare ::= FIX | | +-Precedence class ::= CHOICE [Subscribed precedence(MS to network direction)/Reserved(network to MS direction)] | +-Octet5 ::= DIVISION | | +-spare ::= FIX | | +-Mean throughput ::= CHOICE [Subscribed mean throughput(MS to network direction)/Reserved(network to MS direction)] | +-Octet6 ::= DIVISION | | +-Traffic Class ::= CHOICE [Subscribed traffic class(MS to network direction)/Reserved(network to MS direction)] | | +-Delivery order ::= CHOICE [Subscribed delivery order(MS to network direction)/Reserved(network to MS direction)] | | +-Delivery of erroneous SDUs ::= CHOICE [Subscribed delivery of erroneous SDUs(MS to network direction)/Reserved(network to MS direction)] | +-Octet7 ::= DIVISION | | +-Maximum SDU size ::= CHOICE [Subscribed maximum SDU size(MS to network direction)/Reserved(network to MS direction)] | +-Octet8 ::= DIVISION | | +-Maximum bit rate for uplink ::= CHOICE [Subscribed maximum bit rate for uplink(MS to network direction)/Reserved(network to MS direction)] | +-Octet9 ::= DIVISION | | +-Maximum bit rate for downlink ::= CHOICE [Subscribed maximum bit rate for uplink(MS to network direction)/Reserved(network to MS direction)] | +-Octet10 ::= DIVISION | | +-Residual BER ::= CHOICE [Subscribed residual BER(MS to network direction)/Reserved(network to MS direction)] | | +-SDU error ratio ::= CHOICE [Subscribed SDU error ratio(MS to network direction)/Reserved(network to MS direction)] | +-Octet11 ::= DIVISION | | +-Transfer delay ::= CHOICE [Subscribed transfer delay(MS to network direction)/Reserved(network to MS direction)] | | +-Traffic Handling priority ::= CHOICE [Subscribed traffic handling priority(MS to network direction)/Reserved(network to MS direction)] | +-Octet12 ::= DIVISION | | +-Guaranteed bit rate for uplink ::= INT (0..255) | +-Octet13 ::= DIVISION | | +-Guaranteed bit rate for downlink ::= INT (0..255) | +-Octet14 ::= DIVISION | | +-Spare ::= FIX | | +-Signalling Indication ::= CHOICE [Not optimised for signalling traffic] | | +-Source Statistics Descriptor ::= CHOICE [unknown] | +-Octet15 ::= DIVISION | | +-Maximum bit rate for downlink (extended) ::= CHOICE [Use the value indicated by the Maximum bit rate for downlink in octet 9.] | +-Octet16 ::= DIVISION | | +-Guaranteed bit rate for downlink (extended) ::= CHOICE [Use the value indicated by the Maximum bit rate for downlink in octet 9.] | +-Octet17 ::= DIVISION | | +-Maximum bit rate for uplink (extended) ::= CHOICE [Use the value indicated by the Maximum bit rate for downlink in octet 9.] | +-Octet18 ::= DIVISION | +-Guaranteed bit rate for uplink (extended) ::= CHOICE [Use the value indicated by the Maximum bit rate for downlink in octet 9.] +-Negotiated LLC SAPI ::= TV OPTIONAL:Omit | +-Octet1 ::= DIVISION | | +-LLC SAPI IEI ::= IEI | +-Octet2 ::= DIVISION | +-Spare ::= FIX | +-LLC SAPI value ::= CHOICE [LLC SAPI not assigned] +-Radio priority ::= TV OPTIONAL:Omit | +-Octet1 ::= DIVISION | +-Radio priority IEI ::= IEI [8-] | +-spare ::= FIX | +-Radio priority level value ::= CHOICE [priority level 1 (highest)] +-Packet flow identifier ::= TLV OPTIONAL:Omit | +-Octet1 ::= DIVISION | | +-Packet Flow Identifier IEI ::= IEI | +-Octet2 ::= DIVISION | | +-Length of Packet Flow Identifier IE ::= LEN (0..255) | +-Octet3 ::= DIVISION | +-spare ::= FIX | +-Packet Flow Identifier value ::= CHOICE [Best Effort] +-APN-AMBR ::= TLV OPTIONAL:Omit | +-Octet1 ::= DIVISION | | +-APN aggregate maximum bit rate IEI ::= IEI [5E] | +-Octet2 ::= DIVISION | | +-Length of APN aggregate maximum bit rate contents ::= LEN (0..255) | +-Octet3 ::= DIVISION | | +-APN-AMBR for downlink ::= CHOICE [1kbps] | +-Octet4 ::= DIVISION | | +-APN-AMBR for uplink ::= CHOICE [1kbps] | +-Octet5 ::= DIVISION | | +-APN-AMBR for downlink (extended) ::= CHOICE [Use the value indicated by the APN-AMBR for downlink in octet 3] | +-Octet6 ::= DIVISION | | +-APN-AMBR for uplink (extended) ::= CHOICE [8700kbps] | +-Octet7 ::= DIVISION | | +-APN-AMBR for downlink (extended-2) ::= CHOICE [Use the value indicated by the APN-AMBR for downlink and APN-AMBR for downlink (extended) in octets 3 and 5 0] | +-Octet8 ::= DIVISION | +-APN-AMBR for uplink (extended-2) ::= CHOICE [Use the value indicated by the APN-AMBR for downlink and APN-AMBR for downlink (extended) in octets 3 and 5 0] +-ESM cause ::= TV OPTIONAL:Omit | +-Octet1 ::= DIVISION | | +-ESM cause IEI ::= IEI | +-Octet2 ::= DIVISION | +-Cause value ::= CHOICE [#8:Operator Determined Barring] +-Protocol configuration options ::= TLV OPTIONAL:Exist +-Octet1 ::= DIVISION | +-Protocol configuration options IEI ::= IEI +-Octet2 ::= DIVISION | +-Length of protocol config options contents ::= LEN (0..255) +-Octet3 ::= DIVISION | +-ext ::= EXT1 | +-spare ::= FIX | +-Configuration protocol ::= CHOICE [PPP for use with IP PDP type] +-Octet4-Octet253 ::= DIVISION +-protocol config options contents ::= OCTETARRAY SIZE(0..250) [80210A0300000A81060A000001]
这里有一件你必须了解的事,即如何指定 PDN 地址。下面三个例子应当足以说明问题(我希望如此 :-))。关于 IPv6 的更多细节,请参见 IPv6 一节。
注意:IP 分配流程的细节,IPv4 请参见这篇笔记,IPv6 请参见这篇笔记。
< Example : IPv4 >
+-PDN address ::= LV | +-Octet1 ::= DIVISION | | +-Length of PDN address contents ::= LEN (0..255) | +-Octet2 ::= DIVISION | | +-spare ::= FIX | | +-PDN type value ::= CHOICE [IPv4] | +-Octet3-14 ::= DIVISION | +-PDN address information ::= OCTETARRAY SIZE(0..12) [0A012037]
< Example : IPv6 >
:指定 IPv6 地址的链路本地地址(link local address)。
+-PDN address ::= LV | +-Octet1 ::= DIVISION | | +-Length of PDN address contents ::= LEN (0..255) | +-Octet2 ::= DIVISION | | +-spare ::= FIX | | +-PDN type value ::= CHOICE [IPv6] | +-Octet3-14 ::= DIVISION | +-PDN address information ::= OCTETARRAY SIZE(0..12)
< Example : IPv4v6 >
:先指定 IPv6 地址的链路本地地址,随后跟 IPv4 地址。
+-PDN address ::= LV | +-Octet1 ::= DIVISION | | +-Length of PDN address contents ::= LEN (0..255) | +-Octet2 ::= DIVISION | | +-spare ::= FIX | | +-PDN type value ::= CHOICE [IPv4v6] | +-Octet3-14 ::= DIVISION | +-PDN address information ::= OCTETARRAY SIZE(0..12) [00000000010100020A0A0A0A]
< Protocol configuration options >
RRC : RRC Connection Reconfiguration Complete + NAS : AttachComplete + ESM : Activate Default EPS Bearer Context Accept
UE 在两个层面上应答上一步。RRC Connection Reconfiguration Complete 确认无线配置;随后一条独立的 ULInformationTransfer 承载 Attach Complete,其中包含 Activate Default EPS Bearer Context Accept。这一步之后,UE 完成注册,默认 EPS 承载已可承载业务。
这一步执行的一个重要流程是「ESM : Activate Default EPS Bearer Context Accept」。
RRC Connection Reconfiguration Complete 部分非常简单,如下。
RRC_LTE:UL-DCCH-Message UL-DCCH-Message ::= SEQUENCE +-message ::= CHOICE [c1] +-c1 ::= CHOICE [rrcConnectionReconfigurationComplete] +-rrcConnectionReconfigurationComplete ::= SEQUENCE +-rrc-TransactionIdentifier ::= INTEGER (0..3) +-criticalExtensions ::= CHOICE [rrcConnectionReconfigurationComplete-r8] +-rrcConnectionReconfigurationComplete-r8 ::= SEQUENCE +-nonCriticalExtension ::= SEQUENCE OPTIONAL:Omit
NAS 部分由于被多次捎带,结构相当复杂。
图注:ulInformationTransfer 消息树:携带 Attach Complete 与 Activate Default EPS Bearer Context Accept
RRC_LTE:UL-DCCH-Message UL-DCCH-Message ::= SEQUENCE +-message ::= CHOICE [c1] +-c1 ::= CHOICE [ulInformationTransfer] +-ulInformationTransfer ::= SEQUENCE +-criticalExtensions ::= CHOICE [c1] +-c1 ::= CHOICE [ulInformationTransfer-r8] +-ulInformationTransfer-r8 ::= SEQUENCE +-dedicatedInfoType ::= CHOICE [dedicatedInfoNAS] | +-dedicatedInfoNAS ::= OCTET STRING SIZE(ALIGNED) [074300035200C2] +-nonCriticalExtension ::= SEQUENCE OPTIONAL:Omit
如果解码 dedicatedInfoNAS ::= OCTET STRING SIZE(ALIGNED) [074300035200C2],将得到下面的消息(Attach Complete)。
NAS_LTE:EMM,Attach complete Attach complete ::= DIVISION +-Security header type ::= V | +-Security header type ::= CHOICE [Plain NAS message, not security protected] +-EPS mobility management protocol discriminator ::= V | +-Protocol discriminator ::= PD +-Attach complete message identity ::= V | +-Message type ::= MSG +-ESM message container ::= LV-E +-Octet1-Octet2 ::= DIVISION | +-Length of ESM message container ::= LEN (0..65535) +-Octet3- ::= DIVISION +-ESM message container contents ::= OCTETARRAY SIZE(0..65535) [5200C2]
如果解码 ESM message container contents ::= OCTETARRAY SIZE(0..65535) [5200C2] 部分,将得到下面的消息(Activate default EPS bearer context accept)。
NAS_LTE:ESM,Activate default EPS bearer context accept Activate default EPS bearer context accept ::= DIVISION +-EPS bearer identity ::= V | +-EPS bearer identity value ::= CHOICE [EPS bearer identity value 5] +-EPS session management protocol discriminator ::= V | +-Protocol discriminator ::= PD +-Procedure transaction identity ::= V | +-Procedure transaction identity ::= CHOICE [No procedure transaction identity assigned] +-Activate default EPS bearer context accept message identity ::= V | +-Message type ::= MSG [C2] +-Protocol configuration options ::= TLV OPTIONAL:Omit +-Octet1 ::= DIVISION | +-Protocol configuration options IEI ::= IEI +-Octet2 ::= DIVISION | +-Length of protocol config options contents ::= LEN (0..255) +-Octet3 ::= DIVISION | +-ext ::= EXT1 | +-spare ::= FIX | +-Configuration protocol ::= CHOICE [PPP for use with IP PDP type] +-Octet4-Octet253 ::= DIVISION +-protocol config options contents ::= OCTETARRAY SIZE(0..250)
与步骤 6 相同,只是建立原因(establishment cause)不同,如下所示。根据是 MT 呼叫还是 MO 呼叫,它会取 mt-Access 或 mo-Data。
RRC_LTE:UL-CCCH-Message UL-CCCH-Message ::= SEQUENCE +-message ::= CHOICE [c1] +-c1 ::= CHOICE [rrcConnectionRequest] +-rrcConnectionRequest ::= SEQUENCE +-criticalExtensions ::= CHOICE [rrcConnectionRequest-r8] +-rrcConnectionRequest-r8 ::= SEQUENCE +-ue-Identity ::= CHOICE [s-TMSI] | +-s-TMSI ::= SEQUENCE | +-mmec ::= BIT STRING SIZE(8) | +-m-TMSI ::= BIT STRING SIZE(32) +-establishmentCause ::= ENUMERATED [mt-Access] +-spare ::= BIT STRING SIZE(1)
UE 现在正在离开空闲态,进入本次呼叫的业务部分。步骤 26) 的 RRC Connection Setup 与步骤 9) 的作用和结构相同,因此本节不再重复给出截取日志。
参见 RRC Connection Setup
RRC : RRC Connection Setup Complete + NAS : Service Request
这一次 UE 已经完成附着,因此 RRC Connection Setup Complete 中的 NAS 消息是 Service Request 而不是 Attach Request。Service Request 是一条带有自身安全头类型的短消息,它把 UE 迁移到 EMM-CONNECTED 状态,并请求网络为已存在的 EPS 承载上下文建立无线承载和 S1 承载。
RRC_LTE:UL-DCCH-Message UL-DCCH-Message ::= SEQUENCE +-message ::= CHOICE [c1] +-c1 ::= CHOICE [rrcConnectionSetupComplete] +-rrcConnectionSetupComplete ::= SEQUENCE +-rrc-TransactionIdentifier ::= INTEGER (0..3) +-criticalExtensions ::= CHOICE [c1] +-c1 ::= CHOICE [rrcConnectionSetupComplete-r8] +-rrcConnectionSetupComplete-r8 ::= SEQUENCE +-selectedPLMN-Identity ::= INTEGER (1..6) +-registeredMME ::= SEQUENCE OPTIONAL:Omit +-dedicatedInfoNAS ::= OCTET STRING SIZE(ALIGNED) [C7E00000] +-nonCriticalExtension ::= SEQUENCE OPTIONAL:Omit
如果解码 dedicatedInfoNAS ::= OCTET STRING SIZE(ALIGNED) [C7E00000] 部分,将得到下面的消息(Service Request)。
NAS_LTE:EMM,Service request Service request ::= DIVISION +-Security header type ::= V | +-Security header type ::= CHOICE [Security header for the SERVICE REQUEST message] +-EPS mobility management protocol discriminator ::= V | +-Protocol discriminator ::= PD +-KSI and sequence number ::= V | +-Octet1 ::= DIVISION | +-KSI ::= CHOICE [no key is available] | +-Sequence number(short) ::= INT (0..31) +-Message authentication code (short) ::= V +-Octet1 ::= DIVISION | +-Short MAC value ::= INT (0..255) +-Octet2 ::= DIVISION +-Short MAC value(continued) ::= INT (0..255)
每次 RRC 连接建立之后都必须重新激活 AS 安全,因为 eNB 在步骤 19) 已经释放了 AS 上下文。NAS 安全上下文仍保存在 UE 和 MME 中,因此这次不再需要 NAS Security Mode Command。
参见 RRC : Security Mode Command
UE 以与步骤 16) 相同的方式应答。这次交互之后,UE 和 eNB 对 SRB1 和 SRB2 上的所有后续 RRC 消息以及 DRB 上的所有用户数据进行加密。
参见 RRC : Security Mode Complete
RRC : RRC Connection Reconfiguration + NAS : Activate Dedicated EPS Bearer Context Request
在本例中,网络用一条 RRC Connection Reconfiguration 同时建立 DRB 和专用 EPS 承载。是否在这一时点添加专用 EPS 承载由运营商决定,如状态机图下方的说明所述。
这是另一条「RRC Connection Reconfiguration」消息,但你会看到它与步骤 15 的那条消息存在一些差异。
这里看不到任何「Attach Accept」部分,因为注册期间已经完成了「attach」流程,这次只创建了「专用 EPS 承载」。这是否意味着无法使用步骤 15) 创建的「默认 EPS 承载」?不是。默认承载一旦在注册期间创建就依然存活,这正是此步骤无需重新创建默认 EPS 承载的原因。
图注:RRC Connection Reconfiguration 消息树:携带 Activate Dedicated EPS Bearer Context Request
你会注意到的一点是:「Activate Dedicated EPS Bearer Context Request」中没有 IP 地址设置。这是因为专用 EPS 承载使用默认 EPS 承载所指定的同一套 IP 配置。专用 EPS 承载的目的在于建立一条与默认 EPS QoS 不同的 QoS 的数据管道,也就是说专用 EPS 承载必须链接到某个特定的默认 EPS 承载。
那么,我们如何知道哪个专用 EPS 承载链接到哪个默认 EPS 承载?
这一链接由「Linked EPS Bearer Identity」指定。例如,如果「Linked EPS Bearer Identity」设为 5,表示这个「专用 EPS 承载」链接到 Bearer ID = 5 的默认 EPS 承载,并使用该默认 EPS 承载中定义的同一套 IP 配置。
DL-DCCH-Message ::= SEQUENCE +-message ::= CHOICE [c1] +-c1 ::= CHOICE [rrcConnectionReconfiguration] +-rrcConnectionReconfiguration ::= SEQUENCE +-rrc-TransactionIdentifier ::= INTEGER (0..3) +-criticalExtensions ::= CHOICE [c1] +-c1 ::= CHOICE [rrcConnectionReconfiguration-r8] +-rrcConnectionReconfiguration-r8 ::= SEQUENCE +-measConfig ::= SEQUENCE OPTIONAL:Omit +-mobilityControlInfo ::= SEQUENCE OPTIONAL:Omit +-dedicatedInfoNASList ::= SEQUENCE OF SIZE(1..maxDRB) OPTIONAL:Exist | +-DedicatedInfoNAS ::= OCTET STRING SIZE(ALIGNED) [1700000000036200C5050904686848480000000006213100023011] +-radioResourceConfigDedicated ::= SEQUENCE OPTIONAL:Exist | +-srb-ToAddModList ::= SEQUENCE OF SIZE(1..2) OPTIONAL:Exist | | +-SRB-ToAddMod ::= SEQUENCE | | +-srb-Identity ::= INTEGER (1..2) | | +-rlc-Config ::= CHOICE [defaultValue] OPTIONAL:Exist | | | +-defaultValue ::= NULL | | +-logicalChannelConfig ::= CHOICE [defaultValue] OPTIONAL:Exist | | +-defaultValue ::= NULL | +-drb-ToAddModList ::= SEQUENCE OF SIZE(1..maxDRB) OPTIONAL:Exist | | +-DRB-ToAddMod ::= SEQUENCE | | | +-eps-BearerIdentity ::= INTEGER (0..15) OPTIONAL:Exist | | | +-drb-Identity ::= INTEGER (1..32) | | | +-pdcp-Config ::= SEQUENCE OPTIONAL:Exist | | | | +-discardTimer ::= ENUMERATED [infinity] OPTIONAL:Exist | | | | +-rlc-AM ::= SEQUENCE OPTIONAL:Omit | | | | +-rlc-UM ::= SEQUENCE OPTIONAL:Exist | | | | | +-pdcp-SN-Size ::= ENUMERATED [len12bits] | | | | +-headerCompression ::= CHOICE [notUsed] | | | | +-notUsed ::= NULL | | | +-rlc-Config ::= CHOICE [um-Bi-Directional] OPTIONAL:Exist | | | | +-um-Bi-Directional ::= SEQUENCE | | | | +-ul-UM-RLC ::= SEQUENCE | | | | | +-sn-FieldLength ::= ENUMERATED [size10] | | | | +-dl-UM-RLC ::= SEQUENCE | | | | +-sn-FieldLength ::= ENUMERATED [size10] | | | | +-t-Reordering ::= ENUMERATED [ms50] | | | +-logicalChannelIdentity ::= INTEGER (3..10) OPTIONAL:Exist | | | +-logicalChannelConfig ::= SEQUENCE OPTIONAL:Exist | | | +-ul-SpecificParameters ::= SEQUENCE OPTIONAL:Exist | | | +-priority ::= INTEGER (1..16) | | | +-prioritisedBitRate ::= ENUMERATED [infinity] | | | +-bucketSizeDuration ::= ENUMERATED [ms100] | | | +-logicalChannelGroup ::= INTEGER (0..3) OPTIONAL:Exist | | +-DRB-ToAddMod ::= SEQUENCE | | +-eps-BearerIdentity ::= INTEGER (0..15) OPTIONAL:Exist | | +-drb-Identity ::= INTEGER (1..32) | | +-pdcp-Config ::= SEQUENCE OPTIONAL:Exist | | | +-discardTimer ::= ENUMERATED [infinity] OPTIONAL:Exist | | | +-rlc-AM ::= SEQUENCE OPTIONAL:Omit | | | +-rlc-UM ::= SEQUENCE OPTIONAL:Exist | | | | +-pdcp-SN-Size ::= ENUMERATED [len12bits] | | | +-headerCompression ::= CHOICE [notUsed] | | | +-notUsed ::= NULL | | +-rlc-Config ::= CHOICE [um-Bi-Directional] OPTIONAL:Exist | | | +-um-Bi-Directional ::= SEQUENCE | | | +-ul-UM-RLC ::= SEQUENCE | | | | +-sn-FieldLength ::= ENUMERATED [size10] | | | +-dl-UM-RLC ::= SEQUENCE | | | +-sn-FieldLength ::= ENUMERATED [size10] | | | +-t-Reordering ::= ENUMERATED [ms50] | | +-logicalChannelIdentity ::= INTEGER (3..10) OPTIONAL:Exist | | +-logicalChannelConfig ::= SEQUENCE OPTIONAL:Exist | | +-ul-SpecificParameters ::= SEQUENCE OPTIONAL:Exist | | +-priority ::= INTEGER (1..16) | | +-prioritisedBitRate ::= ENUMERATED [infinity] | | +-bucketSizeDuration ::= ENUMERATED [ms100] | | +-logicalChannelGroup ::= INTEGER (0..3) OPTIONAL:Exist | +-drb-ToReleaseList ::= SEQUENCE OF OPTIONAL:Omit | +-mac-MainConfig ::= CHOICE [explicitValue] OPTIONAL:Exist | | +-explicitValue ::= SEQUENCE | | +-ul-SCH-Config ::= SEQUENCE OPTIONAL:Exist | | | +-maxHARQ-Tx ::= ENUMERATED [n5] OPTIONAL:Exist | | | +-periodicBSR-Timer ::= ENUMERATED [sf20] OPTIONAL:Exist | | | +-retxBSR-Timer ::= ENUMERATED [sf320] | | | +-ttiBundling ::= BOOLEAN [FALSE] | | +-drx-Config ::= CHOICE [release] OPTIONAL:Exist | | | +-release ::= NULL | | +-timeAlignmentTimerDedicated ::= ENUMERATED [infinity] | | +-phr-Config ::= CHOICE [setup] OPTIONAL:Exist | | +-setup ::= SEQUENCE | | +-periodicPHR-Timer ::= ENUMERATED [sf500] | | +-prohibitPHR-Timer ::= ENUMERATED [sf200] | | +-dl-PathlossChange ::= ENUMERATED [dB3] | +-sps-Config ::= SEQUENCE OPTIONAL:Omit | +-physicalConfigDedicated ::= SEQUENCE OPTIONAL:Exist | +-pdsch-ConfigDedicated ::= SEQUENCE OPTIONAL:Omit | +-pucch-ConfigDedicated ::= SEQUENCE OPTIONAL:Omit | +-pusch-ConfigDedicated ::= SEQUENCE OPTIONAL:Omit | +-uplinkPowerControlDedicated ::= SEQUENCE OPTIONAL:Omit | +-tpc-PDCCH-ConfigPUCCH ::= CHOICE [setup] OPTIONAL:Exist | | +-setup ::= SEQUENCE | | +-tpc-RNTI ::= BIT STRING SIZE(16) | | +-tpc-Index ::= CHOICE [indexOfFormat3] | | +-indexOfFormat3 ::= INTEGER (1..15) | +-tpc-PDCCH-ConfigPUSCH ::= CHOICE [setup] OPTIONAL:Exist | | +-setup ::= SEQUENCE | | +-tpc-RNTI ::= BIT STRING SIZE(16) | | +-tpc-Index ::= CHOICE [indexOfFormat3] | | +-indexOfFormat3 ::= INTEGER (1..15) | +-cqi-ReportConfig ::= SEQUENCE OPTIONAL:Omit | +-soundingRS-UL-ConfigDedicated ::= CHOICE OPTIONAL:Omit | +-antennaInfo ::= CHOICE [defaultValue] OPTIONAL:Exist | | +-defaultValue ::= NULL | +-schedulingRequestConfig ::= CHOICE OPTIONAL:Omit +-securityConfigHO ::= SEQUENCE OPTIONAL:Omit +-nonCriticalExtension ::= SEQUENCE OPTIONAL:Omit
Activate dedicated EPS bearer context request ::= DIVISION +-EPS bearer identity ::= V | +-EPS bearer identity value ::= CHOICE [EPS bearer identity value 6] +-EPS session management protocol discriminator ::= V | +-Protocol discriminator ::= PD +-Procedure transaction identity ::= V | +-Procedure transaction identity ::= CHOICE [No procedure transaction identity assigned] +-Activate dedicated EPS bearer context request message identity ::= V | +-Message type ::= MSG [C5] +-Spare half octet ::= V | +-Spare half octet ::= FIX +-Linked EPS bearer identity ::= V | +-Linked EPS bearer identity value ::= CHOICE [EPS bearer identity value 5] +-EPS QoS ::= LV | +-Octet1 ::= DIVISION | | +-Length of EPS quality of service contents ::= LEN (0..255) | +-Octet2 ::= DIVISION | | +-QCI ::= CHOICE [QCI 4] | +-Octet3 ::= DIVISION | | +-Maximum bit rate for uplink ::= CHOICE [384kbps] | +-Octet4 ::= DIVISION | | +-Maximum bit rate for downlink ::= CHOICE [384kbps] | +-Octet5 ::= DIVISION | | +-Guaranteed bit rate for uplink ::= CHOICE [128kbps] | +-Octet6 ::= DIVISION | | +-Guaranteed bit rate for downlink ::= CHOICE [128kbps] | +-Octet7 ::= DIVISION | | +-Maximum bit rate for uplink (extended) ::= CHOICE [Use the value indicated by the maximum bit rate for uplink in octet 4] | +-Octet8 ::= DIVISION | | +-Maximum bit rate for downlink (extended) ::= CHOICE [Use the value indicated by the maximum bit rate for uplink in octet 4] | +-Octet9 ::= DIVISION | | +-Guaranteed bit rate for uplink (extended) ::= CHOICE [Use the value indicated by the guaranteed bit rate for uplink in octet 6] | +-Octet10 ::= DIVISION | +-Guaranteed bit rate for downlink (extended) ::= CHOICE [Use the value indicated by the guaranteed bit rate for uplink in octet 6] +-TFT ::= LV | +-Octet1 ::= DIVISION | | +-Length of traffic flow template IE ::= LEN (0..255) | +-Octet2 ::= DIVISION | | +-TFT operation code ::= CHOICE [Create new TFT] | | +-E bit ::= CHOICE [parameters list is not included] | | +-Number of packet filters ::= INT (0..15) | +-Octet3-Octet256 ::= DIVISION | +-Packet filter list/Parameters list ::= OCTETARRAY SIZE(0..254) +-Transaction identifier ::= TLV OPTIONAL:Omit | +-Octet1 ::= DIVISION | | +-Transaction identifier IEI ::= IEI [5D] | +-Octet2 ::= DIVISION | | +-Length of Transaction identifier contents ::= LEN (0..255) | +-Octet3 ::= DIVISION | | +-TI flag ::= CHOICE [The message is sent from the side that originates the TI] | | +-TIO ::= CHOICE [TI value 0] | | +-Spare ::= FIX | +-Octet4 ::= DIVISION | +-ext ::= EXT (0..1) | +-TIE ::= CHOICE [Reserved] +-Negotiated QoS ::= TLV OPTIONAL:Omit | +-Octet1 ::= DIVISION | | +-Quality of service IEI ::= IEI | +-Octet2 ::= DIVISION | | +-Length of quality of service IE ::= LEN (0..255) | +-Octet3 ::= DIVISION | | +-spare ::= FIX | | +-Delay class ::= CHOICE [Subscribed delay class(MS to network direction)/Reserved(network to MS direction)] | | +-Reliability class ::= CHOICE [Subscribed reliability class(MS to network direction)/Reserved(network to MS direction)] | +-Octet4 ::= DIVISION | | +-Peak throughput ::= CHOICE [Subscribed peak throughput(MS to network direction)/Reserved(network to MS direction)] | | +-spare ::= FIX | | +-Precedence class ::= CHOICE [Subscribed precedence(MS to network direction)/Reserved(network to MS direction)] | +-Octet5 ::= DIVISION | | +-spare ::= FIX | | +-Mean throughput ::= CHOICE [Subscribed mean throughput(MS to network direction)/Reserved(network to MS direction)] | +-Octet6 ::= DIVISION | | +-Traffic Class ::= CHOICE [Subscribed traffic class(MS to network direction)/Reserved(network to MS direction)] | | +-Delivery order ::= CHOICE [Subscribed delivery order(MS to network direction)/Reserved(network to MS direction)] | | +-Delivery of erroneous SDUs ::= CHOICE [Subscribed delivery of erroneous SDUs(MS to network direction)/Reserved(network to MS direction)] | +-Octet7 ::= DIVISION | | +-Maximum SDU size ::= CHOICE [Subscribed maximum SDU size(MS to network direction)/Reserved(network to MS direction)] | +-Octet8 ::= DIVISION | | +-Maximum bit rate for uplink ::= CHOICE [Subscribed maximum bit rate for uplink(MS to network direction)/Reserved(network to MS direction)] | +-Octet9 ::= DIVISION | | +-Maximum bit rate for downlink ::= CHOICE [Subscribed maximum bit rate for uplink(MS to network direction)/Reserved(network to MS direction)] | +-Octet10 ::= DIVISION | | +-Residual BER ::= CHOICE [Subscribed residual BER(MS to network direction)/Reserved(network to MS direction)] | | +-SDU error ratio ::= CHOICE [Subscribed SDU error ratio(MS to network direction)/Reserved(network to MS direction)] | +-Octet11 ::= DIVISION | | +-Transfer delay ::= CHOICE [Subscribed transfer delay(MS to network direction)/Reserved(network to MS direction)] | | +-Traffic Handling priority ::= CHOICE [Subscribed traffic handling priority(MS to network direction)/Reserved(network to MS direction)] | +-Octet12 ::= DIVISION | | +-Guaranteed bit rate for uplink ::= INT (0..255) | +-Octet13 ::= DIVISION | | +-Guaranteed bit rate for downlink ::= INT (0..255) | +-Octet14 ::= DIVISION | | +-Spare ::= FIX | | +-Signalling Indication ::= CHOICE [Not optimised for signalling traffic] | | +-Source Statistics Descriptor ::= CHOICE [unknown] | +-Octet15 ::= DIVISION | | +-Maximum bit rate for downlink (extended) ::= CHOICE [Use the value indicated by the Maximum bit rate for downlink in octet 9.] | +-Octet16 ::= DIVISION | | +-Guaranteed bit rate for downlink (extended) ::= CHOICE [Use the value indicated by the Maximum bit rate for downlink in octet 9.] | +-Octet17 ::= DIVISION | | +-Maximum bit rate for uplink (extended) ::= CHOICE [Use the value indicated by the Maximum bit rate for downlink in octet 9.] | +-Octet18 ::= DIVISION | +-Guaranteed bit rate for uplink (extended) ::= CHOICE [Use the value indicated by the Maximum bit rate for downlink in octet 9.] +-Negotiated LLC SAPI ::= TV OPTIONAL:Omit | +-Octet1 ::= DIVISION | | +-LLC SAPI IEI ::= IEI | +-Octet2 ::= DIVISION | +-Spare ::= FIX | +-LLC SAPI value ::= CHOICE [LLC SAPI not assigned] +-Radio priority ::= TV OPTIONAL:Omit | +-Octet1 ::= DIVISION | +-Radio priority IEI ::= IEI [8-] | +-spare ::= FIX | +-Radio priority level value ::= CHOICE [priority level 1 (highest)] +-Packet flow identifier ::= TLV OPTIONAL:Omit | +-Octet1 ::= DIVISION | | +-Packet Flow Identifier IEI ::= IEI | +-Octet2 ::= DIVISION | | +-Length of Packet Flow Identifier IE ::= LEN (0..255) | +-Octet3 ::= DIVISION | +-spare ::= FIX | +-Packet Flow Identifier value ::= CHOICE [Best Effort] +-Protocol configuration options ::= TLV OPTIONAL:Omit +-Octet1 ::= DIVISION | +-Protocol configuration options IEI ::= IEI +-Octet2 ::= DIVISION | +-Length of protocol config options contents ::= LEN (0..255) +-Octet3 ::= DIVISION | +-ext ::= EXT1 | +-spare ::= FIX | +-Configuration protocol ::= CHOICE [PPP for use with IP PDP type] +-Octet4-253 ::= DIVISION +-protocol config options contents ::= OCTETARRAY SIZE(0..250)
RRC : RRC Connection Reconfiguration Complete + NAS : Activate Dedicated EPS Bearer Context Accept
这是示例序列在释放之前的最后一步。UE 先确认无线配置,然后以与步骤 18) 相同的方式,在一条独立的 ULInformationTransfer 中接受专用 EPS 承载。
RRC Connection Reconfiguration Complete 部分非常简单,如下所示。
ESM,Activate dedicated EPS bearer context accept 部分由 UL information transfer 消息承载,如下。
RRC_LTE:UL-DCCH-Message UL-DCCH-Message ::= SEQUENCE +-message ::= CHOICE [c1] +-c1 ::= CHOICE [ulInformationTransfer] +-ulInformationTransfer ::= SEQUENCE +-criticalExtensions ::= CHOICE [c1] +-c1 ::= CHOICE [ulInformationTransfer-r8] +-ulInformationTransfer-r8 ::= SEQUENCE +-dedicatedInfoType ::= CHOICE [dedicatedInfoNAS] | +-dedicatedInfoNAS ::= OCTET STRING SIZE(ALIGNED) [6200C6] +-nonCriticalExtension ::= SEQUENCE OPTIONAL:Omit
如果解码 dedicatedInfoNAS ::= OCTET STRING SIZE(ALIGNED) [6200C6] 部分,将得到下面的消息(ESM,Activate dedicated EPS bearer context accept)。
NAS_LTE:ESM,Activate dedicated EPS bearer context accept Activate dedicated EPS bearer context accept ::= DIVISION +-EPS bearer identity ::= V | +-EPS bearer identity value ::= CHOICE [EPS bearer identity value 6] +-EPS session management protocol discriminator ::= V | +-Protocol discriminator ::= PD +-Procedure transaction identity ::= V | +-Procedure transaction identity ::= CHOICE [No procedure transaction identity assigned] +-Activate dedicated EPS bearer context accept message identity ::= V | +-Message type ::= MSG [C6] +-Protocol configuration options ::= TLV OPTIONAL:Omit +-Octet1 ::= DIVISION | +-Protocol configuration options IEI ::= IEI +-Octet2 ::= DIVISION | +-Length of protocol config options contents ::= LEN (0..255) +-Octet3 ::= DIVISION | +-ext ::= EXT1 | +-spare ::= FIX | +-Configuration protocol ::= CHOICE [PPP for use with IP PDP type] +-Octet4-Octet253 ::= DIVISION +-protocol config options contents ::= OCTETARRAY SIZE(0..250)
- 3GPP TS 36.331 v19.3.0:演进型通用陆基无线接入(E-UTRA);无线资源控制(RRC);协议规范
- 3GPP TS 24.301 v20.0.0:演进型分组系统(EPS)的非接入层(NAS)协议;第 3 阶段
图示资源
- 从开机经 RRC 建立、空闲态、寻呼到专用 EPS 承载的 LTE UE 状态机
- LTE 下行信道映射:从逻辑信道经传输信道到 PHY
- LTE 上行信道映射:从 PHY 经传输信道到逻辑信道
- SFN 0 至 19 内 MIB 与 SIB1 的发送调度
- PRACH 前导码与 RACH Response:解码出的前导码索引和 RAR 字段
- RRC Connection Request 与 RRC Connection Setup:含竞争解决 UE ID
- RRC Connection Setup 消息树:RadioResourceConfigDedicated 与 PhysicalConfigDedicated
- RRC Connection Setup Complete 消息树:携带 Attach Request 与 PDN Connectivity Request
- UE 与网络之间的 LTE 鉴权序列:RAND、AUTN 与 RES
- RRC Connection Reconfiguration 消息树:携带 Attach Accept 与 Activate Default EPS Bearer Request
- ulInformationTransfer 消息树:携带 Attach Complete 与 Activate Default EPS Bearer Context Accept
- RRC Connection Reconfiguration 消息树:携带 Activate Dedicated EPS Bearer Context Request