CN109842465A - Data transmission method, data end equipment - Google Patents
Data transmission method, data end equipment Download PDFInfo
- Publication number
- CN109842465A CN109842465A CN201711191694.1A CN201711191694A CN109842465A CN 109842465 A CN109842465 A CN 109842465A CN 201711191694 A CN201711191694 A CN 201711191694A CN 109842465 A CN109842465 A CN 109842465A
- Authority
- CN
- China
- Prior art keywords
- data
- retransmitted
- tcp
- function
- transmission
- 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.)
- Pending
Links
Landscapes
- Communication Control (AREA)
Abstract
This application provides a kind of data transmission methods, data end equipment, wherein this method comprises: identification field is added in the packet header that client layer is data to be transmitted packet, to generate transmission data, wherein the identification field is for data to be transmitted packet described in unique identification;The transmission data are transmitted by protocol layer;Obtain the data being retransmitted, and the corresponding identification field of data being retransmitted described in extraction;According to the identification field of extraction, the data packet of client layer belonging to the data being retransmitted is determined.It is solved when retransmitting through the above scheme, data are transmitted in the form of data flow, it is not aware which data packet is the data of re-transmission correspond to, it certainly will thus will lead to and obstacle is led to the problem of to the analysis of the reason of delay or time-out, the reason of having reached the technical effect for being simple and efficient the corresponding relationship for determining to retransmit data packet and raw data packets, can effectively having analyzed network delay.
Description
Technical field
The application belongs to field of computer technology more particularly to a kind of data transmission method, data end equipment.
Background technique
It is related to network in certain operation (such as: search key, read-write remote data etc.) of user application to pass
When defeated, it is frequently encountered high latency or transmits time-out.This high latency is a time out and not only will affect user experience, and
And be also possible to cause to accumulate in server end to request, to seriously affect the availability of service.
If effectively to solve these problems, service administrators either user it should be understood that these high latencies or
The producing cause being a time out, to targetedly be repaired and be optimized.During actual network transmission, generation is prolonged
Slow factor generally further includes the problem on network communication link other than transmitting terminal and the software issue of receiving end.
By taking TCP (Transmission Control Protocol, transmission control protocol) as an example, detecting that network is logical
News link fails (such as: there is congestion or great fluctuation process in link) when, the retransmission operation for carrying out data segment can be triggered.
However, when retransmitting, because data are transmitted in the form of data flow, in this case it is not apparent that re-transmission when TCP transmission
Data correspond to which data packet that the either corresponding application program of which application program issues, and certainly will thus will lead to delay
Or the analysis of the reason of time-out generates obstacle.
In view of the above-mentioned problems, currently no effective solution has been proposed.
Summary of the invention
The application is designed to provide a kind of data transmission method, data end equipment, may be implemented.
The application provides a kind of data transmission method, data end equipment is achieved in that
A kind of data transmission method, which comprises
Identification field is added in the packet header that client layer is data to be transmitted packet, to generate transmission data, wherein the mark
Field is for data to be transmitted packet described in unique identification;
The transmission data are transmitted by protocol layer;
Obtain the data being retransmitted, and the corresponding identification field of data being retransmitted described in extraction;
According to the identification field of extraction, the data packet of client layer belonging to the data being retransmitted is determined.
A kind of data end equipment, including processor and for the memory of storage processor executable instruction, the place
Reason device realizes following steps when executing described instruction:
Identification field is added in the packet header that client layer is data to be transmitted packet, to generate transmission data, wherein the mark
Field is for data to be transmitted packet described in unique identification;
The transmission data are transmitted by protocol layer;
Obtain the data being retransmitted, and the corresponding identification field of data being retransmitted described in extraction;
According to the identification field of extraction, the data packet of client layer belonging to the data being retransmitted is determined.
A kind of computer readable storage medium is stored thereon with computer instruction, and it is above-mentioned that described instruction is performed realization
The step of method.
Data transmission method provided by the present application, data end equipment pass through in the packet header that client layer is data to be transmitted packet
Identification field is added and generates the mode for sending data, so that the identifier word wherein carried can be extracted for the data packet of re-transmission
Section, may thereby determine that out the data packet being retransmitted corresponds to which data packet of client layer transmission.It solves through the above way
It is existing when retransmitting, data are transmitted in the form of data flow, in this case it is not apparent which the data of re-transmission correspond to and answer
Which data packet issued with the either corresponding application program of program, certainly will thus will lead to the reason to delay or time-out
Analysis lead to the problem of obstacle, reached the skill for being simple and efficient the corresponding relationship for determining to retransmit data packet and raw data packets
Art effect, the reason of can effectively analyzing network delay.
Detailed description of the invention
In order to illustrate the technical solutions in the embodiments of the present application or in the prior art more clearly, to embodiment or will show below
There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this
The some embodiments recorded in application, for those of ordinary skill in the art, in the premise of not making the creative labor property
Under, it is also possible to obtain other drawings based on these drawings.
Fig. 1 is the configuration diagram of data transmission system provided by the present application;
Fig. 2 is a kind of method flow diagram of embodiment of data transmission method provided by the present application;
Fig. 3 is a kind of schematic diagram of embodiment of transmission flow provided by the present application;
Fig. 4 is a kind of configuration diagram of embodiment of server provided by the present application;
Fig. 5 is a kind of modular structure schematic diagram of embodiment of data transmission device provided by the present application.
Specific embodiment
In order to make those skilled in the art better understand the technical solutions in the application, below in conjunction with the application reality
The attached drawing in example is applied, the technical scheme in the embodiment of the application is clearly and completely described, it is clear that described implementation
Example is merely a part but not all of the embodiments of the present application.Based on the embodiment in the application, this field is common
The application protection all should belong in technical staff's every other embodiment obtained without creative efforts
Range.
If considering to solve random ordering and packet loss in network communication, guarantee data correct (including number in the form of streaming
According to content and succession) it is transferred to destination.It therefore, will not be immediately by data after kernel transport protocol sends data segment
Section cleans up, and is maintained in a queue.After detecting out-of-order and packet loss, corresponding data will be found from queue
It retransmits one time.For example, (corresponding ACK can not be received after giving out a contract for a project within a certain period of time in time-out by taking Transmission Control Protocol as an example
Confirmation), speculate congestion (such as: continuously receiving three repeat ACKs, receive SACK etc.), receive when needing to distribute ICMP message into
Row retransmits.
Retransmission operation is generally accompanied with the reduction of congestion window, or even stops the transmission to new data, and reflection is used to upper layer
One presentation of family layer is exactly slack-off, appearance time-out of giving out a contract for a project, and What is more, and error is exited.Because the process of data transmission is to pass through
What the mode of data flow was transmitted, client layer is transmitted through the data come and transmits in the way of flow data in a stream,
When being retransmitted all operations, for transport protocol, also simply knows that and certain one piece of data stream is retransmitted, but not
Know the data flow of these re-transmissions corresponds to which data packet of client layer.Correspondingly, client layer can only be seen to be give out a contract for a project it is slack-off,
There is time-out etc., but not knowing is delay or time-out which data packet occurs.
If for this purpose, being used for the unique identification user number of plies in view of increasing by one in the data packet of client layer application program
According to the identification field (such as: mark ID) of packet, and by the identification field also with data packet be transmitted to protocol layer (such as: TCP
Layer), then when carrying out data transmission and retransmitting, so that it may determine that the data retransmitted are to belong to according to the identification field
Which data packet.I.e., it is possible to go the association raw data packets that application program is sent originally by the Tag ID, can also apply
After program finds certain request high latency or time-out, searched whether by the Tag ID of the request into re-transmission data event set
Relevant Tag ID, thus judge the request high latency or time-out whether be as caused by network communication link problem,
It even can further judge the reason of generating link problem.
Detecting that network communication link goes wrong (such as: congestion or great fluctuation process occurs in link) in view of existing
When, the retransmission operation for carrying out data segment can be triggered.However, data are transmitted in the form of data flow when retransmitting,
It is not aware that the data of re-transmission correspond to which data packet that the either corresponding application program of which application program issues, makes use of momentum in this way
The analysis to the reason of delay or time-out must be caused to generate obstacle.
If marked thus by identification field to each data packet in view of increasing identification field in the packet
Know, when retransmitting, this mark is also carried, then can also be based on the identifier word when carrying out data re-transmission
Section determines the data packet being retransmitted corresponds to which original data packet, can be into the reason of so as to delay or supermarket
The simple accurately analysis of row.
Based on this, a kind of data transmission system is provided in this example, as shown in Figure 1, comprising: sender 101, recipient
102, carried out data transmission between sender 101 and recipient 102 by Transmission Control Protocol, and depositing in case of a network fault,
Triggering carries out data re-transmission.
In this example, increase identification field in the packet, each data packet is identified by identification field,
When re-transmission, this mark is also carried, then can also determine based on the identification field when carrying out data re-transmission
The data packet being retransmitted out corresponds to which original data packet.Specifically, a kind of data transmission method is provided in this example,
As shown in Fig. 2, may include steps of:
S1: identification field is added in the packet header that client layer is data to be transmitted packet and generates transmission data, wherein the mark
Field is for data to be transmitted packet described in unique identification;
I.e., it is possible in the data being ready for sending, for example, it may be data pending in 101 memory of sender, for the number
According to identification field is increased, for example, the identification field is used for the unique identification data.
In order to enable could be aware which position is identification field in TCP data stream for processing end, can marking
Increase instruction information before section of becoming literate (the instruction information can be known as to magic number).For example, the evil spirit number can be predetermined byte number
The field of amount, for example, it may be 4 bytes, 8 bytes etc., the field preferably seldom used.In this way, when recognizing in data flow
There is the field, so that it may which the field for determining back to back predetermined byte number is exactly the identification field of data packet.
By way of increasing identification field and identification field and indicating information, allow to determine the data packet retransmitted with
Corresponding relationship between former data packet, so as to based on retransmit determine network failure the reason of.
S2: the transmission data are transmitted by protocol layer;
It when carrying out data transmission between sender and recipient, can be transmitted by transport protocol, such data
Packet when transmission, is transmitted in the form of data flow.
S3: obtaining the identification field carried in the data being retransmitted, determines the number of client layer belonging to the data being retransmitted
According to packet.
In upper example, by way of carrying identification field in raw data packets, so that when retransmitting, Ke Yitong
It crosses the identification field and determines the data packet retransmitted is which application or which data packet from upper layer.That is, for being weighed
It is available to be retransmitted the identification field carried in data for the data of biography, so that it is determined that going out the data packet retransmitted and former number
According to the corresponding relationship between packet.
The transmission method of the data packet can be applied in client, can also be applied in server end, as long as network packet
Sender, then can pass through this method carry out data packet transmission.That is, as long as party awarding the contract's (not being packet receiving side) is i.e.
It can.Because client and server is all meeting, hairnet network packet is requested, both there is the possibility given out a contract for a project.Work as server
When as the party awarding the contract, the transmission method of the data packet is just applied in the server, when client is as the party awarding the contract,
The transmission method of the data packet is just applied in client.
In one embodiment, for the data packet of client layer, one can be increased in the packet header of each data packet
Tag ID, further, in order to enable it is subsequent when carrying out data analysis and extracting, it is known which field is label
ID can be identified by way of increasing magic number.I.e., it is possible to a magic number and a Tag ID is added in data packet head, this
Sample can export the Tag ID of application layer data packet belonging to the data segment when Transmission Control Protocol retransmits data segment.
Above-mentioned evil spirit number can be the field predetermined with certain length, and above-mentioned Tag ID can be set to have
The byte of certain length can choose the idle word that do not use temporarily when magic number and Tag ID are arranged in the packet
Section carries magic number and Tag ID.2,4,8,16 etc. are selected as to the length property of can be exemplified of the above-mentioned magic number and Tag ID enumerated to appoint
It anticipates one kind.When actually realizing, it can according to need the other length of selection and magic number and Tag ID be set.
In upper example, it is identifier word which field can be accurately judged in a stream by way of increasing magic number
Section, which field is not identification field.
Further, it is contemplated that because in practical implementations, increasing Tag ID and magic number in the packet, may relating to
And send and receive packets function is modified in system kernel, it, can be to these goal systems if rewriting these functions
(that is, client or operating system of server operation) carries out excessive change.In order to avoid this large-scale change,
One embodiment can modify to objective function through but not limited to following manner:
Mode 1) code bit specified during target program is run in user by operating system nucleus or privilege process
Set (such as: the head of function, tail portion) special instruction collection is added, achieve the purpose that operation code set by user.
For example, using the referred to as mechanism of kprobe, it is real that user can use kprobe mechanism in (SuSE) Linux OS
Now dynamic instrumentation, with the code of function designated position operation setting most of in linux kernel.
Mode 2) objective function kidnapped by the method for modifying specific structure pointer.
Comparatively, the advantages of mode 1, is that it is that kernel is formal, mechanism designed for this purpose, and limits item
Part is few, covering surface is big;The advantages of mode 2, is will not to lose event, the expense of abduction almost without.
Therefore, when selecting abduction mode, different abduction modes can be selected according to the difference of objective function, with
Just the expense of abduction is efficiently reduced, while achieving the purpose that reduce the system interference to destination server to the greatest extent.
It is illustrated by taking TCP transmission in linux system as an example below, specifically, the linux kernel function to be kidnapped can be with
Including but not limited to following one:
B function: the TCP between client layer and protocol layer sends function, such as: tcp_sendmsg;
D function: TCP sends out the detection function before data segment, such as: tcp_v4_send_check;
F function: the function of unpacking that TCP is retransmitted, such as: tcp_fragment;
H function: TCP retransmits entrance function, such as: tcp_retransmit_skb.
It is mainly specifically described below with the abduction of B function:
B function is between application layer and TCP protocol layer, and parameter involved in B function may include: that user passes through application
Program comes into the raw data packets of kernel, which is stored in the user's space of memory, can carry out to the function
It kidnaps.
In view of B function is a hot spot function, therefore in manner just described 1 can not be adopted, further, because of B function
Meet the condition of aforesaid way 2, therefore can be kidnapped with 2 pairs of B functions through the above way, that is, by modifying specific structure
The method of pointer kidnaps objective function.
The modification to function is realized by using the mode for kidnapping function, can be modified on a large scale, be subtracted to avoid to system
The system interference to destination server is lacked.
For example, linux kernel be in a manner of sock- > ops- > sendmsg () come call B function (that is, sock- >
Ops- > sendmsg pointer is directed toward B function).Therefore, can first save sock- > ops- > sendmsg (i.e. B) is original tcp_
Sendmsg (i.e. following save_tcp_sendmsg) then, then will kidnap function (A function, my_tcp_sendmsg) assignment
To sock- > ops- > sendmsg, to realize the abduction to B function.
This process can pass through following C language Implementation of pseudocode:
Inet_stream_ops=get_symbol_address_diting (" inet_stream_ops ");
Save_tcp_sendmsg=inet_stream_ops- > sendmsg;//save_tcp_sendmsg=B
Inet_stream_ops- > sendmsg=my_tcp_sendmsg;//inet_stream_ops- > sendmsg=
A
In this way, carrying out when kernel runs to the position of script B function and kidnapping function A, the realization logic of A function
Are as follows:
A(parameter1,parameter2,…){
prepare job;The preparation of //A.1
B(parameter1,parameter2,…);//A.2 calls directly corresponding original function B
ending job;The power cut-off of //A.3
}
Correspondingly, can by the other three kidnap function (C function, E function, G-function) respectively to D function, F function and
H function is kidnapped.These three realization logics for kidnapping function can be divided into three parts as A function: first part * .1
It realizes and prepares code, second part * .2 calls directly original function;Part III * .3 realizes ending work.
The component part of above-mentioned abduction function is only a kind of schematic representation, when actually realizing, can also be used
Other building forms, for example, only including: that first part * .1 realizes that preparing code and Part III * .3 realizes ending work.
Which kind of can be selected according to actual needs using mode, the application is not construed as limiting this.
Similar with B function, D function can also be kidnapped with through the above way 2, specifically, can pass through data structure
Pointer: ipv4_specific- > send_check calls D function.
For F function and H function, because being non-hot function, it is not available above-mentioned mode 2 and is kidnapped, it therefore, can
To select aforesaid way 1 to kidnap F function and H function, that is, by being transported in the corresponding function designated position of linux kernel
The code of row setting kidnaps objective function.
For increasing the magic number of 4 bytes and the Tag ID of 4 bytes in the data packet that client layer is sent, tie below
Close Fig. 3 whole process is described, in Fig. 3, horizontal axis indicate the time, the longitudinal axis indicate 4 abduction functions: A function, C function,
E function, G-function, this four abduction functions respectively correspond 4 original functions: B function, D function, F function, H function.Function it
Between call relation (the called function of the object representations that arrow is directed toward) is indicated by vertical arrow.The vertical arrow table of dotted line
Show that the calling does not occur every time, meeting Call Condition can just call.The * .1 in box, * .2 and * .3 difference in Fig. 1
Represent three parts of above-mentioned function structure logic.
It is as follows to 4 abduction function declarations respectively:
1) A function (my_tcp_sendmsg): the TCP between client layer and protocol layer sends the abduction function of function B.
A.1:prepare job (preparation):
A.1.1: 8, the head byte of scanning user's space datarams, if it is predetermined for scanning to preceding 4 byte
Magic number, the then Tag ID being passed to rear 4 byte as user, the Tag ID storage that will acquire to the sk knot for representing present networks link
In structure body;
A.1.2: determining that this sends function data length to be sent, sent out according to the addition stored in this sk structural body
The TCP serial number for sending the last byte of queue calculates this and sends the corresponding TCP sequence number window of data;
A.1.3: the setting flag WRITE in this sk structural body;
A.2: calling original publication function B function;
A.3:ending job (power cut-off):
A.3.1: the case where handling B function Y traverses all skb on this sk structural body transmit queue, if currently processed
Skb TCP serial number range within this TCP sequence number window for sending data A.1.2 recorded, then will A.1.1 record
Tag ID is stored into currently processed skb structural body;
Wherein, sk is the sock data structure during (SuSE) Linux OS kernel TCP is realized, skb is (SuSE) Linux OS
Sk_buff data structure in kernel TCP realization.Wherein, sk is included and this network linking for describing a network linking
Relevant various information, such as: ip, port, mss, the rtt of link, serial number of currently giving out a contract for a project, the acknowledged sequence number received etc.
Deng;Skb includes various information relevant with the data segment for describing network data section (segment), such as: notebook data section
TCP serial number range, whether data length, the memory pointer where data, moment of giving out a contract for a project, this section retransmitted etc..
It, can be by finding useless field in sk data structure and skb data structure, for depositing when realizing
Store up Tag ID.In tcp, certain sheet data can be referred to by segment (section), number can be passed through for upper level applications
It is referred to according to packet.The data packet on one upper layer may correspond to multiple TCP data sections, and a TCP data section may also correspond to multiple
Upper layer data packet.
A.3.2: label WRITE is removed in this sk structural body;
2) B function (tcp_sendmsg): the TCP between client layer and protocol layer sends function.
Detect on transmit queue whether there are also remaining spaces in the last one skb packet, if there is remaining space, then by this
The data copy of transmission is entered, if remaining space is not enough to accommodate all data of this transmission, distributes new skb to hold
Receive remaining data volume to be sent;
It detects whether that data can be sent at once, if data can be sent at once, just sends a skb immediately, otherwise
Other opportunity is waited to retransmit.Therefore, when executing, (one or several) skb (situation X, processing can be sent immediately
See C.1.1), it can also be when handling this transmission function, (one or several) skb, which is stayed in transmit queue, wouldn't send (feelings
A.3.1 condition Y, processing are shown in).
3) the abduction function of the detection function D function before C function (my_tcp_send_check): TCP hair data segment.
The TCP object finally to be sent is skb, and the function for sending skb needs to call D function, in this example, can be used
C function kidnaps D function.Wherein, it is similar with the situation X kidnapped in B function by A function that D function is kidnapped by C function.
C.1:prepare job (preparation):
C.1.1: if there are WRITE labels on the case where handling above-mentioned B function X-- sk structural body, and this skb is new
It sends out section rather than retransmitted segment, then the Tag ID stored on sk structural body is stored on this skb structural body.Wherein it is determined that skb whether
It is that new hair section can be compared to by the last TCP serial number of this skb with next TCP Segment beginning sequence number value to be sent on sk etc.
Judgement.
Further, because of the original skb that skb majority of case is this function parameter (clone) skb, therefore, it is possible to judge that
It whether is clone, to ensure Tag ID there are original skb structural body rather than on the skb structural body of clone.
C.1.2: processing TCP unpacks situation because TCP when sending data, understand due to some (such as: window
Mouthful limitation etc.) skb splitted into two to send.Therefore, whether the next field that can detecte original skb is effective
Skb, if so, and the next skb there is no recording mark ID, then just by the Tag ID storage on original skb to next skb
On structural body so that Tag ID can be carried on skb so that for each skb can identify its with
Corresponding relationship between raw data packets;
C.2: calling original inspection function D function;
C.3:ending job (power cut-off): empty.
4) detection function before D function (tcp_v4_send_check): TCP hair data segment.
5) the abduction function of G-function (mytcp_retransmit_skb): TCP re-transmission entrance function H function.
G.1:prepare job (preparation): empty;
G.2: calling original re-transmission function H function;
G.3:ending job (power cut-off): checking H function, if successfully transmitting a re-transmission skb, output pair
The event answered, specifically, some information on re-transmission skb can be exported, such as: event generation time, the link congestion
State of a control, the port ip four-tuple, sk pointer, TCP serial number range, scoreboard, rto, srtt, rttvar etc. and Tag ID
Deng.
Wherein, event may refer to processor and run to certain appointment codes point in the field Tracing of computer science
When, a series of operation is triggered in the condition of code point setting in advance due to meeting, these operations have identifiability.Example
Such as: user sets Boolean variable in program code somewhere in advance, when processor runs to this position, and detects that the boolean becomes
When amount is true, so that it may trigger event, thereby executing a series of preset operations.The operation of execution can be record event
Relevant information, such as: other data etc. that event title, event generation time, Thread Id, event carry.
6) H function (tcp_retransmit_skb): TCP entrance function is retransmitted, TCP calls the function to retransmit skb.
It unpacks if necessary, then H function, which calls, retransmits function F function of unpacking, and then first calls E function.In addition, working as TCP
When really determining to retransmit some skb, TCP can be called to send out the detection function D function before data segment, to first call C letter
Number.But because no WRITE is marked on sk, C.1.1 part will not be entered.
7) the abduction function of E function (my_tcp_fragment): the TCP function F function of unpacking retransmitted, for handling weight
When biography is unpacked the case where unloading Tag ID.
E.1prepare job (preparation): empty;
E.2 original re-transmission is called to unpack function F function;
Whether the next field for E.3 checking original skb is effective skb, if so, and the next skb do not record mark
Remember ID, then it will be in the Tag ID storage to next skb structural body of this skb.
8) F function (tcp_fragment): the TCP function of unpacking retransmitted.
In upper example, client layer application program records a 4 byte evil spirit numbers and 4 words on the head of hair data packet every time
Shackle mark ID can then export the corresponding client layer application of the retransmitted segment when detecting that linux kernel TCP retransmits certain data segment
The Tag ID of program data packet.May determine that client layer application program certain data packet by the Tag ID, (such as one asked
Ask) network high latency or time-out whether be because Network Abnormal caused by.Further, it avoids as far as possible with kprobe mechanism pair
Kernel hot spot function instrumentation, avoids carrying out overweight operation in hotspot path.Therefore, to goal systems
Interfere it is extremely low, and not will cause event loss.Event is not generated in hot spot, therefore, the result data amount finally generated is small, target
Cost all very littles of the storage of system, transmission cost and subsequent analysis, and kernel source code is not modified, machine can not restarted
In the case where come into force.
Embodiment of the method provided by the embodiment of the present application can be in mobile terminal, terminal, server or class
As execute in arithmetic unit.For running on the server, Fig. 4 is a kind of data transmission method of the embodiment of the present invention
The hardware block diagram of server.As shown in figure 4, server 10 may include one or more (only showing one in figure) processing
Device 102 (processing unit that processor 102 can include but is not limited to Micro-processor MCV or programmable logic device FPGA etc.),
Memory 104 for storing data and the transmission module 106 for communication function.Those of ordinary skill in the art can be with
Understand, structure shown in Fig. 4 is only to illustrate, and does not cause to limit to the structure of above-mentioned electronic device.For example, server 10 is also
It may include more perhaps less component or with the configuration different from shown in Fig. 4 than shown in Fig. 4.
Memory 104 can be used for storing the software program and module of application software, such as the data in the embodiment of the present invention
Corresponding program instruction/the module of transmission method, processor 102 by the software program that is stored in memory 104 of operation and
Module realizes above-mentioned data transmission method thereby executing various function application and data processing.Memory 104 may include
High speed random access memory, may also include nonvolatile memory, as one or more magnetic storage device, flash memory or its
His non-volatile solid state memory.In some instances, memory 104 can further comprise remotely setting relative to processor 102
The memory set, these remote memories can pass through network connection to terminal 10.The example of above-mentioned network include but
It is not limited to internet, intranet, local area network, mobile radio communication and combinations thereof.
Transmission module 106 is used to that data to be received or sent via a network.Above-mentioned network specific example may include
The wireless network that the communication providers of terminal 10 provide.In an example, transmission module 106 includes that a network is suitable
Orchestration (Network Interface Controller, NIC), can be connected by base station with other network equipments so as to
Internet is communicated.In an example, transmission module 106 can be radio frequency (Radio Frequency, RF) module,
For wirelessly being communicated with internet.
Referring to FIG. 5, data transmission method may include generation unit 501, transmission unit in Software Implementation
502, acquiring unit 503 and determination unit 504.Wherein:
Generation unit 501, for identification field to be added in the packet header that client layer is data to be transmitted packet, to generate transmission number
According to, wherein the identification field is for data to be transmitted packet described in unique identification;
Transmission unit 502, for transmitting the transmission data by protocol layer;
Acquiring unit 503, for obtaining the data being retransmitted, and the corresponding identifier word of data being retransmitted described in extraction
Section;
Determination unit 504 determines the data of client layer belonging to the data being retransmitted for the identification field according to extraction
Packet.
In one embodiment, generation unit 501 specifically can be used in the addition of the packet header of the data to be transmitted packet
Indicate information and identification field, wherein the instruction information is located at before the identification field, is used to indicate the instruction information
Subsequent field is identification field.
In one embodiment, transmission unit 502 specifically can be used for through the TCP hair between client layer and protocol layer
Detection function before sending function and TCP to send out data segment sends the transmission data.
In one embodiment, transmission unit 502 sends function and TCP by the TCP between client layer and protocol layer
Detection function before sending out data segment sends the transmission data, may include: to kidnap the user by modifying structured fingers
TCP between layer and protocol layer sends the detection function before function and TCP hair data segment, to send the transmission number
According to.
In one embodiment, acquiring unit 503 is specifically used for that entrance function re-transmission data can be retransmitted by TCP;
Successful re-transmission data are determined whether by TCP function of unpacking;In the case where determination has retransmitted data, the number being retransmitted is obtained
According to.
In one embodiment, entrance function is retransmitted by TCP and retransmits data, may include: to carry to send by skb
Data are retransmitted, wherein the identification field is also carried in the skb.
Data transmission method provided by the present application, data end equipment pass through in the packet header that client layer is data to be transmitted packet
Identification field is added and generates the mode for sending data, so that the identifier word wherein carried can be extracted for the data packet of re-transmission
Section, may thereby determine that out the data packet being retransmitted corresponds to which data packet of client layer transmission.It solves through the above way
It is existing when retransmitting, data are transmitted in the form of data flow, in this case it is not apparent which the data of re-transmission correspond to and answer
Which data packet issued with the either corresponding application program of program, certainly will thus will lead to the reason to delay or time-out
Analysis lead to the problem of obstacle, reached the skill for being simple and efficient the corresponding relationship for determining to retransmit data packet and raw data packets
Art effect, the reason of can effectively analyzing network delay.
Although this application provides the method operating procedure as described in embodiment or flow chart, based on conventional or noninvasive
The labour for the property made may include more or less operating procedure.The step of enumerating in embodiment sequence is only numerous steps
One of execution sequence mode, does not represent and unique executes sequence.It, can when device or client production in practice executes
To execute or parallel execute (such as at parallel processor or multithreading according to embodiment or method shown in the drawings sequence
The environment of reason).
The device or module that above-described embodiment illustrates can specifically realize by computer chip or entity, or by having
The product of certain function is realized.For convenience of description, it is divided into various modules when description apparatus above with function to describe respectively.
The function of each module can be realized in the same or multiple software and or hardware when implementing the application.It is of course also possible to
Realization the module for realizing certain function is combined by multiple submodule or subelement.
Method, apparatus or module described herein can realize that controller is pressed in a manner of computer readable program code
Any mode appropriate is realized, for example, controller can take such as microprocessor or processor and storage can be by (micro-)
The computer-readable medium of computer readable program code (such as software or firmware) that processor executes, logic gate, switch, specially
With integrated circuit (Application Specific Integrated Circuit, ASIC), programmable logic controller (PLC) and embedding
Enter the form of microcontroller, the example of controller includes but is not limited to following microcontroller: ARC 625D, Atmel AT91SAM,
Microchip PIC18F26K20 and Silicone Labs C8051F320, Memory Controller are also implemented as depositing
A part of the control logic of reservoir.It is also known in the art that in addition to real in a manner of pure computer readable program code
Other than existing controller, completely can by by method and step carry out programming in logic come so that controller with logic gate, switch, dedicated
The form of integrated circuit, programmable logic controller (PLC) and insertion microcontroller etc. realizes identical function.Therefore this controller
It is considered a kind of hardware component, and hardware can also be considered as to the device for realizing various functions that its inside includes
Structure in component.Or even, it can will be considered as the software either implementation method for realizing the device of various functions
Module can be the structure in hardware component again.
Part of module in herein described device can be in the general of computer executable instructions
Upper and lower described in the text, such as program module.Generally, program module includes executing particular task or realization specific abstract data class
The routine of type, programs, objects, component, data structure, class etc..The application can also be practiced in a distributed computing environment,
In these distributed computing environment, by executing task by the connected remote processing devices of communication network.In distribution
It calculates in environment, program module can be located in the local and remote computer storage media including storage equipment.
As seen through the above description of the embodiments, those skilled in the art can be understood that the application can
It is realized by the mode of software plus required hardware.Based on this understanding, the technical solution of the application is substantially in other words
The part that contributes to existing technology can be embodied in the form of software products, and can also pass through the implementation of Data Migration
It embodies in the process.The computer software product can store in storage medium, such as ROM/RAM, magnetic disk, CD, packet
Some instructions are included to use so that a computer equipment (can be personal computer, mobile terminal, server or network are set
It is standby etc.) execute method described in certain parts of each embodiment of the application or embodiment.
Each embodiment in this specification is described in a progressive manner, the same or similar portion between each embodiment
Dividing may refer to each other, and each embodiment focuses on the differences from other embodiments.The whole of the application or
Person part can be used in numerous general or special purpose computing system environments or configuration.Such as: personal computer, server calculate
Machine, handheld device or portable device, mobile communication terminal, multicomputer system, based on microprocessor are at laptop device
System, programmable electronic equipment, network PC, minicomputer, mainframe computer, the distribution including any of the above system or equipment
Formula calculates environment etc..
Although depicting the application by embodiment, it will be appreciated by the skilled addressee that the application there are many deformation and
Variation is without departing from spirit herein, it is desirable to which the attached claims include these deformations and change without departing from the application's
Spirit.
Claims (15)
1. a kind of data transmission method, which is characterized in that the described method includes:
Identification field is added in the packet header that client layer is data to be transmitted packet, to generate transmission data, wherein the identification field
For data to be transmitted packet described in unique identification;
The transmission data are transmitted by protocol layer;
Obtain the data being retransmitted, and the corresponding identification field of data being retransmitted described in extraction;
According to the identification field of extraction, the data packet of client layer belonging to the data being retransmitted is determined.
2. the method according to claim 1, wherein mark is added in the packet header that client layer is data to be transmitted packet
Field, to generate transmission data, comprising:
Instruction information and identification field is added in the packet header of the data to be transmitted packet, wherein the instruction information is located at described
Before identification field, being used to indicate the subsequent field of the instruction information is identification field.
3. the method according to claim 1, wherein transmitting the transmission data by protocol layer, comprising:
The transmission data are transmitted by Transmission Control Protocol;
Correspondingly, obtaining the data being retransmitted includes: the data for obtaining and being retransmitted under Transmission Control Protocol.
4. according to the method described in claim 3, it is characterized in that, transmitting the transmission data by Transmission Control Protocol, comprising:
Detection function before sending function and TCP hair data segment by the TCP between client layer and protocol layer sends the hair
Send data.
5. according to the method described in claim 4, it is characterized in that, sending function by the TCP between client layer and protocol layer
Detection function before sending out data segment with TCP sends the transmission data, comprising:
By modifying structured fingers, kidnaps the TCP between the client layer and protocol layer and send function and TCP hair data segment
Detection function before, to send the transmission data.
6. according to the method described in claim 3, it is characterized in that, obtaining the data being retransmitted under Transmission Control Protocol, comprising:
Entrance function, which is retransmitted, by TCP retransmits data;
Successful re-transmission data are determined whether by TCP function of unpacking;
In the case where determination has retransmitted data, the data being retransmitted are obtained.
7. according to the method described in claim 6, it is characterized in that, retransmitting entrance function by TCP retransmits data, comprising:
It carries transmission data by skb to be retransmitted, wherein also carry the identification field in the skb.
8. a kind of data end equipment, including processor and for the memory of storage processor executable instruction, the processing
Device realizes following steps when executing described instruction:
Identification field is added in the packet header that client layer is data to be transmitted packet, to generate transmission data, wherein the identification field
For data to be transmitted packet described in unique identification;
The transmission data are transmitted by protocol layer;
Obtain the data being retransmitted, and the corresponding identification field of data being retransmitted described in extraction;
According to the identification field of extraction, the data packet of client layer belonging to the data being retransmitted is determined.
9. equipment according to claim 8, which is characterized in that mark is added in the packet header that client layer is data to be transmitted packet
Field, to generate transmission data, comprising:
Instruction information and identification field is added in the packet header of the data to be transmitted packet, wherein the instruction information is located at described
Before identification field, being used to indicate the subsequent field of the instruction information is identification field.
10. equipment according to claim 8, which is characterized in that transmit the transmission data by protocol layer, comprising:
The transmission data are transmitted by Transmission Control Protocol;
Correspondingly, obtaining the data being retransmitted includes: the data for obtaining and being retransmitted under Transmission Control Protocol.
11. equipment according to claim 10, which is characterized in that transmit the transmission data by Transmission Control Protocol, comprising:
Detection function before sending function and TCP hair data segment by the TCP between client layer and protocol layer sends the hair
Send data.
12. equipment according to claim 11, which is characterized in that send letter by the TCP between client layer and protocol layer
Detection function before several and TCP hair data segment sends the transmission data, comprising:
By modifying structured fingers, kidnaps the TCP between the client layer and protocol layer and send function and TCP hair data segment
Detection function before, to send the transmission data.
13. equipment according to claim 9, which is characterized in that obtain the data being retransmitted under Transmission Control Protocol, comprising:
Entrance function, which is retransmitted, by TCP retransmits data;
Successful re-transmission data are determined whether by TCP function of unpacking;
In the case where determination has retransmitted data, the data being retransmitted are obtained.
14. equipment according to claim 13, which is characterized in that retransmit entrance function by TCP and retransmit data, comprising:
It carries transmission data by skb to be retransmitted, wherein also carry the identification field in the skb.
15. a kind of computer readable storage medium is stored thereon with computer instruction, described instruction, which is performed, realizes that right is wanted
The step of seeking any one of 1 to 7 the method.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711191694.1A CN109842465A (en) | 2017-11-24 | 2017-11-24 | Data transmission method, data end equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711191694.1A CN109842465A (en) | 2017-11-24 | 2017-11-24 | Data transmission method, data end equipment |
Publications (1)
Publication Number | Publication Date |
---|---|
CN109842465A true CN109842465A (en) | 2019-06-04 |
Family
ID=66876446
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201711191694.1A Pending CN109842465A (en) | 2017-11-24 | 2017-11-24 | Data transmission method, data end equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109842465A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112035831A (en) * | 2020-08-14 | 2020-12-04 | 深信服科技股份有限公司 | Data processing method, device, server and storage medium |
Citations (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1455523A (en) * | 2003-05-28 | 2003-11-12 | 王平 | Method and system of controlling network communication of automation based on blue-tooth technique |
CN1564548A (en) * | 2004-03-30 | 2005-01-12 | 中国科学院计算技术研究所 | Racket rank control method of applied layer protocal switching network gate |
CN102082773A (en) * | 2009-11-30 | 2011-06-01 | 北京广利核系统工程有限公司 | Communication method based on inter-column security communication network protocol of reactor protection system |
CN102546081A (en) * | 2010-12-21 | 2012-07-04 | 中兴通讯股份有限公司 | Packet loss detection method, system and media client |
CN102595199A (en) * | 2011-01-11 | 2012-07-18 | 中兴通讯股份有限公司 | Streaming media packet packaging and transmitting method, and streaming media processing device |
CN103036904A (en) * | 2012-12-27 | 2013-04-10 | 东方通信股份有限公司 | Method of data reliable transmission with user datagram protocol (UDP) in communication network |
CN103269260A (en) * | 2013-06-03 | 2013-08-28 | 腾讯科技(深圳)有限公司 | Data transmission method, data receiving terminal, data sending terminal and data transmission system |
CN104657555A (en) * | 2015-02-11 | 2015-05-27 | 北京麓柏科技有限公司 | TOE (TCP/IP Offload Engine) verification method based on UVM (Universal Verification Methodology) and TOE verification platform based on UVM |
CN105791054A (en) * | 2016-04-22 | 2016-07-20 | 西安交通大学 | Autonomous controllable and reliable multicast transmission method based on flow classification realization |
CN106034014A (en) * | 2015-03-19 | 2016-10-19 | 中兴通讯股份有限公司 | Method for requesting packet loss retransmission, receiving apparatus and sending apparatus |
CN106559337A (en) * | 2015-09-24 | 2017-04-05 | 中兴通讯股份有限公司 | Car networking information transferring method and relevant device |
WO2017078784A1 (en) * | 2015-11-05 | 2017-05-11 | Intel Corporation | Adaptive packet retransmission systems |
-
2017
- 2017-11-24 CN CN201711191694.1A patent/CN109842465A/en active Pending
Patent Citations (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1455523A (en) * | 2003-05-28 | 2003-11-12 | 王平 | Method and system of controlling network communication of automation based on blue-tooth technique |
CN1564548A (en) * | 2004-03-30 | 2005-01-12 | 中国科学院计算技术研究所 | Racket rank control method of applied layer protocal switching network gate |
CN102082773A (en) * | 2009-11-30 | 2011-06-01 | 北京广利核系统工程有限公司 | Communication method based on inter-column security communication network protocol of reactor protection system |
CN102546081A (en) * | 2010-12-21 | 2012-07-04 | 中兴通讯股份有限公司 | Packet loss detection method, system and media client |
CN102595199A (en) * | 2011-01-11 | 2012-07-18 | 中兴通讯股份有限公司 | Streaming media packet packaging and transmitting method, and streaming media processing device |
CN103036904A (en) * | 2012-12-27 | 2013-04-10 | 东方通信股份有限公司 | Method of data reliable transmission with user datagram protocol (UDP) in communication network |
CN103269260A (en) * | 2013-06-03 | 2013-08-28 | 腾讯科技(深圳)有限公司 | Data transmission method, data receiving terminal, data sending terminal and data transmission system |
CN104657555A (en) * | 2015-02-11 | 2015-05-27 | 北京麓柏科技有限公司 | TOE (TCP/IP Offload Engine) verification method based on UVM (Universal Verification Methodology) and TOE verification platform based on UVM |
CN106034014A (en) * | 2015-03-19 | 2016-10-19 | 中兴通讯股份有限公司 | Method for requesting packet loss retransmission, receiving apparatus and sending apparatus |
CN106559337A (en) * | 2015-09-24 | 2017-04-05 | 中兴通讯股份有限公司 | Car networking information transferring method and relevant device |
WO2017078784A1 (en) * | 2015-11-05 | 2017-05-11 | Intel Corporation | Adaptive packet retransmission systems |
CN105791054A (en) * | 2016-04-22 | 2016-07-20 | 西安交通大学 | Autonomous controllable and reliable multicast transmission method based on flow classification realization |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112035831A (en) * | 2020-08-14 | 2020-12-04 | 深信服科技股份有限公司 | Data processing method, device, server and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10764148B2 (en) | Methods, systems, and computer readable media for network traffic statistics collection | |
CN105939297B (en) | A kind of TCP message recombination method and device | |
Kheirkhah et al. | Multipath-TCP in ns-3 | |
US7171464B1 (en) | Method of tracing data traffic on a network | |
US9218266B2 (en) | Systems and methods for replication of test results in a network environment | |
WO2014121630A1 (en) | Method and device for transferring file | |
CN101217429A (en) | A determination method of the initiation relationship within TCP messages based on TCP timestamp options | |
CN108881425B (en) | Data packet processing method and system | |
CN107147655A (en) | A kind of network dual stack parallel process model and its processing method | |
CN104660384A (en) | Network remote monitoring method for open numerical control system | |
US20110035493A1 (en) | Apparatus and method for tracking requests in a multi threaded multi tier computerized envioronment | |
RU2019131451A (en) | COMMUNICATION METHOD | |
US10009151B2 (en) | Packet storage method, information processing apparatus, and non-transitory computer-readable storage medium | |
CN109842465A (en) | Data transmission method, data end equipment | |
EP3304864A1 (en) | Systems and methods for improved trivial file transfer protocol | |
CN108460044B (en) | Data processing method and device | |
US20180150313A1 (en) | Analysis method and analysis apparatus | |
US8332498B2 (en) | Synchronized relay messaging and coordinated network processing using SNMP | |
CN111352781B (en) | Message automatic comparison correctness checking method and device for retransmission component module level verification | |
CN104468569A (en) | Integrity detection method and device of distributed data | |
WO2017107083A1 (en) | Data sending method and receiving method, apparatus and system | |
CN110493081B (en) | Method, device, equipment and storage medium for determining network traffic of game client | |
US9992034B2 (en) | Component multicast protocol | |
CN113064869B (en) | Log processing method, device, transmitting end, receiving end equipment and storage medium | |
CN115118392B (en) | Method for determining D-SACK, processor and communication system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20190604 |