TECHNICAL FIELD

This application relates to the communications field, and more specifically, to a network flow control method and a network device.

BACKGROUND

A modern network is a shared network. A network resource is a distributed resource. The network resource is different from a computing resource and a storage resource. How to share a network is an existing problem. Widespread application of cloud technologies, massive construction of a cloud Internet, and emergence of network functions virtualization (Network Function Virtualization, NFV) technologies impose diversified service requirements for a wide area network (Wide Area Network, WAN). Therefore, requirements for WAN network quality are also increased.

The earliest research on quality of service (Quality of Service, QoS) technologies of a flow control network service began in the 1990s, and the most important technology is a Resource Reservation Protocol (Resource reservation Protocol, RSVP) technology. However, because the algorithm is complex, many parameters in the algorithm cannot be obtained, and consequently, the technology still remains in a theoretical phase. In addition, the RSVP algorithm is difficult to deploy or expand, and the algorithm is aimed at a guarantee service (Guarantee Service) that has low network utilization. Therefore, the technology is not used in a network in a large scale.

For a long time, both a data center (DataCenter, DC) network and a WAN network use high bandwidth and a differentiated service DiffServ manner to guarantee quality of service. This manner is simple without a need of sophisticated control, and therefore is popular. Because of this, bandwidth utilization is extremely low and bandwidth allocation is unbalanced in this manner, and therefore, quality of a high burstiness service, a low latency service, or the like cannot be well guaranteed.

In recent years, people realize that centralized and extensive network management is increasingly incapable of meeting various ever-increasing network requirements. With emergence of a software-defined networking (Software Defined Network, SDN) technology, there are many researches on a centralized flow control technology that is based on an SDN idea. A main idea of the technology is constructing a dynamic flow matrix by collecting flow directions of network flows; and adjusting a path in a network based on the flow matrix, so as to achieve optimal network performance and network utilization. However, in such a solution, there is a problem of collecting a large amount of actual flow information and making decisions in real time. Real-time quality and expansibility of the network cannot be well guaranteed.

In addition, there are many researches on innovation that is based on a Transmission Control Protocol (Transmission Control Protocol, TCP) TCP flow control mechanism, and the researches are mainly some detailed researches such as congestion control and sliding window adjustment. D2TCP is used as an example. Specifically, a main idea of D2TCP is that when congestion is detected, for a flow with a far deadline (far deadline), a transmit end greatly reduces a send window; and for a flow with a near deadline (near deadline), the transmit end slightly reduces a send window. This type of per-flow control mechanism provides an advantage of rapid response. However, different mechanisms affect each other in a network environment in which a plurality of services coexist. In addition, an application may enable more flows to occupy more bandwidth. This causes unfairness in network use.

In practice, in a network in which a plurality of services coexist, mutual interference is generated between multiple types of service flows, and performance requirements of service flows of different service types are difficult to balance.

SUMMARY

Embodiments of this application provide a network flow control method, so as to schedule, based on a bandwidth weight corresponding to each service type, a packet flow in a service pipeline corresponding to the service type.

According to a first aspect, a network flow control method is provided, including: receiving a packet flow; determining, based on a service type of the packet flow, a service pipeline used for transmitting the packet flow, where service types of all packet flows in the service pipeline are the same; and based on a bandwidth weight allocated to the service type, transferring the packet flow by using the service pipeline.

A bandwidth weight of a service type refers to a proportion of maximum allowed occupied bandwidth of the service type to maximum available bandwidth. The maximum available bandwidth is usually total bandwidth of one or more physical ports that can be used by the service type, or bandwidth of a virtual network physical port of the service type in a virtual network.

It should be understood that the method may be performed by a communications entity. The bandwidth weight allocated to the service type may be preset locally by the communications entity, or may be set based on a bandwidth weight sent by another device such as a mediation device. This application is not limited thereto. The communications entity may be a communications device such as a host, a customer terminal, a switch, a virtual switch, a router, or a virtual router. It should be understood that this application is not limited thereto.

In this embodiment of this application, packet flows are allocated to different service pipelines based on a service type, and bandwidth weights are allocated, in a centralized manner, to service pipelines that carry a same service type. Therefore, each service pipeline can schedule packet flows in the service pipeline based on a bandwidth weight allocated to a specific service type, so as to avoid mutual interference generated between packet flows of different service types, and meet performance requirements of service flows of different service types.

With reference to the first aspect, in a first possible implementation of the first aspect, before the transferring the packet flow by using the service pipeline, the method further includes: performing pipeline scheduling on the packet flows in the service pipeline based on the bandwidth weight allocated to the service pipeline corresponding to the service type.

That is, the communications entity may further separately allocate a bandwidth weight to each service pipeline. This may not only implement mutual isolation between packet flows of various service types, but also implement separate weight control on packet flows in various service pipelines, thereby implementing finer network flow control.

With reference to the first aspect and the foregoing implementation of the first aspect, in a second possible implementation of the first aspect, before the sending the packet flow in the service pipeline to a physical port, the method further includes: performing in-pipeline scheduling on the packet flows in the service pipeline based on the service type of the packet flow in the service pipeline.

Each service pipeline carries a service flow that has a specific service type, and performance requirements of service flows of various service types are different. Therefore, personalized in-pipeline scheduling is performed on a packet flow in each service pipeline based on a packet type. This can meet service requirements of different service types and further improve network performance.

With reference to the first aspect and the foregoing implementations of the first aspect, in a third possible implementation of the first aspect, the performing in-pipeline scheduling on the packet flows in the service pipeline based on the service type of the packet flow in the service pipeline includes one of the following: when the service type of the packet flow in the service pipeline is a throughput sensitive service, performing scheduling on the packet flows in the service pipeline in a first in first out queue scheduling manner; when the service type of the packet flow in the service pipeline is a deadline sensitive service, determining a priority of each packet flow based on a deadline of each service flow in the service pipeline, and scheduling each packet flow based on the priority of each packet flow, where a service flow with an earlier deadline is corresponding to a higher priority; when the service type of the packet flow in the service pipeline is a latency sensitive service, performing scheduling on the packet flows in the service pipeline in a first in first out queue scheduling manner on the premise of guaranteeing minimum bandwidth of the packet flows in the service pipeline; or when the service type of the packet flow in the service pipeline is a priority sensitive service, determining a priority of each packet flow in the service pipeline, and scheduling each packet flow based on the priority of each packet flow.

With reference to the first aspect and the foregoing implementations of the first aspect, in a fourth possible implementation of the first aspect, the method further includes: determining a transmission rate of the packet flow in the service pipeline based on a congestion status of the service pipeline and the bandwidth weight allocated to the service type.

With reference to the first aspect and the foregoing implementations of the first aspect, in a fifth possible implementation of the first aspect, the determining a transmission rate of the packet flow in the service pipeline based on a congestion status of the service pipeline and the bandwidth weight allocated to the service type includes: when the service pipeline is in a non-congested state, determining a transmission rate R(t) of the packet flow in the service pipeline at a moment t by using the following formula:
R(t)=min(R(t−T)×(1+w),Rmax×w), where

a transmission rate of the service pipeline at a moment t−T is R(t−T), the bandwidth weight allocated to the service type is w, and maximum bandwidth that can be occupied by the ithservice pipeline is Rmax; or

when the service pipeline is in a congested state, determining a transmission rate R(t) of the packet flow in the service pipeline at a moment t by using the following formula:
R(t)=R(t−T)×(1−αw), where

a transmission rate of the service pipeline at a moment t−T is R(t−T), the bandwidth weight allocated to the service type is w, and a congestion degree of the service pipeline is α, where 0<α<1.

With reference to the first aspect and the foregoing implementations of the first aspect, in a sixth possible implementation of the first aspect, the weight notification message carries current usage bandwidth of each service type on the communications entity, or carries a current bandwidth weight; and a weight notification response fed back by the mediation device is received, where the weight notification response carries a target bandwidth weight of each service type. The current bandwidth weight refers to a proportion of the current usage bandwidth of each service type on the communications entity to total available bandwidth. It should be noted herein that there is a simple conversion relationship between the current usage bandwidth, the current bandwidth weight, and total bandwidth occupied by multiple current service types, and all related combinations in the weight notification message fall within the protection scope of this application.

Therefore, the mediation device may communicate with a plurality of communications entities, collect a weight notification message of each communications entity in the plurality of communications entities, intelligently determine a bandwidth bottleneck communications entity of each service type by using distribution information of each communications entity, and instruct each communications entity to update a network weight occupied by each service, so as to maximize network utilization.

With reference to the first aspect and the foregoing implementations of the first aspect, in a seventh possible implementation of the first aspect, the weight notification message further carries at least one piece of the following information: a physical port identifier of the communications entity, an identifier or an address of the communications entity, a destination communications entity identifier or address of each service packet flow on the communications entity, a pipeline identifier of each service pipeline on the communications entity, or a service type carried in each service pipeline on the communications entity.

With reference to the first aspect and the foregoing implementations of the first aspect, in an eighth possible implementation of the first aspect, the method further includes: receiving a weight update message sent by the mediation device, where the weight update message carries a bandwidth weight allocated to each service type on the communications entity, or carries maximum allowed bandwidth allocated to each service type on the communications entity.

That is, after receiving the weight update message sent by the mediation device, the communications entity updates the bandwidth weight that can be allocated to and used by each service type on the communications entity.

Therefore, this embodiment of this application can ensure network performance when applications of different service types coexist, ensure real-time adaptation to a network status change, meet network deployment scalability, and support large-scale network deployment.

According to a second aspect, a network flow control method is provided, including: receiving a weight notification message of each communications entity in a plurality of communications entities, where a weight notification message if an ithcommunications entity in the plurality of communications entities carries current usage bandwidth of each service type on the ithcommunications entity; and determining target maximum allowed bandwidth of a jthservice type on the ithcommunications entity based on the weight notification message of each communications entity in the plurality of communications entities.

On a communications entity, bandwidth may be wasted because a configuration of a service bandwidth weight does not match a network resource allocation actually used by a service, and consequently, resource utilization of an entire network is reduced.

In this embodiment of this application, a bandwidth weight of each service type can be dynamically determined based on an actual bandwidth occupation status of each service type, so as to achieve optimal utilization of an entire network, and a fair or commercial fair use of a network.

With reference to the second aspect, in a first possible implementation of the second aspect, the determining maximum allowed bandwidth of a jthservice type on the ithcommunications entity based on the weight notification message of each communications entity in the plurality of communications entities includes: determining a bottleneck communications entity with greatest current total usage bandwidth from the plurality of communications entities according to current usage bandwidth that is of each service type and that is carried in the weight notification message of each communications entity, where the jthservice type exists on the bottleneck communications entity; based on a proportion of current usage bandwidth of each service type on the bottleneck communications entity in the current total usage bandwidth, determining maximum allowed bandwidth of the jthservice type on the bottleneck communications entity when maximum available bandwidth of the bottleneck communications entity is totally occupied; and determining the target maximum allowed bandwidth of the jthservice type on the ithcommunications entity based on the maximum allowed bandwidth of the jthservice type on the bottleneck communications entity, and a proportion of current usage bandwidth of the jthservice type on the ithcommunications entity to current usage bandwidth of the jthservice type on the bottleneck communications entity.

With reference to the second aspect and the foregoing implementation of the second aspect, in a second possible implementation of the second aspect, the weight notification message of the ithcommunications entity in the plurality of communications entities carries current maximum allowed bandwidth of each service type on the ithcommunications entity, and the method further includes: when current maximum allowed bandwidth configured for the jthservice type on the ithcommunications entity is different from the target maximum allowed bandwidth of the jthservice type, sending the target maximum allowed bandwidth of the ithservice type to the ithcommunications entity.

With reference to the second aspect and the foregoing implementations of the second aspect, in a third possible implementation of the second aspect, the method further includes: determining a proportion of the target maximum allowed bandwidth of the jthservice type to maximum total bandwidth of the ithcommunications entity as a maximum bandwidth weight of the jthservice type.

According to a third aspect, a network entity is provided, including: a receiving unit, a determining unit, and a scheduling unit. The network entity is configured to perform the method in any one of the first aspect or the possible implementations of the first aspect.

According to a fourth aspect, a network device is provided, including: a receiving unit and a determining unit. The network entity is configured to perform the method in any one of the second aspect or the possible implementations of the second aspect.

According to a fifth aspect, an apparatus is provided, including: a processor, a receiver, a transmitter, and a memory. The processor and the memory are connected by using a bus system, the memory is configured to store an instruction, and the processor is configured to execute the instruction stored in the memory, to control the receiver to receive a signal, and control the transmitter to send a signal, so that the apparatus performs the method in any one of the first aspect or the possible implementations of the first aspect.

According to a sixth aspect, an apparatus is provided, including: a processor, a memory, a receiver, and a transmitter. The processor, the memory, and the receiver are connected by using a bus system, the memory is configured to store an instruction, and the processor is configured to execute the instruction stored in the memory, to control the receiver to receive a signal, and control the transmitter to send a signal, so that the apparatus performs the method in any one of the second aspect or the possible implementations of the second aspect.

According to a seventh aspect, a computer-readable medium is provided and is configured to store a computer program, and the computer program includes an instruction used to perform the method in any one of the first aspect or the possible implementations of the first aspect.

According to an eighth aspect, a computer-readable medium is provided and is configured to store a computer program, and the computer program includes an instruction used to perform the method in any one of the second aspect or the possible implementations of the second aspect.

