Multi-network connection method and terminal in edge computing scene
By creating and configuring multiple network interfaces in edge computing scenarios, we solve the deployment and management problems of multiple network connections, achieve rapid deployment and stability, adapt to different devices and operating systems, and ensure the stability and adaptability of network connections. ability.
Patent Information
- Application Number
- CN202411186976.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-28
- Publication Date
- 2024-09-27
AI Technical Summary
In edge computing scenarios, it is difficult for existing technologies to achieve rapid deployment, independent management and stable adaptation of multiple network connections, especially when multiple network access resources need to be integrated, and it is difficult to adapt to different network devices, transmission media and Operating system differences.
By creating multiple network interfaces, obtain and independently configure the data of each interface, monitor and update interface changes to achieve rapid deployment and stability of network connections, and support static IP address, DHCP or PPP protocol configuration, configure routing tables and Firewall to ensure coexistence of multiple connections and link stability.
It realizes the rapid deployment, independent management and coexistence of multiple network connections in edge computing scenarios, and can adapt to different network devices and operating systems to ensure the stability and adaptability of network connections.
Smart Images

Figure CN118714003A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data sharing technology, and in particular to a method and terminal for connecting multiple networks in an edge computing scenario. Background Art
[0002] Edge computing is an open platform that integrates network, computing, storage, and application core capabilities at the edge of the network close to the source of objects or data, providing edge intelligent services nearby to meet the key needs of industry digitalization in content distribution, agile connection, real-time business, data optimization, application intelligence, security and privacy protection, etc.
[0003] Edge computing provides IT service environment and computing power at the edge of mobile networks, emphasizing proximity to the user end to reduce network operation and service delivery latency and improve user experience. In self-built BGP nodes or computer rooms, it is necessary to access and process the networks of multiple ISPs; in fog computing P2P-CDN, it is necessary to connect multiple small and medium-sized bandwidths to the same server to improve operational efficiency; in important events, it is necessary to aggregate multiple operators or multiple types of networks to maintain strict uninterrupted connections and data flows. Therefore, in edge computing scenarios, it is more inclined to integrate multiple or multiple network access resources, which is different from general Internet connection requirements. Therefore, it is necessary to provide a method for establishing multi-network connection access in edge computing scenarios to meet the needs of edge computing scenarios. Summary of the invention
[0004] In order to solve the above-mentioned problems in the prior art, the present invention provides a method and terminal for multiple network connections in an edge computing scenario, which can realize rapid deployment, independent management, multi-connection coexistence and stable adaptation of multiple network connections in edge computing scenarios, and can be widely used in different network devices, transmission media, connection types and operating systems.
[0005] In order to achieve the above object, the technical solution adopted by the present invention is: In a first aspect, the present invention provides a method for connecting multiple networks in an edge computing scenario, comprising: Step S1. Create multiple network interfaces based on physical or virtual connections; Step S2. Obtain the configuration data of each created network interface, and add configuration to each network interface independently so that each network interface can achieve network connection; Step S3: monitor whether each created network interface has changed, and update the network interface according to the change of the network interface to maintain the network connection of each network interface.
[0006] The beneficial effects of the present invention are that through the independent configuration and connection maintenance of multiple network interfaces, it is possible to achieve rapid deployment, independent management, multi-connection coexistence and stable adaptation of multiple network connections in edge computing scenarios, and can be widely used in different network devices, transmission media, connection types and operating systems.
[0007] Optionally, the configuration data includes the type of network interface, and the adding configurations for each network interface independently so that each network interface can achieve network connection includes: For each created network interface, a network connection is configured according to the type of the corresponding network interface, and a route is configured for each created network interface, so that each created network interface can achieve a network connection.
[0008] Optionally, configuring the network connection according to the type of the corresponding network interface includes: Configure a static IP address; Automatically configure IP address via DHCP or SLAAC; Configure the IP address using the PPP or VPN protocol on the network interface itself.
[0009] It can be seen from the above description that the present invention supports multiple network connections of any number, any connection mode and any network configuration to coexist in the same system.
[0010] Optionally, the method for configuring routing for each created network interface is to configure a routing table, configure policy routing or routing rules, configure a firewall, and configure VRF, or a combination of the above.
[0011] According to the above description, the present invention realizes the capability of parallel communication through multiple network connections.
[0012] Optionally, the method for monitoring whether each created network interface has changed is a combination of one or more update triggering schemes, and the update triggering scheme includes: A. Updates are triggered by changes in the network interface itself that are fed back to the system; B. monitor in real time whether the network interface changes, and if so, trigger an update; C. Regularly capture the interface information of the network interface, and trigger an update if the interface information changes.
[0013] According to the above description, it can be seen that through timed triggering and real-time triggering by the interface information of the network interface, the effect of rapid response can be achieved to further ensure the link stability requirements of multiple network connections in edge computing scenarios.
[0014] Optionally, updating the network interface according to the change of the network interface includes: The IP address and the route are automatically adjusted according to the changes of the network interface, the preset network connection requirements and the route implementation method during configuration, so as to realize the update of the network interface.
[0015] According to the above description, the present invention can automatically update according to changes in network interfaces to achieve the ability to maintain multiple network connections in response to network connection interruption, interruption recovery, addition, change or removal.
[0016] Optionally, the acquiring of configuration data of each created network interface includes one or more of the following: Get configuration data directly entered by the user; Configuration data obtained through user interface interaction; Read configuration data stored in persistent storage.
[0017] Optionally, if a VLAN tag is specified in the configuration of the network interface, the VLAN tag is added to the network interface before configuring the network connection.
[0018] Optionally, the interface name of each network interface is unique and is a custom name in the configuration data, a name randomly assigned by the system, or a default interface name.
[0019] According to the above description, the interface names of different network interfaces are not repeated, so each network interface can be independently configured and managed through configuration data.
[0020] Optionally, in step S2, adding configurations independently for each network interface includes: If a MAC address is specified in the configuration of the network interface, then the MAC address is configured for the network interface; If a MAC address configuration method is specified in the configuration of the network interface, the configuration method is applied to configure the MAC address for the network interface.
[0021] Optionally, the MAC address configuration method includes: Use a random number generator or pseudo-random number algorithm to obtain unique MAC addresses; Alternatively, part or all of the configuration data is used as input, and a preset algorithm is used to obtain non-repeating data as the MAC address.
[0022] Optionally, if the configuration method of the MAC address specifies a device model, it includes: Limiting an optional range of one or more OUI prefixes according to the device model; Taking part or all of the configuration data as input, a preset algorithm is used to obtain data with prefixes within an optional range of the OUI prefix and which are non-repeating as a MAC address.
[0023] According to the above description, the MAC address of the network interface is bound to all or part of the configuration data, and the OUI prefix limits the optional range of OUI corresponding to the device model to prevent the network connection from being restricted by the Internet service provider.
[0024] In a second aspect, the present invention also provides a terminal with multiple network connections in an edge computing scenario, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the various steps of a method for multiple network connections in an edge computing scenario as described in the first aspect.
[0025] Among them, the technical effect corresponding to the terminal with multiple network connections in an edge computing scenario provided by the second aspect refers to the relevant description of the method for multiple network connections in an edge computing scenario provided by the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] Figure 1 A schematic diagram of the main process of a method for connecting multiple networks in an edge computing scenario according to an embodiment of the present invention; Figure 2 A schematic diagram of a configuration flow of a method for a network interface according to an embodiment of the present invention; Figure 3 A schematic diagram of a DHCP service process according to an embodiment of the present invention; Figure 4 A schematic diagram of the process of the PPPoE service involved in the embodiment of the present invention; Figure 5 A schematic diagram of a process of routing update according to an embodiment of the present invention; Figure 6 A schematic diagram of the structure of a terminal with multiple network connections in an edge computing scenario according to an embodiment of the present invention; [Description of Reference Numerals] 1. A terminal with multiple network connections in an edge computing scenario; 2. Processor; 3. Memory. DETAILED DESCRIPTION
[0027] In order to better understand the above technical solution, exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present invention are shown in the accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be limited by the embodiments described herein. On the contrary, these embodiments are provided to enable a clearer and more thorough understanding of the present invention and to fully convey the scope of the present invention to those skilled in the art.
[0028] The above and other technical contents, features and effects of the present invention will be clearly presented in the following detailed description of the preferred embodiments with reference to the drawings. Through the description of the specific implementation methods, the technical means and effects adopted by the present invention to achieve the predetermined purpose can be more deeply and specifically understood. However, the drawings are only for reference and explanation purposes and are not used to limit the present invention.
[0029] Unless otherwise specified, throughout the specification and claims, "include" and "comprising" have the same meaning as "including but not limited to". "Connect" or its variants refer to the direct or indirect connection between two or more components, modules or systems, which can be physical, logical, or a combination thereof. " / " means "or", covering the following interpretations: any item in the list, all items in the list, and any combination of all items in the list. Words using the singular or plural number can also represent the singular or plural case, respectively.
[0030] This implementation is suitable for edge computing scenarios, especially in edge computing scenarios where a large number of network access resources need to be integrated. Compared with other Internet connection requirements, there is a need for rapid deployment in edge computing scenarios. This implementation meets the above requirements through the following solutions, as discussed below.
[0031] The following terms involved in the implementation are explained as follows: 1. IP address: Internet Protocol address, including version 4 (IPv4) and version 6 (IPv6).
[0032] 2. Firewall technology: A technology that monitors, tracks, and controls system network data transmission according to predetermined strategies. For different operating systems, the related functions and interfaces are different, as listed below: 1.Linux operating system: a. Kernel iptables or netfilter function; b. Kernel extended Berkeley Packet Filter (eBPF) interface; c. Using third-party applications to achieve equivalent firewall functions, regardless of whether the above functions and interfaces are indirectly used.
[0033] 2. Other UNIX-derived or variant operating systems, or operating systems designed in accordance with UNIX standards: a. Based on the derivative or transplanted version of IPFilter firewall; b. With the derivative or transplanted version of ipfirewall firewall as the core; c. Based on derivatives or ports of the PF firewall including OpenBSD; d. Take the derivative or transplanted version of NPF firewall as the core; e. Based on derivatives or ported versions of FreeBSD's m0n0wall and its successor projects (pfSense, OPNsense); f. Utilize Berkeley Packet Filter (BPF) or extended Berkeley Packet Filter (eBPF) functionality; g. Using other third-party applications to achieve equivalent firewall functions, regardless of whether the above functions and interfaces are indirectly utilized.
[0034] 3. Windows operating system: a. Windows Firewall function; b. Firewall technology implemented by third-party applications.
[0035] 4. Real-time operating system (RTOS), such as VxWorks, LynxOS: a. The system's iptables firewall function; b. BPF function of the system; c. Using other third-party applications to achieve equivalent firewall functions, regardless of whether the above functions and interfaces are indirectly utilized.
[0036] 3. Virtual Router (VRF, Virtual Routing Forwarding): A routing technology that allows multiple routing tables to coexist. In a multi-network connection system, it allows a separate, non-interfering routing table to be implemented for each different network connection.
[0037] 4. MAC address: "Media Access Control Address" or "Physical Address" refers to a set of six-byte sequence of data that uniquely identifies a device or network interface in the network.
[0038] 5. OUI: "Organizationally Unique Identifier" refers to a group of identifiers in the MAC address, usually the first three bytes. Generally, OUI is obtained by the supplier, manufacturer or other organization submitting an application to IEEE; OUI can identify the supplier, manufacturer or other organization to which the device belongs.
[0039] Please refer to Figures 1 to 5 , a method for connecting multiple networks in an edge computing scenario, comprising: Step S1. Create multiple network interfaces based on physical or virtual connections; Among them, the network interface is divided into: 1. General physical interface, including network adapter or network adapter card connected to the computer network interface device; in this case, the other end of the network adapter or network adapter card can be connected to other network devices through dielectric, optical or radio; In order to facilitate identification, correspondence and management, it is allowed to set an alias for a general physical network interface; 2. Virtual network interface, including: a. Virtual Ethernet interface, such as virtual ethernet, veth; virtual network card, including but not limited to MACVLAN; virtual bridge; b. Virtual Local Area Network (VLAN); c. Point-to-Point Protocol (PPP); d. Virtual Private Network (VPN), such as PPTP, L2TP, SSTP, etc.; To facilitate identification, correspondence, and management, you are allowed to customize the interface name or add an interface alias.
[0040] Therefore, existing general network technicians or related special software will generate device names such as pppX, where X is incremented from 0 according to the dialing sequence. This implementation adopts the method of first determining the interface name, then establishing the configuration and connecting, which enhances the targeted management capability and provides the possibility of independent management.
[0041] The interface name of each network interface is unique and can be a custom name in the configuration data, a randomly assigned name by the system, or a default interface name. When using the default interface name, if it is PPP or VPN-like, the connection program is directly started in the default mode. If it is for dynamic acquisition or static IP configuration, the network can be directly configured on the existing interface. Otherwise: a. Add virtual interfaces based on custom or randomly assigned names, such as MACVLAN, veth; b. If the user needs to configure VLAN, etc., the VLAN interface is named with a custom name or a randomly assigned name; c. When connecting via PPP or VPN-like protocols, an interface will be created with a custom name or a system-assigned name as the interface name; d. For dynamically acquired configuration or static IP configuration, configuration can be performed on the interface of a. or b., or the configuration can be generated by presenting a custom name or a system-assigned name as an alias, where the alias is a user-rememberable name presented.
[0042] Step S2. Obtain the configuration data of each created network interface, and add configuration to each network interface independently so that each network interface can achieve network connection; Wherein, obtaining the configuration data of each created network interface includes one or more of the following: Get configuration data directly entered by the user; Configuration data obtained through user interface interaction; Read configuration data stored in persistent storage.
[0043] Reference Figure 2 It can be seen that when reading the configuration data, it is necessary to verify whether the format of the configuration file is correct and whether there is any configuration conflict. If not, you need to start adding a new network interface to the system. If a VLAN tag is specified in the configuration of the network interface, add the VLAN tag to the network interface before configuring the network connection.
[0044] The configuration in step S2 includes but is not limited to using the system's own management software tools, third-party software tools, writing software to call system APIs, writing software to perform system injection, etc.
[0045] Thus, the configuration data includes the type of network interface, and configuration is added independently for each network interface so that each network interface can achieve network connection including: For each created network interface, a network connection is configured according to the type of the corresponding network interface, and a route is configured for each created network interface, so that each created network interface can achieve a network connection.
[0046] Configuring the network connection according to the type of the corresponding network interface includes: 1. Configure a static IP address; For a static IP address, you need to set the IP address, subnet mask, etc. of the network interface according to the configuration data. The gateway information in the configuration data is retained for configuring routing.
[0047] 2. Automatically configure IP address via DHCP or SLAAC; Reference Figure 3As we know, for the DHCP (Dynamic Host Configuration Protocol) protocol, the DHCP service is started, and the DHCP service is used to obtain the IP address, subnet mask, and gateway information from the DHCP server. The IP address, subnet mask, etc. of the network interface are set according to the information obtained from the DHCP server; the gateway information is retained for use in configuring routing, etc.
[0048] If the DHCP server is not ready, or the network cable is not connected, the DHCP service will wait for a while and try again.
[0049] After the DHCP protocol is completed, the IP address and subnet mask will be configured, and an update signal will be sent to the background routing service to request an update.
[0050] Among them, SLAAC (Stateless address autoconfiguration) can refer to DHCP.
[0051] 3. Configure the IP address using the PPP or VPN protocol on the network interface itself.
[0052] For PPPoE (Point-to-Point Protocol Over Ethernet, a point-to-point communication protocol based on Ethernet), start the PPPoE service, which is used to obtain information such as IP address, subnet mask, and gateway from the PPPoE server. Information such as IP address and subnet mask is used to configure the network interface, and gateway information is used to configure routing.
[0053] If the PPPoE server is not ready, or the network cable is not connected, the PPPoE service will wait for a while and try again.
[0054] After the PPPoE protocol is completed, the IP address and subnet mask will be configured, and an update signal will be sent to the background routing service to request an update.
[0055] The method for configuring routing for each created network interface is to configure a routing table, configure policy routing or routing rules, configure a firewall, configure VRF, or a combination of these. The following is a detailed description of each routing configuration method: 1. Configure the routing table: Add routing entries for multiple network connections in the routing table. These entries are usually used to match IP addresses, find corresponding routers and forward them. Overall, the connection between hosts can be communicated through multiple different network connections.
[0056] Furthermore, equal-cost multipath routing (ECMP) or weighted multipath routing can be added to the routing table, allowing communications to achieve (weighted) load balancing or bandwidth aggregation between multiple different network connections.
[0057] 2. Configure policy routing or routing rules: Add policy routing or routing rules to the system. The system determines the data packet routing and transmission method according to the predetermined policy or rules, so that data packets with different characteristics can be transmitted through multiple different network connections. For example: establish a certain rule to match the source or destination IP address in the network data packet, and transmit the network data packet to the specified network connection according to the rule.
[0058] Furthermore, certain policy routing or routing rules can be designed to allow communication to achieve (weighted) load balancing or bandwidth superposition between multiple different network connections.
[0059] 3. Configure firewalls: The above firewall technologies or functions can enable data packets with different characteristics to be transmitted through multiple different network connections according to predetermined policies or rules. For different operating systems, use corresponding firewall technologies, or use other software to provide equivalent functions for the operating system to operate data packet forwarding in a multi-connection network environment. "Operation" includes but is not limited to tracking, marking, changing data packets, changing data packet routing, etc. For example: using the characteristics of the firewall, by marking data packets that meet certain characteristics and tracking the corresponding connections, by changing the content of the data packet, the data packet is transmitted through a specific network connection according to the settings.
[0060] Furthermore, certain policies or rules can be designed in the firewall technology or function to allow communication to achieve (weighted) load balancing or bandwidth superposition between multiple different network connections.
[0061] 4. Configure VRF: Use VRF to manage multiple different network connections. Configure forwarding rules between VRFs so that connections between different hosts are forwarded to different VRFs, ultimately achieving communication through different network connections.
[0062] The purposes of routing configuration are: 1. Ensure specific network access capabilities based on business needs and program function requirements; 2. When multiple network interfaces have the ability to connect to the network at the same time, ensure that the established network access session will not be disturbed unless the connection status changes due to human intervention or external factors; 3. It usually also includes the function of realizing traffic distribution among multiple interfaces, including load balancing and bandwidth superposition.
[0063] Therefore, this embodiment can work on all well-known general operating systems including Windows, Linux, and Unix-like operating systems, so that the established network connection relationship can be maintained on different operating systems, and is thus widely used in different operating systems and network devices.
[0064] Step S3: monitor whether each created network interface has changed, and update the network interface according to the change of the network interface to maintain the network connection of each network interface.
[0065] Among them, once the Internet connection is established, it is necessary to maintain the connection capability until its state changes, and when the state changes, it is possible to continue to maintain the Internet connection according to its new state. In simple terms, maintaining the connection state of the network interface includes: a. For connections established via PPP or VPN-like protocols, the program must maintain the protocol session to ensure the connection is available, and restore the connection as much as possible in the event of occasional disconnection caused by external factors such as network fluctuations; b. For dynamically acquired configuration or static IP configuration, the program should refer to the configured parameters to perform maintenance or update settings at a certain period of time, where the configured parameters include expiration time.
[0066] Therefore, the method for monitoring whether each created network interface has changed is a combination of one or more update triggering schemes, and the update triggering scheme includes: A. Updates are triggered by changes in the network interface itself that are fed back to the system; B. Monitor the network interface in real time to see if it changes. If so, trigger an update; The change of the network interface includes a change of the network connection status caused by the user's active setting or a change of the network connection status caused by network fluctuation.
[0067] The network connection status change caused by the user's active settings refers to the changes caused by the user's addition, modification, or deletion of configurations, including: a. Add a single or a group of network connection settings, and apply the configuration immediately after saving. The save and apply operations basically do not affect the current existing network interface configuration and the network activities on it; b. Modify the settings of a single or a group of network interfaces, and apply the configuration immediately after saving. The save and apply operations basically do not affect other existing network interface configurations and network activities on them; c. Delete a single or a group of network interfaces or the settings on them. Apply immediately after confirmation. Unless all interface settings are deleted, this operation will basically not affect other existing network interface configurations and network activities on them; d. Require a single or a group of network interfaces to be reconfigured or reconnected, and apply immediately after confirmation. Unless all network interfaces are required to be reconfigured or reconnected, the operation will not affect other existing network interface configurations and network activities on them; e. It is required that when a single or a group of network interfaces are disconnected, the configuration on them is retained, allowing for subsequent reconnection, and the disconnection or reconnection operation has little impact on other existing network interface configurations and the network activities on them.
[0068] The connection status is divided into: a. The connection is successful and the network is accessed normally; b. There is a connection, but network access is limited, such as broadband arrears; c. The connection is abnormal and the network cannot be accessed.
[0069] Usually, the settings for routing, firewall, etc. are based on the interfaces in the managed interface list that are in the "connection successful, normal network access" state; when the connection status of any interface in the managed interface list changes, the settings need to be adjusted in time.
[0070] Among them, changes in network interfaces include changes in interface status and changes in configuration data status. The former includes the online / offline status of the network interface, including the connection, disconnection, and loss of the bound hardware network interface; the connection and disconnection of protocols such as PPP and VPN, etc. The latter includes changes in the IP configured by the network interface, changes in the routing table, etc.
[0071] C. Regularly capture the interface information of the network interface, and trigger an update if the interface information changes.
[0072] That is, an update time is set on the timer. When the timer times out, the update information is sent to achieve timing triggering.
[0073] Among them, this implementation method uses timing triggering and real-time triggering by changes in the network interface. Compared with the polling + timing in the prior art, since the polling process is also time-consuming, if the device status is updated during this process, it will easily cause errors, which may cause its recovery time to be delayed by another update interval; and the timing period reaches several minutes, and consistent instantaneous peaks and valleys or burr anomalies may appear in general traffic statistics charts; and the real-time triggering of this implementation method, in most cases, because the update triggered by network fluctuations will be completed within the time granularity of milliseconds or even microseconds, thereby ensuring that the traffic level of the network connection is more stable and achieves the effect of rapid response, so as to further ensure the link stability requirements of multiple network links in edge computing scenarios.
[0074] Wherein, updating the network interface according to the change of the network interface includes: Automatically adjust the IP address and route according to the changes in the network interface, the preset network connection requirements and the routing implementation method during configuration to update the network interface.
[0075] Specifically include: 1. When one or more network connections are interrupted or abnormal, the ability of the system to maintain stable network connection of multiple network connections unless all network connections are interrupted or abnormal; 2. When a new network connection is added or a disconnected network connection is restored, the ability of a system with multiple network connections to maintain stable network connection; 3. When a network connection configuration changes, such as a change in IP address, the system should maintain the ability of the multi-network connection system to stably connect to the network in the same manner as it would in dealing with network interruption and recovery; 4. When a network connection is removed, the system should maintain the ability of a system with multiple network connections to connect to the network stably in the same manner as it would in a network interruption, unless all network connections are removed; Furthermore, the ability to stably connect to the network also includes achieving (weighted) load balancing or bandwidth superposition between multiple different network connections according to predetermined strategies or rules; Among them, the maintenance method can be to automatically adjust the established routing table entries, policy routing or routing rules, firewall configuration or rules, and VRF forwarding rules according to a certain rule and the implemented routing method when a network connection is interrupted, interrupted, restored, added, changed or removed.
[0076] Among them, "maintain" means to maximize the system's network connectivity to meet the configuration requirements of the system administrator, so that network communication shows stability. "Automatically" means to respond to changes and implement adjustment methods in a very short time without human intervention. "Regular" means to implement adjustment methods in a corresponding manner based on the needs of network connection, taking into account the IP address, gateway, priority, and weight of the network configuration.
[0077] Among them, refer to Figure 5 It can be seen that the routing update method is mainly used to update the system's routing table, policy routing and firewall according to the configuration information of the network interface.
[0078] The main process of routing update is to update the system's routing table, policy routing, and firewall rules in sequence according to the configuration information and the current interface connection status. For example: 1. The default route is updated to make it easier to distribute network activities on different interfaces.
[0079] 2. The purpose of updating policy routing is to select the appropriate interface based on the source and destination address of network activities and maintain the stability of a single network connection.
[0080] 3. The purpose of updating firewall rules is to track the connections of network activities and maintain the stability of connections.
[0081] The operations for IPv4 and IPv6 can be performed serially or in parallel. Depending on the actual configuration information and connection status, only IPv4 or IPv6 can be configured.
[0082] Wherein, in step S2, adding configurations independently for each network interface includes: If a MAC address is specified in the configuration of the network interface, then the MAC address is configured for the network interface; If a MAC address configuration method is specified in the configuration of the network interface, the configuration method is applied to configure the MAC address for the network interface.
[0083] The MAC address of each network interface is independently configured for each network interface. The MAC address is randomly generated, or obtained through a preset algorithm using part or all of the configuration data as input.
[0084] Specifically, it allows the system to generate a MAC address using a random number generator or a pseudo-random number algorithm and configure it on the network interface.
[0085] Alternatively, to make the configuration more stable, the system uses part or all of the configuration data as input, uses a specific algorithm to obtain a data that is not easy to repeat or conflict as the MAC address, and configures it to the network interface; the same input is processed by the same algorithm to obtain the same MAC address, so that the MAC address is bound to the configuration data or a selected part of the configuration data.
[0086] On this basis, for special network requirements, if the MAC address configuration method specifies the device model, it includes: Limiting an optional range of one or more OUI prefixes according to the device model; With part or all of the configuration data as input, a preset algorithm is used to obtain data with prefixes within the optional range of the OUI prefix and which are not repeated as the MAC address.
[0087] That is, the system uses part or all of the configuration information as input, and uses a specific algorithm to obtain a data that is not easy to repeat or conflict within the optional range of the OUI as the MAC address, and configures it on the network interface; the same input is processed by the same algorithm to obtain the same MAC address, so that the MAC address is bound to the configuration information or a part of the selected data in the configuration information.
[0088] In summary, this implementation can achieve rapid deployment, independent management, multi-connection coexistence and stable adaptation of multiple network connections in edge computing scenarios, and can be widely used on different network devices and operating systems.
[0089] Embodiment 1 A method for connecting multiple networks in an edge computing scenario, a specific example, includes the following steps: 1. The user enters multiple PPP account and password configurations, and names them "wan0", "wan1", "wan2", etc. in the order they are entered; 2. The system will run the PPP program and use the account, password and other information to establish a network connection according to the corresponding relationship. It will also set the connection name to "wan0", "wan1", "wan2" and so on according to the user's input, so that the system can find the network interfaces with these names; 3. The system sets the IP addresses of network connections "wan0", "wan1", "wan2", etc. according to the IP address information of the PPP connection, so that the system can find the IP address information through the network interface; 4. The system adds multiple equivalent default routes to the routing table based on the gateway information of the PPP connection to achieve load balancing of network connections among "wan0", "wan1", "wan2", etc.; 5. The system adds policy routing, matching the IP addresses of network connections "wan0", "wan1", "wan2", etc. according to the source IP address or destination IP address field in the network data packet, so that the network data packet can be transmitted in and out through the corresponding network connection; 6. With the above configuration, the system can use any of the "wan0", "wan1", "wan2" interfaces to connect to the network; 7. The system starts a daemon to monitor all changes in network connection status; 8. When the daemon detects that a network connection is interrupted, it removes the IP address of the network connection, deletes the default route entry related to the network connection in the routing table, and deletes the policy routing entry related to the network connection, while maintaining the routing table and policy routing of the remaining network connections unchanged. The system can connect to the network through the remaining network interfaces; 9. When the daemon detects that a disconnected network connection is restored, it sets the latest IP address for the network connection, adds the latest gateway information of the network connection to the equivalent default route in the routing table, and adds a policy route based on the IP address on the network connection, maintaining the routing table and policy routes of the remaining network connections unchanged, and the system can connect to the network through the remaining network interfaces; 10. The system allows users to start the configuration program at any time to add, remove or change one or more PPP account and password configurations and corresponding naming information; 11. When the daemon detects a new network connection, it configures the routing table and policy routing in the same way as when the network connection is restored; 12. When the daemon detects the removal of the network connection, it configures the routing table and policy routing in the same way as when the network connection is disconnected; 13. When the daemon detects a change in the network connection, it configures the routing table and policy routing in the same way as when the network connection is interrupted and restored.
[0090] Embodiment 2 A method for connecting multiple networks in an edge computing scenario, based on the first embodiment, is different in that when establishing a network interface: 1. The system obtains specific data from persistent storage and configures DHCP for the physical network cards "eth0", "eth1", "eth2", etc. in the system accordingly; 2. The system sets aliases for physical network cards "eth0", "eth1", "eth2", etc. as "wan0", "wan1", "wan2", etc. according to the data; 3. The system sets the IP addresses of network connections "wan0", "wan1", "wan2", etc. according to the IP address information obtained by DHCP; 4. The system adds multiple equivalent default routes to the routing table according to the gateway information obtained by DHCP to achieve load balancing of network connections among "wan0", "wan1", "wan2", etc.
[0091] Embodiment 3 A method for connecting multiple networks in an edge computing scenario, based on the second embodiment, differs from the present embodiment in that when establishing a network interface: 1. The system obtains specific data from persistent storage and sets IP addresses for the physical network cards "eth0", "eth1", and "eth2" in the system accordingly; 2. The system adds multiple equal default routes to the routing table according to the gateway information in the data to achieve load balancing of network connections among "eth0", "eth1", "eth2", etc.
[0092] Embodiment 4 A method for connecting multiple networks in an edge computing scenario, based on embodiments 1, 2, and 3, is different in that when establishing a network interface: 1. The user enters multiple network connection information. For the network connections named "wan0", "wan1", and "wan2", they are required to be set to statically configure IP addresses, configure IP addresses through DHCP, and configure IP addresses through PPP respectively; 2. The system sets an IP address for "wan0" based on user input; 3. The system starts DHCP to obtain and configure an IP address for "wan1" based on user input; 4. The system runs the PPP program based on the user input to obtain and configure an IP address for "wan2"; 5. The system adds multiple equivalent default routes to the routing table according to the "wan0" gateway information entered by the user, the "wan1" gateway information obtained from DHCP, and the "wan2" gateway information obtained from PPP, so as to achieve load balancing of network connections among "wan0", "wan1", and "wan2".
[0093] Embodiment 5 A method for connecting multiple networks in an edge computing scenario, based on embodiments 1, 2, 3, and 4, this embodiment differs in that the method for configuring routing is: 1. Set up firewall rules, use the characteristics of firewall technology to mark the data packets of multi-network connection systems, and track the source and direction of the data packets based on the marks, and further change the direction of the data packets as needed.
[0094] Embodiment 6 A method for connecting multiple networks in an edge computing scenario, based on embodiments 1, 2, 3, and 4, the difference of this embodiment is that the method for configuring routing and the method for maintaining network connectivity of the multi-network connection system are: 1. The system creates a VRF for each connection (such as "wan0", "wan1", "wan2", etc.) and adds each connection to the corresponding VRF; 2. The system sets up a routing table for each VRF and adds a default route based on the gateway information of the network connection in the VRF; 3. The system sets up policy routing, matches the source IP address or destination IP address, and forwards the network data packet to the corresponding VRF; 4. The system sets policy routing so that general network connections can be dynamically allocated to different VRFs when initiated, giving the system network the characteristic of load balancing; 5. The system starts a daemon to monitor all changes in network connection status; 6. When the daemon detects that a network connection is interrupted, it removes the IP address of the network connection, removes the corresponding VRF, and deletes the policy routing entry related to the network connection, while maintaining the routing table and policy routing of other network connections unchanged; 7. When the daemon detects that a disconnected network connection is restored, it sets the latest IP address for the network connection, creates a new VRF, adds the network connection to this VRF, adds a default route to the routing table in the VRF, and adds a policy route based on the IP address on the network connection, while maintaining the routing table and policy routes of other network connections unchanged; 8. Other details are the same as the above embodiment.
[0095] Embodiment 7 A method for connecting multiple networks in an edge computing scenario. Based on the above embodiment, this embodiment is different in that in actual use scenarios, network connections may be restricted by Internet service providers (ISPs). One of the restrictions is that the ISP will limit the devices that access the network to the range of trusted device models. Generally speaking, MAC addresses of the same device model share the same OUI prefix.
[0096] Therefore, in this embodiment, the following steps are included: 1. Based on the list of optical modem equipment collected from the public operators, some well-known and most stable optical modem models of recognized individual brands such as Huawei, ZTE, and Fiberhome are selected. After screening and integration, a group of 14 MAC address OUI prefixes are obtained as the optional list of OUIs, and they are numbered 0 to 13 respectively.
[0097] 2. Read the configuration information and perform serialization conversion, taking the converted byte data as input. This embodiment adopts the national secret SM3 cryptographic hash algorithm.
[0098] In other embodiments, the preset algorithm may be data encryption or data summary or other data conversion algorithms, and the preset algorithm has stability and randomness in the conversion method of input and output, obtains output data and saves it in bytes. Stability means that the mapping from input to output is unique and only affected by the input data, and randomness means that a slight modification of the input end will cause a dramatic change in the output end.
[0099] 3. Take the first three bytes of the data output by the cryptographic hash algorithm as the last three bytes of the MAC address; take the fourth to seventh bytes of the data output by the cryptographic hash algorithm, convert them into a 32-bit unsigned integer in big-endian order, perform a modulo operation on 14, and use the result as the number. Take out an OUI prefix corresponding to the number in the optional range list of the OUI as the first three bytes of the MAC address.
[0100] 4. Put together the first and last parts of the above MAC address to get a complete MAC address that meets the requirements and configure it to the network interface.
[0101] Embodiment 8 Reference Figure 6 It can be seen that this embodiment also provides a terminal 1 with multiple network connections in an edge computing scenario, including a memory 3, a processor 2, and a computer program stored in the memory 3 and executable on the processor 2, wherein when the processor 2 executes the computer program, it implements each step as described in any one of Embodiments 1 to 7.
[0102] It should be understood by those skilled in the art that embodiments of the present invention may be provided as methods, apparatuses or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0103] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (apparatus) and computer program products according to embodiments of the present invention. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions.
[0104] It should be noted that in the claims, any reference numerals placed between brackets shall not be construed as limiting the claims. The word "comprising" does not exclude the presence of components or steps not listed in the claims. The word "a" or "an" preceding a component does not exclude the presence of a plurality of such components. The invention may be implemented by means of hardware comprising several different components and by means of a suitably programmed computer. In the claims enumerating several means, several of these means may be embodied by the same hardware. The use of the words first, second, third, etc., is for convenience of expression only and does not indicate any order. These words may be understood as part of the component name.
[0105] In addition, it should be noted that, in the description of this specification, the description of the terms "one embodiment", "some embodiments", "embodiment", "example", "specific example" or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, unless they are contradictory.
[0106] Although the preferred embodiments of the present invention have been described, those skilled in the art may make other changes and modifications to these embodiments after knowing the basic creative concept. Therefore, the claims should be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the present invention.
[0107] Obviously, those skilled in the art can make various modifications and variations to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention should also include these modifications and variations.
Claims
1. A method for connecting multiple networks in an edge computing scenario, characterized in that: include: Step S1. Create multiple network interfaces based on physical or virtual connections; Step S2. Obtain the configuration data of each created network interface, and add configuration to each network interface independently so that each network interface can achieve network connection; Step S3: monitor whether each created network interface has changed, and update the network interface according to the change of the network interface to maintain the network connection of each network interface.
2. The method for connecting multiple networks in an edge computing scenario according to claim 1, characterized in that: The configuration data includes the type of the network interface, and the steps of adding configurations to each network interface independently so that each network interface can achieve network connection include: For each created network interface, a network connection is configured according to the type of the corresponding network interface, and a route is configured for each created network interface, so that each created network interface can achieve a network connection.
3. The method for connecting multiple networks in an edge computing scenario according to claim 2, characterized in that: Configuring the network connection according to the type of the corresponding network interface includes: Configure a static IP address; Automatically configure IP address via DHCP or SLAAC; Configure the IP address using the PPP or VPN protocol on the network interface itself.
4. The method for connecting multiple networks in an edge computing scenario according to claim 1, characterized in that: The method for configuring routing for each created network interface is to configure a routing table, configure policy routing or routing rules, configure a firewall, configure VRF, or a combination of the above.
5. The method for connecting multiple networks in an edge computing scenario according to claim 1, characterized in that: The method for monitoring whether each created network interface has changed is a combination of one or more update triggering schemes, and the update triggering scheme includes: A. Updates are triggered by changes in the network interface itself that are fed back to the system; B. monitor in real time whether the network interface changes, and if so, trigger an update; C. Regularly capture the interface information of the network interface, and trigger an update if the interface information changes.
6. The method for connecting multiple networks in an edge computing scenario according to claim 2, characterized in that: The updating of the network interface according to the change of the network interface comprises: The IP address and the route are automatically adjusted according to the changes of the network interface, the preset network connection requirements and the route implementation method during configuration, so as to realize the update of the network interface.
7. The method for connecting multiple networks in an edge computing scenario according to claim 1, characterized in that: The obtaining of configuration data of each created network interface includes one or more of the following: Get configuration data directly entered by the user; Configuration data obtained through user interface interaction; Read configuration data stored in persistent storage.
8. The method for connecting multiple networks in an edge computing scenario according to claim 2, characterized in that: If a VLAN tag is specified in the configuration of the network interface, the VLAN tag is added to the network interface before configuring the network connection.
9. The method for connecting multiple networks in an edge computing scenario according to claim 1, characterized in that: The interface name of each network interface is unique and is a custom name in the configuration data, a name randomly assigned by the system, or a default interface name.
10. The method for connecting multiple networks in an edge computing scenario according to claim 1, characterized in that: The step S2 of adding configurations independently for each network interface includes: If a MAC address is specified in the configuration of the network interface, then the MAC address is configured for the network interface; If a MAC address configuration method is specified in the configuration of the network interface, the configuration method is applied to configure the MAC address for the network interface.
11. The method for connecting multiple networks in an edge computing scenario according to claim 10, characterized in that: The MAC address configuration method includes: Use a random number generator or pseudo-random number algorithm to obtain unique MAC addresses; Alternatively, part or all of the configuration data is used as input, and a preset algorithm is used to obtain non-repeating data as the MAC address.
12. The method for connecting multiple networks in an edge computing scenario according to claim 11, characterized in that: If the configuration method of the MAC address specifies a device model, it includes: Limiting an optional range of one or more OUI prefixes according to the device model; Taking part or all of the configuration data as input, a preset algorithm is used to obtain data with prefixes within an optional range of the OUI prefix and which are non-repeating as a MAC address.
13. A terminal with multiple network connections in an edge computing scenario, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, it implements the steps of a method for connecting multiple networks in an edge computing scenario as described in any one of claims 1 to 12.
Citation Information
Patent Citations
Forwarding method of multimedia data streams and forwarding equipment
CN102447669A
Wireless multi-network integration method
CN103596290A
IP (internet protocol) configuration method for multi-NIC (network interface card) equipment on basis of equipment group model
CN104363109A
Single network interface for multiple interface virtual network functions
CN107924226A
Method for configuring a plurality of virtual network cards, host machine and storage medium
CN109768871A
