CN106936707A - Routing method and device - Google Patents
Routing method and device Download PDFInfo
- Publication number
- CN106936707A CN106936707A CN201511017810.9A CN201511017810A CN106936707A CN 106936707 A CN106936707 A CN 106936707A CN 201511017810 A CN201511017810 A CN 201511017810A CN 106936707 A CN106936707 A CN 106936707A
- Authority
- CN
- China
- Prior art keywords
- tcp
- packet
- udp
- proxy server
- http
- 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
- 238000000034 method Methods 0.000 title claims abstract description 23
- 239000011800 void material Substances 0.000 claims description 3
- 230000005540 biological transmission Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
Classifications
-
- 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
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L45/00—Routing or path finding of packets in data switching networks
- H04L45/14—Routing performance; Theoretical aspects
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
- Computer And Data Communications (AREA)
Abstract
The embodiment of the invention provides a routing method and a device, wherein the method comprises the following steps: receiving a data packet from an application program, and judging whether an upper layer Protocol corresponding to the data packet is TCP or UDP according to a Protocol in the data packet; if the data packet is UDP, sending the data packet to a UDP proxy server; if the data packet is the TCP, judging that the data packet contains an HTTP key field or a TCP key field; if the data packet contains the HTTP key field, the data packet is sent to an HTTP proxy server; and if the TCP key field is contained, the data packet is sent to a TCP proxy server. The embodiment of the invention selects to route the data packet to the proper proxy server according to the protocol type of the data packet, relieves the pressure of the proxy server and fully utilizes the resources of the proxy server.
Description
Technical field
The present embodiments relate to Internet technical field, more particularly to a kind of method for routing and device.
Background technology
Route refers to the process for being grouped the network range that end-to-end path is determined when from source to destination.
Route is operated in open system interconnection (Open System Interconnection, OSI) and refers to mould
The packet forwarding unit of type third layer --- Internet.Overwhelming majority route operation transmission control protocol
/ Internet Protocol (Transmission Control Protocol/Internet Protocol,
TCP/IP), traditional TCP/IP is generally divided into 4 layers:Application layer, transport layer, IP network layer,
Network interface layer.Each layer is simply to call network service that its next layer provided to complete
The demand of oneself.
VPN (Virtual Private Network, VPN) is used for example in Android system
When, described data traffic is all routed to same proxy server, increased the proxy server
Burden.
The content of the invention
The embodiment of the present invention provides a kind of method for routing and device, is used to solve traditional routing method by all
Data traffic is routed to same proxy server, increases the problem of proxy server burden.
The embodiment of the present invention provides a kind of method for routing, and methods described includes:
The packet from application program is received, the Protocol in the packet judges the number
It is TCP or UDP according to corresponding upper-layer protocol is wrapped;
If UDP, then the packet is sent to UDP proxy servers;
If TCP, then judge that the packet includes HTTP critical fielies or TCP critical fielies;
If comprising HTTP critical fielies, the packet is sent to http proxy server;
If comprising TCP critical fielies, the packet is sent to TCP agent server.
Correspondingly, the embodiment of the present invention also provides a kind of route device, including:
Receiver module, for receiving the packet from application program;
TCP/UDP parsing modules, the packet is judged for the Protocol in the packet
Corresponding upper-layer protocol is TCP or UDP;
UDP routing modules, if for UDP, then sending to UDP agency services the packet
Device;
TCP parsing modules, if for TCP, then judging in the packet comprising HTTP keywords
Section or TCP critical fielies;
HTTP routing modules, if for comprising HTTP critical fielies, by the packet send to
Http proxy server;
TCP routing modules, if for comprising TCP critical fielies, the packet being sent to TCP
Proxy server.
Method for routing provided in an embodiment of the present invention and device, the packet to receiving are judged on corresponding
Layer protocol be TCP or UDP (User Datagram Protocol, UDP), if
UDP, then send data packets to UDP proxy servers;If TCP, then continue to judge the packet
Comprising HTTP (Hyper Text Transfer Protocol, HTTP), critical field is still
TCP critical fielies, if comprising HTTP critical fielies, the packet is sent to HTTP Proxy clothes
Business device;If comprising TCP critical fielies, the packet is sent to TCP agent server.According to number
The packet is routed to appropriate proxy server according to the protocol type selection of bag, agency service is alleviated
The pressure of device, takes full advantage of the resource of proxy server.
Brief description of the drawings
Technical scheme in order to illustrate more clearly the embodiments of the present invention, below will be to needed for embodiment
The accompanying drawing to be used is briefly described, it should be apparent that, drawings in the following description are of the invention
Some embodiments, for those of ordinary skill in the art, on the premise of not paying creative work,
Other accompanying drawings can also be obtained according to these accompanying drawings.
The step of Fig. 1 is a kind of method for routing in the embodiment of the present invention one flow chart;
Fig. 2 is a kind of structural representation of the route device in the embodiment of the present invention two.
Specific embodiment
To make the purpose, technical scheme and advantage of the embodiment of the present invention clearer, below in conjunction with this hair
Accompanying drawing in bright embodiment, is clearly and completely described to the technical scheme in the embodiment of the present invention,
Obviously, described embodiment is a part of embodiment of the invention, rather than whole embodiments.It is based on
Embodiment in the present invention, those of ordinary skill in the art are obtained under the premise of creative work is not made
The every other embodiment for obtaining, belongs to the scope of protection of the invention.
Embodiment one
A kind of method for routing of the proposition of the embodiment of the present invention one is discussed in detail, methods described can apply to visitor
Family end, the client can include PC and mobile terminal.
Reference picture 1, flow chart the step of show a kind of method for routing in the embodiment of the present invention one.
Step 100, receives the packet from application program, according to the Protocol in the packet
Judge that the corresponding upper-layer protocol of the packet is TCP or UDP, if UDP, then perform step 102;
If TCP, then step 104 is performed.
If the embodiment of the present invention is applied to mobile terminal, such as in smart mobile phone, the application program is intelligence
The application program of the accessible internet installed in energy mobile phone.The packet of the application program is to apply journey
The packet that sequence sends to internet.
The packet from application program is received in the step 100, is specifically as follows:Receive by void
Intend the packet from application program of network interface transfer.Any packet from application program is all passed through
Cross virtual network interface transfer.
Protocol in the packet is the field in IP headers, and the mark in Protocol is represented
The corresponding upper-layer protocol of the packet.Protocol in the step 100 in the packet sentences
The corresponding upper-layer protocol of the packet that breaks is TCP or UDP, is specifically as follows:Parse the packet
In Protocol in mark correspond to TCP or UDP.
For example, be designated " 6 " in Protocol represent that the corresponding upper-layer protocol of the packet is TCP;
Be designated " 17 " in Protocol represent that the corresponding upper-layer protocol of the packet is UDP.
Step 102, the packet is sent to UDP proxy servers.
UDP proxy servers are exclusively used in the packet that UDP is supported in treatment, route a data packet to UDP
Proxy server.
Step 104, judges that the packet includes HTTP critical fielies or TCP critical fielies, if bag
Critical field containing HTTP, then perform step 106;If comprising TCP critical fielies, performing step 108.
The step 104 determines whether the corresponding upper-layer protocol of packet, if packet includes HTTP
Critical field, then can determine that the corresponding upper-layer protocol of packet is HTTP;If packet includes TCP
Critical field, then can determine that the corresponding upper-layer protocol of packet is TCP.Wherein, HTTP keywords
Section can be GET and POST etc..
Whether packet can also be judged comprising preset keyword section, if comprising sending data packets to
Default proxy server.If the preset keyword section socket critical fielies, then preset agency service
Device is socket proxy servers.
Step 106, the packet is sent to http proxy server.
Http proxy server is exclusively used in the packet that HTTP is supported in treatment, routes a data packet to mesh
Mark HTTP server.
Step 108, the packet is sent to TCP agent server.
TCP agent server is exclusively used in the packet that TCP is supported in treatment, routes a data packet to target
TCP server.
It should be noted that each proxy server in the embodiment of the present invention is different, it is mutually
Independent proxy server.Corresponding proxy server is routed a data packet to, the band of server is reduced
Wide and load, eventually reduces overall cost of operation.
In sum, the technical scheme in the embodiment of the present invention, the packet to receiving judges corresponding
Upper-layer protocol is TCP or UDP, if UDP, then sends data packets to UDP proxy servers;
If TCP, then continue to judge that the packet includes HTTP critical fielies or TCP critical fielies, if
Comprising HTTP critical fielies, then the packet is sent to http proxy server;If comprising TCP
Critical field, then send to TCP agent server the packet.Protocol type choosing according to packet
Select and the packet is routed to appropriate proxy server, alleviate the pressure of proxy server, fully profit
With the resource of proxy server.
Embodiment two
A kind of route device of the proposition of the embodiment of the present invention two is discussed in detail, described device can apply to visitor
Family end, the client can include PC and mobile terminal.
Reference picture 2, shows a kind of structural representation of the route device in the embodiment of the present invention two.
Described device can include receiver module, TCP/UDP parsing modules, UDP routing modules, TCP
Parsing module, HTTP routing modules and TCP routing modules.
The relation between the function of each module and each module is discussed in detail separately below.
Receiver module, for receiving the packet from application program.The receiver module is received by void
Intend the packet from application program of network interface transfer.
TCP/UDP parsing modules, the packet is judged for the Protocol in the packet
Corresponding upper-layer protocol is TCP or UDP.The TCP/UDP parsing modules are parsed in the packet
Protocol in mark correspond to TCP or UDP.
UDP routing modules, if for UDP, then sending to UDP agency services the packet
Device.
TCP parsing modules, if for TCP, then judging in the packet comprising HTTP keywords
Section or TCP critical fielies.The TCP parsing modules, if being additionally operable to TCP, judge the data
Whether comprising preset keyword section in bag.
HTTP routing modules, if for comprising HTTP critical fielies, by the packet send to
Http proxy server.
TCP routing modules, if for comprising TCP critical fielies, the packet being sent to TCP
Proxy server.
Described device also includes:Default routing module, if for comprising, by the packet send to
Default proxy server;Wherein, the preset keyword section is closed with the HTTP critical fielies and TCP
Key field is differed;The default proxy server and the UDP proxy servers, HTTP Proxy
Server and TCP agent server are differed.
The UDP proxy servers, http proxy server, TCP agent server and default agency
Server is separate proxy server.
In sum, the technical scheme in the embodiment of the present invention, the packet to receiving judges corresponding
Upper-layer protocol is TCP or UDP, if UDP, then sends data packets to UDP proxy servers;
If TCP, then continue to judge that the packet includes HTTP critical fielies or TCP critical fielies, if
Comprising HTTP critical fielies, then the packet is sent to http proxy server;If comprising TCP
Critical field, then send to TCP agent server the packet.Protocol type choosing according to packet
Select and the packet is routed to appropriate proxy server, alleviate the pressure of proxy server, fully profit
With the resource of proxy server.
Device embodiment described above is only schematical, wherein described illustrate as separating component
Unit can be or may not be it is physically separate, the part shown as unit can be or
Person may not be physical location, you can with positioned at a place, or can also be distributed to multiple networks
On unit.Some or all of module therein can be according to the actual needs selected to realize the present embodiment
The purpose of scheme.Those of ordinary skill in the art are not in the case where performing creative labour is paid, you can with
Understand and implement.
Through the above description of the embodiments, those skilled in the art can be understood that each reality
The mode of applying can add the mode of required general hardware platform to realize by software, naturally it is also possible to by hard
Part.Based on such understanding, the portion that above-mentioned technical proposal substantially contributes to prior art in other words
Dividing can be embodied in the form of software product, and the computer software product can be stored can in computer
Read in storage medium, such as ROM/RAM, magnetic disc, CD, including some instructions are used to so that one
Computer equipment (can be personal computer, server, or network equipment etc.) performs each implementation
Method described in some parts of example or embodiment.
Finally it should be noted that:The above embodiments are merely illustrative of the technical solutions of the present invention, rather than to it
Limitation;Although being described in detail to the present invention with reference to the foregoing embodiments, the ordinary skill of this area
Personnel should be understood:It can still modify to the technical scheme described in foregoing embodiments, or
Person carries out equivalent to which part technical characteristic;And these modifications or replacement, do not make corresponding skill
The essence of art scheme departs from the spirit and scope of various embodiments of the present invention technical scheme.
Claims (10)
1. a kind of method for routing, it is characterised in that methods described includes:
The packet from application program is received, the Protocol in the packet judges the number
It is TCP or UDP according to corresponding upper-layer protocol is wrapped;
If UDP, then the packet is sent to UDP proxy servers;
If TCP, then judge that the packet includes HTTP critical fielies or TCP critical fielies;
If comprising HTTP critical fielies, the packet is sent to http proxy server;
If comprising TCP critical fielies, the packet is sent to TCP agent server.
2. method according to claim 1, it is characterised in that the reception is from application program
Packet, including:
Receive by the packet from application program of virtual network interface transfer.
3. method according to claim 1, it is characterised in that described according in the packet
Protocol judges that the corresponding upper-layer protocol of the packet is TCP or UDP, including:
The mark parsed in the Protocol in the packet corresponds to TCP or UDP.
4. method according to claim 1, it is characterised in that if TCP, methods described is also wrapped
Include:
Whether judge in the packet comprising preset keyword section;
If comprising the packet is sent to default proxy server;
Wherein, preset keyword section and the HTTP critical fielies and TCP critical fielies not phase
Together;
The default proxy server and the UDP proxy servers, http proxy server and TCP
Proxy server is differed.
5. method according to claim 4, it is characterised in that the UDP proxy servers,
Http proxy server, TCP agent server and default proxy server are separate agency's clothes
Business device.
6. a kind of route device, it is characterised in that including:
Receiver module, for receiving the packet from application program;
TCP/UDP parsing modules, the packet is judged for the Protocol in the packet
Corresponding upper-layer protocol is TCP or UDP;
UDP routing modules, if for UDP, then sending to UDP agency services the packet
Device;
TCP parsing modules, if for TCP, then judging in the packet comprising HTTP keywords
Section or TCP critical fielies;
HTTP routing modules, if for comprising HTTP critical fielies, by the packet send to
Http proxy server;
TCP routing modules, if for comprising TCP critical fielies, the packet being sent to TCP
Proxy server.
7. device according to claim 6, it is characterised in that the receiver module is received by void
Intend the packet from application program of network interface transfer.
8. device according to claim 6, it is characterised in that the TCP/UDP parsing modules
The mark parsed in the Protocol in the packet corresponds to TCP or UDP.
9. device according to claim 6, it is characterised in that the TCP parsing modules, also
If for TCP, judging whether include preset keyword section in the packet;
Described device also includes:
Default routing module, if for comprising the packet is sent to default proxy server;
Wherein, preset keyword section and the HTTP critical fielies and TCP critical fielies not phase
Together;
The default proxy server and the UDP proxy servers, http proxy server and TCP
Proxy server is differed.
10. device according to claim 9, it is characterised in that the UDP proxy servers,
Http proxy server, TCP agent server and default proxy server are separate agency's clothes
Business device.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201511017810.9A CN106936707A (en) | 2015-12-29 | 2015-12-29 | Routing method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201511017810.9A CN106936707A (en) | 2015-12-29 | 2015-12-29 | Routing method and device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN106936707A true CN106936707A (en) | 2017-07-07 |
Family
ID=59442423
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201511017810.9A Pending CN106936707A (en) | 2015-12-29 | 2015-12-29 | Routing method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106936707A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108696522A (en) * | 2018-05-11 | 2018-10-23 | 北京奇虎科技有限公司 | Task processing method, calculate node, block catenary system in a kind of block chain |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101399843A (en) * | 2007-09-27 | 2009-04-01 | 中兴通讯股份有限公司 | Deepened filtering method for packet |
CN102215231A (en) * | 2011-06-03 | 2011-10-12 | 华为软件技术有限公司 | Data forwarding method and gateway |
CN102571928A (en) * | 2011-12-21 | 2012-07-11 | 深信服网络科技(深圳)有限公司 | Method and device for selecting application proxy according to application identification |
CN103916405A (en) * | 2014-04-25 | 2014-07-09 | 厦门享游网络科技有限公司 | Method for guiding flow of TCP/UDP of App on IOS |
CN104243338A (en) * | 2013-06-14 | 2014-12-24 | 华为技术有限公司 | Message processing method, device and system |
-
2015
- 2015-12-29 CN CN201511017810.9A patent/CN106936707A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101399843A (en) * | 2007-09-27 | 2009-04-01 | 中兴通讯股份有限公司 | Deepened filtering method for packet |
CN102215231A (en) * | 2011-06-03 | 2011-10-12 | 华为软件技术有限公司 | Data forwarding method and gateway |
CN102571928A (en) * | 2011-12-21 | 2012-07-11 | 深信服网络科技(深圳)有限公司 | Method and device for selecting application proxy according to application identification |
CN104243338A (en) * | 2013-06-14 | 2014-12-24 | 华为技术有限公司 | Message processing method, device and system |
CN103916405A (en) * | 2014-04-25 | 2014-07-09 | 厦门享游网络科技有限公司 | Method for guiding flow of TCP/UDP of App on IOS |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108696522A (en) * | 2018-05-11 | 2018-10-23 | 北京奇虎科技有限公司 | Task processing method, calculate node, block catenary system in a kind of block chain |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11533649B2 (en) | Systems and methods for providing mobility aspects to applications in the cloud | |
EP3585015B1 (en) | Distributing service function chain data and service function instance data in a network | |
EP2510453B1 (en) | Website performance optimization and internet traffic processing | |
CN105122741B (en) | The business chain control method and device of Business Stream | |
US9992107B2 (en) | Processing data packets using a policy based network path | |
EP2750343B1 (en) | Dynamic network device processing using external components | |
CN100588175C (en) | Processing of communication flows in asymmetrically routed networks | |
CN108200165B (en) | Request Transmission system, method, apparatus and storage medium | |
EP2629466B1 (en) | Method, device and system for forwarding data in communication system | |
CN105247504A (en) | Virtual channel joining | |
CN108200158B (en) | Request Transmission system, method, apparatus and storage medium | |
AU2017316454B2 (en) | Methods and apparatus for providing traffic forwarder via dynamic overlay network | |
CN102754400A (en) | Method and system for implementing integrated voice over internet protocol in a cloud-based network | |
CN113691589A (en) | Message transmission method, device and system | |
CN107409047A (en) | Encrypt the coordinate packet delivering of session | |
CN107347085A (en) | A kind of information acquisition method and device | |
CN106936707A (en) | Routing method and device | |
CN104780591B (en) | Business interoperability implementation method, device, system and relevant device between terminal device | |
Caviglione et al. | A deep analysis on future web technologies and protocols over broadband GEO satellite networks | |
CA3158506A1 (en) | Satellite network acceleration and optimization | |
EP3466120B1 (en) | Systems and methods for providing mobility aspects to applications in the cloud | |
Luglio | The use of satellite in 5G networks: the technological step forward and perspectives due to the VIBeS project | |
CN113973086B (en) | Data transmission method, device and storage medium | |
CN113114565A (en) | Data message forwarding method and device, storage medium 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 | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20170707 |
|
RJ01 | Rejection of invention patent application after publication |