Network dial-up method, device, computer equipment and storage medium
By introducing virtual dial-up ports and virtual physical addresses into terminal equipment, the problem of IP address changes when terminal equipment switches between fixed line and 5G wireless access methods is solved, ensuring the consistency of IP addresses and business continuity after the access method is switched. sex.
Patent Information
- Application Number
- CN202410874501.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-02
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2044-07-02
AI Technical Summary
In fields such as remote industrial control and webcasting, when terminal equipment switches between fixed lines and 5G wireless access methods, the user's IP address changes, resulting in service interruptions and unavailable functions.
Introduce a virtual dial-up port and virtual physical address into the terminal device, and use the virtual dial-up port to maintain the same virtual physical address when switching between fixed network card and wireless network card access modes, ensuring that the access server can allocate the same IP address.
It realizes that the IP address obtained by the terminal remains unchanged before and after the access mode is switched, ensuring the reliability of the access and the continuity of the business, and meeting the needs of IP-sensitive applications.
Smart Images

Figure CN118432967B
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a network dial-up method, apparatus, computer equipment, storage medium and computer program product. Background Art
[0002] In many fields such as remote industrial control and live streaming, in order to improve business reliability, terminals that support both fixed and wireless access methods (such as 5G) have been introduced on the user side. Generally, fixed (wired) lines are used to access the network, and then switched to the 5G wireless access network when the fixed line fails.
[0003] However, in the current common dial-up scenario, users dial to the Broadband Remote Access Server (BRAS) through fixed lines and to the UPF (User Plane Function) through 5G. Therefore, the user's IP address will change before and after switching between the two access methods, causing service interruption or even unavailability of some functions. Summary of the invention
[0004] Based on this, it is necessary to provide a network dial-up method, apparatus, computer equipment, computer-readable storage medium and computer program product to address the technical problem that the user's IP address changes due to access mode switching, which affects business operations.
[0005] In a first aspect, the present application provides a network dial-up method, which is applied to a terminal, wherein the terminal is provided with a fixed network card dial-up port, a wireless network card dial-up port, and a virtual dial-up port, wherein the fixed network card dial-up port, the wireless network card dial-up port, and the virtual dial-up port correspond to a first physical address, a second physical address, and a third physical address, respectively. The method comprises:
[0006] When the dial-up channel of the fixed network card dial-up port is normal, dialing is performed through the virtual dial-up port, and a first message is sent to the access server through the fixed network card dial-up port; the first message is encapsulated with a third physical address corresponding to the virtual dial-up port;
[0007] In the case of a dial-up channel failure of the fixed network card dial-up port, dialing is performed through the virtual dial-up port, and a second message is sent to the access server through the wireless network card dial-up port; the second message is encapsulated with a third physical address corresponding to the virtual dial-up port;
[0008] The access server is used to allocate an IP address to the terminal according to the third physical address in the first message or the second message.
[0009] In one embodiment, after dialing through the virtual dial-up port and before sending the first message to the access server through the fixed network card dial-up port, the method further includes:
[0010] Encapsulating the third physical address corresponding to the virtual dial-up port to generate an initial first message;
[0011] The initial first message is routed to a fixed network card, and a new header is encapsulated in the outer layer of the initial first message by the fixed network card to obtain the first message; the new header encapsulates the first physical address corresponding to the dial-up port of the fixed network card.
[0012] In one embodiment, the encapsulating the third physical address corresponding to the virtual dial-up port to generate the initial first message includes:
[0013] Encapsulating the third physical address in a header of the initial first message to generate the initial first message;
[0014] The method further comprises:
[0015] In the process of sending the first message to the access server, devices involved along the way replace the physical address based on the first physical address in the outer header of the first message.
[0016] In one embodiment, after dialing through the virtual dial-up port and before sending the second message to the access server through the wireless network card dial-up port, the method further includes:
[0017] Encapsulating the third physical address corresponding to the virtual dial-up port to generate an initial second message;
[0018] The initial second message is routed to the wireless network card, and a new header is encapsulated in the outer layer of the initial second message by the wireless network card to obtain the second message; the new header encapsulates the second physical address corresponding to the dial-up port of the wireless network card.
[0019] In one embodiment, the encapsulating the third physical address corresponding to the virtual dial-up port to generate the initial second message includes:
[0020] Encapsulating the third physical address in a header of the initial second message to generate the initial second message;
[0021] The method further comprises:
[0022] In the process of sending the second message to the access server, devices involved along the way replace the physical address based on the second physical address in the outer header of the second message.
[0023] In one embodiment, the first message and the second message both have two layers of headers, and the third physical address is encapsulated in an inner header; the first physical address corresponding to the fixed network card dial-up port is encapsulated in an outer header of the first message; the second physical address corresponding to the wireless network card dial-up port is encapsulated in an outer header of the second message;
[0024] The server is further used to strip off the outer header of the first message or the second message to obtain the third physical address encapsulated in the inner header.
[0025] In a second aspect, the present application further provides a network dial-up device, which is deployed in a terminal, wherein the terminal is provided with a fixed network card dial-up port, a wireless network card dial-up port, and a virtual dial-up port, wherein the fixed network card dial-up port, the wireless network card dial-up port, and the virtual dial-up port correspond to a first physical address, a second physical address, and a third physical address, respectively. The device comprises:
[0026] A first dialing module, configured to dial through the virtual dialing port when the dialing channel of the fixed network card dialing port is normal, and send a first message to the access server through the fixed network card dialing port; the first message is encapsulated with a third physical address corresponding to the virtual dialing port;
[0027] A second dial-up module is used to dial through the virtual dial-up port when the dial-up channel of the fixed network card dial-up port fails, and send a second message to the access server through the wireless network card dial-up port; the second message is encapsulated with a third physical address corresponding to the virtual dial-up port;
[0028] The access server is used to allocate an IP address to the terminal according to the third physical address in the first message or the second message.
[0029] In a third aspect, the present application further provides a computer device. The computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program:
[0030] When the dial-up channel of the fixed network card dial-up port is normal, dialing is performed through the virtual dial-up port, and a first message is sent to the access server through the fixed network card dial-up port; the first message is encapsulated with a third physical address corresponding to the virtual dial-up port;
[0031] In the case of a dial-up channel failure of the fixed network card dial-up port, dialing is performed through the virtual dial-up port, and a second message is sent to the access server through the wireless network card dial-up port; the second message is encapsulated with a third physical address corresponding to the virtual dial-up port;
[0032] The access server is used to allocate an IP address to the terminal according to the third physical address in the first message or the second message.
[0033] In a fourth aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0034] When the dial-up channel of the fixed network card dial-up port is normal, dialing is performed through the virtual dial-up port, and a first message is sent to the access server through the fixed network card dial-up port; the first message is encapsulated with a third physical address corresponding to the virtual dial-up port;
[0035] In the case of a dial-up channel failure of the fixed network card dial-up port, dialing is performed through the virtual dial-up port, and a second message is sent to the access server through the wireless network card dial-up port; the second message is encapsulated with a third physical address corresponding to the virtual dial-up port;
[0036] The access server is used to allocate an IP address to the terminal according to the third physical address in the first message or the second message.
[0037] In a fifth aspect, the present application further provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0038] When the dial-up channel of the fixed network card dial-up port is normal, dialing is performed through the virtual dial-up port, and a first message is sent to the access server through the fixed network card dial-up port; the first message is encapsulated with a third physical address corresponding to the virtual dial-up port;
[0039] In the case of a dial-up channel failure of the fixed network card dial-up port, dialing is performed through the virtual dial-up port, and a second message is sent to the access server through the wireless network card dial-up port; the second message is encapsulated with a third physical address corresponding to the virtual dial-up port;
[0040] The access server is used to allocate an IP address to the terminal according to the third physical address in the first message or the second message.
[0041] The above-mentioned network dial-up method, device, computer equipment, storage medium and computer program product, by adding a virtual dial-up port and a virtual third physical address in the terminal, can dial through the same virtual dial-up port before and after the switching of the fixed network card and the wireless network card access mode, and the same third physical address can be encapsulated in the message sent to the access server, so that the access server can assign the same IP address after parsing the same third physical address, thereby ensuring that the IP address obtained by the terminal before and after the access mode is switched remains unchanged, solving the problem of inconsistent IP addresses in multiple dial-up access scenarios of a terminal, ensuring access reliability and business continuity, and meeting the requirements of uninterrupted business and service continuity of IP-sensitive applications (such as live broadcast drainage, industrial control, etc.). BRIEF DESCRIPTION OF THE DRAWINGS
[0042] Figure 1 The figure is a schematic diagram of the implementation principle of a terminal supporting both fixed access mode and 5G access mode in an embodiment;
[0043] Figure 2 A diagram of an application environment of a network dial-up method in an embodiment;
[0044] Figure 3 A schematic diagram of a flow chart of a network dialing method in one embodiment;
[0045] Figure 4 A schematic diagram of a two-layer encapsulation format of a first message on a fixed network card side in an embodiment;
[0046] Figure 5 is a schematic diagram of a two-layer encapsulation format of a second message on a wireless network card side in one embodiment;
[0047] Figure 6 A schematic diagram of an implementation mechanism of a terminal in the network dialing method of the present application in one embodiment;
[0048] Figure 7 is a structural block diagram of a network dial-up device in one embodiment;
[0049] Figure 8 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0050] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0051] It should be noted that the terms "first", "second", "third", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein.
[0052] In the fields of remote industrial control, online live broadcasting, etc., terminals that support both fixed and 5G access modes are introduced on the user side. Generally, fixed (wired) lines are preferred for network access, and then switched to 5G wireless access network when fixed lines fail. The dial-up server assigns addresses to users through DHCP (Dynamic Host Configuration Protocol, which allows the server to dynamically assign IP addresses and configuration information to clients). Address assignment and verification are based on the MAC address (Media Access Control Address, also known as physical address) in the header. However, the MAC of the fixed-side network card is different from the MAC of the 5G module. Even if the address is applied to the same dial-up server, different IP addresses will be assigned. For live broadcast services, video freezes will occur at this time, and the platform's traffic diversion algorithm (currently based on IP) will also fail; for industrial control or other remote real-time monitoring, IP address changes may also cause unpredictable results.
[0053] For ease of understanding, the following is a description of the implementation method and mechanism of a terminal that supports both fixed and 5G access modes:
[0054] like Figure 1 As shown, under normal circumstances, the terminal uses the fixed-side network card (NIC) for dialing as the primary path; after detecting a failure in the primary path, it switches to the 5G side for dialing as a backup path.
[0055] Under normal circumstances, traffic is dialed through the fixed-side network card (NIC), and the physical address of the network card is mac1. After the NIC is used as the dial-up port, the physical address in the main field of its encapsulation is mac1, the source MAC sent from the terminal to the access server is mac1, and the destination MAC sent from the access server to the terminal is mac1. The access server performs address allocation and subsequent data packet verification based on mac1. At this time, the IP address assigned by the access server to the terminal is set to IP1.
[0056] After the terminal detects that the fixed network card side channel has failed, it switches to the 5G side dial-up. At this time, the 5G card is used as the dial-up port for dialing. Its physical address is mac2, and the physical address in the main field of its encapsulation is mac2. The source MAC sent from the terminal to the access server is mac2, and the destination MAC sent from the access server to the terminal is mac2. The access server performs address allocation and subsequent data packet verification based on mac2. Since mac2 is inconsistent with mac1, the IP address assigned to the terminal by the access server is IP2 (another IP address different from IP1).
[0057] It can be seen that although the introduction of terminals that switch between fixed and 5G modes at the same time improves access reliability, due to the switching of IP addresses (IP1→IP2), it cannot meet the requirements of IP-sensitive applications (such as live streaming, industrial control, etc.).
[0058] To solve the above problems, this application proposes a method of adding a virtual dial-up port and a virtual physical address, dialing to the same access server through inner PPPoE encapsulation, and realizing the unchanged IP address during the switching process from fixed-side dial-up to 5G wireless-side dial-up. Among them, PPPoE (Point-to-Point Protocol Over Ethernet) is a point-to-point protocol on Ethernet, which is a network tunnel protocol that encapsulates the point-to-point protocol (PPP) in the Ethernet framework.
[0059] The network dialing method provided in the embodiment of the present application can be applied to Figure 2 In the application environment shown, the terminal 202 communicates with the access server 204 through the network. The data storage system can store the data that the access server 204 needs to process. The data storage system can be integrated on the access server 204, or placed on the cloud or other network servers.
[0060] A fixed network card dial-up port, a wireless network card dial-up port, and a virtual dial-up port are provided on the terminal 202. The fixed network card dial-up port, the wireless network card dial-up port, and the virtual dial-up port correspond to the first physical address, the second physical address, and the third physical address, respectively. When the dial-up channel of the fixed network card dial-up port is normal, the terminal 202 dials through the virtual dial-up port, and sends a first message encapsulating the third physical address corresponding to the virtual dial-up port to the access server 204 through the fixed network card dial-up port, so that the access server 204 allocates an IP address to the terminal 202 according to the third physical address in the first message. When the dial-up channel of the fixed network card dial-up port fails, the terminal 202 dials through the virtual dial-up port, and sends a second message encapsulating the third physical address corresponding to the virtual dial-up port to the access server 204 through the wireless network card dial-up port, so that the access server 204 allocates an IP address to the terminal 202 according to the third physical address in the second message. Therefore, before and after the switching between the fixed access mode and the wireless access mode, the access server 204 allocates an IP address to the terminal based on the third physical address corresponding to the virtual dial-up port, ensuring that the IP address remains unchanged before and after the switching between the two access modes.
[0061] The terminal 202 may be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, IoT devices, and portable wearable devices. The IoT devices may be smart speakers, smart TVs, smart air conditioners, smart car-mounted devices, etc. The portable wearable devices may be smart watches, smart bracelets, head-mounted devices, etc. The access server 204 may be implemented using an independent server or a server cluster consisting of multiple servers.
[0062] In one embodiment, Figure 3 As shown, a network dialing method is provided, which is applied to Figure 2 The terminal 202 in the example is used as an example to illustrate, and the following steps are included:
[0063] Step S310, when the dial-up channel of the fixed network card dial-up port is normal, dialing is performed through the virtual dial-up port, and a first message is sent to the access server through the fixed network card dial-up port; the first message is encapsulated with a third physical address corresponding to the virtual dial-up port.
[0064] Step S320, when the dial-up channel of the fixed network card dial-up port fails, dialing is performed through the virtual dial-up port, and a second message is sent to the access server through the wireless network card dial-up port; the second message is encapsulated with a third physical address corresponding to the virtual dial-up port.
[0065] The access server is used to allocate an IP address to the terminal according to the third physical address in the first message or the second message.
[0066] Among them, the fixed network card dial-up port and the wireless network card dial-up port represent the physical network ports on the terminal, and the wireless network card dial-up port includes the 5G network card dial-up port.
[0067] The first physical address, the second physical address and the third physical address are MAC (Media Access Control Address) addresses, which are used to identify the location of a network device.
[0068] In the specific implementation, firstly, a virtual dial-up port and a virtual physical address, i.e., the third physical address, are created in the terminal 202. The virtual dial-up port and the fixed network card dial-up port and the wireless network card dial-up port are all in routing mode. A layer 2 tunnel is established between the virtual dial-up port and the access server 204, and the routing will be iterated to the fixed network card dial-up port and the wireless network card dial-up port.
[0069] When the terminal 202 detects that the dial-up channel of the fixed network card dial-up port is normal, it dials through the virtual dial-up port, encapsulates the third physical address corresponding to the virtual dial-up port, obtains a first message, and sends the first message through the fixed network card dial-up port to the access server 204. After receiving the first message, the access server 204 can allocate an IP address to the terminal 202 according to the third physical address in the first message.
[0070] When the terminal 202 detects a dial-up channel failure of the fixed network card dial-up port, it is necessary to switch the access mode, that is, switch from the fixed mode to the wireless mode. At this time, the terminal 202 still dials through the virtual dial-up port, encapsulates the third physical address corresponding to the virtual dial-up port, obtains a second message, and sends the second message to the access server 204 through the wireless network card dial-up port. After receiving the second message, the access server 204 also allocates an IP address to the terminal 202 according to the third physical address in the second message. Since the access server 204 dials through the virtual dial-up port before and after the access mode is switched, the third physical address is used as the physical address of the terminal 202 in the first message and the second message finally encapsulated. Therefore, the IP address allocated based on the same third physical address remains unchanged.
[0071] In the above network dial-up method, by adding a virtual dial-up port and a virtual third physical address in the terminal, dialing can be performed through the same virtual dial-up port before and after the switching of the fixed network card and the wireless network card access mode, and the same third physical address can be encapsulated in the message sent to the access server, so that the access server can assign the same IP address after parsing the same third physical address, thereby ensuring that the IP address obtained by the terminal before and after the access mode is switched remains unchanged, solving the problem of inconsistent IP addresses in multiple dial-up access scenarios of a terminal, ensuring access reliability and business continuity, and meeting the requirements of uninterrupted business and service continuity of IP-sensitive applications (such as live broadcast drainage, industrial control, etc.).
[0072] In an exemplary embodiment, in the above step S310, after dialing through the virtual dial-up port and before sending the first message to the access server through the fixed network card dial-up port, the following steps are also included:
[0073] Step S311, encapsulating the third physical address corresponding to the virtual dial-up port to generate an initial first message;
[0074] Step S312, routing the initial first message to the fixed network card, encapsulating a new header on the outer layer of the initial first message through the fixed network card to obtain a first message; the new header encapsulates the first physical address corresponding to the dial-up port of the fixed network card.
[0075] In an exemplary embodiment, encapsulating the third physical address corresponding to the virtual dial-up port to generate an initial first message includes: encapsulating the third physical address in a header of the initial first message to generate the initial first message.
[0076] It can be understood that the virtual dial-up port is a virtual network port. When the dial-up channel of the fixed network card dial-up port is normal, when dialing through the virtual dial-up port and sending a message to the access server, the message must first be routed to the fixed network card and sent to the access server through the fixed network card dial-up port.
[0077] In the specific implementation, when the dial-up channel of the fixed network card dial-up port is normal, dialing through the virtual dial-up port is to perform point-to-point protocol (Point-to-Point Protocol Over Ethernet, PPPoE) dialing through the third physical address corresponding to the virtual dial-up port, dialing through the virtual dial-up port, and adding a second-layer tunnel header to obtain a first message, and sending the first message to the access server through the second-layer tunnel.
[0078] Specifically, dialing is performed through the virtual dial-up port, and the third physical address is encapsulated to generate an initial first message, specifically, the third physical address is encapsulated in the header of the initial first message. Then the initial first message is routed iteratively to the fixed network card, and the fixed network card encapsulates a new header in the outer layer of the initial first message based on the routing forwarding principle, that is, the first physical address corresponding to the dial-up port of the fixed network card itself is encapsulated in the new header, thereby obtaining the first message and forwarding it to the access server.
[0079] For example, Figure 4 As shown, it is a schematic diagram of the two-layer encapsulation format of the first message on the fixed network card side. In the inner layer of the first message, the encapsulated physical address is the third physical address corresponding to the virtual dial-up port, and in the outer header of the first message, the encapsulated physical address is the first physical address corresponding to the fixed network card dial-up port.
[0080] In this embodiment, a virtual dial-up port and a virtual third physical address are added to the user terminal, and the virtual third physical address and the PPPoE message are encapsulated in the second layer payload of the first message, so that the access server can resolve the same physical address to assign the same IP address.
[0081] Furthermore, in an exemplary embodiment, the network dial-up method further includes: in the process of sending the first message to the access server, the devices involved along the way replace the physical address based on the first physical address in the outer header of the first message.
[0082] Specifically, the third physical address is encapsulated in the inner layer message of the first message, and the fixed network card and the devices designed along the way forward the message and replace the physical address based on the first physical address in the outer layer header of the first message without affecting the third physical address in the inner layer message.
[0083] In this embodiment, in the process of sending the first message to the access server, the devices involved along the way replace the physical address based on the first physical address in the outer header of the first message without affecting the third physical address in the inner message, so that the access server can recognize the third physical address before and after the access mode is switched, and thus allocate an IP address to the terminal based on the same third physical address, ensuring that the IP address remains unchanged.
[0084] In an exemplary embodiment, in the above step S320, after dialing through the virtual dial-up port and before sending the second message to the access server through the wireless network card dial-up port, the method further includes:
[0085] Step S321, encapsulating the third physical address corresponding to the virtual dial-up port to generate an initial second message;
[0086] Step S322, routing the initial second message to the wireless network card, encapsulating a new header in the outer layer of the initial second message through the wireless network card to obtain a second message; the new header encapsulates the second physical address corresponding to the dial-up port of the wireless network card.
[0087] Further, in an exemplary embodiment, encapsulating the third physical address corresponding to the virtual dial-up port to generate the initial second message in the above step 321 includes: encapsulating the third physical address in a header of the initial second message to generate the initial second message.
[0088] It can be understood that the processing method is the same as that on the fixed network card side. After the access mode is switched to the wireless network card access mode, when dialing through the virtual dial-up port and sending a message to the access server, the message must also be routed to the wireless network card first, and then sent to the access server through the wireless network card dial-up port.
[0089] In the specific implementation, after the dial-up channel of the fixed network card dial-up port fails, the virtual dial-up port still dials based on the third physical address, but at this time the routing iteration will switch to the wireless network card, and the generated message will be recorded as the second message, which will be sent to the access server through the Layer 2 tunnel.
[0090] Specifically, dialing is performed through the virtual dial-up port, and the third physical address is encapsulated to generate an initial second message, specifically, the third physical address is encapsulated in the header of the initial second message. Then the initial second message is routed and iterated to the wireless network card. Based on the routing forwarding principle, the wireless network card encapsulates a new header in the outer layer of the initial second message, that is, the second physical address corresponding to the dial-up port of the wireless network card itself is encapsulated in the new header, thereby obtaining the second message and forwarding it to the access server.
[0091] For example, Figure 5 As shown, it is a schematic diagram of the two-layer encapsulation format of the second message on the wireless network card side. In the inner layer of the second message, the encapsulated physical address is the third physical address corresponding to the virtual dial-up port, and in the outer header of the second message, the encapsulated physical address is the second physical address corresponding to the wireless network card dial-up port.
[0092] In this embodiment, a virtual dial-up port and a virtual third physical address are added to the user terminal, and the virtual third physical address and the PPPoE message are encapsulated in the second layer payload of the second message, so that the access server can resolve the same physical address to assign the same IP address.
[0093] In an exemplary embodiment, the network dial-up method further includes: in the process of sending the second message to the access server, the devices involved along the way replace the physical address based on the second physical address in the outer header of the second message.
[0094] Specifically, the third physical address is encapsulated in the inner layer message of the second message, and the wireless network card and the devices designed along the way forward the message and replace the physical address based on the second physical address in the outer layer header of the second message without affecting the third physical address in the inner layer message.
[0095] In this embodiment, in the process of sending the second message to the access server, the devices involved along the way replace the physical address based on the second physical address in the outer header of the second message without affecting the third physical address in the inner message, so that the access server can recognize the third physical address before and after the access mode is switched, and thus allocate an IP address to the terminal based on the same third physical address, ensuring that the IP address remains unchanged.
[0096] In an exemplary embodiment, the first message and the second message both have two layers of headers, and the third physical address is encapsulated in the inner header; the first physical address corresponding to the fixed network card dial-up port is encapsulated in the outer header of the first message; the second physical address corresponding to the wireless network card dial-up port is encapsulated in the outer header of the second message;
[0097] The server is further used to strip the outer header of the first message or the second message to obtain the third physical address encapsulated in the inner header.
[0098] In the specific implementation, after receiving the first message, the access server detects that the outer address is itself, and processes the message, terminates the stripping of the second-layer tunnel header and parses the real PPPoE message in the load to obtain the inner physical address, thereby allocating IP addresses and verifying subsequent messages based on the inner physical address. Since the physical address of the inner message of the first message is the third physical address corresponding to the virtual dial-up port, it is set to allocate the virtual address IP1 to the terminal at this time.
[0099] After switching the access mode, the access server will receive the second message. Similarly, the access server will still process it as usual, stripping the Layer 2 tunnel header and parsing the real PPPoE message in the load to obtain the inner physical address, and perform address allocation and subsequent message verification based on the inner physical address. Because the physical address of the inner message of the second text is still the third physical address corresponding to the virtual dial-up port, the access server will allocate the same IP address as last time, i.e. IP1, to the terminal.
[0100] In this embodiment, by encapsulating the third physical address message corresponding to the virtual dial-up port in the second-layer payload of the message, the access server can identify the third physical address in the real message by stripping off the outer header before and after the access mode is switched, thereby allocating an IP address to the terminal based on the same third physical address to ensure that the IP address remains unchanged.
[0101] In an exemplary embodiment, multiple applications can be set up on the terminal, and a separate virtual dial-up port and virtual physical address (i.e., the third physical address corresponding to the virtual dial-up port) are created for each application; each application is independently isolated, and the fixed network card dial-up port and the wireless network card dial-up port are bundled and iterated for protection switching, so as to be suitable for scenarios where multiple users and multiple enterprises share access terminals, such as Internet celebrity bases and parks.
[0102] In one embodiment, in order to facilitate those skilled in the art to understand the embodiments of the present application, the following will be described with reference to specific examples of the accompanying drawings. Figure 6 , shows a schematic diagram of the implementation mechanism of the terminal in the network dial-up method of the present application. In this embodiment, the wireless network card is a 5G network card as an example for explanation.
[0103] First, add a virtual dial-up port and a virtual MAC (the third physical address, recorded as mac3) to the terminal, and set the fixed network card (NIC) and the 5G network card to routing mode. Establish a Layer 2 tunnel between the virtual dial-up port and the access server, and the routing will be iterated to the fixed network card dial-up port and the 5G network card dial-up port.
[0104] The virtual dial-up port performs PPPoE dial-up through mac3 and adds a Layer 2 tunnel header, which is sent to the access server through the Layer 2 tunnel. When the network on the fixed side is normal, the route is iterated to the fixed side network card, which sets the Layer 2 tunnel MAC address to its own mac1 (i.e., the first physical address) and forwards it. At this time, the source MAC of the inner layer message of the PPPoE format encapsulated message sent from the terminal is mac3.
[0105] After the access server terminates the Layer 2 tunnel header, it obtains the real PPPoE message and allocates the IP address based on the MAC address. At this time, the MAC of the inner message is the virtual address mac3, and IP1 is allocated to the terminal.
[0106] After the terminal detects that the fixed network card side channel has a fault, the route iterates to the 5G side network card. At this time, the PPPoE encapsulation inner source MAC sent by the 5G network card is still mac3.
[0107] The access server is also based on mac3 and allocates the same IP1 to the terminal.
[0108] In this embodiment, a virtual dial-up port and a virtual MAC address are added to the terminal on the user side that integrates the two access modes, and routing iteration is implemented with the real fixed and 5G physical network ports. A Layer 2 channel is established with the access server, and the virtual MAC address and PPPoE message can be encapsulated in the Layer 2 payload of the data packet. After parsing the same MAC address, the access server can assign the same IP address, thereby ensuring that the IP address obtained by the terminal during fixed-mobile switching remains unchanged, solving the problem of inconsistent IP addresses in multiple dial-up access scenarios of a terminal, and ensuring access reliability and business continuity.
[0109] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0110] Based on the same inventive concept, the embodiment of the present application also provides a network dialing device for implementing the network dialing method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations of one or more network dialing device embodiments provided below can refer to the limitations of the network dialing method above, and will not be repeated here.
[0111] In one embodiment, Figure 7 As shown, a network dial-up device is provided, which is deployed in a terminal. The terminal is provided with a fixed network card dial-up port, a wireless network card dial-up port and a virtual dial-up port. The fixed network card dial-up port, the wireless network card dial-up port and the virtual dial-up port correspond to a first physical address, a second physical address and a third physical address respectively; the device includes: a first dial-up module 710 and a second dial-up module 720, wherein:
[0112] The first dialing module 710 is used to dial through the virtual dialing port when the dialing channel of the fixed network card dialing port is normal, and send a first message to the access server through the fixed network card dialing port; the first message is encapsulated with a third physical address corresponding to the virtual dialing port;
[0113] The second dialing module 720 is used to dial through the virtual dialing port when the dialing channel of the fixed network card dialing port fails, and send a second message to the access server through the wireless network card dialing port; the second message is encapsulated with a third physical address corresponding to the virtual dialing port;
[0114] The access server is used to allocate an IP address to the terminal according to the third physical address in the first message or the second message.
[0115] In one of the embodiments, the first dial-up module 710 is also used to encapsulate the third physical address corresponding to the virtual dial-up port to generate an initial first message; route the initial first message to the fixed network card, and encapsulate a new header on the outer layer of the initial first message through the fixed network card to obtain the first message; the new header encapsulates the first physical address corresponding to the fixed network card dial-up port.
[0116] In one of the embodiments, the first dialing module 710 is also used to encapsulate the third physical address in the header of the initial first message to generate the initial first message; in the process of sending the first message to the access server, the devices involved along the way replace the physical address based on the first physical address in the outer header of the first message.
[0117] In one of the embodiments, the second dial-up module 720 is also used to encapsulate the third physical address corresponding to the virtual dial-up port to generate an initial second message; route the initial second message to the wireless network card, and encapsulate a new header on the outer layer of the initial second message through the wireless network card to obtain a second message; the new header encapsulates the second physical address corresponding to the dial-up port of the wireless network card.
[0118] In one of the embodiments, the second dialing module 720 is also used to encapsulate the third physical address in the header of the initial second message to generate the initial second message; in the process of sending the second message to the access server, the devices involved along the way replace the physical address based on the second physical address in the outer header of the second message.
[0119] In one of the embodiments, the first message and the second message both have two layers of headers, and the third physical address is encapsulated in the inner header; the first physical address corresponding to the fixed network card dial-up port is encapsulated in the outer header of the first message; the second physical address corresponding to the wireless network card dial-up port is encapsulated in the outer header of the second message; the server is also used to strip the outer header of the first message or the second message to obtain the third physical address encapsulated in the inner header.
[0120] Each module in the above network dial-up device can be implemented in whole or in part by software, hardware or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the corresponding operations of each module.
[0121] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Figure 8 As shown. The computer device includes a processor, a memory, a communication interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be achieved through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a network dialing method is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covered on the display screen, or a key, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse, etc.
[0122] Those skilled in the art will understand that Figure 8 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0123] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.
[0124] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0125] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0126] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.
[0127] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0128] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0129] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A network dial-up method, characterized in that: Applied to a terminal, the terminal is provided with a fixed network card dial-up port, a wireless network card dial-up port and a virtual dial-up port, the fixed network card dial-up port, the wireless network card dial-up port and the virtual dial-up port correspond to a first physical address, a second physical address and a third physical address respectively; the method comprises: When the dial-up channel of the fixed network card dial-up port is normal, dialing is performed through the virtual dial-up port, and a first message is sent to the access server through the fixed network card dial-up port; the first message is encapsulated with a third physical address corresponding to the virtual dial-up port; In the case of a dial-up channel failure of the fixed network card dial-up port, dialing is performed through the virtual dial-up port, and a second message is sent to the access server through the wireless network card dial-up port; the second message is encapsulated with a third physical address corresponding to the virtual dial-up port; The access server is used to allocate an IP address to the terminal according to the third physical address in the first message or the second message; After dialing through the virtual dial-up port and before sending the first message to the access server through the fixed network card dial-up port, the method further includes: Encapsulating the third physical address corresponding to the virtual dial-up port to generate an initial first message; wherein the third physical address is encapsulated in the header of the initial first message; Routing the initial first message to the fixed network card, encapsulating a new header in the outer layer of the initial first message through the fixed network card to obtain the first message; the new header encapsulates the first physical address corresponding to the dial-up port of the fixed network card; In the process of sending the first message to the access server, the devices involved along the way replace the physical address based on the first physical address in the outer header of the first message.
2. The method according to claim 1, characterized in that After dialing through the virtual dial-up port and before sending the second message to the access server through the wireless network card dial-up port, the method further includes: Encapsulating the third physical address corresponding to the virtual dial-up port to generate an initial second message; The initial second message is routed to the wireless network card, and a new header is encapsulated in the outer layer of the initial second message by the wireless network card to obtain the second message; the new header encapsulates the second physical address corresponding to the dial-up port of the wireless network card.
3. The method according to claim 2, characterized in that The encapsulating the third physical address corresponding to the virtual dial-up port to generate an initial second message includes: Encapsulating the third physical address in a header of the initial second message to generate the initial second message; The method further comprises: In the process of sending the second message to the access server, devices involved along the way replace the physical address based on the second physical address in the outer header of the second message.
4. The method according to claim 1, characterized in that The first message and the second message both have two layers of headers, and the third physical address is encapsulated in an inner header; the first physical address corresponding to the fixed network card dial-up port is encapsulated in an outer header of the first message; the second physical address corresponding to the wireless network card dial-up port is encapsulated in an outer header of the second message; The access server is further used to strip off the outer header of the first message or the second message to obtain the third physical address encapsulated in the inner header.
5. The method according to claim 1, characterized in that The terminal is provided with a plurality of applications, each of which has a corresponding virtual dial-up port and a third physical address.
6. A network dial-up device, characterized in that: Deployed on a terminal, the terminal is provided with a fixed network card dial-up port, a wireless network card dial-up port and a virtual dial-up port, the fixed network card dial-up port, the wireless network card dial-up port and the virtual dial-up port correspond to a first physical address, a second physical address and a third physical address respectively; the device comprises: A first dialing module, configured to dial through the virtual dialing port when the dialing channel of the fixed network card dialing port is normal, and send a first message to the access server through the fixed network card dialing port; the first message is encapsulated with a third physical address corresponding to the virtual dialing port; A second dial-up module is used to dial through the virtual dial-up port when the dial-up channel of the fixed network card dial-up port fails, and send a second message to the access server through the wireless network card dial-up port; the second message is encapsulated with a third physical address corresponding to the virtual dial-up port; The first dialing module, after dialing through the virtual dialing port and before sending the first message to the access server through the fixed network card dialing port, is also used to encapsulate the third physical address corresponding to the virtual dialing port to generate an initial first message; wherein the third physical address is encapsulated in the header of the initial first message; the initial first message is routed to the fixed network card, and a new header is encapsulated in the outer layer of the initial first message through the fixed network card to obtain the first message; the new header is encapsulated with the first physical address corresponding to the fixed network card dialing port; wherein, in the process of sending the first message to the access server, the devices involved along the way replace the physical address based on the first physical address in the outer header of the first message; The access server is used to allocate an IP address to the terminal according to the third physical address in the first message or the second message.
7. The device according to claim 6, characterized in that The terminal is provided with a plurality of applications, each of which has a corresponding virtual dial-up port and a third physical address.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the network dial-up method according to any one of claims 1 to 5 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the network dial-up method according to any one of claims 1 to 5 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the network dial-up method according to any one of claims 1 to 5 are implemented.
