ipv4的ip地址应该怎样配置 (ipv4地址和ipv6地址的区别)

PDU会话类型

IPV4V6:终端默认使用IPV4V6请求建立data connection,最终由网络决定分配哪种类型IP

IPV4:网络只支持IPV4建立data connection

IPV6:网络只支持IPV6建立data connection

3GPP TS 24.008 6.1.3.1中对IPv4v6要求

终端配置apn的pdp_type为IPv4v6,那么激活PDN的时候有如下几种情况:

1.网络正常返回IPv4v6地址

2.网络只返回IPv4地址

(1)如果返回的SM error为#52(single address bearers only allowed),终端则需使用IPV6请求建立另一路PDN;

(2)如果返回的SM error为#50(PDP type IPv4 only allowed),表示网络仅支持IPV4。

3. 网络只返回IPv6 address

(1)如果返回的SM error为#52(single address bearers only allowed),终端则需使用IPV6请求建立另一路PDN;

(2)如果返回的SM error为#51(PDP type IPv6 only allowed),表示网络仅支持IPV6。

如果运营商对APN type有特殊需求,终端可以定制实现。

例如在PDP用IPv4v6 type激活被network reject,协议3GPP TS 24.008 6.1.3.1只定义了reject cause#52的时候可以实现PDP retry。终端也可以尝试reject cause为#33或#26等其它错误码,分别再用IPv4和IPv6去激活。

网络reject IPV4V6的原因分析

IP地址分配在核心网处理,因此终端请求的跟核心网相关参数会影响PDN建立。例如:使用的SIM、之前注册的参数NAS KSI、GUTI、TAI、TMSI等,在SIM卡和测试地点不同时,测试结果可能就会有差异。

像UE能力、MS网络能力、MS的Classmark、UE的频段等,这些属于无线接入(RA)参数,不会影响IP分配。

因此,对于这种网络行为,建议使用相同的sim卡、相同的位置重新测试以进行比较。

3GPP 24.008 6.1.3.1摘要

If the MS requests PDP type IPv4v6, but the operator uses single addressing per PDP context due to interworking with nodes of earlier releases, the network shall override the PDP type requested by setting the PDP type in the ACTIVATE PDP CONTEXT ACCEPT message sent to the MS to a single address PDP type. In the ACTIVATE PDP CONTEXT ACCEPT message sent to the MS, the network sets the PDP type number to either "IPv4 address" or "IPv6 address" and the SM cause to #52, "single address bearers only allowed" (see subclause 6.1.3.1.1). The MS may subsequently request another PDP context for the other PDP type to the same APN with a single address PDP type (IPv4 or IPv6) other than the one already activated.

可查阅公众号文章终端分配IP地址类型(IPV4 or IPV6 or IPV4V6)介绍