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

具体的消息流过程还是按照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 UEshall 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 protectedwith the current EPS security context, but unciphered. The UE shall include the eKSI indicating the current EPSsecurity 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 NASmessage. 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 securitycontext. From this time onward, all NAS messages exchanged between the UE and the MME are sentintegrity protected and except for the messages specified in subclause 4.4.5, all NAS messages exchangedbetween 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 EPSsecurity context into use or to modify the current EPS security context by selecting new NAS securityalgorithms;

而一个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 相互对应。

我想,这就是旅行的真义吧。

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

相关文章:

你感兴趣的文章:

标签云: