How UPF allocates the UE IP through DHCP server
These stages show the process in which the UPF allocates the UE IP address through external DHCP server:
-
Session establishment request: The SMF sends the UE IP Address IE in PDI IE within the PFCP Session Establishment Request message to the UPF, if the SMF is configured to obtain UE IP addresses from the UPF.
This message contains the VLAN ID(s) in the Create PDR IE in UE IP Address Pool Identity IE and CHOOSE IPV4 (CHV4) message bit set to one. The CHV4 message bit requests the UPF for IPv4 address allocation.
-
DHCP subnet selection: UPF uses the received VLAN ID(s) for selecting the subnet for UE IP based on some conditions.
Learn more about the conditions in the DHCP subnet selection criteria topic.
-
DHCP configuration validation: UPF validates if the DHCP service is configured and running by checking the configuration validation criteria.
If the DHCP configuration validation is successful, UPF accepts the PFCP Establishment Request and initiates a DHCP Discovery handshake towards DHCP server in the given subnet using the received VLAN ID. If the configuration validation fails based on the criteria, the UPF rejects the Establishment Request.
To know more about the configuration validation, see the Criteria for DHCP configuration validation topic.
-
DORA process initiation: UPF initiates the Discovery-Offer-Request-Acknowledge (DORA) handshake process by sending a broadcast Discovery message in the subnet to all the DHCP servers. UPF acts as the DHCP client Relay and uses the received VLAN information for sending the Discovery message.
Note
-
The UPF receives the unicast response from the DHCP server on the destination port 67.
-
UPF acts as client when it sends the broadcast DHCPDISCOVER message is sent in the VLANs source port—68 and the dst port—67.
-
-
Offer and Request messages: UPF receives the Offer message from the DHCP server with an IP address, lease time, and the server identifier.
UPF validates the received IP with the SMF allocated IP chunks. The IP validation happens only if skip-validation is not confiured.
If the IP validation is successful, UPF sends a Request message to the DHCP server. If the IP validation fails, lease validation, or any other validation fails at the Offer packet, then the Request message does not go.
If the IP validaion fails on Reply message, UPF sends a decline message to the DHCP server. However, if any other validation fails, UPF sends a release message to the DHCP server.
Know more about the criteria for IP validation for IPv4 in the Validation of IP addresses from DHCP server and SMF topic.
-
Renew and rebind:
-
Renew request: UPF tries to renew the lease when the allocated lease time is about to expire. In this case, UPF sends a unicast renew request to the DHCP server at 50% (T1 threshold) of the allocated lease time.
If the DHCP server does not respond to renew request, the UPF will retry the renew request until the maximum retries are exhausted. If the DHCP server does not respond even after the maximum retry are exhausted, the DHCP server sends the rebind request when the allocated lease is at 88%.
If server replies with NAK (Negative Acknowledgement), it implies that the lease cannot be extended. The UPF then purges the call and informes the SMF.
-
Rebind request: UPF tries to rebind with another DHCP server by broadcasting a rebind request to all the DHCP servers in the subnet at 88% (T2 threshold) of the allocated lease time.
If the DHCP server does not respond to the rebind request, the UPF retries the rebind request until the maximum retries are exhausted. If the DHCP server does not respond even after maximum retries are exhausted, and the allocated lease gets expired, the call gets purged. The UPF notifies about the call deletion to the SMF.
If server replies with NAK, it implies that the lease cannot be extended. The UPF then purges the call and informs the SMF.
Note
-
The values of T1 and T2 thresholds are configurable.
To know more about configuring T1 and T2 thresholds, see the DHCP Service Configuration Mode Commands chapter in the Command Line Interface Reference, Modes C - D, StarOS Release 21.28 guide.
-
EPFAR configuration is mandatory to handle renew/rebind failure, and if not configured UPF will do a local purge leading to mismatch between SMF and UPF
-
-
Session deletion: UPF locally purges the session and sends an indicationtion to SMF that UPF has deleted the call in session report request, once the lease time is expired.
SMF sends PFCP session Deletion request over N4 interface to UPF. Upon receiving PFCP Session Deletion Request message from SMF, the UPF initiates fire-and-forget DHCP release request towards DHCP server.
DHCP subnet selection criteria
The UPF interprets the UE IP Address Pool Identity IE as the VLAN ID for selecting IPv4 subnet according to these conditions:
When N4 session establishment contains... |
And Create PDR IE contains ... |
Then ... |
---|---|---|
CHOOSE IPV4 bit |
single UE IP Address Pool Identity IE |
UPF interprets as VLAN to identify the subnet for IPv4 IP address allocation. |
CHOOSE IPV4 bit |
more than one UE IP Address Pool Identity IEs |
UPF ignores additional occurrences of the UE IP Address Pool Identity IE. |
Criteria for DHCP configuration validation
Before initiating the DORA process, UPF performs these validations:
-
If CHOOSE IPV4 bit is set, the UE IP Address Pool Identity IE should be present and IPv4 address should not be present.
-
If the CHOOSE IPV4 bit is set and IPv4 address is not present, local APN level configuration ip address alloc-method dhcp-proxy should be present.
-
If the CHOOSE IPv4 bit is set, then the DHCP configuration for IPv4 must be valid. It is required to start DHCP service, otherwise the call gets rejected with the cause code "Mandatory IE Incorrect".
-
The received VLAN ID should be present for IPv4 in the configuration on UPF.
If the received VLAN ID is not present in the UPF configuration, then the UPF sends the cause code “NO RESOURCES AVAILABLE” to SMF.
-
If the DHCP server discovery is disabled and the DHCP server IP address is not configured, but DHCPv4 service is running, then UPF sends the cause code “NO RESOURCES AVAILABLE” to SMF.
-
The Slot/Port should be present and linked to correct interfaces for IPv4 in the configuration.
Validation of IP addresses from DHCP server and SMF
The UPF compares the IP received from DHCP server with the chunks allocated by SMF during the DORA process.
These stages show the IP validation process:
-
UPF sends the DHCP Discover message to the DHCP Server.
-
UPF receives the DHCP Offer message from the DHCP server along with a client IP address, lease time, and server identifier.
UPF accepts the first Offer message it receives and ignores all the subsequent Offer messages from other DHCP servers.
-
UPF validates the received IP address with the IP pool chunks sent by SMF.
If the IP validation is ...
then...
successful
UPF sends DHCP Request message to DHCP server to receive the DHCP Acknowledgement message from the DHCP Server.
unsuccessful
UPF discards the Offer message and does not send DHCP Request message to DHCP Server. UPF then rejects the session.
-
The UPF receives Acknowledgement message from the DHCP server. The UPF validates if the IP received in the Offer and the Acknowledge messages are same. UPF also performs other validations like lease validation, chaddr validation, server identifier validation, etc.
If the IP values received in Offer and Acknowledgement messages are same, the IP validation is considered to be successful. In this case, the UPF forwards the UE IP to the SMF.
The there is a mismatch between the IP addresses received in the Offer and Acknowledgement messages, the IP validation process is considered as unsuccessful. In this case, the UPF sends DHCP decline message to the DHCP server and the deletes the session.
If there is mismatch in values of Offer packet and Acknowledgement packet except the IP address validation,then the UPF sends a DHCP release message to the DHCP server.