Network Architecture

Macro Browser's network architecture is built with privacy and security as core principles. The centerpiece of this architecture is a built-in peer-to-peer VPN that provides enhanced privacy without relying on centralized servers.

Architecture Overview


Network Architecture Overview

P2P VPN Architecture


The P2P VPN component is a core feature of Macro Browser that provides privacy protection by routing traffic through a decentralized network of peers.

Key Components

1. VPN Controller

Central management component for the VPN functionality:

  • User Interface Integration: Provides controls for enabling/disabling the VPN

  • Connection State Management: Tracks and manages the VPN connection state

  • Configuration Handling: Manages user-defined VPN settings

  • Diagnostic Tools: Provides troubleshooting and connection quality information

  • Split Tunneling: Controls which traffic goes through the VPN

2. Peer Discovery

Responsible for finding and connecting to peers in the network:

  • Bootstrap Process: Initial connection to the peer network

  • DHT (Distributed Hash Table): Decentralized peer discovery mechanism

  • NAT Traversal: Techniques for connecting peers behind firewalls/NATs

  • Peer Verification: Validates peer authenticity and integrity

  • Peer Metadata: Collects and shares non-identifying peer information

3. Encryption Layer

Ensures all traffic is securely encrypted:

  • WireGuard Protocol: Modern, high-performance VPN protocol

  • Key Management: Secure generation and storage of encryption keys

  • Perfect Forward Secrecy: Ensures past communications remain secure

  • Crypto Primitives: ChaCha20, Poly1305, Curve25519, BLAKE2s

  • Handshake Mechanism: Secure connection establishment

4. Routing Engine

Determines the optimal path for network traffic:

  • Multi-hop Routing: Routes traffic through multiple peers for enhanced privacy

  • Path Selection Algorithm: Balances privacy, latency, and reliability

  • Circuit Building: Establishes and maintains relay circuits

  • Congestion Control: Manages traffic to avoid bottlenecks

  • Dynamic Rerouting: Adapts to changing network conditions

5. Peer Management

Handles the relationship with other peers in the network:

  • Peer Ranking: Rates peers based on reliability and performance

  • Connection Pooling: Maintains a pool of available peer connections

  • Resource Allocation: Manages bandwidth and processing resources

  • Blacklisting: Excludes unreliable or malicious peers

  • Peer Rotation: Periodically changes peers to enhance privacy

6. Crypto Payment System

Facilitates the incentive mechanism for peer participation:

  • Micropayments: Small payments for bandwidth usage

  • Payment Channels: Efficient off-chain payment processing

  • Earning Model: Mechanism for peers to earn by sharing bandwidth

  • Transparent Pricing: Clear cost structure for network usage

  • Optional Participation: Users can choose whether to participate

Technical Implementation


Network Stack

WireGuard Integration

The VPN is built on the WireGuard protocol with custom extensions for P2P operation:

Peer Discovery and Management

Data Flow


Connection Establishment

Diagram 1

Traffic Routing

Diagram 2

Security Considerations


The P2P VPN architecture addresses several security concerns:

  • Traffic Analysis Resistance: Multi-hop routing prevents any single node from seeing both source and destination

  • No Central Point of Failure: Decentralized architecture eliminates single points of failure

  • Encryption: All traffic is encrypted end-to-end

  • No Logging: No central servers to store connection logs

  • IP Masking: User's real IP address is hidden from destination websites

  • Forward Secrecy: Session keys ensure past sessions remain secure if keys are compromised

  • Malicious Peer Protection: Peer verification and reputation system mitigates malicious peers

Performance Optimization


Several techniques ensure the P2P VPN maintains good performance:

  • Intelligent Peer Selection: Choose optimal peers based on latency, bandwidth, and reliability

  • Connection Reuse: Maintain connections to reduce handshake overhead

  • Adaptive Quality of Service: Prioritize interactive traffic over background transfers

  • Parallel Connections: Use multiple connections for improved throughput

  • Local Caching: Cache DNS and other repetitive requests locally

  • Optimized Protocols: Efficiency-focused protocol design

  • Bandwidth Management: Control bandwidth usage to avoid congestion

User Configuration Options


Users can customize the VPN behavior:

  • Connection Mode: Balance between speed and privacy (more relays = more privacy but higher latency)

  • Trusted Networks: Define networks where VPN activates/deactivates automatically

  • Split Tunneling: Choose which apps or sites bypass the VPN

  • Exit Region Preferences: Select preferred regions for exit nodes

  • Bandwidth Limits: Control bandwidth contribution when acting as a relay

Last updated