WO2012130084A1 - 一种报文多次转向方法、装置和系统 - Google Patents

一种报文多次转向方法、装置和系统 Download PDF

Info

Publication number
WO2012130084A1
WO2012130084A1 PCT/CN2012/072820 CN2012072820W WO2012130084A1 WO 2012130084 A1 WO2012130084 A1 WO 2012130084A1 CN 2012072820 W CN2012072820 W CN 2012072820W WO 2012130084 A1 WO2012130084 A1 WO 2012130084A1
Authority
WO
WIPO (PCT)
Prior art keywords
slave device
packet
value
bit
mpls header
Prior art date
Application number
PCT/CN2012/072820
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 EP12762783.4A priority Critical patent/EP2562974B1/en
Publication of WO2012130084A1 publication Critical patent/WO2012130084A1/zh
Priority to US13/724,174 priority patent/US8687634B2/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/74Address processing for 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/50Routing or path finding of packets in data switching networks using label swapping, e.g. multi-protocol label switch [MPLS]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/22Parsing or analysis of headers

Definitions

  • the invention claims to be submitted to the Chinese Patent Office on March 31, 2011, the application number is 201110080393.8, and the invention name is "a multiple method, device and system for message transmission"
  • the present invention relates to the field of communication technologies, and in particular, to a method, device and system for multiple times of message forwarding.
  • the prior art generally implements multiple redirects of packets between different network devices by adding a virtual local area network (Vlan) header to the original message.
  • Vlan virtual local area network
  • the device can be forwarded to the device and how to turn the packet.
  • the WLAN header can carry 12 bits of information. If you need to carry more multiple directional information, you need to add a new WLAN header.
  • the existing standard protocol only supports packets of up to two layers of vlan headers, so that it can carry up to 24 bits of multiple-turn information, and the multiple-turning information carried is very limited.
  • the embodiment of the invention provides a method, a device and a system for multiple times of message forwarding, which can carry more multiple turning information on the basis of conforming to the existing standard protocol.
  • a method for multiple times of message forwarding comprising:
  • the multiple turn identification field is used to indicate a second slave device that needs to be redirected to;
  • a network device including:
  • a first receiving unit configured to receive a packet sent by the first slave device, where the packet includes an MPLS header that carries multiple times of steering information, where the multiple steering information includes a multiple-turning identification field, and the multiple-turning An identification field is used to indicate a second slave device that needs to be redirected to;
  • a determining unit configured to determine, according to the multiple turn identification field, a second slave device that needs to be redirected; and a sending unit, configured to send the message to the second slave device.
  • a communication system includes a master device and at least one slave device attached to the master device, wherein the master device is the network device described above;
  • the slave device is configured to receive a packet sent by the master device, and send the packet to the master device, where the packet includes an MPLS header that carries multiple redirect information.
  • the MPLS header carries multiple times of steering information to implement multiple redirects of packets between network devices. Since MPLS can carry more information than the existing Vlan, the existing standard protocol It can also support up to 7 layers of MPLS headers, so this solution is more flexible and more scalable than existing solutions, and can carry more times on the basis of the existing standard protocols. Turn to information. DRAWINGS
  • Figure la is a schematic diagram of a scenario in which a message is turned multiple times according to an embodiment of the present invention.
  • Figure lb is a flowchart of a method for multiple times of message transmission according to an embodiment of the present invention.
  • Figure lc is a schematic structural diagram of an MPLS header according to an embodiment of the present invention.
  • FIG. 2a is a schematic structural diagram of an MPLS header according to Embodiment 2 of the present invention.
  • FIG. 2b is a flowchart of a method for multiple times of message transmission according to Embodiment 2 of the present invention.
  • 2c is a schematic diagram of the packet forwarding to the slave device 1 in the second embodiment of the present invention.
  • FIG. 2d is a schematic diagram of a packet when the packet is forwarded to the slave device 1 in the second embodiment of the present invention
  • FIG. 2 is a schematic diagram of the packet forwarding to the slave device 2 in the second embodiment of the present invention
  • FIG. 2f is a schematic diagram of a packet when the packet is forwarded to the slave device 2 in the second embodiment of the present invention
  • FIG. 2g is a schematic diagram of the packet forwarding to the slave device 3 in the second embodiment of the present invention
  • FIG. 2 is a schematic diagram of a packet when the packet is transmitted from the link in the second embodiment of the present invention
  • FIG. 2 is a schematic diagram of a packet when a packet is sent out from a link according to Embodiment 2 of the present invention
  • FIG. 3 is a schematic structural diagram of a network device according to an embodiment of the present invention
  • FIG. 3b is another schematic structural diagram of a network device according to an embodiment of the present invention.
  • each device cluster may include one master device and several slave devices, wherein the master device is deployed in a network link, and the slave device is attached to the master device. If there are more than one slave device in the link of the master device, multiple rounds of the packet need to be implemented within the cluster.
  • the master device is deployed in the network link, and the slave device 1, the slave device 2, and the slave device 3 are all attached to the master device, wherein the slave device 1, the slave device 2, and the slave device 3 can handle the message differently.
  • the multiple steering process of the message B can be as follows: 1.
  • the master device is from the data link (ie, the network) Receiving a message B on the link);
  • the master device sends packet B to the slave device 1;
  • the slave device 1 After receiving the packet B, the slave device 1 processes the packet B to obtain the packet B1, and returns the packet B1 to the master device;
  • the master device sends the message B1 to the slave device 2;
  • the slave device 2 After receiving the packet B1, the slave device 2 processes the packet B1 to obtain the packet B2, and returns the packet B2 to the master device;
  • the master device sends the message B2 to the slave device 3;
  • the slave device 3 After receiving the packet B2, the slave device 3 processes the packet B2 to obtain the packet B3, and returns the packet B3 to the master device;
  • the master device sends the packet B3 through the data link, for example, to the downstream device on the data link.
  • Embodiments of the present invention provide a method, an apparatus, and a system for multiple times of message forwarding. The following is a detailed description.
  • a method for redirecting a message multiple times comprising: receiving a message sent by a first slave device, where the newspaper
  • the article includes an MPLS header carrying multiple forwarding information, the multiple-turning information includes a multiple-turning identification field, and the multiple-turning identification field is used to indicate the slave device that needs to be redirected; determining the need to turn to the multiple-turning identification field according to the foregoing
  • the second slave device sends the message to the second slave device.
  • the method further includes: receiving an original packet sent by the upstream device, adding an MPLS header carrying the multiple forwarding information to the original packet, and sending the MPLS header to the first slave device.
  • the multiple turn information may include a multiple turn identification field, which is used to indicate the slave device or the slave device group that needs to be redirected (ie, to indicate which slave devices need to be redirected to or from the slave device).
  • the multiple-turning information may further include a link number field, where the link number field is used to indicate a link in the primary device that receives the original packet; where, the bit of the identifier field is turned to multiple times ( The bit number N and the number of bits N of the link number field can be set according to the requirements of the actual application.
  • the number of bits M of the multiple-turn identification field may be set to 12, and the number of bits N of the link number field is 8; or, the number of bits M of the multiple-turn identification field may be set to 14, and the chain The number of bits N of the road number field is 6, and so on.
  • the MPLS header may further include a service type (CoS, Class of Service) field, a stack (S, Stack) field, and a TTL (Time-to-Live) field, where The CoS field is 3 bits, the S field is 1 bit, and the TTL field is 8 bits.
  • CoS Service type
  • S stack
  • TTL Time-to-Live
  • the multiple turn information can occupy the idle bit in the MPLS header specified by the existing MPLS protocol.
  • adding an MPLS header carrying multiple steering information to the original message may be as follows:
  • the link number field of the MPLS header indicates which link of the original packet from the primary device (the primary device can The entry includes multiple links, so that after multiple completions, the master device can find the outbound port corresponding to the ingress port of the link to send the packet according to the link number field.
  • the link number may be used as the identifier of the link.
  • All the slave devices that need to be redirected to the device cluster (that is, the device cluster where the master device is located) are identified in the multiple-turn identification field of the MPLS header according to the preset steering order.
  • the specific can be: 3 ⁇ 4 mouth:
  • Each slave device attached to the master device corresponds to at least one bit in the multiple turn identification field, and sets that when the at least one bit position is the first value, indicating that it needs to be redirected to the corresponding slave device;
  • the multiple-turn identification field in the MPLS header may include:
  • At least one bit corresponding to each slave device is determined according to a preset steering order; at least one bit position corresponding to each slave device to which the need is turned is the first value.
  • the number of bits in the multiple-turn identification field corresponding to each slave device and the first value may be preset according to an operator's policy, for example, when each slave device corresponds to 1 in the multiple-turn identification field.
  • the first value can be set to 0 or 1 for each bit; the first value can be set to 00, 01, 10 or 11 when each slave corresponds to 2 bits in the multiple turn identification field. And so on.
  • the first value is specifically 0 or 1, and each slave device corresponds to one bit as an example.
  • the following may be as follows:
  • the slave device may be identified in the multiple-turn identity field of the MPLS header according to the preset steering sequence:
  • the slave device may be identified in the multiple-turn identity field of the MPLS header according to the preset steering sequence:
  • the packet to which the MPLS header is added can be forwarded to the first slave device according to the preset steering sequence. For example, it may be as follows: according to a preset steering sequence, starting from one end of the MPLS header to the end of the identification field; when the first first value (such as 1 or 0) is found, the MPLS header is added.
  • the message is directed to the first slave device, wherein the first slave device corresponds to the bit in which the first first value is located.
  • the steering sequence refers to the order of the slave devices in the cluster of the device at the time of turning, that is, the order in which all the slave devices that need to be turned are turned to, and the steering sequence may be specifically set according to a preset policy. For example, if each slave device has a corresponding number in the master device, called the slave device number, then the steering sequence can be set to switch from the slave device number from small to large, or it can be set as the slave device.
  • the numbers are turned from large to small, and can also be set to turn in any number order. For example, if the master device is connected to N (N is a positive integer greater than 1) slave devices, the numbers are 1, 2, -, ⁇ , and you need to switch to the 5 devices with the numbers 1, 2, 5, 8, and ⁇ .
  • the first bit from the left (or right) of the N bits of the multiple turn identification field may be set to Corresponding to the slave device 5, the second bit corresponds to the slave device 2, the third bit corresponds to the slave device 8, the fourth bit corresponds to the slave device N, and the fifth bit corresponds to the slave device 1,
  • the remaining (N-5) bits can be arbitrarily associated with the remaining (N-5) slave devices, and can be searched from the left end (or right end) of the multiple-turn field when searching.
  • the MPLS header carried by the packet may have multiple layers, and the number of layers of the MPLS header may be determined according to the amount of information actually carried. For example, when the number of slave devices connected to the master device is large, the number of bits in the multiple-turn identification field is correspondingly large. When the total number of links in the master device is large, the number of bits in the link number field is correspondingly larger. Large, at this time, if an MPLS header cannot carry the information, two or more MPLS headers can be used to carry multiple redirect information (including multiple redirect identifier fields and link number fields). In general, existing standard protocols can support up to 7 layers of MPLS headers.
  • the specific information may be as follows:
  • the first slave device After receiving the packet sent by the master device, the first slave device processes the data portion of the packet, but The MPLS header is not changed, and the processed message is returned to the master device.
  • the second slave device that needs to be redirected (that is, the next slave device that needs to be redirected); for example, it may be determined according to the multiple-turning identifier field in the MPLS header.
  • the second slave device that needs to be redirected is as follows:
  • the bit position of the first first value found is the first Binary value (used to indicate that the corresponding slave device has been turned over); then continue to search for the next first value, if it continues to find the next first value, then determine the bit position of the next first value
  • the corresponding slave device is the second slave device.
  • the message including the MPLS header can then be sent to the second slave device.
  • the "3 ⁇ 4" multiple steering method may further include: if the next first value is not found, and all the slave devices that need to be turned to have been turned over, the link number is determined. The link indicated by the field; after the MPLS header in the packet is removed, the packet with the MPLS header removed is sent out from the determined link.
  • the second value can be set according to the operator's policy, but the second value cannot be the same as the first value. For example, when the first value is set to "1”, the second value can be set to "0". When a value is set to "0”, the second value can be set to "1", and so on.
  • the following two methods will be exemplified in the corresponding step 102.
  • step 104 may specifically be:
  • step 105 Clearing the first bit set in the multiple turn identification field to 0 according to the preset steering sequence; searching for the next set bit in the multiple turn identification field according to the preset steering order; Then, it is determined that the slave device corresponding to the next set bit is the second slave device that needs to be redirected (ie, the next slave device that needs to be redirected), and step 105 is performed.
  • the corresponding link in the master device is searched according to the link number field, and the packet is sent out from the link found. The process ends.
  • step 104 may specifically be:
  • the first bit position of the first 0 is set to 1 in the identification field; the next 0 bit is searched in the multiple turn identification field according to the preset steering order; if found, Then determining that the slave device corresponding to the next bit set to 0 is required to be turned
  • the second slave device ie, the next slave device that needs to be redirected performs step 105.
  • the MPLS header is removed from the packet, the MPLS header is removed from the queried link. End.
  • the MPLS header carries multiple times of forwarding information to implement multiple round-trips of packets between network devices. Since MPLS can carry more information than existing Vlans, The standard protocol can also support up to 7 layers of MPLS headers, so this solution is more flexible and more scalable than existing solutions, and can carry more on the basis of the existing standard protocols. Turned to information multiple times.
  • a corresponding number is set in advance for each slave device in the master device, which is called a slave device number.
  • you need to indicate the steering sequence for example, from small to large in the slave number, from big to small in the slave number, or in any number order.
  • the master device since the master device includes multiple links, and each link includes an uplink and a downlink, it is also required to indicate in the MPLS header the link used to receive the original message, that is, the original message is specified. Which link enters the master device, and whether the message after multiple redirects is sent from the uplink port or the downlink port in the link. Therefore, the link number field can be defined in the MPLS header to indicate the link of the original message received by the master device.
  • each slave device corresponds to one bit in the multiple turn identification field, and which slave device needs to be redirected, the bit position corresponding to the slave device is set to 1, thus, You can indicate which slave devices to forward the message to.
  • bit position corresponding to the slave device that needs to be redirected may be other identifiers, such as 0.
  • bit position 1 corresponding to the slave device to be turned to is taken as an example for description. , it should be understood that if the bit corresponding to the slave device that needs to be redirected to The other identifiers are similarly implemented, and are not described here.
  • the master device determines from which link port the packet is sent according to the link number field.
  • the multiple turn identification field and the link number field are multiple turn information.
  • the master device When the message is transferred from the master device to the slave device, and after the slave device returns to the master device, the master device will turn to the identification field multiple times from the left (or right, according to the pre-design according to the order of the slave device).
  • the first set bit is cleared to 0, and then the next set bit in the multiple turn identification field is searched according to the steering order. If found, the message is switched to the next set bit.
  • the corresponding slave device goes. If the set bit is not found in the multiple redirect flag field, the corresponding link in the master device is searched according to the link number field in the MPLS header, and the packet is sent out from the link.
  • the master device can be connected to 12 slave devices, and their numbers in the master device are 1, 2, 3...
  • the master device has 200 links, specifically, link 1, link 2 link 63, and link 200; then, the structure of the MPLS header can be as shown in FIG. 2a, where multiple turns of the identification field are occupied. 12 bits, each bit corresponds to a slave device, for example, the 31st bit in the corresponding MPLS header of the slave device 1 can be set, and the 30th bit in the MPLS header corresponding to the slave device 2, the slave device 3 corresponds to the 29th bit in the MPLS header, the slave device 4 corresponds to the 28th bit in the MPLS header, and so on.
  • the multiple-turning identification field may specifically be 110000000000; for example, if the slave devices that need to be redirected are the slave device 1, the slave device 3, the slave device 4, and From the device 8, the multiple turns to the identification field may specifically be 101100010000, and so on.
  • the link number field can occupy 8 bits, which is used to record the link number of the link that received the original message. For example, if the link with the link number is 63, the original message is received. "00111111” is recorded in the road number field, where "00111111” is the binary number corresponding to "63".
  • the slave device 2 and the slave device 3 are specifically: master device -> slave device 1 -> master device -> slave device 2 -> master device -> slave device 3 - > master device.
  • the slave device 1 corresponds to the 31st bit in the MPLS header
  • the slave device 2 corresponds to the 30th bit in the MPLS header
  • the slave device 3 corresponds to the 29th bit in the MPLS header; 2b, the specific process can be as follows:
  • the master device receives the original packet A sent by the upstream device on the link 63. See Figure 2c and Figure
  • the master device determines that the original message A needs to be steered multiple times, and then, according to the slave device that needs to be redirected, and the steering sequence (in this example, In order to increase the slave device number from the smallest to the largest, the MPLS header is added to the original message A to obtain the message A1, and the message A1 is sent to the slave device 1.
  • the 29th to 31st bits in the MPLS are all 1, indicating that the slave devices that need to be redirected include the slave device 1, the slave device 2, and the slave device 3, that is, the multiple-turn identification field in the MPLS is 111000000000;
  • the road number field is specifically: 00111111, indicating that the original packet A enters the master device from the link 63, and after multiple times of forwarding, the processed packet will be sent out from the port with the link number of the master device. See Figure 2d.
  • the device 1 After receiving the packet A1 sent by the master device, the device 1 processes the packet A1 to obtain the packet A2.
  • the packet A2 carries the same MPLS header as the packet A1, that is, the slave device 1 does not change the packet.
  • the master device After receiving the packet A2 sent by the device 1, the master device searches for the first bit set to the left in the multiple turn identification field in the MPLS header, and finds that the bit 31 is set to 1, and then the bit is set. Cleared to 0, the result is 4, and the number of times to the identification field is 011000000000, and the link number field in the MPLS header remains unchanged, namely: 00111111, see Figure 2e and Figure 2f. Thereafter, the master device searches for the next set bit in the multiple turn identification field, and finds that the bit 30 is set to 1, thus determining that the slave device 2 is the next slave device that needs to be redirected, and then sends the message A2 to From device 2.
  • the device 2 After receiving the packet A2 sent by the master device, the device 2 processes the packet A2, and obtains the packet A3.
  • the packet A3 carries the same MPLS header as the packet A2, that is, the slave device 2 Do not change the MPLS header of A2.
  • the master device After receiving the packet A3 sent by the device 2, the master device searches for the first bit set to the left in the multiple turn identification field in the MPLS header, and finds that the bit 30 is set to 1, and then the bit is set. Cleared to 0, the result is 4, and the turn identification field is specifically: 001000000000, and the link number field in the MPLS header remains unchanged, namely: 00111111, see Figure 2g and Figure 2h.
  • the master device searches for the next set bit in the multiple turn identification field, and finds that the bit 29 is set to 1, thus determining that the slave device 3 is the next slave device that needs to be redirected, and then sends the message A3 to From device 3.
  • the device 3 After receiving the packet A3 sent by the master device, the device 3 processes the packet A3, and obtains the packet A4.
  • the packet A4 carries the same MPLS header as the packet A3, that is, the slave device 3 Do not change the MPLS header of A3'.
  • the slave device 3 returns the message A4 to the master device.
  • the master device After receiving the packet A4 sent by the device 3, the master device searches for the first bit set to the left in the multiple turn identification field in the MPLS header, and finds that the bit 29 is set to 1, and then the bit is set. Cleared to 0, the result is 4, and the turn identification field is specifically: 000000000000, and the link number field in the MPLS header remains unchanged, namely: 00111111, see Figure 2i and Figure 2j.
  • the master device continues to search for the next set bit in the multiple turn identification field, and finds that the bit is not set, so the link number "00111111" in the link number field is read, and the link number is determined.
  • the link is the link 63, and then the MPLS header of the packet A4 is stripped, and the packet A5 is obtained, and the packet A5 is sent out from the port of the link 63 of the master device, for example, to the downstream device of the master device, see Figure 2i and Figure 2j.
  • the above description only takes the number of bits in the multiple-turn identification field to be 12, and the number of bits in the link number field is 8 as an example. It should be understood that the number of bits thereof may also be based on actual conditions. The requirements of the application are adjusted, for example, if the master device is connected to 14 slave devices, the link If there are 60, the number of bits in the multiple-turn identification field can be adjusted to 14, and the number of bits in the link number field is adjusted to 6. If a layer of MPLS header is still insufficient to carry these multiple-turn information, It is also possible to appropriately increase the number of layers of the MPLS header according to the amount of information of the multiple-turn information. Generally, the existing standard protocol can support up to 7 layers of MPLS headers.
  • the MPLS header carries multiple times of steering information to implement multiple redirects of packets between network devices. Since MPLS can carry more information than existing Vlans, The standard protocol can also support up to 7 layers of MPLS headers. Therefore, this solution is more flexible and more scalable than existing solutions, and can carry more on the basis of the existing standard protocols. Turned to information multiple times.
  • the slave device is connected to the master device through the switch, it can be implemented by adding a Vlan header to the original device, and details are not described herein again.
  • the embodiment of the present invention further provides a network device, which can be used as a master device in the embodiment of the present invention.
  • the network device includes a first receiving unit 301 and a determining unit. 302 and sending unit 303;
  • the first receiving unit 301 is configured to receive a packet sent by the first slave device, where the packet includes an MPLS header that carries multiple times of steering information, and the multiple-turning information includes a multiple-turning identifier field, where the multiple The Steering Identification field is used to indicate the slave device that needs to be redirected to;
  • the determining unit 302 is configured to determine, according to the multiple-turning identifier field, the second slave device that needs to be redirected to; the first sending unit 303, configured to send the packet to the second slave device determined by the determining unit 302.
  • the network device may further include a second receiving unit 304 and a second transmitting unit 305; it should be noted that, in order to make it clearer, the slave device is also shown in Fig. 3b.
  • the second receiving unit 304 is configured to receive the original message sent by the upstream device before the first receiving unit 301 receives the packet sent by the first slave device.
  • the second sending unit 305 is configured to add an MPLS header carrying multiple steering information to the original packet received by the second receiving unit 304, and then send the MPLS header to the first slave device.
  • the multiple-turning information further includes a link number field, where the link number field is used to indicate the link of the original message received by the master device; wherein, the number of bits (bits) and the link of the multiple-turn identification field are multiple
  • the number of bits N of the number field can be set according to the needs of the actual application.
  • the MPLS header may also include a CoS field, an S field, and a TTL field. For details, please refer to the previous method embodiment. Said.
  • the second sending unit 305 can include a first identifier subunit, a second identifier subunit, and a sending subunit.
  • the first identifier sub-unit is configured to add the identifier of the link that the second receiving unit 304 receives the original packet to the link number field of the MPLS header.
  • the link number is specifically used as the identifier of the link.
  • a second identifier subunit configured to identify all the slave devices that need to be redirected to the multiple steering identifier field of the MPLS header according to a preset steering sequence, where the preset steering sequence is used to indicate that all needs to be turned to Specifically, the second identifier subunit determines at least one bit corresponding to each slave device according to a preset steering order, and at least corresponds to each slave device that needs to be redirected to One bit is set to the first value;
  • a sending subunit configured to: after the first identifier subunit and the second identifier subunit are executed, redirect the packet with the added MPLS header to the first slave device according to the preset steering sequence.
  • the determining unit 302 is specifically configured to find, from the multiple-turning identification field, the second slave device (ie, the next slave device) that needs to be redirected according to the preset steering sequence. Specifically, after the first receiving unit 301 receives the packet sent by the first slave device, determining, according to the preset steering sequence, and the multiple-turning identifier field in the MPLS header of the received packet, determining that the packet needs to be redirected. Next slave device.
  • each slave device attached to the master device corresponds to at least one bit in the multiple turn identification field, and sets that when the at least one bit is the first value, indicating that it is required to turn to the corresponding slave On the device, Bay' J:
  • the sending sub-unit is specifically configured to start searching from one end of the multiple-turning identification field according to a preset steering sequence; when the first first value is found, the packet with the MPLS header added is redirected to the The first slave device, wherein the first slave device corresponds to a bit in which the first first value is located.
  • the determining unit 302 is specifically configured to: according to the preset steering sequence, start searching from one end of the multiple-turning identification field, and when the first first value is found, the first first value to be found The bit position is the second value, and the next first value is continued. If the next first value is continued, the slave device corresponding to the bit where the next first value is located is determined to be the first Two slave devices.
  • the first sending unit 303 is further configured to: when the determining unit 302 does not find the next first value, determine the link indicated by the link number field, remove the MPLS header in the packet, and remove the MPLS header. The message is sent out from the determined link.
  • the first value and the second value may be preset according to an operator's policy, but the first value cannot be the same as the second value, for example, each slave device corresponds to one bit in the multiple turn identification field.
  • the first value can be set to "1"
  • the second value can be set to "0"
  • the second value can be set to "1”
  • the first value can be set to "11”
  • the second value can be set to "00"
  • the first value is set to " At 10
  • the second value can be set to "01", etc.; and so on.
  • each slave device corresponds to 1 bit in the multiple turn identification field
  • it can be: 3 ⁇ 4 port:
  • Manner 1 set corresponding bits for each slave device in the multiple turn identification field according to the preset steering order (ie, specify which slave device corresponds to which bit in the multiple turn identification field), and set When the bit position is 1, it indicates that it needs to be diverted to the corresponding slave device.
  • Manner 2 Set corresponding bits for each slave device in the multiple turn identification field according to the preset steering order, and set when the bit position is 0, indicating that it needs to be redirected to the corresponding slave device.
  • the second identifier sub-unit is specifically configured to set a bit position corresponding to all the slave devices that need to be redirected in the device cluster to 1.
  • the determining unit 302 may include a first clearing subunit, a first lookup subunit, and a first confirming stator unit;
  • a first clearing subunit configured to clear the first bit set in the multiple turn identification field by 0 according to a preset steering sequence
  • a first lookup subunit configured to search for a next set of bits in the multiple turn identification field according to a preset steering order
  • a first determining subunit configured to: when the first lookup subunit finds the next set bit, determine that the slave device corresponding to the next set bit is a second slave device that needs to be redirected (ie, Need to turn to the next slave device).
  • the first sending unit 303 is further configured to: when the first lookup subunit cannot find the next set bit, search for a corresponding link in the master device according to the link number field, and send the packet to the packet. After the MPLS header is removed, the packet with the MPLS header removed is sent out from the found link.
  • B'J The second identifier sub-unit is specifically configured to set a bit position corresponding to all the slave devices in the cluster of the device to be 0.
  • the determining unit 302 may include a second clearing subunit, a second searching subunit, and a second determining subunit;
  • a second clearing subunit configured to turn to the first bit position 1 of the first 0 in the identification field according to a preset steering sequence
  • a second search subunit configured to search for a next 0 bit in the multiple turn identification field according to a preset steering order
  • a second determining subunit configured to: when the second lookup subunit finds the next bit that is set to 0, determine that the slave device corresponding to the next bit that is set to 0 is the second slave device that needs to be redirected ( That is, you need to turn to the next slave device).
  • the first sending unit 303 is further configured to: when the second lookup subunit cannot find the next bit that is set to 0, search for a corresponding link in the master device according to the link number field, and set the MPLS header in the packet. After the removal, the packet with the MPLS header removed is sent out from the found link.
  • the above units may be implemented as independent entities, or may be implemented in any combination as one or several entities.
  • the second sending unit 305 of the network device in this embodiment may add an MPLS header carrying the multiple-turn information to the original packet, so that after the subsequent return of the packet returned by the device, the determining unit 302 may
  • the MPLS header is parsed to obtain multiple times of steering information to determine the next slave device that needs to be redirected, so that multiple rounds of packets between network devices can be implemented, because MPLS can carry with respect to the existing Vlan.
  • More information, and the existing standard protocol can also support up to 7 layers of MPLS headers, so this solution is more flexible and more scalable than existing solutions, and can comply with existing standard protocols. On the basis of carrying more multiple turns of information.
  • the embodiment of the present invention further provides a communication system (see FIG. 1 for an example), which may be a device cluster, where the communication system includes a master device and at least one slave device attached to the master device, where the master device It can be the network device described in the foregoing embodiment 3.
  • a communication system (see FIG. 1 for an example), which may be a device cluster, where the communication system includes a master device and at least one slave device attached to the master device, where the master device It can be the network device described in the foregoing embodiment 3.
  • a master device configured to receive a packet sent by the slave device, where the packet includes an MPLS header carrying multiple times of steering information, where the multiple-turning information includes a multiple-turning identifier field, and the multiple-turning indicator
  • the identification field is used to indicate the slave device that needs to be redirected; the next slave device that needs to be redirected is determined according to the multiple turn identification field, and the message is sent to the next slave device;
  • the slave device is configured to receive a packet sent by the master device, and send the packet to the master device, where the packet includes an MPLS header that carries the multiple-turn information.
  • the first slave device is configured to send a packet to the master device, where the packet includes an MPLS header that carries the multiple-turn information, where the multiple-turn information includes multiple redirect identifier fields, and the multiple-turn identifier field Used to indicate the slave device that needs to be turned to;
  • a master device configured to receive a packet sent by the first slave device, determine, according to the multiple-turning identifier field carried in the packet, the second slave device that needs to be redirected, and send the packet to the second slave device;
  • the second slave device is configured to receive the packet sent by the master device.
  • the primary device is further configured to receive an original packet sent by the upstream device, add an MPLS header carrying multiple forwarding information to the original packet, and send the MPLS header to the first slave device.
  • the MPLS header may include a link number field, which is used to indicate that the original device receives the original message, in addition to the multiple-turn identification field for indicating the slave device that needs to be redirected.
  • the link wherein the number of bits M of the multiple-turn identification field and the number N of the number of the link number field can be set according to actual application requirements.
  • the MPLS header may also include a CoS field, an S field, and a TTL field.
  • the master device may be specifically configured to add the identifier of the link that receives the original packet to the link number field of the MPLS header, and identify all the slave devices that need to be redirected according to the preset steering sequence. Turned to the identification field multiple times.
  • the identifier of the link may be an identifier such as a link number.
  • the master device may be specifically configured to determine, according to the multiple turn identification field, the second slave device that needs to be redirected.
  • each slave device attached to the master device may be configured to correspond to at least one bit in the multiple turn identification field, and set to indicate that the slave device needs to be redirected to the corresponding slave device when the at least one bit is the first value. on.
  • each slave device corresponds to one bit in the multiple-turn identification field, it can be set to indicate that it needs to be diverted to the corresponding slave device when the bit position is 1 or 0.
  • the master device is specifically configured to clear the first bit set in the multiple turn identification field to 0 according to the preset steering sequence, and then search for the next one in the multiple turn identification field according to the preset steering order.
  • the bit of 1 if found, determines that the slave device corresponding to the next set bit is the second slave device that needs to be redirected.
  • the master device is further configured to search for a corresponding link in the master device according to the link number field, and remove the MPLS header in the packet, and remove the MPLS header in the packet.
  • the packets of the MPLS header are sent out from the found link.
  • bit position is set to 0, it indicates that it needs to be turned to the corresponding slave device, and the master device is specifically used to set the first one of the multiple turns identification fields to 0 according to the preset steering order.
  • the bit position is 1, and then the next 0 bit is searched in the multiple turn identification field according to the preset steering order. If found, the slave device corresponding to the next 0 bit is determined to be The second slave device that needs to be turned to.
  • the master device is further configured to: if the next bit that is set to 0 is not found, search for the corresponding link in the master device according to the link number field, and remove the MPLS header in the packet, and then remove the MPLS header.
  • the packets of the MPLS header are sent out from the found link.
  • the master device in the communication system of the embodiment uses the MPLS header on the received original packet, and the MPLS header carries multiple times of steering information to implement multiple redirects of the packet between the network devices.
  • MPLS can carry more information
  • the existing standard protocol can support up to 7 layers of MPLS headers. Therefore, this scheme is more flexible and convenient than the existing scheme. It is more scalable and can carry more multiple turns of information on the cornerstone of existing standard protocols.
  • the storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).
  • the program may be stored in a computer readable storage medium, and the storage medium may include: Read-only memory, random access memory, disk or optical disk, etc.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Small-Scale Networks (AREA)
  • Communication Control (AREA)

Description

一种" ^文多次转向方法、 装置和系统 本申请要求于 2011 年 3 月 31 日提交中国专利局、 申请号为 201110080393.8、 发明名称为"一种报文多次转向方法、 装置和系统"的中国 专利申请的优先权, 其全部内容通过引用结合在本申请中。 技术领域 本发明涉及通信技术领域,具体涉及一种报文多次转向方法、装置和系统。
背景技术
随着网络技术的发展, 网络设备的功能也越来越丰富,对网络流量的分析 和监控的必要性愈加突出。 目前主要通过网络设备对流量以及报文实施监控, 来实现对网络的控制。 由于不同的网络设备对报文处理的侧重点不同, 而且带 宽支持也不同, 所以部署时经常需要将各个网络设备组成集群, 以便同一集群 中的各个网络设备可以通过相互之间的协助分析, 来满足报文处理需求。在这 种部署下, 同一集群内的网络设备之间可能需要进行报文转向, 以便将特定的 分析需求交给特定的网络设备处理。如果需要将报文依次交给本集群内的多个 网络设备处理, 那么, 就需要实现对报文的多次转向。 其中, 转向是指将报文 由一个网络设备交给另一个网络设备进行处理, 处理完后再将报文返回的过 程。
现有技术一般通过在原始报文中添加虚拟局域网 ( Vlan, Virtual Local Area Network ) 头, 来实现报文在不同网络设备间的多次转向。 主要通过为 Vlan头 中的不同的字段定义不同的含义, 并将多次转向信息存储在 Vlan头中, 然后在 转向时, 在原始报文上加上该 Vlan头, 各个网络设备接收到添加了 Vlan头的报 文后, 通过对 Vlan头的解析处理, 就可以知道将该报文转向哪个设备以及如何 转, 从而实现报文在网络设备之间的多次转向。 其中, 一层 Vlan头可以携带 12 比特位(bit )的信息, 如果需要携带更多的多次转向信息, 则需要多添加一层 Vlan头。 但是, 现有的标准协议仅支持最多两层 vlan头的报文, 这样, 最多可以携 带 24bit的多次转向信息, 携带的多次转向信息十分有限。
发明内容
本发明实施例提供一种报文多次转向方法、装置和系统, 可以在符合现有 标准协议的基石出上, 携带更多的多次转向信息。
一种报文多次转向方法, 包括:
接收第一从设备发送的报文,所述报文包括携带有多次转向信息的多协议 标签交换(MPLS, Multi-Protocol Label Switching ) 头, 所述多次转向信息包 括多次转向标识字段,所述多次转向标识字段用于指示需要转向到的第二从设 备;
根据多次转向标识字段确定需要转向到的第二从设备;
将报文发送给所述第二从设备。
一种网络设备, 包括:
第一接收单元, 用于接收第一从设备发送的报文, 所述报文包括携带有多 次转向信息的 MPLS头, 所述多次转向信息包括多次转向标识字段, 所述多次 转向标识字段用于指示需要转向到的第二从设备;
确定单元, 用于根据多次转向标识字段确定需要转向到的第二从设备; 发送单元, 用于将报文发送给所述第二从设备。
一种通信系统,包括主设备和附属于所述主设备的至少一个从设备,其中, 所述主设备为上述的网络设备;
从设备, 用于接收主设备发送的报文, 以及发送报文给主设备, 所述报文 包括携带多次转向信息的 MPLS头。
本发明实施例采用 MPLS头携带多次转向信息来实现报文在网络设备之 间的多次转向, 由于 MPLS相对于现有的 Vlan来说, 可以携带更多的信息, 而 且现有的标准协议还可以支持最多 7层的 MPLS头,所以采用该方案,较现有方 案而言, 更为灵活方便, 扩展性更强, 可以在符合现有标准协议的基石出上, 携 带更多的多次转向信息。 附图说明
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施 例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地, 下面描述 中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付 出创造性劳动性的前提下, 还可以根据这些附图获得其他的附图。
图 la是本发明实施例的报文多次转向的场景示意图;
图 lb是本发明实施例提供的报文多次转向方法的流程图;
图 lc是本发明实施例提供的 MPLS头的结构示意图;
图 2a是本发明实施例二中 MPLS头的结构示意图;
图 2b是本发明实施例二提供的报文多次转向方法的流程图;
图 2c是本发明实施例二中将报文转向至从设备 1时的示意图;
图 2d是本发明实施例二中将报文转向至从设备 1时的报文示意图; 图 2e是本发明实施例二中将报文转向至从设备 2时的示意图;
图 2f是本发明实施例二中将报文转向至从设备 2时的报文示意图; 图 2g是本发明实施例二中将报文转向至从设备 3时的示意图; 图 2h是本发明实施例二中将报文转向至从设备 3时的报文示意图; 图 2i是本发明实施例二中将报文从链路发送出去时的示意图;
图 2j是本发明实施例二中将报文从链路发送出去时的报文示意图; 图 3a是本发明实施例提供的网络设备的结构示意图;
图 3b是本发明实施例提供的网络设备的另一结构示意图。 具体实施方式 为了使本技术领域的人员更好地理解本发明方案,下面将结合本发明实施 例中的附图, 对本发明实施例中的技术方案进行清楚、 完整地描述, 显然, 所 描述的实施例仅仅是本发明一部分的实施例, 而不是全部的实施例。基于本发 明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所 有其他实施例, 都应当属于本发明保护的范围。
在网络中, 可以包括有若干个设备集群,每个设备集群中可以包括一个主 设备和若干个从设备,其中,主设备部署在网络链路中,从设备附属于主设备。 如果主设备链路中有报文需要一个以上的从设备进行处理,就需要在该集群内 部实现对该报文的多次转向。 例如, 参见图 la, 在该应用场景中, 主设备部署 在网络链路中,从设备 1、从设备 2和从设备 3均附属于主设备,其中,从设备 1、 从设备 2和从设备 3可以对报文进行不同的处理。 如果报文 B需要转向到从设备 1、 从设备 2和从设备 3 , 则, 如图 la所示, 4艮文 B的多次转向流程可以如下: 1、 主设备从数据链路(即网络链路)上接收报文 B;
2、 主设备将报文 B发送给从设备 1 ;
3、 从设备 1在接收到该报文 B后, 对报文 B进行处理, 得到报文 B1 , 将报 文 B1返回给主设备;
4、 主设备将报文 B1发送给从设备 2;
5、 从设备 2在接收到该报文 B1后, 对报文 B1进行处理, 得到报文 B2, 将 报文 B2返回给主设备;
6、 主设备将报文 B2发送给从设备 3;
7、 从设备 3在接收到该报文 B2后, 对报文 B2进行处理, 得到报文 B3 , 将 报文 B3返回给主设备;
8、 主设备将报文 B3通过数据链路发送出去, 比如, 发送给数据链路上的 下游设备。
本发明实施例提供一种报文多次转向方法、装置和系统。 以下分别进行详 细说明。
实施例一、
本实施例将从主设备的角度进行描述。
一种报文多次转向方法, 包括: 接收第一从设备发送的报文, 其中, 该报 文包括携带有多次转向信息的 MPLS头,多次转向信息包括多次转向标识字段, 多次转向标识字段用于指示需要转向到的从设备;根据上述多次转向标识字段 确定需要转向到的第二从设备; 将报文发送给第二从设备。
在接收第一从设备发送的报文之前,还可以包括: 接收上游设备发送的原 始报文, 在该原始报文上添加携带有多次转向信息的 MPLS头后, 发送给第一 从设备。
参见图 lb, 具体流程可以如下:
101、 接收上游设备发送的原始报文;
102、 在该原始报文上添加携带有多次转向信息的 MPLS头后, 发送给第 一从设备 (即本设备集群中的一个从设备 );
其中, 参见图 lc, 多次转向信息可以包括多次转向标识字段, 该多次转向 标识字段用于指示需要转向到的从设备或从设备组(即用于指示需要转向到哪 些从设备或从设备组); 此外, 该多次转向信息还可以包括链路号字段, 该链 路号字段用于指示主设备中接收到原始报文的链路; 其中, 多次转向标识字段 的比特位(bit )数目 M和链路号字段的比特位数目 N可以根据实际应用的需求 进行设置。 例如, 可以设置多次转向标识字段的比特位数目 M为 12, 而链路号 字段的比特位数目 N为 8;或者,还可以设置多次转向标识字段的比特位数目 M 为 14, 而链路号字段的比特位数目 N为 6, 等等。
还需说明的是,如图 lc所示, MPLS头还可以包括服务类型(CoS, Class of Service )字段、 栈(S, Stack ) 字段和存活时间 ( TTL, Time-to-Live )字段, 其中, CoS字段为 3个比特位, S字段为 1个比特位, TTL字段为 8个比特位。
其中, 多次转向信息可以占用现有 MPLS协议规定的 MPLS头中的空闲比 特位。
则此时, 在原始^艮文上添加携带有多次转向信息的 MPLS头具体可以如 下:
( 1 )将接收到原始报文的链路的标识添加在 MPLS头的链路号字段中; 也就是说,链路号字段标示着原始报文从主设备的哪条链路 (主设备可以包括 多条链路)进入, 这样, 在多次转向完成之后, 主设备就可以根据该链路号字 段找到与该链路的入端口对应的出端口将报文发送出去。 其中, 具体可采用链 路号作为链路的标识。 ( 2 )将本设备集群(即主设备所在的设备集群) 中所有需要转向到的从 设备按照预置的转向顺序标识在 MPLS头的多次转向标识字段中。 例如, 具体 可以: ¾口下:
附属于该主设备的每个从设备对应于多次转向标识字段中的至少一个比 特位, 并且设置当该至少一个比特位置为第一值时,表示需要转向到对应的从 设备上;则此时,将所有需要转向到的从设备按照预置的转向顺序标识在 MPLS 头的多次转向标识字段中可以包括:
按照预置的转向顺序确定每个从设备所对应的至少一个比特位;将每个需 要转向到的从设备所对应的至少一个比特位置为所述第一值。
其中,每个从设备所对应的多次转向标识字段中的比特位数以及第一值可 以根据运营商的策略进行预置, 比如, 当每个从设备对应于多次转向标识字段 中的 1个比特位时, 可以将第一值设置为 0或 1 ; 当每个从设备对应于多次转向 标识字段中的 2个比特位时, 可以将第一值设置为 00、 01、 10或 11 ; 以此类推。 为了描述方便, 在本发明实施例中, 将以第一值具体为 0或 1 , 且每个从设备对 应一个比特位为例进行说明, 例如, 可以如下:
方式一:
在多次转向标识字段中为每个从设备设置对应的比特位,并设定当比特位 置 1时, 表示需要转向到对应的从设备上, 则此时, 将本设备集群中所有需要 转向到的从设备按照预置的转向顺序标识在 MPLS头的多次转向标识字段中具 体可以为:
按照预置的转向顺序确定每个从设备所对应的比特位(即确定哪个从设备 对应于多次转向标识字段中的哪个比特位); 将本设备集群中所有需要转向到 的从设备所对应的比特位置为 1。
方式二:
在多次转向标识字段中为每个从设备设置对应的比特位,并设定当比特位 置 0时, 表示需要转向到对应的从设备上, 则此时, 将本设备集群中所有需要 转向到的从设备按照预置的转向顺序标识在 MPLS头的多次转向标识字段中具 体可以为:
按照预置的转向顺序确定每个从设备所对应的比特位(即确定哪个从设备 对应于多次转向标识字段中的哪个比特位); 将本设备集群中所有需要转向到 的从设备所对应的比特位置为 0。
在原始报文上添加携带有多次转向信息的 MPLS头后, 就可以按照预置的 转向顺序将添加了该 MPLS头的报文转向到第一从设备。 例如, 可以如下: 按照预置的转向顺序, 从 MPLS头的多次转向标识字段的一端开始查找; 当查找到第一个第一值(比如 1或 0 ) 时, 将添加了 MPLS头的报文转向到第一 从设备, 其中, 第一从设备对应于该第一个第一值所在的比特位。
其中, 转向顺序指的是转向时本设备集群中各个从设备的排列顺序, 即, 所有需要转向到的从设备被转向到的先后顺序 ,该转向顺序具体可以根据预置 策略进行设置。 比如, 如果各个从设备在主设备中都具有对应的一个编号, 称 为从设备编号, 则此时, 转向顺序可以设置为按从设备编号从小到大转向, 或 者,也可以设置为按从设备编号从大到小转向,还可以设置为按照任意编号顺 序转向。 例如, 主设备外接了 N ( N为大于 1的正整数)个从设备, 编号分别为 1,2, - ,Ν, 需要转向到其中编号为 1,2,5,8,Ν的这 5个从设备, 并且预置转向顺序 为 5, 2, 8,Ν,1 ,多次转向字段的总比特数也为 Ν,—个从设备对应于一个比特位, 则此时, 在将所有需要转向到的从设备按照预置的转向顺序标识在 MPLS头的 多次转向标识字段时, 可以将多次转向标识字段的 N个比特位中的左起(或右 起)第 1个比特位设置为与从设备 5对应, 第 2个比特位与从设备 2对应, 第 3个 比特位与从设备 8对应, 第 4个比特位与从设备 N对应, 第 5个比特位与从设备 1 对应, 其余(N-5 )个比特位可以与剩余的(N-5 )个从设备任意对应, 在查找 时就可以从多次转向字段的左端 (或右端)开始查找。
另外, 需要说明的是, 报文所携带的 MPLS头可以有多层, 具体可以根据 实际需要携带的信息量来确定 MPLS头的层数。 例如, 当主设备外接的从设备 数目较多时, 多次转向标识字段的比特位数也会相应较大, 主设备中的链路总 数较多时, 链路号字段的比特位数也会相应地较大, 此时, 若一个 MPLS头无 法携带完这些信息,则可以用二个甚至更多的 MPLS头来携带多次转向信息(包 括多次转向标识字段和链路号字段)。 一般的, 现有标准协议最多可以支持 7 层的 MPLS头。
103、 接收第一从设备发送的报文, 其中, 报文包括携带多次转向信息的 MPLS头; 具体可以如下:
第一从设备接收到主设备发送的报文后, 对报文的数据部分进行处理,但 不改变 MPLS头, 然后将处理后的报文返回给主设备。
104、 根据多次转向信息, 如多次转向标识字段确定需要转向到的第二从 设备(即需要转向到的下一个从设备); 比如, 具体可以根据 MPLS头中的多次 转向标识字段确定需要转向到的第二从设备, 如下:
按照预置的转向顺序, 从 MPL S头中的多次转向标识字段的一端开始查 找; 当查找到第一个第一值时,将查找到的第一个第一值所在的比特位置为第 二值(用于表示对应的从设备已经转向过了); 然后继续往后查找下一个第一 值, 若继续查找到下一个第一值, 则确定该下一个第一值所在的比特位所对应 的从设备为第二从设备。然后就可以将包括 MPLS头的报文发送给第二从设备。
此外, 该 "¾文多次转向方法还可以包括: 若继续往后查找不到下一个第一 值, 此时认为所有需要转向到的从设备均已经转向过了, 则确定所述链路号字 段所指示的链路; 将报文中的 MPLS头去除后, 将去除了 MPLS头的报文从所 确定的链路上发送出去。
其中, 第二值可以根据运营商的策略进行设置,但是第二值不能和第一值 相同, 比如, 当第一值设置为 "1 " 时, 第二值可以设置为 "0" , 当第一值设 置为 "0" 时, 第二值可以设置为 "1" , 等等。 以下将对应步骤 102中的两种方 式进行举例说明。
( 1 )如果在步骤 102中, 采用的是方式一来标识多次转向标识字段, 则此 时, 步骤 104具体可以为:
按照预置的转向顺序, 将多次转向标识字段中第一个置 1的比特位清 0; 根据预置的转向顺序在多次转向标识字段中查找下一个置 1的比特位; 若查找到, 则确定该下一个置 1的比特位所对应的从设备为需要转向到的 第二从设备(即需要转向到的下一个从设备), 执行步骤 105。
若查找不到, 则根据链路号字段查找在主设备中对应的链路,将报文从查 找到的链路上发送出去, 流程结束。
( 2 )如果在步骤 102中, 采用的是方式二来标识多次转向标识字段, 则此 时, 步骤 104具体可以为:
按照预置的转向顺序, 将多次转向标识字段中第一个置 0的比特位置 1; 根据预置的转向顺序在多次转向标识字段中查找下一个置 0的比特位; 若查找到, 则确定该下一个置 0的比特位所对应的从设备为需要转向到的 第二从设备(即需要转向到的下一个从设备), 执行步骤 105。
若查找不到, 则根据链路号字段查找在主设备中对应的链路,将报文中的 MPLS头去除后, 将去除了 MPLS头的报文从查找到的链路上发送出去, 流程 结束。
105、 将报文发送给该第二从设备, 返回执行步骤 103。
由上可知, 本实施例采用 MPLS头携带多次转向信息来实现报文在网络设 备之间的多次转向, 由于 MPLS相对于现有的 Vlan来说,可以携带更多的信息, 而且现有的标准协议还可以支持最多 7层的 MPLS头,所以采用该方案,较现有 方案而言, 更为灵活方便, 扩展性更强, 可以在符合现有标准协议的基石出上, 携带更多的多次转向信息。
实施例二、
根据实施例一所描述的方法, 以下将举例作详细说明。
首先,预先为各个从设备在主设备中设置一个对应的编号, 称为从设备编 号。 其次, 需要指明转向顺序, 比如, 按从设备编号从小到大转向、 按从设备 编号从大到小转向、 或者按任意编号顺序转向。 再者, 还需要按照预置的转向 顺序在 MPLS头中的多次转向标识字段中为每个从设备设置对应的比特位, 即 指定各从设备对应多次转向标识字段中的哪个比特位。
另外,由于主设备包括了多条链路,且每条链路包括上行链路和下行链路, 所以还需要在 MPLS头中指明接收原始报文所使用的链路, 即指明原始报文是 通过哪条链路进入主设备的,以及在多次转向完毕后的报文是从该链路中的上 行链路的端口还是下行链路的端口发送出去。 由此, 可以在 MPLS头中定义链 路号字段, 用来指示主设备中接收到原始报文的链路。
MPLS头的格式可参见图 lc。 其中, MPLS头中各个字段的定义如下: ( 1 ) 多次转向标识字段:
主要用于指示如何进行多次转向, 其中,每个从设备在该多次转向标识字 段中对应一个比特位, 需要转向到哪个从设备, 则将该从设备对应的比特位置 1 , 这样, 就可以标示将报文转向到哪些从设备。
当然, 也可以将需要转向到的从设备对应的比特位置其他标识, 比如 0, 为了描述方便,在本发明实施例中, 均以将需要转向到的从设备对应的比特位 置 1为例进行说明, 应该理解的是, 如果将需要转向到的从设备对应的比特位 置其他标识, 其实现方法也与此类似, 在此不再贅述。
( 2 )链路号字段:
主要用于指示主设备中接收到原始报文的链路,即标示原始报文从主设备 哪条链路进入,因为报文经过转向后还需要从本报文入链路端口对应的出端口 发送出去。 当转向完毕后, 主设备根据链路号字段决定将报文从哪个链路端口 发送出去。
( 3 ) CoS字段:
主要用于指示业务的类型。
( 4 ) S字段:
主要用于指示当前标签是否到达标签栈底, 一般的, 1表示是, 0表示否。
( 5 ) TT 字段:
主要用于指示该报文的存活时间。
其中, 多次转向标识字段和链路号字段即为多次转向信息。
当报文由主设备转向给从设备, 经过从设备再回到主设备时, 主设备根据 从设备的转向顺序, 将多次转向标识字段中从左边(或右边, 根据预先的设计 而定 )起第一个置 1的比特位清 0, 然后再根据转向顺序查找多次转向标识字段 中下一个置 1的比特位, 若查找到, 则将报文转向至该下一个置 1的比特位对应 的从设备中去。 若在多次转向标识字段中找不到置 1的比特位, 则根据 MPLS 头中的链路号字段, 查找主设备中对应的链路, 将报文从该链路发送出去。
以下将举例进行说明。
(一 ) 背景
主设备可以外接 12个从设备, 它们在主设备中的编号分别为 1、 2、 3... ...
12; 而且主设备具有 200条链路, 具体为链路 1、 链路 2 链路 63 和链路 200; 则此时 MPLS头的结构可以如图 2a所示, 其中, 多次转向标识字段 占用 12个比特位, 每个比特位对应着一个从设备, 比如, 可以设定从设备 1对 应 MPLS头中的第 31个比特位, 从设备 2对应 MPLS头中的第 30个比特位, 从设 备 3对应 MPLS头中的第 29个比特位, 从设备 4对应 MPLS头中的第 28个比特位, 等等, 依此类推。 如果需要转向到的从设备为从设备 1和从设备 2, 则多次转向 标识字段具体可以为 110000000000; 又比如, 如果需要转向到的从设备为从设 备 1、 从设备 3、 从设备 4和从设备 8 , 则多次转向标识字段具体可以为 101100010000, 等等。 而链路号字段则可以占用 8个比特位, 用于记录接收到 原始报文的链路的链路号, 比如接收到原始报文的是链路号为 63的链路, 则可 以在链路号字段中记录 "00111111" , 其中, "00111111" 为 "63" 所对应的二 进制数。
(二) 当前场景
如果当前原始报文由链路 63进入主设备, 并需要多次转向到从设备 1、 从 设备 2和从设备 3 ,且转向顺序为按从设备编号从小到大, 即依次转向从设备 1、 从设备 2和从设备 3 , 具体为: 主设备—— >从设备 1—— >主设备—— >从设备 2—— >主设备—— >从设备 3—— >主设备。 其中, 从设备 1对应着 MPLS头中的 第 31个比特位, 从设备 2对应着 MPLS头中的第 30个比特位, 从设备 3对应着 MPLS头中的第 29个比特位; 则参见图 2b, 具体流程可以如下:
201、 主设备在链路 63上接收上游设备发送的原始报文 A; 参见图 2c和图
2d。
202、 当原始报文 A由链路 63进入主设备时, 主设备确定需要对该原始报 文 A进行多次转向, 于是, 根据需要转向到的从设备, 以及转向顺序 (在本例 子中即为按从设备编号从小到大的顺序)在原始报文 A中加 MPLS头, 得到报 文 A1 , 并将报文 A1发送给从设备 1。
其中, MPLS中的第 29 ~ 31个比特位均为 1 , 指示需要转向到的从设备包 括从设备 1、 从设备 2和从设备 3 , 即 MPLS中的多次转向标识字段为 111000000000; 而链路号字段具体为: 00111111 , 指示该原始报文 A从链路 63 进入主设备, 并在多次转向后, 处理后的报文将从主设备的链路号为 63的端口 发送出去, 具体可参见图 2 d。
203、 从设备 1接收到主设备发送的报文 A1后, 对报文 A1进行处理, 得到 报文 A2; 其中, 报文 A2携带与报文 A1同样的 MPLS头, 即从设备 1不更改报文 A1的 MPLS头。
从设备 1将报文 A2返回给主设备。
204、 主设备接收到从设备 1发送的报文 A2后, 在 MPLS头中的多次转向标 识字段里查找左边第一个置 1的比特位,发现比特位 31置 1 , 于是将该比特位清 0, 得到 4艮文入2,, 即此时多次转向标识字段具体为: 011000000000, 而 MPLS 头中的链路号字段则保持不变, 即为: 00111111 , 参见图 2e和图 2f。 此后, 主设备在多次转向标识字段中查找下一个置 1的比特位, 发现比特 位 30置 1 , 因此确定从设备 2为下一个需要转向到的从设备, 于是将报文 A2, 发送给从设备 2。
205、 从设备 2接收到主设备发送的报文 A2, 后, 对报文 A2, 进行处理, 得到报文 A3; 其中, 报文 A3携带与报文 A2, 同样的 MPLS头, 即从设备 2不更 改才艮文 A2, 的 MPLS头。
从设备 2将报文 A3返回给主设备。
206、 主设备接收到从设备 2发送的报文 A3后, 在 MPLS头中的多次转向标 识字段里查找左边第一个置 1的比特位,发现比特位 30置 1 , 于是将该比特位清 0, 得到 4艮文入3,, 即此时转向标识字段具体为: 001000000000, 而 MPLS头中 的链路号字段则保持不变, 即为: 00111111 , 参见图 2g和图 2h。
此后, 主设备在多次转向标识字段中查找下一个置 1的比特位, 发现比特 位 29置 1 , 因此确定从设备 3为下一个需要转向到的从设备, 于是将报文 A3, 发送给从设备 3。
207、 从设备 3接收到主设备发送的报文 A3, 后, 对报文 A3, 进行处理, 得到报文 A4; 其中, 报文 A4携带与报文 A3, 同样的 MPLS头, 即从设备 3不更 改才艮文 A3' 的 MPLS头。
从设备 3将报文 A4返回给主设备。
208、 主设备接收到从设备 3发送的报文 A4后, 在 MPLS头中的多次转向标 识字段里查找左边第一个置 1的比特位,发现比特位 29置 1 , 于是将该比特位清 0, 得到 4艮文入4,, 即此时转向标识字段具体为: 000000000000, 而 MPLS头中 的链路号字段则保持不变, 即为: 00111111 , 参见图 2i和图 2j。
主设备在多次转向标识字段中继续查找下一个置 1的比特位,发现没有置 1 的比特位, 于是读取链路号字段中的链路号 "00111111" , 确定该链路号对应 的链路为链路 63 , 然后剥除报文 A4, 的 MPLS头, 得到报文 A5 , 将报文 A5从 主设备中链路 63的端口发送出去, 比如, 发送给主设备的下游设备, 参见图 2i 和图 2j。
需说明的是, 以上仅仅以多次转向标识字段的比特位数目为 12,链路号字 段的比特位数目为 8为例进行说明的, 应该理解的是, 它们的比特位数目还可 以根据实际应用的需求进行调整, 比如, 如果主设备与 14个从设备连接, 链路 为 60条, 则此时可以将多次转向标识字段的比特位数目调整为 14,链路号字段 的比特位数目调整为 6, 如果一层 MPLS头仍不足以携带这些多次转向信息的 话, 还可以根据多次转向信息的信息量适当增加 MPLS头的层数, 一般的, 现 有标准协议最多可以支持 7层的 MPLS头。
由上可知, 本实施例采用 MPLS头携带多次转向信息来实现报文在网络 设备之间的多次转向, 由于 MPLS相对于现有的 Vlan来说, 可以携带更多的信 息, 而且现有的标准协议还可以支持最多 7层的 MPLS头, 所以采用该方案, 较 现有方案而言, 更为灵活方便, 扩展性更强, 可以在符合现有标准协议的基础 上, 携带更多的多次转向信息。
此外, 需说明的是, 如果从设备是通过交换机与主设备连接的, 则可通 过在原有基础上加一层 Vlan头来实现, 在此不再贅述。
实施例三、
为了更好地实施以上方法, 本发明实施例还相应地提供一种网络设备, 可 以作为本发明实施例中的主设备, 如图 3a所示, 该网络设备包括第一接收单元 301、 确定单元 302和发送单元 303;
第一接收单元 301 , 用于接收第一从设备发送的报文, 其中, 报文包括携 带有多次转向信息的 MPLS头, 所述多次转向信息包括多次转向标识字段, 所 述多次转向标识字段用于指示需要转向到的从设备;
确定单元 302 ,用于根据多次转向标识字段确定需要转向到的第二从设备; 第一发送单元 303 , 用于将报文发送给确定单元 302确定的第二从设备。 如图 3b所示, 该网络设备还可以包括第二接收单元 304和第二发送单元 305; 需说明的是, 为了表示得更清楚, 图 3b中还画出了从设备。
第二接收单元 304,用于在第一接收单元 301接收到第一从设备发送的报文 之前, 接收上游设备发送的原始报文;
第二发送单元 305,用于在第二接收单元 304接收到的原始报文上添加携带 有多次转向信息的 MPLS头后, 发送给第一从设备。
其中, 多次转向信息还包括链路号字段,链路号字段用于指示主设备中接 收到原始报文的链路; 其中, 多次转向标识字段的比特位(bit )数目 M和链路 号字段的比特位数目 N可以根据实际应用的需求进行设置。 该 MPLS头还可以 包括 CoS字段、 S字段和 TTL字段。 具体可参见前面的方法实施例, 在此不再贅 述。
则此时, 第二发送单元 305可以包括第一标识子单元、 第二标识子单元和 发送子单元;
第一标识子单元,用于将第二接收单元 304接收到原始报文的链路的标识, 添加在 MPLS头的链路号字段中; 其中, 具体可采用链路号作为链路的标识。
第二标识子单元,用于将所有需要转向到的从设备按照预置的转向顺序标 识在 MPLS头的多次转向标识字段中, 其中, 所述预置的转向顺序用于指示所 有需要转向到的从设备被转向到的先后顺序; 具体地, 第二标识子单元按照预 置的转向顺序确定每个从设备所对应的至少一个比特位,将每个需要转向到的 从设备所对应的至少一个比特位均置为所述第一值;
发送子单元, 用于在第一标识子单元和第二标识子单元执行完毕后,按照 预置的转向顺序将添加了 MPLS头的报文转向到第一从设备。
确定单元 302, 具体用于按照预置的转向顺序, 从多次转向标识字段中查 找到需要转向到的第二从设备(即下一个从设备)。具体为在第一接收单元 301 接收到第一从设备发送的报文后,按照预置的转向顺序以及根据该接收到的报 文的 MPLS头中的多次转向标识字段, 确定需要转向到的下一个从设备。
其中, 可以设置: 附属于该主设备的每个从设备对应于多次转向标识字段 中的至少一个比特位, 并且设置当该至少一个比特位为第一值时,表示需要转 向到对应的从设备上, 贝' J :
发送子单元, 具体用于按照预置的转向顺序,从该多次转向标识字段的一 端开始查找; 当查找到第一个第一值时, 将添加了所述 MPLS头的报文转向到 所述第一从设备, 其中, 所述第一从设备对应于所述第一个第一值所在的比特 位。
确定单元 302, 具体用于按照所述预置的转向顺序, 从所述多次转向标识 字段的一端开始查找, 当查找到第一个第一值时,将查找到的第一个第一值所 在的比特位置为第二值, 继续查找下一个第一值, 若继续查找到下一个第一值 时, 则确定所述下一个第一值所在的比特位所对应的从设备为所述第二从设 备。
第一发送单元 303 ,还用于在确定单元 302查找不到下一个第一值时,确定 所述链路号字段所指示的链路, 将报文中的 MPLS头去除并将去除了 MPLS头 的报文从所确定的链路上发送出去。
其中, 第一值和第二值可以根据运营商的策略进行预置,但是第一值不能 和第二值相同, 比如, 在每个从设备对应于多次转向标识字段中的 1个比特位 的情况下, 可以将第一值设置为 "1" , 此时第二值可以设置为 "0" , 当第一值 设置为 "0" 时, 第二值可以设置为 " 1" ; 在每个从设备对应于多次转向标识 字段中的 2个比特位的情况下, 可以将第一值设置为 "11" , 此时第二值可以设 置为 "00" , 当第一值设置为 " 10" 时, 第二值可以设置为 "01" 等; 以此类 推。 例如, 在每个从设备对应于多次转向标识字段中的 1个比特位的情况下, 可以: ¾口下:
方式一:按照预置的转向顺序在多次转向标识字段中为每个从设备设置对 应的比特位(即指定哪个从设备对应于多次转向标识字段中的哪个比特位), 并设定当比特位置 1时, 表示需要转向到对应的从设备上。
方式二:按照预置的转向顺序在多次转向标识字段中为每个从设备设置对 应的比特位, 并设定当比特位置 0时, 表示需要转向到对应的从设备上。
( 1 )如果采用上述方式一, 贝' J :
第二标识子单元,具体用于将本设备集群中所有需要转向到的从设备所对 应的比特位置为 1。
此时, 确定单元 302可以包括第一清除子单元、 第一查找子单元和第一确 定子单元;
第一清除子单元, 用于按照预置的转向顺序,将多次转向标识字段中第一 个置 1的比特位清 0;
第一查找子单元,用于按照预置的转向顺序在多次转向标识字段中查找下 一个置 1的比特位;
第一确定子单元, 用于在第一查找子单元查找到下一个置 1的比特位时, 确定该下一个置 1的比特位所对应的从设备为需要转向到的第二从设备 (即需 要转向到的下一个从设备)。
贝' J , 第一发送单元 303 ,还用于在第一查找子单元查找不到下一个置 1的比 特位时, 根据链路号字段查找在主设备中对应的链路, 将报文中的 MPLS头去 除后, 将去除了 MPLS头的报文从查找到的链路上发送出去。
( 2 )如果采用上述方式二, 贝' J : 所述第二标识子单元,具体用于将本设备集群中所有需要转向到的从设备 所对应的比特位置为 0。
则此时, 确定单元 302可以包括第二清除子单元、 第二查找子单元和第二 确定子单元;
第二清除子单元, 用于按照预置的转向顺序,将多次转向标识字段中第一 个置 0的比特位置 1 ;
第二查找子单元,用于根据预置的转向顺序在多次转向标识字段中查找下 一个置 0的比特位;
第二确定子单元, 用于在第二查找子单元查找到下一个置 0的比特位时, 确定所述下一个置 0的比特位所对应的从设备为需要转向到的第二从设备(即 需要转向到的下一个从设备)。
则第一发送单元 303 ,还用于在第二查找子单元查找不到下一个置 0的比特 位时, 根据链路号字段查找在主设备中对应的链路, 将报文中的 MPLS头去除 后, 将去除了 MPLS头的报文从查找到的链路上发送出去。
以上各个单元的具体实施可参见前面的方法实施例, 在此不再贅述。 具体实施时, 以上单元可以作为独立的实体实现, 也可以进行任意组合, 作为一个或若干个实体来实现。
由上可知, 本实施例的网络设备的第二发送单元 305可以在原始^艮文上添 加携带有多次转向信息的 MPLS头, 使得后续接收到从设备返回的报文后, 确 定单元 302可以通过解析 MPLS头来获取到多次转向信息,以确定下一个需要转 向到的从设备, 从而实现报文在网络设备之间的多次转向, 由于 MPLS相对于 现有的 Vlan来说, 可以携带更多的信息, 而且现有的标准协议还可以支持最多 7层的 MPLS头, 所以采用该方案, 较现有方案而言, 更为灵活方便, 扩展性更 强, 可以在符合现有标准协议的基础上, 携带更多的多次转向信息。
实施例四、
相应的, 本发明实施例还提供一种通信系统(一种实例可以参见图 1 ), 可 以作为一个设备集群,该通信系统包括主设备和附属于主设备的至少一个从设 备, 其中, 主设备可以为上述实施例三中所述的网络设备。
主设备, 用于接收从设备发送的报文, 其中, 该报文包括携带有多次转向 信息的 MPLS头, 所述多次转向信息包括多次转向标识字段, 所述多次转向标 识字段用于指示需要转向到的从设备;根据多次转向标识字段确定需要转向到 的下一个从设备, 并将报文发送给该下一个从设备;
从设备, 用于接收主设备发送的报文, 以及发送报文给主设备, 其中, 该 报文包括携带有多次转向信息的 MPLS头。
具体如下:
第一从设备, 用于发送报文给主设备, 其中, 该报文包括携带有多次转向 信息的 MPLS头, 其中, 该多次转向信息包括多次转向标识字段, 该多次转向 标识字段用于指示需要转向到的从设备;
主设备, 用于接收第一从设备发送的报文,根据该报文中携带的多次转向 标识字段确定需要转向到的第二从设备, 并将报文发送给该第二从设备; 第二从设备, 用于接收主设备发送的报文。
其中, 主设备, 还用于接收上游设备发送的原始报文, 在该原始报文上添 加携带有多次转向信息的 MPLS头后, 发送给第一从设备。
其中, MPLS头除了可以包括用于指示需要转向到的从设备的多次转向标 识字段之外, 还可以包括链路号字段, 该链路号字段用于指示主设备中接收到 原始报文的链路; 其中, 多次转向标识字段的比特位数目 M和链路号字段的比 特位数目 N可以根据实际应用的需求进行设置。 该 MPLS头还可以包括 CoS字 段、 S字段和 TTL字段。 具体可参见前面的方法实施例, 在此不再贅述。
则此时, 主设备, 具体可以用于将接收到原始报文的链路的标识添加在 MPLS头的链路号字段中, 并将所有需要转向到的从设备按照预置的转向顺序 标识在多次转向标识字段中。 其中, 链路的标识具体可以为链路号等标识。
进一步的, 主设备, 具体可以用于根据多次转向标识字段确定需要转向到 的第二从设备。例如, 可以设置附属于该主设备的每个从设备对应于多次转向 标识字段中的至少一个比特位, 并且设置当该至少一个比特位为第一值时,表 示需要转向到对应的从设备上。 比如, 当每个从设备对应于多次转向标识字段 中的一个比特位时, 可以设定当比特位置 1或 0时,表示需要转向到对应的从设 备上。
如果设定当比特位置 1时, 表示需要转向到对应的从设备上, 贝' J :
主设备, 具体用于按照预置的转向顺序,将多次转向标识字段中第一个置 1的比特位清 0,然后根据预置的转向顺序在多次转向标识字段中查找下一个置 1的比特位, 若查找到, 则确定该下一个置 1的比特位所对应的从设备为需要转 向到的第二从设备。
此时, 主设备, 还用于若查找不到下一个置 1的比特位, 则根据链路号字 段查找在主设备中对应的链路, 将报文中的 MPLS头去除后, 将去除了 MPLS 头的报文从查找到的链路上发送出去。
或者, 如果设定当比特位置 0时, 表示需要转向到对应的从设备上, 贝' J : 主设备, 具体用于按照预置的转向顺序,将多次转向标识字段中第一个置 0的比特位置 1 ,然后才艮据预置的转向顺序在多次转向标识字段中查找下一个置 0的比特位, 若查找到, 则确定该下一个置 0的比特位所对应的从设备为需要转 向到的第二从设备。
此时, 主设备, 还用于若查找不到下一个置 0的比特位, 则根据链路号字 段查找在主设备中对应的链路, 将报文中的 MPLS头去除后, 将去除了 MPLS 头的报文从查找到的链路上发送出去。
以上各个设备的具体实施可参见前面实施例, 在此不再贅述。
由上可知,本实施例的通信系统中的主设备采用在接收到的原始报文上添 加 MPLS头, 由 MPLS头携带多次转向信息来实现报文在网络设备之间的多次 转向, 由于 MPLS相对于现有的 Vlan来说, 可以携带更多的信息, 而且现有的 标准协议还可以支持最多 7层的 MPLS头, 所以采用该方案, 较现有方案而言, 更为灵活方便, 扩展性更强, 可以在符合现有标准协议的基石出上, 携带更多的 多次转向信息。
需要说明的是,本领域普通技术人员可以理解实现上述实施例方法中的全 部或部分流程,是可以通过计算机程序来指令相关的硬件来完成, 所述的程序 可存储于一计算机可读取存储介质中, 该程序在执行时, 可包括如上述各方法 的实施例的流程。 其中, 所述的存储介质可为磁碟、 光盘、 只读存储记忆体 ( Read-Only Memory, ROM )或随机存储记忆体( Random Access Memory, RAM )等。
本领域普通技术人员可以理解上述实施例的各种方法中的全部或部分步 骤是可以通过程序来指令相关的硬件来完成,该程序可以存储于一计算机可读 存储介质中, 存储介质可以包括: 只读存储器、 随机存储器、 磁盘或光盘等。
以上对本发明实施例所提供的云系统分布式拒绝服务攻击防护方法以及 式进行了阐述,以上实施例的说明只是用于帮助理解本发明的方法及其核心思 想; 同时, 对于本领域的一般技术人员, 依据本发明的思想, 在具体实施方式 及应用范围上均会有改变之处, 综上, 本说明书内容不应理解为对本发明的限 制。

Claims

权 利 要 求
1、 一种报文多次转向方法, 其特征在于, 包括:
接收第一从设备发送的报文,所述报文包括携带有多次转向信息的多协议 标签交换 MPLS头, 所述多次转向信息包括多次转向标识字段, 所述多次转向 标识字段用于指示需要转向到的第二从设备;
根据多次转向标识字段确定需要转向到的第二从设备;
将报文发送给所述第二从设备。
2、 根据权利要求 1所述的方法, 其特征在于, 所述接收第一从设备发送的 报文之前还包括:
接收上游设备发送的原始报文;
在所述原始报文上添加携带有多次转向信息的 MPLS头后, 发送给第一从 设备。
3、 根据权利要求 2所述的方法, 其特征在于, 所述多次转向信息还包括链 路号字段, 所述链路号字段用于指示主设备中接收到原始报文的链路; 所述在 所述原始报文上添加携带有多次转向信息的 MPLS头后, 发送给第一从设备包 括:
将接收到原始报文的链路的标识, 添加在 MPLS头的链路号字段中; 将所有需要转向到的从设备按照预置的转向顺序标识在 MPLS头的多次转 向标识字段中, 其中, 所述预置的转向顺序用于指示所有需要转向到的从设备 被转向到的先后顺序;
按照所述预置的转向顺序将添加了所述 MPLS头的报文转向到所述第一从 设备。
4、 根据权利要求 3所述的方法, 其特征在于, 附属于所述主设备的每个从 设备对应于多次转向标识字段中的至少一个比特位,并且当所述至少一个比特 位置为第一值时, 表示需要转向到对应的从设备上;
则所述将所有需要转向到的从设备按照预置的转向顺序标识在 MPLS头的 多次转向标识字段中包括:按照预置的转向顺序确定每个从设备所对应的至少 一个比特位;将每个需要转向到的从设备所对应的至少一个比特位置为所述第 一值;
按照所述预置的转向顺序将添加了所述 MPLS头的报文转向到所述第一从 设备包括: 按照所述预置的转向顺序,从所述多次转向标识字段的一端开始查 找; 当查找到第一个第一值时, 将添加了所述 MPLS头的报文转向到所述第一 从设备, 其中, 所述第一从设备对应于所述第一个第一值所在的比特位。
5、 根据权利要求 1至 4中任一项所述的方法, 其特征在于, 所述多次转向 信息还包括链路号字段,所述链路号字段用于指示主设备中接收到原始报文的 链路,附属于所述主设备的每个从设备对应于多次转向标识字段中的至少一个 比特位, 并且当所述至少一个比特位置为第一值时,表示需要转向到对应的从 设备上; 所述根据多次转向标识字段确定需要转向到的第二从设备包括: 按照预置的转向顺序, 从所述多次转向标识字段的一端开始查找; 当查找到第一个第一值时,将查找到的第一个第一值所在的比特位置为第 二值;
继续查找下一个第一值, 若查找到了下一个第一值, 则确定所述下一个第 一值所在的比特位所对应的从设备为所述第二从设备。
6、 根据权利要求 5所述的方法, 其特征在于, 还包括: 若查找不到下一个第一值, 则确定所述链路号字段所指示的链路, 将报文
7、 一种网络设备, 其特征在于, 包括:
第一接收单元, 用于接收第一从设备发送的报文, 所述报文包括携带有多 次转向信息的多协议标签交换 MPLS头, 所述多次转向信息包括多次转向标识 字段, 所述多次转向标识字段用于指示需要转向到的从设备;
确定单元, 用于根据多次转向标识字段确定需要转向到的第二从设备; 第一发送单元, 用于将报文发送给所述第二从设备。
8、 根据权利要求 7所述的网络设备, 其特征在于, 还包括:
第二接收单元,用于在所述第一接收单元接收到第一从设备发送的报文之 前, 接收上游设备发送的原始报文;
第二发送单元, 用于在所述原始报文上添加携带有多次转向信息的 MPLS 头后, 发送给第一从设备。
9、 根据权利要求 8所述的网络设备, 其特征在于, 所述 MPLS头还包括链 路号字段, 所述链路号字段用于指示主设备中接收到原始报文的链路, 附属于 所述主设备的每个从设备对应于在多次转向标识字段中的至少一个比特位,并 且当所述至少一个比特位为第一值时,表示需要转向到对应的从设备上; 则所 述第二发送单元包括:
第一标识子单元, 用于将接收到原始报文的链路的标识, 添加在 MPLS头 的链路号字段中;
第二标识子单元,用于按照预置的转向顺序确定每个从设备所对应的至少 一个比特位,将每个需要转向到的从设备所对应的至少一个比特位均置为所述 第一值, 其中, 所述预置的转向顺序用于指示所有需要转向到的从设备被转向 到的先后顺序;
发送子单元, 用于在第一标识子单元和第二标识子单元执行完毕后,按照 所述预置的转向顺序,从所述多次转向标识字段的一端开始查找, 当查找到第 一个第一值时, 将添加了所述 MPLS头的报文转向到所述第一从设备, 其中, 所述第一从设备对应于所述第一个第一值所在的比特位。
10、 根据权利要求 9所述的网络设备, 其特征在于,
所述确定单元, 具体用于按照所述预置的转向顺序,从所述多次转向标识 字段的一端开始查找, 当查找到第一个第一值时,将查找到的第一个第一值所 在的比特位置为第二值, 继续查找下一个第一值, 若查找到了下一个第一值, 则确定所述下一个第一值所在的比特位所对应的从设备为所述第二从设备; 所述第一发送单元,还用于在所述确定单元查找不到下一个第一值时,确 定所述链路号字段所指示的链路, 将报文中的 MPLS头去除并将去除了 MPLS 头的报文从所确定的链路上发送出去。
11、 一种通信系统, 其特征在于, 包括主设备和附属于所述主设备的至少 一个从设备, 其中, 所述主设备为根据权利要求 7至 10中任一项所述的网络设 备;
从设备, 用于接收主设备发送的报文, 以及发送报文给主设备, 所述报文 包括携带有多次转向信息的多协议标签交换 MPLS头。
PCT/CN2012/072820 2011-03-31 2012-03-22 一种报文多次转向方法、装置和系统 WO2012130084A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
EP12762783.4A EP2562974B1 (en) 2011-03-31 2012-03-22 Message multiple-transfer method, device and system
US13/724,174 US8687634B2 (en) 2011-03-31 2012-12-21 Method for diverting packet multiple times, apparatus and system

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201110080393.8A CN102143081B (zh) 2011-03-31 2011-03-31 一种报文多次转向方法、装置和系统
CN201110080393.8 2011-03-31

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US13/724,174 Continuation US8687634B2 (en) 2011-03-31 2012-12-21 Method for diverting packet multiple times, apparatus and system

Publications (1)

Publication Number Publication Date
WO2012130084A1 true WO2012130084A1 (zh) 2012-10-04

Family

ID=44410316

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2012/072820 WO2012130084A1 (zh) 2011-03-31 2012-03-22 一种报文多次转向方法、装置和系统

Country Status (4)

Country Link
US (1) US8687634B2 (zh)
EP (1) EP2562974B1 (zh)
CN (1) CN102143081B (zh)
WO (1) WO2012130084A1 (zh)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102143081B (zh) 2011-03-31 2014-02-19 华为技术有限公司 一种报文多次转向方法、装置和系统
US20160057004A1 (en) * 2014-08-21 2016-02-25 Caterpillar Inc. Systems and methods for machine-to-machine ad-hoc communication
CN114697402B (zh) * 2020-12-29 2023-07-14 中移物联网有限公司 物联网协议序列化方法、装置及电子设备
CN114205263B (zh) * 2021-12-08 2023-10-13 中国信息通信研究院 用于Ether CAT网络的通信方法、系统和存储介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1822569A (zh) * 2005-02-14 2006-08-23 三星电子株式会社 用于处理多协议标记交换分组的设备和方法
EP2079189A1 (en) * 2008-01-09 2009-07-15 British Telecmmunications public limited campany MPLS function invocation scheme and related aspects
CN101568164A (zh) * 2009-06-08 2009-10-28 北京邮电大学 基于节点优先级的Ad hoc网络机会路由算法
CN101764732A (zh) * 2008-12-23 2010-06-30 华为技术有限公司 建立以太网虚拟连接的方法、网络和节点设备
CN102143081A (zh) * 2011-03-31 2011-08-03 成都市华为赛门铁克科技有限公司 一种报文多次转向方法、装置和系统

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9444785B2 (en) * 2000-06-23 2016-09-13 Cloudshield Technologies, Inc. Transparent provisioning of network access to an application
US20080002669A1 (en) * 2001-09-14 2008-01-03 O'brien Ray Packet voice gateway
DE10152011A1 (de) * 2001-10-22 2003-05-08 Siemens Ag Verfahren und Vorrichtung zur Abbildung von Netzwerk-Headern auf MPLS-Header in Bearer-Architekturen
CN101984598B (zh) * 2010-11-04 2012-11-07 成都市华为赛门铁克科技有限公司 一种报文转向的方法和深度包检测设备

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1822569A (zh) * 2005-02-14 2006-08-23 三星电子株式会社 用于处理多协议标记交换分组的设备和方法
EP2079189A1 (en) * 2008-01-09 2009-07-15 British Telecmmunications public limited campany MPLS function invocation scheme and related aspects
CN101764732A (zh) * 2008-12-23 2010-06-30 华为技术有限公司 建立以太网虚拟连接的方法、网络和节点设备
CN101568164A (zh) * 2009-06-08 2009-10-28 北京邮电大学 基于节点优先级的Ad hoc网络机会路由算法
CN102143081A (zh) * 2011-03-31 2011-08-03 成都市华为赛门铁克科技有限公司 一种报文多次转向方法、装置和系统

Non-Patent Citations (1)

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

Also Published As

Publication number Publication date
CN102143081B (zh) 2014-02-19
EP2562974A1 (en) 2013-02-27
EP2562974A4 (en) 2013-05-29
US20130114603A1 (en) 2013-05-09
CN102143081A (zh) 2011-08-03
US8687634B2 (en) 2014-04-01
EP2562974B1 (en) 2016-09-14

Similar Documents

Publication Publication Date Title
US20220014497A1 (en) Method and Device for Storing and Sending MAC Address Entry, and System
US9515868B2 (en) System and method for communication
US9130859B1 (en) Methods and apparatus for inter-virtual local area network multicast services
EP2618521B1 (en) Method, apparatus and system for link aggregation failure protection
WO2015109821A1 (zh) 一种管理业务链的方法、系统及装置
EP2993836B1 (en) Method and device for routing data message
US20150334001A1 (en) Communication system, control apparatus, and network topology management method
WO2012058988A1 (zh) 一种报文转向的方法和深度包检测设备
EP2559207B1 (en) Controlling directional asymmetricity in wide area networks
US7944924B2 (en) Handling of received implicit null packets
WO2015021881A1 (en) Packet forwarding in software defined networking
CN107968751B (zh) 一种信息处理方法及装置
WO2011103781A2 (zh) 身份标识与位置分离的实现方法、设备及数据封装方法
WO2014047784A1 (zh) 报文转发路径确定方法及网络设备、控制设备
US20210258251A1 (en) Method for Multi-Segment Flow Specifications
WO2012130084A1 (zh) 一种报文多次转向方法、装置和系统
JP6525256B2 (ja) 仮想ネットワークシステムおよび仮想ネットワーク経路設定方法
US20130250962A1 (en) Method and apparatus for label distribution
WO2012062106A1 (zh) 线性保护组隧道复用方法和隧道尾节点
CN110945847B (zh) 路径切换过程中快速恢复业务的方法、装置和系统
JP4459767B2 (ja) 通信方法及び通信ノード
EP3417601B1 (en) Handling source routed content
WO2012159316A1 (zh) 用于在网络中确定等值路径的方法、网络装置和系统
WO2015166979A1 (ja) 通信装置、制御装置、通信システム、受信パケットの処理方法、通信装置の制御方法及びプログラム
KR20070016865A (ko) Vlan의 ipc 경로 절체 시스템 및 방법

Legal Events

Date Code Title Description
REEP Request for entry into the european phase

Ref document number: 2012762783

Country of ref document: EP

WWE Wipo information: entry into national phase

Ref document number: 2012762783

Country of ref document: EP

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

Ref document number: 12762783

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE