WO2014000399A1 - 链路选择方法和装置 - Google Patents

链路选择方法和装置 Download PDF

Info

Publication number
WO2014000399A1
WO2014000399A1 PCT/CN2012/087398 CN2012087398W WO2014000399A1 WO 2014000399 A1 WO2014000399 A1 WO 2014000399A1 CN 2012087398 W CN2012087398 W CN 2012087398W WO 2014000399 A1 WO2014000399 A1 WO 2014000399A1
Authority
WO
WIPO (PCT)
Prior art keywords
link
traffic
trunk
initial
forwarding
Prior art date
Application number
PCT/CN2012/087398
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 华为技术有限公司
Publication of WO2014000399A1 publication Critical patent/WO2014000399A1/zh

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/24Multipath

Definitions

  • the present invention claims the priority of the Chinese Patent Application entitled “Link Selection Method and Apparatus", which is filed on June 28, 2012, the Chinese Patent Application No. 201210218665. This is incorporated herein by reference.
  • TECHNICAL FIELD The present invention relates to communication technologies, and in particular, to a link selection method and apparatus.
  • a plurality of core switches form a stack (English: stack) device, which is connected to an aggregation switch through a port aggregation (English: TRUNK) link.
  • the TRUNK is also called a link aggregation group.
  • TRUNK bundles multiple physical links together as a logical link, which can stack the bandwidth of multiple sets of links.
  • the TRUNK technology can implement the function of backing up multiple links in the trunk. That is, when one link in the trunk is faulty, the other links are not affected. At the same time, load balancing can be implemented between multiple links. .
  • the TRUNK link is selected, the value of the fixed packet feature area is hashed (English: hash), and then the corresponding path is selected according to the hash result. Because the packet traffic itself is uncertain, some link congestion occurs in the TRUNK, and the vacant bandwidth cannot be used on other links, that is, the hash unevenness problem. Currently, the hash unevenness becomes the link load balancing. The main problem that needs to be solved.
  • hash routing is usually performed based on static elements in a message, for example, hash routing based on one or more of a source MAC address, a destination MAC address, a source IP address, or a destination IP address.
  • the embodiments of the present invention provide a link selection method and device, which effectively solve the problem of unbalanced link load and improve the utilization of link resources.
  • a first aspect of the embodiments of the present invention provides a link selection method, including:
  • the TRUNK member traffic status table of the trunk is aggregated according to the port where the initial link is maintained. Taking the link traffic status of the initial link;
  • the packet is forwarded by selecting an optimal link from the TRUNK according to the TRUNK member traffic state table.
  • the forwarding, by using the TRUNK member traffic state table, the optimal link from the TRUNK to forward the message includes:
  • the packet is forwarded through the initial link.
  • the packet is forwarded through the link with the best link traffic state.
  • the link selection method provided by the embodiment of the present invention further includes:
  • the local router maintains the TRUNK member traffic state table of the TRUNK according to the traffic statistics of the physical port, and synchronizes the traffic statistics of the physical port to the TRUNK.
  • the other forwarding chip corresponding to the physical link so that the other forwarding chip updates the TRUNK member traffic state table that is locally maintained according to the traffic statistics of the physical port.
  • the synchronizing the traffic statistics of the physical port to other forwarding chips corresponding to other physical links in the TRUNK includes And sending, by the other forwarding chip corresponding to the other physical links in the TRUNK, a hardware synchronization message, where the hardware synchronization message carries the traffic statistics information of the physical port.
  • the synchronizing the traffic statistics of the physical port to other forwarding chips corresponding to other physical links in the TRUNK includes Sending a software synchronization message to the CPU to which the forwarding chip of the physical port belongs, and carrying the traffic statistics information of the physical port in the software synchronization message;
  • a second aspect of the embodiments of the present invention provides a link selecting apparatus, including at least one receiving port and at least one forwarding chip:
  • the receiving port is configured to receive a packet, and send the received packet to a corresponding forwarding chip;
  • the forwarding chip is configured to select an initial link according to the quintuple information of the packet;
  • the port where the initial link is maintained is aggregated with the TRUNK member traffic state table of the TRUNK, and the link traffic state of the initial link is obtained.
  • the link traffic state of the initial link does not reach the preset traffic upper limit state.
  • forwarding the packet by using the initial link when the link traffic state of the initial link reaches a preset traffic upper limit state, selecting an optimal one from the TRUNK according to the TRUNK member traffic state table.
  • the link forwards the message.
  • the forwarding chip includes:
  • a selection module configured to select an initial link according to the quintuple information of the packet received by the receiving port, and an acquiring module, configured to aggregate the TRUNK member traffic of the trunk according to the port where the initial link is locally maintained.
  • a status table where the link traffic status of the initial link is obtained;
  • a first forwarding module configured to forward the packet by using the initial link when a link traffic state of the initial link does not reach a preset traffic upper limit state
  • a second forwarding module configured to: when the link traffic state of the initial link reaches a preset traffic upper limit state, select the optimal link from the TRUNK to forward the packet according to the TRUNK member traffic state table.
  • the second forwarding module is specifically configured to: when a link traffic state of the initial link reaches a preset traffic upper limit state And forwarding, by the initial link, the packet when the link traffic state of the link other than the initial link in the TRUNK reaches a preset traffic upper limit state; or, when the initial When the link traffic state of the link reaches the preset traffic upper limit state, and the other links except the initial link do not reach the preset traffic upper limit state, the link traffic state is optimal.
  • the link forwards the message.
  • the link selecting apparatus in the embodiment of the present invention further includes:
  • a statistics module configured to obtain traffic statistics information of a physical port
  • a synchronization module configured to: if the physical port belongs to a TRUNK, update the locally maintained TRUNK member traffic state table of the TRUNK according to the traffic statistics of the physical port, and synchronize the traffic statistics of the physical port to And the other forwarding chips corresponding to the other physical links in the TRUNK, so that the other forwarding chips update the TRUNK member traffic state table that is locally maintained according to the traffic statistics information of the physical port.
  • the synchronization module is specifically configured to: if the physical port belongs to a TRUNK, update the local maintenance according to the traffic statistics information of the physical port.
  • the TRUNK member traffic state table of the TRUNK sends a hardware synchronization message to the other forwarding chips corresponding to the other physical links in the TRUNK, and the hardware synchronization message carries the traffic statistics information of the physical port.
  • the other forwarding chips update the TRUNK member traffic status table that is locally maintained according to the traffic statistics of the physical port.
  • the technical effect of the embodiment of the present invention is: first, selecting an initial link according to the quintuple information of the received packet, and obtaining the link traffic state of the initial link according to the TRUNK member traffic state table maintained locally by the switch, when the initial chain
  • the packet is forwarded directly through the initial link.
  • the TRUNK member traffic state table is used to select the most from the TRUNK. The optimal link forwards the packet.
  • Embodiment 1 is a flowchart of Embodiment 1 of a link selection method according to the present invention
  • Embodiment 2 is a flowchart of Embodiment 2 of a link selection method according to the present invention
  • FIG. 3 is a schematic diagram of a hardware synchronization process in Embodiment 2 of a link selection method according to the present invention
  • FIG. 4 is a schematic diagram of a software synchronization process in Embodiment 2 of a link selection method according to the present invention.
  • FIG. 5 is a schematic structural diagram of Embodiment 1 of a link selection apparatus according to the present invention.
  • FIG. 6 is a schematic structural diagram of Embodiment 2 of a link selection apparatus according to the present invention.
  • the technical solutions in the embodiments of the present invention are clearly and completely described in the following with reference to the accompanying drawings in the embodiments of the present invention.
  • the embodiments are a part of the embodiments of the invention, and not all of the embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present invention without creative efforts are within the scope of the present invention.
  • FIG. 1 is a flowchart of Embodiment 1 of a link selection method according to the present invention. As shown in FIG. 1 , this embodiment provides a link selection method, which may specifically include the following steps: Step 101: Receive a message, and select an initial link according to the received quintuple information of the packet.
  • the packet passes through
  • the process of selecting a line card or a forwarding chip for forwarding packets in the present embodiment is a link selection process.
  • the switch obtains the quintuple information of the packet from the packet, where the quintuple information includes the source IP address and source port of the packet.
  • the destination IP address, the destination port, and the transport layer protocol number are selected according to the quintuple information of the packet.
  • the initial link here is named to distinguish it from the selected optimal link.
  • a link is selected as the initial link through the quintuple information, and then the initial chain.
  • the optimal link is selected according to other strategies to replace the initial link.
  • the existing hash mechanism can be used to obtain the initial link.
  • the source IP address is used as the hash factor, and the initial link is obtained through the hash algorithm.
  • the source IP address and the source port are used as the hash factor, or the source IP address and destination are used.
  • the IP address is used as a hash factor.
  • Step 102 Obtain a link traffic status of the initial link according to a TRUNK member traffic state table of the TRUNK where the initial link is maintained.
  • the present embodiment introduces a TRUNK member traffic state table that is locally maintained by the switch, and the switch obtains the link traffic state of the initial link according to the TRUNK member traffic state table, where
  • the TRUNK member traffic status table is the TRUNK member traffic status table of the TRUNK where the initial link selected in step 201 is located.
  • a data center can be configured with multiple TRUNKs according to actual conditions.
  • TRUNK is a logical link, and a TRUNK can be composed of multiple physical links.
  • the TRUNK member traffic status table is used to store the link traffic status of each member belonging to the TRUNK, where the link traffic status is used to indicate the current traffic status of the link, such as the value of the traffic value carried on the link, or The occupancy rate of the link, etc.
  • the occupancy of a link is the ratio between the bandwidth that the link has been used and the maximum bandwidth of the link.
  • the link traffic status can reflect whether the member link is currently in a congested state, an idle state, or a normal state.
  • Step 103 When the link traffic state of the initial link does not reach the preset traffic upper limit state, forward the packet by using the initial link.
  • the traffic upper limit state is a threshold value that can determine the link is in a congested state, and may be the upper limit of the traffic allowed on the link or the maximum allowed rate of the link. For example, when the value of the traffic carried on the initial link is less than the preset traffic upper limit, the link traffic state of the initial link does not reach the upper traffic limit state, indicating that the initial link selected in step 201 is not currently available. Congestion, can be directly transferred through the initial link Send a message without further adjustments.
  • Step 104 When the link traffic state of the initial link reaches a preset traffic upper limit state, select the optimal link from the TRUNK to forward the packet according to the TRUNK member traffic state table.
  • the packet is forwarded by selecting an optimal link from the TRUNK according to the TRUNK member traffic state table. For example, when the value of the traffic carried on the initial link is greater than or equal to the preset traffic upper limit, it indicates that the link traffic state of the initial link has reached the upper traffic limit state.
  • the initial link is currently congested.
  • the packet is forwarded through the initial link and needs to be further adjusted. That is, the optimal link forwarding packet is selected from the TRUNK according to the TRUNK member traffic state table.
  • the TRUNK member traffic status table can reflect the link traffic status of all links in the same TRUNK.
  • the TRUNK member traffic status table maintained locally by the switch can be used to learn the idle or congested status of the physical link on other forwarding chips or line cards. Therefore, a currently idle link is selected from the TRUNK member link as the optimal link to forward the message.
  • the link traffic status of the link is the load on the link. Therefore, in this embodiment, the link load status of each physical link is obtained through the TRUNK member traffic status table, when a physical chain is used. When the road is congested, the traffic carried on the traffic can be directly transferred to other links that are in an idle state, thereby effectively solving the problem of unbalanced link load.
  • an initial link is selected according to the quintuple information of the received packet, and the link traffic state of the initial link is obtained according to the TRUNK member traffic state table maintained by the switch. If the link traffic status of the link does not reach the upper limit of the traffic, the packet is forwarded through the initial link. When the link traffic status of the initial link reaches the upper limit, the TRUNK member traffic status table is selected from the TRUNK. The optimal link forwards the packet. This embodiment effectively solves the problem of unbalanced link load and improves the utilization of link resources.
  • the steps performed by the switch in the foregoing link selection method may be specifically performed by a forwarding chip in the switch.
  • the forwarding chip receives the packet through the switch port connected to the forwarding chip, and The TRUNK member traffic status table is locally maintained by the forwarding chip.
  • the forwarding chip performs the method described in the foregoing Embodiment 1, the method may be further extended.
  • this embodiment provides another method for selecting a link, which may specifically include the following steps:
  • Step 201 Obtain traffic statistics information of the physical port.
  • the step is to obtain the traffic statistics of the physical port by the forwarding chip.
  • the hardware register inside the forwarding chip collects statistics on the traffic of the physical port, and then the hardware register collects the collected traffic statistics. Reported to the forwarding chip.
  • Each forwarding chip obtains traffic statistics information of the respective physical ports. It should be noted that the hardware registers can monitor the traffic of each physical port in real time. When the traffic of a physical port increases or decreases, the hardware register reports the updated traffic statistics to the corresponding forwarding chip.
  • Step 202 Determine whether the physical port belongs to a TRUNK. If yes, go to step 203. Otherwise, end the process.
  • TRUNK that is, the physical port is a member of a TRUNK, or a separate physical port; when it belongs to one of the TRUNKs, the subsequent step 203 is performed; when it is a separate physical port, the physical link corresponding to the physical port
  • the TRUNK member traffic state table does not need to be updated, and the physical link does not belong to the scope of load balancing in this embodiment.
  • Step 203 Update the TRUNK member traffic state table of the locally maintained TRUNK according to the traffic statistics of the physical port.
  • the physical link corresponding to the physical port is a member of the TRUNK.
  • the physical link corresponding to the physical port in the locally maintained TRUNK member traffic status table is updated according to the traffic statistics of the physical port.
  • the link traffic status of the TRUNK member traffic status table includes the link traffic status of each physical link in the trunk that is described in the physical link corresponding to the physical port.
  • Step 204 Synchronize the traffic statistics of the physical port to the forwarding chip corresponding to the other physical links in the TRUNK, so that the other forwarding chips update the local maintenance state of the TRUNK member according to the traffic statistics of the physical port. table.
  • a forwarding chip After a forwarding chip obtains the traffic statistics of a physical port, the traffic statistics are synchronized to the forwarding chip corresponding to other physical links in the TRUNK to which the physical link corresponding to the physical port belongs. Since a TRUNK is composed of a plurality of physical links, and each physical link corresponds to one physical port on a forwarding chip, each physical link in the TRUNK corresponds to each forwarding chip; in this embodiment, Different forwarding chips corresponding to different physical links in the same TRUNK are added to the same logical multicast group, and the traffic statistics of each other are synchronized in the same multicast group. Specifically, the forwarding chips can be synchronized by hardware or by software.
  • FIG. 3 is a schematic diagram of a hardware synchronization process in the second embodiment of the link selection method according to the present invention.
  • a forwarding chip obtains traffic statistics information of a physical port, it forwards to other multicast groups.
  • the chip sends a hardware synchronization message, and the traffic synchronization information is carried in the hardware synchronization message, so that the traffic statistics of the physical port are synchronized to other forwarding chips in the same multicast group, and the physical port is maintained in the multicast group.
  • FIG. 4 is a schematic diagram of a software synchronization process in the second embodiment of the link selection method according to the present invention, as shown in FIG.
  • Some do not support forwarding hardware synchronization between chips, and synchronization can be achieved by software synchronization.
  • the forwarding chip may send a software synchronization message to the CPU to which it belongs, and carry the software synchronization message in the software synchronization message.
  • the traffic statistics of the physical port In this embodiment, a CPU is usually disposed on a line card, where the CPU to which the forwarding chip belongs is the CPU in the line card where the forwarding chip is located.
  • the CPU to which the forwarding chip belongs forwards the software synchronization message to the CPU to which the other forwarding chip corresponding to the physical link in the TRUNK belongs, where the TRUNK is the physical link corresponding to the physical port that obtains the traffic statistics information. Then, the CPU of the other forwarding chip sends the software synchronization message to the respective forwarding chip, so that the traffic statistics of the physical port are forwarded to the other forwarding chips through the CPU to which the other forwarding chip belongs.
  • communication between different CPUs can be realized by communication between respective software synchronization service processes.
  • the TRUNK member traffic state table can be generated and maintained in real time in real time, that is, the foregoing steps 201-204 can be performed before step 205, or can be performed synchronously with step 205, and can also be performed in steps.
  • Step 205 Receive a packet, and select an initial link according to the received quintuple information of the packet. This step is similar to the foregoing step 101, and details are not described herein again.
  • Step 206 Obtain the link traffic status of the initial link according to the TRUNK member traffic state table of the TRUNK member where the initial link is maintained. This step is similar to the foregoing step 102, and details are not described herein.
  • Step 207 Determine whether the link traffic status of the initial link reaches a preset traffic upper limit state. If yes, go to step 208. Otherwise, go to step 210.
  • the link traffic state of the initial link After the link traffic state of the initial link is obtained through the TRUNK member traffic state table, it is determined whether the traffic state of the link reaches a preset traffic upper limit state. For example, determining whether the traffic value in the initial link is greater than a preset. The upper limit of the traffic, or whether the link occupancy rate in the initial link is greater than a preset upper limit of the occupancy rate. If yes, go to step 208. Otherwise, go to step 210.
  • Step 208 Determine whether the link traffic status of the links other than the initial link in the TRUNK reaches a preset traffic upper limit state. If yes, go to step 210. Otherwise, go to step 209.
  • the initial link When the link traffic state of the initial link reaches the preset traffic upper limit state, the initial link may have been congested. Therefore, it is necessary to consider reselecting an idle physical link from the TRUNK to which the initial link belongs. Specifically, it is determined that the link traffic status of the link other than the initial link in the trunk is up to a preset traffic upper limit state, and the other link can be obtained by forwarding the TRUNK member traffic state table maintained locally by the chip. If the link traffic status of the links other than the initial link in the trunk network reaches the preset traffic upper limit state, the link in the current trunk is likely to be congested. Even for the link Performing the adjustment will not bring about better results, but will cause resource consumption due to link adjustment, so step 210 is performed. If the link other than the initial link has a link whose traffic state does not reach the preset traffic upper limit state, step 209 is performed.
  • Step 209 Forward the packet by using a link with the best link traffic state.
  • a less idle link may be selected from the trunk to replace the initial link.
  • the link with the best link traffic state can be selected instead of the initial link forwarding packet.
  • the link with the best link traffic state can be the link with the smallest traffic value carried in the link, that is, the most idle link.
  • Step 210 Forward the packet by using the initial link.
  • the packet is directly forwarded through the initial link, and the initial link does not need to be adjusted to avoid unnecessary resources. waste. If the link traffic state of the initial link reaches the traffic upper limit state and the link traffic state of the other links in the same trunk is also in the traffic upper limit state, the packet is still forwarded through the initial link, and the initial chain does not need to be used. The road is adjusted.
  • an initial link is selected according to the quintuple information of the received packet, and the link traffic state of the initial link is obtained according to the TRUNK member traffic state table maintained locally by the forwarding chip.
  • the link traffic state of the initial link does not reach the traffic upper limit state
  • the packet is forwarded directly through the initial link.
  • the TRUNK member traffic state table is used from the TRUNK.
  • the optimal link is used to forward the packet.
  • FIG. 5 is a schematic structural diagram of Embodiment 1 of a link selection apparatus according to the present invention. As shown in FIG. 5, this embodiment provides a link selection apparatus, which may specifically perform various steps in Embodiment 1 of the foregoing method. Let me repeat.
  • the link selecting apparatus provided in this embodiment may specifically include at least one receiving port 501 and at least one forwarding chip 502.
  • the receiving port 501 is configured to receive a packet, and send the received packet to the corresponding forwarding chip 502.
  • the forwarding chip 502 is configured to select an initial link according to the quintuple information of the packet, and obtain a chain of the initial link according to the TRUNK member traffic state table of the trunk of the initial link that is locally maintained.
  • the packet is forwarded through the initial link; when the link traffic state of the initial link reaches the pre-up
  • the packet is forwarded by selecting an optimal link from the TRUNK according to the TRUNK member traffic state table.
  • FIG. 6 is a schematic structural diagram of another embodiment of a link selection apparatus according to the present invention.
  • the embodiment provides a link selection apparatus, which can specifically perform the steps in the second embodiment of the foregoing method. I won't go into details here.
  • the link selection device provided in this embodiment is based on the foregoing FIG. 5, and the forwarding chip 502 may specifically include a selection module 512, an obtaining module 522, a first forwarding module 532, and a second forwarding module 542. Only the internal module structure of one of the forwarding chips 502 is shown in FIG. 6, and other forwarding chips are similar thereto, and details are not described herein again.
  • the selection module 512 is configured to select an initial link according to the quintuple information of the message received by the receiving port 501.
  • the obtaining module 522 is configured to collect the link traffic status of the initial link according to the TRUNK member traffic state table of the TRUNK according to the port where the initial link is maintained.
  • the first forwarding module 532 is configured to forward the packet by using the initial link when the link traffic state of the initial link does not reach the preset traffic upper limit state.
  • the second forwarding module 542 is configured to: when the link traffic state of the initial link reaches a preset traffic upper limit state, select the optimal link from the TRUNK to forward the packet according to the TRUNK member traffic state table. .
  • the second forwarding module 542 in this embodiment is specifically configured to: when the link traffic state of the initial link reaches a preset traffic upper limit state, and other chains in the TRUNK except the initial link. When the link traffic status of the road reaches the preset traffic upper limit state, the packet is forwarded through the initial link. Or the second forwarding module 542 is specifically configured to: when the link traffic state of the initial link reaches a preset traffic upper limit state, and the other links except the initial link in the TRUNK do not reach the preset. In the upper traffic state, the packet is forwarded through the link with the best link traffic state.
  • the forwarding chip 502 in the link selection apparatus provided in this embodiment may further include a statistics module 552.
  • the statistics module 552 is configured to obtain traffic statistics information of the physical port.
  • the forwarding chip 502 in the link selection apparatus may further include a synchronization module 562.
  • the synchronization module 562 is configured to: if the physical port belongs to a TRUNK, update the locally maintained TRUNK member traffic state table of the TRUNK according to the traffic statistics of the physical port, and synchronize the traffic statistics of the physical port to And the other forwarding chips corresponding to the other physical links in the TRUNK, so that the other forwarding chips update the TRUNK member traffic state table that is locally maintained according to the traffic statistics information of the physical port.
  • the synchronization module 562 in this embodiment may be specifically configured to: if the physical port belongs to a TRUNK, update the locally maintained TRUNK member flow state table of the TRUNK according to the traffic statistics of the physical port,
  • the other forwarding chip corresponding to the other physical links in the TRUNK sends a hardware synchronization message, and the hardware synchronization message carries the traffic statistics information of the physical port, so that the other forwarding chips are
  • the traffic statistics of the physical port update the TRUNK member traffic status table that is maintained locally.
  • the link selection device provided in this embodiment first selects an initial link according to the quintuple information of the received packet, and obtains the link traffic status of the initial link according to the TRUNK member traffic state table maintained locally by the forwarding chip.
  • the link traffic state of the initial link does not reach the traffic upper limit state
  • the packet is forwarded directly through the initial link.
  • the TRUNK member traffic state table is used from the TRUNK.
  • the optimal link is used to forward the packet.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

本发明实施例提供一种链路选择方法和装置,方法包括:接收报文,根据接收到的报文的五元组信息选择初始链路;根据本地维护的所述初始链路所在的端口汇聚 TRUNK的 TRUNK 成员流量状态表,获取所述初始链路的链路流量状态;当所述初始链路的链路流量状态未达到预设的流量上限状态时,通过所述初始链路转发所述报文;当所述初始链路的链路流量状态达到预设的流量上限状态时,根据所述 TRUNK 成员流量状态表从所述 TRUNK 中选择最优链路转发所述报文。本发明实施例还提供了一种链路选择装置。本实施例有效解决了链路负载不均衡的问题,提高了链路资源的利用率。

Description

链路选择方法和装置 本申请要求于 2012年 6月 28日提交中国专利局、 申请号为 201210218665. 0、发明 名称为 "链路选择方法和装置"的中国专利申请的优先权, 其全部内容通过引用结合在 本申请中。 技术领域 本发明涉及通信技术, 尤其涉及一种链路选择方法和装置。 背景技术 在数据中心中, 多个核心交换机组成堆叠 (英文: stack) 设备, 其通过端口汇聚 (英文: TRUNK)链路与汇聚交换机相连, 其中, TRUNK又称为链路聚合组(英文: Link
Aggregation Group, 简称: LAG)。 TRUNK将多个物理链路捆绑在一起当作一个逻辑链 路使用, 即可以将多组链路的带宽叠加起来使用。 TRUNK技术可以实现 TRUNK内部多条 链路互为备份的功能, 即当 TRUNK中的一条链路出现故障时, 不影响其他链路的工作, 同时多条链路之间还能实现流量的负载均衡。在进行 TRUNK链路选择时, 通常对固定的 报文特征区域取值进行哈希(英文: hash)处理, 然后根据 hash结果选择相应的路径。 由于报文流量本身具有不确定性, 因此在 TRUNK中会出现某些链路拥塞, 而其他链路上 有空余带宽无法使用的情况, 即 hash不均匀问题, 目前 hash不均匀成为链路负载均衡 中需要解决的主要问题。
在现有技术中, 通常基于报文中的静态元素进行 hash选路, 例如基于源 MAC地址、 目的 MAC地址、 源 IP地址或目的 IP地址中的一个或多个进行 hash选路。
然而, 现有技术中的 hash选路方案无法有效解决链路负载不均衡的问题。 发明内容 本发明实施例提供一种链路选择方法和装置, 有效解决链路负载不均衡的问题, 提 高链路资源的利用率。
本发明实施例的第一方面提供一种链路选择方法, 包括:
接收报文, 根据接收到的所述报文的五元组信息选择初始链路;
根据本地维护的所述初始链路所在的端口汇聚 TRUNK的 TRUNK成员流量状态表, 获 取所述初始链路的链路流量状态;
当所述初始链路的链路流量状态未达到预设的流量上限状态时,通过所述初始链路 转发所述报文;
当所述初始链路的链路流量状态达到预设的流量上限状态时,根据所述 TRUNK成员 流量状态表从所述 TRUNK中选择最优链路转发所述报文。
在第一方面的第一种可能的实现方式中,所述根据所述 TRUNK成员流量状态表从所 述 TRUNK中选择最优链路转发所述报文包括:
当所述 TRUNK中除所述初始链路外的其他链路的链路流量状态均达到预设的流量上 限状态时, 通过所述初始链路转发所述报文;
当所述 TRUNK中除所述初始链路外的其他链路未均达到预设的流量上限状态时,通 过链路流量状态最佳的链路转发所述报文。
结合第一方面以及第一个方面的第一种可能的实现方式,在第二种可能的实现方式 中, 本发明实施例提供的链路选择方法还包括:
获取物理端口的流量统计信息;
若所述物理端口属于一个 TRUNK, 则根据所述物理端口的流量统计信息更新本地维 护的所述 TRUNK的 TRUNK成员流量状态表, 并将所述物理端口的流量统计信息同步到所 述 TRUNK内其他物理链路对应的其他转发芯片, 以使所述其他转发芯片根据所述物理端 口的流量统计信息更新各自本地维护的所述 TRUNK成员流量状态表。
结合第一方面的第二种可能的实现方式, 在第三种可能的实现方式中, 所述将所述 物理端口的流量统计信息同步到所述 TRUNK内其他物理链路对应的其他转发芯片包括: 向所述 TRUNK内的其他物理链路对应的其他转发芯片发送硬件同步消息,在所述硬 件同步消息中携带所述物理端口的流量统计信息。
结合第一方面的第二种可能的实现方式, 在第四种可能的实现方式中, 所述将所述 物理端口的流量统计信息同步到所述 TRUNK内其他物理链路对应的其他转发芯片包括: 向所述物理端口所在的转发芯片所属的 CPU发送软件同步消息,在所述软件同步消 息中携带所述物理端口的流量统计信息;
由所述物理端口所在的转发芯片所属的 CPU, 向所述 TRUNK内其他物理链路对应的 其他转发芯片所属的 CPU转发所述软件同步消息, 以将所述物理端口的流量统计信息分 别通过所述其他转发芯片所属的 CPU转发到所述其他转发芯片。
本发明实施例的第二方面提供一种链路选择装置,包括至少一个接收端口和至少一 个转发芯片: 所述接收端口, 用于接收报文, 并将接收的所述报文发送给相应的转发芯片; 所述转发芯片, 用于根据所述报文的五元组信息选择初始链路; 根据本地维护的所 述初始链路所在的端口汇聚 TRUNK的 TRUNK成员流量状态表, 获取所述初始链路的链路 流量状态; 当所述初始链路的链路流量状态未达到预设的流量上限状态时, 通过所述初 始链路转发所述报文; 当所述初始链路的链路流量状态达到预设的流量上限状态时, 根 据所述 TRUNK成员流量状态表从所述 TRUNK中选择最优链路转发所述报文。
在第二方面的第一种可能的实现方式中, 所述转发芯片包括:
选择模块, 用于根据所述接收端口接收到的所述报文的五元组信息选择初始链路; 获取模块,用于根据本地维护的所述初始链路所在的端口汇聚 TRUNK的 TRUNK成员 流量状态表, 获取所述初始链路的链路流量状态;
第一转发模块, 用于当所述初始链路的链路流量状态未达到预设的流量上限状态 时, 通过所述初始链路转发所述报文;
第二转发模块, 用于当所述初始链路的链路流量状态达到预设的流量上限状态时, 根据所述 TRUNK成员流量状态表从所述 TRUNK中选择最优链路转发所述报文。
结合第二方面的第一种可能的实现方式, 在第二种可能的实现方式中, 所述第二转 发模块具体用于当所述初始链路的链路流量状态达到预设的流量上限状态, 且所述 TRUNK中除所述初始链路外的其他链路的链路流量状态均达到预设的流量上限状态时, 通过所述初始链路转发所述报文; 或者, 当所述初始链路的链路流量状态达到预设的流 量上限状态, 且所述 TRUNK中除所述初始链路外的其他链路未均达到预设的流量上限状 态时, 通过链路流量状态最佳的链路转发所述报文。
结合第二方面的第一种可能的实现方式以及第二方面的第二种可能的实现方式,在 第三种实现方式中, 本发明实施例中的链路选择装置还包括:
统计模块, 用于获取物理端口的流量统计信息;
同步模块, 用于若所述物理端口属于一个 TRUNK, 则根据所述物理端口的流量统计 信息更新本地维护的所述 TRUNK的 TRUNK成员流量状态表, 并将所述物理端口的流量统 计信息同步到所述 TRUNK内其他物理链路对应的其他转发芯片, 以使所述其他转发芯片 根据所述物理端口的流量统计信息更新各自本地维护的所述 TRUNK成员流量状态表。
结合第二方面的第三种实现方式, 在第四种实现方式中, 所述同步模块具体用于若 所述物理端口属于一个 TRUNK, 则根据所述物理端口的流量统计信息更新本地维护的所 述 TRUNK的 TRUNK成员流量状态表, 向所述 TRUNK内其他物理链路对应的其他转发芯片 发送硬件同步消息, 在所述硬件同步消息中携带所述物理端口的流量统计信息, 以使所 述其他转发芯片根据所述物理端口的流量统计信息更新各自本地维护的所述 TRUNK成员 流量状态表。
本发明实施例的技术效果是: 先根据接收的报文的五元组信息选择一个初始链路, 根据交换机本地维护的 TRUNK成员流量状态表, 获取初始链路的链路流量状态, 当初始 链路的链路流量状态未达到流量上限状态时, 直接通过该初始链路转发报文, 当初始链 路的链路流量状态达到流量上限状态时,根据 TRUNK成员流量状态表从该 TRUNK中选择 最优链路转发该报文; 本实施例有效解决了链路负载不均衡的问题, 提高了链路资源的 利用率。 附图说明 为了更清楚地说明本发明实施例或现有技术中的技术方案, 下面将对实施例或现有 技术描述中所需要使用的附图作一简单地介绍, 显而易见地, 下面描述中的附图是本发 明的一些实施例, 对于本领域普通技术人员来讲, 在不付出创造性劳动性的前提下, 还 可以根据这些附图获得其他的附图。
图 1为本发明链路选择方法实施例一的流程图;
图 2为本发明链路选择方法实施例二的流程图;
图 3为本发明链路选择方法实施例二中硬件同步过程示意图;
图 4为本发明链路选择方法实施例二中软件同步过程示意图;
图 5为本发明链路选择装置实施例一的结构示意图;
图 6为本发明链路选择装置实施例二的结构示意图。 具体实施方式 为使本发明实施例的目的、 技术方案和优点更加清楚, 下面将结合本发明实施例中 的附图, 对本发明实施例中的技术方案进行清楚、 完整地描述, 显然, 所描述的实施例 是本发明一部分实施例, 而不是全部的实施例。 基于本发明中的实施例, 本领域普通技 术人员在没有作出创造性劳动前提下所获得的所有其他实施例, 都属于本发明保护的范 围。
图 1为本发明链路选择方法实施例一的流程图, 如图 1所示, 本实施例提供了一种 链路选择方法, 可以具体包括如下步骤: 步骤 101, 接收报文, 根据接收到的所述报文的五元组信息选择初始链路。
在本实施例中, 当数据中心中的服务器通过交换机向 IP骨干网 (英文: Backbone) 中的网络设备发送报文, 或者 IP Backbone中的网络设备通过交换机向服务器发送报文 时,报文经过交换机中的各线卡(英文: Line Card)或转发芯片(英文: forwarding chip) 进行转发, 本实施例中选择转发报文的线卡或转发芯片的过程为链路选择过程。 本步骤 中, 当交换机接收到需要转发的报文后, 从该报文中获取该报文的五元组信息, 此处的 五元组信息可以包括该报文的源 IP地址、 源端口、 目的 IP地址、 目的端口以及传输层 协议号, 根据该报文的五元组信息选择转发该报文的初始链路。 此处的初始链路是为了 与后续选择的最优链路相区别而命名的, 其并不存在特定的含义, 即先通过五元组信息 选择一条链路作为初始链路, 后续当初始链路不满足预设的条件时, 再根据其他策略选 择最优链路来代替该初始链路。 具体可以采用现有的 hash机制来获取初始链路, 例如 以源 IP地址作为 hash因子, 通过 hash算法得到初始链路; 或者以源 IP地址和源端口 作为 hash因子, 或者以源 IP地址和目的 IP地址作为 hash因子等。
步骤 102, 根据本地维护的所述初始链路所在的 TRUNK的 TRUNK成员流量状态表, 获取所述初始链路的链路流量状态。
在利用现有的 hash机制获取到初始链路后,本实施例引入交换机本地维护的 TRUNK 成员流量状态表,交换机根据该 TRUNK成员流量状态表获取该初始链路的链路流量状态, 此处的 TRUNK成员流量状态表为步骤 201选择的初始链路所在的 TRUNK的 TRUNK成员流 量状态表。 在本实施例中, 一个数据中心可以根据实际情况设置多条 TRUNK, TRUNK为 逻辑链路, 一条 TRUNK可以由多条物理链路组成。 TRUNK成员流量状态表用于存储属于 该 TRUNK的各个成员的链路流量状态, 其中, 链路流量状态用于指示链路当前的流量状 态, 如该链路上已承载的流量值的大小, 或者该链路的占用率等。 链路的占用率是指该 链路已经被使用的带宽和链路最大带宽之间的比值。通过链路流量状态可以反映各成员 链路当前处于拥塞状态, 空闲状态, 还是正常状态。
步骤 103, 当所述初始链路的链路流量状态未达到预设的流量上限状态时, 通过所 述初始链路转发所述报文。
当获取到的初始链路的链路流量状态未达到预设的流量上限状态时,直接通过该初 始链路转发所述报文。 该流量上限状态是指能够确定链路处于拥塞状态的阈值, 可以是 该链路上允许承载的流量上限值, 也可以是该链路允许的最大占用率。 如当初始链路上 已承载的流量值小于预设的流量上限值时,表明该初始链路的链路流量状态未达到流量 上限状态, 此时表明步骤 201选出的初始链路当前未拥塞, 可以直接通过该初始链路转 发报文, 无需对其进行进一步调整。
步骤 104, 当所述初始链路的链路流量状态达到预设的流量上限状态时, 根据所述 TRUNK成员流量状态表从所述 TRUNK中选择最优链路转发所述报文。
当获取到的初始链路的链路流量状态已达到预设的流量上限状态时, 根据所述 TRUNK成员流量状态表从所述 TRUNK中选择最优链路转发所述报文。 例如, 当初始链路 上已承载的流量值大于或等于预设的流量上限值时,表明该初始链路的链路流量状态已 达到流量上限状态, 该初始链路当前已拥塞, 则不能再通过该初始链路转发报文, 需要 进行进一步调整, 即根据 TRUNK成员流量状态表从 TRUNK中选择最优链路转发报文。 由 于 TRUNK成员流量状态表可以反映同一个 TRUNK内所有链路的链路流量状态, 从而通过 交换机本地维护的 TRUNK成员流量状态表可以获知其他转发芯片或线卡上的物理链路的 空闲或拥塞情况, 从而从 TRUNK成员链路中选出一个当前较空闲的链路作为最优链路转 发该报文。 本实施例中链路的链路流量状态即为链路上的负载情况, 由此可见, 本实施 例通过 TRUNK成员流量状态表来获取各物理链路的链路负载情况, 当某条物理链路拥塞 时, 可以直接将其上承载的流量转到其他处于空闲状态的链路上, 从而有效解决了链路 负载不均衡的问题。
本实施例提供的链路选择方法, 先根据接收的报文的五元组信息选择一个初始链 路, 根据交换机本地维护的 TRUNK成员流量状态表, 获取初始链路的链路流量状态, 当 初始链路的链路流量状态未达到流量上限状态时, 直接通过该初始链路转发报文, 当初 始链路的链路流量状态达到流量上限状态时,根据 TRUNK成员流量状态表从该 TRUNK中 选择最优链路转发该报文; 本实施例有效解决了链路负载不均衡的问题, 提高了链路资 源的利用率。
本发明实施例一上述的链路选择方法中由交换机执行的步骤具体可以由交换机中 的转发芯片来执行, 此种情况下, 转发芯片通过与该转发芯片连接的交换机端口来接收 报文, 并且, 所述 TRUNK成员流量状态表由所述转发芯片本地维护。 进一步地, 当转发 芯片执行上述实施例一所述的方法时, 所述方法还可以进一步扩展。 如图 2所示, 本实 施例提供了另一种链路选择方法, 可以具体包括如下步骤:
步骤 201, 获取物理端口的流量统计信息。
在本实施例中, 本步骤为转发芯片获取物理端口的流量统计信息, 具体来说, 所述 转发芯片内部的硬件寄存器对物理端口的流量进行统计,然后硬件寄存器将统计获取到 的流量统计信息上报给所述转发芯片。 其中, 每个转发芯片分别获取各自的物理端口的 流量统计信息。 需要指出的是, 硬件寄存器可以对各物理端口的流量进行实时监控, 当 某个物理端口的流量增加或减少时,硬件寄存器将更新后的流量统计信息上报给相应的 转发芯片。
步骤 202, 判断物理端口是否属于一个 TRUNK, 如果是, 则执行步骤 203, 否则结束 本流程。
当获取到每个物理端口的流量统计信息后, 先判断该物理端口是否属于其中一个
TRUNK, 即判断该物理端口为一个 TRUNK的成员, 还是一个单独的物理端口; 当其属于 其中一个 TRUNK时, 执行后续步骤 203 ; 当其为单独的物理端口时, 该物理端口对应的 物理链路不属于之前设置的任一 TRUNK, 则无需更新 TRUNK成员流量状态表, 该物理链 路不属于本实施例负载均衡的范畴。
步骤 203, 根据物理端口的流量统计信息更新本地维护的 TRUNK的 TRUNK成员流量 状态表。
当物理端口属于其中一个 TRUNK时,表明物理端口对应的物理链路为该 TRUNK的成 员,则根据该物理端口的流量统计信息更新本地维护的 TRUNK成员流量状态表中该物理 端口对应的物理链路的链路流量状态, 该 TRUNK成员流量状态表包括该物理端口对应的 物理链路所述的 TRUNK内各物理链路的链路流量状态。
步骤 204, 将所述物理端口的流量统计信息同步到 TRUNK内的其他物理链路所对应 的转发芯片, 以使其他转发芯片根据所述物理端口的流量统计信息更新各自本地维护的 TRUNK成员流量状态表。
在一个转发芯片获取到其某个物理端口的流量统计信息后,将该流量统计信息同步 到该物理端口对应的物理链路所属的 TRUNK内其他物理链路所对应的转发芯片。 由于一 个 TRUNK由多条物理链路构成, 而每条物理链路对应一个转发芯片上的一个物理端口, 则 TRUNK内的各物理链路与各转发芯片相对应; 在本实施例中, 通过将同一 TRUNK内不 同物理链路对应的不同转发芯片加入到同一个逻辑组播组中, 定时在同一个组播组中同 步彼此的流量统计信息。 具体地, 转发芯片间可以通过硬件的方式同步, 也可以通过软 件的方式同步。
图 3为本发明链路选择方法实施例二中硬件同步过程示意图, 如图 3所示, 当某个 转发芯片获取到其某个物理端口的流量统计信息后, 向组播组内的其他转发芯片发送硬 件同步消息, 在该硬件同步消息中携带该流量统计信息, 从而将该物理端口的流量统计 信息同步到同一组播组内的其他转发芯片,在该组播组内维护了该物理端口对应的物理 链路所属的 TRUNK的 TRUNK成员流量状态表。
图 4为本发明链路选择方法实施例二中软件同步过程示意图, 如图 4所示, 对于有 些不支持转发芯片间硬件同步的情况,可以通过软件同步的方式来实现同步。具体来说, 在进行流量统计信息的同步时, 当转发芯片通过其物理端口获取到流量统计信息后, 该 转发芯片可以向其自身所属的 CPU发送软件同步消息,在该软件同步消息中携带所述物 理端口的流量统计信息。 在本实施例中, 通常在一个线卡上设置有一个 CPU, 此处转发 芯片所属的 CPU为该转发芯片所在的线卡中的 CPU。再由该转发芯片所属的 CPU,向 TRUNK 内其他物理链路对应的其他转发芯片所属的 CPU转发该软件同步消息,此处的 TRUNK为 获取该流量统计信息的该物理端口对应的物理链路所属的 TRUNK, 然后, 其他转发芯片 所属的 CPU再将该软件同步消息下发到各自的转发芯片上, 从而将物理端口的流量统计 信息分别通过其他转发芯片所属的 CPU转发到所述其他转发芯片。 其中, 不同 CPU之间 的通信可以通过各自的软件同步服务进程之间的通信来实现。
具体地, 本实施例可以实时对 TRUNK成员流量状态表进行实时生成和维护, 即上述 步骤 201-204的可以在步骤 205之前执行, 也可以与步骤 205同步执行, 还可以在步骤
205之后的任一时间点执行。
步骤 205, 接收报文, 根据接收到的所述报文的五元组信息选择初始链路, 本步骤 与上述步骤 101类似, 此处不再赘述。
步骤 206, 根据本地维护的初始链路所在的 TRUNK的 TRUNK成员流量状态表, 获取 所述初始链路的链路流量状态, 本步骤与上述步骤 102类似, 此处不再赘述。
步骤 207, 判断初始链路的链路流量状态是否达到预设的流量上限状态, 如果是, 则执行步骤 208, 否则执行步骤 210。
在通过 TRUNK成员流量状态表获取到初始链路的链路流量状态后,先判断该链路流 量状态是否达到预设的流量上限状态, 例如, 判断该初始链路中的流量值是否大于预设 的流量上限值, 或者判断该初始链路中的链路占用率是否大于预设的占用率上限值, 如 果是, 则执行步骤 208, 否则执行步骤 210。
步骤 208, 判断所述 TRUNK中除初始链路外的其他链路的链路流量状态是否均达到 预设的流量上限状态, 如果是, 则执行步骤 210, 否则执行步骤 209。
当初始链路的链路流量状态达到预设的流量上限状态时, 该初始链路当前可能已经 出现拥塞, 则需要考虑从该初始链路所属的 TRUNK中重新选择一条空闲的物理链路。 具 体为继续判断该 TRUNK中除该初始链路外的其他链路的链路流量状态是否均达到预设的 流量上限状态, 具体可以通过转发芯片本地维护的 TRUNK成员流量状态表来获取其他链 路的链路流量状态, 如果该 TRUNK中除该初始链路外的其他链路的链路流量状态均达到 预设的流量上限状态, 则表明当前 TRUNK中各链路均已可能出现拥塞, 此时即使对链路 进行调整也不会带来更好的效果, 反而会因链路调整引起资源消耗, 因此执行步骤 210。 如果该 TRUNK中除该初始链路外的其他链路中存在链路流量状态未达到预设的流量上限 状态的链路, 则执行步骤 209。
步骤 209, 通过链路流量状态最佳的链路转发所述报文。
如果 TRUNK中除该初始链路外的其他链路中存在链路流量状态未达到预设的流量上 限状态的链路, 则可以从该 TRUNK中选择一条较空闲的链路来代替初始链路, 具体可以 选择当前链路流量状态最佳的链路代替初始链路转发报文。此处的链路流量状态最佳的 链路可以为链路中承载的流量值最小的链路, 也即最空闲的链路。
步骤 210, 通过所述初始链路转发所述报文。
如果初始链路的链路流量状态未达到流量上限状态, 表明该初始链路当前比较空 闲, 则直接通过该初始链路转发报文, 无需对该初始链路进行调整, 以免造成不必要的 资源浪费。 如果初始链路的链路流量状态达到流量上限状态, 且同一 TRUNK中的其他链 路的链路流量状态也均达到流量上限状态, 则仍通过该初始链路转发报文, 无需对该初 始链路进行调整。
本实施例提供的链路选择方法, 先根据接收的报文的五元组信息选择一个初始链 路, 根据转发芯片本地维护的 TRUNK成员流量状态表, 获取初始链路的链路流量状态, 当初始链路的链路流量状态未达到流量上限状态时, 直接通过该初始链路转发报文, 当 初始链路的链路流量状态达到流量上限状态时, 根据 TRUNK成员流量状态表从该 TRUNK 中选择最优链路转发该报文; 本实施例有效解决了链路负载不均衡的问题, 提高了链路 资源的利用率。
本领域普通技术人员可以理解: 实现上述各方法实施例的全部或部分步骤可以通过 程序指令相关的硬件来完成。 前述的程序可以存储于一计算机可读取存储介质中。 该程 序在执行时, 执行包括上述各方法实施例的步骤; 而前述的存储介质包括: R0M、 RAM, 磁碟或者光盘等各种可以存储程序代码的介质。
图 5为本发明链路选择装置实施例一的结构示意图, 如图 5所示, 本实施例提供了 一种链路选择装置, 可以具体执行上述方法实施例一中的各个步骤, 此处不再赘述。 本 实施例提供的链路选择装置可以具体包括至少一个接收端口 501 和至少一个转发芯片 502。
其中, 所述接收端口 501用于接收报文, 并将接收的所述报文发送给相应的转发芯 片 502。 转发芯片 502用于根据所述报文的五元组信息选择初始链路; 根据本地维护的 所述初始链路所在的端口汇聚 TRUNK的 TRUNK成员流量状态表, 获取所述初始链路的链 路流量状态; 当所述初始链路的链路流量状态未达到预设的流量上限状态时, 通过所述 初始链路转发所述报文; 当所述初始链路的链路流量状态达到预设的流量上限状态时, 根据所述 TRUNK成员流量状态表从所述 TRUNK中选择最优链路转发所述报文。
图 6为本发明另一种链路选择装置实施例的结构示意图, 如图 6所示, 本实施例提 供了一种链路选择装置,可以具体执行上述方法实施例二中的各个步骤,此处不再赘述。 本实施例提供的链路选择装置在上述图 5所示的基础之上,转发芯片 502可以具体包括 选择模块 512、获取模块 522、第一转发模块 532和第二转发模块 542。 图 6中仅示出了 其中一个转发芯片 502的内部模块结构, 其他转发芯片与其类似, 此处不再赘述。
其中,选择模块 512用于根据接收端口 501接收到的报文的五元组信息选择初始链 路。获取模块 522用于根据本地维护的所述初始链路所在的端口汇聚 TRUNK的 TRUNK成 员流量状态表, 获取所述初始链路的链路流量状态。 第一转发模块 532用于当所述初始 链路的链路流量状态未达到预设的流量上限状态时, 通过所述初始链路转发所述报文。 第二转发模块 542用于当所述初始链路的链路流量状态达到预设的流量上限状态时,根 据所述 TRUNK成员流量状态表从所述 TRUNK中选择最优链路转发所述报文。
具体地,本实施例中的第二转发模块 542具体用于当所述初始链路的链路流量状态 达到预设的流量上限状态, 且所述 TRUNK中除所述初始链路外的其他链路的链路流量状 态均达到预设的流量上限状态时, 通过所述初始链路转发所述报文。 或者, 第二转发模 块 542 具体用于当所述初始链路的链路流量状态达到预设的流量上限状态, 且所述 TRUNK中除所述初始链路外的其他链路未均达到预设的流量上限状态时, 通过链路流量 状态最佳的链路转发所述报文。
进一步地, 本实施例提供的链路选择装置中的转发芯片 502 还可以包括统计模块 552。 其中, 统计模块 552用于获取物理端口的流量统计信息。
进一步地, 本实施例提供的链路选择装置中的转发芯片 502 还可以包括同步模块 562。同步模块 562用于若所述物理端口属于一个 TRUNK,则根据所述物理端口的流量统 计信息更新本地维护的所述 TRUNK的 TRUNK成员流量状态表, 并将所述物理端口的流量 统计信息同步到所述 TRUNK内其他物理链路对应的其他转发芯片, 以使所述其他转发芯 片根据所述物理端口的流量统计信息更新各自本地维护的所述 TRUNK成员流量状态表。
更进一步地, 本实施例中的同步模块 562 可以具体用于若所述物理端口属于一个 TRUNK, 则根据所述物理端口的流量统计信息更新本地维护的所述 TRUNK的 TRUNK成员 流量状态表, 向所述 TRUNK内其他物理链路对应的其他转发芯片发送硬件同步消息, 在 所述硬件同步消息中携带所述物理端口的流量统计信息, 以使所述其他转发芯片根据所 述物理端口的流量统计信息更新各自本地维护的所述 TRUNK成员流量状态表。
本实施例提供的链路选择装置, 先根据接收的报文的五元组信息选择一个初始链 路, 根据转发芯片本地维护的 TRUNK成员流量状态表, 获取初始链路的链路流量状态, 当初始链路的链路流量状态未达到流量上限状态时, 直接通过该初始链路转发报文, 当 初始链路的链路流量状态达到流量上限状态时, 根据 TRUNK成员流量状态表从该 TRUNK 中选择最优链路转发该报文; 本实施例有效解决了链路负载不均衡的问题, 提高了链路 资源的利用率。
最后应说明的是: 以上各实施例仅用以说明本发明的技术方案, 而非对其限制; 尽 管参照前述各实施例对本发明进行了详细的说明, 本领域的普通技术人员应当理解: 其 依然可以对前述各实施例所记载的技术方案进行修改, 或者对其中部分或者全部技术特 征进行等同替换; 而这些修改或者替换, 并不使相应技术方案的本质脱离本发明各实施 例技术方案的范围。

Claims

权利要求
1、 一种链路选择方法, 其特征在于, 包括:
接收报文, 根据接收到的所述报文的五元组信息选择初始链路;
根据本地维护的所述初始链路所在的端口汇聚 TRUNK的 TRUNK成员流量状态表, 获 取所述初始链路的链路流量状态;
当所述初始链路的链路流量状态未达到预设的流量上限状态时,通过所述初始链路 转发所述报文;
当所述初始链路的链路流量状态达到预设的流量上限状态时,根据所述 TRUNK成员 流量状态表从所述 TRUNK中选择最优链路转发所述报文。
2、 根据权利要求 1所述的方法, 其特征在于, 所述根据所述 TRUNK成员流量状态 表从所述 TRUNK中选择最优链路转发所述报文包括:
当所述 TRUNK中除所述初始链路外的其他链路的链路流量状态均达到预设的流量上 限状态时, 通过所述初始链路转发所述报文;
当所述 TRUNK中除所述初始链路外的其他链路未均达到预设的流量上限状态时,通 过链路流量状态最佳的链路转发所述报文。
3、 根据权利要求 1或 2所述的方法, 其特征在于, 还包括:
获取物理端口的流量统计信息;
若所述物理端口属于一个 TRUNK, 则根据所述物理端口的流量统计信息更新本地维 护的所述 TRUNK的 TRUNK成员流量状态表, 并将所述物理端口的流量统计信息同步到所 述 TRUNK内其他物理链路对应的其他转发芯片, 以使所述其他转发芯片根据所述物理端 口的流量统计信息更新各自本地维护的所述 TRUNK成员流量状态表。
4、 根据权利要求 3所述的方法, 其特征在于, 所述将所述物理端口的流量统计信 息同步到所述 TRUNK内其他物理链路对应的其他转发芯片包括:
向所述 TRUNK内的其他物理链路对应的其他转发芯片发送硬件同步消息,在所述硬 件同步消息中携带所述物理端口的流量统计信息。
5、 根据权利要求 3所述的方法, 其特征在于, 所述将所述物理端口的流量统计信 息同步到所述 TRUNK内其他物理链路对应的其他转发芯片包括:
向所述物理端口所在的转发芯片所属的 CPU发送软件同步消息,在所述软件同步消 息中携带所述物理端口的流量统计信息;
由所述物理端口所在的转发芯片所属的 CPU, 向所述 TRUNK内其他物理链路对应的 其他转发芯片所属的 CPU转发所述软件同步消息, 以将所述物理端口的流量统计信息分 别通过所述其他转发芯片所属的 CPU转发到所述其他转发芯片。
6、 一种链路选择装置, 其特征在于, 包括至少一个接收端口和至少一个转发芯片: 所述接收端口, 用于接收报文, 并将接收的所述报文发送给相应的转发芯片; 所述转发芯片, 用于根据所述报文的五元组信息选择初始链路; 根据本地维护的所 述初始链路所在的端口汇聚 TRUNK的 TRUNK成员流量状态表, 获取所述初始链路的链路 流量状态; 当所述初始链路的链路流量状态未达到预设的流量上限状态时, 通过所述初 始链路转发所述报文; 当所述初始链路的链路流量状态达到预设的流量上限状态时, 根 据所述 TRUNK成员流量状态表从所述 TRUNK中选择最优链路转发所述报文。
7、 根据权利要求 6所述的装置, 所述转发芯片包括:
选择模块, 用于根据所述接收端口接收到的所述报文的五元组信息选择初始链路; 获取模块,用于根据本地维护的所述初始链路所在的端口汇聚 TRUNK的 TRUNK成员 流量状态表, 获取所述初始链路的链路流量状态;
第一转发模块, 用于当所述初始链路的链路流量状态未达到预设的流量上限状态 时, 通过所述初始链路转发所述报文;
第二转发模块, 用于当所述初始链路的链路流量状态达到预设的流量上限状态时, 根据所述 TRUNK成员流量状态表从所述 TRUNK中选择最优链路转发所述报文。
8、 根据权利要求 7所述的装置, 其特征在于, 所述第二转发模块具体用于当所述 初始链路的链路流量状态达到预设的流量上限状态, 且所述 TRUNK中除所述初始链路外 的其他链路的链路流量状态均达到预设的流量上限状态时,通过所述初始链路转发所述 报文; 或者, 当所述初始链路的链路流量状态达到预设的流量上限状态, 且所述 TRUNK 中除所述初始链路外的其他链路未均达到预设的流量上限状态时,通过链路流量状态最 佳的链路转发所述报文。
9、 根据权利要求 7或 8所述的装置, 其特征在于, 还包括:
统计模块, 用于获取物理端口的流量统计信息;
同步模块, 用于若所述物理端口属于一个 TRUNK, 则根据所述物理端口的流量统计 信息更新本地维护的所述 TRUNK的 TRUNK成员流量状态表, 并将所述物理端口的流量统 计信息同步到所述 TRUNK内其他物理链路对应的其他转发芯片, 以使所述其他转发芯片 根据所述物理端口的流量统计信息更新各自本地维护的所述 TRUNK成员流量状态表。
10、 根据权利要求 9所述的装置, 其特征在于, 所述同步模块具体用于若所述物理 端口属于一个 TRUNK, 则根据所述物理端口的流量统计信息更新本地维护的所述 TRUNK的 TRUNK成员流量状态表, 向所述 TRUNK内其他物理链路对应的其他转发芯片发送硬件同步 消息, 在所述硬件同步消息中携带所述物理端口的流量统计信息, 以使所述其他转发芯 片根据所述物理端口的流量统计信息更新各自本地维护的所述 TRUNK成员流量状态表。
PCT/CN2012/087398 2012-06-28 2012-12-25 链路选择方法和装置 WO2014000399A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201210218665.0A CN102761479B (zh) 2012-06-28 2012-06-28 链路选择方法和装置
CN201210218665.0 2012-06-28

Publications (1)

Publication Number Publication Date
WO2014000399A1 true WO2014000399A1 (zh) 2014-01-03

Family

ID=47055805

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2012/087398 WO2014000399A1 (zh) 2012-06-28 2012-12-25 链路选择方法和装置

Country Status (2)

Country Link
CN (1) CN102761479B (zh)
WO (1) WO2014000399A1 (zh)

Families Citing this family (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102761479B (zh) * 2012-06-28 2015-09-09 华为技术有限公司 链路选择方法和装置
WO2014000219A1 (zh) 2012-06-28 2014-01-03 华为技术有限公司 拥塞状态上报方法及接入网设备
CN103401801A (zh) * 2013-08-07 2013-11-20 盛科网络(苏州)有限公司 动态负载均衡的实现方法及装置
CN104135445B (zh) * 2014-07-29 2017-12-19 迈普通信技术股份有限公司 一种基于流的链路汇聚负载均衡的方法及装置
CN104580002B (zh) * 2015-01-14 2017-07-28 盛科网络(苏州)有限公司 大流负载均衡转发方法及装置
CN107154861B (zh) * 2016-03-02 2019-11-29 华为技术有限公司 一种堆叠系统的数据传输方法及装置
CN106612218A (zh) * 2017-01-01 2017-05-03 国云科技股份有限公司 一种虚拟访问入口数据包的地区区域特征提取方法
CN107018088B (zh) * 2017-03-06 2020-03-17 北京安博通科技股份有限公司 传输链路选择方法及装置
CN107623640A (zh) * 2017-11-07 2018-01-23 北京锐安科技有限公司 一种增强哈希算法的方法以及装置
CN107864094B (zh) * 2017-11-15 2020-08-18 新华三技术有限公司 一种流量选路方法、装置和机器可读存储介质
BR112022015508A2 (pt) * 2020-02-07 2022-10-11 Huawei Tech Co Ltd Método e aparelho para determinação de enlace para encaminhamento de fluxo de serviço
CN112702277B (zh) * 2020-12-15 2023-01-10 锐捷网络股份有限公司 一种负载均衡配置优化的方法和装置
CN113347230B (zh) * 2021-05-13 2022-09-06 长沙星融元数据技术有限公司 基于可编程交换机的负载均衡方法、装置、设备及介质
CN113938519A (zh) * 2021-11-11 2022-01-14 深圳市风云实业有限公司 一种基于软硬件结合的网络流量负载均衡方法及系统

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101547154A (zh) * 2009-05-06 2009-09-30 烽火通信科技股份有限公司 一种trunk分发方法
CN101729425A (zh) * 2009-12-22 2010-06-09 杭州华三通信技术有限公司 Vrrp组网中流量发送的方法及设备
CN101729424A (zh) * 2009-12-16 2010-06-09 杭州华三通信技术有限公司 一种流量转发的方法、设备和系统
CN102065004A (zh) * 2009-11-12 2011-05-18 株式会社日立制作所 具有数据包分配功能的装置及数据包分配方法
CN102325124A (zh) * 2011-05-23 2012-01-18 北京网康科技有限公司 一种支持引流功能的应用识别设备及方法
CN102761479A (zh) * 2012-06-28 2012-10-31 华为技术有限公司 链路选择方法和装置

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101547154A (zh) * 2009-05-06 2009-09-30 烽火通信科技股份有限公司 一种trunk分发方法
CN102065004A (zh) * 2009-11-12 2011-05-18 株式会社日立制作所 具有数据包分配功能的装置及数据包分配方法
CN101729424A (zh) * 2009-12-16 2010-06-09 杭州华三通信技术有限公司 一种流量转发的方法、设备和系统
CN101729425A (zh) * 2009-12-22 2010-06-09 杭州华三通信技术有限公司 Vrrp组网中流量发送的方法及设备
CN102325124A (zh) * 2011-05-23 2012-01-18 北京网康科技有限公司 一种支持引流功能的应用识别设备及方法
CN102761479A (zh) * 2012-06-28 2012-10-31 华为技术有限公司 链路选择方法和装置

Also Published As

Publication number Publication date
CN102761479A (zh) 2012-10-31
CN102761479B (zh) 2015-09-09

Similar Documents

Publication Publication Date Title
WO2014000399A1 (zh) 链路选择方法和装置
JP7417825B2 (ja) スライスベースルーティング
KR101989333B1 (ko) 소프트웨어 정의 네트워킹에서의 데이터 전달 방법, 기기 및 시스템
US8427958B2 (en) Dynamic latency-based rerouting
KR101317969B1 (ko) 링크 애그리게이션 방법 및 노드
US9407503B2 (en) Control apparatus, communication system, communication method, and program
US10404773B2 (en) Distributed cluster processing system and packet processing method thereof
JP5372615B2 (ja) パケット転送システム、網管理装置、及び、エッジノード
JP2014511091A (ja) Wanipバックボーンのための凝縮されたコアエネルギー効率の高いアーキテクチャ
CN104756451A (zh) 用于lag接口上网络流的动态负载平衡的方法
JP7313480B2 (ja) スライスベースネットワークにおける輻輳回避
WO2014180332A1 (zh) 通用路由方法及系统
Cui et al. Difs: Distributed flow scheduling for adaptive routing in hierarchical data center networks
JP2011160363A (ja) コンピュータシステム、コントローラ、スイッチ、及び通信方法
CN103067291A (zh) 一种上下行链路关联的方法和装置
KR20150007623A (ko) 패킷 전달 시스템에서의 보호 절체 방법 및 장치
WO2010135987A1 (zh) 链路聚合方法及装置
WO2014090083A1 (zh) 分布式弹性网络互连的业务承载方法及装置
CN104620637B (zh) 用于标签交换网络中的移动性管理的方法和系统
CN112350949A (zh) 软件定义网络中基于流调度的重路由拥塞控制方法及系统
WO2017012471A1 (zh) 负载均衡处理方法及装置
US9866456B2 (en) System and method for network health and management
JP5534033B2 (ja) 通信システム、ノード、パケット転送方法およびプログラム
WO2014048128A1 (zh) 环网中点到多点业务的保护方法及环网中的上环节点
JPWO2013176262A1 (ja) パケット転送システム、制御装置、パケット転送方法及びプログラム

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: 12880057

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 12880057

Country of ref document: EP

Kind code of ref document: A1