A network access method, apparatus, device, storage medium and program product
By extending the ARP protocol to achieve the conversion of IPv6 addresses to IPv4 addresses, the problem of terminal devices being unable to directly access IPv6 addresses is solved, thus improving the user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHINA MOBILE COMM LTD RES INST
- Filing Date
- 2024-08-02
- Publication Date
- 2026-07-10
AI Technical Summary
During the evolution of IPv6 to a single stack, terminal devices, due to being assigned IPv4 addresses, cannot complete NAT46 translation of destination addresses through DNS46, resulting in applications being unable to directly access IPv6 addresses and a decline in user experience.
By extending the ARP protocol, the terminal device initiates an ARP request to the address translation module, requesting the IPv4 address corresponding to the IPv6 address, and receives and stores the mapping relationship, realizing the conversion of IPv6 address to IPv4 address, and directly accessing the IPv6 service terminal.
Without relying on DNS46, terminal devices can directly access IPv6 addresses, improving the user experience.
Smart Images

Figure CN118921349B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of Internet technology, and in particular to a network access method, apparatus, device, storage medium, and program product. Background Technology
[0002] In recent years, with the continuous advancement of IPv6 transformation and the constant evolution of new IPv6 technologies, IPv6 traffic in networks has increased significantly. As the proportion of IPv6 traffic continues to rise, IPv6 single-stack technology is also constantly evolving.
[0003] In the evolution of IPv6 to a single stack, NAT46 translation scenarios are receiving increasing attention. Since both network and service servers have been upgraded to IPv6 single stack, the terminal side may only be allocated IPv4 addresses for various reasons. In this situation, the customer premises equipment (CPE) needs to perform NAT46 translation, including source address NAT46 translation and destination address NAT46 translation, thereby enabling the terminal to access the IPv6 network and services.
[0004] The inventors discovered that existing technologies have at least the following problems: NAT46 translation of destination addresses relies on DNS46 functionality. However, in scenarios where applications on a terminal access IPv6 addresses directly without using DNS, the inability to perform NAT46 translation of destination addresses via DNS46 will prevent the terminal applications from accessing the addresses successfully, leading to a degraded user experience. Summary of the Invention
[0005] The purpose of this invention is to provide a network access method, apparatus, device, storage medium, and program product that achieves the conversion of IPv6 addresses to IPv4 addresses by extending the ARP protocol, so that terminals assigned IPv4 addresses can directly access IPv6 addresses without going through DNS46, thereby improving the user experience.
[0006] To achieve the above objectives, embodiments of the present invention provide a network access method applied to a terminal side, the method comprising:
[0007] In response to the access request to the service terminal, an ARP request is initiated to the address translation module; wherein, the ARP request includes an extended ARP protocol type and the IPv6 address of the service terminal, the extended ARP protocol type is used to implement the mapping of IPv6 address to IPv4 address, and the ARP request is used to request the IPv4 address corresponding to the IPv6 address.
[0008] Receive the ARP response returned by the address translation module; wherein the ARP response includes the IPv6 address of the service terminal and the corresponding configured IPv4 address of the service terminal;
[0009] Access to the service terminal is initiated based on the IPv4 address of the service terminal.
[0010] As an improvement to the above scheme, before initiating an ARP request to the address translation module, the method further includes:
[0011] In response to the access request to the service terminal, check whether the IPv4 address corresponding to the IPv6 address of the service terminal is stored in the preset ARP table entry;
[0012] When the ARP entry does not store the IPv4 address corresponding to the IPv6 address of the service terminal, an ARP request is initiated to the address translation module.
[0013] As an improvement to the above scheme, after receiving the ARP response returned by the address translation module, the method further includes:
[0014] Generate a mapping relationship between the IPv6 address and the IPv4 address of the service terminal, and update the ARP entry.
[0015] As an improvement to the above scheme, after checking whether the IPv4 address corresponding to the IPv6 address of the service terminal is stored in the preset ARP table entry, the method further includes:
[0016] When the ARP entry stores the IPv4 address corresponding to the IPv6 address of the service terminal, an access to the service terminal is initiated based on the IPv4 address of the service terminal.
[0017] As an improvement to the above solution, the step of initiating access to the service terminal based on the service terminal's IPv4 address includes:
[0018] Generate a first access request; wherein the first access request is used to request access to the service terminal, and the source address of the first access request is the IPv4 address of the terminal, and the destination address is the IPv4 address of the service terminal.
[0019] The first access request is sent to the address translation module so that the address translation module converts the source address to the IPv6 address of the terminal, converts the destination address to the IPv6 address of the service terminal, and initiates access to the service terminal.
[0020] This invention also provides a network access method applied to an address translation module, the method comprising:
[0021] The terminal receives an ARP request; wherein the ARP request includes an extended ARP protocol type and the IPv6 address of the service terminal that the terminal needs to access, the extended ARP protocol type is used to implement the mapping from IPv6 address to IPv4 address, and the ARP request is used to request the IPv4 address corresponding to the IPv6 address.
[0022] In response to the ARP request, configure the corresponding IPv4 address for the IPv6 address of the service terminal and generate an ARP response;
[0023] The ARP response is returned to the terminal, enabling the terminal to initiate access to the service provider based on the service provider's IPv4 address.
[0024] As an improvement to the above solution, the step of responding to the ARP request by configuring a corresponding IPv4 address for the IPv6 address of the service terminal and generating an ARP response includes:
[0025] In response to the ARP request, a target IPv4 address is selected from the preset address pool and configured as the IPv4 address of the service terminal;
[0026] An ARP response is generated based on the IPv6 address of the service terminal and the corresponding configured IPv4 address of the service terminal.
[0027] As an improvement to the above scheme, after returning the ARP response to the terminal, the method further includes:
[0028] Receive a first access request sent by the terminal; wherein the first access request is used to request access to the service terminal, and the source address of the first access request is the IPv4 address of the terminal, and the destination address is the IPv4 address of the service terminal.
[0029] The source address is converted to the IPv6 address of the terminal, the destination address is converted to the IPv6 address of the service terminal, and a second access request is generated to request access to the service terminal.
[0030] Send the second access request to the service terminal.
[0031] As an improvement to the above solution, the step of converting the source address to the IPv6 address of the terminal and converting the destination address to the IPv6 address of the service terminal includes:
[0032] Add a preset IPv6 prefix to the IPv4 address of the terminal, convert it into the IPv6 address of the terminal, and use it as the source address;
[0033] Based on the mapping between IPv6 and IPv4 addresses, the IPv4 address of the service terminal is converted to the IPv6 address of the service terminal and used as the destination address.
[0034] This invention also provides a network access device applied to a terminal side, the device comprising:
[0035] The ARP request sending module is used to initiate an ARP request to the address translation module in response to an access request to the service terminal; wherein, the ARP request includes an extended ARP protocol type and the IPv6 address of the service terminal, the extended ARP protocol type is used to implement the mapping from IPv6 address to IPv4 address, and the ARP request is used to request the IPv4 address corresponding to the IPv6 address.
[0036] An ARP response receiving module is used to receive an ARP response returned by the address translation module; wherein the ARP response includes the IPv6 address of the service terminal and the corresponding configured IPv4 address of the service terminal;
[0037] The service-side access module is used to initiate access to the service-side based on its IPv4 address.
[0038] This invention also provides a network access device applied to an address translation module, the device comprising:
[0039] An ARP request receiving module is used to receive ARP requests initiated by a terminal; wherein, the ARP request includes an extended ARP protocol type and the IPv6 address of the service terminal that the terminal needs to access, the extended ARP protocol type is used to implement the mapping from IPv6 address to IPv4 address, and the ARP request is used to request the IPv4 address corresponding to the IPv6 address.
[0040] The ARP response generation module is used to respond to the ARP request, configure the corresponding IPv4 address for the IPv6 address of the service terminal, and generate an ARP response.
[0041] The ARP response sending module is used to return the ARP response to the terminal, so that the terminal can initiate access to the service terminal based on the IPv4 address of the service terminal.
[0042] This invention also provides a network access device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor executes the computer program to implement the network access method as described in any of the preceding embodiments.
[0043] This invention also provides a computer-readable storage medium, which includes a stored computer program, wherein the computer program, when running, controls the device where the computer-readable storage medium is located to perform the network access method as described in any of the above embodiments.
[0044] This invention also provides a computer program product, which includes a computer program or computer instructions. When the computer program or computer instructions are executed by a processor, they implement the network access method as described in any of the above embodiments.
[0045] Compared with existing technologies, the network access method, apparatus, device, storage medium, and program product disclosed in this invention achieve NAT46 translation of destination addresses by extending the ARP protocol. When a terminal with an IPv4 address needs to access a service with an IPv6 address, it initiates an ARP request to the NAT46 module. The NAT46 module configures the corresponding IPv4 address for the service's IPv6 address and returns it to the terminal. The terminal initiates access to the service based on the service's IPv4 address, without relying on DNS46 functionality, and can directly access the IPv6 address, thus achieving normal access to the service and effectively improving the user experience. Attached Figure Description
[0046] Figure 1 This is a schematic diagram illustrating the principle of NAT46 translation scenarios;
[0047] Figure 2 This is a schematic diagram of the access process in a NAT46 translation scenario in existing technology;
[0048] Figure 3 This is a flowchart illustrating a network access method provided in an embodiment of the present invention;
[0049] Figure 4 This is a schematic diagram of the existing ARP protocol message format;
[0050] Figure 5 This is a schematic diagram of the extended ARP protocol message format in an embodiment of the present invention;
[0051] Figure 6 This is a flowchart illustrating a preferred network access method in an embodiment of the present invention;
[0052] Figure 7 This is a flowchart illustrating another network access method provided in an embodiment of the present invention;
[0053] Figure 8 This is a schematic diagram of the structure of a network access device provided in an embodiment of the present invention. Detailed Implementation
[0054] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0055] In the description of this application, it should be understood that the terms "center", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are only for the convenience of describing this application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on this application.
[0056] The terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this application, unless otherwise stated, "a plurality of" means two or more.
[0057] It should be noted that this embodiment of the invention is applied to NAT46 translation scenarios. In fixed-line scenarios, the NAT46 address translation module can be deployed on the customer premises equipment (CPE), while in mobile scenarios, the NAT46 module can be deployed on the terminal. This embodiment of the invention is applicable to both fixed-line and mobile scenarios. This embodiment of the invention is illustrated using a fixed-line scenario as an example; see [link to documentation]. Figure 1 This is a schematic diagram of the NAT46 translation scenario. In this scenario, both the network and service server sides have been upgraded to IPv6 single stack, while the terminal side is assigned an IPv4 address. When the terminal side needs to access the IPv6 service server, the home gateway CPE needs to perform NAT46 translation to complete the terminal's access to the IPv6 network and service server.
[0058] See Figure 2This diagram illustrates the access flow in a NAT46 translation scenario in existing technologies. Existing technologies rely on DNS46 functionality to complete NAT46 translation of the destination address. Specifically, when a terminal needs to access service server 1, it initiates a DNS4 request. After the CPE receives this request message, its DNS46 function translates the DNS4 request into a DNS6 request. The CPE receives the AAAA record from the DNS server carrying the IPv6 address of service server 1 and performs stateful NAT46 translation on the IPv6 address. That is, based on the previously configured IPv4 address pool, it generates and saves a NAT46 translation entry for service server 1 (service server 1 - IPv4 address <-> service server 1 - IPv6 address). The CPE then sends the translated service server IPv4 address to the terminal via DNS4. The terminal uses this address as the destination address to initiate a data plane IPv4 access. Upon reaching the CPE, NAT46 translation is performed, including: performing stateless NAT46 translation on the source address, that is, adding the CPE's LAN-side IPv6 prefix to the IPv4 private address to obtain the source IPv6 address; and performing stateful NAT46 translation on the destination address, that is, using the previous stateful NAT46 translation table entry for translation, thereby initiating a data plane IPv6 access and enabling the terminal to access service server 1.
[0059] However, in scenarios where terminal applications access IPv6 addresses directly without using DNS, the applications will fail to access the network because DNS46 cannot perform NAT46 translation for the destination address. To address this issue, this invention provides a network access method, see [link to relevant documentation]. Figure 3 This is a flowchart illustrating a network access method provided in an embodiment of the present invention. The method is applied to the terminal side and includes steps S11 to S13:
[0060] S11. In response to the access request to the service terminal, an ARP request is initiated to the address translation module; wherein, the ARP request includes an extended ARP protocol type and the IPv6 address of the service terminal, the extended ARP protocol type is used to implement the mapping from IPv6 address to IPv4 address, and the ARP request is used to request the IPv4 address corresponding to the IPv6 address.
[0061] S12. Receive the ARP response returned by the address translation module; wherein the ARP response includes the IPv6 address of the service terminal and the corresponding configured IPv4 address of the service terminal;
[0062] S13. Initiate access to the service terminal based on the IPv4 address of the service terminal.
[0063] In this embodiment of the invention, the translation of IPv6 addresses to IPv4 addresses is achieved by extending the ARP (Address Resolution Protocol) protocol, thereby completing the NAT46 translation of the destination address.
[0064] It should be noted that, see Figure 4 This is a schematic diagram of the existing ARP protocol message format. The current ARP protocol can translate IPv4 addresses into hardware addresses (MAC addresses) required by various networks. In other words, the goal of address resolution is to discover the mapping relationship between logical addresses and physical addresses. The protocol type defined in the current standard is IPv4, and the operation codes are "ARPRequest=1" and "ARP Reply=2".
[0065] See Figure 5 This diagram illustrates the extended ARP protocol message format in an embodiment of the present invention. This embodiment extends the current ARP protocol by defining a new protocol type: IPv4&IPv6 protocol, which represents a protocol that includes both IPv4 and IPv6 addresses. The assumed type value is 0xFFFE. When the protocol type is IPv4&IPv6, the protocol address length is 160 bits (32 bits + 128 bits). Furthermore, the extended ARP protocol operation codes are defined as NAT46 Request and NAT46 Reply. NAT46 Request (assumed value 0x00FE) represents requesting the IPv4 address corresponding to a given IPv6 address in the ARP protocol to complete the subsequent NAT46 translation. NAT46 Reply (assumed value 0x00FF) represents replying to the IPv4 address corresponding to the given IPv6 address in the ARP protocol.
[0066] After the ARP protocol is extended, terminals with IPv4 addresses can directly access services with IPv6 addresses. For details, see [link to relevant documentation]. Figure 6This is a flowchart illustrating a preferred network access method in an embodiment of the present invention. Taking a NAT46 module deployed on a client terminal device (CPE) as an example, assume the terminal's IPv4 address is IPv4 private address 1 and the CPE's MAC address is MAC2. When the terminal requests access to a service, it sends an ARP request to the CPE. The protocol type is the extended ARP protocol type IPv4&IPv6, the protocol length is 160 bits, the operation code is NAT46Request, and it also includes the service's IPv6 address, assumed to be 2001::1. The request asks the CPE to generate a corresponding IPv4 address for the service's IPv6 address 2001::1. Upon discovering the operation code NAT46Request, the CPE responds to the request, configures a corresponding IPv4 address for IPv6 address 2001::1, assumed to be 192.168.1.100, and generates an ARP response. The client terminal equipment (CPE) sends an ARP response to the terminal. The protocol type is IPv4 & IPv6, the protocol address length is 160 bits, the operation code is NAT46 Reply, the source IPv6 address is 2001::1, the source IPv4 address is 192.168.1.100, and the source MAC address is MAC2. This informs the terminal that the IPv6 address 2001::1 corresponds to the IPv4 address 192.168.1.100.
[0067] Preferably, the steps for the address translation module to generate an ARP response are as follows: selecting a target IPv4 address from a preset address pool and configuring it as the IPv4 address of the service terminal; generating an ARP response based on the IPv6 address of the service terminal and the corresponding configured IPv4 address of the service terminal.
[0068] In other words, after the client terminal device (CPE) receives an ARP request, it selects an unoccupied and suitable IPv4 address according to the configured NAT46 address pool and a certain algorithm, generates a stateful NAT46 translation table entry 2001::1<->192.168.1.100 and saves it.
[0069] Furthermore, after receiving the ARP response, the terminal can perform data plane IPv4 access based on the IPv4 address of the service terminal. The source address is the terminal's private IPv4 address 1, and the destination address is the service terminal's IPv4 address 192.168.1.100.
[0070] Preferably, after receiving the ARP response returned by the address translation module, the method further includes step S14:
[0071] S14. Generate a mapping relationship between the IPv6 address and the IPv4 address of the service terminal, and update the ARP entry.
[0072] In this embodiment of the invention, after receiving an ARP response, the terminal generates an ARP entry. The ARP entry stores IPv6 addresses and IPv4 addresses, as well as the mapping relationship between IPv4 addresses and MAC addresses. Specifically, it includes an IPv6-IPv4 corresponding entry: 192.168.1.100<->MAC2 and an IPv6-MAC corresponding entry: 2001::1<->MAC2. This allows the terminal to directly initiate an access request when it needs to access the service again, by querying the IPv4 address corresponding to the IPv6 address of the service stored in the ARP entry.
[0073] In a preferred embodiment, before step S11, i.e., before initiating an ARP request to the address translation module, the method further includes:
[0074] In response to the access request to the service terminal, check whether the IPv4 address corresponding to the IPv6 address of the service terminal is stored in the preset ARP table entry;
[0075] When the ARP entry does not store the IPv4 address corresponding to the IPv6 address of the service terminal, an ARP request is initiated to the address translation module.
[0076] When the ARP entry stores the IPv4 address corresponding to the IPv6 address of the service terminal, an access to the service terminal is initiated based on the IPv4 address of the service terminal.
[0077] In other words, in this embodiment of the invention, when a terminal requests access to a service provider, the terminal first checks whether the ARP table entry stores the IPv4 address of the service provider. If the IPv4 address of the service provider is found, there is no need to initiate an ARP request to the client terminal device (CPE), but the terminal directly uses the IPv4 address of the service provider for data plane IPv4 access. If the IPv4 address of the service provider is not found, then an ARP request needs to be initiated to the client terminal device (CPE) to request the CPE to configure the corresponding IPv4 address.
[0078] Preferably, step S13, namely, initiating access to the service terminal based on the IPv4 address of the service terminal, includes:
[0079] Generate a first access request; wherein the first access request is used to request access to the service terminal, and the source address of the first access request is the IPv4 address of the terminal, and the destination address is the IPv4 address of the service terminal.
[0080] The first access request is sent to the address translation module so that the address translation module converts the source address to the IPv6 address of the terminal, converts the destination address to the IPv6 address of the service terminal, and initiates access to the service terminal.
[0081] In embodiments of the present invention, such as Figure 6 As shown, after receiving or querying the IPv4 address of the service provider, the terminal initiates a first access request to the Customer Premises Equipment (CPE) for data plane IPv4 access. The source address is IPv4 private address 1, and the destination address is 192.168.1.100. The CPE performs NAT46 translation, converting the source address to the terminal's IPv6 address and the destination address to the service provider's IPv6 address. The CPE can use existing stateless NAT46 translation for the source address. Assuming the LAN-side IPv6 prefix allocated by the CPE is IPv6Prefix, the source address is converted to IPv6Prefix::IPv4 private address 1. The CPE then performs the destination address translation according to the mapping relationship, i.e., the destination address is converted to 2001::1. After the client terminal equipment (CPE) completes the address translation, it generates a second access request to perform IPv6 data plane access. The source address is IPv6Prefix::IPv4 private address 1, and the destination address is 2001::1, thus initiating access to the service terminal.
[0082] By employing the technical means of this invention, the ARP protocol is extended to achieve NAT46 translation of the destination address. When a terminal with an IPv4 address needs to access a service provider with an IPv6 address, it initiates an ARP request to the NAT46 module. The NAT46 module then configures the corresponding IPv4 address for the service provider's IPv6 address and returns it to the terminal. This allows the terminal to access the service provider directly based on the service provider's IPv4 address without relying on the DNS46 function, thus enabling normal access to the service provider and effectively improving the user experience.
[0083] See Figure 7 This is a flowchart illustrating another network access method provided by an embodiment of the present invention. The embodiment of the present invention provides another network access method applied to an address translation module, the method comprising steps S21 to S23:
[0084] S21. Receive an ARP request initiated by the terminal; wherein the ARP request includes an extended ARP protocol type and the IPv6 address of the service terminal that the terminal needs to access, the extended ARP protocol type is used to implement the mapping from IPv6 address to IPv4 address, and the ARP request is used to request the IPv4 address corresponding to the IPv6 address.
[0085] S22. In response to the ARP request, configure the corresponding IPv4 address for the IPv6 address of the service terminal, and generate an ARP response;
[0086] S23. Return the ARP response to the terminal so that the terminal can initiate access to the service terminal based on the IPv4 address of the service terminal.
[0087] In this embodiment of the invention, a new protocol type is defined based on the current ARP protocol: IPv4 & IPv6 protocol. The type value is assumed to be 0xFFFE, and the protocol address length is 160 bits (32 bits + 128 bits). The operation codes are defined as NAT46 Request and NAT46 Reply. NAT46 Request: assuming a value of 0x00FE, represents requesting the IPv4 address corresponding to a certain IPv6 address in the ARP protocol to complete the subsequent NAT46 translation. NAT46 Reply: assuming a value of 0x00FF, represents replying with the IPv4 address corresponding to the IPv6 address in the ARP protocol.
[0088] After the ARP protocol is extended, terminals with IPv4 addresses can directly access services with IPv6 addresses. Taking the NAT46 address translation module deployed on a Customer Premises Equipment (CPE) as an example, assuming the terminal's IPv4 address is IPv4 private address 1 and the CPE's MAC address is MAC2, when the terminal requests access to a service, it sends an ARP request to the CPE. The protocol type is the extended ARP protocol type IPv4&IPv6, the protocol length is 160 bits, the operation code is NAT46Request, and it also includes the service's IPv6 address, assuming it is 2001::1, requesting the CPE to generate a corresponding IPv4 address for the service's IPv6 address 2001::1. The CPE, recognizing the operation code NAT46 Request, responds to the request, configures the corresponding IPv4 address for IPv6 address 2001::1, assuming it is 192.168.1.100, and generates an ARP response. The client terminal equipment (CPE) sends an ARP response to the terminal. The protocol type is IPv4 & IPv6, the protocol address length is 160 bits, the operation code is NAT46 Reply, the source IPv6 address is 2001::1, the source IPv4 address is 192.168.1.100, and the source MAC address is MAC2. This informs the terminal that the IPv6 address 2001::1 corresponds to the IPv4 address 192.168.1.100.
[0089] Furthermore, after receiving the ARP response, the terminal can perform data plane IPv4 access based on the IPv4 address of the service provider. The source address is the terminal's private IPv4 address 1, and the destination address is the service provider's IPv4 address 192.168.1.100. Upon receiving the ARP response, the terminal generates an ARP entry storing the mapping relationship between IPv6 addresses and IPv4 addresses, as well as IPv4 addresses and MAC addresses. Specifically, this includes the IPv6-IPv4 mapping entry: 192.168.1.100<->MAC2 and the IPv6-MAC mapping entry: 2001::1<->MAC2. This allows the terminal to directly initiate an access request when it subsequently needs to access the service provider again by querying the IPv4 address corresponding to the service provider's IPv6 address stored in the ARP entry.
[0090] Preferably, step S22, that is, responding to the ARP request by configuring a corresponding IPv4 address for the IPv6 address of the service terminal and generating an ARP response, includes:
[0091] In response to the ARP request, a target IPv4 address is selected from the preset address pool and configured as the IPv4 address of the service terminal;
[0092] An ARP response is generated based on the IPv6 address of the service terminal and the corresponding configured IPv4 address of the service terminal.
[0093] In other words, after the client terminal device (CPE) receives an ARP request, it selects an unoccupied and suitable IPv4 address according to the configured NAT46 address pool and a certain algorithm, generates a stateful NAT46 translation table entry 2001::1<->192.168.1.100 and saves it.
[0094] Preferably, in step S23, that is, after returning the ARP response to the terminal, the method further includes:
[0095] Receive a first access request sent by the terminal; wherein the first access request is used to request access to the service terminal, and the source address of the first access request is the IPv4 address of the terminal, and the destination address is the IPv4 address of the service terminal.
[0096] The source address is converted to the IPv6 address of the terminal, the destination address is converted to the IPv6 address of the service terminal, and a second access request is generated to request access to the service terminal.
[0097] Send the second access request to the service terminal.
[0098] Preferably, the step of converting the source address to the IPv6 address of the terminal and converting the destination address to the IPv6 address of the service terminal includes:
[0099] Add a preset IPv6 prefix to the IPv4 address of the terminal, convert it into the IPv6 address of the terminal, and use it as the source address;
[0100] Based on the mapping between IPv6 and IPv4 addresses, the IPv4 address of the service terminal is converted to the IPv6 address of the service terminal and used as the destination address.
[0101] Specifically, after receiving or querying the IPv4 address of the service provider, the terminal initiates a first access request to the Customer Premises Equipment (CPE) for data plane IPv4 access. The source address is IPv4 private address 1, and the destination address is 192.168.1.100. The CPE performs NAT46 translation, converting the source address to the terminal's IPv6 address and the destination address to the service provider's IPv6 address. The CPE can use existing stateless NAT46 translation for the source address. Assuming the LAN-side IPv6 prefix allocated by the CPE is IPv6Prefix, the source address is converted to IPv6Prefix::IPv4 private address 1. The CPE then performs the destination address translation according to the mapping relationship, i.e., the destination address is 2001::1. After the client terminal equipment (CPE) completes the address translation, it generates a second access request to perform IPv6 data plane access. The source address is IPv6Prefix::IPv4 private address 1, and the destination address is 2001::1, thus initiating access to the service terminal.
[0102] It should be noted that the network access method applied to the address translation module provided in the embodiments of the present invention corresponds one-to-one with all the process steps of the network access method applied to the terminal side in the above embodiments. The working principle and beneficial effects of the two are the same, so they will not be described again.
[0103] By employing the technical means of this invention, the ARP protocol is extended to achieve NAT46 translation of the destination address. When a terminal with an IPv4 address needs to access a service provider with an IPv6 address, it initiates an ARP request to the NAT46 module. The NAT46 module then configures the corresponding IPv4 address for the service provider's IPv6 address and returns it to the terminal. This allows the terminal to access the service provider directly based on the service provider's IPv4 address without relying on the DNS46 function, thus enabling normal access to the service provider and effectively improving the user experience.
[0104] This invention also provides a network access device applied to a terminal side, the device comprising:
[0105] The ARP request sending module is used to initiate an ARP request to the address translation module in response to an access request to the service terminal; wherein, the ARP request includes an extended ARP protocol type and the IPv6 address of the service terminal, the extended ARP protocol type is used to implement the mapping from IPv6 address to IPv4 address, and the ARP request is used to request the IPv4 address corresponding to the IPv6 address.
[0106] An ARP response receiving module is used to receive an ARP response returned by the address translation module; wherein the ARP response includes the IPv6 address of the service terminal and the corresponding configured IPv4 address of the service terminal;
[0107] The service-side access module is used to initiate access to the service-side based on its IPv4 address.
[0108] It should be noted that the network access device provided in this embodiment of the invention is used to execute all the process steps of the network access method applied to the terminal side in the above embodiment. The working principle and beneficial effect of the two are one-to-one, so they will not be described again.
[0109] This invention also provides another network access device applied to an address translation module, the device comprising:
[0110] An ARP request receiving module is used to receive ARP requests initiated by a terminal; wherein, the ARP request includes an extended ARP protocol type and the IPv6 address of the service terminal that the terminal needs to access, the extended ARP protocol type is used to implement the mapping from IPv6 address to IPv4 address, and the ARP request is used to request the IPv4 address corresponding to the IPv6 address.
[0111] The ARP response generation module is used to respond to the ARP request, configure the corresponding IPv4 address for the IPv6 address of the service terminal, and generate an ARP response.
[0112] The ARP response sending module is used to return the ARP response to the terminal, so that the terminal can initiate access to the service terminal based on the IPv4 address of the service terminal.
[0113] It should be noted that the network access device provided in this embodiment of the invention is used to execute all the process steps of a network access method applied to the address translation module in the above embodiment. The working principles and beneficial effects of the two are one-to-one, so they will not be described again.
[0114] See Figure 8 This is a schematic diagram of the structure of a network access device provided in an embodiment of the present invention. The present invention also provides a network access device 30, including a processor 31, a memory 32, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, it implements the network access method as described in any of the above embodiments.
[0115] This invention also provides a computer-readable storage medium, which includes a stored computer program, wherein the computer program, when running, controls the device where the computer-readable storage medium is located to execute the network access method as described in any of the above embodiments.
[0116] This invention also provides a computer program product, which includes a computer program or computer instructions. When the computer program or computer instructions are executed by a processor, they implement the network access method as described in any of the above embodiments.
[0117] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. The storage medium can be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc.
[0118] The above description represents the preferred embodiments of the present invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of the present invention, and these improvements and modifications are also considered to be within the scope of protection of the present invention.
Claims
1. A network access method, characterized in that, Applied to the terminal side, the method includes: In response to the access request to the service terminal, an ARP request is initiated to the address translation module; wherein, the ARP request includes an extended ARP protocol type and the IPv6 address of the service terminal, the extended ARP protocol type is used to implement the mapping of IPv6 address to IPv4 address, and the ARP request is used to request the IPv4 address corresponding to the IPv6 address. Receive the ARP response returned by the address translation module; wherein the ARP response includes the IPv6 address of the service terminal and the corresponding configured IPv4 address of the service terminal; Access to the service terminal is initiated based on the IPv4 address of the service terminal.
2. The network access method as described in claim 1, characterized in that, Before initiating an ARP request to the address translation module, the method further includes: In response to the access request to the service terminal, check whether the IPv4 address corresponding to the IPv6 address of the service terminal is stored in the preset ARP table entry; When the ARP entry does not store the IPv4 address corresponding to the IPv6 address of the service terminal, an ARP request is initiated to the address translation module.
3. The network access method as described in claim 2, characterized in that, After receiving the ARP response returned by the address translation module, the method further includes: Generate a mapping relationship between the IPv6 address and the IPv4 address of the service terminal, and update the ARP entry.
4. The network access method as described in claim 2 or 3, characterized in that, After checking whether the IPv4 address corresponding to the IPv6 address of the service terminal is stored in the preset ARP table entry, the method further includes: When the ARP entry stores the IPv4 address corresponding to the IPv6 address of the service terminal, an access to the service terminal is initiated based on the IPv4 address of the service terminal.
5. The network access method as described in claim 1, characterized in that, The process of initiating access to the service terminal based on its IPv4 address includes: Generate a first access request; wherein the first access request is used to request access to the service terminal, and the source address of the first access request is the IPv4 address of the terminal, and the destination address is the IPv4 address of the service terminal. The first access request is sent to the address translation module so that the address translation module converts the source address to the IPv6 address of the terminal, converts the destination address to the IPv6 address of the service terminal, and initiates access to the service terminal.
6. A network access method, characterized in that, Applied to an address translation module, the method includes: The terminal receives an ARP request; wherein the ARP request includes an extended ARP protocol type and the IPv6 address of the service terminal that the terminal needs to access, the extended ARP protocol type is used to implement the mapping from IPv6 address to IPv4 address, and the ARP request is used to request the IPv4 address corresponding to the IPv6 address. In response to the ARP request, configure the corresponding IPv4 address for the IPv6 address of the service terminal and generate an ARP response; The ARP response is returned to the terminal, enabling the terminal to initiate access to the service provider based on the service provider's IPv4 address.
7. The network access method as described in claim 6, characterized in that, In response to the ARP request, the corresponding IPv4 address is configured for the IPv6 address of the service terminal, and an ARP response is generated, including: In response to the ARP request, a target IPv4 address is selected from the preset address pool and configured as the IPv4 address of the service terminal; An ARP response is generated based on the IPv6 address of the service terminal and the corresponding configured IPv4 address of the service terminal.
8. The network access method as described in claim 6, characterized in that, After returning the ARP response to the terminal, the method further includes: Receive a first access request sent by the terminal; wherein the first access request is used to request access to the service terminal, and the source address of the first access request is the IPv4 address of the terminal, and the destination address is the IPv4 address of the service terminal. The source address is converted to the IPv6 address of the terminal, the destination address is converted to the IPv6 address of the service terminal, and a second access request is generated to request access to the service terminal. Send the second access request to the service terminal.
9. The network access method as described in claim 8, characterized in that, The step of converting the source address to the IPv6 address of the terminal and converting the destination address to the IPv6 address of the service terminal includes: Add a preset IPv6 prefix to the IPv4 address of the terminal, convert it into the IPv6 address of the terminal, and use it as the source address; Based on the mapping between IPv6 and IPv4 addresses, the IPv4 address of the service terminal is converted to the IPv6 address of the service terminal and used as the destination address.
10. A network access device, characterized in that, Applied to the terminal side, the device includes: The ARP request sending module is used to initiate an ARP request to the address translation module in response to an access request to the service terminal; wherein, the ARP request includes an extended ARP protocol type and the IPv6 address of the service terminal, the extended ARP protocol type is used to implement the mapping from IPv6 address to IPv4 address, and the ARP request is used to request the IPv4 address corresponding to the IPv6 address. An ARP response receiving module is used to receive an ARP response returned by the address translation module; wherein the ARP response includes the IPv6 address of the service terminal and the corresponding configured IPv4 address of the service terminal; The service-side access module is used to initiate access to the service-side based on its IPv4 address.
11. A network access device, characterized in that, The device, applied to an address translation module, includes: An ARP request receiving module is used to receive ARP requests initiated by a terminal; wherein, the ARP request includes an extended ARP protocol type and the IPv6 address of the service terminal that the terminal needs to access, the extended ARP protocol type is used to implement the mapping from IPv6 address to IPv4 address, and the ARP request is used to request the IPv4 address corresponding to the IPv6 address. The ARP response generation module is used to respond to the ARP request, configure the corresponding IPv4 address for the IPv6 address of the service terminal, and generate an ARP response. The ARP response sending module is used to return the ARP response to the terminal, so that the terminal can initiate access to the service terminal based on the IPv4 address of the service terminal.
12. A network access device, characterized in that, It includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor, when executing the computer program, implements the network access method as described in any one of claims 1 to 9.
13. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored computer program, wherein, when the computer program is executed, it controls the device on which the computer-readable storage medium is located to perform the network access method as described in any one of claims 1 to 9.
14. A computer program product, characterized in that, The computer program product includes a computer program or computer instructions that, when executed by a processor, implement the network access method as described in any one of claims 1 to 9.