A method for observing CDN website return rate in network path

By analyzing HTTP request and response moments in the network path, the return-to-origin rate of the CDN website is identified, which solves the problem of difficulty in monitoring the return-to-origin rate of the CDN website, realizes transparent and full-process monitoring of the return-to-origin rate of the CDN website, and improves the network Service provider optimization capabilities and user experience.

CN116743613BActive Publication Date: 2024-08-30HANGZHOU MANIFOLD NEW NETWORK TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210206265.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-03
Publication Date
2024-08-30
Estimated Expiration
2042-03-03

AI Technical Summary

Technical Problem

It is difficult to effectively observe and count the return rate of CDN websites with existing technology, especially in sites with a lot of dynamic content. Frequent user visits lead to resource acquisition speeds that vary between CDN providers, making it difficult for network service providers to optimize. .

Method used

By collecting and analyzing network messages in the network path, identifying HTTP request and response moments in TCP and UDP connections, using the ALPN and SNI extensions of TLS and QUIC protocols to identify HTTP access, calculating HTTP response delays, and clustering statistics to separate returns For origin and non-return-to-origin requests, calculate the return-to-origin rate.

Benefits of technology

It achieves transparent and full-process monitoring of the return rate of CDN websites. It only monitors traffic types and has no privacy risks. It facilitates optimization by network service providers and improves network service efficiency and user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure HDA0003529273180000011
    Figure HDA0003529273180000011
  • Figure HDA0003529273180000021
    Figure HDA0003529273180000021
  • Figure HDA0003529273180000031
    Figure HDA0003529273180000031
Patent Text Reader

Abstract

The present invention discloses a method for observing the return rate of a CDN website in a network path, the method comprising: collecting the first k messages of each connection to meet the needs of subsequent steps; the TCP protocol itself has the concept of connection in the underlying protocol, and the UDP protocol based on datagrams uses a quadruple similar to TCP. After data collection is completed, all TCP connections are traversed to perform group statistics; UDP connections are retrieved, and the time t when the HTTP request starts to be sent is obtained. 1 , and the time t when the first HTTP response is received from the server 2 , according to the HTTP access of different domain names d The values ​​are clustered separately, so that the back-to-source and non-back-to-source requests can be separated, so as to calculate the back-to-source rate of a certain domain name during this period of time. The present invention observes and counts the back-to-source rate of CDN websites from the perspective of network service providers, which is convenient for optimizing each site from the perspective of network service providers.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a method for observing a CDN website return rate in a network path. Background Art

[0002] In the computer field, more and more websites are beginning to use content distribution networks (CDN) for deployment. For these websites, after receiving user access requests, they can allocate corresponding CDN nodes according to a certain algorithm. Therefore, when users access content (mostly static content) cached by CDN nodes, they can obtain faster access speeds.

[0003] Chinese patent CN113472852 discloses a CDN node back-to-source method, device and equipment, and provides a CDN node back-to-source device. The device includes: an acquisition module, which is set in any cache server among the multiple cache servers contained in the CDN node, and is used to respond to a resource request and obtain the URI requested in the resource request and the IP list of the cache server in the CDN node; a calculation module, which is set in the cache server, and is used to calculate the target IP through a consistent hash algorithm according to the URI requested in the resource request and the IP list of the cache server in the CDN node, and forward the resource request to the cache server corresponding to the target IP; a judgment module, which is set in the cache server corresponding to the target IP, and is used to judge whether the content requested in the resource request is cached. If so, the CDN node returns to the lower node of the CDN node until the client corresponding to the resource request is returned; otherwise, the CDN node sends a back-to-source request to the upper node of the CDN node. This invention enables each CDN node to return to the source only once for user requests for the same content, thereby reducing the return rate, saving upper-layer bandwidth, increasing effective throughput, reducing the access pressure on the source site server, and improving user experience.

[0004] However, for sites with more dynamic content, users may often need to return to the source when visiting, and the process of obtaining the source site resources is included in the CDN, and the speed varies depending on the CDN provider. In order to observe the proportion of return requests for each website, so as to optimize from the perspective of network service providers, an effective method is needed to observe the return rate of CDN websites. Summary of the invention

[0005] The object of the present invention is to provide a method for observing the return rate of a CDN website in a network path, so as to observe the return rate of a CDN website in a network path.

[0006] To achieve the above object, the present invention provides the following technical solution: a method for observing the return rate of a CDN website in a network path, the method comprising:

[0007] 1) Data collection: In the process of observing the initiation of each connection of network messages in the network path, the first k messages of each connection are collected, where k is a constant that can meet the needs of subsequent steps; the TCP protocol itself has the concept of connection in the underlying protocol, while the datagram-based UDP protocol identifies a connection through a four-tuple similar to TCP, namely, source address, source port, destination address and destination port. "UDP connection" refers to the connection identified in this way;

[0008] 2) Retrieve TCP connections: After data collection is completed, traverse all TCP connections and perform group statistics based on the following results:

[0009] If a TLS handshake is detected, the application layer protocol version is negotiated with the server, i.e., HTTP / 1.x or HTTP / 2. Modern browsers mostly use the ALPN extension of TLS for negotiation. The start of an HTTP access is identified by observing the negotiation result of ALPN in the network path. The ALPN extension is located in the TLS handshake, i.e., the "Client Hello" message initiated by the client. They are all discovered by the traffic monitoring or forwarding program on the network path, so the time when the TLS handshake is initiated is located, i.e., the time when the "Client Hello" message is sent. At the same time, the "Client Hello" message is accompanied by the SNI extension. By reading the information in the SNI extension, the domain name information of the corresponding website is obtained. The negotiation result of ALPN is reflected in the "Server Hello" message sent back by the server. If the negotiation result is HTTP / 1.x or HTTP / 2, it indicates that this TCP connection is about to initiate a TCP-based HTTP request. Then, by retrieving the TCP messages transmitted on this basic TCP connection and analyzing their types, we record the time t when the HTTP request starts to be sent. 1 , and the time t when the first HTTP response is received from the server 2 Therefore, t d =t 2 -t 1 This is the requested HTTP response delay;

[0010] If no TLS handshake is detected, the unencrypted HTTP connection can only be HTTP / 1.x version, and the HTTP request header is plain text. Continue to retrieve the transmission message of this TCP connection. If an HTTP request is detected, parse the HOST field to determine the domain name, and at the same time determine its sending time t 1, find the time when the first server response arrives after this, which is t 2 , the subsequent steps are the same as detecting a TLS handshake;

[0011] 3) Retrieve UDP connections. The only HTTP protocol using UDP is HTTP / 3 based on QUIC. Therefore, UDP connections containing QUIC handshakes can be filtered out. Since the QUIC protocol comes with TLS encryption, an HTTP access is identified based on the ALPN extension of TLS. At this time, the negotiation result of ALPN is HTTP / 3, and the corresponding domain name information is determined by the SNI extension. Retrieve these UDP connections and obtain the time t when the HTTP request starts to be sent. 1 , and the time t when the first HTTP response is received from the server 2 , the subsequent steps are the same as those described in the TLS handshake detection step;

[0012] 4) Clustering and statistics, based on the HTTP access t of different domain names d By clustering the values ​​separately, we can separate the back-to-origin requests from the non-back-to-origin requests, and thus find the back-to-origin rate for a certain domain name during this period of time.

[0013] Preferably, the method for observing the return rate of a CDN website in a network path adopts a bypass analysis method.

[0014] Preferably, the identification connection identifies and marks the underlying TCP or QUIC connection that initiates the HTTP request through the ALPN extension of TLS.

[0015] Preferably, the domain name acquisition 2. uses the SNI extension of TLS or the HOST field in the HTTP plain text request in the marked connection to obtain the domain name information.

[0016] Preferably, the domain name acquisition may be performed by arranging a DNS resolution cache server on the client side in advance to query the corresponding relationship between the IP address and the domain name, or the domain name may be reversely checked using the DNS PTR instruction.

[0017] Preferably, the clustering method can distinguish two groups of significantly different response delays.

[0018] Preferably, the t d Response latency is calculated by taking the time difference between the first HTTP request and the first HTTP response in each connection.

[0019] Considering that the HTTP versions currently used by various websites range from the earlier HTTP / 1.0 to the latest HTTP / 3, and their underlying protocols are also divided into TCP and UDP, they should be discussed separately. In the following, HTTP / 1.0 and HTTP / 1.1 are referred to as HTTP / 1.x. This series of versions is based on the TCP protocol and does not require TLS encryption. HTTP / 2 is also based on the TCP protocol, but the current browser implementations all require TLS encryption, so the HTTP / 2 protocol without TLS encryption is not discussed. HTTP / 3 (draft) uses the UDP-based QUIC protocol, which comes with TLS encryption. Therefore, the above situations will be discussed separately below. Considering the large number of situations and the different specifications of each version, we use the bypass analysis method to ensure the robustness of the forwarding system and improve the overall forwarding efficiency.

[0020] The present invention has the following beneficial effects: the present invention is used to observe and count the return rate of CDN websites from the perspective of the network service provider. The whole process is transparent to the user and only the traffic type is monitored. There is no privacy risk, which facilitates the optimization of each site from the perspective of the network service provider. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] Figure 1 , is a schematic diagram of the principle of the method for observing the return rate of a CDN website in a network path of the present invention;

[0022] Figure 2 , is a schematic diagram of a non-back-to-origin HTTP request under the HTTPS protocol of the present invention;

[0023] Figure 3 , is a schematic diagram of a back-to-origin HTTP request under the HTTPS protocol of the present invention;

[0024] Figure 4 , is a schematic diagram of the process of the present invention. DETAILED DESCRIPTION

[0025] The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the embodiments of the present invention.

[0026] Embodiment 1, as Figure 1-3As shown, a method for observing the return rate of a CDN website in a network path, the method comprising: data collection: in the process of observing each connection initiation of network messages in the network path, the first k messages of each connection are collected, k is a constant, which can meet the needs of subsequent steps; the TCP protocol itself has the concept of connection in the underlying protocol, and the UDP protocol based on datagrams identifies a connection through a four-tuple similar to TCP, namely, source address, source port, destination address and destination port, and "UDP connection" refers to the connection identified in this way; retrieval of TCP connection: further, after the data collection is completed, all TCP connections are traversed, and group statistics are performed according to the following results: if a TLS handshake is detected, the application layer protocol version is negotiated with the server, namely, HTTP / 1.x or HTTP / 2. Modern browsers mostly use the ALPN extension of TLS for negotiation. Therefore, in the network path, the start of an HTTP access can be identified by observing the negotiation result of ALPN. The ALPN extension is located in the TLS handshake, in the "Client Hello" message initiated by the client; they can all be discovered by the traffic monitoring or forwarding program on the network path, so the TLS handshake initiation moment can be located, that is, the "Client Hello" message is sent. At the same time, the "Client Hello" message usually comes with an SNI extension. By reading the information in it, we can get the domain name information of the corresponding website; the ALPN negotiation result will be reflected in the "Server Hello" message sent back by the server. If the negotiation result is HTTP / 1.x or HTTP / 2, it means that this TCP connection is about to initiate a TCP-based HTTP request; then by retrieving the TCP message transmitted on this basic TCP connection and analyzing its type, we record the time t when the HTTP request starts to be sent. 1 , and the time t when the first HTTP response is received from the server 2 Therefore, t d =t 2 -t 1 This is the required HTTP response delay. If the TLS handshake is not detected, the unencrypted HTTP connection can only be the HTTP / 1.x version, and the HTTP request header is a plain text. Continue to retrieve the transmission message of this TCP connection. If an HTTP request is detected, parse the HOST field to determine the domain name, and at the same time determine its sending time t 1 , find the time when the first server response arrives after this, which is t 2, the subsequent steps are the same as detecting the TLS handshake; retrieve the UDP connection. The only HTTP protocol using UDP is HTTP / 3 based on QUIC, so the UDP connection containing the QUIC handshake can be screened out. Because the QUIC protocol comes with TLS encryption, an HTTP access is identified based on the ALPN extension of TLS. At this time, the negotiation result of ALPN is HTTP / 3, and the corresponding domain name information is determined by the SNI extension; retrieve these UDP connections and obtain the time t when the HTTP request starts to be sent 1 , and the time t when the first HTTP response is received from the server 2 The following steps are the same as those described in the TLS handshake detection step; clustering and statistics, based on the HTTP access t of different domain names d By clustering the values ​​separately, we can separate the back-to-origin requests from the non-back-to-origin requests, and thus find the back-to-origin rate for a certain domain name during this period of time.

[0027] Embodiment 2, a method for observing the return rate of a CDN website in a network path, adopting a bypass analysis method, the method comprising: data collection: in the process of observing each connection initiation of network messages in the network path, the first k messages of each connection are collected, k is a constant, which can meet the needs of subsequent steps; the TCP protocol itself has the concept of connection in the underlying protocol, and the datagram-based UDP protocol identifies a connection through a four-tuple similar to TCP, namely, source address, source port, destination address and destination port, and "UDP connection" refers to the connection identified in this way; retrieve TCP connection: further, after the data collection is completed, traverse all TCP connections, and perform group statistics according to the following results: if a TLS handshake is detected, negotiate the application layer protocol version with the server, namely HTTP / 1.x or HTTP / 2, modern browsers mostly use the ALPN extension of TLS for negotiation, so the start of an HTTP access can be identified in the network path by observing the negotiation result of ALPN, the ALPN extension is located in the TLS handshake, and the "Client Hello" message; they can all be discovered by traffic monitoring or forwarding programs on the network path, so the time when the TLS handshake is initiated can be located, that is, the time when the "Client Hello" message is sent; at the same time, the "Client Hello" message usually also comes with an SNI extension, and by reading the information in it, the domain name information of the corresponding website can be obtained; the ALPN negotiation result will be reflected in the "ServerHello" message sent back by the server. If the negotiation result is HTTP / 1.x or HTTP / 2, it indicates that this TCP connection is about to initiate a TCP-based HTTP request; then by retrieving the TCP messages transmitted on this basic TCP connection and analyzing their types, we record the time t when the HTTP request starts to be sent.1 , and the time t when the first HTTP response is received from the server 2 Therefore, t d =t 2 -t 1 This is the required HTTP response delay. If the TLS handshake is not detected, the unencrypted HTTP connection can only be the HTTP / 1.x version, and the HTTP request header is a plain text. Continue to retrieve the transmission message of this TCP connection. If an HTTP request is detected, parse the HOST field to determine the domain name, and at the same time determine its sending time t 1 , find the time when the first server response arrives after this, which is t 2 , the subsequent steps are the same as detecting the TLS handshake; retrieve the UDP connection. The only HTTP protocol using UDP is HTTP / 3 based on QUIC, so the UDP connection containing the QUIC handshake can be screened out. Because the QUIC protocol comes with TLS encryption, an HTTP access is identified based on the ALPN extension of TLS. At this time, the negotiation result of ALPN is HTTP / 3, and the corresponding domain name information is determined by the SNI extension; retrieve these UDP connections and obtain the time t when the HTTP request starts to be sent 1 , and the time t when the first HTTP response is received from the server 2 The following steps are the same as those described in the TLS handshake detection step; clustering and statistics, based on the HTTP access t of different domain names d By clustering the values ​​separately, we can separate the back-to-origin requests from the non-back-to-origin requests, and thus find the back-to-origin rate for a certain domain name during this period of time.

[0028] Embodiment 3, a method for observing the return rate of a CDN website in a network path, the method comprising: data collection: in the process of observing each connection initiation of network messages in the network path, the first k messages of each connection are collected, k is a constant, which can meet the needs of subsequent steps; the TCP protocol itself has the concept of connection in the underlying protocol, and the datagram-based UDP protocol identifies a connection through a four-tuple similar to TCP, namely, source address, source port, destination address and destination port, and "UDP connection" refers to the connection identified in this way; retrieval of TCP connection: further, after the data collection is completed, all TCP connections are traversed, and group statistics are performed according to the following results: if a TLS handshake is detected, the application layer protocol version is negotiated with the server, namely, HTTP / 1.x or HTTP / 2. Modern browsers mostly use the ALPN extension of TLS for negotiation. Therefore, in the network path, the start of an HTTP access can be identified by observing the negotiation result of ALPN. The ALPN extension is located in the TLS handshake, in the "Client Hello" message initiated by the client; they can all be discovered by the traffic monitoring or forwarding program on the network path, so the TLS handshake initiation moment can be located, that is, sending the "Client At the same time, the "Client Hello" message usually comes with an SNI extension. By reading the information in it, we can get the domain name information of the corresponding website; the ALPN negotiation result will be reflected in the "Server Hello" message sent back by the server. If the negotiation result is HTTP / 1.x or HTTP / 2, it means that this TCP connection is about to initiate a TCP-based HTTP request; then by retrieving the TCP message transmitted on this basic TCP connection and analyzing its type, we record the time t when the HTTP request starts to be sent. 1 , and the time t when the first HTTP response is received from the server 2 Therefore, t d =t 2 -t 1 This is the required HTTP response delay. If the TLS handshake is not detected, the unencrypted HTTP connection can only be the HTTP / 1.x version, and the HTTP request header is a plain text. Continue to retrieve the transmission message of this TCP connection. If an HTTP request is detected, parse the HOST field to determine the domain name, and at the same time determine its sending time t 1 , find the time when the first server response arrives after this, which is t 2, the subsequent steps are the same as detecting the TLS handshake; retrieve the UDP connection. The only HTTP protocol using UDP is HTTP / 3 based on QUIC, so the UDP connection containing the QUIC handshake can be screened out. Because the QUIC protocol comes with TLS encryption, an HTTP access is identified based on the ALPN extension of TLS. At this time, the negotiation result of ALPN is HTTP / 3, and the corresponding domain name information is determined by the SNI extension; retrieve these UDP connections and obtain the time t when the HTTP request starts to be sent 1 , and the time t when the first HTTP response is received from the server 2 The following steps are the same as those described in the TLS handshake detection step; clustering and statistics, based on the HTTP access t of different domain names d The values ​​are clustered separately to separate the back-to-origin requests from the non-back-to-origin requests, so as to calculate the back-to-origin rate for a domain name during this period of time. The identification connection identifies and marks the underlying TCP or QUIC connection that initiates the HTTP request through the ALPN extension of TLS.

[0029] Embodiment 4, a method for observing the return rate of a CDN website in a network path, the method comprising: data collection: in the process of observing each connection initiation of network messages in the network path, the first k messages of each connection are collected, k is a constant, which can meet the needs of subsequent steps; the TCP protocol itself has the concept of connection in the underlying protocol, and the UDP protocol based on datagrams identifies a connection through a four-tuple similar to TCP, namely, source address, source port, destination address and destination port, and "UDP connection" refers to the connection identified in this way; retrieval of TCP connection: further, after the data collection is completed, all TCP connections are traversed, and group statistics are performed according to the following results: if a TLS handshake is detected, the application layer protocol version is negotiated with the server, namely, HTTP / 1.x or HTTP / 2. Modern browsers mostly use the ALPN extension of TLS for negotiation. Therefore, in the network path, the start of an HTTP access can be identified by observing the negotiation result of ALPN. The ALPN extension is located in the TLS handshake, in the "Client Hello" message initiated by the client; they can all be discovered by the traffic monitoring or forwarding program on the network path, so the TLS handshake initiation moment can be located, that is, sending the "Client Hello" message. At the same time, the "Client Hello" message usually comes with an SNI extension. By reading the information in it, we can get the domain name information of the corresponding website; the ALPN negotiation result will be reflected in the "Server Hello" message sent back by the server. If the negotiation result is HTTP / 1.x or HTTP / 2, it means that this TCP connection is about to initiate a TCP-based HTTP request; then by retrieving the TCP message transmitted on this basic TCP connection and analyzing its type, we record the time t when the HTTP request starts to be sent. 1 , and the time t when the first HTTP response is received from the server 2 Therefore, t d =t 2 -t 1 This is the required HTTP response delay. If the TLS handshake is not detected, the unencrypted HTTP connection can only be the HTTP / 1.x version, and the HTTP request header is a plain text. Continue to retrieve the transmission message of this TCP connection. If an HTTP request is detected, parse the HOST field to determine the domain name, and at the same time determine its sending time t 1 , find the time when the first server response arrives after this, which is t 2, the subsequent steps are the same as detecting the TLS handshake; retrieve the UDP connection. The only HTTP protocol using UDP is HTTP / 3 based on QUIC, so the UDP connection containing the QUIC handshake can be screened out. Because the QUIC protocol comes with TLS encryption, an HTTP access is identified based on the ALPN extension of TLS. At this time, the negotiation result of ALPN is HTTP / 3, and the corresponding domain name information is determined by the SNI extension; retrieve these UDP connections and obtain the time t when the HTTP request starts to be sent 1 , and the time t when the first HTTP response is received from the server 2 The following steps are the same as those described in the TLS handshake detection step; clustering and statistics, based on the HTTP access t of different domain names d The values ​​are clustered separately to separate the back-to-source and non-back-to-source requests, so as to find the back-to-source rate for a certain domain name during this period. The domain name 2. The domain name information is obtained by using the SNI extension of TLS or the HOST field in the HTTP plain text request in the marked connection. .

[0030] Embodiment 5, a method for observing the return rate of a CDN website in a network path, the method comprising: data collection: in the process of observing each connection initiation of network messages in the network path, the first k messages of each connection are collected, k is a constant, which can meet the needs of subsequent steps; the TCP protocol itself has the concept of connection in the underlying protocol, and the UDP protocol based on datagrams identifies a connection through a four-tuple similar to TCP, namely, source address, source port, destination address and destination port, and "UDP connection" refers to the connection identified in this way; retrieval of TCP connection: further, after the data collection is completed, all TCP connections are traversed, and group statistics are performed according to the following results: if a TLS handshake is detected, the application layer protocol version is negotiated with the server, namely, HTTP / 1.x or HTTP / 2. Modern browsers mostly use the ALPN extension of TLS for negotiation. Therefore, in the network path, the start of an HTTP access can be identified by observing the negotiation result of ALPN. The ALPN extension is located in the TLS handshake, in the "Client Hello" message initiated by the client; they can all be discovered by the traffic monitoring or forwarding program on the network path, so the TLS handshake initiation moment can be located, that is, sending the "Client At the same time, the "Client Hello" message usually comes with an SNI extension. By reading the information in it, we can get the domain name information of the corresponding website; the ALPN negotiation result will be reflected in the "Server Hello" message sent back by the server. If the negotiation result is HTTP / 1.x or HTTP / 2, it means that this TCP connection is about to initiate a TCP-based HTTP request; then by retrieving the TCP message transmitted on this basic TCP connection and analyzing its type, we record the time t when the HTTP request starts to be sent. 1 , and the time t when the first HTTP response is received from the server 2 Therefore, t d =t 2 -t 1 This is the required HTTP response delay. If the TLS handshake is not detected, the unencrypted HTTP connection can only be the HTTP / 1.x version, and the HTTP request header is a plain text. Continue to retrieve the transmission message of this TCP connection. If an HTTP request is detected, parse the HOST field to determine the domain name, and at the same time determine its sending time t 1 , find the time when the first server response arrives after this, which is t 2, the subsequent steps are the same as detecting the TLS handshake; retrieve the UDP connection. The only HTTP protocol using UDP is HTTP / 3 based on QUIC, so the UDP connection containing the QUIC handshake can be screened out. Because the QUIC protocol comes with TLS encryption, an HTTP access is identified based on the ALPN extension of TLS. At this time, the negotiation result of ALPN is HTTP / 3, and the corresponding domain name information is determined by the SNI extension; retrieve these UDP connections and obtain the time t when the HTTP request starts to be sent 1 , and the time t when the first HTTP response is received from the server 2 The following steps are the same as those described in the TLS handshake detection step; clustering and statistics, based on the HTTP access t of different domain names d The values ​​can be clustered separately to separate the back-to-origin requests and non-back-to-origin requests, so as to calculate the back-to-origin rate of a certain domain name during this period. For the domain name information, if the HOST field detection or SNI detection technology is not used, a DNS resolution cache server can be arranged on the client side in advance to query the correspondence between the IP address and the domain name, or the DNS PTR instruction can be used to reversely query the domain name.

[0031] Embodiment 6, a method for observing the return rate of a CDN website in a network path, the method comprising: data collection: in the process of observing each connection initiation of network messages in the network path, the first k messages of each connection are collected, k is a constant, which can meet the needs of subsequent steps; the TCP protocol itself has the concept of connection in the underlying protocol, and the datagram-based UDP protocol identifies a connection through a four-tuple similar to TCP, namely, source address, source port, destination address and destination port, and "UDP connection" refers to the connection identified in this way; retrieval of TCP connection: further, after the data collection is completed, all TCP connections are traversed, and group statistics are performed according to the following results: if a TLS handshake is detected, the application layer protocol version is negotiated with the server, namely, HTTP / 1.x or HTTP / 2. Modern browsers mostly use the ALPN extension of TLS for negotiation. Therefore, in the network path, the start of an HTTP access can be identified by observing the negotiation result of ALPN. The ALPN extension is located in the TLS handshake, in the "Client Hello" message initiated by the client; both of their messages can be discovered by the traffic monitoring or forwarding program on the network path, so the TLS handshake initiation moment can be located, that is, the "Client Hello" message is sent. At the same time, the "Client Hello" message usually comes with an SNI extension. By reading the information in it, we can get the domain name information of the corresponding website; the ALPN negotiation result will be reflected in the "Server Hello" message sent back by the server. If the negotiation result is HTTP / 1.x or HTTP / 2, it means that this TCP connection is about to initiate a TCP-based HTTP request; then by retrieving the TCP message transmitted on this basic TCP connection and analyzing its type, we record the time t when the HTTP request starts to be sent. 1 , and the time t when the first HTTP response is received from the server 2 Therefore, t d =t 2 -t 1 This is the required HTTP response delay. If the TLS handshake is not detected, the unencrypted HTTP connection can only be the HTTP / 1.x version, and the HTTP request header is a plain text. Continue to retrieve the transmission message of this TCP connection. If an HTTP request is detected, parse the HOST field to determine the domain name, and at the same time determine its sending time t 1 , find the time when the first server response arrives after this, which is t 2, the subsequent steps are the same as detecting the TLS handshake; retrieve the UDP connection. The only HTTP protocol using UDP is HTTP / 3 based on QUIC, so the UDP connection containing the QUIC handshake can be screened out. Because the QUIC protocol comes with TLS encryption, an HTTP access is identified based on the ALPN extension of TLS. At this time, the negotiation result of ALPN is HTTP / 3, and the corresponding domain name information is determined by the SNI extension; retrieve these UDP connections and obtain the time t when the HTTP request starts to be sent 1 , and the time t when the first HTTP response is received from the server 2 The following steps are the same as those described in the TLS handshake detection step; clustering and statistics, based on the HTTP access t of different domain names d The values ​​are clustered separately to separate the back-to-origin requests from the non-back-to-origin requests, thereby calculating the back-to-origin rate for a certain domain name during this period of time. The clustering method described above can separate two groups of significantly different response delays.

[0032] Considering that the HTTP versions currently used by various websites range from the earlier HTTP / 1.0 to the latest HTTP / 3, and their underlying protocols are also divided into TCP and UDP, they should be discussed separately. HTTP / 1.0 and HTTP / 1.1 are referred to as HTTP / 1.x below. This series of versions is based on the TCP protocol and does not require the use of TLS encryption; HTTP / 2 is also based on the TCP protocol, but the current browser implementations all require the use of TLS encryption, so the HTTP / 2 protocol without TLS encryption is not discussed; HTTP / 3 (draft) uses the UDP-based QUIC protocol, and the QUIC protocol comes with TLS encryption. Therefore, the above situations will be discussed separately below. Considering that there are many situations and the specifications of each version are different, we use the bypass analysis method to ensure the robustness of the forwarding system and improve the overall forwarding efficiency. The present invention uses the CDN website's return rate from the perspective of the network service provider to observe and count the return rate. The whole process is transparent to the user, only the traffic type is monitored, and there is no privacy risk, which is convenient for optimizing each site from the perspective of the network service provider.

[0033] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, exemplary types of hardware logic components that may be used include, without limitation, field programmable gate arrays, application specific integrated circuits, application specific standard products, systems on chip systems, load programmable logic devices, and the like.

[0034] The program code for implementing the method of the present invention can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code can be executed entirely on the machine, partially on the machine, partially on the machine as a stand-alone software package and partially on a remote machine, or entirely on a remote machine or server.

[0035] In addition, although each operation is described in a specific order, it should be understood that such operation is required to be performed in the specific order shown or in a sequential order, or that all illustrated operations should be performed to obtain the desired result. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although several specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present invention. Certain features described in the context of a separate embodiment can also be implemented in a single implementation in combination. On the contrary, the various features described in the context of a single implementation can also be implemented in multiple implementations individually or in any suitable sub-combination. Although the subject matter has been described in a language specific to structural features and / or method logic actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims.

Claims

1. A method for observing the return rate of a CDN website in a network path, characterized in that: The method includes: 1) Data collection: In the process of observing the initiation of each connection of network messages in the network path, the first k messages of each connection are collected, where k is a constant; the TCP protocol itself has the concept of connection in the underlying protocol, while the datagram-based UDP protocol identifies a connection through a four-tuple similar to TCP, which includes source address, source port, destination address and destination port. UDP connection refers to the connection identified in this way; 2) Retrieve TCP connections: After data collection is completed, traverse all TCP connections and perform group statistics based on the following results: If a TLS handshake is detected, the start of an HTTP request is identified by observing the ALPN negotiation result in the network path. The ALPN extension is located in the TLS handshake, that is, the Client Hello message initiated by the client. The ALPN extension is discovered by the traffic monitoring or forwarding program on the network path, and the time when the TLS handshake is initiated, that is, the time when the Client Hello message is sent, is recorded; the Client Hello message is accompanied by an SNI extension, and the domain name information of the corresponding website is obtained by reading the information in the SNI extension; the ALPN negotiation result is reflected in the Server Hello message sent back by the server. If the negotiation result is HTTP / 1.x or HTTP / 2, it indicates that this TCP connection is about to initiate a TCP-based HTTP request; then, by retrieving the TCP messages transmitted on this TCP connection and analyzing their types, the time when the HTTP request starts to be sent is recorded in sequence. , and the time when the first HTTP response is received from the server ;Response delay is the time difference between the first HTTP request and the first HTTP response in each connection, so This is the required HTTP response delay; If no TLS handshake is detected, the unencrypted HTTP connection is only HTTP / 1.x, and the HTTP request header is plain text. Continue to retrieve the transmission message of this TCP connection. If an HTTP request is detected, parse the HOST field to determine the domain name and determine the time when the request starts to be sent. , find the time of the first server response after that ,therefore This is the required HTTP response delay; 3) Retrieve UDP connections. The only HTTP protocol using UDP is HTTP / 3 based on QUIC. Therefore, UDP connections containing QUIC handshakes are selected. Since the QUIC protocol comes with TLS encryption, an HTTP request is identified based on the ALPN extension of the QUIC handshake. At this time, the negotiation result of ALPN is HTTP / 3, and the corresponding domain name information is determined by the SNI extension. Retrieve these UDP connections and obtain the time when the HTTP request starts to be sent. , and the time when the first HTTP response is received from the server ,therefore This is the required HTTP response delay; 4) Clustering and statistics, based on HTTP requests from different domain names The values ​​are clustered separately to separate the back-to-origin and non-back-to-origin requests, so as to calculate the back-to-origin rate for a certain domain name.

2. According to claim 1, a method for observing the return rate of a CDN website in a network path is characterized in that: The method for observing the return rate of the CDN website adopts a bypass analysis method.

3. According to claim 1, a method for observing the return rate of a CDN website in a network path is characterized in that: The retrieved connection identifies and identifies the underlying TCP or QUIC connection that initiated the HTTP request through the negotiation of the ALPN extension in the TLS handshake.

4. According to claim 1, a method for observing the return rate of a CDN website in a network path is characterized in that: The domain name information is obtained using the SNI extension of the TLS handshake or the HOST field in the HTTP request in the identified connection.

5. A method for observing the return rate of a CDN website in a network path according to claim 1 or 4, characterized in that: The method for obtaining the domain name information is to arrange a DNS resolution cache server on the client side in advance to query the corresponding relationship between the IP address and the domain name, or to reversely query the domain name using the PTR instruction of the DNS.

Citation Information

Patent Citations

  • Method and device for determining return source path, server and readable storage medium

    CN109412946A

  • Resource access method, device and system, electronic equipment and storage medium

    CN112202631A