Civil aviation VHF radio station active-standby switching method and system based on virtual IP
Technical Field
The invention relates to the technical field of communication, in particular to a method and a system for switching home and standby of a civil aviation VHF radio station based on a virtual IP.
Background
In the rapid development of communication technology, voIP (Voice over Internet Protocol, voice over IP) technology has been widely used in various communication systems due to its high efficiency and convenience. The VoIP technology transmits voice signals through a data network, and converts traditional analog voice signals into digital signals for transmission, so that the fusion transmission of voice and data is realized. The introduction of the technology not only reduces the communication cost, but also improves the flexibility and the expandability of the communication.
In the existing civil aviation VHF radio station, the main and standby switching usually depends on the direct switching of hardware equipment or complex software logic control, and the methods have the problems of low switching speed, low resource utilization rate, high maintenance cost and the like. The traditional main-standby switching mode, whether based on direct switching of hardware or relying on control of complex software logic, is difficult to completely adapt to the requirements of real-time data processing and high redundancy backup in a VoIP environment. In the VoIP technology context, voice data is encapsulated into IP packets for transmission in a network, and this process places higher demands on the stability of the network and the bandwidth utilization. Therefore, the problems of handover delay, uneven resource allocation, high maintenance complexity, and the like in the conventional method become particularly prominent.
To overcome these difficulties, the solution can be achieved by means of virtual IP: a common virtual IP is generated for the main and standby machines through the address resolution protocol, and then the main and standby machines are selected and kept alive through the virtual router redundancy protocol, so that redundancy backup and quick switching between network devices can be realized. However, research and practice for performing active-standby switching in civil aviation VHF stations using address resolution protocols and virtual router redundancy protocols is inadequate.
Disclosure of Invention
In view of this, the invention provides a method and a system for switching home-to-standby of a civil aviation VHF radio station based on a virtual IP, which utilizes an address resolution protocol to construct the virtual IP, and then realizes the election and the keep-alive of the home-to-standby by a virtual router redundancy protocol, thereby realizing the rapid switching of the home-to-standby equipment of the civil aviation VHF radio station so as to improve the reliability and the stability of the system.
The invention discloses a civil aviation VHF radio station active-standby switching method based on virtual IP, which comprises the following steps:
Connecting a host radio station with a core switch through first network switching equipment; the method comprises the steps that a standby station is connected with a core switch through second network switching equipment, the core switch is ensured to start an IP routing function, a VLAN relay protocol is supported, the standby station and the host station are in the same VLAN, the host station and the standby station are communicated with each other, and service information is exchanged with an external network;
The host station is programmed or connected with the first network switching equipment in series, and the standby station is programmed or connected with the second network switching equipment in series, so that the standby station has the capability of sending messages, and the link state between the host station and the standby station is detected and the floating management of the virtual IP is carried out.
Further, a workstation connected with the core switch is accessed to a Console port of the core switch through a Console line, and then the core switch is configured through a serial port debugging tool; the configuration of the first network switching device and the second network switching device includes configuring a two-layer forwarding function, a VRRP backup group, and a static BFD session.
Further, configuring a two-layer forwarding function of the first network switching device and the second network switching device:
Selecting one port of the first network switching equipment, configuring the port as an Access or Hybrid type, and configuring the configuration port corresponding to the core switch in the same network section when configuring the gateway; selecting another port of the first network switching equipment, configuring the port as an Access or Hybrid type, and configuring the port and a host radio station in the same network section when configuring a gateway;
Selecting one port of the second network switching equipment, configuring the port as an Access or Hybrid type, and configuring the configuration port corresponding to the core switch in the same network section when configuring the gateway; and selecting the other port of the second network switching equipment, configuring the other port as an Access or Hybrid type, and configuring the gateway and the standby station in the same network section when configuring the gateway.
Further, the first network switching equipment and the second network switching equipment are interconnected by adopting a static route so as to meet the stability requirement of the civil aviation network.
Further, configuring a VRRP backup group of the first network switching device and the second network switching device:
Setting the priority of a first network switching device connected to a host station to a value higher than a default value; setting the priority of a second network switching device connected with the standby power station as a default value; and simultaneously setting and configuring virtual IP for the first network switching equipment and the second network switching equipment.
Further, a static BFD session is configured for a VLAN where a link between the first network switching device and the second network switching device is located, and linkage between VRRP and BFD is configured at the same time, when the BFD session is disconnected, the second network switching device connected with the standby radio station increases its VRRP priority to be higher than that of the first network switching device connected with the host radio station, at this time, the priority of the standby radio station is higher than that of the host radio station, and the switching between the host radio station and the standby radio station is triggered.
Further, importing a Socket or other program libraries supporting the sending of IP messages in a development environment, taking the Socket library in a Python environment as an example, selecting an original socket_RAW when a Socket subfunction is called, selecting a VRRP (virtual router redundancy protocol) for protocol packet types, and editing the messages in a VRRP format; multicasting the edited message to a group address, and finally directly accessing a host radio station and a standby radio station into a core switch, configuring an ARP message, and directing a virtual address in a routing table to a local machine; the ARP message may be sent when the local priority is higher than that of another machine, and trigger to switch between the host station and the standby station.
Further, in the format of VRRP: 1-4 bits are VRRP protocol version, when the field is 2, the protocol version is VRRPv2, and when the field is 3, the protocol version is VRRPv3; 5-8 bits are VRRP message type, and the field can only be 1; 9-16 bits are virtual router identification, and the field range is 1-255; 17-24 bits are priority, the field range is 0-255, and if the virtual route is consistent with the local address, the field can only be set to 255; if the local machine needs to stop participating in the VRRP group, the field is set to 0; under other conditions, the field value range is 1-254, and the higher the priority is, the larger the value is; 25-32 bits are the number of IP addresses in the VRRP advertisement; 33-40 bits are of authentication type, 0 indicates that authentication is not needed between VRRP message exchanges, 1 indicates that plaintext is used for authentication, and 2 indicates that MD5 is used for authentication; 41-48 bits are VRRP advertisement interval time; 49-64 bits are check bits; 65-96 bits are virtual IP addresses; 97-128 bits are authentication field, the field is filled in when the authentication type is plain text authentication or MD5 authentication, and the field is 0 when the authentication type is not available.
Further, through modification of the VRRP notification interval time field definition, switching delay between the host radio station and the standby radio station is reduced, so that call interruption caused by downtime of the host radio station in actual situations is reduced.
The invention also discloses a civil aviation VHF radio station master-slave switching system based on the virtual IP, which realizes the civil aviation VHF radio station master-slave switching method based on the virtual IP, and comprises a host radio station, a slave radio station, a first network switching device, a second network switching device and a core switch; the host radio station is connected with the core switch through the first network switching equipment; the standby station is connected with the core switch through the second network switching equipment; the host station and the standby station are in the same VLAN and exchange service information with an external network.
Due to the adoption of the technical scheme, the invention has the following advantages:
1. The efficiency is high: by modifying the definition of the announcement interval time field in the VRRP, the switching delay between the host radio station and the standby radio station is reduced from the second level to the millisecond level, and compared with the traditional method of switching between the host and the standby through a fine and complex circuit board, the switching efficiency of the host and the standby is further improved.
2. The cost is low: the mode of realizing virtual IP active-standby switching by selecting the series switching equipment is adopted, so that the system is in a distributed design, and corresponding parts are replaced when faults occur.
3. The practicability is strong: the invention adopts the computer and the electronic instrument which are mature goods shelf products, the virtual IP realizing method is flexible and changeable, the virtual IP main and standby switching can be realized by selecting the serial exchange equipment or programming the radio station on the premise of whether the civil aviation VHF radio station equipment has the programmable function, the method is effective and feasible, and a research foundation can be provided for the development of the virtual IP main and standby switching part of the VoIP radio station equipment and the like.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly described below, and it is apparent that the drawings in the following description are only some embodiments described in the embodiments of the present invention, and other drawings may be obtained according to these drawings for those skilled in the art.
Fig. 1 is a schematic diagram of a master-slave switching system of a civil aviation VHF radio station based on a virtual IP according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of the capability of building VRRP messages through a tandem exchange device according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of active/standby switching in an embodiment of the present invention;
FIG. 4 is a schematic diagram of a VRRP message format according to an embodiment of the present invention;
FIG. 5 is a diagram illustrating the function call and VRRP message editing according to the embodiment of the present invention;
FIG. 6 is a schematic diagram of a VRRP packet capturing result according to an embodiment of the present invention;
FIG. 7 is a diagram illustrating function call and ARP message editing according to an embodiment of the present invention.
Detailed Description
The present invention will be further described with reference to the accompanying drawings and examples, wherein the examples are shown only in a partial, but not in all embodiments of the invention. All other embodiments obtained by those skilled in the art are intended to fall within the scope of the embodiments of the present invention.
The invention provides an embodiment of a civil aviation VHF radio station active-standby switching method based on virtual IP, which comprises the following steps:
Connecting a host radio station with a core switch through first network switching equipment; the method comprises the steps that a standby station is connected with a core switch through second network switching equipment, the core switch is ensured to start an IP routing function, VLAN (Virtual Local Area Network ) relay protocols are supported, the host station and the standby station are in the same VLAN, the host station and the standby station are communicated with each other, and service information is exchanged with an external network;
The host station is programmed or connected with the first network switching equipment in series, and the standby station is programmed or connected with the second network switching equipment in series, so that the standby station has the capability of sending messages, and the link state between the host station and the standby station is detected and the floating management of the virtual IP is carried out.
The following two modes are available for implementing the active-standby switching of the virtual IP:
1. series connection of a first network switching device and a second network switching device
The host station and the first network switching device having the functions of switching VRRP (Virtual Router Redundancy Protocol ), BFD (Bidirectional Forwarding Detection, bidirectional forwarding detection), ARP (Address Resolution Protocol ) messages are connected in series, as shown in fig. 2. The workstation accesses to a Console port of the first network switching device through a Console line, and then configures the first network switching device through a serial port debugging tool, such as HYPERTERMINAL (super terminal). The standby radio station and a second network switching device with the functions of switching VRRP (Virtual Router Redundancy Protocol ), BFD (Bidirectional Forwarding Detection, bidirectional forwarding detection) and ARP (Address Resolution Protocol ) messages are connected in series. The workstation accesses to a Console port of the second network switching device through a Console line, and then configures the second network switching device through a serial port debugging tool, such as HYPERTERMINAL (super terminal).
The configuration of the first network switching device and the second network switching device comprises the steps of configuring a two-layer forwarding function, a VRRP backup group and a static BFD session:
Configuring a two-layer forwarding function of the first network switching device: one port of the first network switching equipment is selected and configured as an Access or Hybrid type (the port can belong to a plurality of VLANs), the configuration port corresponding to the core switch is configured in the same network section when the gateway (VlanIf) is configured, the other port of the first network switching equipment is selected and configured as an Access or Hybrid type, and the gateway (VlanIf) is configured in the same network section with a radio station connected with the gateway. The two-layer forwarding function of the second network switching device is configured similar to the two-layer forwarding function of the first network switching device. In order to meet the stability requirement of the civil aviation network, the first network switching equipment and the second network switching equipment are interconnected by adopting a static route.
Configuring VRRP backup groups of the first network switching device and the second network switching device: for the first network switching device to which the host station is connected, the priority is set to a value higher than 100. For a second network switching device connected to the standby station, the priority is set to a default value (100). And simultaneously setting and configuring virtual IP for the first network switching equipment and the second network switching equipment.
And finally configuring a BFD session for a Vlan where a link between the first network switching equipment and the second network switching equipment is located, simultaneously configuring linkage between VRRP and BFD, and when the BFD session is disconnected, increasing the VRRP priority of the second network switching equipment connected with the standby radio station to be higher than the VRRP priority of the first network switching equipment connected with the host radio station, wherein the priority of the standby radio station is higher than that of the host radio station, and triggering switching between the host radio station and the standby radio station, as shown in figure 3.
2. Programming a host station and a standby station
A Socket or other program library supporting sending of an IP message is imported into a development environment, taking the Socket library in a Python environment as an example, when a Socket subfunction is called, an original Socket (SOCK_RAW) is selected, a protocol packet type is selected, and then the message is edited in a VRRP format, wherein the VRRP format is shown in figure 4.
The format is: 1-4 bits are VRRP protocol version, when the field is 2, the protocol version is VRRPv2, and when the field is 3, the protocol version is VRRPv3. 5-8 bits are VRRP message type, and the field can only be 1. 9-16 bits are Virtual Router Identification (VRID), and the field range is 1-255. 17-24 bits are priority, the field range is 0-255, and if the virtual route is consistent with the local address, the field can only be set to 255; if the local machine needs to stop participating in the VRRP group, the field is set to 0; in other cases, the field value range is 1-254, and the higher the priority is, the larger the value is. And 25-32 bits are the number of IP addresses in the VRRP advertisement. And 33-40 bits are of an authentication type, 0 indicates that authentication is not needed between VRRP message exchanges, 1 indicates that plaintext is used for authentication, and 2 indicates that MD5 (message digest algorithm) mode is used for authentication. The 41-48 bits are VRRP notification interval time, the unit is seconds, and in actual conditions, the part can be redefined to be in millisecond level, so that the switching time is quickened, for example, hexadecimal '01' can no longer represent 1 second but 1 millisecond, and the corresponding use of '14' represents 20 milliseconds of packet sending interval, and the packet sending interval of 20 milliseconds meets the requirement of civil aviation communication stability better than 1 second. 49-64 bits are check bits. 65-96 bits are the virtual IP address. 97-128 bits are authentication field, the field is filled in when the authentication type is plain text authentication or MD5 authentication, and the field is 0 when the authentication type is not available.
An example of a function call and an edited message is shown in fig. 5. The filled message is multicast to the group address 224.0.0.18 as shown in fig. 6.
And finally, directly accessing the host radio station and the standby radio station into a core switch, configuring an ARP message, and pointing the virtual address in the routing table to the host. This message is sent when the local priority is higher than the other machine, and at the same time, the active-standby switch is triggered. An example of a function call and an edited message is shown in fig. 7.
The method reduces the switching delay of the main and standby from the second level to the millisecond level by modifying the definition of the announcement interval time field in the VRRP, avoids the call interruption caused by the fact that the host radio station is down for too long in the actual situation, and enhances the call stability.
By adopting the mode of the serial network switching equipment, even if the host radio station and the standby radio station do not have programming capability, the host radio station and the standby radio station can have the main-standby switching function of the virtual IP, the method has strong practicability, and the research and development cost of the new function of the existing air-handling communication equipment is further reduced.
After the virtual IP main and standby switching is realized by the mode of connecting network switching equipment in series, the whole system is in a distributed design, and single equipment (a host radio station or a standby radio station) can be replaced in time after faults occur, so that the maintenance of the whole system is more convenient.
Referring to fig. 1, the invention also provides an embodiment of a virtual IP-based civil aviation VHF radio station active-standby switching system, which implements the virtual IP-based civil aviation VHF radio station active-standby switching method described in the above embodiment, and includes a host radio station, a standby radio station, a first network switching device, a second network switching device and a core switch; the host radio station is connected with the core switch through the first network switching equipment; the standby station is connected with the core switch through the second network switching equipment; the host station and the standby station are in the same VLAN and exchange service information with an external network.
Specifically, the host station and the standby station may be VoIP stations; voIP station and required configuration: the radio station should have the capability of normally performing data communication, and can have the capability of sending messages such as ARP, VRRP by programming radio Software (SDR) in the radio station, field Programmable Gate Array (FPGA) and the like or connecting network switching equipment in series, so as to detect the link state between the main radio station and the standby radio station and perform floating management of virtual IP.
Core switch: the main station and the standby station are connected to the same core exchanger through network cables, so that the exchanger is ensured to start an IP routing function, VLAN relay protocols are supported, the main station and the standby station can communicate with each other in the same VLAN, and service information is exchanged with an external network.
The VoIP radio station model is R & S4200, the network switching equipment model is Huawei S5700, and the core switching equipment model is Huawei S5735.
Finally, it should be noted that: the above embodiments are only for illustrating the technical aspects of the present invention and not for limiting the same, and although the present invention has been described in detail with reference to the above embodiments, it should be understood by those of ordinary skill in the art that: modifications and equivalents may be made to the specific embodiments of the invention without departing from the spirit and scope of the invention, which is intended to be covered by the claims.