CN104601645A - Data packet processing method and device - Google Patents

Data packet processing method and device Download PDF

Info

Publication number
CN104601645A
CN104601645A CN201410555669.7A CN201410555669A CN104601645A CN 104601645 A CN104601645 A CN 104601645A CN 201410555669 A CN201410555669 A CN 201410555669A CN 104601645 A CN104601645 A CN 104601645A
Authority
CN
China
Prior art keywords
packet
routing iinformation
state information
connection state
assignment
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
CN201410555669.7A
Other languages
Chinese (zh)
Other versions
CN104601645B (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.)
Tsinghua University
Sina Technology China Co Ltd
Original Assignee
Tsinghua University
Sina Technology China 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 Tsinghua University, Sina Technology China Co Ltd filed Critical Tsinghua University
Priority to CN201410555669.7A priority Critical patent/CN104601645B/en
Publication of CN104601645A publication Critical patent/CN104601645A/en
Application granted granted Critical
Publication of CN104601645B publication Critical patent/CN104601645B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention discloses a data packet processing method and device. According to the method, network equipment receives a data packet, searches link state information corresponding to the data packet and judges whether routing information is stored in the searched link state information or not, the stored routing information is written into the data packet if the routing information is stored in the searched link state information, the routing information of the data packet is searched in a route cache if not, and the searched routing information is written into the data packet and stored in the link state information corresponding to the data packet. By the mode, the network equipment stores other data packets received by a link besides a first data packet received by each link before submitting the data packets to a network layer, the routing information stored in the link state information of the link is determined as routing information of the other data packets, so that the routing information of the other data packets does not need to be searched from the route cache in the network layer, and data packet processing efficiency of the network equipment is improved.

Description

A kind of data package processing method and device
Technical field
The present invention relates to field of computer technology, particularly relate to a kind of data package processing method and device.
Background technology
Along with the development of computer technology, central processing unit (Central Processing Unit, CPU) development enters the multinuclear epoch, server also uses multi-core CPU to process more and more and connects from a large amount of transmission control protocols (Transmission Control Protocol, TCP) packet sent.
In the prior art, the network equipment can be set up TCP length with miscellaneous equipment and be connected, when this network equipment from TCP long receive packet after, the routing iinformation of this packet can be searched in the route-caching of network layer, if this network equipment is the destination of this packet, then this packet is removed Internet protocol (Internet Protocol, IP) transport layer is submitted to after head, the long connection state information connected of TCP corresponding to this packet is searched in transport layer, if find the long connection state information connected of this TCP, then according to the connection state information found, by the long Socket connected of this TCP comprised in this connection state information, the application layer data carried in this packet is submitted to corresponding process process in application layer.
But, because CPU compares expend time in searching routing iinformation from route-caching, and use general foundation on the network equipment of multi-core CPU to have the long connection of a large amount of TCP, each TCP long connection may continue to receive multiple packet, therefore, the processing mode of searching routing iinformation for each packet from route-caching respectively reduces the efficiency of network device processing packet.
Summary of the invention
The embodiment of the present invention provides a kind of data package processing method and device, reduces the efficiency of network device processing packet in order to solve in prior art the processing mode of searching routing iinformation for each packet from route-caching respectively.
A kind of data package processing method that the embodiment of the present invention provides, comprising:
Receive packet;
Search the connection state information corresponding with described packet;
Judge whether preserve routing iinformation in the described connection state information found;
If so, then the routing iinformation in described connection state information is write described packet, and subsequent treatment is carried out to the packet of the described routing iinformation of write;
Otherwise, the routing iinformation of described packet is searched in route-caching, the routing iinformation found is write described packet, subsequent treatment is carried out to the packet of the described routing iinformation of write, and the routing iinformation found is kept in connection state information corresponding to described packet.
A kind of data packet processing that the embodiment of the present invention provides, comprising:
Receiver module, for receiving packet;
First searches module, for searching the connection state information corresponding with described packet;
Judge module, for judge described first search module searches to described connection state information in whether preserve routing iinformation; If so, then the routing iinformation in described connection state information is write described packet, and subsequent treatment is carried out to the packet of the described routing iinformation of write; Otherwise, the routing iinformation of described packet is searched in route-caching, the routing iinformation found is write described packet, subsequent treatment is carried out to the packet of the described routing iinformation of write, and the routing iinformation found is kept in connection state information corresponding to described packet.
The embodiment of the present invention provides a kind of data package processing method and device, and the method treatment facility receives packet, searches the connection state information corresponding with described packet, judges whether preserve routing iinformation in the described connection state information found; If so, then the routing iinformation in described connection state information is write described packet, and subsequent treatment is carried out to the packet of the described routing iinformation of write; Otherwise, the routing iinformation of described packet is searched in route-caching, the routing iinformation found is write described packet, subsequent treatment is carried out to the packet of the described routing iinformation of write, and the routing iinformation found is kept in connection state information corresponding to described packet.Pass through said method, due to for each connection on the network equipment, except first packet received by this connection, for other packet received by this connection, the network equipment is before giving network layer by this other packet data delivery, all the routing iinformation of this first packet be kept in the connection state information of this connection is defined as the routing iinformation of this other packet, thus, in network layer, the network equipment need not search the routing iinformation of this other packet from route-caching, therefore, improve the efficiency of network device processing packet.
Accompanying drawing explanation
Accompanying drawing described herein is used to provide a further understanding of the present invention, forms a part of the present invention, and schematic description and description of the present invention, for explaining the present invention, does not form inappropriate limitation of the present invention.In the accompanying drawings:
The processing data packets process that Fig. 1 provides for the embodiment of the present invention;
The processing data packets main flow schematic diagram corresponding to tcp protocol stack that Fig. 2 A provides for the embodiment of the present invention;
Fig. 2 B is the processing data packets main flow schematic diagram corresponding to tcp protocol stack in prior art;
The detailed process of the processing data packets that Fig. 3 provides for the embodiment of the present invention;
The data packet processing structural representation that Fig. 4 provides for the embodiment of the present invention.
Embodiment
For making the object, technical solutions and advantages of the present invention clearly, below in conjunction with the specific embodiment of the invention and corresponding accompanying drawing, technical solution of the present invention is clearly and completely described.Obviously, described embodiment is only the present invention's part embodiment, instead of whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art, not making other embodiments all obtained under creative work prerequisite, belong to the scope of protection of the invention.
The processing data packets process that Fig. 1 provides for the embodiment of the present invention, specifically comprises the following steps:
S101: the network equipment receives packet.
In embodiments of the present invention, the described network equipment can be server or client.Wherein, described server includes but not limited to: employ the server of multi-core CPU, employ the server etc. of multiple CPU.Described client includes but not limited to: personal computer (Personal Computer, PC), mobile phone, panel computer etc.Can connect between the network equipment, after connection establishment, the network equipment then can to transmit and receive data bag based on the connection of setting up.Concrete, the packet that the network equipment receives can be the packet carrying IP head, then subsequent network device can in its network layer based on this packet of IP protocol processes.
In step S101, the network equipment receives packet by its network interface card from the connection of having set up, then in data link layer, network interface card is for each packet received, verify cyclic redundancy check (CRC) code (the Cyclic Redundancy Check carried in the frame head of this packet, CRC), and verify the object physical address carried in frame head, if pass through the CRC check of carrying in frame head, and the physical address of the object physical address carried in frame head and the network equipment (is also, the physical address of the network interface card of the network equipment) identical, then determine that this packet is legal, subsequent treatment can be carried out to it, otherwise, determine that this packet is illegal, can directly be abandoned.
S102: the network equipment searches the connection state information corresponding with this packet.
In data link layer, the network equipment, for above-mentioned each legal packet, can be that this packet builds a corresponding socket buffer (sk_buff, SKB) in operating system nucleus, and is contained in this SKB by this data envelope.Because the packet that will process and submit in subsequent protocol stack has been encapsulated in SKB all, therefore, each layer protocol in subsequent protocol stack processes accordingly packet and submits and also can be considered that the SKB to being packaged with this packet processes accordingly and submits.The present invention's packet described below all refers to the packet be encapsulated in SKB.
In embodiments of the present invention, the network equipment is before being forwarded to network layer by packet from data link layer, can search the connection state information corresponding with this packet (is also, receive this packet based on the connection state information of connection), and then, attempt the routing iinformation determining this packet.Wherein, described connection state information is kept at transport layer, and connection state information can comprise socket (sock) information etc.Wherein, the routing iinformation of packet can characterize this packet by processing locality, or this packet need be transmitted to miscellaneous equipment.
S103: the network equipment judges whether preserve routing iinformation in this connection state information found, if so, then performs step S104, otherwise, perform step S105.
S104: the routing iinformation in this connection state information is write this packet by the network equipment, and subsequent treatment is carried out to the packet of this routing iinformation of write.
In embodiments of the present invention, if the network equipment is determined to preserve routing iinformation in this connection state information found, then the routing iinformation in this connection state information writes in this packet by the network equipment, now, the routing iinformation of this packet is the routing iinformation of this packet of write, thus the network equipment according to the routing iinformation of write, can carry out subsequent treatment to the packet of this routing iinformation of write.
Concrete, the packet of this routing iinformation of write is submitted to network layer from data link layer by the network equipment, network layer can be judged to write routing iinformation in this packet by the route object variable of the packet reading this routing iinformation of write, therefore, the routing iinformation searching this packet need not be removed in route-caching, but can determine according to the routing iinformation write in this packet that this packet is by processing locality, still need be transmitted to miscellaneous equipment.
S105: the network equipment searches the routing iinformation of this packet in route-caching, the routing iinformation found is write this packet, subsequent treatment is carried out to the packet of this routing iinformation of write, and the routing iinformation found is kept in connection state information corresponding to described packet.
In embodiments of the present invention, if the network equipment is determined not preserve routing iinformation in this connection state information found, then this packet is submitted to network layer from data link layer by the network equipment, in the route-caching of network layer, remove the routing iinformation searching this packet.
Concrete, network layer can according to the source IP address carried in this packet, object IP addresses etc. calculate hash value, the one group list item identical with this hash value is found again in route-caching hash shows, then the chained list that this group list item is corresponding is traveled through, find out and the source IP address that carries in this packet, object IP address, the identical list item such as subnet mask, now, the network equipment has found the routing iinformation of this packet in the route-caching of network layer, be and the source IP address that carries in this packet, object IP address, the identical list item such as subnet mask.Then, this routing iinformation is write this packet by the network equipment on the one hand, on the other hand, the network equipment also will search connection state information corresponding to this packet that transport layer is preserved, and is also kept at by this routing iinformation in connection state information corresponding to this packet of finding.
Because the network equipment is by this routing iinformation write packet, therefore, can judge to write routing iinformation in this packet in network layer, and then can determine according to the routing iinformation write in this packet that this packet is by processing locality, or need miscellaneous equipment be transmitted to, thus subsequent treatment can be carried out according to this routing iinformation to this packet.
Pass through said method, due to for each connection on the network equipment, except first packet received by this connection, for other packet received by this connection, the network equipment is before giving network layer by this other packet data delivery, all the routing iinformation be kept in the connection state information of this connection (this routing iinformation is exactly the routing iinformation of first packet) is defined as the routing iinformation of this other packet, thus, in network layer, the network equipment without the need to searching the routing iinformation of this other packet from route-caching, directly be submitted to transport layer process, improve the efficiency of network device processing packet.
Fig. 2 A shows the processing data packets main flow corresponding to tcp protocol stack that the embodiment of the present invention provides, Fig. 2 B shows the processing data packets main flow corresponding to tcp protocol stack in prior art, can find out, in the flow process (as Fig. 2 A) that the embodiment of the present invention provides, if be not first packet received from this connection from a packet received, then the network equipment just can be in data link layer the routing iinformation that this packet determines this packet, therefore, in network layer, can skip the step of searching routing iinformation in route-caching, thus improve the efficiency of network device processing packet.
In embodiments of the present invention, when needing the connection by setting up send continuously and receive multiple packet between the network devices, the connection of setting up between the network equipment can be the long connection of TCP, accordingly, above-mentioned connection state information comprises the long connection state information connected of TCP, in above-mentioned steps S102, searches the connection state information corresponding with packet, specifically comprise: according to the TCP head in packet, search the connection state information corresponding with this TCP head.Wherein a kind of feasible method is: obtained customizing messages (as upper-layer protocol, frame type etc.) in the frame head in this packet by tcp protocol stack to locate IP head, and then the customizing messages (as upper-layer protocol, IP head length etc.) obtained in IP head, to locate TCP head.Certainly, due to when searching the connection state information corresponding with this TCP head, packet is still positioned at data link layer, therefore, except the process operation (these process operations are only to find the connection state information corresponding with this packet being kept at transport layer) related in above-mentioned feasible method, other other process operation that should perform in network layer or transport layer can not be performed to this packet.
In this case, the network equipment often sets up the long connection of a TCP, capital preserves the long connection state information connected of this TCP in transport layer for this TCP long connection, wherein, the long connection state information connected of TCP can comprise sock information etc., and this sock packets of information contains the long source IP address, object IP address, source port number, destination slogan (can be collectively referred to as four-tuple) etc. connecting correspondence of this TCP.And in the TCP head of packet, carry the source IP address, object IP address, source port number, destination slogan etc. of this packet.Then under TCP length connects the prerequisite set up, the network equipment by the four-tuple of carrying in the TCP head of packet being mated with the four-tuple in each connection state information, and then finds out unique connection state information corresponding with this packet.
Further, during due to routing iinformation is kept in connection state information, specifically can be kept in the sock information that connection state information comprises, therefore, after the network equipment finds the connection state information corresponding with packet, in above-mentioned steps S103, the network equipment judges whether preserve routing iinformation in the connection state information found, specifically comprise: the network equipment extracts the sock information comprised in the connection state information found, judge whether preserve routing iinformation in the described sock information extracted.
Further, in actual applications, in network layer, the network equipment be according to the route object variable in packet whether assignment judge whether to have write in this packet corresponding routing iinformation, if this route object variable assignment, then the network equipment is determined to be written with corresponding routing iinformation in this packet, if the non-assignment of this route object variable, then the network equipment is determined not yet to write corresponding routing iinformation in this packet.
Further, the sign implication that the value of described route object variable is corresponding can be pre-defined by the protocol stack on the network equipment, in embodiments of the present invention, when the value of the route object variable of packet is the first numerical value, characterize this packet by processing locality, when the value of the route object variable of packet is second value, characterizes this packets need and be transmitted to miscellaneous equipment.
Therefore, in above-mentioned steps S104, if the network equipment is determined in the connection state information found preserve routing iinformation, the first numerical value then can be adopted to carry out assignment to the route object variable in this packet, using the packet of the packet after assignment as write routing iinformation, and the application layer data carried in the packet of write routing iinformation is submitted to corresponding process process.Concrete, after the network equipment adopts the first numerical value to carry out assignment to the route object variable in this packet, this packet can be submitted to network layer from data link layer, determine that this packet is by processing locality in network layer according to the value (being the first numerical value) of the route object variable in this packet, and then, give transport layer by this packet data delivery, and by the socket (Socket) that this packet is corresponding, the application layer data carried in this packet is submitted to corresponding process process in transport layer.
In addition, in some scenarios, in above-mentioned steps S102, the connection state information corresponding with described packet may do not found.Such as, for setting up the handshake data bag used when TCP connects, due to the network equipment receive handshake data bag time, this TCP connection not yet completes foundation, therefore, the connection state information of also not this TCP connection in each connection state information that transport layer is preserved, thus the network equipment also cannot find the connection state information corresponding with this packet; Similar also has for the packet that need be transmitted to miscellaneous equipment, the TCP connection corresponding due to this packet is not based upon on this network equipment, therefore, the connection state information of also not this TCP connection in each connection state information that transport layer is preserved, thus the network equipment also cannot find the connection state information corresponding with this packet.
For above-mentioned scene, in embodiments of the present invention, when the network equipment does not find the connection state information corresponding with this packet, then this packet is submitted to network layer from data link layer, owing to can judge in network layer not yet to write routing iinformation in this packet, therefore, in route-caching, still search the routing iinformation of this packet.
When the routing iinformation that basis finds, when the object IP address determining to comprise in this routing iinformation is local ip address, then this packet may be set up TCP connect process in use handshake data bag (due to now transport layer not yet preserve this TCP connect connection state information, therefore search less than this connection state information), the first numerical value is then adopted to carry out assignment to the route object variable in this packet, the application layer data carried in packet after assignment is submitted to corresponding process process, and when establishing connection according to this application layer data, the routing iinformation found in route-caching is kept in the connection state information of this connection correspondence of foundation, wherein, assignment is that the route object variable of the first numerical value characterizes this packet by processing locality.
When the routing iinformation that basis finds, when the destination address determining to comprise in this routing iinformation is not local address, this packet known may be the packet that need be transmitted to miscellaneous equipment, second value is then adopted to carry out assignment to the route object variable in described packet, according to described routing iinformation, packet after assignment is transmitted to miscellaneous equipment, and wherein, assignment is that the route object variable of second value characterizes described packet and need be transmitted to miscellaneous equipment.
It should be noted that, due to for needing the packet being transmitted to miscellaneous equipment, the connection of its correspondence is not based upon on this network equipment (for this packet, this network equipment is only a forwarding unit), therefore, the network equipment cannot find the connection state information corresponding with this packet in transport layer.That is, if the packet that the network equipment receives is the packet needing to be transmitted to miscellaneous equipment, so the network equipment is in transport layer, impossible find connection state information corresponding to this packet, if and for the packet received, the network equipment can find connection state information corresponding to this packet in transport layer, and so this packet must be processed by this network equipment this locality.Therefore, the routing iinformation preserved in the connection state information of transport layer can only characterization data bag by processing locality.
According to the above description, in the step S102 shown in Fig. 1, if the network equipment has found connection state information corresponding to this packet, then can determine that this packet must be processed by this network equipment this locality, if do not find the connection state information that this packet is corresponding, then still can not determine whether (this packet both may be set up the long handshake data bag connected of TCP to this packet by processing locality, also may be the packet needing to be transmitted to miscellaneous equipment), therefore could can only determine by searching routing iinformation corresponding to this packet in the route-caching of network layer.
In addition, when the network equipment does not have forwarding capability (also namely, the network equipment cannot be set to a router), if this network equipment receives packet, and when network layer determines that this packet is the packet that need be transmitted to miscellaneous equipment, then this packet directly can be abandoned.
The detailed process of the processing data packets that Fig. 3 provides for the embodiment of the present invention, specifically comprises the following steps:
S301: receive packet.
S302: according to the TCP head of this packet, search the connection state information corresponding with this TCP head.
S303: judge whether to have found the connection state information corresponding with this TCP head, if so, then performs step S304, otherwise, perform step S308.
S304: extract the sock information comprised in the connection state information found.
S305: judge whether preserve routing iinformation in the sock information extracted, if so, then perform step S306, otherwise, perform step S307.
S306: adopt the first numerical value to carry out assignment to the route object variable in this packet, the application layer data carried in the packet after assignment is submitted to corresponding process process.
Wherein, assignment is that the route object variable of the first numerical value characterizes this packet by processing locality.
S307: the routing iinformation searching this packet in route-caching, carries out subsequent treatment according to the routing iinformation found to this packet, and is kept at by the routing iinformation found in sock information corresponding to this packet.
S308: the routing iinformation searching this packet in route-caching.
S309: according to the routing iinformation found, judges whether the destination address comprised in this routing iinformation is local address, if so, then performs step S310, otherwise, perform S311.
S310: adopt the first numerical value to carry out assignment to the route object variable in this packet, the application layer data carried in the packet after assignment is submitted to corresponding process process.
In step S310, if the network equipment is according to the application layer data carried in this packet, establish the long connection of corresponding TCP, then can set up the long connection state information connecting correspondence of this TCP in transport layer, now, the routing iinformation found in step S308 then can directly be kept in this connection state information set up by the network equipment.
S311: adopt second value to carry out assignment to the route object variable in this packet, according to this routing iinformation, the packet after assignment is transmitted to miscellaneous equipment.
Wherein, assignment is that the route object variable of second value characterizes this packet and need be transmitted to miscellaneous equipment.
Be the data package processing method that the embodiment of the present invention provides above, based on same thinking, the embodiment of the present invention also provides a kind of data packet processing, as shown in Figure 4.
The data packet processing structural representation that Fig. 4 provides for the embodiment of the present invention, specifically comprises:
Receiver module 401, for receiving packet;
First searches module 402, for searching the connection state information corresponding with described packet;
Judge module 403, for judging described first searches in the described connection state information that module 402 finds whether preserve routing iinformation; If so, then the routing iinformation in described connection state information is write described packet, and subsequent treatment is carried out to the packet of the described routing iinformation of write; Otherwise, the routing iinformation of described packet is searched in route-caching, the routing iinformation found is write described packet, subsequent treatment is carried out to the packet of the described routing iinformation of write, and the routing iinformation found is kept in connection state information corresponding to described packet.
State connection state information to comprise: the long connection state information connected of transmission control protocol TCP;
Described first search module 402 specifically for, according to the TCP head of described packet, search the connection state information corresponding with described TCP head.
Described judge module 403 specifically for, extract described first and search the socket sock information comprised in the described connection state information that module 402 finds, judge whether preserve routing iinformation in the described sock information extracted.
Described judge module 403 specifically for, adopt the first numerical value to carry out assignment to the route object variable in described packet, wherein, assignment is that the route object variable of described first numerical value characterizes described packet by processing locality;
Described judge module 403 specifically for, the application layer data that carries in the packet of the described routing iinformation of write is submitted to corresponding process process.
Described device also comprises:
Second searches module 404, for when described first search module 402 do not find the connection state information corresponding with described packet time, in route-caching, search the routing iinformation of described packet; When the routing iinformation that basis finds, when the destination address determining to comprise in described routing iinformation is local address, the first numerical value is adopted to carry out assignment to the route object variable in described packet, the application layer data carried in packet after assignment is submitted to corresponding process process, and when establishing connection according to described application layer data, the routing iinformation found in route-caching being kept at the described of foundation connects in corresponding connection state information, wherein, assignment is that the route object variable of described first numerical value characterizes described packet by processing locality; When the routing iinformation that basis finds, when the destination address determining to comprise in described routing iinformation is not local address, second value is adopted to carry out assignment to the route object variable in described packet, according to described routing iinformation, packet after assignment is transmitted to miscellaneous equipment, wherein, assignment is that the route object variable of described second value characterizes described packet and need be transmitted to miscellaneous equipment.
Concrete above-mentioned device as shown in Figure 4 can be positioned on the network equipment.
The embodiment of the present invention provides a kind of data package processing method and device, and the method treatment facility receives packet, searches the connection state information corresponding with described packet, judges whether preserve routing iinformation in the described connection state information found; If so, then the routing iinformation in described connection state information is write described packet, and subsequent treatment is carried out to the packet of the described routing iinformation of write; Otherwise, the routing iinformation of described packet is searched in route-caching, the routing iinformation found is write described packet, subsequent treatment is carried out to the packet of the described routing iinformation of write, and the routing iinformation found is kept in connection state information corresponding to described packet.Pass through said method, due to for each connection on the network equipment, except first packet received by this connection, for other packet received by this connection, the network equipment is before giving network layer by this other packet data delivery, all the routing iinformation of this first packet be kept in the connection state information of this connection is defined as the routing iinformation of this other packet, thus, in network layer, the network equipment need not search the routing iinformation of this other packet from route-caching, therefore, improve the efficiency of network device processing packet.
Those skilled in the art should understand, embodiments of the invention can be provided as method, system or computer program.Therefore, the present invention can adopt the form of complete hardware embodiment, completely software implementation or the embodiment in conjunction with software and hardware aspect.And the present invention can adopt in one or more form wherein including the upper computer program implemented of computer-usable storage medium (including but not limited to magnetic disc store, CD-ROM, optical memory etc.) of computer usable program code.
The present invention describes with reference to according to the flow chart of the method for the embodiment of the present invention, equipment (system) and computer program and/or block diagram.Should understand can by the combination of the flow process in each flow process in computer program instructions realization flow figure and/or block diagram and/or square frame and flow chart and/or block diagram and/or square frame.These computer program instructions can being provided to the processor of all-purpose computer, special-purpose computer, Embedded Processor or other programmable data processing device to produce a machine, making the instruction performed by the processor of computer or other programmable data processing device produce device for realizing the function of specifying in flow chart flow process or multiple flow process and/or block diagram square frame or multiple square frame.
These computer program instructions also can be stored in can in the computer-readable memory that works in a specific way of vectoring computer or other programmable data processing device, the instruction making to be stored in this computer-readable memory produces the manufacture comprising command device, and this command device realizes the function of specifying in flow chart flow process or multiple flow process and/or block diagram square frame or multiple square frame.
These computer program instructions also can be loaded in computer or other programmable data processing device, make on computer or other programmable device, to perform sequence of operations step to produce computer implemented process, thus the instruction performed on computer or other programmable device is provided for the step realizing the function of specifying in flow chart flow process or multiple flow process and/or block diagram square frame or multiple square frame.
In one typically configuration, computing equipment comprises one or more processor (CPU), input/output interface, network interface and internal memory.
Internal memory may comprise the volatile memory in computer-readable medium, and the forms such as random access memory (RAM) and/or Nonvolatile memory, as read-only memory (ROM) or flash memory (flashRAM).Internal memory is the example of computer-readable medium.
Computer-readable medium comprises permanent and impermanency, removable and non-removable media can be stored to realize information by any method or technology.Information can be computer-readable instruction, data structure, the module of program or other data.The example of the storage medium of computer comprises, but be not limited to phase transition internal memory (PRAM), static RAM (SRAM), dynamic random access memory (DRAM), the random access memory (RAM) of other type, read-only memory (ROM), Electrically Erasable Read Only Memory (EEPROM), fast flash memory bank or other memory techniques, read-only optical disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassette tape, tape magnetic rigid disk stores or other magnetic storage apparatus or other non-transmitting medium any, can be used for storing the information can accessed by computing equipment.According to defining herein, computer-readable medium does not comprise temporary computer readable media (transitory media), as data-signal and the carrier wave of modulation.
Also it should be noted that, term " comprises ", " comprising " or its other variant any are intended to contain comprising of nonexcludability, thus make to comprise the process of a series of key element, method, commodity or equipment and not only comprise those key elements, but also comprise other key element clearly do not listed, or also comprise by the intrinsic key element of this process, method, commodity or equipment.When not more restrictions, the key element limited by statement " comprising ... ", and be not precluded within process, method, commodity or the equipment comprising described key element and also there is other identical element.
It will be understood by those skilled in the art that embodiments of the invention can be provided as method, system or computer program.Therefore, the present invention can adopt the form of complete hardware embodiment, completely software implementation or the embodiment in conjunction with software and hardware aspect.And the present invention can adopt in one or more form wherein including the upper computer program implemented of computer-usable storage medium (including but not limited to magnetic disc store, CD-ROM, optical memory etc.) of computer usable program code.
The foregoing is only embodiments of the invention, be not limited to the present invention.To those skilled in the art, the present invention can have various modifications and variations.All do within spirit of the present invention and principle any amendment, equivalent replacement, improvement etc., all should be included within right of the present invention.

Claims (10)

1. a data package processing method, is characterized in that, comprising:
Receive packet;
Search the connection state information corresponding with described packet;
Judge whether preserve routing iinformation in the described connection state information found;
If so, then the routing iinformation in described connection state information is write described packet, and subsequent treatment is carried out to the packet of the described routing iinformation of write;
Otherwise, the routing iinformation of described packet is searched in route-caching, the routing iinformation found is write described packet, subsequent treatment is carried out to the packet of the described routing iinformation of write, and the routing iinformation found is kept in connection state information corresponding to described packet.
2. the method for claim 1, is characterized in that, described connection state information comprises: the long connection state information connected of transmission control protocol TCP;
Search the connection state information corresponding with described packet, specifically comprise:
According to the TCP head of described packet, search the connection state information corresponding with described TCP head.
3. the method for claim 1, is characterized in that, judges whether preserve routing iinformation in the described connection state information found, specifically comprises:
Extract the socket sock information comprised in the described connection state information found;
Judge whether preserve routing iinformation in the described sock information extracted.
4. the method for claim 1, is characterized in that, the routing iinformation in described connection state information is write described packet, specifically comprises:
Adopt the first numerical value to carry out assignment to the route object variable in described packet, wherein, assignment is that the route object variable of described first numerical value characterizes described packet by processing locality;
Subsequent treatment is carried out to the packet of the described routing iinformation of write, specifically comprises:
The application layer data carried in the packet of the described routing iinformation of write is submitted to corresponding process process.
5. the method for claim 1, is characterized in that, when not finding the connection state information corresponding with described packet, described method also comprises:
The routing iinformation of described packet is searched in route-caching;
When the routing iinformation that basis finds, when the destination address determining to comprise in described routing iinformation is local address, the first numerical value is adopted to carry out assignment to the route object variable in described packet, the application layer data carried in packet after assignment is submitted to corresponding process process, and when establishing connection according to described application layer data, the routing iinformation found in route-caching being kept at the described of foundation connects in corresponding connection state information, wherein, assignment is that the route object variable of described first numerical value characterizes described packet by processing locality;
When the routing iinformation that basis finds, when the destination address determining to comprise in described routing iinformation is not local address, second value is adopted to carry out assignment to the route object variable in described packet, according to described routing iinformation, packet after assignment is transmitted to miscellaneous equipment, wherein, assignment is that the route object variable of described second value characterizes described packet and need be transmitted to miscellaneous equipment.
6. a data packet processing, is characterized in that, comprising:
Receiver module, for receiving packet;
First searches module, for searching the connection state information corresponding with described packet;
Judge module, for judge described first search module searches to described connection state information in whether preserve routing iinformation; If so, then the routing iinformation in described connection state information is write described packet, and subsequent treatment is carried out to the packet of the described routing iinformation of write; Otherwise, the routing iinformation of described packet is searched in route-caching, the routing iinformation found is write described packet, subsequent treatment is carried out to the packet of the described routing iinformation of write, and the routing iinformation found is kept in connection state information corresponding to described packet.
7. device as claimed in claim 6, it is characterized in that, described connection state information comprises: the long connection state information connected of transmission control protocol TCP;
Described first search module specifically for, according to the TCP head of described packet, search the connection state information corresponding with described TCP head.
8. device as claimed in claim 6, it is characterized in that, described judge module specifically for, extract described first search module searches to described connection state information in the socket sock information that comprises, judge whether preserve routing iinformation in the described sock information extracted.
9. device as claimed in claim 6, it is characterized in that, described judge module specifically for, adopt the first numerical value to carry out assignment to the route object variable in described packet, wherein, assignment is that the route object variable of described first numerical value characterizes described packet by processing locality;
Described judge module specifically for, the application layer data that carries in the packet of the described routing iinformation of write is submitted to corresponding process process.
10. device as claimed in claim 6, it is characterized in that, described device also comprises:
Second searches module, for when described first search module do not find the connection state information corresponding with described packet time, in route-caching, search the routing iinformation of described packet; When the routing iinformation that basis finds, when the destination address determining to comprise in described routing iinformation is local address, the first numerical value is adopted to carry out assignment to the route object variable in described packet, the application layer data carried in packet after assignment is submitted to corresponding process process, and when establishing connection according to described application layer data, the routing iinformation found in route-caching being kept at the described of foundation connects in corresponding connection state information, wherein, assignment is that the route object variable of described first numerical value characterizes described packet by processing locality; When the routing iinformation that basis finds, when the destination address determining to comprise in described routing iinformation is not local address, second value is adopted to carry out assignment to the route object variable in described packet, according to described routing iinformation, packet after assignment is transmitted to miscellaneous equipment, wherein, assignment is that the route object variable of described second value characterizes described packet and need be transmitted to miscellaneous equipment.
CN201410555669.7A 2014-10-17 2014-10-17 A kind of data package processing method and device Active CN104601645B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410555669.7A CN104601645B (en) 2014-10-17 2014-10-17 A kind of data package processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410555669.7A CN104601645B (en) 2014-10-17 2014-10-17 A kind of data package processing method and device

Publications (2)

Publication Number Publication Date
CN104601645A true CN104601645A (en) 2015-05-06
CN104601645B CN104601645B (en) 2018-01-26

Family

ID=53127143

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410555669.7A Active CN104601645B (en) 2014-10-17 2014-10-17 A kind of data package processing method and device

Country Status (1)

Country Link
CN (1) CN104601645B (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105939263A (en) * 2015-08-12 2016-09-14 杭州迪普科技有限公司 Message sending method and device
CN106656811A (en) * 2016-12-06 2017-05-10 上海斐讯数据通信技术有限公司 Method and system for processing remote call based on AllJoyn frame
CN108737557A (en) * 2018-05-29 2018-11-02 Oppo(重庆)智能科技有限公司 A kind of data pack transmission method, terminal and computer storage media
CN114598609A (en) * 2022-03-11 2022-06-07 杭州网银互联科技股份有限公司 Network topology connection structure information storage method
WO2022198582A1 (en) * 2021-03-25 2022-09-29 华为技术有限公司 Data processing method and apparatus

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020143954A1 (en) * 2001-04-03 2002-10-03 Aiken John Andrew Methods, systems and computer program products for content-based routing via active TCP connection transfer
CN101217493A (en) * 2008-01-08 2008-07-09 北京大学 TCP data package transmission method
CN101217464A (en) * 2007-12-28 2008-07-09 北京大学 UDP data package transmission method

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020143954A1 (en) * 2001-04-03 2002-10-03 Aiken John Andrew Methods, systems and computer program products for content-based routing via active TCP connection transfer
CN101217464A (en) * 2007-12-28 2008-07-09 北京大学 UDP data package transmission method
CN101217493A (en) * 2008-01-08 2008-07-09 北京大学 TCP data package transmission method

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105939263A (en) * 2015-08-12 2016-09-14 杭州迪普科技有限公司 Message sending method and device
CN105939263B (en) * 2015-08-12 2019-07-09 杭州迪普科技股份有限公司 A kind of file transmitting method and device
CN106656811A (en) * 2016-12-06 2017-05-10 上海斐讯数据通信技术有限公司 Method and system for processing remote call based on AllJoyn frame
CN108737557A (en) * 2018-05-29 2018-11-02 Oppo(重庆)智能科技有限公司 A kind of data pack transmission method, terminal and computer storage media
WO2022198582A1 (en) * 2021-03-25 2022-09-29 华为技术有限公司 Data processing method and apparatus
CN114598609A (en) * 2022-03-11 2022-06-07 杭州网银互联科技股份有限公司 Network topology connection structure information storage method

Also Published As

Publication number Publication date
CN104601645B (en) 2018-01-26

Similar Documents

Publication Publication Date Title
CN109992405B (en) Method and network card for processing data message
CN104601645A (en) Data packet processing method and device
US20190026246A1 (en) On-chip data partitioning read-write method, system, and device
US8903972B2 (en) Method and apparatus for sharing contents using information of group change in content oriented network environment
CN108550038A (en) A kind of data dissemination system and method applied to block chain
CN103077208B (en) URL(uniform resource locator) matched processing method and device
CN107547391A (en) A kind of message transmitting method and device
CN104780201A (en) Data packet processing method and device for use in IPVS (Internet Protocol Virtual Server) cluster
CN113891396A (en) Data packet processing method and device, computer equipment and storage medium
CN108259348B (en) Message transmission method and device
CN107493234B (en) Message processing method and device based on virtual network bridge
CN104468855A (en) Method and device for processing ARP message
KR101952187B1 (en) Method and apparatus for processing service node ability, service classifier and service controller
CN114374641B (en) Three-layer message forwarding method and device
CN115712566A (en) Method, device, equipment and storage medium for checking interface field
WO2016101490A1 (en) Update processing method and device
CN108990126A (en) Message forwarding method and device
EP4136809B1 (en) Distributed flow processing and flow cache
CN111107142B (en) Service access method and device
CN110866380A (en) Method and terminal for filling in information field content
EP4283479A1 (en) Interconnection system, data transmission method, and chip
US9497285B1 (en) Connection bucketing in mirroring asymmetric clustered multiprocessor systems
CN111200608B (en) Link information processing method and device
CN110166434A (en) It stores gateway and stores data write-in, read method and the device of equipment
CN115102805B (en) Virtual tunnel processing method, device, computer equipment and storage medium

Legal Events

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