Network Topology
Select a protocol layer to visualize different communication patterns
Message Log
Compare Protocols
Side-by-side view of all three communication patterns
REST API
- HTTP/1.1 Request / Response
- Centralized routing via server
- JSON payloads with status codes
- Stateless — each request is independent
TCP / UDP
- TCP Reliable streams + UDP fast datagrams
- Persistent socket connections
- Binary frame protocol
- Connection state: SYN → ACK → DATA
P2P Mesh
- DHT Distributed hash table lookup
- No central server required
- Direct peer connections
- Gossip protocol for discovery
Layered Architecture
How the communication stack is structured
Application Layer
REST API endpoints for ride requests, driver matching, and status updates. JSON serialization with HTTP verbs (GET, POST, PUT).
Transport Layer
TCP for reliable ordered delivery of ride confirmations. UDP for real-time location broadcasts with minimal overhead.
Network / P2P Layer
Peer-to-peer mesh for direct rider-driver communication. DHT-based discovery eliminates single points of failure.
Lamport Logical Clocks
Every node maintains a logical clock. On send: clock++. On receive: clock = max(local, received) + 1. Ensures causal ordering across the distributed system.