如何充分利用带宽?
我使用 WinPcap 制作了一系列自定义 UDP 数据包并将它们注入以太网层。
我发送了 1000 个数据包,每个数据包 1440 字节。 100 Mbps 带宽需要 2.1 秒。
如何充分利用带宽?
Using WinPcap I crafted a series of custom UDP packets and injected them into the Ethernet layer.
I sent 1000 packets, 1440 bytes each. It takes 2.1 sec for 100 Mbps bandwidth.
How do I make use of full bandwidth?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
您的吞吐量似乎正是 10 mbit 连接所获得的最大值。 确定没有任何地方涉及 10mbit 吗?
Your throughput seems to be exactly the max you'd get for a 10 mbit connection. Sure there's no 10mbit involved anywhere ?
最初我误读了这个问题,并认为它是 这个的重复。 但100Mbps就完全不同了。
即使是非常普通的硬件也应该能够毫无问题地使 100Mbps 连接饱和 - 特别是当您使用 1440 字节 udp 数据包时。
正如 krosenvold 所建议的,这些数字看起来确实令人怀疑是 10Mbps 连接,而不是 100Mbps。 我会从头到尾检查所有链接,以确保它们达到您认为的 100Mbps。 该链中的任何 10Mbps 链路都会出现问题。
根据您使用的设备,您可能会发现链路自动协商存在问题。 有些设备的性能非常差,因此您可以通过关闭自动协商并将链接速度强制为 100Mbps 来找到更好的结果。
由于您正在使用 pcap 文件,我建议尝试 tcpreplay 进行一些速度测试。 tcpreplay 提供了多个选项来以尽可能高的速度重播文件。 (特别是,请查看此 wiki条目)
如果这给您带来了不同的结果比您目前看到的更可能表明 pcap 文件存在问题。 例如,pcap 文件确实包含重播文件时可以使用的计时信息。 如果您的 pcap 文件中的计时取自 10Mbps 网络(例如),那么实时重播它将为您提供您所看到的结果。
Originally I misread the question, and thought that it was a duplicate of this. But the 100Mbps makes it completely different.
Even very modest hardware should be able to saturate a 100Mbps connection with no problems - particularly if you're using 1440 byte udp packets.
As suggested by krosenvold, the figures do look suspiciously like a 10Mbps connection, rather than 100Mbps. I would check all of the links from end to end to make sure that they are at the 100Mbps that you believe them to be. Any 10Mbps link in that chain is going to be a problem.
Depending on the equipment that you're using you may find that there have been issues with link autonegotiation. Some equipment is notoriously bad, so you may find better results by turning autonegotiation off, and forcing the link speeds to 100Mbps.
And as you have a pcap file that you're using, I would suggest trying tcpreplay to do some speed testing. There are several options that tcpreplay provides to replay files at the highest possible speed. (in particular, look at this wiki entry)
If that gives you different results than you're seeing at the moment it could point to a problem with the pcap file. For example, the pcap files do contain timing information that can be used when replaying the file. If the timing in your pcap file was taken from a 10Mbps network (for example) then replaying it in real time will give you the result that you're seeing.
确保数据交换路径上的所有设备和介质都以 100 mbps 的速度运行,连接的速度取决于其最薄弱的链路。 另请确保所有设备(包括您的网卡)都在全双工模式下运行。
Make sure all devices and mediums on the data exchange route are operating at 100 mbps, a connection is only as fast as it's weakest link. Also make sure all devices (including your network card) are operating in Full-Duplex mode.
传输过程中 CPU 使用情况如何?
我们需要找到瓶颈。 它可以是 NIC/网络或 CPU。
确保您没有为每个数据包“打开”NIC。
错:
好:
What about CPU usage during the transfer?
We need to find the bottleneck. It can be the NIC/network or the CPU.
Make sure that you are not "opening" the NIC for each packet.
Wrong:
Good: