通过数据包测量响应时间?

发布于 2024-08-23 01:34:28 字数 159 浏览 16 评论 0原文

再会! 我正在用 c++ 和 winpcap 开发一个应用程序,它将列出浏览器中访问的所有 URL 及其相应的响应时间。 目前,我现在可以通过捕获和分析数据包来跟踪或监控所有访问的 URL。 有什么方法可以测量网页加载的响应时间(从发出请求到服务器响应)? 有什么简单的方法吗?

谢谢..

good day!
im developing an app in c++ and winpcap that will list all the URL accessed in the browser with its corresponding response time..
currently, i can now track or monitor all accessed url through capturing and analyzing packets..
is there any way of measuring the response time of a web page to load, from the request made to the server's response?..
any easy way?

thanks..

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

夏了南城 2024-08-30 01:34:28

您必须跟踪浏览器和服务器之间的各个 TCP 连接 -
这只是跟踪您捕获的数据包中的源/目标 IP 和端口号。

然后,您必须解析捕获的数据包中的 HTTP,并将 HTTP 请求与其响应相关联,并获取时间差(您可以从 pcap 的时间戳中获得时间差)。

在 HTTP 请求/响应跨越多个数据包的情况下,这很重要,如果您还想考虑丢失的数据包和重传,这当然也很重要。

You will have to keep track of the individual TCP connections between the browser and the server -
that's just keeping track of the source/destination IP and port numbes in the packets you capture.

Then you'll have to parse the HTTP in the captured packets and correlate HTTP requests with its response and take the time difference(which you'll get from the timestamps from pcap).

This is non-trivial in the cases the HTTP request/responses spans several packets, and certainly non-trivial if you also want to account for lost packets and retransmission.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文