"Does gRPC use TCP or UDP?" looks like it should have a one-word answer. It doesn't quite. If you've ever typed grpc udp into a search box, you're probably trying to work out whether gRPC can do datagram-style communication — for real-time feeds, telemetry, gaming, or agent-to-agent traffic. Here's the short version: gRPC is built on HTTP/2, and HTTP/2 is built on TCP, so there is no native UDP transport in gRPC. But that's not the whole story. There's a UDP path through HTTP/3 and QUIC, and there are cases where you don't want gRPC at all. Let's walk the stack.
Can gRPC Run Over UDP? The Short Answer
No — not natively, and not in a way you'd put in production today. gRPC's transport is HTTP/2, and HTTP/2's transport is TCP. The gRPC specification assumes a reliable, ordered, byte-stream connection underneath it. UDP provides none of those things, so there's no "gRPC over raw UDP" mode to flip on.
That said, the question keeps coming back, and it's worth understanding why — because the people asking it usually want something specific: the multiplexing and typed-contract benefits of gRPC without the cost of a TCP connection per stream, or a lower-latency transport for time-sensitive data.
Where gRPC Actually Sits in the Stack
Most networking questions get easier once you draw the layers:
gRPC ← RPC layer: protobuf messages, deadlines, status codes
HTTP/2 ← framing: multiplexed streams, headers, trailers
TCP ← ordered, reliable byte stream
IP ← packets
gRPC chose HTTP/2 deliberately. The RPC model needs multiplexed streams so many in-flight calls share one connection, header compression for repeated metadata, and trailers to carry status codes after the response body. All of those live at the HTTP/2 layer. Below that, gRPC leans on TCP's guarantees: bytes arrive in order, nothing is silently dropped, the connection either works or fails loudly.
UDP gives you none of that. It's a datagram service: fire packets at an address, best effort, no ordering, no congestion awareness, no connection state. That's why "can I just point gRPC at a UDP socket?" doesn't work — gRPC would be re-implementing TCP inside its own protocol, which is a much bigger job than it sounds.
The UDP Path: QUIC and HTTP/3
There is a UDP path, and it goes through QUIC. QUIC is a transport protocol that runs over UDP, adding back the reliability and ordering TCP provides — plus stream-level independence, connection migration, and faster connection establishment. HTTP/3 is HTTP over QUIC, and gRPC over HTTP/3 is exactly "gRPC over UDP" in a practical sense.
The catch is maturity. gRPC's HTTP/3 support is still experimental across implementations: some language libraries have preview transports (the .NET gRPC stack shipped an HTTP/3 implementation early), while others — including Go's gRPC library — don't support it natively at all. The official gRPC specification for an HTTP/3 transport is still a work in progress. You can wire it up in some stacks today, but you're depending on experimental branches and a thinner ecosystem: proxies, observability middleware, and load balancers that understand gRPC-over-HTTP/3 are much rarer than the TCP path.
What you'd get for that pain: no head-of-line blocking across streams (a lost packet stalls one stream instead of every RPC sharing the connection), connection migration when a client hops networks, and a handshake that doesn't need a full round trip. Genuinely useful properties — for the day the ecosystem catches up.
What People Actually Mean by "gRPC Over UDP"
Search intent behind grpc udp splits into a few distinct questions, and they have different answers:
- "Does gRPC use TCP or UDP?" — TCP, via HTTP/2. Always the default.
- "Can gRPC work over UDP?" — Only through experimental HTTP/3/QUIC support; there is no stable native path.
- "gRPC vs UDP for low latency" — the real question underneath most of these searches. If you need low-latency, real-time semantics, gRPC-over-TCP and raw-UDP are usually both the wrong tool; you want something designed for the specific profile you need.
When people genuinely want datagram semantics — loss tolerance, minimal overhead per message, fan-out to many receivers — they usually aren't looking for gRPC at all. They're looking for a transport with UDP's profile and with reliability handled somewhere else.
The Agent-to-Agent Case: When UDP Transport Actually Helps
This is where the question gets concrete in 2026: AI agents. Agents talk continuously — heartbeats, task delegation, streaming results — and they run across clouds, containers, and NATs, where a TCP connection needs port forwarding or a relay, webhooks time out, and polling burns cycles. If you want UDP's lightweight transport profile plus reliability plus reachability, that's exactly the niche an overlay network fills.
One honest example is Pilot Protocol, an open-source overlay network that gives agents a permanent virtual address and encrypted UDP tunnels. The transport is UDP with encryption (X25519 key exchange, AES-GCM), and reliability is implemented in userspace — you get the datagram efficiency without writing your own retransmission logic. NAT traversal uses STUN plus hole-punching with relay fallback, so agents behind NAT are reachable without opening ports. Trust is explicit rather than ambient: every peer relationship starts with a mutual handshake, so joining the network doesn't automatically trust anyone.
# one command, and the agent has an address on the network
curl -fsSL https://pilotprotocol.network/install.sh | sh
It also ships an app store where agents install capabilities as typed IPC services — JSON in, JSON out — discoverable by the 243k+ agents and users already on the network. For agent workloads that need persistent, secure connectivity without VPNs or static IPs, that's a better fit than either raw gRPC or raw UDP.
So: gRPC or UDP?
Depends on what you're building:
- Typed request/response with rich streaming, and you control the endpoint? gRPC over TCP is the mature, boring, correct choice.
- Maximum throughput on lossy links, and you own reliability? Raw UDP plus your own protocol layer.
- Want multiplexing without TCP head-of-line blocking, and you can live with experimental? Keep an eye on gRPC over HTTP/3.
- Many machines behind NATs that need persistent, secure connections — especially agents? Reach for an overlay on UDP with userspace reliability, rather than fighting NAT per connection.
FAQ
Does gRPC use TCP or UDP?
TCP. gRPC runs over HTTP/2, which runs over TCP.
Can gRPC run over UDP?
Not natively. The only UDP path is HTTP/3 over QUIC, which remains experimental in gRPC implementations.
Is gRPC over HTTP/3 production-ready?
Not broadly. Some language implementations have experimental support; the official spec work is still in progress.
When should I use raw UDP instead of gRPC?
When you need datagram semantics — low overhead per message, loss tolerance, fan-out — and you're willing to handle reliability at the application layer.
Closing
"grpc udp" turns out to be two questions: can gRPC use UDP (no, not stably) and what should I use when I need UDP's properties (it depends). The stack doesn't have a single answer, and pretending it does is how you end up with a bespoke reliability protocol you now maintain forever. Know what you actually need from the transport, and pick the layer that provides it.
If you're building agent-to-agent systems and want the UDP path without building it yourself, the install line above is the fastest way to try the overlay approach. And if you've run gRPC over HTTP/3 in production — I'd genuinely like to hear how it went.
Top comments (0)