CN103780507A - Method and device for managing cache resources - Google Patents

Method and device for managing cache resources Download PDF

Info

Publication number
CN103780507A
CN103780507A CN201410052358.9A CN201410052358A CN103780507A CN 103780507 A CN103780507 A CN 103780507A CN 201410052358 A CN201410052358 A CN 201410052358A CN 103780507 A CN103780507 A CN 103780507A
Authority
CN
China
Prior art keywords
vqg
cache resources
threshold value
voq
message
Prior art date
Legal status (The legal status 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 status listed.)
Granted
Application number
CN201410052358.9A
Other languages
Chinese (zh)
Other versions
CN103780507B (en
Inventor
翟颖颖
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
New H3C Technologies Co Ltd
Original Assignee
Hangzhou H3C Technologies Co Ltd
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 Hangzhou H3C Technologies Co Ltd filed Critical Hangzhou H3C Technologies Co Ltd
Priority to CN201410052358.9A priority Critical patent/CN103780507B/en
Publication of CN103780507A publication Critical patent/CN103780507A/en
Application granted granted Critical
Publication of CN103780507B publication Critical patent/CN103780507B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention discloses a method and device for managing cache resources. The method includes the steps that a VOQ used for storing messages with the requirement for caching is divided into at least two VQGs according to all message attributes in a message attribute combination, wherein each acquired VQG corresponds to an attribute value of each message attribute in the message attribute combination, and the message attribute combination is composed of at least one of the following message attributes: sending mode, priority, universality level, ingress port, protocol type and message content; cache resource threshold values in one-to-one correspondence to the VQGs are provided for the VQGs respectively; when the messages need caching, the VOQ used for storing the messages is determined, the VQG corresponding to the VOQ is determined according to the message attributes of the messages; whether the messages will be stored in the VOQ or not is determined by judging whether the sum of a value of caching resources occupied by the VQG and a value of caching resources which the messages need to occupy is larger than the cache resource threshold value corresponding to the VQG or not.

Description

The management method of cache resources and device
Technical field
The application relates to resource management techniques field, particularly a kind of management method of cache resources and device.
Background technology
On forwarding chip in the communication equipment such as switch, router, be all provided with data buffer storage unit, be used for interim stored messages, in order to avoid message is lost.For example, in the time of network congestion, port can not send message immediately, message first will be stored in data buffer storage unit.Message can buffer memory time longer, represent that communication equipment is stronger for the adaptive capacity of accident.Therefore, how management data cache resources, improving Buffer Utilization is a very important technology.
At present, based on VOQ(Virtual Output Queue, VOQ) carry out in the equipment of data retransmission, the method of cache resources management is to manage based on VOQ, the unit of cache resources management is VOQ, the corresponding outbound port of each VOQ and a priority (Traffic Class, TC).Existing buffer resource management is that for each VOQ configures corresponding cache resources threshold value, that is, VOQ can take at most the cache resources of size for corresponding cache resources threshold value; In the time having a message to need buffer memory, according to the outbound port of this message and priority, determine the VOQ that this message need to be stored in; Judge the cache resources value sum that the current cache resources value having taken of this VOQ and this message need to take, whether be greater than the cache resources threshold value that this VOQ is corresponding, if so, abandon this message, otherwise this message is stored in and in this VOQ, carries out buffer memory.
But there is following problem in this method of carrying out cache management according to VOQ:
(1) need to be according to corresponding outbound port and priority, be a cache resources threshold value of each VOQ configuration, in the time that the quantity of VOQ is very large, configuration effort amount is larger;
(2) carry out cache resources management take VOQ as unit, because VOQ is and definite physical attribute: outbound port and priority are corresponding, therefore, can only manage cache resources according to message outbound port and priority, way to manage is more single, dumb.
Summary of the invention
The application provides a kind of management method and device of cache resources, is intended to solve the configuration effort amount existing in prior art larger, the single and inflexible problem of way to manage.
The application's technical scheme is as follows:
On the one hand, provide a kind of management method of cache resources, having comprised:
According to all message attribute in message attribute combination, by the VOQ for depositing the message that needs buffer memory, be divided at least two VQG, each VQG that division obtains is corresponding to a property value of each message attribute in this message attribute combination; Wherein, message attribute combination is made up of following at least one message attribute: send mode, priority, general grade, inbound port, protocol type, message content;
For each VQG configures corresponding cache resources threshold value;
In the time of needs buffer memory message, be identified for depositing the VOQ of this message, according to the message attribute of this message, determine the VQG that this VOQ is affiliated;
Whether the cache resources value sum that need to take according to the current cache resources value taking of this VQG and this message, be greater than the cache resources threshold value that this VQG is corresponding, determines whether this message to be stored in this VOQ.
On the other hand, also provide a kind of management devices of cache resources, having comprised:
Divide module, for all message attribute that combine according to message attribute, by the VOQ for depositing the message that needs buffer memory, be divided at least two VQG, each VQG that division obtains is corresponding to a property value of each message attribute in this message attribute combination; Wherein, message attribute combination is made up of following at least one message attribute: send mode, priority, general grade, inbound port, protocol type, message content;
Configuration module, is used to each VQG to configure corresponding cache resources threshold value;
Determination module, for when the needs buffer memory message, is identified for depositing the VOQ of this message, according to the message attribute of this message, determines the VQG under this VOQ;
Whether processing module, for the cache resources value sum that need to take according to the current cache resources value taking of this VQG and this message, be greater than the cache resources threshold value that this VQG is corresponding, determines whether this message to be stored in this VOQ.
In the application's above technical scheme, first according to all message attribute in the message attribute combination being formed by least one message attribute, VOQ is divided into multiple (at least two) VQG, then, for each VQG configures corresponding cache resources threshold value, follow-up, in the time having message to need buffer memory, be identified for depositing the VOQ of this message, according to the message attribute of this message, determine the VQG that this VOQ is affiliated, the cache resources value sum that need to take according to the current cache resources value taking of this VQG and this message afterwards, whether be greater than the cache resources threshold value that this VQG is corresponding, determine whether this message to be stored in this VOQ.
In said method, owing to VOQ being divided into multiple VQG, for VQG configures corresponding cache resources threshold value, obviously, configure corresponding cache resources threshold value owing to being only required to be a small amount of several VQG, therefore greatly reduce configuration effort amount, and, according to send mode, priority, general grade, inbound port, protocol type, at least one message attribute in the relevant message attribute of the upper layer application such as message content, VOQ is divided into multiple VQG, for each VQG configures corresponding cache resources threshold value, thereby, the unit of management using VQG as cache resources, manage cache resources by the cache resources occupancy of controlling each VQG, like this, can be according to user's actual demand, mode with statistics is managed cache resources, way to manage is more flexible, can more reasonably distribute cache resources.
In addition, VOQ is divided into multiple VQG, each VQG is configured to corresponding cache resources threshold value, realize the management of cache resources take VQG as unit, rather than carry out the management of cache resources take VOQ as unit, thereby all VOQ in same VQG can share the cache resources that this VQG takies, and have improved cache resources utilance.
Accompanying drawing explanation
Fig. 1 is the flow chart of the management method of the cache resources of the embodiment of the present application one;
Fig. 2 is the concrete process chart of the management method of the cache resources in the example one of the embodiment of the present application one;
Fig. 3 is the concrete process chart of the management method of the cache resources in the example two of the embodiment of the present application one;
Fig. 4 is the concrete process chart of the management method of the cache resources in the example three of the embodiment of the present application one;
Fig. 5 is the hardware configuration schematic diagram of the communication equipment of the management devices that includes cache resources of the embodiment of the present application three.
Embodiment
On the communication equipment such as switch, router, be provided with multiple message repeating chips, in each message repeating chip, be provided with data buffer storage unit, for interim stored messages, in order to avoid message is lost.In order to improve the adaptive capacity of communication equipment for accident, need to reasonably manage the cache resources of data buffer storage unit.
Larger in order to solve the configuration effort amount existing in the buffer resource management of prior art, single and the inflexible problem of way to manage, a kind of management method of cache resources is provided in the application's following examples, and a kind of device that can apply the method.
Embodiment mono-
As shown in Figure 1, the management method of the cache resources in the embodiment of the present application comprises the following steps:
Step S102, according to all message attribute in message attribute combination, by the VOQ for depositing the message that needs buffer memory, be divided at least two VQG(VOQ Group, VOQ group), each VQG that division obtains is corresponding to a property value of each message attribute in this message attribute combination;
In the embodiment of the present application, message attribute refers to the attributes such as send mode, priority, general grade (Common Class, CC), inbound port, protocol type, message content, and each message attribute can have multiple property values.For example, send mode has 3 property values: clean culture, non-unicast, transmitted to CPU (central processing unit); The property value of priority has 0~7 these 8 priority; The property value of general grade can have high priority and these 2 general grades of low priority, also can have high priority, medium priority, these 3 general grades of low priority; Etc..
Message attribute combination in step S102 can be made up of at least one message attribute.
Step S104, for each VQG configures corresponding cache resources threshold value;
Step S106, in the time of needs buffer memory message, is identified for depositing the VOQ of this message, according to the message attribute of this message, determines the VQG that this VOQ is affiliated;
Step S108, whether the cache resources value sum that need to take according to the current cache resources value taking of this VQG and this message, be greater than the cache resources threshold value that this VQG is corresponding, determines whether this message to be stored in this VOQ.
That is to say, if the cache resources value sum (should and being designated as P) that the current cache resources value taking of this VQG and this message need to take, be greater than the cache resources threshold value that this VQG is corresponding, abandon this message, otherwise, this message is stored in this VOQ, and current this VQG cache resources value taking is updated to P.
In the method for the embodiment of the present application, first according to all message attribute in the message attribute combination being formed by least one message attribute, VOQ is divided into multiple (at least two) VQG, then, for each VQG configures corresponding cache resources threshold value, follow-up, in the time having message to need buffer memory, be identified for depositing the VOQ of this message, according to the message attribute of this message, determine the VQG that this VOQ is affiliated, the cache resources value sum that need to take according to the current cache resources value taking of this VQG and this message afterwards, whether be greater than the cache resources threshold value that this VQG is corresponding, determine whether this message to be stored in this VOQ.
In said method, owing to VOQ being divided into multiple VQG, for VQG configures corresponding cache resources threshold value, obviously, configure corresponding cache resources threshold value owing to being only required to be a small amount of several VQG, therefore greatly reduce configuration effort amount, and, according to send mode, priority, general grade, inbound port, protocol type, at least one message attribute in the relevant message attribute of the upper layer application such as message content, VOQ is divided into multiple VQG, for each VQG configures corresponding cache resources threshold value, thereby, the unit of management using VQG as cache resources, manage cache resources by the cache resources occupancy of controlling each VQG, like this, can be according to user's actual demand, mode with statistics is managed cache resources, way to manage is more flexible, can more reasonably distribute cache resources.
In addition, VOQ is divided into multiple VQG, each VQG is configured to corresponding cache resources threshold value, realize the management of cache resources take VQG as unit, rather than carry out the management of cache resources take VOQ as unit, thereby all VOQ in same VQG can share the cache resources that this VQG takies, and have improved cache resources utilance.
In actual implementation process, in step S102, can divide into groups to VOQ according to a message attribute combination, also can divide into groups to VOQ respectively according to multiple message attribute combinations.In the time that message attribute combination has multiple (at least two), can be according to all message attribute in each message attribute combination in step S102, VOQ is divided into at least two VQG, like this, the message attribute of the message of buffer memory as required in step S106, determine the VQG under the VOQ for depositing this message, determine that result is that the affiliated VQG of this VOQ has at least two, afterwards, in step S108, if judge the cache resources value sum that the affiliated current cache resources value taking of arbitrary VQG of this VOQ and this message need to take, be greater than the cache resources threshold value that this VQG is corresponding, abandon this message, if judge the cache resources value sum that the affiliated current cache resources value taking of each VQG of this VOQ and this message need to take, be all not more than the cache resources threshold value that this VQG is corresponding, this message is stored in this VOQ.
Respectively VOQ is divided into groups by multiple message attribute combinations, for each grouping is that VQG configures corresponding cache resources threshold value, can manage multi-faceted, at many levels cache resources, provide rational cache resources for thering is the message of multiple different message attribute, rationally utilize cache resources.
Below respectively by several examples, the method in above-described embodiment is described.
Example one:
As shown in Figure 2, in this example one, the management method of cache resources comprises the following steps:
Step S202, according to the send mode of message, is divided at least two VQG by VOQ, for convenience, is called the Global(overall situation) VQG, each Global VQG that division obtains is corresponding to a property value of send mode; Wherein, the property value of send mode comprises: clean culture, non-unicast and transmitted to CPU;
Message repeating chip has three kinds for the send mode of message: clean culture, non-unicast and transmitted to CPU, therefore,, according to the send mode of message, VOQ can be divided into three Global VQG, for example, be designated as respectively Global VQG0, Global VQG1 and Global VQG2:
Global VQG0-clean culture VQG, corresponding to the send mode of clean culture, VOQ is wherein used for depositing unicast message;
Global VQG1-non-unicast VQG, corresponding to non-unicast send mode, VOQ is wherein used for depositing non-unicast message, comprising: the unicast message of multicast message, broadcasting packet and destination address the unknown;
Global VQG2-transmitted to CPU VQG, corresponding to the send mode of transmitted to CPU, VOQ is wherein for depositing the protocol massages of going to CPU.
Step S204, according to the send mode of message and priority, is divided at least two VQG by VOQ, for convenience, is called TC VQG, and each TC VQG that division obtains is corresponding to a property value of a priority and send mode;
Owing to being that unicast message, non-unicast message or the message of transmitted to CPU are all to distinguish priority.Therefore, according to the send mode of message and priority, VOQ can be divided into multiple TC VQG, that is, by each in above-mentioned three Global VQG:Global VQG0, Global VQG1 and Global VQG2, Further Division is multiple TC VQG.
For example, according to send mode and priority, divide the multiple TC VQG that obtain and be designated as respectively:
TC VQG0-clean culture TC0VQG, corresponding to send mode and the priority 0 of clean culture, VOQ is wherein 0 unicast message for depositing priority;
TC VQG1-clean culture TC1VQG, corresponding to send mode and the priority 1 of clean culture, VOQ is wherein 1 unicast message for depositing priority;
TC VQG2-clean culture TC2VQG, corresponding to send mode and the priority 2 of clean culture, VOQ is wherein 2 unicast message for depositing priority;
……
TC VQG7-clean culture TC7VQG, corresponding to send mode and the priority 7 of clean culture, VOQ is wherein 7 unicast message for depositing priority;
TC VQG8-non-unicast TC0VQG, corresponding to non-unicast send mode and priority 0, VOQ is wherein 0 non-unicast message for depositing priority;
TC VQG9-non-unicast TC1VQG, corresponding to non-unicast send mode and priority 1, VOQ is wherein 1 non-unicast message for depositing priority;
TC VQG10-non-unicast TC2VQG, corresponding to non-unicast send mode and priority 2, VOQ is wherein 2 non-unicast message for depositing priority;
……
TC VQG15-non-unicast TC7VQG, corresponding to non-unicast send mode and priority 7, VOQ is wherein 7 non-unicast message for depositing priority;
TC VQG16-transmitted to CPU TC0VQG, corresponding to send mode and the priority 0 of transmitted to CPU, VOQ is wherein for depositing the protocol massages that priority is 0 transmitted to CPU;
TC VQG17-transmitted to CPU TC1VQG, corresponding to send mode and the priority 1 of transmitted to CPU, VOQ is wherein for depositing the protocol massages that priority is 1 transmitted to CPU;
TC VQG18-transmitted to CPU TC2VQG, corresponding to send mode and the priority 2 of transmitted to CPU, VOQ is wherein for depositing the protocol massages that priority is 2 transmitted to CPU;
……
TC VQG23-transmitted to CPU TC7VQG, corresponding to send mode and the priority 7 of transmitted to CPU, VOQ is wherein for depositing the protocol massages that priority is 7 transmitted to CPU.
Obviously, can find out, TC VQG0~TC VQG7 belongs to Global VQG0, and TC VQG8~TC VQG15 belongs to Global VQG1, and TC VQG16~TC VQG23 belongs to Global VQG2.
Above-mentioned steps S202-S204 is corresponding to step S102, and wherein, step S202 and step S204 do not have specific sequencing.
Step S206, according to user's configuration information, for each Global VQG and each TC VQG configure corresponding cache resources threshold value; This step is corresponding to step S104;
Concrete, for each Global VQG configures corresponding cache resources threshold value, make cache resources threshold value sum that all Global VQG are corresponding equal the sum of cache resources; That is to say, the cache resources that each Global VQG takies is independent of one another.
For example, Global VQG0 is example, be useful on deposit unicast message VOQ(for convenience, be called clean culture VOQ) all belong to Global VQG0, the cache resources sum that all clean culture VOQ take equals the cache resources that Global VQG0 takies, and is the cache resources of size for cache resources threshold value corresponding to Global VQG0.
By configuring corresponding cache resources threshold value for each Global VQG, control Global VQG0, the cache resources that Global VQG1 and Global VQG2 take is independent of one another, just can limit the cache resources that all clean culture VOQ take, the cache resources that all non-unicast VOQ take, and, the cache resources that all transmitted to CPU VOQ take, can control globally unicast message, non-unicast message, in the situation of any packet congestion in the protocol massages of transmitted to CPU, can not affect depositing of other two kinds of messages, can guarantee unicast service, the business of non-unicast business and transmitted to CPU can not interfere with each other each other, the in the situation that of certain traffic congestion, other business still can normal process.
In addition, in the time being TC VQG allocating cache resource threshold value, can be configured according to following pre-defined rule: in all TC VQG of the same property value corresponding to send mode, the cache resources threshold value of each TC VQG configuration, all be not more than the cache resources threshold value of corresponding Global VQG, the priority that TC VQG is corresponding is higher, the cache resources threshold value of configuration is larger, and, the difference of the priority that any two TC VQG are corresponding is less, and the difference of the cache resources threshold value of configuration is less; Wherein, corresponding Global VQG is the Global VQG corresponding to this property value of send mode.
For example, this pre-defined rule can be:
In all TC VQG corresponding to clean culture, the cache resources threshold value of each TC VQG configuration, all be not more than the cache resources threshold value of Global VQG0, the priority that TC VQG is corresponding is higher, the cache resources threshold value of configuration is larger, and the difference of the priority that any two TC VQG are corresponding is less, the difference of the cache resources threshold value of configuration is less;
In all TC VQG corresponding to non-unicast, the cache resources threshold value of each TC VQG configuration, all be not more than the cache resources threshold value of Global VQG1, the priority that TC VQG is corresponding is higher, the cache resources threshold value of configuration is larger, and the difference of the priority that any two TC VQG are corresponding is less, the difference of the cache resources threshold value of configuration is less;
In all TC VQG corresponding to transmitted to CPU, the cache resources threshold value of each TC VQG configuration, all be not more than the cache resources threshold value of Global VQG2, the priority that TC VQG is corresponding is higher, the cache resources threshold value of configuration is larger, and the difference of the priority that any two TC VQG are corresponding is less, the difference of the cache resources threshold value of configuration is less.
By configure corresponding cache resources threshold value for TC VQG, control the cache resources that this TC VQG takies, just can limit and belong to the cache resources that all VOQ of this TC VQG take.
After obtaining multiple Global VQG and configure corresponding cache resources threshold value for each Global VQG according to send mode division, further divide and obtain multiple TC VQG and configure corresponding cache resources threshold value for each TC VQG according to send mode and priority, can control corresponding to the cache resources occupation proportion between the VOQ of different send modes (being the different attribute value of send mode), further, can also control the cache resources occupation proportion between the each priority VOQ under same send mode (being the same property value of send mode).
Step S208, in the time of needs buffer memory one message, according to the outbound port of this message and priority, is identified for depositing the VOQ of this message, for convenience, is designated as VOQ-x; According to the send mode of this message and priority, determine the VQG that VOQ-x is affiliated; Suppose, this message is that unicast message and priority are 1, belongs to Global VQG0 and TC VQG1 for depositing the VOQ-x of this message;
Step S210, judges the cache resources value sum that the current cache resources value taking of Global VQG0 and this message need to take, and whether is greater than the cache resources threshold value that Global VQG0 is corresponding, if so, performs step S216, otherwise, execution step S212;
Step S212, judges the cache resources value sum that the current cache resources value taking of TC VQG1 and this message need to take, and whether is greater than the cache resources threshold value that TC VQG1 is corresponding, if so, performs step S216, otherwise, execution step S214;
Step S214, is stored in this message in VOQ-x;
Step S216, abandons this message.
Above-mentioned steps S208~step S216 is corresponding to step S106~step S108.
By the method in example one, according to send mode, VOQ is divided into multiple Global VQG, each Global VQG is corresponding to the one in clean culture, non-unicast, transmitted to CPU, for making cache resources threshold value sum that all Global VQG are corresponding, each Global VQG equals the sum of cache resources, like this, clean culture, business non-unicast and transmitted to CPU are not disturbed mutually.
And, according to send mode and priority, VOQ is divided into multiple TC VQG, and when configuring corresponding cache resources threshold value corresponding to all TC VQG of same send mode, be configured according to following pre-defined rule: the cache resources threshold value of each TC VQG configuration, all be not more than the cache resources threshold value of corresponding Global VQG, the priority that TC VQG is corresponding is higher, the cache resources threshold value of configuration is larger, and, the difference of the priority that any two TC VQG are corresponding is less, and the difference of the cache resources threshold value of configuration is less.Like this, under same send mode, different priorities can take more cache resources as much as possible, the VQG that priority is higher can take more cache resources, the race condition of the more approaching VQG of priority is fiercer, guarantee in the congested situation of multiple priority, the message of high priority can not be dropped, simultaneously, also meet certain block capability,, avoided a certain priority packet to take even all cache resources and other priority packets of causing cannot take the problem of cache resources of major part.
Example two:
As shown in Figure 3, in this example two, the management method of cache resources comprises the following steps:
Step S302, according to the send mode of message, is divided at least two VQG by VOQ, for convenience, is called Global VQG, and each Global VQG that division obtains is corresponding to a property value of send mode; Wherein, the property value of send mode comprises: clean culture, non-unicast and transmitted to CPU;
Message repeating chip has three kinds for the send mode of message: clean culture, non-unicast and transmitted to CPU, therefore,, according to the send mode of message, VOQ can be divided into three Global VQG, for example, be designated as respectively Global VQG0, Global VQG1 and Global VQG2:
Global VQG0-clean culture VQG, corresponding to the send mode of clean culture, VOQ is wherein used for depositing unicast message;
Global VQG1-non-unicast VQG, corresponding to non-unicast send mode, VOQ is wherein used for depositing non-unicast message, comprising: the unicast message of multicast message, broadcasting packet and destination address the unknown;
Global VQG2-transmitted to CPU VQG, corresponding to the send mode of transmitted to CPU, VOQ is wherein for depositing the protocol massages of going to CPU.
Step S304, according to the send mode of message and priority, is divided at least two VQG by VOQ, for convenience, is called TC VQG, and each TC VQG that division obtains is corresponding to a property value of a priority and send mode;
Owing to being that unicast message, non-unicast message or the message of transmitted to CPU are all to distinguish priority.Therefore, according to the send mode of message and priority, VOQ can be divided into multiple TC VQG, that is, by each in above-mentioned three Global VQG:Global VQG0, Global VQG1 and Global VQG2, Further Division is multiple TC VQG.
For example, according to send mode and priority, divide the multiple TC VQG that obtain and be designated as respectively:
TC VQG0-clean culture TC0VQG, corresponding to send mode and the priority 0 of clean culture, VOQ is wherein 0 unicast message for depositing priority;
TC VQG1-clean culture TC1VQG, corresponding to send mode and the priority 1 of clean culture, VOQ is wherein 1 unicast message for depositing priority;
TC VQG2-clean culture TC2VQG, corresponding to send mode and the priority 2 of clean culture, VOQ is wherein 2 unicast message for depositing priority;
……
TC VQG7-clean culture TC7VQG, corresponding to send mode and the priority 7 of clean culture, VOQ is wherein 7 unicast message for depositing priority;
TC VQG8-non-unicast TC0VQG, corresponding to non-unicast send mode and priority 0, VOQ is wherein 0 non-unicast message for depositing priority;
TC VQG9-non-unicast TC1VQG, corresponding to non-unicast send mode and priority 1, VOQ is wherein 1 non-unicast message for depositing priority;
TC VQG10-non-unicast TC2VQG, corresponding to non-unicast send mode and priority 2, VOQ is wherein 2 non-unicast message for depositing priority;
……
TC VQG15-non-unicast TC7VQG, corresponding to non-unicast send mode and priority 7, VOQ is wherein 7 non-unicast message for depositing priority;
TC VQG16-transmitted to CPU TC0VQG, corresponding to send mode and the priority 0 of transmitted to CPU, VOQ is wherein for depositing the protocol massages that priority is 0 transmitted to CPU;
TC VQG17-transmitted to CPU TC1VQG, corresponding to send mode and the priority 1 of transmitted to CPU, VOQ is wherein for depositing the protocol massages that priority is 1 transmitted to CPU;
TC VQG18-transmitted to CPU TC2VQG, corresponding to send mode and the priority 2 of transmitted to CPU, VOQ is wherein for depositing the protocol massages that priority is 2 transmitted to CPU;
……
TC VQG23-transmitted to CPU TC7VQG, corresponding to send mode and the priority 7 of transmitted to CPU, VOQ is wherein for depositing the protocol massages that priority is 7 transmitted to CPU.
Obviously, can find out, TC VQG0~TC VQG7 belongs to Global VQG0, and TC VQG8~TC VQG15 belongs to Global VQG1, and TC VQG16~TC VQG23 belongs to Global VQG2.
Step S306, according to send mode and general grade, is divided at least two VQG by VOQ, for convenience, be called CC(Common Class, general grade) VQG, each CC VQG that division obtains is corresponding to a property value of a general grade and send mode;
Utilize the general grade of message can generally distinguish the priority of message, for example, general grade comprises: high low priority, or, high, normal, basic priority, etc.Such as, TC0~TC5 is incorporated into as low priority, TC6~TC7 incorporates into as high priority.
When general grade comprises: when high low priority, according to send mode and general grade, divide the multiple CC VQG that obtain and be designated as respectively:
CC VQG0-clean culture low priority VQG, corresponding to send mode and the low priority of clean culture, VOQ is wherein used for depositing the unicast message of low priority (for example, TC0~TC5);
CC VQG1-clean culture high priority VQG, corresponding to send mode and the high priority of clean culture, VOQ is wherein used for depositing the unicast message of high priority (for example, TC6~TC7);
CC VQG2-non-unicast low priority VQG, corresponding to non-unicast send mode and low priority, VOQ is wherein used for depositing the non-unicast message of low priority (for example, TC0~TC5);
CC VQG3-non-unicast low priority VQG, corresponding to non-unicast send mode and low priority, VOQ is wherein used for depositing the non-unicast message of low priority (for example, TC6~TC7);
CC VQG4-transmitted to CPU low priority VQG, corresponding to send mode and the low priority of transmitted to CPU, VOQ is wherein used for the protocol massages of the transmitted to CPU of depositing low priority (for example, TC0~TC5);
CC VQG5-transmitted to CPU low priority VQG, corresponding to send mode and the low priority of transmitted to CPU, VOQ is wherein used for the protocol massages of the transmitted to CPU of depositing low priority (for example, TC6~TC7);
Obviously, can find out, CC VQG0 and CC VQG1 belong to Global VQG0, and CC VQG2 and CC VQG3 belong to Global VQG1, and CC VQG4 and CC VQG5 belong to Global VQG2.
Above-mentioned steps S302-S306 is corresponding to step S102, and wherein, step S302, step S304, step S306 do not have specific sequencing.
Step S308, according to user's configuration information, for each Global VQG, each TC VQG and each CC VQG configure corresponding cache resources threshold value; This step is corresponding to step S104;
First,, for each Global VQG configures corresponding cache resources threshold value, make cache resources threshold value sum that all Global VQG are corresponding equal the sum of cache resources; That is to say, the cache resources that each Global VQG takies is independent of one another.
For example, Global VQG0 is example, be useful on deposit unicast message VOQ(for convenience, be called clean culture VOQ) all belong to Global VQG0, the cache resources sum that all clean culture VOQ take equals the cache resources that Global VQG0 takies, and is the cache resources of size for cache resources threshold value corresponding to Global VQG0.
By configuring corresponding cache resources threshold value for each Global VQG, control Global VQG0, the cache resources that Global VQG1 and Global VQG2 take is independent of one another, just can limit the cache resources that all clean culture VOQ take, the cache resources that all non-unicast VOQ take, and, the cache resources that all transmitted to CPU VOQ take, can control globally unicast message, non-unicast message, in the situation of any packet congestion in the protocol massages of transmitted to CPU, can not affect depositing of other two kinds of messages, can guarantee unicast service, the business of non-unicast business and transmitted to CPU can not interfere with each other each other, the in the situation that of certain traffic congestion, other business still can normal process.
Secondly, in the time being TC VQG allocating cache resource threshold value, can be configured according to following pre-defined rule: in all TC VQG of the same property value corresponding to send mode, the cache resources threshold value of each TC VQG configuration, all be not more than the cache resources threshold value of corresponding Global VQG, the priority that TC VQG is corresponding is higher, the cache resources threshold value of configuration is larger, and, the difference of the priority that any two TC VQG are corresponding is less, and the difference of the cache resources threshold value of configuration is less; Wherein, corresponding Global VQG is the Global VQG corresponding to this property value of send mode.
For example, this pre-defined rule can be:
In all TC VQG corresponding to clean culture, the cache resources threshold value of each TC VQG configuration, all be not more than the cache resources threshold value of Global VQG0, the priority that TC VQG is corresponding is higher, the cache resources threshold value of configuration is larger, and the difference of the priority that any two TC VQG are corresponding is less, the difference of the cache resources threshold value of configuration is less;
In all TC VQG corresponding to non-unicast, the cache resources threshold value of each TC VQG configuration, all be not more than the cache resources threshold value of Global VQG1, the priority that TC VQG is corresponding is higher, the cache resources threshold value of configuration is larger, and the difference of the priority that any two TC VQG are corresponding is less, the difference of the cache resources threshold value of configuration is less;
In all TC VQG corresponding to transmitted to CPU, the cache resources threshold value of each TC VQG configuration, all be not more than the cache resources threshold value of Global VQG2, the priority that TC VQG is corresponding is higher, the cache resources threshold value of configuration is larger, and the difference of the priority that any two TC VQG are corresponding is less, the difference of the cache resources threshold value of configuration is less.
By configure corresponding cache resources threshold value for TC VQG, control the cache resources that this TC VQG takies, just can limit and belong to the cache resources that all VOQ of this TC VQG take.
Again, in the time configuring corresponding cache resources threshold value for each CC VQG, can be configured according to following pre-defined rule: in all CC VQG of the same property value corresponding to send mode, the cache resources threshold value of each CC VQG configuration, all be not more than the cache resources threshold value of corresponding Global VQG, the general higher grade that CC VQG is corresponding, the cache resources threshold value of configuration is larger, and, corresponding to except the cache resources threshold value sum of the CC VQG of other the general grades grade for high pass, be less than the cache resources threshold value of corresponding Global VQG, wherein, corresponding Global VQG is the Global VQG corresponding to this property value of send mode.
For example, this pre-defined rule can be:
In all CC VQG corresponding to clean culture, the cache resources threshold value of each CC VQG configuration, all be not more than the cache resources threshold value of Global VQG0, the general higher grade that CC VQG is corresponding, the cache resources threshold value of configuration is larger, and, corresponding to except the cache resources threshold value sum of the CC VQG of other the general grades grade for high pass, be less than the cache resources threshold value of Global VQG0;
In all CC VQG corresponding to non-unicast, the cache resources threshold value of each CC VQG configuration, all be not more than the cache resources threshold value of Global VQG1, the general higher grade that CC VQG is corresponding, the cache resources threshold value of configuration is larger, and, corresponding to except the cache resources threshold value sum of the CC VQG of other the general grades grade for high pass, be less than the cache resources threshold value of Global VQG1;
In all CC VQG corresponding to transmitted to CPU, the cache resources threshold value of each CC VQG configuration, all be not more than the cache resources threshold value of Global VQG2, the general higher grade that CC VQG is corresponding, the cache resources threshold value of configuration is larger, and, corresponding to except the cache resources threshold value sum of the CC VQG of other the general grades grade for high pass, be less than the cache resources threshold value of Global VQG2.
Wherein, when general grade comprises: when high low priority, corresponding to except high pass with the CC VQG of other the general grades grade being: corresponding to the CC VQG of low priority; When general grade comprises: when high, normal, basic priority, corresponding to except high pass with the CC VQG of other the general grades grade being: corresponding to the CC VQG of medium priority with corresponding to the CC VQG of low priority.
By configure corresponding cache resources threshold value for CC VQG, control the cache resources that this CC VQG takies, just can limit and belong to the cache resources that all VOQ of this CC VQG take.
After obtaining multiple Global VQG and configure corresponding cache resources threshold value for each Global VQG according to send mode division, further divide and obtain multiple TC VQG and configure corresponding cache resources threshold value for each TC VQG according to send mode and priority, further obtain multiple CC VQG and configure corresponding cache resources threshold value for each CC VQG according to send mode and general grade classification, can control corresponding to the cache resources occupation proportion between the VOQ of different send modes, further can also control the cache resources occupation proportion between the each priority VOQ under same send mode, and further can also control the cache resources occupation proportion between the each general grade VOQ under same send mode, make the way to manage of cache resources more flexible.
Step S310, in the time of needs buffer memory one message, according to the outbound port of this message and priority, is identified for depositing the VOQ of this message, for convenience, is designated as VOQ-x; According to the send mode of this message and priority, determine the VQG that VOQ-x is affiliated; Suppose, this message is that unicast message and priority are 1, belongs to Global VQG0, TC VQG1 and CC VQG0 for depositing the VOQ-x of this message;
Step S312, judges the cache resources value sum that the current cache resources value taking of Global VQG0 and this message need to take, and whether is greater than the cache resources threshold value that Global VQG0 is corresponding, if so, performs step S320, otherwise, execution step S314;
Step S314, judges the cache resources value sum that the current cache resources value taking of TC VQG1 and this message need to take, and whether is greater than the cache resources threshold value that TC VQG1 is corresponding, if so, performs step S320, otherwise, execution step S316;
Step S316, judges the cache resources value sum that the current cache resources value taking of CC VQG0 and this message need to take, and whether is greater than the cache resources threshold value that CC VQG0 is corresponding, if so, performs step S320, otherwise, execution step S318;
Step S318, is stored in this message in VOQ-x;
Step S320, abandons this message.
Above-mentioned steps S310~step S320 is corresponding to step S106~step S108.
By the method in example two, according to send mode, VOQ is divided into multiple Global VQG, each Global VQG is corresponding to the one in clean culture, non-unicast, transmitted to CPU, for making cache resources threshold value sum that all Global VQG are corresponding, each Global VQG equals the sum of cache resources, like this, clean culture, business non-unicast and transmitted to CPU are not disturbed mutually.
And, according to send mode and priority, VOQ is divided into multiple TC VQG, and when configuring corresponding cache resources threshold value corresponding to all TC VQG of same send mode, be configured according to following pre-defined rule: the cache resources threshold value of each TC VQG configuration, all be not more than the cache resources threshold value of corresponding Global VQG, the priority that TC VQG is corresponding is higher, the cache resources threshold value of configuration is larger, and, the difference of the priority that any two TC VQG are corresponding is less, and the difference of the cache resources threshold value of configuration is less.Like this, under same send mode, different priorities can take more cache resources as much as possible, the VQG that priority is higher can take more cache resources, the race condition of the more approaching VQG of priority is fiercer, guarantee in the congested situation of multiple priority, the message of high priority can not be dropped, simultaneously, also meet certain block capability,, avoided a certain priority packet to take even all cache resources and other priority packets of causing cannot take the problem of cache resources of major part.
And, further according to send mode and general grade, VOQ is divided into multiple CC VQG, and when configuring corresponding cache resources threshold value corresponding to all CC VQG of same send mode, be configured according to following pre-defined rule: the cache resources threshold value of each CC VQG configuration, all be not more than the cache resources threshold value of corresponding Global VQG, the general higher grade that CC VQG is corresponding, the cache resources threshold value of configuration is larger, and, corresponding to except the cache resources threshold value sum of the CC VQG of other the general grades grade for high pass, be less than the cache resources threshold value of corresponding Global VQG.Like this, under same send mode, the VQG that general higher grade can take more cache resources, and, guarantee that the VQG of high pass grade under any circumstance can both take the cache resources of some.
In addition, in another kind of embodiment, can also only according to the send mode of message, VOQ be divided into 3 Global VQG, and, according to the send mode of message and general grade, VOQ is divided into multiple CC VQG, other step and above-mentioned steps S302~step S320 are similar, repeat no more here.
Example three:
As shown in Figure 4, in this example three, the management method of cache resources comprises the following steps:
Step S402, according to the send mode of message, is divided at least two Global VQG by VOQ, and each Global VQG that division obtains is corresponding to a property value of send mode; Wherein, the property value of send mode comprises: clean culture, non-unicast and transmitted to CPU;
Message repeating chip has three kinds for the send mode of message: clean culture, non-unicast and transmitted to CPU, therefore,, according to the send mode of message, VOQ can be divided into three Global VQG, for example, be designated as respectively Global VQG0, Global VQG1 and Global VQG2:
Global VQG0-clean culture VQG, corresponding to the send mode of clean culture, VOQ is wherein used for depositing unicast message;
Global VQG1-non-unicast VQG, corresponding to non-unicast send mode, VOQ is wherein used for depositing non-unicast message, comprising: the unicast message of multicast message, broadcasting packet and destination address the unknown;
Global VQG2-transmitted to CPU VQG, corresponding to the send mode of transmitted to CPU, VOQ is wherein for depositing the protocol massages of going to CPU.
Step S404, according to the inbound port of message, is divided at least two IPT(InPut Port, inbound port by VOQ) VQG, divides each the IPT VQG obtaining corresponding to an inbound port;
Inbound port is wherein the port on this forwarding chip.
Above-mentioned steps S402~step S404 is corresponding to step S102.
Step S406, according to user's configuration information, for each Global VQG and each IPT VQG configure corresponding cache resources threshold value; This step is corresponding to step S104;
First,, for each Global VQG configures corresponding cache resources threshold value, make cache resources threshold value sum that all Global VQG are corresponding equal the total Sum of cache resources; That is to say, the cache resources that each Global VQG takies is independent of one another.
By configuring corresponding cache resources threshold value for each Global VQG, control Global VQG0, the cache resources that Global VQG1 and Global VQG2 take is independent of one another, just can limit the cache resources that all clean culture VOQ take, the cache resources that all non-unicast VOQ take, and, the cache resources that all transmitted to CPU VOQ take, can control globally unicast message, non-unicast message, in the situation of any packet congestion in the protocol massages of transmitted to CPU, can not affect depositing of other two kinds of messages, can guarantee unicast service, the business of non-unicast business and transmitted to CPU can not interfere with each other each other, the in the situation that of certain traffic congestion, other business still can normal process.
Secondly, be Sum/N for each IPT VQG configures corresponding cache resources threshold value, wherein, the maximum quantity of congested inbound port when N is default.
By configure corresponding cache resources threshold value for IPT VQG, control the cache resources that this IPT VQG takies, can limit the cache resources ratio taking corresponding to the VOQ of different inbound ports.
After obtaining multiple Global VQG and configure corresponding cache resources threshold value for each Global VQG according to send mode division, further divide and obtain multiple IPT VQG and configure corresponding cache resources threshold value for each IPT VQG according to inbound port, can control corresponding to the cache resources occupation proportion between the VOQ of different send modes, further can also control corresponding to the cache resources occupation proportion between the IPT VOQ of different inbound ports, make the way to manage of cache resources more flexible.
Step S408, in the time of needs buffer memory one message, according to the outbound port of this message and priority, is identified for depositing the VOQ of this message, for convenience, is designated as VOQ-x; According to the send mode of this message and inbound port, determine the VQG that VOQ-x is affiliated; Suppose, this message is that unicast message and inbound port are PORT1, belongs to Global VQG0 and IPT VQG1 for depositing the VOQ-x of this message;
Step S410, judges the cache resources value sum that the current cache resources value taking of Global VQG0 and this message need to take, and whether is greater than the cache resources threshold value that Global VQG0 is corresponding, if so, performs step S416, otherwise, execution step S412;
Step S412, judges the cache resources value sum that the current cache resources value taking of IPT VQG1 and this message need to take, and whether is greater than the cache resources threshold value that IPT VQG1 is corresponding, if so, performs step S416, otherwise, execution step S414;
Step S414, is stored in this message in VOQ-x;
Step S416, abandons this message.
Above-mentioned steps S408~step S416 is corresponding to step S106~step S108.
By the method in example three, according to send mode, VOQ is divided into multiple Global VQG, each Global VQG is corresponding to the one in clean culture, non-unicast, transmitted to CPU, for making cache resources threshold value sum that all Global VQG are corresponding, each Global VQG equals the sum of cache resources, like this, clean culture, business non-unicast and transmitted to CPU are not disturbed mutually.
And, according to inbound port, VOQ is divided into multiple IPT VQG, and is Sum/N for each IPT VQG configures corresponding cache resources threshold value, wherein, the maximum quantity of congested inbound port when N is default.Like this, the IPT VQG that has guaranteed different inbound ports can take cache resources as much as possible, simultaneously, also meet certain block capability,, avoided the message of a certain inbound port to take even all cache resources and the message of other inbound ports of causing cannot take the problem of cache resources of major part.
Obviously, in actual implementation process, can also adopt how different message attribute combinations to divide VOQ, realize the management to cache resources, the application does not limit this.
Embodiment bis-
Below by a concrete example, the method for allocating cache resource threshold value in the example two of above-described embodiment one is described.
Suppose, in the data buffer storage unit on the forwarding chip of some switches, total cache size is 1000K, as follows to the cache resources threshold value of each VQG configuration:
1, the cache resources threshold value of each Global VQG:
Global?VQG0:850K
Global?VQG1:100K
Global?VQG2:50K
2, the cache resources threshold value of each TC VQG
Take the TC VQG of the send mode corresponding to clean culture as example:
TC VQG0(is corresponding to clean culture and TC0): 100K
TC VQG1(is corresponding to clean culture and TC1): 100K
TC VQG2(is corresponding to clean culture and TC2): 500K
TC VQG3(is corresponding to clean culture and TC3): 500K
TC VQG4(is corresponding to clean culture and TC4): 500K
TC VQG5(is corresponding to clean culture and TC5): 500K
TC VQG6(is corresponding to clean culture and TC6): 800K
TC VQG7(is corresponding to clean culture and TC7): 800K
Under the send mode of clean culture, further control cache resources threshold value according to priority, corresponding to cache resources threshold value sum corresponding to the TC VOG of different priorities, do not need the cache resources threshold value that equals corresponding corresponding to the Global VQG0 of clean culture,, the cache resources that each priority takies is not separately independently, but has shared situation.
In the time there is no other priority, single priority can take maximum resources, and exist in the situation of the common competition of multiple priority, just there will be seizing of each priority, for the TC VQG corresponding to different priorities configures different cache resources threshold values, the cache resources that the each priority of allotment that can be suitable can take.
Can find out from the above-mentioned cache resources threshold value for TC VQG0~TC VQG7 configuration: among all TC VQG corresponding to clean culture, the cache resources threshold value of each TC VQG configuration, is all not more than the cache resources threshold value 850K of Global VQG0; The priority that TC VQG is corresponding is higher, and the cache resources threshold value of configuration is larger, and the difference of the priority that any two TC VQG are corresponding is less, and the difference of the cache resources threshold value of configuration is less.
In the time there is TC0, TC2 and TC7 simultaneously, in the time that TC7 takies 800K, the cache resources threshold value that remaining 50K(Global VQG0 is corresponding is 850K) will jointly be seized by TC2 and TC0, if and TC7 has only taken 500K, TC0 and TC2 seize remaining 350K jointly, but TC0 can only take at most 100K, and therefore TC2 can guarantee the cache resources of 250K.
3, the cache resources threshold value of each CC VQG
Take the CC VQG of the send mode corresponding to clean culture as example:
CC VQG0(is corresponding to clean culture and TC0~TC5): 700K
CC VQG1(is corresponding to clean culture and TC6~TC7): 850K
Under the send mode of clean culture, further control cache resources threshold value according to general grade, general grade herein can be divided into high priority and low priority, and wherein TC6~TC7 belongs to high priority, and TC0~TC5 belongs to low priority.The cache resources taking due to each priority is not independently, is further therefore that the unicast message that guarantees high priority is not affected according to the object of general grade control cache resources threshold value.
Can find out from the above-mentioned cache resources threshold value for CC VQG0~CC VQG1 configuration: among all CC VQG corresponding to clean culture, the cache resources threshold value of each CC VQG configuration, is all not more than the cache resources threshold value 850K of Global VQG0; The general higher grade that CC VQG is corresponding, and the cache resources threshold value of configuration is larger; And, corresponding to the cache resources threshold value 700K of the CC VQG:CC VQG0 of low priority, be less than the cache resources threshold value 850K of Global VQG0, like this, CC VQG0 can guarantee can take at least cache resources of 150K corresponding to the CC VQG:CC VQG1 of high priority, because can only take at most 700K.
Embodiment tri-
For the method in above-described embodiment one, in the embodiment of the present application, provide a kind of management devices of the cache resources that can apply the method.This device can be applied in the communication equipment of such as router, switch etc.
Be embodied as example with software, as shown in Figure 5, in this device, can comprise with lower module: divide module 10, configuration module 20, determination module 30 and processing module 40, wherein:
Divide module 10, for according to all message attribute of message attribute combination, by the VOQ for depositing the message that needs buffer memory, be divided at least two VQG, divide each VQG obtaining corresponding to all message attribute in this message attribute combination; Wherein, message attribute combination is made up of following at least one message attribute: send mode, priority, general grade, inbound port, protocol type, message content;
Configuration module 20, is used to each VQG to configure corresponding cache resources threshold value;
Determination module 30, for when the needs buffer memory message, is identified for depositing the VOQ of this message, according to the message attribute of this message, determines the VQG under this VOQ;
Whether processing module 40, for the cache resources value sum that need to take according to the current cache resources value taking of this VQG and this message, be greater than the cache resources threshold value that this VQG is corresponding, determines whether this message to be stored in this VOQ.
Wherein, in the time that message attribute combination has at least two, the VQG under definite VOQ has at least two, and, this processing module comprises: discarding unit and storage unit, wherein:
Discarding unit, if the cache resources value sum that need to take for judging the current cache resources value taking of arbitrary VQG under this VOQ and this message is greater than the cache resources threshold value that this VQG is corresponding, abandons this message;
Storage unit, if the cache resources value sum that need to take for judging the current cache resources value taking of each VQG under this VOQ and this message is all not more than the cache resources threshold value that this VQG is corresponding, is stored in this message in this VOQ.
In a kind of embodiment of the application, this division module comprises: the first division unit and the second division unit, wherein:
The first division unit, for according to send mode, is divided at least two Global VQG by VOQ, divides each Global VQG of obtaining corresponding to the one in following send mode: clean culture, non-unicast and transmitted to CPU;
The second division unit, for according to send mode and priority, is divided at least two TCVQG by VOQ, divides each TC VQG of obtaining corresponding to the one in a priority and following send mode: clean culture, non-unicast, transmitted to CPU.
Now, this configuration module comprises: the first dispensing unit and the second dispensing unit, wherein:
The first dispensing unit, is used to each Global VQG to configure corresponding cache resources threshold value, makes cache resources threshold value sum that all Global VQG are corresponding equal the sum of cache resources;
The second dispensing unit, for according to pre-defined rule, each TC VQG configures corresponding cache resources threshold value; Wherein, this pre-defined rule comprises: in all TC VQG corresponding to same send mode, the cache resources threshold value of each TC VQG configuration, all be not more than the cache resources threshold value of corresponding Global VQG, the priority that TC VQG is corresponding is higher, and the cache resources threshold value of configuration is larger, and, the difference of the priority that any two TC VQG are corresponding is less, and the difference of the cache resources threshold value of configuration is less; Wherein, corresponding Global VQG is the Global VQG corresponding to this kind of send mode.
In the application's another kind of embodiment, in this division module, except can comprising above-mentioned the first division unit and the second division unit, can also comprise the 3rd division unit, wherein:
The 3rd division unit, for according to send mode and general grade, is divided at least two CC VQG by VOQ, divides each CC VQG of obtaining corresponding to the one in a general grade and following send mode: clean culture, non-unicast, transmitted to CPU;
Wherein, general grade is high priority or low priority, or general grade is high priority, medium priority or low priority.
Now, in this configuration module, except can comprising above-mentioned the first dispensing unit and the second dispensing unit, can also comprise the 3rd dispensing unit, wherein:
The 3rd dispensing unit, for according to pre-defined rule, for each CC VQG configures corresponding cache resources threshold value;
Wherein, this pre-defined rule comprises: in all CC VQG corresponding to same send mode, the cache resources threshold value of each CC VQG configuration, all be not more than the cache resources threshold value of corresponding Global VQG, the general higher grade that CC VQG is corresponding, and the cache resources threshold value of configuration is larger, and, corresponding to except the cache resources threshold value sum of the CC VQG of other the general grades grade for high pass, be less than the cache resources threshold value of corresponding Global VQG; Wherein, corresponding Global VQG is the Global VQG corresponding to this kind of send mode.
In another embodiment of the application, this division module comprises: the first division unit and the second division unit, wherein:
The first division unit, for according to send mode, is divided at least two Global VQG by VOQ, divides each Global VQG of obtaining corresponding to the one in following send mode: clean culture, non-unicast and transmitted to CPU;
The second division unit, for according to inbound port, is divided at least two IPT VQG by VOQ, divides each the IPT VQG obtaining corresponding to an inbound port.
Now, this configuration module comprises: the first dispensing unit and the second dispensing unit, wherein:
The first dispensing unit, is used to each Global VQG to configure corresponding cache resources threshold value, makes cache resources threshold value sum that all Global VQG are corresponding equal the total Sum of cache resources;
The second dispensing unit, being used to each IPT VQG to configure corresponding cache resources threshold value is Sum/N, wherein, the maximum quantity of congested inbound port when N is default.
The embodiment of the present application is not got rid of the execution mode of hardware or software and hardware combining.Please refer to Fig. 5, say from hardware view, communication equipment comprises: CPU, nonvolatile memory, internal memory, forwarding chip and other hardware.The management devices of above-mentioned cache resources is as the device on a logical meaning, and it is by CPU, computer program instructions corresponding in nonvolatile memory to be read to operation in internal memory to form.On forwarding chip, be provided with data buffer storage unit, in the time that corresponding computer program instructions is performed, the management devices of the cache resources of formation is used for according to the cache resources in the management by methods data buffer storage unit of embodiment mono-.
To sum up, the above embodiment of the application can reach following technique effect:
(1) first according to all message attribute in the message attribute combination being formed by least one message attribute, VOQ is divided into multiple VQG, then, for each VQG configures corresponding cache resources threshold value, follow-up, in the time having message to need buffer memory, be identified for depositing the VOQ of this message, according to the message attribute of this message, determine the VQG that this VOQ is affiliated, the cache resources value sum that need to take according to the current cache resources value taking of this VQG and this message afterwards, whether be greater than the cache resources threshold value that this VQG is corresponding, determine whether this message to be stored in this VOQ.
In said method, owing to VOQ being divided into multiple VQG, for VQG configures corresponding cache resources threshold value, obviously, configure corresponding cache resources threshold value owing to being only required to be a small amount of several VQG, therefore greatly reduce configuration effort amount, and, according to send mode, priority, general grade, inbound port, protocol type, at least one message attribute in the relevant message attribute of the upper layer application such as message content, VOQ is divided into multiple VQG, for each VQG configures corresponding cache resources threshold value, thereby, the unit of management using VQG as cache resources, manage cache resources by the cache resources occupancy of controlling each VQG, like this, can be according to user's actual demand, mode with statistics is managed cache resources, way to manage is more flexible, can more reasonably distribute cache resources.
In addition, VOQ is divided into multiple VQG, each VQG is configured to corresponding cache resources threshold value, realize the management of cache resources take VQG as unit, rather than carry out the management of cache resources take VOQ as unit, thereby all VOQ in same VQG can share the cache resources that this VQG takies, and have improved cache resources utilance.
(2) respectively VOQ is divided into groups by multiple message attribute combinations, for each grouping is that VQG configures corresponding cache resources threshold value, can manage multi-faceted, at many levels cache resources, provide rational cache resources for thering is the message of multiple different message attribute, rationally utilize cache resources.
(3) according to send mode, VOQ is divided into multiple Global VQG, each Global VQG is corresponding to the one in clean culture, non-unicast, transmitted to CPU, for making cache resources threshold value sum that all Global VQG are corresponding, each Global VQG equals the sum of cache resources, like this, clean culture, business non-unicast and transmitted to CPU are not disturbed mutually.
And, according to send mode and priority, VOQ is divided into multiple TC VQG, and when configuring corresponding cache resources threshold value corresponding to all TC VQG of same send mode, be configured according to following pre-defined rule: the cache resources threshold value of each TC VQG configuration, all be not more than the cache resources threshold value of corresponding Global VQG, the priority that TC VQG is corresponding is higher, the cache resources threshold value of configuration is larger, and, the difference of the priority that any two TC VQG are corresponding is less, and the difference of the cache resources threshold value of configuration is less.Like this, under same send mode, different priorities can take more cache resources as much as possible, the VQG that priority is higher can take more cache resources, the race condition of the more approaching VQG of priority is fiercer, guarantee in the congested situation of multiple priority, the message of high priority can not be dropped, simultaneously, also meet certain block capability,, avoided a certain priority packet to take even all cache resources and other priority packets of causing cannot take the problem of cache resources of major part.
(4) further according to send mode and general grade, VOQ is divided into multiple CC VQG, and when configuring corresponding cache resources threshold value corresponding to all CC VQG of same send mode, be configured according to following pre-defined rule: the cache resources threshold value of each CC VQG configuration, all be not more than the cache resources threshold value of corresponding Global VQG, the general higher grade that CC VQG is corresponding, the cache resources threshold value of configuration is larger, and, corresponding to except the cache resources threshold value sum of the CC VQG of other the general grades grade for high pass, be less than the cache resources threshold value of corresponding Global VQG.Like this, under same send mode, the VQG that general higher grade can take more cache resources, and, guarantee that the VQG of high pass grade under any circumstance can both take the cache resources of some.
(5) according to send mode, VOQ is divided into multiple Global VQG, each Global VQG is corresponding to the one in clean culture, non-unicast, transmitted to CPU, for making cache resources threshold value sum that all Global VQG are corresponding, each Global VQG equals the sum of cache resources, like this, clean culture, business non-unicast and transmitted to CPU are not disturbed mutually.
And, according to inbound port, VOQ is divided into multiple IPT VQG, and is Sum/N for each IPT VQG configures corresponding cache resources threshold value, wherein, the maximum quantity of congested inbound port when N is default.Like this, the IPT VQG that has guaranteed different inbound ports can take cache resources as much as possible, simultaneously, also meet certain block capability,, avoided the message of a certain inbound port to take even all cache resources and the message of other inbound ports of causing cannot take the problem of cache resources of major part.
The foregoing is only the application's preferred embodiment, not in order to limit the application, all within the application's spirit and principle, any modification of making, be equal to replacement, improvement etc., within all should being included in the scope of the application's protection.

Claims (16)

1. a management method for cache resources, is characterized in that, comprising:
According to all message attribute in message attribute combination, by the VOQ VOQ for depositing the message that needs buffer memory, be divided at least two VOQ group VQG, each VQG that division obtains is corresponding to a property value of each message attribute in this message attribute combination; Wherein, message attribute combination is made up of following at least one message attribute: send mode, priority, general grade, inbound port, protocol type, message content;
For each VQG configures corresponding cache resources threshold value;
In the time of needs buffer memory message, be identified for depositing the VOQ of described message, according to the message attribute of described message, determine the VQG that this VOQ is affiliated;
Whether the cache resources value sum that need to take according to the current cache resources value taking of this VQG and described message, be greater than the cache resources threshold value that this VQG is corresponding, determines whether described message to be stored in this VOQ.
2. method according to claim 1, is characterized in that, in the time that message attribute combination has at least two, the VQG under definite VOQ has at least two,, determines whether that the method that described message is stored in this VOQ comprises:
If judge the cache resources value sum that the affiliated current cache resources value taking of arbitrary VQG of this VOQ and described message need to take, be greater than the cache resources threshold value that this VQG is corresponding, abandon described message;
If judge the cache resources value sum that the affiliated current cache resources value taking of each VQG of this VOQ and described message need to take, be all not more than the cache resources threshold value that this VQG is corresponding, described message is stored in this VOQ.
3. method according to claim 2, is characterized in that, according to all message attribute in message attribute combination, by the VOQ for depositing the message that needs buffer memory, the method that is divided at least two VQG comprises:
According to send mode, VOQ is divided into at least two overall Global VQG, each Global VQG that division obtains is corresponding to a property value of send mode; Wherein, the property value of send mode comprises: clean culture, non-unicast and on send central processor CPU;
According to send mode and priority, VOQ is divided into at least two priority TC VQG, each TC VQG that division obtains is corresponding to a property value of a priority and send mode.
4. method according to claim 3, is characterized in that, the method that configures corresponding cache resources threshold value for each VQG comprises:
For each Global VQG configures corresponding cache resources threshold value, make cache resources threshold value sum that all Global VQG are corresponding equal the sum of cache resources;
According to pre-defined rule, each TC VQG configures corresponding cache resources threshold value; Wherein, this pre-defined rule comprises: in all TC VQG of the same property value corresponding to send mode, the cache resources threshold value of each TC VQG configuration, all be not more than the cache resources threshold value of corresponding Global VQG, the priority that TC VQG is corresponding is higher, and the cache resources threshold value of configuration is larger, and, the difference of the priority that any two TC VQG are corresponding is less, and the difference of the cache resources threshold value of configuration is less; Wherein, corresponding Global VQG is the Global VQG corresponding to this property value of send mode.
5. method according to claim 4, is characterized in that, according to all message attribute in message attribute combination, by the VOQ for depositing the message that needs buffer memory, the method that is divided at least two VQG also comprises:
According to send mode and general grade, VOQ is divided into at least two general grade CC VQG, each CC VQG that division obtains is corresponding to a property value of a general grade and send mode;
Wherein, general grade is high priority or low priority, or general grade is high priority, medium priority or low priority.
6. method according to claim 5, is characterized in that, the method that configures corresponding cache resources threshold value for each VQG also comprises:
According to pre-defined rule, for each CC VQG configures corresponding cache resources threshold value;
Wherein, this pre-defined rule comprises: in all CC VQG of the same property value corresponding to send mode, the cache resources threshold value of each CC VQG configuration, all be not more than the cache resources threshold value of corresponding Global VQG, the general higher grade that CC VQG is corresponding, and the cache resources threshold value of configuration is larger, and, corresponding to except the cache resources threshold value sum of the CC VQG of other the general grades grade for high pass, be less than the cache resources threshold value of corresponding Global VQG; Wherein, corresponding Global VQG is the Global VQG corresponding to this property value of send mode.
7. method according to claim 2, is characterized in that, according to all message attribute in message attribute combination, by the VOQ for depositing the message that needs buffer memory, the method that is divided at least two VQG comprises:
According to send mode, VOQ is divided into at least two Global VQG, each Global VQG that division obtains is corresponding to a property value of send mode; Wherein, the property value of send mode comprises: clean culture, non-unicast and transmitted to CPU;
According to inbound port, VOQ is divided into at least two inbound port IPT VQG, divide each the IPT VQG obtaining corresponding to an inbound port.
8. method according to claim 7, is characterized in that, the method that configures corresponding cache resources threshold value for each VQG comprises:
For each Global VQG configures corresponding cache resources threshold value, make cache resources threshold value sum that all Global VQG are corresponding equal the total Sum of cache resources;
Be Sum/N for each IPT VQG configures corresponding cache resources threshold value, wherein, the maximum quantity of congested inbound port when N is default.
9. a management devices for cache resources, is characterized in that, comprising:
Divide module, for all message attribute that combine according to message attribute, by the VOQ VOQ for depositing the message that needs buffer memory, be divided at least two VOQ group VQG, each VQG that division obtains is corresponding to a property value of each message attribute in this message attribute combination; Wherein, message attribute combination is made up of following at least one message attribute: send mode, priority, general grade, inbound port, protocol type, message content;
Configuration module, is used to each VQG to configure corresponding cache resources threshold value;
Determination module, for when the needs buffer memory message, is identified for depositing the VOQ of described message, according to the message attribute of described message, determines the VQG under this VOQ;
Whether processing module, for the cache resources value sum that need to take according to the current cache resources value taking of this VQG and described message, be greater than the cache resources threshold value that this VQG is corresponding, determines whether described message to be stored in this VOQ.
10. device according to claim 9, is characterized in that, in the time that message attribute combination has at least two, the VQG under definite VOQ has at least two, and, described processing module comprises:
Discarding unit, if the cache resources value sum that need to take for judging the current cache resources value taking of arbitrary VQG under this VOQ and described message is greater than the cache resources threshold value that this VQG is corresponding, abandons described message;
Storage unit, if the cache resources value sum that need to take for judging the current cache resources value taking of each VQG under this VOQ and described message is all not more than the cache resources threshold value that this VQG is corresponding, is stored in described message in this VOQ.
11. devices according to claim 10, is characterized in that, described division module comprises:
The first division unit, for according to send mode, is divided at least two overall Global VQG by VOQ, and each Global VQG that division obtains is corresponding to a property value of send mode; Wherein, the property value of send mode comprises: clean culture, non-unicast and on send central processor CPU;
The second division unit, for according to send mode and priority, is divided at least two priority TC VQG by VOQ, and each TC VQG that division obtains is corresponding to a property value of a priority and send mode.
12. devices according to claim 11, is characterized in that, described configuration module comprises:
The first dispensing unit, is used to each Global VQG to configure corresponding cache resources threshold value, makes cache resources threshold value sum that all Global VQG are corresponding equal the sum of cache resources;
The second dispensing unit, for according to pre-defined rule, each TC VQG configures corresponding cache resources threshold value; Wherein, this pre-defined rule comprises: in all TC VQG of the same property value corresponding to send mode, the cache resources threshold value of each TC VQG configuration, all be not more than the cache resources threshold value of corresponding Global VQG, the priority that TC VQG is corresponding is higher, and the cache resources threshold value of configuration is larger, and, the difference of the priority that any two TC VQG are corresponding is less, and the difference of the cache resources threshold value of configuration is less; Wherein, corresponding Global VQG is the Global VQG corresponding to this property value of send mode.
13. devices according to claim 12, is characterized in that, described division module also comprises:
The 3rd division unit, for according to send mode and general grade, is divided at least two general grade CC VQG by VOQ, and each CC VQG that division obtains is corresponding to a property value of a general grade and send mode;
Wherein, general grade is high priority or low priority, or general grade is high priority, medium priority or low priority.
14. devices according to claim 13, is characterized in that, described configuration module also comprises:
The 3rd dispensing unit, for according to pre-defined rule, for each CC VQG configures corresponding cache resources threshold value;
Wherein, this pre-defined rule comprises: in all CC VQG of the same property value corresponding to send mode, the cache resources threshold value of each CC VQG configuration, all be not more than the cache resources threshold value of corresponding Global VQG, the general higher grade that CC VQG is corresponding, and the cache resources threshold value of configuration is larger, and, corresponding to except the cache resources threshold value sum of the CC VQG of other the general grades grade for high pass, be less than the cache resources threshold value of corresponding Global VQG; Wherein, corresponding Global VQG is the Global VQG corresponding to this property value of send mode.
15. devices according to claim 10, is characterized in that, described division module comprises:
The first division unit, for according to send mode, is divided at least two Global VQG by VOQ, and each Global VQG that division obtains is corresponding to a property value of send mode; Wherein, the property value of send mode comprises: clean culture, non-unicast and transmitted to CPU;
The second division unit, for according to inbound port, is divided at least two inbound port IPT VQG by VOQ, divides each the IPT VQG obtaining corresponding to an inbound port.
16. devices according to claim 15, is characterized in that, described configuration module comprises:
The first dispensing unit, is used to each Global VQG to configure corresponding cache resources threshold value, makes cache resources threshold value sum that all Global VQG are corresponding equal the total Sum of cache resources;
The second dispensing unit, being used to each IPT VQG to configure corresponding cache resources threshold value is Sum/N, wherein, the maximum quantity of congested inbound port when N is default.
CN201410052358.9A 2014-02-17 2014-02-17 The management method of cache resources and device Active CN103780507B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410052358.9A CN103780507B (en) 2014-02-17 2014-02-17 The management method of cache resources and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410052358.9A CN103780507B (en) 2014-02-17 2014-02-17 The management method of cache resources and device

Publications (2)

Publication Number Publication Date
CN103780507A true CN103780507A (en) 2014-05-07
CN103780507B CN103780507B (en) 2017-03-15

Family

ID=50572355

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410052358.9A Active CN103780507B (en) 2014-02-17 2014-02-17 The management method of cache resources and device

Country Status (1)

Country Link
CN (1) CN103780507B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106302232A (en) * 2015-05-25 2017-01-04 深圳市中兴微电子技术有限公司 A kind of buffer memory management method and local device
CN106850714A (en) * 2015-12-04 2017-06-13 中国电信股份有限公司 Caching sharing method and device
CN107005488A (en) * 2014-12-23 2017-08-01 英特尔公司 Generic queue

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101771666A (en) * 2008-12-26 2010-07-07 中卫星空移动多媒体网络有限公司 Terrestrial mobile multimedia broadcasting based method for managing cache of multimedia data distributing broadcasting system
CN102447610B (en) * 2010-10-14 2015-05-20 中兴通讯股份有限公司 Method and device for realizing message buffer resource sharing
CN102694730B (en) * 2012-05-28 2014-12-03 华为技术有限公司 Method and device for parallel processing

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107005488A (en) * 2014-12-23 2017-08-01 英特尔公司 Generic queue
CN106302232A (en) * 2015-05-25 2017-01-04 深圳市中兴微电子技术有限公司 A kind of buffer memory management method and local device
CN106850714A (en) * 2015-12-04 2017-06-13 中国电信股份有限公司 Caching sharing method and device
CN106850714B (en) * 2015-12-04 2021-03-09 中国电信股份有限公司 Cache sharing method and device

Also Published As

Publication number Publication date
CN103780507B (en) 2017-03-15

Similar Documents

Publication Publication Date Title
CN108259383B (en) Data transmission method and network equipment
US9590914B2 (en) Randomized per-packet port channel load balancing
TWI510030B (en) System and method for performing packet queuing on a client device using packet service classifications
US9106574B2 (en) Supporting quality of service differentiation using a single shared buffer
US11637786B1 (en) Multi-destination traffic handling optimizations in a network device
CN103986664A (en) Mixed interconnection Mesh topological structure for on-chip network and routing algorithm thereof
WO2020134425A1 (en) Data processing method, apparatus, and device, and storage medium
US9774461B2 (en) Network switch with dynamic multicast queues
US20220078119A1 (en) Network interface device with flow control capability
JP6569374B2 (en) Switch device and control method of switch device
EP3588880A1 (en) Queuing system to predict packet lifetime in a computing device
US20190166058A1 (en) Packet processing method and router
US11165710B2 (en) Network device with less buffer pressure
CN103780507A (en) Method and device for managing cache resources
CN111585911A (en) Method for balancing network traffic load of data center
US8879578B2 (en) Reducing store and forward delay in distributed systems
WO2021143913A1 (en) Congestion control method, apparatus and system, and storage medium
KR20210130766A (en) Memory management methods and devices
CN112272933B (en) Queue control method, device and storage medium
US11516145B2 (en) Packet control method, flow table update method, and node device
CN107835135B (en) Shared buffer access control method and device
US9922000B2 (en) Packet buffer with dynamic bypass
WO2019028723A1 (en) Multicast program management method and device and network device
CN112311678B (en) Method and device for realizing message distribution
JP7251060B2 (en) Information processing device, information processing system and information processing program

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CP03 Change of name, title or address

Address after: 310052 Binjiang District Changhe Road, Zhejiang, China, No. 466, No.

Patentee after: Xinhua three Technology Co., Ltd.

Address before: 310053 Hangzhou hi tech Industrial Development Zone, Zhejiang province science and Technology Industrial Park, No. 310 and No. six road, HUAWEI, Hangzhou production base

Patentee before: Huasan Communication Technology Co., Ltd.

CP03 Change of name, title or address