APN是(Access Point Name)的簡(jiǎn)寫(xiě),也就是接入點(diǎn)名稱(chēng)。它是終端在無(wú)線(xiàn)互聯(lián)網(wǎng)的網(wǎng)關(guān)(或錨定點(diǎn)) ,UE (移動(dòng)終端)通過(guò)接入點(diǎn)(APN)后,才可能訪(fǎng)問(wèn)核心網(wǎng)絡(luò),進(jìn)行數(shù)據(jù)服務(wù)連接。
1.APN分配
在無(wú)線(xiàn)網(wǎng)絡(luò)中APN是根據(jù)UE的請(qǐng)求,由網(wǎng)絡(luò)為其分配。APN是UE設(shè)置(請(qǐng)求)和網(wǎng)絡(luò)配置的結(jié)合,終端和網(wǎng)絡(luò)都參與了APN的賦值;
如果APN賦值不正確,終端將不能連接上網(wǎng);商用電話(huà)一般都是根據(jù)SIM卡、終端和網(wǎng)絡(luò)匹配在終端中存儲(chǔ)APN。
* 現(xiàn)網(wǎng)中個(gè)別用戶(hù)投訴不能上網(wǎng)大多是由于私自更改APN,而網(wǎng)絡(luò)不支持所致;
2.APN分配過(guò)程
APN的分配協(xié)議和過(guò)程非常簡(jiǎn)單,只需兩步就可完成;其分別如下:
2.1 UE-->Network:PDN Connectivity Request(終端請(qǐng)求一個(gè)特定APN)
2.2 UE<--Network:Activate Default EPS Bearer Context Request(激活包括上下文的默認(rèn)承載和網(wǎng)絡(luò)定義一個(gè)APN)
3.APN分配示例
3.1 默認(rèn)APN分配
默認(rèn)APN的分配包括在RRC+NAS消息中,其過(guò)程如下:
i) RRC : RRC Connection Setup Complete + NAS : Attach Request + ESM : PDN Connectivity Request
ii) RRC : RRC Connection Reconfiguration + NAS : Attach Accept + NAS : Activate Default EPS Bearer Context Req
APN分配的NAS(請(qǐng)求)消息< PDN Connectivity Request : Default APN >
NAS EPS session management messages: PDN connectivity request (0xd0)
0011 .... = PDN type: IPv4v6 (3)
.... 0001 = Request type: initial request (1)
ESM information transfer flag
1101 .... = Element ID: 0xd-
.... 000. = Spare bit(s): 0x00
.... ...1 = EIT (ESM information transfer): Security protected ESM information transfer required
Protocol Configuration Options
Element ID: 0x27
Length: 32
[Link direction: MS to network (0)]
1... .... = Extension: True
Configuration Protocol: PPP for use with IP PDP type or IP PDN type (0)
Protocol or Container ID: Internet Protocol Control Protocol (0x8021)
Length: 0x10 (16)
PPP IP Control Protocol
Code: Configuration Request (1)
Identifier: 0 (0x00)
Length: 16
Options: (12 bytes), Primary DNS Server IP Address, Secondary DNS Server IP Address
Primary DNS Server IP Address: 0.0.0.0
Type: Primary DNS Server IP Address (129)
Length: 6
Primary DNS Address: 0.0.0.0 (0.0.0.0)
Secondary DNS Server IP Address: 0.0.0.0
Type: Secondary DNS Server IP Address (131)
Length: 6
Secondary DNS Address: 0.0.0.0 (0.0.0.0)
Access Point Name // UE can specify a predefined name here.
// In case of default EPS bearer, it is common that the APN is not specified
Protocol or Container ID: DNS Server IPv4 Address Request (0x000d) Length: 0x00 (0)
Protocol or Container ID: DNS Server IPv6 Address Request (0x0003) Length: 0x00 (0)
Protocol or Container ID: IP address allocation via NAS signalling (0x000a) Length: 0x00 (0)
Protocol or Container ID: IPv4 Link MTU Request (0x0010) Length: 0x00 (0)
默認(rèn)承載激活請(qǐng)求(默認(rèn)APN)< Activate Default EPS Bearer Context Request : Default APN >
NAS EPS session management messages: Activate default EPS bearer context request (0xc1)
EPS quality of service
Length: 1
Quality of Service Class Identifier (QCI): QCI 9 (9)
Access Point Name
Length: 8
APN: internet // Network Assigns a specific APN Name
PDN address
Length: 13
0000 0... = Spare bit(s): 0x00
PDN type: IPv4v6 (3)
PDN IPv6 if id: 0000000000000001
PDN IPv4: 192.168.137.2 (192.168.137.2)
Protocol Configuration Options
Element ID: 0x27
Length: 8
[Link direction: Network to MS (1)]
1... .... = Extension: True
Configuration Protocol: PPP for use with IP PDP type or IP PDN type (0)
Protocol or Container ID: Internet Protocol Control Protocol (0x8021)
Length: 0x04 (4)
PPP IP Control Protocol
Code: Configuration Nak (3)
Identifier: 0 (0x00)
Length: 4
3.2 (網(wǎng)絡(luò)側(cè))APN分配(Assignment of additional APN)----VOLTE終端在默認(rèn)承載激活和APN分配后IMS APN分配
(網(wǎng)絡(luò)側(cè))的APN分配是UE默認(rèn)承載(和APN)激活之后,再由網(wǎng)絡(luò)側(cè)為其分配(如 IMS APN),其主要包括兩步:
i) RRC : ulinformationTransfer + ESM : PDN Connectivity Request
ii) RRC : RRC Connection Reconfiguration + NAS : Activate Default EPS Bearer Context Req
APN連接請(qǐng)求< PDN Connectivity Request : Additional APN >
NAS EPS session management messages: PDN connectivity request (0xd0)
0011 .... = PDN type: IPv4v6 (3)
.... 0001 = Request type: initial request (1)
Access Point Name
Element ID: 0x28
Length: 4
APN: ims // Usually UE request PDN with specific APN name
Protocol Configuration Options
Element ID: 0x27
Length: 41
[Link direction: MS to network (0)]
1... .... = Extension: True
Configuration Protocol: PPP for use with IP PDP type or IP PDN type (0)
Protocol or Container ID: Internet Protocol Control Protocol (0x8021)
Length: 0x10 (16)
PPP IP Control Protocol
Code: Configuration Request (1)
Identifier: 0 (0x00)
Length: 16
Options: (12 bytes), Primary DNS Server IP Address, Secondary DNS Server IP Address
Primary DNS Server IP Address: 0.0.0.0
Type: Primary DNS Server IP Address (129)
Length: 6
Primary DNS Address: 0.0.0.0 (0.0.0.0)
Secondary DNS Server IP Address: 0.0.0.0
Type: Secondary DNS Server IP Address (131)
Length: 6
Secondary DNS Address: 0.0.0.0 (0.0.0.0)
Protocol or Container ID: DNS Server IPv4 Address Request (0x000d)
Length: 0x00 (0)
Protocol or Container ID: DNS Server IPv6 Address Request (0x0003)
Length: 0x00 (0)
Protocol or Container ID: P-CSCF IPv6 Address Request (0x0001)
Length: 0x00 (0)
Protocol or Container ID: P-CSCF IPv4 Address Request (0x000c)
Length: 0x00 (0)
Protocol or Container ID: IP address allocation via NAS signalling (0x000a)
Length: 0x00 (0)
Protocol or Container ID: MS Support of Network Requested Bearer Control indicator (0x0005)
Length: 0x00 (0)
Protocol or Container ID: IPv4 Link MTU Request (0x0010)
Length: 0x00 (0)
APN的分配(默認(rèn)承載激活+APN請(qǐng)求)< Activate Default EPS Bearer Context Req : Additional APN >
NAS EPS session management messages: Activate default EPS bearer context request (0xc1)
EPS quality of service
Length: 1
Quality of Service Class Identifier (QCI): QCI 9 (9)
Access Point Name
Length: 4
APN: ims // Network Allocate the specific APN Name. This may or may not be the same as UE requested
PDN address
Length: 13
0000 0... = Spare bit(s): 0x00
PDN type: IPv4v6 (3)
PDN IPv6 if id: 0000000000000011
PDN IPv4: 192.168.1.11 (192.168.1.11)
Linked TI - Transaction identifier
Element ID: 0x5d
Length: 1
0... .... = TI Flag: The message is sent from the side that originates the TI
TI value: 0x02 (2)
Quality Of Service - Negotiated QoS
Element ID: 0x30
Length: 14
00.. .... = Spare bit(s): 0
..10 0... = Quality of Service Delay class: Delay class 4 (best effort) (4)
.... .011 = Reliability class: Unacknowledged GTP/LLC, Ack RLC, Protected data (3)
1001 .... = Peak throughput: Up to 256 000 octet/s (9)
.... 0... = Spare bit(s): 0
.... .010 = Precedence class: Normal priority (2)
000. .... = Spare bit(s): 0
...0 1010 = Mean throughput: 100 000 octet/h (10)
100. .... = Traffic class: Background class (4)
...1 0... = Delivery order: Without delivery order ('no') (2)
.... .011 = Delivery of erroneous SDUs: Erroneous SDUs are not delivered('No') (3)
Maximum SDU size: 1500 octets (150)
Maximum bitrate for uplink: 64 kbps (64)
Maximum bitrate for downlink: 384 kbps (104)
0111 .... = Residual Bit Error Rate (BER): 1*10-5 (7)
.... 0100 = SDU error ratio: 1*10-4 (4)
0000 00.. = Transfer delay: Subscribed transfer delay/reserved (0)
.... ..00 = Traffic handling priority: Subscribed traffic handling priority/Reserved (0)
Guaranteed bitrate for uplink: 64 kbps (64)
Guaranteed bitrate for downlink: 568 kbps (127)
000. .... = Spare bit(s): 0
...0 .... = Signalling indication: Not optimised for signalling traffic
.... 0000 = Source statistics description: unknown (0)
Maximum bitrate for downlink (extended): Use the value indicated by the Maximum bit rate for downlink (0)
Guaranteed bitrate for downlink (extended): Use the value indicated by the Guaranteed bit rate for downlink (0)
LLC Service Access Point Identifier - Negotiated LLC SAPI
Element ID: 0x32
0000 .... = Spare bit(s): 0
.... 0011 = LLC SAPI: SAPI 3 (3)
Radio Priority
1000 .... = Element ID: 0x8-
Radio Priority (PDP or SMS): priority level 1 (highest) (1)
Protocol Configuration Options
Element ID: 0x27
Length: 72
[Link direction: Network to MS (1)]
1... .... = Extension: True
Configuration Protocol: PPP for use with IP PDP type or IP PDN type (0)
Protocol or Container ID: Internet Protocol Control Protocol (0x8021)
Length: 0x10 (16)
PPP IP Control Protocol
Code: Configuration Nak (3)
Identifier: 0 (0x00)
Length: 16
Options: (12 bytes), Primary DNS Server IP Address, Secondary DNS Server IP Address
Primary DNS Server IP Address: 10.211.64.87
Type: Primary DNS Server IP Address (129)
Length: 6
Primary DNS Address: 10.211.64.87 (10.211.64.87)
Secondary DNS Server IP Address: 10.211.64.87
Type: Secondary DNS Server IP Address (131)
Length: 6
Secondary DNS Address: 10.211.64.87 (10.211.64.87)
Protocol or Container ID: DNS Server IPv4 Address (0x000d)
Length: 0x04 (4)
IPv4: 10.211.64.87
Protocol or Container ID: DNS Server IPv6 Address (0x0003)
Length: 0x10 (16)
IPv6: 2001:0:0:1::2
Protocol or Container ID: P-CSCF IPv6 Address (0x0001)
Length: 0x10 (16)
IPv6: 2001:0:0:1::2
Protocol or Container ID: P-CSCF IPv4 Address (0x000c)
Length: 0x04 (4)
IPv4: 192.168.1.2
4.S1接口上APN傳輸協(xié)議
APN是終端(UE)與核心網(wǎng)絡(luò)協(xié)商分配,在5G(NR)NSA網(wǎng)絡(luò)中相關(guān)消息通過(guò)S1鏈路(SA網(wǎng)絡(luò)是在NG接口中)在基站與核心網(wǎng)之間傳遞 ;消息內(nèi)容如下:
4.1 初始建立NAS消息< UplinkNASTransport >
S1 Application Protocol
S1AP-PDU: initiatingMessage (0)
initiatingMessage
procedureCode: id-uplinkNASTransport (13)
criticality: ignore (1)
value
UplinkNASTransport
protocolIEs: 5 items
Item 0: id-MME-UE-S1AP-ID
ProtocolIE-Field
id: id-MME-UE-S1AP-ID (0)
criticality: reject (0)
value
MME-UE-S1AP-ID: ....
Item 1: id-eNB-UE-S1AP-ID
ProtocolIE-Field
id: id-eNB-UE-S1AP-ID (8)
criticality: reject (0)
value
ENB-UE-S1AP-ID: 3
Item 2: id-NAS-PDU
ProtocolIE-Field
id: id-NAS-PDU (26)
criticality: reject (0)
value
NAS-PDU: 27a8ccdcee7e024eda2808016e05697370736e
Non-Access-Stratum (NAS)PDU
0010 .... = Security header type: Integrity protected and ciphered (2)
.... 0111 = Protocol discriminator: EPS mobility management messages (0x07)
Message authentication code: 0xa8ccdcee
Sequence number: 126
0000 .... = EPS bearer identity: No EPS bearer identity assigned (0)
.... 0010 = Protocol discriminator: EPS session management messages (0x02)
Procedure transaction identity: 78
NAS EPS session management messages: ESM information response (0xda)
Access Point Name
Element ID: 0x28
Length: 8
APN: testapn
Item 3: id-EUTRAN-CGI
ProtocolIE-Field
id: id-EUTRAN-CGI (100)
criticality: ignore (1)
value
EUTRAN-CGI
...
Item 4: id-TAI
ProtocolIE-Field
id: id-TAI (67)
criticality: ignore (1)
value
TAI
...
4.2初始上下文建立請(qǐng)求< InitialContextSetupRequest >
S1 Application Protocol
S1AP-PDU: initiatingMessage (0)
initiatingMessage
procedureCode: id-InitialContextSetup (9)
criticality: reject (0)
value
InitialContextSetupRequest
protocolIEs: 8 items
Item 0: id-MME-UE-S1AP-ID
ProtocolIE-Field
id: id-MME-UE-S1AP-ID (0)
criticality: reject (0)
value
MME-UE-S1AP-ID: ...
Item 1: id-eNB-UE-S1AP-ID
ProtocolIE-Field
id: id-eNB-UE-S1AP-ID (8)
criticality: reject (0)
value
ENB-UE-S1AP-ID: 3
Item 2: id-uEaggregateMaximumBitrate
ProtocolIE-Field
id: id-uEaggregateMaximumBitrate (66)
criticality: reject (0)
value
UEAggregateMaximumBitrate
uEaggregateMaximumBitRateDL: 201943030
uEaggregateMaximumBitRateUL: 201943030
Item 3: id-E-RABToBeSetupListCtxtSUReq
ProtocolIE-Field
id: id-E-RABToBeSetupListCtxtSUReq (24)
criticality: reject (0)
value
E-RABToBeSetupListCtxtSUReq: 1 item
Item 0: id-E-RABToBeSetupItemCtxtSUReq
ProtocolIE-SingleContainer
id: id-E-RABToBeSetupItemCtxtSUReq (52)
criticality: reject (0)
value
E-RABToBeSetupItemCtxtSUReq
e-RAB-ID: 5
e-RABlevelQoSParameters
qCI: 9
allocationRetentionPriority
priorityLevel: Unknown (12)
pre-emptionCapability: shall-not-trigger-pre-emption (0)
pre-emptionVulnerability: pre-emptable (1)
0... .... Extension Present Bit: False
transportLayerAddress: 0a9bb99c
transportLayerAddress(IPv4): xxx.xxx.xxx.xxx (xxx.xxx.xxx.xxx)
gTP-TEID: ...
nAS-PDU: ...
Non-Access-Stratum (NAS)PDU
0010 .... = Security header type:
Integrity protected and ciphered (2)
.... 0111 = Protocol discriminator:
EPS mobility management messages (0x07)
Message authentication code: 0x5e7a308b
Sequence number: 76
0000 .... = Security header type:
Plain NAS message, not security protected (0)
.... 0111 = Protocol discriminator:
EPS mobility management messages (0x07)
NAS EPS Mobility Management Message Type: Attach accept (0x42)
0000 .... = Spare half octet: 0
.... 0... = Spare bit(s): 0x00
.... .001 = Attach result: EPS only (1)
GPRS Timer - T3412 value
...
Tracking area identity list - TAI list
...
ESM message container
Length: 83
ESM message container contents: ...
0101 .... = EPS bearer identity:
EPS bearer identity value 5 (5)
.... 0010 = Protocol discriminator:
EPS session management messages (0x02)
Procedure transaction identity: 78
NAS EPS session management messages:
Activate default EPS bearer context request (0xc1)
EPS quality of service
Length: 1
Quality of Service Class Identifier (QCI): QCI 9 (9)
Access Point Name
Length: 8
APN: testapn
PDN address
Length: 5
0000 0... = Spare bit(s): 0x00
PDN type: IPv4 (1)
PDN IPv4: xxx.xxx.xxx.xxx (xxx.xxx.xxx.xxx)
APN aggregate maximum bit rate
Element ID: 0x5e
Length: 6
APN-AMBR for downlink : 8640 kbps
APN-AMBR for uplink : 8640 kbps
APN-AMBR for downlink (extended) : 44 Mbps
APN-AMBR for uplink (extended) : 44 Mbps
APN-AMBR for downlink (extended-2) : 256 Mbps
Total APN-AMBR for downlink : 308.640 Mbps
APN-AMBR for uplink (extended-2) : 256 Mbps
Total APN-AMBR for uplink : 308.640 Mbps
Protocol Configuration Options
....
EPS mobile identity - GUTI
Element ID: 0x50
Length: 11
.... 0... = odd/even indic: 0
.... .110 = Type of identity: GUTI (6)
Mobile Country Code (MCC): 001
Mobile Network Code (MNC): 01
MME Group ID: 32774
MME Code: 33
M-TMSI: 0xc071bb09
EMM cause
Element ID: 0x53
Cause: CS domain not available (18)
GPRS Timer - T3402 value
...
GPRS Timer - T3423 value
...
PLMN List - Equivalent PLMNs - 2 PLMNs
Element ID: 0x4a
Length: 6
PLMN[1] Mobile Country Code (MCC): 001
PLMN[2] Mobile Country Code (MCC): 01
EPS network feature support
Element ID: 0x64
Length: 1
....
Additional update result
1111 .... = Element ID: 0xf-
.... 00.. = Spare bit(s): 0x00
.... ..01 = AURV: CS Fallback not preferred (1)
Item 4: id-UESecurityCapabilities
ProtocolIE-Field
id: id-UESecurityCapabilities (107)
criticality: reject (0)
value
UESecurityCapabilities
..0. .... Extension Present Bit: False
encryptionAlgorithms: c000
...0 .... Extension Present Bit: False
integrityProtectionAlgorithms: c000
Item 5: id-SecurityKey
ProtocolIE-Field
id: id-SecurityKey (73)
criticality: reject (0)
value
SecurityKey: ... [bit length 256]
Item 6: id-HandoverRestrictionList
ProtocolIE-Field
id: id-HandoverRestrictionList (41)
criticality: ignore (1)
value
HandoverRestrictionList
servingPLMN: 131002
Mobile Country Code (MCC): 001
Mobile Network Code (MNC): 02
equivalentPLMNs: 2 items
Item 0
PLMNidentity: 134109
Mobile Country Code (MCC): 001
Mobile Network Code (MNC): 02
Item 1
PLMNidentity: 138107
Mobile Country Code (MCC): 001
Mobile Network Code (MNC): 02
Item 7: id-SubscriberProfileIDforRFP
ProtocolIE-Field
id: id-SubscriberProfileIDforRFP (106)
criticality: ignore (1)
value
SubscriberProfileIDforRFP: 1
整理:kangguoying20201104
"5G網(wǎng)絡(luò)共享方案介紹"已在微信公眾號(hào)"跟著老康學(xué)5G"中推出,敬請(qǐng)關(guān)注!