# Network Architecture

## <mark style="color:purple;">Network Architecture</mark>

Mesh P2P VPN with distributed routing and verifiable paths.

***

<figure><img src="https://content.gitbook.com/content/12iOS9xiOBrGJgaaBtCR/blobs/fEWCAwz4uG4IPcbtVvEM/Screenshot_27.png" alt=""><figcaption><p>Network Architecture Overview</p></figcaption></figure>

![Diagram 1](https://content.gitbook.com/content/12iOS9xiOBrGJgaaBtCR/blobs/s8FhaILNOmkvsflE4wLt/Screenshot_3.png)

![Diagram 2](https://content.gitbook.com/content/12iOS9xiOBrGJgaaBtCR/blobs/VDgmk9eJH5h5zUPsdn81/Screenshot_4.png)

***

### <mark style="color:purple;">Mesh VPN Architecture</mark>

**Decentralized routing system:**

#### <mark style="color:purple;">Network Topology</mark>

* Distributed peer-to-peer mesh
* No central VPN servers
* Global node distribution
* Dynamic routing based on health

#### <mark style="color:purple;">Node Types</mark>

**Entry Nodes** - Your traffic enters the mesh here. Multiple entry points for redundancy, geographically distributed.

**Relay Nodes** - Intermediate hops in the route. Each knows only previous and next hop. Onion-style routing for privacy.

**Exit Nodes** - Traffic exits to destination here. Choose exit location. Load-balanced across exit points.

### <mark style="color:purple;">Routing Protocol</mark>

**Dynamic path selection:**

#### Route Building

1. Client requests route from entry to exit region
2. Routing algorithm selects path based on node health scores, latency metrics, geographic distribution, and load balancing
3. Establishes encrypted tunnel through selected nodes
4. Monitors route health continuously

#### Route Optimization

* Multi-path routing for redundancy
* Automatic failover to healthy routes
* Latency-based path selection
* Avoid congested nodes

### <mark style="color:purple;">Encryption</mark>

**Multi-layer encryption:**

#### Onion Routing

* Each hop encrypted separately
* Node A can't see what Node C knows
* End-to-end encryption on top of hop encryption

#### Protocol

* ChaCha20-Poly1305 for speed
* Curve25519 for key exchange
* Perfect forward secrecy
* No logs of encryption keys

### <mark style="color:purple;">Health Monitoring</mark>

**Real-time route health:**

#### Metrics Tracked

* Latency per hop
* Packet loss rates
* Bandwidth availability
* Node uptime

#### Visual Display

* Route map showing path
* Health indicator per hop (green/yellow/red)
* Estimated total latency
* Real-time throughput

#### Auto Re-routing

* If hop degrades, re-route around it
* Seamless transition (no connection drop)
* User notification of route change
* Health improvement triggers route recalculation

### <mark style="color:purple;">Node Operation</mark>

**Community-run infrastructure:**

#### Node Operators

* $MACRO stakers
* Community members
* Ecosystem participants

#### Requirements

* Minimum $MACRO stake
* Stable internet connection
* Sufficient bandwidth allocation
* Uptime commitments

#### Reputation System

* Performance-based scoring
* Uptime tracking
* User ratings
* Reward multipliers for high-quality nodes

#### Rewards

$MACRO earnings based on:

* Traffic routed
* Uptime percentage
* Reputation score
* Network demand

### <mark style="color:purple;">Geographic Distribution</mark>

**Global coverage:**

#### Regions

* North America (US, Canada)
* Europe (UK, Germany, Netherlands, France)
* Asia (Singapore, Japan, Hong Kong)
* Others (Australia, South America)

#### Exit Node Selection

* Auto (best performance)
* Specific country/region
* Nearest to destination
* Random (maximum privacy)

### <mark style="color:purple;">Traffic Analysis Resistance</mark>

**Prevent correlation attacks:**

#### Timing Obfuscation

* Random delays injected
* Traffic padding
* Packet size normalization

#### Flow Correlation Prevention

* Multi-hop routing
* Different paths for different streams
* Session rotation

### <mark style="color:purple;">Performance</mark>

**Optimized for speed:**

#### Benchmarks

* Overhead: \~15-25ms average added latency
* Throughput: 80-95% of direct connection
* Better than traditional VPNs (no single chokepoint)

#### Optimizations

* Smart route caching
* Persistent connections where safe
* UDP support for low-latency applications
* QoS prioritization

### <mark style="color:purple;">Failover & Redundancy</mark>

**Always-on connectivity:**

#### Automatic Failover

* If route fails, instant failover to backup
* Multiple backup routes pre-computed
* No user intervention required

#### Kill Switch

* Optional: block all traffic if VPN fails
* Prevent IP leaks
* Auto-reconnect attempts
* Configurable per profile

***

Decentralized. Verifiable. Fast.

***
