大数跨境
0
0

5G SA PDU Session建立流程(3)- IPv6地址分配

5G SA PDU Session建立流程(3)- IPv6地址分配 GiveMe5G
2020-11-01
2
导读:导读本文主要介绍PDU Session建立过程中UE的IPv6地址分配。IPv6和IPv4地址的分配是不同的

导读

本文主要介绍PDU Session建立过程中UE的IPv6地址分配。IPv6和IPv4地址的分配是不同的,因此这里重点介绍下IPv6相关的知识点以及地址分配机制。


为啥是这样子呢?

下面这幅图是CMCC SA网络下PDU Session建立的信令流程图。终端一共建立了两个PDU Session,一个用于IMS,另一个用于CMNET。

  • IMS PDU Session的IP地址类型为IPv6那么在PDU Session Establishment Accept中IE pdu_addr给出的是IPv6地址吗?答案是NO,那是什么呢?

  • CMNET PDU Session的IP地址类型为IPv4v6,那么SMF就会给终端分配IPv4和IPv6两种类型的IP地址。在PDU Session Establishment Accept中IE pdu_addr中直接给出了IPv4的地址为10.0.3.202,对于IPv6地址,同IMS一样,并没有直接给出。



协议描述:

a)if the network sets the PDU session type IE to IPv4, the network shall include an IPv4 address in the PDU address IE;

b)if the network sets the PDU session type IE to IPv6, the network shall include an interface identifier for the IPv6 link local address in the PDU address IE; 

c)if the network sets the PDU session type IE to IPv4v6, the network shall include an IPv4 address and an interface identifier for the IPv6 link local address in the PDU address IE.


IPv6地址知识点

先了解下IPv6地址的一些知识点,在后面的讨论中会用到:

  • IPv6是128位的,用于单播unicast的IPv6地址由IPv6 Prefix(64位)Interface Identifier(64位)组成

  • 在IPv6地址分配中经常听到两个术语:

    1) Global unicast address:the global unicast address is globally unique in the Internet.

    2) Link-local address: The link-local unicast address can be used only on the local network link. Link-local addresses are not valid nor recognized outside the enterprise. fe80::/10 Indicates that a link-local address follows.

下面这段话摘自协议23501,基本说清楚了IPv6地址是怎么分配的:

If Stateless IPv6 Address Autoconfiguration is used for IPv6 address allocation to the UE, after PDU Session Establishment the UE may send a Router Solicitation message to the SMF to solicit a Router Advertisement message. The SMF sends a Router Advertisement message (solicited or unsolicited) to the UE. The Router Advertisement messages shall contain the IPv6 prefix. After the UE has received the Router Advertisement message, it constructs a full IPv6 addressvia IPv6 Stateless Address Autoconfiguration in accordance.



IPv6地址分配

下面结合log,我们来总结一下IPv6地址分配的步骤(以IMS PDU Session为例):


  • 网络在PDU Session Establishment Accept中发给终端的不是IPv6地址,而是64位Interface Identifier。这个Interface ID=1642:c6c5:fea0:a11a

  • 终端开始构建link-local地址fe80::c00a:44d3:8d66:b316,link-local地址=link-local prefix+ interface ID。这里面fe80::是link-local prefix,最终使用的interface ID是c00a:44d3:8d66:b316,而不是第一步中的网络告知的fe80::c00a:44d3:8d66:b316,这块我还没有弄清为什么,也请知道的童鞋告知下。

  • 终端使用link-local地址fe80::c00a:44d3:8d66:b316,向router ff02::2发送Router Solicitation消息,根据上面那段协议描述,UE其实是在向SMF发送消息。FF02::2 是一个组播地址,指all routers在本地链路范围的所有路由器

  • SMF会在link-local链路上回给终端Router Advertisement消息,通知终端最重要的信息,IPv6 Prefix 2409:8100:1a80:92

  • 拿到了IPv6 Prefix,再加上Interface ID,就组成了IPv6 global unicast 地址2409:8100:1a80:92:c00a:44d3:8d66:b316。至此,UE成功获得了IPv6地址。


注意:像Router Solicitation, Router Advertisement, Neighbor Solicitation, Neighbor Advertisement 这些消息的交互都是SMF和UE通过UPF, 而不是AMF完成的

【声明】内容源于网络
0
0
GiveMe5G
分享5G相关技术,跟踪5G行业动态
内容 17
粉丝 0
GiveMe5G 分享5G相关技术,跟踪5G行业动态
总阅读2
粉丝0
内容17