Summary
- RFC 1928 gave SOCKS5 a UDP relay whose life was leased from a TCP connection: when the stream carrying the
UDP ASSOCIATErequest ended, the association ended with it. The stream supplied a lifetime, never a transport. - The relay address it handed back, the client’s source IP, each datagram’s destination envelope, and any authentication or fragment state were separate claims. None of them, alone, proved a user, a final recipient or a successful delivery.
A valid datagram, a live port, and a relay that has already moved on
Picture the moment. A client has been pushing name lookups or real-time media through a SOCKS relay all afternoon. The UDP path is busy and healthy. Then the separate TCP socket closes — the client process exits, a firewall forgets its state, a mobile path flips, the proxy restarts. A moment later, one more datagram lands on the relay’s UDP port. Header valid. Destination clear. Payload intact.
The relay drops it.
RFC 1928, published in March 1996, is the reason. It refused to let recent traffic count as authority. The UDP association terminates when the TCP connection carrying the UDP ASSOCIATE request terminates. The relay may still hold the bytes and a routing table. It no longer holds the live association that gave those bytes a place in its policy.
That rule never turned UDP into a stream. Application data stayed in separate datagrams; loss, duplication and reordering stayed possible. TCP carried method negotiation and the request that created a bounded relay context. Its ending supplied the cleanup evidence for state that UDP has no vocabulary to close on its own.
It was an economical division of labour: a connectionless service gained an explicit beginning and an explicit ending without inventing a UDP close handshake, and without letting idle heuristics become the only source of truth.
The association was born inside a conversation it never used
SOCKS5 opened with a small ritual on a TCP connection: client and server chose an authentication method, then ran the method-dependent exchange. Only after that could the client issue one of three commands — CONNECT, BIND or UDP ASSOCIATE.
The UDP request carried the address and port from which the client expected to send datagrams. A server could use that statement to narrow the association. A client that did not yet know its eventual UDP endpoint sent an all-zero address and port. Zero did not mean “every source is trusted.” It meant the request had no specific value, and the server had to derive or constrain the usable source through its own implementation and policy.
On success the server returned BND.ADDR and BND.PORT. For UDP ASSOCIATE, those fields told the client where to send relay requests. A multihomed server could return an address unlike the one the TCP connection had reached. The binding was therefore an ingress instruction supplied by the relay — not the identity of the ultimate target.
Three addresses could now coexist without contradiction: the TCP address used to reach the SOCKS server, the bound UDP relay endpoint that server returned, and the remote destination carried inside each datagram. Compress them into one “proxy address” and you destroy exactly the evidence the protocol went to the trouble of making observable.
Every datagram carried its own destination
The client did not commit to one permanent UDP destination when it opened the association. Every datagram sent to the relay carried a small SOCKS header: two reserved octets, a FRAG field, an address type, a destination address, a destination port and the payload.
That envelope let a single association relay messages toward different destinations. It also made the relay an active interpreter rather than an invisible packet pipe. The relay stripped the SOCKS header, sent the payload onward, and wrapped replies in the same grammar so the client could see which remote address and port had answered.
The grammar handed the relay bounded authority. It could evaluate destination and policy per datagram. It could report the origin of a returned datagram. It could not convert acceptance at its own UDP port into proof that the remote host received the packet, that an application processed it, or that a reply belonged to a human actor.
Nor did BND.ADDR become a portable capability. Once the control connection ended, sending another syntactically perfect envelope to the old port did not recreate the association. A remembered address was not remembered permission.
A source IP is a location, not a person
RFC 1928 required the UDP relay to learn the expected client IP address from the SOCKS server and silently drop datagrams arriving from any other source IP for that association. That closed an obvious door through which an unrelated host might inject traffic into an established relay context.
The test stayed modest. A source IP can be shared by processes, users or machines behind translation. It can change mid-session during mobility. It says where a datagram appeared at the relay — not which person caused it, whether the same application opened the TCP connection, or whether the destination will accept the traffic.
Authentication belonged to the earlier method negotiation. Even there, “SOCKS5 authenticated” was never one universal fact. RFC 1929 defined a username/password method whose credentials travel in cleartext inside that subnegotiation and warned against using it where sniffing is possible. RFC 1961 defined a GSS-API method that could provide authentication, message integrity and optional confidentiality through negotiated protection levels.
The base protocol made room for those properties. It did not manufacture them. An operator had to retain which method was selected, which protection it actually supplied, and whether that protection covered subsequent relay messages. A version number was never a security receipt.
The FRAG octet: optional state with a five-second floor
The FRAG octet is easy to misread as an IP fragmentation field. It belonged to the SOCKS UDP envelope. Zero meant the datagram stood alone. Values from one through 127 described positions in a SOCKS fragment sequence, and the high bit marked the end.
Supporting the feature was optional. An implementation without reassembly had to discard every datagram whose FRAG was nonzero. A supporting receiver kept a reassembly queue and a timer. Expiry abandoned the queued fragments. A new fragment numbered below the highest value already processed also reset the queue. The timer could not be shorter than five seconds, and the specification recommended that applications avoid fragmentation where possible.
This was not reliable transport in miniature. There was no acknowledgment grammar, no retransmission promise, no licence to preserve an incomplete sequence indefinitely. The state was local, finite and disposable. Its job was reconstruction, not delivery certification.
That distinction is where diagnosis lives or dies. A missing application message might have been lost before the relay, rejected for source mismatch, dropped because fragmentation was unsupported, abandoned after timer expiry, sent toward the destination and lost later, or received without producing a reply. “The proxy dropped UDP” is not a finding until you know which decision point fired.
Why not an idle timer? Because silence lies
Why let the association die with TCP instead of keeping it alive until an idle timer expires? An idle timer reclaims resources, but silence has several causes. A quiet application, a broken return path and a dead client look identical from the relay’s chair. Recent UDP traffic proves activity; it does not prove that the authenticated principal or process which requested the association still controls it.
The control connection supplied a stronger, if still bounded, lifecycle fact. While it survived, the SOCKS server could tie method state, request policy and the UDP relay entry to one live conversation. When it ended, the protocol chose revocation over guesswork. A client wanting more service had to establish a fresh context.
That choice imposed costs. A transient TCP failure could interrupt otherwise healthy UDP traffic. A mobile address change could make both the control path and the source-IP binding stale. Keeping a stream open consumed resources. But those costs were visible and testable. The alternative — an orphan relay that stayed usable because packets kept arriving — would have made authority depend on traffic the relay itself could not confidently attribute.
What the IPv6 gateway inherited
RFC 3089 described an Informational SOCKS-based IPv6/IPv4 gateway in 2001. It relayed between terminated IPv4 and IPv6 connections at the application layer and inherited the native SOCKS command set, UDP ASSOCIATE included.
That later use shows both the reach and the restraint. SOCKS could bridge address families without pretending to be an IP router. Domain-name resolution could be delegated to a dual-stack gateway when an old application could not store an IPv6 address. Yet the gateway still acted through application-layer relay state. It never erased the distinction among name, address, control association and forwarded data.
The historical achievement was not a universal tunnel. It was a small common grammar that let endpoints ask a relay to perform bounded work while leaving deployment policy local.
Sources
Member Briefing
Read the full trend briefing
Members read the full briefing with the source notes behind every finding.
Strategic Circle
A daily briefing in your language, built from changes we have verified.
Join for USD 20/monthCancel anytime.
Members also get the full research library, a daily briefing on the networks they follow and the private forum.






