CN105871741A - Packet dispersion method and device - Google Patents

Packet dispersion method and device Download PDF

Info

Publication number
CN105871741A
CN105871741A CN201510037385.3A CN201510037385A CN105871741A CN 105871741 A CN105871741 A CN 105871741A CN 201510037385 A CN201510037385 A CN 201510037385A CN 105871741 A CN105871741 A CN 105871741A
Authority
CN
China
Prior art keywords
port numbers
mask
message
network interface
processor core
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
CN201510037385.3A
Other languages
Chinese (zh)
Other versions
CN105871741B (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.)
Alibaba Group Holding Ltd
Original Assignee
Alibaba Group Holding 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 Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN201510037385.3A priority Critical patent/CN105871741B/en
Publication of CN105871741A publication Critical patent/CN105871741A/en
Application granted granted Critical
Publication of CN105871741B publication Critical patent/CN105871741B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The present invention provides a packet dispersion method and device. The method comprises: the source and the object IP address mask in the filter mask of a network card flow controller and the source port number mask are set to be zero, and the object port number mask is set to be non-zero; different port number assemblies are distributed to each processor core, and the corresponding relation between the network card packet queue related to each processor core and the port number assemblies is arranged; the processor cores are configured to set the source port number of the received forward direction packet by using the port numbers in the distributed port number assemblies, and the forward direction packet is sent; the network card receives the backward direction packet and then perform flow controller filtering through the filter mask, and the backward direction packet is dispersed to the network card packet queue corresponding to the port number assembly consisting of the object port numbers; and the processor cores and the backward packet in the network card packet queue related to the processor core are processed. The packet dispersion method and device fully employs the filter dispersion technology of the existing flow controller of the network card hardware to send the same flow packet to the same processor core for processing.

Description

A kind of message diversion method and device
Technical field
The application relates to network communication field, particularly relates to a kind of message diversion method and device.
Background technology
In the network device, three-layer equipment has only to process bag and forwards, and four layers and above equipment are such as NAT (Network Address Translation, network address translation) gateway, VPN (Virtual Private Network, Virtual Private Network) gateway then needs to safeguard session information, only determines message Just can extract corresponding session information after affiliated session and carry out the process of message.And it is many for being provided with Processor or the network equipment of polycaryon processor, if multiple processor core processes same session simultaneously Can relate to the session locking of complexity, message goes out, the problem such as incoming interface order-preserving, and this not only can increase system Complexity, also systematic function can be caused and have a strong impact on, it is therefore desirable to same stream/same will be belonged to The message of individual session is delivered to same processor core and is processed in the heart.
Main flow network interface card hardware typically both provides diverter function at present, can be by arranging hardware filtering condition Realize shunting.As a example by INTEL (Intel) 82599 network interface card, its RSS (Receive-Side provided Scaling, receiving terminal regulates) message can be diverted to specifically by diverter function according to the five-tuple of message Processor core processes, but can only support the individual different five-tuple of most 32K (32 × 1024) Combination, this is obviously nowhere near for the application of gateway class.
Additionally, the network equipment may change the IP (Internet of message when processing message Protocol, Internet protocol) address and port numbers.Such as, message is processing through source NAT device Its source IP address rear can change;For another example, message may be coupled with one newly after VPN device processes IP head, this can change the IP address of message equally.If the forward report of same stream/same session Literary composition (message i.e. sent by Connection initiator) and reverse message (being i.e. sent to the message of Connection initiator) IP address incomplete same, then rely on network interface card RSS diverter function be difficult to be diverted to bi-directional session with One processor core processes.
Publication No. " 103269317A ", entitled " based on symmetric multi-processors smp system without lock Change communication means and system " Chinese patent in disclose a kind of RSS message diversion method, the method Main thought be that whole system is run on pipeline (pipeline) pattern, and by a processor core The heart (such as, be denoted as CoreA) is used for processing message shunting, and message is all delivered to CoreA by network interface card, by After a CoreA execution Hash (HASH) computing, message is sent to by the result further according to Hash operation Corresponding processor core.
Above-mentioned shunt method needs to use a processor core to be exclusively used in message shunting, does not carry out other industry The process of business, wastes processor resource, and this processor core easily becomes the performance of whole system Bottleneck.Additionally, due to whole system runs under pipe modes when using above-mentioned shunt method, once report Literary composition processes to be needed jointly to be completed by multiple processor cores, and therefore the data needed for a Message processing need Being stored in the cache memory (Cache) corresponding to multiple processor core, this will reduce place The Cache hit rate of reason device, reduce further systematic function.
Summary of the invention
The purpose of the application is to provide message diversion method and device.
In order to achieve the above object, this application discloses a kind of message diversion method, the method includes:
By the source IP address mask in the filter mask of network interface card stream controller, the address mask of purpose IP and Source port number mask is set to 0, and destination slogan mask is set to non-zero value;
Distribute different port numbers set for each processor core, and arrange associated by each processor core Network interface card message queue and the corresponding relation of described port numbers set;
Processor core uses and arranges its forward received for the port numbers in the port numbers set of its distribution The source port number of message, sends this forward message by network interface card;
Network interface card uses described filter mask to carry out stream controller filtration after receiving reverse message, this is anti- It is diverted to and the network interface card message queue corresponding to the port numbers set belonging to its destination slogan to message;
Reverse message in network interface card message queue associated with it is processed by processor core;
Wherein, the port numbers in different port number set carries out step-by-step and institute with described destination slogan mask The result obtained is different;Port numbers in same port number set carries out step-by-step with described destination slogan mask Identical with the result of gained.
Additionally, the value of described destination slogan mask is: 0xFFFF < < m;
Wherein, 0 < m < 16, < < represent binary shift left.
Additionally, the port numbers in described port numbers set is non-well-known port number.
Additionally, arrange the network interface card message queue associated by processor core and described port in the following way Number set corresponding relation:
Port numbers in the port numbers set that will distribute for processor core is entered with described destination slogan mask Row step-by-step with end value depositing corresponding to the network interface card message queue associated with this processor core is set In device.
Additionally, described port numbers set includes: P1, P2..., Pn
Port numbers set PiIn the port numbers that comprises be: 2m+i-1,…,2m+i-1;1≤i≤n;
Wherein, m >=10, n≤16-m.
In order to achieve the above object, disclosed herein as well is a kind of message part flow arrangement, this device includes:
Mask arranges module, for being covered by the source IP address in the filter mask of network interface card stream controller Code, the address mask of purpose IP and source port number mask are set to 0, are set to non-by destination slogan mask 0 value;
Port number assignment module, for the port numbers set different for the distribution of each processor core, and is arranged Network interface card message queue associated by each processor core and the corresponding relation of described port numbers set;
Processor core, the port numbers in using as its port numbers set distributed arranges it and receives The source port number of forward message, send this forward message by network interface card;
Network interface card, for using described filter mask to carry out stream controller mistake after receiving reverse message Filter, is diverted to this reverse message and the network interface card report corresponding to the port numbers set belonging to its destination slogan Literary composition queue;
Described processor core, is additionally operable to carry out the reverse message in network interface card message queue associated with it Process;
Wherein, the port numbers in different port number set carries out step-by-step and institute with described destination slogan mask The result obtained is different;Port numbers in same port number set carries out step-by-step with described destination slogan mask Identical with the result of gained.
Additionally, described mask arranges module, described destination slogan mask is set to: 0xFFFF < < m;
Wherein, 0 < m < 16, < < represent binary shift left.
Additionally, the port numbers in the described port numbers set of described port number assignment module assignment is non-well-known Port numbers.
Additionally, described port number assignment module arranges the network interface card associated by processor core in the following way Message queue and the corresponding relation of described port numbers set:
Port numbers in the port numbers set that will distribute for processor core is entered with described destination slogan mask Row step-by-step with end value depositing corresponding to the network interface card message queue associated with this processor core is set In device.
Additionally, the described port numbers set of described port number assignment module assignment includes: P1, P2..., Pn
Port numbers set PiIn the port numbers that comprises be: 2m+i-1,…,2m+i-1;1≤i≤n;
Wherein, m >=10, n≤16-m.
Compared with prior art, the application can obtain and include techniques below effect:
Make full use of the filter bypass technology of the existing stream controller of network interface card hardware, same stream will be belonged to The message of/same session delivers to same processor core and processes in the heart, it is to avoid pipe modes is to system The adverse effect that performance causes;
By well-known port number is got rid of outside the port numbers set distributing to each processor core, permissible The filter bypass technology of the application is used in combination with other dividing technology of network interface card hardware, it is to avoid tool There is each processor core that a large amount of messages of well-known port are intensively allocated to a processor core and cause The problem of load imbalance.
Certainly, the arbitrary product implementing the application it is not absolutely required to reach all the above skill simultaneously Art effect.
Accompanying drawing explanation
Accompanying drawing described herein is used for providing further understanding of the present application, constitutes of the application Point, the schematic description and description of the application is used for explaining the application, is not intended that the application's Improper restriction.In the accompanying drawings:
Fig. 1 is the method flow diagram of a kind of message diversion method of the embodiment of the present application;
Fig. 2 is the method flow diagram of the another kind of message diversion method of the embodiment of the present application;
Fig. 3 is the method flow diagram of the another kind of message diversion method of the embodiment of the present application;
Fig. 4 is the Message processing process signal of the source NAT gateway of the message diversion method using the application Figure;
Fig. 5 is the structure drawing of device of the message part flow arrangement of the embodiment of the present application.
Detailed description of the invention
Presently filed embodiment is described in detail, thereby to the application below in conjunction with drawings and Examples How application technology means solve technical problem and reach the process that realizes of technology effect and can fully understand also Implement according to this.
In a typical configuration, calculating equipment include one or more processor (CPU), input/ Output interface, network interface and internal memory.
Internal memory potentially includes the volatile memory in computer-readable medium, random access memory (RAM) and/or the form such as Nonvolatile memory, such as read only memory (ROM) or flash memory (flash RAM).Internal memory is the example of computer-readable medium.
Computer-readable medium includes that permanent and non-permanent, removable and non-removable media can be by Any method or technology realize information storage.Information can be computer-readable instruction, data structure, The module of program or other data.The example of the storage medium of computer includes, but are not limited to phase transition internal memory (PRAM), static RAM (SRAM), dynamic random access memory (DRAM), Other kinds of random access memory (RAM), read only memory (ROM), electrically erasable Read only memory (EEPROM), fast flash memory bank or other memory techniques, the read-only storage of read-only optical disc Device (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassette tape, magnetic The storage of band magnetic rigid disk or other magnetic storage apparatus or any other non-transmission medium, can be used for storing permissible The information being accessed by a computing device.According to defining herein, computer-readable medium does not include non-temporary Computer readable media (transitory media), such as data signal and the carrier wave of modulation.
Embodiment describes
With an embodiment, the realization of the application method is described further below.As it is shown in figure 1, be this A kind of method flow diagram of the message diversion method of application embodiment, the method includes:
Step S100: by the filter of the filter (Flow Director Filters) of network interface card stream controller Source IP address mask, the address mask of purpose IP and source port number mask in mask are set to 0, by mesh Port numbers mask be set to non-zero value.
Step S102: distribute different port numbers set for each processor core, and each processor is set Network interface card message queue associated by core and the corresponding relation of described port numbers set;
The port numbers comprised in above-mentioned port numbers set meets following condition: the end in different port number set It is different with the result of gained that slogan carries out step-by-step from described destination slogan mask;In same port number set Port numbers to carry out step-by-step with described destination slogan mask identical with the result of gained.
Step S104: processor core uses and arranges it for the port numbers in the port numbers set of its distribution The source port number of the forward message received, sends this forward message by network interface card.
Step S106: network interface card uses described filter mask to carry out stream controller after receiving reverse message Filter, this reverse message is diverted to and the network interface card corresponding to the port numbers set belonging to its destination slogan Message queue.
Step S108: the reverse message in network interface card message queue associated with it is carried out by processor core Process.
With the second embodiment, the realization of the application method is described further below.As in figure 2 it is shown, be The method flow diagram of the another kind of message diversion method of the embodiment of the present application;In the present embodiment, in source NAT gateway is applied message diversion method;The method includes:
Step S200: the filter mask of the stream controller of network interface card is set in the NAT gateway of source;
The interface that operating system in the NAT gateway of source and upper application software can use network interface card to provide enters The setting of row filter mask.
The filter mask of network interface card includes: source IP address mask (source_ip_mask), purpose IP ground Location mask (dest_ip_mask), source port number mask (source_port_mask) and destination slogan Mask (dest_port_mask).
In order to realize the shunt method of the present invention, need to get rid of source IP address, purpose IP address in message With the source port number impact on shunting, therefore make:
Source_ip_mask=0;
Dest_ip_mask=0;
Source_port_mask=0;
And dest_port_mask is set to any one non-zero value.
Four layer protocols either TCP (Transfer Control Protocol, transmission control protocol) or UDP (User Datagram Protocol, UDP), its port numbers is all by 2 bytes Representing, the span of port numbers is 0~65535.Port numbers can be divided three classes:
Well-known port number (Well Known Ports), well-known port number is alternatively referred to as system reserved port Number, the scope of port numbers is: 0~1023;Well-known port number is used for the network service commonly used;
Registered port numbers, the scope of port numbers is: 1024~49151, and registered port numbers is assigned to use Family process or application program use;
Dynamic end slogan (Dynamic Ports), the scope of port numbers is: 49152~65535, dynamically Port numbers is generally not used for fixed allocation and services to certain, and for dynamically distribution.
Registered port numbers and dynamic end slogan can be collectively referred to as non-well-known port number.
The port numbers mask (such as, above-mentioned purpose port numbers mask) arranging non-zero value is substantially to hold Slogan is divided into multiple different port numbers set.Such as, make dest_port_mask=0x01, then will All of available port number (including well-known port number, registered port numbers and dynamic end slogan) is divided into two Port numbers set: port numbers lowest-order values be 1 port numbers set and port numbers lowest-order values be the end of 0 Slogan set.Each port numbers set comprises 215Individual port numbers.
Additionally, for the operational efficiency improving program, save the systems such as the internal memory for storing variable and provide Source, needs to comprise in each port numbers set continuous print port numbers, therefore, it can by Continuous m the bit value that dest_port_mask starts from lowest bit position is set to 0, remaining bit value It is set to 1.Port numbers will be divided into 2(16-m)Individual different port numbers set, each port numbers set In comprise 2mIndividual port numbers.That is, in the present embodiment, dest_port_mask can be set to: 0xFFFF<<m;
Wherein, 0 < m < 16, " < < " represents binary shift left.
Step S202: each processor core for source NAT gateway distributes different port numbers set, i.e. The port numbers comprised in each port numbers set is distributed to each processor core as resource;
Owing to well-known port number (port numbers is 0~1023) is for conventional network service, source NAT net The destination slogan of the forward message that the network interface card closed receives is usually well-known port number, this class forward report Literary composition generally should use the RSS diverter function of network interface card to shunt, in order to by uniform for such forward message It is diverted to multiple processor core process, is not usually required to the stream controller by using in the application Filter shunt.
Therefore, when for each processor core assignment of port numbers set, distribution generally should be avoided to comprise and to know The port numbers set of name port.
In the present embodiment, make m >=10, from 2mStart, divide following n port numbers set:
P1={ 2m,…,2m+1-1};
P2={ 2m+1,…,2m+2-1};
Pi={ 2m+i-1,…,2m+i-1};
Pn={ 2m+n-1,…,2m+n-1};
Wherein, n≤16-m.
In this step, can be processor core one port numbers set of distribution, it is also possible to be one Processor core distributes multiple port numbers set.
Step S204: be respectively provided with the net associated by each processor core in the network interface card of source NAT gateway Corresponding relation between card message queue and the port numbers set distributed by each processor core;
Source NAT gateway can be that each processor core distributes network interface card message queue in initialization procedure, builds Vertical incidence relation between processor core and network interface card message queue.
The interface that operating system in the NAT gateway of source and upper application software can use network interface card to provide sets Put the corresponding relation between network interface card message queue and port numbers set.
Such as, source NAT gateway comprises N number of processor core: Core1,…,CoreN
The network interface card message queue associated with each processor core is denoted as respectively: Q1,…,QN
The port numbers set distributed for each processor core is respectively as follows: P1,…,PN
The interface provided by network interface card is set up Q by this stepiAnd PiBetween corresponding relation.
Different types of network interface card provides different interfaces to carry out QiAnd PiBetween the foundation of corresponding relation.Example As, can be by port numbers set PiIn any one port numbers Pi[j] and destination slogan mask The step-by-step of dest_port_mask and the end value of calculating: Pi[j] &dest_port_mask arranges QiInstitute is right In the network interface card depositor answered.
Step S206: after the processor core of source NAT gateway receives forward message, according to this forward Five-tuple (i.e. source IP address, purpose IP address, source port number, destination slogan and the agreement of message Type) search corresponding session information;
If not finding the session information of correspondence, then it is that this forward message creates session, and at for this In the port numbers set of reason device core distribution, one port numbers of selection is as the transient port number of respective session, Preserve corresponding session information, and after using this transient port number to revise the source port number of this forward message, This forward message is sent by network interface card;
If finding the session information of correspondence, then from corresponding session information, extract the interim of this session Port numbers, and use this transient port number revise this forward message source port number after, sent by network interface card This forward message.
Step S208: after the network interface card of source NAT gateway receives reverse message, uses filter mask to enter Row stream controller filters, and is diverted to by this reverse message and the port numbers set institute belonging to its destination slogan In corresponding network interface card message queue;
The main process that stream controller filters includes:
1) filter mask and four-tuple (source IP address, purpose IP extracted from reverse message are used Address, source port number and destination slogan) carry out step-by-step and computing;
Due in the present invention by the source IP address mask in filter mask, the address mask of purpose IP and source Port numbers mask is set to 0, and this step can be expressed as:
Above-mentioned source_ip is the source IP address of reverse message, and dest_ip is the purpose IP ground of reverse message Location, source_port is the source port number of reverse message, and dest_port is the destination interface of reverse message Number.
According to the feature of step-by-step Yu (&) computing, the value of pMASK only by The value of dest_port&dest_port_mask determines.
2) use pMASK value to carry out Hash lookup, find the network interface card message corresponding with pMASK value Queue, this network interface card message queue is exactly corresponding with the value of dest_port&dest_port_mask, the most just It is and the network interface card message queue corresponding to the port numbers set belonging to the destination slogan of reverse message;
3) reverse message is sent in corresponding network interface card message queue.
From the description in step S204, owing to existing between network interface card message queue and processor core Corresponding relation, and the network interface card message queue corresponding with processor core is divided with by this processor core The port numbers set joined is corresponding (i.e. corresponding with the value of dest_port&dest_port_mask), therefore Filtering through above-mentioned stream controller, the most reversely message is transferred to and the end belonging to the destination interface of this message The corresponding processor core of slogan set processes.
Step S210: the processor core of source NAT gateway is in network interface card message queue associated with it Reversely message processes.
From the foregoing, it will be observed that use the message diversion method of the present embodiment, achieve same in the NAT gateway of source Article one, the forward message of stream/same session and reverse message are carried out processing by identical processor core Purpose.
With the 3rd embodiment, the realization of the application method is described further below.As it is shown on figure 3, be The method flow diagram of the another kind of message diversion method of the embodiment of the present application;In the present embodiment, at VPN Gateway is applied message diversion method;The method includes:
Step S300: the filter mask of the stream controller of network interface card is set in vpn gateway;
In order to realize the shunt method of the present invention, need to get rid of source IP address, purpose IP address in message With the source port number impact on shunting, therefore make:
Source_ip_mask=0;
Dest_ip_mask=0;
Source_port_mask=0;
Dest_port_mask=(0xFFFF < < m);Wherein 0 < m < 16.
Certainly, dest_port_mask can also be set to arbitrary non-zero value by the present embodiment.
Step S302: each processor core for vpn gateway distributes different port numbers set, will The port numbers comprised in each port numbers set distributes to each processor core as resource;
Equally, in order to avoid distribution comprises the port numbers set of well-known port, in the present embodiment, make m >= 10, from 2mStart, divide following n port numbers set:
P1={ 2m,…,2m+1-1};
P2={ 2m+1,…,2m+2-1};
Pi={ 2m+i-1,…,2m+i-1};
Pn={ 2m+n-1,…,2m+n-1};
Wherein, n≤16-m.
In this step, can be processor core one port numbers set of distribution, it is also possible to be one Processor core distributes multiple port numbers set.
Step S304: be respectively provided with the network interface card associated by each processor core in the network interface card of vpn gateway Corresponding relation between message queue and the port numbers set distributed by each processor core;
The interface that operating system in vpn gateway and upper application software can use network interface card to provide is arranged Corresponding relation between network interface card message queue and port numbers set.
Such as, vpn gateway comprises N number of processor core: Core1,…,CoreN
The network interface card message queue associated with each processor core is denoted as respectively: Q1,…,QN
The port numbers set distributed for each processor core is respectively as follows: P1,…,PN
The interface provided by network interface card is set up Q by this stepiAnd PiBetween corresponding relation.
After the processor core of step S306:VPN gateway receives forward message, according to this forward report Five-tuple (i.e. source IP address, purpose IP address, source port number, destination slogan and the protocol class of literary composition Type) search corresponding session information;
If not finding the session information of correspondence, then it is that this forward message creates session, and at for this In the port numbers set of reason device core distribution, one port numbers of selection is as the transient port number of respective session, Preserve corresponding session information, and use this transient port number as the external IP head of this forward message Source port number, sends this forward message by network interface card after adding external IP head for this forward message;
If finding the session information of correspondence, then from corresponding session information, extract the interim of this session Port numbers, and use this transient port number as the source port number of the external IP head of this forward message, for This forward message sends this forward message by network interface card after adding external IP head.
After the network interface card of step S308:VPN gateway receives reverse message, filter mask is used to carry out Stream controller filters, and it is right with the port numbers set institute belonging to its destination slogan to be diverted to by this reverse message In the network interface card message queue answered.
Anti-in network interface card message queue associated with it of the processor core of step S310:VPN gateway Process to message.
From the foregoing, it will be observed that use the message diversion method of the present embodiment, achieve same in vpn gateway The forward message of bar stream/same session is carried out the mesh processed with reverse message by identical processor core 's.
Application example describes
With an application example, the realization of the application method is described further below.As shown in Figure 4, for Use the Message processing process schematic of the source NAT gateway of the message diversion method of the application.
Assume that client sends forward message: message 1, its source IP address is: 1.1.1.1, source port number For: 1234, purpose IP address is: 2.2.2.2, and destination slogan is: 80;
After message 1 arrives source NAT gateway, owing to the destination slogan of this message is 80, for well-known end Slogan, is not comprised in distributing in the port numbers set of each processor core, and therefore network interface card uses other Message 1 is diverted to a certain processor core by shunting mode (such as, RSS diverter function), such as, Core10On;
Core10After receiving message 1, the four-tuple according to message 1 does not inquires corresponding session information, Therefore perform NAT logic, select a NAT IP address (such as, 3.3.3.3) for message 1, and From Core10Corresponding port numbers set select a port numbers (such as, 40961) as transient port Number, and use above-mentioned IP address and the source IP address of transient port number amendment message 1 and source port number, After preserving related session information, message 1 is converted to message 1 ', is sent out by the network interface card of source NAT gateway Deliver newspaper literary composition 1 ';
It is 3.3.3.3 that the network interface card of source NAT gateway receives purpose IP address, and destination slogan is 40961 Reverse message (being denoted as: message 2) after, use filter mask to carry out stream controller filtration, will report Literary composition 2 is diverted to Core10Process;
Core10According to NAT logic, according to the session information preserved, use IP address 1.1.1.1, with And port numbers 1234 revises purpose IP address and the destination slogan of message 2, message 2 is converted to report Literary composition 2 ', sends message 2 ' by the network interface card of source NAT gateway.
From the foregoing, it will be observed that belong to the forward message of same stream/same session and reverse message is all split Process to same processor core.
With another embodiment, the realization of the application device is described further below.As it is shown in figure 5, be The structure drawing of device of the message part flow arrangement of the embodiment of the present application, message part flow arrangement includes: mask is arranged Module 500, port number assignment module 502, processor core 504, network interface card 506;Wherein:
Mask arranges module, for being covered by the source IP address in the filter mask of network interface card stream controller Code, the address mask of purpose IP and source port number mask are set to 0, are set to non-by destination slogan mask 0 value;
Port number assignment module, for the port numbers set different for the distribution of each processor core, and is arranged Network interface card message queue associated by each processor core and the corresponding relation of port numbers set;
Processor core, the port numbers in using as its port numbers set distributed arranges it and receives The source port number of forward message, send this forward message by network interface card;
Network interface card, for using filter mask to carry out stream controller filtration after receiving reverse message, will This reverse message is diverted to and the network interface card message team corresponding to the port numbers set belonging to its destination slogan Row;
Processor core, is additionally operable to the reverse message in network interface card message queue associated with it Reason;
Port numbers in different port number set carries out the result of step-by-step and gained not with destination slogan mask With;Port numbers in same port number set and destination slogan mask carry out the result phase of step-by-step and gained With.
Mask arranges module and is set to by destination slogan mask: 0xFFFF < < m;Wherein, 0 < m < 16, < < represent binary shift left.
Preferably, the port numbers set of port number assignment module assignment includes: P1, P2..., Pn
Port numbers set PiIn the port numbers that comprises be: 2m+i-1,…,2m+i-1;1≤i≤n;
Wherein, m >=10, n≤16-m.
Port numbers in the port numbers set of port number assignment module assignment is non-well-known port number.
Port number assignment module arrange in the following way network interface card message queue associated by processor core with The corresponding relation of port numbers set:
Port numbers in the port numbers set that will distribute for processor core and destination slogan mask carry out by Position with end value the depositor corresponding to the network interface card message queue associated with this processor core is set In.
Described device describes corresponding with aforesaid method flow, more specifically describes and refer to said method stream The narration of journey, repeats the most one by one.
Described above illustrate and describes some preferred embodiments of the application, but as previously mentioned, it should reason Solve the application and be not limited to form disclosed herein, be not to be taken as the eliminating to other embodiments, And can be used for various other combination, amendment and environment, and can in invention contemplated scope described herein, It is modified by above-mentioned teaching or the technology of association area or knowledge.And those skilled in the art are carried out changes Move and change is without departing from spirit and scope, the most all should be in the protection of the application claims In the range of.

Claims (10)

1. a message diversion method, it is characterised in that the method includes:
By the source IP address mask in the filter mask of network interface card stream controller, the address mask of purpose IP and Source port number mask is set to 0, and destination slogan mask is set to non-zero value;
Distribute different port numbers set for each processor core, and arrange associated by each processor core Network interface card message queue and the corresponding relation of described port numbers set;
Processor core uses and arranges its forward received for the port numbers in the port numbers set of its distribution The source port number of message, sends this forward message by network interface card;
Network interface card uses described filter mask to carry out stream controller filtration after receiving reverse message, this is anti- It is diverted to and the network interface card message queue corresponding to the port numbers set belonging to its destination slogan to message;
Reverse message in network interface card message queue associated with it is processed by processor core;
Wherein, the port numbers in different port number set carries out step-by-step and institute with described destination slogan mask The result obtained is different;Port numbers in same port number set carries out step-by-step with described destination slogan mask Identical with the result of gained.
Method the most according to claim 1, it is characterised in that
The value of described destination slogan mask is: 0xFFFF < < m;
Wherein, 0 < m < 16, < < represent binary shift left.
Method the most according to claim 1, it is characterised in that
Port numbers in described port numbers set is non-well-known port number.
Method the most according to claim 1, it is characterised in that
Network interface card message queue associated by processor core and described port numbers set are set in the following way Corresponding relation:
Port numbers in the port numbers set that will distribute for processor core is entered with described destination slogan mask Row step-by-step with end value depositing corresponding to the network interface card message queue associated with this processor core is set In device.
Method the most according to claim 2, it is characterised in that
Described port numbers set includes: P1, P2..., Pn
Port numbers set PiIn the port numbers that comprises be: 2m+i-1,…,2m+i-1;1≤i≤n;
Wherein, m >=10, n≤16-m.
6. a message part flow arrangement, it is characterised in that this device includes:
Mask arranges module, for being covered by the source IP address in the filter mask of network interface card stream controller Code, the address mask of purpose IP and source port number mask are set to 0, are set to non-by destination slogan mask 0 value;
Port number assignment module, for the port numbers set different for the distribution of each processor core, and is arranged Network interface card message queue associated by each processor core and the corresponding relation of described port numbers set;
Processor core, the port numbers in using as its port numbers set distributed arranges it and receives The source port number of forward message, send this forward message by network interface card;
Network interface card, for using described filter mask to carry out stream controller mistake after receiving reverse message Filter, is diverted to this reverse message and the network interface card report corresponding to the port numbers set belonging to its destination slogan Literary composition queue;
Described processor core, is additionally operable to carry out the reverse message in network interface card message queue associated with it Process;
Wherein, the port numbers in different port number set carries out step-by-step and institute with described destination slogan mask The result obtained is different;Port numbers in same port number set carries out step-by-step with described destination slogan mask Identical with the result of gained.
Device the most according to claim 6, it is characterised in that
Described mask arranges module and is set to by described destination slogan mask: 0xFFFF < < m;
Wherein, 0 < m < 16, < < represent binary shift left.
Device the most according to claim 6, it is characterised in that
Port numbers in the described port numbers set of described port number assignment module assignment is non-well-known port Number.
Device the most according to claim 6, it is characterised in that
Described port number assignment module arranges the network interface card message team associated by processor core in the following way Row and the corresponding relation of described port numbers set:
Port numbers in the port numbers set that will distribute for processor core is entered with described destination slogan mask Row step-by-step with end value depositing corresponding to the network interface card message queue associated with this processor core is set In device.
Device the most according to claim 7, it is characterised in that
The described port numbers set of described port number assignment module assignment includes: P1, P2..., Pn
Port numbers set PiIn the port numbers that comprises be: 2m+i-1,…,2m+i-1;1≤i≤n;
Wherein, m >=10, n≤16-m.
CN201510037385.3A 2015-01-23 2015-01-23 A kind of message diversion method and device Active CN105871741B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510037385.3A CN105871741B (en) 2015-01-23 2015-01-23 A kind of message diversion method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510037385.3A CN105871741B (en) 2015-01-23 2015-01-23 A kind of message diversion method and device

Publications (2)

Publication Number Publication Date
CN105871741A true CN105871741A (en) 2016-08-17
CN105871741B CN105871741B (en) 2018-12-25

Family

ID=56623653

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510037385.3A Active CN105871741B (en) 2015-01-23 2015-01-23 A kind of message diversion method and device

Country Status (1)

Country Link
CN (1) CN105871741B (en)

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109218229A (en) * 2017-06-30 2019-01-15 华为技术有限公司 A kind of message processing method, the network equipment and storage medium
CN111031065A (en) * 2019-12-25 2020-04-17 东软集团股份有限公司 File transmission method, system, client and firewall
CN111371694A (en) * 2018-12-26 2020-07-03 中兴通讯股份有限公司 Shunting method, device and system, processing equipment and storage medium
CN111865806A (en) * 2019-04-29 2020-10-30 瞻博网络公司 Prefix-based fat stream
CN113079077A (en) * 2021-03-30 2021-07-06 郑州信大捷安信息技术股份有限公司 Method and system for processing tunnel message symmetrical RSS under DPDk architecture based on queue
CN113098794A (en) * 2021-03-30 2021-07-09 郑州信大捷安信息技术股份有限公司 Method and system for realizing tunnel message symmetrical RSS processing by utilizing secondary distribution
CN114257545A (en) * 2021-12-09 2022-03-29 北京奇艺世纪科技有限公司 Message forwarding method and device
CN114826818A (en) * 2022-05-23 2022-07-29 北斗星通智联科技有限责任公司 CAN message data processing method and device
CN116248590A (en) * 2022-12-16 2023-06-09 中国联合网络通信集团有限公司 Data forwarding method, device, equipment and storage medium
CN116248590B (en) * 2022-12-16 2024-05-10 中国联合网络通信集团有限公司 Data forwarding method, device, equipment and storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101286936A (en) * 2008-05-16 2008-10-15 华为技术有限公司 Method and apparatus for data message processing
CN101656677A (en) * 2009-09-18 2010-02-24 杭州迪普科技有限公司 Message diversion processing method and device
US20100284404A1 (en) * 2009-05-05 2010-11-11 Sandhya Gopinath Systems and methods for packet steering in a multi-core architecture
CN102377640A (en) * 2010-08-11 2012-03-14 杭州华三通信技术有限公司 Message processing apparatus, message processing method and preprocessor
CN102594694A (en) * 2012-03-06 2012-07-18 北京中创信测科技股份有限公司 Data distribution method and equipment
CN103269317A (en) * 2013-04-22 2013-08-28 北京百度网讯科技有限公司 Lock-free communication method and system based on SMP system
CN103475586A (en) * 2013-08-22 2013-12-25 东软集团股份有限公司 Method, device and system for forwarding network data messages

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101286936A (en) * 2008-05-16 2008-10-15 华为技术有限公司 Method and apparatus for data message processing
US20100284404A1 (en) * 2009-05-05 2010-11-11 Sandhya Gopinath Systems and methods for packet steering in a multi-core architecture
CN101656677A (en) * 2009-09-18 2010-02-24 杭州迪普科技有限公司 Message diversion processing method and device
CN102377640A (en) * 2010-08-11 2012-03-14 杭州华三通信技术有限公司 Message processing apparatus, message processing method and preprocessor
CN102594694A (en) * 2012-03-06 2012-07-18 北京中创信测科技股份有限公司 Data distribution method and equipment
CN103269317A (en) * 2013-04-22 2013-08-28 北京百度网讯科技有限公司 Lock-free communication method and system based on SMP system
CN103475586A (en) * 2013-08-22 2013-12-25 东软集团股份有限公司 Method, device and system for forwarding network data messages

Cited By (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109218229A (en) * 2017-06-30 2019-01-15 华为技术有限公司 A kind of message processing method, the network equipment and storage medium
CN111371694B (en) * 2018-12-26 2022-10-04 中兴通讯股份有限公司 Shunting method, device and system, processing equipment and storage medium
CN111371694A (en) * 2018-12-26 2020-07-03 中兴通讯股份有限公司 Shunting method, device and system, processing equipment and storage medium
CN111865806A (en) * 2019-04-29 2020-10-30 瞻博网络公司 Prefix-based fat stream
CN111031065B (en) * 2019-12-25 2022-02-11 东软集团股份有限公司 File transmission method, system, client and firewall
CN111031065A (en) * 2019-12-25 2020-04-17 东软集团股份有限公司 File transmission method, system, client and firewall
CN113098794A (en) * 2021-03-30 2021-07-09 郑州信大捷安信息技术股份有限公司 Method and system for realizing tunnel message symmetrical RSS processing by utilizing secondary distribution
CN113079077A (en) * 2021-03-30 2021-07-06 郑州信大捷安信息技术股份有限公司 Method and system for processing tunnel message symmetrical RSS under DPDk architecture based on queue
CN113098794B (en) * 2021-03-30 2022-04-05 郑州信大捷安信息技术股份有限公司 Method and system for realizing tunnel message symmetrical RSS processing by utilizing secondary distribution
CN113079077B (en) * 2021-03-30 2022-04-08 郑州信大捷安信息技术股份有限公司 Method and system for processing tunnel message symmetrical RSS under DPDk architecture based on queue
CN114257545A (en) * 2021-12-09 2022-03-29 北京奇艺世纪科技有限公司 Message forwarding method and device
CN114257545B (en) * 2021-12-09 2023-09-05 北京奇艺世纪科技有限公司 Message forwarding method and device
CN114826818A (en) * 2022-05-23 2022-07-29 北斗星通智联科技有限责任公司 CAN message data processing method and device
CN116248590A (en) * 2022-12-16 2023-06-09 中国联合网络通信集团有限公司 Data forwarding method, device, equipment and storage medium
CN116248590B (en) * 2022-12-16 2024-05-10 中国联合网络通信集团有限公司 Data forwarding method, device, equipment and storage medium

Also Published As

Publication number Publication date
CN105871741B (en) 2018-12-25

Similar Documents

Publication Publication Date Title
CN105871741A (en) Packet dispersion method and device
CN103428094B (en) Message forwarding method in open flows OpenFlow system and device
US10728176B2 (en) Ruled-based network traffic interception and distribution scheme
US10078526B2 (en) Securing a managed forwarding element that operates within a data compute node
US8958418B2 (en) Frame handling within multi-stage switching fabrics
CN105637822B (en) For providing the system, apparatus and method of data service
US6717949B1 (en) System and method for IP network address translation using selective masquerade
CN103650436B (en) Service path distribution method, router and business perform entity
CN107995324A (en) A kind of cloud means of defence and device based on tunnel mode
EP3952240A1 (en) Blockchain-based network security system and processing method
CN103109516A (en) Multiple virtual machines sharing a single ip address
CN108632098A (en) Flow classifier, business route flip-flop, Message processing method and system
EP3192226B1 (en) Device and method for controlling a communication network
CN107046506A (en) A kind of message processing method, flow classifier and business function example
CN105556916A (en) Network flow information statistics method and apparatus
CN103986658A (en) Message output method and device
CN106534394A (en) NAT port manager used for realizing port mapping by using remainder
CN105871725A (en) Message shunt method and device
WO2009082683A1 (en) Multi-layered packet security
CN103179109B (en) Filter bypass devices and methods therefors based on two grades of session query functions
CN107483341A (en) A kind of across fire wall packet fast forwarding method and device
CN103795705B (en) For the network and node of the time lock of the data packet of exchanging safety
US10728171B2 (en) Governing bare metal guests
CN110602110A (en) Method, device, equipment and storage medium for isolating ports of whole network
CN103281205A (en) Method for configuring isolating information at ports, and network equipment

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant