Route configuration method, address allocation method, electronic equipment and storage medium

By assigning a unique local address proxy prefix to the target device in an IPv6 environment and automatically configuring routing, the problem that the home gateway cannot assign global unicast addresses is solved, automatic access between devices is achieved and human resources is saved, and user experience is improved.

CN119172306APending Publication Date: 2024-12-20ZTE CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310744704.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-06-20
Publication Date
2024-12-20

AI Technical Summary

Technical Problem

In IPv6 technology, when the home gateway cannot assign global unicast address prefix to the downhook router, it causes indirect connection access between devices to fail, and traditional methods require manual configuration of static routing, which is troublesome to operate, wastes human resources, and reduces user experience.

Method used

The target device is assigned a unique local address proxy prefix through the gateway, and the next hop address of the destination address is automatically configured in the LAN routing to avoid manually configuring static routing.

Benefits of technology

It realizes automatic address management without manual routing configuration, saves human resources, improves user experience, and simplifies the access process between devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119172306A_ABST
    Figure CN119172306A_ABST
Patent Text Reader

Abstract

The invention discloses a routing configuration method, an address allocation method, electronic equipment and a storage medium, relates to the technical field of communication, and aims to save human resources and improve user experience. The method is applied to a gateway, the gateway is connected with target equipment with a routing function, and the method comprises the following steps: distributing a first ULA proxy prefix for the target equipment; in a local area network (LAN) side route, configuring a next-hop address corresponding to the destination address as the address of the target equipment; the prefix of the destination address is a first ULA proxy prefix; the LAN is a local area network including the gateway and the target device.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communication technology, and in particular to a routing configuration, an address allocation method, an electronic device and a storage medium. Background Art

[0002] Internet Protocol version 6 (IPv6) has 128-bit addresses, which can solve the problem of the number of network address resources and has great advantages in terms of the number of network addresses, security, mobility and service quality. In recent years, with the development of IPv6 technology, more and more devices and applications support IPv6.

[0003] When the home gateway uses IPv6 technology, when the gateway proxy prefix obtained by the home gateway is equal to 64 bits, or when the gateway proxy prefix is ​​not obtained, the home gateway cannot allocate a global unicast address (GUA) prefix to the downstream router. At this time, the downstream router of the home gateway will randomly generate a unique local IPv6 Address (ULA) prefix, and based on the ULA prefix, generate a ULA address for the downstream device of the router. In this case, when the downstream device directly connected to the home gateway wants to access the downstream device indirectly connected to the home gateway through the router, the home gateway has no route to the router as the next hop, resulting in access failure.

[0004] In the conventional technology, in order to solve the above problem, a static route on the local area network (LAN) side is generally configured in the home gateway, and the next hop address of the message whose destination address prefix is ​​the prefix of the downstream device indirectly connected through the router is set to the address of the router. When the home gateway receives a message sent by the directly connected downstream device to the indirectly connected downstream device through the router, the message is sent to the router, and the router forwards the message to the downstream device connected to it, thereby completing the access of the downstream device directly connected to the home gateway to the downstream device indirectly connected to the home gateway through the router.

[0005] In this traditional method, the LAN side static route of the home gateway is manually configured. When the ULA generated by the downstream router of the home gateway changes, the LAN static route needs to be manually reconfigured in the home gateway. This method is cumbersome to operate, wastes human resources, and reduces user experience. Summary of the invention

[0006] The embodiments of the present application provide a routing configuration, an address allocation method, an electronic device, and a storage medium, which save human resources and can improve user experience.

[0007] On the one hand, a routing configuration method is provided, which is applied to a gateway, the gateway is connected to a target device, and the target device has a routing function. The method includes: allocating a first ULA proxy prefix to the target device; in the routing on the LAN side, configuring the next hop address corresponding to the destination address as the address of the target device; the prefix of the destination address is the first ULA proxy prefix; and the LAN is a local area network including the gateway and the target device.

[0008] On the other hand, an address allocation method is provided, which is applied to a target device, the target device has a routing function, and the target device is connected to a gateway and a second device. The method includes: receiving a first ULA prefix allocated by the gateway; wherein the length of the first ULA proxy prefix is ​​less than a preset length; and allocating a first ULA address to the second device based on the first ULA proxy prefix.

[0009] On the other hand, an electronic device is provided, including: an allocation unit, used to allocate a first ULA proxy prefix to a target device; a configuration unit, used to configure the next hop address corresponding to the destination address as the address of the target device in the routing on the local area network (LAN) side; the prefix of the destination address is the first ULA proxy prefix; and the LAN is a local area network including a gateway and the target device.

[0010] On the other hand, another electronic device is provided, including: a receiving unit, configured to receive a first unique local unicast address ULA prefix assigned by a gateway; wherein the length of the first ULA proxy prefix is ​​less than a preset length; and an allocating unit, configured to allocate a first ULA address to a second device based on the first ULA proxy prefix.

[0011] On the other hand, an electronic device is provided, comprising: a memory and a processor; the memory and the processor are coupled; the memory is used to store a computer program; and the processor implements the routing configuration or address allocation method described in any of the above embodiments when executing the computer program.

[0012] On the other hand, a computer-readable storage medium is provided, on which computer program instructions are stored. When the computer program instructions are executed by a processor, the routing configuration or address allocation method described in any of the above embodiments is implemented.

[0013] On the other hand, a computer program product is provided, which includes computer program instructions, and when the computer program instructions are executed by a processor, the routing configuration or address allocation method described in any of the above embodiments is implemented.

[0014] In the embodiment of the present application, the ULA proxy prefix of the target device is generated by the gateway. Therefore, the gateway can automatically configure the next hop address corresponding to the destination address as the address of the target device in the route based on the ULA proxy prefix. This method does not require manual configuration, saves human resources, and can improve user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] In order to more clearly illustrate the technical solution in the present application, the drawings required for use in some embodiments of the present application will be briefly introduced below. Obviously, the drawings described below are only drawings of some embodiments of the present application. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.

[0016] Figure 1 A schematic diagram of an implementation environment involved in a routing configuration and address allocation method provided in some embodiments of the present application;

[0017] Figure 2 A module schematic diagram provided for some embodiments of the present application;

[0018] Figure 3 A flowchart of a routing configuration method provided for some embodiments of the present application;

[0019] Figure 4 A flowchart of an address allocation method provided in some embodiments of the present application;

[0020] Figure 5 A flowchart of another address allocation method provided for some embodiments of the present application;

[0021] Figure 6 A schematic diagram of address allocation provided for some embodiments of the present application;

[0022] Figure 7 A flowchart of a target message transmission process provided in some embodiments of the present application;

[0023] Figure 8 A flowchart of another routing configuration method provided for some embodiments of the present application;

[0024] Fig. 9 A flowchart of another address allocation method provided for some embodiments of the present application;

[0025] Fig.10 A flowchart of another address allocation method provided for some embodiments of the present application;

[0026] Fig.11 A schematic diagram of the structure of an electronic device provided in some embodiments of the present application;

[0027] Fig.12A schematic diagram of the structure of another electronic device provided in some embodiments of the present application;

[0028] Fig.13 A schematic diagram of the structure of another electronic device provided for some embodiments of the present application. DETAILED DESCRIPTION

[0029] For ease of understanding, the following briefly introduces the relevant terms involved in the embodiments of the present application:

[0030] (1) Dynamic Host Configuration Protocol for IPv6 (DHCPv6): is a network protocol used to configure the Internet Protocol (IP) address, IP prefix and / or other configurations required by IPv6 hosts operating on an IPv6 network.

[0031] (2) Prefix Delegation (PD): It is a prefix allocation mechanism in DHCPv6. Through this mechanism, the upstream network device (such as a gateway) can allocate a proxy prefix to the downstream network device that applies for a proxy prefix. The downstream network device (such as a router under the gateway) will further subdivide the obtained proxy prefix into subnet segments with a prefix length of 64 bits, and announce it to multiple host devices (such as devices under the router) through routing.

[0032] (3) Static routing is a routing method in which routing entries are manually configured rather than dynamically determined. Unlike dynamic routing, static routing is fixed and does not change, even if network conditions change or are reconfigured. Generally speaking, static routing is added to the routing table one by one by the network administrator.

[0033] The following will be combined with the drawings in this application to clearly and completely describe the technical solutions in this application. Obviously, the described embodiments are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0034] It should be noted that, in this application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in this application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.

[0035] In the following, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features.

[0036] In the description of this application, unless otherwise specified, " / " means "or", for example, A / B can mean A or B. "And / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, "at least one" means one or more, and "multiple" means two or more.

[0037] In the above background technology, in order to solve the problem that the downstream devices under the router can send messages to the downstream devices of the home gateway, but the downstream devices of the home gateway cannot send messages to the downstream devices of the router, the LAN side static route is generally configured in the home gateway, and the next hop address of the message whose destination address prefix is ​​the prefix of the downstream device indirectly connected to the router is set to the address of the router. In this method, the LAN side static route of the home gateway is manually configured. When the ULA generated by the downstream router of the home gateway changes, the LAN static route needs to be manually reconfigured in the home gateway. This method is cumbersome to operate, wastes human resources, and reduces the user experience.

[0038] Based on this, an embodiment of the present application proposes a method for routing configuration and address allocation. In this method, the gateway allocates a first ULA proxy prefix to the target device, and configures the next hop address corresponding to the destination address with the prefix of the first ULA proxy prefix in the LAN side routing as the address of the target device (i.e., the router under the gateway). It can be understood that in this method, the ULA proxy prefix of the target device is generated by the gateway. Therefore, the gateway can automatically configure the next hop address corresponding to the destination address in the LAN side routing as the address of the target device based on the ULA proxy prefix. When the proxy prefix assigned by the home gateway to the target device changes, the prefix of the destination address can be automatically modified in the routing. This method does not require manual configuration, saves human resources, and can improve user experience.

[0039] The implementation of the embodiments of the present application will be described in detail below with reference to the accompanying drawings.

[0040] Please refer to Figure 1 , which shows an implementation environment involved in a routing configuration and address allocation method provided in an embodiment of the present application, the implementation environment includes: a gateway 110 and a target device 120, and optionally, the implementation environment may also include a first device 130 and a second device 140.

[0041] The gateway 110 is also called an internetwork connector or a protocol converter. It is used between two systems with different communication protocols, data formats or languages, or even completely different architectures, and can realize the interconnection between two network devices with different protocols. In the embodiment of the present application, the gateway 110 can be called a home gateway, that is, a hardware that connects a home or small office network to the Internet. The home gateway can ensure that all networked devices in the home network form a unified network, use a unified network protocol, and realize information sharing among the internal devices.

[0042] Exemplarily, the gateway 110 may include: a cable modem, a wireless router, a network switch, a Voice over Internet Protocol (VoIP) and analog telephone adapter, a wireless access point or a wired router, or a device formed by a combination of the above devices.

[0043] The target device 120 is a hardware device with routing function, which connects two or more networks. It is a dedicated network device that can read the address in each data packet and then decide how to transmit the data packet.

[0044] By way of example, the target device 120 may be a router.

[0045] The first device 130 and the second device 140 may be various computing devices or smart devices in a home network or an office network.

[0046] Exemplarily, the first device 130 or the second device 140 may include computing devices such as terminals, servers, tablet computers, desktop computers, laptop computers, notebook computers, and netbooks, or devices such as smart homes.

[0047] In one possible implementation, Figure 2 As shown, the gateway 110 includes: a first DHCPv6 server module 111 , a prefix module 112 , and a routing module 113 .

[0048] The first DHCPv6 service module 111 is used to receive a request from a downstream device (such as the first device 130 or the target device 120) to obtain an address, or receive a request from the target device 120 to obtain a PD, or generate an address for a downstream device.

[0049] The prefix module 112 is configured to generate a ULA prefix and separate sub-prefixes from the ULA prefix.

[0050] Routing module 113: used to configure LAN side static routing.

[0051] In one possible implementation, Figure 2As shown, the target device 120 includes: a second DHCPv6 service (server) module 121 and a DHCPv6 client (client) module 122 .

[0052] The second DHCPv6 service module 121 is configured to receive a PD and generate an address for a downstream device (eg, the second device 130 ) based on the PD.

[0053] DHCPv6 client module 122: used to send a request for obtaining an address or a request for obtaining a PD to the gateway 110, or receive an address or a PD sent by the gateway.

[0054] The gateway 110 is connected to the target device 120 and the first device 130 by wire or wireless, and the second device 140 is connected to the target device 120 by wire or wireless. The embodiment of the present application does not limit the number of the target device 120, the first device 130 and the second device 140.

[0055] The following describes the routing configuration and address allocation method provided in the embodiments of the present application.

[0056] Please refer to Figure 3 , is a flow chart of a routing configuration method provided in an embodiment of the present application. The method is applied to a gateway, the gateway connects a target device and a first device, and indirectly connects a second device through the target device. Figure 3 As shown, the method may include S101-S106.

[0057] S101: When the gateway cannot allocate a GUA proxy prefix for the target device, the gateway generates a second ULA proxy prefix.

[0058] The situations where the gateway cannot allocate a GUA proxy prefix to the target device include: the gateway proxy prefix obtained by the gateway is a preset length, or the gateway cannot obtain the gateway proxy prefix.

[0059] The gateway proxy prefix is ​​a proxy prefix assigned to the gateway by the operator using PD, which can be used to generate addresses for downstream devices of the gateway (such as the first device or the target device), or to assign a proxy prefix to downstream devices of the gateway (such as the target device).

[0060] In a possible implementation, the following method is based on IPv6 technology. Of course, the method proposed in the embodiment of the present application is not limited to IPv6 technology.

[0061] In IPv6, an IPv6 address is 128 bits, including a prefix and an interface identifier, where the prefix length and the interface identifier length are 64 bits respectively, so the above preset length can be set to 64 bits in IPv6. The value of the preset length is equal to the length of the address prefix. If the proxy prefix length is equal to the preset length, it means that the proxy prefix cannot be split into sub-prefixes. The interface identifier can be generated by three methods: manual configuration, automatic generation by the system through software, or generation by IEEE EUI-64 specifications. Among them, the most commonly used method is to use the EUI-64 specification to automatically generate the interface identifier.

[0062] The GUA proxy prefix is ​​a sub-prefix split from the gateway proxy prefix by the gateway. When the length of the gateway proxy prefix is ​​less than a preset length (e.g., 64 bits), the gateway can split the GUA proxy prefix from the gateway proxy prefix to generate an address containing the GUA proxy prefix for a downstream device of the gateway (e.g., a first device or a target device), or allocate the GUA proxy prefix to a downstream device of the gateway (e.g., a target device).

[0063] The second ULA proxy prefix is ​​a ULA proxy prefix generated by the gateway.

[0064] In a possible implementation, the gateway uses ULA and NAT66 technology to generate a second ULA proxy prefix through a pseudo-random algorithm, wherein the ULA of the gateway is an IPv6 address with a fixed prefix of FC00:: / 7, for example: FD00:1234:5678:: / 48.

[0065] S102: The target device sends a first request to the gateway.

[0066] The first request is used to request to obtain a first ULA proxy prefix, and the first request may include: an identity association for prefix delegation option (IA_PD) request.

[0067] The above IA_PD request is a request for obtaining a PD in the DHCPv6 protocol.

[0068] The first ULA proxy prefix is ​​a prefix requested by the target device. When the target device sends the first request, the target device does not know the specific content of the first ULA proxy prefix.

[0069] S103: When receiving the first request from the target device, the gateway separates the first ULA proxy prefix from the second ULA proxy prefix.

[0070] The first ULA proxy prefix is ​​a sub-prefix separated from the second ULA proxy prefix, and the length of the first ULA proxy prefix is ​​between the second ULA proxy prefix and a preset length.

[0071] In an example, the second ULA proxy prefix is ​​FD00:1234:5678:: / 48. If the preset length is 64 bits, the first ULA proxy prefix split by the gateway from the second ULA proxy prefix is ​​FD00:1234:5678:AA00:: / 56. The length of the first ULA proxy prefix is ​​56 bits, which is between the length of the second ULA proxy prefix (48 bits) and the preset length (64 bits).

[0072] It is understandable that when the gateway splits the sub-prefix from the second ULA proxy prefix, the length of the sub-prefix is ​​determined based on the request for applying for the sub-prefix. Since the first request sent by the target device in S102 is for requesting to obtain the proxy prefix, the length of the first ULA proxy prefix split by the gateway is less than the preset length, which enables the target device to generate an address for the downstream device of the target device based on the first ULA proxy prefix.

[0073] S104: The gateway allocates a first ULA proxy prefix to the target device.

[0074] The gateway allocates the first ULA proxy prefix to the target device, that is, the gateway establishes a correspondence between the split first ULA proxy prefix and the target device. It can also be understood that the gateway decides to configure the split first ULA proxy prefix to the target device.

[0075] The allocation process can be understood as a configuration process after the gateway splits out the first ULA proxy prefix, and is a decision-making process before the gateway sends the first ULA proxy prefix. For example, when the gateway is connected to multiple devices, and multiple devices request to obtain the proxy prefix, the gateway will configure the generated first ULA proxy prefix to the target device instead of other devices. This process is the process of the gateway allocating the first ULA proxy prefix to the target device.

[0076] S105: The gateway sends a first ULA proxy prefix to the target device.

[0077] S106: The gateway configures the next hop address corresponding to the destination address as the address of the target device in the LAN side routing.

[0078] The prefix of the destination address is the first ULA proxy prefix; LAN is a local area network including the gateway and the target device.

[0079] Routing is the network-wide process of determining the end-to-end path for packets from source to destination. It can also be said that it is the process of receiving a message from one interface and directing and forwarding it to another interface based on the destination address of the message. Generally, the gateway determines the destination address and next hop address based on the address of the received message and the routing table.

[0080] The routing table is a spreadsheet stored in the gateway that stores the paths to specific network addresses. Each path in the routing table contains the source address and the destination address, and optionally also contains the next hop address, where the next hop address is the address between the source address and the destination address, and is the fixed address that the message passes through from the source address to the destination address.

[0081] The route in the embodiment of the present application may be a static route, and the next hop address corresponding to the destination address may be a network path in a routing table maintained by the static route, and the next hop address to reach the destination address includes the address of the target device.

[0082] Since the prefix of the destination address is the first ULA proxy prefix, the next hop address corresponding to the destination address is configured as the address of the target device. It can be understood that when the prefix of the destination address to be reached by the message received by the gateway is the first ULA proxy prefix, the gateway sends the message to the target device uniformly, and the target device forwards it to the destination address.

[0083] In this method, the ULA proxy prefix of the target device is generated by the gateway. Therefore, the gateway can automatically configure the next hop address corresponding to the destination address in the route as the address of the target device based on the ULA proxy prefix. This method does not require manual configuration, saves human resources, and can improve user experience.

[0084] based on Figure 1 In the method shown, the gateway allocates the first ULA prefix to the target device. The following is a flowchart of an address allocation method, which is applied to the target device. Please refer to Figure 4 , the method includes: S201-S202.

[0085] S201: A target device receives a first ULA proxy prefix allocated by a gateway.

[0086] The length of the first ULA proxy prefix is ​​less than a preset length.

[0087] For a detailed description of the first ULA proxy prefix, please refer to S103.

[0088] S202: The target device allocates a first ULA address to the second device based on the first ULA proxy prefix.

[0089] In a possible implementation manner, the specific implementation steps of S202 include: S202a-S202d:

[0090] S202a: The target device separates a third ULA prefix from the first ULA proxy prefix.

[0091] The length of the third ULA prefix is ​​a preset length, for example, 64 bits. The third ULA prefix is ​​used as an address prefix of a downstream device (for example, a second device) of the target device.

[0092] In one example, the first ULA proxy prefix is ​​FD00:1234:5678:AA00:: / 56, and the third ULA prefix split from the prefix by the target device is FD00:1234:5678:AA00:: / 64.

[0093] S202b: The second device sends a second request to the target device.

[0094] The second request is used to request to obtain the first ULA address, and the second request may include: an identity association for non-temporary address (IANA) request.

[0095] The above IANA request is a request for allocating an address in the DHCPv6 protocol.

[0096] The first ULA address is an address requested by the second device. When the second device sends the second request, the second device does not know the specific content of the first ULA address.

[0097] S202c: When receiving the second request sent by the second device, the target device generates a first ULA address for the second device using the third ULA prefix.

[0098] The prefix of the first ULA address is the third ULA prefix. The interface identifier of the first ULA address can be manually configured, automatically generated by software, or generated based on the IEEE EUI-64 specification. The embodiment of the present application does not limit the method for generating the interface identifier.

[0099] In one example, the third ULA prefix is ​​FD00:1234:5678:AA00:: / 64, and the first ULA address is FD00:1234:5678:AA00::1.

[0100] S202d: The target device sends the first ULA address to the second device.

[0101] It is understandable that the step (S202a) of splitting the third ULA prefix by the target device may be before receiving the second request (S202b) from the second device, or after receiving the second request from the second device. If the target device splits the third ULA prefix in advance before receiving the request, after receiving the request for obtaining the address from the second device, the third ULA prefix may be directly used to generate an address for the device requesting the address. This method can improve the efficiency of address allocation.

[0102] Please refer to Figure 5 Based on the second ULA proxy prefix in S101, the following is a flowchart of a method for the gateway to allocate addresses to the first device and the target device, and the method includes: S301-S307.

[0103] S301: The gateway separates a fourth ULA prefix from the second ULA proxy prefix.

[0104] The length of the fourth ULA prefix is ​​a preset length, such as 64 bits, and is used as an address prefix of a downstream device (such as the first device or the target device) of the gateway.

[0105] In one example, the second ULA proxy prefix is ​​FD00:1234:5678:: / 48, and the fourth ULA prefix split from the prefix by the gateway is FD00:1234:5678:BB00:: / 64.

[0106] S302: The first device sends a third request to the gateway.

[0107] The third request is used to request to obtain the address of the second ULA, for example, an IANA request.

[0108] The second ULA address is an address requested by the first device. When the first device sends the third request, the first device does not know specific content of the second ULA address.

[0109] S303: When receiving the third request from the first device, the gateway generates a second ULA address for the first device using the fourth ULA prefix.

[0110] The prefix of the second ULA address is the fourth ULA prefix. The interface identifier of the second ULA address may be manually configured, automatically generated by software, or generated based on the IEEE EUI-64 specification, and the embodiment of the present application does not limit the method for generating the interface identifier.

[0111] In one example, the fourth ULA prefix is ​​FD00:1234:5678:BB00:: / 64 and the second ULA address is.

[0112] S304: The gateway sends the second ULA address to the first device.

[0113] S305: The target device sends a fourth request to the gateway.

[0114] The fourth request is used to request to obtain the third ULA address, for example, an IANA request.

[0115] The third ULA address is an address requested by the target device. When the target device sends the fourth request, the target device does not know the specific content of the third ULA address.

[0116] S306: When receiving the fourth request from the target device, the gateway generates a third ULA address for the target device using the fourth ULA prefix.

[0117] The prefix of the third ULA address is the fourth ULA prefix. The interface identifier of the third ULA address may be manually configured, automatically generated by software, or generated based on the IEEE EUI-64 specification, and the embodiment of the present application does not limit the method for generating the interface identifier.

[0118] In one example, the fourth ULA prefix is ​​FD00:1234:5678:BB00:: / 64, and the third ULA address is FD00:1234:5678:BB00::2.

[0119] S307: The gateway sends the third ULA address to the target device.

[0120] It is understandable that the step (S301) of the gateway splitting the fourth ULA prefix may be before receiving the third request (S302) of the first device or before receiving the fourth request (S305) of the target device, or after receiving the third request (S302) of the first device or after receiving the fourth request (S305) of the target device. If the gateway splits the fourth ULA prefix in advance before receiving the third request or the fourth request, when a downstream device (such as the first device or the target device) sends a request to obtain an address, the fourth ULA prefix can be directly used to generate an address for the device requesting the address. This method can improve the efficiency of address allocation.

[0121] The above S302-S304 is the process of the first device obtaining an address, and S305-S307 is the process of the target device obtaining an address. The order of the two processes is not distinguished, and the gateway executes them based on the order of the received requests. If the gateway receives requests from the first device and the target device at the same time, the gateway can execute S302-S304 first, or S305-S307 first, or S302-S304 and S305-S307 at the same time.

[0122] Above Figure 3 , Figure 4and Figure 5 for Figure 1 The process of configuring routing and assigning addresses for the system shown in FIG. Figure 6 As shown, Figure 6 Shows the passing Figure 3 , Figure 4 and Figure 5 After the method is configured, the gateway allocates addresses to the first device, the target device, and the second device connected to the target device based on the second ULA proxy prefix (FD00:1234:5678:: / 48). The address of the first device is the first ULA address (FD00:1234:5678:BB00::1), the address of the second device is the second ULA address (FD00:1234:5678:AA00::1), and the address of the target device is the third ULA address (FD00:1234:5678:BB00::2).

[0123] Please refer to Figure 7 ,based on Figure 6 The device configured with routing and address, the following is a flowchart of the target message transmission process when the first device sends the target message to the second device, including: S401-S405.

[0124] S401: The first device sends a target message to the second device to the gateway.

[0125] Since the target message is a message sent to the second device, the destination address of the target message is the address of the second device, that is, the first ULA address (for example Figure 6 FD00:1234:5678:AA00:1).

[0126] Since the first device is not directly connected to the second device, the first device first sends the target message to the gateway, and the gateway determines the next hop address of the target message based on the destination address of the target message.

[0127] S402: The gateway searches, based on the prefix of the destination address of the target message, the LAN-side routing to determine whether there is a ULA proxy prefix that is the same as the prefix of the destination address of the target message.

[0128] If it exists, and the ULA proxy prefix is ​​the first ULA proxy prefix, the next hop address of the destination address of the target message is obtained as the address of the target device, and S403 and S404 are continued.

[0129] If it does not exist, the target message is discarded.

[0130] S403: The gateway sends the target message to the target device.

[0131] S404: After receiving the target message sent by the gateway, the target device sends the target message to the second device based on the destination address of the target message.

[0132] Since the gateway sets the next hop address corresponding to the address whose destination address is prefixed with the first ULA prefix as the address of the target device in the LAN side routing, the target messages sent by the first device to the second device are all sent by the gateway to the target device, and the target device forwards the target messages to the second device, thereby realizing normal communication between the first device and the second device.

[0133] Combination Figure 2 , the present application embodiment provides a flowchart of another routing configuration method, such as Figure 8 As shown, the method may include: S501-S506.

[0134] S501: When the prefix module of the gateway cannot allocate a GUA proxy prefix to the target device, the prefix module of the gateway generates a second ULA proxy prefix.

[0135] S502: The DHCPv6 client module of the target device sends a first request to the first DHCPv6 service module of the gateway.

[0136] S503: Upon receiving the first request from the target device, the first DHCPv6 service module of the gateway notifies the prefix module to separate the first ULA proxy prefix from the second ULA proxy prefix.

[0137] S504: After receiving the first ULA proxy prefix split out by the prefix module, the first DHCPv6 service module of the gateway allocates the first ULA proxy prefix to the target device.

[0138] S505: The first DHCPv6 service module of the gateway sends a first ULA proxy prefix to the DHCPv6 client module of the target device.

[0139] S506: The prefix module of the gateway sends the first ULA proxy prefix to the routing module, and the routing module configures the next hop address corresponding to the destination address as the address of the target device in the LAN side routing.

[0140] For a detailed description of S501-S506, please refer to S101-S106.

[0141] Combination Figure 2 , the following is a flowchart of another address allocation method, such as Fig. 9 As shown, the method includes: S601-S602.

[0142] S601: A DHCPv6 client module of a target device receives a first ULA proxy prefix allocated by a gateway, and sends the prefix to a second DHCPv6 service module of the target device.

[0143] S602: The DHCPv6 client module of the target device sends the first ULA proxy prefix to the second DHCPv6 service module of the target device, and the second DHCPv6 service module of the target device allocates a first ULA address to the second device based on the first ULA proxy prefix.

[0144] Specifically, S602 includes S602a-S602d:

[0145] S602a: The second DHCPv6 service module of the target device separates a third ULA prefix from the first ULA proxy prefix.

[0146] S602b: The second device sends a second request to the second DHCPv6 service module of the target device.

[0147] S602c: Upon receiving the second request sent by the second device, the second DHCPv6 service module of the target device generates a first ULA address for the second device using the third ULA prefix.

[0148] S602d: The second DHCPv6 service module of the target device sends the first ULA address to the second device.

[0149] For a detailed description of S601-S602, please refer to S201-S202.

[0150] Combination Figure 2 Based on the second ULA proxy prefix in S501, another method for the gateway to allocate addresses to the first device and the target device is proposed below, such as Fig.10 As shown, the method includes: S701-S707.

[0151] S701: The prefix module of the gateway separates a fourth ULA prefix from the second ULA proxy prefix and sends the fourth ULA prefix to the first DHCPv6 service module of the gateway.

[0152] S702: The first device sends a third request to the first DHCPv6 service module of the gateway.

[0153] S703: Upon receiving the third request from the first device, the first DHCPv6 service module of the gateway generates a second ULA address for the first device using the fourth ULA prefix.

[0154] S704: The first DHCPv6 service module of the gateway sends the second ULA address to the first device.

[0155] S705: The DHCPv6 client module of the target device sends a fourth request to the first DHCPv6 service module of the gateway.

[0156] S706: Upon receiving the fourth request from the target device, the first DHCPv6 service module of the gateway generates a third ULA address for the target device using the fourth ULA prefix.

[0157] S707: The first DHCPv6 service module of the gateway sends a third ULA address to the DHCPv6 client module of the target device.

[0158] For a detailed description of S701-S707, please refer to S301-S307.

[0159] It is understandable that, in order to realize the above functions, the electronic device includes a hardware structure and / or software module corresponding to the execution of each function. Those skilled in the art should easily realize that, in conjunction with the algorithm steps of each example described in the embodiments of the present application, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present application.

[0160] The embodiment of the present application can divide the electronic device into another functional module according to the above method embodiment. For example, each functional module can be divided according to each function, or two or more functions can be integrated into one functional module. The above integrated module can be implemented in the form of hardware or software. It should be noted that the division of modules in the embodiment of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation, such as Figure 2 The following is an example of dividing each functional module into corresponding functional modules.

[0161] Fig.11 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application, and the electronic device can execute the routing configuration method provided in the above method embodiment. Fig.11 As shown, the electronic device 200 includes: an allocating unit 201, which is used to allocate a first ULA proxy prefix to the target device; a configuring unit 202, which is used to configure the next hop address corresponding to the destination address as the address of the target device in the LAN side routing; the prefix of the destination address is the first ULA proxy prefix; the LAN is a local area network including the electronic device 200 and the target device. Figure 3The allocation unit 201 can be applied to S104 in the method embodiment, and the configuration unit 202 can be applied to S106 in the method embodiment.

[0162] Optionally, the allocating unit 201 is specifically configured to allocate a first ULA proxy prefix to the target device when the electronic device 200 cannot allocate a GUA proxy prefix to the target device. For example, the allocating unit 201 may be applied to S104 in the method embodiment.

[0163] Optionally, the electronic device 200 is unable to allocate a GUA proxy prefix to the target device, including: the gateway proxy prefix obtained by the electronic device 200 is a preset length, or the electronic device 200 is unable to obtain the gateway proxy prefix.

[0164] Optionally, the electronic device 200 further includes a processing unit 203, configured to generate a second ULA proxy prefix before allocating the first ULA proxy prefix to the target device, and to separate the first ULA proxy prefix from the second ULA proxy prefix. The length of the second ULA proxy prefix is ​​less than a preset length; the length of the first ULA proxy prefix is ​​between the length of the second ULA proxy prefix and the preset length. For example, in combination Figure 3 The processing unit 203 can be applied to S101 and S103 in the method embodiment.

[0165] Optionally, the processing unit 203 is specifically configured to separate the first ULA proxy prefix from the second ULA proxy prefix, including: upon receiving a first request from the target device, separating the first ULA proxy prefix from the second ULA proxy prefix; the first request is used to request to obtain the first ULA proxy prefix. Figure 3 , the processing unit 203 can be applied to S102 in the method embodiment.

[0166] Optionally, the electronic device 200 is connected to the first device, and the electronic device 200 is connected to the second device through the target device. The processing unit 203 is also used to, when receiving a target message sent by the first device to the second device, find the next hop address of the target message from the LAN side route as the address of the target device. The prefix of the destination address of the target message is the first ULA proxy prefix; based on the address of the target device, the target message is sent to the target device, and the target device forwards the target message to the second device. For example, in combination Figure 7 The processing unit 203 can be applied to S401-S403 in the method embodiment.

[0167] Fig.12 is a schematic diagram of the structure of another electronic device provided in an embodiment of the present application, and the electronic device can execute the address allocation method provided in the above method embodiment. Fig.12As shown, the electronic device 300 includes: a receiving unit 301, configured to receive a first ULA prefix assigned by a gateway; wherein the length of the first ULA proxy prefix is ​​less than a preset length. An allocating unit 302, configured to allocate a first ULA address to a second device based on the first ULA proxy prefix. For example, in combination with Figure 4 The receiving unit 301 can be applied to S201 in the method embodiment, and the allocating unit 302 can be applied to S202 in the method embodiment.

[0168] Optionally, the electronic device 300 further includes a sending unit 303, configured to send a first request to the gateway before receiving the first ULA proxy prefix assigned by the gateway; the first request is used to request to obtain the first ULA proxy prefix. Figure 3 The sending unit 303 can be applied to S102 in the method embodiment.

[0169] Optionally, the receiving unit 301 is further configured to receive a target message sent by the gateway; wherein the destination address of the target message is the address of the second device; and the sending unit 303 is further configured to send the target message to the second device based on the destination address of the target message. Figure 7 The sending unit 303 can be applied to S404 in the method embodiment.

[0170] In the case of implementing the functions of the above-mentioned integrated modules in the form of hardware, the embodiments of the present application provide another possible structure of the electronic device involved in the above-mentioned embodiments. Fig.13 As shown, the electronic device 400 includes: a processor 402 and a bus 404. Optionally, the electronic device may further include a memory 401; and optionally, the electronic device may further include a communication interface 403.

[0171] Processor 402 may be a processor that implements or executes various exemplary logic blocks, modules, and circuits described in conjunction with the embodiments of the present application. The processor 402 may be a central processing unit, a general-purpose processor, a digital signal processor, an application-specific integrated circuit, a field programmable gate array, or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It may implement or execute various exemplary logic blocks, modules, and circuits described in conjunction with the embodiments of the present application. The processor 402 may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, and the like.

[0172] The communication interface 403 is used to connect with other devices via a communication network, such as Ethernet, wireless access network, wireless local area network (WLAN), etc.

[0173] The memory 401 may be a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, a random access memory (RAM) or other types of dynamic storage devices that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store desired program codes in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto.

[0174] As a possible implementation, the memory 401 can exist independently of the processor 402, and the memory 401 can be connected to the processor 402 via a bus 404 to store instructions or program codes. When the processor 402 calls and executes the instructions or program codes stored in the memory 401, the routing configuration and address allocation method provided in the embodiment of the present application can be implemented.

[0175] In another possible implementation, the memory 401 may also be integrated with the processor 402 .

[0176] The bus 404 may be an extended industry standard architecture (EISA) bus, etc. The bus 404 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig.13 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0177] Some embodiments of the present application provide a computer-readable storage medium (e.g., a non-transitory computer-readable storage medium), which stores computer program instructions. When the computer program instructions are executed on a computer, the computer executes the routing configuration and address allocation method as described in any of the above embodiments.

[0178] Exemplarily, the above-mentioned computer-readable storage media may include, but are not limited to: magnetic storage devices (e.g., hard disks, floppy disks or magnetic tapes, etc.), optical disks (e.g., compact disks (CD), digital versatile disks (DVD), etc.), smart cards and flash memory devices (e.g., erasable programmable read-only memory (EPROM), cards, sticks or key drives, etc.). The various computer-readable storage media described in this application may represent one or more devices and / or other machine-readable storage media for storing information. The term "machine-readable storage medium" may include, but is not limited to, wireless channels and various other media capable of storing, containing and / or carrying instructions and / or data.

[0179] An embodiment of the present application provides a computer program product including instructions. When the computer program product is run on a computer, the computer is enabled to execute the routing configuration and address allocation method described in any of the above embodiments.

[0180] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A routing configuration method, characterized in that: The method is applied to a gateway, the gateway is connected to a target device, the target device has a routing function, and the method includes: Allocate a first unique local address ULA proxy prefix to the target device; In the LAN side routing, the next hop address corresponding to the destination address is configured as the address of the target device; the prefix of the destination address is the first ULA proxy prefix; and the LAN is a LAN including the gateway and the target device.

2. The method according to claim 1, characterized in that The allocating a first ULA proxy prefix to the target device includes: In a case where the gateway cannot allocate a global unicast address GUA proxy prefix to the target device, a first ULA proxy prefix is ​​allocated to the target device.

3. The method according to claim 2, characterized in that The gateway cannot allocate a GUA proxy prefix to the target device, including: The gateway proxy prefix obtained by the gateway is of a preset length, or the gateway cannot obtain the gateway proxy prefix.

4. The method according to any one of claims 1 to 3, characterized in that: Before allocating the first ULA proxy prefix to the target device, the method further includes: A second ULA proxy prefix is ​​generated, and the first ULA proxy prefix is ​​separated from the second ULA proxy prefix; wherein the length of the second ULA proxy prefix is ​​less than a preset length; and the length of the first ULA proxy prefix is ​​between the length of the second ULA proxy prefix and the preset length.

5. The method according to claim 4, characterized in that The separating the first ULA proxy prefix from the second ULA proxy prefix comprises: In case of receiving a first request from the target device, separating the first ULA proxy prefix from the second ULA proxy prefix; the first request is used to request to obtain the first ULA proxy prefix.

6. The method according to claim 1, characterized in that The gateway is connected to the first device, and the gateway is connected to the second device through the target device. The method further includes: When receiving a target message sent by the first device to the second device, finding from the LAN side routing that the next hop address of the target message is the address of the target device; wherein the prefix of the destination address of the target message is the first ULA proxy prefix; Based on the address of the target device, the target message is sent to the target device, and the target device forwards the target message to the second device.

7. An address allocation method, characterized in that: Applied to a target device, the target device has a routing function, the target device is connected to a gateway and a second device, and the method includes: Receive a first unique local unicast address ULA prefix assigned by the gateway; wherein the length of the first ULA proxy prefix is ​​less than a preset length; A first ULA address is assigned to the second device based on the first ULA proxy prefix.

8. The method according to claim 7, characterized in that Before receiving the first ULA proxy prefix allocated by the gateway, the method further includes: Sending a first request to the gateway; the first request is used to request to obtain the first ULA proxy prefix.

9. The method according to claim 7, characterized in that: The method further comprises: receiving a target message sent by the gateway; wherein the destination address of the target message is the address of the second device; Based on the destination address of the target message, the target message is sent to the second device.

10. An electronic device, characterized in that: It comprises a memory and a processor; the memory and the processor are coupled; the memory is used to store computer program code, and the computer program code includes computer instructions; wherein, when the processor executes the computer instructions, the electronic device executes the routing configuration method as described in any one of claims 1 to 6, or executes the address allocation method as described in any one of claims 7 to 9.

11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions; wherein, when the computer instructions are executed on an electronic device, the electronic device executes the routing configuration method as described in any one of claims 1-6, or executes the address allocation method as described in any one of claims 7-9.