CN103078720B - Message processing method and device - Google Patents

Message processing method and device Download PDF

Info

Publication number
CN103078720B
CN103078720B CN201210584139.6A CN201210584139A CN103078720B CN 103078720 B CN103078720 B CN 103078720B CN 201210584139 A CN201210584139 A CN 201210584139A CN 103078720 B CN103078720 B CN 103078720B
Authority
CN
China
Prior art keywords
message
request message
payload segment
head
described request
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.)
Active
Application number
CN201210584139.6A
Other languages
Chinese (zh)
Other versions
CN103078720A (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.)
Guangdong Gaohang Intellectual Property Operation Co ltd
Haining hi tech Zone Science and Innovation Center Co.,Ltd.
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN201210584139.6A priority Critical patent/CN103078720B/en
Publication of CN103078720A publication Critical patent/CN103078720A/en
Application granted granted Critical
Publication of CN103078720B publication Critical patent/CN103078720B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)
  • Computer And Data Communications (AREA)

Abstract

The embodiment of the present invention provides a kind of message processing method and device, the request message that the method sends by obtaining transmitting terminal; Forward driver module directly described request message repeating to be processed to the application program preset; The request message that described forwarding driver module carries out processing for script being mail to operating system protocol stack, is transmitted to described application program; Described application program is used for directly storing and filters the heading of described request message, obtains message payload segment, and determines that the type of described request message is to carry out respective handling according to predetermined field in described message payload segment, obtain result; And heading is added to described result, directly return to described transmitting terminal after obtaining response message.The message processing method that the present embodiment provides and device, can meet network test requirements.

Description

Message processing method and device
Technical field
The embodiment of the present invention relates to the communication technology, particularly relates to a kind of message processing method and device.
Background technology
Network test is tested various software and hardware by high-performance server, verifies whether software and hardware can reach set function.
In prior art, when the network test to high performance network reptile or packet filtering equipment etc., in order to avoid the testing equipment adopting the instrument and equipment of high price to build, often develop specific server in the lab, make it have specific function, specific test can be completed.Such as, use the server of socket protocol to lightweight to do some changes, linux system adopts Epoll technology, or in Windows system, adopts completing port model etc., by the order that application program processing server is corresponding.
But the existing change to lightweight service device, is often limited to operating system performance, the socket protocol adopting operating system to provide, cannot meet test request.
Summary of the invention
The embodiment of the present invention provides a kind of message processing method and device, in order to meet network test requirements.
First aspect, the embodiment of the present invention provides a kind of message processing method, comprising:
Obtain the request message that transmitting terminal sends;
Forward driver module directly described request message repeating to be processed to the application program preset; The request message that described forwarding driver module carries out processing for script being mail to operating system protocol stack, is transmitted to described application program; Described application program is used for directly storing and filters the heading of described request message, obtains message payload segment, and determines that the type of described request message is to carry out respective handling according to predetermined field in described message payload segment, obtain result; And heading is added to described result, directly return to described transmitting terminal after obtaining response message.
In conjunction with first aspect, in the implementation that the first is possible, describedly determine that the type of described request message comprises to carry out respective handling according to predetermined field in described message payload segment:
If according to the replacement RST field determination described request message in described message payload segment for resetting message, then directly exit handling process;
If be off connection message according to the FIN field determination described request message that disconnects in described message payload segment, then generate and confirm ACK message, and generate the FIN field indicating described transmitting terminal to disconnect;
If be the message that connects according to the SYN field determination described request message that connects in described message payload segment, then generate and confirm ACK message;
If be data message according to the data PSH field determination described request message in described message payload segment, then generate and confirm ACK message;
If the valid data length in described message payload segment is greater than zero, then described valid data are processed, obtain result.
In conjunction with the first possible implementation of first aspect or first aspect, in the implementation that the second is possible, described request message is the message meeting transmission control protocol TCP agreement; Accordingly, described application program is used for directly storing and filters the heading of described request message, obtains message payload segment and comprises:
The protocol IP head interconnected between the media access control layer MAC head of described application storage described request message and network, and the MAC head filtered successively in described request message and IP head, obtain message payload segment; Correspondingly, add heading to described result to comprise:
Upper TCP head, IP head and MAC head are added successively to described result.
Second aspect, the embodiment of the present invention provides a kind of message process device, comprising:
Acquisition module, for obtaining the request message that transmitting terminal sends;
Forwarding driver module, for script being mail to the request message that operating system protocol stack carries out processing, being transmitted to processing module;
Processing module, store default application program, for directly storing and filtering the heading of described request message, obtain message payload segment, and determine that the type of described request message is to carry out respective handling according to predetermined field in described message payload segment, obtain result; And heading is added to described result, directly return to described transmitting terminal after obtaining response message.
In conjunction with second aspect, in the implementation that the first is possible, according to predetermined field in described message payload segment, described processing module determines that the type of described request message comprises to carry out respective handling:
If according to the replacement RST field determination described request message in described message payload segment for resetting message, then directly exit handling process;
If be off connection message according to the FIN field determination described request message that disconnects in described message payload segment, then generate and confirm ACK message, and generate the FIN field indicating described transmitting terminal to disconnect;
If be the message that connects according to the SYN field determination described request message that connects in described message payload segment, then generate and confirm ACK message;
If be data message according to the data PSH field determination described request message in described message payload segment, then generate and confirm ACK message;
If the valid data length in described message payload segment is greater than zero, then described valid data are processed, obtain result.
In conjunction with the first possible implementation of second aspect or second aspect, in the implementation that the second is possible, described request message is the message meeting transmission control protocol TCP agreement; Accordingly, described processing module directly stores and filters the heading of described request message, obtains message payload segment and comprises:
Described processing module stores the protocol IP head interconnected between the media access control layer MAC head of described request message and network, and the MAC head filtered successively in described request message and IP head, obtain message payload segment; Correspondingly, add heading to described result to comprise:
Upper TCP head, IP head and MAC head are added successively to described result.
The message processing method that the embodiment of the present invention provides and device, the request message that the method sends by obtaining transmitting terminal; Request message is directly forwarded to default application program and processes by forwarding driver module; Forwarding the request message that driver module carries out processing for script being mail to operating system protocol stack, being transmitted to application program; Application program is used for directly storing and the heading of filter request message, obtains message payload segment, and determines that the type of request message is to carry out respective handling according to field predetermined in message payload segment, obtain result; And heading is added to result, directly return to described transmitting terminal after obtaining response message.When processing request message, script is mail to the request message that operating system protocol stack carries out processing, be transmitted to application program, by application program, simplify processes carried out to this request message, improve Message processing performance, can network test requirements be met.
Accompanying drawing explanation
In order to be illustrated more clearly in the embodiment of the present invention or technical scheme of the prior art, be briefly described to the accompanying drawing used required in embodiment or description of the prior art below, apparently, accompanying drawing in the following describes is some embodiments of the present invention, for those of ordinary skill in the art, under the prerequisite not paying creative work, other accompanying drawing can also be obtained according to these accompanying drawings.
Fig. 1 is the schematic flow sheet of message processing method embodiment one of the present invention;
Fig. 2 is the schematic flow sheet of message processing method embodiment two of the present invention;
Fig. 3 is the structural representation of message process device embodiment one of the present invention.
Embodiment
For making the object of the embodiment of the present invention, technical scheme and advantage clearly, below in conjunction with the accompanying drawing in the embodiment of the present invention, technical scheme in the embodiment of the present invention is clearly and completely described, obviously, described embodiment is 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 the every other embodiment obtained under creative work prerequisite, belong to the scope of protection of the invention.
Fig. 1 is the schematic flow sheet of message processing method embodiment one of the present invention.Present embodiments provide a kind of message processing method, the method can perform by performing arbitrarily the message process device that Message processing operates, and this device can pass through software and/or hardware implementing.As shown in Figure 1, the method for the present embodiment can comprise:
Step 101: obtain the request message that transmitting terminal sends.
In the present embodiment, transmitting terminal can be network or various computer equipment, and message process device directly can obtain the request message that transmitting terminal sends, and can also capture request message by packet catcher.
Step 102: request message is directly forwarded to default application program and processes by forwarding driver module.
After getting request message, request message is directly forwarded in default application program and processes by forwarding driver module.Wherein, forwarding the request message that driver module carries out processing for script being mail to operating system protocol stack, being transmitted to application program.
In specific implementation process, forwarding driver module can be embedded in various high performance network transmitting-receiving bag hardware card, the speed that this high performance network transmitting-receiving bag hardware card received and sent data is higher, and directly can insert PCI bus (PeripheralComponentInterconnect the is called for short PCI) slot of message process device or be connected on message process device by other interface.It will be understood by those skilled in the art that this high performance network transmitting-receiving bag hardware card possesses general network card interface, directly can insert netting twine, obtain the request message that transmitting terminal sends, or return response message to transmitting terminal.The treatment effeciency of this high performance network transmitting-receiving bag hardware card is high, and the bit of process each second is up to 10,G(1,G=1,024 million).After this high performance network transmitting-receiving bag hardware card gets the request message of transmitting terminal, buffering area request message being forwarded to the application program that application layer is preset is driven by the forwarding in high performance network transmitting-receiving bag hardware card, when application program processes request message, application program calls this request message from this buffering area.When forwarding driver module is embedded in network interface card, the forwarding driver module by increasing income realizes request message to be forwarded to application program.
In another specific implementation process, forward driver module and can be embedded in message process device.It will be understood by those skilled in the art that this message process device is in order to supervisory computer hardware resource, control other programs and run and provide interactive operation interface for user, message process device can comprise operating system.For microsoft operation system, NDIS (NetworkDriverInterfaceSpecification in microsoft operation system, be called for short NDIS), define network interface card or the communication interface specification between NIC driver and upper-layer protocol driver, only need call NDIS function, and the kernel of operating system and the interface problem with other drivers need not be considered, network driver can be made can be separated from the complex communication of operating system.In forwarding driver module, NDIS function is set, when request message arrives operating system protocol stack, the type that operating system protocol stack can drive according to the forwarding in this forwarding driver module determines can't help operating system protocol stack processing request message, then operating system protocol stack does not carry out any process to request message, by forwarding driver module, request message is forwarded to default application program.
Application program is used for directly storing and the heading of filter request message, obtains message payload segment, and determines that the type of request message is to carry out respective handling according to field predetermined in message payload segment, obtain result; And heading is added to result, directly return to described transmitting terminal after obtaining response message.In specific implementation process, the MAC head of the first storage resource request message of application program and IP head, then filter out the MAC head and IP head of namely deleting this request message successively, obtain message payload segment.
Wherein, the heading of this request message comprises agreement (InternetProtocol the is called for short IP) head that media access control layer (MediaAccessControl is called for short MAC) interconnects between head and network.Application program filters out MAC head and the IP head of request message successively, obtains message payload segment.When this message is transmission control protocol (TransmissionControlProtocol is called for short TCP) message, wherein message payload segment comprises TCP head and data division.Application program assigns to determine the type of request message according to transmission control protocol (TransmissionControlProtocol is called for short TCP) head and data portion, and carries out respective handling, obtains result.When processing message payload segment, remove the message about Retransmission timeout or congestion control mechanism, only process the message of basic FLAG form, and obtain result, after acquisition result, application program adds heading to result, directly returns to transmitting terminal after obtaining response message.Wherein, add heading to result to comprise and add TCP head and IP head and MAC head successively to result.Especially, application program is that result adds corresponding IP head and MAC head according to the IP head preserved and MAC head.It will be understood by those skilled in the art that the request message in the embodiment of the present invention, be not limited to TCP message, can also be the message of other agreement, the present embodiment be particularly limited at this.
It will be appreciated by those skilled in the art that, by the driving of increasing income in high performance network transmitting-receiving bag hardware card equipment, network interface card, and NDIS specification, request message can be made to walk around system protocol stack receive or send network data, again by the simplify processes of application program to request message, the handling process to request message can be reduced, reduce system resource waste, improve the efficiency of processing request message, the message process device enabling the message processing method in the present embodiment and perform this message processing method completes the simulation of high-performance server.
The message processing method that the embodiment of the present invention provides, by obtaining the request message that transmitting terminal sends; Request message is directly forwarded to default application program and processes by forwarding driver module; Forwarding the request message that driver module carries out processing for script being mail to operating system protocol stack, being transmitted to application program; Application program is used for directly storing and the heading of filter request message, obtains message payload segment, and determines that the type of request message is to carry out respective handling according to field predetermined in message payload segment, obtain result; And heading is added to result, directly return to described transmitting terminal after obtaining response message.When processing request message, script is mail to the request message that operating system protocol stack carries out processing, be transmitted to application program, by application program, simplify processes carried out to this request message, improve Message processing performance, can network test requirements be met.
Further, on the basis of above-described embodiment one, in a step 102 determine that the type of described request message comprises to carry out respective handling according to field predetermined in message payload segment:
If according to the replacement RST field determination described request message in described message payload segment for resetting message, then directly exit handling process;
If be off connection message according to the FIN field determination described request message that disconnects in described message payload segment, then generate and confirm ACK message, and generate the FIN field indicating described transmitting terminal to disconnect;
If be the message that connects according to the SYN field determination described request message that connects in described message payload segment, then generate and confirm ACK message;
If be data message according to the data PSH field determination described request message in described message payload segment, then generate and confirm ACK message;
If the valid data length in described message payload segment is greater than zero, then described valid data are processed, obtain result.
Above-mentioned request message is TCP message.Six continuous print bits are comprised in TCP head in message payload segment, these six continuous print bits represent 6 important flag bits, be message process device in transmitting terminal and the present embodiment and carry out the Information sign of data exchange, determine the type of request message according to these marks.Below these six flag bits are described in detail.
Resetting (Resettheconnection, be called for short RST) field: for resetting because certain reason causes the incorrect link of appearance, being also used for refusal invalid data and request.If when receiving RST field, usually there occurs some mistake, only need carrying out data scrubbing work, without the need to replying any message, directly exiting handling process.
Disconnect (Nomoredatafromsender, be called for short FIN) field: be used for release connection, show that transmitting terminal has not had data have sent.
Confirm (Acknowledgmentfieldsignificant is called for short ACK) field: represent when putting 1 that confirmation number is legal, represent when being 0 that data segment does not comprise confirmation, confirmation number is left in the basket.
Connect (Synchronizesequencenumbers is called for short SYN) field: be used for connecting, in a connection request, SYN=1, ACK=0, during connection response, SYN=1, ACK=1.That is, SYN and ACK distinguishes connection request and connection response.
The data that data (PushFunction is called for short PSH) field: PUSH indicates, the data segment of asking when putting 1 just directly can deliver to application program after recipient obtains, and just transmits when buffering area need not be waited full.
Urgent pointer (UrgentPointerfieldsignificant, URG) field: when using, value is 1, being used for process avoids tcp data stream to interrupt.
In the present embodiment, urgent pointer field is not processed, only process for the message that front 5 fields are corresponding.It will be understood by those skilled in the art that the type of message that front 5 fields are corresponding, be in actual applications select one form, namely request message may be only the one in message corresponding to above-mentioned 5 fields.Determine that the type of request message is to carry out respective handling, is described in detail with a specific embodiment according to field predetermined in message payload segment below, specifically can see Fig. 2.
Fig. 2 is the schematic flow sheet of message processing method embodiment two of the present invention.As shown in Figure 2, in this paper processing method of providing of the embodiment of the present invention, according to predetermined field in described message payload segment, application program determines that the type of described request message comprises the following steps to carry out respective handling:
Step 201, acquisition message payload segment;
Application program filters out MAC head and the IP head of request message successively, and obtain message load message, message payload segment comprises TCP head and/or valid data.
Step 202, whether be reset message;
If TCP head comprises RST field, then determine that this request message is for resetting message, directly performs step 212, exits processing procedure; If do not comprise RST field in TCP head, then this request message is not reset message, performs step 203.
Step 203, whether be off connection message;
If TCP head comprises FIN field, then determine that this request message is off connection message, perform step 204; If do not comprise FIN field in TCP head, then determine that this request message is for being not disconnect message, then perform step 206.
Step 204, transmission acknowledge message;
When request message is off connection message, generates and confirm ACK message, and return this confirmation ACK message to transmitting terminal.
Step 205, transmission disconnect message;
When get that transmitting terminal sends disconnect message after, illustrates that transmitting terminal requires to disconnect, then this locality also needs transmission to disconnect message, notifies that transmitting terminal local terminal will disconnect network.
Step 206, whether be the message that connects;
When determining that request message is not when disconnecting message, judging whether comprise SYN field in TCP head, if TCP head comprises SYN field, then determining that this request message is for the message that connects, show that transmitting terminal wants newly-built TCP to connect, perform step 207; If do not comprise SYN field in TCP head, then determine that this request message is not the message that connects, perform step 208.
Step 207, transmission acknowledge message;
When request message for connect message time, generate and confirm ACK message, and return this confirmation ACK message to transmitting terminal.
Step 208, whether be data message;
When determining that request message is not when connecting message, judging whether comprise PSH field in TCP head, if TCP head comprises PSH field, then determining that this request message is data message, perform step 209; If when not comprising PSH field in TCP head, then determine that this request message is not data message, perform step 210.
Step 209, transmission acknowledge message;
When request message is data message, generates and confirm ACK message, and return this confirmation ACK message to transmitting terminal.
Whether step 210, valid data length are greater than zero;
When determine request message be off connect message or data message or other message time, judge whether the valid data length in this message is greater than zero, when valid data length is greater than zero, these valid data are filtered out, perform step 211, when valid data length equals zero, perform step 212.
Step 211, valid data process;
Valid data are processed, is specifically as follows and calls the upper strata of TCP and the data handling procedure of application layer, obtain application layer message.
Step 212, exit handling process.
Fig. 2 embodiment has carried out rational simplification to the handling process of Transmission Control Protocol, and when not affecting normal communication, only process resets message, and disconnect message, connect message and data message, improves handling property.It will be understood by those skilled in the art that above-described embodiment is only illustrative examples, in actual application, the type according to the predetermined field determination request message in TCP head can also be carried out according to other order.For the order of the type of concrete judgement request message, the present embodiment does not repeat them here.
For the request message comprising valid data, after application program process, be application layer message, this application layer message according to the difference of message process device, can return different data.
It will be appreciated by those skilled in the art that, when return data, add header successively by application program, comprise TCP head, IP head and MAC head, obtain response message, by the response message of application program simplify processes, do not mail to operating system protocol stack, directly be sent to transmitting terminal, owing to returning the process of response message, without operating system protocol stack, high response performance can be achieved.
Message processing method described in Fig. 1 and Fig. 2 embodiment, can be applied in multiple network test, for a concrete network test.
In web crawlers test, certain network company develops the very high http reptile of a money performance, and this reptile 1 can access the http-server of more than 10000 second, in test laboratory, in order to complete web crawlers test, it is almost impossible for building 10000 servers.And the message process device in the embodiment of the present invention, by the mode of packet capturing, the server that all reptiles are accessed all can be directed to message process device, due to this message process device in the present embodiment, operating system protocol stack is not walked to the process of request message, but completed by application program, be equivalent to high performance server, web crawlers 1 can be made to access this message process device 10000 times second, and all access climbed out of are made respond fast, without the need to building 10000 servers.
It will be understood by those skilled in the art that the message processing method that the present embodiment provides, can also be applied to other network test scenarios, for concrete network test scenarios, the present embodiment is not particularly limited at this.
Fig. 3 is the structural representation of message process device embodiment one of the present invention.As shown in Figure 3, the message process device that the present embodiment provides comprises acquisition module 301, forwards driver module 302, processing module 303.
Wherein, acquisition module 301 is for obtaining the request message of transmitting terminal transmission;
Forwarding the request message that driver module 302 carries out processing for script being mail to operating system protocol stack, being transmitted to processing module;
Processing module 303 stores default application program, for directly storing and filtering the heading of described request message, obtain message payload segment, and determine that the type of described request message is to carry out respective handling according to predetermined field in described message payload segment, obtain result; And heading is added to described result, directly return to described transmitting terminal after obtaining response message.
The message process device of the present embodiment, may be used for the technical scheme performing embodiment of the method shown in Fig. 1, it realizes principle and technique effect is similar, repeats no more herein.
Further, acquisition module 301, for obtaining the request message that transmitting terminal sends;
Forwarding driver module 302, for script being mail to the request message that operating system protocol stack carries out processing, being transmitted to processing module;
Processing module 303, store default application program, for directly storing and filtering the heading of described request message, obtain message payload segment, and determine that the type of described request message is to carry out respective handling according to predetermined field in described message payload segment, obtain result; And heading is added to described result, directly return to described transmitting terminal after obtaining response message.
Further, according to predetermined field in described message payload segment, described processing module 303 determines that the type of described request message comprises to carry out respective handling:
If according to the replacement RST field determination described request message in described message payload segment for resetting message, then directly exit handling process;
If be off connection message according to the FIN field determination described request message that disconnects in described message payload segment, then generate and confirm ACK message, and generate the FIN field indicating described transmitting terminal to disconnect;
If be the message that connects according to the SYN field determination described request message that connects in described message payload segment, then generate and confirm ACK message;
If be data message according to the data PSH field determination described request message in described message payload segment, then generate and confirm ACK message;
If the valid data length in described message payload segment is greater than zero, then described valid data are processed, obtain result.
Further, described request message is the message meeting Transmission Control Protocol; Accordingly, described processing module 303 directly stores and filters the heading of described request message, obtains message payload segment and comprises:
Described processing module 303 filters out MAC head and the IP head of described request message successively, obtains message payload segment; Correspondingly, add heading to described result to comprise:
Upper TCP head, IP head and MAC head are added successively to described result.
The message process device of the present embodiment, may be used for the technical scheme performing said method embodiment, it realizes principle and technique effect is similar, repeats no more herein.
In several embodiments that the application provides, should be understood that disclosed apparatus and method can realize by another way.Such as, device embodiment described above is only schematic, such as, the division of described unit or module, be only a kind of logic function to divide, actual can have other dividing mode when realizing, such as multiple unit or module can in conjunction with or another system can be integrated into, or some features can be ignored, or do not perform.Another point, shown or discussed coupling each other or direct-coupling or communication connection can be by some interfaces, and the indirect coupling of device or module or communication connection can be electrical, machinery or other form.
The described module illustrated as separating component can or may not be physically separates, and the parts as module display can be or may not be physical module, namely can be positioned at a place, or also can be distributed in multiple network element.Some or all of module wherein can be selected according to the actual needs to realize the object of the present embodiment scheme.
One of ordinary skill in the art will appreciate that: all or part of step realizing above-mentioned each embodiment of the method can have been come by the hardware that program command is relevant.Aforesaid program can be stored in a computer read/write memory medium.This program, when performing, performs the step comprising above-mentioned each embodiment of the method; And aforesaid storage medium comprises: ROM, RAM, magnetic disc or CD etc. various can be program code stored medium.
Last it is noted that above each embodiment is only in order to illustrate technical scheme of the present invention, be not intended to limit; Although with reference to foregoing embodiments to invention has been detailed description, those of ordinary skill in the art is to be understood that: it still can be modified to the technical scheme described in foregoing embodiments, or carries out equivalent replacement to wherein some or all of technical characteristic; And these amendments or replacement, do not make the essence of appropriate technical solution depart from the scope of various embodiments of the present invention technical scheme.

Claims (6)

1. a message processing method, is characterized in that, comprising:
Obtain the request message that transmitting terminal sends;
Forward driver module directly described request message repeating to be processed to the application program preset; The request message that described forwarding driver module carries out processing for script being mail to operating system protocol stack, is transmitted to described application program; Described application program is used for directly storing and filters the heading of described request message, obtain message payload segment, and determine that the type of described request message is to carry out respective handling according to predetermined field in described message payload segment, obtain result, and heading is added to described result, directly return to described transmitting terminal after obtaining response message.
2. method according to claim 1, is characterized in that, describedly determines that the type of described request message comprises to carry out respective handling according to predetermined field in described message payload segment:
If according to the replacement RST field determination described request message in described message payload segment for resetting message, then directly exit handling process;
If be off connection message according to the FIN field determination described request message that disconnects in described message payload segment, then generate and confirm ACK message, and generate the FIN field indicating described transmitting terminal to disconnect;
If be the message that connects according to the SYN field determination described request message that connects in described message payload segment, then generate and confirm ACK message;
If be data message according to the data PSH field determination described request message in described message payload segment, then generate and confirm ACK message;
If the valid data length in described message payload segment is greater than zero, then described valid data are processed, obtain result.
3. method according to claim 1 and 2, is characterized in that, described request message is the message meeting transmission control protocol TCP agreement; Accordingly, described application program is used for directly storing and filters the heading of described request message, obtains message payload segment and comprises:
The protocol IP head interconnected between the media access control layer MAC head of described application storage described request message and network, and the MAC head filtered successively in described request message and IP head, obtain message payload segment; Correspondingly, add heading to described result to comprise:
Upper TCP head, IP head and MAC head are added successively to described result.
4. a message process device, is characterized in that, comprising:
Acquisition module, for obtaining the request message that transmitting terminal sends;
Forwarding driver module, for script being mail to the request message that operating system protocol stack carries out processing, being transmitted to processing module;
Processing module, store default application program, for directly storing and filtering the heading of described request message, obtain message payload segment, and determine that the type of described request message is to carry out respective handling according to predetermined field in described message payload segment, obtain result; And heading is added to described result, directly return to described transmitting terminal after obtaining response message.
5. device according to claim 4, is characterized in that, according to predetermined field in described message payload segment, described processing module determines that the type of described request message comprises to carry out respective handling:
If according to the replacement RST field determination described request message in described message payload segment for resetting message, then directly exit handling process;
If be off connection message according to the FIN field determination described request message that disconnects in described message payload segment, then generate and confirm ACK message, and generate the FIN field indicating described transmitting terminal to disconnect;
If be the message that connects according to the SYN field determination described request message that connects in described message payload segment, then generate and confirm ACK message;
If be data message according to the data PSH field determination described request message in described message payload segment, then generate and confirm ACK message;
If the valid data length in described message payload segment is greater than zero, then described valid data are processed, obtain result.
6. the device according to claim 4 or 5, is characterized in that, described request message is the message meeting transmission control protocol TCP agreement; Accordingly, described processing module directly stores and filters the heading of described request message, obtains message payload segment and comprises:
Described processing module stores the protocol IP head interconnected between the media access control layer MAC head of described request message and network, and the MAC head filtered successively in described request message and IP head, obtain message payload segment; Correspondingly, add heading to described result to comprise:
Upper TCP head, IP head and MAC head are added successively to described result.
CN201210584139.6A 2012-12-28 2012-12-28 Message processing method and device Active CN103078720B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210584139.6A CN103078720B (en) 2012-12-28 2012-12-28 Message processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210584139.6A CN103078720B (en) 2012-12-28 2012-12-28 Message processing method and device

Publications (2)

Publication Number Publication Date
CN103078720A CN103078720A (en) 2013-05-01
CN103078720B true CN103078720B (en) 2015-11-25

Family

ID=48155134

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210584139.6A Active CN103078720B (en) 2012-12-28 2012-12-28 Message processing method and device

Country Status (1)

Country Link
CN (1) CN103078720B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107888514A (en) * 2017-11-17 2018-04-06 北京东土军悦科技有限公司 Message transmission method, message transfer device and electronic equipment in a kind of equipment
CN109587163B (en) * 2018-12-27 2022-08-16 网宿科技股份有限公司 Protection method and device in DR mode
CN114157684B (en) * 2020-08-18 2024-01-02 华为终端有限公司 Message processing method, device and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101247266A (en) * 2008-03-21 2008-08-20 深圳国人通信有限公司 Method for processing data in Ethernet
CN102694733A (en) * 2012-06-06 2012-09-26 济南大学 Method for acquiring network flow data set with accurate application type identification

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
ATE443291T1 (en) * 2002-06-19 2009-10-15 Ericsson Telefon Ab L M NETWORK DEVICE DRIVER ARCHITECTURE

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101247266A (en) * 2008-03-21 2008-08-20 深圳国人通信有限公司 Method for processing data in Ethernet
CN102694733A (en) * 2012-06-06 2012-09-26 济南大学 Method for acquiring network flow data set with accurate application type identification

Also Published As

Publication number Publication date
CN103078720A (en) 2013-05-01

Similar Documents

Publication Publication Date Title
US10986171B2 (en) Method for unified communication of server, baseboard management controller, and server
CN101689171A (en) End-to-end current control in the network
CN102761534B (en) Realize the method and apparatus of media access control layer Transparent Proxy
CN107800663B (en) Method and device for detecting flow offline file
CN105141603B (en) Communication data transmission method and system
CN111162935B (en) Network communication method and system based on packet-level data distribution
CN103795632A (en) Data message transmission method, related equipment and system
CN101953139A (en) DHCP initialization responsive to network layer connectivity
CN103078720B (en) Message processing method and device
US8948020B2 (en) Detecting and isolating dropped or out-of-order packets in communication networks
CN107506324A (en) Interconnecting device, telecommunication system, data transmission method and device
CN108462590A (en) The monitoring method and device of network flow, terminal
CN107493254B (en) TCP message forwarding method, device and system
CN114338270B (en) Data communication method, device, electronic equipment and storage medium
CN111726406A (en) Data transmission method and related equipment
CN103312753A (en) Communication method and device of Internet of things
US9628366B2 (en) Methods, systems, and computer readable media for sustaining active control over concurrent session connections
CN106411677A (en) Method and device for determining optimal maximum transmission unit (MTU) of virtual private network (VPN) data channel
US20080002701A1 (en) Network interface card virtualization based on hardware resources and software rings
CN107168909A (en) Interconnecting device, telecommunication system, data transmission method and device
CN108933738A (en) A kind of method, apparatus and system handling network congestion
CN115348337B (en) TCP data packet analysis method and device based on multiple protocols
US7526706B2 (en) Method and apparatus for preventing network outages
CN111865884A (en) Message processing method, device and equipment
CN116915667B (en) Network traffic acquisition method and device, electronic 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
C14 Grant of patent or utility model
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20191216

Address after: 314400 No.11, Weisan Road, Nongfa District, Chang'an Town, Haining City, Jiaxing City, Zhejiang Province

Patentee after: Haining hi tech Zone Science and Innovation Center Co.,Ltd.

Address before: 510000 unit 2414-2416, building, No. five, No. 371, Tianhe District, Guangdong, China

Patentee before: GUANGDONG GAOHANG INTELLECTUAL PROPERTY OPERATION Co.,Ltd.

Effective date of registration: 20191216

Address after: 510000 unit 2414-2416, building, No. five, No. 371, Tianhe District, Guangdong, China

Patentee after: GUANGDONG GAOHANG INTELLECTUAL PROPERTY OPERATION Co.,Ltd.

Address before: 518129 Bantian HUAWEI headquarters office building, Longgang District, Guangdong, Shenzhen

Patentee before: HUAWEI TECHNOLOGIES Co.,Ltd.