具体的消息流过程还是按照3GPP 23.401。针对attach过程的某些流程和具体消息展开解释。并给出相对应的规范出处。

1. 首先第一条initial Attach 消息: 从具体的wireshark的包来看, 这个intial attach包含了两个事件, attach Req+PDN connectivity Req

一个是EMM 层面的消息,一个是ESM 层面的消息。

Attach Req 无需多讲,这是终端登陆网络侧所必须的过程。而PDN Conncetivity Req的出现是为了建立default Bearer。

在NAS 规范24.301 6.5.1.1 中就是很明确的提出在attach req中所包含的PDN Con Req 是为了最初的default bearer建立所发(这个独立于可能还会和其他APN 所建立的default bearer),在这个PDN Connect Req里UE 侧不需要提交APN的地址,换句话讲, 这个initial default bearer所连向的APN 应该由网络侧来决定。终端只提供了UE 所支持的IP地址类型。

(但是也有例外,虽然规范里要求是这样,但是也有观点认为,UE提供了APN 更有利于UE 对业务需求,例如UE想直接连入企业网,那得需要UE 提供APN,但是这个APN的提供得在鉴权和NAS安全关联建立之后,因为default APN的提供应该估计应该根据实际运营商的业务实现或者客户需求来做)

When the PDN CONNECTIVITY REQUEST message is sent together with an ATTACH REQUEST message, the UE
shall not include the APN.

而把PDN Connectivity Req和Attach Req绑定的考虑出自于 3GPP2 24.301, 4.2节,LTE 中实现了the ip of UE alwanys online的想法。

a. 具体来看这个消息体。 在这条消息中,在S1AP 层面上,暂时还只有eNB-UE-S1AP-ID的value,网络侧的S1AP 的 ID 需要等MME 来回复。

b. 在NAS 层(如图2所示):其中 EPS mobility message 的地方出现了两次。 ESM PDN Connet Req的消息被包含在EMM 消息中,通过ESM Message container这个IE ,EMM 包含了ESM的内容。

EPS Mobility Message 出现两次的原因是: 这条消息采取了24.301中 9.1 节 所列出的消息编码格式----- a security protected NAS message. 如图3 所示:

随后具体到每条NAS 的Message, NAS message 本身又有Protocol discriminator 和 Security header type 的IEI. 所以造成 EPS Mobility managerment message 这个header出现了两次的情况。 (但是为什么要出现两次呢? NAS 具体的Message 的Security header不够么? 为什么还要再加一层Security header上去呢?)

那么如果UE 侧已经有一个valid NAS security context  存在了,那么UE 需要在attach Req 中置上intergrity protect。 对应于3GPP 24301:

1) Except for the case described in item 3 below, the UE shall transmit the initial NAS message integrity protected with the current EPS security context, but unciphered. The UE shall include the eKSI indicating the current EPS security context value in the initial NAS message. The MME shall check whether the eKSI included in the initial

NAS message belongs to an EPS security context available in the MME, and shall verify the MAC of the NAS message. If the verification is successful, the MME may re-establish the secure exchange of NAS messages:

- by replying with a NAS message that is integrity protected and ciphered using the current EPS security context. From this time onward, all NAS messages exchanged between the UE and the MME are sent integrity protected and except for the messages specified in subclause 4.4.5, all NAS messages exchanged between the UE and the MME are sent ciphered; or

- by initiating a security mode control procedure. This can be used by the MME to take a non-current EPS security context into use or to modify the current EPS security context by selecting new NAS security algorithms;

而一个Scurity Context 是通过NAS COUNT 来标示的。 NAS Count对应于NAS Header呢,就是Sequence Number。 MME 通过Sequence Number来找到相对应的Security Context (如果存在的话), 然后再使用 Message Authentication Code来完成检查.

图3

c. 随后再打开 ESM Message Container 这个IEI。

可以看到:

在这段消息体内,值得注意的是这几个header: EPS bearer identity , Procedure transaction id。

copy from 24.007:

The EPS bearer identity is used to identify a message flow。 这个 NAS 中的EPS bearer id 和随后在GTP-C 上建立的Bearer Context ID 相互对应。

Procedure transaction:  A L3 protocol may define that the second octet of a standard L3 message of the protocol contains the proceduretransaction identity (PTI). The PTI allows distinguishing up to 254 different bi-directional messages flows for a given PD and a given SAP. Such a message flow is called a transaction. The procedure transaction identity is released when the procedure is completed.

对于这两个heder在LTE 中的运用,24.301 又给出了详细的描述。 参看 6.3.2.

并且通过24.007 中的routing model来看, PTI+PD 是EMM 用来routing消息给ESM 的。 而一旦bearer context 建立完,ESM 能够分配出context id后,后续的消息就不需要PTI了。

例如: PDN Context Req (from UE to MME)  中需要有PTI, EPS default Bearer req (from MME to UE) 需要有(PTI,EBI) , 随后的 EPS default bearer Resp (from UE to MME)只需要有EBI了,就不需要PTI了。

在这个过程中,EMM层需要为ESM 提供一个routing服务,EMM 通过PTI来区分向ESM 建立不同的transcription, MME 收到req之后,回出的 Default Bearer Req 中,也需要PTI,是因为它需要向UE 标明 它是为了之前那条ESM transaction分配了EBI, UE 收到之后,双方在ESM 上达成了统一,就不需要PTI的配合了,因为Bearer ID 的唯一性就足够EMM 在随后的过程中,将ESM的消息路由给相对应的EMS layer来处理。

这个default Beraer的的建立在MME 被pending在那边,因为要完成EMM的过程之后, MME 才会去处理ESM 的状态机。NAS 的PTI,EBI的再次出现要等到MME-SGW-PGW之间的bearer context 建立完成后。

2) 随后New MME 向 UE 要求获取IMSI, MME 可以根据IMSI 向 HSS 要求鉴权数据以及随后的用户数据。但这个时候因为security mode还未建立,所以NAS 层面的消息是

Plain NAS message, not security protected, 应该也算危险的地方。

3) MME 收到IMSI 之后,和HSS 通过diameter 的AIR/AIA 完成鉴权五元组的交互。

4) MME 向UE 发送 RAND ,AUTN value, 要求UE上报鉴权数据。

5) MME 收到 NAS Authentication Resp,鉴权通过之后, 开始security mode 的建立。

按照 24.301 中4.4.2.4 的规定,

The SECURITY MODE COMMAND message sent by the MME includes the eKSI of the new EPS security context to be used. The MME shall send the SECURITY MODE COMMAND message integrity protected with the new EPS security context, but unciphered. When the UE responds with a SECURITY MODE COMPLETE, it shall send the message integrity protected and ciphered with the new EPS security context.

MME 下发的Security Command 只是integrity protected and unciphered. 但是UE 随后的Security Complete 消息应该是被cipher过的。

但是如果MME 对于cipher的规则选择的是“ null ciphering alogrithm“ EEA0, 虽然随后UE 和MME 之间的NAS 没有经过cipher,但是在security header也必须置上ciphered。

(参见24.301 - 4.4.5, ” If the "null ciphering algorithm" EEA0 has been selected as a ciphering algorithm, the NAS messages with the security header indicating ciphering are regarded as ciphered”)

具体见图:(还是不理解为啥要插两层EMM 的 Security header 进去, 第一层的Security header 可以理解, 但是第二层对于具体的EMM ,为啥还需要一个security header呢,直接被包含在第一层不行么?)

6)  接下来就是MME 得去HSS 取数据了。使用DIAMETER ULR/ULA..

再分个子节吧。。。感觉这部分用户很重要。没有完全看过这部分的用户数据。

LTE Initial Attach 的过程以及相关消息的具体解析 (一)相关推荐

  1. LTE Initial Attach 的过程以及相关消息的具体解析 (一)

    具体的消息流过程还是按照3GPP 23.401.针对attach过程的某些流程和具体消息展开解释.并给出相对应的规范出处. 1. 首先第一条initial Attach 消息: 从具体的wiresha ...

  2. LTE Initial Attach 的过程以及相关消息的具体解析 ( 示意图 )

    花了点时间,将UE在LTE下面注册所建立的tunnel和各个网元关系画了下.不然光语言组织好麻烦. 原图太大了. 只好截取部分,有关 Tunnel的部分. UE 在当前LTE 中完成附着后,还向另外两 ...

  3. LTE Initial Attach 的过程以及相关消息的具体解析 (三)

    这段开始描述 MME, SGW, PGW 之间建立Tunnel 的过程.主要使用Create Session Req/Resp for default Bearer 和 Create Bearer R ...

  4. LTE Initial Attach 的过程以及相关消息的具体解析 (二)

    接续上一次的话题,到MME 像 HSS 请求用户数据, 使用Diameter ULR/ULA过程. ULR 没什么大的描述.着重对ULA 解析下.规范参照3gpp 29272, 23401 对于ULA ...

  5. LTE Initial Attach 的过程以及相关消息的具体解析 (四)

    继续上次, MME,SGW 已经开始建立tunnel. 现在轮到PGW了. 在发送Create Session Response的时候,PGW 需要向PGW 请求用户数据. 规范3gpp 23203, ...

  6. 初始附着的流程(Call Flow of Initial Attach)

    文章目录 Abbreviations 1.Introduction 2. Initial Attach Procedure 2.1 IMSI Acquisition 2.2 Authenticatio ...

  7. Franklin-Reiter相关消息攻击

    文章目录 知识导入: 题一 题目描述: 题目分析: 题二 题目描述: 题目分析: 题三 题目描述: 题目分析: 收获与体会: 知识导入: 总结: Franklin-Reiter相关消息攻击(Frank ...

  8. CV之MTCNN:MTCNN算法过程及其相关思路配图集合

    MTCNN算法过程及其相关思路配图集合 目录 MTCNN思路结构框图 MTCNN关键步骤 MTCNN思路结构框图 MTCNN关键步骤 1.Proposal Net 2.Refine Net 3.Out ...

  9. Eigen类型与ROS中tf相关消息类型进行相互转换工具

    在ROS机器人编程资料书中,有个Eigen消息类型与TF相关消息类型进行互相转换的工具包感觉挺好使,修改一下方便以后使用. 1.头文件 #include <Eigen/Eigen> #in ...

  10. 浅析 Spring Security 的认证过程及相关过滤器

    前言 上一篇文章 浅析 Spring Security 核心组件 中介绍了Spring Security的基本组件,有了前面的基础,这篇文章就来详细分析下Spring Security的认证过程. S ...

最新文章

  1. 深入分析Flex [Bindable] 【转】
  2. 不重新编译DLL,让FCKEditor支持附件上传
  3. [SCOI2012]滑雪 (最小生成树 Kruskal)
  4. 《Python Cookbook 3rd》笔记(4.7):迭代器切片
  5. 两个list取交集_利用jieba计算两个句子的相似度
  6. Leetcode每日一题:70.climbing-stairs(爬楼梯)
  7. z-index 绝对定位的盒子居中
  8. 计算机逻辑判断函数,Excel函数:逻辑判断IF函数如何使用,涨知识了
  9. pointcloud90度分割+球面投影(pcl+ros+python)
  10. 服务器被黑客攻击快速解决方案
  11. 利用RecordRTC支持web端录制屏幕(vue写法)
  12. 如何在Outlook中检查电子邮件的可访问性
  13. 真当Flutter不能热更新?QQ团队开源动态化Flutter,稳进大厂
  14. SSH (安全shell 协议)
  15. php获取公众号微信用户信息
  16. 明白这十个故事--你也就参悟了人生
  17. Java代码韦伯分布_Excel 应用WEIBULL函数计算韦伯分布
  18. java计算机毕业设计网上拍卖系统(附源码、数据库)
  19. 智能开关继电器-评估篇
  20. python求根公式超范围_python求根公式

热门文章

  1. 树的最小表示法 UVA 12489 - Combating cancer
  2. 给定经纬度计算距离_oracle 根据经纬度计算任意两地之间的距离
  3. 读取四则运算的字符串(Formula)返回计算结果 c#
  4. 您无法关机或重启此计算机,Win10不能关机或重启的四种解决方法
  5. 基于微信小程序的毕业设计题目(30)php物业维修报修小程序(含开题报告、任务书、中期报告、答辩PPT、论文模板)
  6. RStudio 开发环境配置
  7. docker 安装 Nginx 并配置反向代理
  8. Linux OTA升级
  9. 网页设计如何排成一列_网页排版设计中对齐技巧能让网站产生高端感(下)
  10. java json的使用_java JSON的使用和解析