Version: v0.2.0 Latest Latest

This package is not in the latest version of its module.

Go to latest
Published: Dec 23, 2018 License: MIT Imports: 16 Imported by: 1


Stellar Network Service

The network service is a service that provides cross host networking for containers. Static routing is used for simplicity and easier debugging. Static networking was chosen for the following reasons:

  • Tunnels add overhead and need to be tuned to improve performance
  • Static routing offers native networking speed
  • Easier debugging
  • Access control using existing tools

In order to maintain simplicity and stable management the network is divided into subnets. The size of the network determines the capacity the cluster can scale. For example, a would be able to have a total of 255 container IP addresses. Since the divided subnets are used to route, each cluster node has to have a unique subnet. By default, Stellar uses the ( address space. This allows for a 1024 node cluster with 1022 routable containers per host (2 IPs per subnet are for gateway and broadcast). To scale larger you can use the subnet. This can grow much larger (a 4096 node cluster could have 4096 containers per node).

For easier management, upon node join it will be assigned a subnet from the global network. Any container that needs networking will be placed in this subnet. This also means easier IPAM as a node will have a dedicated subnet. For example, given a three node cluster the following subnets would be assigned:

  • (node0)
  • (node1)
  • (node2)

This format would allow the cluster to have 1,046,528 routable containers on the network (1024 nodes * 1022 container IPs). The Stellar network service also propagates subnet routes throughout the cluster.

Container Networking

Stellar utilizes CNI for networking in the containers. The CNI bridge plugin is used to setup the veth and bridge while a custom Stellar IPAM Plugin handles communicating to the network service via GRPC to allocate and release IP addresses.




This section is empty.


View Source
var (
	// ErrNoAvailableSubnets returns an error if there are no available subnets to allocate
	ErrNoAvailableSubnets = errors.New("no available subnets in network configuration")
	// ErrSubnetNotFound returns an error if no subnet is found for the node
	ErrSubnetNotFound = errors.New("subnet not found")
View Source
var (
	ErrNoAvailableIP = errors.New("IP allocation exhausted")
View Source
var (
	ErrRouteExists = errors.New("route exists in configuration")


func New

func New(cfg *stellar.Config, agent *element.Agent, ds datastoreapi.DatastoreServer) (*service, error)


This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL