Documentation
¶
Overview ¶
Package dataplanetest runs a data plane for the tests of what rides it: a node of the smallest topology that carries SCION packets, one internal and one external link, on loopback sockets of the caller's host. Two nodes started with each other's external addresses share a direct link, so traffic crosses the data plane exactly as between two deployed nodes.
Index ¶
Constants ¶
const IfID = 1
IfID is the interface ID of every node's external link.
Variables ¶
This section is empty.
Functions ¶
func FreeUDPAddr ¶
FreeUDPAddr returns a UDP address on host with a port picked by the kernel and released for the caller's bind. Each package's tests reserve on a loopback host of their own: go test runs the packages in parallel, and on a shared host a released reservation could be taken before its rebind.
Types ¶
type Node ¶
type Node struct {
// IA is the node's ISD-AS, and Neighbor the ISD-AS across its link.
IA, Neighbor addr.IA
// ControlIP is the host the node's sockets bind, and Internal the
// internal link's address they send through.
ControlIP netip.Addr
Internal string
// MACKey is the node's forwarding key, which the sockets' one-hop
// paths are authenticated with.
MACKey []byte
// Provider is the node's underlay, which holds its service table.
Provider *dataplane.UDPProvider
}
Node is one running node and the facts a SCION socket of it needs.
func StartNode ¶
func StartNode(t *testing.T, host netip.Addr, ia, neighbor addr.IA, extLocal, extRemote string) *Node
StartNode starts a node on host; extRemote must be the neighbor node's extLocal. The node serves until the test ends.