2

I'm monitoring the performances of a WAN link with iperf between two windows machines on both ends.

Surprisingly (for me), TCP single session default window reaches a throughput of 12Mbps, while UDP limit (0% packet loss) is about 4Mbps. Bandwidth higher than 5Mbps brings UDP to unacceptable packet loss (>20%).

How can it be?

These results are also confirmed by some UDP real traffic sent over the link (at bandwidth lower than expected capacity) which results in packet loss.

Thanks in advance for any suggestion.

EDIT: forgot to mention an important detail: this is a private network, so it's not a congested link and the extra traffic over the link during these tests (both with iperf and with real traffic) is almost negligible.

EDIT: Can someone provide advices on how to troubleshoot where (in which part of the network) this traffic is dropped?

kuma
  • 130
  • 8
  • Does the traffic cross a router? What else in the path, e.g. does it cross a switch from a 1 Gbps port to a 100 Mbps port? There are many hidden points of congestion on a network. – Ron Maupin Jul 15 '16 at 22:03
  • Yes it crosses: a switched network A-----router A----router B-----switched network B. Doing some troubleshooting, problem seems within one switched network. Yes it crosses switches from 1Gbps to 100Mbps ports. – kuma Jul 15 '16 at 22:16
  • @kuma It sounds like there's some portion of the path that's inconsistent. TCP can adapt, UDP cannot. – David Schwartz Jul 15 '16 at 22:16
  • There are many places where traffic is dropped. A 100 Mbps port cannot keep up with a 1 Gbps stream of traffic, and a lot of frames will be dropped (switches have tiny buffers). UDP has no method to request lost traffic to be resent because the receiving host has no expectation that anything is even coming. TCP will notice that traffic was dropped, and it will resend the traffic. Routers generally do not perform at wirespeed, and often will prioritize TCP over UDP unless configured differently. Without a network design and configurations, it is had to tell where the problem lies. – Ron Maupin Jul 15 '16 at 22:20
  • do you suggest to set all ports involved in this UDP communication (hosts and switches) to 100Mbps? – kuma Jul 15 '16 at 22:26
  • No. UDP is a connectionless, unreliable, fire-and-forget, best-effort protocol. Applications which use UDP expect datagrams to be lost in the network, and either have mitigation built into the application (emulate TCP functions), or the application may have problems if lost datagrams are resent (many real-time applications such as VoIP or video have such problems). Using UDP means that the sender doesn't care if the datagrams are delivered, nor does the receiver expect to receive any datagrams, but if sent datagrams are received then that is great. – Ron Maupin Jul 15 '16 at 22:57
  • I understand TCP/UDP purposes. My question is how to troubleshoot where traffic is dropped. I edited the question for clarity. – kuma Jul 17 '16 at 10:10

1 Answers1

2

Iperf has no logic to maximize the efficiency of UDP traffic over a WAN link. Windows, like most modern operating systems, has gone to significant effort to get every possible drop of TCP throughput possible.

TCP has acknowledgements that adjust a window, sophisticated transmit pacing, and so on. Iperf is just sending the UDP packets at regular intervals.

There's just no comparison.

David Schwartz
  • 61,528
  • 7
  • 100
  • 149
  • I understand optimizations done at OS level. But I still don't understand speaking at link level. If this is expected to provide a throughput of 15Mbps, why sending 5Mbps UDP leads to such high packet loss? Which item is responsible for such losses? Isn't this a symptom of network problem? This also happens with real UDP traffic (no iperf) – kuma Jul 15 '16 at 09:21
  • 1
    @kuma Again, there's a reason so much research and effort went into designing TCP and its congestion control, backoff, transmit pacing, and so on. UDP has none of that stuff. This is why we use TCP for bulk data things that matter (like downloading files) and we use UDP for tiny, latency-sensitive requests (like DNS). UDP has no sensible way to react to congestion unless the application implements it. Iperf doesn't. – David Schwartz Jul 15 '16 at 09:27
  • 1
    I edited the question adding some details. The question is mainly related to possible issues within the network as the link is supposed not to be congested (tests far below link capacity), rather than to how TCP/UDP work. – kuma Jul 15 '16 at 22:03