Lab
The path of one request
A program sends one request to a pod behind a Service. Then a fault starts on the path: a A fault that drops each packet without an answer. The peer seems to be there, but nothing comes back., a The process of the peer stops, for example in a long pause of its event loop. Its kernel still answers each packet. or a The network between two nodes breaks for a time, then it heals.. Five layers can find the fault, and each one has its own timers. This page computes, in your browser, when each layer knows.
The program knows first, at 10 s. TCP would know at 15 min 25 s to 18 min 4 s.
A call with a deadline of 10 s and 2 retries, on the defaults of Linux and Kubernetes.
- the fault
- the layer knows, in this band
- recovers
- a send again or a timer
- a probe
- measured median of a cell
The axis is logarithmic, thus the first second and the last hour both fit.
The program
First · Knows at 10 sThe deadline finds the fault at 10 s. 2 retries also wait, and the call fails at 30.6 s.
- Deadline
- 10 s
- Tries
- 3
- The call gives up at
- 30.6 s
The time that a program waits for one reply before it stops the call.The socketThe handle of a program on one TCP connection. The program writes to it and reads from it.
Knows at 15 min 25 s to 18 min 4 sThe socket shows nothing until TCP gives up. At 15 min 25 s to 18 min 4 s, the next read or write returns ETIMEDOUT.
- The write
- returns at once
- Send queue
- the request, until an ACK
TCPRetransmission timeout. TCP sends a segment again if no ACK comes in this time. Each new try waits two times longer.
Knows at 15 min 25 s to 18 min 4 sThe retransmission give-up finds the fault at 15 min 25 s to 18 min 4 s, and the socket gets ETIMEDOUT.
- First RTO
- 201 ms
- Retransmissions
- 15
- Delayed ACK, at most
- 40 ms
- keepalive
- held: tx.retransmit.first cancels it
The socket option that turns on keepalive. It is off on a socket by default.A socket option: the longest time that sent data can stay without an ACK. 0 turns it off.The clock of the kernel: the ticks in each second. A timer fires on a tick, thus it can be late by one tick or more.KubernetesThe program on each node that writes the rules that send the traffic of a Service to its pods.
Cannot see itThe kubelet probes the pod from its own node, and the black hole is on the path between the nodes. Each probe passes, and the pod stays in the Service.
- Propagation, iptables
- 27 ms to 92 ms (measured)
- conntrack keeps this flow
- while packets pass
The program on each node that writes the rules that send the traffic of a Service to its pods.The NICNetwork interface card: the hardware that puts the packets on the wire.
Cannot see itThe NIC sends each segment, 16 after the request. The loss is past its wire, thus its link stays up and its counters show no error.
- A full queue drains in
- 1.2 ms
- Segments it sends after the request
- 16
Link rateMaximum transmission unit: the largest packet on the link, in bytes.
How to read the page
Section titled “How to read the page”- The headline tells which layer knows first, and when.
- The timeline has one lane for each layer, in the sequence of the path. Press Play to see the story. A layer lights when it finds the fault.
- The cards below the timeline give each layer, with its knobs. Change a knob, and each time on the page changes.
- An orange dot is the median that a cell of the harness or of kind measured. It shows only when your settings are the settings of that cell. Its link opens the cell.
Where the numbers come from
Section titled “Where the numbers come from”Each time comes from the algebra of this repository, @mark1russell7/algebra. The algebra operates on four machine documents of @mark1russell7/machines. Two are the TCP stack of Linux 6.6 and its The table of the kernel that remembers each connection through a NAT, for example the address of the pod behind a Service. table. One is the call of the program, with a The time that a program waits for one reply before it stops the call. and its retries. The last is the The kubelet asks the pod a question each period. After a number of failures in a row, the pod leaves the Service. of the The agent of Kubernetes on each node. It starts the pods and probes them. of Kubernetes 1.37.0.
A probe that takes longer than its period starts the next probe at once, because the kubelet probes in sequence. Thus the probes come at intervals of the longer of the period and the timeout.
Each amount prints through format of @mark1russell7/quantity. The page does no timer arithmetic of its own.
What each layer can see
Section titled “What each layer can see”- The program knows only what its own deadline tells it. Without a deadline, it waits for a layer below.
- The socket has no timer. A write goes into the The memory of the kernel that keeps the data that the peer did not acknowledge. at once. The error of TCP comes at the next read or write.
- TCP sends again on each Retransmission timeout. TCP sends a segment again if no ACK comes in this time. Each new try waits two times longer., and it stops after A sysctl: the number of RTO retransmissions before TCP stops the connection. The default is 15, approximately 15 min. retransmissions. On an idle connection, only Probes that TCP sends on an idle connection. If no probe gets an answer, TCP stops the connection. can find the fault.
- Kubernetes probes the pod from its own node. A probe finds a stalled pod, but it does not find a black hole between two nodes. After the pod leaves the Service, The program on each node that writes the rules that send the traffic of a Service to its pods. changes the rules of each node. New connections go to other pods. A connection that is open stays on the old pod, because conntrack keeps its Network address translation. The node rewrites the address of the Service to the address of one pod..
- The NIC sends each segment and sees no error. The loss is past its wire.
Limits
Section titled “Limits”The propagation of a change to the rules of each node has no closed form. The page adds the band that the kind cells measured for each mode. Cilium has no measured band, thus the page shows only the time of the kubelet for Cilium.
The page assumes one round trip. A cell assumes a range of round trips. Thus a band of a cell can differ from the band of the page by a few milliseconds.