Method and device for routing switching of communication equipment, communication equipment and storage medium
By setting the virtual gateway address in the ring network and informing external routes to the backbone network, the problem of traditional routing technology reconverging for a long time when new devices are added or network topology changes is solved, and fast routing handover and load balancing of communication devices are achieved.
Patent Information
- Application Number
- CN202211277962.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-19
- Publication Date
- 2025-05-06
- Estimated Expiration
- 2042-10-19
AI Technical Summary
When new devices are added or network topology changes, the routing reconvergence time is long and cannot meet the requirements of industrial communication for fast switching.
By setting the virtual gateway address in the ring network and notifying external routes to the backbone network, setting the previous hop as the virtual gateway address of the sending node, the routing handover of the communication device is realized.
It realizes fast routing and handover of communication equipment, meeting the high reliability and load balancing requirements of industrial communication.
Smart Images

Figure CN115941582B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communication technology, and in particular to a routing switching method for communication equipment, a routing switching device for communication equipment, a corresponding electronic device and a corresponding computer storage medium. Background Art
[0002] With the development of information technology, most fields such as industrial communications communicate through Ethernet. The traditional routing technology used by Ethernet can be mainly implemented based on routing selection methods or strategies. In traditional routing technology, routing selection algorithms are usually classified according to whether they can be adaptively adjusted with the network topology or communication volume. They are divided into static routing selection algorithms and dynamic routing selection algorithms. Static routing selection algorithms are non-adaptive routing selection algorithms, which only make decisions according to certain fixed rules to obtain simple routing selection algorithms, while dynamic routing selection is an adaptive routing selection algorithm, which mainly relies on the current network status information to make decisions, so that the routing selection results can use the changes in network topology and communication volume to a certain extent.
[0003] However, in traditional routing technology, even if the dynamic routing selection it adopts can adaptively perform routing selection based on the network topology, when new devices are added or the network topology changes, such as link interruption or interface abnormality, the routing re-convergence time is long and cannot meet the industrial communication requirements of rapid switching. Summary of the invention
[0004] In view of the above problems, embodiments of the present invention are proposed to provide a routing switching method of a communication device, a routing switching device of a communication device, a corresponding communication device and a corresponding computer storage medium that overcome the above problems or at least partially solve the above problems.
[0005] The embodiment of the present invention discloses a routing switching method for a communication device, wherein the communication device is connected to a backbone network based on a communication link, and multiple communication devices are connected end to end to form a ring network for direct communication, and the formed ring network includes an access node and a sending node. The method includes:
[0006] Determine an access node and obtain a gateway address of the access node; the gateway address is set based on a virtual gateway address of an intranet occupied by the access node;
[0007] Setting the gateway address of the communication device in the ring network to the virtual gateway address;
[0008] The external route to the communication device in the ring network is notified to the backbone network, wherein the previous hop of the route to the communication device in the ring network in the external routing message is set to the virtual gateway address of the sending node, so as to implement route switching of the communication device.
[0009] Optionally, the notifying the backbone network of an external route to the communication device in the ring network, wherein the previous hop of the route to the corresponding ring network communication device in the external routing message is set to be the virtual gateway address of the sending node, comprises:
[0010] Obtaining network segments of half of the communication devices in the ring network that set their gateway addresses to the virtual gateway address;
[0011] The next-hop gateway addresses of half of the communication devices in the ring network are set as the virtual gateway address of the sending node, so as to implement route switching of the communication devices under load balancing.
[0012] Optionally, the notifying the backbone network of an external route to the communication device in the ring network, wherein the previous hop of the route to the corresponding ring network communication device in the external routing message is set to be the virtual gateway address of the sending node, comprises:
[0013] When a link in the ring network that accesses the backbone network fails, obtaining a network segment of an unreachable communication device among the communication devices in the ring network that set the gateway address to the virtual gateway address;
[0014] The next-hop gateway address of the unreachable communication device in the ring network is set as the virtual gateway address of the sending node, so as to implement the route switching of the communication device in the event of a link failure in the backbone network.
[0015] Optionally, the notifying the backbone network of an external route to the communication device in the ring network, wherein the previous hop of the route to the corresponding ring network communication device in the external routing message is set to be the virtual gateway address of the sending node, comprises:
[0016] When a communication device in the ring network fails, obtaining a network segment of a communication device that is still working normally among the communication devices in the ring network whose gateway addresses are set to the virtual gateway addresses;
[0017] The next-hop gateway address of the communication device that is still working normally in the ring network is set as the virtual gateway address of the sending node, so as to implement route switching of the communication device in case of failure of the communication device in the ring network.
[0018] Optionally, the gateway address of the access node is also set based on a real gateway address of an intranet occupied by the access node, and the real gateway address is used to provide communication equipment in the ring network for communication, further comprising:
[0019] During the process of the communication equipment in the ring network communicating using the real gateway address, if it is detected that the heartbeat detection packet is lost for a preset number of consecutive times, it is determined that the communication equipment corresponding to the heartbeat detection packet being lost for the preset number of consecutive times fails.
[0020] Optionally, the determining the access node includes:
[0021] A node in the ring network with a device connected to the back end is determined as an access node.
[0022] Optionally, the backend is connected to a device based on the backend existing routing determination, and the determining of the node in the ring network where the backend is connected to a device as the access node includes:
[0023] If there are multiple nodes with devices connected to the back end in the ring network, the routes existing in the back end of each node are obtained to determine the physical address of each node, and the access node is determined according to the size of the physical address.
[0024] The embodiment of the present invention further discloses a routing switching device for a communication device, wherein the communication device is connected to a backbone network based on a communication link, and multiple communication devices are connected end to end to form a ring network for direct communication, and the formed ring network includes an access node and a sending node, and the device includes:
[0025] An access node determination module, used to determine an access node and obtain a gateway address of the access node; the gateway address is set based on a virtual gateway address of an intranet occupied by the access node;
[0026] A gateway address setting module, used to set the gateway address of the communication device in the ring network to the virtual gateway address;
[0027] The routing switching module is used to notify the backbone network of the external route to the communication device in the ring network, wherein the previous hop of the route to the communication device in the ring network in the external routing message is set to the virtual gateway address of the sending node to achieve routing switching of the communication device.
[0028] Optionally, the access node determination module includes:
[0029] The access node determination submodule is used to determine a node in the ring network with a device connected to the back end as an access node.
[0030] Optionally, the backend is connected to a device based on the backend existence routing determination, and the access node determination submodule includes:
[0031] The access node determination unit is used to obtain the routes existing in the back end of each node to determine the physical address of each node when there are multiple nodes with devices connected to the back end in the ring network, and determine the access node according to the size of the physical address.
[0032] Optionally, the routing switching module includes:
[0033] A first communication network segment acquisition submodule, used to acquire network segments of half of the communication devices in the ring network whose gateway addresses are set to the virtual gateway addresses;
[0034] The first device routing switching submodule is used to set the next-hop gateway addresses of half of the communication devices in the ring network to the virtual gateway address of the sending node, so as to implement routing switching of the communication devices under load balancing.
[0035] Optionally, the routing switching module includes:
[0036] A second communication network segment acquisition submodule is used to acquire a network segment of an unreachable communication device among the communication devices in the ring network whose gateway addresses are set to the virtual gateway addresses when a link in the ring network accessing the backbone network fails;
[0037] The second device routing switching submodule is used to set the next-hop gateway address of the unreachable communication device in the ring network to the virtual gateway address of the sending node, so as to implement routing switching of the communication device in the event of a link failure in the backbone network.
[0038] Optionally, the routing switching module includes:
[0039] A third communication network segment acquisition submodule is used for acquiring the network segment of the communication device that is still working normally among the communication devices in the ring network whose gateway addresses are set to the virtual gateway addresses when a communication device in the ring network fails;
[0040] The third device routing switching submodule is used to set the next-hop gateway address of the communication device that is still working normally in the ring network to the virtual gateway address of the sending node, so as to implement routing switching of the communication device in the event of a failure of the communication device in the ring network.
[0041] Optionally, the gateway address of the access node is also set based on the real gateway address of the intranet occupied by the access node, and the real gateway address is used to provide communication equipment in the ring network for communication, and the routing switching module further includes:
[0042] The device fault detection submodule is used to determine that the communication device corresponding to the heartbeat detection packet loss for a consecutive preset number of times has a fault if it is detected that the heartbeat detection packet has been lost for a consecutive preset number of times during the process of the communication device in the ring network using the real gateway address for communication.
[0043] An embodiment of the present invention further discloses a communication device, comprising: a processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein when the computer program is executed by the processor, any one of the routing switching methods of the communication device is implemented.
[0044] The embodiment of the present invention further discloses a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, any one of the routing switching methods for the communication device is implemented.
[0045] The embodiments of the present invention include the following advantages:
[0046] In an embodiment of the present invention, a communication device can be connected to a backbone network based on a communication link, and multiple communication devices are connected end to end to form a ring network for direct communication. At this time, a gateway address set based on a virtual gateway address of an intranet occupied by an access node can be obtained to set the gateway address of a communication device in the ring network to the virtual gateway address of the access node, so as to ensure that the communication devices in the ring network are in the same intranet or local area network, and notify the backbone network of an external route to reach the communication devices in the ring network, wherein the previous hop of the route to the communication device in the ring network in the external routing message is set to be the virtual gateway address of the sending node, and by dividing the network segments of the virtual gateway addresses set for the communication devices in the formed ring network, and combining the setting of the previous hop routing address of the route to the communication device in the notified external routing message, the routing switching of the communication device is realized, so as to achieve the purpose of load balancing and fast switching of unicast routing. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] Figure 1 It is a schematic diagram of a network formed by communication devices for implementing route switching provided by an embodiment of the present invention;
[0048] Figure 2 is a flowchart of a method for routing switching of a communication device according to an embodiment of the present invention;
[0049] Figure 3 This is an application scenario diagram of the routing switching method for a communication device provided by an embodiment of the present invention;
[0050] Figure 4 It is a structural block diagram of an embodiment of a routing switching device of a communication device of the present invention. DETAILED DESCRIPTION
[0051] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0052] To facilitate those skilled in the art to understand the present invention, the following explains the terms or nouns involved in the following embodiments of the present invention:
[0053] Redundant Ring Network Protocol: It is an Ethernet high-speed redundancy technology. This technology can not only ensure that the communication can be restored within milliseconds when the network encounters a failure, but also issue an alarm when the ring network link is disconnected.
[0054] HSR protocol: High-availability Seamless Redundancy, a high-availability seamless redundancy protocol that provides a redundant backup mechanism for seamless switching of network links.
[0055] ERPS protocol: Ethernet Ring Protection Switching, Ethernet multi-ring protection switching protocol, which defines RAPS (Ring Auto Protection Switching) protocol messages and protection switching mechanisms. It supports not only single-ring networking, but also multi-ring networking such as intersecting rings, and can achieve interoperability with equipment from other manufacturers.
[0056] Spanning Tree Protocol: Spanning Tree Protocol, referred to as STP protocol, is a communication protocol that works in the second layer (data link layer) of the OSI (Open System Internetwork Reference Model, OSI reference model, a reference model of the seven-layer framework of network interconnection, i.e., the Open System Interconnection Reference Model) network model. Its basic application is to prevent loops caused by redundant links of switches. It is mainly used to ensure a loop-free logical topology in Ethernet, thereby avoiding broadcast storms and occupying a large amount of switch resources. It can include RSTP protocol (Rapid Spanning Tree Protocol, used to eliminate data link layer physical loops in LAN) and MSTP protocol (Multiple Spanning Tree Protocol, mainly to solve Ethernet loop problems by generating multiple spanning trees).
[0057] VLAN: Virtual Local Area Network, refers to a communication technology that logically divides a physical LAN into multiple broadcast domains, that is, a LAN is divided into multiple logical VLANs, each VLAN is a broadcast domain, hosts within a VLAN can communicate directly, but VLANs cannot communicate directly with each other, and broadcast messages are limited to a single VLAN, which can solve the problem of serious conflicts caused by a large number of hosts, while isolating broadcast messages and improving network quality.
[0058] PC:Personal Computer.
[0059] IP: Internet Protocol, which can provide information of various protocols to the transport layer, such as TCP (Transmission Control Protocol) and UDP (User Datagram Protocol), etc.; it can put IP information packets into the link layer and transmit them through various technologies such as Ethernet and token ring network.
[0060] MAC address: Media Access Control Address, also known as LAN Address, Ethernet Address or Physical Address, is mainly used to confirm the location of network devices.
[0061] OSPF protocol: Open Shortest Path First, is an interior gateway protocol (IGP) of a router selection protocol. It is usually used to make routing decisions within a single autonomous system (AS) and is an implementation of a link state routing protocol.
[0062] DHCP protocol: Dynamic Host Configuration Protocol, is a network protocol for a local area network. It refers to a range of IP addresses controlled by a server. When a communication device logs into the server, it can automatically obtain the IP address and subnet mask assigned by the server.
[0063] OAM protocol: Operation Administration and Maintenance, operation, maintenance and management protocol. Ethernet OAM technology is implemented in a hierarchical manner and is divided into link-level Ethernet OAM technology and network-level Ethernet OAM technology. Link-level Ethernet OAM technology is used to monitor the link status between the user network and the operator network, and network-level Ethernet OAM technology is used to monitor the connectivity of the entire network and locate network connectivity failures.
[0064] ARP: Address Resolution Protocol, is a TCP / IP protocol that obtains the physical address based on the IP address.
[0065] Gateway address: It is essentially the IP address that connects one network to other networks. Without a router, TCP / IP communication is not possible between the two networks. Even if the two networks are connected to the same switch (or hub), the TCP / IP protocol will determine that the hosts in the two networks are in different networks based on the subnet mask. Communication between the two networks is required through a gateway, which is specifically achieved through gateway forwarding. The IP address of the gateway is the IP address of the device with routing function.
[0066] With the development of information technology, the reliability requirements of Ethernet communication in the fields of industrial communication are getting higher and higher. For example, when the LAN communication equipment or line fails, the fault switching time must be within ms; when there are redundant access channels, the channel links must be used efficiently to achieve balanced distribution of network resources; and when new devices are connected to the network, they must be opened immediately. However, in traditional routing technology, when new devices are added or the network topology changes, such as link interruption or interface abnormality, the routing reconvergence time is long, which cannot meet the aforementioned industrial communication application requirements.
[0067] The embodiment of the present invention provides a communication device capable of achieving high-reliability load balancing and fast fault switching, referring to Figure 1 , showing a network schematic diagram composed of communication devices for implementing route switching provided in an embodiment of the present invention. The communication devices can be connected to a backbone network based on a communication link. The communication devices are specifically composed of a ring network module, a three-layer switching module, and a control circuit.
[0068] Among them, the ring network module is responsible for forming a ring network between multiple communication devices for mutual communication; the three-layer switching module is specifically manifested as a three-layer switch, which is mainly responsible for completing the second-layer forwarding and third-layer forwarding functions; the control circuit is responsible for controlling and managing the switching routing strategy.
[0069] Specifically, when the ring network module forms a ring network with multiple communication devices for mutual communication, a redundant ring network protocol is usually used to connect the three-layer switching modules end to end. For example, the three-layer switch of the communication device is connected to the three-layer switch of communication device 2 and the three-layer switch of communication device 3 respectively through the ring network module of communication device 1 via the ring network module of communication device 2 and the ring network module of communication device 3 respectively. For the ring network module of communication device 1, it belongs to the communication direction of receiving data for the ring network module of communication device 2, and belongs to the communication direction of sending data for the ring network module of communication device 3. At this time, since the ring network device in any communication device belongs to the communication direction of sending data for its own three-layer switch, then for the ring network module of communication device 1, it connects communication device 1, communication device 2 and communication device 3 end to end. Similarly, communication device 1, communication device 3 and communication device 5 are connected end to end, communication device 3, communication device 5 and communication device 7 are connected end to end, and so on. Figure 1 All the communication devices shown are connected end to end, and a ring network is formed between multiple communication devices, so that multiple communication devices can share link bandwidth. The ring network formed by them is more flexible in wiring than a star network.
[0070] In practical applications, such as Figure 1 When the network formed by the communication devices shown is working normally, the ring network module can usually send communication data to the left and right at the same time. For example, for the ring network module of communication device 1, its communication direction to the left is sent through the ring network module to its own three-layer switch module, and its communication direction to the right is sent through the ring network module to the ring network module of communication device 3; for the ring network module of communication device 8, its communication direction to the left is sent through the ring network module to the ring network module of communication device 7, and its communication direction to the right is sent through the ring network module to its own three-layer switch module, that is, based on the ring network formed by multiple communication devices and the ring-type sending direction in each communication device, communication data transmission between different communication devices in the ring network is realized. Specifically, when working normally, the sending node will remove redundant messages from the transmitted communication data, and then divide the physical groups according to the physical location of the node using the distributed grouping idea according to the HSR protocol, and upload the communication data after removing the redundant messages to the opposite receiving node, which is determined based on the destination IP address of the communication data.
[0071] Among them, under normal working conditions, the ring network modules of each communication device have data sending directions to the left and to the right at the same time, that is, the formed ring network has a ring-shaped sending direction. When one direction of the ring network is blocked, for example, a communication link failure or a communication device failure occurs, based on the existence of the ring-shaped sending direction, communication can be carried out in another direction to ensure fast switching when switching the communication device. At the same time, when there are redundant access channels, based on the ring-shaped sending direction, the channel links can be efficiently utilized to achieve balanced allocation of network resources.
[0072] Furthermore, in the network formed by the communication devices proposed in the embodiment of the present invention, unlike the traditional switch ring network protocol, such as Ethernet Multi-Ring Protection Switching Protocol (ERPS) or Spanning Tree Protocol (RSTP\MSTP), the redundant ring network protocol adopted makes it possible for the communication devices to not require any switch configuration when forming the network, that is, not requiring a large amount of configuration, so as to improve the switching time of the communication devices and ensure fast switching when switching the communication devices. Specifically, when multiple communication devices are directly communicating by connecting end to end to form a ring network, the three-layer switch module of each communication device can directly obtain an IP address through a back-end DHCP server to communicate with the gateway. At this time, the gateway can send the IP resource pool of each communication device in a unicast manner, and each communication device can act as a DHCP server to send the resource pool to the downstream network terminal device, such as a computer PC. The new device does not need any configuration after being newly connected to the ring network, meeting the high requirement of immediate activation.
[0073] It should be noted that if Figure 1 The network formed by the communication devices shown is only an example, and the specific number of ring networks is mainly determined based on actual needs. All communication devices are connected to the backbone network based on communication links, and multiple communication devices are connected end to end to form a ring network for direct communication, so as to realize the sharing of the ring network bandwidth. This is not limited in the embodiments of the present invention.
[0074] The control circuit is responsible for controlling and managing the switching routing strategy, such as Figure 1As shown, it can be specifically manifested as the three-layer switching module dividing two LAN VLANs, including dividing the network terminal device (such as a computer PC) and the interface of the ring network module into a lower VLAN, and accessing the backbone network into an upper VLAN. Among them, the network segment network resource for the PC machine is a 16-bit mask, for example, the IP address assigned to the lower VLAN by the communication device 1 is 11.11.111.1 / 16, and the IP address assigned to the lower VLAN by the communication device 2 is 11.11.111.17 / 16, and so on. All communication devices in the ring network are in the same 16-bit network, that is, 11.11.0.0 / 16. At this time, all the intranet devices in the lower VLAN can achieve intercommunication based on the divided network segment; and the gateway address assigned to the upper VLAN by each communication device, that is, the IP address, can include a real IP address and a virtual IP address. The real IP address is used to manage the local communication device and communicate with other communication devices in the ring network, and the virtual IP address is used as the gateway address for back-end communication.
[0075] In the embodiment of the present invention, the network formed by the communication equipment proposed in the embodiment of the present invention realizes the random access of the communication equipment by designing the communication equipment with the ring network module and the three-layer switching module adopting the HSR protocol, and the high requirement of immediate activation is met. Moreover, based on the overall ring network formed, the fault switching time requirement of ms level can be met when the communication equipment and line of the local area network fail, and when there are redundant access channels, the requirement of balanced allocation of network resources can be met by efficiently utilizing the channel links, which meets the high reliability requirements of Ethernet communication in the fields of industrial communication and so on.
[0076] Reference Figure 2 , showing a flow chart of the steps of a method for routing switching of a communication device according to an embodiment of the present invention, involving Figure 1 The network diagram formed by the communication devices shown may specifically include the following steps:
[0077] Step 201, determine the access node and obtain the gateway address of the access node;
[0078] In the network formed by the communication devices proposed in the embodiment of the present invention, the communication devices are connected to the backbone network based on the communication link, and multiple communication devices are connected end to end to form a ring network for direct communication, thereby sharing the ring network bandwidth.
[0079] When the ring network operates normally, the ring network generally includes an access node and a sending node. The access node may refer to a node that can communicate in the ring network formed by multiple communication devices, which may be any node on the communication link, including a communication device on the communication link, an intermediate node on the communication link formed by two communication devices, etc. The sending node may refer to a node used to send communication data, which may also be any node on the communication link, and the embodiments of the present invention are not limited to this.
[0080] In actual applications, all communication devices in the ring network can communicate with each other based on the divided network segments. The specific method of communication requires obtaining the gateway address of the access node and setting the corresponding gateway address for the communication devices in the ring network, that is, communication between networks is achieved based on the gateway settings.
[0081] In an embodiment of the present invention, in order to obtain the gateway address of the access node, the access node needs to be determined first.
[0082] The way to determine the access node is that in order to achieve unicast load balancing and ensure fast switching, each node has an external virtual address, and the communication equipment in the ring network can elect the access point according to the external connection situation and MAC address strategy. Usually, the nodes with devices connected to the back end in the ring network, such as network terminal devices (expressed as PCs), communication devices, etc., can be determined as access nodes. Since each node has an external virtual gateway address, the virtual IP address can be used as the gateway address for back-end communication. Then, the back-end connected device can be determined based on the existence of the route at the back end of the node. At this time, there may be a situation where multiple devices in the ring network are connected to the back end. In this case, the access node can be determined by comparing the routing overhead of the back-end destination and the size of the physical address.
[0083] It should be noted that the specific method of determining the access node according to the size of the physical address can be expressed as selecting the access node in the order of equal priority from large to small or from small to large, and there is no fixed situation. This is not limited in the embodiment of the present invention.
[0084] Step 202, setting the gateway address of the communication device in the ring network as the virtual gateway address;
[0085] In one embodiment of the present invention, the gateway address of the access node is mainly set based on the virtual gateway address and the real gateway address of the intranet occupied by the access node. The virtual gateway address and the real gateway address can be mainly set through the device of the access node. At this time, the gateway address of the communication device in the ring network can be set to the virtual gateway address, and the communication device in the ring network can use the real gateway address to realize the communication within the ring network, as well as the mutual discovery and synchronization resources of each device in the ring network.
[0086] Step 203, announcing the external route to the communication device in the ring network to the backbone network, wherein the previous hop of the route to the communication device in the ring network in the external route message is set to the virtual gateway address of the sending node, so as to implement route switching for the communication device.
[0087] In order to realize the route switching of communication equipment and ensure that the communication equipment in the ring network is in the same intranet or local area network, the network segment is divided by the virtual gateway address set by the communication equipment in the ring network, and combined with the setting of the previous hop route address of the route to the ring network communication equipment in the announced external routing message, that is, the control right of the virtual gateway address is switched based on the set routing address, so as to realize the route switching of the communication equipment and achieve the purpose of load balancing and fast switching of unicast routing.
[0088] Specifically, after setting the gateway addresses of the communication devices in the ring network, including all PCs in the ring network, to the virtual gateway address of the access node, and realizing intercommunication among all communication devices in the ring network, it realizes data routing from external devices to the ring network based on the published external routes of the network segments of the communication devices in the ring network.
[0089] Among them, when publishing routes to the outside, the previous hop of the route to the ring network communication device in the external routing message is set to the virtual gateway address of the sending node. For the terminal in the ring network, it can be expressed as setting the next hop gateway address of the communication device in the ring network to the local machine, that is, the virtual gateway address of the sending node. That is, at this time, the last hop gateway address of the communication device in the ring network to the local network segment can be set to this node.
[0090] In one case, the network segments of half of the communication devices in the ring network that set the gateway address as a virtual address can be obtained, and the external routes of the network segments reaching half of the communication devices in the ring network can be notified to the backbone network. At this time, the next-hop gateway addresses of half of the communication devices in the ring network can be set as the virtual gateway address of the sending node, occupying the virtual gateway address of the access node, thereby realizing route switching of the communication devices under load balancing.
[0091] In actual applications, the virtual gateway address occupied by the access node in the intranet can be used as the gateway address, and the gateway addresses of all PCs in the ring network can be set to the virtual intranet address. At this time, all nodes in the ring network run the OSPF protocol, and the external routes of the 28-bit mask network segment of half of the communication devices in the ring network can be notified to the backbone network through the sending node, and the next hop of a certain access node through the network segment 11.11.111.1 / 28 is set as the virtual IP address of this node, thereby switching the control of the virtual gateway address to achieve load balancing. It should be noted that there are two devices responsible for external forwarding in the ring network, and each device is responsible for the external transfer of half of the devices. At this time, the network segment is a 28-bit mask, not a 16-bit mask, and obtaining half of the communication devices is to fully utilize the link bandwidth resources for load balancing.
[0092] In another case, when a link in the ring network that accesses the backbone network fails, the network segment of the communication device in the ring network that sets the gateway address as the virtual gateway address can be obtained. Since some communication devices are unreachable due to the failed link, the external route to the unreachable communication device can be notified to the backbone network. At this time, the gateway address of the next hop of the network segment of the unreachable communication device in the ring network can be set to the virtual gateway address of the sending node, and the control of the virtual gateway address can be switched to realize route switching of the communication device when the communication link fails, thereby achieving the purpose of fault switching of the communication device.
[0093] In actual applications, when a communication link connected to the backbone network fails, the access nodes can quickly synchronize information. At this time, the 28-bit mask network segment of the unreachable device can be announced through the OSPF external routing method, and the next hop of the external route is set to the virtual IP address of this node, thereby achieving rapid switching. Among them, the failure of the communication link can usually be detected by hardware, specifically when the optical module detects that the communication link is disconnected, the hardware reports it; or by running the OAM protocol on the back-end device and performing heartbeat judgment. When the back-end device does not receive the heartbeat detection packet for a preset number of consecutive times, such as 3 times, it can be considered that the communication link connected to this back-end device has failed.
[0094] In another case, when a communication device in a ring network fails, the network segment of the communication device that is still working properly among the communication devices in the ring network that set the gateway address to the virtual gateway address can be obtained, and the network segment of the external route that reaches the communication device that is still working properly can be notified to the backbone network. At this time, the next-hop gateway address of the communication device that is still working properly in the ring network can be set to the virtual gateway address of the sending node, and the control of the virtual gateway address can be switched to achieve the route switching of the communication device when the communication device fails, so as to achieve the purpose of fault switching of the communication device. Specifically, when a communication device in a ring network fails, the backup node, such as the communication device that is still working properly among the communication devices in the ring network that set the gateway address to the virtual gateway address, can occupy the virtual gateway address of the failed access node and republish the route and free ARP message.
[0095] In actual applications, each communication device knows the routes it is responsible for. The device that fails can sense that it has no routes to the backend. At this time, it will notify other devices that the devices it is responsible for are unreachable. When the heartbeat between the access devices is predicted to be lost for consecutive times, such as 3 times, it is determined that the access device has failed. At this time, all 28-bit mask segments in the ring network can be notified through the OSPF external routing method through the access node that is still working normally, and the next hop of the external route of the communication device is set to the virtual IP of this node, so as to achieve fast switching when the device fails. This kind of fault switching is fast and is not affected by the size of the network.
[0096] In an embodiment of the present invention, a communication device can be connected to a backbone network based on a communication link, and multiple communication devices are connected end to end to form a ring network for direct communication. At this time, a gateway address set based on the virtual gateway address of the intranet occupied by the access node can be obtained to set the gateway address of the communication device in the ring network to the virtual gateway address of the access node, so as to ensure that the communication devices in the ring network are in the same intranet or local area network, and notify the backbone network of the external route to the communication device in the ring network, wherein the previous hop of the route to the communication device in the ring network in the external routing message is set to the virtual gateway address of the sending node, and the network segmentation is performed on the virtual gateway address set by the communication device in the formed ring network, and combined with the setting of the previous hop routing address of the route to the communication device in the ring network in the notified external routing message, the routing switching of the communication device is realized, so as to achieve the purpose of load balancing and fast switching of unicast routing.
[0097] Reference Figure 3 , which shows an application scenario diagram of the method for implementing routing switching of a communication device provided by an embodiment of the present invention, can be applied to scenarios such as industrial control that require high communication reliability, specifically involving Figure 1 Schematic diagram of a network composed of communication devices shown.
[0098] Assuming that the connected devices include communication devices 1-4, at this time, the communication devices 1-4 can be connected end to end based on the ring network module to form a ring network for direct communication. In the scenario of industrial control, when a new access device is required, for example, when a new communication device 5 is newly accessed, it can also be connected end to end with the original ring network based on the ring network module. At this time, the gateway address set based on the virtual gateway address of the intranet occupied by the access node can be obtained to set the gateway address of the communication device in the ring network to the virtual gateway address of the access node, so as to ensure that the communication devices in the ring network are in the same intranet or local area network, and notify the backbone network of the external route to the communication device in the ring network, wherein the previous hop of the route to the corresponding ring network communication device in the external routing message is set to the virtual gateway address of the sending node, and the virtual gateway address set by the communication device in the constituted ring network is divided into network segments, and combined with the setting of the previous hop route address of the route to the corresponding ring network communication device in the notified external routing message, the route switching of the communication device is realized, so as to achieve the purpose of load balancing and fast switching of unicast routes.
[0099] Specifically, when implementing load balancing routing switching, the access node, such as communication device 2, can be determined and the virtual gateway address of the access node can be obtained. Then, the network segments of all communication devices in the ring network, including the network segments of communication devices 1-5, can be set to the virtual intranet address of the access node. At this time, load balancing can be achieved using half of the number of devices. Then, the external routes of the devices in the ring network can be announced to the backbone network, and then the external routes of the 28-bit mask network segments of half of the communication devices, that is, the next hop of their external routes is set to this node through the network segment 11.11.111.1 / 28, such as the virtual IP address of the newly accessed setting 5.
[0100] Similarly, when performing a failover, the routing switch of the communication device can also be implemented based on the set next-hop routing address, so as to achieve the purpose of load balancing and fast switching of unicast routing.
[0101] Specifically, when the communication link accessing the backbone network fails, the external route of the device in the ring network can be announced to the backbone network, and then the external route of the 28-bit mask network segment of the unreachable device, that is, the next hop of its external route is set to this node through the network segment 11.11.111.1 / 28, such as the newly accessed virtual IP address of setting 5; when the accessed device fails, all 28-bit mask network segments in the ring network can be announced through the access node that is still working normally through the OSPF external routing method, that is, the next hop of its external route is set to this node through the network segment 11.11.111.1 / 28, such as the newly accessed virtual IP address of setting 5, to achieve fault switching.
[0102] In an embodiment of the present invention, a communication device can be connected to a backbone network based on a communication link, and multiple communication devices are connected end to end to form a ring network for direct communication. At this time, a gateway address set based on the virtual gateway address of the intranet occupied by the access node can be obtained to set the gateway address of the communication device in the ring network to the virtual gateway address of the access node, so as to ensure that the communication devices in the ring network are in the same intranet or local area network, and notify the backbone network of the external route to the communication device in the ring network, wherein the previous hop of the route to the communication device in the ring network in the external routing message is set to the virtual gateway address of the sending node, and the network segmentation is performed on the virtual gateway address set by the communication device in the formed ring network, and combined with the setting of the previous hop routing address of the route to the communication device in the ring network in the notified external routing message, the routing switching of the communication device is realized, so as to achieve the purpose of load balancing and fast switching of unicast routing.
[0103] It should be noted that, for the sake of simplicity, the method embodiments are described as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.
[0104] Reference Figure 4 , shows a structural block diagram of an embodiment of a routing switching device of a communication device of the present invention, wherein the communication device is connected to a backbone network based on a communication link, and multiple communication devices are connected end to end to form a ring network for direct communication, and the formed ring network includes an access node and a sending node, and specifically may include the following modules:
[0105] The access node determination module 401 is used to determine the access node and obtain the gateway address of the access node; the gateway address is set based on the virtual gateway address of the intranet occupied by the access node;
[0106] A gateway address setting module 402, used to set the gateway address of the communication device in the ring network to the virtual gateway address;
[0107] The route switching module 403 is used to notify the backbone network of the external route to the communication device in the ring network, wherein the previous hop of the route to the communication device in the ring network in the external route message is set to the virtual gateway address of the sending node to implement route switching for the communication device.
[0108] In an embodiment of the present invention, the access node determination module 401 may include the following submodules:
[0109] The access node determination submodule is used to determine a node in the ring network with a device connected to the back end as an access node.
[0110] In one embodiment of the present invention, the backend is connected to a device based on the backend existing routing determination, and the access node determination submodule may include the following units:
[0111] The access node determination unit is used to obtain the routes existing in the back end of each node to determine the physical address of each node when there are multiple nodes with devices connected to the back end in the ring network, and determine the access node according to the size of the physical address.
[0112] In an embodiment of the present invention, the routing switching module 403 may include the following submodules:
[0113] A first communication network segment acquisition submodule, used to acquire network segments of half of the communication devices in the ring network whose gateway addresses are set to the virtual gateway addresses;
[0114] The first device routing switching submodule is used to set the next-hop gateway addresses of half of the communication devices in the ring network to the virtual gateway address of the sending node, so as to implement routing switching of the communication devices under load balancing.
[0115] In an embodiment of the present invention, the routing switching module 403 may include the following submodules:
[0116] A second communication network segment acquisition submodule is used to acquire a network segment of an unreachable communication device among the communication devices in the ring network whose gateway addresses are set to the virtual gateway addresses when a link in the ring network accessing the backbone network fails;
[0117] The second device routing switching submodule is used to set the next-hop gateway address of the unreachable communication device in the ring network to the virtual gateway address of the sending node, so as to implement routing switching of the communication device in the event of a link failure in the backbone network.
[0118] In an embodiment of the present invention, the routing switching module 403 may include the following submodules:
[0119] A third communication network segment acquisition submodule is used for acquiring the network segment of the communication device that is still working normally among the communication devices in the ring network whose gateway addresses are set to the virtual gateway addresses when a communication device in the ring network fails;
[0120] The third device routing switching submodule is used to set the next-hop gateway address of the communication device that is still working normally in the ring network to the virtual gateway address of the sending node, so as to implement routing switching of the communication device in the event of a failure of the communication device in the ring network.
[0121] In one embodiment of the present invention, the gateway address of the access node is also set based on the real gateway address of the intranet occupied by the access node, and the real gateway address is used to provide communication equipment in the ring network for communication. The routing switching module 403 may also include the following submodules:
[0122] The device fault detection submodule is used to determine that the communication device corresponding to the heartbeat detection packet loss for a consecutive preset number of times has a fault if it is detected that the heartbeat detection packet has been lost for a consecutive preset number of times during the process of the communication device in the ring network using the real gateway address for communication.
[0123] In an embodiment of the present invention, a communication device can be connected to a backbone network based on a communication link, and multiple communication devices are connected end to end to form a ring network for direct communication. The switching implementation device of the communication device proposed in the embodiment of the present invention can obtain a gateway address set based on the virtual gateway address of the intranet occupied by the access node, so as to set the gateway address of the communication device in the ring network to the virtual gateway address of the access node, and ensure that the communication devices in the ring network are in the same intranet or local area network. When the external route to the communication device in the ring network is notified to the backbone network, the previous hop of the route to the communication device in the ring network in the external routing message is set to the virtual gateway address of the sending node, and the network segmentation is performed on the virtual gateway address set by the communication device in the formed ring network, and combined with the setting of the previous hop route address of the route to the communication device in the ring network in the notified external routing message, the route switching of the communication device is realized, and the purpose of load balancing and fast switching of unicast routes is achieved.
[0124] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0125] An embodiment of the present invention further provides a communication device, including:
[0126] It includes a processor, a memory, and a computer program stored in the memory and capable of running on the processor. When the computer program is executed by the processor, each process of the routing switching method embodiment of the above-mentioned communication device is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0127] An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, each process of the routing switching method embodiment of the above-mentioned communication device is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0128] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0129] It will be appreciated by those skilled in the art that the embodiments of the present invention may be provided as methods, devices, or computer program products. Therefore, the embodiments of the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the embodiments of 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 codes.
[0130] The embodiments of the present invention are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0131] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0132] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0133] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present invention.
[0134] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.
[0135] The routing switching method of a communication device, a routing switching device of a communication device, a corresponding communication device and a corresponding computer storage medium provided by the present invention are introduced in detail above. Specific examples are used in this article to illustrate the principle and implementation mode of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation mode and application scope. In summary, the content of this specification should not be understood as limiting the present invention.
Claims
1. A routing switching method for a communication device, characterized in that: The communication device is connected to the backbone network based on a communication link, and multiple communication devices are connected end to end to form a ring network for direct communication. The formed ring network includes an access node and a sending node. The method includes: Determine an access node and obtain a gateway address of the access node; the gateway address is set based on a virtual gateway address of an intranet occupied by the access node; Setting the gateway address of the communication device in the ring network to the virtual gateway address; Notifying the backbone network of an external route to the communication device in the ring network, wherein the previous hop of the route to the communication device in the ring network in the external routing message is set to be the virtual gateway address of the sending node, so as to implement route switching of the communication device; Among them, notifying the backbone network of the external route to the communication device in the ring network, wherein the previous hop of the route to the corresponding ring network communication device in the external route message is set to the virtual gateway address of the sending node, includes: When a link in the ring network that accesses the backbone network fails, obtaining a network segment of an unreachable communication device among the communication devices in the ring network that set the gateway address to the virtual gateway address; The next-hop gateway address of the unreachable communication device in the ring network is set as the virtual gateway address of the sending node, so as to implement the route switching of the communication device in the event of a link failure in the backbone network.
2. The method according to claim 1, characterized in that The step of notifying the backbone network of an external route to the communication device in the ring network, wherein the previous hop of the route to the communication device in the ring network in the external route message is set to be the virtual gateway address of the sending node, comprises: Obtaining network segments of half of the communication devices in the ring network that set their gateway addresses to the virtual gateway address; The next-hop gateway addresses of half of the communication devices in the ring network are set as the virtual gateway address of the sending node, so as to implement route switching of the communication devices under load balancing.
3. The method according to claim 1 or 2, characterized in that: The step of notifying the backbone network of an external route to the communication device in the ring network, wherein the previous hop of the route to the communication device in the ring network in the external route message is set to be the virtual gateway address of the sending node, comprises: When a communication device in the ring network fails, obtaining a network segment of a communication device that is still working normally among the communication devices in the ring network whose gateway addresses are set to the virtual gateway addresses; The next-hop gateway address of the communication device that is still working normally in the ring network is set as the virtual gateway address of the sending node, so as to implement route switching of the communication device in case of failure of the communication device in the ring network.
4. The method according to claim 3, characterized in that The gateway address of the access node is also set based on the real gateway address of the intranet occupied by the access node, and the real gateway address is used to provide communication equipment in the ring network for communication, and further includes: During the process of the communication equipment in the ring network communicating using the real gateway address, if it is detected that the heartbeat detection packet is lost for a preset number of consecutive times, it is determined that the communication equipment corresponding to the heartbeat detection packet being lost for the preset number of consecutive times fails.
5. The method according to claim 1, characterized in that The determining of the access node comprises: A node in the ring network with a device connected to the back end is determined as an access node.
6. The method according to claim 5, characterized in that The device connected to the backend is determined based on the backend existence route, and the node connected to the device in the backend of the ring network is determined as the access node, including: If there are multiple nodes with devices connected to the back end in the ring network, the routes existing in the back end of each node are obtained to determine the physical address of each node, and the access node is determined according to the size of the physical address.
7. A routing switching device for a communication device, characterized in that: The communication device is connected to the backbone network based on a communication link, and multiple communication devices are connected end to end to form a ring network for direct communication. The formed ring network includes an access node and a sending node. The device includes: An access node determination module, used to determine an access node and obtain a gateway address of the access node; the gateway address is set based on a virtual gateway address of an intranet occupied by the access node; A gateway address setting module, used to set the gateway address of the communication device in the ring network to the virtual gateway address; A routing switching module, used to notify the backbone network of the external route to the communication device in the ring network, wherein the previous hop of the route to the communication device in the ring network in the external routing message is set to the virtual gateway address of the sending node, so as to realize the routing switching of the communication device; Among them, the routing switching module includes the following sub-modules: A second communication network segment acquisition submodule is used to acquire a network segment of an unreachable communication device among the communication devices in the ring network whose gateway addresses are set to the virtual gateway addresses when a link in the ring network accessing the backbone network fails; The second device routing switching submodule is used to set the next-hop gateway address of the unreachable communication device in the ring network to the virtual gateway address of the sending node, so as to implement routing switching of the communication device in the event of a link failure in the backbone network.
8. A communication device, characterized in that: include: A processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein when the computer program is executed by the processor, the routing switching method of the communication device according to any one of claims 1 to 6 is implemented.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the routing switching method of the communication device according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Method for realizing OSPF rapid convergence in internal gateway protocol
CN112511435A