Technical

Understanding WebRTC: The Technology Behind Perkoon's P2P Transfers

5 min read 384 views

WebRTC: The Part Of The Web That Actually Talks Back

Most of the web is request, response, done. WebRTC is the part that decided that wasn''t enough. It lets browsers talk to each other directly – audio, video, and, in Perkoon''s case, raw data flying between two machines without a server in the middle.

If you''ve ever wondered how Perkoon can send huge files peer-to-peer without a native app, the answer lives here.

The Peer-To-Peer Connection Lifecycle

Under the hood, a Perkoon P2P transfer over WebRTC looks roughly like this:

  1. Signaling – Both peers exchange SDP offers and answers through a lightweight signaling server.
  2. ICE candidate gathering – Each browser collects potential network paths: local IPs, public IPs via STUN, and TURN relay options.
  3. Connectivity checks – ICE tests these candidates to find a working path through NATs and firewalls.
  4. DTLS handshake – Once a path is found, peers perform a DTLS handshake to establish encryption keys.
  5. SCTP data channel – A reliable, ordered SCTP data channel is created on top of DTLS for file transfer.

The only part Perkoon owns is the signaling and configuration. The actual P2P engine ships inside your browser.

NAT Traversal: Getting Out Of The Local Bubble

Most clients live behind NAT. WebRTC uses the usual trio to escape:

  • STUN to discover public-facing addresses
  • TURN as a relay of last resort when direct paths fail
  • ICE to coordinate candidate testing and selection

Perkoon prefers direct connections for speed and privacy, but can fall back to TURN-relayed traffic when the network insists on being difficult.

Optimizing WebRTC For Huge Files

WebRTC was originally built for real-time media. Pushing very large files through it requires a different set of tradeoffs. Perkoon focuses on:

  • Chunked transfer – files are split into manageable chunks that flow steadily instead of flooding buffers
  • Adaptive flow control – sender adjusts to the receiver and network instead of blindly pushing data
  • Progress visibility – real-time progress, speed, and ETA so you know if the transfer will beat the deadline

The goal is simple: saturate the usable bandwidth without turning the connection into a DDoS against your own RAM.

Security Properties

WebRTC data channels are not a bolt-on afterthought; they are encrypted by design. In Perkoon''s P2P mode:

  • Traffic between peers is protected with DTLS
  • Keys are transient and tied to the session
  • No unencrypted payload leaves the browser

Since Perkoon does not store your files in P2P mode, there is nothing for us to leak or lose. Our threat surface is reduced to keeping signaling and TURN infrastructure up and boring.

Browser Support Reality Check

WebRTC support is no longer experimental:

  • Chrome / Edge – mature implementation, excellent performance
  • Firefox – full support with slightly different quirks
  • Safari – modern Safari supports WebRTC on desktop and iOS

If it runs a current Chromium, Firefox, or Safari, it can participate in a Perkoon P2P transfer.

When P2P Is Not Possible

Some networks are hostile to direct traffic:

  • Symmetric NAT
  • Locked-down corporate firewalls
  • Guest WiFi that treats every client as an untrusted stranger

In those cases, Perkoon can route WebRTC through TURN or switch to temporary cloud storage, keeping the UX consistent even when the network isn''t.

Performance Characteristics You Can Actually Use

In practice, WebRTC file transfer performance is dominated by:

  • Path length – same LAN is fastest, then same region, then cross-continent
  • Last-mile bandwidth – the slower side sets the ceiling
  • Latency – affects how aggressive flow control and acknowledgements can be

On a local gigabit network, Perkoon can push transfers to line rate. Across the public internet, seeing 50–200 Mbps for large file transfers is normal when both ends have modern connections.

Why Perkoon Chose WebRTC

Because building a custom native stack for every platform just to re-implement what your browser already ships with would be pointless. WebRTC is standardized, battle-tested, and gives us exactly what Perkoon needs: encrypted, low-latency, peer-to-peer data channels. We handle the UX and routing. Your browser handles the heavy lifting.

Topics

webrtc file transfer webrtc p2p browser file transfer technology peer to peer transfer webrtc data channel

Ready to try P2P file transfer?

Send unlimited files for free. No signup required.

By starting, you agree to our Terms