使用 libpcap 限速发送数据包

发布于 2024-10-06 02:36:43 字数 329 浏览 0 评论 0原文

我编写了一个程序,以高速(约 1Gbps)从某个 NIC(即 eth0)捕获以太网数据包,并使用 pcap_sendpacket() 将流量转发到另一个 NIC(即 eth1)。

虽然转发器以太网接口没有连接到另一台计算机网卡,但转发速度是理想的,但是当我连接它时,发送速度急剧下降(从 900 Mbps 到 100 Mbps)。

有人能解释一下原因吗?

<子> 操作系统:Kubuntu linux 10.10
语言:C++
:Libpcap

I wrote a program that captures Ethernet packets from some NIC (i.e eth0) at high speed (about 1Gbps) and forward traffic using pcap_sendpacket() to another NIC (i.e eth1).

While the forwarder Ethernet interface is not connected to another computer NIC, forwarding speed is desired, but when I connect it, sending speed gets down awfully (from 900 Mbps to 100 Mbps).

Can anybody explain the reason?


OS: Kubuntu linux 10.10
Language: C++
Library: Libpcap

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

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

发布评论

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

评论(2

智商已欠费 2024-10-13 02:36:43

因为目标 NIC 是 100 Bbps 接口 :D :p

Because the destination NIC is a 100 Bbps interface :D :p

会发光的星星闪亮亮i 2024-10-13 02:36:43

或者网络设备的自动协商已关闭,正在先尝试100Mbps。

Or the auto-negotiation for the network device has been turned off and is trying 100Mbps firstly.

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