An address allocation method and apparatus

CN122601643APending Publication Date: 2026-08-18NEW H3C TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610898762.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-06-22
Publication Date
2026-08-18

AI Technical Summary

Technical Problem

[0006]本申请提供一种地址分配方法及装置,用以解决SDN园区网络中在业务DHCP服务器不可达时,终端IP地址分配及IP地址续约的问题,以保障园区网络的业务连续性

Benefits of technology

在SDN控制的园区网络中,当核心业务DHCP服务器故障时,本申请的Leaf设备自动从DHCP中继角色切换为DHCP服务代理角色,基于通过DHCP Snooping学习到的绑定关系以及SDN控制组件为自身分配的备用地址池,为终端继续提供地址分配和租约管理等DHCP服务,从而保证园区网络的业务连续性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122601643A_ABST
    Figure CN122601643A_ABST
Patent Text Reader

Abstract

This application provides an address allocation method and apparatus. The method, applied to a Leaf device, includes: maintaining a binding relationship between the IP address, MAC address, and lease validity period of a terminal locally based on DHCP messages monitored by the DHCP Snooping function; periodically probing the status of the service DHCP server, and switching its role from DHCP relay to DHCP server agent when the service DHCP server is detected to be unreachable; and providing temporary DHCP services to the terminal based on the binding relationship and a pre-allocated spare address pool. This method solves the problem of terminal IP address allocation and renewal when the service DHCP server is unreachable without adding equipment or servers, improving the network's self-healing capability and service continuity in critical service failure scenarios.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of communication technology, and in particular to an address allocation method and apparatus. Background Technology

[0002] In SDN (Software-Defined Networking) campus network solutions, terminal access authentication and IP address allocation are critical aspects of ensuring network security and business continuity. Using DHCP (Dynamic Host Configuration Protocol) to dynamically allocate IP addresses to terminals significantly reduces network operation and maintenance complexity compared to static configuration, and is also the foundation for implementing advanced features such as name-address binding and policy-based configuration.

[0003] In an SDN campus network, Leaf devices, acting as distributed gateways and terminal access devices, are crucial nodes for terminal authentication and IP address allocation. Authentication servers (such as AAA servers) and service DHCP servers are essential components for the normal operation of the SDN solution. If the service DHCP server becomes unavailable due to server failure, network link failures, or unreachability of the management and maintenance area, newly connected terminals will be unable to obtain IP addresses, and existing terminals will be unable to renew their leases upon expiration, leading to service interruption.

[0004] To address terminal authentication issues in scenarios where the authentication server is unreachable, current SDN campus solutions offer escape and escape permission retention solutions. However, these solutions only focus on scenarios where the authentication server is unreachable and do not address situations where the service DHCP server is unreachable, thus failing to provide terminals with IP address allocation and lease renewal services for the service network segment.

[0005] In summary, the current technical solution fails to address the issues of terminal IP address allocation and lease renewal when the business DHCP server is unreachable, making it difficult to guarantee business continuity of the campus network under DHCP service failure conditions. Summary of the Invention

[0006] This application provides an address allocation method and apparatus to solve the problem of terminal IP address allocation and IP address renewal in an SDN campus network when the service DHCP server is unreachable, so as to ensure the service continuity of the campus network.

[0007] Specifically, this application provides the following technical solution: In a first aspect, this application provides an address allocation method applied to Leaf devices in a target campus network, wherein the target campus network further includes an SDN control component and a service DHCP server, and the method includes: Based on the DHCP messages monitored by the DHCP Snooping function, the binding relationship between the terminal's IP address, MAC address, and lease validity period is maintained locally. The system periodically probes the status of the service DHCP server, and when it detects that the service DHCP server is unreachable, it switches its role from DHCP relay role to DHCP server agent role. Based on the binding relationship and the pre-allocated backup address pool, temporary DHCP service is provided to the terminal; the backup address pool is pre-allocated to each Leaf device by the SDN control component, and the backup address pools of different Leaf devices do not overlap.

[0008] Secondly, this application provides an address allocation device applied to Leaf devices in a target campus network, wherein the target campus network further includes an SDN control component and a service DHCP server, and the device includes: The first module is used to maintain the binding relationship between the terminal's IP address, MAC address, and lease validity period locally based on the DHCP messages listened to by the DHCP Snooping function. The second module is used to periodically detect the status of the service DHCP server. When the service DHCP server is detected to be unreachable, the module switches its role from DHCP relay role to DHCP server agent role. The third module is used to provide temporary DHCP service to the terminal based on the binding relationship and the pre-allocated backup address pool; the backup address pool is pre-allocated to each Leaf device by the SDN control component, and the backup address pools of different Leaf devices do not overlap.

[0009] Thirdly, this application provides an electronic device, comprising: A memory, one or more processors; the memory is coupled to the processors; wherein the memory stores computer program code, the computer program code including computer instructions, and when the computer instructions are executed by the processor, the electronic device performs the method described above.

[0010] Fourthly, this application provides a computer-readable storage medium including computer instructions that, when executed on an electronic device, cause the electronic device to perform the method described above.

[0011] Fifthly, this application provides a computer program product that, when run on a computer, causes the computer to perform the method described above.

[0012] The technical solution provided in this application has the following beneficial effects: In an SDN-controlled campus network, when the core service DHCP server fails, the Leaf device of this application automatically switches from the DHCP relay role to the DHCP service agent role. Based on the binding relationship learned through DHCP Snooping and the backup address pool allocated to it by the SDN control component, it continues to provide DHCP services such as address allocation and lease management to the terminals, thereby ensuring the service continuity of the campus network.

[0013] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and do not limit this application. Attached Figure Description

[0014] The accompanying drawings, which are incorporated in and form part of this application, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0015] Figure 1 A flowchart illustrating the address allocation method provided in an embodiment of this application; Figure 2 A schematic diagram of the campus network provided in the embodiments of this application; Figure 3 A schematic diagram of the processing logic of the Leaf device in a scenario where the AAA server is reachable but the service DHCP server is unreachable. Figure 4 A schematic diagram of the Leaf device's processing logic in a scenario where neither the AAA server nor the business DHCP server is reachable; Figure 5 A schematic diagram illustrating the process of a Leaf device simulating a terminal initiating an IP address request, provided in an embodiment of this application; Figure 6 A schematic diagram of the recovery logic of the Leaf device in a scenario where the AAA server is reachable and the service DHCP server is restored to reachability; Figure 7 A schematic diagram of the recovery logic of the Leaf device in a scenario where the AAA server is unreachable but the business DHCP server becomes reachable again; Figure 8 A schematic diagram of an address allocation device provided in an embodiment of this application; Figure 9 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0016] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application.

[0017] The terminology used in this application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. The singular forms “a,” “the,” and “the” used herein are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and includes any and all possible combinations of one or more of the corresponding listed items.

[0018] It should be understood that although the terms first, second, third, etc., may be used in this application to describe various information, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, without departing from the scope of this application, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to determination."

[0019] The technical solution and its beneficial effects of this application will be described in detail below through specific embodiments.

[0020] This application provides an address allocation method applied to Leaf devices in a target campus network, wherein the target campus network further includes an SDN control component and a service DHCP server. Figure 1 As shown, the method may include the following steps: Step 110: Based on the DHCP messages monitored by the DHCP Snooping function, maintain the binding relationship between the terminal's IP address, MAC address, and lease validity period locally; Step 120: Periodically detect the status of the service DHCP server. When the service DHCP server is detected to be unreachable, switch its own role from DHCP relay role to DHCP server agent role. In this application, DHCP relay refers to DHCP Relay, and DHCP server proxy refers to DHCP Server Proxy.

[0021] Step 130: Based on the binding relationship and the pre-allocated backup address pool, provide temporary DHCP service to the terminal; the backup address pool is pre-allocated to each Leaf device by the SDN control component, and the backup address pools of different Leaf devices do not overlap.

[0022] The method described in this application is applied to the target campus network. Figure 2 An example of a campus network is given, which is logically divided into two parts: the management and maintenance area and the campus network.

[0023] The management and maintenance area is equipped with an SDN control component, an AAA (Authentication, Authorization, and Accounting) server, and a service DHCP server. The SDN control component is responsible for the unified configuration and management of the campus network; the AAA server is responsible for terminal authentication and authorization; and the service DHCP server is responsible for allocating IP addresses to authenticated terminals and managing address leases.

[0024] The campus network uses VXLAN (Virtual eXtensible LAN) technology to build an overlay network, with a physical architecture consisting of three layers: core layer, aggregation layer, and access layer. The core layer deploys Spine devices (Spine Switches, backbone switches / core layer switches), serving as the core forwarding nodes of the campus network and responsible for Layer 3 forwarding across Leaf devices. The aggregation layer deploys Leaf devices (Leaf Switches, leaf switches / access layer switches), serving as boundary nodes and distributed gateways for the VXLAN network, and also as Network Access Servers (NAS), responsible for terminal authentication. The access layer deploys Access devices (Access Switches), serving as Layer 2 switching devices for accessing terminals and Access Points (APs). Wireless terminals access the network through AP devices and are managed uniformly by AC devices (Access Controllers, access controllers / wireless controllers). AC devices can be deployed independently or integrated with Leaf devices.

[0025] The devices in the campus network (Spine devices, Leaf devices, Access devices, AC devices, AP devices, etc.) communicate with the SDN control components, AAA server, and service DHCP server through the Layer 3 switches in the management and maintenance area. If the link between the campus network and the management and maintenance area fails or communication is interrupted, the AAA server or service DHCP server will become unreachable, which will affect terminal authentication and IP address acquisition, causing service interruption.

[0026] In this application, the Leaf device has both DHCP relay and DHCP Snooping functions. The Leaf device continuously listens for passing DHCP messages through the DHCP Snooping function, and records and maintains the binding relationship between the IP address, MAC address and lease validity period of the terminal device.

[0027] The SDN control component pre-allocates a primary address pool for the service DHCP server and assigns non-overlapping backup address pools to each Leaf device. Each Leaf device's backup address pool corresponds to a slave subnet within its own Layer 2 network domain. This slave subnet belongs to the same Layer 2 network domain as the primary subnet managed by the service DHCP server, but the network segments are different and do not overlap.

[0028] The aforementioned Layer 2 network domain refers to the logically isolated broadcast domain built on VXLAN in the SDN network, used to achieve terminal access isolation and service accompaniment across physical locations; the subnet of the Layer 2 network domain refers to the Layer 3 logical gateway of the Layer 2 network domain.

[0029] The Leaf device periodically probes the status of the service DHCP server. While the service DHCP server is reachable, the Leaf device acts as a DHCP relay, forwarding DHCP requests from terminals to the service DHCP server. When the service DHCP server is detected as unreachable, the Leaf device switches its role from DHCP relay to DHCP server agent, providing temporary DHCP services such as address allocation and lease management to terminal devices based on locally maintained binding relationships and a spare address pool pre-allocated by the SDN components.

[0030] After the service DHCP server becomes reachable again, the Leaf device switches back to the DHCP relay role, and the IP address allocation and lease of the terminal are still handled by the service DHCP server.

[0031] In this application, the Leaf device switches to the DHCP server agent role when the service DHCP server is unreachable, temporarily taking over the functions of the service DHCP server. Specifically, for terminals that have already been online and request to reconnect (i.e., reconnection scenario) and newly connected terminals (i.e., initial connection scenario), the Leaf device assigns them IP addresses; for terminals already online (i.e., lease renewal scenario), the Leaf device renews their IP addresses. Furthermore, based on whether the AAA server is reachable, it can be divided into the following two scenarios: AAA server reachable, business DHCP server unreachable: In this scenario, the Leaf device assigns an IP address to terminals that are reconnecting or connecting for the first time; for terminals that are renewing their IP addresses, the Leaf device renews their IP addresses.

[0032] Neither the AAA server nor the business DHCP server is reachable: In this scenario, the Leaf device assigns an IP address to a terminal that reconnects; for terminals that renew their IP addresses, the Leaf device renews their IP addresses.

[0033] Furthermore, for medium to large-scale campus networks, the mainstream approach to wireless deployment is local forwarding, with centralized forwarding scenarios being less common. One of the significant advantages of VXLAN networking is its support for wireless local forwarding; therefore, this application only considers the wireless local forwarding scenario, and the following descriptions of wireless terminals are all based on this scenario.

[0034] The following five aspects will be discussed in detail regarding the address allocation method provided in this application: binding relationship maintenance, DHCP server reachability detection, address pool allocation, temporary DHCP service, and fault recovery.

[0035] I. Binding Relationship Maintenance In this application, the Leaf device enables the DHCP Snooping function, listens for passing DHCP packets through the DHCP Snooping function, and generates DHCP Snooping entries. These entries are data records generated by the standard DHCP Snooping function, including information such as terminal IP address, MAC address, lease validity period, VLAN (Virtual Local Area Network), and access interface.

[0036] Based on this, the Leaf device maintains a list of binding relationships locally according to the DHCP Snooping entries. Each binding relationship specifically includes the terminal's IP address, MAC address, and lease validity period, which serves as the basis for the Leaf device to provide temporary DHCP services when the business DHCP server is unreachable.

[0037] As an example, the binding relationships maintained by the Leaf device are shown below: Table 1 In this application, the binding relationship refers to the correspondence between terminal IP addresses, MAC addresses, and lease validity periods maintained locally by the Leaf device for address allocation and lease management. This data originates from DHCP Snooping entries and is a mapping view of key information within the DHCP Snooping entries, used for rapid retrieval and decision-making under the agent role. DHCP Snooping entries are complete data records generated by the standard DHCP Snooping function and are used for data synchronization after the business DHCP server recovers.

[0038] Whether the business DHCP server provides regular DHCP service while it is reachable, or the Leaf device acts as a DHCP server agent to provide temporary DHCP service while it is unreachable, the DHCPSnooping entries are updated normally, and the binding relationships are automatically updated along with the DHCP Snooping entries.

[0039] II. DHCP Server Reachability Detection The Leaf device periodically probes the status of the service DHCP server. For example, acting as a DHCP relay, the Leaf device sends DHCP Discover, Request, or Release messages to the service DHCP server and listens for its response. If no response is received from the service DHCP server within a predetermined time, a timeout retransmission mechanism is initiated; if no response is received after retransmission, the service DHCP server is determined to be unreachable.

[0040] When the business DHCP server is determined to be unreachable, the Leaf device switches its role from DHCP relay to DHCP server agent, temporarily taking over the work of the business DHCP server and providing temporary DHCP service to the terminal.

[0041] When the Leaf device receives a response message from the service DHCP server again, it determines that the service DHCP server has been restored to reachability. At this time, the Leaf device switches its role from DHCP server agent back to DHCP relay.

[0042] III. Address Pool Allocation The backup address pool is used as a basis for decision-making when the business DHCP server is unreachable, and the Leaf device acts as a DHCP server proxy to temporarily assign IP addresses to terminals.

[0043] To avoid address pool conflicts in both reachable and unreachable scenarios of the business DHCP server, this application configures a primary subnet and a secondary subnet for the same Layer 2 network domain: the primary subnet is used as the primary address pool for the business DHCP server, and the secondary subnet is used as the backup address pool for Leaf devices when the business DHCP server is unreachable.

[0044] When the service DHCP server is reachable, the service DHCP server is responsible for the allocation and renewal of the terminal's IP address. Specifically, when the SDN control component configures the main subnet of the Layer 2 network domain (i.e., the virtual interface and main IP address of the Leaf device's interface vsi-interface) and selects automatic IPv4 address acquisition, the SDN control component pushes the network segment and gateway address of the main subnet of the Layer 2 network domain to the service DHCP server as the address pool for that Layer 2 network domain.

[0045] When the service DHCP server becomes unreachable, the Leaf device acts as a DHCP server proxy, temporarily assigning IP addresses to terminals. The spare address pool is pre-configured in the SDN control component, specifically including: creating a slave subnet (as slave IP addresses under the interface vsi-interface virtual interface when distributed to the Leaf device) within the Layer 2 network domain of the SDN control component, enabling the "DHCP Server Proxy mode" for this slave subnet, and selecting the allocation method for the Leaf device's spare address pool (e.g., equal allocation or weighted allocation). The SDN control component distributes the configured spare address pool to each Leaf device, without pushing it to the service DHCP server.

[0046] To avoid address pool conflicts between multiple Leaf devices, the backup address pools of each Leaf device do not overlap. This application provides the following two address pool allocation methods, and users can choose the appropriate allocation method according to their actual scenario: Method A: Average distribution This method is suitable for scenarios where the number of terminals connected to each Leaf device is roughly the same, and includes the following steps A1 to A3: Step A1: Based on the planned number of terminals to be connected to each Leaf device, and considering an 80% address utilization rate (i.e., reserving 20% ​​for future terminal expansion), calculate the address pool capacity required for a single Leaf device. The calculation formula is: Address pool capacity required for a single Leaf device = ⌈Number of terminals planned to be connected to a single Leaf device ÷ 0.8⌉, where ⌈⌉ represents rounding up.

[0047] Step A2: Calculate the required address pool capacity for all Leaf devices using the SDN control component, rounding up to a suitable network segment for configuring the slave network segment in the Layer 2 network domain. This application adds a parameter to the slave network segment; selecting this parameter indicates that the address pool is provided to the Leaf devices as a backup address pool when the DHCP server is unreachable. Total address pool capacity = total number of Leaf devices × address pool capacity required by a single Leaf device. Taking the smallest power of 2 that satisfies the total address pool capacity, denoted as 2^n, the total network segment prefix length = 32 - n.

[0048] Step A3: The SDN control component will split the address pool of the network segment (i.e., the slave subnet of the Layer 2 network domain) into multiple address segments and distribute them to each Leaf device.

[0049] For example, assuming there are 5 Leaf devices, each planned to connect 200 terminals, the address pool capacity required for each Leaf device is 200 ÷ 0.8 = 250, and the total address pool capacity is 250 * 5 = 1250. The smallest power of 2 that satisfies this capacity is 2^11 (i.e., 2048), corresponding to a network segment prefix length of 21 bits. The SDN control component configures the Layer 2 network domain from the network segment 172.16.0.0 / 21, and uses an average allocation algorithm to allocate address pools to each Leaf device, with the following results: Table 2 Method B: Weighted Allocation This method is suitable for scenarios where the number of terminals connected to each Leaf device is unevenly distributed, and includes the following steps B1 to B3: Step B1: Obtain the approximate number of terminals connected to each Leaf device (denoted as C1, C2, ..., Cx), and determine the address pool capacity weight ratio of each Leaf device as C1:C2:C3:...:Cx.

[0050] Step B2: Calculate the total address pool capacity P = ⌈(C1+C2+C3+…+Cx)÷(1-20%)⌉, where ⌈⌉ represents rounding up. That is, based on the sum of the address pool capacities required by all Leaf devices, a 20% expansion margin is reserved. Based on the planned total address pool capacity P, select the smallest power of 2 that satisfies P, denoted as 2^n, to obtain the total network segment prefix length l = 32 – n.

[0051] Step B3: The SDN control component calculates the address pool capacity of each Leaf device using a weighted allocation algorithm based on the address pool capacity weight ratio of each Leaf device. It then weights and splits the address pool of the subnet (i.e., the subnet of the Layer 2 network domain) into multiple address segments and distributes them to each Leaf device.

[0052] Specifically, the address pool capacity of the first Leaf is K1 = ⌈(2^n - 2) × C1 / (C1 + C2 + ... + Cx)⌉. This address pool ranges from 172.16.0.2, counting forward (K1-1) addresses, where ⌈⌉ represents rounding up. The other address pools are calculated similarly. It's worth noting that 2^n - 2 is used to exclude gateway addresses and addresses like 172.16.0.0, which are generally not allocated to terminals.

[0053] For example, suppose there are 5 Leaf devices, with Leaf 1 to Leaf 3 each connected to approximately 170 terminals, Leaf 4 connected to approximately 80 terminals, and Leaf 5 connected to approximately 40 terminals. The planned total address pool capacity P = ⌈(170+170+170+80+40) ÷ (1-20%)⌉ = 788. The smallest power of 2 that satisfies 788 is 2^10 (i.e., 1024), corresponding to a 22-bit network segment prefix length. The SDN control component configures the Layer 2 network's slave network segment as 172.16.0.0 / 22, with the weight ratio of each Leaf device being 170:170:170:80:40. The final address pool capacity allocated to each Leaf device is: Leaf1 address pool capacity K1 = ⌈(1024-2)×170÷(170+170+170+80+40)⌉ = 276; Leaf2 address pool capacity K2 = ⌈(1024-2)×170÷(170+170+170+80+40)⌉ = 276; Leaf3 address pool capacity K3 = ⌈(1024-2)×170÷(170+170+170+80+40)⌉ = 276; Leaf4 address pool capacity K4 = ⌈(1024-2)×80÷(170+170+170+80+40)⌉=130; Leaf5 address pool capacity K5 = ⌈(1024-2)×40÷(170+170+170+80+40)⌉=65.

[0054] The final allocation results are shown below: Table 3 IV. Temporary DHCP Service After switching to the DHCP server agent role, the Leaf device takes over the DHCP requests that should have been handled by the business DHCP server, providing temporary DHCP services. Specifically, for terminals that have already been online and request to go online again, as well as newly online terminals, the Leaf device assigns them IP addresses; for terminals that are already online and request to renew their IP addresses, the Leaf device renews their IP addresses.

[0055] In this application, based on the state of the terminal device during the period when the service DHCP server is unreachable and the type of DHCP interaction initiated, the Leaf device processes the requests according to the following logic: (1) Reconnection Scenario: The terminal device has previously obtained an IP address in this network, and the Leaf device has a local record of the terminal's binding relationship. However, the terminal is currently in a reconnection state after being offline. In this scenario, the terminal initiates a DHCP address allocation request. The Leaf device responds to the request by querying the locally maintained binding relationship using the terminal's MAC address as the query keyword, and allocates the obtained IP address to the terminal through a DHCP response message.

[0056] (2) First-time access scenario: The terminal device has never obtained an IP address in this network, and the Leaf device does not have a binding relationship with the terminal locally. In this scenario, the terminal initiates a DHCP address allocation request, and the Leaf device responds to the request by selecting an unoccupied IP address from the spare address pool and allocating the selected IP address to the terminal via a DHCP response message. After successful allocation, a corresponding DHCP Snooping entry and binding relationship are generated for the terminal.

[0057] The above-mentioned selection of an unused IP address from the backup address pool can specifically be achieved by selecting an unused IP address from the backup address pool corresponding to the XLAN service to which the terminal belongs. In other words, the aforementioned backup address pool corresponds to the VXLAN service to which the terminal belongs.

[0058] (3) Lease renewal scenario: The terminal device is currently online and its IP address lease has not yet expired. In this scenario, the terminal initiates a DHCP renewal request, and the Leaf device directly responds to the request, returns a renewal confirmation message to the terminal, and refreshes the lease validity period in the corresponding DHCP Snooping table and binding relationship.

[0059] The method by which a terminal accesses the corresponding service via VXLAN depends on whether the AAA server is reachable and the type of the terminal, as detailed below: Different methods are used to determine the service VXLAN to which the terminal belongs, depending on whether the AAA server is reachable: (a1) When the AAA server is reachable, the AAA server authenticates the terminal and grants service VXLAN or VLAN authorization after successful authentication. The Leaf device determines the service VXLAN to which the terminal belongs based on the authorization information issued by the AAA server. (a2) When the AAA server is unreachable, for terminals that have been online, the Leaf device or AC device shall determine the service VXLAN previously authorized to the terminal as the service VXLAN to which the terminal belongs, based on the escape permission retention table entries maintained locally.

[0060] Different paths are used to enable wired and wireless terminals to access the VXLAN service: (b1) For wired terminals, after the wired terminal obtains the service VXLAN authorization, the Leaf device binds the access session of the wired terminal to the corresponding service VXLAN; (b2) For wireless terminals, the AAA server or AC device authorizes the VLAN for them. After the wireless terminal obtains the VLAN authorization, the Leaf device determines the service VXLAN corresponding to the authorized VLAN according to the VLAN and VXLAN mapping relationship pre-configured on its own downlink port, and binds the access session of the wireless terminal to the corresponding service VXLAN.

[0061] The following describes the specific handling process of the Leaf device acting as a DHCP server agent when the business DHCP server is unreachable, based on two dimensions: whether the AAA server is reachable and the terminal type.

[0062] Scenario 1: AAA server is reachable, but business DHCP server is unreachable. like Figure 3 As shown, when the AAA server is reachable but the service DHCP server is unreachable, the AAA server can still authenticate the terminal and authorize it to enter the corresponding service VXLAN. The Leaf device switches to the DHCP server agent role and provides DHCP services to wired and wireless terminals respectively in the following ways: (a) Wired terminal Reconnection Scenario: When a wired terminal that has already been connected reconnects to the network, the AAA server authenticates the terminal. After successful authentication, the terminal is authorized to access the corresponding VXLAN service. The Leaf device uses the terminal's MAC address as the query keyword to retrieve the locally maintained binding relationships. If a corresponding binding relationship is found, the retrieved IP address is assigned to the terminal via a DHCP response message.

[0063] Initial Access Scenario: When a new wired terminal accesses the network for the first time, it first completes authentication via the AAA server. After successful authentication, it accesses the corresponding VXLAN service. The Leaf device, acting as a DHCP server proxy, selects an unused IP address from the spare address pool corresponding to the VXLAN service and assigns it to the terminal via a DHCP response message. After successful address allocation, the Leaf device generates a corresponding DHCP Snooping entry and binding relationship for the terminal.

[0064] Lease renewal scenario: When an online wired terminal initiates a DHCP renewal request, the Leaf device, acting as a DHCP server agent, directly responds to the renewal request, returns a renewal confirmation message to the terminal, and simultaneously refreshes the lease validity period in the corresponding DHCP Snooping table and binding relationship.

[0065] (ii) Wireless terminal The processing logic for wireless terminals is basically the same as that for wired terminals, the difference being the path to access the service VXLAN: Wireless terminals are first authorized to use a VLAN by the AAA server, and then access the corresponding service VXLAN through the pre-configured VLAN-VXLAN mapping on the downlink port of the Leaf device. Specifically: Reconnection Scenario: When a previously connected wireless terminal reconnects to the network, the AAA server authenticates the terminal and authorizes its VLAN upon successful authentication. The terminal then accesses the corresponding VXLAN service based on the pre-configured VLAN-VXLAN mapping on the Leaf device's downlink port. The Leaf device uses the terminal's MAC address as the query keyword to retrieve locally maintained binding relationships and assigns the retrieved IP address to the terminal via a DHCP response message.

[0066] Initial Access Scenario: When a new wireless terminal accesses the network for the first time, it completes authentication via the AAA server. After successful authentication, the AAA server authorizes the VLAN. The terminal accesses the corresponding service VXLAN based on the VLAN-VXLAN mapping pre-configured on the Leaf device's downlink port. Subsequent IP address allocation mechanisms are the same as those for the initial access scenario of wired terminals described above.

[0067] Lease renewal scenario: When an online wireless terminal initiates a DHCP renewal request, the processing mechanism is the same as the lease renewal scenario for wired terminals mentioned above. That is, the Leaf device directly responds to the renewal request and refreshes the corresponding lease validity period.

[0068] Scenario 2: Both the AAA server and the business DHCP server are unreachable. like Figure 4 As shown, when both the AAA server and the service DHCP server are unreachable, the AAA server cannot authenticate and authorize the terminal. In this case, the Leaf device or AC device restores the previously authorized service VXLAN for terminals that have been online, based on the locally maintained escape permission retention table entries; for terminals that have never been online, they are handled in the normal way, i.e., included in the escape security group, and assigned an IP address by the escape DHCP server.

[0069] (a) Wired terminal Reconnection Scenario (Users with Escape Permission Retention): For wired terminals that have been previously authenticated and online and have escape permission, the Leaf device directly authorizes the VXLAN service for the terminal based on the locally maintained escape permission retention table. The Leaf device uses the terminal's MAC address as the query keyword to retrieve the locally maintained binding relationship and assigns the retrieved IP address to the terminal via a DHCP response message.

[0070] First-time access scenario (escape user): For new wired terminals that have never been online before, the terminal is included in the escape safety group, and its IP address is assigned by the escape DHCP server.

[0071] Lease renewal scenario: When an online wired terminal initiates a DHCP renewal request, the Leaf device, acting as a DHCP server agent, directly responds to the renewal request, returns a renewal confirmation message to the terminal, and refreshes the corresponding lease validity period.

[0072] (ii) Wireless terminal The processing logic of wireless terminals is basically the same as that of wired terminals. The difference lies in the following: In escape scenarios, the wireless terminal uses the AC device to maintain the authorized VLAN entries in the escape permission table based on locally maintained records. Then, through the VLAN-VXLAN mapping relationship pre-configured on the downlink port of the Leaf device, it enters the corresponding service VXLAN. Specifically: Reconnection Scenario (Users with Escape Permission Retention): For wireless terminals that have been previously authenticated and online and have escape permission, the AC device authorizes a VLAN for the terminal based on the locally maintained escape permission retention table. Terminal packets enter the corresponding service VXLAN via the pre-configured VLAN-VXLAN mapping relationship on the Leaf device's downlink port. The Leaf device uses the terminal's MAC address as the query keyword to retrieve the locally maintained binding relationship and assigns the retrieved IP address to the terminal via a DHCP response message.

[0073] First-time access scenario (escape user): For new wireless terminals that have never been online before, they are included in the escape safety group and an IP address is assigned to them by the escape DHCP server.

[0074] Lease renewal scenario: When an online wireless terminal initiates a DHCP renewal request, the processing mechanism is the same as the lease renewal scenario for wired terminals mentioned above. That is, the Leaf device directly responds to the renewal request and refreshes the corresponding lease validity period.

[0075] V. Fault Recovery After the business DHCP server recovers from an unreachable state to a reachable state, the Leaf device switches its role from DHCP server agent back to DHCP relay and simulates the terminal to initiate an IP address request process to the business DHCP server in order to achieve lease synchronization.

[0076] The following describes the specific processing flow after the business DHCP server regains reachability, based on two scenarios: whether the AAA server is reachable or not.

[0077] Scenario 1: AAA server is reachable, but business DHCP server is unreachable. Initial Access Scenario: During the period when the service DHCP server was unreachable, the Leaf device assigned IP addresses to these terminals, and the service DHCP server did not have any record of these terminals' IP addresses. Therefore, when the service DHCP server became reachable again, the Leaf device switched back to the DHCP relay role. At the same time, the Leaf device simulated the process of these terminals initiating an IP address request to the service DHCP server to achieve data synchronization with the service DHCP server. This process was imperceptible to the end users.

[0078] For example, the interaction process between the Leaf device's simulated terminal and the service DHCP server is as follows: Figure 5 As shown: Step 510: The Leaf device sends a DHCP-DISCOVER message to the service DHCP server to simulate a terminal initiating an address request; Step 520: The service DHCP server responds to the Leaf device with a DHCP-OFFER message, which instructs the Leaf device to provide an address allocation proposal; Step 530: The Leaf device sends a DHCP-REQUEST message to the service DHCP server to request the allocation of a specified address; In the above steps, the Leaf device can fill the Option50 field of the DHCP-REQUEST message with the IP address assigned to the terminal by the Leaf device during the period when the service DHCP server is unreachable, so that the service DHCP server binds the IP address to the terminal and generates the corresponding lease record.

[0079] Step 540: The service DHCP server responds to the Leaf device with a DHCP-ACK message. At this point, the server confirms the address allocation and completes the lease synchronization.

[0080] The messages mentioned in steps 510 to 540 above are all unicast messages.

[0081] Reconnection and Lease Renewal Scenarios: When the service DHCP server becomes reachable again, if the IP addresses of these terminals have not expired (specifically, the leases maintained by the service DHCP server have not expired), and the Leaf device did not process the lease renewal requests of these terminals during the period when the service DHCP server was unreachable, then no synchronization is required. Subsequent lease renewal requests initiated by these terminals will be forwarded by the Leaf device as a DHCP relay to the service DHCP server for processing. If the IP addresses of these terminals have expired (specifically, the leases maintained by the service DHCP server have expired), and the Leaf device processed the lease renewal requests of these terminals during the period when the service DHCP server was unreachable, then the processing method is the same as the initial access scenario described above. That is, the Leaf device simulates the terminal to initiate an IP address request process to the service DHCP server, and this process is imperceptible to the end user.

[0082] Scenario 2: Both the AAA server and the business DHCP server are unreachable. Reconnection Scenario: During the period when the service DHCP server is unreachable, the IP addresses of these users are assigned by the Leaf device. When the service DHCP server becomes reachable again, the recovery method is as follows: the Leaf device simulates a terminal to initiate an IP address request process to the service DHCP server.

[0083] Initial Access Scenario: While both the AAA server and the service DHCP server are unreachable, these terminals enter the escape security group, and their IP addresses are assigned by the escape DHCP server. If both the AAA server and the service DHCP server become reachable again, the Leaf device or AC device automatically triggers the terminal's re-authentication process. Through interaction with the AAA server, the terminal is switched to a normal authorized state. The subsequent IP address request process for the terminal is the same as the normal process when the service DHCP server becomes reachable. If the service DHCP server becomes reachable but the AAA server does not, these terminals remain in the escape security group and do not require synchronization; their IP address renewal is still handled by the escape DHCP server.

[0084] Lease renewal scenario: The recovery method is the same as the lease renewal scenario in Scenario 1 above.

[0085] As can be seen from the above technical solutions, this application can achieve the following beneficial effects: In this application, the Leaf device switches to the DHCP server proxy role when the service DHCP server becomes unreachable. Utilizing locally maintained binding relationships and a backup address pool, it directly provides IP address allocation and lease renewal services to terminals, addressing the technical shortcomings of current escape and permission retention solutions that do not cover scenarios where the service DHCP server is unreachable. For terminals that have already been online and reconnect, the Leaf device directly restores their original IP address by querying the local cache via MAC address, achieving seamless IP address recovery. For newly connected terminals, the Leaf device allocates an available IP address from the backup address pool, ensuring that new terminals can still connect normally during network failures. For online terminals that have already obtained IP addresses, the Leaf device can directly respond to renewal requests when the lease expires, preventing IP address invalidation due to inability to renew and thus preventing service interruption.

[0086] This application ensures that address allocation and renewal services for terminals are not interrupted during the failure of the business DHCP server, effectively guaranteeing the continuity of campus network services.

[0087] The above-mentioned solution in this application does not require the deployment of additional DHCP server hardware or modification of the existing network topology. It can achieve high availability of DHCP service by utilizing the existing capabilities of Leaf devices and SDN control components in the campus network (DHCP relay and DHCP Snooping functions of Leaf devices, and centralized management capabilities of SDN control components) without increasing the number of network devices or maintenance costs.

[0088] The SDN control component pre-allocates non-overlapping spare address pools for each Leaf device, avoiding address conflicts in multi-Leaf device scenarios. It supports both average allocation and weighted allocation algorithms, flexibly adapting to different scale scenarios.

[0089] Once the service DHCP server becomes reachable again, the Leaf device initiates an IP address request process from the service DHCP server via a simulated terminal to complete the lease synchronization. This process is completely unnoticed by end users, avoiding the impact on network equipment caused by a large number of terminals coming back online. The entire solution ensures service continuity while also taking into account ease of deployment and low operating and maintenance costs.

[0090] Based on the same inventive concept, this application provides an address allocation device applied to Leaf devices in a target campus network, wherein the target campus network further includes an SDN control component and a service DHCP server. Its structural diagram is shown below. Figure 8 As shown, it specifically includes: The first module 810 is used to maintain the binding relationship between the terminal's IP address, MAC address and lease validity period locally based on the DHCP messages listened to by the DHCP Snooping function. The second module 820 is used to periodically detect the status of the service DHCP server. When the service DHCP server is detected to be unreachable, it switches its own role from DHCP relay role to DHCP server agent role. The third module 830 is used to provide temporary DHCP service to the terminal based on the binding relationship and the pre-allocated backup address pool; the backup address pool is pre-allocated to each Leaf device by the SDN control component, and the backup address pools of different Leaf devices do not overlap.

[0091] Optionally, the third module 830 provides temporary DHCP service to the terminal in the following ways: In the reconnection scenario, in response to the DHCP address allocation request initiated by the terminal, the system queries the locally maintained binding relationships using the terminal's MAC address as the query keyword, and allocates the obtained IP address to the terminal via a DHCP response message; and / or, in the initial access scenario, in response to the DHCP address allocation request initiated by the terminal, the system selects an unoccupied IP address from the spare address pool and allocates the selected IP address to the terminal via a DHCP response message; and / or, in the lease renewal scenario, in response to the DHCP renewal request initiated by the terminal, the system returns a renewal confirmation message to the terminal.

[0092] Optionally, the target campus network may also include an AAA server; The third module 830 specifically selects unoccupied IP addresses from the spare address pool in the following ways: selecting unoccupied IP addresses from the spare address pool corresponding to the VXLAN service to which the terminal belongs; The device further includes a fourth module, which is used to determine the service VXLAN to which the terminal belongs by means of: When the AAA server is reachable, the AAA server authorizes the terminal with either a service VXLAN or a VLAN. The Leaf device determines the service VXLAN to which the terminal belongs based on the authorization information issued by the AAA server. When the AAA server is unreachable, for the reconnected terminal, the Leaf device or AC device determines the service VXLAN to which the terminal belongs based on the escape permission retention table entries maintained locally.

[0093] Optionally, the terminal includes a wired terminal and a wireless terminal, and the device further includes a fifth module, which is used to enable the terminal to access the corresponding VXLAN service in the following ways: For wired terminals, after the wired terminal obtains service VXLAN authorization, the Leaf device binds the wired terminal's access session to the corresponding service VXLAN. For wireless terminals, after the wireless terminal obtains VLAN authorization, the Leaf device determines the service VXLAN corresponding to the authorized VLAN based on the VLAN-VXLAN mapping relationship pre-configured on its downlink port, and binds the wireless terminal's access session to the corresponding service VXLAN.

[0094] Optionally, the second module 820 detects the status of the service DHCP server in the following ways: Send a probe message to the service DHCP server and listen for the response from the service DHCP server. The probe message is a Discover message, a Request message, or a Release message. If no response message is received from the service DHCP server within the scheduled time, a timeout retransmission mechanism will be initiated; if no response message is received after retransmission, the service DHCP server will be determined to be unreachable.

[0095] The device further includes: The sixth module is used by the SDN control component to allocate a backup address pool to each Leaf device based on the slave subnet of the Layer 2 network domain, where the master subnet of the Layer 2 network domain is the primary address pool for the service DHCP server.

[0096] Optionally, the SDN control component allocates the spare address pool to each Leaf device using the following average allocation method: Determine the address pool capacity required for a single Leaf device; based on the number of Leaf devices and the address pool capacity required for a single Leaf device, determine the total address pool capacity; based on the total address pool capacity, determine the subnet segment prefix length; based on the subnet segment prefix length, distribute the subnet equally to each Leaf device.

[0097] Optionally, the SDN control component allocates spare address pools to each Leaf device using the following weighted allocation method: Determine the address pool capacity required for each Leaf device, and determine the weight ratio of each Leaf device based on its required address pool capacity. Determine the total address pool capacity based on the sum of the required address pool capacities for all Leaf devices. Determine the subnet segment prefix length based on the total address pool capacity. Based on the subnet segment prefix length and the weight ratio of each Leaf device, allocate the subnet to each Leaf device in a weighted manner.

[0098] Optionally, the device further includes: The seventh module is used to switch the Leaf device's role from DHCP server agent back to DHCP relay when it detects that the service DHCP server has recovered from being unreachable. It also simulates the process of a terminal initiating an IP address request to the service DHCP server to achieve lease synchronization.

[0099] The apparatus provided in this application is used to perform the corresponding method described above. Therefore, the beneficial effects it can achieve can be referred to the beneficial effects of the corresponding method described above, and will not be repeated here.

[0100] This application provides an electronic device that may include a memory and one or more processors. The memory stores computer program code, including computer instructions. When the processor executes the computer instructions, the electronic device can perform various functions or steps of the above-described method embodiments.

[0101] The structure of this electronic device can be referenced. Figure 9 The structure of the electronic device 100 shown.

[0102] For example, the processor mentioned above can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.

[0103] This application provides a computer-readable storage medium including computer instructions that, when executed on an electronic device, cause the electronic device to perform the various functions or steps of the above-described method embodiments.

[0104] The aforementioned computer-readable storage media include, but are not limited to, any of the following: USB flash drive, portable hard drive, read-only memory (ROM), random access memory (RAM), magnetic disk or optical disk, and other media capable of storing program code.

[0105] This application provides a computer program product that, when run on a computer, causes the computer to perform various functions or steps of the above-described method embodiments.

[0106] The electronic devices, computer-readable storage media, and computer program products provided in the above embodiments are all used to execute the corresponding methods provided above. Therefore, the beneficial effects they can achieve can be referred to the beneficial effects in the corresponding methods provided above, and will not be repeated here.

[0107] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0108] The specific implementation process of the functions and roles of each unit / module in the above device can be found in the implementation process of the corresponding steps in the above method, and will not be repeated here.

[0109] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to in the description of the method embodiments. The device embodiments described above are merely illustrative. The units / modules described as separate components may or may not be physically separate. The components shown as units / modules may or may not be physical units / modules, that is, they may be located in one place or distributed across multiple network units / modules. Some or all of the units / modules can be selected to achieve the purpose of this application according to actual needs. Those skilled in the art can understand and implement this without creative effort.

[0110] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application.

Claims

1. An address allocation method, characterized in that, The method, which involves applying Leaf devices to a target campus network, wherein the target campus network further includes an SDN control component and a service DHCP server, comprises: Based on the DHCP messages monitored by the DHCP Snooping function, the binding relationship between the terminal's IP address, MAC address, and lease validity period is maintained locally. The system periodically probes the status of the service DHCP server, and when it detects that the service DHCP server is unreachable, it switches its role from DHCP relay role to DHCP server agent role. Based on the binding relationship and the pre-allocated backup address pool, temporary DHCP service is provided to the terminal; the backup address pool is pre-allocated to each Leaf device by the SDN control component, and the backup address pools of different Leaf devices do not overlap.

2. The method according to claim 1, characterized in that, Temporary DHCP service is provided to the terminal in the following ways: In the reconnection scenario, in response to the DHCP address allocation request initiated by the terminal, the system queries the locally maintained binding relationship using the terminal's MAC address as the query keyword, and allocates the obtained IP address to the terminal through a DHCP response message. And / or, In the initial access scenario, in response to the DHCP address allocation request initiated by the terminal, an unoccupied IP address is selected from the spare address pool, and the selected IP address is allocated to the terminal through a DHCP response message; And / or, In lease renewal scenarios, respond to the DHCP renewal request initiated by the terminal and return a renewal confirmation message to the terminal.

3. The method according to claim 2, characterized in that, The target campus network also includes an AAA server; The step of selecting an unoccupied IP address from the backup address pool includes: selecting an unoccupied IP address from the backup address pool corresponding to the VXLAN service to which the terminal belongs; The method also includes determining the service VXLAN to which the terminal belongs by means of: When the AAA server is reachable, the AAA server authorizes the terminal with either a service VXLAN or a VLAN. The Leaf device determines the service VXLAN to which the terminal belongs based on the authorization information issued by the AAA server. When the AAA server is unreachable, for a terminal that reconnects, the Leaf device or AC device will determine the service VXLAN previously authorized to the terminal as the service VXLAN to which the terminal belongs, based on the locally maintained escape permission retention table entries.

4. The method according to claim 3, characterized in that, The terminal includes wired terminals and wireless terminals, and the method further includes enabling the terminal to access the corresponding VXLAN service through the following means: For wired terminals, after the wired terminal obtains the service VXLAN authorization, the Leaf device binds the wired terminal's access session to the corresponding service VXLAN. For wireless terminals, after the wireless terminal obtains VLAN authorization, the Leaf device determines the service VXLAN corresponding to the authorized VLAN based on the VLAN-VXLAN mapping relationship pre-configured on its own downlink port, and binds the access session of the wireless terminal to the corresponding service VXLAN.

5. The method according to claim 1, characterized in that, Specifically, the status of the service DHCP server is detected using the following methods: Send a probe message to the service DHCP server and listen for the response from the service DHCP server. The probe message is a Discover message, a Request message, or a Release message. If no response message is received from the service DHCP server within the scheduled time, a timeout retransmission mechanism will be initiated; if no response message is received after retransmission, the service DHCP server will be determined to be unreachable.

6. The method according to claim 1, characterized in that, The method further includes: The SDN control component allocates a spare address pool to each Leaf device based on the slave subnet of the Layer 2 network domain. The master subnet of the Layer 2 network domain is the primary address pool for the service DHCP server.

7. The method according to claim 6, characterized in that, The SDN control component allocates spare address pools to each Leaf device using the following average allocation method: Determine the address pool capacity required for a single Leaf device; The total address pool capacity is determined based on the number of Leaf devices and the address pool capacity required by each Leaf device. The subnet prefix length is determined based on the total address pool capacity; Based on the subnet prefix length, the subnet will be evenly distributed to each Leaf device.

8. The method according to claim 6, characterized in that, The SDN control component allocates spare address pools to each Leaf device using the following weighted allocation method: Determine the address pool capacity required for each Leaf device, and determine the weight ratio of each Leaf device based on the address pool capacity required for each Leaf device; Determine the total address pool capacity based on the sum of the address pool capacities required by all Leaf devices; The subnet prefix length is determined based on the total address pool capacity; Based on the subnet prefix length and the weight ratio of each Leaf device, the subnet will be weighted and allocated to each Leaf device.

9. The method according to claim 1, characterized in that, The method further includes: When the Leaf device detects that the business DHCP server has recovered from being unreachable to being reachable, it switches its role from DHCP server agent back to DHCP relay and simulates the process of a terminal initiating an IP address request to the business DHCP server to achieve lease synchronization.

10. An address allocation device, characterized in that, A Leaf device applied in a target campus network, the target campus network further including an SDN control component and a service DHCP server, the device comprising: The first module is used to maintain the binding relationship between the terminal's IP address, MAC address, and lease validity period locally based on the DHCP messages listened to by the DHCP Snooping function. The second module is used to periodically detect the status of the service DHCP server. When the service DHCP server is detected to be unreachable, the module switches its role from DHCP relay role to DHCP server agent role. The third module is used to provide temporary DHCP service to the terminal based on the binding relationship and the pre-allocated backup address pool; the backup address pool is pre-allocated to each Leaf device by the SDN control component, and the backup address pools of different Leaf devices do not overlap.

11. An electronic device, characterized in that, include: A memory, one or more processors; the memory is coupled to the processors; wherein the memory stores computer program code, the computer program code including computer instructions, and when the computer instructions are executed by the processor, the electronic device performs the method as described in any one of claims 1-9.

12. A computer-readable storage medium comprising computer instructions, characterized in that, When the computer instructions are executed on the electronic device, the electronic device causes the electronic device to perform the method as described in any one of claims 1-9.

13. A computer program product, characterized in that, When the computer program product is run on a computer, it causes the computer to perform the method as described in any one of claims 1-9.