Summary of the invention
Present invention aim to address OpenvSwitch under multi-core environment, and the distribution of convection current does not fully consider caching one
Cause property, load balancing depend on scheduling of the Linux to thread, it is difficult to be applied in multicore real time operating system;And
The OpenvSwitch not unrelated forwarding of supported protocol, stream caching method can be not applied directly in agreement independent environment.
To achieve the above object, it is slow that the present invention provides a kind of unrelated forwarding flows of agreement suitable for multi-core network processor
Method is deposited, the factors such as flow table critical field, core load, QoS are included in stream scheduling mechanism.This method means to integrate
Consider that Buffer Utilization, computing resource utilization rate and QoS etc. are required.
The present invention provides a kind of unrelated forwarding flow caching methods of agreement, applied to unrelated turn of the agreement containing scheduler module
Interchanger is sent out, the scheduling strategy of scheduler module is related to the load of multiple cores and flow table critical field, and core includes stream caching;
A kind of unrelated forwarding flow caching method of agreement the following steps are included:
Message is received by the unrelated forwarding interchanger of agreement, by stream scheduling mechanism by dispatching message into multiple cores one
A core;
After core receives message, the predefined field value of message is matched with stream caching, is carried out according to matching result
Corresponding caching.
Wherein, after core receives the message, the predefined field value of message is matched with stream caching, according to matching
As a result include: in the step of carrying out corresponding caching
When core receives the message for needing to cache, the predefined field in message is matched with cache flow;
If stream belonging to message is uncached, message is executed according to the data path of list item and action schedule, and record matching
List item records stream information at the end of data path, as new data cached;
If stream spatial cache has been expired, free time longest several stream cachings and free time are deleted beyond threshold value
Cache flow;
It is inserted into new cache flow, process terminates.
After core receives the message, the predefined field value of message is matched with stream caching, according to matching result
Include: in the step of carrying out corresponding caching
When core receives the message for needing to cache, the predefined field in message is matched with cache flow;
If stream belonging to message has cached, the list item movement in caching is executed in order, and more new information, process terminates.
After core receives the message, the predefined field value of message is matched with stream caching, according to matching result
Include: in the step of carrying out corresponding caching
If buffer area is less than, it is inserted into new cache flow, process terminates.
When calculating the primary key value of the message in scheduler module, it is ensured that same stream is dispatched to the same core
In the heart.
Stream each of the scheduling mechanism core separately maintains stream caching, including the foundation of caching, the mistake of caching
Caching caused by effect and flow table update is deleted.
The flow table in stream scheduling mechanism is obtained by the configuration phase or operation phase of the unrelated forwarding interchanger of agreement
Critical field;
In configuration phase, flow table critical field is obtained by the disagreement position of analysis and Control stream;
In the operation phase, flow table critical field jumps relationship by analysis flow table and obtains.
Wherein, it in the operation phase, updates or includes: the step of deleting flow table
The unrelated forwarding interchanger of agreement receives the request that the list item of control plane is updated or deleted;
Each core is notified to delete stream relevant to list item is changed and cache;
If it is more than preset range that flow table, which updates quantity, need to update the definition of flow table critical field;
It updates if being defined apart from last time flow table critical field more than removing and the jump between statistic fluid table again if preset time
Transfering the letter breath;
It analyzes and identifies the jump information between the flow table, choose new flow table critical field definition, process terminates.
Operation phase updates or includes: the step of deleting flow table
The unrelated forwarding interchanger of agreement receives the request that the list item of control plane is updated or deleted;
Each core is notified to delete stream relevant to list item is changed and cache;
If flow table, which updates quantity, is not above preset range, process terminates.
In the operation phase, updates or include: the step of deleting flow table
The unrelated forwarding interchanger of agreement receives the request that the list item of control plane is updated or deleted;
Each core is notified to delete stream relevant to list item is changed and cache;
If it is more than preset range that flow table, which updates quantity, need to update the definition of flow table critical field;
If updating apart from the definition of last time flow table critical field and being not above preset time, process terminates.
Compared with prior art, the invention has the benefit that
1, a kind of stream caching method suitable for multi-core network processor is provided.
2, by conjunction with the targets such as Buffer Utilization and computing resource utilization rate, QoS, more flexible stream scheduling mechanism is provided.
3, stream caching is mutually indepedent between core, improves Buffer Utilization, and then promote message forwarding performance.
Specific embodiment
Below by drawings and examples, technical scheme of the present invention will be described in further detail.
To make the objectives, technical solutions, and advantages of the present invention clearer, below in conjunction with attached drawing to the present invention make into
It is described in detail to one step, it is clear that described embodiments are only a part of the embodiments of the present invention, rather than whole implementation
Example.Based on the embodiments of the present invention, obtained by those of ordinary skill in the art without making creative efforts
Every other embodiment, shall fall within the protection scope of the present invention.
A kind of unrelated forwarding flow caching method of the agreement suitable for multi-core network processor is provided in the embodiment of the present invention,
The factors such as flow table critical field, core load, QoS are included in stream scheduling mechanism.This method means that caching can be comprehensively considered
The requirement such as utilization rate, computing resource utilization rate and QoS.The invention will be further elaborated for following embodiment content.
Fig. 1 is the message forwarding model schematic diagram in a kind of unrelated forwarding interchanger of agreement provided in an embodiment of the present invention.
As shown in Figure 1, the present invention provides a kind of unrelated forwarding flow caching method of agreement, it is unrelated applied to the agreement containing scheduler module
Interchanger is forwarded, the scheduling strategy of scheduler module is related to the load of multiple cores and flow table critical field, and core includes that stream is slow
It deposits;A kind of unrelated forwarding flow caching method of agreement the following steps are included:
Message is received by the unrelated forwarding interchanger of agreement, by stream scheduling mechanism by dispatching message into multiple cores one
A core;
After core receives message, the predefined field value of message is matched with stream caching, is carried out according to matching result
Corresponding caching.
Wherein, after core receives the message, the predefined field value of message is matched with stream caching, according to matching
As a result include: in the step of carrying out corresponding caching
When core receives the message for needing to cache, the predefined field in message is matched with cache flow;
If stream belonging to message is uncached, message is executed according to the data path of list item and action schedule, and record matching
List item records stream information at the end of data path, as new data cached;
If stream spatial cache has been expired, free time longest several stream cachings and free time are deleted beyond threshold value
Cache flow;
It is inserted into new cache flow, process terminates.
After core receives the message, the predefined field value of message is matched with stream caching, according to matching result
Include: in the step of carrying out corresponding caching
When core receives the message for needing to cache, the predefined field in message is matched with cache flow;
If stream belonging to message has cached, the list item movement in caching is executed in order, and more new information, process terminates.
After core receives the message, the predefined field value of message is matched with stream caching, according to matching result
Include: in the step of carrying out corresponding caching
If buffer area is less than, it is inserted into new cache flow, process terminates.
When calculating the primary key value of the message in scheduler module, it is ensured that same stream is dispatched to the same core
In the heart.
Stream each of the scheduling mechanism core separately maintains stream caching, including the foundation of caching, the mistake of caching
Caching caused by effect and flow table update is deleted.
The flow table in stream scheduling mechanism is obtained by the configuration phase or operation phase of the unrelated forwarding interchanger of agreement
Critical field;
In configuration phase, flow table critical field is obtained by the disagreement position of analysis and Control stream;
In the operation phase, flow table critical field jumps relationship by analysis flow table and obtains.
Wherein, it in the operation phase, updates or includes: the step of deleting flow table
The unrelated forwarding interchanger of agreement receives the request that the list item of control plane is updated or deleted;
Each core is notified to delete stream relevant to list item is changed and cache;
If it is more than preset range that flow table, which updates quantity, need to update the definition of flow table critical field;
If updating apart from the definition of last time flow table critical field is more than preset time
Then removing and the again jump information between statistic fluid table;
It analyzes and identifies the jump information between the flow table, choose new flow table critical field definition, process terminates.
Operation phase updates or includes: the step of deleting flow table
The unrelated forwarding interchanger of agreement receives the request that the list item of control plane is updated or deleted;
Each core is notified to delete stream relevant to list item is changed and cache;
If flow table, which updates quantity, is not above preset range, process terminates.
In the operation phase, updates or include: the step of deleting flow table
The unrelated forwarding interchanger of agreement receives the request that the list item of control plane is updated or deleted;
Each core is notified to delete stream relevant to list item is changed and cache;
If it is more than preset range that flow table, which updates quantity, need to update the definition of flow table critical field;
If updating apart from the definition of last time flow table critical field and being not above preset time, process terminates.
In addition, being calculated specifically, be used to flow scheduling for flow table primary key value;Pass through the configuration of analysis forward-path and stream
Amount Actual path obtains the definition of flow table critical field;Each core separately maintains a stream caching;The stream cached is accelerated
The execution of matching plus movement establishes caching for uncached stream, and deletes idle stream caching.
The calculating of stream scheduling result therein, also comprising core load, QoS configuration and other information;Flow table critical field
Definition pass through analysis flow table dependence in interchanger configuration phase, determine control flow point discrimination position acquisition;In interchanger
Stage when operation, by jump information between statistics flow table, determine jump branch at most, the flow table of maximum flow obtains.
In the stage in interchanger operation, execute the update that flow table critical field defines, it is desirable that the flow table and list item of variation are super
Cross certain amount.Stream caching is accurately matched by all fields of packet parsing.In the stage at runtime, control stream can be with list item
Update and change, by counting flow table jump information, from jumping branch at most, in the flow table of maximum flow, choose keyword
Section.
Stage at runtime, the update that flow table critical field defines, it is desirable that updating from last time definition is more than preset time, and
The flow table and list item of variation are more than certain amount.
When the corresponding stream of message is uncached, the matching of recorded message adds action executing process, caches as new stream;
When the corresponding stream of message has cached, adds action executing process according to the matching recorded in caching, message is carried out
Acceleration processing;
When being inserted into new stream caching, if buffer area has been expired, free time longest several stream cachings are deleted, and idle
Time caches beyond the stream of threshold value.
To accelerate the matching of message that movement is added to execute speed, a kind of common method is that the matching of cache flow adds movement to execute
Process adds action schedule to jump except first message of stream needs to be implemented multiple matching, and subsequent packet only needs to execute once matching and adds
Movement.Wherein, flow table critical field refers in field definition, the field that the differentiation of convection current plays a major role.
Fig. 2 is a kind of stream scheduling mechanism schematic diagram provided in an embodiment of the present invention.As shown in Fig. 2, by the unrelated forwarding of agreement
Interchanger receives the message for needing to cache, by flowing scheduling mechanism for dispatching message a to core in the multiple core;
After core receives message, the predefined field value of message is matched with stream caching, is carried out according to matching result
Corresponding caching.The predefined field value of message is matched with stream caching, is delayed accordingly according to matching result
Include: in the step of depositing operation
When core receives the message for needing to cache, the predefined field in message is matched with cache flow;
If stream belonging to message is uncached, message is executed according to the data path of list item and action schedule, and record matching
List item records stream information at the end of data path, as new data cached;
If stream spatial cache has been expired, free time longest several stream cachings and free time are deleted beyond threshold value
Cache flow;
It is inserted into new cache flow, process terminates.
After core receives message, the predefined field value of message is matched with stream caching, is carried out according to matching result
Include: in the step of corresponding caching
When core receives the message for needing to cache, the predefined field in message is matched with cache flow;
If stream belonging to message has cached, the list item movement in caching is executed in order, and more new information, process terminates.
After core receives message, the predefined field value of message is matched with stream caching, is carried out according to matching result
Include: in the step of corresponding caching
If buffer area is less than, it is inserted into new cache flow, process terminates.
Wherein, when calculating the primary key value of message in scheduler module, it is ensured that same stream is dispatched to same described
In core.
Stream scheduling mechanism in each core separately maintain stream caching, including the foundation of caching, the failure of caching and
Caching caused by flow table updates is deleted.
Method provided by the invention specifically includes the critical field chosen and played a major role to traffic differentiation, is included in stream
In scheduling mechanism.Flow table critical field is obtained in configuration phase by the disagreement position of analysis and Control stream;Stage at runtime,
Relationship is jumped by analysis flow table to obtain.Each core separately maintains stream caching.Message corresponds to if it exists after being dispatched to core
Stream caching, then accelerate to execute;Corresponding stream caching if it does not exist, then execute and record matching add movement, add as new stream
Enter caching.
The scheduler module wherein flowed in scheduling mechanism incorporates the factors such as flow table critical field, core load and QoS.Matching
It sets the stage, the definition initialization step of flow table critical field is as follows:
Interchanger receives the data path configuration that control plane issues in configuration phase, obtains flow table dependence;
Flow table dependence is analyzed, judges to control flow point discrimination position, selects the definition of flow table critical field.
More accurately, it is proposed by the present invention stream scheduling mechanism in be included in flow table critical field, core load, QoS etc. its
The method of his factor.It comprises the steps of:
Define flow table critical field.
Determine that control flow point discrimination position obtains critical field by analyzing flow table dependence in configuration phase;
Calculate the other informations such as core load, QoS;
Message keyword segment value is calculated, guarantees that same stream is dispatched in the same core.
In addition, there are also the method that each core separately maintains stream caching, including caching is established, cache invalidation and flow table update
Caused caching is deleted.
Stream caching is accurately matched by all fields of packet parsing.When the corresponding stream of message is uncached, by following
Step establishes stream caching:
The initial value of recorded message field;
The data path for tracking message, is sequentially recorded matched list item and movement, and records being associated with for list item and the stream
Information;
At the end of message data path, it is inserted into new stream caching.
If spatial cache has been expired, free time longest several stream cachings and free time are deleted beyond threshold value
Stream caching.
When list item is updated or is deleted, deletes and cached with the associated stream of list item.
The stage updates flow table critical field flow chart when Fig. 3 is a kind of operation provided in an embodiment of the present invention.Such as Fig. 3 institute
Show, obtains the flow table critical field in stream scheduling mechanism by the configuration phase or operation phase of the unrelated forwarding interchanger of agreement;
In configuration phase, flow table critical field is obtained by the disagreement position of analysis and Control stream;In the operation phase, flow table critical field is logical
It crosses analysis flow table and jumps relationship and obtain.Operation phase updates or includes: the step of deleting flow table
The unrelated forwarding interchanger of agreement receives the request that the list item of control plane is updated or deleted;
Each core is notified to delete stream relevant to list item is changed and cache;
If it is more than preset range that flow table, which updates quantity, need to update the definition of flow table critical field;
It updates if being defined apart from last time flow table critical field more than removing and the jump between statistic fluid table again if preset time
Transfering the letter breath;
It analyzes and identifies the jump information between the flow table, choose new flow table critical field definition, process terminates.
Operation phase updates or includes: the step of deleting flow table
The unrelated forwarding interchanger of agreement receives the request that the list item of control plane is updated or deleted;
Each core is notified to delete stream relevant to list item is changed and cache;
If flow table, which updates quantity, is not above preset range, process terminates.
In the operation phase, updates or include: the step of deleting flow table
The unrelated forwarding interchanger of agreement receives the request that the list item of control plane is updated or deleted;
Each core is notified to delete stream relevant to list item is changed and cache;
If it is more than preset range that flow table, which updates quantity, need to update the definition of flow table critical field;
If updating apart from the definition of last time flow table critical field and being not above preset time, process terminates.
Specifically, stage at runtime, updating flow table, specific step is as follows:
(1) list item that interchanger receives control plane updates (deletion) request;
(2) each core is notified to delete stream relevant to list item is changed and cache;
(3) it if it is more than preset range that flow table, which updates quantity, needs to update the definition of flow table critical field, enters step (4),
Otherwise process terminates;
(4) if updating apart from the definition of last time flow table critical field is more than preset time, (5) are entered step, otherwise process knot
Beam;
(5) removing and again jump information between statistic fluid table;
(6) jump information between analysis flow table, identification jump several flow tables that branch is more and flow is big, choose new flow table and close
Key field definition.
After message is scheduled for core, core is according to the addition of stream cache match situation and deletes stream caching.
Fig. 4 is a kind of stream cache match flow chart provided in an embodiment of the present invention.As shown in figure 4, as shown in figure 4, stream is slow
It is as follows to deposit matching step:
(1) after core receives message, the predefined field value of message is accurately matched with stream caching;
(2) if stream belonging to message has cached, (3) is entered step, (4) are otherwise entered step;
(3) the list item movement in caching is executed in order, updates the free time of stream caching, and is recorded stream and jumped etc. other
Information, process terminate;
(4) message adds the data path of action schedule to execute according to list item, the list item of record matching;
(5) at the end of data path, stream information is recorded, as new caching.If stream buffer area has been expired, (6) are entered step,
Otherwise (7) are entered step;
(6) free time longest several stream cachings are deleted and free time caches beyond the stream of threshold value;
(7) it is inserted into new stream caching, process terminates.
When list item is updated or is deleted, deletes and cached with the associated stream of list item.
Above-described specific embodiment has carried out further the purpose of the present invention, technical scheme and beneficial effects
It is described in detail, it should be understood that being not intended to limit the present invention the foregoing is merely a specific embodiment of the invention
Protection scope, all within the spirits and principles of the present invention, any modification, equivalent substitution, improvement and etc. done should all include
Within protection scope of the present invention.