Crate grafos_net

Crate grafos_net 

Source
Expand description

grafos-net — Network-aware programming primitives for grafOS.

This crate provides higher-level networking abstractions built on top of grafos-std’s grafos_std::net::NetLease and grafos_std::net::NetBuilder. Programs acquire leased network interfaces with bandwidth guarantees, then use familiar socket and listener APIs for communication.

§Architecture

+-------------------------------+
|  Your program                 |
|  FabricSocket / FabricDns     |
+-------------------------------+
|  grafos-net                   |
|  socket | listener | dns      |
+-------------------------------+
|  grafos-std::net              |
|  NetBuilder → NetLease        |
+-------------------------------+
|  Host: macvlan / SR-IOV / tc  |
+-------------------------------+

grafos-std::net handles lease acquisition (requesting a NIC with a bandwidth guarantee from the host). grafos-net builds familiar socket and DNS APIs on top of those leases.

§Types

TypePurpose
FabricSocketUDP socket bound to a leased NIC with bandwidth guarantee
FabricListenerTCP listener bound to a leased NIC
FabricDnsIn-memory name→address resolver with TTL cache

§Quick start

use grafos_net::FabricSocket;
use grafos_std::net::NetBuilder;

let lease = NetBuilder::new().min_bandwidth(1_000_000_000).acquire()?;
let sock = FabricSocket::new(lease)?;
assert_eq!(sock.bandwidth(), 1_000_000_000);

Structs§

FabricDns
Fabric DNS resolver for mapping node names to socket addresses.
FabricListener
A TCP listener bound to a leased fabric network interface.
FabricSocket
A network socket bound to a leased fabric network interface.