CN107743122A - A kind of data transmission method for uplink, data receiver method and data communication system - Google Patents
A kind of data transmission method for uplink, data receiver method and data communication system Download PDFInfo
- Publication number
- CN107743122A CN107743122A CN201710908693.8A CN201710908693A CN107743122A CN 107743122 A CN107743122 A CN 107743122A CN 201710908693 A CN201710908693 A CN 201710908693A CN 107743122 A CN107743122 A CN 107743122A
- Authority
- CN
- China
- Prior art keywords
- computing device
- data
- packets
- data processing
- protocol
- 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
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L63/00—Network architectures or network communication protocols for network security
- H04L63/02—Network architectures or network communication protocols for network security for separating internal from external traffic, e.g. firewalls
- H04L63/0227—Filtering policies
- H04L63/0236—Filtering by address, protocol, port number or service, e.g. IP-address or URL
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L1/00—Arrangements for detecting or preventing errors in the information received
- H04L1/0001—Systems modifying transmission characteristics according to link quality, e.g. power backoff
- H04L1/0006—Systems modifying transmission characteristics according to link quality, e.g. power backoff by adapting the transmission format
- H04L1/0007—Systems modifying transmission characteristics according to link quality, e.g. power backoff by adapting the transmission format by modifying the frame length
- H04L1/0008—Systems modifying transmission characteristics according to link quality, e.g. power backoff by adapting the transmission format by modifying the frame length by supplementing frame payload, e.g. with padding bits
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/06—Notations for structuring of protocol data, e.g. abstract syntax notation one [ASN.1]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/16—Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
- H04L69/161—Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields
- H04L69/162—Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields involving adaptations of sockets based mechanisms
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/22—Parsing or analysis of headers
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/30—Definitions, standards or architectural aspects of layered protocol stacks
- H04L69/32—Architecture of open systems interconnection [OSI] 7-layer type protocol stacks, e.g. the interfaces between the data link level and the physical level
- H04L69/322—Intralayer communication protocols among peer entities or protocol data unit [PDU] definitions
- H04L69/326—Intralayer communication protocols among peer entities or protocol data unit [PDU] definitions in the transport layer [OSI layer 4]
Abstract
The invention discloses a kind of data transmission method for uplink, data receiver method and data communication system, data receiver method is suitable to perform in the first computing device, and the first computing device is connected with the second computing device communication and is stored with data processing rule, and this method includes:Raw socket is created, setting socket option field, IP packets include packet header and data segment in a manner of specifying filling IP packets;Default protocol number and port numbers are obtained from data processing rule;The IP address of second computing device and protocol number are filled into the respective field in the packet header of IP packets;Fill corresponding with protocol number transport layer data bag in the data segment of the IP packets, transport layer data bag includes packet header and data segment, in the respective field in the packet header that port numbers are filled into transport layer data bag;Data to be sent are filled into the data segment of transport layer data bag, to generate corresponding IP packets;The IP packets are sent to the second computing device.
Description
Technical field
The present invention relates to computer network field, more particularly to a kind of data transmission method for uplink, data receiver method and data
Communication system.
Background technology
With the continuous development of Internet technology, increasing people begins through various terminal equipment to access interconnection
Net, the life convenient brought with the information needed for acquisition and enjoyment Internet service.And terminal device is carrying out network service
When, most of to be all built upon on the transport layer of ICP/IP protocol, communicating pair is communicated by IP address and port numbers,
Just because of this, most network security monitoring, network forensics, trace to the source be in accordance with communication in use IP address and port.Such as
Fruit can send and receive packet under transport layer, it is possible to without using port, so as to significantly increase the hidden of communication
Covering property.
In current data communication package, use to be most widely multiplexed port technology.Under this technology, it is not required to
A new port is opened, but is communicated using the port opened in system, program is receiving packet
When, whether it is the packet of oneself by some marker for judgment first, if so, just being handled, if it is not, just passing through loopback
Address 127.0.0.1 consigns to original process on that port.Although the technology is not influenceing former service using port is reused
In the case of realize communication, have certain disguise, but the technology still will use port to be communicated, then still can be with
Content of Communication is extracted by the packet for analyzing the port.Therefore, it is necessary to which a kind of new data communication package is above-mentioned to improve
Processing procedure.
The content of the invention
Therefore, the present invention provides a kind of technical scheme of data communication, to try hard to solve or at least alleviate exist above
The problem of.
According to an aspect of the present invention, there is provided a kind of data transmission method for uplink, suitable for being performed in the first computing device, the
One computing device is connected with the second computing device communication, and the first computing device is set in advance with being stored with the second computing device
Data processing rule, data processing rule include carrying out the rule of data processing, the party based on default protocol number and port numbers
Method comprises the following steps:First, raw socket is created, and socket option field is set to specify the side of filling IP packets
Formula, IP packets include packet header and data segment;Default protocol number and port numbers are obtained from data processing rule;By the second meter
In the respective field in the packet header that the IP address and protocol number of calculation equipment are filled into IP packets;In the data segment of the IP packets
Filling transport layer data bag corresponding with the protocol number, transport layer data bag include packet header and data segment, port numbers are filled into
In the respective field in the packet header of transport layer data bag;Data to be sent are filled into the data segment of transport layer data bag, with
Generate corresponding IP packets;The IP packets are sent to the second computing device.
Alternatively, in the data transmission method for uplink according to the present invention, default port numbers are the first computing device and second
The port numbers that computing device is generated based on the time, by identical randomization.
Alternatively, in the data transmission method for uplink according to the present invention, data processing rule also includes being based only upon default association
View number carries out the rule of data processing, and the protocol number is that the first computing device and the second computing device are set in advance, commonly uses association
Any value beyond the protocol number of view.
According to a further aspect of the invention, there is provided a kind of data receiver method, suitable for being performed in the second computing device,
Second computing device is connected with the first computing device communication, and the first computing device is preset with being stored with the second computing device
Data processing rule, data processing rule includes carrying out the rule of data processing based on default protocol number and port numbers, should
Method comprises the following steps:First, raw socket is created, and sets protocol suite field and protocol type field to be received to specify
The mode of IP packets;The packet header of each IP packets to receiving is analyzed, to obtain the protocol information wherein included;If
Protocol information is consistent with the default protocol number in data processing rule, then extracts corresponding IP packets according to protocol information
The transport layer data bag that data segment includes;The packet header of the transport layer data bag is analyzed, to obtain the end wherein included
Message ceases;If port information is consistent with the default port numbers in data processing rule, by port corresponding to the port information
The IP packets that received IP packets are sent as the first computing device.
Alternatively, in the data receiver method according to the present invention, default port numbers are the first computing device and second
The port numbers that computing device is generated based on the time, by identical randomization.
Alternatively, in the data receiver method according to the present invention, data processing rule also includes being based only upon default association
View number carries out the rule of data processing, and the protocol number is that the first computing device and the second computing device are set in advance, commonly uses association
Any value beyond the protocol number of view.
According to a further aspect of the invention, there is provided a kind of data communications method, suitable for being performed in data communication system,
Data communication system includes the first computing device and the second computing device, is stored in the first computing device and the second computing device
There is data processing rule set in advance, and enter row data communication according to data processing rule, data processing rule includes being based on
Default protocol number and port numbers carry out the rule of data processing, and this method comprises the following steps:First, the first computing device is created
Build raw socket, and set socket option field by specify filling IP packets in a manner of, IP packets include packet header and
Data segment;Default protocol number and port numbers are obtained from data processing rule, by the IP address and agreement of the second computing device
In the respective field in number packet header for being filled into IP packets;Filled in the data segment of the IP packets corresponding with the protocol number
Transport layer data bag, transport layer data bag include packet header and data segment, port numbers are filled into the packet header of transport layer data bag
In respective field;Data to be sent are filled into the data segment of transport layer data bag, to generate corresponding IP packets, to
Second computing device sends the IP packets;Second computing device creates raw socket, and sets protocol suite field and agreement
Type field is in a manner of specifying and receive IP packets;The packet header of each IP packets to receiving is analyzed, to obtain it
In the protocol information that includes, if protocol information is consistent with the default protocol number in data processing rule, according to protocol information
Extract the transport layer data bag that the data segment of corresponding IP packets includes;The packet header of the transport layer data bag is divided
Analysis,, will if port information is consistent with the default port numbers in data processing rule to obtain the port information wherein included
The IP packets that IP packets corresponding to the port information received by port are sent as the first computing device.
Alternatively, in the data communications method according to the present invention, default port numbers are the first computing device and second
The port numbers that computing device is generated based on the time, by identical randomization.
According to a further aspect of the invention, there is provided a kind of data sending device, suitable for residing in the first computing device,
First computing device is connected with the second computing device communication, and the first computing device is preset with being stored with the second computing device
Data processing rule, data processing rule includes carrying out the rule of data processing based on default protocol number and port numbers, should
Device includes the first creation module, acquisition module, the first filling module, the second filling module, generation module and sending module.Its
In, the first creation module is suitable to create raw socket, and sets socket option field to specify the side of filling IP packets
Formula, IP packets include packet header and data segment;Acquisition module is suitable to obtain default protocol number and end from data processing rule
Slogan;First fills the corresponding of packet header of the module suitable for the IP address of the second computing device and protocol number to be filled into IP packets
In field;Second filling module is suitable to fill transport layer data corresponding with the protocol number in the data segment of the IP packets
Bag, transport layer data bag include packet header and data segment, in the respective field in the packet header that port numbers are filled into transport layer data bag;
Generation module is suitable to be filled into data to be sent in the data segment of transport layer data bag, to generate corresponding IP packets;
Sending module is suitable to send the IP packets to the second computing device.
According to a further aspect of the invention, there is provided a kind of data sink, suitable for residing in the second computing device,
Second computing device is connected with the first computing device communication, and the first computing device is preset with being stored with the second computing device
Data processing rule, data processing rule includes carrying out the rule of data processing based on default protocol number and port numbers, should
Device includes the second creation module, the first analysis module, extraction module, the second analysis module and processing module.Wherein, the second wound
Model block to be suitable to create raw socket, and protocol suite field and protocol type field are set to specify the side of reception IP packets
Formula;The packet header that first analysis module is suitable to each IP packets to receiving is analyzed, and is believed with obtaining the agreement wherein included
Breath;Extraction module is suitable to when protocol information is consistent with the default protocol number in data processing rule, is carried according to protocol information
The transport layer data bag for taking the data segment of corresponding IP packets to include;Second analysis module is suitable to the transport layer data bag
Packet header analyzed, to obtain the port information that wherein includes;Processing module is suitable to work as port information and data processing rule
In default port numbers it is consistent when, using the IP packets received by port corresponding to the port information as first calculate set
The IP packets that preparation goes out.
According to a further aspect of the invention, there is provided a kind of data communication system, including the first computing device are also provided, the
The data sending device according to the present invention is populated with one computing device, and the second meter being connected with the first computing device communication
Equipment is calculated, the data sink according to the present invention is populated with the second computing device.
The technical scheme to be communicated according to the data of the present invention, when sending IP packets, the first computing device first passes through wound
Raw socket is built to specify the mode of filling IP packets, according to data processing rule set in advance come to sent number
According to being handled, using self-defined encapsulated data packet to generate IP packets, and the IP packets are sent to the second computing device,
And when receiving IP packets, the second computing device, which then first passes through, creates raw socket to specify the side of reception IP packets
Formula, each IP packets received are analyzed to obtain the protocol information and port information that wherein include, work as protocol information
When all meeting data processing rule with port information, assert IP packets corresponding to the port information received by port for the
The IP packets that one computing device is sent.In such scheme, data processing rule includes being based on default protocol number and port
Number carry out the rule of data processing, default port numbers be the first computing device and the second computing device based on the time, pass through phase
The port numbers of same randomization generation, have larger unpredictability, reduce the risk that data are detected and extract.
In addition, data processing rule also includes being based only upon the rule that default protocol number carries out data processing, the protocol number
For the first computing device and the second computing device is set in advance, any value beyond protocol number of common protocol, further
Simplify the generation of IP packets and analyzing and processing.The process that sends and receives for carrying out IP packets in Internet more than can
To know, protocol number and/or port numbers are actually to be considered as a filter identification, do not participate in the use in data communication really,
Do not use any port so that whole communication process is more hidden, added on certain procedures monitored data and
The difficulty that network is traced to the source, add the security of communication.
Brief description of the drawings
In order to realize above-mentioned and related purpose, some illustrative sides are described herein in conjunction with following description and accompanying drawing
Face, these aspects indicate the various modes that can put into practice principles disclosed herein, and all aspects and its equivalent aspect
It is intended to fall under in the range of theme claimed.Read following detailed description in conjunction with the accompanying drawings, the disclosure it is above-mentioned
And other purposes, feature and advantage will be apparent.Throughout the disclosure, identical reference generally refers to identical
Part or element.
Fig. 1 shows the schematic diagram of data communication system 100 according to an embodiment of the invention;
Fig. 2 shows the structured flowchart of computing device 200 according to an embodiment of the invention;
Fig. 3 shows the flow chart of data transmission method for uplink 300 according to an embodiment of the invention;
Fig. 4 shows the flow chart of data receiver method 400 according to an embodiment of the invention;
Fig. 5 shows the flow chart of data communications method 500 according to an embodiment of the invention;
Fig. 6 shows the schematic diagram of data sending device 610 according to an embodiment of the invention;And
Fig. 7 shows the schematic diagram of data sink 710 according to an embodiment of the invention.
Embodiment
The exemplary embodiment of the disclosure is more fully described below with reference to accompanying drawings.Although the disclosure is shown in accompanying drawing
Exemplary embodiment, it being understood, however, that may be realized in various forms the disclosure without should be by embodiments set forth here
Limited.On the contrary, these embodiments are provided to facilitate a more thoroughly understanding of the present invention, and can be by the scope of the present disclosure
Completely it is communicated to those skilled in the art.
Fig. 1 shows the schematic diagram of data communication system 100 according to an embodiment of the invention.It should be pointed out that in Fig. 1
Data communication system 100 be only exemplary, in specific practice situation, can there is difference in data communication system 100
The computing device of quantity, the present invention are not limited to the quantity of computing device included in data communication system 100.Such as Fig. 1
Shown, data communication system 100 includes the first computing device 600 and the second computing device 700.Wherein, the first computing device
600 communicate to connect with the second computing device 700, and are stored with the first computing device 600 and the second computing device 700 and set in advance
Fixed data processing rule, and enter row data communication according to the data processing rule, data processing rule is included based on default
Protocol number and port numbers carry out the rule of data processing.
Specifically, the first computing device 600 creates raw socket, and sets socket option field to specify filling
The mode of IP packets, IP packets include packet header and data segment, default protocol number and end are obtained from data processing rule
Slogan, in the respective field in the packet header that the IP address of the second computing device 700 and protocol number are filled into IP packets, in the IP
Transport layer data bag corresponding with the protocol number is filled in the data segment of packet, transport layer data bag includes packet header and data
Section, in the respective field in the packet header that port numbers are filled into transport layer data bag, data to be sent are filled into the transmission number of plies
According in the data segment of bag, to generate corresponding IP packets, the IP packets are sent to the second computing device 700.Second calculates
Equipment 700 creates raw socket, and sets protocol suite field and protocol type field in a manner of specifying and receive IP packets,
The packet header of each IP packets to receiving is analyzed, to obtain the protocol information wherein included, if protocol information and data
Default protocol number in processing rule is consistent, then is included according to the data segment of the corresponding IP packets of protocol information extraction
Transport layer data bag, the packet header of the transport layer data bag is analyzed, to obtain the port information wherein included, if port is believed
Breath is consistent with the default port numbers in data processing rule, then by the IP data received by port corresponding to the port information
Wrap the IP packets sent as the first computing device 600.
Fig. 2 is the structured flowchart of computing device 200 according to an embodiment of the invention.In basic configuration 202,
Computing device 200 typically comprises system storage 206 and one or more processor 204.Memory bus 208 can be used
In the communication between processor 204 and system storage 206.
Depending on desired configuration, processor 204 can be any kind of processing, include but is not limited to:Microprocessor
(μ P), microcontroller (μ C), digital information processor (DSP) or any combination of them.Processor 204 can be included such as
The cache of one or more rank of on-chip cache 210 and second level cache 212 etc, processor core
214 and register 216.The processor core 214 of example can include arithmetic and logical unit (ALU), floating-point unit (FPU),
Digital signal processing core (DSP core) or any combination of them.The Memory Controller 218 of example can be with processor
204 are used together, or in some implementations, Memory Controller 218 can be an interior section of processor 204.
Depending on desired configuration, system storage 206 can be any type of memory, include but is not limited to:Easily
The property lost memory (RAM), nonvolatile memory (ROM, flash memory etc.) or any combination of them.System stores
Device 206 can include operating system 220, one or more program 222 and routine data 224.In some embodiments,
Program 222 may be arranged to utilize the execute instruction of routine data 224 by one or more processors 204 on an operating system.
Computing device 200 can also include contributing to from various interface equipments (for example, output equipment 242, Peripheral Interface
244 and communication equipment 246) to basic configuration 202 via the communication of bus/interface controller 230 interface bus 240.Example
Output equipment 242 include graphics processing unit 248 and audio treatment unit 250.They can be configured as contributing to via
One or more A/V port 252 is communicated with the various external equipments of such as display or loudspeaker etc.Outside example
If interface 244 can include serial interface controller 254 and parallel interface controller 256, they can be configured as contributing to
Via one or more I/O port 258 and such as input equipment (for example, keyboard, mouse, pen, voice-input device, touch
Input equipment) or the external equipment of other peripheral hardwares (such as printer, scanner etc.) etc communicated.The communication of example is set
Standby 246 can include network controller 260, and it can be arranged to be easy to via one or more COM1 264 and one
The communication that other individual or multiple computing devices 262 pass through network communication link.
Network communication link can be an example of communication media.Communication media can be generally presented as in such as carrier wave
Or computer-readable instruction in the modulated data signal of other transmission mechanisms etc, data structure, program module, and can
With including any information delivery media." modulated data signal " can such signal, one in its data set or more
It is individual or it change can the mode of coding information in the signal carry out.As nonrestrictive example, communication media can be with
Include the wire medium of such as cable network or private line network etc, and it is such as sound, radio frequency (RF), microwave, infrared
(IR) the various wireless mediums or including other wireless mediums.Term computer-readable medium used herein can include depositing
Both storage media and communication media.
Computing device 200 can be implemented as server, such as file server, database server, application program service
Device and WEB server etc., a part for portable (or mobile) electronic equipment of small size, these electronic equipments can also be embodied as
Can be such as cell phone, personal digital assistant (PDA), personal media player device, wireless network browsing apparatus, individual
Helmet, application specific equipment or the mixing apparatus that any of the above function can be included.Computing device 200 can also be real
It is now to include desktop computer and the personal computer of notebook computer configuration.
In certain embodiments, computing device 200 can be implemented as according to the first computing device 600 of the invention, and by
It is configured to perform the data transmission method for uplink 300 according to the present invention, now program 222 includes the data sending device according to the present invention
610.Computing device 200 is also implemented as the second computing device 700 according to the present invention, and is configured as performing according to this hair
Bright data receiver method 400, now program 222 is including according to data sink 710 of the invention.Need what is illustrated herein
It is that the first computing device 600 can also receive the IP packets sent from the second computing device 700 as receiving terminal, and
Two computing devices 700 can also be used as transmitting terminal to generate IP packets and send it to the first computing device 600, and unlimited
Data transmission or reception processing can only be carried out by making the first computing device 600 and the second computing device 700.But for ease of describing,
To be transmitting terminal with the first computing device 600 in embodiments of the invention, the second computing device 700 be receiving terminal to carry out data
The explanation of communication process.
Fig. 3 shows the flow chart of data transmission method for uplink 300 according to an embodiment of the invention.Data transmission method for uplink
300 are suitable to perform in the first computing device 600.As shown in figure 3, method 300 starts from step S310.In step S310, the
One computing device 600 creates raw socket, and sets socket option field in a manner of specifying filling IP packets, IP numbers
According to including packet header and data segment.According to one embodiment of present invention, the raw socket raw of Internet is first created
Socket, and it is IP_HDRINCL to set socket option field, for filled by hand in a manner of specifying filling IP packets.
In the embodiment, the command statement for creating socket is as follows:
Sockfd=socket (PF_INET, SOCK_RAW, protocol)
Socket option field is set to indicate that the command statement in the packet header of filled by hand IP packets is as follows:
Int flag=1;
setsockopt(sockfd,IPPROTO_IP,IP_HDRINCL,&flag,sizeof(flag))
Then, into step S320, default protocol number and port numbers are obtained from data processing rule.Wherein, data
It is set in advance by the first computing device 600 and the second computing device 700 to handle rule.According to one of present invention implementation
Example, data processing rule are included being carried out the rule of data processing based on default protocol number and port numbers, assisted corresponding to protocol number
Discuss and correspond to udp protocol etc. for transport layer protocol, such as 6 corresponding Transmission Control Protocol of protocol number, protocol number 17, the first computing device 600 can
To be made an appointment the transport layer protocol to be used with the second computing device 700, using the protocol number of the transport layer protocol as pre-
If protocol number.For port numbers, the mode of agreement, such as the first computing device 600 and the second meter can be equally taken
It is to generally acknowledge the port numbers of any one port beyond port to calculate equipment 700 to arrange port numbers before communicating, such as 7777.Wherein,
Generally acknowledged port refers to port numbers for 0~1023 port in the range of this.
In order to further improve the randomness in port numbers setting, in this embodiment, default port numbers are first
The port numbers that the computing device 700 of computing device 600 and second is generated based on the time, by identical randomization.First meter
Calculate the computing device 700 of equipment 600 and second and first arrange a randomization rule based on time generation port numbers, made with 24 hours
Exemplified by, 0 point~1 corresponding ports 2100,1 point~2 corresponding ports 2200,2 points~3 corresponding ports 2300, by that analogy,
22 points~23 corresponding ports 4300,23 points~24 points (0 point) corresponding ports 4400.Table 1 shows one according to the present invention
Time and the example of port numbers corresponding relation in the randomization of embodiment, it is specific as follows shown:
Time | Default port numbers |
0 point~1 point | 2100 |
1 point~2 points | 2200 |
2 points~3 points | 2300 |
… | … |
22 points~23 points | 4300 |
23 points~24 points (0 points) | 4400 |
Table 1
First computing device 600, can be with the before generation preparation is sent to the IP packets of the second computing device 700
One time point of two computing devices, 700 arbitary convention, or using current time as agreement time point, such as 2 points 13 minutes, by
It fall into the time point in 2 points~3 points this times, therefore the first computing device 600 and the second computing device 700 are default
Port numbers are 2300.So far, it is respectively 17 and 2300 that default protocol number and port numbers are got from data processing rule.
In step S330, the IP address of the second computing device 700 and protocol number are filled into the packet header of IP packets
In respective field.According to one embodiment of present invention, the IP address of the second computing device 700 is 218.56.112.12, agreement
Number be 17,218.56.112.12 is filled into the purpose IP address field in the packet header of IP packets, IP packets are filled into by 17
Packet header protocol fields.On other fields in the packet header of IP packets, carried out according to the Conventional filler mode of IP packets
Filling.
Next, performing step S340, transport layer corresponding with the protocol number is filled in the data segment of the IP packets
Packet, the transport layer data bag include packet header and data segment, port numbers are filled into transport layer data bag packet header it is corresponding
In field.According to one embodiment of present invention, because default protocol number is 17, show agreement that transport layer uses for UDP
Agreement, therefore transport layer data bag is UDP message bag.Fill the UDP message bag in the data segment of the IP packets, and UDP
Packet includes packet header and data segment, then port numbers 2300 are filled into the destination slogan word in the packet header of UDP message bag
Section, for other fields in the packet header of UDP message bag, is filled according to the Conventional filler mode of UDP message bag.
In step S350, data to be sent are filled into the data segment of transport layer data bag, it is corresponding to generate
IP packets.According to one embodiment of present invention, data to be sent are filled into the data segment of UDP message bag, with life
Deposit corresponding IP packets.
Finally, in step S360, the IP packets are sent to the second computing device 700.According to the reality of the present invention
Example is applied, based on the IP address 218.56.112.12 of the second computing device 700, can be found in data communication system 100
Two computing devices 700, and then the IP packets got from step S350 are sent to the second computing device 700.
In view of the optimal setting of data processing rule, according to still another embodiment of the invention, data processing rule is also
The rule of data processing is carried out including being based only upon default protocol number, the protocol number is that the first computing device 600 and second calculates
Equipment 700 is set in advance, any value beyond common protocol protocol number.In this embodiment, common protocol includes
ICMP agreements, IGMP agreements, Transmission Control Protocol, udp protocol, IGRP agreements and ospf protocol, its protocol number is 1 respectively, 2,6,17,
88 and 89, then default protocol number is any number beyond the protocol number of above-mentioned common protocol in data processing rule, such as
Default protocol number is 100.When data processing rule is to be based only upon default protocol number to carry out the rule of data processing, first
Computing device 600 specify filling IP packets mode be filled by hand after, by the IP address of the second computing device 700 and from
The default protocol number 100 got in data processing rule is filled into the respective field in the packet header of IP packets, i.e., by second
The IP address 218.56.112.12 of computing device 700 is filled into the purpose IP address field in the packet header of IP packets, by protocol number
100 are filled into the protocol fields in the packet header of IP packets.And other fields in the packet header of the IP packets, according to IP packets
Conventional filler mode is filled.Next, corresponding transport layer data bag is filled in the data segment of the IP packets,
And be filled into data to be sent in the data segment of the transport layer data bag, so as to generate corresponding IP packets.Finally, will
The IP packets send to the second computing device 700 and then complete data transmission.
For the second computing device 700, it can not only receive the IP packets sent from the first computing device 600, and
And it can also receive the IP packets in data communication system 100 transmitted by other computing devices, then the second computing device 700 is just
Need to screen out one or more IP packets that the first computing device 600 is sent from the multiple IP packets received.
Fig. 4 shows the flow chart of data receiver method 400 according to an embodiment of the invention.As shown in figure 4, method 400 begins
In step S410.In step S410, the second computing device 700 creates raw socket, and sets protocol suite field and agreement
Type field is in a manner of specifying and receive IP packets.According to one embodiment of present invention, the original set of Internet is first created
Word raw socket are met, and it is PF_PACKET, protocol type field ETH_P_IP to set protocol suite field, is received to specify
All packets being sent to more than the Internet of the machine.In this embodiment, the mode of above-mentioned specified reception IP packets
Command statement is as follows:
Fd=socket (PF_PACKET, SOCK_RAW, hton (ETH_P_IP))
Then, analyzed into step S420, the packet header of each IP packets to receiving, to obtain what is wherein included
Protocol information.According to one embodiment of present invention, the second computing device 700 have received 10 IP packets, be IP respectively
Packet A1, A2, A3 ..., A9 and A10, then first extract the packet header of this 10 IP packets and analyzed, from each bag
Its protocol information included is obtained in head, the protocol information is the content of protocol fields in packet header.Table 2 is shown according to this hair
The IP packets of bright one embodiment and the corresponding relation example of protocol information, it is specific as follows shown:
IP packets | A1 | A2 | A3 | A4 | A5 | A6 | A7 | A8 | A9 | A10 |
Protocol information | 6 | 17 | 6 | 17 | 6 | 6 | 17 | 6 | 6 | 6 |
Table 2
After protocol information corresponding to each IP packets is obtained, step S430 is performed, if protocol information is advised with data processing
Default protocol number in then is consistent, then the transport layer included according to the data segment of the corresponding IP packets of protocol information extraction
Packet.According to one embodiment of present invention, default protocol number is 17 in data processing rule, and protocol information is in table 2
17 IP packets are respectively A2, A4 and A7, understand that transport layer protocol is udp protocol by protocol information 17, are then believed according to agreement
Udp protocol corresponding to 17 is ceased to extract the UDP message bag that IP packets A2, A4 and A7 data segment include.
In step S440, the packet header of the transport layer data bag is analyzed, to obtain the port information wherein included.
According to one embodiment of present invention, the packet header of the UDP message bag included by IP packets A2, A4 and A7 is analyzed, from
Destination slogan field is obtained in packet header as port information.Table 3 shows IP data according to an embodiment of the invention
The corresponding relation example of bag and port information, it is specific as follows shown:
IP packets | A2 | A4 | A7 |
Port information | 80 | 45 | 2300 |
Table 3
Finally, step S450 is performed, should if port information is consistent with the default port numbers in data processing rule
The IP packets that IP packets received by port corresponding to port information are sent as the first computing device 600.Wherein, in advance
If port numbers generated for the first computing device 600 and the second computing device 700 based on the time, by identical randomization
Port numbers.It should be noted that protocol number and port numbers are preset in data processing rule, method 300 the step of
To be described in detail in S320, here is omitted.According to one embodiment of present invention, it is default in data processing rule
Port numbers be 2300, then as known from Table 3, the corresponding IP packets of the port information consistent with the port numbers are A7, by second
The IP packets that computing device 700 is sent in the IP packets A7 received by port 2300 as the first computing device 600.
According to still another embodiment of the invention, when the first computing device 600 and the second computing device 700 are set in advance
Data processing rule is that the second computing device 700 connects specified when being based only upon default protocol number to carry out the rule of data processing
The mode for receiving IP packets is after receiving packet more than all-network layer, and the packet header of each IP packets to receiving is carried out
Analysis, obtains its protocol information included from each packet header, and the protocol information is the content of protocol fields in packet header.If association
The default protocol number discussed in information and date processing rule is consistent, then using IP packets corresponding to the protocol information as first
The IP packets that computing device 600 is sent.
Fig. 5 shows the flow chart of data communications method 500 according to an embodiment of the invention.Method 500 starts from
Step S511.In step S511, the first computing device 600 creates raw socket, and sets socket option field to refer to
Surely the mode of IP packets is filled, IP packets include packet header and data segment.Then, in step S512, the first computing device
600 obtain default protocol number and port numbers from data processing rule, by the IP address and protocol number of the second computing device 700
It is filled into the respective field in the packet header of IP packets.Wherein, default port numbers are that the first computing device 600 and second calculates
The port numbers that equipment 700 is generated based on the time, by identical randomization.Next, performing step S513, first calculates
Equipment 600 fills transport layer data bag corresponding with the protocol number, transport layer data bag in the data segment of the IP packets
Packet header and data segment are included, in the respective field in the packet header that port numbers are filled into transport layer data bag.And then in step S514,
Data to be sent are filled into the data segment of transport layer data bag by the first computing device 600, to generate corresponding IP data
Bag.After IP packets are generated, into step S515, the first computing device 600 sends the IP data to the second computing device 700
Bag.
In step S521, the second computing device 700 creates raw socket, and sets protocol suite field and protocol type
Field is in a manner of specifying and receive IP packets.It should be noted that step S521 time sequencing is performed not by step
The order limitation of S511~515, i.e. step S521 can with performed in step S511~515 before and after or during perform.
In step S522, the packet header of each IP packet of second computing device 700 to receiving is analyzed, to obtain what is wherein included
Protocol information, if protocol information is consistent with the default protocol number in data processing rule, extracted according to protocol information corresponding
IP packets the transport layer data bag that includes of data segment.Finally, into step S523, to the bag of the transport layer data bag
Head is analyzed, to obtain the port information wherein included, if port information and the default port numbers in data processing rule
Unanimously, then the IP numbers sent the IP packets received by port corresponding to the port information as the first computing device 600
According to bag.
The detail of respective operations is performed on each step in method 500, step S511 can be found in the step in method 300
Rapid S310, step S512 can be found in step S320 and S330 in method 300, and step S513~515 can be respectively referring to method 300
In step S340~360, step S521 can be found in the step S410 in method 400, and step S522 can be found in method 400
Step S420 and S430, step S523 can be found in step S440 and S450 in method 400, do not repeated herein.Need
Bright, data processing rule can also include being based only upon the rule that default protocol number carries out data processing, and the protocol number is
Any value beyond 700 set in advance, common protocol protocol number of first computing device 600 and the second computing device.It is right
The concrete operations of data communications method 500 are realized based on this data processing rule, reference can be made to being related in method 300 and method 400
And the operating process of same data processing rule, here is omitted.
Fig. 6 shows the schematic diagram of data sending device 610 according to an embodiment of the invention.As shown in fig. 6, number
Reside in the first computing device 600, and communicated to connect with the second computing device 700, the first computing device according to dispensing device 610
600 and second are stored with data processing rule set in advance in computing device 700, and data processing rule is included based on default
Protocol number and port numbers carry out the rule of data processing, and data sending device 600 includes the first creation module 611, acquisition module
612nd, the first filling module 613, second fills module 614, generation module 615 and sending module 616.
First creation module 611 is suitable to create raw socket, and sets socket option field to specify filling IP numbers
According to the mode of bag, IP packets include packet header and data segment.The detail that first creation module 611 performs aforesaid operations can join
Step S310 in square method 300, is not repeated herein.
Acquisition module 612 is suitable to obtain default protocol number and port numbers from data processing rule.Wherein, default end
Slogan is the port that the first computing device 600 and the second computing device 700 are generated based on the time, by identical randomization
Number.The detail of the execution aforesaid operations of acquisition module 612 can be found in the step S320 in method 300, not repeated herein.
First filling module 613 is connected with the first creation module 611 and acquisition module 612 respectively, suitable for second is calculated
The IP address and protocol number of equipment 700 are filled into the respective field in the packet header of IP packets.First filling module 613 performs
The detail for stating operation can be found in step S330 in method 300, not repeated herein.
Second filling module 614 fills the phase of module 613 with the first creation module 611, acquisition module 612 and first respectively
Even, suitable for filling transport layer data bag corresponding with the protocol number, transport layer data bag in the data segment of the IP packets
Packet header and data segment are included, in the respective field in the packet header that port numbers are filled into transport layer data bag.Second filling module 614 is held
The detail of row aforesaid operations can be found in the step S340 in method 300, not repeated herein.
Generation module 615 is connected with the second filling module 614, suitable for data to be sent are filled into transport layer data bag
Data segment in, to generate corresponding IP packets.The detail that generation module 615 performs aforesaid operations can be found in method
Step S350 in 300, is not repeated herein.
Sending module 616 is connected with generation module 615, suitable for sending the IP packets to the second computing device 700.Send
The detail of the execution aforesaid operations of module 616 can be found in the step S360 in method 300, not repeated herein.
According to still another embodiment of the invention, data processing rule also includes being based only upon default protocol number progress data
The rule of processing, the protocol number are 700 set in advance, common protocol association of the first computing device 600 and the second computing device
Any value beyond view number.In this embodiment, each module included by data sending device 610 is no longer performed and preset
The related processing of port numbers, and only carry out the operation for being related to default protocol number.The tool of aforesaid operations is performed on each module
Body details, reference can be made in method 300 about based on this data processing rule realize data send operation, do not gone to live in the household of one's in-laws on getting married herein
State.
Fig. 7 shows the schematic diagram of data sink 710 according to an embodiment of the invention.As shown in fig. 7, number
Reside in the second computing device 700, and communicated to connect with the first computing device 600, the first computing device according to reception device 710
600 and second are stored with data processing rule set in advance in computing device 700, and data processing rule is included based on default
Protocol number and port numbers carry out the rule of data processing, and data sink 710 is analyzed including the second creation module 711, first
Module 712, extraction module 713, the second analysis module 714 and processing module 715.
Second creation module 711 is suitable to create raw socket, and sets protocol suite field and protocol type field to refer to
Surely the mode of IP packets is received.The detail of second creation module 711 execution aforesaid operations can be found in the step in method 400
Rapid S410, is not repeated herein.
First analysis module 712 is connected with the second creation module 711, and the packet header suitable for each IP packets to receiving is entered
Row analysis, to obtain the protocol information wherein included.First analysis module 712 performs the detail side of can be found in of aforesaid operations
Step S420 in method 400, is not repeated herein.
Extraction module 713 is connected with the first analysis module 712, suitable for when default in protocol information and data processing rule
Protocol number it is consistent when, the transport layer data bag that the data segment of corresponding IP packets includes is extracted according to protocol information.Carry
The detail of the execution aforesaid operations of modulus block 713 can be found in the step S430 in method 400, not repeated herein.
Second analysis module 714 is connected with extraction module 713, suitable for analyzing the packet header of the transport layer data bag,
To obtain the port information wherein included.The detail that second analysis module 714 performs aforesaid operations can be found in method 400
Step S440, do not repeated herein.
Processing module 715 is connected with the second analysis module 714, suitable for when default in port information and data processing rule
Port numbers it is consistent when, sent out the IP packets received by port corresponding to the port information as the first computing device 600
The IP packets gone out.Wherein, default port numbers are that the first computing device 600 is based on the time with the second computing device 700, passed through
The port numbers of identical randomization generation.The detail that processing module 715 performs aforesaid operations can be found in method 400
Step S450, do not repeated herein.
According to still another embodiment of the invention, data processing rule also includes being based only upon default protocol number progress data
The rule of processing, the protocol number are 700 set in advance, common protocol association of the first computing device 600 and the second computing device
Any value beyond view number.In this embodiment, each module included by data sink 710 is no longer performed and preset
The related processing of port numbers, and only carry out the operation for being related to default protocol number, i.e. the analysis module of extraction module 713 and second
714 can not perform corresponding operating, and processing module 715 is then further adapted for when protocol information and the default agreement in data processing rule
When number consistent, IP packets that IP packets corresponding to the protocol information are sent as the first computing device 600.On each mould
Block performs the detail of aforesaid operations, reference can be made to relevant in method 400 realize data receiver based on this data processing rule
Operation, do not repeated herein.
In existing data communication package, generally use multiplexed port technology is realized logical in the case where not influenceing former service
Letter, but the technology still will use port could be communicated, so as to by analyze the packet of the port extract it is logical
Believe content, it is disguised inadequate.The technical scheme of data communication according to embodiments of the present invention, when sending IP packets, first
Computing device, which first passes through, creates raw socket to specify the mode of filling IP packets, is advised according to data processing set in advance
Then handled to sent data, IP packets are generated using self-defined encapsulated data packet, and calculate and set to second
Preparation gives the IP packets, and when receiving IP packets, the second computing device, which then first passes through, creates raw socket to specify
The mode of IP packets is received, each IP packets received are analyzed to obtain the protocol information wherein included and port
Information, when protocol information and port information all meet data processing rule, assert that port corresponding to the port information is received
To IP packets be the IP packets that send of the first computing device.In such scheme, data processing rule is included based on pre-
If protocol number and port numbers carry out data processing rule, default port numbers are the first computing device and the second computing device
The port numbers generated based on the time, by identical randomization, there is larger unpredictability, reduce data and visited
The risk surveyed and extracted.
In addition, data processing rule also includes being based only upon the rule that default protocol number carries out data processing, the protocol number
For the first computing device and the second computing device is set in advance, any value beyond protocol number of common protocol, further
Simplify the generation of IP packets and analyzing and processing.The process that sends and receives for carrying out IP packets in Internet more than can
To know, protocol number and/or port numbers are actually to be considered as a filter identification, do not participate in the use in data communication really,
Do not use any port so that whole communication process is more hidden, added on certain procedures monitored data and
The difficulty that network is traced to the source, add the security of communication.
C8. the method as described in C7, when the default port numbers are that the first computing device and the second computing device are based on
Between, the port numbers that are generated by identical randomization.
D10. the device as described in D9, when the default port numbers are that the first computing device and the second computing device are based on
Between, the port numbers that are generated by identical randomization.
D11. the device as described in D9 or 10, the data processing rule also enter line number including being based only upon default protocol number
According to the rule of processing, the protocol number is the first computing device and the second computing device is set in advance, protocol number of common protocol
Any value in addition.
E13. the device as described in E12, the default port numbers are that the first computing device is based on the second computing device
Time, the port numbers generated by identical randomization.
E14. the device as described in E12 or 13, the data processing rule also include being based only upon default protocol number progress
The rule of data processing, the protocol number is the first computing device and the second computing device is set in advance, agreement of common protocol
Any value beyond number.
In the specification that this place provides, numerous specific details are set forth.It is to be appreciated, however, that the implementation of the present invention
Example can be put into practice in the case of these no details.In some instances, known method, knot is not been shown in detail
Structure and technology, so as not to obscure the understanding of this description.
Similarly, it will be appreciated that in order to simplify the disclosure and help to understand one or more of each inventive aspect,
Above in the description to the exemplary embodiment of the present invention, each feature of the invention is grouped together into single implementation sometimes
In example, figure or descriptions thereof.However, the method for the disclosure should be construed to reflect following intention:I.e. required guarantor
The application claims of shield are than the feature more features that is expressly recited in each claim.More precisely, as following
As claims reflect, inventive aspect is all features less than single embodiment disclosed above.Therefore, abide by
Thus the claims for following embodiment are expressly incorporated in the embodiment, wherein each claim is in itself
Separate embodiments as the present invention.
Those skilled in the art should be understood the module or unit or group of the equipment in example disclosed herein
Between can be arranged in equipment as depicted in this embodiment, or alternatively can be positioned at and the equipment in the example
In different one or more equipment.Module in aforementioned exemplary can be combined as a module or be segmented into addition multiple
Submodule.
Those skilled in the art, which are appreciated that, to be carried out adaptively to the module in the equipment in embodiment
Change and they are arranged in one or more equipment different from the embodiment.Can be the module or list in embodiment
Member or group between be combined into one between module or unit or group, and can be divided into addition multiple submodule or subelement or
Between subgroup.In addition at least some in such feature and/or process or unit exclude each other, it can use any
Combination is disclosed to all features disclosed in this specification (including adjoint claim, summary and accompanying drawing) and so to appoint
Where all processes or unit of method or equipment are combined.Unless expressly stated otherwise, this specification (including adjoint power
Profit requires, summary and accompanying drawing) disclosed in each feature can be by providing the alternative features of identical, equivalent or similar purpose come generation
Replace.
In addition, it will be appreciated by those of skill in the art that although some embodiments described herein include other embodiments
In included some features rather than further feature, but the combination of the feature of different embodiments means in of the invention
Within the scope of and form different embodiments.For example, in the following claims, embodiment claimed is appointed
One of meaning mode can use in any combination.
In addition, be described as herein can be by the processor of computer system or by performing for some in the embodiment
The method or the combination of method element that other devices of the function are implemented.Therefore, have and be used to implement methods described or method
The processor of the necessary instruction of element forms the device for implementing this method or method element.In addition, device embodiment
Element described in this is the example of following device:The device is used to implement as in order to performed by implementing the element of the purpose of the invention
Function.
Various technologies described herein can combine hardware or software, or combinations thereof is realized together.So as to the present invention
Method and apparatus, or some aspects of the process and apparatus of the present invention or part can take embedded tangible media, such as soft
The form of program code (instructing) in disk, CD-ROM, hard disk drive or other any machine readable storage mediums,
Wherein when program is loaded into the machine of such as computer etc, and is performed by the machine, the machine becomes to put into practice this hair
Bright equipment.
In the case where program code performs on programmable computers, computing device generally comprises processor, processor
Readable storage medium (including volatibility and nonvolatile memory and/or memory element), at least one input unit, and extremely
A few output device.Wherein, memory is arranged to store program codes;Processor is arranged to according to the memory
Instruction in the described program code of middle storage, perform data transmission method for uplink, data receiver method and the data communication of the present invention
Method.
By way of example and not limitation, computer-readable medium includes computer-readable storage medium and communication media.Calculate
Machine computer-readable recording medium includes computer-readable storage medium and communication media.Computer-readable storage medium storage such as computer-readable instruction,
The information such as data structure, program module or other data.Communication media is typically modulated with carrier wave or other transmission mechanisms etc.
Data-signal processed passes to embody computer-readable instruction, data structure, program module or other data including any information
Pass medium.Any combination above is also included within the scope of computer-readable medium.
As used in this, unless specifically stated so, come using ordinal number " first ", " second ", " the 3rd " etc.
Description plain objects are merely representative of the different instances for being related to similar object, and are not intended to imply that the object being so described must
Must have the time it is upper, spatially, in terms of sequence or given order in any other manner.
Although describing the present invention according to the embodiment of limited quantity, above description, the art are benefited from
It is interior it is clear for the skilled person that in the scope of the present invention thus described, it can be envisaged that other embodiments.Additionally, it should be noted that
The language that is used in this specification primarily to readable and teaching purpose and select, rather than in order to explain or limit
Determine subject of the present invention and select.Therefore, in the case of without departing from the scope and spirit of the appended claims, for this
Many modifications and changes will be apparent from for the those of ordinary skill of technical field.For the scope of the present invention, to this
The done disclosure of invention is illustrative and not restrictive, and it is intended that the scope of the present invention be defined by the claims appended hereto.
Claims (10)
1. a kind of data transmission method for uplink, suitable for being performed in the first computing device, first computing device is calculated with second and set
It is standby to communicate to connect, data processing rule set in advance is stored with first computing device and the second computing device, it is described
Data processing rule includes carrying out the rule of data processing based on default protocol number and port numbers, and methods described includes:
Raw socket is created, and socket option field is set in a manner of specifying filling IP packets, the IP packets
Including packet header and data segment;
Default protocol number and port numbers are obtained from the data processing rule;
The IP address of second computing device and the protocol number are filled into the respective field in the packet header of the IP packets;
Transport layer data bag corresponding with the protocol number, the transport layer data bag are filled in the data segment of the IP packets
Packet header and data segment are included, in the respective field in the packet header that the port numbers are filled into the transport layer data bag;
Data to be sent are filled into the data segment of the transport layer data bag, to generate corresponding IP packets;
The IP packets are sent to second computing device.
2. the method as described in claim 1, the default port numbers are that the first computing device is based on the second computing device
Time, the port numbers generated by identical randomization.
3. method as claimed in claim 1 or 2, the data processing rule also enters line number including being based only upon default protocol number
According to the rule of processing, the protocol number is the first computing device and the second computing device is set in advance, protocol number of common protocol
Any value in addition.
4. a kind of data receiver method, suitable for being performed in the second computing device, second computing device is calculated with first and set
It is standby to communicate to connect, data processing rule set in advance is stored with first computing device and the second computing device, it is described
Data processing rule includes carrying out the rule of data processing based on default protocol number and port numbers, and methods described includes:
Raw socket is created, and protocol suite field and protocol type field are set in a manner of specifying and receive IP packets;
The packet header of each IP packets to receiving is analyzed, to obtain the protocol information wherein included;
If the protocol information is consistent with the default protocol number in data processing rule, phase is extracted according to the protocol information
The transport layer data bag that the data segment for the IP packets answered includes;
The packet header of the transport layer data bag is analyzed, to obtain the port information wherein included;
If the port information is consistent with the default port numbers in data processing rule, by port corresponding to the port information
The IP packets that received IP packets are sent as first computing device.
5. method as claimed in claim 4, the default port numbers are that the first computing device is based on the second computing device
Time, the port numbers generated by identical randomization.
6. the method as described in claim 4 or 5, the data processing rule also enters line number including being based only upon default protocol number
According to the rule of processing, the protocol number is the first computing device and the second computing device is set in advance, protocol number of common protocol
Any value in addition.
7. a kind of data communications method, suitable for being performed in data communication system, the data communication system includes the first meter
Equipment and the second computing device are calculated, data processing set in advance is stored with first computing device and the second computing device
Rule, and enter row data communication according to the data processing rule, the data processing rule includes being based on default protocol number
The rule of data processing is carried out with port numbers, methods described includes:
First computing device creates raw socket, and sets socket option field in a manner of specifying filling IP packets,
The IP packets include packet header and data segment;
Default protocol number and port numbers are obtained from the data processing rule, by the IP address of the second computing device and described
Protocol number is filled into the respective field in the packet header of the IP packets;
Transport layer data bag corresponding with the protocol number, the transport layer data bag are filled in the data segment of the IP packets
Packet header and data segment are included, in the respective field in the packet header that the port numbers are filled into the transport layer data bag;
Data to be sent are filled into the data segment of the transport layer data bag, to generate corresponding IP packets, to institute
State the second computing device and send the IP packets;
Second computing device creates raw socket, and sets protocol suite field and protocol type field to receive IP data to specify
The mode of bag;
The packet header of each IP packets to receiving is analyzed, to obtain the protocol information wherein included, if the agreement is believed
Breath is consistent with the default protocol number in data processing rule, then the number of corresponding IP packets is extracted according to the protocol information
The transport layer data bag included according to section;
The packet header of the transport layer data bag is analyzed, to obtain the port information that wherein includes, if the port information with
Default port numbers in data processing rule are consistent, then make the IP packets received by port corresponding to the port information
The IP packets sent for first computing device.
8. a kind of data sending device, suitable for residing in the first computing device, first computing device is calculated with second and set
It is standby to communicate to connect, data processing rule set in advance is stored with first computing device and the second computing device, it is described
Data processing rule includes carrying out the rule of data processing based on default protocol number and port numbers, and described device includes:
First creation module, suitable for creating raw socket, and socket option field is set to specify filling IP packets
Mode, the IP packets include packet header and data segment;
Acquisition module, suitable for obtaining default protocol number and port numbers from the data processing rule;
First filling module, suitable for the IP address of the second computing device and the protocol number to be filled into the bag of the IP packets
In the respective field of head;
Second filling module, suitable for filling transport layer data bag corresponding with the protocol number in the data segment of the IP packets,
The transport layer data bag includes packet header and data segment, and the port numbers are filled into the phase in the packet header of the transport layer data bag
Answer in field;
Generation module, it is corresponding to generate suitable for data to be sent are filled into the data segment of the transport layer data bag
IP packets;
Sending module, suitable for sending the IP packets to second computing device.
9. a kind of data sink, suitable for residing in the second computing device, second computing device is calculated with first and set
It is standby to communicate to connect, data processing rule set in advance is stored with first computing device and the second computing device, it is described
Data processing rule includes carrying out the rule of data processing based on default protocol number and port numbers, and described device includes:
Second creation module, suitable for creating raw socket, and protocol suite field and protocol type field is set to be received to specify
The mode of IP packets;
First analysis module, the packet header suitable for each IP packets to receiving are analyzed, to obtain the agreement wherein included
Information;
Extraction module, suitable for when the protocol information is consistent with the default protocol number in data processing rule, according to described
Protocol information extracts the transport layer data bag that the data segment of corresponding IP packets includes;
Second analysis module, suitable for analyzing the packet header of the transport layer data bag, to obtain the port information wherein included;
Processing module, suitable for when the port information is consistent with the default port numbers in data processing rule, by the port
The IP packets that IP packets received by port corresponding to information are sent as first computing device.
10. a kind of data communication system, including:
First computing device, data sending device as claimed in claim 8 is populated with first computing device;And
The second computing device being connected with first computing device communication, being resident in second computing device will just like right
Seek the data sink described in 9.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710908693.8A CN107743122A (en) | 2017-09-29 | 2017-09-29 | A kind of data transmission method for uplink, data receiver method and data communication system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710908693.8A CN107743122A (en) | 2017-09-29 | 2017-09-29 | A kind of data transmission method for uplink, data receiver method and data communication system |
Publications (1)
Publication Number | Publication Date |
---|---|
CN107743122A true CN107743122A (en) | 2018-02-27 |
Family
ID=61236450
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710908693.8A Pending CN107743122A (en) | 2017-09-29 | 2017-09-29 | A kind of data transmission method for uplink, data receiver method and data communication system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107743122A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109151075A (en) * | 2018-10-30 | 2019-01-04 | 迈普通信技术股份有限公司 | Log processing method, device and electronic equipment |
CN113395241A (en) * | 2020-03-13 | 2021-09-14 | 西安诺瓦星云科技股份有限公司 | Data communication method, device and system |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6061349A (en) * | 1995-11-03 | 2000-05-09 | Cisco Technology, Inc. | System and method for implementing multiple IP addresses on multiple ports |
CN101388757A (en) * | 2008-09-05 | 2009-03-18 | 北京锐安科技有限公司 | Network security transmission method and system |
CN101540999A (en) * | 2008-03-19 | 2009-09-23 | 华为技术有限公司 | Method and equipment for establishing safe data tunnel |
CN101594301A (en) * | 2009-06-23 | 2009-12-02 | 杭州华三通信技术有限公司 | A kind of message processing method and device |
CN103716196A (en) * | 2012-09-28 | 2014-04-09 | 杭州华三通信技术有限公司 | Network device and detection method |
CN106657136A (en) * | 2017-01-13 | 2017-05-10 | 北京元心科技有限公司 | Terminal device, communication method of hidden channel and device thereof |
-
2017
- 2017-09-29 CN CN201710908693.8A patent/CN107743122A/en active Pending
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6061349A (en) * | 1995-11-03 | 2000-05-09 | Cisco Technology, Inc. | System and method for implementing multiple IP addresses on multiple ports |
CN101540999A (en) * | 2008-03-19 | 2009-09-23 | 华为技术有限公司 | Method and equipment for establishing safe data tunnel |
CN101388757A (en) * | 2008-09-05 | 2009-03-18 | 北京锐安科技有限公司 | Network security transmission method and system |
CN101594301A (en) * | 2009-06-23 | 2009-12-02 | 杭州华三通信技术有限公司 | A kind of message processing method and device |
CN103716196A (en) * | 2012-09-28 | 2014-04-09 | 杭州华三通信技术有限公司 | Network device and detection method |
CN106657136A (en) * | 2017-01-13 | 2017-05-10 | 北京元心科技有限公司 | Terminal device, communication method of hidden channel and device thereof |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109151075A (en) * | 2018-10-30 | 2019-01-04 | 迈普通信技术股份有限公司 | Log processing method, device and electronic equipment |
CN109151075B (en) * | 2018-10-30 | 2021-07-20 | 迈普通信技术股份有限公司 | Log processing method and device and electronic equipment |
CN113395241A (en) * | 2020-03-13 | 2021-09-14 | 西安诺瓦星云科技股份有限公司 | Data communication method, device and system |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN102682233B (en) | Methods and systems for scalable distribution of protected content | |
Samaila et al. | IoT-HarPSecA: a framework and roadmap for secure design and development of devices and applications in the IoT space | |
CN109189825A (en) | Lateral data cutting federation learning model building method, server and medium | |
CN109495870B (en) | Bluetooth test method and device | |
CN106156133B (en) | The method, apparatus and system that control table substance is submitted again | |
CN105138924B (en) | The method and apparatus for being not logged in preserving application operating information under state | |
CN107667510A (en) | The detection of Malware and malicious application | |
CN107579973A (en) | A kind of cyberspace detection method, device and computing device | |
CN105451222B (en) | A kind of terminal establishes the method, apparatus and system of connection | |
CN103034483A (en) | Web page script management method and system | |
CN105208028B (en) | Data transmission method and related device and equipment | |
CN105519028A (en) | Wireless system access control method and apparatus | |
CN107743122A (en) | A kind of data transmission method for uplink, data receiver method and data communication system | |
CN109905474A (en) | Data safety sharing method and device based on block chain | |
CN106534145A (en) | Application identification method and equipment | |
CN105119900A (en) | Information secure transmission method, network access method and corresponding terminals | |
CN105898396A (en) | Third party video pushing method and system | |
CN112291181A (en) | Data transmission method based on multiple network cards and related device | |
CN105354505A (en) | Image adaption method and electronic device | |
CN108574807A (en) | A kind of image treatment method and relevant device | |
CN105592030B (en) | IP packet processing method and processing device | |
CN104853447B (en) | A kind of data information processing method and device | |
CN106302519A (en) | The method of a kind of internet security management and terminal | |
CN108960894A (en) | A kind of advertisement real-time charging method, device, server and storage medium | |
CN108235074A (en) | A kind of method, server and computer equipment for sending, receiving key information |
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 | ||
CB02 | Change of applicant information |
Address after: Room 311501, Unit 1, Building 5, Courtyard 1, Futong East Street, Chaoyang District, Beijing 100102 Applicant after: Beijing Zhichuangyu Information Technology Co., Ltd. Address before: 100097 Jinwei Building 803, 55 Lanindichang South Road, Haidian District, Beijing Applicant before: Beijing Knows Chuangyu Information Technology Co.,Ltd. |
|
CB02 | Change of applicant information | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20180227 |
|
RJ01 | Rejection of invention patent application after publication |