Glossary
Two people, each with a BitTorrent client on their own computer and an ordinary internet connection, want their computers to connect directly. Between them stand addresses, routers, translators, and firewalls, each with names, numbers, and standards of its own, and the protocols that find a way around them. This glossary names those parts and says what each one is, from who writes the standards to how BitTorrent gets two peers through.
It's meant to be read top to bottom, since each term builds on the ones before it. A word in italics is a glossary term, defined either in an entry of its own or right where it appears. The last group covers the protocols that browsers and calling apps use to connect, for the reader who meets them elsewhere.
Standards and who writes them
- IETF (Internet Engineering Task Force). The body that writes the protocols the internet runs on, the ones that address and carry packets and most of what this glossary covers. Its work happens in working groups, each on one problem and open to anyone through its mailing list, and it decides by rough consensus rather than by vote.
- Internet-Draft. A working document in the IETF, which expires after six months unless it's revised. A protocol can spend years as a series of drafts before one becomes an RFC, and some are deployed while they're still drafts.
- RFC (Request for Comments). One of the IETF's numbered documents, a series that runs from RFC 1 in 1969, older than the IETF itself. Each carries a status: Proposed Standard or Internet Standard for a standard, and Informational, Experimental, or Best Current Practice for the rest. An RFC never changes once it's published. A later one updates or obsoletes it, which is how the specification of Internet Protocol version 6 went from RFC 2460 in 1998 to RFC 8200 in 2017.
- MUST and SHOULD. The capitalized words an RFC uses for its requirements, defined in RFC 2119: MUST for an absolute requirement, SHOULD for a recommendation a good reason can override, and MAY for an option.
- IANA (Internet Assigned Numbers Authority). Keeps the registries the standards point to: which port numbers belong to which services, which address ranges are private, link-local, or set aside for documentation, and the numbers used inside protocols. The example addresses on this page, like
192.0.2.1and2001:db8::1, come from the documentation ranges. - Regional internet registries. The five organizations that hand out IP (Internet Protocol) addresses, from blocks IANA gives them, to the internet service providers and other networks in their part of the world: ARIN (American Registry for Internet Numbers) for North America, RIPE NCC (Réseaux IP Européens Network Coordination Centre) for Europe and the Middle East, APNIC (Asia-Pacific Network Information Centre) for Asia and the Pacific, LACNIC (Latin America and Caribbean Network Information Centre) for Latin America and the Caribbean, and AFRINIC (African Network Information Centre) for Africa.
- IEEE (Institute of Electrical and Electronics Engineers). Writes the standards beneath the internet's own protocols on a local network, through its 802 committee: Ethernet as 802.3 and Wi-Fi as 802.11, which carry packets between a device and its router.
- W3C (World Wide Web Consortium). Writes the web's standards, among them, with the IETF, WebRTC (Web Real-Time Communication).
- UPnP Forum. The industry group that wrote UPnP (Universal Plug and Play) and its profile for routers, from 1999. Its specifications passed in 2016 to the Open Connectivity Foundation, which keeps them now.
- BEP (BitTorrent Enhancement Proposal). BitTorrent's own numbered documents, kept at
bittorrent.org, with BEP 3 as the protocol itself. A proposal starts as an issue and a pull request in the site's public repository, and an editor numbers it and marks its status, Draft, Accepted, or Final, with BitTorrent's creator, Bram Cohen, as final arbiter. Many BEPs write down what clients already did, as BEP 55 did for libtorrent's holepunch message.
Addresses
- IP address. The number that identifies a device on a network, so packets can be delivered to it. Every packet carries two, the source it came from and the destination it's headed for. IP, the Internet Protocol, runs in two versions side by side today, and every address belongs to one of them. Reading IP Addresses walks through how both are written.
- Network interface. A device's connection to one network, physical like a Wi-Fi radio or an Ethernet port, or virtual like the tunnel of a VPN (virtual private network). Addresses belong to interfaces rather than to the device as a whole, so a computer holds several at once. A computer's settings list many interfaces, most of them idle or kept by the system for its own use, and one carries the traffic to the internet.
- IPv4. Internet Protocol version 4, the internet's original addressing, defined in 1981 in RFC 791. Its addresses are 32 bits, written as four numbers from 0 to 255 separated by dots, like
192.0.2.1. That allows 4.3 billion addresses, fewer than the devices that want one, and the regional internet registries ran out of new ones through the 2010s. - IPv6. Internet Protocol version 6, IPv4's successor, published in 1998 and an Internet Standard since 2017, as RFC 8200. Its addresses are 128 bits, written as eight groups of four hexadecimal digits separated by colons, with runs of zeros shortened, like
2001:db8::1. There are enough for every device to hold its own, several at once. In a typical address the first 64 bits name the network and the last 64 the device on it, a division The IPv6 Squeeze traces from its start. - Prefix. The leading bits that every address in one network shares, written after a slash as a count of bits.
192.168.1.0/24is the 256 IPv4 addresses that start192.168.1, and2001:db8:1:2::/64is an IPv6 network of the size one home network gets. Network settings also show an IPv4 prefix the older way, as a subnet mask:255.255.255.0is a/24. - Public address. An address that's unique on the whole internet and reachable from anywhere on it. Over IPv4 a home usually has one, held by its router and shared by every device behind it. Over IPv6 each device holds its own, called a global address. ip.ftorrent.com answers any request with the public address it came from.
- Private address. An IPv4 address from the ranges RFC 1918 set aside in 1996 for use inside a network:
10.0.0.0/8,172.16.0.0/12, and192.168.0.0/16. Any number of networks use the same ones at once, so they mean nothing on the internet, and a packet from one has to be translated before it leaves. A home router hands them out, most often from192.168.0.0/24or192.168.1.0/24. - Link-local address. An address that works only on the network a device is directly attached to, its Wi-Fi or its Ethernet, and is never routed past it. Every IPv6 interface gives itself one, starting
fe80, and uses it to talk with the router and its neighbors, so an interface can show an IPv6 address on a network with no IPv6 internet at all. IPv4's range for them,169.254.0.0/16, appears when a device found nothing to give it an address. - Temporary address. An IPv6 address a computer makes up at random and uses for its outgoing connections, replacing it with a new one each day by default under RFC 8981, so the servers it visits can't follow it from day to day by its address. Beside its temporary addresses a computer keeps a stable one, the address to give anyone who needs to reach it over time. Older temporary addresses stay on as deprecated while the connections using them finish.
- Dual stack. Running IPv4 and IPv6 at once, with addresses of both kinds, which are the two address families. Desktop and phone operating systems are dual stack, and a home network is too when its provider supplies IPv6. Each connection goes over one family or the other, and a BitTorrent client on a dual-stack connection listens in both and reaches each peer at whichever address it learned.
Packets and ports
- Packet. One unit of data sent across a network on its own: a header carrying its addresses and other details, followed by its contents. Everything on the internet travels as packets, each delivered independently, and a large transfer is many thousands of them.
- Port. A number from 0 to 65535 that names one endpoint on a machine, so many programs can share its address. A packet carries a source port and a destination port beside its two addresses. A service waits for connections at a fixed, well-known port, like
443for the web's HTTPS (Hypertext Transfer Protocol Secure), and a BitTorrent client at one it picks. - Socket. A program's handle, in the operating system, on one endpoint of communication: a protocol, a local address, and a local port. A program binds a socket to a port and listens on it for others, or connects it to a remote address and port to start a conversation itself.
- Client and server. A server is a program that listens, at an address and port that stay put so anyone can find it, and answers whoever connects. A client connects out to a server, starts the conversation, and needs no fixed address of its own. The web works this way. A BitTorrent client is both at once, connecting out to peers and listening for them.
- TCP (Transmission Control Protocol). A connection between two programs that delivers a stream of bytes complete and in order, sending again whatever is lost. Each connection opens with a three-way handshake,
SYN,SYN-ACK, andACK, short for synchronize and acknowledge, so it's always clear which side started it, and that side can start it only if the other is listening. The web, email, and BitTorrent's original peer connections run on it. - UDP (User Datagram Protocol). Single messages, called datagrams, with no connection, no ordering, and no resending; a program that needs any of those builds them itself. With no handshake, either side may send first, and its ports are numbered apart from TCP's, so the same number over each is two different ports. DNS (the Domain Name System), video calls, games, and BitTorrent's DHT (distributed hash table) and uTP (Micro Transport Protocol) run on it.
- Dynamic port range. Ports
49152through65535, which IANA keeps unassigned for temporary use. A system picks from this range, or one like it, when a program connects out without naming a port, which is called an ephemeral port. Some BitTorrent clients pick their listen port from it at random. - Outbound and inbound. An outbound connection is one this computer starts by sending the first packet, and an inbound connection is one another computer starts toward it. TCP's handshake marks the direction, and over UDP it's whoever sent first. What stands between peers acts almost entirely on inbound.
- Unsolicited packet. A packet that arrives answering nothing the receiver sent: the first packet of an inbound connection, or a datagram from a stranger. NAT (network address translation) and firewalls both drop them by default, and port forwards, pinholes, and hole punching are each a way to get one through.
The local network
- LAN (local area network). The devices joined to one router, by Ethernet cable or Wi-Fi, in a home or an office. They reach each other directly and the internet through the router, and share one private IPv4 prefix, like
192.168.1.0/24, and one IPv6/64. - Modem. The box at the end of a home's line from its provider, cable, fiber, or DSL (digital subscriber line) on a phone line, that turns the line's signal into Ethernet. Many providers' modems are routers too, and one that only converts the signal hands the router the provider's address directly.
- Router. The device between the LAN and the internet, forwarding packets from one side to the other, which is routing. A home's is usually one box that is also the Wi-Fi access point and often the modem, supplied by the provider or bought by the person. Over IPv4 it also translates addresses, and in both families it runs a firewall.
- ISP (internet service provider). The company that carries a home's connection to the internet, over cable, fiber, DSL, or a cellular network. It gives the router a public IPv4 address, or under carrier-grade NAT a shared one, and where it offers IPv6, a prefix: a
/64for one network, or a larger one, like a/56, for the router to divide. - Default gateway. The address a device sends every packet bound outside its own prefix to: the router's address on the LAN, like
192.168.1.1over IPv4, and over IPv6 usually the router's link-local address. - Subnet. One network's block of addresses under a single prefix, such as a home's
192.168.1.0/24. Devices in the same subnet reach each other directly, and packets for anywhere else go to the default gateway. - DHCP (Dynamic Host Configuration Protocol). How a device joining a network gets its IPv4 settings: it asks, and the router answers with a private address, the prefix, the default gateway, and DNS servers. The address comes on a lease, hours or days long, which the device renews while it stays, and a router can reserve one address for one device so it never changes.
- Router advertisement. A message the router sends to the whole LAN over IPv6, regularly and whenever a device asks, naming the network's prefix, the router as the default gateway, and how long each stays good.
- SLAAC (stateless address autoconfiguration). How IPv6 addresses usually arrive: each device takes the prefix from a router advertisement and forms its own addresses in it, a stable one and temporary ones, with no server keeping a record, which is what stateless means. Some networks run DHCPv6, DHCP's IPv6 version, beside it.
- DNS (Domain Name System). Turns names into addresses:
open.ftorrent.comresolves to an IPv4 address in itsArecord and an IPv6 address in itsAAAArecord. The router usually answers the LAN's lookups, passing them on to a server at the provider that looks names up. In BitTorrent, trackers and bootstrap nodes are reached by name, and peers by address. - VPN (virtual private network). A network a computer joins through an encrypted tunnel to a server elsewhere, which appears on the computer as a network interface of its own. Traffic for the internet then leaves from the server's address, so to peers, the computer's public address is the VPN server's. The server usually translates addresses the way a home router does, and inbound connections reach the computer only if the VPN forwards a port to it.
Address translation
- NAT (network address translation). A router rewriting the addresses in packets as they pass, so the devices on a LAN, holding private IPv4 addresses, share its one public address. On the way out it replaces each packet's private source address and port with its public address and a port of its own choosing, remembers the pair, and rewrites the answers that come back to match. Strictly, sharing an address by port is NAPT, network address and port translation, though nearly everyone calls it NAT. Home routers translate IPv4 and leave IPv6 alone, since IPv6 has addresses enough for every device.
- Mapping. One entry in a NAT's table: a private address and port, paired with the public port that stands for it. A socket's first packet out makes it, its traffic keeps it, and answers come back through it. NATs differ in when they make a new mapping and whom they let send through one.
- Mapping lifetime. How long a NAT keeps a mapping nothing is using. For UDP, RFC 4787 requires at least two minutes and recommends five, and routers vary. For TCP a mapping lasts as long as its connection, with an idle timer of hours. A program that wants to stay reachable through a mapping sends something before it runs out, a keepalive.
- Port preservation. A NAT keeping a socket's own port as its public port when that port is free, so
192.168.1.23:50000leaves as203.0.113.42:50000. Many home routers preserve ports, and a NAT many customers share can't do it for all of them. - Cone types. Four names for how a NAT behaves, from RFC 3489, which in 2003 defined the first version of STUN, then Simple Traversal of UDP through NATs: full cone, restricted cone, port-restricted cone, and symmetric. Most writing about NAT still uses them. The first three keep one public port for a socket whatever it sends to, and differ in whom they let in.
- Full cone NAT. Once a socket has a mapping, anyone on the internet can send to its public port and reach it.
- Restricted cone NAT. Lets a packet in only from an address the socket has sent to, from any port at that address.
- Port-restricted cone NAT. Lets a packet in only from the exact address and port the socket has sent to. Most home routers behave this way.
- Symmetric NAT. Gives a socket a new public port for each destination it sends to, and lets in only that destination's answers. A server that tells the socket its public port has learned the port that leads to itself alone.
- Mapping behavior. The first of the two properties RFC 4787 used in 2007 to describe NATs in place of the cone types: whether a socket keeps one public port as it sends to different destinations. RFC 4787 requires the first of its three kinds, endpoint-independent, and the other two together are often called endpoint-dependent mapping. good.ftorrent.com reads it for the connection it's opened on.
- Filtering behavior. The second property: which outside senders a NAT lets through a mapping that exists. It comes in the same three kinds, named the same way.
- Endpoint-independent. An endpoint is an address and port. As mapping, one public port for the socket whatever the destination; as filtering, anyone may send to that port.
- Address-dependent. As mapping, a new public port for each destination address; as filtering, only addresses the socket has sent to may send to it.
- Address-and-port-dependent. As mapping, a new public port for each destination address and port; as filtering, only the exact addresses and ports the socket has sent to may send to it.
- The cones as behaviors. A full cone is endpoint-independent mapping and filtering. A restricted cone is endpoint-independent mapping with address-dependent filtering, and a port-restricted cone the same mapping with address-and-port-dependent filtering. A symmetric NAT is address-and-port-dependent in both. Separating the two properties also describes NATs no cone fits, which is why current documents use them.
- Carrier-grade NAT (CGNAT). A NAT the ISP runs in its own network, translating many customers onto a smaller pool of public IPv4 addresses, so the address a home router holds is itself private to the provider. It's standard on cellular networks and increasingly common on wired ones, as the provider's answer to running out of IPv4. RFC 6598 set aside
100.64.0.0/10in 2012, the shared address space, for the addresses between customers and the carrier's NAT. A customer usually has no way to forward a port through it, which leaves port forwarding on the home router with nothing to forward. Some providers give a customer a public IPv4 address on request, sometimes for a fee. - Double NAT. Two NATs in a row: a provider's modem that routes and translates, with the person's own router behind it translating again, or a carrier-grade NAT above a home router. An unsolicited packet then needs a way through both, and a request to the router for a port reaches only the nearer one.
Firewalls
- Firewall. Software that decides for each packet whether to let it through or drop it, by rules about its addresses, ports, and protocol. One in the router guards a network, and one on a computer guards that computer. Consumer firewalls let everything out and drop unsolicited packets coming in, unless a rule says otherwise.
- Stateless packet filter. A firewall that judges each packet by its header alone, with no memory of the packets before it, so it can't tell an answer from an unsolicited packet. Real, and rare on consumer equipment.
- Stateful firewall. A firewall that remembers the conversations the devices it guards have started, which is called connection tracking, and lets in what answers one while dropping unsolicited packets. For UDP, which has no connections, the first packet out makes an entry that a timer ends, the way a NAT's mapping works. The firewalls in home routers and desktop operating systems are stateful.
- Network firewall. The firewall in the router, guarding every device on the LAN at once. Over IPv4 the NAT already drops unsolicited packets, which match no mapping, and the firewall's rules sit beside it. Over IPv6, with nothing translated, the firewall alone stands between each device's global address and the internet, and most home routers drop unsolicited IPv6 by default.
- Host firewall. A software firewall in the computer's own operating system, guarding that computer on every network it joins. Where a network firewall's rules name addresses and ports, the ones Windows and macOS ship decide mostly by program, allowing or blocking each app.
Firewalls on the computer
- Windows Defender Firewall. Windows' host firewall, on by default. Its rules name programs by their path, and the first time a program listens, an alert asks whether to allow it on private networks, public networks, or both. Windows writes rules blocking the program as the alert appears, and Allow access turns them into allows. Each network profile has its own rules.
- Network profile. Windows' label for the kind of network it's joined: Private, Public, or Domain, for an organization's managed network. Each has its own firewall rules, Public's the strictest, and a network Windows hasn't met before is Public unless the person says otherwise.
- macOS firewall. macOS's host firewall, off by default and turned on in System Settings, under Network, then Firewall. When it's on, the first time a program not on its list accepts an incoming connection, macOS asks whether to allow it, and keeps the answer on an allow list by program. It has no rules for ports or addresses. Its other settings are block all incoming connections, and stealth mode, which leaves unanswered the packets that test whether a computer is there.
- Linux firewall. Linux's firewall is netfilter, in the kernel, Linux's core, the same code that translates and filters inside most home routers, which run Linux. Its rules, written for
nftables, which replacediptables, can match any address, port, protocol, or connection state, and can translate addresses too. Desktop distributions put a front end over it: Ubuntu'sufw(Uncomplicated Firewall) ships off, and Fedora'sfirewalldships on.
Asking the router for a port
- Port forwarding. A rule in a router that sends packets arriving at one of its public ports on to a device on the LAN, at an address and port the rule names. It's how a device behind a NAT accepts unsolicited packets over IPv4.
- Manual port forwarding. A port forward a person types into the router's settings page, naming the device's private address and the port. It lasts until someone removes it, and it points at the wrong device if DHCP gives that address to another, which is why guides pair it with an address the router reserves for the device.
- Automatic port forwarding. A port forward a program asks the router for itself, over one of the protocols below, usually called a port mapping. It comes on a lease the program renews while it runs, and when the lease runs out the router removes it. The common BitTorrent clients ask this way at startup, with the setting on by default.
- UPnP (Universal Plug and Play). A set of protocols, from an industry forum Microsoft led from 1999, for devices on a LAN to find one another and say what they can do. Windows XP shipped it in 2001, and it became the way programs ask a router for a port. Nearly every home router speaks it, many with it on by default and some shipped by their providers with it off. Any program on the LAN may ask, with no password.
- SSDP (Simple Service Discovery Protocol). UPnP's way of finding devices: a program sends a search over UDP to the multicast address
239.255.255.250, port1900, which reaches every device on the LAN listening for it, and the router answers with the address of a description of itself. - IGD (Internet Gateway Device). The part of UPnP that describes a router: its public address, its list of port mappings, and the actions that add and delete them, called as XML (Extensible Markup Language) over HTTP on the LAN. Version 1, from 2001, maps IPv4 ports. Version 2, from 2010, adds IPv6 pinholes, which few home routers offer.
- NAT-PMP (NAT Port Mapping Protocol). Apple's protocol for the same request, from 2005: small binary messages over UDP to the router's port
5351, for IPv4 alone. Apple's AirPort routers spoke it, and other routers still do. It was documented in 2013 as RFC 6886, an Informational RFC recording a protocol already in use, the same month PCP was published to replace it. - PCP (Port Control Protocol). NAT-PMP's successor, published by the IETF as RFC 6887 in 2013, on the same port. It adds IPv6 pinholes, and it was designed to reach a carrier-grade NAT as well as the home router. Few home routers answer it, and fewer carriers.
BitTorrent
- BitTorrent. A protocol for sharing files directly between the computers that want them, each downloading pieces from the others while uploading the pieces it already has, so every computer that joins adds capacity to send the file as well as demand for it. Bram Cohen released it in 2001, and BEP 3 is the protocol itself.
- BitTorrent client. A program that speaks BitTorrent: it joins swarms, trades pieces with peers, and talks to trackers and the DHT. qBittorrent, Transmission, Deluge, and µTorrent are common ones, and ftorrent's desktop client is one too.
- libtorrent. A library that does BitTorrent's work for the programs built on it, written in C++ by Arvid Norberg. qBittorrent and Deluge are built on it, as is ftorrent's desktop client, while Transmission has an engine of its own.
- Hash. A short, fixed-length fingerprint computed from any amount of data, the same every time for the same data and, in practice, different for any change to it. A hash checks that data arrived intact, and it can name data by what it is rather than where it's kept.
- Torrent. A small file describing content to share: the names and sizes of its files, a hash of each piece they're cut into, and usually the addresses of trackers. A magnet link names the same content by its info-hash alone, and the client fetches the rest from peers, as the Magnet Link User Guide explains.
- Info-hash. The SHA-1 (Secure Hash Algorithm 1) hash of a torrent's description of its content, 20 bytes, written as 40 hexadecimal digits. It names the content exactly, and trackers and the DHT index peers by it, so it's how peers sharing the same thing find each other.
- Peer. A client taking part in a torrent, downloading, uploading, or both. Peers connect to one another directly, over TCP or uTP, and trade pieces.
- Seed. A peer that holds every piece and only uploads. A peer still downloading is a leecher.
- Swarm. Every peer sharing one torrent at a given moment.
- Listen port. The port a client listens at for inbound peer connections, the same number over TCP and UDP. In the common clients, uTP and the DHT share its UDP socket. The client gives it in every announce so others know where to reach it, and behind a NAT it's the port that needs forwarding.
- Tracker. A server that keeps, for each info-hash, a list of the peers that announced it lately, and answers each announce with some of them. It introduces peers and carries none of the content. Trackers speak HTTP, in BEP 3, or UDP, in BEP 15, and ftorrent runs one at open.ftorrent.com.
- Announce. A client's message, repeated every so often, to a tracker or to the DHT: the info-hash and its listen port, and to a tracker how much it has downloaded and has left. The tracker reads the client's address from where the packet came from, not from the message, so what it records is the public address the client's NAT gave it, paired with the listen port the client named.
- DHT (distributed hash table). BitTorrent's way to find peers without a tracker: the Mainline DHT, BEP 5, a table from info-hashes to peers spread across millions of clients, each one a node holding a small part. Its messages travel over UDP. How the Mainline DHT Works explains it in full.
- Bootstrap node. A well-known DHT node, at a fixed name and port, that a client asks first when it has no nodes yet, to learn its first others.
router.bittorrent.com,dht.transmissionbt.com, anddht.libtorrent.orgare among them, and ftorrent runs one atdht.ftorrent.com. - PEX (peer exchange). Peers telling one another which peers they're connected to, BEP 11, so a client learns more of the swarm from the peers it has, without asking a tracker or the DHT. Flags beside each peer listed say whether it's reachable, whether it speaks uTP, and whether it supports the holepunch extension.
- LSD (Local Service Discovery). A client announcing its torrents and listen port to the rest of its own LAN, BEP 14, by multicast to
239.192.152.143orff15::efc0:988f, port6771, so two clients on one LAN find each other and connect directly across it. - uTP (Micro Transport Protocol). BitTorrent's own transport, BEP 29: a reliable connection like TCP's, built on UDP, that slows down when other traffic on the line needs room. The common clients speak it alongside TCP, on the UDP side of the listen port.
- External address. The public address a client believes it has, which it can learn only from outside: an HTTP tracker may say in its answer (BEP 24), a peer says in the first messages of their connection (BEP 10), and DHT nodes say in their replies (BEP 42). libtorrent counts these reports as votes.
Getting through
- NAT traversal. The techniques for making a direct connection between two peers when NATs and firewalls stand between them: port forwarding, hole punching, and, outside BitTorrent, relaying. How Can Two Peers Connect? surveys them across the internet.
- Connectable. A peer that accepts unsolicited connections at its listen port, through a port forward, a pinhole, or an address with nothing in the way; one that doesn't is often called firewalled. Two connectable peers connect whichever one connects out, a connectable peer and a firewalled one only when the firewalled one connects out, and two firewalled peers only by hole punching.
- Hole punching. Two peers each sending to the other's public address and port at nearly the same moment, so each one's outgoing packet makes the mapping, or the firewall entry, that lets the other's in. A third party both can already reach tells each the other's address and when to send. Over UDP it works whenever both NATs keep a socket's public port for every destination, whatever their filtering behavior, and it usually fails when either gives each destination a new port, since the port the other side was told is the wrong one. Tailscale's How NAT traversal works follows a punch step by step.
- Holepunch extension. BitTorrent's hole punching, BEP 55, written up in 2019 from libtorrent's
ut_holepunchmessage. A peer that wants to reach a firewalled peer asks a third peer connected to both, the relay, which sends each of them the other's address and port, and both then open a uTP connection to the other at once. The relay is another peer in the swarm, so no server takes part. - Pinhole. A firewall rule letting unsolicited packets through to one address and port. Over IPv6, where nothing is translated, it does what a port forward does over IPv4. A program asks for one over UPnP's IGD version 2 or PCP, where the router offers them, or a person opens one in the router's settings. The word also gets used loosely for any such opening, port forwards included.
NAT traversal for calls and WebRTC
- WebRTC (Web Real-Time Communication). The standard by which browsers, and apps built the same way, connect directly to one another for calls, video, and data. The W3C writes the interface a page uses, and the IETF the protocols beneath it, which reach through NATs with STUN, TURN, and ICE.
- STUN (Session Traversal Utilities for NAT). A protocol for asking a server which public address and port a packet arrived from, so a program behind a NAT learns its mapping. It came out of the IETF's work on middleboxes, the devices like NATs that sit in a packet's path, as RFC 3489 in 2003, for internet calls, games, and other peer-to-peer protocols. Today's version is RFC 8489. ftorrent runs one at
stun.ftorrent.com. BitTorrent learns the same thing from the trackers, peers, and DHT nodes that report its external address. - TURN (Traversal Using Relays around NAT). A server that carries traffic between two peers that can't connect directly, RFC 5766 in 2010 and now RFC 8656: each sends to the relay, and the relay passes it on. It always works, and it costs whoever runs it the bandwidth. BitTorrent's only relay is the holepunch extension's, a peer that carries an introduction and none of the data.
- ICE (Interactive Connectivity Establishment). The procedure that puts STUN and TURN together, RFC 5245 in 2010, written for calls set up over SIP (the Session Initiation Protocol), and now RFC 8445. Each peer gathers every address it might be reached at: its own, the public one STUN reports, and a TURN relay's. The two exchange their lists by some other path, such as a server both already reach, which is called signaling, and test pairs until one connects. WebRTC runs it for every connection. BitTorrent does the same work more simply: a client tries the addresses it learned for a peer, and the holepunch extension times a punch when neither side can be reached.