Keep UDP headers and TCP association lifetime distinct
05UDP ASSOCIATE uses a TCP control connection, then separate header-wrapped UDP datagrams travel through its relay endpoint.
The control TCP connection terminates, ending the association. A later UDP packet cannot keep that association alive and is stopped from using it.
Source for this drawing: RFC 1928 · Read RFC section 7 ↗
New to this? Start hereA quick picture + helpful background
A request starts a conversation.
A client asks for a resource. A server sends a response. The method, address, headers, and status explain what that conversation means.
Helpful first, if these ideas are unfamiliar
These pictures are analogies to help you learn. The linked RFC explains the actual rules.
Terms in this drawing
Related RFCs and changes
“Updates” changes part of an earlier RFC. “Obsoletes” replaces it. This list shows selected related documents.
The IPv6 SOCKS UDP header totals2+1+1+16+2=22 octets before payload and method-dependent overhead. The programming-interface allowance is corrected from20 to22.
Read the updated RFC section ↗The UDP relay belongs to a live TCP association.
- UDP ASSOCIATE DST.ADDR/DST.PORT describe where the client expects to send UDP from. If unknown, the client MUST use an all-zero address and port. The reply BND endpoint is where the client MUST send relay datagrams; the server MAY use the request information to limit access.
- Each UDP request has two reserved00 octets, FRAG, ATYP, destination address, port and DATA. The relay silently forwards or drops; returning datagrams MUST get the SOCKS UDP header and required method encapsulation. Verified erratum3198 gives IPv6 overhead22 bytes, not20.
- The relay MUST record the expected client IP and MUST drop another source IP. Fragment support is optional; without it every nonzero FRAG MUST be dropped. The association terminates when its TCP connection terminates.
FRAG00 is standalone. With fragmentation implemented, the high bit marks the final fragment and positions are1–127; reassembly rules apply and the timer MUST be at least5 seconds. This guide does not implement reassembly. The programming interface MUST reserve10+method bytes for IPv4,262+method for domains and22+method for IPv6, the last corrected by3198. Domain262 is the maximum-name allowance, not every domain header size. Addresses, relay port53000 and payload Hi are fictional. No UDP delivery acknowledgement, automatic reliability, SOCKS VPN or confidentiality is implied.
Read the RFC section ↗