Back

Blog details

IPFS Transports Explained: TCP vs QUIC in libp2p and Kubo

AIOZ Network
7 min readSeptember 11, 2026
aioz-pin

IPFS nodes connect over two main transports, TCP and QUIC, and Kubo listens on both by default. QUIC sets up an encrypted connection in one round trip and avoids head-of-line blocking, so libp2p tries it first and keeps TCP as the fallback for networks that block UDP.

TL;DR:

  • A transport is the layer that carries bytes between two peers; libp2p supports several, and Kubo enables TCP, QUIC, WebTransport, WebRTC Direct, WebSocket and relay by default
  • TCP needs a separate security handshake (TLS 1.3 or Noise) and a stream multiplexer (Yamux) on top; Kubo's docs say its TCP transport takes 4 round trips to set up, against 1 for QUIC
  • QUIC runs over UDP with TLS 1.3 and stream multiplexing built in, so one lost packet only stalls one stream
  • Since go-libp2p v0.28.0, smart dialing tries a peer's QUIC address first and starts TCP only if QUIC hasn't connected within 250 ms
  • Kubo listens on TCP and UDP port 4001; if your firewall blocks either one, you fall back to slower relayed or hole-punched connections

Updated Nov 4, 2026: retitled, and rechecked every default against Kubo's current config docs. We corrected how libp2p dials, which is QUIC first rather than every transport at once, and how QUIC handles security. We also added the transport list, firewall ports, a labelled diagram and a section on AIOZ Pin.

What Is a Transport in IPFS?

A transport is the protocol that carries bytes between two machines. Everything else in IPFS sits on top of it: the DHT lookups, the Bitswap block exchanges and the peer ID checks all assume a working connection already exists. Our guide to libp2p, the networking layer under IPFS covers the layers above.

The libp2p stack doesn't hardcode one transport, so a peer advertises an address for each transport it supports, written as a multiaddr. For example, /ip4/192.0.2.0/tcp/4001 is a TCP address, and /ip4/192.0.2.0/udp/4001/quic-v1 is a QUIC one. Your node reads those addresses and picks one you can reach from your network.

Kubo's config docs list six network transports, and all of them are enabled by default:

  • TCP: the simple, widely deployed one, listening on port 4001
  • QUIC: UDP-based, which Kubo's docs call the most widely used transport by Kubo nodes
  • WebTransport: HTTP/3 over QUIC, meant for browsers that can't open TCP or QUIC sockets
  • WebRTC Direct: another browser-to-node path that needs no TLS certificate
  • WebSocket: enabled for dialing, though Kubo doesn't listen on it by default
  • Relay: a connection hopped through another peer, used to get past NATs and firewalls

If you run two server-side nodes that talk to each other, TCP and QUIC are the ones that matter to you. The rest exist mostly so browsers and peers behind a NAT can join.

How a TCP Connection Works in libp2p

TCP gives you a reliable byte stream and nothing more, with no encryption and no way to carry several conversations at once. So the libp2p stack adds two layers on top of every TCP connection, as Kubo's docs put it, "a security & multiplexing transport."

First comes the security handshake, where Kubo supports TLS 1.3 and Noise, with TLS at priority 100 and Noise at 200, and lower numbers win when your node dials out. Both handshakes also prove each side's peer ID to the other. Then a stream multiplexer splits the connection into independent streams, and Yamux is the only one Kubo supports today, since mplex has been removed.

Each step costs network round trips, and the libp2p QUIC docs note that TCP spends one round trip before TLS can start, so an encrypted TCP connection always takes at least two. On top of that, libp2p negotiates which security protocol and which multiplexer to use. Kubo's own docs say its TCP transport currently takes 4 round trips to set up. On a link with 100 ms of latency, that is about 400 ms before the first DHT query or Bitswap message can go out.

What Does QUIC Change?

QUIC is a transport built on UDP, standardized by the IETF in RFC 9000, 9001 and 9002. It does the job of TCP, TLS and a multiplexer in one protocol, and that changes three things for you.

First, setup is faster, because QUIC runs the TLS 1.3 handshake in its first flight, so a new connection takes one round trip. The libp2p docs say there is no extra security handshake and no stream multiplexer to negotiate, because QUIC provides both. In libp2p, each peer puts its peer ID in a self-signed certificate signed with its host key, the same way the libp2p TLS handshake does it.

Second, there is no head-of-line blocking between streams. A TCP connection delivers one ordered byte stream, so when a packet is lost, every stream on that connection waits for the retransmission. QUIC streams are independent at the transport level, so a lost packet only stalls the stream it belonged to. If your node is running a DHT lookup and a Bitswap transfer to the same peer, one doesn't hold up the other.

Third, QUIC is easier on the operating system: Kubo's docs point out that it doesn't need a file descriptor per connection, which helps if your node holds hundreds of peer connections.

Diagram comparing libp2p connection stacks: TCP needs a TCP handshake, then a TLS 1.3 or Noise security handshake, then Yamux multiplexing, about 4 round trips in Kubo, with one byte stream so a lost packet stalls all streams; QUIC over UDP combines TLS 1.3 and native streams in 1 round trip so a lost packet stalls only one stream; smart dialing tries QUIC first and TCP 250 ms later
TCP stacks security and multiplexing on top; QUIC builds them in. libp2p dials QUIC first and TCP 250 ms later.

TCP vs QUIC at a Glance

In Kubo today, the two transports compare like this:

  • Runs over: TCP uses the kernel's TCP; QUIC uses UDP
  • Default listen address: /ip4/0.0.0.0/tcp/4001 for TCP, and /ip4/0.0.0.0/udp/4001/quic-v1 for QUIC
  • Security: TCP negotiates TLS 1.3 or Noise; QUIC always uses its built-in TLS 1.3
  • Multiplexing: TCP adds Yamux; QUIC has native streams
  • Setup: 4 round trips for Kubo's TCP transport, 1 for QUIC
  • Packet loss: TCP stalls every stream on the connection; QUIC stalls one stream
  • When it fails: TCP passes most firewalls; QUIC fails where UDP is blocked

The quic-v1 code in the address matters, and the libp2p docs explain that it marks the RFC 9000 version, while the older quic code pointed at a pre-standard draft.

How Does libp2p Choose Between TCP and QUIC?

Older versions of go-libp2p dialed every address a peer advertised at the same time and kept whichever connected first. That created a lot of wasted connection attempts. go-libp2p v0.28.0, released in 2023, replaced it with smart dialing.

Per the release notes, if a peer has both a QUIC and a TCP address, your node dials QUIC first. It starts TCP only if QUIC hasn't connected within 250 ms, a delay borrowed from the Happy Eyeballs approach in RFC 8305. The same notes say the first attempt succeeds for more than 90% of connections on the IPFS network. Relay addresses wait 500 ms when a direct address exists, so a relayed connection is the last resort.

QUIC isn't always the better path, though. A 2025 measurement of hole punching in the IPFS network found TCP and QUIC succeeded at about the same rate, and our libp2p NAT traversal section covers that study. And if a network blocks UDP, QUIC fails outright, which is why TCP stays enabled.

Ports and Firewalls for an IPFS Node

Kubo's firewall guide says its swarm listens on port 4001 over both TCP and UDP. TCP 4001 carries the TCP transport and, if you add it, WebSocket, while UDP 4001 carries QUIC, WebTransport and WebRTC Direct.

Open both if you want other peers to reach you directly. The guide warns that blocking either one makes Kubo fall back to slower relayed or hole-punched connections. These commands come from that guide and were not run here, since this machine has no IPFS binary:

# Not run: from Kubo's docs/production/firewall.md
sudo ufw allow 4001/tcp comment 'ipfs/libp2p tcp+http+ws'
sudo ufw allow 4001/udp comment 'ipfs/libp2p quic+webtransport+webrtc'

Browsers are a separate case, because they can't open raw TCP or QUIC sockets, so a browser node reaches your Kubo node over WebTransport, WebRTC Direct or secure WebSockets instead. The Helia JavaScript implementation is the usual client on that side.

How AIOZ Pin Handles It

None of this touches a request to an AIOZ Pin gateway. Your app sends plain HTTPS to a gateway URL in the format https://gateway-url/ipfs/<CID>, as the AIOZ Pin gateway docs show, and the gateway deals with libp2p transports for you.

The same docs say content you pin on AIOZ Pin becomes accessible on the public IPFS network. So peers that fetch it over IPFS itself, such as your own Kubo node, do use the transports above. What the docs don't cover yet: which transports and ports AIOZ Pin's own nodes listen on. For the bigger picture of what decides IPFS retrieval speed, connection setup is only one part.

Next step: read the AIOZ Pin guide to gateways to see how gateway URLs are built.

Frequently Asked Questions

Does IPFS use TCP or QUIC? Both. Kubo listens on TCP and QUIC on port 4001 by default, and libp2p prefers QUIC when a peer offers both.

Why is QUIC faster to connect than TCP? QUIC folds the TLS 1.3 handshake into connection setup and has streams built in, so it takes one round trip. Kubo's docs say its TCP transport takes four.

Does libp2p dial TCP and QUIC at the same time? Not anymore. Since go-libp2p v0.28.0, it dials QUIC first and starts TCP only if QUIC hasn't connected within 250 ms.

Does a QUIC connection use Noise? No. QUIC always uses its built-in TLS 1.3, and the peer ID is checked through a self-signed certificate. TLS or Noise is negotiated on transports without built-in encryption, such as TCP and WebSocket.

Is mplex still used? No. Kubo's docs say mplex support has been removed from Kubo and go-libp2p, and Yamux is the multiplexer for TCP.

Do transports matter for an AIOZ Pin gateway request? No. A gateway request is plain HTTPS; the transports only matter for peer-to-peer connections between IPFS nodes.

References

We only send updates when meaningful changes ship, and you can unsubscribe anytime

Related Content

blog thumbnail

What Is a Multiaddr? Peer IDs and Addresses in IPFS

A multiaddr is a network address that names every protocol it uses, like /ip4/.../tcp/4001/p2p/ and a peer ID. Learn to read one and how IPFS peer IDs work.

7 min readNovember 06, 2026
blog thumbnail

IPFS Bootstrap Nodes and How a New Node Finds Its Peers

IPFS bootstrap nodes are the first peers a new node dials to join the Amino DHT. See how Kubo uses them, who runs them after Shipyard, and how to edit the list.

6 min readNovember 04, 2026
blog thumbnail

ipfs.io Gateway Not Working? What Changed and Who Runs It

The ipfs.io gateway now returns HTTP 429 to scripts and servers and sends browsers to inbrowser.link. See who runs the public IPFS services and what to change.

6 min readNovember 02, 2026
blog thumbnail

IPFS Glossary: Key IPFS and libp2p Terms Explained A to Z

An IPFS glossary of 115 terms from A to Z: CIDs, Bitswap, the DHT, IPNS, gateways and pinning, each defined in plain words and linked to a deeper guide.

21 min readOctober 31, 2026
blog thumbnail

What Is IPFS Provide Sweep? How Kubo Announces Many CIDs

IPFS Provide Sweep is Kubo's provider that batches CIDs by DHT region, not one lookup each. See how it works, when it became default, and how to check it.

6 min readOctober 30, 2026
blog thumbnail

IPFS Dedicated Gateway Free vs Paid Plans on AIOZ Pin

An IPFS dedicated gateway on AIOZ Pin is called a premium gateway. See what the free plan limits, what a paid plan adds, and what happens at zero balance.

6 min readOctober 28, 2026