CN107360268A - A kind of data package processing method, device and equipment - Google Patents

A kind of data package processing method, device and equipment Download PDF

Info

Publication number
CN107360268A
CN107360268A CN201710491127.1A CN201710491127A CN107360268A CN 107360268 A CN107360268 A CN 107360268A CN 201710491127 A CN201710491127 A CN 201710491127A CN 107360268 A CN107360268 A CN 107360268A
Authority
CN
China
Prior art keywords
target
data bag
cache table
equipment
arp cache
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
CN201710491127.1A
Other languages
Chinese (zh)
Other versions
CN107360268B (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.)
Beijing QIYI Century Science and Technology Co Ltd
Original Assignee
Beijing QIYI Century Science and Technology 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 Beijing QIYI Century Science and Technology Co Ltd filed Critical Beijing QIYI Century Science and Technology Co Ltd
Priority to CN201710491127.1A priority Critical patent/CN107360268B/en
Publication of CN107360268A publication Critical patent/CN107360268A/en
Application granted granted Critical
Publication of CN107360268B publication Critical patent/CN107360268B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/09Mapping addresses
    • H04L61/10Mapping addresses of different types
    • H04L61/103Mapping addresses of different types across network layers, e.g. resolution of network layer into physical layer addresses or address resolution protocol [ARP]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • G06F16/2308Concurrency control
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • G06F16/24552Database cache management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • G06F16/24568Data stream processing; Continuous queries
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/50Address allocation
    • H04L61/5007Internet protocol [IP] addresses
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/58Caching of addresses or names
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2101/00Indexing scheme associated with group H04L61/00
    • H04L2101/60Types of network addresses
    • H04L2101/618Details of network addresses
    • H04L2101/622Layer-2 addresses, e.g. medium access control [MAC] addresses

Abstract

The embodiments of the invention provide a kind of data package processing method, device and equipment, this method is applied to the equipment comprising polycaryon processor, and each core is run in a manner of single thread, arp cache table is stored with each core, this method includes:Scheduling core in the polycaryon processor obtains target data bag;It is determined that handle the target core of the target data bag;And call the target core;The target core is handled the target data bag according to target arp cache table, wherein, target arp cache table is:The arp cache table stored on target core.Processing data packets are carried out using scheme provided in an embodiment of the present invention, improve processing data packets efficiency.

Description

A kind of data package processing method, device and equipment
Technical field
The present invention relates to software technology field, more particularly to a kind of data package processing method, device and equipment.
Background technology
ARP (Address Resolution Protocol, address resolution protocol) is to obtain MAC Address according to IP address An ICP/IP protocol.
ARP workflow is:When this equipment for running ARP protocol needs to send packet to target device, first, According to the IP address of target device, local arp cache table is searched, determines whether to find the MAC Address of target device, if not Can, then all devices being sent to the ARP request comprising target device IP address with broadcast mode on network, and receive target The arp reply message (MAC Address that target device wherein, is included in arp reply message) that equipment returns, so that it is determined that target is set Standby MAC Address, and the IP address of target device and MAC Address are stored in local arp cache table in the lump, so that next time needs When obtaining the MAC Address of target device, directly it can be obtained by inquiring about arp cache table;When this equipment receives source device , it is necessary to which the IP address of this equipment and MAC Address are packaged into arp reply message during the ARP request of transmission, source device is sent to.
At present, the realization of ARP protocol is mainly based upon the ARP protocol stack of linux kernel, still, due to based in Linux In the ARP protocol stack of core, arp cache table is globally shared, and various lock mechanisms can be used between multithreading (for example, Read-Write Locks And spin lock), to ensure that each thread is correctly conducted interviews and operated to shared arp cache table, because lock mechanism can draw The obstruction of thread is played, thus causes the inefficient of its processing data bag, therefore, it is necessary to one kind can improve processing data packets effect The method of rate.
The content of the invention
The purpose of the embodiment of the present invention is to provide a kind of data package processing method, device and equipment, to realize raising number According to bag treatment effeciency.Concrete technical scheme is as follows:
In a first aspect, the embodiments of the invention provide a kind of data package processing method, applied to including polycaryon processor Equipment, each core are run in a manner of single thread, and arp cache table is stored with each core, and methods described includes:
Scheduling core in the polycaryon processor obtains target data bag;It is determined that handle the target of the target data bag Core;Call the target core;
The target core is handled the target data bag according to target arp cache table, wherein, the target ARP Cache table is:The arp cache table stored on the target core.
Optionally, arp cache table node corresponding to each equipment forms, and node corresponding to each equipment is used to deposit The facility information of the equipment is stored up, the facility information includes:The IP address and/or MAC Address of equipment, the scheduling core obtain mesh Packet is marked, including:
The scheduling core, which obtains this equipment, will be sent to the target data bag of target device, wherein, the target data bag The middle IP address for carrying the target device;
The target core is handled the target data bag according to target arp cache table, including:
Whether the target core is searched in the target arp cache table according to the IP address of the target device and is stored State the MAC Address of target device;
If it is, the MAC Address of the target device is filled into the target data bag;
The target data bag after MAC Address will be filled and be sent to the target device.
Optionally, if not storing the MAC Address of the target device in the target arp cache table, methods described is also wrapped Include:
The target core newly-built target section for being used to store the target device information in the target arp cache table Point, and the IP address of the target device is stored in the destination node;
Cache the target data bag.
Optionally, methods described also includes:
When the target core obtains the MAC Address of the target device, the target core is by the MAC of the target device Address is stored in the destination node;And fill the MAC Address of the target device into the target data bag of caching, will The target data bag after MAC Address is filled to send to the target device.
Optionally, the arp cache table is additionally operable to store the key assignments of equipment corresponding to each node, wherein, an equipment Key assignments be:Key assignments corresponding to the IP address for the equipment being calculated according to default hash algorithm;
Whether the target core is searched in the target arp cache table according to the IP address of the target device and is stored The MAC Address of target device is stated, including:
The target core calculates object key corresponding to the IP address of the target device according to the default hash algorithm Value;
According to the target key value, search whether be stored with the target arp cache table it is corresponding with the target key value Destination node;
If it is, judge the MAC Address of the target device whether is stored with the destination node, if being stored with, really The MAC Address of the target device is stored with the fixed target arp cache table.
Optionally, arp cache table node corresponding to each equipment forms, and node corresponding to each equipment is used to deposit The facility information of the equipment, and the removal state of the node are stored up, being initially set to for the removal mark of each node be not removable Except state;The target data bag is the packet that this equipment will be sent to target device, and institute is carried in the target data bag The target device information of target device is stated,
The target core is handled the target data bag according to target arp cache table, including:The target is verified Look in the target arp cache table and whether be stored with node corresponding with the target device information;
Methods described also includes:
The target, which is verified to find in the target arp cache table, is stored with node corresponding to the target device information When, the removal of node corresponding to the target device information is labeled as non-removable state;
Methods described also includes:
The target core is removed and mark is removed in the target arp cache table is marked as can be removed in preset time point The node of state;
The removal for the node that non-removable state is in the target arp cache table is labeled as removable shape State.
Optionally, arp cache table node corresponding to each equipment forms, and node corresponding to each equipment is used to deposit The facility information of the equipment is stored up, the facility information includes:The IP address and/or MAC Address of equipment, the scheduling core obtain mesh Packet is marked, including:
The scheduling core obtains the target data bag that source device is sent;
Whether the target core is searched in the target arp cache table according to the IP address of the target device and is stored The MAC Address of target device is stated, including:
The target core judges whether the target data bag is ARP packets;
If ARP packets, whether with the IP of this equipment the target ip address carried in the target data bag is judged Location is consistent;
If consistent, whether the type for judging the target data bag is request bag;
If request bag, then by the IP address of the source device carried in the target data bag and the source device MAC Address cache into the target arp cache table;And encapsulate the IP address of this equipment and MAC Address obtains target response Bag, the source device is sent to by the target response bag.
Optionally, if the type of the target data bag is not request bag, methods described also includes:
The target core judges whether the type of the target data bag is response bag;
If response bag, then the IP address of the source device carried in the target data bag and MAC Address are delayed Deposit into the target arp cache table.
Optionally, if the target ip address and the IP address of this equipment that are carried in the target data bag are inconsistent, or Person, if the type of the target data bag is not response bag, methods described also includes:
The target core abandons the target data bag;
Discharge target data bag internal memory shared on the target core.
Optionally, methods described also includes:
The target core detects whether the target arp cache table is updated;
If it is, the new information of the target arp cache table is sent to other cores, so that other cores are according to the renewal Information updating is stored in the arp cache table of itself.
Second aspect, the embodiments of the invention provide a kind of data packet processing, applied to including polycaryon processor Equipment, each core are run in a manner of single thread, and arp cache table is stored with each core, and described device includes:Transceiver module and place Manage module;
The transceiver module, target data bag is obtained for the scheduling core in the polycaryon processor;
The processing module, including:Applied to the first processing submodule in the scheduling core of the polycaryon processor and answer For the second processing submodule in the target core of the polycaryon processor;
The first processing submodule, for determining the target core of the processing target data bag;Call the target core;
The second processing submodule, for being handled according to target arp cache table the target data bag, its In, the target arp cache table is:The arp cache table stored on the target core.
Optionally, arp cache table node corresponding to each equipment forms, and node corresponding to each equipment is used to deposit The facility information of the equipment is stored up, the facility information includes:The IP address and/or MAC Address of equipment,
The transceiver module, is additionally operable to:
The target data bag of target device will be sent to by obtaining this equipment, wherein, in the target data bag described in carrying The IP address of target device;
The second processing submodule, is additionally operable to:
Search in the target arp cache table whether be stored with the target device according to the IP address of the target device MAC Address;
If it is, the MAC Address of the target device is filled into the target data bag;
The target data bag after MAC Address will be filled and be sent to the target device.
Optionally, the second processing submodule, is additionally operable to:
If not storing the MAC Address of the target device in the target arp cache table, in the target arp cache table In it is newly-built be used to store the destination node of the target device information, and the IP address of the target device is stored in the target Node;
Cache the target data bag.
Optionally, the second processing submodule, is additionally operable to:
When the target core obtains the MAC Address of the target device, the MAC Address of the target device is stored in institute State destination node;And fill the MAC Address of the target device into the target data bag of caching, MAC will be filled The target data bag behind address is sent to the target device.
Optionally, the arp cache table is additionally operable to store the key assignments of equipment corresponding to each node, wherein, an equipment Key assignments be:Key assignments corresponding to the IP address for the equipment being calculated according to default hash algorithm;
The second processing submodule, is additionally operable to:
According to the default hash algorithm, target key value corresponding to the IP address of the target device is calculated;
According to the target key value, search whether be stored with the target arp cache table it is corresponding with the target key value Destination node;
If it is, judge the MAC Address of the target device whether is stored with the destination node, if being stored with, really The MAC Address of the target device is stored with the fixed target arp cache table.
Optionally, arp cache table node corresponding to each equipment forms, and node corresponding to each equipment is used to deposit The facility information of the equipment, and the removal state of the node are stored up, being initially set to for the removal mark of each node be not removable Except state;The target data bag is the packet that this equipment will be sent to target device, and institute is carried in the target data bag The target device information of target device is stated,
The target core is handled the target data bag according to target arp cache table, including:The target is verified Look in the target arp cache table and whether be stored with node corresponding with the target device information;
The second processing submodule, is additionally operable to:
Find when being stored with node corresponding to the target device information in the target arp cache table, by the mesh The removal of node corresponding to marking device information is labeled as non-removable state;
In preset time point, remove and the node that mark is marked as removable state is removed in the target arp cache table;
The removal for the node that non-removable state is in the target arp cache table is labeled as removable shape State.
Optionally, arp cache table node corresponding to each equipment forms, and node corresponding to each equipment is used to deposit The facility information of the equipment is stored up, the facility information includes:The IP address and/or MAC Address of equipment, the transceiver module, also For:
Obtain the target data bag that source device is sent;
The second processing submodule, is additionally operable to:
Judge whether the target data bag is ARP packets;
If ARP packets, then judge the target ip address that is carried in the target data bag whether the IP with this equipment Address is consistent;
If consistent, whether the type for judging the target data bag is request bag;
If request bag, then by the IP address of the source device carried in the target data bag and the source device MAC Address cache into the target arp cache table;And encapsulate the IP address of this equipment and MAC Address obtains target response Bag, the source device is sent to by the target response bag.
Optionally, the second processing submodule, is additionally operable to:
If the type of the target data bag is not request bag, whether the type for judging the target data bag is response Bag;
If response bag, then the IP address of the source device carried in the target data bag and MAC Address are delayed Deposit into the target arp cache table.
Optionally, the second processing submodule, is additionally operable to:
If the target ip address and the IP address of this equipment that are carried in the target data bag are inconsistent, or, if The type of the target data bag is not response bag, then abandons the target data bag;The target data bag is discharged described Shared internal memory on target core.
Optionally, the second processing submodule, is additionally operable to:
Detect whether the target arp cache table is updated;
If it has, then send the new information of the target arp cache table to other cores so that other cores according to more New information renewal is stored in the arp cache table of itself.
At the another aspect that the present invention is implemented, a kind of computer-readable recording medium is additionally provided, it is described computer-readable Instruction is stored with storage medium, when run on a computer so that computer performs any of the above-described described packet Processing method.
At the another aspect that the present invention is implemented, the embodiment of the present invention additionally provides a kind of computer program production comprising instruction Product, when run on a computer so that computer performs any of the above-described described data package processing method.
It can be seen that using technical scheme provided in an embodiment of the present invention, using multinuclear processing mode, each core independent maintenance is certainly The arp cache table of body, and each core is run in a manner of single thread, thus so that each thread can be individually to arp cache table Conduct interviews and operate, without using lock mechanism to arp cache table, avoid the thread block because caused by using lock mechanism, So as to improve processing data packets efficiency.
Brief description of the drawings
In order to illustrate more clearly about the embodiment of the present invention or technical scheme of the prior art, below will be to embodiment or existing There is the required accompanying drawing used in technology description to be briefly described.
Fig. 1 is a kind of schematic flow sheet of data package processing method provided in an embodiment of the present invention;
Fig. 2 is the handling process schematic diagram that a kind of target provided in an embodiment of the present invention checks target data bag;
Fig. 3 is the handling process schematic diagram that another target provided in an embodiment of the present invention checks target data bag;
Fig. 4 is a kind of structural representation of arp cache table provided in an embodiment of the present invention;
Fig. 5 is a kind of structural representation of data packet processing provided in an embodiment of the present invention;
Fig. 6 is the structural representation of another data packet processing provided in an embodiment of the present invention;
Fig. 7 is a kind of structural representation of equipment provided in an embodiment of the present invention.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is described.
In order to solve the problems, such as that processing data bag is inefficient in the prior art, the embodiment of the invention discloses a kind of data Packet processing method, device and equipment.
Specifically, data package processing method application scenarios provided in an embodiment of the present invention can be:Include polycaryon processor Equipment as executive agent, each core in the equipment is run in a manner of single thread, and arp cache table is stored with each core, Scheduling core in polycaryon processor obtains target data bag, and then, it is determined that handling the target core of the target data bag, and call and be somebody's turn to do Target core;The target core is handled the target data bag according to target arp cache table, wherein, target arp cache table is: The arp cache table stored on the target core.
A kind of data package processing method provided below the embodiment of the present invention is introduced.
It should be noted that a kind of packet method that the embodiment of the present invention is provided is applied to comprising polycaryon processor Equipment, each core are run in a manner of single thread, and arp cache table is stored with each core, and in a particular application, the equipment can be Server, or, mobile phone, tablet personal computer, PC etc. can carry out packet and receive equipment with sending processing, this All it is rational.The embodiment of the present invention is not limited the concrete model of equipment.For example, can be comprising 16 core processors People's computer.
Above-mentioned polycaryon processor, which functionally divides, to be divided into:Dispatch core and non-scheduled core.Wherein, its function of scheduling core It can be understood as being scheduled each non-scheduled core in above-mentioned polycaryon processor.
Moreover, it is achieved that a kind of functional software for packet method that the embodiment of the present invention is provided can be special data Bag processing software, or available data bag, which handles software or other, has plug-in unit in the software of processing data packets function.
Fig. 1 is a kind of a kind of schematic flow sheet of data package processing method provided in an embodiment of the present invention.As shown in figure 1, A kind of data package processing method that the embodiment of the present invention is provided, may include steps of:
S101, the scheduling core in polycaryon processor obtain target data bag.
It should be noted that target data bag is to dispatch the arbitrary data bag that core obtains, specifically, target data bag can be with It is that this equipment will be sent to the packet that the packet of target device or source device are sent to this equipment, target device It is the equipment in addition to this equipment with source device, target device and source device can be same equipment, or difference is set It is standby.The embodiment of the present invention is not limited the particular type of target data bag.For example, target data bag can be ARP request bag, It can also be arp response bag.
S102, scheduling core determine to handle the target core of the target data bag.
Because the processor of this equipment includes multiple cores that can carry out data processing, therefore, scheduling core is needed from multiple A core is selected in core as target core to handle the target data bag, specifically, scheduling core can utilize multi-core dispatching algorithm, A core is selected from multiple cores, and as target core, the multi-core dispatching algorithm specifically used can be for:Global Queue's dispatching algorithm, Local queue dispatching algorithm etc., the embodiment of the present invention determine the side of the target core of processing target data bag to specific scheduling core Method does not limit.
In practical application, a physical core can be corresponded to by dispatching core and target core, can also correspond to different physical cores, this Inventive embodiments are not limited this.
S103, scheduling core call the target core.
It is understood that target data bag is passed to target core by scheduling core, target can be made to check target data bag Handled, complete the calling to target core.The method that target data bag is passed to target core by specific scheduling core is existing Technology, the embodiment of the present invention will not be repeated here.The embodiment of the present invention by target data bag to specifically passing to target core Method does not limit.For example, calling core can will store structure transmission in the form of Transfer Parameters of target data bag content The interface function provided to target core, so as to, target core can obtain the content of the target data bag, and then, target core can be with The target data bag is handled.
S104, target core are handled the target data bag according to target arp cache table.
Wherein, target arp cache table is:The arp cache table stored on target core.
In practical application, designer can be designed according to target arp cache table to target data bag according to self-demand The method handled, the embodiment of the present invention are not limited specific processing method.For example, if target data bag is originally to set The standby packet that be sent to target device, the processing method can be:Target core obtains the target carried in target data bag The IP address of equipment, the MAC Address that whether there is the target device in target arp cache table is searched, if it is present by target The MAC Address of equipment is filled into target data bag;The target data bag after MAC Address will be filled and be sent to target device.
It can be seen that using technical scheme provided in an embodiment of the present invention, using multinuclear processing mode, each core independent maintenance is certainly The arp cache table of body, and each core is run in a manner of single thread, thus so that each thread can be individually to arp cache table Conduct interviews and operate, without using lock mechanism to arp cache table, avoid the thread block because caused by using lock mechanism, So as to improve processing data packets efficiency.In order to simplify the processing procedure of target verification packet, in a kind of specific embodiment party In formula, arp cache table node corresponding to each equipment forms, and node corresponding to each equipment is used for the equipment for storing the equipment Information, facility information include:The IP address and/or MAC Address of equipment, the IP address of target device is carried in target data bag, Obtained in scheduling core after this equipment will be sent to the target data bag of target device, target core is according to target arp cache table to mesh Mark packet is handled, and may comprise steps of:
The first step, target core are searched in target arp cache table according to the IP address of target device and whether are stored with target and set Standby MAC Address;If it is, perform second step;
The MAC Address of target device is filled into target data bag by second step, target core;After MAC Address being filled Target data bag be sent to target device.
For prior art, this equipment is carried out after acquisition will be sent to the packet of target device to packet The step of processing, also includes:Packet state is inspected periodically, and the embodiment of the present invention eliminates and inspects periodically packet state Step, so as to simplify the processing procedure of target verification packet, improve the treatment effeciency to packet.
In practical application, when not storing the MAC Address of target device in target arp cache table, target data bag can not The MAC Address of target device is filled, and then target device can not be sent to, now, target data bag be able to can be dropped, In order to avoid the loss of target data bag, when not storing the MAC Address of target device in target arp cache table, this method is also It can include:Target core newly-built destination node for being used to store target device information in target arp cache table, and target is set Standby IP address is stored in the destination node;Caching of target packet.
Specifically, the content that node corresponding to each equipment stores also includes:Bag queue is cached, the caching bag queue is used for Storage does not find the target data bag of target device MAC Address temporarily.
As can be seen that the target data bag for not finding target device MAC Address temporarily is cached, so as to avoid The loss of target data bag.
In order to which the target data bag of caching is sent into target device, in a kind of specific embodiment, for Buffered target data bag, this method can also include:
When target core obtains the MAC Address of target device, the MAC Address of target device is stored in the target section by target core Point;And fill the MAC Address of target device into the target data bag of caching, the target data after MAC Address will be filled Bag is sent to target device.
Specifically, the method that target core obtains the MAC Address of target device can be:Target core is with broadcast mode to local exchange Other equipment in the net of domain sends ARP request bag, and then, target core can obtain the arp response bag of target device response, enter one Step, the MAC Address of the target device carried in the response bag can be obtained.
As can be seen that when target core obtains the MAC Address of target device, the MAC Address of target device can be filled Into the target data bag of caching, thus, it is possible to be sent the target data bag after MAC Address is filled to target device.
In order to improve the speed that target arp cache table is looked in target verification, in a kind of specific embodiment, arp cache Table is additionally operable to store the key assignments of equipment corresponding to each node, wherein, the key assignments of an equipment is:According to default hash algorithm meter Key assignments corresponding to the IP address of the obtained equipment;Target core searches target arp cache table according to the IP address of target device In whether be stored with the MAC Address of target device, Ke Yiwei:
Target core calculates target key value corresponding to the IP address of target device according to default hash algorithm;According to object key Value, search in target arp cache table whether be stored with destination node corresponding with the target key value;If it is, judge target The MAC Address of the target device whether is stored with node, if being stored with, determines to be stored with target in target arp cache table The MAC Address of equipment.
In order to avoid hash-collision and simplify algorithm, target core can use last eight values to IP address, calculate The formula of target key value can be corresponding to the IP address of target device:
(uint32)IP&(2^8-1)
In a kind of specific embodiment, IP address can be:Based on the IP address of IPV4 agreements, based on IPV4 agreements IP address length be 32, it is however generally that, the equipment in LAN is the IP address based on the division of 24 bit subnet masks, IP Last eight most equipments covered in LAN of location, hash algorithm, can using last eight values are taken to IP address To cause the distribution of the ARP nodes corresponding to each equipment in the same network segment to try one's best discretization, and due to only using IP address Latter eight, reduce computation complexity so that target core searches time of node close to O (1) every time, shortens lookup section The time of point.
It should be noted that the embodiment of the present invention illustrates by taking the IP address based on IPV4 agreements as an example, it is only this hair A bright instantiation, does not form limitation of the invention.In actual applications, IP address can also be to be assisted based on IPV6 The IP address of view.
In actual applications, in arp cache table the key assignments of equipment corresponding to each node can be based on storage of linked list, When hash-collision occurs, can select to extend chained list length successively, to solve hash-collision.The specific method for extending chained list Belong to prior art, the embodiment of the present invention will not be repeated here.
Because hash algorithm is using last eight values are taken to IP address, reduce computation complexity so that target core is every The secondary time for searching node close to O (1), shortens the time for searching node, target arp cache table is searched so as to improve Speed.
Prior art can reset timer corresponding to the node when finding node every time so that timer can be with Restart timing, and after the timing more than timer, the content stored in the node can be discharged, it can be understood as The node is removed, can be had an impact due to frequently resetting timer to the performance of equipment.
Therefore, in order to improve systematic function, in a kind of specific embodiment, arp cache table is corresponding by each equipment Node composition, node corresponding to each equipment is used to store the facility information of the equipment, and the removal state of the node, respectively The removal mark of individual node is initially set to non-removable state;Target data bag is that this equipment will be sent to target device Packet, the target device information of the target device is carried in target data bag, target core is according to target arp cache table to target Packet is handled, and can be included:Whether target is verified to look in the target arp cache table and is stored with and the target device information Corresponding node;
This method can also include:
Target, which is verified, to be found when being stored with destination node in target arp cache table, by node corresponding to target device information Removal be labeled as non-removable state;
This method can also include:
Target core removes the section that mark is marked as removable state in preset time point, removal target arp cache table Point;The removal for the node that non-removable state is in target arp cache table is labeled as removable state.
The embodiment of the present invention is not limited the title of flag bit.For example, flag bit is introduced in node:Used, should Used flag bits can be bool (boolean) type variable, when used values are 1, show that the node is in non-removable shape State;When used values are 0, show that the node is in removable state, preset time point can be the timing length by timer At the time point of formation, for example, the timing length of timer is two hours, timer starts timing as 9:00, then when presetting Between point be:11:00、13:00、15:00、17:00 equi-time point.
As can be seen that in each query node, timer is not reset, but uses the method that flag bit is set, is passed through The concrete numerical value of flag bit represents the removal state residing for the node, in preset time point, removes and is moved in target arp cache table Except mark is marked as the node of removable state;The removal of the node of non-removable state will be in target arp cache table Removable state is labeled as, so as to realize the timeout treatment to node, avoids and frequently resets timer to equipment Performance impact, therefore improve systematic function.
In order to simplify target verification packet processing procedure, in another specific embodiment, arp cache table by Node corresponding to each equipment forms, and node corresponding to each equipment is used for the facility information for storing the equipment, facility information bag Include:The IP address and/or MAC Address of equipment, after scheduling core acquisition source device is sent to the target data bag of this equipment, target Core is handled target data bag according to target arp cache table, can include following steps:
Step A, target core judge whether target data bag is ARP packets;If ARP packets, then step B is performed.
Step B, judge whether the target ip address that is carried in target data bag is consistent with the IP address of this equipment;If one Cause, then perform step C.
Step C, whether the type for judging target data bag is request bag;If request bag, then step D is performed.
It is understood that request bag represents that the target data bag is:The IP for being used to ask this equipment that source device is sent Address and the packet of MAC Address.
Step D, the MAC Address of the IP address of the source device carried in target data bag and source device is cached to target In arp cache table;And encapsulate the IP address of this equipment and MAC Address obtains target response bag, target response bag is sent to source Equipment.
For prior art, this equipment is handled packet after the packet that source device is sent is obtained Step also includes:Build packet state table, and the embodiment of the present invention eliminate structure packet state table the step of, from And the processing procedure of target verification packet is simplified, improve the treatment effeciency to packet.
In order to tackle the situation that the type of packet is not request bag, the disposal ability to packet is improved, is had in one kind In the embodiment of body, if the type of target data bag is not request bag, this method can also increase step E:Target core is sentenced Whether the type of disconnected target data bag is response bag;If response bag, then step F is performed.
It is understood that response bag represents that the target data bag is:Source device is sent to the packet of this equipment, and should Packet is used for the IP address and MAC Address for informing this equipment source device.
Step F, target core cache the IP address of the source device carried in target data bag and MAC Address to target ARP In cache table.
As can be seen that for target data bag type be response bag situation, will can carry in target data bag The IP address and MAC Address of source device are cached into target arp cache table, so as to provide a kind of type for tackling packet not For the method for request bag, the disposal ability to packet is improved.
In order to avoid unnecessary EMS memory occupation, memory usage is improved, in another specific embodiment, if The target ip address carried in target data bag and the IP address of this equipment are inconsistent, or, if the type of target data bag It is not response bag, methods described can also increase step G:Target core abandons target data bag;Target data bag is discharged in target Shared internal memory on core.
As can be seen that situation about can not be handled for target core target data bag, that is, occur in target data bag The target ip address of carrying and the IP address of this equipment are inconsistent, or, the type of target data bag is not the situation of response bag, Target core can abandon target data bag, and discharge target data bag internal memory shared on target core, so as to avoid not Necessary EMS memory occupation, improves memory usage.
In order to improve the reliability of arp cache table, in actual applications, this method can also include:
Whether target core detection target arp cache table is updated;If it has, then send target arp cache table to other cores New information so that other cores according to the new information renewal be stored in the arp cache table of itself.
It should be noted that when target core detects that the feelings of removed, the newly-built node of node occurs in target arp cache table Condition, it is believed that detect that target arp cache table is updated, in addition, when target core detects one in target arp cache table Or the information of multiple nodes storage is when changing, it is also contemplated that detecting that target arp cache table is updated, for example, target ARP The equipment a of storage IP address is H before in cache table interior joint A, when target core detects the IP for needing will to be stored in node A When address is changed to M, you can think to detect that target arp cache table is updated, then need to delay to other cores transmission target ARP The new information of table is deposited, so as to which other cores can update according to the new information is stored in the arp cache table of itself.
As can be seen that after target core detects that target arp cache table is updated, target ARP can be sent to other cores and delayed The new information of table is deposited, so as to which other cores can update according to the new information is stored in the arp cache table of itself, therefore realizes The synchronized update of arp cache table on each core, improve the reliability of arp cache table.
The embodiment of the present invention is simply introduced below by an instantiation.
Data package processing method provided in an embodiment of the present invention is applied to some equipment, the equipment includes multinuclear processing Device, and the equipment is to realize data package processing method provided in an embodiment of the present invention based on DPDK frameworks.DPDK full name Data Plane Development Kit, DPDK are a kind of efficient development storehouses for the quick processing bag for operating in User space, For the high-performance treatments to packet.DPDK is operated on User space, can be received using the datum plane storehouse that itself is provided Send out packet, for example, handled using multi-core parallel concurrent, the technology such as UIO (Userspace I/O), big page internal memory come transceiving data bag, Linux kernel protocol stack is bypassed to packet processing procedure, therefore, the data package processing method based on DPDK exploitations is being handled There is very big advantage in efficiency relative to the data package processing method of the protocol stack development based on linux kernel, can substantially carry The high processing speed to packet, and because DPDK is to operate in User space, for kernel state is operated in, have more Good portability and alterability, thus, data package processing method provided in an embodiment of the present invention is realized based on DPDK frameworks With more preferable flexibility.
Scheduling core in the equipment can use complete after obtaining this equipment and to be sent to the target data bag of target device Office's queue scheduling algorithm, determines the target core of processing target data bag, and calls the target core, allows the target core according to such as Processing data packets flow shown in Fig. 2 is handled the target data bag.
Referring to Fig. 2, it is corresponding to calculate the IP address according to the IP address of the target device carried in target data bag for target core Cryptographic Hash, using cryptographic Hash, determine whether to find target section corresponding with the target device in target arp cache table Point, if can find, judge the MAC Address of target device whether is stored with destination node, if being stored with, determine target ARP The MAC Address of target device is stored with cache table, and the MAC Address of target device is filled into target data bag;Will be by Target data bag after filling MAC Address is sent to target device, newly-built in target arp cache table if can not find Destination node, and caching of target number are stored in for storing the destination node of target device information, and by the IP address of target device According to bag.
It can be seen that using technical scheme provided in an embodiment of the present invention, using multinuclear processing mode, each core independent maintenance is certainly The arp cache table of body, and each core is run in a manner of single thread, thus so that each thread can be individually to arp cache table Conduct interviews and operate, without using lock mechanism to arp cache table, avoid the thread block because caused by using lock mechanism, So as to improve processing data packets efficiency, and eliminate the step of inspecting periodically packet state, so as to simplify target core To the processing procedure of packet, further, the target data bag for not finding target device MAC Address temporarily is cached Come, so as to avoid the loss of target data bag, node is searched using hash algorithm, shortens the time for searching node, so as to Improve the speed for searching target arp cache table.
Similar, the scheduling core in the equipment can use global team after the target data bag that source device is sent is obtained Row dispatching algorithm, it is determined that handling the target core of the target data bag, and the target core is called, allow the target core according to such as Processing data packets flow shown in Fig. 3 is handled the target data bag.
Referring to Fig. 3, target core initialization timer and target arp cache table, wherein, target arp cache table is for depositing The Hash table of nodal information is stored up, the structure chart of specific target arp cache table is respectively referring to Fig. 4, digital 1-5:Utilize Hash Algorithm, the cryptographic Hash for each equipment that the IP address based on each equipment is calculated, the main data content in ARP nodes Including:MAC Address, IP address, corresponding network interface card port, overtime timer, cache bag queue.
After initialization timer and target arp cache table, whether the target data bag that target core judges to receive is ARP numbers According to bag;If ARP packets, then judge the target ip address that is carried in target data bag whether the IP address one with this equipment Cause;If consistent, whether the type for judging target data bag is request bag;If request bag, then will be taken in target data bag The IP address of the source device of band and the MAC Address of source device are cached into target arp cache table;And encapsulate the IP address of this equipment Target response bag is obtained with MAC Address, target response bag is sent to the source device;If the type of target data bag is not Request bag, whether the type for judging target data bag is response bag;If response bag, the source carried in target data bag is set Standby IP address and MAC Address is cached into target arp cache table.If the target ip address carried in target data bag and sheet The IP address of machine is inconsistent, or, if the type of the target data bag is not response bag, abandon target data bag;Release Put target data bag internal memory shared on target core.
It can be seen that using technical scheme provided in an embodiment of the present invention, using multinuclear processing mode, each core independent maintenance is certainly The arp cache table of body, and each core is run in a manner of single thread, thus so that each thread can be individually to arp cache table Conduct interviews and operate, without using lock mechanism to arp cache table, avoid the thread block because caused by using lock mechanism, So as to improve processing data packets efficiency, and eliminate structure packet state table the step of, so as to simplify target core To the processing procedure of packet, further, the type for target data bag is the situation of response bag, can be by target data The IP address and MAC Address of the source device carried in bag are cached into target arp cache table, so as to provide a kind of reply data The type of bag is not the method for request bag, improves the disposal ability to packet, target data bag can not be entered for target core The situation of row processing, that is, it is inconsistent the IP address of target ip address and this equipment carried in target data bag occur, or, mesh The type for marking packet is not the situation of response bag, and target core can abandon target data bag, and discharge target data bag in mesh Internal memory shared on core is marked, so as to avoid unnecessary EMS memory occupation, improves memory usage.
Corresponding with above-mentioned embodiment of the method, the embodiment of the present invention also provides a kind of data packet processing, is applied to Equipment comprising polycaryon processor, each core are run in a manner of single thread, and arp cache table is stored with each core.
Referring to Fig. 5, a kind of structural representation for data packet processing that Fig. 5 is provided by the embodiment of the present invention, the dress Put including:Transceiver module 501 and processing module 502;
Transceiver module 501, target data bag is obtained for the scheduling core in polycaryon processor;
Processing module 502, including:Applied to the first processing submodule in the scheduling core of polycaryon processor and applied to more Second processing submodule in the target core of core processor;
First processing submodule, for obtaining target data bag;It is determined that handle the target core of the target data bag;Calling should Target core;
Second processing submodule, for being handled according to target arp cache table the target data bag, wherein, target Arp cache table is:The arp cache table stored on the target core.
It can be seen that using technical scheme provided in an embodiment of the present invention, using multinuclear processing mode, each core independent maintenance is certainly The arp cache table of body, and each core is run in a manner of single thread, thus so that each thread can be individually to arp cache table Conduct interviews and operate, without using lock mechanism to arp cache table, avoid the thread block because caused by using lock mechanism, So as to improve processing data packets efficiency.
Wherein, arp cache table node corresponding to each equipment is formed, and node corresponding to each equipment is set for storing this Standby facility information, facility information include:The IP address and/or MAC Address of equipment, the transceiver module 501, are additionally operable to:
The target data bag of target device will be sent to by obtaining this equipment, wherein, carry the target in the target data bag The IP address of equipment;
The second processing submodule, is additionally operable to:
The MAC that the target device whether is stored with the target arp cache table is searched according to the IP address of the target device Address;
If it is, the MAC Address of the target device is filled into the target data bag;
The target data bag after MAC Address will be filled and be sent to the target device.
Wherein, the second processing submodule, is additionally operable to:
It is newly-built in the target arp cache table if not storing the MAC Address of the target device in the target arp cache table The destination node is stored in for storing the destination node of the target device information, and by the IP address of the target device;Caching should Target data bag.
Wherein, the second processing submodule, is additionally operable to:
When target core obtains the MAC Address of the target device, the MAC Address of the target device is stored in the target section Point;And fill the MAC Address of the target device into the target data bag of caching, the number of targets after MAC Address will be filled Sent according to bag to the target device.
Wherein, arp cache table is additionally operable to store the key assignments of equipment corresponding to each node, wherein, the key assignments of an equipment For:Key assignments corresponding to the IP address for the equipment being calculated according to default hash algorithm;
The second processing submodule, is additionally operable to:
Hash algorithm is preset according to this, calculates target key value corresponding to the IP address of the target device;
According to the target key value, search in the target arp cache table whether be stored with target corresponding with the target key value Node;
If it is, judge the MAC Address of the target device whether is stored with the destination node, if being stored with, it is determined that should The MAC Address of the target device is stored with target arp cache table.
Wherein, arp cache table node corresponding to each equipment is formed, and node corresponding to each equipment is set for storing this Standby facility information, and the removal state of the node, the removal mark of each node are initially set to non-removable state; Target data bag is the packet that this equipment will be sent to target device, and the target of the target device is carried in the target data bag Facility information,
Target core is handled the target data bag according to target arp cache table, including:Target is verified and looks for the target Whether with the target device information corresponding node is stored with arp cache table;
The second processing submodule, is additionally operable to:
Find when being stored with node corresponding to the target device information in the target arp cache table, by the target device The removal of node corresponding to information is labeled as non-removable state;
In preset time point, remove and the node that mark is marked as removable state is removed in the target arp cache table;
The removal for the node that non-removable state is in the target arp cache table is labeled as removable state.
Wherein, arp cache table node corresponding to each equipment is formed, and node corresponding to each equipment is set for storing this Standby facility information, facility information include:The IP address and/or MAC Address of equipment, the module of transmitting-receiving 501, are additionally operable to:
Obtain the target data bag that source device is sent;
The second processing submodule, is additionally operable to:
Judge whether the target data bag is ARP packets;
If ARP packets, then whether with the IP of this equipment the target ip address carried in the target data bag is judged Location is consistent;
If consistent, whether the type for judging the target data bag is request bag;
If request bag, then the IP address of source device and the MAC Address of source device that will be carried in the target data bag Caching is into the target arp cache table;And encapsulate the IP address of this equipment and MAC Address obtains target response bag, by the target Response bag is sent to source device.
Wherein, the second processing submodule, is additionally operable to:
If the type of the target data bag is not request bag, whether the type for judging the target data bag is response bag;
If response bag, then the IP address of the source device carried in the target data bag and MAC Address are cached to this In target arp cache table.
Wherein, the second processing submodule, is additionally operable to:
If the target ip address and the IP address of this equipment that are carried in the target data bag are inconsistent, or, if should The type of target data bag is not response bag, then abandons the target data bag;Discharge target data bag institute on the target core The internal memory of occupancy.
Wherein, the second processing submodule is additionally operable to:
Detect whether the target arp cache table is updated;
If it has, then the new information of the target arp cache table is sent to other cores, so that other cores disappear according to the renewal Breath renewal is stored in the arp cache table of itself.
In an alternate embodiment of the invention, as shown in fig. 6, the processing module 502 in the embodiment of the present invention can be processor 610, transceiver module 501 can be transceiver 620, meanwhile, the embodiment of the present invention provides data packet processing, can also include Memory 630, memory 630 are used for store program codes and data.
The embodiment of the present invention additionally provides a kind of equipment, as shown in fig. 7, comprises polycaryon processor 701, communication interface 702, Memory 703 and communication bus 704, wherein, polycaryon processor 701, communication interface 702, memory 703 passes through communication bus 704 complete mutual communication,
Memory 703, for depositing computer program;
Polycaryon processor 701, during for performing the program deposited on memory 703, realize that the embodiment of the present invention is carried The data package processing method of confession, specifically, the data package processing method following steps:
Scheduling core in polycaryon processor obtains target data bag;It is determined that handle the target core of the target data bag;Call The target core;
Target core is handled the target data bag according to target arp cache table, wherein, target arp cache table is:Should The arp cache table stored on target core.
Optionally, arp cache table node corresponding to each equipment forms, and node corresponding to each equipment is used to store this The facility information of equipment, facility information include:The IP address and/or MAC Address of equipment, scheduling core obtain target data bag, bag Include:
Scheduling core, which obtains this equipment, will be sent to the target data bag of target device, wherein, carried in the target data bag The IP address of the target device;
Target core is handled the target data bag according to target arp cache table, including:
Target core searches in the target arp cache table whether be stored with the target device according to the IP address of the target device MAC Address;
If it is, the MAC Address of the target device is filled into the target data bag;
The target data bag after MAC Address will be filled and be sent to the target device.
Optionally, if not storing the MAC Address of the target device in the target arp cache table, this method also includes:
Target core newly-built destination node for being used to store the target device information in the target arp cache table, and should The IP address of target device is stored in the destination node;
Cache the target data bag.
Optionally, this method also includes:
When target core obtains the MAC Address of the target device, the target core should by the MAC Address deposit of the target device Destination node;And fill the MAC Address of the target device into the target data bag of caching, after MAC Address is filled Target data bag is sent to the target device.
Optionally, arp cache table is additionally operable to store the key assignments of equipment corresponding to each node, wherein, the key of an equipment It is worth and is:Key assignments corresponding to the IP address for the equipment being calculated according to default hash algorithm;
Target core searches in the target arp cache table whether be stored with the target device according to the IP address of the target device MAC Address, including:
Target core presets hash algorithm according to this, calculates target key value corresponding to the IP address of the target device;
According to the target key value, search in the target arp cache table whether be stored with target corresponding with the target key value Node;
If it is, judge the MAC Address of the target device whether is stored with the destination node, if being stored with, it is determined that should The MAC Address of the target device is stored with target arp cache table.
Optionally, arp cache table node corresponding to each equipment forms, and node corresponding to each equipment is used to store this The facility information of equipment, and the removal state of the node, the removal mark of each node are initially set to non-removable shape State;Target data bag is the packet that this equipment will be sent to target device, and the target device is carried in the target data bag Target device information,
Target core is handled the target data bag according to target arp cache table, including:The target is verified and looks for the target Whether with the target device information corresponding node is stored with arp cache table;
This method also includes:
Target, which is verified, to be found when being stored with node corresponding to the target device information in the target arp cache table, by the mesh The removal of node corresponding to marking device information is labeled as non-removable state;
This method also includes:
Target core is removed and mark is removed in the target arp cache table is marked as removable state in preset time point Node;
The removal for the node that non-removable state is in the target arp cache table is labeled as removable state.
Optionally, arp cache table node corresponding to each equipment forms, and node corresponding to each equipment is used to store this The facility information of equipment, facility information include:The IP address and/or MAC Address of equipment, scheduling core obtain target data bag, bag Include:
Dispatch core and obtain the target data bag that source device is sent;
Target core searches in the target arp cache table whether be stored with the target device according to the IP address of the target device MAC Address, including:
Target core judges whether the target data bag is ARP packets;
If ARP packets, judge the target ip address that is carried in the target data bag whether the IP address with this equipment Unanimously;
If consistent, whether the type for judging the target data bag is request bag;
If request bag, then the IP address of source device and the MAC Address of source device that will be carried in the target data bag Caching is into the target arp cache table;And encapsulate the IP address of this equipment and MAC Address obtains target response bag, by the target Response bag is sent to source device.
Optionally, if the type of the target data bag is not request bag, this method also includes:
Target core judges whether the type of the target data bag is response bag;
If response bag, then the IP address of the source device carried in the target data bag and MAC Address are cached to this In target arp cache table.
Optionally, if the target ip address and the IP address of this equipment that are carried in the target data bag are inconsistent, or, If the type of the target data bag is not response bag, this method also includes:
Target core abandons the target data bag;
Discharge target data bag internal memory shared on the target core.
Optionally, this method also includes:
Target core detects whether the target arp cache table is updated;
If it is, the new information of the target arp cache table is sent to other cores, so that other cores are according to the new information Renewal is stored in the arp cache table of itself.
The communication bus that above-mentioned electronic equipment is mentioned can be Peripheral Component Interconnect standard (Peripheral Component Interconnect, abbreviation PCI) bus or EISA (Extended Industry Standard Architecture, abbreviation EISA) bus etc..The communication bus can be divided into address bus, data/address bus, controlling bus etc.. For ease of representing, only represented in figure with a thick line, it is not intended that an only bus or a type of bus.
The communication that communication interface is used between above-mentioned electronic equipment and other equipment.
Memory can include random access memory (Random Access Memory, abbreviation RAM), can also include Nonvolatile memory (non-volatile memory), for example, at least a magnetic disk storage.Optionally, memory may be used also To be at least one storage device for being located remotely from aforementioned processor.
Above-mentioned processor can be general processor, including central processing unit (Central Processing Unit, Abbreviation CPU), network processing unit (Ne twork Processor, abbreviation NP) etc.;It can also be digital signal processor (Digital Signal Processing, abbreviation DSP), application specific integrated circuit (Applica tion Specific Integrated Circuit, abbreviation ASIC), field programmable gate array (Field-Programmable Gate Array, Abbreviation FPGA) either other PLDs, discrete gate or transistor logic, discrete hardware components.
In another embodiment provided by the invention, a kind of computer-readable recording medium is additionally provided, the computer can Read to be stored with instruction in storage medium, when run on a computer so that computer performs any institute in above-described embodiment The data package processing method stated.
In another embodiment provided by the invention, a kind of computer program product for including instruction is additionally provided, when it When running on computers so that computer performs any described data package processing method in above-described embodiment.
In the above-described embodiments, can come wholly or partly by software, hardware, firmware or its any combination real It is existing.When implemented in software, can realize in the form of a computer program product whole or in part.The computer program Product includes one or more computer instructions.When loading on computers and performing the computer program instructions, all or Partly produce according to the flow or function described in the embodiment of the present invention.The computer can be all-purpose computer, special meter Calculation machine, computer network or other programmable devices.The computer instruction can be stored in computer-readable recording medium In, or the transmission from a computer-readable recording medium to another computer-readable recording medium, for example, the computer Instruction can pass through wired (such as coaxial cable, optical fiber, numeral from a web-site, computer, server or data center User's line (DSL)) or wireless (such as infrared, wireless, microwave etc.) mode to another web-site, computer, server or Data center is transmitted.The computer-readable recording medium can be any usable medium that computer can access or It is the data storage devices such as server, the data center integrated comprising one or more usable mediums.The usable medium can be with It is magnetic medium, (for example, floppy disk, hard disk, tape), optical medium (for example, DVD) or semiconductor medium (such as solid state hard disc Solid State Disk (SSD)) etc..
It should be noted that herein, such as first and second or the like relational terms are used merely to a reality Body or operation make a distinction with another entity or operation, and not necessarily require or imply and deposited between these entities or operation In any this actual relation or order.Moreover, term " comprising ", "comprising" or its any other variant are intended to Nonexcludability includes, so that process, method, article or equipment including a series of elements not only will including those Element, but also the other element including being not expressly set out, or it is this process, method, article or equipment also to include Intrinsic key element.In the absence of more restrictions, the key element limited by sentence "including a ...", it is not excluded that Other identical element also be present in process, method, article or equipment including the key element.
Each embodiment in this specification is described by the way of related, identical similar portion between each embodiment Divide mutually referring to what each embodiment stressed is the difference with other embodiment.It is real especially for device For applying example, because it is substantially similar to embodiment of the method, so description is fairly simple, related part is referring to embodiment of the method Part explanation.
The foregoing is merely illustrative of the preferred embodiments of the present invention, is not intended to limit the scope of the present invention.It is all Any modification, equivalent substitution and improvements made within the spirit and principles in the present invention etc., are all contained in protection scope of the present invention It is interior.

Claims (21)

1. a kind of data package processing method, it is characterised in that applied to the equipment comprising polycaryon processor, each core is with single thread Mode is run, and arp cache table is stored with each core, and methods described includes:
Scheduling core in the polycaryon processor obtains target data bag;It is determined that handle the target core of the target data bag;And Call the target core;
The target core is handled the target data bag according to target arp cache table, wherein, the target arp cache Table is:The arp cache table stored on the target core.
2. according to the method for claim 1, it is characterised in that arp cache table node group as corresponding to each equipment Into node corresponding to each equipment is used for the facility information for storing the equipment, and the facility information includes:The IP address of equipment And/or MAC Address,
The scheduling core obtains target data bag, including:
The scheduling core, which obtains this equipment, will be sent to the target data bag of target device, wherein, taken in the target data bag IP address with the target device;
The target core is handled the target data bag according to target arp cache table, including:
The target core searches in the target arp cache table whether be stored with the mesh according to the IP address of the target device The MAC Address of marking device;
If it is, the MAC Address of the target device is filled into the target data bag;
The target data bag after MAC Address will be filled and be sent to the target device.
3. according to the method for claim 2, it is characterised in that if not storing the target in the target arp cache table The MAC Address of equipment, methods described also include:
The target core newly-built destination node for being used to store the target device information in the target arp cache table, and The IP address of the target device is stored in the destination node;
Cache the target data bag.
4. according to the method for claim 3, it is characterised in that methods described also includes:
When the target core obtains the MAC Address of the target device, the target core is by the MAC Address of the target device It is stored in the destination node;And fill the MAC Address of the target device into the target data bag of caching, it will be filled out The target data bag filled after MAC Address is sent to the target device.
5. according to the method for claim 2, it is characterised in that
The arp cache table is additionally operable to store the key assignments of equipment corresponding to each node, wherein, the key assignments of an equipment is:Press Key assignments corresponding to the IP address for the equipment being calculated according to default hash algorithm;
The target core searches in the target arp cache table whether be stored with the mesh according to the IP address of the target device The MAC Address of marking device, including:
The target core calculates target key value corresponding to the IP address of the target device according to the default hash algorithm;
According to the target key value, search and mesh corresponding with the target key value whether is stored with the target arp cache table Mark node;
If it is, judging the MAC Address of the target device whether is stored with the destination node, if being stored with, institute is determined State the MAC Address that the target device is stored with target arp cache table.
6. according to the method for claim 1, it is characterised in that arp cache table node group as corresponding to each equipment Into node corresponding to each equipment is used for the facility information for storing the equipment, and the removal state of the node, each node Remove mark is initially set to non-removable state;The target data bag is the data that this equipment will be sent to target device Wrap, the target device information of the target device carried in the target data bag,
The target core is handled the target data bag according to target arp cache table, including:The target is verified and looks for institute State and node corresponding with the target device information whether is stored with target arp cache table;
Methods described also includes:
The target, which is verified, to be found when being stored with node corresponding to the target device information in the target arp cache table, will The removal of node corresponding to the target device information is labeled as non-removable state;
Methods described also includes:
The target core is removed and mark is removed in the target arp cache table is marked as removable state in preset time point Node;
The removal for the node that non-removable state is in the target arp cache table is labeled as removable state.
7. according to the method for claim 1, it is characterised in that arp cache table node group as corresponding to each equipment Into node corresponding to each equipment is used for the facility information for storing the equipment, and the facility information includes:The IP address of equipment And/or MAC Address,
The scheduling core obtains target data bag, including:
The scheduling core obtains the target data bag that source device is sent;
The target core is handled target data bag according to target arp cache table, including:
The target core judges whether the target data bag is ARP packets;
If ARP packets, judge the target ip address that is carried in the target data bag whether the IP address one with this equipment Cause;
If consistent, whether the type for judging the target data bag is request bag;
If request bag, then by the IP address of the source device carried in the target data bag and the source device MAC Address is cached into the target arp cache table;And encapsulate the IP address of this equipment and MAC Address obtains target response bag, The target response bag is sent to the source device.
8. according to the method for claim 7, it is characterised in that if the type of the target data bag is not request bag, Methods described also includes:
The target core judges whether the type of the target data bag is response bag;
If response bag, then by the IP address of the source device carried in the target data bag and MAC Address cache to In the target arp cache table.
9. according to the method for claim 8, it is characterised in that if the target ip address carried in the target data bag It is inconsistent with the IP address of this equipment, or, if the type of the target data bag is not response bag, methods described is also wrapped Include:
The target core abandons the target data bag;
Discharge target data bag internal memory shared on the target core.
10. according to the method any one of claim 4,6,7-9, it is characterised in that methods described also includes:
The target core detects whether the target arp cache table is updated;
If it is, the new information of the target arp cache table is sent to other cores, so that other cores are according to the new information Renewal is stored in the arp cache table of itself.
11. a kind of data packet processing, it is characterised in that applied to the equipment comprising polycaryon processor, each core is with single line Journey mode is run, and arp cache table described device is stored with each core to be included:Transceiver module and processing module;
The transceiver module, target data bag is obtained for the scheduling core in the polycaryon processor;
The processing module, including:Applied to the first processing submodule in the scheduling core of the polycaryon processor and it is applied to Second processing submodule in the target core of the polycaryon processor;
The first processing submodule, for determining the target core of the processing target data bag;Call the target core;
The second processing submodule, for being handled according to target arp cache table the target data bag, wherein, institute Stating target arp cache table is:The arp cache table stored on the target core.
12. device according to claim 11, it is characterised in that arp cache table node as corresponding to each equipment Composition, node corresponding to each equipment are used for the facility information for storing the equipment, and the facility information includes:The IP address of equipment And/or MAC Address,
The transceiver module, is additionally operable to:
The target data bag of target device will be sent to by obtaining this equipment, wherein, carry the target in the target data bag The IP address of equipment;
The second processing submodule, is additionally operable to:
Search in the target arp cache table whether be stored with the target device according to the IP address of the target device MAC Address;
If it is, the MAC Address of the target device is filled into the target data bag;
The target data bag after MAC Address will be filled and be sent to the target device.
13. device according to claim 12, it is characterised in that the second processing submodule, be additionally operable to:
It is new in the target arp cache table if not storing the MAC Address of the target device in the target arp cache table The destination node for storing the target device information is built, and the IP address of the target device is stored in the target section Point;
Cache the target data bag.
14. device according to claim 13, it is characterised in that the second processing submodule, be additionally operable to:
When the target core obtains the MAC Address of the target device, the MAC Address of the target device is stored in the mesh Mark node;And fill the MAC Address of the target device into the target data bag of caching, MAC Address will be filled The target data bag afterwards is sent to the target device.
15. device according to claim 12, it is characterised in that
The arp cache table is additionally operable to store the key assignments of equipment corresponding to each node, wherein, the key assignments of an equipment is:Press Key assignments corresponding to the IP address for the equipment being calculated according to default hash algorithm;
The second processing submodule, is additionally operable to:
According to the default hash algorithm, target key value corresponding to the IP address of the target device is calculated;
According to the target key value, search and mesh corresponding with the target key value whether is stored with the target arp cache table Mark node;
If it is, judging the MAC Address of the target device whether is stored with the destination node, if being stored with, institute is determined State the MAC Address that the target device is stored with target arp cache table.
16. device according to claim 11, it is characterised in that arp cache table node as corresponding to each equipment Composition, node corresponding to each equipment are used for the facility information for storing the equipment, and the removal state of the node, each node Removal mark be initially set to non-removable state;The target data bag is the number that this equipment will be sent to target device According to bag, the target device information of the target device is carried in the target data bag,
The target core is handled the target data bag according to target arp cache table, including:The target is verified and looks for institute State and node corresponding with the target device information whether is stored with target arp cache table;
The second processing submodule, is additionally operable to:
Find when being stored with node corresponding to the target device information in the target arp cache table, the target is set The removal of node is labeled as non-removable state corresponding to standby information;
In preset time point, remove and the node that mark is marked as removable state is removed in the target arp cache table;
The removal for the node that non-removable state is in the target arp cache table is labeled as removable state.
17. device according to claim 11, it is characterised in that arp cache table node as corresponding to each equipment Composition, node corresponding to each equipment are used for the facility information for storing the equipment, and the facility information includes:The IP address of equipment And/or MAC Address,
The transceiver module, is additionally operable to:
Obtain the target data bag that source device is sent;
The second processing submodule, is additionally operable to:
Judge whether the target data bag is ARP packets;
If ARP packets, then judge the target ip address that is carried in the target data bag whether the IP address with this equipment Unanimously;
If consistent, whether the type for judging the target data bag is request bag;
If request bag, then by the IP address of the source device carried in the target data bag and the source device MAC Address is cached into the target arp cache table;And encapsulate the IP address of this equipment and MAC Address obtains target response bag, The target response bag is sent to the source device.
18. device according to claim 17, it is characterised in that the second processing submodule is additionally operable to:
If the type of the target data bag is not request bag, whether the type for judging the target data bag is response bag;
If response bag, then by the IP address of the source device carried in the target data bag and MAC Address cache to In the target arp cache table.
19. device according to claim 18, it is characterised in that the second processing submodule, be additionally operable to:
If the target ip address and the IP address of this equipment that are carried in the target data bag are inconsistent, or, if described The type of target data bag is not response bag, then abandons the target data bag;The target data bag is discharged in the target Shared internal memory on core.
20. according to the device any one of claim 14,16,17-19, it is characterised in that the second processing submodule Block, it is additionally operable to:
Detect whether the target arp cache table is updated;
If it has, then the new information of the target arp cache table is sent to other cores, so that other cores disappear according to the renewal Breath renewal is stored in the arp cache table of itself.
A kind of 21. equipment, it is characterised in that including polycaryon processor, communication interface, memory and communication bus, wherein, multinuclear Processor, communication interface, memory complete mutual communication by communication bus;
Memory, for depositing computer program;
Polycaryon processor, during for performing the program deposited on memory, realize any described methods of claim 1-10 Step.
CN201710491127.1A 2017-06-23 2017-06-23 Data packet processing method, device and equipment Active CN107360268B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710491127.1A CN107360268B (en) 2017-06-23 2017-06-23 Data packet processing method, device and equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710491127.1A CN107360268B (en) 2017-06-23 2017-06-23 Data packet processing method, device and equipment

Publications (2)

Publication Number Publication Date
CN107360268A true CN107360268A (en) 2017-11-17
CN107360268B CN107360268B (en) 2020-11-06

Family

ID=60273733

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710491127.1A Active CN107360268B (en) 2017-06-23 2017-06-23 Data packet processing method, device and equipment

Country Status (1)

Country Link
CN (1) CN107360268B (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108134855A (en) * 2017-12-18 2018-06-08 东软集团股份有限公司 ARP table management method, processor core, storage medium, electronic equipment
CN108345502A (en) * 2018-01-15 2018-07-31 中兴飞流信息科技有限公司 Resource regulating method, device, terminal device based on DPDK and readable storage medium storing program for executing
CN108366024A (en) * 2018-02-07 2018-08-03 迈普通信技术股份有限公司 Message forwarding method and device
CN108900327A (en) * 2018-06-20 2018-11-27 昆明理工大学 A kind of chronometer data acquisition and real-time processing method based on DPDK
WO2020151449A1 (en) * 2019-01-25 2020-07-30 上海哔哩哔哩科技有限公司 Data processing method and system based on quic protocol stack, device and storage medium
CN113835902A (en) * 2021-09-22 2021-12-24 北京字节跳动网络技术有限公司 Data processing method and device, computer equipment and storage medium
CN115567590A (en) * 2022-11-17 2023-01-03 鹏城实验室 Data packet scheduling method, device, equipment and readable storage medium

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1829190A (en) * 2005-03-01 2006-09-06 杭州华为三康技术有限公司 Distributed ARP realizing method
CN101128827A (en) * 2005-02-24 2008-02-20 塞朗德系统有限公司 Method and apparatus for distributed data management in a switching network
CN101267435A (en) * 2008-04-17 2008-09-17 中兴通讯股份有限公司 An implementation method for address parsing protocol
CN101699821A (en) * 2009-11-02 2010-04-28 清华大学 Method for realizing address resolution protocol in distribution type multi-kernel network system
US20100329258A1 (en) * 2009-06-30 2010-12-30 Alcatel-Lucent Usa Inc. Dynamically enabling mpls stations and ports using an arp database
CN102081603A (en) * 2009-11-27 2011-06-01 上海博达数据通信有限公司 Method for address resolution protocol (ARP) query optimization under multinuclear environment
CN103078814A (en) * 2013-02-06 2013-05-01 杭州华三通信技术有限公司 Address resolution protocol (ARP) table entry synchronization method and business processing method and equipment
CN103188155A (en) * 2011-12-27 2013-07-03 上海博达数据通信有限公司 ARP realization method based on distributed system
US20140310417A1 (en) * 2013-04-16 2014-10-16 Amazon Technologies, Inc. Connection publishing in a distributed load balancer

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101128827A (en) * 2005-02-24 2008-02-20 塞朗德系统有限公司 Method and apparatus for distributed data management in a switching network
CN1829190A (en) * 2005-03-01 2006-09-06 杭州华为三康技术有限公司 Distributed ARP realizing method
CN101267435A (en) * 2008-04-17 2008-09-17 中兴通讯股份有限公司 An implementation method for address parsing protocol
US20100329258A1 (en) * 2009-06-30 2010-12-30 Alcatel-Lucent Usa Inc. Dynamically enabling mpls stations and ports using an arp database
CN101699821A (en) * 2009-11-02 2010-04-28 清华大学 Method for realizing address resolution protocol in distribution type multi-kernel network system
CN102081603A (en) * 2009-11-27 2011-06-01 上海博达数据通信有限公司 Method for address resolution protocol (ARP) query optimization under multinuclear environment
CN103188155A (en) * 2011-12-27 2013-07-03 上海博达数据通信有限公司 ARP realization method based on distributed system
CN103078814A (en) * 2013-02-06 2013-05-01 杭州华三通信技术有限公司 Address resolution protocol (ARP) table entry synchronization method and business processing method and equipment
US20140310417A1 (en) * 2013-04-16 2014-10-16 Amazon Technologies, Inc. Connection publishing in a distributed load balancer

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108134855A (en) * 2017-12-18 2018-06-08 东软集团股份有限公司 ARP table management method, processor core, storage medium, electronic equipment
CN108134855B (en) * 2017-12-18 2021-03-09 东软集团股份有限公司 ARP table management method, processor core, storage medium and electronic device
CN108345502A (en) * 2018-01-15 2018-07-31 中兴飞流信息科技有限公司 Resource regulating method, device, terminal device based on DPDK and readable storage medium storing program for executing
CN108366024A (en) * 2018-02-07 2018-08-03 迈普通信技术股份有限公司 Message forwarding method and device
CN108900327A (en) * 2018-06-20 2018-11-27 昆明理工大学 A kind of chronometer data acquisition and real-time processing method based on DPDK
CN108900327B (en) * 2018-06-20 2021-06-18 昆明理工大学 DPDK-based astronomical data acquisition and real-time processing method
WO2020151449A1 (en) * 2019-01-25 2020-07-30 上海哔哩哔哩科技有限公司 Data processing method and system based on quic protocol stack, device and storage medium
US11954530B2 (en) 2019-01-25 2024-04-09 Shanghai Bilibili Technology Co., Ltd. Method and system of processing data based on QUIC protocol stack, device and storage medium
CN113835902A (en) * 2021-09-22 2021-12-24 北京字节跳动网络技术有限公司 Data processing method and device, computer equipment and storage medium
CN113835902B (en) * 2021-09-22 2023-12-05 抖音视界有限公司 Data processing method, device, computer equipment and storage medium
CN115567590A (en) * 2022-11-17 2023-01-03 鹏城实验室 Data packet scheduling method, device, equipment and readable storage medium

Also Published As

Publication number Publication date
CN107360268B (en) 2020-11-06

Similar Documents

Publication Publication Date Title
CN107360268A (en) A kind of data package processing method, device and equipment
US7644188B2 (en) Distributing tasks in data communications
US11489773B2 (en) Network system including match processing unit for table-based actions
CN103825976B (en) NAT (network address translation) processing method and device in distributed system architecture
CN110301120A (en) Flow point class device, method and system
CN107613529A (en) Message treatment method and base station
US11588734B2 (en) Systems for providing an LPM implementation for a programmable data plane through a distributed algorithm
CN101426010A (en) Information processing apparatus and information processing system
JP2004172917A (en) Packet retrieving device, packet process retrieving method, and program
CN106161110A (en) Data processing method in a kind of network equipment and system
US20230042747A1 (en) Message Processing Method and Device, Storage Medium, and Electronic Device
JP2005117206A5 (en)
CN107430628A (en) Acceleration framework with immediate data transmission mechanism
CN107301215A (en) A kind of search result caching method and device, searching method and device
US8365045B2 (en) Flow based data packet processing
US8619790B2 (en) Adaptive cache for caching context and for adapting to collisions in a session lookup table
WO2022040570A1 (en) Systems for building data structures with highly scalable algorithms for a distributed lpm implementation
CN107682446A (en) A kind of message mirror-image method, device and electronic equipment
US20060029088A1 (en) Reducing latency in a channel adapter by accelerated I/O control block processing
CN107453948A (en) The storage method and system of a kind of network measurement data
CN110351208A (en) A kind of message forwarding method, device, equipment and computer readable storage medium
CN107249038A (en) Business datum retransmission method and system
CN108011801A (en) Method, unit and the system of data transfer
US7657654B2 (en) Hashing assist for network processors
CN116599892A (en) Server system, routing method, routing device, electronic equipment and storage medium

Legal Events

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