CN114024903A - Network switching method and device and gateway equipment - Google Patents
Network switching method and device and gateway equipment Download PDFInfo
- Publication number
- CN114024903A CN114024903A CN202111315485.XA CN202111315485A CN114024903A CN 114024903 A CN114024903 A CN 114024903A CN 202111315485 A CN202111315485 A CN 202111315485A CN 114024903 A CN114024903 A CN 114024903A
- Authority
- CN
- China
- Prior art keywords
- network
- state
- fixed
- routing table
- fixed network
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 50
- 230000004044 response Effects 0.000 claims description 27
- 230000006854 communication Effects 0.000 abstract description 6
- 238000004891 communication Methods 0.000 abstract description 5
- 238000010586 diagram Methods 0.000 description 6
- 230000006870 function Effects 0.000 description 5
- 239000013307 optical fiber Substances 0.000 description 2
- 238000006467 substitution reaction Methods 0.000 description 2
- 230000001413 cellular effect Effects 0.000 description 1
- 238000004590 computer program Methods 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 239000002184 metal Substances 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/54—Store-and-forward switching systems
- H04L12/56—Packet switching systems
- H04L12/5691—Access to open networks; Ingress point selection, e.g. ISP selection
- H04L12/5692—Selection among different networks
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/66—Arrangements for connecting between networks having differing types of switching systems, e.g. gateways
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Mobile Radio Communication Systems (AREA)
Abstract
The embodiment of the application discloses a network switching method, a network switching device and gateway equipment, wherein the network switching method is applied to the gateway equipment, and the method comprises the steps of establishing connection with a first wide area network corresponding to a fixed network and establishing connection with a second wide area network corresponding to a mobile network; determining the network on-off state of the fixed network and the current network comprising the routing table items; if the current network is a fixed network and the network on-off state of the fixed network is a disconnected state, deleting the routing table entry of the fixed network and configuring the routing table entry for the mobile network; and if the current network is a mobile network and the network on-off state of the fixed network is a connected state, deleting the routing table entry of the mobile network and configuring the routing table entry for the fixed network. The gateway equipment and the mobile network are kept in a communication state, and data are routed to the network configured with the routing table items in a mode of configuring the routing table items of the network, so that the switching time of the fixed network and the mobile network is reduced.
Description
Technical Field
The present invention relates to the field of gateways, and in particular, to a network switching method and apparatus, and a gateway device.
Background
With the development of mobile Internet technology, gateway devices provide the ability to access services of the Internet (Internet) through a mobile network or a fixed network. When a physical link between the gateway device and the upper-level device is disconnected and a network node of an operator of the fixed network has a problem, the fixed network may be failed.
When the fixed network fails, the gateway equipment is switched to the mobile network so as to ensure that the user terminal can continuously access the Internet. In the switching process of the mobile network and the fixed network, the switching time is long, and a user using the network can obviously feel the interruption of the network and influence the user terminal to access the Internet.
Disclosure of Invention
In view of the defects in the prior art, embodiments of the present application provide a network switching method, a device, and a gateway device, so as to solve the problem that a switching duration is long in a switching process between a mobile network and a fixed network.
In a first aspect, an embodiment of the present application provides a network switching method, which is applied to a gateway device, and the network switching method includes:
establishing connection with a first wide area network corresponding to the fixed network, and establishing connection with a second wide area network corresponding to the mobile network;
determining the network on-off state of the fixed network and the current network comprising the routing table items;
if the current network is a fixed network and the network on-off state of the fixed network is a disconnected state, deleting the routing table entry of the fixed network and configuring the routing table entry for the mobile network;
and if the current network is a mobile network and the network on-off state of the fixed network is a connected state, deleting the routing table entry of the mobile network and configuring the routing table entry for the fixed network.
With reference to the first aspect, in a first possible implementation manner, the gateway device includes a first counter, and if the current network is a fixed network and a network on-off state of the fixed network is an off state, deleting a routing table entry of the fixed network and configuring a routing table entry for the mobile network includes:
and if the current network is a fixed network and the network on-off state of the fixed network is a disconnected state, adding one to the count of the first counter, and repeatedly executing the steps of determining the network on-off state of the fixed network and the current network comprising routing table entries, deleting the routing table entries of the fixed network and configuring the routing table entries for the mobile network until the count of the first counter reaches a first count threshold value.
With reference to the first aspect, in a second possible implementation manner, the gateway device includes a second counter, and if the current network is a mobile network and the network on-off state of the fixed network is a connected state, deleting a routing table entry of the mobile network and configuring a routing table entry for the fixed network includes:
and if the current network is a mobile network and the network on-off state of the fixed network is a connected state, adding one to the count of the second counter, and repeatedly executing the steps of determining the network on-off state of the fixed network and the current network comprising the routing table items, deleting the routing table items of the mobile network until the count of the second counter reaches a second count threshold value, and configuring the routing table items for the fixed network.
With reference to the first aspect, in a third possible implementation manner, after the determining the network on-off state of the fixed network and the current network including the routing table entry, the method further includes:
when the network on-off state of the fixed network is the off state, sending a first message to a message receiver, and receiving a first response message sent by the message receiver;
if the first response message does not comprise the MAC address corresponding to the gateway address of the fixed network, deleting the gateway address of the fixed network and restarting the DHCP process;
and if the first response message comprises the MAC address corresponding to the gateway address of the fixed network, executing the steps of determining the network on-off state of the fixed network and the current network comprising the routing list item.
With reference to the first aspect, in a fourth possible implementation manner, the determining a network on-off state of the fixed network includes:
sending a second message to a message receiver, and receiving a second response message sent by the message receiver;
if the second response message comprises the gateway address of the fixed network, determining that the network on-off state of the fixed network is a connected state;
and if the second response message does not comprise the gateway address of the fixed network, determining that the network on-off state of the fixed network is a disconnected state.
With reference to the first aspect, in a fifth possible implementation manner, after the determining the network on-off state of the fixed network and the current network including the routing table entry, the method further includes:
and if the current network is a fixed network and the network on-off state of the fixed network is a connected state, executing the steps of determining the network on-off state of the fixed network and the current network comprising the routing list items based on a preset time interval.
With reference to the first aspect, in a sixth possible implementation manner, after the connection is established with the first wide area network corresponding to the fixed network and the connection is established with the second wide area network corresponding to the mobile network, the determining a network on-off state of the fixed network and before the current network including the routing table entry further includes:
acquiring the link on-off state of the fixed network;
if the link on-off state of the fixed network is a connected state, starting a DHCP process and configuring a routing table item for the fixed network;
and if the link on-off state of the fixed network is the off state, configuring a routing table entry for the mobile network.
In a second aspect, an embodiment of the present application is a network switching apparatus applied to a gateway device, where the network switching apparatus includes:
the connection module is used for establishing connection with a first wide area network corresponding to the fixed network and establishing connection with a second wide area network corresponding to the mobile network;
the determining module is used for determining the network on-off state of the fixed network and the current network comprising the routing list items;
the mobile routing configuration module is used for deleting the routing table entry of the fixed network and configuring the routing table entry for the mobile network if the current network is the fixed network and the network on-off state of the fixed network is the off state;
and the fixed routing configuration module is used for deleting the routing table entry of the mobile network and configuring the routing table entry for the fixed network if the current network is the mobile network and the network on-off state of the fixed network is the connected state.
In a third aspect, an embodiment of the present application provides a gateway device, which includes a processor and a memory, where the memory stores a program or an instruction, and the program or the instruction is executed by the processor, so as to cause the gateway device to execute the steps of the network handover method described above.
In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, on which a program or instructions are stored, and the program or instructions, when executed by a processor, implement the steps of the network handover method described above.
The application provides a network switching method, which is applied to gateway equipment, and establishes connection with a first wide area network corresponding to a fixed network and a second wide area network corresponding to a mobile network; determining the network on-off state of the fixed network and the current network comprising the routing table items; if the current network is a fixed network and the network on-off state of the fixed network is a disconnected state, deleting the routing table entry of the fixed network and configuring the routing table entry for the mobile network; and if the current network is a mobile network and the network on-off state of the fixed network is a connected state, deleting the routing table entry of the mobile network and configuring the routing table entry for the fixed network. The gateway equipment and the mobile network are kept in a communication state, and data are routed to the network configured with the routing table items in a mode of configuring the routing table items of the network, so that the switching time of the fixed network and the mobile network is reduced.
Drawings
In order to more clearly illustrate the technical solution of the present invention, the drawings required to be used in the embodiments will be briefly described below, and it should be understood that the following drawings only illustrate some embodiments of the present invention, and therefore should not be considered as limiting the scope of the present invention. Like components are numbered similarly in the various figures.
Fig. 1 shows a flowchart of a network handover method provided in embodiment 1 of the present invention;
fig. 2 is a schematic structural diagram of a network switching apparatus according to embodiment 2 of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments.
The components of embodiments of the present invention generally described and illustrated in the figures herein may be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present invention, presented in the figures, is not intended to limit the scope of the invention, as claimed, but is merely representative of selected embodiments of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present invention without making any creative effort, shall fall within the protection scope of the present invention.
Hereinafter, the terms "including", "having", and their derivatives, which may be used in various embodiments of the present invention, are only intended to indicate specific features, numbers, steps, operations, elements, components, or combinations of the foregoing, and should not be construed as first excluding the existence of, or adding to, one or more other features, numbers, steps, operations, elements, components, or combinations of the foregoing.
Furthermore, the terms "first," "second," "third," and the like are used solely to distinguish one from another and are not to be construed as indicating or implying relative importance.
Unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art to which various embodiments of the present invention belong. The terms (such as those defined in commonly used dictionaries) should be interpreted as having a meaning that is consistent with their contextual meaning in the relevant art and will not be interpreted in an idealized or overly formal sense unless expressly so defined herein in various embodiments of the present invention.
Example 1
Referring to fig. 1, fig. 1 is a flowchart illustrating a network handover method according to embodiment 1 of the present invention. The network switching method in fig. 1 is applied to a gateway device, and includes the following steps:
It should be understood that the fixed network is also called a fixed network or a fixed network, and is a network for transmitting signals through a fixed medium such as a metal wire or an optical fiber line. A mobile network, also known as a cellular network, is a wireless network that does not rely on fixed devices. The wide area network, also called as an extranet or a public network, is a remote network connecting local area or metropolitan area network devices in different regions for communication. In this application, the first wide area network and the second wide area network may be networks provided by any operator, specifically, the wide area network may be a 4G network, a 5G network, or the like, and may also be a future communication network, such as a 6G network, and the like, which is not limited herein.
Taking the mobile network as an example, after the gateway device establishes connection with the second wide area network corresponding to the mobile network, the gateway device does not configure a routing table entry of the mobile network, that is, the mobile network is not used as a default wide area network for connection, and the gateway device does not access the internet through the mobile network. When the gateway device needs to access the internet through the mobile network, the routing table entry of the mobile network is configured to connect the mobile network as a default wide area network.
As an example, after the connection is established with the first wide area network corresponding to the fixed network and the connection is established with the second wide area network corresponding to the mobile network, the determining the network on-off state of the fixed network and before the current network including the routing table entry further includes:
acquiring the link on-off state of the fixed network;
if the link on-off state of the fixed network is a connected state, starting a DHCP process and configuring a routing table item for the fixed network;
and if the link on-off state of the fixed network is the off state, configuring a routing table entry for the mobile network.
When communicating over a fixed network, a link refers to a physical line, such as a cable or an optical fiber, between two devices. And if the link on-off state of the fixed network is the connected state, confirming that the gateway equipment is normally connected with equipment providing the fixed network through the link, and configuring a routing table item for the fixed network so as to access the Internet through the fixed network. And if the link on-off state of the fixed network is the off state, confirming that the gateway equipment is not connected with equipment providing the fixed network through the link, and configuring a routing table item for the mobile network so as to access the Internet through the mobile network.
It should be understood that DHCP (Dynamic Host Configuration Protocol) is a network Protocol of a local area network, and is used to manage and allocate IP addresses, so that devices in the local area network dynamically obtain information such as IP addresses and DNS addresses, and improve the utilization rate of the addresses. After the gateway equipment establishes connection with the first wide area network corresponding to the fixed network, the DHCP process is started to avoid faults caused by repeated use of addresses.
In this application, the current network is one of a fixed network and a mobile network. Specifically, if a routing table entry is configured for the mobile network, the current network is the mobile network, that is, the gateway device currently accesses the internet through the mobile network. If the routing table entry is configured for the fixed network, the current network is the fixed network, that is, the gateway device currently accesses the internet through the fixed network.
After the gateway device establishes a connection with a first wide area network corresponding to a fixed network, if the fixed network provided by an operator fails, the fixed network cannot access the internet. And determining whether the network between the two devices is smooth or not by determining the network on-off state of the fixed network so as to determine the reason of the fixed network fault.
As an example, after determining the network on-off state of the fixed network and the current network including the routing table entry, the method further includes:
and if the current network is a fixed network and the network on-off state of the fixed network is a connected state, executing the steps of determining the network on-off state of the fixed network and the current network comprising the routing list items based on a preset time interval.
If the network on-off state of the fixed network is the connected state, the fixed network provided by the operator does not send a fault, and the mode of accessing the Internet through the fixed network is kept. Meanwhile, step 102 is executed based on a preset time interval, and when the network on-off state of the fixed network is ensured to be a disconnected state, the gateway equipment is switched to access the Internet through the mobile network in real time.
And 103, if the current network is a fixed network and the network on-off state of the fixed network is a disconnected state, deleting the routing table entry of the fixed network and configuring the routing table entry for the mobile network.
If the network on-off state of the fixed network is the off state, the internet cannot be normally accessed through the fixed network. And deleting the routing table entry of the fixed network, configuring the routing table entry for the mobile network, and connecting the mobile network as a default wide area network to ensure that the Internet can be continuously accessed.
And when the network on-off state of the fixed network is a connection state, accessing the Internet through the fixed network. Meanwhile, the gateway device maintains the second wan connection corresponding to the mobile network, and does not configure a routing table entry for the mobile network, and data is not routed to the mobile network. When the network on-off state of the fixed network is the off state, the routing table entry of the fixed network is deleted, and the routing table entry is configured for the mobile network, so that the data can be routed to the mobile network, and the switching time length between the mobile network and the fixed network is reduced.
As an example, the gateway device includes a first counter, and if the current network is a fixed network and the network on-off state of the fixed network is an off state, deleting the routing table entry of the fixed network and configuring the routing table entry for the mobile network includes:
and if the current network is a fixed network and the network on-off state of the fixed network is a disconnected state, adding one to the count of the first counter, and repeatedly executing the steps of determining the network on-off state of the fixed network and the current network comprising routing table entries, deleting the routing table entries of the fixed network and configuring the routing table entries for the mobile network until the count of the first counter reaches a first count threshold value.
The first count threshold may be any number of times, and is not limited herein. Taking the first count threshold as 3 for example, if the current network is still the fixed network and the network on-off state of the fixed network is the off state after the step 102 is continuously executed for 3 times, it is determined that the internet cannot be normally accessed through the fixed network at the current time. The mobile network is connected as a default wide area network to ensure continued access to the Internet.
And 104, if the current network is a mobile network and the network on-off state of the fixed network is a connected state, deleting the routing table entry of the mobile network and configuring the routing table entry for the fixed network.
The fixed network has the characteristic of being not easily influenced by the network environment relative to the mobile network, and if the current network is the mobile network and the network on-off state of the fixed network is the connected state, the internet can be normally accessed through the fixed network. And deleting the routing table entry of the mobile network, configuring the routing table entry for the fixed network, and connecting the fixed network as a default wide area network, so that the charging and the flow generated by using the mobile network are reduced. If the current network is a mobile network and the network on-off state of the fixed network is a disconnected state, the mode of accessing the Internet through the mobile network is maintained so as to ensure that the Internet can be continuously accessed.
As an example, the gateway device includes a second counter, and if the current network is a mobile network and the network on-off state of the fixed network is a connected state, deleting the routing table entry of the mobile network and configuring the routing table entry for the fixed network includes:
and if the current network is a mobile network and the network on-off state of the fixed network is a connected state, adding one to the count of the second counter, and repeatedly executing the steps of determining the network on-off state of the fixed network and the current network comprising the routing table items, deleting the routing table items of the mobile network until the count of the second counter reaches a second count threshold value, and configuring the routing table items for the fixed network.
The second count threshold may be any number of times, and is not limited herein. Taking the second count threshold as 3 for example, if the current network is still the mobile network and the network on-off state of the fixed network is the off state after continuously executing step 102 for 3 times, it is determined that the internet can be normally accessed through the fixed network at the current moment. The fixed network is used as a default wide area network for connection, so that the charging and the flow generated by using the mobile network are reduced.
As an example, after determining the network on-off state of the fixed network and the current network including the routing table entry, the method further includes:
when the network on-off state of the fixed network is the off state, sending a first message to a message receiver, and receiving a first response message sent by the message receiver;
if the first response message does not comprise the MAC address corresponding to the gateway address of the fixed network, deleting the gateway address of the fixed network and restarting the DHCP process;
and if the first response message comprises the MAC address corresponding to the gateway address of the fixed network, executing the steps of determining the network on-off state of the fixed network and the current network comprising the routing list item.
The MAC Address (Media Access Control Address, MAC Address) is used to uniquely identify a network card in the network. In the communication process, the MAC address and the IP address are in one-to-one correspondence. When receiving the data packet, the gateway device maps the IP address in the data packet into the MAC address, and sends the data packet to the device corresponding to the MAC address.
ARP (Address Resolution Protocol) is a Protocol for acquiring a MAC Address from an IP Address. And judging whether the MAC address corresponding to the IP address of the fixed network is obtained or not through the ARP message. And if the MAC address corresponding to the gateway address of the fixed network is not obtained, deleting the gateway address of the fixed network and restarting the DHCP process so as to redistribute the gateway address of the fixed network and avoid errors caused by gateway address conflict. If the MAC address corresponding to the gateway address of the fixed network is obtained, the gateway address of the fixed network is reserved, and step 102 is executed to wait for the network on-off state of the fixed network to be restored to the connection state from the disconnection state.
As an example, the determining the network on-off state of the fixed network includes:
sending a second message to a message receiver, and receiving a second response message sent by the message receiver;
if the second response message comprises the gateway address of the fixed network, determining that the network on-off state of the fixed network is a connected state;
and if the second response message does not comprise the gateway address of the fixed network, determining that the network on-off state of the fixed network is a disconnected state.
And sending the second message to a message receiver, and receiving and analyzing the second response message sent by the message receiver.
It should be understood that the second Message may be an icmp (Internet Control Message Protocol) Message, an ICMPv6(Internet Control Message Protocol version 6) Message, and the like, and is not limited herein. The message receiver may be any device that establishes a connection relationship with the gateway device, and is not limited herein. The gateway address may be an IP address, a DNS address, a MAC address, etc., and is not limited herein.
Taking the example that the message receiver sends the ICMP and the ICMPv6, if the response message includes gateway addresses such as IPv4 and IPv6, the network on-off state of the fixed network is determined to be a connected state. And if the response message does not contain the gateway address, determining that the network on-off state of the fixed network is the off state.
The application provides a network switching method, which is applied to gateway equipment, and establishes connection with a first wide area network corresponding to a fixed network and a second wide area network corresponding to a mobile network; determining the network on-off state of the fixed network and the current network comprising the routing table items; if the current network is a fixed network and the network on-off state of the fixed network is a disconnected state, deleting the routing table entry of the fixed network and configuring the routing table entry for the mobile network; and if the current network is a mobile network and the network on-off state of the fixed network is a connected state, deleting the routing table entry of the mobile network and configuring the routing table entry for the fixed network. The gateway equipment and the mobile network are kept in a communication state, and data are routed to the network configured with the routing table items in a mode of configuring the routing table items of the network, so that the switching time of the fixed network and the mobile network is reduced.
Example 2
Referring to fig. 2, fig. 2 is a schematic structural diagram of a network switching apparatus according to embodiment 2 of the present invention, which is applied to a gateway device, and the network switching apparatus 200 in fig. 2 includes:
a connection module 210, configured to establish a connection with a first wide area network corresponding to a fixed network and establish a connection with a second wide area network corresponding to a mobile network;
the determining module 220 is configured to determine a network on-off state of the fixed network and a current network including a routing table entry;
a mobile routing configuration module 230, configured to delete a routing table entry of the fixed network and configure a routing table entry for the mobile network if the current network is the fixed network and the network on-off state of the fixed network is the off state;
and a fixed routing configuration module 240, configured to delete a routing table entry of the mobile network and configure a routing table entry for the fixed network if the current network is the mobile network and the network on-off state of the fixed network is the connected state.
As an example, the mobile routing configuration module 230 is further configured to, if the current network is a fixed network and the network on-off state of the fixed network is an off state, increment a count of the first counter by one, and repeatedly perform the steps of determining the network on-off state of the fixed network and the current network including the routing table entry, delete the routing table entry of the fixed network and configure the routing table entry for the mobile network until the count of the first counter reaches a first count threshold.
As an example, the fixed routing configuration module 240 is further configured to, if the current network is a mobile network and the network on-off state of the fixed network is a connected state, increment a count of the second counter by one, and repeatedly perform the steps of determining the network on-off state of the fixed network and the current network including the routing table entry, until the count of the second counter reaches a second count threshold, delete the routing table entry of the mobile network, and configure the routing table entry for the fixed network.
As an example, the network switching apparatus 200 further includes:
the first message sending module is used for sending a first message to a message receiving party and receiving a first response message sent by the message receiving party when the network on-off state of the fixed network is a disconnected state;
the restarting module is used for deleting the gateway address of the fixed network and restarting the DHCP process if the first response message does not comprise the MAC address corresponding to the gateway address of the fixed network;
and the first execution module is used for executing the steps of determining the network on-off state of the fixed network and the current network comprising the routing table items if the first response message comprises the MAC address corresponding to the gateway address of the fixed network.
As an example, the determining module 220 is further configured to send a second message to a message receiver, and receive a second response message sent by the message receiver;
if the second response message comprises the gateway address of the fixed network, determining that the network on-off state of the fixed network is a connected state;
and if the second response message does not comprise the gateway address of the fixed network, determining that the network on-off state of the fixed network is a disconnected state.
As an example, the network switching apparatus 200 further includes:
and the second execution module is used for executing the steps of determining the network on-off state of the fixed network and the current network comprising the routing list items based on a preset time interval if the current network is the fixed network and the network on-off state of the fixed network is a connected state.
As an example, the network switching apparatus 200 further includes:
the link state acquisition module is used for acquiring the link on-off state of the fixed network;
the fixed network configuration module is used for starting a DHCP process and configuring a routing table item for the fixed network if the link on-off state of the fixed network is a connected state;
and the mobile network configuration module is used for configuring a routing table item for the mobile network if the link on-off state of the fixed network is a disconnection state.
The network switching apparatus 200 is configured to execute corresponding steps in the network switching method, and specific implementations of each function are not described one by one here. Note that the alternative example in embodiment 1 is also applied to the network switching apparatus 200 in embodiment 2.
The embodiment of the present application further provides a gateway device, which includes a processor and a memory, where the memory stores a program or an instruction, and the program or the instruction is executed by the processor, so that the gateway device executes the steps of the network switching method.
An embodiment of the present application further provides a computer-readable storage medium, where a program or an instruction is stored on the computer-readable storage medium, and when the program or the instruction is executed by a processor, the method implements the steps of the network handover method.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method can be implemented in other ways. The apparatus embodiments described above are merely illustrative and, for example, the flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In addition, each functional module or unit in each embodiment of the present invention may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
The functions, if implemented in the form of software functional modules and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention or a part of the technical solution that contributes to the prior art in essence can be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a smart phone, a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The above description is only for the specific embodiments of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present invention, and all the changes or substitutions should be covered within the scope of the present invention.
Claims (10)
1. A network switching method is applied to a gateway device, and comprises the following steps:
establishing connection with a first wide area network corresponding to the fixed network, and establishing connection with a second wide area network corresponding to the mobile network;
determining the network on-off state of the fixed network and the current network comprising the routing table items;
if the current network is a fixed network and the network on-off state of the fixed network is a disconnected state, deleting the routing table entry of the fixed network and configuring the routing table entry for the mobile network;
and if the current network is a mobile network and the network on-off state of the fixed network is a connected state, deleting the routing table entry of the mobile network and configuring the routing table entry for the fixed network.
2. The network switching method according to claim 1, wherein the gateway device includes a first counter, and if the current network is a fixed network and the network on-off state of the fixed network is an off state, deleting a routing table entry of the fixed network and configuring a routing table entry for the mobile network includes:
if the current network is a fixed network and the network on-off state of the fixed network is a disconnected state, adding one to the count of the first counter, and repeatedly executing the steps of determining the network on-off state of the fixed network and the current network comprising the routing list items,
and deleting the routing table entry of the fixed network and configuring the routing table entry for the mobile network until the count of the first counter reaches a first count threshold value.
3. The network switching method according to claim 1, wherein the gateway device includes a second counter, and the deleting the routing table entry of the mobile network and configuring the routing table entry for the fixed network if the current network is a mobile network and the network on-off state of the fixed network is a connected state includes:
if the current network is a mobile network and the network on-off state of the fixed network is a connected state, the counting of the second counter is increased by one, and the steps of determining the network on-off state of the fixed network and the current network comprising the routing list items are repeatedly executed,
and deleting the routing table entry of the mobile network and configuring the routing table entry for the fixed network until the count of the second counter reaches a second count threshold value.
4. The network switching method according to claim 1, wherein after determining the network on-off state of the fixed network and the current network including the routing table entry, the method further comprises:
when the network on-off state of the fixed network is the off state, sending a first message to a message receiver, and receiving a first response message sent by the message receiver;
if the first response message does not comprise the MAC address corresponding to the gateway address of the fixed network, deleting the gateway address of the fixed network and restarting the DHCP process;
and if the first response message comprises the MAC address corresponding to the gateway address of the fixed network, executing the steps of determining the network on-off state of the fixed network and the current network comprising the routing list item.
5. The network switching method according to claim 1, wherein the determining the network on-off state of the fixed network comprises:
sending a second message to a message receiver, and receiving a second response message sent by the message receiver;
if the second response message comprises the gateway address of the fixed network, determining that the network on-off state of the fixed network is a connected state;
and if the second response message does not comprise the gateway address of the fixed network, determining that the network on-off state of the fixed network is a disconnected state.
6. The network switching method according to claim 1, wherein after determining the network on-off state of the fixed network and the current network including the routing table entry, the method further comprises:
and if the current network is a fixed network and the network on-off state of the fixed network is a connected state, executing the steps of determining the network on-off state of the fixed network and the current network comprising the routing list items based on a preset time interval.
7. The network switching method according to claim 1, wherein after the connection is established with the first wide area network corresponding to the fixed network and the connection is established with the second wide area network corresponding to the mobile network, the determining of the network on-off state of the fixed network and the current network including the routing table entry further comprises:
acquiring the link on-off state of the fixed network;
if the link on-off state of the fixed network is a connected state, starting a DHCP process and configuring a routing table item for the fixed network;
and if the link on-off state of the fixed network is the off state, configuring a routing table entry for the mobile network.
8. A network switching apparatus, applied to a gateway device, the apparatus comprising:
the connection module is used for establishing connection with a first wide area network corresponding to the fixed network and establishing connection with a second wide area network corresponding to the mobile network;
the determining module is used for determining the network on-off state of the fixed network and the current network comprising the routing list items;
the mobile routing configuration module is used for deleting the routing table entry of the fixed network and configuring the routing table entry for the mobile network if the current network is the fixed network and the network on-off state of the fixed network is the off state;
and the fixed routing configuration module is used for deleting the routing table entry of the mobile network and configuring the routing table entry for the fixed network if the current network is the mobile network and the network on-off state of the fixed network is the connected state.
9. Gateway device, characterized in that it comprises a processor and a memory, said memory having stored thereon a program or instructions which, when executed by said processor, implement the steps of the network switching method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium has stored thereon a program or instructions which, when executed by a processor, implement the steps of the network switching method according to any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111315485.XA CN114024903A (en) | 2021-11-08 | 2021-11-08 | Network switching method and device and gateway equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111315485.XA CN114024903A (en) | 2021-11-08 | 2021-11-08 | Network switching method and device and gateway equipment |
Publications (1)
Publication Number | Publication Date |
---|---|
CN114024903A true CN114024903A (en) | 2022-02-08 |
Family
ID=80062487
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111315485.XA Pending CN114024903A (en) | 2021-11-08 | 2021-11-08 | Network switching method and device and gateway equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114024903A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115277410A (en) * | 2022-08-04 | 2022-11-01 | 深圳市共进电子股份有限公司 | Gateway adjusting method, device, electronic equipment and storage medium |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1719926A (en) * | 2004-07-06 | 2006-01-11 | 华为技术有限公司 | Wireless link detecting method |
US20080130572A1 (en) * | 2005-01-31 | 2008-06-05 | Junbiao Zhang | Local Mobility Solution With Wired and Wireless Interface Switching |
CN101764722A (en) * | 2009-12-21 | 2010-06-30 | 中兴通讯股份有限公司 | Method for detecting link and device and system thereof |
CN105871667A (en) * | 2016-03-24 | 2016-08-17 | 上海泓亚通信技术有限公司 | Network switching method of gateway device |
CN106470170A (en) * | 2015-08-21 | 2017-03-01 | 中兴通讯股份有限公司 | Method for switching network and device |
CN109889409A (en) * | 2019-03-15 | 2019-06-14 | 深圳市领佳物联科技有限公司 | Cable network and wireless network double copies chain-circuit system and implementation method |
CN112702202A (en) * | 2020-12-23 | 2021-04-23 | 南方电网数字电网研究院有限公司 | Ammeter communication link fault recovery method and device and computer equipment |
-
2021
- 2021-11-08 CN CN202111315485.XA patent/CN114024903A/en active Pending
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1719926A (en) * | 2004-07-06 | 2006-01-11 | 华为技术有限公司 | Wireless link detecting method |
US20080130572A1 (en) * | 2005-01-31 | 2008-06-05 | Junbiao Zhang | Local Mobility Solution With Wired and Wireless Interface Switching |
CN101764722A (en) * | 2009-12-21 | 2010-06-30 | 中兴通讯股份有限公司 | Method for detecting link and device and system thereof |
CN106470170A (en) * | 2015-08-21 | 2017-03-01 | 中兴通讯股份有限公司 | Method for switching network and device |
CN105871667A (en) * | 2016-03-24 | 2016-08-17 | 上海泓亚通信技术有限公司 | Network switching method of gateway device |
CN109889409A (en) * | 2019-03-15 | 2019-06-14 | 深圳市领佳物联科技有限公司 | Cable network and wireless network double copies chain-circuit system and implementation method |
CN112702202A (en) * | 2020-12-23 | 2021-04-23 | 南方电网数字电网研究院有限公司 | Ammeter communication link fault recovery method and device and computer equipment |
Non-Patent Citations (2)
Title |
---|
LEA LEHMANN: "Implementation of multimedia service mobility in fix/mobile converged networks", IEEE * |
陈天力: "固网移动网融合技术UMA的深入研究", 电信快报 * |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115277410A (en) * | 2022-08-04 | 2022-11-01 | 深圳市共进电子股份有限公司 | Gateway adjusting method, device, electronic equipment and storage medium |
CN115277410B (en) * | 2022-08-04 | 2024-04-12 | 深圳市共进电子股份有限公司 | Gateway adjustment method, device, electronic equipment and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP2169877A1 (en) | Processing method and device for qinq termination configuration | |
CN109156046B (en) | Home gateway and method for forwarding service thereof | |
EP2939399A1 (en) | Methods and systems for seamless network communications between ipv4 and ipv6 devices | |
CN103916484B (en) | The method and apparatus for configuring IP address | |
CN110752975A (en) | Network sharing method and device | |
CN113098722A (en) | Multi-network card management method, device and computer readable storage medium | |
CN105207909A (en) | Method for transmitting information and network apparatus | |
CN104426816B (en) | A kind of virtual machine communication method and device | |
CN114024903A (en) | Network switching method and device and gateway equipment | |
US7002932B1 (en) | Method and system for providing network connectivity and mobility while roaming | |
CN103051484B (en) | Session service processing method, system and Session Border Controll | |
CN107786441B (en) | Communication method, OpenFlow switch and communication system | |
WO2017161866A1 (en) | Network connection method and device | |
JP2009130501A (en) | Terminating device | |
CN102761425A (en) | Charging method and device | |
CN107666671B (en) | Method and device for detecting wrong connection based on TWAMP | |
CN110290230B (en) | Method, device and storage medium for detecting dialing mode supported by network environment | |
CN111654390B (en) | Data transmission method, device, terminal equipment and storage medium | |
KR101204339B1 (en) | A method and network connectivity device for opening a network link | |
CN115866650A (en) | Communication method, communication device, electronic equipment and readable storage medium | |
WO2010094882A1 (en) | Method for switching an access node | |
EP3200433A1 (en) | Ipv6 address management method, device and terminal | |
CN114553834B (en) | Interaction method and device of 5G core network and IMS network | |
CN106797565B (en) | Communication method, mobile network equipment, terminal, application server and system | |
CN113873503B (en) | Gateway bridging networking method, device and router |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20220208 |