Pseudo-wire switching method, device, electronic device and storage medium
By deploying a pseudo-line switching device on the service provider edge router PE, monitoring and determining the switching conditions, the problem of untimely pseudo-line switching in the prior art is solved, and more efficient pseudo-line switching is achieved, reducing the risk of data loss and service interruption.
Patent Information
- Application Number
- CN202210670380.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-14
- Publication Date
- 2025-03-04
- Estimated Expiration
- 2042-06-14
AI Technical Summary
The prior art cannot realize fast pseudo-line switching when link abnormalities occur, resulting in serious data traffic loss and may even lead to service interruption.
By deploying a pseudo-line switching device on the service provider edge router PE, it monitors whether the switching conditions are met during the communication process, and determines whether it is the first time when the conditions are met. If so, save the MAC address of the current pseudo-line and obtain the MAC address of the pseudo-line to be switched. Otherwise, directly find the MAC address in the memory space for switching.
It improves the average efficiency of pseudo-line switching, reduces the loss of data traffic, and reduces the chance of service interruption.
Smart Images

Figure CN114884872B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of communication technology, and in particular to a pseudo line switching method, device, electronic device and storage medium. Background Art
[0002] In abnormal scenarios such as link disconnection, oscillation or congestion, when a link of a network device carries a service, it is necessary to quickly switch the traffic to the backup link when the link is abnormal, and switch the traffic back in time after the link is restored. However, actual links are often more complex. At this time, it is necessary to introduce pseudo-wires to simplify complex links into point-to-point connections. Pseudo-wires are a general term for various simulation technologies in the communication field. They are point-to-point connections established between edge routers. For example: When a link of a network device carries VPLS (Virtual Private Lan Service, virtual private LAN service), if abnormal conditions such as link oscillation occur, the data traffic needs to be switched between the primary and backup links. Due to the introduction of pseudo-wires, the data traffic can be switched between the primary and backup pseudo-wires.
[0003] In the related art, every time a PE (Provider Edge) needs to perform a pseudo-wire switch, due to the limitation of the chip's storage space, it must delete the MAC address (Media Access Control Address) corresponding to the currently used pseudo-wire stored in the storage space, and then re-learn the MAC address of the destination device from the pseudo-wire to be switched to, obtain the MAC address corresponding to the pseudo-wire to be switched to, and then perform the pseudo-wire switch.
[0004] Since the process of relearning the MAC address of the destination device each time is very time-consuming, it is impossible to implement fast pseudo-wire switching, which ultimately leads to serious data traffic loss and even business interruption. Summary of the invention
[0005] The purpose of the embodiments of the present disclosure is to provide a pseudowire switching method, device, electronic device and storage medium to improve the average efficiency of pseudowire switching, thereby reducing the loss of data traffic and the probability of service interruption. The specific technical solution is as follows:
[0006] In a first aspect, an embodiment of the present disclosure provides a pseudowire switching method, which is applied to a pseudowire switching device deployed in a service provider edge router PE, and the method includes:
[0007] In each cycle, monitoring whether any one of a plurality of switching conditions is satisfied during a communication process based on a pseudo wire; wherein the plurality of switching conditions include: a condition for switching from a main pseudo wire to a backup pseudo wire, and a condition for switching from a backup pseudo wire to the main pseudo wire; the main pseudo wire and the backup pseudo wire are both pseudo wires used for communicating with a target device belonging to a destination device;
[0008] If a switching condition is met, determining whether the switching condition is met for the first time in the current cycle;
[0009] If yes, save the MAC address corresponding to the currently used pseudo wire to the memory space of the device, and obtain the MAC address corresponding to the target pseudo wire to be switched to according to the acquisition method corresponding to the switching condition; otherwise, search for the MAC address corresponding to the target pseudo wire stored in the memory space; wherein the MAC address corresponding to any pseudo wire is the MAC address of the target device learned from the pseudo wire;
[0010] The pseudo wire is switched using the MAC address corresponding to the target pseudo wire.
[0011] Optionally, acquiring a MAC address corresponding to a target pseudo wire to be switched to according to an acquisition method corresponding to the switching condition includes:
[0012] If the switching condition satisfied is a condition for switching from a primary pseudowire to a backup pseudowire, learning a MAC address of the target device from the target pseudowire to be switched to, and obtaining a MAC address corresponding to the target pseudowire;
[0013] If the switching condition satisfied is a condition for switching from a backup pseudo wire to a main pseudo wire, a MAC address corresponding to the target pseudo wire is searched in the memory space.
[0014] Optionally, learning the MAC address of the target device from the target pseudo wire to be switched to, and obtaining the MAC address corresponding to the target pseudo wire includes:
[0015] The address resolution protocol ARP message flooding method is adopted to learn the MAC address of the target device from the target pseudo wire to be switched to, and obtain the MAC address corresponding to the target pseudo wire.
[0016] Optionally, the using the MAC address corresponding to the target pseudo wire to perform pseudo wire switching includes:
[0017] The data traffic for the target device is switched to the physical link of the target pseudo wire by using the MAC address corresponding to the target pseudo wire, wherein any pseudo wire corresponds to one physical link.
[0018] Optionally, the condition for switching from the primary pseudowire to the backup pseudowire includes:
[0019] The main link is abnormal; wherein the main link is the physical link of the main pseudo line;
[0020] The conditions for switching from the standby pseudo wire to the main pseudo wire include:
[0021] The backup link is abnormal, or the main link returns to normal; wherein the backup link is the physical link of the backup pseudowire.
[0022] In a second aspect, an embodiment of the present disclosure provides a pseudo wire switching device, which is applied to a pseudo wire switching device deployed in a service provider edge router PE, and the device includes:
[0023] A monitoring module, used to monitor whether any one of a plurality of switching conditions is satisfied in each cycle during a communication process based on a pseudo wire; wherein the plurality of switching conditions include: a condition for switching from a main pseudo wire to a backup pseudo wire, and a condition for switching from a backup pseudo wire to the main pseudo wire; the main pseudo wire and the backup pseudo wire are both pseudo wires used for communicating with a target device belonging to a destination device;
[0024] A judgment module, used for judging whether a switching condition is satisfied for the first time in a current cycle if the switching condition is satisfied;
[0025] The address acquisition module is used to, if yes, save the MAC address corresponding to the currently used pseudo wire to the memory space of the device, and acquire the MAC address corresponding to the target pseudo wire to be switched to according to the acquisition method corresponding to the switching condition; otherwise, search for the MAC address corresponding to the target pseudo wire stored in the memory space; wherein the MAC address corresponding to any pseudo wire is the MAC address of the target device learned from the pseudo wire;
[0026] The switching module is used to perform pseudo wire switching by using the MAC address corresponding to the target pseudo wire.
[0027] Optionally, the address acquisition module acquires a MAC address corresponding to a target pseudo wire to be switched to according to an acquisition method corresponding to the switching condition, including:
[0028] A learning submodule, configured to learn the MAC address of the target device from the target pseudo wire to be switched to, and obtain the MAC address corresponding to the target pseudo wire if the switching condition satisfied is a condition for switching from the main pseudo wire to the backup pseudo wire;
[0029] The search submodule is configured to search the memory space for a MAC address corresponding to the target pseudo wire if the switching condition satisfied is a condition for switching from the backup pseudo wire to the main pseudo wire.
[0030] Optionally, the learning submodule includes:
[0031] The learning unit is used to learn the MAC address of the target device from the target pseudo wire to be switched to by adopting the address resolution protocol ARP message flooding method, so as to obtain the MAC address corresponding to the target pseudo wire.
[0032] Optionally, the switching module includes:
[0033] The switching submodule is used to switch the data traffic for the target device to the physical link of the target pseudo wire by using the MAC address corresponding to the target pseudo wire, wherein any pseudo wire corresponds to one physical link.
[0034] Optionally, the condition for switching from the primary pseudowire to the backup pseudowire includes:
[0035] The main link is abnormal; wherein the main link is the physical link of the main pseudo line;
[0036] The conditions for switching from the standby pseudo wire to the main pseudo wire include:
[0037] The backup link is abnormal, or the main link returns to normal; wherein the backup link is the physical link of the backup pseudowire.
[0038] In a third aspect, an embodiment of the present disclosure provides an electronic device, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus;
[0039] Memory, used to store computer programs;
[0040] The processor is used to implement any one of the above pseudo wire switching method steps when executing the program stored in the memory.
[0041] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, any of the above-mentioned pseudo wire switching method steps is implemented.
[0042] In the scheme provided by the present disclosure, only when a switching condition is met for the first time in each cycle, the MAC address corresponding to the target pseudo wire to be switched to is obtained according to the acquisition method corresponding to the switching condition; and when a switching condition is not met for the first time in each cycle, since the MAC address corresponding to the currently used pseudo wire has been saved to the memory space corresponding to the pseudo wire switching device when each switching condition is met for the first time, the MAC address corresponding to the target pseudo wire to be switched to can be directly obtained from the memory space, which greatly saves the time of pseudo wire switching. It can be seen that through this scheme, it is possible to avoid re-learning the MAC address of the destination device each time, improve the average efficiency of pseudo wire switching, thereby reducing the loss of data traffic and reducing the probability of service interruption.
[0043] In addition, by periodically analyzing, the MAC address stored in the memory space can be periodically updated to ensure the validity of the address and avoid the MAC address corresponding to the main pseudo wire or the MAC address corresponding to the backup pseudo wire from becoming invalid due to some reason.
[0044] Of course, it is not necessary to achieve all the advantages described above at the same time to implement any product or method of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present disclosure, and for ordinary technicians in this field, other embodiments can also be obtained based on these drawings.
[0046] Figure 1 A schematic diagram of a pseudo line switching method provided by an embodiment of the present disclosure;
[0047] Figure 2 A schematic diagram of a flow chart of another pseudo line switching method provided by an embodiment of the present disclosure;
[0048] Figure 3 A schematic diagram of a flow chart of another pseudo line switching method provided by an embodiment of the present disclosure;
[0049] Figure 4 A network device topology diagram provided for an embodiment of the present disclosure;
[0050] Figure 5 Another network device topology diagram provided by an embodiment of the present disclosure;
[0051] Figure 6 A schematic diagram of the structure of a pseudo line switching device provided in an embodiment of the present disclosure;
[0052] Figure 7An electronic device is provided according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0053] The following will be combined with the drawings in the embodiments of the present disclosure to clearly and completely describe the technical solutions in the embodiments of the present disclosure. Obviously, the described embodiments are only part of the embodiments of the present disclosure, rather than all the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in this field based on the present disclosure belong to the scope of protection of the present disclosure.
[0054] In order to avoid relearning the MAC address of the destination device each time, improve the average efficiency of pseudo-wire switching, thereby reducing data traffic loss and the probability of service interruption, the present disclosure provides a pseudo-wire switching method, device, electronic device and storage medium.
[0055] First, a pseudo line switching method provided by the disclosed embodiment is introduced below.
[0056] A pseudo-wire switching method provided in an embodiment of the present disclosure can be applied to a pseudo-wire switching device deployed in a service provider edge router PE. The embodiment of the present disclosure does not limit the specific form of the pseudo-wire switching device. For example, the pseudo-wire switching device can be in a plug-in form or a client form, etc.
[0057] It should be noted that, in specific applications, the network services carried by PE may include VPLS (Virtual Private Lan Service), but are not limited thereto. For example, when the link of PE carries VPLS, if abnormal conditions such as link oscillation occur, the data traffic can be quickly switched between the primary and backup pseudo wires through the solution provided by the present disclosure.
[0058] The embodiment of the present disclosure provides a pseudo wire switching method, which is applied to a pseudo wire switching device deployed in a service provider edge router PE, and may include:
[0059] In each cycle, monitoring whether any one of a plurality of switching conditions is satisfied during a communication process based on a pseudo wire; wherein the plurality of switching conditions include: a condition for switching from a primary pseudo wire to a backup pseudo wire, and a condition for switching from a backup pseudo wire to a primary pseudo wire; both the primary pseudo wire and the backup pseudo wire are pseudo wires used for communicating with a target device belonging to a destination device;
[0060] If a switching condition is met, determining whether the switching condition is met for the first time in the current cycle;
[0061] If yes, save the MAC address corresponding to the currently used pseudo wire to the memory space of the device, and obtain the MAC address corresponding to the target pseudo wire to be switched to according to the acquisition method corresponding to the switching condition; otherwise, search for the MAC address corresponding to the target pseudo wire stored in the memory space; wherein the MAC address corresponding to any pseudo wire is the MAC address of the target device learned from the pseudo wire;
[0062] The MAC address corresponding to the target pseudo wire is used to switch the pseudo wire.
[0063] In the scheme provided by the present disclosure, only when a switching condition is met for the first time in each cycle, the MAC address corresponding to the target pseudo wire to be switched to is obtained according to the acquisition method corresponding to the switching condition; and when a switching condition is not met for the first time in each cycle, since the MAC address corresponding to the currently used pseudo wire has been saved to the memory space corresponding to the pseudo wire switching device when each switching condition is met for the first time, the MAC address corresponding to the target pseudo wire to be switched to can be directly obtained from the memory space, which greatly saves the time of pseudo wire switching. It can be seen that through this scheme, it is possible to avoid re-learning the MAC address of the destination device each time, improve the average efficiency of pseudo wire switching, thereby reducing the loss of data traffic and reducing the probability of service interruption.
[0064] In addition, by periodically analyzing, the MAC address stored in the memory space can be periodically updated to ensure the validity of the address and avoid the MAC address corresponding to the main pseudo wire or the MAC address corresponding to the backup pseudo wire from becoming invalid due to some reason.
[0065] A pseudo line switching method provided by an embodiment of the present disclosure is introduced below in conjunction with the accompanying drawings.
[0066] like Figure 1 As shown, a pseudo line switching method provided by an embodiment of the present disclosure may include the following steps:
[0067] S101, in each cycle, monitoring whether any one of a plurality of switching conditions is satisfied during a communication process based on a pseudo wire;
[0068] When the source device and the destination device communicate, the PE can communicate based on the pseudo wire, and the pseudo wire can include a main pseudo wire and a backup pseudo wire. The physical link corresponding to the main pseudo wire is the main link, and the link corresponding to the backup pseudo wire is the backup link. This solution does not limit the setting method of the main pseudo wire and the backup pseudo wire. In the process of pseudo wire-based communication, it can be monitored whether any of the multiple switching conditions is met, that is, whether it is necessary to switch from the main pseudo wire to the backup pseudo wire, or from the backup pseudo wire to the main pseudo wire.
[0069] The multiple switching conditions may include: a condition for switching from a primary pseudowire to a backup pseudowire, and a condition for switching from a backup pseudowire to a primary pseudowire. For example, when device a communicates with device b, a primary pseudowire and a backup pseudowire exist between device a and device b, and device b is a target device of the destination device, then both the primary pseudowire and the backup pseudowire are pseudowires used by device a and device b to communicate.
[0070] Optionally, in one implementation, the condition for switching from the primary pseudowire to the backup pseudowire includes:
[0071] The main link is abnormal; wherein the main link is the physical link of the main pseudo line;
[0072] The conditions for switching from the backup pseudowire to the primary pseudowire include:
[0073] The backup link is abnormal, or the primary link returns to normal; the backup link is a physical link of the backup pseudowire.
[0074] It is understandable that link anomalies may include link oscillation, disconnection, congestion, etc. For example, if the condition for switching from the main pseudo-wire to the backup pseudo-wire includes the main link anomaly, then in each cycle, it is possible to monitor whether the main link has oscillation, disconnection, congestion, etc. during the communication process based on the main pseudo-wire; if the condition for switching from the backup pseudo-wire to the main pseudo-wire includes the backup link anomaly, then in each cycle, it is possible to monitor whether the backup link has oscillation, disconnection, congestion, etc. during the communication process based on the backup pseudo-wire. It should be noted that the conditions for switching from the backup pseudo-wire to the main pseudo-wire may include the backup link anomaly and the main link recovery. At this time, when the main link returns to normal, the data traffic can also be switched back from the backup link to the main link. Then, in each cycle, it is possible to monitor whether the main link has returned to normal during the communication process based on the backup pseudo-wire.
[0075] It should be noted that multiple cycles can be pre-set, so that in this solution, when entering each cycle is detected, the solution provided by the embodiment of the present disclosure can be executed. The duration of the cycle can be set according to actual conditions, for example: one day as a cycle, one week as a cycle, and so on. In addition, by setting multiple cycles, the MAC address stored in the memory space can be updated periodically, thereby ensuring the validity of the address and avoiding the MAC address corresponding to the main pseudo wire or the MAC address corresponding to the backup pseudo wire from being invalid due to some reason.
[0076] S102, if a switching condition is met, determining whether the switching condition is met for the first time in the current cycle;
[0077] In order to solve the problems of the prior art, when a switching condition is met, this solution does not delete the MAC address corresponding to the currently used pseudo-line and learn the MAC address from the pseudo-line to be switched to, but can continue to determine whether the switching condition is met for the first time in the current cycle, and execute different processing steps according to different judgment results.
[0078] Exemplarily, if an abnormality occurs in the main link, determine whether it is the first time that an abnormality occurs in the main link in the current cycle; if an abnormality occurs in the backup link, determine whether it is the first time that an abnormality occurs in the backup link in the current cycle; if the main link returns to normal, determine whether the main link returns to normal for the first time in the current cycle.
[0079] S103, if yes, save the MAC address corresponding to the currently used pseudo wire to the memory space of the device, and obtain the MAC address corresponding to the target pseudo wire to be switched to according to the acquisition method corresponding to the switching condition; otherwise, search for the MAC address corresponding to the target pseudo wire stored in the memory space;
[0080] The MAC address corresponding to any pseudo wire is the MAC address of the target device learned from the pseudo wire.
[0081] In this embodiment, when it is determined that the switching condition is satisfied for the first time in the current cycle, since the MAC address corresponding to the currently used pseudo wire is known, the MAC address corresponding to the currently used pseudo wire can be saved in the memory space of the device, so that when the pseudo wire is subsequently switched back, the MAC address can be directly read from the memory space; and when it is determined that the switching condition is satisfied for the first time in the current cycle, since different switching conditions are satisfied for the first time, the MAC address corresponding to the target pseudo wire to be switched to may have been saved in the memory space, or may not have been saved in the memory space and thus needs to be learned, therefore, the MAC address corresponding to the target pseudo wire to be switched to can be obtained according to the acquisition method corresponding to the switching condition. When it is determined that the switching condition is not satisfied for the first time in the current cycle, therefore, the MAC address corresponding to the target pseudo wire to be switched to has been saved in the memory space, at this time, the memory space can be directly searched to obtain the MAC address corresponding to the target pseudo wire.
[0082] It should be noted that the MAC address corresponding to any pseudo-wire is stored in the memory space of the device, wherein the memory space is at the software level. It is understandable that in the prior art, the MAC address learned from any pseudo-wire is stored in the chip memory space, which belongs to the hardware level. However, if a complex service such as VPLS is carried, the chip memory space may be difficult to store a large number of MAC addresses. The embodiment of the present disclosure saves the MAC address at the software level without having to consider the problem of insufficient storage space, and can effectively solve the problem of limited hardware memory space when carrying complex services. The embodiment of the present disclosure does not impose too many restrictions on the memory space.
[0083] The specific content of this implementation method is introduced below in conjunction with other embodiments, and will not be elaborated here.
[0084] S104, using the MAC address corresponding to the target pseudo wire to perform pseudo wire switching;
[0085] Specifically, the data traffic for the target device is switched to the physical link of the target pseudo wire by using the MAC address corresponding to the target pseudo wire, wherein any pseudo wire corresponds to one physical link.
[0086] Exemplarily, device a transmits data traffic to device b. There are a main pseudo-wire and a backup pseudo-wire between device a and device b, and there are corresponding main links and backup links. Device a transmits data traffic to device b through the main link, and uses the MAC address corresponding to the backup pseudo-wire to switch the data traffic for device b to the physical link of the backup pseudo-wire. That is, in the process of device a transmitting data traffic to device b, the main pseudo-wire and the backup pseudo-wire are switched, so the data traffic is switched from the main link to the backup link.
[0087] In the scheme provided by the present disclosure, only when a switching condition is met for the first time in each cycle, the MAC address corresponding to the target pseudo wire to be switched to is obtained according to the acquisition method corresponding to the switching condition; and when a switching condition is not met for the first time in each cycle, since the MAC address corresponding to the currently used pseudo wire has been saved to the memory space corresponding to the pseudo wire switching device when each switching condition is met for the first time, the MAC address corresponding to the target pseudo wire to be switched to can be directly obtained from the memory space, which greatly saves the time of pseudo wire switching. It can be seen that through this scheme, it is possible to avoid re-learning the MAC address of the destination device each time, improve the average efficiency of pseudo wire switching, thereby reducing the loss of data traffic and reducing the probability of service interruption.
[0088] In addition, by periodically analyzing, the MAC address stored in the memory space can be periodically updated to ensure the validity of the address and avoid the MAC address corresponding to the main pseudo wire or the MAC address corresponding to the backup pseudo wire from becoming invalid due to some reason.
[0089] Optionally, in another disclosed embodiment, as Figure 2 As shown, a pseudo line switching method may include the following steps:
[0090] S201, in each cycle, monitoring whether any one of a plurality of switching conditions is satisfied during a communication process based on a pseudo wire;
[0091] S202, if a switching condition is met, determine whether the switching condition is met for the first time in the current cycle, if yes, execute S2031; otherwise, execute S2032;
[0092] In this embodiment, S201-S202 are the same as S101-S102 in the above embodiment, and are not described in detail here.
[0093] S2031, saving the MAC address corresponding to the currently used pseudo wire to the memory space of the device, and if the switching condition satisfied is a condition for switching from the main pseudo wire to the backup pseudo wire, learning the MAC address of the target device from the target pseudo wire to be switched to, and obtaining the MAC address corresponding to the target pseudo wire, and if the switching condition satisfied is a condition for switching from the backup pseudo wire to the main pseudo wire, searching the MAC address corresponding to the target pseudo wire from the memory space;
[0094] S2032, searching for a MAC address corresponding to the target pseudowire stored in the memory space;
[0095] Among them, if the switching condition satisfied is the condition of switching from the main pseudowire to the backup pseudowire, then since the MAC address corresponding to the backup pseudowire is unknown, the MAC address of the target device is learned from the target pseudowire to be switched to, and the MAC address corresponding to the target pseudowire is obtained. In other words, if the main link is abnormal, the MAC address of the target device is learned from the backup pseudowire to obtain the MAC address corresponding to the backup pseudowire. Exemplarily, device a transmits data traffic to device b, and there are primary and backup links and primary and backup pseudowires between the two devices. If link oscillation occurs in the main link, the MAC address of device b is learned from the backup pseudowire to obtain the MAC address corresponding to the backup pseudowire.
[0096] It should be noted that learning the MAC address of the target device from the target pseudo wire to be switched to and obtaining the MAC address corresponding to the target pseudo wire may include step A1:
[0097] Step A1: adopting the address resolution protocol ARP message flooding method to learn the MAC address of the target device from the target pseudo wire to be switched to, and obtain the MAC address corresponding to the target pseudo wire.
[0098] Using ARP message flooding to learn the MAC address of the target device is a method widely used in the prior art. This method can learn the MAC address of the pseudo wire to be switched. This method is introduced in other embodiments and will not be described in detail here.
[0099] Among them, if the switching condition satisfied is the condition of switching from the backup pseudowire to the main pseudowire, the MAC address corresponding to the target pseudowire is searched from the memory space, that is, if the backup link is abnormal or the main link is restored to normal, the MAC address corresponding to the target pseudowire is searched from the memory space. It can be understood that, since the MAC address corresponding to the main pseudowire has been saved in the memory space when the condition for switching from the main pseudowire to the backup pseudowire is satisfied for the first time, that is, when the main link is abnormal for the first time, the MAC address corresponding to the main pseudowire has been saved in the memory space, therefore, if the switching condition satisfied is the condition of switching from the backup pseudowire to the main pseudowire, the MAC address corresponding to the main pseudowire can be directly searched from the memory space. Exemplarily, device a transmits data traffic to device b, and there are primary-backup links and primary-backup pseudowires between the two devices. If the backup link is disconnected, the MAC address corresponding to the main pseudowire is searched from the memory space; if the main link is restored to normal, the MAC address corresponding to the main pseudowire is searched from the memory space.
[0100] S204, using the MAC address corresponding to the target pseudo wire to perform pseudo wire switching;
[0101] In this embodiment, S204 is the same as S104 in the above embodiment, and will not be described in detail here.
[0102] In the scheme provided by the present disclosure, only when a switching condition is met for the first time in each cycle, the MAC address corresponding to the target pseudo wire to be switched to is obtained according to the acquisition method corresponding to the switching condition; and when a switching condition is not met for the first time in each cycle, since the MAC address corresponding to the currently used pseudo wire has been saved to the memory space corresponding to the pseudo wire switching device when each switching condition is met for the first time, the MAC address corresponding to the target pseudo wire to be switched to can be directly obtained from the memory space, which greatly saves the time of pseudo wire switching. It can be seen that through this scheme, it is possible to avoid re-learning the MAC address of the destination device each time, improve the average efficiency of pseudo wire switching, thereby reducing the loss of data traffic and reducing the probability of service interruption.
[0103] Combine the following Figure 4 The topology diagram of the network device shown introduces a pseudo wire switching method provided by the present disclosure.
[0104] like Figure 4 As shown, the network equipment carries the VPLS service, where:
[0105] PC1 is the source device, PC2 is the destination device, PC1 is connected to CE1, PC2 is connected to CE2, when PC1 and PC2 communicate, PE1 can use the main pseudo wire PW1 to communicate. Among them, CE1 and CE2 are both CE (Customer Edge, customer side edge device), CE devices can connect to terminals, such as: PC, CE devices provide service access for users by connecting to one or more PE routers; among them, PE1, PE2 and PE3 are all PE (Provider Edge, network side edge device).
[0106] When using the main pseudo wire PW1 for communication, the MAC address of the destination device is first learned from the main pseudo wire through ARP message flooding: MAC B, and the MAC address corresponding to the main pseudo wire is obtained; then, PE1 uses the MAC address corresponding to the main pseudo wire PW1 to communicate through the main pseudo wire.
[0107] Among them, a pseudo line switching method provided by an embodiment of the present disclosure is as follows: Figure 3 As shown, the following steps may be included:
[0108] S301, in each cycle, when the main link is detected to be abnormal, PE1 saves the MAC address corresponding to the main pseudo wire into the routing table of the memory space to achieve data preservation at the software level. The routing table can be seen in Table 1:
[0109] VSI MAC Port VPN A vlan10,port11 VPN B PW1
[0110] Table 1
[0111] It can be seen that the table 1 records the MAC corresponding to the main pseudowire PW1. Among them, VSI (Virtual Switch Interface) is a protocol used to control wide area network switching. For network applications, the network carried by VSI is VPN (Virtual Private Network), MAC is the MAC address, and Port is the interface.
[0112] S302, PE1 learns the MAC address of the destination device MACB from the standby pseudowire PW2 by flooding the ARP message, and obtains the MAC address corresponding to the standby pseudowire;
[0113] Exemplarily, PC1 sends an ARP request message, and PE1 floods the ARP message. When an abnormality occurs in the main link, the ARP message reaches PE3 through the backup pseudowire PW2, then reaches PE2 through the backup pseudowire PW3, then reaches CE2, and finally reaches PC2. Since PC2 is the destination device, PC2 will reply to this message and transmit the MAC address of PC2 back to PE1 through the original path. In this way, PE1 learns the MAC address of device PC2 from the backup pseudowire PW2: MAC B, and thus obtains the MAC address corresponding to the backup pseudowire PW2.
[0114] S303, PE1 uses the MAC address corresponding to the backup pseudo wire to perform pseudo wire switching, that is, switching data traffic to the backup link;
[0115] Exemplarily, PE1 uses address MAC B to switch the primary pseudo wire to the backup pseudo wire, so as to switch data traffic from the primary link to the backup link.
[0116] S304, when PE1 detects that the main link is restored, it saves the MAC address corresponding to the backup pseudowire into the routing table of the memory space to achieve data preservation at the software level. At this time, the routing table can be seen in Table 2:
[0117] VSI MAC Port VPN A vlan10,port11 VPN B PW1 VPN B PW2
[0118] Table 2
[0119] S305, PE1 uses the MAC address corresponding to the primary pseudo wire to perform pseudo wire switching, that is, switching data traffic to the primary link;
[0120] Exemplarily, when the primary link returns to normal, PE1 uses the MAC address corresponding to the primary pseudo wire to switch the backup pseudo wire to the primary pseudo wire, and switches data traffic from the backup link to the primary link.
[0121] S306, whenever PE1 detects that the main link is abnormal or recovered, it searches the memory space for the MAC address corresponding to the target pseudo wire to be switched to, and performs pseudo wire switching using the found MAC address corresponding to the target pseudo wire.
[0122] For example, if the main link becomes abnormal again, there is no need to re-learn the MAC address based on the backup pseudo-wire. The MAC address corresponding to the backup pseudo-wire stored in the program memory can be directly searched, and the pseudo-wire can be directly switched using the found MAC address, thereby switching the data traffic from the main link to the backup link.
[0123] In the scheme provided by the present disclosure, only when a switching condition is met for the first time in each cycle, the MAC address corresponding to the target pseudo wire to be switched to is obtained according to the acquisition method corresponding to the switching condition; and when a switching condition is not met for the first time in each cycle, since the MAC address corresponding to the currently used pseudo wire has been saved to the memory space corresponding to the pseudo wire switching device when each switching condition is met for the first time, the MAC address corresponding to the target pseudo wire to be switched to can be directly obtained from the memory space, which greatly saves the time of pseudo wire switching. It can be seen that through this scheme, it is possible to avoid re-learning the MAC address of the destination device each time, improve the average efficiency of pseudo wire switching, thereby reducing the loss of data traffic and reducing the probability of service interruption.
[0124] The following will be combined Figure 5 The following is a brief introduction to the specific implementation of ARP message flooding:
[0125] ARP is a TCP / IP protocol for obtaining physical addresses (MAC). Flooding can be understood as the source node wants to send a piece of data to the target node. The source node first transmits a copy of the data to each of its neighbor nodes through the network. Each neighbor node then transmits the data to its own nodes except the node that sent the data. This continues until the data is transmitted to the target node. ARP message flooding is a message flooding based on the ARP protocol.
[0126] like Figure 5 As shown in the figure, there are three terminal devices, PC1, PC2 and PC3. The MAC address of PC1 is A, the IP address is 1.1.1.1 / 24, and the VLAN is 10. The MAC address of PC2 is B, the IP address is 1.1.1.2 / 24, and the VLAN is 10. The MAC address of PC3 is C, and the IP address is 1.1.1.3 / 24. There are also three PEs and three CEs. The VLAN of PC1 and PC2 is the same. At this time, PC1 floods the surrounding devices with ARP messages and broadcasts data to the surrounding devices. In order to learn the MAC address of PC2, only PC2 can reply to the broadcast. PC1 sends data to CE1. CE1 transmits the data to PE1 through Port1. PE1 transmits the data to PE3 through PW2, and transmits the data to PE2 through PW1. PE3 transmits the data to CE3, and finally transmits the data to PC3. However, since PC3 is not the target node, PC3 cannot reply. PE2 transmits the data to CE2 through Port2, and finally transmits it to PC2. Since PC2 is the target node, PC2 can reply to the broadcast and transmit the data back to PC1. Through this process, message flooding is achieved.
[0127] It can be seen that this method can learn the MAC address of the target node, but since it requires a large number of broadcasts, it will occupy a large amount of network bandwidth. Therefore, the embodiment of the present disclosure uses ARP message flooding to learn the MAC address only when the link is abnormal for the first time. The MAC addresses learned subsequently are stored in the program memory. When the link is abnormal again, the MAC address of the pseudo wire to be switched can be directly searched, so that the pseudo wire can be quickly switched.
[0128] Based on the above method embodiment, the present disclosure also provides a pseudo line switching device, such as Figure 6 As shown, the device comprises:
[0129] The monitoring module 610 is used to monitor whether any one of a plurality of switching conditions is satisfied in each cycle during the communication process based on the pseudo wire; wherein the plurality of switching conditions include: a condition for switching from a main pseudo wire to a backup pseudo wire, and a condition for switching from a backup pseudo wire to the main pseudo wire; the main pseudo wire and the backup pseudo wire are both pseudo wires used for communicating with a target device belonging to a destination device;
[0130] The judging module 620 is used to judge whether a switching condition is satisfied for the first time in the current cycle if the switching condition is satisfied;
[0131] The address acquisition module 630 is used to, if yes, save the MAC address corresponding to the currently used pseudo wire to the memory space of the device, and acquire the MAC address corresponding to the target pseudo wire to be switched to according to the acquisition method corresponding to the switching condition; otherwise, search for the MAC address corresponding to the target pseudo wire stored in the memory space; wherein the MAC address corresponding to any pseudo wire is the MAC address of the target device learned from the pseudo wire;
[0132] The switching module 640 is configured to perform pseudo wire switching by using the MAC address corresponding to the target pseudo wire.
[0133] Optionally, the address acquisition module acquires a MAC address corresponding to a target pseudo wire to be switched to according to an acquisition method corresponding to the switching condition, including:
[0134] A learning submodule, configured to learn the MAC address of the target device from the target pseudo wire to be switched to, and obtain the MAC address corresponding to the target pseudo wire if the switching condition satisfied is a condition for switching from the main pseudo wire to the backup pseudo wire;
[0135] The search submodule is configured to search the memory space for a MAC address corresponding to the target pseudo wire if the switching condition satisfied is a condition for switching from the backup pseudo wire to the main pseudo wire.
[0136] Optionally, the learning submodule includes:
[0137] The learning unit is used to learn the MAC address of the target device from the target pseudo wire to be switched to by adopting the address resolution protocol ARP message flooding method, so as to obtain the MAC address corresponding to the target pseudo wire.
[0138] Optionally, the switching module includes:
[0139] The switching submodule is used to switch the data traffic for the target device to the physical link of the target pseudo wire by using the MAC address corresponding to the target pseudo wire, wherein any pseudo wire corresponds to one physical link.
[0140] Optionally, the condition for switching from the primary pseudowire to the backup pseudowire includes:
[0141] The main link is abnormal; wherein the main link is the physical link of the main pseudo line;
[0142] The conditions for switching from the standby pseudo wire to the main pseudo wire include:
[0143] The backup link is abnormal, or the main link returns to normal; wherein the backup link is the physical link of the backup pseudowire.
[0144] The present disclosure also provides an electronic device, such as Figure 7 As shown, it includes a processor 701, a communication interface 702, a memory 703 and a communication bus 704, wherein the processor 701, the communication interface 702, and the memory 703 communicate with each other through the communication bus 704.
[0145] Memory 703, used for storing computer programs;
[0146] The processor 701 is configured to implement any of the above pseudo wire switching methods when executing the program stored in the memory 703 .
[0147] The communication bus mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0148] The communication interface is used for communication between the above electronic device and other devices.
[0149] The memory may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0150] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0151] In another embodiment provided by the present disclosure, a computer-readable storage medium is provided, in which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above pseudowire switching methods are implemented.
[0152] In another embodiment provided by the present disclosure, a computer program product including instructions is also provided. When the computer program product is run on a computer, the computer is enabled to execute any pseudo wire switching method in the above embodiments.
[0153] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present disclosure is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk Solid State Disk (SSD)), etc.
[0154] 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 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 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 device including the elements.
[0155] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system 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.
[0156] The above description is only a preferred embodiment of the present disclosure and is not intended to limit the protection scope of the present disclosure. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present disclosure are included in the protection scope of the present disclosure.
Claims
1. A pseudo line switching method, characterized in that: The method is applied to a pseudowire switching device deployed in a service provider edge router PE, and comprises: Preset a plurality of cycles, and monitor in each cycle whether any one of a plurality of switching conditions is satisfied during a communication process based on a pseudowire; wherein the plurality of switching conditions include: a condition for switching from a main pseudowire to a backup pseudowire, and a condition for switching from a backup pseudowire to the main pseudowire; the main pseudowire and the backup pseudowire are both pseudowires used for communicating with a target device belonging to a destination device; If a switching condition is met, determining whether the switching condition is met for the first time in the current cycle; If yes, save the MAC address corresponding to the currently used pseudo wire to the routing table of the memory space of the device, and obtain the MAC address corresponding to the target pseudo wire to be switched to according to the acquisition method corresponding to the switching condition; otherwise, search for the MAC address corresponding to the target pseudo wire stored in the memory space; wherein the MAC address corresponding to any pseudo wire is the MAC address of the target device learned from the pseudo wire; wherein the memory space is a software-level memory space; The pseudo wire is switched using the MAC address corresponding to the target pseudo wire.
2. The method according to claim 1, characterized in that: The acquiring, in accordance with an acquisition method corresponding to the switching condition, a MAC address corresponding to the target pseudo wire to be switched to, includes: If the switching condition satisfied is a condition for switching from a primary pseudowire to a backup pseudowire, learning a MAC address of the target device from the target pseudowire to be switched to, and obtaining a MAC address corresponding to the target pseudowire; If the switching condition satisfied is a condition for switching from a backup pseudo wire to a main pseudo wire, a MAC address corresponding to the target pseudo wire is searched in the memory space.
3. The method according to claim 2, characterized in that The step of learning the MAC address of the target device from the target pseudo wire to be switched to, and obtaining the MAC address corresponding to the target pseudo wire, comprises: The address resolution protocol ARP message flooding method is adopted to learn the MAC address of the target device from the target pseudo wire to be switched to, and obtain the MAC address corresponding to the target pseudo wire.
4. The method according to any one of claims 1 to 3, characterized in that: The using the MAC address corresponding to the target pseudo wire to perform pseudo wire switching includes: The data traffic for the target device is switched to the physical link of the target pseudo wire by using the MAC address corresponding to the target pseudo wire, wherein any pseudo wire corresponds to one physical link.
5. The method according to any one of claims 1 to 3, characterized in that: The conditions for switching from the primary pseudowire to the backup pseudowire include: The main link is abnormal; wherein the main link is the physical link of the main pseudo line; The conditions for switching from the standby pseudo wire to the main pseudo wire include: The backup link is abnormal, or the main link returns to normal; wherein the backup link is the physical link of the backup pseudowire.
6. A pseudo line switching device, characterized in that: A pseudowire switching device deployed in a service provider edge router PE, the device comprising: A monitoring module, configured to pre-set a plurality of cycles, and monitor in each cycle whether any one of a plurality of switching conditions is satisfied during a communication process based on a pseudo wire; wherein the plurality of switching conditions include: a condition for switching from a main pseudo wire to a backup pseudo wire, and a condition for switching from a backup pseudo wire to the main pseudo wire; the main pseudo wire and the backup pseudo wire are both pseudo wires used for communicating with a target device belonging to a destination device; A judgment module, used for judging whether a switching condition is satisfied for the first time in a current cycle if the switching condition is satisfied; The address acquisition module is used to save the MAC address corresponding to the currently used pseudo wire to the routing table of the memory space of the device, and obtain the MAC address corresponding to the target pseudo wire to be switched to according to the acquisition method corresponding to the switching condition; otherwise, search for the MAC address corresponding to the target pseudo wire stored in the memory space; wherein the MAC address corresponding to any pseudo wire is the MAC address of the target device learned from the pseudo wire; wherein the memory space is a software-level memory space; The switching module is used to perform pseudo wire switching by using the MAC address corresponding to the target pseudo wire.
7. The device according to claim 6, characterized in that The address acquisition module acquires the MAC address corresponding to the target pseudo wire to be switched to according to the acquisition method corresponding to the switching condition, including: A learning submodule, configured to learn the MAC address of the target device from the target pseudo wire to be switched to, and obtain the MAC address corresponding to the target pseudo wire if the switching condition satisfied is a condition for switching from the main pseudo wire to the backup pseudo wire; The search submodule is configured to search the memory space for a MAC address corresponding to the target pseudo wire if the switching condition satisfied is a condition for switching from the backup pseudo wire to the main pseudo wire.
8. The device according to claim 7, characterized in that The learning submodule comprises: The learning unit is used to learn the MAC address of the target device from the target pseudo wire to be switched to by adopting the address resolution protocol ARP message flooding method, so as to obtain the MAC address corresponding to the target pseudo wire.
9. The device according to any one of claims 6 to 8, characterized in that: The switching module comprises: The switching submodule is used to switch the data traffic for the target device to the physical link of the target pseudo wire by using the MAC address corresponding to the target pseudo wire, wherein any pseudo wire corresponds to one physical link.
10. The device according to any one of claims 6 to 8, characterized in that: The conditions for switching from the primary pseudowire to the backup pseudowire include: The main link is abnormal; wherein the main link is the physical link of the main pseudo line; The conditions for switching from the standby pseudo wire to the main pseudo wire include: The backup link is abnormal, or the main link returns to normal; wherein the backup link is the physical link of the backup pseudowire.
11. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, for implementing the method steps described in any one of claims 1 to 5 when executing a program stored in a memory.
12. 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 method steps described in any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Virtual private LAN service (VPLS) rapid rerouting method and equipment thereof
CN102694718A
Systems and methods to detect, locate, and switch based on signal degrade on Multi-Segment Pseudowires
US20200304365A1