CN109639555A - Link layer message generation method, link layer message generating means and terminal device - Google Patents
Link layer message generation method, link layer message generating means and terminal device Download PDFInfo
- Publication number
- CN109639555A CN109639555A CN201811646854.1A CN201811646854A CN109639555A CN 109639555 A CN109639555 A CN 109639555A CN 201811646854 A CN201811646854 A CN 201811646854A CN 109639555 A CN109639555 A CN 109639555A
- Authority
- CN
- China
- Prior art keywords
- layer message
- network layer
- network
- link layer
- message
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/28—Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
- H04L12/46—Interconnection of networks
- H04L12/4633—Interconnection of networks using encapsulation techniques, e.g. tunneling
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L47/00—Traffic control in data switching networks
- H04L47/10—Flow control; Congestion control
- H04L47/24—Traffic characterised by specific attributes, e.g. priority or QoS
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L47/00—Traffic control in data switching networks
- H04L47/50—Queue scheduling
- H04L47/62—Queue scheduling characterised by scheduling criteria
- H04L47/625—Queue scheduling characterised by scheduling criteria for service slots or service orders
- H04L47/6275—Queue scheduling characterised by scheduling criteria for service slots or service orders based on priority
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computer And Data Communications (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
This application provides a kind of link layer message generation method, link layer message generating means and terminal devices, which comprises the data link layer in network communicating system executes: obtaining the variate-value of network layer message and design variables corresponding with the network layer message to be packaged;Whether the variate-value for judging the design variables is preset value;If the preset value, then the link layer message for being packaged with the network layer message is generated, wherein the priority of the link layer message is highest priority defined in communication protocol used in the link layer message.The application can be solved to a certain extent since trunking Message processing burden is larger, and causes terminal device that can not get the technical issues of server responds for a long time.
Description
Technical field
The application belongs to field of communication technology more particularly to a kind of link layer message generation method, link layer message generate
Device, terminal device and computer readable storage medium.
Background technique
Currently, terminal device online when, need by between trunking (such as wireless router) and server into
Row message transmissions, if the message communicated between server will via trunking need to handle more message
When, terminal device can be made since the Message processing burden of trunking is larger, and the sound of server can not be got for a long time
It answers, so that the network speed for causing user to surf the Internet is slower.
Summary of the invention
In view of this, this application provides a kind of link layer message generation method, link layer message generating means, terminals to set
Standby and computer readable storage medium can be solved to a certain extent since trunking Message processing burden is larger, and is led
The technical issues of causing terminal device that can not get server response for a long time.
The application first aspect provides a kind of link layer message generation method, comprising:
Data link layer in network communicating system executes:
Obtain the variate-value of network layer message and design variables corresponding with the network layer message to be packaged;
Whether the variate-value for judging above-mentioned design variables is preset value;
If above-mentioned preset value, then the link layer message for being packaged with above-mentioned network layer message is generated, wherein the link layer report
The priority of text is highest priority defined in communication protocol used in the link layer message.
The application second aspect provides a kind of link layer message generating means, comprising:
Receive message module executes for the data link layer in network communicating system: obtaining network layer to be packaged
The variate-value of message and design variables corresponding with the network layer message;
Variable judgment module executes for the data link layer in network communicating system: judging above-mentioned design variables
Whether variate-value is preset value;
Message generation module is executed for the data link layer in network communicating system: if above-mentioned preset value, then being given birth to
At the link layer message for being packaged with above-mentioned network layer message, wherein the priority of the link layer message is the link layer message institute
Highest priority defined in the communication protocol used.
The application third aspect provides a kind of terminal device, including memory, processor and is stored in above-mentioned storage
In device and the computer program that can run on above-mentioned processor, above-mentioned processor are realized as above when executing above-mentioned computer program
The step of stating first aspect method.
The application fourth aspect provides a kind of computer readable storage medium, above-mentioned computer-readable recording medium storage
There is computer program, realizes when above-mentioned computer program is executed by processor such as the step of above-mentioned first aspect method.
The 5th aspect of the application provides a kind of computer program product, and above-mentioned computer program product includes computer journey
Sequence is realized when above-mentioned computer program is executed by one or more processors such as the step of above-mentioned first aspect method.
Therefore this application provides a kind of link layer message generation methods, in the data link of network communicating system
Layer executes following steps: firstly, obtaining network layer message and design variables corresponding with the network layer message to be packaged
Variate-value;Secondly, whether the variate-value for judging the design variables is preset value, if the preset value, then generation is packaged with above-mentioned
The link layer message of network layer message, wherein the priority of the link layer message is communication protocols used in the link layer message
Highest priority defined in view.Therefore, in technical solution provided herein, it is higher that priority can be generated in terminal device
Link layer message so that the higher link layer message of priority is when being sent to trunking, trunking can be excellent
First the link layer message is handled.Therefore, technical solution provided herein can shorten terminal to a certain extent
Equipment gets the time of server response, thus it is possible to solve to bear due to trunking Message processing to a certain extent
It is larger, and cause terminal device that can not get the technical issues of server responds for a long time.In addition, skill provided herein
In art scheme, terminal device is to set the message priority of data link layer to highest priority, rather than by network communication
The priority of higher level message (such as network layer message or transport layer message etc.) is set as highest priority in system, this meeting
So that the higher level message of the received terminal device transmission of server institute for being responded to the terminal device is preferential
Grade be default priority, it is generally the case that in the configurator of many servers, when receive priority be it is non-default compared with
When high-rise message, the server can execute some orders that we are not intended to (such as not to send the higher level message end
End equipment is responded), therefore, in technical solution provided herein, the higher level message transmitted by the terminal device
Default priority when not being highest priority, due to the terminal device not by the priority of the higher level message by force from
Default priority is changed to highest priority, so, the server for receiving the higher level message will not be because of the higher level message
Priority be not default priority and execute some orders that we are not intended to.So technical side provided herein
Case is stronger to the compatibility of server.
Detailed description of the invention
It in order to more clearly explain the technical solutions in the embodiments of the present application, below will be to embodiment or description of the prior art
Needed in attached drawing be briefly described, it should be apparent that, the accompanying drawings in the following description is only some of the application
Embodiment for those of ordinary skill in the art without creative efforts, can also be attached according to these
Figure obtains other attached drawings.
Fig. 1 is a kind of implementation process schematic diagram for link layer message generation method that the embodiment of the present application one provides;
Fig. 2 is the implementation process schematic diagram for another link layer message generation method that the embodiment of the present application two provides;
Fig. 3 is a kind of structural schematic diagram for link layer message generating means that the embodiment of the present application three provides;
Fig. 4 is the structural schematic diagram for the terminal device that the embodiment of the present application four provides.
Specific embodiment
In being described below, for illustration and not for limitation, the tool of such as particular system structure, technology etc is proposed
Body details, so as to provide a thorough understanding of the present application embodiment.However, it will be clear to one skilled in the art that there is no these specific
The application also may be implemented in the other embodiments of details.In other situations, it omits to well-known system, device, electricity
The detailed description of road and method, so as not to obscure the description of the present application with unnecessary details.
Link layer message generation method provided by the embodiments of the present application is suitable for terminal device, and illustratively, which sets
It is standby to include but is not limited to: smart phone, palm PC, notebook, desktop PC, intelligent wearable device etc..
It should be appreciated that ought use in this specification and in the appended claims, term " includes " instruction is described special
Sign, entirety, step, operation, the presence of element and/or component, but be not precluded one or more of the other feature, entirety, step,
Operation, the presence or addition of element, component and/or its set.
It is also understood that mesh of the term used in this present specification merely for the sake of description specific embodiment
And be not intended to limit the application.As present specification and it is used in the attached claims, unless on
Other situations are hereafter clearly indicated, otherwise " one " of singular, "one" and "the" are intended to include plural form.
It will be further appreciated that the term "and/or" used in present specification and the appended claims is
Refer to any combination and all possible combinations of one or more of associated item listed, and including these combinations.
As used in this specification and in the appended claims, term " if " can be according to context quilt
Be construed to " when ... " or " once " or " in response to determination " or " in response to detecting ".Similarly, phrase " if it is determined that " or
" if detecting [described condition or event] " can be interpreted to mean according to context " once it is determined that " or " in response to true
It is fixed " or " once detecting [described condition or event] " or " in response to detecting [described condition or event] ".
In addition, term " first ", " second " etc. are only used for distinguishing description, and should not be understood as in the description of the present application
Indication or suggestion relative importance.
In order to illustrate technical solution described herein, the following is a description of specific embodiments.
Embodiment one
The link layer message generation method provided below the embodiment of the present application one is described, and please refers to attached drawing 1, this Shen
Please the link layer message generation method in embodiment one include step S101-S103, wherein step S101-S103 is to work as terminal
What equipment was executed in the corresponding code of operation data link layer.
In step s101, network layer message and design variables corresponding with the network layer message to be packaged are obtained
Variate-value;
In the embodiment of the present application, network layer message to be packaged can be corresponding with a design variables, by the network layer
Before message is packaged, terminal device obtains the network layer message to be packaged and the network layer report to be packaged with this first
The variate-value of the corresponding design variables of text, so that the terminal device can be generated according to the variate-value of the design variables
It is packaged with the link layer message of the network layer message.
Under normal conditions, network layer message to be packaged and with the associated some parameters of network layer message to be packaged
It is maintained in a sk_buff data structure, therefore, step S101 can be with specifically: obtains from sk_buff data structure
The variate-value of network layer message and above-mentioned design variables corresponding with the network layer message to be packaged.
In addition, in the embodiment of the present application, network layer message to be packaged that might not be all is all corresponding with above-mentioned pre-
If variable, therefore, it is above-mentioned " obtained from sk_buff data structure network layer message to be packaged and with the network layer report
The variate-value of the corresponding above-mentioned design variables of text ", may include steps of:
Step A, above-mentioned network layer message to be packaged is obtained from above-mentioned sk_buff data structure;
Step B, judge whether to preserve in above-mentioned sk_buff data structure corresponding with above-mentioned network layer message above-mentioned pre-
If variable;
If preserving above-mentioned default change corresponding with above-mentioned network layer message in step C, above-mentioned sk_buff data structure
Amount then obtains the variate-value of above-mentioned design variables corresponding with above-mentioned network layer message from the sk_buff data structure.
In step s 102, whether the variate-value for judging above-mentioned design variables is preset value;
In the variate-value for getting the corresponding above-mentioned design variables of above-mentioned network layer message to be packaged by step S101
Later, whether the variate-value for judging the design variables is preset value, if so, executing subsequent step S103.
In addition, if the network layer message to be packaged that step S101 is obtained is not corresponding with above-mentioned design variables, alternatively, if step
The judging result of rapid S102 is that the variate-value of the corresponding above-mentioned design variables of above-mentioned network layer message to be packaged is not above-mentioned pre-
If, can the network layer that is obtained come encapsulation step S101 of the mode as defined in communication protocol according to used in this communication when value
Message.
In step s 103, if above-mentioned preset value, then the link layer message for being packaged with above-mentioned network layer message is generated,
In, the priority of the link layer message is highest priority defined in communication protocol used in the link layer message;
If the judging result of above-mentioned steps S102 is affirmative, the link layer report for being packaged with above-mentioned network layer message is generated
Text, wherein the priority of the link layer message is highest priority defined in communication protocol used in the link layer message.
For example, if the field for being used to indicate the link layer message priority in the link layer message is made of 3 binary systems, the link layer
The regulation of communication protocol used in message represents the highest priority of the link layer message, then when 3 binary systems are 111
In step S103, a link layer message is generated, and 3 binary systems are 111 in the link layer message.
It can be seen that the higher link layer message of priority can be generated in terminal device in the embodiment of the present application one, from
And make the higher link layer message of priority when being sent to trunking, which can be preferentially to the link layer report
Text is handled.Therefore, the time that terminal device gets server response can be shortened to a certain extent, it can be certain
It is solved in degree since trunking Message processing burden is larger, and causes terminal device that can not get server for a long time and ring
The technical issues of answering.
In addition, in order to solve above-mentioned " since trunking Message processing is born larger, and to lead to terminal device for a long time
Server response can not be got " the technical issues of, terminal device can also change the network layer message or biography that it to be sent
The priority of defeated layer message.
Such as, it is generally the case that the head IP of network layer message includes one 8 TOS (Type of Service, clothes
Service type) field, high 3 of the TOS field are therefore priority field can be set using high 3 of the TOS field
The priority (the corresponding numerical value of 3 binary systems is bigger, and the priority of network layer message is higher) of network layer message, in addition, TOS
The lowest order of field is necessarily arranged to 0, remaining 4 respectively represent from a high position to low level: minimal time delay, maximum throughput, minimum
Expense and highest reliability.Therefore, terminal device can be set as 110 0100 with the TOS field of network layer message to be sent
The numerical value such as 0 (0Xc8) or 111 1,000 0 (0xf0) handle the speed of the network layer message to improve trunking, to make
The trunking priority processing network layer message is obtained, to solve since trunking Message processing burden is larger, and leads to end
End equipment can not get the technical issues of server response for a long time.In addition, the prior art has many methods TOS word is arranged
Section, for example, " iptables-t mangle-A OUTPUT-p udp-- can be instructed in the following firewall of terminal equipment configuration
Dport 53-j TOS--set-tos 0xc8 " sets the TOS field for the network layer message that destination port number is 53 to
0xc8。
Technical solution provided by the embodiment of the present application one, compared to by higher level message (such as network layer message or
Transport layer message etc.) priority be set as the technical solution of higher priority, have stronger server-compatible, it is specific former
Cause are as follows: be non-default higher level message when receiving priority in the configurator of many servers under normal conditions
When, the server can execute some orders that we are not intended to (such as not to send the higher level message terminal device into
Row response), therefore, in the technical solution provided by the embodiment of the present application one, the higher level message transmitted by the terminal device
Default priority when not being highest priority, due to the terminal device not by the priority of the higher level message by force from
Default priority is changed to higher priority, so, the server for receiving the higher level message will not be because of the higher level message
Priority be not default priority and execute some orders that we are not intended to.So the embodiment of the present application one is provided
Technical solution to server compatibility it is stronger.
Embodiment two
Another link layer message generation method provided below the embodiment of the present application two is described, and please refers to attached drawing
2, the link layer message generation method in the embodiment of the present application two includes step S201-S206, wherein step S201-S203 is
It is executed when terminal device is in the corresponding code of operational network layer, step S204-S206 is when terminal device is in operation data
It is executed when the corresponding code of link layer.
In step s 201, the destination port number of network layer message to be packaged is obtained;
Above-mentioned destination port number is used to indicate the recipient port of above-mentioned network layer message to be packaged.Under normal conditions,
It often all therefore can directly be obtained from the network layer message to be packaged comprising destination port number field in network layer message
The destination port number for the network layer message for taking this to be packaged.
In step S202, judge whether the destination port number of above-mentioned network layer message to be packaged is default port numbers;
In the embodiment of the present application, after getting the above-mentioned corresponding destination port number of network layer message to be packaged,
May determine that whether the destination port number is default port numbers, if above-mentioned default port numbers, then follow the steps S203.
It, then will be corresponding pre- with above-mentioned network layer message to be packaged if above-mentioned default port numbers in step S203
If the variate-value of variable is set as preset value;
It, will be corresponding above-mentioned pre- with above-mentioned network layer message to be packaged if the judging result of step S202 is affirmative
If the variate-value of variable is set as above-mentioned preset value, and executes subsequent step S204-S206.If the judging result of step S202 is
Negative, then can set above-mentioned design variables corresponding with above-mentioned network layer message to be packaged to except above-mentioned preset value it
Outer another numerical value, or above-mentioned network layer message to be packaged can be set and be not corresponding with above-mentioned design variables.
In step S204, obtain above-mentioned network layer message to be packaged and with above-mentioned network layer message pair to be packaged
The variate-value for the above-mentioned design variables answered;
In step S205, judge whether the variate-value of above-mentioned design variables is above-mentioned preset value;
In step S206, if above-mentioned preset value, then the link layer message for being packaged with above-mentioned network layer message is generated,
In, the priority of the link layer message is highest priority defined in communication protocol used in the link layer message;
Above-mentioned steps S204-S206 is executed in data link layer, the step S101- in executive mode and embodiment one
S103 is identical, and for details, reference can be made to the descriptions of embodiment one, and details are not described herein again.
Those skilled in the art can be seen that the embodiment of the present application second is that the link layer that will be sent to above-mentioned default port numbers
The priority of message is set as highest priority.Such as, it is generally the case that terminal device needs to take to DNS first in online
Business device sends the network layer message for inquiring IP address, and the destination port number of the network layer message is 53, it is assumed that the application
" default port numbers " in embodiment two are 53, then can will be sent to the link layer for being used to inquire IP address of dns server
The priority of message is set as highest priority, so that the link layer message can make this by trunking priority processing
Terminal device gets the IP address to be inquired more quickly.
Under normal conditions, in data link layer, terminal device is the target that can not get network layer message to be packaged
Port numbers, so the destination port number of the network layer message to be packaged must be obtained in network layer, and in the target port
When number for default port numbers, it is preset value that the corresponding design variables of network layer message to be packaged, which are arranged, so that in number
According to link layer, terminal device can be by inquiring the numerical value of the design variables, to determine whether to generate the chain of highest priority
Road floor message.
In addition, can use following steps D in the embodiment of the present application two to replace the step in the embodiment of the present application two
S201-S203, step D: set above-mentioned default for the variate-value of the corresponding above-mentioned design variables of first object network layer message
Value, wherein above-mentioned first object network layer message is the network layer message that destination port number is default port numbers.For example, it is assumed that
Above-mentioned design variables are mark, and above-mentioned preset value is 0x800000, then can come in the following firewall instruction X of terminal equipment configuration
Realize " setting 0x800000 for the corresponding mark value of network layer message that destination port number is 53 ", which instructs X are as follows:
iptables-t mangle-A OUTPUT-p udp--dport 53-j mark--set-mark 0x800000.It can benefit
Above-mentioned steps D is realized with firewall instruction X.
In addition, terminal device can also execute following steps E or step F in network layer in the embodiment of the present application two:
Step E: whether the source for judging network layer message to be packaged is default application program;If above-mentioned default application
Program then sets preset value for the variate-value of design variables corresponding with above-mentioned network layer message to be packaged.
Step F are as follows: set above-mentioned default for the variate-value of the corresponding above-mentioned design variables of the second target network-layer message
Value, wherein above-mentioned second target network-layer message is the network layer message that source is default application program.
It that is to say, terminal device is realized in the corresponding code of execution network layer: will be from default application program (ratio
Such as QQ) the corresponding design variables of network layer message be set as preset value so that the terminal device is by the network layer message pair
The priority for the link layer message answered is set as highest priority, to enable the trunking priority processing link layer report
Text allows users to the response for getting server more quickly about the application program.
The priority that the embodiment of the present application two provides a kind of link layer message for being sent to default port numbers is set as highest
The technical solution of priority, so that terminal device can faster get the sound for certain certain types of messages
It answers, if being 53 than above-mentioned default port numbers, then terminal device can get IP address to be inquired more quickly.In addition, this
Application embodiment two is the same as example 1, and can be solved to a certain extent since trunking Message processing burden is larger,
And the technical issues of causing terminal device that can not get server response for a long time, and it is stronger to the compatibility of server.
It should be understood that the size of the serial number of each step is not meant that the order of the execution order in above method embodiment, respectively
The execution sequence of process should be determined by its function and internal logic, and the implementation process without coping with the embodiment of the present application constitutes any
It limits.
Embodiment three
The embodiment of the present application three provides a kind of link layer message generating means, for ease of description, only shows and this Shen
Please relevant part, as shown in figure 3, the link layer message generating means 300 include:
Receive message module 301 executes for the data link layer in network communicating system: obtaining network to be packaged
The variate-value of layer message and design variables corresponding with the network layer message;
Variable judgment module 302 executes for the data link layer in network communicating system: judging above-mentioned design variables
Variate-value whether be preset value;
Message generation module 303 is executed for the data link layer in network communicating system: if above-mentioned preset value,
Then generate the link layer message for being packaged with above-mentioned network layer message, wherein the priority of the link layer message is the link layer report
Highest priority defined in communication protocol used in text.
Optionally, above-mentioned link layer message generating means 300 further include:
Port obtains module, executes for the network layer in network communicating system: obtaining above-mentioned network layer to be packaged
The destination port number of message;
Port judgment module executes for the network layer in network communicating system: judging above-mentioned network layer to be packaged
Whether the destination port number of message is default port numbers;
First variable setup module is executed for the network layer in network communicating system: if above-mentioned port judgment module
Judge above-mentioned network layer message to be packaged destination port number be it is described on set port numbers, then by with above-mentioned net to be packaged
The variate-value of the corresponding above-mentioned design variables of network layers message is set as above-mentioned preset value.
Optionally, above-mentioned link packet generating means 300 further include:
Second variable setup module is executed for the network layer in network communicating system: by first object network layer report
The variate-value of the corresponding above-mentioned design variables of text is set as above-mentioned preset value, wherein above-mentioned first object network layer message is mesh
Mark port numbers are the network layer message of default port numbers.
Optionally, above-mentioned link layer message generating means 300 further include:
Third variable setup module is executed for the network layer in network communicating system: by the second target network-layer report
The variate-value of the corresponding above-mentioned design variables of text is set as above-mentioned preset value, wherein above-mentioned second target network-layer message is next
Source is the network layer message of default application program.
Optionally, above-mentioned Receive message module 301, is specifically used for: the data link layer in network communicating system executes:
Above-mentioned network layer message to be packaged and corresponding with the network layer message above-mentioned default is obtained from sk_buff data structure
The variate-value of variable.
Optionally, above-mentioned Receive message module 301, comprising:
Receive message unit, for obtaining above-mentioned network layer message to be packaged from sk_buff data structure;
Variable judging unit, for judging whether preserve in above-mentioned sk_buff data structure and above-mentioned network layer message
Corresponding above-mentioned design variables;
Variable acquiring unit, if corresponding with above-mentioned network layer message for being preserved in above-mentioned sk_buff data structure
Above-mentioned design variables then obtain above-mentioned design variables corresponding with above-mentioned network layer message from above-mentioned sk_buff data structure
Variate-value.
It should be noted that the contents such as information exchange, implementation procedure between above-mentioned apparatus/unit, due to the application
Embodiment of the method is based on same design, concrete function and bring technical effect, for details, reference can be made to embodiment of the method part, this
Place repeats no more.
Example IV
Fig. 4 is the schematic diagram for the terminal device that the embodiment of the present application four provides.As shown in figure 4, the terminal of the embodiment is set
Standby 4 include: processor 40, memory 41 and are stored in the meter that can be run in above-mentioned memory 41 and on above-mentioned processor 40
Calculation machine program 42.Above-mentioned processor 40 realizes the step in above-mentioned each embodiment of the method when executing above-mentioned computer program 42,
Such as step S101 to S103 shown in FIG. 1.Alternatively, above-mentioned processor 40 realized when executing above-mentioned computer program 42 it is above-mentioned each
The function of each module/unit in Installation practice, such as the function of module 301 to 303 shown in Fig. 3.
Illustratively, above-mentioned computer program 42 can be divided into one or more module/units, said one or
Multiple module/units are stored in above-mentioned memory 41, and are executed by above-mentioned processor 40, to complete the application.Above-mentioned one
A or multiple module/units can be the series of computation machine program instruction section that can complete specific function, which is used for
Implementation procedure of the above-mentioned computer program 42 in above-mentioned terminal device 4 is described.For example, above-mentioned computer program 42 can be divided
It is cut into Receive message module, variable judgment module and message generation module, each module concrete function is as follows:
Data link layer in network communicating system executes:
Obtain the variate-value of network layer message and design variables corresponding with the network layer message to be packaged;
Whether the variate-value for judging above-mentioned design variables is preset value;
If above-mentioned preset value, then the link layer message for being packaged with above-mentioned network layer message is generated, wherein the link layer report
The priority of text is highest priority defined in communication protocol used in the link layer message.
Above-mentioned terminal device may include, but be not limited only to, processor 40, memory 41.Those skilled in the art can manage
Solution, Fig. 4 is only the example of terminal device 4, does not constitute the restriction to terminal device 4, may include more or more than illustrating
Few component perhaps combines certain components or different components, such as above-mentioned terminal device can also be set including input and output
Standby, network access equipment, bus etc..
Alleged processor 40 can be central processing unit (Central Processing Unit, CPU), can also be
Other general processors, digital signal processor (Digital Signal Processor, DSP), specific integrated circuit
(Application Specific Integrated Circuit, ASIC), field programmable gate array (Field-
Programmable Gate Array, FPGA) either other programmable logic device, discrete gate or transistor logic,
Discrete hardware components etc..General processor can be microprocessor or the processor is also possible to any conventional processor
Deng.
Above-mentioned memory 41 can be the internal storage unit of above-mentioned terminal device 4, such as the hard disk or interior of terminal device 4
It deposits.Above-mentioned memory 41 is also possible to the External memory equipment of above-mentioned terminal device 4, such as be equipped on above-mentioned terminal device 4
Plug-in type hard disk, intelligent memory card (Smart Media Card, SMC), secure digital (Secure Digital, SD) card dodge
Deposit card (Flash Card) etc..Further, above-mentioned memory 41 can also both include the storage inside list of above-mentioned terminal device 4
Member also includes External memory equipment.Above-mentioned memory 41 is for storing needed for above-mentioned computer program and above-mentioned terminal device
Other programs and data.Above-mentioned memory 41 can be also used for temporarily storing the data that has exported or will export.
It is apparent to those skilled in the art that for convenience of description and succinctly, only with above-mentioned each function
Can unit, module division progress for example, in practical application, can according to need and by above-mentioned function distribution by different
Functional unit, module are completed, i.e., the internal structure of above-mentioned apparatus is divided into different functional unit or module, more than completing
The all or part of function of description.Each functional unit in embodiment, module can integrate in one processing unit, can also
To be that each unit physically exists alone, can also be integrated in one unit with two or more units, it is above-mentioned integrated
Unit both can take the form of hardware realization, can also realize in the form of software functional units.In addition, each function list
Member, the specific name of module are also only for convenience of distinguishing each other, the protection scope being not intended to limit this application.Above system
The specific work process of middle unit, module, can refer to corresponding processes in the foregoing method embodiment, and details are not described herein.
In the above-described embodiments, it all emphasizes particularly on different fields to the description of each embodiment, is not described in detail or remembers in some embodiment
The part of load may refer to the associated description of other embodiments.
Those of ordinary skill in the art may be aware that list described in conjunction with the examples disclosed in the embodiments of the present disclosure
Member and algorithm steps can be realized with the combination of electronic hardware or computer software and electronic hardware.These functions are actually
It is implemented in hardware or software, the specific application and design constraint depending on technical solution.Professional technician
Each specific application can be used different methods to achieve the described function, but this realization is it is not considered that exceed
Scope of the present application.
In embodiment provided herein, it should be understood that disclosed device/terminal device and method, it can be with
It realizes by another way.For example, device described above/terminal device embodiment is only schematical, for example, on
The division of module or unit is stated, only a kind of logical function partition, there may be another division manner in actual implementation, such as
Multiple units or components can be combined or can be integrated into another system, or some features can be ignored or not executed.
Above-mentioned unit as illustrated by the separation member may or may not be physically separated, aobvious as unit
The component shown may or may not be physical unit, it can and it is in one place, or may be distributed over multiple
In network unit.It can select some or all of unit therein according to the actual needs to realize the mesh of this embodiment scheme
's.
It, can also be in addition, each functional unit in each embodiment of the application can integrate in one processing unit
It is that each unit physically exists alone, can also be integrated in one unit with two or more units.Above-mentioned integrated list
Member both can take the form of hardware realization, can also realize in the form of software functional units.
If above-mentioned integrated module/unit be realized in the form of SFU software functional unit and as independent product sale or
In use, can store in a computer readable storage medium.Based on this understanding, the application realizes above-mentioned implementation
All or part of the process in example method, can also instruct relevant hardware to complete, above-mentioned meter by computer program
Calculation machine program can be stored in a computer readable storage medium, the computer program when being executed by processor, it can be achieved that on
The step of stating each embodiment of the method.Wherein, above-mentioned computer program includes computer program code, above-mentioned computer program generation
Code can be source code form, object identification code form, executable file or certain intermediate forms etc..Above-mentioned computer-readable medium
It may include: any entity or device, recording medium, USB flash disk, mobile hard disk, magnetic that can carry above-mentioned computer program code
Dish, CD, computer storage, read-only memory (ROM, Read-Only Memory), random access memory (RAM,
Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium etc..It should be noted that above-mentioned
The content that computer-readable medium includes can carry out increasing appropriate according to the requirement made laws in jurisdiction with patent practice
Subtract, such as does not include electric carrier signal and electricity according to legislation and patent practice, computer-readable medium in certain jurisdictions
Believe signal.
Above above-described embodiment is only to illustrate the technical solution of the application, rather than its limitations;Although referring to aforementioned reality
Example is applied the application is described in detail, those skilled in the art should understand that: it still can be to aforementioned each
Technical solution documented by embodiment is modified or equivalent replacement of some of the technical features;And these are modified
Or replacement, the spirit and scope of each embodiment technical solution of the application that it does not separate the essence of the corresponding technical solution should all
Comprising within the scope of protection of this application.
Claims (10)
1. a kind of link layer message generation method characterized by comprising
Data link layer in network communicating system executes:
Obtain the variate-value of network layer message and design variables corresponding with the network layer message to be packaged;
Whether the variate-value for judging the design variables is preset value;
If the preset value, then the link layer message for being packaged with the network layer message is generated, wherein the link layer message
Priority be highest priority defined in communication protocol used in the link layer message.
2. link layer message generation method as described in claim 1, which is characterized in that the link layer message generation method is also
Include:
Network layer in network communicating system executes:
Obtain the destination port number of the network layer message to be packaged;
Whether the destination port number for judging the network layer message to be packaged is default port numbers;
If the default port numbers, then by the variate-value of the design variables corresponding with the network layer message to be packaged
It is set as the preset value.
3. link layer message generation method as described in claim 1, which is characterized in that the link packet generation method is also wrapped
It includes:
Network layer in network communicating system executes:
The preset value is set by the variate-value of the corresponding design variables of first object network layer message, wherein described
First object network layer message is the network layer message that destination port number is default port numbers.
4. link layer message generation method as described in claim 1, which is characterized in that the link layer message generation method is also
Include:
Network layer in network communicating system executes:
The preset value is set by the variate-value of the corresponding design variables of the second target network-layer message, wherein described
Second target network-layer message is the network layer message that source is default application program.
5. link layer message generation method according to any one of claims 1 to 4, which is characterized in that described to obtain wait seal
The variate-value of the network layer message of dress and design variables corresponding with the network layer message, comprising:
The network layer message to be packaged and institute corresponding with the network layer message are obtained from sk_buff data structure
State the variate-value of design variables.
6. link layer message generation method as claimed in claim 5, which is characterized in that described from sk_buff data structure
The variate-value of the network layer message to be packaged and the design variables corresponding with the network layer message is obtained, is wrapped
It includes:
The network layer message to be packaged is obtained from the sk_buff data structure;
Judge the design variables corresponding with the network layer message whether are preserved in the sk_buff data structure;
If preserving the design variables corresponding with the network layer message in the sk_buff data structure, from described
The variate-value of the design variables corresponding with the network layer message is obtained in sk_buff data structure.
7. a kind of link layer message generating means characterized by comprising
Receive message module executes for the data link layer in network communicating system: obtaining network layer message to be packaged
And the variate-value of design variables corresponding with the network layer message;
Variable judgment module executes for the data link layer in network communicating system: judging the variable of the design variables
Whether value is preset value;
Message generation module is executed for the data link layer in network communicating system: if the variable judgment module judges
The variate-value of the design variables is the preset value out, then generates the link layer message for being packaged with the network layer message,
In, the priority of the link layer message is highest priority defined in communication protocol used in the link layer message.
8. link layer message generating means as claimed in claim 7, which is characterized in that the link layer message generating means are also
Include:
Port obtains module, executes for the network layer in network communicating system: obtaining the network layer message to be packaged
Destination port number;
Port judgment module executes for the network layer in network communicating system: judging the network layer message to be packaged
Destination port number whether be default port numbers;
First variable setup module is executed for the network layer in network communicating system: if the port judgment module judges
Out the destination port number of the network layer message to be packaged be the default port numbers, then by with the network layer to be packaged
The variate-value of the corresponding design variables of message is set as the preset value.
9. a kind of terminal device, including memory, processor and storage are in the memory and can be on the processor
The computer program of operation, which is characterized in that the processor realizes such as claim 1 to 6 when executing the computer program
The step of any one the method.
10. a kind of computer readable storage medium, the computer-readable recording medium storage has computer program, and feature exists
In when the computer program is executed by processor the step of any one of such as claim 1 to 6 of realization the method.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811646854.1A CN109639555B (en) | 2018-12-29 | 2018-12-29 | Link layer message generation method, link layer message generation device and terminal equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811646854.1A CN109639555B (en) | 2018-12-29 | 2018-12-29 | Link layer message generation method, link layer message generation device and terminal equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109639555A true CN109639555A (en) | 2019-04-16 |
CN109639555B CN109639555B (en) | 2021-03-02 |
Family
ID=66054927
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811646854.1A Active CN109639555B (en) | 2018-12-29 | 2018-12-29 | Link layer message generation method, link layer message generation device and terminal equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109639555B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115334176A (en) * | 2022-07-27 | 2022-11-11 | 广州安凯微电子股份有限公司 | Data transmission method, data transmission device, computer equipment, storage medium and program product |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101132374A (en) * | 2006-10-09 | 2008-02-27 | 杭州华三通信技术有限公司 | Method and device for transmitting message |
CN101252534A (en) * | 2008-03-28 | 2008-08-27 | 清华大学 | Method for improving mobile self-organizing network communication capacity through link layer message combination |
CN101997871A (en) * | 2010-09-21 | 2011-03-30 | 电子科技大学 | Device for quickly capturing, filtering and forwarding data |
US20150229704A1 (en) * | 2014-02-11 | 2015-08-13 | Samsung Electronics Co., Ltd. | Apparatus and method for providing metadata with network traffic |
CN105981318A (en) * | 2014-12-10 | 2016-09-28 | Lg电子株式会社 | Broadcast signal transmission apparatus, broadcast signal receiving apparatus, broadcast signal transmission method, and broadcast signal receiving method |
-
2018
- 2018-12-29 CN CN201811646854.1A patent/CN109639555B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101132374A (en) * | 2006-10-09 | 2008-02-27 | 杭州华三通信技术有限公司 | Method and device for transmitting message |
CN101252534A (en) * | 2008-03-28 | 2008-08-27 | 清华大学 | Method for improving mobile self-organizing network communication capacity through link layer message combination |
CN101997871A (en) * | 2010-09-21 | 2011-03-30 | 电子科技大学 | Device for quickly capturing, filtering and forwarding data |
US20150229704A1 (en) * | 2014-02-11 | 2015-08-13 | Samsung Electronics Co., Ltd. | Apparatus and method for providing metadata with network traffic |
CN105981318A (en) * | 2014-12-10 | 2016-09-28 | Lg电子株式会社 | Broadcast signal transmission apparatus, broadcast signal receiving apparatus, broadcast signal transmission method, and broadcast signal receiving method |
Non-Patent Citations (1)
Title |
---|
杜英明: ""高速网络环境下基于零拷贝的报文捕获机制研究与实现"", 《中国优秀硕士学位论文全文数据库-信息科技辑》 * |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115334176A (en) * | 2022-07-27 | 2022-11-11 | 广州安凯微电子股份有限公司 | Data transmission method, data transmission device, computer equipment, storage medium and program product |
Also Published As
Publication number | Publication date |
---|---|
CN109639555B (en) | 2021-03-02 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN105159753B (en) | The method, apparatus and pooling of resources manager of accelerator virtualization | |
CN102790776B (en) | Heartbeat connection normalizing processing method, terminal, server and communication system | |
CN105721535A (en) | Parallel processing of service functions in service function chains | |
CN108880999A (en) | A kind of method, equipment and the system of business routing | |
US10536341B2 (en) | Fog-based service function chaining | |
US20140215492A1 (en) | Dynamic provisioning of message groups | |
CN104216761B (en) | It is a kind of that the method for sharing equipment is used in the device that can run two kinds of operating system | |
CN108021710A (en) | A kind of dynamic socket conversion method, device, terminal device and storage medium | |
CN109561124A (en) | A kind of method, system and the terminal device of file transmission | |
CN104937896A (en) | Method for processing address resolution protocol message, forwarder and controller | |
CN107968848B (en) | A kind of method, terminal device and storage medium obtaining IP address | |
CN104683428A (en) | Network service processing method and device | |
CN104618253A (en) | Dynamically changed transmission message processing method and device | |
CN102662778A (en) | Callback response method of inter-application communication on online application platform, application and online application platform | |
CN103946825A (en) | Network device selection | |
CN114125940A (en) | Data message sending method, data message processing method, data message sending device, data message processing device, data message sending equipment and data message | |
SE520287C2 (en) | Method of communication using WAP protocol | |
CN106059964B (en) | Message forwarding method and device | |
CN103501282A (en) | Network message sending control method, virtual switch and physical machine | |
CN109639555A (en) | Link layer message generation method, link layer message generating means and terminal device | |
CN113438169A (en) | Data scheduling method, electronic equipment and storage medium | |
CN106302432B (en) | A kind of communication device and control method based on car networking | |
CN104253702B (en) | A kind of terminal management method and system | |
CN113965628A (en) | Message scheduling method, server and storage medium | |
CN115065637B (en) | Method and device for transmitting computing power resource information and electronic equipment |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |