WO2012149862A1 - 环网故障切换方法和装置 - Google Patents

环网故障切换方法和装置 Download PDF

Info

Publication number
WO2012149862A1
WO2012149862A1 PCT/CN2012/073977 CN2012073977W WO2012149862A1 WO 2012149862 A1 WO2012149862 A1 WO 2012149862A1 CN 2012073977 W CN2012073977 W CN 2012073977W WO 2012149862 A1 WO2012149862 A1 WO 2012149862A1
Authority
WO
WIPO (PCT)
Prior art keywords
ring network
link
node
path
data traffic
Prior art date
Application number
PCT/CN2012/073977
Other languages
English (en)
French (fr)
Inventor
周冲
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Priority to EP12779501.1A priority Critical patent/EP2738978A4/en
Publication of WO2012149862A1 publication Critical patent/WO2012149862A1/zh
Priority to US14/187,660 priority patent/US9407538B2/en

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/28Routing or path finding of packets in data switching networks using route fault recovery
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/42Loop networks
    • H04L12/437Ring fault isolation or reconfiguration
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/22Alternate routing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/66Layer 2 routing, e.g. in Ethernet based MAN's

Definitions

  • Ring network failover method and apparatus The present application claims priority to Chinese patent application filed on August 26, 2011, the Chinese Patent Office, Application No. 201110248105.5, entitled “Ring Network Failover Method and Apparatus", the entire contents of which is incorporated herein by reference. This is incorporated herein by reference.
  • the present invention relates to communications technologies, and in particular, to a ring network failover method and apparatus.
  • BACKGROUND OF THE INVENTION Ring network technology is a technology in which some network devices are connected together through the shape of a ring to implement mutual communication, for example, a Layer 2 Ethernet ring network.
  • the data traffic sent by the source node is entered into the ring network by one of the network devices (which may be called a ring network node) in the ring network, and then transmitted along the ring network path, and then another The network device flows out of the ring network and sends it to the destination node.
  • the media access control (Media Access Control, MAC address) address re-executes the MAC address learning mode. For example, the data traffic entering the ring from the first node in the ring network is routed to the A interface of the third node and exited by the third node, and the third node can record the source MAC address of the data traffic. Corresponding relationship of the A interface, so that when receiving the traffic destined for the source MAC address, the traffic is sent from the A interface.
  • Media Access Control Media Access Control
  • the third node When the second node fails, the third node only knows that the ring network is faulty, but does not know the fault location of the ring network. If it is still sent from the A interface, the transmission failure may occur; therefore, in the ring network failure, the first node The three nodes usually perform broadcast transmission until the traffic that flows back to itself is received, and the path that can be successfully transmitted corresponding to the source MAC address is determined, and the broadcast is stopped, and the traffic is switched to the new path transmission. This makes the ring network's processing efficiency for faults too low; and, because of MAC The address learning time is long. Before the new MAC address is learned, the ring network is full of broadcast traffic, which greatly increases the load pressure of the ring network traffic.
  • the present invention provides a ring network failover method, where the ring network includes a local node, a first node, and a link connecting the local node and the first node; the handover method includes: receiving a first data traffic, The first data traffic includes a destination MAC address, and according to the destination MAC address, querying a forwarding entry stored by the local node, and obtaining a ring network identifier corresponding to the destination MAC address, where the ring network identifier is connected to the The first node of the destination MAC address uniquely corresponds to; obtaining path state information of the link corresponding to the ring network identifier;
  • the present invention provides a ring network failover method, where the ring network includes a local node, a second node, and a link connecting the local node and the second node.
  • the switching method includes: receiving a second data traffic, where the The second data traffic includes a source MAC address, and the ring network identifier corresponding to the local node is set in the second data traffic, and the second data traffic after the ring network identifier is set is sent to the second node. So that the second node is forwarding
  • the link detection packet includes the ring network identifier, so that the second node receives the packet according to the link detection packet.
  • a status obtaining path state information of the link, and identifying the ring network and the path
  • the state information is recorded in the forwarding entry, so that the second node, when receiving the first data traffic including the destination MAC address, queries the forwarding entry stored by the local node according to the destination MAC address, and obtains a ring network identifier corresponding to the destination MAC address, and path state information of the link corresponding to the ring network identifier; and when the path state information indicates that the link is in a fault state, the first Data traffic is sent to the first node in a direction opposite to the link; the source MAC address is the same as the destination MAC address.
  • the present invention provides a ring network failover apparatus, including: a first receiving unit, configured to receive a first data traffic, where the first data traffic includes a destination MAC address; and a first query unit, configured to use, according to the destination MAC address Querying a forwarding entry stored by the local node, and obtaining a ring network identifier corresponding to the destination MAC address, where the ring network identifier uniquely corresponds to the first node connected to the destination MAC address; The path information information of the link corresponding to the ring network identifier; the first processing unit, configured to: when the path state information indicates that the link is in a fault state, the first data traffic along the link The opposite direction is sent to the first node.
  • the present invention provides a ring network failover apparatus, including:
  • a second receiving unit configured to receive a second data traffic, where the second data traffic includes a source MAC address, and an identifier setting unit, configured to set, in the second data traffic, a ring network identifier uniquely corresponding to the local node;
  • a second processing unit configured to send the second data traffic after setting the ring network identifier to the second node, so that the second node records the source MAC address and the ring in a forwarding entry Correspondence of the network identifier; and, a detection packet sending unit, configured to send a link detection packet to the second node by using the link, where the link detection packet includes the ring network identifier, and a link identifier of the link And obtaining, by the second node, path state information of the link according to the receiving status of the link detection packet, and identifying the ring network, the link identifier of the link, and the path The status information is recorded in the forwarding entry, so that the second node, when receiving the first data traffic including the destination MAC address, queries the
  • the ring network failover method and device of the present invention obtains the corresponding ring network identifier and the path state information of the link according to the MAC address of the data traffic, and when the link is in a fault state, the data traffic is in the opposite direction to the link.
  • the solution solves the problem that the ring network fault handling method is complicated and the efficiency is too low, and the failover process is centralized, which greatly improves the switching efficiency.
  • FIG. 1 is a schematic diagram of a ring network structure used in an embodiment of a ring network failover method according to the present invention
  • FIG. 2 is a schematic flowchart of a ring network failover method according to an embodiment of the present invention
  • FIG. 3 is a schematic flowchart of another embodiment of a ring network failover method according to the present invention.
  • FIG. 4 is a schematic diagram of a normal state of a ring network according to still another embodiment of a ring network failover method according to the present invention
  • FIG. 5 is a schematic diagram of a ring network fault state according to still another embodiment of a ring network failover method according to the present invention
  • FIG. 6 is a schematic structural diagram of an embodiment of a ring network failover apparatus according to the present invention
  • FIG. 7 is a schematic structural diagram of another embodiment of a ring network failover apparatus according to the present invention.
  • FIG. 1 is a schematic diagram of a ring network structure used in an embodiment of a method for failing over a ring network in the present invention. As shown in FIG. 1 , this is a ring network composed of four ring network nodes, and the four ring network nodes are respectively R1. R2, R3 and R4. Each node is connected by a link, for example, a link f between R1 and R2. The link is bidirectional, that is, data traffic can flow from R1 through link f to R2, or from R2 through link f. Flow to Rl. Suppose a data traffic passes through the ring network.
  • the data traffic is sent from the source node L1 (the MAC address of the source node L1 is the source MAC address of the data traffic) and sent to the destination node L2 (the MAC address of the destination node L2 is The destination MAC address of the data traffic). It is assumed that the data traffic sent by the source node L1 is sent to the node R1 in the ring network, and the node R1 enters the ring.
  • the node R1 can be called the ring-in node; after the data traffic is transmitted in the ring network, the slave node R4 The ring, and can be sent to the destination node L2, which can be called the exit node.
  • data traffic in the reverse direction may also occur, that is, the node L2 may also issue another data traffic, the data traffic is looped from the node R4, looped out from the node R1, and then sent to the node L1, at this time, the node L2 As the source node, node L1 is the destination node.
  • the switching method will be described by taking the ring network of the above configuration and the two types of data traffic as an example.
  • FIG. 2 is a schematic flowchart of an embodiment of a ring network failover method according to an embodiment of the present invention.
  • R1 in the ring network shown in FIG. 1 may be defined as a first node, and R2 in the ring network is defined.
  • R3, or R4 may be referred to as a local node device; the handover method of this embodiment is performed by the local node device.
  • the method may include:
  • the 101 Receive a first data traffic, where the first data traffic includes a destination MAC address of the first data traffic.
  • the first data traffic is the traffic entering the ring network. Specifically, the data flows from the node R4 to the ring network after being sent from the node L2, and the data flows from the node R1 to the node L1 after passing through the ring network.
  • the traffic enters the ring network from the local node device; if the traffic is transmitted in the direction of node R4 - node R3 - node R2 - node R1, then for node R2 or node R3, the traffic is from Other nodes in the ring enter and flow through the local node device; of course, the traffic can also be transmitted from the path of node R4 - node R1.
  • the destination MAC address is the destination address of the first data traffic. In this embodiment, the destination MAC address carried in the first data traffic is the MAC address of the node L1.
  • the local node device itself stores a forwarding entry, where the forwarding entry stores a correspondence between a MAC address and a ring network identifier, and a path state letter of the link corresponding to the ring network identifier.
  • the ring network identifier is uniquely corresponding to the ring network node in the ring network, and is set by the first ring network node that the data traffic enters the ring network, that is, the ring entry node, and the ring network identifier is The setting corresponds to the source MAC address of the data traffic received by the ringing node.
  • An example is as follows: Assume that the data traffic sent by the node L1 as the source node enters the ring network by the node R1, when the node R1 receives the traffic, the ring network identifier a is inserted into the data traffic, and the ring network identifier a is used for
  • the ring network marked with the node R1 as the ingress node is equivalent to recording the traffic with the node L1 as the source node entering the ring from the node R1, but the ring network identified by the ring network identifier a does not limit the direction, when the reverse direction occurs.
  • node R1 can also act as an outgoing node for traffic in the ring network.
  • the local node device can record the data traffic in the forwarding entry.
  • the data traffic should be directly sent to the node R1 corresponding to the ring network identifier a.
  • the above is an example of the data traffic of the node R1 entering the ring node.
  • the traffic is set by the node R1 to the ring network identifier a.
  • the set ring network identifier is different.
  • the node R2 can set the ring network identifier b in the traffic, and the ring network identifier b is different from the ring network identifier a. That is, when each node in the ring network is used as the ingress ring node, the ring network identifiers set in the inbound traffic are different, so that the ring network with each node as the endpoint can be distinguished.
  • the ring network identifier a represents The node R1 is used as the ring network of the endpoint, and the ring network identifier b represents the ring network with the node R2 as the endpoint.
  • the endpoint refers to the ringing node or the ringing node which can be the ring network.
  • the ring network identifier corresponding to the destination MAC address corresponds to the node R1.
  • the mapping between the destination MAC address and the ring network identifier may be recorded in the forwarding entry of the local node.
  • the mapping between the first node R1 and the ring network identifier is not required to be recorded; because the local node device records the correspondence between the destination MAC address and the ring network identifier, the interface that receives the ring network identifier can be regarded as the MAC address.
  • the output interface of the data flow of the destination address can be directly output from the output interface when receiving the data traffic.
  • the link between the node R1 and the local node device includes a first link and a second link that form a ring network. That is, the node R1 may be connected to the local node device R4 through the first link node R1-node R2-node R3-node R4, or may be connected to the local node device R4 through the second link R1-R4, and may be identified by the link.
  • the distinction is made, for example, the first link and the second link.
  • the path state information of the link refers to that the link is in a normal state or a fault state.
  • the path state information of the link may be determined according to the receiving condition of the link detection packet by sending a link detection packet. If the packet can be continuously received according to a preset condition, the chain is indicated. The path is normal. If the message is not received, the link is faulty.
  • the link detection packet may be sent by the first node R1, and the ring network identifier is set in the packet, so that the local node devices R2, R3, and R4 can be identified according to the ring network identifier. Which link is the link and record the path status information of the link.
  • the preset condition may refer to receiving one message every 50 ms seconds and continuously losing no more than three messages.
  • the local node device may use the interface that the local node receives the ring network identifier as the output interface of the data traffic with the specific MAC address as the destination address. For example, the data traffic received by the local node device through the first interface, including the source MAC address of the data traffic and the ring network identifier a, uses the first interface as an output interface corresponding to the source MAC address; the next time the local node device receives When the first data traffic is reached, if the destination address of the first data traffic is the source MAC address, the traffic is output from the output interface, and the first data traffic is along the ring network label. The link corresponding to a is sent.
  • the local node device learns that the link corresponding to the ring network identifier a is in a fault state by querying the forwarding entry, the first data traffic is sent in the opposite direction to the link corresponding to the ring network identifier a.
  • the ring network identifier a corresponds to the node R1
  • the ring network corresponding to the ring network identifier a includes two links, that is, the first path that the node R1 connects to the local node device from the left direction, and connects to the local device from the right direction.
  • the second path of the node device the first data traffic is sent from the node R1 along the first path to the local node device; and the forwarding entry indicates that the first path fails, the local node device can send the traffic from the second path.
  • the local node device in the ring network itself stores a forwarding entry, where the MAC address and the corresponding link are recorded in the forwarding entry.
  • the path status information is such that when the local node device receives the data traffic, it can directly obtain the transmission path corresponding to the traffic according to the destination MAC address of the traffic, and when the query finds that the link is faulty, the local node device
  • the traffic can be automatically sent to other paths; each node in the ring network can know whether the traffic transmission path is clear, and can also automatically change the transmission path of the traffic, without the need for mutual notification between nodes as in the prior art.
  • Learning complex processing such as MAC, which greatly improves the efficiency of ring network failover, and the processing method is simple.
  • FIG. 3 is a schematic flowchart of another embodiment of a ring network failover method according to the present invention.
  • a node R2, a node R3, or a node R4 in a ring network may be referred to as a second node.
  • the switching method of this embodiment is local Executed by the node device.
  • the local node device needs to perform the action of setting a ring network identifier in data traffic, and performing the action of sending a link detection packet according to 203, as described in 201-202.
  • the second data traffic includes a source MAC address, where the second data traffic received by the local node device is an inbound traffic, and is specifically sent from the node L1 and then enters the ring from the node R1. And after the ring network, the traffic from the node R4 to the node L2 needs to be sent out; the local node device R1 serves as the ringing node of the ring network.
  • the second data traffic includes the source MAC address of the data traffic, that is, the MAC address of the node L1.
  • a ring network identifier corresponding to the local node uniquely in the second data traffic, and send the second data traffic after the ring network identifier is set to the second node; where the local node device receives the second one in 201
  • the ring network identifier is set in the traffic, and the ring network identifier is used to indicate the ring network that uses the local node device as the ingress or outbound node; and the ring network identifier uniquely corresponds to the local node device, that is, If the second data traffic from the source MAC address enters the ring from another node in the ring network, the other node will set another ring network identity for the second data traffic.
  • each ring network identifier corresponds to a different ring network node, and the ring network node corresponds to the MAC address of the source node, the ring network identifier corresponds to a link, and the link is the MAC of the source node.
  • the traffic whose address is the destination address is sent to the link of the ring network node.
  • the local node device sends the second data traffic after the ring network identifier is set to the second node, so that the second node can record the second data in the forwarding entry stored by the second node itself after receiving the traffic.
  • the corresponding relationship between the source MAC address of the traffic and the ring network identifier is recorded.
  • the second node receives the data traffic with the MAC address as the destination MAC address, the second node can learn according to the corresponding relationship.
  • the traffic should be sent to the ring network identifier. Link.
  • the local node device sets the ring network identifier in the data traffic and sends the ring network identifier to the second node, so that the second node can find the link represented by the corresponding ring network identifier according to the MAC address in the traffic;
  • the local node device detects the packet by sending a link including the ring network identifier, so that the second node can learn whether the link is in a normal state according to the receiving condition of the packet.
  • the link detection packet includes a ring network identifier, so that the second node can identify that the packet corresponds to the link represented by the ring network identifier.
  • the second node can learn the path state information of the link according to the receiving condition of the packet, for example, in a normal state or a fault state. If the packet can be continuously received according to a preset condition, the link is normal, if the packet is reported If the message does not receive, it indicates that the link is faulty.
  • the second node may record the ring network identifier and the path state information corresponding to the ring network identifier in the forwarding entry of the second node itself.
  • the second node records the ring network identifier corresponding to the source MAC address of the node L1, and can learn the link corresponding to the destination MAC address of the second data traffic (the link between the node R1 and the second node).
  • the path status information of the link is also recorded. Therefore, when receiving the data traffic, the second node can query the forwarding entry stored by the local node according to the destination MAC address in the data traffic, and obtain the corresponding MAC address.
  • the ring network failover method in this embodiment obtains the corresponding ring network identifier and the path state information of the link according to the MAC address of the data traffic, and when the link is in a fault state, the data traffic is in the opposite direction to the link.
  • Send solve the loop network fault handling method is complex and efficient
  • Embodiment 3 This embodiment uses the ring network shown in FIG. 1 as an example to describe the switching method of the first embodiment and the second embodiment in more detail.
  • the second layer Ethernet ring network is taken as an example, but Concrete
  • FIG. 4 is a schematic diagram of a ring network normal state according to still another embodiment of the ring network failover method of the present invention
  • FIG. 5 is a schematic diagram of a ring network fault state according to still another embodiment of the ring network failover method of the present invention.
  • the ring network is in a normal state, and the nodes R1 to R4 in the ring in the embodiment send link detection packets, and the node R1 functions as an ingress ring node to set a ring network identifier in the data traffic that is still in the ring;
  • the following describes the transmission of the link detection packet and the setting of the ring network identifier in the data traffic.
  • the node R1 is used as an example.
  • the format of the packet detection packet sent by the node R1 can be found in Table 1 below. Show; Table 1 Link detection message structure
  • the ring network identifier (Label) is included in the file.
  • the ring network identifier is uniquely associated with the node R1.
  • the ring network identifier can be set after the link layer packet header of the packet, where the link layer is located.
  • the header refers to DMAC, SMAC, and Type.
  • the ring network identifier can be a Multi-Protocol Label Switching (MPLS) label, or Use other identifiers that can uniquely identify the role of the ring network node.
  • MPLS Multi-Protocol Label Switching
  • the DMAC and the SMAC can be arbitrarily selected.
  • the MAC address of the node R1 can be used as the DMAC and the SMAC, which is equivalent to defining the source MAC address of the link detection packet. If the destination MAC address is the node R1, the link detection packet will be sent from the node R1, and then transmitted to the node R1 along the nodes of the ring network. Even if the DMAC and SMAC are arbitrarily selected, the ring network is a unidirectional channel. The packet sent by R1 will also return to node R1 after being transmitted over the ring network.
  • the type of the protocol is defined in the Type. Since the link detection packet is a newly added packet to the ring network node in the embodiment of the present invention, the Type is a new protocol type that does not conflict with the existing protocol.
  • the flag behind the Label can be 8 bits long.
  • the main format and contents can be found in Table 2 below:
  • the type length value (type-length-value, TLV) is included, and TLV Num indicates the number of TLVs carried by the packet; When the TLV bearer flag is 0, the TLV Num must be 0.
  • the TLV carries the ring network attribute information, for example, the device IPv4 identifier ID; the device IPv6 identifier ID; Name string; device load information; link traffic report; link quality report; link detection packet transmission interval; encrypted authentication information; message sequence number, etc.
  • TLV content is not limited to the above aspects , can be expanded as needed.
  • the device IPv4 and IPv6 identifier ID and the device name string are the device identifiers of the R1, which is useful for finding the device that sends the packet when the detection packet is faulty; device load information, chain The traffic report and the link quality report can help to grasp the link load and quality in the ring network.
  • the interval for sending link detection packets can help the node to receive packets in the ring network.
  • the receiving status of the text; the encrypted authentication information can effectively identify the faked message and ensure the authenticity of the detected message.
  • node R1 can send packets in two directions, one of which is the link detection message transmitted along the ring loop of the a loop, and the other is the link detection of the ring network transmission along the a2 loop.
  • the two packets can be distinguished by the left and right direction identifiers in the above-mentioned Flags.
  • the packets of the al loop can be defined as the L packets in the left direction
  • the packets of the a2 loop can be defined as the packets in the right direction. .
  • the purpose of sending the packet in the two directions is to take the ring network node R4 as an example.
  • R4 in this embodiment is the egress ring node.
  • R4 can receive the al ring packet normally, only the loop along the al can be specified.
  • the link from R1 to R4 is in the normal state, and the link state from R4 to R1 in the direction of the a loop is unknown.
  • R4 can receive the a2 ring packet normally, only the loop along a2 can be explained.
  • the link from R1 to R4 is in a normal state, and the link state from R4 to R1 in the a2 loop direction is unknown.
  • the nodes R2 and R3 in the ring network can also learn the path status of the two sides according to the link detection packet, which is beneficial to the ring network when the link fails.
  • the nodes can detect link faults and select normal links for traffic transmission to improve the efficiency of fault handling.
  • the link from R1 to R4 in the direction of the a loop can be defined as the first path, and the link from R1 to R4 in the direction of the a2 loop is defined as the second.
  • the path is determined by the R4 according to the receiving status of the link detection packet, and whether the first path and the second path are in a normal state. For example, if R4 continuously receives n (default is 3) correct link detection messages within the specified time, it indicates that the link is normal; if R4 does not receive n consecutively (default is 3) correctly within the specified time The link detection packet indicates that the link is faulty.
  • the number of consecutively received packets may be other than 3, and the specified time may be configured independently, or may be based on the interval of sending the packets in the TLV in the link detection packet. determine. For example, both the first path and the second path are in a normal state.
  • R4 may record the path state information in its own forwarding entry stored in the forwarding entry. Specifically, the R4 may record the ring network identifier in the link detection packet, and the path state information of the first path and the second path corresponding to the ring network identifier; and the first path and the foregoing path may be distinguished by the link identifier.
  • the second path, the link identifier may be a left-right direction identifier in the flag in the link detection packet, where the first path corresponds to an L (Left) direction, a second path corresponds to an R (Right) direction, and the two directions have The same ring logo. For example, record the Label, the L (Left) direction link corresponding to the Label, and the link status as normal.
  • Each node in the ring network can detect the ring network status of the ring network through the link detection packet. For example, when R1 receives the packet sent by itself, it determines that the ring network is unblocked; R4 receives the packet sent by R1. When it is determined, the link between R1 and R4 is normal.
  • R1 not only sends the link detection packet carrying the ring network identifier, but also sets the ring network identifier in the inbound traffic. Specifically, R1 receives the data traffic bl, and the data traffic bl is sent from the source MAC address to the R1, and the source MAC address is included in the data traffic; R1 sets a ring network identifier in the data traffic, and the ring network identifier and The link detection in the above-mentioned link detection Same. For details on how to set the ring network ID in data traffic, see Table 3 and Table 4 below: Table 3 Example of ring network ID setting structure in data traffic
  • DMAC SMAC Type Label Data Table 4 Example of ring network identification setting structure in data traffic
  • the ring network identifier can be set after the link layer header of the data traffic before the data bearer layer. After the ring network identifier is set, the data traffic bl can be called data traffic b2 to distinguish it from bl. R1 can send data traffic b2 to R4 through the first path. After receiving the data traffic b2, R4 records the correspondence between the source MAC address and the ring network identifier in the data traffic b2 in its own forwarding entry, that is, the data traffic sent to the source MAC address needs to be sent to the location. The link corresponding to the ring network identifier.
  • the ring network identifier corresponding to the link may be two, for example, the foregoing first path and the second path; and the data traffic sent to the source MAC address can only be from one path.
  • R1 can specify the priority of two paths in advance when sending link detection packets. Specifically, for example, R1 is connected to the first interface of R4 through the first path, and R1 is connected to the second interface of R4 by the second path; R1 is set in the Flag of the packet when sending the message in two directions.
  • the primary and backup priorities are different.
  • the primary and backup priorities configured in the two directions are different.
  • the packet corresponding to the first path is the primary priority
  • the packet corresponding to the second path is the priority.
  • R4 needs to send data traffic to R1
  • the first path is preferentially sent.
  • the path fails, select the second path to send. That is, by setting the primary and backup priorities, R4 determines that its first interface is the output interface of the data traffic destined for the source MAC address, and binds the ring identifier to the interface.
  • R4 is the outgoing node of data traffic b2, and data traffic b2 is sent from R4 to the destination MAC address.
  • R4 deletes the ring network identifier before sending the data traffic b2.
  • the data traffic b2 of the deleted ring identifier is returned to the original data traffic bl and sent to the destination MAC address. Further, if R1 receives data traffic sent by itself as an ingress ring node to the ring network, for example, R1 receives data traffic b2, indicating that the data traffic b2 does not find a ring network connected to the destination MAC address in the ring network. At this time, R1 will directly discard the data traffic b2, and implement the blocking of the spontaneous packets to avoid repeated forwarding of the ring network and better reduce the load on the ring network.
  • Rings generally set the blocking point in the ring network; in order to avoid the transmission of traffic in a single direction, the ring network node may encounter the failure of the receiving node and encounter the set of breakpoints, causing the traffic to fail to be sent, usually by means of broadcast transmission.
  • the load on the ring network is large.
  • R1 itself is used as the blocking point. Therefore, R1 can send traffic in one direction and ensure smooth ring-out, thus reducing the load on the ring network. Even if the receiving node is not found in the ring network, As mentioned above, R1 is also capable of self-blocking.
  • the ring network is in the fault state. If the R2 in the ring network fails, the packets in the direction of the a2 and the packets in the a2 direction are in the link detection packet sent by R1. An interrupt occurred at R2. If R4 does not receive the message in the al direction continuously within the specified time, it can know that the first path is in the fault state and can receive the packet along the a2 direction. It can be known that the second path is in the normal state. Similarly, R3 can also listen to the link detection packet sent by R1, and learn that the path from R1 to R3 in the al direction is in a fault state, and the path from R1 to R3 in the a2 direction is in a normal state. Both R4 and R3 record the path state information obtained above in their respective forwarding entries, for example, the state of the first path is changed from normal to failure.
  • R4 is used as the ingress node, and the source MAC address of the received data traffic cl is For the destination MAC address of the data traffic b1 shown in FIG. 4, the destination MAC address of the data traffic cl is the source MAC address of the data traffic bl.
  • R4 After receiving the data traffic cl, R4 queries the forwarding entry stored by itself, and obtains the corresponding ring network identifier according to the destination MAC address of the data traffic cl, that is, the ring network identifier corresponding to R1 can be obtained, so that R4 can know that Send the data traffic to Rl. In the same way, when R4 receives the data traffic cl, it also sets the ring network identifier corresponding to R4. The comparison will not be repeated.
  • the data traffic with the ring network identifier added can be called data traffic c2.
  • R4 obtains the path state information of the link corresponding to the ring network identifier in the forwarding entry according to the obtained ring network identifier. For example, the forwarding priority of the corresponding destination MAC address is recorded in the forwarding entry of R4.
  • the first path of the level is in a fault state, and the second path of the standby priority is in a normal state; then R4 automatically adjusts the outbound interface of the data traffic c2 from the first interface to the second interface in the opposite direction.
  • R5 can also sense that the link in the R2 direction is faulty, and the interface is automatically switched to the opposite of R2.
  • R1 deletes the ring network identifier of the corresponding R4, and returns it to the data traffic cl to the destination MAC address.
  • the R4 may detect the link priority identifier determined in the link according to its own link. The data traffic is sent to the primary priority. Otherwise, if the priority is not configured, the data traffic can be sent in the ring network. It should be noted that, in a specific implementation, the manner in which the link detection packet is sent may also be flexibly selected.
  • R1 only sends packets along the direction of the a loop
  • R4 only You can learn the link from R1 to R4 along the direction of the a loop. In this case, you can configure R4 so that the interface that receives the packet by default is the outbound interface with higher priority.
  • priority is given. Traffic is sent from the interface; and the detected link is In the event of a failure, the default automatically sends traffic in the opposite direction of the link.
  • the ring network identifier may be nested in a plurality of nested ring networks; as long as it can uniquely identify the ring corresponding to the nodes in the ring.
  • the role can be.
  • the ring network failover method in this embodiment obtains the corresponding ring network identifier and the path state information of the link according to the MAC address of the data traffic, and when the link is in a fault state, the data traffic is in the opposite direction to the link.
  • the solution solves the problem that the ring network fault handling method is complicated and the efficiency is too low, and the failover process is centralized, which greatly improves the switching efficiency.
  • FIG. 6 is a schematic structural diagram of an embodiment of a ring network failover apparatus according to the present invention.
  • the switching apparatus may be R4 in FIG. 5, and may perform a ring network failover method according to any embodiment of the present invention.
  • the structure of the device is described in the embodiment.
  • the specific working principle of the device may be described in conjunction with the method embodiment, and details are not described herein.
  • the apparatus may include: a first receiving unit 51, a first query unit 52, and a first processing unit 53;
  • the first receiving unit 51 is configured to receive the first data traffic, where the first data traffic includes a destination MAC address, and the first querying unit 52 is configured to query, according to the destination MAC address, a forwarding entry stored by the local node, Obtaining a ring network identifier corresponding to the destination MAC address, where the ring network identifier uniquely corresponds to the first node connected to the destination MAC address, and obtaining a path of the link corresponding to the ring network identifier
  • the first processing unit 53 is configured to send the first data traffic to the first node in a direction opposite to the link when the path state information indicates that the link is in a fault state. .
  • the device may further include a detection message receiving unit 54 and a link state recording unit 55;
  • the detecting message receiving unit 54 is configured to receive, after the querying the forwarding entry stored by the local node, the link detection packet sent by the first node by using the link, where the link detection packet includes a ring network identifier, and a link identifier of the link;
  • a link state recording unit 55 configured to obtain path state information of the link according to the receiving status of the link detection packet;
  • the ring network identifier, the link identifier of the link, and the path state information are recorded in the forwarding entry.
  • the device may further include: a traffic receiving unit 56, an identifier recording unit 57, wherein the traffic receiving unit 56 is configured to receive the second data traffic sent by the first node before receiving the first data traffic, where
  • the second data traffic includes a source MAC address and the ring network identifier, the ring network identifier is corresponding to the source MAC address, and the source MAC address is the same as the destination MAC address in the first data traffic.
  • the ring network identifier is set by the first node;
  • the identifier recording unit 57 is configured to record, in the forwarding entry, a correspondence between the source MAC address and the ring network identifier. Further, the apparatus may further include: an identifier deleting unit 58 configured to delete the ring network identifier in the second data traffic before sending the second data traffic.
  • the link may include a first path and a second path that form a ring; the first node is connected to the first interface of the local node by using the first path, and the first node is connected to the second path by using the second path a second interface of the local node; at this time, the first query unit 52 is specifically configured to obtain path state information of the first path and the second path corresponding to the ring network identifier; and the ring network identifier is bound to the a first interface, configured to indicate that the first data is sent from the first interface, where the first processing unit 53 is configured to: when the path state information of the first path indicates that the first path is in a fault state, Passing the first data traffic from the second path corresponding to the second path The port is issued to the first node.
  • the ring network failover apparatus of this embodiment obtains the corresponding ring network identifier and the path state information of the link according to the MAC address of the data traffic by setting the first query unit and the first processing unit, and the link is in a fault state.
  • the problem that the ring network fault handling is complicated and the efficiency is too low is solved, and the failover process is centralized, which greatly improves the switching efficiency.
  • FIG. 7 is a schematic structural diagram of another embodiment of a ring network failover apparatus according to the present invention.
  • the switching apparatus may be R1 in FIG. 4, and may perform a ring network failover method according to any embodiment of the present invention.
  • the structure of the device is described in the following, and the specific working principle may be described in conjunction with the method embodiment, and details are not described herein again.
  • the apparatus may include: a second receiving unit 61, an identifier setting unit 62, a second processing unit 63, and a detection packet sending unit 64.
  • the second receiving unit 61 is configured to receive the second data traffic.
  • the second data flow includes a source MAC address
  • the identifier setting unit 62 is configured to set a ring network identifier uniquely corresponding to the local node in the second data traffic
  • a second processing unit 63 configured to: The second data traffic after the ring network identifier is sent to the second node, so that the second node records the correspondence between the source MAC address and the ring network identifier in the forwarding entry;
  • a text sending unit 64 configured to send, by using the link, a link detection packet to the second node, where the link detection packet includes the ring network identifier and a link identifier of the link; So that the second node obtains path state information of the link according to the receiving status of the link detection packet, and the ring network identifier, the link
  • the second node When the second node receives the first data traffic including the destination MAC address, the second node is configured to query the forwarding entry stored by the local node according to the destination MAC address, and obtain a ring network identifier corresponding to the destination MAC address. And the path state information of the link corresponding to the ring network identifier; and when the path state information indicates that the link is in a fault state, the first data traffic is in a direction opposite to the link Sending to the first node; the source MAC address is the same as the destination MAC address. Further, the identifier setting unit 62 is configured to: after the link layer header of the second data traffic, before the data bearer layer, set the ring network identifier uniquely corresponding to the local node.
  • the detection packet sending unit 64 is further configured to set the ring network attribute information in the link detection message; the ring network attribute information includes a link detection packet sending interval time, and a local node device identifier. And local node device load information, traffic information and quality information of the link.
  • the device may further include: a message blocking unit 65, configured to: after sending the second data traffic after setting the ring network identifier to the second node, after receiving the second node, When the second data traffic returned after the ring network is transmitted, the second data traffic is discarded.
  • the link may include a first path and a second path that form a ring; the local node is connected to the first interface of the second node by using the first path, and the local node is connected to the first node by using the second path a second interface of the second node; the detection packet sending unit 64 is configured to send the first link detection packet to the second node by using the first path, and the second path is used to The second node sends a second link detection message. Further, the detection message sending unit 64 is further configured to set a first priority of the first path in the first link detection message, and Setting a second priority of the second path in the second link detection packet, where the first priority and the second priority are different.
  • the ring network failover apparatus of the present embodiment obtains the corresponding ring network identifier and the path state information of the link according to the MAC address of the data traffic by setting the identifier setting unit and the detection packet sending unit, and the link is in a fault state.
  • the problem that the ring network fault handling is complicated and the efficiency is too low is solved, and the failover process is centralized, which greatly improves the switching efficiency.
  • a person skilled in the art can understand that all or part of the steps of implementing the above method embodiments may be completed by using hardware related to program instructions, and the foregoing program may be stored in a computer readable storage medium, and the program is executed when executed.
  • the method includes the steps of the foregoing method embodiments; and the foregoing storage medium includes: a medium that can store program codes, such as a ROM, a RAM, a magnetic disk, or an optical disk.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Small-Scale Networks (AREA)

Abstract

本发明提供一种环网故障切换方法和装置,其中方法包括:接收第一数据流量,所述第一数据流量中包括目的MAC地址;根据所述目的MAC地址,查询本地节点存储的转发表项,得到与所述目的MAC地址对应的环网标识,所述环网标识与连接至所述目的MAC地址的所述第一节点唯一对应;并得到所述环网标识对应的所述链路的路径状态信息;在所述路径状态信息表明所述链路处于故障状态时,将所述第一数据流量沿与所述链路相反的方向发送至所述第一节点。本发明筒化了故障切换的流程,大大提高了切换效率。

Description

环网故障切换方法和装置 本申请要求于 2011 年 8 月 26 日提交中国专利局、 申请号为 201110248105.5、 发明名称为 "环网故障切换方法和装置" 的中国专利申请 的优先权, 其全部内容通过引用结合在本申请中。
技术领域 本发明涉及通信技术, 特别涉及一种环网故障切换方法和装置。 背景技术 环网技术即将一些网络设备通过环的形状连接到一起, 实现相互通信 的一种技术, 例如, 二层以太环网。 数据流量在通过环网进行传输时, 通 常是源节点发出的数据流量由环网中的其中一网络设备 (可以称为环网节 点)进入环网, 沿环网路径传输后, 再由另一网络设备流出环网, 发往目 的节点。
当环网中的某一网络设备发生故障时, 流经该设备的数据流量将中断, 源节点发出的数据流量将不能按照原有的环网路径传输, 此时环网中的节 点通常采用清除媒体接入控制 (Media Access Control, 筒称: MAC )地址 重新进行 MAC地址学习的方式。例如,从环网中的第一节点入环的数据流 量, 途径第二节点后到达第三节点的 A接口并由该第三节点出环, 该第三 节点可以记录数据流量的源 MAC地址与所述 A接口的对应关系, 以使得 在接收到发往所述源 MAC地址的流量时, 将流量从 A接口发出。 当第二 节点故障时, 上述第三节点仅仅知道环网发生故障, 但具体不知道环网的 故障位置, 若仍然从 A接口发出, 则可能出现发送失败; 因此, 在环网故 障时, 第三节点通常是进行广播发送, 直至收到反向流至自身的流量, 确 定了对应所述源 MAC地址的可以成功传输的路径时才停止广播,并将流量 切换到新路径传输。这使得环网对于故障的处理效率太低;而且,由于 MAC 地址学习时间较长, 在学习到新的 MAC 地址之前环网中到处都是广播流 量, 大幅增加了环网流量负载压力。 发明内容 本发明的目的是提供一种环网故障切换方法和装置, 以筒化故障切换 流程, 提高切换效率。 本发明提供一种环网故障切换方法, 所述环网包括本地节点、 第一节 点, 以及连接本地节点和所述第一节点的链路; 所述切换方法包括: 接收第一数据流量, 所述第一数据流量中包括目的 MAC地址; 根据所述目的 MAC地址, 查询本地节点存储的转发表项,得到与所述 目的 MAC地址对应的环网标识, 所述环网标识与连接至所述目的 MAC地 址的所述第一节点唯一对应; 得到所述环网标识对应的所述链路的路径状 态信息;
在所述路径状态信息表明所述链路处于故障状态时, 将所述第一数据 流量沿与所述链路相反的方向发送至所述第一节点。 本发明提供一种环网故障切换方法, 所述环网包括本地节点、 第二节 点, 以及连接本地节点和第二节点的链路; 所述切换方法包括: 接收第二数据流量, 所述第二数据流量中包括源 MAC地址; 在所述第 二数据流量中设置与本地节点唯一对应的环网标识, 并将设置所述环网标 识之后的第二数据流量发送至所述第二节点, 以使得所述第二节点在转发
通过所述链路向所述第二节点发送链路检测报文, 所述链路检测报文 中包括所述环网标识; 以使得所述第二节点根据所述链路检测报文的接收 状况, 得到所述链路的路径状态信息, 并将所述环网标识以及所述路径状 态信息记录在所述转发表项中; 以使得所述第二节点在接收到包括目的 MAC地址的第一数据流量时, 根据所述目的 MAC地址, 查询本地节点存储的转发表项,得到与所述目的 MAC地址对应的环网标识, 以及所述环网标识对应的所述链路的路径状态 信息; 并在所述路径状态信息表明所述链路处于故障状态时, 将所述第一 数据流量沿与所述链路相反的方向发送至所述第一节点;所述源 MAC地址 与所述目的 MAC地址相同。 本发明提供一种环网故障切换装置, 包括: 第一接收单元, 用于接收第一数据流量, 所述第一数据流量中包括目 的 MAC地址; 第一查询单元, 用于根据所述目的 MAC地址, 查询本地节点存储的转 发表项,得到与所述目的 MAC地址对应的环网标识, 所述环网标识与连接 至所述目的 MAC地址的所述第一节点唯一对应;并得到所述环网标识对应 的所述链路的路径状态信息; 第一处理单元, 用于在所述路径状态信息表明所述链路处于故障状态 时, 将所述第一数据流量沿与所述链路相反的方向发送至所述第一节点。 本发明提供一种环网故障切换装置, 包括:
第二接收单元, 用于接收第二数据流量, 所述第二数据流量中包括源 MAC地址; 标识设置单元, 用于在所述第二数据流量中设置与本地节点唯一对应 的环网标识; 第二处理单元, 用于将设置所述环网标识之后的第二数据流量发送至 所述第二节点,以使得所述第二节点在转发表项中记录所述源 MAC地址与 所述环网标识的对应关系; 以及, 检测报文发送单元, 用于通过所述链路向所述第二节点发送链路检测 报文, 所述链路检测报文中包括所述环网标识, 以及所述链路的链路标识; 以使得所述第二节点根据所述链路检测报文的接收状况, 得到所述链路的 路径状态信息, 并将所述环网标识、 所述链路的链路标识以及所述路径状 态信息记录在所述转发表项中; 以使得所述第二节点在接收到包括目的 MAC地址的第一数据流量时, 根据所述目的 MAC地址, 查询本地节点存储的转发表项, 得到与所述目的 MAC地址对应的环网标识, 以及所述环网标识对应的所述链路的路径状态 信息; 并在所述路径状态信息表明所述链路处于故障状态时, 将所述第一 数据流量沿与所述链路相反的方向发送至所述第一节点; 所述源 MAC地址 与所述目的 MAC地址相同。
本发明的环网故障切换方法和装置, 根据数据流量的 MAC地址得到对 应的环网标识以及链路的路径状态信息, 并在链路处于故障状态时, 将数 据流量沿与链路相反的方向发送, 解决了环网故障处理方式复杂且效率太 低的问题, 筒化了故障切换的流程, 大大提高了切换效率。 附图说明 为了更清楚地说明本发明实施例或现有技术中的技术方案, 下面将对 实施例或现有技术描述中所需要使用的附图作一筒单地介绍, 显而易见地, 下面描述中的附图是本发明的一些实施例, 对于本领域普通技术人员来讲, 在不付出创造性劳动的前提下, 还可以根据这些附图获得其他的附图。
图 1为发明环网故障切换方法实施例中所应用的环网架构示意图; 图 2为本发明环网故障切换方法一实施例的流程示意图;
图 3为本发明环网故障切换方法另一实施例的流程示意图;
图 4为本发明环网故障切换方法又一实施例的环网正常状态示意图; 图 5为本发明环网故障切换方法又一实施例的环网故障状态示意图; 图 6为本发明环网故障切换装置一实施例的结构示意图; 图 7为本发明环网故障切换装置另一实施例的结构示意图。 具体实施方式 为使本发明的目的、 技术方案和优点更加清楚, 下面将结合本发明实 施例中的附图, 对本发明实施例中的技术方案进行清楚、 完整地描述, 显 然, 所描述的实施例是本发明一部分实施例, 而不是全部的实施例。 基于 本发明中的实施例, 本领域普通技术人员在没有做出创造性劳动的前提下 所获得的所有其他实施例, 都属于本发明保护的范围。
供一个该切换方法所应用的环网架构, 但并不局限于此环网。 图 1 为发明 环网故障切换方法实施例中所应用的环网架构示意图, 如图 1 所示, 这是 一个由四个环网节点组成的环网, 该四个环网节点分别为 Rl、 R2、 R3和 R4。 各节点之间通过链路连接, 例如, R1和 R2之间的链路 f, 该链路是双 向的, 即数据流量可以从 R1经过链路 f流至 R2, 也可以从 R2经过链路 f 流至 Rl。 假设有一数据流量从该环网经过, 该数据流量是从源节点 L1 (该源节 点 L1的 MAC地址为数据流量的源 MAC地址)发出, 发送至目的节点 L2 (该目的节点 L2的 MAC地址为数据流量的目的 MAC地址 ) 的。 其中, 假设源节点 L1发出的数据流量将发送至环网中的节点 R1 ,从节点 R1入环, 该节点 R1可以称为入环节点; 该数据流量在环网中传输后, 从节点 R4出 环, 并可以发送至目的节点 L2, 该节点 R4可以称为出环节点。 相应的, 也可以发生反方向的数据流量, 即节点 L2也可以发出另一数据流量, 该数 据流量从节点 R4入环, 从节点 R1出环, 并进而发送至节点 L1 , 此时, 节 点 L2为源节点, 节点 L1为目的节点。 以下的实施例将以上述结构的环网, 以及所述的两种数据流量为例, 对切换方法进行说明。
实施例一 图 2为本发明环网故障切换方法一实施例的流程示意图, 本实施例的 切换方法中可以定义图 1 所示环网中的 R1 为第一节点, 并定义环网中的 R2、 R3、 或者 R4均可以称为本地节点设备; 本实施例的切换方法由本地 节点设备执行。
如图 2所示, 该方法可以包括:
101、 接收第一数据流量, 所述第一数据流量中包括该第一数据流量的 目的 MAC地址。 其中, 该第一数据流量是进入环网的流量, 具体是从节点 L2发出后由 节点 R4进入环网, 需要经过环网后从节点 R1出环至节点 L1的数据流量。 对于节点 R4 来说, 该流量是从本地节点设备进入环网; 若该流量以节点 R4—节点 R3—节点 R2—节点 R1的方向传输,则对于节点 R2或者节点 R3 来说, 该流量是从环网中的其他节点进入而流经本地节点设备; 当然, 该 流量也可以从节点 R4—节点 R1的路径传输。 所述的目的 MAC地址为该第一数据流量的目的地址, 在本实施例中, 该第一数据流量中携带的目的 MAC地址是节点 L1的 MAC地址。
102、 根据目的 MAC地址, 查询本地节点存储的转发表项, 得到与目 的 MAC地址对应的环网标识, 以及该环网标识对应的链路的路径状态信
其中, 本地节点设备自身存储有转发表项, 该转发表项中存储有 MAC 地址与环网标识的对应关系, 以及该环网标识所对应的链路的路径状态信 具体的, 环网标识是与环网中的环网节点唯一对应的, 是由数据流量 进入环网时所经过的第一个环网节点即入环节点所设置的, 并且该环网标 识在设置时与该入环节点所接收到的数据流量的源 MAC地址对应。
举例说明如下: 假设节点 L1作为源节点发出的数据流量由节点 R1入 环网, 则节点 R1在接收到该流量时, 将在该数据流量中插入环网标识 a, 该环网标识 a用于标示以节点 R1作为入环节点的环网,相当于记录以节点 L1为源节点的流量是从节点 R1入环的, 但环网标识 a所标识的该环网不 限定方向, 当发生反方向流量时, 节点 R1在该环网中也可以作为流量的出 环节点。 相应的, 假设该数据流量沿节点 R1—节点 R2—节点 R3—节点 R4 的路径流经本地节点设备(假设本地节点设备为节点 R4 ) , 则本地节点设 备可以在转发表项中记录该数据流量的源 MAC地址(节点 L1的 MAC地 址) 与环网标识 a 的对应关系, 以使得在下次接收到反方向流量即以节点 L1的 MAC地址为目的 MAC地址的数据流量时, 可以才艮据该对应关系, 直接得到应将数据流量发往环网标识 a对应的节点 Rl。 其中, 上述是以节点 R1入环节点的数据流量为例, 该流量被节点 R1 设置了环网标识 a; 当数据流量从环网中的其他节点入环时, 设置的环网标 识是不同的, 例如, 流量若从节点 R2入环, 则节点 R2可以在流量中设置 环网标识 b, 该环网标识 b与环网标识 a不同。 即, 环网中的各节点作为入 环节点时, 在入环流量中所设置的环网标识均不相同, 这样就可以区分以 各节点作为端点的环网,例如,环网标识 a代表以节点 R1作为端点的环网, 环网标识 b代表以节点 R2作为端点的环网,该端点指的是可以为环网的入 环节点或者出环节点。
本实施例中, 通过查询转发表项可知, 目的 MAC地址(节点 L1 的 MAC地址)所对应的环网标识是与节点 R1对应的。 在具体实施中, 本地 节点的转发表项中可以只记录目的 MAC地址与环网标识的对应关系即可, 而不需要记录第一节点 Rl和环网标识的对应关系; 因为, 本地节点设备在 记录目的 MAC地址与环网标识的对应关系时,可以将接收该环网标识的接 口作为以该 MAC地址为目的地址的数据流量的输出接口,在接收到上述数 据流量时, 直接从所述输出接口输出即可。
例如, 环网标识对应的节点与本地节点设备之间的链路存在两条, 例 如,节点 R1与本地节点设备之间的链路包括组成环网状的第一链路和第二 链路, 即节点 R1可以通过第一链路节点 R1-节点 R2-节点 R3-节点 R4连接 至本地节点设备 R4, 也可以通过第二链路 R1-R4连接至本地节点设备 R4, 则可以通过链路标识进行区分, 例如可以为第一链路和第二链路。 具体的, 链路的路径状态信息指的是, 该链路处于正常状态或者故障 状态。 具体实施中, 例如可以通过发送链路检测报文的方式, 根据链路检 测报文的接收情况, 确定链路的路径状态信息; 若该报文能够按照预设条 件连续接收到, 则表明链路正常, 若该报文出现了未接收到的情况, 则表 明链路故障。 其中, 上述的链路检测报文可以是第一节点 R1发送的, 并且 在该报文中设置了所述的环网标识, 以使得本地节点设备 R2, R3, R4可 以根据该环网标识识别是哪条链路, 并记录该链路的路径状态信息。 所述 预设条件, 可以指每 50ms秒接收 1个报文, 且连续丢失不超过 3个。
103、 在所述路径状态信息表明所述链路处于故障状态时, 将第一数据 流量沿与所述链路相反的方向发送至第一节点。
其中, 本地节点设备可以将本地节点接收到该环网标识的接口作为以 某个 MAC地址为目的地址的数据流量的输出接口。例如, 本地节点设备通 过第一接口接收的数据流量中,包括该数据流量的源 MAC地址以及环网标 识 a, 则以第一接口作为对应源 MAC地址的输出接口; 下次本地节点设备 在接收到第一数据流量时, 若该第一数据流量的目的地址即为上述的源 MAC地址, 则将流量从上述的输出接口输出, 第一数据流量将沿着环网标 识 a所对应的链路发送。 若本地节点设备通过查询转发表项, 得知环网标识 a所对应的链路处 于故障状态, 则将第一数据流量沿与环网标识 a所对应的链路相反的方向 发出。 例如, 4叚设环网标识 a对应节点 R1 , 环网标识 a所对应的环网包括 两条链路即节点 R1从左方向连接至本地节点设备的第一路径,以及从右方 向连接至本地节点设备的第二路径,第一数据流量是从节点 R1沿第一路径 发送至本地节点设备; 而转发表项中记载第一路径发生故障, 则本地节点 设备可以将流量从第二路径发出即可。 与现有技术的环网故障切换方法相比较, 本实施例的切换方法中, 环 网中的本地节点设备自身存储有转发表项,该转发表项中记载有 MAC地址 以及所对应链路的路径状态信息, 使得本地节点设备在接收到数据流量时, 可以直接根据流量的目的 MAC 地址得到该流量所对应的传输路径是否处 于正常状态, 并在查询得知链路发生故障时, 本地节点设备可以自动将流 量向其他路径发送; 环网中的各个节点自身便能够得知流量传输路径是否 畅通, 也能够自动改变流量的传输路径, 而不需要如现有技术那样, 节点 间互通报文以及学习 MAC等复杂处理,从而大大提高了环网故障切换的效 率, 而且处理方式筒单。 本实施例的环网故障切换方法,通过根据数据流量的 MAC地址得到对 应的环网标识以及链路的路径状态信息, 并在链路处于故障状态时, 将数 据流量沿与链路相反的方向发送, 解决了环网故障处理方式复杂且效率太 低的问题, 筒化了故障切换的流程, 大大提高了切换效率。 实施例二 图 3 为本发明环网故障切换方法另一实施例的流程示意图, 本实施例 的切换方法中可以定义环网中的节点 R2、 节点 R3、 或者节点 R4均可以称 为第二节点, 并定义节点 R1为本地节点设备; 本实施例的切换方法是本地 节点设备所执行。 如图 3所示, 本实施例的切换方法中, 本地节点设备需要执行 201-202 所述的在数据流量中设置环网标识的动作, 以及执行 203所述的发送链路 检测报文的动作, 这两方面为并列关系, 其顺序不做限制; 该方法可以包 括:
201、 接收第二数据流量, 所述第二数据流量中包括源 MAC地址; 其中, 本地节点设备接收到的该第二数据流量是入环流量, 具体是从 节点 L1发出后从节点 R1入环, 并经过环网后需要从节点 R4出环至节点 L2的流量; 本地节点设备 R1作为环网的入环节点。 该第二数据流量中包 括该数据流量的源 MAC地址即节点 L1的 MAC地址。
202、 在第二数据流量中设置与本地节点唯一对应的环网标识, 并将设 置环网标识之后的第二数据流量发送至第二节点; 其中, 本地节点设备在接收到 201 中的第二数据流量时, 将在该流量 中设置环网标识, 该环网标识用于标示以本地节点设备作为入环节点或者 出环节点的环网; 并且, 环网标识与本地节点设备唯一对应, 即, 如果来 自源 MAC地址的第二数据流量从环网中的另一节点入环,则该另一节点将 为第二数据流量设置另一环网标识。 由于各环网标识对应不同的环网节点, 而该环网节点又与源节点的 MAC地址对应, 因此相当于, 环网标识对应着 一链路,该链路是以所述源节点的 MAC地址为目的地址的流量发送至所述 环网节点的链路。 本地节点设备将设置环网标识之后的第二数据流量发送至第二节点, 以使得第二节点可以在接收到该流量后, 在第二节点自身存储的转发表项 中, 记录该第二数据流量的源 MAC地址与环网标识的对应关系, 记录该对 应关系的作用是, 当第二节点在接收到以所述的 MAC地址为目的 MAC地 址的数据流量时, 可以根据该对应关系得知应将流量发往环网标识所对应 的链路。
203、 通过所述链路向所述第二节点发送链路检测报文, 所述链路检测 4艮文中包括所述环网标识;
其中, 201-202中, 本地节点设备在数据流量中设置环网标识并发送至 第二节点,使得第二节点能够根据流量中的 MAC地址找到对应的环网标识 所代表的链路; 而该 203 中, 本地节点设备通过发送包括环网标识的链路 检测报文, 以使得第二节点可以根据报文的接收情况得知上述链路是否处 于正常状态。 具体的, 链路检测报文中包括环网标识, 以使得第二节点可以识别出 该报文对应的是环网标识所代表的链路。 第二节点可以根据报文的接收情 况得知上述链路的路径状态信息, 例如处于正常状态或者故障状态; 若该 报文能够按照预设条件连续接收到, 则表明链路正常, 若该报文出现了未 接收到的情况, 则表明链路故障。 第二节点可以将环网标识、 以及该环网 标识对应的路径状态信息记录在第二节点自身侧的转发表项中。
本实施例中, 第二节点既记录了节点 L1的源 MAC地址对应的环网标 识, 能够得知第二数据流量的目的 MAC地址对应的链路 (节点 R1和第二 节点之间的链路) , 又记录了该链路的路径状态信息, 因此, 第二节点在 接收到数据流量时, 可以根据数据流量中的目的 MAC地址, 查询本地节点 存储的转发表项,得到与目的 MAC地址对应的环网标识, 以及环网标识对 应的链路的路径状态信息; 并在路径状态信息表明链路处于故障状态时, 将流量沿与链路相反的方向发出, 从而实现了环网故障时的自动切换, 大 大提高了切换效率。
本实施例的环网故障切换方法,通过根据数据流量的 MAC地址得到对 应的环网标识以及链路的路径状态信息, 并在链路处于故障状态时, 将数 据流量沿与链路相反的方向发送, 解决了环网故障处理方式复杂且效率太 低的问题, 筒化了故障切换的流程, 大大提高了切换效率。 实施例三 本实施例以图 1 所示的环网为例, 对实施例一和实施例二的切换方法 进行更详细具体的说明; 并且, 本实施例以二层以太环网为例, 但具体实
图 4为本发明环网故障切换方法又一实施例的环网正常状态示意图, 图 5为本发明环网故障切换方法又一实施例的环网故障状态示意图。 如图 4所示, 环网处于正常状态, 实施例中的环中节点 R1~ R4均发送 链路检测报文,并且节点 R1作为入环节点还在入环的数据流量中设置环网 标识; 下面分别对链路检测报文的发送及数据流量中环网标识的设置进行 说明: 具体的, 以节点 R1为例, 节点 R1发送的链路检测报文的报文格式可 以参见如下的表 1所示; 表 1 链路检测报文结构
Figure imgf000014_0001
该 4艮文中包括环网标识(Label ) , 该环网标识与节点 R1 唯一对应; 具体实施中, 该环网标识可以设置在报文的链路层报文头之后, 此处的链 路层报文头指的是 DMAC、 SMAC以及 Type。 例如, 环网标识可以采用多 协议标签交换(Multi-Protocol Label Switching, 筒称: MPLS )标签, 或者 采用其他可以起到唯一识别环网节点作用的标识符号。 例如, 本实施例的链路层报文头中, DMAC、 SMAC 可以任意取值, 例如可以将节点 R1的 MAC地址作为 DMAC、 SMAC, 即相当于定义该链 路检测报文的源 MAC地址和目的 MAC地址均为节点 R1 , 则该链路检测 报文将从节点 R1发出, 沿环网各节点传输后返回至节点 R1; 即使 DMAC、 SMAC任意取值, 由于环网为单向通道, 节点 R1发出的报文经过环网传输 后也会回到节点 Rl。 Type中定义该报文的协议类型, 由于该链路检测报文 是本发明实施例中对环网节点新增加的报文, 所以 Type中是与现有协议不 沖突的新协议类型。
例如, 本实施例报文中位于 Label后边的 Flag, 其长可以为 8bit, 主要 格式和包括的内容可以参见如下的表 2所示:
表 2 链路检测报文中的 Flag结构
Figure imgf000015_0001
该 Flag中, 3bit主版本号 ( Main Ver ) , 默认情况为 001; 2bit子版本 号 (Sub Ver ) , 默认情况为 00; lbit左右方向标识, 1=左方向 L, 0=右方 向 R; lbit主备优先级标识, 1=主优先级 M, 0=备优先级 S; 1 比特 TLV 承载标记, 1=存在 TLV, 0=不存在 TLV; 其中, 关于该 Flag中的左右方向 标识和主备优先级标识在后面说明。 例如, 在本实施例的链路检测报文中的还包括类型长度值 ( type-length- value, 筒称: TLV ) , TLV Num表示该报文所承载的 TLV 的个数; 当 Flag中的 TLV承载标记为 0时, TLV Num必须为 0。 该 TLV 中承载了环网属性信息, 例如, 设备 IPv4标示 ID; 设备 IPv6标示 ID; 设 备名称字符串; 设备负载信息; 链路流量报告; 链路质量报告; 链路检测 报文的发送间隔时间; 加密认证信息; 报文序列号等; 在具体实施中, TLV 内容不限于以上方面, 可以根据需要进行扩展。
对于上述的 TLV中承载内容, 其中, 设备 IPv4和 IPv6标示 ID、 设备 名称字符串均是 R1的设备标识,有利于在检测报文出现问题时查找发送该 报文的设备; 设备负载信息、 链路流量报告、 链路质量报告可以起到有利 于掌握环网中的链路负载和质量等的作用; 而链路检测报文的发送间隔时 间可以帮助环网中的接收报文的节点判断报文的接收状况; 加密认证信息 可以有效识别仿造报文, 保证检测报文的真实性。 在对链路检测报文的格式进行说明的基础上,下面描述节点 R1发送该 报文的方式。 如图 4所示, 节点 R1可以发送两个方向的报文, 其中一个是 沿 al环路绕环网传输的链路检测报文,另一个是沿 a2环路绕环网传输的链 路检测报文。 这两个报文可以通过上面所说的 Flag中的左右方向标识来区 别, 例如, al环路的报文可以定义为左方向 L报文, a2环路的报文可以定 义为右方向 艮文。
上述向两个方向发送报文的目的是, 以环网节点 R4为例(本实施例的 R4为出环节点 ) , 如果 R4能够正常接收到 al环路报文, 仅能说明沿 al 环路方向从 R1至 R4的链路处于正常状态, 而沿 al环路方向从 R4至 R1 的链路状态未知; 同理, 如果 R4能够正常接收到 a2环路报文, 仅能说明 沿 a2环路方向从 R1至 R4的链路处于正常状态, 而沿 a2环路方向从 R4 至 R1的链路状态未知。 因此, 数据流量如果从 R1入环, 从 R4出环, 其 可以经过两个路径, 即沿 al环路方向从 R1至 R4, 或者沿 a2环路方向从 R1至 R4, 为了更清楚的掌握这两条路径的路径状态,则采取了上述的两个 方向发送报文的方式。 同理, 该环网中的节点 R2和 R3也可以根据链路检 测报文获知其自身两侧的路径状态, 从而有利于在链路出现故障时, 环网 节点均能感知链路故障, 并且同时选择正常链路进行流量发送, 提高故障 处理的效率。 当采用向两个方向发送报文的方式时, 可以定义上述的沿 al环路方向 从 R1至 R4的链路为第一路径, 定义沿 a2环路方向从 R1至 R4的链路为 第二路径; R4根据链路检测报文的接收状况, 可以获知该第一路径和第二 路径是否处于正常状态。 例如, 若 R4在规定时间内连续收到 n (默认为 3) 个正确的链路检测报文, 则表明链路正常; 若 R4在规定时间内未连续收到 n (默认为 3)个正确的链路检测报文, 则表明链路故障。 其中, 设定的连续 收到的报文数量也可以为 3 以外的其他数值, 所述的规定时间也可以自主 配置,或者,可以根据链路检测报文中的 TLV中的报文发送间隔时间确定。 例如, 第一路径和第二路径均处于正常状态。
在通过上述检测方式获得链路的路径状态信息之后, R4可以将该路径 状态信息记录在其自身所存储的转发表项中。 具体的, R4可以记录链路检 测报文中的环网标识、 以及该环网标识所对应的第一路径和第二路径的路 径状态信息; 还可以通过链路标识区分上述的第一路径和第二路径, 该链 路标识可以为链路检测报文中的 Flag 中的左右方向标识, 第一路径对应 L(Left)方向, 第二路径对应和 R(Right)方向, 该两个方向具有相同的环网标 识。 例如, 记录 Label、 该 Label对应的 L(Left)方向链路、链路状态为正常。
环网中的各节点均可以通过链路检测报文检测自身所在的环网状态, 例如, R1在接收到自己发送的报文时, 则确定环网畅通; R4在接收到 R1 发送的报文时, 则确定 R1至 R4之间的链路正常。
R1不仅发送携带环网标识的链路检测报文, 而且还在入环流量中设置 所述的环网标识。具体的, R1接收到数据流量 bl ,该数据流量 bl从源 MAC 地址发送至该 R1 , 源 MAC地址包括在该数据流量中; R1将在该数据流量 中设置环网标识, 该环网标识与上面所述的链路检测 4艮文中的环网标识相 同。 环网标识在数据流量中的设置方式可以参见如下表 3和表 4: 表 3 数据流量中的环网标识设置结构示例一
DMAC SMAC Type Data
DMAC SMAC Type Label Data 表 4数据流量中的环网标识设置结构示例二
DMAC SMAC Type VLAN Data
DMAC SMAC Type VLAN Label Data 环网标识可以设置在数据流量的链路层报文头之后, 数据承载层之前; 在设置了环网标识后, 数据流量 bl可以称为数据流量 b2以区别于 bl。 R1 可以通过第一路径将数据流量 b2发送至 R4。 R4在接收到数据流量 b2后, 将在自身的转发表项中记录数据流量 b2中的源 MAC地址与环网标识的对 应关系,即发往所述的源 MAC地址的数据流量需要发送至所述的环网标识 所对应的链路。 在此需要说明的是, 所述的环网标识对应的链路可以是两条, 例如, 前述的第一路径和第二路径;而发往源 MAC地址的数据流量只能从其中一 条路径上传输, 针对于此, R1在发送链路检测报文时, 可以预先指定两条 路径的优先级。 具体的, 例如, R1通过第一路径连接至 R4的第一接口, R1通过第二路径连接至 R4的第二接口; R1在向两个方向发送报文时, 在 报文的 Flag中设置了主备优先级标识,两个方向配置的主备优先级不相同。
例如, 对应第一路径方向的报文为主优先级, 对应第二路径方向的报 文为备优先级, 则表示当 R4需要向 R1发送数据流量时, 优先选择第一路 径发送, 当第一路径发生故障时, 再选择第二路径发送。 即, 相当于, 通 过设置主备优先级, R4确定了其自身的第一接口为发往源 MAC地址的数 据流量的输出接口, 将环网标识与接口进行了绑定。 本实施例中, R4作为数据流量 b2的出环节点, 数据流量 b2将从 R4 发往目的 MAC地址。 R4在将数据流量 b2发出之前, 将其中的环网标识删 除。删除环网标识的数据流量 b2又回到初始的数据流量 bl ,发往目的 MAC 地址。 进一步的, R1如果接收到自己作为入环节点发送至该环网的数据流量, 例如, R1接收到数据流量 b2, 则表明该数据流量 b2在环网中没有找到与 目的 MAC地址连接的环网节点; 此时, R1将直接丢弃该数据流量 b2, 实 现自发报文的阻断, 以避免环网重复转发, 更好的减轻环网负载。 具体的, 与现有技术相比,现有技术中在发送未指定 MAC地址的数据流量(即未明 确接收节点, 需要将流量发送至节点由节点自己判断是否接收) 时, 为了 使得流量顺利出环, 一般在环网中设置阻断点; 环网节点为了避免单一方 向发送流量时可能出现未遇到接收节点而遇到该组断点造成流量发送失 败, 通常是采取广播发送的方式, 使得环网负载较大; 而本实施例相当于 是将 R1 自身作为阻断点, 所以 R1能够采取单方向发送流量并且确保能够 顺利出环, 从而减轻环网负载; 即使环网中未找到接收节点, 如上面所述, R1也能够实现自阻断。
如图 5所示, 环网处于故障状态, 4叚设环网中的 R2发生了故障, 则 R1发送的链路检测报文中,沿 al方向的报文以及沿 a2方向的报文均在 R2 处发生中断。 R4在规定时间内未连续收到沿 al方向的报文,则可以得知第 一路径处于故障状态, 可以接收到沿 a2方向的报文, 则可以得知第二路径 处于正常状态。 同理, R3也可以通过监听 R1所发送的链路检测报文, 获 知沿 al方向的从 R1到 R3的路径处于故障状态, 且沿 a2方向的从 R1到 R3的路径处于正常状态。 R4和 R3均在各自的转发表项中记录上述获得的 路径状态信息, 例如第一路径的状态由正常更改为故障。
本实施例中, R4作为入环节点, 接收的数据流量 cl的源 MAC地址即 为图 4中所示的数据流量 bl的目的 MAC地址,该数据流量 cl的目的 MAC 地址即为数据流量 bl的源 MAC地址。
R4在接收到该数据流量 cl后,查询自身存储的转发表项,可以根据数 据流量 cl的目的 MAC地址得到对应的环网标识,即可以得到 R1所对应的 环网标识, 使得 R4可以知道应该将该数据流量发往 Rl。 其中, 同理, R4 在接收到数据流量 cl时, 也在其中设置了唯一对应 R4的环网标识, 对比 不再赘述, 可以将增加了环网标识的数据流量称为数据流量 c2。
R4再根据所查得的环网标识, 在转发表项中获取该环网标识所对应的 链路的路径状态信息,例如前述的, R4的转发表项中记录有对应目的 MAC 地址的主优先级的第一路径处于故障状态, 备优先级的第二路径处于正常 状态; 则 R4就自动将数据流量 c2的出接口由第一接口调整为与之相反方 向的第二接口。 同理, 假设第二路径上还有 R1和 R4之外的另一设备 R5 (未图示) , 则 R5也可以感知 R2方向的链路发生故障, 也会自动将出接 口切换为 R2相反的方向, 从而与 R4的切换保持一致, 使得数据流量能够 顺利沿正常路径发往 Rl。 数据流量 c2在 R1 出环时, R1会将其中的对应 R4的环网标识删除, 使之回复为数据流量 cl发往目的 MAC地址。 本实施例中, 如果 R4两侧都没有收到报文, 即第一路径和第二路径都 出现故障, 则 R4 可以根据自身的链路检测报文中所确定的链路优先级标 识, 将数据流量向主优先级方向发送; 否则, 若没有配置优先级, 则可以 将数据流量在环网中广报发送。 需要说明的是, 在具体实施中, 链路检测报文的发送方式也可以灵活 选取; 例如, 也可以不采用向两个方向发送, 假设 R1只发送沿 al环路方 向的报文, R4仅能获知沿 al环路方向从 R1至 R4的链路, 则此时, 可以 配置 R4, 使得 R4默认选择接收报文的接口为优先级较高的出接口, 在接 收到数据流量时, 优先将流量从该接口发出; 而且在所检测到的上述链路 发生故障时, 默认的自动将流量向链路相反的方向发送。 进一步的, 当本实施例的切换方法应用于多个环网嵌套的环境时, 环 网标识可以为多层嵌套的环网嵌套; 只要能够起到唯一标识环中节点对应 的环网的作用即可。 本实施例的环网故障切换方法,通过根据数据流量的 MAC地址得到对 应的环网标识以及链路的路径状态信息, 并在链路处于故障状态时, 将数 据流量沿与链路相反的方向发送, 解决了环网故障处理方式复杂且效率太 低的问题, 筒化了故障切换的流程, 大大提高了切换效率。
实施例四 图 6为本发明环网故障切换装置一实施例的结构示意图, 该切换装置 可以为图 5中的 R4, 可以执行本发明任意实施例的环网故障切换方法。 本 实施例对该装置的结构做筒单说明, 其具体的工作原理可以结合参见方法 实施例所述, 在此不再赘述。 如图 6所示, 该装置可以包括: 第一接收单元 51、 第一查询单元 52、 第一处理单元 53; 其中,
第一接收单元 51 , 用于接收第一数据流量, 所述第一数据流量中包括 目的 MAC地址; 第一查询单元 52, 用于根据所述目的 MAC地址, 查询本 地节点存储的转发表项,得到与所述目的 MAC地址对应的环网标识, 所述 环网标识与连接至所述目的 MAC地址的所述第一节点唯一对应;并得到所 述环网标识对应的所述链路的路径状态信息; 第一处理单元 53, 用于在所述路径状态信息表明所述链路处于故障状 态时, 将所述第一数据流量沿与所述链路相反的方向发送至所述第一节点。
进一步的, 该装置还可以包括检测报文接收单元 54、 链路状态记录单 元 55; 其中, 检测报文接收单元 54,用于在所述查询本地节点存储的转发表项之前, 接收所述第一节点通过所述链路发送的链路检测报文, 所述链路检测报文 中包括所述环网标识, 以及所述链路的链路标识; 链路状态记录单元 55, 用于根据所述链路检测报文的接收状况, 得到 所述链路的路径状态信息; 并将所述环网标识、 所述链路的链路标识以及 所述路径状态信息记录在所述转发表项中。 进一步的, 该装置还可以包括: 流量接收单元 56、 标识记录单元 57; 其中, 流量接收单元 56, 用于在接收第一数据流量之前, 接收所述第一节 点发送的第二数据流量,所述第二数据流量中包括源 MAC地址以及所述环 网标识, 所述环网标识与所述源 MAC地址对应, 所述源 MAC地址与所述 第一数据流量中的目的 MAC地址相同,所述环网标识是所述第一节点设置 的;
标识记录单元 57, 用于在所述转发表项中记录所述源 MAC地址与所 述环网标识的对应关系。 进一步的, 该装置还可以包括: 标识删除单元 58, 用于在将所述第二 数据流量发出之前, 将所述第二数据流量中的所述环网标识删除。
进一步的, 所述链路可以包括组成环状的第一路径和第二路径; 所述 第一节点通过第一路径连接至本地节点的第一接口, 所述第一节点通过第 二路径连接至本地节点的第二接口; 则此时, 第一查询单元 52, 具体用于得到所述环网标识对应的第一路径和第二 路径的路径状态信息; 且所述环网标识绑定所述第一接口, 用于指示将所 述第一数据流量从第一接口发出; 第一处理单元 53, 具体用于在所述第一路径的路径状态信息表明所述 第一路径处于故障状态时, 将所述第一数据流量从第二路径对应的第二接 口发出至所述第一节点。
本实施例的环网故障切换装置, 通过设置第一查询单元和第一处理单 元等,根据数据流量的 MAC地址得到对应的环网标识以及链路的路径状态 信息, 并在链路处于故障状态时, 将数据流量沿与链路相反的方向发送, 解决了环网故障处理方式复杂且效率太低的问题, 筒化了故障切换的流程, 大大提高了切换效率。
实施例五 图 7 为本发明环网故障切换装置另一实施例的结构示意图, 该切换装 置可以为图 4中的 R1 , 可以执行本发明任意实施例的环网故障切换方法。 本实施例对该装置的结构做筒单说明, 其具体的工作原理可以结合参见方 法实施例所述, 在此不再赘述。
如图 7所示, 该装置可以包括: 第二接收单元 61、 标识设置单元 62、 第二处理单元 63、 检测报文发送单元 64; 其中, 第二接收单元 61 , 用于接收第二数据流量, 所述第二数据流量中包括 源 MAC地址; 标识设置单元 62, 用于在所述第二数据流量中设置与本地 节点唯一对应的环网标识; 第二处理单元 63, 用于将设置所述环网标识之后的第二数据流量发送 至所述第二节点,以使得所述第二节点在转发表项中记录所述源 MAC地址 与所述环网标识的对应关系; 以及, 检测报文发送单元 64, 用于通过所述链路向所述第二节点发送链路检 测报文, 所述链路检测报文中包括所述环网标识, 以及所述链路的链路标 识; 以使得所述第二节点根据所述链路检测报文的接收状况, 得到所述链 路的路径状态信息, 并将所述环网标识、 所述链路的链路标识以及所述路 径状态信息记录在所述转发表项中; 以使得所述第二节点在接收到包括目的 MAC地址的第一数据流量时, 根据所述目的 MAC地址, 查询本地节点存储的转发表项,得到与所述目的 MAC地址对应的环网标识, 以及所述环网标识对应的所述链路的路径状态 信息; 并在所述路径状态信息表明所述链路处于故障状态时, 将所述第一 数据流量沿与所述链路相反的方向发送至所述第一节点;所述源 MAC地址 与所述目的 MAC地址相同。 进一步的, 标识设置单元 62, 具体用于在所述第二数据流量的链路层 报文头之后, 数据承载层之前, 设置所述与本地节点唯一对应的环网标识。 进一步的, 检测报文发送单元 64, 还用于在所述链路检测报文中设置 环网属性信息; 所述环网属性信息中包括链路检测报文的发送间隔时间、 本地节点设备标识、 本地节点设备负载信息、 所述链路的流量信息和质量 信息。 进一步的, 该装置还可以包括: 报文阻断单元 65, 用于在将设置所述 环网标识之后的第二数据流量发送至所述第二节点之后, 接收经过所述第 二节点之后, 沿所述环网传输后返回的所述第二数据流量时, 则丢弃所述 第二数据流量。 进一步的, 所述链路可以包括组成环状的第一路径和第二路径; 本地 节点通过第一路径连接至所述第二节点的第一接口, 本地节点通过第二路 径连接至所述第二节点的第二接口; 则此时, 检测报文发送单元 64, 具体用于通过所述第一路径向所述第二节点发 送第一链路检测报文, 通过第二路径向所述第二节点发送第二链路检测报 文; 进一步的, 检测报文发送单元 64, 还用于在所述第一链路检测报文中 设置所述第一路径的第一优先级, 并在所述第二链路检测报文中设置所述 第二路径的第二优先级, 所述第一优先级和第二优先级不同。 本实施例的环网故障切换装置, 通过设置标识设置单元和检测报文发 送单元等,根据数据流量的 MAC地址得到对应的环网标识以及链路的路径 状态信息, 并在链路处于故障状态时, 将数据流量沿与链路相反的方向发 送, 解决了环网故障处理方式复杂且效率太低的问题, 筒化了故障切换的 流程, 大大提高了切换效率。 本领域普通技术人员可以理解: 实现上述方法实施例的全部或部分步 骤可以通过程序指令相关的硬件来完成, 前述的程序可以存储于一计算机 可读取存储介质中, 该程序在执行时, 执行包括上述方法实施例的步骤; 而前述存储介质包括: ROM、 RAM, 磁碟或者光盘等各种可以存储程序代 码的介质。
最后应说明的是: 以上实施例仅用以说明本发明的技术方案, 而非对 其限制; 尽管参照前述实施例对本发明进行了详细的说明, 本领域的普通 技术人员应当理解: 其依然可以对前述各实施例所记载的技术方案进行修 改, 或者对其中部分技术特征进行等同替换; 而这些修改或者替换, 并不 使相应技术方案的本质脱离本发明各实施例技术方案的精神和范围。

Claims

权利要求
1、 一种环网故障切换方法, 所述环网包括本地节点、 第一节点, 以及 连接本地节点和所述第一节点的链路; 所述切换方法包括:
接收第一数据流量, 所述第一数据流量中包括目的媒体接入控制 MAC 地址; 根据所述目的 MAC地址, 查询本地节点存储的转发表项,得到与所述 目的 MAC地址对应的环网标识, 所述环网标识与连接至所述目的 MAC地 址的所述第一节点唯一对应; 并得到所述环网标识对应的所述链路的路径 状态信息;
在所述路径状态信息表明所述链路处于故障状态时, 将所述第一数据 流量沿与所述链路相反的方向发送至所述第一节点。
2、 根据权利要求 1所述的环网故障切换方法, 其特征在于, 在所述查 询本地节点存储的转发表项之前, 还包括: 接收所述第一节点通过所述链路发送的链路检测报文, 所述链路检测 报文中包括所述环网标识, 以及所述链路的链路标识; 根据所述链路检测报文的接收状况, 得到所述链路的路径状态信息; 并将所述环网标识、 所述链路的链路标识以及所述路径状态信息记录在所 述转发表项中。
3、 根据权利要求 1所述的环网故障切换方法, 其特征在于, 在接收第 一数据流量之前, 还包括:
接收所述第一节点发送的第二数据流量, 所述第二数据流量中包括源 MAC地址以及所述环网标识, 所述环网标识与所述源 MAC地址对应, 所 述源 MAC地址与所述第一数据流量中的目的 MAC地址相同, 所述环网标 识是所述第一节点设置的;
4、 根据权利要求 3所述的环网故障切换方法, 其特征在于, 若所述第 二数据流量从本地节点发出所述环网, 则在将所述第二数据流量发出之前, 还包括: 将所述第二数据流量中的所述环网标识删除。
5、 根据权利要求 1-4任一所述的环网故障切换方法, 其特征在于, 所 述链路包括组成环状的第一路径和第二路径; 所述第一节点通过第一路径 连接至本地节点的第一接口, 所述第一节点通过第二路径连接至本地节点 的第二接口; 所述得到环网标识对应的所述链路的路径状态信息, 包括: 得到所述 环网标识对应的第一路径和第二路径的路径状态信息; 且所述环网标识绑 定所述第一接口, 用于指示将所述第一数据流量从第一接口发出; 所述在路径状态信息表明所述链路处于故障状态时, 将所述第一数据 流量沿与所述链路相反的方向发送至所述第一节点, 包括: 在所述第一路 径的路径状态信息表明所述第一路径处于故障状态时, 将所述第一数据流 量从第二路径对应的第二接口发出至所述第一节点。
6、 一种环网故障切换方法, 所述环网包括本地节点、 第二节点, 以及 连接本地节点和第二节点的链路; 其特征在于, 所述切换方法包括: 接收第二数据流量, 所述第二数据流量中包括源 MAC地址; 在所述第 二数据流量中设置与本地节点唯一对应的环网标识, 并将设置所述环网标 识之后的第二数据流量发送至所述第二节点, 以使得所述第二节点在转发
通过所述链路向所述第二节点发送链路检测报文, 所述链路检测报文 中包括所述环网标识; 以使得所述第二节点根据所述链路检测报文的接收 状况, 得到所述链路的路径状态信息, 并将所述环网标识以及所述路径状 态信息记录在所述转发表项中; 以使得所述第二节点在接收到包括目的 MAC地址的第一数据流量时, 根据所述目的 MAC地址, 查询本地节点存储的转发表项,得到与所述目的 MAC地址对应的环网标识, 以及所述环网标识对应的所述链路的路径状态 信息; 并在所述路径状态信息表明所述链路处于故障状态时, 将所述第一 数据流量沿与所述链路相反的方向发送至所述第一节点;所述源 MAC地址 与所述目的 MAC地址相同。
7、 根据权利要求 6所述的环网故障切换方法, 其特征在于, 在所述第 二数据流量中设置与本地节点唯一对应的环网标识, 具体为: 在所述第二数据流量的链路层报文头之后, 数据承载层之前, 设置所 述与本地节点唯一对应的环网标识。
8、 根据权利要求 6所述的环网故障切换方法, 其特征在于, 还包括: 在所述链路检测报文中设置环网属性信息; 所述环网属性信息中包括链路检测报文的发送间隔时间、 本地节点设 备标识、 本地节点设备负载信息、 所述链路的流量信息和质量信息。
9、 根据权利要求 6所述的环网故障切换方法, 其特征在于, 在将设置 所述环网标识之后的第二数据流量发送至所述第二节点之后, 还包括: 接收经过所述第二节点之后, 沿所述环网传输后返回的所述第二数据 流量, 则丢弃所述第二数据流量。
10、根据权利要求 6-9任一所述的环网故障切换方法, 其特征在于, 所 述链路包括组成环状的第一路径和第二路径; 本地节点通过第一路径连接 至所述第二节点的第一接口, 本地节点通过第二路径连接至所述第二节点 的第二接口; 所述通过所述链路向所述第二节点发送链路检测报文, 包括: 通过所 述第一路径向所述第二节点发送第一链路检测报文, 通过第二路径向所述 第二节点发送第二链路检测报文;
所述在路径状态信息表明所述链路处于故障状态时, 将第一数据流量 沿与所述链路相反的方向发送至所述第一节点, 包括: 在所述第一路径的 路径状态信息表明所述第一路径处于故障状态时, 将所述第一数据流量从 第二路径对应的第二接口发出至所述第一节点。
11、 根据权利要求 10所述的环网故障切换方法, 其特征在于, 所述通 过链路向所述第二节点发送链路检测报文, 还包括: 在所述第一链路检测报文中设置所述第一路径的第一优先级, 并在所 述第二链路检测报文中设置所述第二路径的第二优先级, 所述第一优先级 和第二优先级不同。
12、 一种环网故障切换装置, 其特征在于, 包括: 第一接收单元, 用于接收第一数据流量, 所述第一数据流量中包括目 的 MAC地址;
第一查询单元, 用于根据所述目的 MAC地址, 查询本地节点存储的转 发表项,得到与所述目的 MAC地址对应的环网标识, 所述环网标识与连接 至所述目的 MAC地址的所述第一节点唯一对应;并得到所述环网标识对应 的所述链路的路径状态信息;
第一处理单元, 用于在所述路径状态信息表明所述链路处于故障状态 时, 将所述第一数据流量沿与所述链路相反的方向发送至所述第一节点。
13、根据权利要求 12所述的环网故障切换装置, 其特征在于,还包括: 检测报文接收单元, 用于在所述查询本地节点存储的转发表项之前, 接收所述第一节点通过所述链路发送的链路检测报文, 所述链路检测报文 中包括所述环网标识, 以及所述链路的链路标识; 链路状态记录单元, 用于根据所述链路检测报文的接收状况, 得到所 述链路的路径状态信息; 并将所述环网标识、 所述链路的链路标识以及所 述路径状态信息记录在所述转发表项中。
14、根据权利要求 12所述的环网故障切换装置, 其特征在于,还包括: 流量接收单元, 用于在接收第一数据流量之前, 接收所述第一节点发 送的第二数据流量,所述第二数据流量中包括源 MAC地址以及所述环网标 识, 所述环网标识与所述源 MAC地址对应, 所述源 MAC地址与所述第一 数据流量中的目的 MAC地址相同, 所述环网标识是所述第一节点设置的; 标识记录单元,用于在所述转发表项中记录所述源 MAC地址与所述环 网标识的对应关系。
15、 根据权利要求 14所述的环网故障切换装置, 其特征在于, 若所述 第二数据流量从本地节点发出所述环网, 则还包括: 标识删除单元, 用于在将所述第二数据流量发出之前, 将所述第二数 据流量中的所述环网标识删除。
16、 根据权利要求 12-15任一所述的环网故障切换装置, 其特征在于, 所述链路包括组成环状的第一路径和第二路径; 所述第一节点通过第一路 径连接至本地节点的第一接口, 所述第一节点通过第二路径连接至本地节 点的第二接口; 所述第一查询单元, 具体用于得到所述环网标识对应的第一路径和第 二路径的路径状态信息; 且所述环网标识绑定所述第一接口, 用于指示将 所述第一数据流量从第一接口发出; 所述第一处理单元, 具体用于在所述第一路径的路径状态信息表明所 述第一路径处于故障状态时, 将所述第一数据流量从第二路径对应的第二 接口发出至所述第一节点。
17、 一种环网故障切换装置, 其特征在于, 包括: 第二接收单元, 用于接收第二数据流量, 所述第二数据流量中包括源
MAC地址; 标识设置单元, 用于在所述第二数据流量中设置与本地节点唯一对应 的环网标识; 第二处理单元, 用于将设置所述环网标识之后的第二数据流量发送至 所述第二节点,以使得所述第二节点在转发表项中记录所述源 MAC地址与 所述环网标识的对应关系; 以及, 检测报文发送单元, 用于通过所述链路向所述第二节点发送链路检测 报文, 所述链路检测报文中包括所述环网标识, 以及所述链路的链路标识; 以使得所述第二节点根据所述链路检测报文的接收状况, 得到所述链路的 路径状态信息, 并将所述环网标识、 所述链路的链路标识以及所述路径状 态信息记录在所述转发表项中; 以使得所述第二节点在接收到包括目的 MAC地址的第一数据流量时, 根据所述目的 MAC地址, 查询本地节点存储的转发表项,得到与所述目的 MAC地址对应的环网标识, 以及所述环网标识对应的所述链路的路径状态 信息; 并在所述路径状态信息表明所述链路处于故障状态时, 将所述第一 数据流量沿与所述链路相反的方向发送至所述第一节点;所述源 MAC地址 与所述目的 MAC地址相同。
18、 根据权利要求 17所述的环网故障切换装置, 其特征在于, 所述标识设置单元, 具体用于在所述第二数据流量的链路层报文头之 后, 数据承载层之前, 设置所述与本地节点唯一对应的环网标识。
19、 根据权利要求 17所述的环网故障切换装置, 其特征在于, 所述检测报文发送单元, 还用于在所述链路检测报文中设置环网属性 信息; 所述环网属性信息中包括链路检测报文的发送间隔时间、 本地节点 设备标识、 本地节点设备负载信息、 所述链路的流量信息和质量信息。
20、根据权利要求 17所述的环网故障切换装置, 其特征在于,还包括: 报文阻断单元, 用于在将设置所述环网标识之后的第二数据流量发送 至所述第二节点之后, 接收经过所述第二节点之后, 沿所述环网传输后返 回的所述第二数据流量时, 则丢弃所述第二数据流量。
21、 根据权利要求 17-20任一所述的环网故障切换装置, 其特征在于, 所述链路包括组成环状的第一路径和第二路径; 本地节点通过第一路径连 接至所述第二节点的第一接口, 本地节点通过第二路径连接至所述第二节 点的第二接口; 所述检测报文发送单元, 具体用于通过所述第一路径向所述第二节点 发送第一链路检测报文, 通过第二路径向所述第二节点发送第二链路检测 报文。
22、 根据权利要求 21所述的环网故障切换装置, 其特征在于, 所述检测报文发送单元, 还用于在所述第一链路检测报文中设置所述第一 路径的第一优先级, 并在所述第二链路检测报文中设置所述第二路径的第 二优先级, 所述第一优先级和第二优先级不同。
PCT/CN2012/073977 2011-08-26 2012-04-13 环网故障切换方法和装置 WO2012149862A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
EP12779501.1A EP2738978A4 (en) 2011-08-26 2012-04-13 FUSE PROTECTION AND DEVICE FOR A RING NETWORK
US14/187,660 US9407538B2 (en) 2011-08-26 2014-02-24 Ring network failure switching method and apparatus

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201110248105.5 2011-08-26
CN201110248105.5A CN102299835B (zh) 2011-08-26 2011-08-26 环网故障切换方法和装置

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US14/187,660 Continuation US9407538B2 (en) 2011-08-26 2014-02-24 Ring network failure switching method and apparatus

Publications (1)

Publication Number Publication Date
WO2012149862A1 true WO2012149862A1 (zh) 2012-11-08

Family

ID=45360022

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2012/073977 WO2012149862A1 (zh) 2011-08-26 2012-04-13 环网故障切换方法和装置

Country Status (4)

Country Link
US (1) US9407538B2 (zh)
EP (1) EP2738978A4 (zh)
CN (1) CN102299835B (zh)
WO (1) WO2012149862A1 (zh)

Families Citing this family (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102299835B (zh) 2011-08-26 2014-01-08 华为技术有限公司 环网故障切换方法和装置
US20140082215A1 (en) * 2012-09-19 2014-03-20 Arm Limited Arbitrating between data paths in a bufferless free flowing interconnect
CN103795601B (zh) * 2012-11-04 2018-04-10 中国移动通信集团公司 一种实现环网Steering保护的方法及装置
CN104426700B (zh) * 2013-09-06 2018-05-18 华为技术有限公司 网元和环网保护的方法
JP6428502B2 (ja) * 2015-06-24 2018-11-28 株式会社デンソー 中継装置
WO2017045095A1 (en) * 2015-09-14 2017-03-23 Telefonaktiebolaget Lm Ericsson (Publ) Method of segment routing in ring topology and router
CN107809782B (zh) * 2017-09-08 2021-07-30 深圳市盛路物联通讯技术有限公司 物联网数据传输方法及存储介质
CN111817955B (zh) * 2019-04-12 2022-10-21 阿里巴巴集团控股有限公司 数据传输系统、方法、装置和设备
WO2021036983A1 (zh) * 2019-08-30 2021-03-04 华为技术有限公司 一种传输数据的方法及装置
CN111404822B (zh) * 2020-02-28 2022-08-26 华为技术有限公司 数据传输方法、装置、设备以及计算机可读存储介质
CN113946141B (zh) * 2020-07-16 2022-09-06 卡奥斯工业智能研究院(青岛)有限公司 一种生产示范线的网络系统及控制方法
CN113111029B (zh) * 2021-04-14 2024-03-26 广州希姆半导体科技有限公司 一种确定数据传输路径的方法、芯片和存储介质
CN115412395A (zh) * 2022-07-16 2022-11-29 奥特酷智能科技(南京)有限公司 基于erps的车载以太环网链路切换方法

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1756222A (zh) * 2004-09-27 2006-04-05 华为技术有限公司 一种环网及其业务实现方法
CN1972234A (zh) * 2005-11-24 2007-05-30 杭州华为三康技术有限公司 环型以太网及其业务承载实现方法
CN101316212A (zh) * 2008-07-07 2008-12-03 华为技术有限公司 环网故障处理方法、环网及运营商骨干设备
CN101425979A (zh) * 2008-12-10 2009-05-06 中兴通讯股份有限公司 一种以太环网的数据报文转发方法
US20100074102A1 (en) * 2008-09-19 2010-03-25 Fujitsu Limited Transmission device and transmission method
CN102299835A (zh) * 2011-08-26 2011-12-28 华为技术有限公司 环网故障切换方法和装置

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005260321A (ja) * 2004-03-09 2005-09-22 Nec Corp ラベルパスネットワークの迂回制御方式
CN100446500C (zh) 2007-01-08 2008-12-24 杭州华三通信技术有限公司 生成树网络连接环网的保护方法及其应用的网络节点
KR20080089285A (ko) * 2007-03-30 2008-10-06 한국전자통신연구원 이더넷 링 네트워크에서의 보호 절체 방법
CN101364926B (zh) * 2007-08-08 2011-06-01 华为技术有限公司 一种网络保护的方法和设备
CN101471875B (zh) * 2007-12-27 2012-08-29 华为技术有限公司 基于环路的报文传送方法、网络系统和节点设备
CN101710875A (zh) * 2009-12-22 2010-05-19 中兴通讯股份有限公司 一种实现快速重路由的方法及装置

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1756222A (zh) * 2004-09-27 2006-04-05 华为技术有限公司 一种环网及其业务实现方法
CN1972234A (zh) * 2005-11-24 2007-05-30 杭州华为三康技术有限公司 环型以太网及其业务承载实现方法
CN101316212A (zh) * 2008-07-07 2008-12-03 华为技术有限公司 环网故障处理方法、环网及运营商骨干设备
US20100074102A1 (en) * 2008-09-19 2010-03-25 Fujitsu Limited Transmission device and transmission method
CN101425979A (zh) * 2008-12-10 2009-05-06 中兴通讯股份有限公司 一种以太环网的数据报文转发方法
CN102299835A (zh) * 2011-08-26 2011-12-28 华为技术有限公司 环网故障切换方法和装置

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP2738978A4 *

Also Published As

Publication number Publication date
US20140169156A1 (en) 2014-06-19
US9407538B2 (en) 2016-08-02
CN102299835B (zh) 2014-01-08
CN102299835A (zh) 2011-12-28
EP2738978A1 (en) 2014-06-04
EP2738978A4 (en) 2014-12-03

Similar Documents

Publication Publication Date Title
WO2012149862A1 (zh) 环网故障切换方法和装置
WO2019105066A1 (zh) 处理路由的方法和装置、以及数据传输的方法和装置
US9871708B2 (en) Method and system for ring protection switching
EP2498454A1 (en) Method, device and system for processing service traffic based on pseudo wires
WO2016101646A1 (zh) 以太虚拟网络的接入方法及装置
WO2006099784A1 (fr) Procédé de détection d’un défaut de liaison entre des noeuds d’une extrémité à l’autre dans un réseau hybride
US20050044211A1 (en) Self-healing tree network
WO2012003743A1 (zh) 组播流量的转发方法及装置
WO2013182059A1 (zh) 多协议标签交换流量工程隧道建立方法及设备
WO2011021180A1 (en) Technique for dual homing interconnection between communication networks
WO2008089633A1 (fr) Procédé et appareil pour protéger un anneau éthernet
WO2020024828A1 (zh) 通信方法、通信设备和通信系统
WO2008037203A1 (en) Method and node device for realizing the network topology discovery
WO2012130034A1 (zh) 一种vpls快速重路由方法和设备
WO2007121633A1 (fr) Procédé de réacheminement rapide en cas de partage de liaisons de transmission par de multiples ports
WO2016116050A1 (zh) 环保护链路故障保护方法、设备及系统
US20140185429A1 (en) Communication system, path switching method and communication device
WO2020001389A1 (zh) 一种避免环路的通信方法、设备和系统
WO2009092257A1 (zh) 运营商骨干网传输网络的故障检测方法和装置
WO2010135987A1 (zh) 链路聚合方法及装置
JP2013239807A (ja) 通信装置
WO2014063571A1 (zh) 一种分布式链路聚合组业务切换方法和装置
JP2003258822A (ja) パケットリングネットワーク及びそれに用いるパケットリングネットワーク間の接続方法
WO2012146097A1 (zh) Vpls网络和以太环网的倒换方法及装置
WO2008095360A1 (fr) Méthode et système de commutation rapide en cas de défaillance d'une liaison d'un réseau privé virtuel

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 12779501

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

REEP Request for entry into the european phase

Ref document number: 2012779501

Country of ref document: EP

WWE Wipo information: entry into national phase

Ref document number: 2012779501

Country of ref document: EP