CN109922105A - Realize that CDN returns the method and system that source request carries client ip - Google Patents

Realize that CDN returns the method and system that source request carries client ip Download PDF

Info

Publication number
CN109922105A
CN109922105A CN201711328802.5A CN201711328802A CN109922105A CN 109922105 A CN109922105 A CN 109922105A CN 201711328802 A CN201711328802 A CN 201711328802A CN 109922105 A CN109922105 A CN 109922105A
Authority
CN
China
Prior art keywords
client
data packet
source station
station server
source
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
Application number
CN201711328802.5A
Other languages
Chinese (zh)
Inventor
姚平
李强乙
朱恒
朱健荣
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Suning Commerce Group Co Ltd
Original Assignee
Suning Commerce Group Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Suning Commerce Group Co Ltd filed Critical Suning Commerce Group Co Ltd
Priority to CN201711328802.5A priority Critical patent/CN109922105A/en
Publication of CN109922105A publication Critical patent/CN109922105A/en
Pending legal-status Critical Current

Links

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The present invention discloses a kind of method and system realized CDN and return source request carrying client ip, can request in the CDN node for not disposing private spoon to the source of returning that the source station server of the website HTTPS sends carrying client ip.This method includes judging whether CDN node is stored with and access request corresponding private key according to the received client access request of CDN node;It initiates to the TCP connection of source station server to request, is inserted into client ip and port is sent to source station server into TCP syn data packet, and by TCP syn data packet after update;The client ip in TCP syn data packet and port are extracted, TCP connection request is received;Client access request content is forwarded to source station server by TCP connection using CDN node, so that the service logic feedback request content of source station server, obtains client ip and port.

Description

Realize that CDN returns the method and system that source request carries client ip
Technical field
Source request, which is returned, the present invention relates to technical field of the computer network more particularly to a kind of realization CDN carries client ip Method and system.
Background technique
CDN (Content Distribution Network) is content distributing network, is constructed in existing internet On a kind of advanced flow distribution network.The network saves the content storage in the server of source station to the CDN for being distributed in various regions On point, by intelligent network assignment of traffic control system, the access request of client, which is automatically pointed to health, be can be used and apart from this In the nearest CDN node private server in ground, to improve the response speed of client access and the availability of service, improve interconnection Online service quality.But if the client content to be accessed is not stored in CDN node, then CDN node will be from source station The content of server pull missing accesses, and with content needed for obtaining client, this process is known as Hui Yuan.
In order to improve the access experience of client, website would generally analyze the customer action of client according to client ip, To recommend the interested content of client automatically, therefore, can it be that realize point that CDN returns the client ip that whether carries in the request of source Analyse the key of the customer action of client.For the website HTTPS, the prior art usually adds client ip and request content It is close, and the private key by being deployed in CDN node decrypts it, when decrypted result is that need to service request content Hui Yuan to source station When device, at this point, source station server can just obtain client ip and request content, and by required content feed to client.But Due to safety concerns due to part website, private spoon will not be usually deployed in CDN node, will lead to CDN node in this way can not Client request is decrypted, and then source station server also can not just obtain the IP of client, while can not be based on client ip pair Customer action is analyzed.
Summary of the invention
Realize that CDN returns the method and system that source request carries client ip the purpose of the present invention is to provide a kind of, it can In the CDN node for not disposing private spoon, time source request for carrying client ip is sent to the source station server of the website HTTPS, is made The source station server for obtaining the website HTTPS can analyze customer action based on client ip.
To achieve the goals above, an aspect of of the present present invention, which provides, a kind of realizes that CDN returns sources request and carries client ips Method, applied to returning in the request of source for CDN node and the source station HTTPS server, which comprises
Step S1: according to CDN node receive client access request, judge the CDN node whether be stored with it is described Access request corresponding private key;If "None" executes S3;
Step S3: it initiates to the TCP connection of source station server to request, is inserted into client ip and port to TCP syn data Bao Zhong, and the updated TCP syn data packet is sent to source station server;
Step S4: client ip and port in the TCP syn data packet are extracted by source station server, return to syn Ack data packet receives the TCP connection request to CDN node;
Step S5: client access request content is forwarded to source station by the TCP connection using the CDN node and is taken Business device, so that the service logic of source station server feeds back the request content, and obtains client ip and port.
Specifically, the S3 includes:
Step S31:CDN node initiates handshake request to source station server, constructs TCP syn data packet;
Step S32: the first kernel function is called to select the head that client ip and port are inserted into the TCP syn data packet Item (option), to update the TCP syn data packet;
Step S33: the updated TCP syn data packet is sent to source station server.
Preferably, the S4 is specifically included:
Step S41: the second kernel function is called to verify the head option (option);
Step S42: extracting the client ip in the head option (option) and port after being verified, store to In sock structural body;
Step S43: pass through the TCP connection relationship of the sock structural body managed source site server and the CDN node.
Preferably, the method for calling the second kernel function to verify head option (option) in the step S41 includes:
Whether No. kind for judging the head option (option) simultaneously is TCPOPT_CIP, the head option (option) whether length is TCPOLEN_CIP, and when the judging result of the two is "Yes", then above-mentioned verification result passes through.
Preferably, the S5 is specifically included:
Step S51: the inet_getname_cip function in the server of accept function call source station is utilized;
The primary function inet_getname of step S52:inet_getname_cip function call kernel, using described primary Function inet_getname extracts client ip and port from the sock structural body, and client ip and port are back to Accept function.
Preferably, first kernel function is tcp_options_write function, and second kernel function is tcp_ V4_syn_recv_sock_cip function.
Preferably, the tcp_v4_syn_recv_sock_cip function is kernel syn_recv_ in the server of source station The Hook Function of the upper carry of sock.
Optionally, between step S1 and step S3, further includes: step S2: using the private key to the access request It decrypts, and client ip and port is inserted into the request content after decryption, then Hui Yuan to source station server, so that source station The service logic of server can obtain client ip and port, and feed back corresponding access request content.
Compared with prior art, provided by the invention to realize that CDN returns source request and carries the method for client ip with following The utility model has the advantages that
It is provided by the invention to realize that CDN returns source request and carries in the method for client ip, it is saved using the CDN for being deployed in various regions The access request of point real-time reception client, and according to whether being stored in CDN node and access request related private key, corresponding choosing Different time source modules is selected, specifically, then selecting private key to return source module when being stored with related private key in CDN node, works as CDN node The upper not stored time source module for thering is related private key then to select insertion client ip;Wherein, private key returns source module and refers to using related Private key decrypts access request, and will decrypt obtained client ip and request content Hui Yuan to source station server, by such Method realization obtains client ip while feeding back access request content, but this time source module is only applicable to safety and wants Ask the lower website HTTPS, that is, be only applicable to the website HTTPS related private key being deployed in CDN node.If for safety Property the higher website HTTPS, i.e., the website of related private key is not disposed in CDN node, then the Hui Yuan of insertion client ip can be used TCP syn data packet after update by insertion client ip and port configuration TCP syn data packet, and is sent to source by mode Site server extracts client ip and port in TCP syn data packet using source station server, and receives TCP connection request, TCP connection relationship is established, so that the service logic of source station server can not only feed back respective request, while client can be obtained IP and port are held, client real IP can also be obtained by being may be implemented in the CDN node for not disposing related private key in this way, in other words It says, such time source module not only ensure that the safety of website, while can also be divided based on client ip customer action Analysis.
As it can be seen that private can not disposed by returning the method that source request carries client ip using realization CDN provided by the invention In the CDN node of spoon, time source request for carrying client ip is sent to the source station server of the website HTTPS, so that the website HTTPS Source station server customer action can be analyzed based on client ip.
Another aspect of the present invention provides a kind of system realized CDN and return source request carrying client ip, is applied to above-mentioned Realization CDN described in technical solution returns source request and carries in the method for client ip, and the system comprises the source of returning request judgement is single Member, first time source processing unit, data packet updating unit, information extraction unit and second time source processing unit;
Described time source request judging unit is used to judge the CDN section according to the received client access request of CDN node Whether point is stored with and the access request corresponding private key;
First time source processing unit is used to when the judgment result is yes decrypt access request using the private key, and Client ip and port be inserted into the obtained request content of decryption to Hui Yuan is to source station server, so that the industry of source station server Business logic responds;
The data packet updating unit is for when the judgment result is No, being inserted into client ip and port to TCP syn number According in packet, and the updated TCP syn data packet is sent to source station server;
The information extraction unit is for extracting and storing the client ip in the TCP syn data packet and port;
Second time source processing unit feeds back corresponding access for receiving client ip, port and request content Request content.
Preferably, the data packet updating unit includes:
Handshake request module, for sending handshake request to source station server;
Data packet update module, for calling the first kernel function that client ip and port are inserted into TCP syn data packet Head option (option), and by the updated TCP syn data packet to source station server.
Preferably, the information extraction unit includes:
Information authentication module, for calling the second kernel function to verify the head option (option);
Information storage module, for extracting client ip and end in the head option (option) after being verified Mouthful, and client ip and port are stored to sock structural body.
Compared with prior art, provided by the invention to realize that CDN returns the beneficial effect that source request carries the system of client ip Fruit, which goes back to source with the realization CDN that above-mentioned technical proposal provides, requests the carrying beneficial effect of method of client ip identical, herein not It repeats.
Detailed description of the invention
The drawings described herein are used to provide a further understanding of the present invention, constitutes a part of the invention, this hair Bright illustrative embodiments and their description are used to explain the present invention, and are not constituted improper limitations of the present invention.In the accompanying drawings:
Fig. 1 is to realize that CDN returns the flow diagram that source request carries the method for client ip in the embodiment of the present invention;
Fig. 2 is the method schematic diagram that client ip and port configuration TCP syn data packet are inserted into the embodiment of the present invention;
Fig. 3 is client ip, port and the request content extracted in TCP syn data packet in the embodiment of the present invention, and The method schematic diagram of TCP connection relationship is established with CDN node;
Fig. 4 is client ip, port and request content to be received in the embodiment of the present invention, and feed back access request content Method schematic diagram;
Fig. 5 is to realize that CDN returns the timing diagram that source request carries the method for client ip in the embodiment of the present invention;
Fig. 6 is to realize that CDN returns the structural schematic diagram that source request carries client ip system in the embodiment of the present invention.
Appended drawing reference:
1- goes back to source and requests judging unit, and 2- first returns source processing unit;
3- data packet updating unit, 4- information extraction unit;
5- first returns source processing unit, 31- handshake request module;
32- data packet update module, 41- information authentication module;
42- information storage module.
Specific embodiment
In order to make the foregoing objectives, features and advantages of the present invention clearer and more comprehensible, implement below in conjunction with the present invention Attached drawing in example, technical scheme in the embodiment of the invention is clearly and completely described.Obviously, described embodiment Only a part of the embodiment of the present invention, instead of all the embodiments.Based on the embodiments of the present invention, the common skill in this field Art personnel all other embodiment obtained without creative labor belongs to the model that the present invention protects It encloses.
Embodiment one
Fig. 1 is to realize that CDN returns the flow diagram that source request carries the method for client ip in the embodiment of the present invention one.Figure 5 return the timing diagram that sources request carries the method for client ip for realization CDN in the embodiment of the present invention one.Fig. 1, Fig. 5 are please referred to, this Embodiment provides a kind of method realized CDN and return source request carrying client ip, comprising:
Step S1: according to the received client access request of CDN node, judge whether CDN node is stored with and asked with access Seek corresponding private key;If "None" executes S3;
Step S3: it initiates to the TCP connection of source station server to request, is inserted into client ip and port to TCP syn data Bao Zhong, and updated TCP syn data packet is sent to source station server;
Step S4: client ip and port in TCP syn data packet are extracted by source station server, return to syn ack Data packet receives TCP connection request to CDN node;This is the process of tcp three-way handshake: after Syn ack reaches cdn node, Cdn node can reply an ack;This when, both sides think that connection has built up.
Step S5: client access request content is forwarded to source station server by TCP connection using CDN node, is made The service logic feedback request content of source station server is obtained, and obtains client ip and port.
It is provided in this embodiment to realize that CDN returns source request and carries in the method for client ip, utilize the CDN for being deployed in various regions The access request of node real-time reception client, and according to whether being stored in CDN node and access request related private key, it is corresponding Different time source modules is selected, specifically, then selecting private key to return source module when being stored with related private key in CDN node, when CDN is saved The not stored time source module for thering is related private key then to select insertion client ip on point;Wherein, private key returns source module and refers to using phase It closes private key to decrypt access request, and client ip and request content Hui Yuan that decryption is obtained pass through this to source station server Kind method realization obtains client ip while feeding back access request content, but this time source module is only applicable to safety It is required that the lower website HTTPS, that is, be only applicable to be ready the website HTTPS being deployed in related private key in CDN node.If right In the higher website HTTPS of safety, i.e., the website of related private key is not disposed in CDN node, then insertion client ip can be used Return source module, can be by insertion client ip and port configuration TCP syn data packet, and TCP syn data packet after updating It is sent to source station server, extracts client ip and port in TCP syn data packet using source station server, and receive TCP Connection request establishes TCP connection relationship, so that the service logic of source station server can not only feed back respective request, while energy Client ip and port are enough obtained, may be implemented in the CDN node for not disposing related private key that also to obtain client true in this way IP, in other words, such time source module not only ensure that the safety of website, while can also be based on client ip to client's row To be analyzed.
As it can be seen that returning the method that source request carries client ip using realization CDN provided in this embodiment, it is capable of providing a variety of It is available to return source module, that is, no matter whether CDN node is stored with related private key, can be used and corresponds to back source module acquisition visitor Family end real IP.
It should be noted that it is that the prior art commonly returns source method that the private key in above-described embodiment, which returns source module, herein Repeating for source module no longer is returned to private key.
Specifically, referring to Fig. 2, the S3 in the present embodiment is specifically included:
Step S31:CDN node initiates handshake request to source station server, constructs TCP syn data packet;
Step S32: call the first kernel function by the head option of client ip and port insertion TCP syn data packet (option), to update TCP syn data packet;
Step S33: updated TCP syn data packet is sent to source station server.
Further, referring to Fig. 3, the S4 in the present embodiment is specifically included:
Step S41: the second kernel function is called to verify head option (option);
Step S42: client ip and the port in head option (option) are extracted after being verified, stores to sock and ties In structure body;
Step S43: pass through the TCP connection relationship of sock structural body managed source site server and CDN node.
Specifically, the second kernel function is called to verify head option (option) in the step S41 in above-described embodiment Method include:
Whether No. kind for judging head option (option) simultaneously is TCPOPT_CIP, the length of head option (option) Whether degree is TCPOLEN_CIP, and when the judging result of the two is "Yes", then above-mentioned verification result passes through.That is, head option (option) No. kind is the length of TCPOPT_CIP and head option (option) when being TCPOLEN_CIP, above-mentioned to test Card result is passed through.
Preferably, referring to Fig. 4, the S5 in the present embodiment is specifically included:
Step S51: the inet_getname_cip function in the server of accept function call source station is utilized;
The primary function inet_getname of step S52:inet_getname_cip function call kernel, using described primary Function inet_getname extracts client ip and port from the sock structural body, and client ip and port are back to Accept function.
It should be noted that the first kernel function is tcp_options_write function, the second kernel function is tcp_ V4_syn_recv_sock_cip function.Tcp_v4_syn_recv_sock_cip function is kernel syn_ in the server of source station The Hook Function of the upper carry of recv_sock.
Embodiment two
Fig. 1, Fig. 5 are please referred to, between step S1 and step S3, further includes: step S2: using the private key to the visit It asks request decryption, and client ip and port is inserted into the request content after decryption, then Hui Yuan makes to source station server The service logic for obtaining source station server can obtain client ip and port, and feed back corresponding access request content.
It is provided in this embodiment to realize that CDN returns source request and carries in the method for client ip, utilize the CDN for being deployed in various regions The access request of node real-time reception client, and according to whether being stored in CDN node and access request related private key, it is corresponding Select different time source modules.
Embodiment three
Fig. 1 and Fig. 5 are please referred to, realizes that CDN returns the method that source request carries client ip, packet the present embodiment provides a kind of It includes:
CDN node receives client access request, judges whether the local of the CDN node is stored with and the access request Corresponding private key;
CDN node is initiated to the TCP connection of source station server to request, and is inserted into client ip and port to TCP syn data Bao Zhong, and the updated TCP syn data packet is sent to source station server;
CDN node receives what source station server returned behind client ip and port in extracting the TCP syn data packet Syn ack data packet, and the TCP connection is established with source station server;
Client access request content is forwarded to source station server by the TCP connection by CDN node, so that source station takes The service logic of business device feeds back the request content, and obtains client ip and port.
Wherein, CDN node is initiated to the TCP connection of source station server to request in the above method, is inserted into client ip and end The updated TCP syn data packet is sent to source station server and specifically included by mouth into TCP syn data packet:
CDN node initiates handshake request to source station server, constructs TCP syn data packet;
Call the first kernel function that client ip and port are inserted into the head option of the TCP syn data packet (option), to update the TCP syn data packet;
The updated TCP syn data packet is sent to source station server.
Preferably, CDN node receives source station server client in extracting the TCP syn data packet in the above method The syn ack data packet returned behind IP and port, and establish the TCP connection with source station server and specifically include:
The second kernel function is called to verify the head option (option);
The client ip in the head option (option) and port are extracted after being verified, and are stored to sock structural body In;
Pass through the TCP connection relationship of the sock structural body managed source site server and the CDN node.
Preferably, the method for calling the second kernel function to verify head option (option) includes:
Whether No. kind for judging the head option (option) simultaneously is TCPOPT_CIP, the head option (option) whether length is TCPOLEN_CIP, and when the judging result of the two is "Yes", then above-mentioned verification result passes through.
Preferably, client access request content is forwarded to source station by the TCP connection by CDN node in the above method Server so that the service logic of source station server feeds back the request content, and obtains client ip and port specifically includes:
Utilize the inet_getname_cip function in the server of accept function call source station;
The primary function inet_getname of inet_getname_cip function call kernel, utilizes the primary function Inet_getname extracts client ip and port from the sock structural body, and client ip and port are back to Accept function.
Preferably, the first kernel function in the present embodiment is tcp_options_write function, and the second kernel function is Tcp_v4_syn_recv_sock_cip function.
Preferably, the tcp_v4_syn_recv_sock_cip function in the present embodiment is kernel syn_ in the server of source station The Hook Function of the upper carry of recv_sock.
It is provided in this embodiment to realize that CDN returns source request and carries in the method for client ip, utilize the CDN for being deployed in various regions The access request of node real-time reception client, and according to whether being stored in CDN node and access request related private key, it is corresponding Select different time source modules.
Example IV
Fig. 1, Fig. 5 are please referred to, realizes that CDN returns the method that source request carries client ip the present embodiment provides a kind of, comprising:
CDN node receives client access request, judges whether the local of the CDN node is stored with and the access request Corresponding private key;
CDN node is initiated to the TCP connection of source station server to request, and is inserted into client ip and port to TCP syn data Bao Zhong;
The updated TCP syn data packet is sent to source station server by CDN node, and is received source station server and returned The syn ack data packet returned;
CDN node and source station server establish the TCP connection, and client access request content is passed through the TCP Connection is forwarded to source station server.
Specifically, in the above method CDN node initiate to source station server TCP connection request, insertion client ip and Port is specifically included to TCP syn data packet:
CDN node initiates handshake request to source station server, constructs TCP syn data packet;
Call the first kernel function that client ip and port are inserted into the head option of the TCP syn data packet (option), to update the TCP syn data packet;
The updated TCP syn data packet is sent to source station server.
Preferably, CDN node and source station server establish the TCP connection in the above method, and client access is asked It asks content to be forwarded to source station server by the TCP connection, specifically includes:
The second kernel function is called to verify the head option (option);
The client ip in the head option (option) and port are extracted after being verified, and are stored to sock structural body In;
Pass through the TCP connection relationship of the sock structural body managed source site server and the CDN node.
Further, the method that second kernel function verifies head option (option) includes:
Whether No. kind for judging the head option (option) simultaneously is TCPOPT_CIP, the head option (option) whether length is TCPOLEN_CIP, and when the judging result of the two is "Yes", then above-mentioned verification result passes through.
Preferably, first kernel function is tcp_options_write function, and second kernel function is tcp_ V4_syn_recv_sock_cip function.
Preferably, the tcp_v4_syn_recv_sock_cip function is kernel in the server of source station
The Hook Function of the upper carry of syn_recv_sock.
It is provided in this embodiment to realize that CDN returns source request and carries in the method for client ip, utilize the CDN for being deployed in various regions The access request of node real-time reception client, and according to whether being stored in CDN node and access request related private key, it is corresponding Select different time source modules.
Embodiment five
1 and Fig. 6 are please referred to, realizes that CDN returns the system that source request carries client ip the embodiment of the invention provides a kind of, Including time source request 1, first time source processing unit 2 of judging unit, data packet updating unit 3, information extraction unit 4 and second time Source processing unit 5;
Described time source request judging unit 1 is used to judge the CDN according to the received client access request of CDN node Whether node is stored with and the access request corresponding private key;
First time source processing unit 2 is used to when the judgment result is yes decrypt access request using the private key, And client ip and port are inserted into the obtained request content of decryption Hui Yuan to source station server, so that source station server Service logic responds;
The data packet updating unit 3 is for when the judgment result is No, being inserted into client ip and port to TCP syn number According in packet, and the updated TCP syn data packet is sent to source station server;
The information extraction unit 4 is for extracting and storing the client ip in the TCP syn data packet and port;
Second time source processing unit 5 feeds back corresponding access for receiving client ip, port and request content Request content.
Specifically, please referring next to Fig. 6, the data packet updating unit 3 in this implementation includes:
Handshake request module 31, for sending handshake request to source station server;
Data packet update module 32, for calling the first kernel function that client ip and port are inserted into TCP syn data The head option (option) of packet, and by the updated TCP syn data packet to source station server.
Further, please continue to refer to Fig. 6, the information extraction unit 4 includes:
Information authentication module 41, for calling the second kernel function to verify the head option (option);
Information storage module 42, for extracted after being verified the client ip in the head option (option) and Port, and client ip and port are stored to sock structural body.
Compared with prior art, provided in an embodiment of the present invention to realize that CDN returns the system of source request carrying client ip Beneficial effect, which goes back to source with the realization CDN that above-described embodiment one provides, requests the carrying beneficial effect of method of client ip identical, This will not be repeated here.
It will appreciated by the skilled person that implement the method for the above embodiments be can be with Instruct relevant hardware to complete by program, program can store in computer-readable storage medium, the program When being executed, each step including above-described embodiment method, and the storage medium may is that ROM/RAM, magnetic disk, CD, Storage card etc..
The above description is merely a specific embodiment, but scope of protection of the present invention is not limited thereto, any Those familiar with the art in the technical scope disclosed by the present invention, can easily think of the change or the replacement, and should all contain Lid is within protection scope of the present invention.Therefore, protection scope of the present invention should be based on the protection scope of the described claims.

Claims (10)

1. a kind of realize that CDN returns the method that source request carries client ip characterized by comprising
Step S1: client access request is received according to CDN node, judges whether the CDN node is stored with and the access Request corresponding private key;If "None" executes S3;
Step S3: initiating to the TCP connection of source station server to request, be inserted into client ip and port into TCP syn data packet, And the updated TCP syn data packet is sent to source station server;
Step S4: client ip and port in the TCP syn data packet are extracted by source station server, return to syn ack Data packet receives the TCP connection request to CDN node;
Step S5: client access request content is forwarded to source station by the TCP connection using the CDN node and is serviced Device so that the service logic of source station server feeds back the request content, and obtains client ip and port.
2. the method according to claim 1, wherein the S3 is specifically included:
Step S31: the CDN node initiates handshake request to source station server, constructs TCP syn data packet;
Step S32: call the first kernel function that client ip and port are inserted into the head option of the TCP syn data packet Option, to update the TCP syn data packet;
Step S33: the updated TCP syn data packet is sent to source station server.
3. according to the method described in claim 2, it is characterized in that, the S4 is specifically included:
Step S41: the second kernel function is called to verify the head option option;
Step S42: the client ip in the head option option and port are extracted after being verified, is stored to sock structure In body;
Step S43: pass through the TCP connection relationship of the sock structural body managed source site server and the CDN node.
4. according to the method described in claim 3, it is characterized in that, the S5 is specifically included:
Step S51: the inet_getname_cip function in the server of accept function call source station is utilized;
The primary function inet_getname of step S52:inet_getname_cip function call kernel, utilizes the primary function Inet_getname extracts client ip and port from the sock structural body, and client ip and port are back to Accept function.
5. according to the method described in claim 3, it is characterized in that, first kernel function is tcp_options_write Function, second kernel function are tcp_v4_syn_recv_sock_cip function.
6. according to the method described in claim 3, it is characterized in that, the tcp_v4_syn_recv_sock_cip function is source In site server on kernel syn_recv_sock carry Hook Function.
7. the method according to claim 1, wherein between step S1 and step S3, further includes:
Step S2: decrypting the access request using the private key, and client ip and port are inserted into asking after decrypting It asks in content, then Hui Yuan to source station server, enables the service logic of source station server to obtain client ip and port, And feed back corresponding access request content.
8. a kind of realize that CDN returns the method that source request carries client ip characterized by comprising
CDN node receives client access request, and it is corresponding with the access request to judge whether the local of the CDN node is stored with Private key;
CDN node is initiated to the TCP connection of source station server to request, and is inserted into client ip and port into TCP syn data packet, And the updated TCP syn data packet is sent to source station server;
CDN node receives the syn that source station server returns behind client ip and port in extracting the TCP syn data packet Ack data packet, and the TCP connection is established with source station server;
Client access request content is forwarded to source station server by the TCP connection by CDN node, so that source station server Service logic feed back the request content, and obtain client ip and port.
9. a kind of realize that CDN returns the method that source request carries client ip characterized by comprising
CDN node receives client access request, and it is corresponding with the access request to judge whether the local of the CDN node is stored with Private key;
CDN node is initiated to the TCP connection of source station server to request, and is inserted into client ip and port into TCP syn data packet;
The updated TCP syn data packet is sent to source station server by CDN node, and receives the return of source station server Syn ack data packet;
CDN node and source station server establish the TCP connection, and client access request content is passed through the TCP connection It is forwarded to source station server.
10. a kind of realize that CDN returns the system that source request carries client ip, comprising: at time source request judging unit, first time source Manage unit, data packet updating unit, information extraction unit and second time source processing unit;
Described time source request judging unit is used to judge that the CDN node is according to the received client access request of CDN node It is no to be stored with and the access request corresponding private key;
First time source processing unit is used to when the judgment result is yes decrypt access request using the private key, and will be objective Family end IP and port are inserted into the obtained request content of decryption that Hui Yuan is to source station server, so that the business of source station server is patrolled It collects and responds;
The data packet updating unit is for when the judgment result is No, being inserted into client ip and port to TCP syn data packet In, and the updated TCP syn data packet is sent to source station server;
The information extraction unit is for extracting and storing the client ip in the TCP syn data packet and port;
Second time source processing unit feeds back corresponding access request for receiving client ip, port and request content Content.
CN201711328802.5A 2017-12-13 2017-12-13 Realize that CDN returns the method and system that source request carries client ip Pending CN109922105A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711328802.5A CN109922105A (en) 2017-12-13 2017-12-13 Realize that CDN returns the method and system that source request carries client ip

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711328802.5A CN109922105A (en) 2017-12-13 2017-12-13 Realize that CDN returns the method and system that source request carries client ip

Publications (1)

Publication Number Publication Date
CN109922105A true CN109922105A (en) 2019-06-21

Family

ID=66958653

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711328802.5A Pending CN109922105A (en) 2017-12-13 2017-12-13 Realize that CDN returns the method and system that source request carries client ip

Country Status (1)

Country Link
CN (1) CN109922105A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112398884A (en) * 2019-08-14 2021-02-23 上海哔哩哔哩科技有限公司 Flow scheduling control method in mirror image back-to-source scene, readable storage medium and computer equipment

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020073232A1 (en) * 2000-08-04 2002-06-13 Jack Hong Non-intrusive multiplexed transaction persistency in secure commerce environments
CN102035905A (en) * 2010-12-17 2011-04-27 北京世纪互联工程技术服务有限公司 Method for obtaining visitor Local DNS (Local Domain-Name Server)
CN103747112A (en) * 2013-12-24 2014-04-23 乐视网信息技术(北京)股份有限公司 CDN back-to-source method, first server and system thereof
CN105871797A (en) * 2015-11-19 2016-08-17 乐视云计算有限公司 Handshake method, device and system of client and server
CN106789344A (en) * 2017-01-19 2017-05-31 上海帝联信息科技股份有限公司 Data transmission method, system, CDN and client
CN107465666A (en) * 2017-07-12 2017-12-12 北京潘达互娱科技有限公司 A kind of client ip acquisition methods and device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020073232A1 (en) * 2000-08-04 2002-06-13 Jack Hong Non-intrusive multiplexed transaction persistency in secure commerce environments
CN102035905A (en) * 2010-12-17 2011-04-27 北京世纪互联工程技术服务有限公司 Method for obtaining visitor Local DNS (Local Domain-Name Server)
CN103747112A (en) * 2013-12-24 2014-04-23 乐视网信息技术(北京)股份有限公司 CDN back-to-source method, first server and system thereof
CN105871797A (en) * 2015-11-19 2016-08-17 乐视云计算有限公司 Handshake method, device and system of client and server
CN106789344A (en) * 2017-01-19 2017-05-31 上海帝联信息科技股份有限公司 Data transmission method, system, CDN and client
CN107465666A (en) * 2017-07-12 2017-12-12 北京潘达互娱科技有限公司 A kind of client ip acquisition methods and device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112398884A (en) * 2019-08-14 2021-02-23 上海哔哩哔哩科技有限公司 Flow scheduling control method in mirror image back-to-source scene, readable storage medium and computer equipment
CN112398884B (en) * 2019-08-14 2023-08-25 上海哔哩哔哩科技有限公司 Flow scheduling control method under mirror image back source scene, readable storage medium and computer equipment

Similar Documents

Publication Publication Date Title
CN104580264B (en) Login method, entering device and login and Accreditation System
CN105847988B (en) Video sharing method and apparatus
CN106254377B (en) Support the soft load-balancing method and system of the long connection of magnanimity
CN107105033B (en) Cloud application access method, cloud proxy server and cloud application access system
CN103227786B (en) A kind of website login information filling method and device
CN105528728A (en) Mall e-commerce service platform based on cloud computing and method thereof
CN102420819A (en) User registering method, interaction method and associated device
CN107426339A (en) A kind of cut-in method, the apparatus and system of data interface channel
CN103139137B (en) Network service provider method and device
CN104410546A (en) Testing method and device of real-time processing system
CN109905474A (en) Data safety sharing method and device based on block chain
CN105228126B (en) A kind of method and system of network access point trustship
CN108390955A (en) Domain Name acquisition method, Website access method and server
CN108734493B (en) Advertisement targeted delivery control method, monitoring method and device
CN105790960B (en) Method for recognizing flux and system, flow gateway
CN103997479B (en) A kind of asymmetric services IP Proxy Methods and equipment
CN105979521B (en) The method of fat or thin WiFi AP unaware certification free Internet access
CN106209727B (en) Session access method and device
CN104506802A (en) Video monitoring system, and method for monitoring video data through traversing NAT (Network Address Translation)
CN111447133A (en) Message transmission method and device, storage medium and electronic device
CN103561063B (en) A kind of method of Register top box and terminal
CN110995656A (en) Load balancing method, device, equipment and storage medium
CN110351276A (en) Data processing method, equipment and computer readable storage medium
CN108989427A (en) A kind of public service system and its construction method based on multi-source information polymerization
CN109922105A (en) Realize that CDN returns the method and system that source request carries client ip

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: 20190621

RJ01 Rejection of invention patent application after publication