Networking
How packets get from one host to another: the addresses they carry, the boxes along the path that rewrite those addresses or refuse to forward them, and the protocols two endpoints use to find a path that works anyway.
The first subsection is NAT traversal. Most hosts on the internet sit behind a network address translation (NAT) device that lets them reach out but not be reached, and two such hosts cannot talk directly without help. The section covers the property of a NAT that decides whether help is possible, and then the tools, in the order they are usually tried. A STUN server reports a host’s public address. The two hosts punch holes in their NATs by sending to each other at the same time. A TURN server relays the traffic when that fails, and ICE tries every combination and keeps the best one that works.
WebRTC puts those tools in every browser. It is the browser stack for audio, video and data sent directly between two users, and every call it places runs the whole NAT traversal procedure before the first frame of media is sent.
WebRTC carries the media and data but not the setup. Before connecting, the two browsers have to swap session descriptions through some channel both can already reach, and WebRTC leaves that channel to the application. Nostr is a protocol for publishing signed messages through relays, servers anyone can run that forward messages between clients connecting out to them. Trystero is a JavaScript library that uses public relays like these as the setup channel, so that browsers can connect to each other with no server belonging to the application.
Where the boundaries fall#
Web is about publishing: building a document and serving it to a browser that asked for it. The browser always opens that connection to a server with a public address, so none of the problems in this section arise there. A browser talking to another browser is the point where they begin, which is why WebRTC is here rather than there.
The durable ideas in Computer Science are not about the wire. IPFS runs over a peer-to-peer network that has to traverse NATs like anything else, but it sits in Computer Science because its subject is content addressing, not connectivity.
Social is about running communities on social platforms. Nostr was designed for a social network and mostly carries one, but its page here covers the relay protocol underneath: signed events, what a relay can and cannot do, and relays used as a general message bus, which is how Trystero uses them. Running a community on Nostr would belong in Social. Nor is Nostr in Web, because a relay forwards signed messages between clients rather than serving documents to a browser.
Security handles keys and credentials on a developer machine. The credentials a relay server issues are covered here, with the relay, because they only make sense next to the protocol that checks them.