测量数据包丢失与Java [英] Measuring packet loss with Java

查看:193
本文介绍了测量数据包丢失与Java的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个应用程序,它通过分析网络连接的质量,其中的一部分是测量数据包丢失。

I'm developing an app that analyses the quality of your internet connection, and part of that is measuring packet loss.

我想包发送到一个IP地址,但我怎么能发送消息,并检查他们返回?我猜我需要发送一个包提示的答复,但我不能找到一个很好的例子无论是使用搜索或谷歌。

I was thinking of sending packages to an IP address, but how can I send messages and check that they return? I'm guessing I need to send a package prompting a reply, but I can't find an example of that using either search or Google.

或者我应该利用现有的流量(如何?)?

Or should I use existing traffic(how?)?

除此之外,我怎么衡量往返时间?

Besides that, how do I measure round trip time?

推荐答案

由于TCP是可靠的运输,你没有看到丢弃的数据包。在Linux中,你可以用ifconfig看看有多少你重发发生。我不知道是什么命令行工具会告诉你该在Android上,但你需要使用的系统工具给你这些信息。

As TCP is reliable transport, you don't see dropped packets. In Linux you can use ifconfig to see how many retransmits you incurred. I am not sure what command line tools would show you this on Android, but you would need to use a system tools to give you this information.

顺便说一句,您可以估算使用UDP packets.The丢包率的UDP和TCP是不一样的,但它给你一个想法丢包。

BTW You can estimate the packet loss using UDP packets.The packets loss rate for UDP and TCP is not the same but it gives you an idea.

这篇关于测量数据包丢失与Java的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆