# MVP The module should: - Access and parse configuration - Create and tear tunnels via P2P protocol - Serve router functionality via P2P protocol - Provide encrypted communication between peers - Final: send message via tunnel ## P2P Messages Messages between Onion modules are transmitted via TCP sockets and TLS encrpyted. The Onion packets of our P2P protocol are the payload of these TLS packets. Every packet is padded to have the exact size, the padding should be random, but may be undefined. Packets not conforming the size restrictions are rejected. ### Header - CircID - Command (8bit) ### Commands #### CREATE Initiates a new hop to another peer. The origin of this packet is always the last node in the current tunnel. - Length (16bit) - Encrypted message containing the ECDH public key of the proxy. #### CREATED - Length (16bit) - Error message #### DESTROY #### RELAY Sub-Header: - Length - Digest - Relay Command ##### RELAY EXTEND - Flags (IP version) - Adress - Port - encrypted EDCH payload ##### RELAY EXTENDED - Flags (IP version, error) - Adress - Port - Message extended needs error handling, i.e. node requested not available ##### RELAY DATA - Payload Relay packet length of 0 implies that this is cover traffic and should be discarded. ##### RELAY TRUNCATE ##### RELAY TRUNCATED - Flags (IP version, if by error or as requested) - IP - Port - Error code