WO2022022251A1 - 流量限速方法、相关网络设备和存储介质 - Google Patents

流量限速方法、相关网络设备和存储介质 Download PDF

Info

Publication number
WO2022022251A1
WO2022022251A1 PCT/CN2021/105133 CN2021105133W WO2022022251A1 WO 2022022251 A1 WO2022022251 A1 WO 2022022251A1 CN 2021105133 W CN2021105133 W CN 2021105133W WO 2022022251 A1 WO2022022251 A1 WO 2022022251A1
Authority
WO
WIPO (PCT)
Prior art keywords
interface
network device
bandwidth
message
traffic
Prior art date
Application number
PCT/CN2021/105133
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 EP21849295.7A priority Critical patent/EP4181434A4/en
Publication of WO2022022251A1 publication Critical patent/WO2022022251A1/zh
Priority to US18/160,882 priority patent/US20230179532A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/26Flow control; Congestion control using explicit feedback to the source, e.g. choke packets
    • H04L47/263Rate modification at the source after receiving feedback
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/46Interconnection of networks
    • H04L12/4641Virtual LANs, VLANs, e.g. virtual private networks [VPN]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0896Bandwidth or capacity management, i.e. automatically increasing or decreasing capacities
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/12Avoiding congestion; Recovering from congestion
    • H04L47/125Avoiding congestion; Recovering from congestion by balancing the load, e.g. traffic engineering
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/31Flow control; Congestion control by tagging of packets, e.g. using discard eligibility [DE] bits
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/70Admission control; Resource allocation
    • H04L47/82Miscellaneous aspects
    • H04L47/822Collecting or measuring resource availability data
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/02Topology update or discovery
    • H04L45/04Interdomain routing, e.g. hierarchical routing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/22Traffic shaping

Definitions

  • the embodiments of the present application relate to the field of communications technologies, and in particular, to a traffic rate limiting method, related network devices, and storage media.
  • VPN Virtual Private Network
  • PE Provide Edge
  • CE Customer Edge
  • the CE device is dual-homed to the PE1 device and the PE2 device.
  • the PE1 and PE2 devices forward user upstream traffic from the CE device to other devices in a load balancing manner, and forward user downstream traffic from other devices to the CE device in a load balancing manner.
  • the service traffic bandwidth speed limit provided by the operator to the user is 100 megabits per second (Mbps).
  • the PE1 device and PE2 device can perform load balancing, if the speed limit value of the PE1 device and the PE2 device is both set to 50Mbps, it is difficult to ensure absolute bilateral load balancing during the actual operation of the network. In some cases, it may even occur.
  • User traffic is forwarded through the PE1 device, that is, the actual user traffic rate is limited to 50 Mbps, which affects the normal transmission of packets and reduces user experience.
  • the speed limit value of the PE1 device and PE2 device are both set to 100Mbps, the actual peak speed limit of user traffic is 200Mbps, which is not conducive to the reasonable allocation of the limited network by the operator. resource.
  • the embodiments of the present application provide a traffic rate limiting method, a related network device and a storage medium, which can implement flexible and reasonable rate limiting of traffic.
  • a flow rate limiting method is provided. The method is applied to a network system, the network system includes a first network device, a second network device and a third network device, and the third network device is multi-homed and connected to the first network device and the second network device.
  • the first network device and the second network device may be PE devices, and the third network device may be CE devices.
  • the first network device determines the free bandwidth of the interface of the second network device, and then determines the limited bandwidth of the interface of the first network device according to the free bandwidth of the interface of the second network device and the configured bandwidth of the second interface.
  • the free bandwidth of the interface of the second network device is the bandwidth that is not occupied in the configured bandwidth of the first interface.
  • the first interface is an interface through which the second network device is connected to the third network device.
  • the first interface is an interface used by the second network device to receive upstream traffic from the third network device or to send downstream traffic to the third network device.
  • the upstream traffic sent by the third network device and the downstream traffic sent to the third network device may both flow through the first interface, such as the same aggregated interface.
  • the configured bandwidth of the first interface is a bandwidth configured by the second network device for the first interface for forwarding traffic (upstream traffic or downstream traffic).
  • the spare bandwidth of the interface of the second network device is currently unused bandwidth among the bandwidths configured by the second network device for the first interface, that is, the spare bandwidth of the configured bandwidth of the first interface that is not used for transmitting traffic.
  • the free bandwidth of the interface of the second network device is also directed to upstream traffic; when the configured bandwidth of the first interface is directed to downstream traffic, the second network device The free bandwidth of the interface is also for downstream traffic.
  • the second interface is an interface used by the first network device to receive upstream traffic from the third network device or to send downstream traffic to the third network device.
  • the upstream traffic sent by the third network device and the downstream traffic sent to the third network device may both flow through the second interface, such as the same aggregated interface.
  • the configured bandwidth of the second interface is the bandwidth configured by the first network device for the second interface for forwarding traffic (upstream traffic or downstream traffic).
  • the bandwidth limitation of the interface of the first network device is used to limit the rate of the traffic flowing through the second interface, which may specifically be to limit the rate of the upstream traffic or the downstream traffic flowing through the second interface. If the free bandwidth of the interface of the second network device and the configured bandwidth of the second interface are both for the upstream traffic, the determined limited bandwidth of the interface of the first network device is also for the upstream traffic, that is, the interface limit of the first network device The bandwidth is used to limit the rate of the upstream traffic flowing through the second interface; if both the interface free bandwidth of the second network device and the configured bandwidth of the second interface are for downstream traffic, the determined interface limit of the first network device The bandwidth is also for the downlink traffic, that is, the bandwidth limitation of the interface of the first network device is used to limit the speed of the downlink traffic flowing through the second interface.
  • the message may be a Border Gateway Protocol (Border Gateway Protocol, BGP) route, or may be other messages capable of carrying bandwidth information.
  • Border Gateway Protocol BGP
  • BGP Border Gateway Protocol
  • the first network device may limit the rate of user traffic according to the bandwidth limitation of the interface. Since the first network device and the second network device are used for load sharing of user traffic, the first network device limits the bandwidth according to the free bandwidth of the interface of the second network device, that is, the interface determined according to the bandwidth occupancy of the second network device To be more accurate, the first network device can limit the bandwidth according to the interface to implement a more reasonable rate limit for user traffic, so as to achieve the purpose of saving network resources without compromising user experience.
  • the operation of determining the free bandwidth of the interface of the second network device by the first network device may be: the first network device receives a message sent by the second network device, where the message includes the configured bandwidth of the first interface and the The bandwidth occupied by the traffic flowing through the first interface; the first network device determines the free bandwidth of the interface of the second network device according to the difference between the configured bandwidth of the first interface and the bandwidth occupied by the traffic flowing through the first interface.
  • the message may be a message, and the message includes both the configured bandwidth of the first interface and the bandwidth occupied by the traffic flowing through the first interface.
  • this one message may be sent when the configured bandwidth of the first interface changes, or may be sent at a preset time interval.
  • the message may be two messages, eg, the message may include a first message and a second message.
  • the first message includes the configured bandwidth of the first interface, that is, the configured bandwidth of the first interface is sent through the first message.
  • the second message includes the bandwidth occupied by the traffic flowing through the first interface, that is, the bandwidth occupied by the traffic flowing through the first interface is sent through the second message.
  • the sending time intervals of the first message and the second message are different; or, the first message is sent when the configured bandwidth of the first interface changes, and the second message is sent at a preset time interval.
  • the operation of determining the free bandwidth of the interface of the second network device by the first network device may be: the first network device receives a message sent by the second network device, where the message includes the interface of the second network device free bandwidth.
  • the message further includes an Ethernet Segment Identifier (Ethernet Segment Identifier, ESI) or an interface identifier of the first interface, where the ESI or the interface identifier is used to instruct the first network device to determine the second interface. That is, after receiving the message, the first network device may determine the second interface corresponding to the first interface according to the ESI or the interface identifier of the first interface in the message.
  • Ethernet Segment Identifier Ethernet Segment Identifier
  • interface identifier the interface identifier of the first interface
  • the first network device and the second network device that have a multi-homing relationship may have the same ESI, and the first network device may determine the first network based on the ESI The first interface in the device for connecting with the third network device, and the second network device may determine the second interface in the second network device for connecting with the third network device based on the ESI.
  • EVPN Ethernet Virtual Private Network
  • the first network device and the second network device can be assigned corresponding interface identifiers respectively, so that the interface identifier used to identify the first interface is carried in the message sent by the second network device, so that the A network device determines a second interface corresponding to the interface identifier of the first interface, wherein the interface identifiers of the first interface and the second interface may be the same, or the interface identifiers of the first interface and the second interface may have a certain correspondence.
  • the subsequent first network device may set the bandwidth of the second interface according to the free bandwidth of the interface of the second network device (ie, the free bandwidth of the first interface).
  • the message further includes an Ethernet label of the first interface, and the ESI and the Ethernet label are used to instruct the first network device to determine the second interface.
  • the Ethernet tag may be a virtual local network identifier (VLAN ID).
  • the first network device can determine the aggregation interface according to the ESI, and the aggregation interface includes one or more sub-interfaces, and the first network device can determine a certain sub-interface in the aggregation interface as the second interface according to the received VLAN ID.
  • the message may also include traffic direction information.
  • the traffic direction information is used to indicate whether the configured bandwidth of the first interface and the bandwidth occupied by the traffic flowing through the first interface carried in the message are the bandwidth information of the upstream traffic flowing through the first interface or the downstream traffic flowing through the first interface. bandwidth information; or, the traffic direction information is used to indicate whether the interface free bandwidth carried in the message is bandwidth information of upstream traffic flowing through the first interface or bandwidth information of downstream traffic flowing through the first interface.
  • the traffic direction information indicates that the message carries the bandwidth information of the upstream traffic
  • the free bandwidth of the interface of the second network device determined by the first network device according to the message is also for the upstream traffic.
  • the bandwidth used for forwarding upstream traffic of the second interface is configured.
  • the traffic direction information indicates that the message carries the bandwidth information of the downlink traffic
  • the free bandwidth of the interface of the second network device determined by the first network device according to the message is also for the downlink traffic, and accordingly the subsequent The bandwidth used for forwarding downlink traffic of the second interface is configured.
  • the operation of determining the limited bandwidth of the interface of the first network device by the first network device according to the free bandwidth of the interface of the second network device and the configured bandwidth of the second interface may be: The sum of the free bandwidth of the interface of the second network device and the configured bandwidth of the second interface determines the limited bandwidth of the interface of the first network device; or, the first network device first obtains the free bandwidth of the interface and the second interface of the second network device. The sum of the configured bandwidth of the first network device and the control coefficient are multiplied to determine the limited bandwidth of the interface of the first network device; Actions for other preset rules to obtain interface limit bandwidth.
  • This implementation method is suitable for dual-homing and dual-active scenarios.
  • the third network device sends uplink traffic or receives downlink traffic through the first network device and the second network device. Therefore, the first network device can directly adjust its own real-time effective bandwidth rate limit configuration according to the bandwidth occupancy of the second network device.
  • the third network device is also multi-homed and connected to N other network devices, where N is a positive integer, and the first network device is based on the second network device.
  • the free bandwidth of the interface of the device and the configured bandwidth of the second interface, and the operation of determining the limited bandwidth of the interface of the first network device may be: the first network device according to the free bandwidth of the interface of the second network device, one of the N other network devices, or A plurality of interface spare bandwidths and control coefficients are used to determine available interface spare bandwidths.
  • the number of the control coefficients may be one or more, and the values of the one or more control coefficients may all be greater than 0 and less than 1.
  • the first network device may determine that one or more interface free bandwidths of one or more other network devices all correspond to the control coefficient. When there are multiple control coefficients, the first network device may determine that multiple interface free bandwidths of multiple other network devices respectively correspond to the multiple control coefficients. The first network device determines the limited bandwidth of the interface of the first network device according to the available free bandwidth of the interface and the configured bandwidth of the second interface.
  • This implementation is suitable for multi-return and multi-active scenarios.
  • the third network device sends uplink traffic or receives downlink traffic by performing load sharing between the first network device, the second network device and the N other network devices. Therefore, the first network device may need to adjust the bandwidth rate limit configuration that takes effect in real time according to the second network device and the bandwidth occupancy conditions of the N network devices.
  • a first network device is provided, the first network device is applied to a network system, the network system includes a first network device, a second network device and a third network device, and the third network device is multi-homed and connected to the first network device. a network device and a second network device.
  • the first network device has a function of implementing the behavior of the traffic rate limiting method in the first aspect or any implementation manner of the first aspect.
  • the first network device includes at least one module, and the at least one module is configured to implement the traffic rate limiting method provided in the first aspect.
  • the first network device includes: a first determination module and a second determination module.
  • the first determining module is configured to determine the free bandwidth of the interface of the second network device, the free bandwidth of the interface of the second network device is the bandwidth that is not occupied in the configured bandwidth of the first interface, and the first interface is all the bandwidth.
  • the second network device is connected to the interface of the third network device.
  • the second determining module is configured to determine the limited bandwidth of the interface of the first network device according to the free bandwidth of the interface of the second network device and the configured bandwidth of the second interface, where the limited bandwidth of the interface is used for The traffic of the second interface is rate-limited, and the second interface is the interface through which the first network device is connected to the third network device.
  • the first determining module is configured to: receive a message sent by the second network device, where the message includes the configured bandwidth of the first interface and the bandwidth flowing through the first interface. bandwidth occupied by traffic; according to the difference between the configured bandwidth of the first interface and the bandwidth occupied by traffic flowing through the first interface, determine the free bandwidth of the interface of the second network device.
  • the first determining module is configured to: receive a message sent by the second network device, where the message includes the free bandwidth of the interface of the second network device.
  • the message further includes an Ethernet segment identifier ESI or an interface identifier of the first interface, where the ESI or the interface identifier is used to instruct the first network device to determine the first interface.
  • Ethernet segment identifier ESI or an interface identifier of the first interface where the ESI or the interface identifier is used to instruct the first network device to determine the first interface.
  • the message further includes an Ethernet label of the first interface, and the ESI and the Ethernet label are used to instruct the first network device to determine the second interface.
  • the message is a border gateway protocol BGP route.
  • the message includes a first message and a second message
  • the configured bandwidth of the first interface is sent through the first message
  • the traffic flowing through the first interface occupies a Bandwidth is sent through the second message.
  • the sending time intervals of the first message and the second message are different; or, the first message is sent when the configured bandwidth of the first interface changes, and the first message is sent when the configured bandwidth of the first interface changes.
  • Two messages are sent at preset time intervals.
  • the second determining module is configured to: determine the first network device according to the sum of the idle bandwidth of the interface of the second network device and the configured bandwidth of the second interface The interface limits bandwidth.
  • the third network device is also multi-homed and connected to other N network devices, where N is a positive integer.
  • the second determining module is configured to: determine the available interface spare bandwidth according to the interface spare bandwidth of the second network device, one or more interface spare bandwidths of the other N network devices, and a control coefficient, and the control The coefficient may be greater than 0 and less than 1, or may be other values; according to the available free bandwidth of the interface and the configured bandwidth of the second interface, the limited bandwidth of the interface of the first network device is determined.
  • the interface limiting bandwidth is used to limit the rate of upstream traffic or downstream traffic flowing through the second interface.
  • the message further includes traffic direction information.
  • the traffic direction information is used to indicate that the configured bandwidth of the first interface and the bandwidth occupied by the traffic flowing through the first interface carried in the message are the bandwidth information of the upstream traffic flowing through the first interface or the bandwidth information of the upstream traffic flowing through the first interface.
  • Bandwidth information of the downstream traffic flowing through the first interface; or, the traffic direction information is used to indicate that the free bandwidth of the interface carried in the message is the bandwidth information of the upstream traffic flowing through the first interface or Bandwidth information of downlink traffic flowing through the first interface.
  • a first network device in a third aspect, includes a processor and a memory, and the memory is used to store and support the first network device to perform the first aspect or any one of the first aspects.
  • a program of the traffic rate limiting method provided in a possible implementation manner, and storing data involved in implementing the traffic rate limiting method described in the first aspect above.
  • the processor is configured to execute the program stored in the memory to implement the method involved in the first aspect or any possible implementation manner of the first aspect.
  • the first network device may further include a transceiver, where the transceiver is configured to receive and/or transmit the data involved in the first aspect or any possible implementation manner of the first aspect.
  • a computer-readable storage medium where instructions are stored in the computer-readable storage medium, and when the computer-readable storage medium runs on a computer, the computer can execute the first aspect or any possible implementation of the first aspect.
  • a computer program product containing instructions, which, when run on a computer, cause the computer to execute the traffic rate limiting method described in the first aspect or any possible implementation manner of the first aspect.
  • a flow rate limiting method is provided.
  • the method is applied to a network system, the network system includes a first network device, a second network device and a third network device, and the third network device is multi-homed and connected to the first network device and the second network device.
  • the second network device determines the configured bandwidth of the first interface and the bandwidth occupied by the traffic flowing through the first interface, and then sends the information to the first interface according to the configured bandwidth of the first interface and the bandwidth occupied by the traffic flowing through the first interface.
  • a network device sends a message, where the message is used to instruct the first network device to limit the rate of traffic of the third network device according to the message.
  • the first interface is an interface through which the second network device is connected to the third network device.
  • the first interface is an interface used by the second network device to receive upstream traffic from the third network device or to send downstream traffic to the third network device.
  • the upstream traffic sent by the third network device and the downstream traffic sent to the third network device may both flow through the first interface, such as the same aggregated interface.
  • the configured bandwidth of the first interface is a bandwidth configured by the second network device for the first interface for forwarding traffic (upstream traffic or downstream traffic).
  • the message includes the configured bandwidth of the first interface and the bandwidth occupied by the traffic flowing through the first interface, or the message includes the idle bandwidth of the interface of the second network device.
  • the free bandwidth of the interface of the second network device is the bandwidth that is not occupied in the configured bandwidth of the first interface.
  • the spare bandwidth of the interface of the second network device is currently unused bandwidth among the bandwidths configured by the second network device for the first interface, that is, the spare bandwidth of the configured bandwidth of the first interface that is not used for transmitting traffic.
  • the free bandwidth of the interface of the second network device is also directed to upstream traffic; when the configured bandwidth of the first interface is directed to downstream traffic, the second network device The free bandwidth of the interface is also for downstream traffic.
  • the message may be a message that includes both the configured bandwidth of the first interface and the traffic flowing through the first interface. Occupied bandwidth.
  • this one message may be sent when the configured bandwidth of the first interface changes, or may be sent at a preset time interval.
  • the preset time interval may be set by the second network device itself, and may be set to be longer or shorter, and may be specifically set as required.
  • the message may be two messages, eg, the message may include a first message and a second message.
  • the first message includes the configured bandwidth of the first interface, that is, the configured bandwidth of the first interface is sent through the first message.
  • the second message includes the bandwidth occupied by the traffic flowing through the first interface, that is, the bandwidth occupied by the traffic flowing through the first interface is sent through the second message.
  • the sending time intervals of the first message and the second message are different; or, the first message is sent when the configured bandwidth of the first interface changes, and the second message is sent at a preset time interval.
  • the second network device may subtract the bandwidth occupied by the traffic flowing through the first interface from the configured bandwidth of the first interface to obtain the spare bandwidth of the interface of the second network device.
  • the message may be a border gateway protocol BGP route, or may be any other message capable of carrying bandwidth information.
  • the second network device may send the configured bandwidth of the first interface and the bandwidth occupied by the traffic flowing through the first interface to the first network device, or may send the free bandwidth of the interface of the second network device to the first network device.
  • the first network device Accordingly, the first network device can learn the bandwidth occupation of the second network device. Since the first network device and the second network device are used for load sharing of user traffic, the first network device can implement a more reasonable rate limit on the user traffic of the third network device according to the bandwidth occupancy of the second network device , in order to ensure the purpose of saving network resources on the basis that the user experience is not damaged.
  • the message further includes an Ethernet segment identifier ESI or an interface identifier of the first interface, where the ESI or the interface identifier is used to instruct the first network device to determine the second interface.
  • the second interface is an interface through which the first network device is connected to the third network device.
  • the second interface is an interface used by the first network device to receive upstream traffic from the third network device or to send downstream traffic to the third network device.
  • the upstream traffic sent by the third network device and the downstream traffic sent to the third network device may both flow through the second interface, such as the same aggregated interface.
  • the first network device and the second network device that have a multi-homing relationship may have the same ESI, and the first network device may determine, based on the ESI, the first network device for connecting with the third network device in the first network device an interface, and the second network device may determine, based on the ESI, a second interface in the second network device for connecting with the third network device.
  • the first network device and the second network device can be assigned corresponding interface identifiers respectively, so that the interface identifier used to identify the first interface is carried in the message sent by the second network device, so that the A network device determines a second interface corresponding to the interface identifier of the first interface, wherein the interface identifiers of the first interface and the second interface may be the same, or the interface identifiers of the first interface and the second interface may have a certain correspondence.
  • the subsequent first network device may set the bandwidth of the second interface according to the free bandwidth of the interface of the second network device (ie, the free bandwidth of the first interface).
  • the message further includes an Ethernet label of the first interface, and the ESI and the Ethernet label are used to instruct the first network device to determine the second interface.
  • the Ethernet tag can be a VLAN ID.
  • the first network device can determine the aggregation interface according to the ESI, and the aggregation interface includes one or more sub-interfaces, and the first network device can determine a certain sub-interface in the aggregation interface as the second interface according to the received VLAN ID.
  • the message may also include traffic direction information.
  • the traffic direction information is used to indicate whether the configured bandwidth of the first interface and the bandwidth occupied by the traffic flowing through the first interface carried in the message are the bandwidth information of the upstream traffic flowing through the first interface or the downstream traffic flowing through the first interface. bandwidth information; or, the traffic direction information is used to indicate whether the interface free bandwidth carried in the message is bandwidth information of upstream traffic flowing through the first interface or bandwidth information of downstream traffic flowing through the first interface.
  • the traffic direction information indicates that the message carries the bandwidth information of the upstream traffic
  • the free bandwidth of the interface of the second network device determined by the first network device according to the message is also for the upstream traffic.
  • the bandwidth used for forwarding upstream traffic of the second interface is configured.
  • the traffic direction information indicates that the message carries the bandwidth information of the downlink traffic
  • the free bandwidth of the interface of the second network device determined by the first network device according to the message is also for the downlink traffic, and accordingly the subsequent The bandwidth used for forwarding downlink traffic of the second interface is configured.
  • a second network device is provided, the second network device is applied to a network system, the network system includes a first network device, a second network device and a third network device, and the third network device is multi-homed and connected to the first network device. a network device and a second network device.
  • the second network device has the function of implementing the behavior of the traffic rate limiting method in the sixth aspect or any possible implementation manner of the sixth aspect.
  • the second network device includes at least one module, and the at least one module is configured to implement the traffic rate limiting method provided in the sixth aspect.
  • the second network device includes: a first determining module and a sending module.
  • a first determining module configured to determine a configured bandwidth of a first interface and a bandwidth occupied by traffic flowing through the first interface, where the first interface is an interface through which the second network device is connected to the third network device .
  • a sending module configured to send a message to the first network device according to the configured bandwidth of the first interface and the bandwidth occupied by traffic flowing through the first interface, where the message is used to instruct the first network device to The message limits the rate of the traffic of the third network device.
  • the message includes the configured bandwidth of the first interface and the bandwidth occupied by the traffic flowing through the first interface, or the message includes the spare bandwidth of the interface of the second network device, and the second network
  • the free bandwidth of the interface of the device is the bandwidth that is not occupied in the configured bandwidth of the first interface.
  • the message further includes an Ethernet segment identifier ESI or an interface identifier of the first interface, where the ESI or the interface identifier is used to instruct the first network device to determine the second interface , the second interface is an interface through which the first network device is connected to the third network device.
  • the message further includes an Ethernet label of the first interface, and the ESI and the Ethernet label are used to instruct the first network device to determine the second interface.
  • the message further includes traffic direction information.
  • the traffic direction information is used to indicate that the configured bandwidth of the first interface and the bandwidth occupied by the traffic flowing through the first interface carried in the message are the bandwidth information of the upstream traffic flowing through the first interface or the bandwidth information of the upstream traffic flowing through the first interface.
  • Bandwidth information of the downstream traffic flowing through the first interface; or, the traffic direction information is used to indicate that the free bandwidth of the interface carried in the message is the bandwidth information of the upstream traffic flowing through the first interface or Bandwidth information of downlink traffic flowing through the first interface.
  • the message is a border gateway protocol BGP route.
  • the message includes a first message and a second message
  • the configured bandwidth of the first interface is sent through the first message
  • the traffic flowing through the first interface occupies a Bandwidth is sent through the second message.
  • the sending time intervals of the first message and the second message are different; or, the first message is sent when the configured bandwidth of the first interface changes, and the first message is sent when the configured bandwidth of the first interface changes.
  • Two messages are sent at preset time intervals.
  • a second network device in an eighth aspect, includes a processor and a memory, and the memory is used to store and support the second network device to perform the sixth aspect or any one of the sixth aspects.
  • a program of the traffic rate limiting method provided in a possible implementation manner, and storing data involved in implementing the traffic rate limiting method described in the sixth aspect.
  • the processor is configured to execute a program stored in the memory to perform the method involved in the sixth aspect or any possible implementation manner of the sixth aspect.
  • the second network device may further include a transceiver, and the transceiver is configured to receive and/or transmit the data involved in the sixth aspect or any possible implementation manner of the sixth aspect.
  • a computer-readable storage medium is provided, and instructions are stored in the computer-readable storage medium, which, when executed on a computer, cause the computer to execute the sixth aspect or any possible implementation of the sixth aspect
  • the flow rate limiting method described in the method is provided.
  • a computer program product containing instructions which, when run on a computer, causes the computer to execute the traffic rate limiting method described in the sixth aspect or any possible implementation manner of the sixth aspect.
  • FIG. 1 is a schematic diagram of a network system provided by an embodiment of the present application.
  • FIG. 2 is a flowchart of a first traffic rate limiting method provided by an embodiment of the present application
  • FIG. 3 is a flowchart of a second flow rate limiting method provided by an embodiment of the present application.
  • FIG. 4 is a flowchart of a third traffic rate limiting method provided by an embodiment of the present application.
  • FIG. 5 is a schematic structural diagram of a network device provided by an embodiment of the present application.
  • FIG. 6 is a schematic structural diagram of a first network device provided by an embodiment of the present application.
  • FIG. 7 is a schematic structural diagram of a second network device provided by an embodiment of the present application.
  • the network system involved in the embodiments of the present application includes a first network device, a second network device, and a third network device.
  • the third network device is multi-homed to the first network device and the second network device.
  • the third network device may also be connected to other N network devices in a multi-homed manner, where N is a positive integer.
  • the third network device may receive traffic through the first network device and the second network device, and may also send traffic through the first network device and the second network device.
  • the direction from the third network device to the remote network device via the first network device is the upstream direction
  • the direction from the third network device to the remote network device via the second network device is also the upstream direction.
  • Traffic in the upstream direction may be referred to as upstream traffic.
  • the upstream traffic may be, for example, the traffic originating from the user equipment mounted by the third network device, or the traffic originating from the third network device, or originating from other network devices connected to the third network device or the other network Traffic of user equipment mounted on the equipment.
  • the upstream traffic may also be sent to a network device directly connected to the first network device via the first network device, or sent to a network device directly connected to the second network device via the second network device.
  • the direction from the remote network device through the first network device to the third network device is the downlink direction, and the direction from the remote network device through the second network device to the third network device is also the downlink direction.
  • Traffic in the downstream direction may be referred to as downstream traffic.
  • the downlink traffic can be, for example, the traffic sent by the remote user equipment or other remote network devices to the third network device. After the traffic is received by the third network device, it can be forwarded to the user equipment or network device connected to the third network device. , or for local processing and storage. In some cases, the downlink traffic may also be sent by a network device directly connected to the first network device or the second network device.
  • Both the first network device and the second network device may be devices with a data forwarding function, such as PE devices, and specifically may be switches, routers, and the like.
  • the third network device may be a device with a data forwarding function, or may be a user-side network device, such as a CE device.
  • the device types of the first network device, the second network device and the third network device may be the same or different.
  • FIG. 1 is a schematic diagram of a network system provided by an embodiment of the present application.
  • the third network device is the CE 21 device
  • the first network device is the PE 11 device
  • the second network device is the PE 12 device as an example for description.
  • the network system can be established through interior gateway protocol (Interior Gateway Protocol, IGP), multiprotocol label switching technology (Multiprotocol Label Switching, MPLS), or border gateway protocol (Border Gateway Protocol, BGP), so that CE 21 equipment, PE 11 equipment , The routes between PE 12 devices are reachable.
  • IGP Interior Gateway Protocol
  • MPLS multiprotocol Label Switching
  • BGP Border Gateway Protocol
  • the network system shown in FIG. 1 can be used as an application scenario of the embodiment of the present application.
  • the network system includes CE 21 equipment, PE 11 equipment and PE 12 equipment. That is, the CE 21 device is dual-homed to the PE 11 device and the PE 12 device.
  • PE 11 and PE 12 are BGP neighbors.
  • the network system also includes a PE 13 device, and the PE 13 device is the remote BGP neighbor device of the PE 11 device and the PE 12 device.
  • Other CE devices (the CE 22 device shown in Figure 1) can be connected to the PE 13 device.
  • the interface connecting the PE 11 device to the CE 21 is the interface 31.
  • Interface 31 is an interface used by the PE 11 device to receive upstream traffic from the CE 21 device or to send downstream traffic to the CE 21 device.
  • the upstream traffic sent by the CE 21 device and the downstream traffic sent to the CE 21 device may both flow through the interface 31, such as the same aggregated interface.
  • the interfaces through which the upstream traffic and the downstream traffic flow may also be different, such as different aggregated interfaces or different sub-interfaces under the same aggregated interface.
  • the interface connecting the PE 12 device to the CE 21 device is interface 32.
  • Interface 32 is an interface used by the PE 12 device to receive upstream traffic from the CE 21 device or to send downstream traffic to the CE 21 device. In some cases, both the upstream traffic sent by the CE 21 device and the downstream traffic sent to the CE 21 device may also flow through the interface 32 .
  • the PE 11 device and the PE 12 device forward the upstream traffic from the CE 21 device to the CE 22 device in a load-sharing manner.
  • the PE 11 device can forward the upstream traffic from the CE 21 device to the CE 22 device through the interface 31, and the PE 12 device can forward the upstream traffic from the CE 21 device to the CE 22 device through the interface 32.
  • the PE 11 device and the PE 12 device forward the downstream traffic from the CE 22 device to the CE 21 device in a load-sharing manner.
  • the PE 11 device can forward the downstream traffic from the CE 22 device to the CE 21 device through the interface 31, and the PE 12 device can forward the downstream traffic from the CE 22 device to the CE 21 device through the interface 32.
  • the embodiment of the present application provides a traffic rate limiting method, and the corresponding method can be applied to the network system shown in FIG. The issue of flexible rate limiting of traffic.
  • FIG. 2 is a flowchart of a traffic rate limiting method provided by an embodiment of the present application, and the method may be applied to the network system shown in FIG. 1 .
  • the method includes:
  • the PE 11 device determines the free bandwidth of the interface of the PE 12 device.
  • the free bandwidth of the interface of the PE 12 device is the bandwidth that is not occupied in the configured bandwidth of the first interface.
  • the first interface is the interface through which the PE 12 device is connected to the CE 21 device, such as the interface 32 shown in FIG. 1 .
  • the first interface is the interface used by the PE 12 device to receive upstream traffic from the CE 21 device or to send downstream traffic to the CE 21 device.
  • the upstream traffic sent by the CE 21 device and the downstream traffic sent to the CE 21 device may both flow through the first interface, such as the same aggregated interface.
  • the configured bandwidth of the first interface is the bandwidth configured by the PE 12 device for the first interface for forwarding traffic (upstream traffic or downstream traffic).
  • the configured bandwidth of the first interface may be statically configured locally by the PE 12 device, or may be configured by other network devices such as a controller and then delivered to the PE 12 device, which is not uniquely limited in this embodiment of the present application.
  • the interface spare bandwidth of the PE 12 device is the bandwidth currently in an unused state in the bandwidth configured by the PE 12 device for the first interface, that is, the spare bandwidth that is not used for transmitting traffic temporarily in the configured bandwidth of the first interface.
  • the configuration bandwidth of the first interface is aimed at upstream traffic
  • the free bandwidth of the interface of the PE 12 device is also aimed at upstream traffic
  • the interface of the PE 12 device is also aimed at upstream traffic.
  • the spare bandwidth is also for downstream traffic.
  • the operation of 201 may include the following two possible ways:
  • the PE 11 device receives a message sent by the PE 12 device, and the message includes the configured bandwidth of the first interface and the bandwidth occupied by the traffic flowing through the first interface.
  • the PE 11 device determines the interface free bandwidth of the PE 12 device according to the difference between the configured bandwidth of the first interface and the bandwidth occupied by the traffic flowing through the first interface.
  • the PE 11 device when the PE 11 device determines the free bandwidth of the interface of the PE 12 device according to the difference between the configured bandwidth of the first interface and the bandwidth occupied by the traffic flowing through the first interface, the PE 11 device can directly compare the configured bandwidth of the first interface and the bandwidth of the first interface. The difference of the bandwidth occupied by the traffic flowing through the first interface is used as the interface spare bandwidth of the PE 12 device. Alternatively, in combination with specific rate limit requirements or scenario requirements, the PE 11 device can also multiply the difference between the configured bandwidth of the first interface and the bandwidth occupied by the traffic flowing through the first interface by k to obtain the interface vacancy of the PE 12 device. bandwidth.
  • the value range of k is usually greater than 0 and less than 1, but in some possible cases, it can also be set to other value ranges. k may be a fixed value statically configured by the PE 11 device, or may be a value that allows flexible and real-time adjustment according to certain rules, which is not uniquely limited in this embodiment of the present application.
  • the message may be a message, and the message includes both the configured bandwidth of the first interface and the bandwidth occupied by the traffic flowing through the first interface.
  • this one message may be sent when the configured bandwidth of the first interface changes, or may be sent at a preset time interval.
  • the preset time interval can be set by the PE 12 device itself, which can be set to be longer or shorter, and can be set as needed.
  • the message may be two messages, eg, the message may include a first message and a second message.
  • the first message includes the configured bandwidth of the first interface, that is, the configured bandwidth of the first interface is sent through the first message.
  • the second message includes the bandwidth occupied by the traffic flowing through the first interface, that is, the bandwidth occupied by the traffic flowing through the first interface is sent through the second message.
  • the sending time intervals of the first message and the second message are different; or, the first message is sent when the configured bandwidth of the first interface changes, and the second message is sent at a preset time interval.
  • the PE 12 device determines the configured bandwidth of the first interface and the bandwidth occupied by the traffic flowing through the first interface, and then obtains the configured bandwidth of the first interface and the bandwidth occupied by the traffic flowing through the first interface. bandwidth, send a message to the PE 11 device, the message includes the configured bandwidth of the first interface and the bandwidth occupied by the traffic flowing through the first interface, and is used to instruct the PE 11 device to limit the rate of the flow of the CE 21 device according to the message.
  • the second possible way is that the PE 11 device receives a message sent by the PE 12 device, and the message includes the free bandwidth of the interface of the PE 12 device.
  • the PE 12 device determines the configuration bandwidth of the first interface and the bandwidth occupied by the traffic flowing through the first interface, and then according to the configuration bandwidth of the first interface and the bandwidth occupied by the traffic flowing through the first interface, Directly determine the free bandwidth of the interface of the PE 12 device, and carry the free bandwidth of the interface in the message to send to the PE 11 device.
  • the free bandwidth of the interface included in the message is used to instruct the PE 11 device to limit the rate of the traffic of the CE 21 device according to the message. In this way, the PE 12 device can subtract the bandwidth occupied by the traffic flowing through the first interface from the configured bandwidth of the first interface to obtain the free bandwidth of the interface of the PE 12 device.
  • the PE 12 device when the PE 12 device sends the message to the PE 11 device, it can directly send the message to the PE 11 device, or it can send the message to the PE 11 device through other network devices, such as a route reflector (RR).
  • RR route reflector
  • the message is sent to the PE 11 device, which is not uniquely limited in this embodiment of the present application.
  • the message may further include an Ethernet Segment Identifier (Ethernet Segment Identifier, ESI) or an interface identifier of the first interface.
  • the interface identifier is used to identify the first interface, which may be statically configured locally by the PE 12 device, or may be configured by, for example, a controller and then delivered to the PE 12 device, which is not uniquely limited in this embodiment of the present application.
  • the ESI or interface identifier of the first interface is used to instruct the PE 11 device to determine the second interface.
  • the second interface is the interface through which the PE 11 device is connected to the CE 21 device, such as the interface 31 shown in FIG. 1 .
  • the second interface is the interface used by the PE 11 device to receive upstream traffic from the CE 21 device or to send downstream traffic to the CE 21 device.
  • the upstream traffic sent by the CE 21 device and the downstream traffic sent to the CE 21 device may both flow through the second interface, such as the same aggregated interface.
  • the PE 11 device can determine the second interface corresponding to the first interface according to the ESI or the interface identifier of the first interface in the message.
  • the PE 11 device and the PE 12 device that have a multi-homing relationship may have the same ESI, and the PE 11 device may determine the PE 11 device based on the ESI.
  • the first interface for connecting with the CE 21 device, the PE 12 device can determine the second interface in the PE 12 device for connecting with the CE 21 device based on the ESI.
  • the PE11 device can determine the The second interface corresponding to the interface identifier of the first interface, wherein the interface identifiers of the first interface and the second interface may be the same, or the interface identifiers of the first interface and the second interface may have a certain correspondence.
  • the subsequent PE 11 device can set the bandwidth of the second interface according to the free bandwidth of the interface of the PE 12 device (that is, the free bandwidth of the first interface).
  • the first interface and the second interface are corresponding, and both the first interface and the second interface are used to forward the upstream traffic sent by the CE 21 device or both are used to forward the downstream traffic sent to the CE 21 device.
  • the message in the above two possible manners may also include an Ethernet tag (Ethernet tag) of the first interface, and the ESI and the Ethernet tag of the first interface are used to jointly instruct the PE 11 device to determine the second interface.
  • the Ethernet tag may be a virtual local network identifier (VLAN ID).
  • the PE 11 device may determine an aggregated interface according to the ESI, and the aggregated interface includes one or more sub-interfaces, and the PE 11 device may determine, according to the received VLAN ID, that a certain sub-interface in the aggregated interface is the second one interface.
  • the VLAN ID when the first interface corresponds to a unique VLAN, can be the identification of the unique VLAN determined by the PE 12 device, and when the first interface corresponds to multiple VLANs, the VLAN ID can be the PE 12 device.
  • the identifier of one of the VLANs determined from the multiple VLANs eg, the VLAN with the largest or smallest identifier value among the multiple VLANs).
  • the message can also include the VLAN identification corresponding to the first interface, and the way of determining the VLAN identification is similar to the above-mentioned way of determining the VLAN ID in EVPN.
  • the PE11 equipment receives the VLAN identification and the interface identification of the first interface sent by the PE12 equipment, it can determine the second interface corresponding to the first interface according to the interface identification and the VLAN identification of the first interface.
  • the PE 12 device does not send the VLAN identifier, for example, the corresponding interface can be uniquely determined only through the interface identifier by way of static configuration.
  • the PE 12 device sends a VLAN ID in addition to the interface ID, it can allow interfaces belonging to different VLANs to have the same ID. At this time, the corresponding interface needs to be determined by the interface ID and the VLAN ID.
  • the message in the above two possible manners may further include traffic direction information.
  • the traffic direction information is used to indicate whether the configured bandwidth of the first interface and the bandwidth occupied by the traffic flowing through the first interface carried in the message are the bandwidth information of the upstream traffic flowing through the first interface or the downstream traffic flowing through the first interface. bandwidth information; or, the traffic direction information is used to indicate whether the interface free bandwidth carried in the message is bandwidth information of upstream traffic flowing through the first interface or bandwidth information of downstream traffic flowing through the first interface.
  • the free bandwidth of the interface of the PE 12 device determined by the PE 11 device according to the message is also for the upstream traffic. Configure the bandwidth of the interface for forwarding upstream traffic.
  • the traffic direction information indicates that the message carries the bandwidth information of the downstream traffic
  • the free bandwidth of the interface of the PE 12 device determined by the PE 11 device according to the message is also for the downstream traffic. Configure the bandwidth of the interface for forwarding downstream traffic.
  • the messages described in the above two possible manners may all be BGP routes, or may be other messages capable of carrying bandwidth information, which are not uniquely limited in this embodiment of the present application.
  • the bandwidth information (the configured bandwidth of the first interface, the bandwidth occupied by the traffic flowing through the first interface, or the bandwidth of the PE 12 device) may be carried by adding a BGP route type or adding an extended community attribute. interface free bandwidth).
  • the bandwidth information may exist in the network layer reachability information (NLRI) attribute in the BGP route.
  • NLRI network layer reachability information
  • Table 1 the fields contained in the NLRI attribute may be as shown in Table 1 below:
  • the Type field is the BGP route type.
  • the Length field is the length of the NLRI attribute.
  • the Route Distinguisher field is used to distinguish BGP routes of different virtual local area networks (VLANs).
  • the Ethernet Segment Identifier field is the ESI of the interface.
  • the Ethernet Tag field is the Ethernet tag of the interface.
  • the Bandwidth_direction field is traffic direction information, which is used to indicate whether the message carries bandwidth information of upstream traffic or bandwidth information of downstream traffic.
  • the Bandwidth_type field may include three bandwidth types, namely: configuration bandwidth type, traffic occupied bandwidth type, and spare bandwidth type.
  • the Bandwidth field is the bandwidth value of the interface.
  • the Originating Router's IP Address field is the source address configured on the network device that sends the message, such as the IP address of the PE 12 device.
  • the bandwidth information may also exist in the extended community attribute of the BGP route, for example, it may be used in a non-EVPN network scenario.
  • the fields included in the extended community attribute may be as shown in Table 2 below:
  • the Extend-Community type field is the type of the newly defined extended community attribute
  • the Extend-Community sub-type field is the subtype of the newly defined extended community attribute.
  • the Extend-Community type field and Extend-Community sub-type field indicate that the message carries is the information used to adjust the bandwidth.
  • the Bandwidth_id field is the interface identifier.
  • the Outer vlan field and the Inner vlan field contain the VLAN ID.
  • the Bandwidth field is the bandwidth value of the interface, and the C/A/I/O flag is set for different bandwidth types.
  • C: The C bit is 1, indicating the configuration bandwidth type.
  • A: The A position is 1, indicating the type of bandwidth occupied by traffic.
  • I: The I position is 1, indicating that it is the bandwidth information of the downstream traffic.
  • O: O bit is 1, indicating that it is the bandwidth information of upstream traffic.
  • Table 2 takes the configuration bandwidth and the traffic occupied bandwidth carried in the message as an example, and other types of message carrying formats can also be designed in combination with scenarios.
  • the C/A bit in Table 2 can be changed to the F bit, and the F bit is set to 1, indicating that the value carried in the Bandwidth field is the value of the free bandwidth.
  • the C/A/I/O/F flag bit can also be set at the same time.
  • This embodiment of the present application only takes the above Table 2 as an example to describe the extended community attribute, and the above Table 2 does not constitute a unique limitation to the embodiment of the present application.
  • the PE11 device determines the limited bandwidth of the interface of the PE11 device according to the free bandwidth of the interface of the PE12 device and the configured bandwidth of the second interface.
  • the configured bandwidth of the second interface is the bandwidth configured by the PE 11 device for the second interface for forwarding traffic (upstream traffic or downstream traffic).
  • the configured bandwidth of the second interface can be statically configured locally by the PE 11 device, or can be configured by other network devices such as a controller and then delivered to the PE 11 device.
  • the interface limit bandwidth of the PE 11 device is used to limit the rate of the traffic flowing through the second interface, which may specifically be to limit the rate of the upstream traffic or the downstream traffic flowing through the second interface. If the free bandwidth of the interface of the PE12 device and the configured bandwidth of the second interface are both for the upstream traffic, the determined limited bandwidth of the interface of the PE11 device is also for the upstream traffic, that is, the limited bandwidth of the interface of the PE11 device is used for convection Limit the speed through the upstream traffic of the second interface; if the interface free bandwidth of the PE 12 device and the configured bandwidth of the second interface are both for the downstream traffic, then the determined interface limit bandwidth of the PE 11 device is also for the downstream traffic. , that is, the limited bandwidth of the interface of the PE 11 device is used to limit the rate of the downstream traffic flowing through the second interface.
  • the PE 11 device After the PE 11 device determines the limited bandwidth of its own interface, it can limit the rate of user traffic according to the limited bandwidth of the interface. Since the PE 11 device and the PE 12 device are used for load balancing of user traffic, the PE 11 device determines the bandwidth limit of the interface according to the free bandwidth of the PE 12 device, that is, according to the bandwidth occupation of the PE 12 device. The device can limit the bandwidth based on the interface to implement a more reasonable rate limit for user traffic, so as to save network resources without compromising user experience.
  • the operation of 202 may include the following two possible ways:
  • the PE 11 device determines the limited bandwidth of the interface of the PE 11 device according to the sum of the free bandwidth of the interface of the PE 12 device and the configured bandwidth of the second interface.
  • the PE11 device can directly use the sum of the free bandwidth of the interface of the PE12 device and the configured bandwidth of the second interface as the interface limit bandwidth of the PE11 device; or, the PE11 device can use the free bandwidth of the interface of the PE12 device and the second interface. Multiply the sum of the configured bandwidth and the control coefficient K 1 to obtain the limited bandwidth of the interface of the PE 11 device.
  • the first possible way is suitable for dual-homing and dual-active scenarios.
  • CE 21 devices send upstream traffic or receive downstream traffic through PE 11 devices and PE 12 devices. Therefore, the PE 11 device can directly adjust its real-time effective bandwidth rate limit configuration according to the bandwidth occupancy of the PE 12 device.
  • the CE 21 device is also multi-homed and connected to other N PE devices.
  • the PE11 device determines the available interface spare bandwidth according to the interface spare bandwidth of the PE12 device, one or more interface spare bandwidths and control coefficients of the N PE devices; the PE11 device determines the available interface spare bandwidth according to the available interface spare bandwidth and the second interface Configure the bandwidth to determine the limited bandwidth of the interface of the PE 11 device.
  • the N PE devices may all send messages for advertising bandwidth information to PE 11 devices, or only M (1 ⁇ M ⁇ N) of them may send messages for advertising bandwidth information to PE 11 devices. message of bandwidth information, and the remaining (NM) PE devices have no interface spare bandwidth.
  • the PE11 device determines the total available interface free bandwidth of the PE11 device according to the multiple messages sent by the PE12 device and one or more PE devices in the N PE devices received within this period of time.
  • the manner in which the PE 11 device acquires the free bandwidth of the interface of any one of the N network devices is similar to the manner in which the PE 11 device acquires the free bandwidth of the interface of the PE 12 device, which is not repeated in this embodiment of the present application.
  • the number of the control coefficients may be one.
  • the control coefficient K 2 is a uniform fixed value set by the PE 11 device for the PE 12 device and the N PE devices.
  • the values of the multiple control coefficients may be determined, for example, according to the processing performance of the N PE devices.
  • the PE 11 device and the PE 12 device, the PE 13 device, and the PE 14 device together constitute the multi-homing device of the CE 21 device, and the PE 11 device receives the information sent by the PE 12 device and the PE 13 device within a preset period of time, including message of the interface free bandwidth
  • the PE 11 device can obtain the available interface free bandwidth of the PE 11 device according to (K 21 x the interface free bandwidth of the PE 12 device + K 22 x the interface free bandwidth of the PE 13 device), and based on the available interface The free bandwidth determines the interface limit bandwidth of the PE 11 device.
  • K 21 is the control coefficient corresponding to the PE 12 device
  • K 22 is the control coefficient corresponding to the PE 13 device.
  • the value range of the control coefficient is usually greater than 0 and less than 1, but in some possible situations, other value ranges may also be set.
  • the second possible way is suitable for multi-return and multi-live scenarios.
  • the CE 21 device transmits upstream traffic or receives downstream traffic through load sharing between the PE 11 device, the PE 12 device and the N PE devices. Therefore, the PE 11 device may need to adjust the bandwidth rate limit configuration that takes effect in real time according to the bandwidth occupancy of the PE 12 device and the N network devices.
  • the traffic rate limiting method provided by this embodiment of the present application is applied to a network system, where the network system includes a first network device, a second network device, and a third network device, and the third network device is multi-homed and connected to the first network device and the second network equipment.
  • FIG. 3 is a flowchart of a traffic rate limiting method provided by an embodiment of the present application.
  • the method may be executed by a first network device, and the first network device may be, for example, the PE 11 device in FIG. 1 .
  • the method includes:
  • the first network device determines the free bandwidth of the interface of the second network device.
  • the free bandwidth of the interface of the second network device is the bandwidth that is not occupied in the configured bandwidth of the first interface.
  • the first interface is an interface through which the second network device is connected to the third network device, such as interface 32 shown in FIG. 1 .
  • the first interface is an interface used by the second network device to receive upstream traffic from the third network device or to send downstream traffic to the third network device.
  • the upstream traffic sent by the third network device and the downstream traffic sent to the third network device may both flow through the first interface, such as the same aggregated interface.
  • the configured bandwidth of the first interface is a bandwidth configured by the second network device for the first interface for forwarding traffic (upstream traffic or downstream traffic).
  • the configured bandwidth of the first interface may be statically configured locally by the second network device, or may be configured by other network devices such as a controller and then delivered to the second network device, which is not uniquely limited in this embodiment of the present application.
  • the spare bandwidth of the interface of the second network device is currently unused bandwidth among the bandwidths configured by the second network device for the first interface, that is, the spare bandwidth of the configured bandwidth of the first interface that is not used for transmitting traffic.
  • the free bandwidth of the interface of the second network device is also directed to upstream traffic; when the configured bandwidth of the first interface is directed to downstream traffic, the second network device The free bandwidth of the interface is also for downstream traffic.
  • the operation of 301 may include the following two possible ways:
  • the first network device receives a message sent by the second network device, where the message includes the configured bandwidth of the first interface and the bandwidth occupied by the traffic flowing through the first interface.
  • the first network device determines the free bandwidth of the interface of the second network device according to the difference between the configured bandwidth of the first interface and the bandwidth occupied by the traffic flowing through the first interface.
  • the first network device may directly convert the bandwidth of the first interface to The difference between the configuration bandwidth and the bandwidth occupied by the traffic flowing through the first interface is used as the interface spare bandwidth of the second network device.
  • the first network device may also multiply the difference between the configured bandwidth of the first interface and the bandwidth occupied by traffic flowing through the first interface by k to obtain the second network device's bandwidth. Interface free bandwidth.
  • the value range of k is usually greater than 0 and less than 1, but in some possible cases, it can also be set to other value ranges. k may be a fixed value statically configured by the first network device, or may be a value that can be adjusted flexibly and in real time according to certain rules, which is not uniquely limited in this embodiment of the present application.
  • the message may be a message, and the message includes both the configured bandwidth of the first interface and the bandwidth occupied by the traffic flowing through the first interface.
  • this one message may be sent when the configured bandwidth of the first interface changes, or may be sent at a preset time interval.
  • the preset time interval may be set by the second network device itself, and may be set to be longer or shorter, and may be specifically set as required.
  • the message may be two messages, eg, the message may include a first message and a second message.
  • the first message includes the configured bandwidth of the first interface, that is, the configured bandwidth of the first interface is sent through the first message.
  • the second message includes the bandwidth occupied by the traffic flowing through the first interface, that is, the bandwidth occupied by the traffic flowing through the first interface is sent through the second message.
  • the sending time intervals of the first message and the second message are different; or, the first message is sent when the configured bandwidth of the first interface changes, and the second message is sent at a preset time interval.
  • the first network device receives a message sent by the second network device, where the message includes the free bandwidth of the interface of the second network device.
  • the message may further include the ESI or the interface identifier of the first interface.
  • the interface identifier is used to identify the first interface, and may be configured locally and statically by the second network device, or may be configured by, for example, a controller and then delivered to the second network device, which is not uniquely limited in this embodiment of the present application.
  • the ESI or the interface identifier of the first interface is used to instruct the first network device to determine the second interface.
  • the second interface is an interface through which the first network device is connected to the third network device, such as interface 31 shown in FIG. 1 .
  • the second interface is an interface used by the first network device to receive upstream traffic from the third network device or to send downstream traffic to the third network device.
  • the upstream traffic sent by the third network device and the downstream traffic sent to the third network device may both flow through the second interface, such as the same aggregated interface.
  • the first network device may determine the second interface corresponding to the first interface according to the ESI or the interface identifier of the first interface in the message.
  • the first network device and the second network device that have a multi-homing relationship may have the same ESI, and the first network device may determine, based on the ESI, that the first network device is used to connect with the third network device the first interface, the second network device may determine, based on the ESI, a second interface in the second network device for connecting with the third network device.
  • the first network device and the second network device can be assigned corresponding interface identifiers respectively, so that the interface identifier used to identify the first interface is carried in the message sent by the second network device, so that the A network device determines a second interface corresponding to the interface identifier of the first interface, wherein the interface identifiers of the first interface and the second interface may be the same, or the interface identifiers of the first interface and the second interface may have a certain correspondence.
  • the subsequent first network device may set the bandwidth of the second interface according to the free bandwidth of the interface of the second network device (ie, the free bandwidth of the first interface).
  • the first interface and the second interface are corresponding, and both the first interface and the second interface are used for forwarding the upstream traffic sent by the third network device or both are used for forwarding the downstream traffic sent to the third network device.
  • the message may further include the Ethernet label of the first interface, and the ESI and the Ethernet label of the first interface are used to jointly instruct the first network device to determine the second interface.
  • the Ethernet tag can be a VLAN ID
  • the first network device can determine the aggregation interface according to the ESI
  • the aggregation interface includes one or more sub-interfaces
  • the first network device can determine the aggregation interface according to the received VLAN ID.
  • One of the sub-interfaces is the second interface.
  • the VLAN ID when the first interface corresponds to a unique VLAN, can be the identifier of the unique VLAN determined by the second network device, and when the first interface corresponds to multiple VLANs, the VLAN ID can be the second The identification of one of the VLANs (eg, the VLAN with the largest or smallest identification value among the multiple VLANs) determined by the network device from the plurality of VLANs.
  • the message can also include the VLAN identification corresponding to the first interface, and the way of determining the VLAN identification is similar to the above-mentioned way of determining the VLAN ID in EVPN.
  • the first network device may determine the second interface corresponding to the first interface according to the interface identifier and the VLAN identifier of the first interface.
  • the second network device does not send the VLAN identifier, for example, the corresponding interface can be uniquely determined only through the interface identifier by means of static configuration.
  • interfaces belonging to different VLANs may be allowed to have the same interface identifiers.
  • the corresponding interfaces need to be jointly determined by the interface identifiers and the VLAN identifiers.
  • the message in the above two possible manners may further include traffic direction information.
  • the traffic direction information is used to indicate whether the configured bandwidth of the first interface and the bandwidth occupied by the traffic flowing through the first interface carried in the message are the bandwidth information of the upstream traffic flowing through the first interface or the downstream traffic flowing through the first interface. bandwidth information; or, the traffic direction information is used to indicate whether the interface free bandwidth carried in the message is bandwidth information of upstream traffic flowing through the first interface or bandwidth information of downstream traffic flowing through the first interface.
  • the traffic direction information indicates that the message carries the bandwidth information of the upstream traffic
  • the free bandwidth of the interface of the second network device determined by the first network device according to the message is also for the upstream traffic.
  • the bandwidth used for forwarding upstream traffic of the second interface is configured.
  • the traffic direction information indicates that the message carries the bandwidth information of the downlink traffic
  • the free bandwidth of the interface of the second network device determined by the first network device according to the message is also for the downlink traffic, and accordingly the subsequent The bandwidth used for forwarding downlink traffic of the second interface is configured.
  • the messages described in the above two possible manners may all be BGP routes, or may be other messages capable of carrying bandwidth information, which are not uniquely limited in this embodiment of the present application.
  • the bandwidth information (the configured bandwidth of the first interface, the bandwidth occupied by traffic flowing through the first interface, or the free bandwidth of the interface of the second network device) may be carried by adding a BGP route type or adding an extended community attribute. ).
  • the bandwidth information may exist in the NLRI attribute in the BGP route.
  • the fields contained in the NLRI attribute may be as shown in Table 1 above.
  • the bandwidth information may also exist in the extended community attribute of the BGP route, for example, it may be used in a non-EVPN network scenario.
  • the fields included in the extended community attribute may be as shown in Table 2 above.
  • the first network device determines the limited bandwidth of the interface of the first network device according to the free bandwidth of the interface of the second network device and the configured bandwidth of the second interface.
  • the configured bandwidth of the second interface is the bandwidth configured by the first network device for the second interface for forwarding traffic (upstream traffic or downstream traffic).
  • the configured bandwidth of the second interface may be statically configured locally by the first network device, or may be configured by other network devices such as a controller and then delivered to the first network device.
  • the bandwidth limitation of the interface of the first network device is used to limit the rate of the traffic flowing through the second interface, which may specifically be to limit the rate of the upstream traffic or the downstream traffic flowing through the second interface. If the free bandwidth of the interface of the second network device and the configured bandwidth of the second interface are both for the upstream traffic, the determined limited bandwidth of the interface of the first network device is also for the upstream traffic, that is, the interface limit of the first network device The bandwidth is used to limit the rate of the upstream traffic flowing through the second interface; if both the interface free bandwidth of the second network device and the configured bandwidth of the second interface are for downstream traffic, the determined interface limit of the first network device The bandwidth is also for the downlink traffic, that is, the bandwidth limitation of the interface of the first network device is used to limit the speed of the downlink traffic flowing through the second interface.
  • the first network device After the first network device determines the limited bandwidth of its own interface, it may limit the rate of user traffic according to the limited bandwidth of the interface. Since the first network device and the second network device are used for load sharing of user traffic, the first network device limits the bandwidth according to the interface free bandwidth of the second network device, that is, the interface determined according to the bandwidth occupancy of the second network device To be more accurate, the first network device can limit the bandwidth according to the interface to implement a more reasonable rate limit for user traffic, so as to achieve the purpose of saving network resources without compromising user experience.
  • the operation of 302 may include the following two possible ways:
  • the first network device determines the limited bandwidth of the interface of the first network device according to the sum of the free bandwidth of the interface of the second network device and the configured bandwidth of the second interface.
  • the first network device may directly use the sum of the free bandwidth of the interface of the second network device and the configured bandwidth of the second interface as the limited bandwidth of the interface of the first network device; or, the first network device may use the free bandwidth of the interface of the second network device
  • the sum of the configured bandwidth of the second interface is multiplied by the control coefficient K 1 to obtain the limited bandwidth of the interface of the first network device.
  • the first possible way is suitable for dual-homing and dual-active scenarios.
  • the third network device sends uplink traffic or receives downlink traffic through the first network device and the second network device. Therefore, the first network device can directly adjust its own effective bandwidth rate limit configuration in real time according to the bandwidth occupancy of the second network device.
  • the third network device is also multi-homed to connect to other N network devices.
  • the first network device determines the available interface spare bandwidth according to the interface spare bandwidth of the second network device, one or more interface spare bandwidths and control coefficients of the N network devices; the first network device determines the available interface spare bandwidth according to the available interface spare bandwidth and The configured bandwidth of the second interface is determined to limit the bandwidth of the interface of the first network device.
  • all of the N network devices may send messages for advertising bandwidth information to the first network device, or only M (1 ⁇ M ⁇ N) of them may send messages to the first network device for advertising bandwidth information.
  • the remaining (NM) network devices do not have free bandwidth on the interface.
  • the first network device determines the total available interface free bandwidth of the first network device according to the second network device and multiple messages sent by one or more network devices among the N network devices received within the period of time.
  • the manner in which the first network device obtains the interface spare bandwidth of any one of the N network devices is similar to the manner in which the first network device obtains the interface spare bandwidth of the second network device, which is not repeated in this embodiment of the present application.
  • the control coefficient may be a uniform fixed value set by the first network device for the second network device and the N network devices.
  • the first network device together with the second network device, the fourth network device and the fifth network device constitute a multi-homing device of the third network device, and the first network device receives the second network device within a preset period of time and the message including the spare bandwidth of the interface sent by the fourth network device, the first network device can obtain the first The available interface free bandwidth of the network device, and the limited bandwidth of the interface of the first network device is determined according to the available interface free bandwidth.
  • K 21 is the control coefficient corresponding to the second network device
  • K 22 is the control coefficient corresponding to the fourth network device.
  • the value range of the control coefficient is usually greater than 0 and less than 1, but in some possible cases, it can also be set to other value ranges.
  • the second possible way is suitable for multi-return and multi-live scenarios.
  • the third network device sends uplink traffic or receives downlink traffic by performing load sharing between the first network device, the second network device and the N network devices. Therefore, the first network device may need to adjust the bandwidth rate limit configuration that takes effect in real time according to the second network device and the bandwidth occupancy conditions of the N network devices.
  • FIG. 4 is a flowchart of a traffic rate limiting method provided by an embodiment of the present application.
  • the method may be executed by a second network device, and the second network device may be, for example, the PE 12 device in FIG. 1 .
  • the method includes:
  • the second network device determines the configured bandwidth of the first interface and the bandwidth occupied by the traffic flowing through the first interface.
  • the first interface and the configured bandwidth of the first interface have been explained and described in 301 above, and details are not repeated in this embodiment of the present application.
  • the second network device sends a message to the first network device according to the configured bandwidth of the first interface and the bandwidth occupied by the traffic flowing through the first interface.
  • the message is used to instruct the first network device to limit the rate of the traffic of the third network device according to the message, that is, it is used to instruct the first network device to limit the rate of the traffic flowing through the second interface according to the message.
  • the second interface has been explained in 302 above, which is not repeated in this embodiment of the present application.
  • the second network device When the second network device sends the message to the first network device, it can directly send the message to the first network device, or can send the message to the first network device through other network devices, such as RR, etc.
  • This application implements the This example does not make a unique limitation.
  • the message includes the configured bandwidth of the first interface and the bandwidth occupied by the traffic flowing through the first interface, or the message includes the free bandwidth of the interface of the second network device, and the free bandwidth of the interface of the second network device is the bandwidth of the first interface. Configure the unused bandwidth in the bandwidth.
  • the free bandwidth of the interface of the second network device has been explained and described in the foregoing 302, which is not repeated in this embodiment of the present application.
  • the message may be a message that includes both the configured bandwidth of the first interface and the traffic flowing through the first interface. Occupied bandwidth.
  • this one message may be sent when the configured bandwidth of the first interface changes, or may be sent at a preset time interval.
  • the preset time interval may be set by the second network device itself, and may be set to be longer or shorter, and may be specifically set as required.
  • the message may be two messages, eg, the message may include a first message and a second message.
  • the first message includes the configured bandwidth of the first interface, that is, the configured bandwidth of the first interface is sent through the first message.
  • the second message includes the bandwidth occupied by the traffic flowing through the first interface, that is, the bandwidth occupied by the traffic flowing through the first interface is sent through the second message.
  • the sending time intervals of the first message and the second message are different; or, the first message is sent when the configured bandwidth of the first interface changes, and the second message is sent at a preset time interval.
  • the second network device may subtract the bandwidth occupied by the traffic flowing through the first interface from the configured bandwidth of the first interface to obtain the spare bandwidth of the interface of the second network device.
  • the message may further include the ESI or the interface identifier of the first interface. Further, the message may also include the Ethernet label of the first interface or the VLAN identifier corresponding to the first interface. Optionally, the message may also include traffic direction information. Relevant content has been explained in the above 301, which is not repeated in this embodiment of the present application.
  • the message may be a BGP route, or may be another message capable of carrying bandwidth information, which is not uniquely limited in this embodiment of the present application.
  • the bandwidth information (the configured bandwidth of the first interface, the bandwidth occupied by traffic flowing through the first interface, or the free bandwidth of the interface of the second network device) may be carried by adding a BGP route type or adding an extended community attribute. ). Relevant content has been explained in the above 301, which is not repeated in this embodiment of the present application.
  • the second network device may send the configured bandwidth of the first interface and the bandwidth occupied by the traffic flowing through the first interface to the first network device, or may send the free bandwidth of the interface of the second network device to the first network device.
  • the first network device Accordingly, the first network device can learn the bandwidth occupation of the second network device. Since the first network device and the second network device are used for load sharing of user traffic, the first network device can implement a more reasonable rate limit on the user traffic of the third network device according to the bandwidth occupancy of the second network device , in order to achieve the purpose of saving network resources without sacrificing user experience.
  • FIG. 5 is a schematic structural diagram of a network device provided by an embodiment of the present application.
  • the network device may be the PE 11 device or the PE 12 device shown in FIG. 1 , or may be the first network device or the second network device described in the embodiments of FIG. 3 to FIG. 4 .
  • the network device may include at least one processor 501 and at least one communication interface 504 .
  • the network device may also include a communication bus 502 and a memory 503 .
  • the processor 501 may be a microprocessor (including a central processing unit (CPU), etc.), an application-specific integrated circuit (ASIC), or may be one or more devices used to control the solution of the present application Program execution integrated circuit.
  • a microprocessor including a central processing unit (CPU), etc.
  • ASIC application-specific integrated circuit
  • Communication interface 504 uses any transceiver-like device for communicating with other devices or communication networks, such as Ethernet, radio access network (RAN), wireless local area network (WLAN), and the like.
  • the communication interface 504 may be used to receive or send data for communication with other devices, such as receiving packets sent by other devices, or sending interface identifiers generated by network devices to other devices.
  • the memory 503 may be read-only memory (ROM), random access memory (RAM), electrically erasable programmable read-only memory (EEPROM), optical disk ( Including compact disc read-only memory (CD-ROM), compact disc, laser disc, digital versatile disc, Blu-ray disc, etc.), magnetic disk storage media or other magnetic storage devices, or desired program code in the form of instructions or data structures and any other medium that can be accessed by a computer, but is not limited thereto.
  • the memory 503 may exist independently and be connected to the processor 501 through the communication bus 502 .
  • the memory 503 may also be integrated with the processor 501 .
  • Communication bus 502 may include a path for transferring information between the components described above.
  • the processor 501 may include one or more CPUs, such as CPU0 and CPU1 as shown in FIG. 5 .
  • the network device may include multiple processors, such as the processor 501 and the processor 505 shown in FIG. 5 .
  • processors can be a single-core processor or a multi-core processor.
  • a processor herein may refer to one or more devices, circuits, and/or processing cores for processing data (eg, computer program instructions).
  • the network device may further include an output device 506 and an input device 507 .
  • the output device 506 is in communication with the processor 501 and can display information in a variety of ways.
  • the output device 506 may be a liquid crystal display (LCD), a light emitting diode (LED) display device, a cathode ray tube (CRT) display device, a projector, or the like .
  • Input device 507 is in communication with processor 501 and can receive user input in a variety of ways.
  • the input device 507 may be a mouse, a keyboard, a touch screen device, a sensor device, or the like.
  • the above-mentioned network device may be, for example, a router, a switch, a PE device, a network server, a switch, or a desktop computer, or other types of communication devices or embedded devices, etc.
  • the embodiment of the present application does not specifically limit the type of network device.
  • the memory 503 is used for storing the program code 510 for executing the solution of the present application
  • the processor 501 is used for executing the program code 510 stored in the memory 503 .
  • the network device can use the processor 501 and the program code 510 in the memory 503 to implement the operations performed by the first network device or the second network device in the foregoing embodiment.
  • the memory may also exist independently of the network device, and when the network device is running, the program code stored in the memory may be called to implement the operations performed by the first network device or the second network device in the foregoing embodiment. .
  • FIG. 6 is a schematic structural diagram of a first network device provided by an embodiment of the present application.
  • the first network device may be implemented by software, hardware, or a combination of the two, and the first network device may be the network device shown in FIG. 5 .
  • the first network device is applied to a network system, the network system includes a first network device, a second network device and a third network device, and the third network device is multi-homed and connected to the first network device and the second network device.
  • the first network device includes: a first determination module 601 and a second determination module 602 .
  • the first determining module 601 is configured to determine the free bandwidth of the interface of the second network device, the free bandwidth of the interface of the second network device is the bandwidth that is not occupied in the configured bandwidth of the first interface, and the first interface is the second network device is connected to the interface of the third network device;
  • the second determining module 602 is configured to determine the limited bandwidth of the interface of the first network device according to the free bandwidth of the interface of the second network device and the configured bandwidth of the second interface, where the limited bandwidth of the interface is used for The traffic of the second interface is rate-limited, and the second interface is an interface through which the first network device is connected to the third network device.
  • the first determining module 601 is used for:
  • the second network device receiving a message sent by the second network device, the message including the configured bandwidth of the first interface and the bandwidth occupied by traffic flowing through the first interface;
  • the free bandwidth of the interface of the second network device is determined according to the difference between the configured bandwidth of the first interface and the bandwidth occupied by the traffic flowing through the first interface.
  • the first determining module 601 is used for:
  • a message sent by the second network device is received, where the message includes the free bandwidth of the interface of the second network device.
  • the message further includes an ESI or an interface identifier of the first interface, where the ESI or the interface identifier is used to instruct the first network device to determine the second interface.
  • the message further includes an Ethernet label of the first interface, and the ESI and the Ethernet label are used to instruct the first network device to determine the second interface.
  • the message is a BGP route.
  • the message includes a first message and a second message, the configured bandwidth of the first interface is sent through the first message, and the bandwidth occupied by the traffic flowing through the first interface is sent through the first message. Two messages are sent.
  • the sending time intervals of the first message and the second message are different; or, the first message is sent when the configured bandwidth of the first interface changes, and the second message is preset time interval sent.
  • the second determining module 602 is used for:
  • the third network device is also multi-homed and connected to other N network devices, where N is a positive integer, the second determining module 602 Used for:
  • the interface limiting bandwidth is used to limit the rate of upstream traffic or downstream traffic flowing through the second interface.
  • the message further includes traffic direction information
  • the traffic direction information is used to indicate that the configured bandwidth of the first interface and the bandwidth occupied by the traffic flowing through the first interface carried in the message are the bandwidth information of the upstream traffic flowing through the first interface or the bandwidth information of the upstream traffic flowing through the first interface. bandwidth information of downlink traffic flowing through the first interface; or,
  • the traffic direction information is used to indicate that the interface free bandwidth carried in the message is bandwidth information of upstream traffic flowing through the first interface or bandwidth information of downstream traffic flowing through the first interface.
  • the first network device determines the limited bandwidth of the interface of the first network device according to the free bandwidth of the interface of the second network device and the configured bandwidth of the second interface. Subsequently, the first network device may limit the rate of user traffic according to the bandwidth limit of the interface. Since the first network device and the second network device are used for load sharing of user traffic, the first network device limits the bandwidth according to the interface free bandwidth of the second network device, that is, the interface determined according to the bandwidth occupancy of the second network device To be more accurate, the first network device can limit the bandwidth according to the interface to implement a more reasonable rate limit for user traffic, so as to ensure the purpose of saving network resources on the basis that the user experience is not damaged.
  • the first network device provided in the above embodiment performs traffic rate limiting
  • only the division of the above functional modules is used as an example for illustration.
  • the above functions may be allocated to different functional modules as required.
  • To complete that is, to divide the internal structure of the device into different functional modules to complete all or part of the functions described above.
  • the first network device and the traffic rate limiting method provided in the above embodiments belong to the same concept, and the specific implementation process is detailed in the method embodiments, which will not be repeated here.
  • FIG. 7 is a schematic structural diagram of a second network device provided by an embodiment of the present application.
  • the second network device may be implemented by software, hardware, or a combination of the two, and the second network device may be the network device shown in FIG. 5 .
  • the second network device is applied to a network system, and the network system includes a first network device, a second network device, and a third network device, and the third network device is multi-homed and connected to the first network device and the second network device.
  • the second network device includes: a first determining module 701 and a sending module 702;
  • the first determining module 701 is configured to determine the configured bandwidth of the first interface and the bandwidth occupied by the traffic flowing through the first interface, where the first interface is the connection between the second network device and the third network device. interface;
  • a sending module 702 configured to send a message to the first network device according to the configured bandwidth of the first interface and the bandwidth occupied by the traffic flowing through the first interface, where the message is used to instruct the first network device to The message performs rate limiting on the traffic of the third network device; wherein the message includes the configured bandwidth of the first interface and the bandwidth occupied by the traffic flowing through the first interface, or the message includes The free bandwidth of the interface of the second network device, where the free bandwidth of the interface of the second network device is the bandwidth that is not occupied in the configured bandwidth of the first interface.
  • the message further includes an ESI or an interface identifier of the first interface, where the ESI or the interface identifier is used to instruct the first network device to determine a second interface, and the second interface is the The first network device is connected to the interface of the third network device.
  • the message further includes an Ethernet label of the first interface, and the ESI and the Ethernet label are used to instruct the first network device to determine the second interface.
  • the message further includes traffic direction information; the traffic direction information is used to indicate that the configured bandwidth of the first interface carried in the message and the bandwidth occupied by the traffic flowing through the first interface are the The bandwidth information of the upstream traffic of the first interface or the bandwidth information of the downstream traffic flowing through the first interface; or,
  • the traffic direction information is used to indicate that the interface free bandwidth carried in the message is bandwidth information of upstream traffic flowing through the first interface or bandwidth information of downstream traffic flowing through the first interface.
  • the message is a BGP route.
  • the message includes a first message and a second message, the configured bandwidth of the first interface is sent through the first message, and the bandwidth occupied by the traffic flowing through the first interface is sent through the first message. Two messages are sent.
  • the sending time intervals of the first message and the second message are different; or, the first message is sent when the configured bandwidth of the first interface changes, and the second message is preset time interval sent.
  • the second network device may send the configured bandwidth of the first interface and the bandwidth occupied by the traffic flowing through the first interface to the first network device, or may send the free bandwidth of the interface of the second network device to the first network device.
  • the first network device Accordingly, the first network device can learn the bandwidth occupation of the second network device. Since the first network device and the second network device are used for load sharing of user traffic, the first network device can implement a more reasonable rate limit on the user traffic of the third network device according to the bandwidth occupancy of the second network device , in order to ensure the purpose of saving network resources on the basis that the user experience is not damaged.
  • the second network device provided in the above embodiment performs traffic rate limiting
  • only the division of the above functional modules is used as an example for illustration.
  • the above functions may be allocated to different functional modules as required.
  • To complete that is, to divide the internal structure of the device into different functional modules to complete all or part of the functions described above.
  • the second network device provided in the above embodiment and the traffic rate limiting method embodiment belong to the same concept, and the specific implementation process thereof is detailed in the method embodiment, which will not be repeated here.
  • the computer program product includes one or more computer instructions.
  • the computer may be a general purpose computer, special purpose computer, computer network or other programmable device.
  • the computer instructions may be stored in or transmitted from one computer readable storage medium to another computer readable storage medium, for example, the computer instructions may be downloaded from a website site, computer, server or data center Transmission to another website site, computer, server or data center by wired (eg coaxial cable, optical fiber, Digital Subscriber Line, DSL) or wireless (eg: infrared, wireless, microwave, etc.).
  • the computer-readable storage medium can be any available medium that can be accessed by a computer, or a data storage device such as a server, a data center, etc. that includes one or more available media integrated.
  • the available media may be magnetic media (eg: floppy disk, hard disk, magnetic tape), optical media (eg: Digital Versatile Disc (DVD)) or semiconductor media (eg: Solid State Disk (SSD)) Wait.

Landscapes

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

Abstract

一种流量限速方法、相关网络设备及***,属于通信技术领域。在该方法中,第三网络设备多归属连接到第一网络设备和第二网络设备。第一网络设备可以根据第二网络设备的接口空余带宽和第二接口的配置带宽,确定第一网络设备的接口限制带宽。后续第一网络设备可以根据该接口限制带宽来对用户流量进行限速。由于第一网络设备和第二网络设备用于对用户流量进行负载分担,所以第一网络设备根据第二网络设备的接口空余带宽,即根据第二网络设备的带宽占用情况确定出的接口限制带宽比较准确,第一网络设备根据该接口限制带宽可以实现对用户流量进行更为合理的限速,以实现在用户体验不受损的基础上节约网络资源的目的。

Description

流量限速方法、相关网络设备和存储介质
本申请实施例要求于2020年7月29日提交的申请号为202010747256.4、发明名称为“流量限速方法、相关网络设备和存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请实施例中。
技术领域
本申请实施例涉及通信技术领域,特别涉及一种流量限速方法、相关网络设备和存储介质。
背景技术
虚拟私有网络(Virtual Private Network,VPN)技术在各大运营商的网络设计中被广泛使用。VPN中包括多个运营商边缘(Provider Edge,PE)设备,该多个PE设备互相连接。用户边缘(Customer Edge,CE)设备可以连接该VPN内的PE设备,以使得挂载在该CE设备上的用户设备接入该VPN。
目前,为了提升可靠性,可以使用双归双活方案。具体地,CE设备双归属连接到PE1设备和PE2设备。PE1设备和PE2设备以负载分担的方式向其他设备转发来自CE设备的用户上行流量,且以负载分担的方式向CE设备转发来自其他设备的用户下行流量。
然而,上述双归双活方案中,难以实现对流量的灵活和合理限速。假设运营商签约提供给用户的业务流量带宽限速为100兆比特每秒(Mbps)。考虑PE1设备和PE2设备可以进行负载分担,若将PE1设备和PE2设备的限速值均设置为50Mbps,由于网络在实际运行过程中难以保证绝对地双侧负载均衡,某些情况下甚至会出现用户流量均通过PE1设备一侧转发,也即实际的用户流量限速至50Mbps,导致影响报文的正常传输,降低了用户体验。然而,如果为了保证用户体验不低于预期,而将PE1设备和PE2设备的限速值均设置为100Mbps,则用户流量的实际限速峰值为200Mbps,这又不利于运营商合理分配有限的网络资源。
发明内容
本申请实施例提供了一种流量限速方法、相关网络设备和存储介质,可以实现对流量的灵活和合理限速。
第一方面,提供了一种流量限速方法。该方法应用于网络***,该网络***包括第一网络设备、第二网络设备和第三网络设备,第三网络设备多归属连接到第一网络设备和第二网络设备。该第一网络设备和第二网络设备可以是PE设备,该第三网络设备可以是CE设备。
在该方法中,第一网络设备确定第二网络设备的接口空余带宽,然后根据第二网络设备的接口空余带宽和第二接口的配置带宽,确定第一网络设备的接口限制带宽。
第二网络设备的接口空余带宽是第一接口的配置带宽中未被占用的带宽。第一接口是第二网络设备连接到第三网络设备的接口。
第一接口是第二网络设备用来接收来自第三网络设备的上行流量或用来向第三网络设备 发送下行流量的接口。在一些情形下,第三网络设备发出的上行流量以及发往第三网络设备的下行流量可以均流经第一接口,如同一聚合接口。第一接口的配置带宽是第二网络设备为第一接口配置的用于转发流量(上行流量或下行流量)的带宽。
第二网络设备的接口空余带宽是第二网络设备为第一接口配置的带宽中当前处于未占用状态的带宽,即是第一接口的配置带宽中暂未用于传输流量的空余带宽。相应地,当第一接口的配置带宽针对的是上行流量时,第二网络设备的接口空余带宽也针对的是上行流量;当第一接口的配置带宽针对的是下行流量时,第二网络设备的接口空余带宽也针对的是下行流量。
第二接口是第一网络设备用来接收来自第三网络设备的上行流量或用来向第三网络设备发送下行流量的接口。在一些情形下,第三网络设备发出的上行流量以及发往第三网络设备的下行流量可以均流经第二接口,如同一聚合接口。第二接口的配置带宽是第一网络设备为第二接口配置的用于转发流量(上行流量或下行流量)的带宽。
第一网络设备的接口限制带宽用于对流经第二接口的流量进行限速,具体可以是对流经第二接口的上行流量或下行流量进行限速。若第二网络设备的接口空余带宽和第二接口的配置带宽均是针对上行流量的,则所确定出的第一网络设备的接口限制带宽也是针对上行流量的,即第一网络设备的接口限制带宽用于对流经第二接口的上行流量进行限速;若第二网络设备的接口空余带宽和第二接口的配置带宽均是针对下行流量的,则所确定出的第一网络设备的接口限制带宽也是针对下行流量的,即第一网络设备的接口限制带宽用于对流经第二接口的下行流量进行限速。
可选地,该消息可以为边界网关协议(Border Gateway Protocol,BGP)路由,也可以为其他能够携带带宽信息的消息。
在本申请实施例中,第一网络设备确定自身的接口限制带宽后,可以根据该接口限制带宽来对用户流量进行限速。由于第一网络设备和第二网络设备用于对用户流量进行负载分担,所以第一网络设备根据第二网络设备的接口空余带宽,即根据第二网络设备的带宽占用情况确定出的接口限制带宽比较准确,第一网络设备根据该接口限制带宽可以实现对用户流量进行更为合理的限速,以实现在用户体验不受损的基础上节约网络资源的目的。
在一种可能的实现方式中,第一网络设备确定第二网络设备的接口空余带宽的操作可以为:第一网络设备接收第二网络设备发送的消息,该消息包括第一接口的配置带宽和流经第一接口的流量占用的带宽;第一网络设备根据第一接口的配置带宽和流经第一接口的流量占用的带宽的差值,确定第二网络设备的该接口空余带宽。
可选地,该消息可以是一个消息,这一个消息中同时包括第一接口的配置带宽和流经第一接口的流量占用的带宽。这种情况下,这一个消息可以在第一接口的配置带宽发生变化时发送,或者可以以预设时间间隔发送。
或者,该消息可以是两个消息,如该消息可以包括第一消息和第二消息。第一消息包括第一接口的配置带宽,即第一接口的配置带宽通过第一消息发送。第二消息包括流经第一接口的流量占用的带宽,即流经第一接口的流量占用的带宽通过第二消息发送。这种情况下,第一消息和第二消息的发送时间间隔不同;或者,第一消息在第一接口的配置带宽发生变化时发送,第二消息以预设时间间隔发送。
在一种可能的实现方式中,第一网络设备确定第二网络设备的接口空余带宽的操作可以 为:第一网络设备接收第二网络设备发送的消息,该消息包括第二网络设备的该接口空余带宽。
在一种可能的实现方式中,该消息还包括第一接口的以太网段标识(Ethernet Segment Identifier,ESI)或接口标识,该ESI或该接口标识用于指示第一网络设备确定第二接口。也就是说,第一网络设备接收到该消息后,可以根据该消息中的第一接口的ESI或接口标识确定与第一接口对应的第二接口。
在以太网虚拟私有网络(Ethernet Virtual Private Network,EVPN)网络中,存在多归关系的第一网络设备和第二网络设备可以具有相同的ESI,其中第一网络设备可以基于该ESI确定第一网络设备中用于与第三网络设备连接的第一接口,第二网络设备可以基于该ESI确定第二网络设备中用于与第三网络设备连接的第二接口。而在非EVPN网络中,可以通过为第一网络设备和第二网络设备分别分配相应的接口标识,以通过在第二网络设备发送的消息中携带用于标识第一接口的接口标识,使得第一网络设备确定与第一接口的接口标识对应的第二接口,其中,第一接口和第二接口的接口标识可以相同,或者第一接口和第二接口的接口标识可以具有某种对应关系。如此,后续第一网络设备可以根据第二网络设备的接口空余带宽(即第一接口的空余带宽)对第二接口的带宽进行设置。
进一步地,该消息还包括第一接口的以太网标签,该ESI和该以太网标签用于指示第一网络设备确定第二接口。一些可能的情形中,以太网标签可以是虚拟局域网标识(virtual local network identifier,VLAN ID)。例如,第一网络设备根据ESI可以确定聚合接口,该聚合接口包括一个或多个子接口,第一网络设备可以根据该接收的VLAN ID确定该聚合接口中的某一子接口为第二接口。
在一种可能的实现方式中,该消息还可以包括流量方向信息。该流量方向信息用于指示该消息携带的第一接口的配置带宽和流经第一接口的流量占用的带宽是流经第一接口的上行流量的带宽信息还是流经第一接口的下行流量的带宽信息;或者,该流量方向信息用于指示该消息携带的接口空余带宽是流经第一接口的上行流量的带宽信息还是流经第一接口的下行流量的带宽信息。
当该流量方向信息指示该消息携带的是上行流量的带宽信息时,第一网络设备根据该消息确定出的第二网络设备的接口空余带宽也针对的是上行流量,相应地后续据此也是对第二接口的用于转发上行流量的带宽进行配置。当该流量方向信息指示该消息携带的是下行流量的带宽信息时,第一网络设备根据该消息确定出的第二网络设备的接口空余带宽也针对的是下行流量,相应地后续据此也是对第二接口的用于转发下行流量的带宽进行配置。
在一种可能的实现方式中,第一网络设备根据第二网络设备的接口空余带宽和第二接口的配置带宽,确定第一网络设备的接口限制带宽的操作可以为:第一网络设备根据第二网络设备的该接口空余带宽和第二接口的配置带宽之和,确定第一网络设备的该接口限制带宽;或者,第一网络设备先获取第二网络设备的该接口空余带宽和第二接口的配置带宽之和,并将求和结果与控制系数相乘,以确定第一网络设备的该接口限制带宽;或者也可以根据第二网络设备的接口空余带宽和第二接口的配置带宽,执行其他预设规则的操作以获取接口限制带宽。
这种实现方式适用于双归双活场景。双归双活场景下,第三网络设备通过第一网络设备和第二网络设备来发送上行流量或接收下行流量。因而,第一网络设备可以直接根据第二网 络设备的带宽占用情况调整自己实时生效的带宽限速配置。
在一种可能的实现方式中,除第一网络设备和第二网络设备之外,第三网络设备还多归属连接到N个其他网络设备,N为正整数,第一网络设备根据第二网络设备的接口空余带宽和第二接口的配置带宽,确定第一网络设备的接口限制带宽的操作可以为:第一网络设备根据第二网络设备的接口空余带宽、该N个其他网络设备的一个或多个接口空余带宽和控制系数,确定可用的接口空余带宽,该控制系数的个数可以为一个或多个,所述一个或多个控制系数的取值可以均大于0且小于1。当控制系数为一个时,第一网络设备可以确定一个或多个其他网络设备的一个或多个接口空余带宽均对应于该控制系数。当控制系数为多个时,第一网络设备可以确定多个其他网络设备的多个接口空余带宽分别对应于该多个控制系数。第一网络设备根据该可用的接口空余带宽和第二接口的配置带宽,确定第一网络设备的该接口限制带宽。
这种实现方式适用于多归多活场景。多归多活场景下,第三网络设备通过第一网络设备、第二网络设备和该N个其他网络设备进行负载分担而发送上行流量或接收下行流量。因而,第一网络设备可以需要根据第二网络设备以及该N个网络设备的带宽占用情况调整实时生效的带宽限速配置。
第二方面,提供了一种第一网络设备,第一网络设备应用于网络***,该网络***包括第一网络设备、第二网络设备和第三网络设备,第三网络设备多归属连接到第一网络设备和第二网络设备。所述第一网络设备具有实现上述第一方面或第一方面任一实现方式中流量限速方法行为的功能。所述第一网络设备包括至少一个模块,所述至少一个模块用于实现上述第一方面所提供的流量限速方法。
在一种可能的实现方式中,所述第一网络设备包括:第一确定模块和第二确定模块。第一确定模块,用于确定所述第二网络设备的接口空余带宽,所述第二网络设备的接口空余带宽是第一接口的配置带宽中未被占用的带宽,所述第一接口是所述第二网络设备连接到所述第三网络设备的接口。第二确定模块,用于根据所述第二网络设备的接口空余带宽和第二接口的配置带宽,确定所述第一网络设备的接口限制带宽,所述接口限制带宽用于对流经所述第二接口的流量进行限速,所述第二接口是所述第一网络设备连接到所述第三网络设备的接口。
在一种可能的实现方式中,所述第一确定模块用于:接收所述第二网络设备发送的消息,所述消息包括所述第一接口的配置带宽和流经所述第一接口的流量占用的带宽;根据所述第一接口的配置带宽和流经所述第一接口的流量占用的带宽的差值,确定所述第二网络设备的所述接口空余带宽。
在一种可能的实现方式中,所述第一确定模块用于:接收所述第二网络设备发送的消息,所述消息包括所述第二网络设备的所述接口空余带宽。
在一种可能的实现方式中,所述消息还包括所述第一接口的以太网段标识ESI或接口标识,所述ESI或所述接口标识用于指示所述第一网络设备确定所述第二接口。
在一种可能的实现方式中,所述消息还包括所述第一接口的以太网标签,所述ESI和所述以太网标签用于指示所述第一网络设备确定所述第二接口。
在一种可能的实现方式中,所述消息为边界网关协议BGP路由。
在一种可能的实现方式中,所述消息包括第一消息和第二消息,所述第一接口的配置带宽通过所述第一消息发送,所述流经所述第一接口的流量占用的带宽通过所述第二消息发送。
在一种可能的实现方式中,所述第一消息和所述第二消息的发送时间间隔不同;或者,所述第一消息在所述第一接口的配置带宽发生变化时发送,所述第二消息以预设时间间隔发送。
在一种可能的实现方式中,所述第二确定模块用于:根据所述第二网络设备的所述接口空余带宽和所述第二接口的配置带宽之和,确定所述第一网络设备的所述接口限制带宽。
在一种可能的实现方式中,除所述第一网络设备和所述第二网络设备之外,所述第三网络设备还多归属连接到其他N个网络设备,N为正整数。
所述第二确定模块用于:根据所述第二网络设备的接口空余带宽、所述其他N个网络设备的一个或多个接口空余带宽和控制系数,确定可用的接口空余带宽,所述控制系数可以大于0且小于1,或者也可以是其他取值;根据所述可用的接口空余带宽和所述第二接口的配置带宽,确定所述第一网络设备的所述接口限制带宽。
在一种可能的实现方式中,所述接口限制带宽用于对流经所述第二接口的上行流量或下行流量进行限速。
在一种可能的实现方式中,所述消息还包括流量方向信息。所述流量方向信息用于指示所述消息携带的所述第一接口的配置带宽和流经所述第一接口的流量占用的带宽是流经所述第一接口的上行流量的带宽信息或者是流经所述第一接口的下行流量的带宽信息;或者,所述流量方向信息用于指示所述消息携带的所述接口空余带宽是流经所述第一接口的上行流量的带宽信息或者是流经所述第一接口的下行流量的带宽信息。
第三方面,提供了一种第一网络设备,所述第一网络设备的结构中包括处理器和存储器,所述存储器用于存储支持第一网络设备执行上述第一方面或第一方面任一可能的实现方式中所提供的流量限速方法的程序,以及存储用于实现上述第一方面所述的流量限速方法所涉及的数据。所述处理器被配置为用于执行所述存储器中存储的程序以实现上述第一方面或第一方面任一可能的实现方式中所涉及的方法。所述第一网络设备还可以包括收发器,所述收发器用于接收和/或发送上述第一方面或第一方面任一可能的实现方式中所涉及的数据。
第四方面,提供了一种计算机可读存储介质,所述计算机可读存储介质中存储有指令,当其在计算机上运行时,使得计算机执行上述第一方面或第一方面任一可能的实现方式中所述的流量限速方法。
第五方面,提供了一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行上述第一方面或第一方面任一可能的实现方式中所述的流量限速方法。
上述第二方面、第三方面、第四方面和第五方面所获得的技术效果与上述第一方面中对应的技术手段获得的技术效果近似,在这里不再赘述。
第六方面,提供了一种流量限速方法。该方法应用于网络***,该网络***包括第一网络设备、第二网络设备和第三网络设备,第三网络设备多归属连接到第一网络设备和第二网络设备。在该方法中,第二网络设备确定第一接口的配置带宽和流经第一接口的流量占用的带宽,然后根据第一接口的配置带宽和流经第一接口的流量占用的带宽,向第一网络设备发 送消息,该消息用于指示第一网络设备根据该消息对第三网络设备的流量进行限速。
第一接口是第二网络设备连接到第三网络设备的接口。第一接口是第二网络设备用来接收来自第三网络设备的上行流量或用来向第三网络设备发送下行流量的接口。在一些情形下,第三网络设备发出的上行流量以及发往第三网络设备的下行流量可以均流经第一接口,如同一聚合接口。第一接口的配置带宽是第二网络设备为第一接口配置的用于转发流量(上行流量或下行流量)的带宽。
其中,该消息包括第一接口的配置带宽和流经第一接口的流量占用的带宽,或者,该消息包括第二网络设备的接口空余带宽。
第二网络设备的接口空余带宽是第一接口的配置带宽中未被占用的带宽。第二网络设备的接口空余带宽是第二网络设备为第一接口配置的带宽中当前处于未占用状态的带宽,即是第一接口的配置带宽中暂未用于传输流量的空余带宽。相应地,当第一接口的配置带宽针对的是上行流量时,第二网络设备的接口空余带宽也针对的是上行流量;当第一接口的配置带宽针对的是下行流量时,第二网络设备的接口空余带宽也针对的是下行流量。
当该消息包括第一接口的配置带宽和流经第一接口的流量占用的带宽时,该消息可以是一个消息,这一个消息中同时包括第一接口的配置带宽和流经第一接口的流量占用的带宽。这种情况下,这一个消息可以在第一接口的配置带宽发生变化时发送,或者可以以预设时间间隔发送。预设时间间隔可以由第二网络设备自身设置,可以设置的较长,也可以设置的较短,具体可以根据需要设置。或者,该消息可以是两个消息,如该消息可以包括第一消息和第二消息。第一消息包括第一接口的配置带宽,即第一接口的配置带宽通过第一消息发送。第二消息包括流经第一接口的流量占用的带宽,即流经第一接口的流量占用的带宽通过第二消息发送。这种情况下,第一消息和第二消息的发送时间间隔不同;或者,第一消息在第一接口的配置带宽发生变化时发送,第二消息以预设时间间隔发送。
当该消息包括第二网络设备的接口空余带宽时,第二网络设备可以将第一接口的配置带宽减去流经第一接口的流量占用的带宽,得到第二网络设备的接口空余带宽。
可选地,该消息可以为边界网关协议BGP路由,也可以为其他能够携带带宽信息的消息。
在本申请实施例中,第二网络设备可以将第一接口的配置带宽和流经第一接口的流量占用的带宽发送给第一网络设备,或者可以将第二网络设备的接口空余带宽发送给第一网络设备。第一网络设备据此可以获知第二网络设备的带宽占用情况。由于第一网络设备和第二网络设备用于对用户流量进行负载分担,所以第一网络设备根据第二网络设备的带宽占用情况可以实现对第三网络设备的用户流量进行更为合理的限速,以保证在用户体验不受损的基础上节约网络资源的目的。
在一种可能的实现方式中,,该消息还包括第一接口的以太网段标识ESI或接口标识,该ESI或该接口标识用于指示第一网络设备确定第二接口。
第二接口是第一网络设备连接到第三网络设备的接口。第二接口是第一网络设备用来接收来自第三网络设备的上行流量或用来向第三网络设备发送下行流量的接口。在一些情形下,第三网络设备发出的上行流量以及发往第三网络设备的下行流量可以均流经第二接口,如同一聚合接口。
在EVPN中,存在多归关系的第一网络设备和第二网络设备可以具有相同的ESI,其中第一网络设备可以基于该ESI确定第一网络设备中用于与第三网络设备连接的第一接口,第 二网络设备可以基于该ESI确定第二网络设备中用于与第三网络设备连接的第二接口。而在非EVPN网络中,可以通过为第一网络设备和第二网络设备分别分配相应的接口标识,以通过在第二网络设备发送的消息中携带用于标识第一接口的接口标识,使得第一网络设备确定与第一接口的接口标识对应的第二接口,其中,第一接口和第二接口的接口标识可以相同,或者第一接口和第二接口的接口标识可以具有某种对应关系。如此,后续第一网络设备可以根据第二网络设备的接口空余带宽(即第一接口的空余带宽)对第二接口的带宽进行设置。
进一步地,该消息还包括第一接口的以太网标签,该ESI和该以太网标签用于指示第一网络设备确定第二接口。一些可能的情形中,以太网标签可以是VLAN ID。例如,第一网络设备根据ESI可以确定聚合接口,该聚合接口包括一个或多个子接口,第一网络设备可以根据该接收的VLAN ID确定该聚合接口中的某一子接口为第二接口。
在一种可能的实现方式中,,该消息还可以包括流量方向信息。该流量方向信息用于指示该消息携带的第一接口的配置带宽和流经第一接口的流量占用的带宽是流经第一接口的上行流量的带宽信息还是流经第一接口的下行流量的带宽信息;或者,该流量方向信息用于指示该消息携带的接口空余带宽是流经第一接口的上行流量的带宽信息还是流经第一接口的下行流量的带宽信息。
当该流量方向信息指示该消息携带的是上行流量的带宽信息时,第一网络设备根据该消息确定出的第二网络设备的接口空余带宽也针对的是上行流量,相应地后续据此也是对第二接口的用于转发上行流量的带宽进行配置。当该流量方向信息指示该消息携带的是下行流量的带宽信息时,第一网络设备根据该消息确定出的第二网络设备的接口空余带宽也针对的是下行流量,相应地后续据此也是对第二接口的用于转发下行流量的带宽进行配置。
第七方面,提供了一种第二网络设备,第二网络设备应用于网络***,该网络***包括第一网络设备、第二网络设备和第三网络设备,第三网络设备多归属连接到第一网络设备和第二网络设备。所述第二网络设备具有实现上述第六方面或第六方面任一可能的实现方式中流量限速方法行为的功能。所述第二网络设备包括至少一个模块,所述至少一个模块用于实现上述第六方面所提供的流量限速方法。
在一种可能的实现方式中,第二网络设备包括:第一确定模块和发送模块。第一确定模块,用于确定第一接口的配置带宽和流经所述第一接口的流量占用的带宽,所述第一接口是所述第二网络设备连接到所述第三网络设备的接口。发送模块,用于根据所述第一接口的配置带宽和流经所述第一接口的流量占用的带宽,向所述第一网络设备发送消息,所述消息用于指示第一网络设备根据所述消息对所述第三网络设备的流量进行限速。其中,所述消息包括所述第一接口的配置带宽和流经所述第一接口的流量占用的带宽,或者,所述消息包括所述第二网络设备的接口空余带宽,所述第二网络设备的接口空余带宽是所述第一接口的配置带宽中未被占用的带宽。
在一种可能的实现方式中,所述消息还包括所述第一接口的以太网段标识ESI或接口标识,所述ESI或所述接口标识用于指示所述第一网络设备确定第二接口,所述第二接口是所述第一网络设备连接到所述第三网络设备的接口。
在一种可能的实现方式中,所述消息还包括所述第一接口的以太网标签,所述ESI和所述以太网标签用于指示所述第一网络设备确定所述第二接口。
在一种可能的实现方式中,所述消息还包括流量方向信息。所述流量方向信息用于指示所述消息携带的所述第一接口的配置带宽和流经所述第一接口的流量占用的带宽是流经所述第一接口的上行流量的带宽信息或者是流经所述第一接口的下行流量的带宽信息;或者,所述流量方向信息用于指示所述消息携带的所述接口空余带宽是流经所述第一接口的上行流量的带宽信息或者是流经所述第一接口的下行流量的带宽信息。
在一种可能的实现方式中,所述消息为边界网关协议BGP路由。
在一种可能的实现方式中,所述消息包括第一消息和第二消息,所述第一接口的配置带宽通过所述第一消息发送,所述流经所述第一接口的流量占用的带宽通过所述第二消息发送。
在一种可能的实现方式中,所述第一消息和所述第二消息的发送时间间隔不同;或者,所述第一消息在所述第一接口的配置带宽发生变化时发送,所述第二消息以预设时间间隔发送。
第八方面,提供了一种第二网络设备,所述第二网络设备的结构中包括处理器和存储器,所述存储器用于存储支持第二网络设备执行上述第六方面或第六方面任一可能的实现方式中所提供的流量限速方法的程序,以及存储用于实现上述第六方面所述的流量限速方法所涉及的数据。所述处理器被配置为用于执行所述存储器中存储的程序以执行上述第六方面或第六方面任一可能的实现方式中涉及的方法。所述第二网络设备还可以包括收发器,所述收发器用于接收和/或发送上述第六方面或第六方面任一可能的实现方式中所涉及的数据。
第九方面,提供了一种计算机可读存储介质,所述计算机可读存储介质中存储有指令,当其在计算机上运行时,使得计算机执行上述第六方面或第六方面任一可能的实现方式中所述的流量限速方法。
第十方面,提供了一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行上述第六方面或第六方面任一可能的实现方式中所述的流量限速方法。
上述第七方面、第八方面、第九方面和第十方面所获得的技术效果与上述第六方面中对应的技术手段获得的技术效果近似,在这里不再赘述。
附图说明
图1是本申请实施例提供的一种网络***示意图;
图2是本申请实施例提供的第一种流量限速方法的流程图;
图3是本申请实施例提供的第二种流量限速方法的流程图;
图4是本申请实施例提供的第三种流量限速方法的流程图;
图5是本申请实施例提供的一种网络设备的结构示意图;
图6是本申请实施例提供的一种第一网络设备的结构示意图;
图7是本申请实施例提供的一种第二网络设备的结构示意图。
具体实施方式
为使本申请实施例的目的、技术方案和优点更加清楚,下面将结合附图对本申请的实施方式作进一步地详细描述。
应当理解的是,本申请实施例提及的“多个”是指两个或两个以上。在本申请实施例的 描述中,除非另有说明,“/”表示或的意思,例如,A/B可以表示A或B;本文中的“和/或”仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,为了便于清楚描述本申请实施例的技术方案,采用了“第一”、“第二”等字样对功能和作用基本相同的相同项或相似项进行区分。本领域技术人员可以理解“第一”、“第二”等字样并不对数量和执行次序进行限定,并且“第一”、“第二”等字样也并不限定一定不同。
在对本申请实施例进行详细地解释说明之前,对本申请实施例涉及的应用场景予以说明。
本申请实施例涉及的网络***包括第一网络设备、第二网络设备和第三网络设备。第三网络设备多归属连接到第一网络设备和第二网络设备。当然,除第一网络设备和第二网络设备之外,第三网络设备还可以多归属连接到其他N个网络设备,N为正整数。第三网络设备可以通过第一网络设备和第二网络设备接收流量,也可以通过第一网络设备和第二网络设备发送流量。
从第三网络设备经第一网络设备至远端网络设备的方向是上行方向,从第三网络设备经第二网络设备至远端网络设备的方向也是上行方向。上行方向上的流量可以称为上行流量。该上行流量例如可以是源自第三网络设备挂载的用户设备的流量,也可以是源自第三网络设备的流量,或者是源自与第三网络设备连接的其他网络设备或该其他网络设备挂载的用户设备的流量。在一些情形下,该上行流量也可以是经由该第一网络设备发送至与第一网络设备直连的网络设备,或经由第二网络设备发送至与第二网络设备直连的网络设备。
从远端网络设备经第一网络设备至第三网络设备的方向是下行方向,从远端网络设备经第二网络设备至第三网络设备的方向也是下行方向。下行方向上的流量可以称为下行流量。该下行流量例如可以是远端用户设备或其他远端网络设备发送至第三网络设备的流量,该流量由第三网络设备接收后,可以转发至与第三网络设备连接的用户设备或网络设备,或者进行本地处理和存储。在一些情形下,该下行流量也可以是与第一网络设备或第二网络设备直连的网络设备发送的。
第一网络设备和第二网络设备均可以是具备数据转发功能的设备,如可以是PE设备,具体可以是交换机、路由器等。第三网络设备可以是具备数据转发功能的设备,也可以是用户侧网络设备,如可以是CE设备。第一网络设备、第二网络设备和第三网络设备的设备类型可以相同也可以不同。
图1是本申请实施例提供的一种网络***示意图。以第三网络设备为CE 21设备、第一网络设备为PE 11设备、第二网络设备为PE 12设备为例来进行说明。该网络***可以通过内部网关协议(Interior Gateway Protocol,IGP)、多协议标签交换技术(Multiprotocol Label Switching,MPLS)、或边界网关协议(Border Gateway Protocol,BGP)建立,使得CE 21设备、PE 11设备、PE 12设备之间路由可达。
图1示出的网络***可以作为本申请实施例的一种应用场景。参见图1,该网络***包括CE 21设备、PE 11设备和PE 12设备。也即,CE 21设备双归属连接到PE 11设备和PE 12设备。PE 11设备和PE 12设备互为BGP邻居设备。该网络***还包括PE 13设备,PE 13设备是PE 11设备和PE 12设备的远端BGP邻居设备。其他CE设备(如图1中所示的CE 22设备)可以连接到PE 13设备。
PE 11设备连接到CE 21的接口为接口31。接口31是PE 11设备用来接收来自CE 21设备的上行流量或用来向CE 21设备发送下行流量的接口。在一些情形下,CE 21设备发出的上行流量以及发往CE 21设备的下行流量可以均流经接口31,如同一聚合接口。在另一些情形下,该上行流量和该下行流量流经的接口也可以不同,如不同的聚合接口或同一聚合接口下的不同子接口。PE 12设备连接到CE 21设备的接口为接口32。接口32是PE 12设备用来接收来自CE 21设备的上行流量或用来向CE 21设备发送下行流量的接口。在一些情形下,CE 21设备发出的上行流量以及发往CE 21设备的下行流量也可以均流经接口32。
目前,在双归双活场景下,对于CE 21设备发送至CE 22设备上行流量,PE 11设备和PE 12设备以负载分担的方式向CE 22设备转发来自CE 21设备的上行流量。具体地,PE 11设备可以通过接口31向CE 22设备转发来自CE 21设备的上行流量,PE 12设备可以通过接口32向CE 22设备转发来自CE 21设备的上行流量。对于CE 22设备发送至CE 21设备的用户设备的下行流量,PE 11设备和PE 12设备以负载分担的方式向CE 21设备转发来自CE 22设备的下行流量。具体地,PE 11设备可以通过接口31向CE 21设备转发来自CE 22设备的下行流量,PE 12设备可以通过接口32向CE 21设备转发来自CE 22设备的下行流量。
为保证在尽量不影响用户体验的前提下,实现网络资源的合理分配和利用,本申请实施例提供一种流量限速方法,相应方法可以应用于图1所示的网络***中,以解决无法对流量进行灵活限速的问题。
图2是本申请实施例提供的一种流量限速方法的流程图,该方法可以应用于图1所示的网络***中。参见图2,该方法包括:
201:PE 11设备确定PE 12设备的接口空余带宽。
PE 12设备的接口空余带宽是第一接口的配置带宽中未被占用的带宽。第一接口是PE 12设备连接到CE 21设备的接口,如图1示出的接口32。
第一接口是PE 12设备用来接收来自CE 21设备的上行流量或用来向CE 21设备发送下行流量的接口。在一些情形下,CE 21设备发出的上行流量以及发往CE 21设备的下行流量可以均流经第一接口,如同一聚合接口。
第一接口的配置带宽是PE 12设备为第一接口配置的用于转发流量(上行流量或下行流量)的带宽。第一接口的配置带宽可以由PE 12设备本地静态配置,也可以由诸如控制器等其他网络设备配置后下发到PE 12设备,本申请实施例对此不作唯一限定。
PE 12设备的接口空余带宽是PE 12设备为第一接口配置的带宽中当前处于未占用状态的带宽,即是第一接口的配置带宽中暂未用于传输流量的空余带宽。相应地,当第一接口的配置带宽针对的是上行流量时,PE 12设备的接口空余带宽也针对的是上行流量;当第一接口的配置带宽针对的是下行流量时,PE 12设备的接口空余带宽也针对的是下行流量。
具体地,201的操作可以包括如下两种可能的方式:
第一种可能的方式PE 11设备接收PE 12设备发送的消息,该消息包括第一接口的配置带宽和流经第一接口的流量占用的带宽。PE 11设备根据第一接口的配置带宽和流经第一接口的流量占用的带宽的差值,确定PE 12设备的接口空余带宽。
其中,PE 11设备根据第一接口的配置带宽和流经第一接口的流量占用的带宽的差值,确定PE 12设备的接口空余带宽时,PE 11设备可以直接将第一接口的配置带宽和流经第一接口 的流量占用的带宽的差值作为PE 12设备的接口空余带宽。或者,结合具体的限速需求或场景需求,PE 11设备还可以将第一接口的配置带宽和流经第一接口的流量占用的带宽的差值与k相乘,得到PE 12设备的接口空余带宽。k的取值范围通常大于0且小于1,但在一些可能的情形下,也可以设置成其他取值范围。k可以是PE 11设备静态配置的一个固定值,也可以是允许根据一定的规则灵活、实时调整的数值,本申请实施例对此不作唯一限定。
可选地,该消息可以是一个消息,这一个消息中同时包括第一接口的配置带宽和流经第一接口的流量占用的带宽。这种情况下,这一个消息可以在第一接口的配置带宽发生变化时发送,或者可以以预设时间间隔发送。预设时间间隔可以由PE 12设备自身设置,可以设置的较长,也可以设置的较短,具体可以根据需要设置。
或者,该消息可以是两个消息,如该消息可以包括第一消息和第二消息。第一消息包括第一接口的配置带宽,即第一接口的配置带宽通过第一消息发送。第二消息包括流经第一接口的流量占用的带宽,即流经第一接口的流量占用的带宽通过第二消息发送。这种情况下,第一消息和第二消息的发送时间间隔不同;或者,第一消息在第一接口的配置带宽发生变化时发送,第二消息以预设时间间隔发送。
第一种可能的方式下,PE 12设备确定第一接口的配置带宽和流经第一接口的流量占用的带宽,然后根据获取的第一接口的配置带宽和流经第一接口的流量占用的带宽,向PE 11设备发送消息,该消息中包括第一接口的配置带宽和流经第一接口的流量占用的带宽,用于指示PE 11设备根据该消息对CE 21设备的流量进行限速。
第二种可能的方式PE 11设备接收PE 12设备发送的消息,该消息包括PE 12设备的接口空余带宽。
第二种可能的方式下,PE 12设备确定第一接口的配置带宽和流经第一接口的流量占用的带宽,然后根据第一接口的配置带宽和流经第一接口的流量占用的带宽,直接确定PE 12设备的接口空余带宽,并将该接口空余带宽携带在消息中向PE 11设备发送。该消息中包括的该接口空余带宽,用于指示PE 11设备根据该消息对CE 21设备的流量进行限速。这种方式下,PE 12设备可以将第一接口的配置带宽减去流经第一接口的流量占用的带宽,得到PE 12设备的接口空余带宽。
上述两种可能的方式中PE 12设备将消息发送给PE 11设备时,可以直接将该消息发送给PE 11设备,或者可以通过其他网络设备,如路由反射器(Route Reflector,RR)等将该消息发送给PE 11设备,本申请实施例对此不作唯一限定。
上述两种可能的方式中所述消息还可以包括第一接口的以太网段标识(Ethernet Segment Identifier,ESI)或接口标识。该接口标识用于标识第一接口,可以由PE 12设备本地静态配置,或者可以由诸如控制器等配置后下发到PE 12设备,本申请实施例对此不作唯一限定。
第一接口的ESI或接口标识用于指示PE 11设备确定第二接口。第二接口是PE 11设备连接到CE 21设备的接口,如图1示出的接口31。第二接口是PE 11设备用来接收来自CE 21设备的上行流量或用来向CE 21设备发送下行流量的接口。在一些情形下,CE 21设备发出的上行流量以及发往CE 21设备的下行流量可以均流经第二接口,如同一聚合接口。
也就是说,PE 11设备接收到该消息后,可以根据该消息中的第一接口的ESI或接口标识确定与第一接口对应的第二接口。具体的,在以太网虚拟私有网络(Ethernet Virtual Private Network,EVPN)中,存在多归关系的PE 11设备和PE 12设备可以具有相同的ESI,其中 PE 11设备可以基于该ESI确定PE 11设备中用于与CE 21设备连接的第一接口,PE 12设备可以基于该ESI确定PE 12设备中用于与CE 21设备连接的第二接口。而在非EVPN网络中,可以通过为PE 11设备和PE 12设备分别分配相应的接口标识,以通过在PE 12设备发送的消息中携带用于标识第一接口的接口标识,使得PE 11设备确定与第一接口的接口标识对应的第二接口,其中,第一接口和第二接口的接口标识可以相同,或者第一接口和第二接口的接口标识可以具有某种对应关系。如此,后续PE 11设备可以根据PE 12设备的接口空余带宽(即第一接口的空余带宽)对第二接口的带宽进行设置。
第一接口和第二接口是相对应的,第一接口和第二接口均用于转发CE 21设备发出的上行流量或均用于转发发往CE 21设备的下行流量。
在EVPN中,上述两种可能的方式中所述消息还可以包括第一接口的以太网标签(Ethernet tag),第一接口的ESI和以太网标签用于共同指示PE 11设备确定第二接口。一些可能的情形中,以太网标签可以是虚拟局域网标识(virtual local network identifier,VLAN ID)。作为一种可能的示例,PE 11设备根据ESI可以确定聚合接口,该聚合接口包括一个或多个子接口,PE 11设备可以根据该接收的VLAN ID确定该聚合接口中的某一子接口为第二接口。作为可能的具体实现,当第一接口对应唯一一个VLAN时,VLAN ID可以是PE 12设备确定的该唯一一个VLAN的标识,而当第一接口对应多个VLAN时,VLAN ID可以是PE 12设备从该多个VLAN中确定的其中一个VLAN(如多个VLAN中标识值最大或最小的VLAN)的标识。
在非EVPN中,上述两种可能的方式中所述消息还可以包括第一接口对应的VLAN标识,其中所述VLAN标识的确定方式与上述在EVPN中确定VLAN ID的方式类似。PE 11设备在接收到PE 12设备发送的第一接口的VLAN标识和接口标识后,可以根据第一接口的接口标识和VLAN标识确定该第一接口对应的第二接口。当PE 12设备不发送VLAN标识时,例如可以通过静态配置的方式使得仅通过接口标识即可唯一地确定相应的接口。当PE 12设备除了接口标识,还发送VLAN标识时,可以允许属于不同VLAN的接口具有相同的接口标识,此时需要通过接口标识和VLAN标识共同确定相应的接口。
可选地,上述两种可能的方式中所述消息还可以包括流量方向信息。该流量方向信息用于指示该消息携带的第一接口的配置带宽和流经第一接口的流量占用的带宽是流经第一接口的上行流量的带宽信息还是流经第一接口的下行流量的带宽信息;或者,该流量方向信息用于指示该消息携带的接口空余带宽是流经第一接口的上行流量的带宽信息还是流经第一接口的下行流量的带宽信息。
当该流量方向信息指示该消息携带的是上行流量的带宽信息时,PE 11设备根据该消息确定出的PE 12设备的接口空余带宽也针对的是上行流量,相应地后续据此也是对第二接口的用于转发上行流量的带宽进行配置。当该流量方向信息指示该消息携带的是下行流量的带宽信息时,PE 11设备根据该消息确定出的PE 12设备的接口空余带宽也针对的是下行流量,相应地后续据此也是对第二接口的用于转发下行流量的带宽进行配置。
上述两种可能的方式中所述的消息都可以为BGP路由,也可以为其他能够携带带宽信息的消息,本申请实施例对此不作唯一限定。
本申请实施例中可以通过新增BGP路由类型或新增扩展团体(extended communities)属性来携带上述带宽信息(第一接口的配置带宽、流经第一接口的流量占用的带宽或PE 12设 备的接口空余带宽)。
可选地,在诸如EVPN等场景中,该带宽信息可以存在于BGP路由中的网络层可达信息(network layer reachability information,NLRI)属性中。示例地,该NLRI属性中包含的字段可以如下表1所示:
表1
类型Type(1字节)
长度Length(1字节)
路由标识符Route Distinguisher(8字节)
以太网段标识Ethernet Segment Identifier(10字节)
以太网标签Ethernet Tag(4字节)
带宽类型Bandwidth_type(4位)
带宽方向Bandwidth_direction(4位)
带宽Bandwidth(6字节)
源路由器的IP地址Originating Router's IP Address(4或16字节)
其中,Type字段为BGP路由类型。Length字段为NLRI属性的长度。Route Distinguisher字段用来区分不同虚拟局域网(virtual local area network,VLAN)的BGP路由。Ethernet Segment Identifier字段为接口的ESI。Ethernet Tag字段为接口的以太网标签。Bandwidth_direction字段为流量方向信息,用于指示消息中携带的是上行流量的带宽信息还是下行流量的带宽信息。Bandwidth_type字段可以包括三种带宽类型,分别是:配置带宽类型、流量占用带宽类型、空余带宽类型。Bandwidth字段为接口的带宽值。Originating Router's IP Address字段为发送消息的网络设备上配置的源地址,如PE 12设备的IP地址。
本申请实施例仅以上表1为例来对NLRI属性进行说明,上表1并不对本申请实施例构成唯一限定。
可选地,该带宽信息也可以存在于BGP路由的扩展团体属性中,例如可以用于非EVPN网络场景中。示例地,该扩展团体属性中包含的字段可以如下表2所示:
表2
Figure PCTCN2021105133-appb-000001
其中,Extend-Community type字段为新定义扩展团体属性的类型,Extend-Community sub-type字段为新定义扩展团体属性的子类型,该Extend-Community type字段和Extend-Community sub-type字段指示消息携带的为用于调整带宽的信息。Bandwidth_id字段为接口标识。Outer vlan字段和Inner vlan字段包括VLAN标识。Bandwidth字段为接口的带宽值,不同的带宽类型置位C/A/I/O标记位。C:C位置1,表示配置带宽类型。A:A位置1,表示流量占用带宽类型。I:I位置1,表示是下行流量的带宽信息。O:O位置1,表示是上行流量的带宽信息。
表2以消息中携带配置带宽和流量占用带宽为例,还可以结合场景设计其他样式的消息携带格式。例如,在消息中携带的是空余带宽的情形下,可以将表2中的C/A位更改为F位, 并设置该F位置1,表示Bandwidth字段携带的值为空余带宽的值。对于既可以支持在消息中携带配置带宽和流量占用带宽,也支持在消息中携带空余带宽的情形,还可以同时设置C/A/I/O/F标记位。
本申请实施例仅以上表2为例来对扩展团体属性进行说明,上表2并不对本申请实施例构成唯一限定。
202:PE 11设备根据PE 12设备的接口空余带宽和第二接口的配置带宽,确定PE 11设备的接口限制带宽。
第二接口的配置带宽是PE 11设备为第二接口配置的用于转发流量(上行流量或下行流量)的带宽。第二接口的配置带宽可以由PE 11设备本地静态配置,也可以由诸如控制器等其他网络设备配置后下发到PE 11设备。
PE 11设备的接口限制带宽用于对流经第二接口的流量进行限速,具体可以是对流经第二接口的上行流量或下行流量进行限速。若PE 12设备的接口空余带宽和第二接口的配置带宽均是针对上行流量的,则所确定出的PE 11设备的接口限制带宽也是针对上行流量的,即PE11设备的接口限制带宽用于对流经第二接口的上行流量进行限速;若PE 12设备的接口空余带宽和第二接口的配置带宽均是针对下行流量的,则所确定出的PE 11设备的接口限制带宽也是针对下行流量的,即PE 11设备的接口限制带宽用于对流经第二接口的下行流量进行限速。
PE 11设备确定自身的接口限制带宽后,可以根据该接口限制带宽来对用户流量进行限速。由于PE 11设备和PE 12设备用于对用户流量进行负载分担,所以PE 11设备根据PE 12设备的接口空余带宽,即根据PE 12设备的带宽占用情况确定出的接口限制带宽比较准确,PE 11设备根据该接口限制带宽可以实现对用户流量进行更为合理的限速,以保证在用户体验不受损的基础上节约网络资源的目的。
具体地,202的操作可以包括如下两种可能的方式:
第一种可能的方式PE 11设备根据PE 12设备的接口空余带宽和第二接口的配置带宽之和,确定PE 11设备的接口限制带宽。
PE 11设备可以直接将PE 12设备的接口空余带宽和第二接口的配置带宽之和作为PE 11设备的接口限制带宽;或者,PE 11设备可以将PE 12设备的接口空余带宽和第二接口的配置带宽之和与控制系数K 1相乘,得到PE 11设备的接口限制带宽。
第一种可能的方式适用于双归双活场景。双归双活场景下,CE 21设备通过PE 11设备和PE 12设备来发送上行流量或接收下行流量。因而,PE 11设备可以直接根据PE 12设备的带宽占用情况调整自己实时生效的带宽限速配置。
第二种可能的方式除PE 11设备和PE 12设备之外,CE 21设备还多归属连接到其他N个PE设备。PE 11设备根据PE 12设备的接口空余带宽、该N个PE设备的一个或多个接口空余带宽和控制系数,确定可用的接口空余带宽;PE 11设备根据该可用的接口空余带宽和第二接口的配置带宽,确定PE 11设备的接口限制带宽。
其中,在某一段时间内该N个PE设备可能全部向PE 11设备发送了用于通告带宽信息的消息,也可能只有其中M(1≤M<N)个向PE 11设备发送了用于通告带宽信息的消息,而剩余的(N-M)个PE设备不具有接口空余带宽。PE 11设备根据在该段时间内接收到的PE12设备和N个PE设备中的一个或多个PE设备发送的多个消息,确定PE 11设备总共可用 的接口空余带宽。PE 11设备获取该N个网络设备中任意一个网络设备的接口空余带宽的方式与PE 11设备获取PE 12设备的接口空余带宽的方式类似,本申请实施例对此不再赘述。
该控制系数的个数可以是一个,此情形下该控制系数K 2是PE 11设备为PE 12设备和该N个PE设备设置的一个统一的固定值。或者,该控制系数可以有多个,该多个控制系数分别与PE 12设备以及该N个PE设备一一对应。该多个控制系数的取值例如可以是根据N个PE设备的处理性能等确定。示例地,如果PE 11设备与PE 12设备、PE 13设备和PE 14设备共同构成CE 21设备的多归设备,并且PE 11设备在预设时段内接收到PE 12设备和PE 13设备发送的包括接口空余带宽的消息,则PE 11设备可以根据(K 21ⅹPE 12设备的接口空余带宽+K 22ⅹPE 13设备的接口空余带宽),获取PE 11设备可用的接口空余带宽,并根据该可用的接口空余带宽确定PE 11设备的接口限制带宽。其中,K 21为PE 12设备对应的控制系数,K 22为PE 13设备对应的控制系数。
对于上述提及的各种设置控制系数的情形,控制系数的取值范围通常大于0且小于1,但在一些可能的情形下,也可以设置成其他取值范围。
第二种可能的方式适用于多归多活场景。多归多活场景下,CE 21设备通过PE 11设备、PE 12设备和该N个PE设备进行负载分担而发送上行流量或接收下行流量。因而,PE 11设备可以需要根据PE 12设备以及该N个网络设备的带宽占用情况调整实时生效的带宽限速配置。
本申请实施例提供的流量限速方法应用于网络***,该网络***包括第一网络设备、第二网络设备和第三网络设备,第三网络设备多归属连接到第一网络设备和第二网络设备。
下面对第一网络设备进行流量限速的过程进行说明:
图3是本申请实施例提供的一种流量限速方法的流程图,该方法可以由第一网络设备执行,第一网络设备例如可以是图1中的PE 11设备。参见图3,该方法包括:
301:第一网络设备确定第二网络设备的接口空余带宽。
第二网络设备的接口空余带宽是第一接口的配置带宽中未被占用的带宽。第一接口是第二网络设备连接到第三网络设备的接口,如图1示出的接口32。
第一接口是第二网络设备用来接收来自第三网络设备的上行流量或用来向第三网络设备发送下行流量的接口。在一些情形下,第三网络设备发出的上行流量以及发往第三网络设备的下行流量可以均流经第一接口,如同一聚合接口。
第一接口的配置带宽是第二网络设备为第一接口配置的用于转发流量(上行流量或下行流量)的带宽。第一接口的配置带宽可以由第二网络设备本地静态配置,也可以由诸如控制器等其他网络设备配置后下发到第二网络设备,本申请实施例对此不作唯一限定。
第二网络设备的接口空余带宽是第二网络设备为第一接口配置的带宽中当前处于未占用状态的带宽,即是第一接口的配置带宽中暂未用于传输流量的空余带宽。相应地,当第一接口的配置带宽针对的是上行流量时,第二网络设备的接口空余带宽也针对的是上行流量;当第一接口的配置带宽针对的是下行流量时,第二网络设备的接口空余带宽也针对的是下行流量。
具体地,301的操作可以包括如下两种可能的方式:
第一种可能的方式第一网络设备接收第二网络设备发送的消息,该消息包括第一接口 的配置带宽和流经第一接口的流量占用的带宽。第一网络设备根据第一接口的配置带宽和流经第一接口的流量占用的带宽的差值,确定第二网络设备的接口空余带宽。
其中,第一网络设备根据第一接口的配置带宽和流经第一接口的流量占用的带宽的差值,确定第二网络设备的接口空余带宽时,第一网络设备可以直接将第一接口的配置带宽和流经第一接口的流量占用的带宽的差值作为第二网络设备的接口空余带宽。或者,结合具体的限速需求或场景需求,第一网络设备还可以将第一接口的配置带宽和流经第一接口的流量占用的带宽的差值与k相乘,得到第二网络设备的接口空余带宽。k的取值范围通常大于0且小于1,但在一些可能的情形下,也可以设置成其他取值范围。k可以是第一网络设备静态配置的一个固定值,也可以是允许根据一定的规则灵活、实时调整的数值,本申请实施例对此不作唯一限定。
可选地,该消息可以是一个消息,这一个消息中同时包括第一接口的配置带宽和流经第一接口的流量占用的带宽。这种情况下,这一个消息可以在第一接口的配置带宽发生变化时发送,或者可以以预设时间间隔发送。预设时间间隔可以由第二网络设备自身设置,可以设置的较长,也可以设置的较短,具体可以根据需要设置。
或者,该消息可以是两个消息,如该消息可以包括第一消息和第二消息。第一消息包括第一接口的配置带宽,即第一接口的配置带宽通过第一消息发送。第二消息包括流经第一接口的流量占用的带宽,即流经第一接口的流量占用的带宽通过第二消息发送。这种情况下,第一消息和第二消息的发送时间间隔不同;或者,第一消息在第一接口的配置带宽发生变化时发送,第二消息以预设时间间隔发送。
第二种可能的方式第一网络设备接收第二网络设备发送的消息,该消息包括第二网络设备的接口空余带宽。
上述两种可能的方式中所述消息还可以包括第一接口的ESI或接口标识。该接口标识用于标识第一接口,可以由第二网络设备本地静态配置,或者可以由诸如控制器等配置后下发到第二网络设备,本申请实施例对此不作唯一限定。
第一接口的ESI或接口标识用于指示第一网络设备确定第二接口。第二接口是第一网络设备连接到第三网络设备的接口,如图1示出的接口31。第二接口是第一网络设备用来接收来自第三网络设备的上行流量或用来向第三网络设备发送下行流量的接口。在一些情形下,第三网络设备发出的上行流量以及发往第三网络设备的下行流量可以均流经第二接口,如同一聚合接口。
也就是说,第一网络设备接收到该消息后,可以根据该消息中的第一接口的ESI或接口标识确定与第一接口对应的第二接口。具体的,在EVPN中,存在多归关系的第一网络设备和第二网络设备可以具有相同的ESI,其中第一网络设备可以基于该ESI确定第一网络设备中用于与第三网络设备连接的第一接口,第二网络设备可以基于该ESI确定第二网络设备中用于与第三网络设备连接的第二接口。而在非EVPN网络中,可以通过为第一网络设备和第二网络设备分别分配相应的接口标识,以通过在第二网络设备发送的消息中携带用于标识第一接口的接口标识,使得第一网络设备确定与第一接口的接口标识对应的第二接口,其中,第一接口和第二接口的接口标识可以相同,或者第一接口和第二接口的接口标识可以具有某种对应关系。如此,后续第一网络设备可以根据第二网络设备的接口空余带宽(即第一接口的空余带宽)对第二接口的带宽进行设置。
第一接口和第二接口是相对应的,第一接口和第二接口均用于转发第三网络设备发出的上行流量或均用于转发发往第三网络设备的下行流量。
在EVPN中,上述两种可能的方式中所述消息还可以包括第一接口的以太网标签,第一接口的ESI和以太网标签用于共同指示第一网络设备确定第二接口。一些可能的情形中,以太网标签可以是VLAN ID,第一网络设备根据ESI可以确定聚合接口,该聚合接口包括一个或多个子接口,第一网络设备可以根据该接收的VLAN ID确定该聚合接口中的某一子接口为第二接口。作为可能的具体实现,当第一接口对应唯一一个VLAN时,VLAN ID可以是第二网络设备确定的该唯一一个VLAN的标识,而当第一接口对应多个VLAN时,VLAN ID可以是第二网络设备从该多个VLAN中确定的其中一个VLAN(如多个VLAN中标识值最大或最小的VLAN)的标识。
在非EVPN中,上述两种可能的方式中所述消息还可以包括第一接口对应的VLAN标识,其中所述VLAN标识的确定方式与上述在EVPN中确定VLAN ID的方式类似。第一网络设备在接收到第二网络设备发送的第一接口的VLAN标识和接口标识后,可以根据第一接口的接口标识和VLAN标识确定该第一接口对应的第二接口。当第二网络设备不发送VLAN标识时,例如可以通过静态配置的方式使得仅通过接口标识即可唯一地确定相应的接口。当第二网络设备除了接口标识,还发送VLAN标识时,可以允许属于不同VLAN的接口具有相同的接口标识,此时需要通过接口标识和VLAN标识共同确定相应的接口。
可选地,上述两种可能的方式中所述消息还可以包括流量方向信息。该流量方向信息用于指示该消息携带的第一接口的配置带宽和流经第一接口的流量占用的带宽是流经第一接口的上行流量的带宽信息还是流经第一接口的下行流量的带宽信息;或者,该流量方向信息用于指示该消息携带的接口空余带宽是流经第一接口的上行流量的带宽信息还是流经第一接口的下行流量的带宽信息。
当该流量方向信息指示该消息携带的是上行流量的带宽信息时,第一网络设备根据该消息确定出的第二网络设备的接口空余带宽也针对的是上行流量,相应地后续据此也是对第二接口的用于转发上行流量的带宽进行配置。当该流量方向信息指示该消息携带的是下行流量的带宽信息时,第一网络设备根据该消息确定出的第二网络设备的接口空余带宽也针对的是下行流量,相应地后续据此也是对第二接口的用于转发下行流量的带宽进行配置。
上述两种可能的方式中所述的消息都可以为BGP路由,也可以为其他能够携带带宽信息的消息,本申请实施例对此不作唯一限定。
本申请实施例中可以通过新增BGP路由类型或新增扩展团体属性来携带上述带宽信息(第一接口的配置带宽、流经第一接口的流量占用的带宽或第二网络设备的接口空余带宽)。
可选地,在诸如EVPN等场景中,该带宽信息可以存在于BGP路由中的NLRI属性中。示例地,该NLRI属性中包含的字段可以如上表1所示。
可选地,该带宽信息也可以存在于BGP路由的扩展团体属性中,例如可以用于非EVPN网络场景中。示例地,该扩展团体属性中包含的字段可以如上表2所示。
302:第一网络设备根据第二网络设备的接口空余带宽和第二接口的配置带宽,确定第一网络设备的接口限制带宽。
第二接口的配置带宽是第一网络设备为第二接口配置的用于转发流量(上行流量或下行流量)的带宽。第二接口的配置带宽可以由第一网络设备本地静态配置,也可以由诸如控制 器等其他网络设备配置后下发到第一网络设备。
第一网络设备的接口限制带宽用于对流经第二接口的流量进行限速,具体可以是对流经第二接口的上行流量或下行流量进行限速。若第二网络设备的接口空余带宽和第二接口的配置带宽均是针对上行流量的,则所确定出的第一网络设备的接口限制带宽也是针对上行流量的,即第一网络设备的接口限制带宽用于对流经第二接口的上行流量进行限速;若第二网络设备的接口空余带宽和第二接口的配置带宽均是针对下行流量的,则所确定出的第一网络设备的接口限制带宽也是针对下行流量的,即第一网络设备的接口限制带宽用于对流经第二接口的下行流量进行限速。
第一网络设备确定自身的接口限制带宽后,可以根据该接口限制带宽来对用户流量进行限速。由于第一网络设备和第二网络设备用于对用户流量进行负载分担,所以第一网络设备根据第二网络设备的接口空余带宽,即根据第二网络设备的带宽占用情况确定出的接口限制带宽比较准确,第一网络设备根据该接口限制带宽可以实现对用户流量进行更为合理的限速,以实现在用户体验不受损的基础上节约网络资源的目的。
具体地,302的操作可以包括如下两种可能的方式:
第一种可能的方式第一网络设备根据第二网络设备的接口空余带宽和第二接口的配置带宽之和,确定第一网络设备的接口限制带宽。
第一网络设备可以直接将第二网络设备的接口空余带宽和第二接口的配置带宽之和作为第一网络设备的接口限制带宽;或者,第一网络设备可以将第二网络设备的接口空余带宽和第二接口的配置带宽之和与控制系数K 1相乘,得到第一网络设备的接口限制带宽。
第一种可能的方式适用于双归双活场景。双归双活场景下,第三网络设备通过第一网络设备和第二网络设备来发送上行流量或接收下行流量。因而,第一网络设备可以直接根据第二网络设备的带宽占用情况调整自己实时生效的带宽限速配置。
第二种可能的方式除第一网络设备和第二网络设备之外,第三网络设备还多归属连接到其他N个网络设备。第一网络设备根据第二网络设备的接口空余带宽、该N个网络设备的一个或多个接口空余带宽和控制系数,确定可用的接口空余带宽;第一网络设备根据该可用的接口空余带宽和第二接口的配置带宽,确定第一网络设备的接口限制带宽。
其中,在某一段时间内该N个网络设备可能全部向第一网络设备发送了用于通告带宽信息的消息,也可能只有其中M(1≤M<N)个向第一网络设备发送了用于通告带宽信息的消息,而剩余的(N-M)个网络设备不具有接口空余带宽。第一网络设备根据在该段时间内接收到的第二网络设备和N个网络设备中的一个或多个网络设备发送的多个消息,确定第一网络设备总共可用的接口空余带宽。第一网络设备获取该N个网络设备中任意一个网络设备的接口空余带宽的方式与第一网络设备获取第二网络设备的接口空余带宽的方式类似,本申请实施例对此不再赘述。
该控制系数可以是第一网络设备为第二网络设备和该N个网络设备设置的一个统一的固定值。或者,该控制系数可以有多个,该多个控制系数分别与第二网络设备以及该N个网络设备一一对应。示例地,如果第一网络设备与第二网络设备、第四网络设备和第五网络设备共同构成第三网络设备的多归设备,并且第一网络设备在预设时段内接收到第二网络设备和第四网络设备发送的包括接口空余带宽的消息,则第一网络设备可以根据(K 21ⅹ第二网络设备的接口空余带宽+K 22ⅹ第四网络设备的接口空余带宽),获取第一网络设备可用的接口空余 带宽,并根据该可用的接口空余带宽确定第一网络设备的接口限制带宽。其中,K 21为第二网络设备对应的控制系数,K 22为第四网络设备对应的控制系数。
控制系数的取值范围通常大于0且小于1,但在一些可能的情形下,也可以设置成其他取值范围。
第二种可能的方式适用于多归多活场景。多归多活场景下,第三网络设备通过第一网络设备、第二网络设备和该N个网络设备进行负载分担而发送上行流量或接收下行流量。因而,第一网络设备可以需要根据第二网络设备以及该N个网络设备的带宽占用情况调整实时生效的带宽限速配置。
下面对第二网络设备进行流量限速的过程进行说明:
图4是本申请实施例提供的一种流量限速方法的流程图,该方法可以由第二网络设备执行,第二网络设备例如可以是图1中的PE 12设备。参见图4,该方法包括:
401:第二网络设备确定第一接口的配置带宽和流经第一接口的流量占用的带宽。
第一接口和第一接口的配置带宽已经在上述301进行解释说明,本申请实施例对此不再赘述。
402:第二网络设备根据第一接口的配置带宽和流经第一接口的流量占用的带宽,向第一网络设备发送消息。
该消息用于指示第一网络设备根据该消息对第三网络设备的流量进行限速,即用于指示第一网络设备根据该消息对流经第二接口的流量进行限速。第二接口已经在上述302进行解释说明,本申请实施例对此不再赘述。
第二网络设备将该消息发送给第一网络设备时,可以直接将该消息发送给第一网络设备,或者可以通过其他网络设备,如RR等将该消息发送给第一网络设备,本申请实施例对此不作唯一限定。
其中,该消息包括第一接口的配置带宽和流经第一接口的流量占用的带宽,或者,该消息包括第二网络设备的接口空余带宽,第二网络设备的接口空余带宽是第一接口的配置带宽中未被占用的带宽。第二网络设备的接口空余带宽已经在上述302进行解释说明,本申请实施例对此不再赘述。
当该消息包括第一接口的配置带宽和流经第一接口的流量占用的带宽时,该消息可以是一个消息,这一个消息中同时包括第一接口的配置带宽和流经第一接口的流量占用的带宽。这种情况下,这一个消息可以在第一接口的配置带宽发生变化时发送,或者可以以预设时间间隔发送。预设时间间隔可以由第二网络设备自身设置,可以设置的较长,也可以设置的较短,具体可以根据需要设置。或者,该消息可以是两个消息,如该消息可以包括第一消息和第二消息。第一消息包括第一接口的配置带宽,即第一接口的配置带宽通过第一消息发送。第二消息包括流经第一接口的流量占用的带宽,即流经第一接口的流量占用的带宽通过第二消息发送。这种情况下,第一消息和第二消息的发送时间间隔不同;或者,第一消息在第一接口的配置带宽发生变化时发送,第二消息以预设时间间隔发送。
当该消息包括第二网络设备的接口空余带宽时,第二网络设备可以将第一接口的配置带宽减去流经第一接口的流量占用的带宽,得到第二网络设备的接口空余带宽。
可选地,该消息还可以包括第一接口的ESI或接口标识。进一步地,该消息还可以包括 第一接口的以太网标签或第一接口对应的VLAN标识。可选地,该消息还可以包括流量方向信息。相关内容已在上述301进行解释说明,本申请实施例对此不再赘述。
此外,该消息可以为BGP路由,也可以为其他能够携带带宽信息的消息,本申请实施例对此不作唯一限定。本申请实施例中可以通过新增BGP路由类型或新增扩展团体属性来携带上述带宽信息(第一接口的配置带宽、流经第一接口的流量占用的带宽或第二网络设备的接口空余带宽)。相关内容已在上述301进行解释说明,本申请实施例对此不再赘述。
在本申请实施例中,第二网络设备可以将第一接口的配置带宽和流经第一接口的流量占用的带宽发送给第一网络设备,或者可以将第二网络设备的接口空余带宽发送给第一网络设备。第一网络设备据此可以获知第二网络设备的带宽占用情况。由于第一网络设备和第二网络设备用于对用户流量进行负载分担,所以第一网络设备根据第二网络设备的带宽占用情况可以实现对第三网络设备的用户流量进行更为合理的限速,以实现在用户体验不受损的基础上节约网络资源的目的。
图5是本申请实施例提供的一种网络设备的结构示意图。该网络设备可以是图1中所示的PE 11设备或PE 12设备,也可以是上述图3-图4实施例中所述的第一网络设备或第二网络设备。参见图5,该网络设备可以包括至少一个处理器501以及至少一个通信接口504。该网络设备还可以包括通信总线502、存储器503。
处理器501可以是微处理器(包括中央处理器(central processing unit,CPU)等)、特定应用集成电路(application-specific integrated circuit,ASIC),或者可以是一个或多个用于控制本申请方案程序执行的集成电路。
通信接口504使用任何收发器一类的装置,用于与其它设备或通信网络通信,如以太网、无线接入网(radio access network,RAN)、无线局域网(wireless local area network,WLAN)等。通信接口504可以用于接收或发送与其他设备之间进行通信的数据,如接收其他设备发送的报文,或向其他设备发送网络设备生成的接口标识等。
存储器503可以是只读存储器(read-only memory,ROM)、随机存取存储器(random access memory,RAM)、电可擦可编程只读存储器(electrically erasable programmable read-Only memory,EEPROM)、光盘(包括只读光盘(compact disc read-only memory,CD-ROM)、压缩光盘、激光盘、数字通用光盘、蓝光光盘等)、磁盘存储介质或者其它磁存储设备,或者是能够用于携带或存储具有指令或数据结构形式的期望的程序代码并能够由计算机存取的任何其它介质,但不限于此。存储器503可以是独立存在,并通过通信总线502与处理器501相连接。存储器503也可以和处理器501集成在一起。
通信总线502可包括一通路,用于在上述组件之间传送信息。
在具体实现中,作为一种实施例,处理器501可以包括一个或多个CPU,如图5中所示的CPU0和CPU1。
在具体实现中,作为一种实施例,网络设备可以包括多个处理器,如图5中所示的处理器501和处理器505。这些处理器中的每一个可以是一个单核处理器,也可以是一个多核处理器。这里的处理器可以指一个或多个设备、电路、和/或用于处理数据(如计算机程序指令)的处理核。
在具体实现中,作为一种实施例,网络设备还可以包括输出设备506和输入设备507。 输出设备506和处理器501通信,可以以多种方式来显示信息。例如,输出设备506可以是液晶显示器(liquid crystal display,LCD)、发光二级管(light emitting diode,LED)显示设备、阴极射线管(cathode ray tube,CRT)显示设备或投影仪(projector)等。输入设备507和处理器501通信,可以以多种方式接收用户的输入。例如,输入设备507可以是鼠标、键盘、触摸屏设备或传感设备等。
上述网络设备例如可以是路由器、交换机、PE设备、网络服务器、交换机或台式机,也可以是其他类型的通信设备或嵌入式设备等,本申请实施例不特别限定网络设备的类型。
当网络设备包括存储器503时,该存储器503用于存储执行本申请方案的程序代码510,处理器501用于执行存储器503中存储的程序代码510。该网络设备可以通过处理器501以及存储器503中的程序代码510,以实现上述实施例中由第一网络设备或第二网络设备执行的操作。在其他实现形式中,存储器也可以独立于该网络设备存在,该网络设备运行时可以调用该存储器中存储的程序代码,以实现上述实施例中由第一网络设备或第二网络设备执行的操作。
图6是本申请实施例提供的一种第一网络设备的结构示意图,第一网络设备可以由软件、硬件或者两者的结合实现,第一网络设备可以为图5所示的网络设备。第一网络设备应用于网络***,该网络***包括第一网络设备、第二网络设备和第三网络设备,第三网络设备多归属连接到第一网络设备和第二网络设备。
参见图6,第一网络设备包括:第一确定模块601和第二确定模块602。
第一确定模块601,用于确定所述第二网络设备的接口空余带宽,所述第二网络设备的接口空余带宽是第一接口的配置带宽中未被占用的带宽,所述第一接口是所述第二网络设备连接到所述第三网络设备的接口;
第二确定模块602,用于根据所述第二网络设备的接口空余带宽和第二接口的配置带宽,确定所述第一网络设备的接口限制带宽,所述接口限制带宽用于对流经所述第二接口的流量进行限速,所述第二接口是所述第一网络设备连接到所述第三网络设备的接口。
可选地,所述第一确定模块601用于:
接收所述第二网络设备发送的消息,所述消息包括所述第一接口的配置带宽和流经所述第一接口的流量占用的带宽;
根据所述第一接口的配置带宽和流经所述第一接口的流量占用的带宽的差值,确定所述第二网络设备的所述接口空余带宽。
可选地,所述第一确定模块601用于:
接收所述第二网络设备发送的消息,所述消息包括所述第二网络设备的所述接口空余带宽。
可选地,所述消息还包括所述第一接口的ESI或接口标识,所述ESI或所述接口标识用于指示所述第一网络设备确定所述第二接口。
可选地,所述消息还包括所述第一接口的以太网标签,所述ESI和所述以太网标签用于指示所述第一网络设备确定所述第二接口。
可选地,所述消息为BGP路由。
可选地,所述消息包括第一消息和第二消息,所述第一接口的配置带宽通过所述第一消 息发送,所述流经所述第一接口的流量占用的带宽通过所述第二消息发送。
可选地,所述第一消息和所述第二消息的发送时间间隔不同;或者,所述第一消息在所述第一接口的配置带宽发生变化时发送,所述第二消息以预设时间间隔发送。
可选地,所述第二确定模块602用于:
根据所述第二网络设备的所述接口空余带宽和所述第二接口的配置带宽之和,确定所述第一网络设备的所述接口限制带宽。
可选地,除所述第一网络设备和所述第二网络设备之外,所述第三网络设备还多归属连接到其他N个网络设备,N为正整数,所述第二确定模块602用于:
根据所述第二网络设备的接口空余带宽、所述其他N个网络设备的一个或多个接口空余带宽和控制系数,确定可用的接口空余带宽,所述控制系数大于0且小于1;
根据所述可用的接口空余带宽和所述第二接口的配置带宽,确定所述第一网络设备的所述接口限制带宽。
可选地,所述接口限制带宽用于对流经所述第二接口的上行流量或下行流量进行限速。
可选地,所述消息还包括流量方向信息;
所述流量方向信息用于指示所述消息携带的所述第一接口的配置带宽和流经所述第一接口的流量占用的带宽是流经所述第一接口的上行流量的带宽信息或者是流经所述第一接口的下行流量的带宽信息;或者,
所述流量方向信息用于指示所述消息携带的所述接口空余带宽是流经所述第一接口的上行流量的带宽信息或者是流经所述第一接口的下行流量的带宽信息。
在本申请实施例中,第一网络设备根据第二网络设备的接口空余带宽和第二接口的配置带宽,确定第一网络设备的接口限制带宽。后续第一网络设备可以根据该接口限制带宽来对用户流量进行限速。由于第一网络设备和第二网络设备用于对用户流量进行负载分担,所以第一网络设备根据第二网络设备的接口空余带宽,即根据第二网络设备的带宽占用情况确定出的接口限制带宽比较准确,第一网络设备根据该接口限制带宽可以实现对用户流量进行更为合理的限速,以保证在用户体验不受损的基础上节约网络资源的目的。
需要说明的是:上述实施例提供的第一网络设备在进行流量限速时,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。另外,上述实施例提供的第一网络设备与流量限速方法实施例属于同一构思,其具体实现过程详见方法实施例,这里不再赘述。
图7是本申请实施例提供的一种第二网络设备的结构示意图,第二网络设备可以由软件、硬件或者两者的结合实现,第二网络设备可以为图5所示的网络设备。第二网络设备应用于网络***,该网络***包括第一网络设备、第二网络设备和第三网络设备,第三网络设备多归属连接到第一网络设备和第二网络设备。
参见图7,第二网络设备包括:第一确定模块701和发送模块702;
第一确定模块701,用于确定第一接口的配置带宽和流经所述第一接口的流量占用的带宽,所述第一接口是所述第二网络设备连接到所述第三网络设备的接口;
发送模块702,用于根据所述第一接口的配置带宽和流经所述第一接口的流量占用的带 宽,向所述第一网络设备发送消息,所述消息用于指示第一网络设备根据所述消息对所述第三网络设备的流量进行限速;其中,所述消息包括所述第一接口的配置带宽和流经所述第一接口的流量占用的带宽,或者,所述消息包括所述第二网络设备的接口空余带宽,所述第二网络设备的接口空余带宽是所述第一接口的配置带宽中未被占用的带宽。
可选地,所述消息还包括所述第一接口的ESI或接口标识,所述ESI或所述接口标识用于指示所述第一网络设备确定第二接口,所述第二接口是所述第一网络设备连接到所述第三网络设备的接口。
可选地,所述消息还包括所述第一接口的以太网标签,所述ESI和所述以太网标签用于指示所述第一网络设备确定所述第二接口。
可选地,所述消息还包括流量方向信息;所述流量方向信息用于指示所述消息携带的所述第一接口的配置带宽和流经所述第一接口的流量占用的带宽是流经所述第一接口的上行流量的带宽信息或者是流经所述第一接口的下行流量的带宽信息;或者,
所述流量方向信息用于指示所述消息携带的所述接口空余带宽是流经所述第一接口的上行流量的带宽信息或者是流经所述第一接口的下行流量的带宽信息。
可选地,所述消息为BGP路由。
可选地,所述消息包括第一消息和第二消息,所述第一接口的配置带宽通过所述第一消息发送,所述流经所述第一接口的流量占用的带宽通过所述第二消息发送。
可选地,所述第一消息和所述第二消息的发送时间间隔不同;或者,所述第一消息在所述第一接口的配置带宽发生变化时发送,所述第二消息以预设时间间隔发送。
在本申请实施例中,第二网络设备可以将第一接口的配置带宽和流经第一接口的流量占用的带宽发送给第一网络设备,或者可以将第二网络设备的接口空余带宽发送给第一网络设备。第一网络设备据此可以获知第二网络设备的带宽占用情况。由于第一网络设备和第二网络设备用于对用户流量进行负载分担,所以第一网络设备根据第二网络设备的带宽占用情况可以实现对第三网络设备的用户流量进行更为合理的限速,以保证在用户体验不受损的基础上节约网络资源的目的。
需要说明的是:上述实施例提供的第二网络设备在进行流量限速时,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。另外,上述实施例提供的第二网络设备与流量限速方法实施例属于同一构思,其具体实现过程详见方法实施例,这里不再赘述。
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意结合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机指令时,全部或部分地产生按照本申请实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络或其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如:同轴电缆、光纤、数据用户线(Digital Subscriber Line,DSL))或无线(例如:红外、无线、微波等)方式向另一个网站站点、计 算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质,或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质(例如:软盘、硬盘、磁带)、光介质(例如:数字通用光盘(Digital Versatile Disc,DVD))或半导体介质(例如:固态硬盘(Solid State Disk,SSD))等。
以上所述为本申请提供的实施例,并不用以限制本申请,凡在本申请的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。

Claims (22)

  1. 一种流量限速方法,其特征在于,应用于网络***,所述网络***包括第一网络设备、第二网络设备和第三网络设备,所述第三网络设备多归属连接到所述第一网络设备和所述第二网络设备,所述方法包括:
    所述第一网络设备确定所述第二网络设备的接口空余带宽,所述第二网络设备的接口空余带宽是第一接口的配置带宽中未被占用的带宽,所述第一接口是所述第二网络设备连接到所述第三网络设备的接口;
    所述第一网络设备根据所述第二网络设备的接口空余带宽和第二接口的配置带宽,确定所述第一网络设备的接口限制带宽,所述接口限制带宽用于对流经所述第二接口的流量进行限速,所述第二接口是所述第一网络设备连接到所述第三网络设备的接口。
  2. 如权利要求1所述的方法,其特征在于,所述第一网络设备确定所述第二网络设备的接口空余带宽,包括:
    所述第一网络设备接收所述第二网络设备发送的消息,所述消息包括所述第一接口的配置带宽和流经所述第一接口的流量占用的带宽;
    所述第一网络设备根据所述第一接口的配置带宽和流经所述第一接口的流量占用的带宽的差值,确定所述第二网络设备的所述接口空余带宽。
  3. 如权利要求1所述的方法,其特征在于,所述第一网络设备确定所述第二网络设备的接口空余带宽,包括:
    所述第一网络设备接收所述第二网络设备发送的消息,所述消息包括所述第二网络设备的所述接口空余带宽。
  4. 如权利要求2或3所述的方法,其特征在于,所述消息还包括所述第一接口的以太网段标识ESI或接口标识,所述ESI或所述接口标识用于指示所述第一网络设备确定所述第二接口。
  5. 如权利要求4所述的方法,其特征在于,所述消息还包括所述第一接口的以太网标签,所述ESI和所述以太网标签用于指示所述第一网络设备确定所述第二接口。
  6. 如权利要求2-5任一所述的方法,其特征在于,所述消息为边界网关协议BGP路由。
  7. 如权利要求2所述的方法,其特征在于,所述消息包括第一消息和第二消息,所述第一接口的配置带宽通过所述第一消息发送,所述流经所述第一接口的流量占用的带宽通过所述第二消息发送。
  8. 如权利要求7所述的方法,其特征在于,所述第一消息和所述第二消息的发送时间间 隔不同;或者,所述第一消息在所述第一接口的配置带宽发生变化时发送,所述第二消息以预设时间间隔发送。
  9. 如权利要求1-8任一所述的方法,其特征在于,所述第一网络设备根据所述第二网络设备的接口空余带宽和第二接口的配置带宽,确定所述第一网络设备的接口限制带宽,包括:
    所述第一网络设备根据所述第二网络设备的所述接口空余带宽和所述第二接口的配置带宽之和,确定所述第一网络设备的所述接口限制带宽。
  10. 如权利要求1-8任一所述的方法,其特征在于,除所述第一网络设备和所述第二网络设备之外,所述第三网络设备还多归属连接到其他N个网络设备,N为正整数,所述第一网络设备根据所述第二网络设备的接口空余带宽和第二接口的配置带宽,确定所述第一网络设备的接口限制带宽,包括:
    所述第一网络设备根据所述第二网络设备的接口空余带宽、所述其他N个网络设备的一个或多个接口空余带宽和控制系数,确定可用的接口空余带宽,所述控制系数大于0且小于1;
    所述第一网络设备根据所述可用的接口空余带宽和所述第二接口的配置带宽,确定所述第一网络设备的所述接口限制带宽。
  11. 如权利要求1-10任一所述的方法,其特征在于,所述接口限制带宽用于对流经所述第二接口的上行流量或下行流量进行限速。
  12. 如权利要求2或3所述的方法,其特征在于,所述消息还包括流量方向信息;
    所述流量方向信息用于指示所述消息携带的所述第一接口的配置带宽和流经所述第一接口的流量占用的带宽是流经所述第一接口的上行流量的带宽信息或者是流经所述第一接口的下行流量的带宽信息;或者,
    所述流量方向信息用于指示所述消息携带的所述接口空余带宽是流经所述第一接口的上行流量的带宽信息或者是流经所述第一接口的下行流量的带宽信息。
  13. 一种流量限速方法,其特征在于,应用于网络***,所述网络***包括第一网络设备、第二网络设备和第三网络设备,所述第三网络设备多归属连接到所述第一网络设备和所述第二网络设备,所述方法包括:
    所述第二网络设备确定第一接口的配置带宽和流经所述第一接口的流量占用的带宽,所述第一接口是所述第二网络设备连接到所述第三网络设备的接口;
    所述第二网络设备根据所述第一接口的配置带宽和流经所述第一接口的流量占用的带宽,向所述第一网络设备发送消息,所述消息用于指示第一网络设备根据所述消息对所述第三网络设备的流量进行限速;其中,所述消息包括所述第一接口的配置带宽和流经所述第一接口的流量占用的带宽,或者,所述消息包括所述第二网络设备的接口空余带宽,所述第二网络设备的接口空余带宽是所述第一接口的配置带宽中未被占用的带宽。
  14. 如权利要求13所述的方法,其特征在于,所述消息还包括所述第一接口的以太网段标识ESI或接口标识,所述ESI或所述接口标识用于指示所述第一网络设备确定第二接口,所述第二接口是所述第一网络设备连接到所述第三网络设备的接口。
  15. 如权利要求14所述的方法,其特征在于,所述消息还包括所述第一接口的以太网标签,所述ESI和所述以太网标签用于指示所述第一网络设备确定所述第二接口。
  16. 如权利要求13-15任一所述的方法,其特征在于,所述消息还包括流量方向信息;所述流量方向信息用于指示所述消息携带的所述第一接口的配置带宽和流经所述第一接口的流量占用的带宽是流经所述第一接口的上行流量的带宽信息或者是流经所述第一接口的下行流量的带宽信息;或者,
    所述流量方向信息用于指示所述消息携带的所述接口空余带宽是流经所述第一接口的上行流量的带宽信息或者是流经所述第一接口的下行流量的带宽信息。
  17. 如权利要求13-16任一所述的方法,其特征在于,所述消息为边界网关协议BGP路由。
  18. 如权利要求13所述的方法,其特征在于,所述消息包括第一消息和第二消息,所述第一接口的配置带宽通过所述第一消息发送,所述流经所述第一接口的流量占用的带宽通过所述第二消息发送。
  19. 如权利要求18所述的方法,其特征在于,所述第一消息和所述第二消息的发送时间间隔不同;或者,所述第一消息在所述第一接口的配置带宽发生变化时发送,所述第二消息以预设时间间隔发送。
  20. 一种第一网络设备,其特征在于,所述第一网络设备包括处理器和存储器,所述存储器用于存储计算机程序,所述处理器用于调用所述存储器中存储的计算机程序,以使得所述第一网络设备执行如权利要求1-12任一项所述的方法。
  21. 一种第二网络设备,其特征在于,所述第二网络设备包括处理器和存储器,所述存储器用于存储计算机程序,所述处理器用于调用所述存储器中存储的计算机程序,以使得所述第二网络设备执行如权利要求13-19任一项所述的方法。
  22. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质中存储有指令,当其在计算机上运行时,使得计算机执行如权利要求1-19任意一项所述的方法。
PCT/CN2021/105133 2020-07-29 2021-07-08 流量限速方法、相关网络设备和存储介质 WO2022022251A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
EP21849295.7A EP4181434A4 (en) 2020-07-29 2021-07-08 TRAFFIC SPEED LIMITING METHOD, RELATED NETWORK DEVICE AND STORAGE MEDIUM
US18/160,882 US20230179532A1 (en) 2020-07-29 2023-01-27 Traffic Rate Limiting Method, Related Network Device, and Storage Medium

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010747256.4 2020-07-29
CN202010747256.4A CN114070793A (zh) 2020-07-29 2020-07-29 流量限速方法、相关网络设备和存储介质

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US18/160,882 Continuation US20230179532A1 (en) 2020-07-29 2023-01-27 Traffic Rate Limiting Method, Related Network Device, and Storage Medium

Publications (1)

Publication Number Publication Date
WO2022022251A1 true WO2022022251A1 (zh) 2022-02-03

Family

ID=80037523

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/105133 WO2022022251A1 (zh) 2020-07-29 2021-07-08 流量限速方法、相关网络设备和存储介质

Country Status (4)

Country Link
US (1) US20230179532A1 (zh)
EP (1) EP4181434A4 (zh)
CN (1) CN114070793A (zh)
WO (1) WO2022022251A1 (zh)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103139848A (zh) * 2011-12-05 2013-06-05 中兴通讯股份有限公司 一种资源共享方法及***
CN106453111A (zh) * 2015-08-11 2017-02-22 中兴通讯股份有限公司 基于聚合链路的流量管理方法及装置
US9807035B1 (en) * 2015-03-31 2017-10-31 Juniper Networks, Inc. Using available bandwidths of an IP fabric to intelligently distribute data
CN110971991A (zh) * 2019-12-05 2020-04-07 广东东研网络科技股份有限公司 一种gpon onu实现veip端口限速的方法

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10003536B2 (en) * 2013-07-25 2018-06-19 Grigore Raileanu System and method for managing bandwidth usage rates in a packet-switched network
CN106470165B (zh) * 2015-08-14 2020-02-14 华为技术有限公司 一种负载分担方法、***及相关设备
CN114070770A (zh) * 2018-07-10 2022-02-18 华为技术有限公司 一种收发消息的方法、装置和***
CN113824647A (zh) * 2018-10-19 2021-12-21 华为技术有限公司 一种确定组播流的df的方法、设备及***
CN109617806B (zh) * 2018-12-26 2021-06-22 新华三技术有限公司 一种数据流量调度方法及装置
CN110753004B (zh) * 2019-10-18 2023-02-24 北京浪潮数据技术有限公司 一种数据传输动态限流方法、***、装置及可读存储介质

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103139848A (zh) * 2011-12-05 2013-06-05 中兴通讯股份有限公司 一种资源共享方法及***
US9807035B1 (en) * 2015-03-31 2017-10-31 Juniper Networks, Inc. Using available bandwidths of an IP fabric to intelligently distribute data
CN106453111A (zh) * 2015-08-11 2017-02-22 中兴通讯股份有限公司 基于聚合链路的流量管理方法及装置
CN110971991A (zh) * 2019-12-05 2020-04-07 广东东研网络科技股份有限公司 一种gpon onu实现veip端口限速的方法

Non-Patent Citations (1)

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

Also Published As

Publication number Publication date
EP4181434A1 (en) 2023-05-17
US20230179532A1 (en) 2023-06-08
EP4181434A4 (en) 2023-11-29
CN114070793A (zh) 2022-02-18

Similar Documents

Publication Publication Date Title
US8913613B2 (en) Method and system for classification and management of inter-blade network traffic in a blade server
EP3641244B1 (en) Method and apparatus for selecting path
WO2017016106A1 (zh) 一种基于SDN的支持QoS的通信隧道建立方法及***
WO2021043181A1 (zh) 一种数据传输方法及装置
US20130003549A1 (en) Resilient Hashing for Load Balancing of Traffic Flows
CN113676361A (zh) 针对体验质量度量的按需探测
WO2018153221A1 (zh) 传输网络中业务服务质量的控制方法、设备及***
US9014219B2 (en) Link aggregation (LAG) information exchange protocol
WO2020108587A1 (zh) 数据处理方法、控制器和转发设备
WO2021017578A1 (zh) 报文发送方法、装置及存储介质
WO2022012689A1 (zh) 一种路由通告方法及相关设备
WO2015144018A1 (zh) 信息发送方法、装置及通信***
WO2021190251A1 (zh) Mac地址发送方法、装置、***及相关设备
US11070386B2 (en) Controlling an aggregate number of unique PIM joins in one or more PIM join/prune messages received from a PIM neighbor
WO2021057530A1 (zh) 确定路由前缀与分段标识间映射关系的方法、装置及***
US8675658B2 (en) Using multiple IGMP queriers in a layer 2 network
US20230208751A1 (en) Packet forwarding method, device, and system
EP3866391A1 (en) Controlling protocol independent multicast (pim) join/prune messages from a downstream pim neighbor using a pim join/prune response(s) from an upstream pim neighbor
WO2020010998A1 (zh) 一种收发消息的方法、装置和***
WO2020043106A1 (zh) 通信方法和通信设备
WO2019196914A1 (zh) 一种发现转发路径的方法及其相关设备
CN109728926B (zh) 通信方法以及网络设备
US11411802B2 (en) Determining the impact of network events on network applications
WO2022022251A1 (zh) 流量限速方法、相关网络设备和存储介质
CN106878173B (zh) 一种路由发送方法及装置

Legal Events

Date Code Title Description
ENP Entry into the national phase

Ref document number: 2021849295

Country of ref document: EP

Effective date: 20230210

NENP Non-entry into the national phase

Ref country code: DE