Network access method and device, equipment, storage medium and program product
By extending the ARP protocol to realize the mapping of IPv6 addresses to IPv4 addresses in an IPv6 single-stack environment, the problem that terminal devices cannot directly access the service side of IPv6 addresses is solved, and the user experience is improved.
Patent Information
- Application Number
- CN202411057813.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-02
- Publication Date
- 2024-11-08
- Estimated Expiration
- 2044-08-02
AI Technical Summary
During the evolution of IPv6 single stack, when the terminal device can only allocate an IPv4 address, it cannot complete the NAT46 conversion of the destination address through DNS46, resulting in a decline in user experience.
By extending the ARP protocol, the terminal device initiates an ARP request to the address translation module to realize the mapping of IPv6 addresses to IPv4 addresses, thereby directly accessing the service end of the IPv6 address and avoiding relying on DNS46 functions.
It realizes that the IPv4 address terminal device can directly access the service end of the IPv6 address, improves the user experience, and solves the access failure problem caused by relying on DNS46 in the prior art.
Smart Images

Figure CN118921349A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of Internet technology, and in particular to a network access method, device, equipment, storage medium and program product. Background Art
[0002] In recent years, with the continuous advancement of IPv6 transformation and the continuous evolution of new IPv6 technologies, IPv6 traffic in the network has increased significantly. As the proportion of IPv6 traffic continues to increase, IPv6 single stack technology is also constantly evolving.
[0003] In the process of IPv6 single stack evolution, NAT46 conversion scenarios are gaining more and more attention. Since the network and service server sides have been upgraded to IPv6 single stack, the terminal side may only be allocated IPv4 addresses for some reasons. In this case, the customer terminal equipment CPE needs to perform NAT46 conversion, including NAT46 conversion of source address and NAT46 conversion of destination address, so as to complete the terminal's access to IPv6 network and services.
[0004] The inventors have found that the prior art has at least the following problems: NAT46 conversion of the destination address needs to rely on the DNS46 function. However, in the scenario where the application on the terminal directly accesses the IPv6 address without using DNS, since the NAT46 conversion of the destination address cannot be completed with the help of DNS46, the terminal application will not be able to access successfully, which will lead to a decline in user experience. Summary of the invention
[0005] The purpose of the embodiments of the present invention is to provide a network access method, apparatus, device, storage medium and program product, which implements the conversion of IPv6 addresses to IPv4 addresses by extending the ARP protocol, so that the terminal assigned to the IPv4 address can directly access the IPv6 address without going through DNS46, thereby improving the user experience.
[0006] To achieve the above object, an embodiment of the present invention provides a network access method, which is applied to a terminal side, and the method includes:
[0007] In response to the access demand for the service end, 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 end, the extended ARP protocol type is used to implement the mapping of the IPv6 address to the IPv4 address, and the ARP request is used to request the IPv4 address corresponding to the IPv6 address;
[0008] Receive an ARP response returned by the address translation module; wherein the ARP response includes the IPv6 address of the service end and the corresponding configured IPv4 address of the service end;
[0009] Initiate access to the service end based on the IPv4 address of the service end.
[0010] As an improvement of the above solution, before initiating the ARP request to the address translation module, the method further includes:
[0011] In response to the access demand for the service end, searching whether the IPv4 address corresponding to the IPv6 address of the service end is stored in a preset ARP table entry;
[0012] When the IPv4 address corresponding to the IPv6 address of the service end is not stored in the ARP table entry, an ARP request is initiated to the address conversion module.
[0013] As an improvement of the above solution, after receiving the ARP response returned by the address translation module, the method further includes:
[0014] Generate a mapping relationship between the IPv6 address of the service end and the IPv4 address of the service end, and update it in the ARP table entry.
[0015] As an improvement of the above solution, after searching whether the preset ARP table entry stores the IPv4 address corresponding to the IPv6 address of the service end, the method further includes:
[0016] When the IPv4 address corresponding to the IPv6 address of the service end is stored in the ARP table entry, access to the service end is initiated based on the IPv4 address of the service end.
[0017] As an improvement of the above solution, the initiating access to the service end based on the IPv4 address of the service end includes:
[0018] Generate a first access request; wherein the first access request is used to request access to the service end, the source address included in the first access request is the IPv4 address of the terminal, and the destination address is the IPv4 address of the service end;
[0019] The first access request is sent to the address conversion module, so that the address conversion module converts the source address into the IPv6 address of the terminal, converts the destination address into the IPv6 address of the service end, and initiates access to the service end.
[0020] The embodiment of the present invention further provides a network access method, which is applied to an address translation module, and the method includes:
[0021] Receiving an ARP request initiated by a terminal; wherein the ARP request includes an extended ARP protocol type and an IPv6 address of a service end that the terminal needs to access, the extended ARP protocol type is used to implement mapping of an IPv6 address to an IPv4 address, and the ARP request is used to request an IPv4 address corresponding to the IPv6 address;
[0022] In response to the ARP request, configuring a corresponding IPv4 address for the IPv6 address of the service end, and generating an ARP response;
[0023] The ARP response is returned to the terminal, so that the terminal initiates access to the service end based on the IPv4 address of the service end.
[0024] As an improvement of the above solution, in response to the ARP request, configuring a corresponding IPv4 address for the IPv6 address of the service end, and generating an ARP response, includes:
[0025] In response to the ARP request, selecting a target IPv4 address from a preset address pool and configuring it as the IPv4 address of the service end;
[0026] An ARP response is generated according to the IPv6 address of the service end and the corresponding configured IPv4 address of the service end.
[0027] As an improvement of the above solution, 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 end, and the source address included in the first access request is the IPv4 address of the terminal, and the destination address is the IPv4 address of the service end;
[0029] Convert the source address into the IPv6 address of the terminal, convert the destination address into the IPv6 address of the service end, and generate a second access request for requesting access to the service end;
[0030] Send the second access request to the service end.
[0031] As an improvement of the above solution, the converting the source address into the IPv6 address of the terminal and the converting the destination address into the IPv6 address of the service end includes:
[0032] Adding a preset IPv6 prefix to the IPv4 address of the terminal to convert the IPv6 address of the terminal into the IPv6 address of the terminal as the source address;
[0033] According to the mapping between the IPv6 address and the IPv4 address, the IPv4 address of the service end is converted into the IPv6 address of the service end as the destination address.
[0034] The embodiment of the present invention further provides a network access device, which is applied to a terminal side, and the device includes:
[0035] An ARP request sending module is used to initiate an ARP request to the address translation module in response to an access demand for the service end; wherein the ARP request includes an extended ARP protocol type and an IPv6 address of the service end, the extended ARP protocol type is used to implement a mapping of an IPv6 address to an IPv4 address, and the ARP request is used to request an IPv4 address corresponding to the IPv6 address;
[0036] An ARP response receiving module, used to receive the ARP response returned by the address conversion module; wherein the ARP response includes the IPv6 address of the service end and the corresponding configured IPv4 address of the service end;
[0037] A service end access module is used to initiate access to the service end based on the IPv4 address of the service end.
[0038] The embodiment of the present invention further provides a network access device, which is applied to an address conversion module, and the device includes:
[0039] An ARP request receiving module, configured to receive an ARP request initiated by a terminal; wherein the ARP request includes an extended ARP protocol type and an IPv6 address of a service end to be accessed by the terminal, the extended ARP protocol type is used to implement mapping of an IPv6 address to an IPv4 address, and the ARP request is used to request an IPv4 address corresponding to the IPv6 address;
[0040] An ARP response generation module, configured to configure a corresponding IPv4 address for the IPv6 address of the service end in response to the ARP request, 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 initiates access to the service end based on the IPv4 address of the service end.
[0042] An embodiment of the present invention further provides a network access device, comprising a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor implements any one of the network access methods described above when executing the computer program.
[0043] An embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium includes a stored computer program, wherein when the computer program is executed, the device where the computer-readable storage medium is located is controlled to execute any one of the network access methods described above.
[0044] An embodiment of the present invention further provides a computer program product, which includes a computer program or a computer instruction. When the computer program or the computer instruction is executed by a processor, the network access method as described in any one of the above is implemented.
[0045] Compared with the prior art, the network access method, apparatus, device, storage medium and program product disclosed in the present invention extend the ARP protocol to implement NAT46 conversion of the destination address. When a terminal with an IPv4 address needs to access a service end with an IPv6 address, an ARP request is initiated to the NAT46 module. The NAT46 module configures a corresponding IPv4 address for the IPv6 address of the service end and returns it to the terminal. The terminal initiates access to the service end based on the IPv4 address of the service end, and does not need to rely on the DNS46 function. It can directly access the IPv6 address, thereby achieving normal access to the service end and effectively improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] Figure 1 This is a schematic diagram of the principle of NAT46 conversion scenario;
[0047] Figure 2 It is a schematic diagram of the access process of the NAT46 conversion scenario in the prior art;
[0048] Figure 3 It is a flowchart of a network access method provided by an embodiment of the present invention;
[0049] Figure 4 It is a schematic diagram of the existing ARP protocol message format;
[0050] Figure 5 is a schematic diagram of an extended ARP protocol message format in an embodiment of the present invention;
[0051] Figure 6 It is a flowchart of a preferred network access method in an embodiment of the present invention;
[0052] Figure 7 It is a flowchart of another network access method provided by an embodiment of the present invention;
[0053] Figure 8 It is a structural diagram of a network access device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0054] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0055] In the description of the present application, it should be understood that the terms "center", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside", etc., indicating orientations or positional relationships, are based on the orientations or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be understood as a limitation on the present application.
[0056] The terms "first" and "second" are used for descriptive purposes only and should not 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. In the description of this application, unless otherwise specified, "plurality" means two or more.
[0057] It should be noted that the embodiment of the present invention is applied to the NAT46 conversion scenario. In the fixed network scenario, the address translation module NAT46 can be deployed on the customer terminal equipment CPE. In the mobile scenario, the NAT46 module can be deployed on the terminal. The embodiment of the present invention is applicable to both the fixed network scenario and the mobile scenario. The embodiment of the present invention takes the fixed network scenario as an example for explanation. Figure 1 , is a schematic diagram of the principle of the NAT46 conversion scenario, in which the network and service server sides have been upgraded to IPv6 single stack, and the terminal side is assigned an IPv4 address. When the terminal side wants to access the IPv6 service server, the home gateway CPE needs to perform NAT46 conversion to complete the terminal's access to the IPv6 network and service server.
[0058] See also Figure 2, is a schematic diagram of the access process of the NAT46 conversion scenario in the prior art. The prior art needs to rely on the DNS46 function to complete the NAT46 conversion of the destination address. Specifically, when the terminal needs to access the service server 1, the terminal initiates a DNS4 request. After the CPE obtains the request message, the DNS46 function of the CPE converts the DNS4 request into a DNS6 request. The CPE receives the AAAA record carrying the IPv6 address of the service server 1 returned by the DNS server, and performs stateful NAT46 conversion on the IPv6 address, that is: based on the previously configured IPv4 address pool, generate and save the NAT46 conversion table entry for the service server 1 (service server 1-IPv4 address <-> service server 1-IPv6 address). The CPE sends the converted service server IPv4 address to the terminal through DNS4. The terminal uses this address as the destination address to initiate data plane IPv4 access, and performs NAT46 conversion after reaching the CPE, including: performing stateless NAT46 conversion 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; performing stateful NAT46 conversion on the destination address, that is, using the previous stateful NAT46 conversion table entry for conversion, thereby initiating data plane IPv6 access and enabling the terminal to access business server 1.
[0059] However, in the scenario where the application on the terminal directly accesses the IPv6 address without using DNS, the terminal application will not be able to access successfully because it cannot complete the NAT46 conversion of the destination address with the help of DNS46. In order to solve the above problem, an embodiment of the present invention provides a network access method, see Figure 3 , is a flow chart of a network access method provided by an embodiment of the present invention, the method is applied to the terminal side, and the method includes steps S11 to S13:
[0060] S11. In response to the access demand for the service end, 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 end, the extended ARP protocol type is used to implement the mapping of the IPv6 address to the IPv4 address, and the ARP request is used to request the IPv4 address corresponding to the IPv6 address;
[0061] S12, receiving an ARP response returned by the address translation module; wherein the ARP response includes the IPv6 address of the service end and the corresponding configured IPv4 address of the service end;
[0062] S13. Initiate access to the service end based on the IPv4 address of the service end.
[0063] In the embodiment of the present invention, the conversion from IPv6 address to IPv4 address is implemented by extending the ARP (Address Resolution Protocol) protocol to complete the NAT46 conversion of the destination address.
[0064] It should be noted that see Figure 4 , is a schematic diagram of the existing ARP protocol message format. The current ARP protocol can convert IPv4 addresses into hardware addresses (MAC addresses) required by various networks, that is, 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 also Figure 5 , is a schematic diagram of the extended ARP protocol message format in an embodiment of the present invention. The embodiment of the present invention extends the protocol type based on the current ARP protocol and defines a new protocol type: IPv4&IPv6 protocol, which means that it contains both IPv4 address and IPv6 address, and the type value is assumed to be 0xFFFE. When the protocol type is IPv4&IPv6 protocol, the protocol address length is 160 bits (32 bits + 128 bits). In addition, the operation code of the extended ARP protocol is defined as NAT46 Request and NAT46 Reply, where NAT46Request: The assumed value is 0x00FE, which means requesting the IPv4 address corresponding to a certain IPv6 address in the ARP protocol to complete the subsequent NAT46 conversion. NAT46 Reply: The assumed value is 0x00FF, which means replying to the IPv4 address corresponding to the IPv6 address in the ARP protocol.
[0066] After the ARP protocol is extended, the terminal with an IPv4 address can directly access the service end with an IPv6 address. For details, see Figure 6, is a flowchart of a preferred network access method in an embodiment of the present invention. Taking the NAT46 module deployed on the customer terminal device CPE as an example, it is assumed that the IPv4 address of the terminal is the IPv4 private address 1, and the MAC address of the customer terminal device CPE is MAC2. When the terminal has a request to access the service end, the terminal sends an ARP request to the customer terminal device CPE, the protocol type is the extended APR protocol type IPv4&IPv6, the protocol length is 160 bits, the operation code is NAT46Request, and it also includes the IPv6 address of the service end, assuming it is 2001::1, requesting the customer terminal device CPE to generate a corresponding IPv4 address for the IPv6 address 2001::1 of the service end. The customer terminal device CPE finds that the operation code is NAT46Request, then responds to the request, configures a corresponding IPv4 address for the IPv6 address 2001::1, assuming it is 192.168.1.100, and generates an ARP response. The customer 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, informing the terminal that the IPv4 address corresponding to the IPv6 address 2001::1 is 192.168.1.100.
[0067] Preferably, the step of the address conversion module generating an ARP response is: selecting a target IPv4 address from a preset address pool and configuring it as the IPv4 address of the service end; generating an ARP response according to the IPv6 address of the service end and the corresponding configured IPv4 address of the service end.
[0068] That is, after receiving the ARP request, the customer terminal equipment CPE 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 according to the IPv4 address of the service end, with the source address being the terminal's IPv4 private address 1 and the destination address being the service end's IPv4 address 192.168.1.100.
[0070] Preferably, after receiving the ARP response returned by the address translation module, the method further comprises step S14:
[0071] S14: Generate a mapping relationship between the IPv6 address of the service end and the IPv4 address of the service end, and update it in the ARP table entry.
[0072] In an embodiment of the present invention, after receiving the ARP response, the terminal generates an ARP table entry, in which the ARP table entry stores the mapping relationship between the IPv6 address and the IPv4 address, as well as the IPv4 address and the MAC address, specifically including the IPv6-IPv4 corresponding table entry: 192.168.1.100<->MAC2 and the IPv6-MAC corresponding table entry: 2001::1<->MAC2, so that when the terminal needs to access the service end again in the future, it can directly initiate an access request by querying the IPv4 address corresponding to the IPv6 address of the service end stored in the ARP table entry.
[0073] As a preferred implementation, in step S11, that is, before initiating an ARP request to the address translation module, the method further includes:
[0074] In response to the access demand for the service end, searching whether the IPv4 address corresponding to the IPv6 address of the service end is stored in a preset ARP table entry;
[0075] When the IPv4 address corresponding to the IPv6 address of the service end is not stored in the ARP table entry, an ARP request is initiated to the address conversion module.
[0076] When the IPv4 address corresponding to the IPv6 address of the service end is stored in the ARP table entry, access to the service end is initiated based on the IPv4 address of the service end.
[0077] That is, in the embodiment of the present invention, when the terminal has a request to access the service end, the terminal first queries whether the ARP table entry stores the IPv4 address of the service end. If the IPv4 address of the service end is found to be stored, there is no need to initiate an ARP request to the customer terminal equipment CPE, but directly use the IPv4 address of the service end for data plane IPv4 access. If the IPv4 address of the service end is not found to be stored, an ARP request needs to be initiated to the customer terminal equipment CPE to request the customer terminal equipment CPE to configure the corresponding IPv4 address.
[0078] Preferably, step S13, i.e., initiating access to the service end based on the IPv4 address of the service end, includes:
[0079] Generate a first access request; wherein the first access request is used to request access to the service end, the source address included in the first access request is the IPv4 address of the terminal, and the destination address is the IPv4 address of the service end;
[0080] The first access request is sent to the address conversion module, so that the address conversion module converts the source address into the IPv6 address of the terminal, converts the destination address into the IPv6 address of the service end, and initiates access to the service end.
[0081] In the embodiment of the present invention, Figure 6 As shown, after receiving or querying the IPv4 address of the service end, the terminal initiates a first access request to the customer terminal equipment CPE to perform data plane IPv4 access, the source address is IPv4 private address 1, and the destination address is 192.168.1.100. The customer terminal equipment CPE performs NAT46 conversion, converts the source address to the IPv6 address of the terminal, and converts the destination address to the IPv6 address of the service end. Among them, the customer terminal equipment CPE can use the existing stateless NAT46 conversion method for the conversion of the source address. Assuming that the LAN side IPv6 prefix assigned by the CPE is IPv6Prefix, the source address is converted to IPv6Prefix::IPv4 private address 1. The customer terminal equipment CPE converts the destination address according to the mapping relationship, that is, the destination address is converted to 2001::1. After the customer terminal equipment CPE completes the address translation, it generates a second access request for IPv6 data plane access, with the source address being IPv6Prefix::IPv4 private address 1 and the destination address being 2001::1, and initiates access to the service end.
[0082] By adopting the technical means of the embodiments of the present invention, the ARP protocol is extended to implement NAT46 conversion of the destination address. When a terminal with an IPv4 address needs to access a service end with an IPv6 address, an ARP request is initiated to the NAT46 module. The NAT46 module configures a corresponding IPv4 address for the IPv6 address of the service end and returns it to the terminal, so that the terminal initiates access to the service end based on the IPv4 address of the service end. It does not need to rely on the DNS46 function and can directly access the IPv6 address, thereby achieving normal access to the service end and effectively improving the user experience.
[0083] See also Figure 7 , is a flow chart of another network access method provided by an embodiment of the present invention. The embodiment of the present invention provides another network access method, which is applied to an address translation module. The method includes steps S21 to S23:
[0084] S21. Receive an ARP request initiated by a terminal; wherein the ARP request includes an extended ARP protocol type and an IPv6 address of a service end that the terminal needs to access, the extended ARP protocol type is used to implement mapping of an IPv6 address to an IPv4 address, and the ARP request is used to request an IPv4 address corresponding to the IPv6 address;
[0085] S22. In response to the ARP request, configure a corresponding IPv4 address for the IPv6 address of the service end, and generate an ARP response;
[0086] S23. Return the ARP response to the terminal, so that the terminal initiates access to the service end based on the IPv4 address of the service end.
[0087] In the embodiment of the present invention, the protocol type is extended on the basis of the current ARP protocol, and a new protocol type is defined: IPv4&IPv6 protocol, assuming that the type value is 0xFFFE, the protocol address length = 160bit (32bit+128bit), and the operation code is defined as NAT46 Request and NAT46 Reply, wherein, NAT46 Request: the assumed value is 0x00FE, which means requesting the IPv4 address corresponding to a certain IPv6 address in the ARP protocol to complete the subsequent NAT46 conversion. NAT46 Reply: the assumed value is 0x00FF, which means replying the IPv4 address corresponding to the IPv6 address in the ARP protocol.
[0088] After the ARP protocol is extended, the terminal with an IPv4 address can directly access the service end with an IPv6 address. Take the address translation module NAT46 deployed on the customer terminal device CPE as an example, assuming that the IPv4 address of the terminal is IPv4 private address 1, and the MAC address of the customer terminal device CPE is MAC2. When the terminal has a request to access the service end, the terminal sends an ARP request to the customer terminal device 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 IPv6 address of the service end, assuming it is 2001::1, requesting the customer terminal device CPE to generate a corresponding IPv4 address for the IPv6 address 2001::1 of the service end. If the customer terminal device CPE finds that the operation code is NAT46 Request, it responds to the request, configures the corresponding IPv4 address for the IPv6 address 2001::1, assuming it is 192.168.1.100, and generates an ARP response. The customer 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, informing the terminal that the IPv4 address corresponding to the IPv6 address 2001::1 is 192.168.1.100.
[0089] Furthermore, after receiving the ARP response, the terminal can perform data plane IPv4 access according to the IPv4 address of the service end, with the source address being the terminal's IPv4 private address 1, and the destination address being the service end's IPv4 address 192.168.1.100. Moreover, after receiving the ARP response, the terminal generates an ARP table entry, in which the mapping relationship between the IPv6 address and the IPv4 address, as well as the IPv4 address and the MAC address is stored, specifically including the IPv6-IPv4 corresponding table entry: 192.168.1.100<->MAC2 and the IPv6-MAC corresponding table entry: 2001::1<->MAC2, so that when the terminal needs to access the service end again in the future, it can directly initiate an access request by querying the IPv4 address corresponding to the IPv6 address of the service end that has been stored in the ARP table entry.
[0090] Preferably, step S22, i.e., in response to the ARP request, configuring a corresponding IPv4 address for the IPv6 address of the service end and generating an ARP response, includes:
[0091] In response to the ARP request, selecting a target IPv4 address from a preset address pool and configuring it as the IPv4 address of the service end;
[0092] An ARP response is generated according to the IPv6 address of the service end and the corresponding configured IPv4 address of the service end.
[0093] That is, after receiving the ARP request, the customer terminal equipment CPE 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 end, and the source address included in the first access request is the IPv4 address of the terminal, and the destination address is the IPv4 address of the service end;
[0096] Convert the source address into the IPv6 address of the terminal, convert the destination address into the IPv6 address of the service end, and generate a second access request for requesting access to the service end;
[0097] Send the second access request to the service end.
[0098] Preferably, converting the source address into the IPv6 address of the terminal and converting the destination address into the IPv6 address of the service end comprises:
[0099] Adding a preset IPv6 prefix to the IPv4 address of the terminal to convert the IPv6 address of the terminal into the IPv6 address of the terminal as the source address;
[0100] According to the mapping between the IPv6 address and the IPv4 address, the IPv4 address of the service end is converted into the IPv6 address of the service end as the destination address.
[0101] Specifically, after receiving or querying the IPv4 address of the service end, the terminal initiates a first access request to the customer terminal equipment CPE to perform data plane IPv4 access, with the source address being IPv4 private address 1 and the destination address being 192.168.1.100. The customer terminal equipment CPE performs NAT46 conversion, converting the source address to the IPv6 address of the terminal and converting the destination address to the IPv6 address of the service end. Among them, the customer terminal equipment CPE may use the existing stateless NAT46 conversion method for converting the source address. Assuming that the LAN side IPv6 prefix assigned by the CPE is IPv6Prefix, the source address is converted to IPv6Prefix::IPv4 private address 1. The customer terminal equipment CPE converts the destination address according to the mapping relationship, that is, the target address is 2001::1. After the customer terminal equipment CPE completes the address translation, it generates a second access request for IPv6 data plane access, with the source address being IPv6Prefix::IPv4 private address 1 and the destination address being 2001::1, and initiates access to the service end.
[0102] It should be noted that the network access method applied to the address translation module provided in the embodiment of the present invention corresponds one-to-one to all the process steps of the network access method applied to the terminal side in the above embodiment, and the working principles and beneficial effects of the two are the same, so they will not be repeated here.
[0103] By adopting the technical means of the embodiments of the present invention, the ARP protocol is extended to implement NAT46 conversion of the destination address. When a terminal with an IPv4 address needs to access a service end with an IPv6 address, an ARP request is initiated to the NAT46 module. The NAT46 module configures a corresponding IPv4 address for the IPv6 address of the service end and returns it to the terminal, so that the terminal initiates access to the service end based on the IPv4 address of the service end. It does not need to rely on the DNS46 function and can directly access the IPv6 address, thereby achieving normal access to the service end and effectively improving the user experience.
[0104] The embodiment of the present invention further provides a network access device, which is applied to a terminal side, and the device includes:
[0105] An ARP request sending module is used to initiate an ARP request to the address translation module in response to an access demand for the service end; wherein the ARP request includes an extended ARP protocol type and an IPv6 address of the service end, the extended ARP protocol type is used to implement a mapping of an IPv6 address to an IPv4 address, and the ARP request is used to request an IPv4 address corresponding to the IPv6 address;
[0106] An ARP response receiving module, used to receive the ARP response returned by the address conversion module; wherein the ARP response includes the IPv6 address of the service end and the corresponding configured IPv4 address of the service end;
[0107] A service end access module is used to initiate access to the service end based on the IPv4 address of the service end.
[0108] It should be noted that a network access device provided in an embodiment of the present invention is used to execute all process steps of a network access method applied to the terminal side in the above embodiment, and the working principles and beneficial effects of the two correspond one to one, so they will not be repeated.
[0109] The embodiment of the present invention further provides another network access device, which is applied to an address conversion module, and the device includes:
[0110] An ARP request receiving module, configured to receive an ARP request initiated by a terminal; wherein the ARP request includes an extended ARP protocol type and an IPv6 address of a service end to be accessed by the terminal, the extended ARP protocol type is used to implement mapping of an IPv6 address to an IPv4 address, and the ARP request is used to request an IPv4 address corresponding to the IPv6 address;
[0111] An ARP response generation module, configured to configure a corresponding IPv4 address for the IPv6 address of the service end in response to the ARP request, 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 initiates access to the service end based on the IPv4 address of the service end.
[0113] It should be noted that a network access device provided in an embodiment of the present invention is used to execute all process steps of a network access method applied to an address translation module in the above embodiment, and the working principles and beneficial effects of the two correspond one to one, so they will not be repeated.
[0114] See also Figure 8 , is a structural diagram of a network access device provided in an embodiment of the present invention. The embodiment of 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, the network access method described in any one of the above embodiments is implemented.
[0115] An embodiment of the present invention further provides a computer-readable storage medium, which includes a stored computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute the network access method as described in any one of the above embodiments.
[0116] An embodiment of the present invention further provides a computer program product, which includes a computer program or a computer instruction. When the computer program or the computer instruction is executed by a processor, the network access method as described in any one of the above embodiments is implemented.
[0117] A person skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.
[0118] The above is a preferred embodiment of the present invention. It should be pointed out that a person skilled in the art can make several improvements and modifications without departing from the principle of the present invention. 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 demand for the service end, 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 end, the extended ARP protocol type is used to implement the mapping of the IPv6 address to the IPv4 address, and the ARP request is used to request the IPv4 address corresponding to the IPv6 address; Receive an ARP response returned by the address translation module; wherein the ARP response includes the IPv6 address of the service end and the corresponding configured IPv4 address of the service end; Initiate access to the service end based on the IPv4 address of the service end.
2. The network access method according to claim 1, characterized in that: Before initiating the ARP request to the address translation module, the method further includes: In response to the access demand for the service end, searching whether the IPv4 address corresponding to the IPv6 address of the service end is stored in a preset ARP table entry; When the IPv4 address corresponding to the IPv6 address of the service end is not stored in the ARP table entry, an ARP request is initiated to the address conversion module.
3. The network access method according to 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 of the service end and the IPv4 address of the service end, and update it in the ARP table entry.
4. The network access method according to claim 2 or 3, characterized in that: After searching the preset ARP table entry to determine whether the IPv4 address corresponding to the IPv6 address of the service end is stored, the method further includes: When the IPv4 address corresponding to the IPv6 address of the service end is stored in the ARP table entry, access to the service end is initiated based on the IPv4 address of the service end.
5. The network access method according to claim 1, characterized in that: The initiating access to the service end based on the IPv4 address of the service end includes: Generate a first access request; wherein the first access request is used to request access to the service end, the source address included in the first access request is the IPv4 address of the terminal, and the destination address is the IPv4 address of the service end; The first access request is sent to the address conversion module, so that the address conversion module converts the source address into the IPv6 address of the terminal, converts the destination address into the IPv6 address of the service end, and initiates access to the service end.
6. A network access method, characterized in that: Applied to the address translation module, the method comprises: Receiving an ARP request initiated by a terminal; wherein the ARP request includes an extended ARP protocol type and an IPv6 address of a service end that the terminal needs to access, the extended ARP protocol type is used to implement mapping of an IPv6 address to an IPv4 address, and the ARP request is used to request an IPv4 address corresponding to the IPv6 address; In response to the ARP request, configuring a corresponding IPv4 address for the IPv6 address of the service end, and generating an ARP response; The ARP response is returned to the terminal, so that the terminal initiates access to the service end based on the IPv4 address of the service end.
7. The network access method according to claim 6, characterized in that: The step of configuring a corresponding IPv4 address for the IPv6 address of the service end in response to the ARP request and generating an ARP response includes: In response to the ARP request, selecting a target IPv4 address from a preset address pool and configuring it as the IPv4 address of the service end; An ARP response is generated according to the IPv6 address of the service end and the corresponding configured IPv4 address of the service end.
8. The network access method according to 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 end, and the source address included in the first access request is the IPv4 address of the terminal, and the destination address is the IPv4 address of the service end; Convert the source address into the IPv6 address of the terminal, convert the destination address into the IPv6 address of the service end, and generate a second access request for requesting access to the service end; Send the second access request to the service end.
9. The network access method according to claim 8, characterized in that: The converting the source address into the IPv6 address of the terminal and converting the destination address into the IPv6 address of the service end includes: Adding a preset IPv6 prefix to the IPv4 address of the terminal to convert the IPv6 address of the terminal into the IPv6 address of the terminal as the source address; According to the mapping between the IPv6 address and the IPv4 address, the IPv4 address of the service end is converted into the IPv6 address of the service end as the destination address.
10. A network access device, characterized in that: Applied to the terminal side, the device includes: An ARP request sending module is used to initiate an ARP request to the address translation module in response to an access demand for the service end; wherein the ARP request includes an extended ARP protocol type and an IPv6 address of the service end, the extended ARP protocol type is used to implement a mapping of an IPv6 address to an IPv4 address, and the ARP request is used to request an IPv4 address corresponding to the IPv6 address; An ARP response receiving module, used to receive the ARP response returned by the address conversion module; wherein the ARP response includes the IPv6 address of the service end and the corresponding configured IPv4 address of the service end; A service end access module is used to initiate access to the service end based on the IPv4 address of the service end.
11. A network access device, characterized in that: Applied to an address conversion module, the device comprises: An ARP request receiving module, configured to receive an ARP request initiated by a terminal; wherein the ARP request includes an extended ARP protocol type and an IPv6 address of a service end to be accessed by the terminal, the extended ARP protocol type is used to implement mapping of an IPv6 address to an IPv4 address, and the ARP request is used to request an IPv4 address corresponding to the IPv6 address; An ARP response generation module, configured to configure a corresponding IPv4 address for the IPv6 address of the service end in response to the ARP request, and generate an ARP response; The ARP response sending module is used to return the ARP response to the terminal, so that the terminal initiates access to the service end based on the IPv4 address of the service end.
12. A network access device, characterized in that: The method comprises a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor implements the network access method according to any one of claims 1 to 9 when executing the computer program.
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, the device where the computer-readable storage medium is located is controlled to execute the network access method according to any one of claims 1 to 9.
14. A computer program product, characterized in that The computer program product comprises a computer program or a computer instruction, and when the computer program or the computer instruction is executed by a processor, the network access method according to any one of claims 1 to 9 is implemented.
Citation Information
Patent Citations
Route updating method and device
CN111953607A
Intelligent network card and method for supporting IPv6 through intelligent network card
CN115499408A
Address resolution broadcasting in a networked device
US10516645B1
Stateless Protocol Translation
US20130235871A1
Address Resolution System
US20200244617A1
