Coordinates
Coordinates use the Vivaldi algorithm to estimate P2P latency, creating a scalable “map” of network topology in virtual space.
1. Purpose
Section titled “1. Purpose”- Estimate RTT between naras without full-mesh pinging.
- Drive proximity-based social behaviors and “best friends.”
- Optimize World Postcard routing.
- Network visualization in the web UI.
2. Conceptual Model
Section titled “2. Conceptual Model”- Virtual Space: 2D Euclidean plane where naras “move” based on latency.
- Height: A third dimension for “last-mile” (non-Euclidean) latency.
- Confidence:
Errorscore (0.0 to 1.0) indicating coordinate accuracy.
Invariants
Section titled “Invariants”- Refinement: Coordinates stabilize over time as real pings are observed.
- Prediction:
Estimated_RTT = Euclidean_Distance(A, B) + A.Height + B.Height.
3. External Behavior
Section titled “3. External Behavior”- Automatic Updates: Triggered by Mesh HTTP
/pingorPingObservationevents. - Influence Bonus: 30% boost to opinions for nearby naras.
- Barrios: Latency clustering into neighborhoods (see Aura & Avatar).
4. Interfaces
Section titled “4. Interfaces”NetworkCoordinate Structure
Section titled “NetworkCoordinate Structure”x,y,height,error.
HTTP API
Section titled “HTTP API”GET /coordinates: Returns local virtual position.
5. Algorithms
Section titled “5. Algorithms”Vivaldi Update
Section titled “Vivaldi Update”Triggered when measuring RTT r to peer:
- Weight:
w = me.Error / (me.Error + peer.Error). - Relative Error:
e_rel = |Predicted_RTT - r| / r. - Error Update:
me.Error = (e_rel * Cc * w) + (me.Error * (1 - Cc * w)). - Position: Move
me.posalong the unit vector frompeertomebased on(r - Predicted_RTT). - Height: Adjust
me.Heightby displacement factor.
Proximity Bonus
Section titled “Proximity Bonus”Bonus = 100 / max(1, Measured_Distance_in_ms).
6. Failure Modes
Section titled “6. Failure Modes”- Oscillation: Unstable networks may prevent convergence.
- Triangle Inequality Violation: High-latency direct links “bend” virtual space.
- Spoofing: Coordinates are self-reported and not cryptographically verified.
7. Test Oracle
Section titled “7. Test Oracle”TestVivaldi_UpdateConvergence: Stability checks.TestVivaldi_DistanceCalculation: Euclidean + height verification.TestProximity_Influence: Clout boost validation.