Network Address Translator (NAT) for UDP - symmetric: NAT mapping refers specifically to the connection between the local host address and port number and the destination address and port number and a binding of the local address and port to a public-side address and port - full-cone: the binding of a local address and port to a public-side address and port, when established, can be used by any remote host on any remote port address - restricted-cone: the NAT binding is accessible only by the destination host, although in this case the destination host can send packets from any port address after the binding is created - port-restricted cone: the NAT binding is accessible by any remote host, although in this case the remote host must use the same source port address as the original port address that triggered the NAT binding STUN (Simple Traversal of UDP through NAT) -- now STUN (Session Traversal Utilities for NAT) - STUN server: fixed server with two IP addresses - see if the host is behind a NAT * client sends request to STUN server, and server puts IP address and port into the response packet - see if it is a full-cone NAT * send second packet to same STUN server address and port, but request response from alternat address/port --> if packet received, there is a full-cone NAT - see if it is a symmetric NAT * send second packet to the second STUN server address and port, and if the address/port is different than last time, it is a symmetric NAT NAT traversal under full-cone - Private host contacts Rendezvous server, reports available - Remote host contacts Rendezvous server, requests IP/port of Private host - Rendezvous server returns Public IP/port to Remote host - Remote host attempts to contact Public IP/port - Remote IP/port mapped to Private IP/port - (Keep-alive message to keep it open) NATs under symmetric - cannot do traversal - direct traffic through intermediate node BitTorrent - .torrent file: contains information about the file, its length, name, and hashing information, and the url of a tracker - tracker: responsible for helping downloaders find each other - swarm: all the peers sharing a torrent - seed: downloaded who already has the complete file available - leech: downloader (especially one who downloads more than uploading) - piece/block: portion of file (e.g., quarter MB), to simplify keeping track of who has what - piece selection: rarest first (to get more copies in the system) and random (to avoid slow download on rare pieces) - choking: temporary refusal to upload - choking algorithm: unchoke fixed # of peers (e.g., four), best rate plus one "optimistic unchoking" - divide upload bandwidth equally BitTyrant - no change to the protocol, just to selection of upload rates - ranks peers by download/upload ratio, and pick the top ones - estimate the upload rate that encourages reciprocation ("last place is good enough") BitTorrent as an auction - proportional share: peers reward one another with proportional shares of bandwidth - under-reporting of blocks, to make yourself more interesting in later rounds (i.e., reveal a piece when another peer starts losing interest)