Concepts: VNet (Overlay Network)

Last updated 2 min read
Report issue

Overview#

GritivaCore VNet is an overlay network that connects a set of scopes across one or many virtual machines (VMs) into a single private network. It utilizes WireGuard (gmesh) and Linux network namespaces to create a secure and efficient networking solution. This document outlines the key features, use cases, and technical specifications of VNets within the GritivaCore ecosystem.

What is VNet?#

A VNet (Virtual Network) in GritivaCore is a Wave A primitive that provides a private network with its own subnet, routing table, and DNS. It is defined by the following characteristics:

  • A CIDR (IPv4 only currently)
  • A list of attached scopes (membership)
  • A per-scope IP allocation
  • Optional egress NAT rules
  • Per-edge firewall rules

ASCII Diagram#

TEXT
VM1: Scope1  ----|
                |-- VNet (10.x.x.x)
VM1: Scope2  ----|

VM2: Scope1  ----|
                |-- VNet (10.x.x.x)
VM2: Scope2  ----|

Key Features#

  • Wave A vs Wave B: Wave A is overlay only (gmesh-based). Wave B adds vRouter/vSwitch/vLB primitives.

  • Lifecycle: VNets are created and managed in the panel at https://gritiva.com — open MESH → VNets, create the network with its CIDR, then attach or detach scopes from the network's member list. To read the same inventory from a script:

    BASH
    curl -s https://api.gritiva.com/api/v1/vnets \
      -H "X-API-Key: $GRITIVA_API_KEY"

    API keys are issued in the panel under SET. → API keys.

  • IP Allocation: The first attached scope gets .0.10, the next .0.11, etc. Static reservations are possible.

  • Cross-VM Behavior: Scopes on different VMs can reach each other through gmesh peers without a central router.

  • Common Pitfalls:

    • MTU mismatch when nesting.
    • DNS not propagated to scope automatically (you bind /etc/resolv.conf yourself).

Use Cases#

VNets are ideal for scenarios where secure, private communication between multiple VMs is required, such as:

  • Multi-tier applications where different components run on separate VMs.
  • Development and testing environments that require isolation from production networks.
  • Secure communication between microservices.

Comparison with Traditional Networks#

Unlike traditional networks that rely on physical infrastructure, VNets provide a flexible and scalable solution that can adapt to changing workloads and requirements. Key differences include:

  • Scalability: VNets can easily scale by adding or removing VMs without reconfiguring physical hardware.
  • Security: VNets offer enhanced security through isolation and encryption, reducing the attack surface.

Technical Specifications#

  • Protocol: Built on WireGuard (gmesh).
  • IP Addressing: Supports IPv4 CIDR notation.
  • Performance: Optimized for low-latency communication between VMs.

Conclusion#

GritivaCore VNet provides a robust solution for creating secure, private networks across multiple VMs. Its overlay architecture and integration with WireGuard make it a powerful tool for modern cloud environments.