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
| Type | Purpose |
|---|---|
FabricSocket | UDP socket bound to a leased NIC with bandwidth guarantee |
FabricListener | TCP listener bound to a leased NIC |
FabricDns | In-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§
- Fabric
Dns - Fabric DNS resolver for mapping node names to socket addresses.
- Fabric
Listener - A TCP listener bound to a leased fabric network interface.
- Fabric
Socket - A network socket bound to a leased fabric network interface.