大网数据广告活动
服务器运维问答

UDP. Sending speed is limited by the minimal Ethernet adapter configuration

· 52CE 我爱测

I have 1Gbit Ethernet adapter on my computer. And I have the other computer with Ethernet adapter 100Mbit . The both in one LAN and connected through the 1Gbit switch. 1 Test : I try to send from my computer(1Gbit) to the other(1…

问题原文

原帖链接 · Vitali Kuzniatsou · CC BY-SA 4.0

I have 1Gbit Ethernet adapter on my computer. And I have the other computer with Ethernet adapter 100Mbit. The both in one LAN and connected through the 1Gbit switch.

1 Test: I try to send from my computer(1Gbit) to the other(100Mbit) the packets by UDP with speedmore than 100Mbps.

Expected result: The speed is more than 100Mbps. Some packets are lost on the receiving computer(100Mbit).

Actual result: The speed is under 100Mbps (approximately 95~98Mbps). All packets are received on the receiving computer(100Mbit).

The code of the sending side(using PowerShell):

$ipEndPoint = New-Object -TypeName System.Net.IPEndPoint -ArgumentList @([System.Net.IPAddress]::Parse("192.168.102.46"), 15000)
$udpClient = New-Object -TypeName System.Net.Sockets.UdpClient
$udpClient.Connect($ipEndPoint)

while ($true) {
  $bytes = [System.Byte[]]::CreateInstance([System.Byte], 1400)
  $udpClient.Send($bytes, $bytes.Length)
}

2 Test: The same test, but I try to send UDP Broadcast to the current LAN.

Expected result: The speed is more than 100Mbps. Some packets are lost on the receiving computer(100Mbit).

Actual result: The speed is under 100Mbps (approximately 95~98Mbps). All packets are received on the receiving computer(100Mbit).

The code of the sending side(using powershell):

$ipEndPoint = New-Object -TypeName System.Net.IPEndPoint -ArgumentList @([System.Net.IPAddress]::Parse("192.168.102.255"), 15000)
$udpClient = New-Object -TypeName System.Net.Sockets.UdpClient
$udpClient.EnableBroadcast = $true
$udpClient.Connect($ipEndPoint)

while ($true) {
  $bytes = [System.Byte[]]::CreateInstance([System.Byte], 1400)
  $udpClient.Send($bytes, $bytes.Length)
}

Note:

  1. I've tested the code above for the next configuration: sending computer (1Gbit), receiving(1Gbit). I tried to send with speed more than 100Mbps, and actually, the speed was more than 100Mbps.
  2. I've changed for the first two tests adapter settings from 100Mbit to 10Mbit on the receiving computer. And the result: the actual speed is approximately 7~9Mbps instead of 10+ Mbps.

Please, help, why I can't get the expected results?

已采纳解答

原帖链接 · Tomek · CC BY-SA 4.0

If your switch supports Flow Control it is likely sending pause frames to your host to limit transmit rate to what is acceptable on ports it has to forward them to.

You can have a look in advanced settings for the NIC and disable flow control if there is such a setting available.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2018-07-06)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。