Skip to content

Instantly share code, notes, and snippets.

@jafow
Last active April 9, 2018 21:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jafow/69a22aa345a884c45f33b37b54ccc63e to your computer and use it in GitHub Desktop.
Save jafow/69a22aa345a884c45f33b37b54ccc63e to your computer and use it in GitHub Desktop.
awl - spec

Overview

awl is a module for connecting peers that are both behind a p2p friendly NAT;

  • a rendezvous server Ṟ -- globally available IP addr -- listens for UDP connections

  • Ṟ connects two peers A → B;

    • If A wants to connect to B, A pings Ṟ and receives a response from Ṟ with B's IP/PORT info (B[IP]:B[PORT])

    • A then sends a packet to B[IP]:B[PORT], which opens that port on A's NAT but is blocked by B's NAT.

    • B does the same: msg request for A[IP]:A[PORT] → Ṟ → A[IP]:A[PORT] to B. B requests to A[IP]:A[PORT]. A receives this message because its NAT has been opened at B's PORT. \0/

  • the awl client sends a request to awl service with destination IP and Hosts hashed.

    • crafty nats that look for IP-like data can't read it
    • maintain request & dest data privacy during hole punching
  • awl rendezous service and clients handle

    1. direct actual peer to peer connections (peers behind on the same LAN, behind same NAT, peers with global public IP addr)
    2. connection where peer 1 is behind a NAT, peer 2 is publicly available.
    3. port collisions

TODO

  • use the bryanosaurus paper and/or dat to clarify "p2p" friendly.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment