Chapter 13 loopback UDP experiment, 2026-09-20 Run: python3 udp.py Only Python standard library and IPv4 loopback sockets are used. Ports are allocated by the OS. Three sockets form sender -> application proxy -> receiver. Every recvfrom source is checked against the expected bound peer. Each operation has a two-second socket timeout. ExitStack/with closes sockets on all paths. The sender submits one-byte ASCII payloads 0,1,2,3,4. The proxy really receives each, drops1, holds2, emits3 before held2, and emits4 twice. Receiver obtains 0,3,2,4,4. Logs preserve sendto return counts, actual received bytes, peer addresses and injection actions. These effects are injected in application code; they are not observations of spontaneous network loss/reordering. Sequential receive after each planned forward controls the demonstration. It does not measure congestion, jitter, datagram reliability or performance. A separate socket pair sends a zero-byte datagram: sendto returns0 and recvfrom receives b''. A later 11-byte after-empty datagram still arrives. A subsequent 10-byte abcdefghij datagram is read with recvmsg buffer4: abcd is returned with MSG_TRUNC. The next NEXT datagram arrives intact, without the discarded efghij suffix. No UDP EOF interpretation is used. If recvmsg/MSG_TRUNC is absent the script reports that subsection skipped. First sandbox invocation was denied at loopback bind with PermissionError, before sending. The authorized escalated invocation of this script succeeded; no production or external address was contacted. No forbidden check program, BPF capture, network-route modification or package installation was used. run.json is unedited stdout of the successful invocation and contains actual platform, Python version and ephemeral ports. Repeated runs need not have identical addresses or ports. --help exit0, --bad exit2; Python no-excuse checker zero violations. No packet-capture, kernel-loss, public-network, TCP, ICMP or production end-to-end claim follows from these localhost application observations.