<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Robin Vidal]]></title><description><![CDATA[Distributed systems and stuff.]]></description><link>https://robin-vidal.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Fri, 04 Dec 2026 21:14:46 GMT</lastBuildDate><atom:link href="https://robin-vidal.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Count Round Trips, Not Bytes]]></title><description><![CDATA[Doubling bandwidth won't speed up small requests. Cutting round trips will: measured with curl, then proven with pipelining in a few lines of Rust.]]></description><link>https://robin-vidal.hashnode.dev/count-round-trips-not-bytes</link><guid isPermaLink="true">https://robin-vidal.hashnode.dev/count-round-trips-not-bytes</guid><category><![CDATA[networking]]></category><category><![CDATA[latency]]></category><category><![CDATA[performance]]></category><dc:creator><![CDATA[Robin Vidal]]></dc:creator><pubDate>Thu, 03 Dec 2026 19:49:18 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/6aff9587003edc316941cc12/d62cabe0-577b-4c59-a8ec-9a794cc9e0ab.webp" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>In <a href="https://robin-vidal.com/writing/where-network-latency-comes-from/">Where Network Latency Comes From</a>, we found that a round trip from Paris to New York costs 87 ms, and that most of it is distance, which no upgrade can buy back. So if a round trip can't get cheaper, the only lever left is to make fewer of them. But how many round trips does a request really need, and how much can we save by cutting them?</p>
<h2>The Round Trip Is the Unit of Cost</h2>
<p>That 87 ms is the <strong>round-trip time (RTT)</strong> of a small message from Paris to New York.</p>
<p>But sometimes we need multiple round trips for an operation. For example, loading an HTTPS page for the first time needs 3 round trips:</p>
<ul>
<li>first, the connection,</li>
<li>then, securing it,</li>
<li>finally, the request.</li>
</ul>
<p>The formula to estimate the total time of an operation is:</p>
<p>$$\text{time} \approx \text{round trips} \times \text{RTT}$$</p>
<p>So \(3 \times 87 \approx 261\) ms for a page of a few bytes.</p>
<p>To know if an operation will be slow, we don't count the bytes, we count the round trips (the article title was chosen carefully).</p>
<h2>How Many Round Trips in One Request?</h2>
<p>Now it's time to test if our prediction of 261 ms is accurate. We are going to use the same server as in the previous article (<code>nj-us-ping.vultr.com</code>), so the 87 ms RTT still applies.</p>
<p>Here is the command:</p>
<pre><code class="language-bash">curl -s -o /dev/null -w 'dns=%{time_namelookup} connect=%{time_connect} tls=%{time_appconnect} ttfb=%{time_starttransfer}\n' https://nj-us-ping.vultr.com/
</code></pre>
<p>Let's break it down:</p>
<ul>
<li><code>curl</code>: a tool that sends a request to a URL and prints the response,</li>
<li><code>-s</code>: silent mode (no progress bar),</li>
<li><code>-o /dev/null</code>: throws the page away (we only care about the timings here, not the HTML),</li>
<li><code>-w '...'</code>: prints a line once the transfer ends, where each <code>%{...}</code> is replaced with a timer:<ul>
<li><code>time_namelookup</code>: the DNS lookup is done,</li>
<li><code>time_connect</code>: the TCP connection is open,</li>
<li><code>time_appconnect</code>: the TLS handshake is done,</li>
<li><code>time_starttransfer</code>: the first byte of the response arrived.</li>
</ul>
</li>
</ul>
<blockquote>
<p><strong>TIP: The timers add up</strong></p>
<p>We need to subtract the previous timer at each step to get the cost of one step, because each timer counts from the start of the command and not from the previous step.</p>
</blockquote>
<p>Here is the output:</p>
<pre><code class="language-text">dns=0.014213 connect=0.101487 tls=0.192534 ttfb=0.281406
</code></pre>
<table>
<thead>
<tr>
<th>Step</th>
<th>Measured</th>
<th>Predicted</th>
</tr>
</thead>
<tbody><tr>
<td>TCP connection</td>
<td>~87 ms</td>
<td>87 ms</td>
</tr>
<tr>
<td>TLS</td>
<td>~91 ms</td>
<td>87 ms</td>
</tr>
<tr>
<td>Request</td>
<td>~89 ms</td>
<td>87 ms</td>
</tr>
<tr>
<td><strong>Total</strong></td>
<td><strong>~267 ms</strong></td>
<td><strong>261 ms</strong></td>
</tr>
</tbody></table>
<p>We predicted 261 ms and measured 267 ms. Each step costs about one RTT, as expected. TLS is a bit slower because the client and the server also have to compute the encryption keys, and the request because the server has to build the response. The DNS lookup (14 ms) is not in the total: it goes to a resolver close to us, not to New York. Three round trips, about three RTTs: the formula holds.</p>
<h2>Ten Requests, One Round Trip</h2>
<p>Now that the connection is open, each new request costs one RTT. So what if the page needs 10 small pieces of data from the same server (a profile, notifications, etc.)? One after the other, it takes \(10 \times 87 \approx 870\) ms. If only we had a method to send all requests together to save on RTT.</p>
<p>There is a method (unbelievable, right?): <strong>pipelining</strong>. This means sending all requests without waiting for a response, then reading the responses as they come back. Requests travel together, so we pay only about one RTT. It's like posting 10 letters and waiting for the responses instead of posting one letter, waiting for a response, then repeating this 9 more times.</p>
<p>Let's build a small local Rust UDP server and a client that talks to it, so we can see the difference in latency between classic sequential requests and pipelining.</p>
<p>To simulate the 87 ms RTT we measured, the server creates a new thread for each request. That thread sleeps for 87 ms, then replies to the client with the message it received. The client will send 10 requests, to stick to our previous example.</p>
<p>Creating a new thread allows the server to handle multiple requests at the same time, so they don't block each other.</p>
<p>The code for both the server and the client is available on <a href="https://github.com/robin-vidal/writing-lab/tree/main/count-round-trips-not-bytes">the writing-lab repository</a>.</p>
<h3>The Sequential Mode</h3>
<p>The sequential mode in the client is a simple loop that sends a message, waits for the reply, and repeats.</p>
<pre><code class="language-rust">for _ in 0..REQUESTS {
    socket.send(MESSAGE)?;
    recv_and_check(socket, &amp;mut buf)?;
}
</code></pre>
<p>Here, <code>recv_and_check</code> receives the reply and checks it's the same message. And <code>?</code> just stops the program in case of an error.</p>
<p>Let's run it:</p>
<pre><code class="language-bash">cargo run --bin client sequential
</code></pre>
<pre><code class="language-text">908.983125ms
</code></pre>
<p>Our prediction was 870 ms for 10 requests and the result is ~909 ms. It's really close, only ~4 ms off per request. The small difference comes from <code>sleep</code>, which wakes up late, and from the thread that can take some time to be created. We can conclude that the sequential mode costs about one RTT per request.</p>
<h3>The Pipelining Mode</h3>
<p>The pipelining mode in the client splits the loop from the sequential mode in two: one sending all requests in a row, one receiving all responses in a row. The requests leave one right after the other, without waiting, so they travel together.</p>
<pre><code class="language-rust">for _ in 0..REQUESTS {
    socket.send(MESSAGE)?;
}

for _ in 0..REQUESTS {
    recv_and_check(socket, &amp;mut buf)?;
}
</code></pre>
<p>Let's run it:</p>
<pre><code class="language-bash">cargo run --bin client pipelined
</code></pre>
<pre><code class="language-text">92.51975ms
</code></pre>
<p>As we can see, the responses came back about 10 times faster: we predicted about 87 ms and measured 92.5 ms. We casually demonstrated that we paid the RTT only once and not for each request (pretty neat, huh?).</p>
<p>Notice that both modes sent exactly the same bytes. The only thing that changed is the number of round trips: same bytes, ten times fewer round trips, ten times faster.</p>
<p>But pipelining has a catch: it only works when the requests don't depend on each other. If a request needs the answer to another request, it must wait for that answer. As we saw earlier, each request waiting for another one to respond costs one round trip.</p>
<h2>Filling the Pipe</h2>
<p>Based on what we saw, the sequential and the pipelining modes might look totally opposed. In reality, they are the two ends of the same dial: the number of requests we keep in flight. The sequential mode keeps one, the pipelining mode keeps all of them. And in practice, we rarely live at the extremes.</p>
<p>One request at a time is too slow, as the sequential mode showed. All of them at once doesn't work either, because with too many requests, the server and the memory can't keep up. So instead, we use a window: we keep at most $N$ requests in flight.</p>
<p>First, we send $N$ requests to fill the pipe (hence the section title). Then, we wait for the responses, like in the pipelining mode. But each response means one request is no longer in flight, so we send the next one right away to keep the pipe full. With this mode, we expect the <strong>throughput</strong>, the number of requests handled per second, to be:</p>
<p>$$\text{throughput} \approx \frac{N}{\text{RTT}}$$</p>
<p>Every round trip, a full window of $N$ requests comes back.</p>
<p>Like the pipelining mode, we need two loops. The first one fills the window. It sends $N$ consecutive requests, or all of them if $N$ is greater than the total. The second one slides the window. For each response, we send the next request so the number of requests in flight doesn't change. Once everything is sent, the window empties until all responses come back.</p>
<pre><code class="language-rust">let initial_window = min(n, WINDOW_REQUESTS);
for _ in 0..initial_window {
    socket.send(MESSAGE)?;
}

let mut sent = initial_window;
let mut in_flight = initial_window;
while in_flight &gt; 0 {
    recv_and_check(socket, &amp;mut buf)?;
    if sent &lt; WINDOW_REQUESTS {
        socket.send(MESSAGE)?;
        sent += 1;
    } else {
        in_flight -= 1;
    }
}
</code></pre>
<p>For our examples, the window mode sends 200 requests, set by <code>WINDOW_REQUESTS</code> in the client. With only 10 requests, a window of 10 would already send everything at once, and there would be no middle of the dial to test.</p>
<p>Let's try with a maximum of one request in flight.</p>
<pre><code class="language-bash">cargo run --bin client window 1
</code></pre>
<pre><code class="language-text">18.11214975s
</code></pre>
<p>As you can see, that's pretty slow. It's also equivalent to the sequential mode. To compare with the same number of requests, set <code>REQUESTS</code> to 200 in the client first, then run the sequential mode:</p>
<pre><code class="language-bash">cargo run --bin client sequential
</code></pre>
<pre><code class="language-text">18.042476792s
</code></pre>
<p>See? That's totally normal. With a maximum of one request in flight, we wait for a response after each request we send, exactly like the sequential mode.</p>
<p>Now let's try with 200 requests (all of them):</p>
<pre><code class="language-bash">cargo run --bin client window 200
</code></pre>
<pre><code class="language-text">96.224375ms
</code></pre>
<p>Sending all requests should match the pipelining mode, with <code>REQUESTS</code> still set to 200:</p>
<pre><code class="language-bash">cargo run --bin client pipelined
</code></pre>
<pre><code class="language-text">95.9625ms
</code></pre>
<p>Quite similar. Now, the interesting part: the middle of the dial. In real life, we can't send everything at once, so let's try a window of 10 requests, only 5% of the total. Each round trip now brings back 10 requests, so we expect 200 requests to take about 20 round trips, that is, \(20 \times 87,\text{ms} \approx 1.74,\text{s}\):</p>
<pre><code class="language-bash">cargo run --bin client window 10
</code></pre>
<pre><code class="language-text">1.814752666s
</code></pre>
<p>We predicted 1.74 s and measured 1.81 s: our prediction was almost on point, and the formula holds. With only 5% of the requests in flight, we are already 10 times faster than the sequential mode. In terms of throughput, that's \(200 / 1.81 \approx 110\) requests per second, against \(10 / 0.087 \approx 115\) predicted by the formula.</p>
<p>Now that we can trust our formulas, we can use them without running any code.</p>
<h2>Back of the Envelope</h2>
<p>This article is almost over. You did the hardest part (congrats!). Now, we are going to find out whether cutting the round trips is better than doubling the bandwidth to send small requests from Paris to New York.</p>
<p>To answer, let's take our 10 requests from the <a href="https://robin-vidal.com/writing/count-round-trips-not-bytes/#ten-requests-one-round-trip">Ten Requests, One Round Trip</a> section. Requests are 1 KB each, sent one after the other from Paris to New York over a 1 Gbps connection.</p>
<p>Since each request waits for the previous answer, the initial cost is \(10 \times 87 \approx 870\) ms, 87 ms being the RTT from Paris to New York. The <a href="https://robin-vidal.com/writing/where-network-latency-comes-from/#transmission">transmission</a> adds \(10 \times 1,\text{KB} / 1,\text{Gbps} \approx 0.08\) ms (1 KB = 8000 bits).</p>
<p>Our first lever here is doubling the bandwidth. The transmission drops to around 0.04 ms. We gain 0.04 ms over 870 ms, so basically nothing.</p>
<p>The second lever is cutting the round trips. With pipelining, the 10 requests travel together, and the total drops to about 87 ms. We gain about 780 ms (that's a lot).</p>
<p>To conclude, for small messages, we count the round trips, not the bytes. That's our title (but now with numbers).</p>
<h2>What It Means for Distributed Systems</h2>
<p>In a distributed system, most messages are quite small: votes, acks, heartbeats, log entries. It's the same scenario as <a href="https://robin-vidal.com/writing/count-round-trips-not-bytes/#back-of-the-envelope">Back of the Envelope</a> case. The bandwidth barely matters, so we need to count round trips.</p>
<p>In real systems, pipelining is quite popular. For example, in a Raft cluster, the leader sends every follower the entries they must append (<code>AppendEntries</code> requests). But instead of waiting for each response, it keeps multiple <code>AppendEntries</code> requests in flight, so it costs fewer round trips. That's exactly our <a href="https://robin-vidal.com/writing/count-round-trips-not-bytes/#filling-the-pipe">window mode</a>.</p>
<p>A useful thing to do is to count the round trips of a protocol. For example, a Raft commit costs at least 1 RTT (the leader sends the entry to the followers, then waits for the responses of a majority). 2PC costs 2 RTT (prepare then commit). With one replica in Paris and one in New York, each write costs at least 87 ms, no matter the bandwidth. So to know the cost of a protocol, we count its round trips.</p>
<p>But there is a limit to pipelining, as we saw in <a href="https://robin-vidal.com/writing/count-round-trips-not-bytes/#ten-requests-one-round-trip">Ten Requests, One Round Trip</a>: if a step depends on another one, they cannot be sent together. A 2PC commit must wait for the response of the prepare request. Pipelining cannot solve this. The only ways out are to change the protocol or to move the replicas closer.</p>
<h2>Takeaways</h2>
<p>For small messages, the bytes are almost free. We pay the number of round trips times the RTT, and no bandwidth upgrade can make a round trip cheaper. So we have two levers left: send independent requests together instead of one by one, and count the round trips of a protocol before choosing it. In short, count round trips, not bytes.</p>
<h2>Further Reading</h2>
<ul>
<li><strong>Computer Networking: A Top-Down Approach</strong>, by James Kurose and Keith Ross, section "Principles of Reliable Data Transfer".</li>
<li><strong>High Performance Browser Networking</strong>, by Ilya Grigorik, chapters "Building Blocks of TCP" and "Transport Layer Security (TLS)".</li>
<li><strong>In Search of an Understandable Consensus Algorithm</strong>, by Diego Ongaro and John Ousterhout.</li>
<li><strong>Designing Data-Intensive Applications</strong>, by Martin Kleppmann, chapter "Consistency and Consensus".</li>
</ul>
]]></content:encoded></item><item><title><![CDATA[Where Network Latency Comes From]]></title><description><![CDATA[A ping from Paris to New York takes 28 ms longer than light needs. Here's where the time goes: propagation, transmission, processing and queuing.]]></description><link>https://robin-vidal.hashnode.dev/where-network-latency-comes-from</link><guid isPermaLink="true">https://robin-vidal.hashnode.dev/where-network-latency-comes-from</guid><category><![CDATA[networking]]></category><category><![CDATA[performance]]></category><category><![CDATA[computerscience]]></category><dc:creator><![CDATA[Robin Vidal]]></dc:creator><pubDate>Fri, 20 Nov 2026 00:43:24 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/6aff9587003edc316941cc12/3f253e73-01f7-45a2-8f89-4416ff8f6123.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>A ping from my apartment in Paris to a server near New York takes 87 ms, but light could make that round trip in 58. Where are my missing 28 ms? Can I buy back some of them?</p>
<h2>Where Latency Comes From</h2>
<p><strong>Latency</strong> is the time it takes for a message to travel from one point to another, usually measured in ms or μs. Low latency means faster responses. Groundbreaking, I know.</p>
<p>Let’s follow our message and find out who stole the other 28 ms. During its trip, the message spends time in four places: on the wire (propagation), getting onto the wire (transmission), inside routers (processing), and waiting in line (queuing).</p>
<h3>Propagation</h3>
<p><strong>Propagation</strong> is the time for the signal to physically travel the distance. The propagation formula is <code>distance / signal speed</code>. Light travels at ~200,000 km/s in fiber and New York is 5,840 km away from Paris, so one way should take 29 ms, and 58 ms for the round trip.</p>
<p>But 29 ms is the best case. It assumes a cable running straight from Paris to New York. Real cables don't. We can see where the cables actually run on <a href="https://submarinecablemap.com">submarinecablemap.com</a>.</p>
<p>Notice that the size of the message and the bandwidth (the maximum amount of data a link can carry per second, usually advertised in bits per second) are missing from the formula because no matter the size of the message, the time for the first bit to reach New York is identical. Bandwidth only decides how fast the rest follows.</p>
<blockquote>
<p><strong>Aside: Why 200,000 km/s?</strong> Light crosses a vacuum at about 300,000 km/s. Inside glass, it slows down by a factor of about 1.5, which leaves roughly 200,000 km/s.</p>
</blockquote>
<h3>Transmission</h3>
<p><strong>Transmission</strong> is the time to push all the bits of the message onto the link (a direct connection between two devices, like the cable between our box and the next router). The formula is <code>message size / bandwidth</code>. The result grows with message size and shrinks with more bandwidth. Our ping is 64 bytes on my MacBook and my fiber plan is about 1 Gbps or 125,000,000 B/s. With this configuration our message should take 0.5 μs.</p>
<p>As we can see, distance doesn’t matter here, because transmission ends when the last bit leaves. After that, it’s propagation’s job.</p>
<h3>Processing</h3>
<p><strong>Processing</strong> is the time each router spends reading the packet header (the first bytes of a packet, with the addresses routers read to decide where to send it) and choosing the next link. It's usually a few μs per router, but we have zero control over this step.</p>
<p>As this step is quite fast, going through a dozen routers shouldn't take more than 0.1 ms.</p>
<h3>Queuing</h3>
<p><strong>Queuing</strong> is the time a packet spends waiting in a router buffer, the memory where a router keeps packets waiting for their turn on the outgoing link. It occurs when packets arrive in the router faster than they can be sent out. The usual time spent here ranges from nothing to tens of ms depending on the load.</p>
<p>This step is the most unpredictable part, and it's the main cause of tail latency (the latency of the slowest requests, usually measured as the 99th percentile, or p99).</p>
<h2>So Where Did the Time Go?</h2>
<p>Now we have the tools to answer our question! We need to identify where those 28 ms went.</p>
<p>As the round trip (RTT, for round-trip time) is the sum of the four steps we just saw, once for the client request, once for the server response, we can estimate the time spent in each step from it.</p>
<pre><code class="language-text">RTT = propagation + transmission + processing + queuing    (both ways)
</code></pre>
<p>To get the RTT, we ping a server near New York (here: <code>nj-us-ping.vultr.com</code>), in New Jersey, which changes the math by less than half a millisecond, because it's only about 40 km further from Paris than Manhattan. We repeat this 50 times (<code>-c</code> means "count"), with 0.2 s between each ping (<code>-i</code> stands for "interval").</p>
<pre><code class="language-bash">ping -c 50 -i 0.2 nj-us-ping.vultr.com
</code></pre>
<pre><code class="language-text">PING nj-us-ping.vultr.com (108.61.149.182): 56 data bytes
[more lines]

--- nj-us-ping.vultr.com ping statistics ---
50 packets transmitted, 50 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 85.379/86.679/93.580/1.788 ms
</code></pre>
<h3>Queuing: Average Minus Minimum</h3>
<p>As we can see on the last line, the minimum RTT is 85.379 ms and the average RTT is 86.679 ms.</p>
<p>Out of the four steps, queuing is the only one that changes from one ping to the next. So the fastest ping is the one that waited the least. That means the minimum is our best case (with almost no queuing), whereas the average includes the usual wait. So the difference between the two tells us how long we wait on average compared to the best case. Here we waited about 1.3 ms (<code>86.679 ms - 85.379 ms ≈ 1.3 ms</code>).</p>
<blockquote>
<p><strong>Tip: Never trust a single ping</strong> It's important to send multiple pings. When doing that, the minimum is our floor and the gap between the minimum and the average is queuing. It's much better than doing only one ping because a single ping tells us almost nothing.</p>
</blockquote>
<h3>Transmission and Processing: Too Small to Matter</h3>
<p>Transmission only shows up if we ping with bigger packets (<code>-s 1400</code>) because for our 64-byte ping, it’s only a few μs.</p>
<p>For processing, as no command isolates the time a router spends reading a header, we can’t measure it from the outside. It usually takes a few microseconds per router, so even a dozen routers stay well under a millisecond. We can ignore both.</p>
<h3>Propagation: What's Left</h3>
<p>With queuing out of the minimum, and transmission and processing too small to matter, the minimum RTT is almost pure propagation. Some of it is spent before the message even leaves my apartment. Let's run two quick measurements to see how much:</p>
<pre><code class="language-bash">ping -c 30 -i 0.2 192.168.1.1
traceroute -I nj-us-ping.vultr.com
</code></pre>
<pre><code class="language-text">round-trip min/avg/max/stddev = 4.701/5.607/9.972/1.265 ms

 1  192.168.1.1                            5.350 ms
 7  81.52.170.48                           6.516 ms
 8  be40.br03.nyc06.as3491.net             85.810 ms
13  108.61.149.182.vultrusercontent.com    85.712 ms
</code></pre>
<p>As we can see, my Wi-Fi and box cost about 4.7 ms. Orange's own network adds about 1.8 ms (still in Paris). The next router that answers is already in New York: the whole Atlantic fits in a single hop (seven-league boots would be jealous).</p>
<blockquote>
<p><strong>Aside: What's hiding in those 6.5 ms?</strong> Wi-Fi is a shared radio channel: only one device can talk at a time. Before sending, my MacBook listens, waits for silence, then adds a small random delay so it doesn't talk over a neighbor. If a frame gets corrupted on the way, the Wi-Fi card resends it on its own: ping never sees the loss, only the extra time. Orange's fiber is shared too, between several homes, so my box also waits for its time slot before sending. And when a packet is really lost end to end, resending it is TCP's job, which deserves an article of its own.</p>
</blockquote>
<p>To get the duration of the trip across the ocean, we need to remove those local costs from the minimum: 85.4 − 4.7 − 1.8 ≈ 78.9 ms round trip, so about 39.5 ms one way. At 200,000 km/s, that's about 7,900 km of cable, against 5,840 km in a straight line. The detour alone costs about 20.5 ms.</p>
<h3>The Verdict</h3>
<table>
<thead>
<tr>
<th>Where the time went</th>
<th align="right">Cost</th>
</tr>
</thead>
<tbody><tr>
<td>Queuing</td>
<td align="right">~1.3 ms</td>
</tr>
<tr>
<td>Wi-Fi and box</td>
<td align="right">~4.7 ms</td>
</tr>
<tr>
<td>Orange's network</td>
<td align="right">~1.8 ms</td>
</tr>
<tr>
<td>Cable detour (propagation)</td>
<td align="right">~20.5 ms</td>
</tr>
<tr>
<td>Transmission and processing</td>
<td align="right">a few μs</td>
</tr>
<tr>
<td><strong>Total</strong></td>
<td align="right"><strong>~28.3 ms</strong></td>
</tr>
</tbody></table>
<p>Be careful. These numbers are estimates: we got propagation by subtracting everything else, not by measuring it directly. But the verdict holds because most of the missing time is distance, just more of it than the map suggests. And distance, unlike bandwidth, is something no upgrade can buy back. (Bandwidth will get its moment, just not with a 64-byte ping.)</p>
<blockquote>
<p><strong>Tip: Plug in a cable before measuring</strong> My Wi-Fi alone costs 4.7 ms. Over Ethernet, the first hop usually drops well under a millisecond, and our measurements get a lot less noisy.</p>
</blockquote>
<h2>When Bandwidth Does Matter</h2>
<p>Wait, did I just say bandwidth doesn’t matter? Not quite! Remember, bandwidth decides how fast the rest of the message follows the first bit. So for a 64-byte ping, there's no "rest". For a 10 MB file the rest is almost... everything! Let's see where the switch happens.</p>
<p>Let’s compute how long messages of growing size would take from Paris to New York, one way, over a single 1 Gbps link with the 29 ms of straight-line propagation from earlier:</p>
<pre><code class="language-text">transmission  = message size (bits) / bandwidth (bits per second)
delivery time = transmission + propagation
share         = transmission / delivery time
</code></pre>
<img src="https://dev-to-uploads.s3.us-east-2.amazonaws.com/uploads/articles/bilyjk704ptycqpc2t0m.png" alt="Share of delivery time at 1 Gbps: propagation dominates below 3.6 MB, transmission above" style="display:block;margin:0 auto" />

<p>The switch happens around 3.6 MB, where transmission catches up with propagation (1 Gbps × 29 ms). Below it, distance wins and doubling the bandwidth changes nothing we'd notice: a 1 KB message takes 29 ms at 1 Gbps and still 29 ms at 2 Gbps. Above it, bandwidth wins and doubling it almost halves the time: a 1 GB file drops from 8,029 ms to 4,029 ms.</p>
<p>(This is the clean version: one link, no queuing, and no TCP. Real downloads are slower than this, for reasons we'll get to in the next article.)</p>
<h2>Takeaways</h2>
<p>Most of the time a message spends on the network is distance, and distance is the one thing we can't buy back. Bandwidth helps with big transfers, but most of what distributed systems send is small: requests, acks, heartbeats, Raft votes. For those, the 64-byte ping is the honest model, and distance wins every time.</p>
<p>So if we can't make a round trip cheaper, there's only one lever left: make fewer of them. That's the subject of the next article, <strong>Count Round Trips, Not Bytes (soon)</strong>.</p>
<p>Thanks for reading!</p>
]]></content:encoded></item></channel></rss>