Documentation ¶
Index ¶
- Constants
- func AssignAddrs(tbAddr TPA, tbx *xir.Topology, switchRoles []xir.Role, hostRoles []xir.Role) (map[*xir.Device]TPA, map[*xir.Interface]TPA)
- func AssignTPAsInfraNet(tbAddr TPA, tbx *xir.Topology) (map[*xir.Device]TPA, map[*xir.Interface]TPA)
- func AssignTPAsXpNet(tbAddr TPA, tbx *xir.Topology) (map[*xir.Device]TPA, map[*xir.Interface]TPA)
- func CheckLinks(e *Embedding) portal.Diagnostics
- func CleanSegments(e *Embedding)
- func CollectHops(wp *Waypoint) [][]*xir.Interface
- func CollectLinks(wp *Waypoint) []*xir.Connection
- func ComputeCosts(hs []*Host)
- func ComputeInterfaceConstraints(tbx *xir.Topology)
- func DiagnosticDebugf(format string, a ...interface{}) *rz.Diagnostic
- func DiagnosticErrorf(format string, a ...interface{}) *rz.Diagnostic
- func DiagnosticWarningf(format string, a ...interface{}) *rz.Diagnostic
- func DiagnosticsMacWarning(ifx *xir.Interface) *rz.Diagnostic
- func EmbedHarborLinks(e *Embedding, tbx *xir.Topology, rt RoutingTable, rvx *xir.Device) portal.Diagnostics
- func EmbedInfranetLinks(net NetworkMode, e *Embedding, tbx *xir.Topology, rt RoutingTable, ...) portal.Diagnostics
- func EmbedLink(e *Embedding, x *xir.Connection, tbx *xir.Topology, rt RoutingTable, ...) portal.Diagnostics
- func EmbedLinks(e *Embedding, tbx, xp *xir.Topology, rt RoutingTable, ...) portal.Diagnostics
- func EmbedNodes(e *Embedding, a *portal.AllocationTable, guests []*Guest, metal, virt []*Host, ...) portal.Diagnostics
- func Equals(x, other Route) bool
- func FillInHostGuestInfo(ds rz.Diagnostics, nodes map[string]*NodeEmbedding) rz.Diagnostics
- func FormatUnits(s string) string
- func Oversubscribed(component string) *rz.Diagnostic
- func Provision(g *Guest, hosts []*Host, e *Embedding, a *portal.AllocationTable, ...) portal.Diagnostics
- func ResolveDisks(r *xir.Resource, s *xir.DiskSpec, a *xir.DisksAllocation) (*xir.DisksAllocation, rz.Diagnostics)
- func ResolveImage(r *xir.Resource, s *xir.Node) rz.Diagnostics
- func ResolveMemory(r *xir.Resource, s *xir.MemorySpec, a *xir.MemoryAllocation) (*xir.MemoryAllocation, rz.Diagnostics)
- func ResolveNIC(r *xir.Resource, s *xir.NICSpec, a *xir.NICsAllocation) (*xir.NICsAllocation, rz.Diagnostics)
- func ResolveNode(r *xir.Resource, s *xir.Node, as []*xir.ResourceAllocation, mzid string) (*xir.ResourceAllocation, rz.Diagnostics)
- func ResolveProc(r *xir.Resource, s *xir.ProcSpec, a *xir.ProcAllocation) (*xir.ProcAllocation, rz.Diagnostics)
- func Shorter(x, other Route) bool
- func Sort(hs []*Host) ([]*Host, []*Host)
- func StringTPAs(tbx *xir.Topology) string
- func WithGuest(ds rz.Diagnostics, g *Guest) rz.Diagnostics
- func WithHost(ds rz.Diagnostics, h *Host) rz.Diagnostics
- type Cost
- type DevAddrMap
- type Direction
- type Embedding
- type End
- type EndpointMode
- type ExpectedResult
- type Guest
- type Host
- type IfxAddrMap
- type InterfaceSelection
- type LinkEmulation
- type LinkEmulationParams
- type MiniLinkRealization
- type MiniLinkSegment
- type MiniNetPoint
- type MiniRealization
- type NetworkMode
- type NextHop
- type NodeEmbedding
- type Path
- type PathFinder
- type Route
- type RouteMessage
- type RoutingTable
- func (rt RoutingTable) AnyPaths(from *xir.Interface, to TPA) *Waypoint
- func (rt RoutingTable) Dump(tbx *xir.Topology)
- func (rt RoutingTable) GetRandomShortestRouteTo(host string, destination TPA) *Route
- func (rt RoutingTable) GetRouteTo(host string, destination TPA) []Route
- func (rt RoutingTable) GetRouteUsing(ifx *xir.Interface) *Route
- func (rt RoutingTable) GetShortestRoutesTo(host string, destination TPA) []Route
- func (rt RoutingTable) Paths(from *xir.Interface, to TPA) *Waypoint
- func (rt RoutingTable) ShortestPath(from *xir.Interface, to TPA) (*Waypoint, portal.Diagnostics)
- func (rt RoutingTable) String(tbx *xir.Topology) string
- type TPA
- func (t TPA) GetGuest() uint16
- func (t TPA) GetHost() uint16
- func (t TPA) GetNetwork() uint16
- func (t TPA) GetTestbed() uint16
- func (t TPA) SetGuest(x uint16) TPA
- func (t TPA) SetHost(x uint16) TPA
- func (t TPA) SetNetwork(x uint16) TPA
- func (t TPA) SetTestbed(x uint16) TPA
- func (t TPA) String() string
- type Waypoint
Constants ¶
View Source
const ( CPUCostPerCore = 45.0 MemoryCostPerByte = 7.0 / 1024 / 1024 / 1024 NetworkCostPerBit = 8.0 / 1024 / 1024 / 1024 DiskCostPerByte = 3.0 / 1024 / 1024 / 1024 )
View Source
const ( HarborLsi = 3 LsiBegin = 100 MarinerInfraBridge = "mbr" DefaultMtu = 1500 JumboMtu = 9216 )
View Source
const ( SwitchMask = uint8(32) HostMask = uint8(16) )
Variables ¶
This section is empty.
Functions ¶
func AssignAddrs ¶
func AssignTPAsInfraNet ¶
func AssignTPAsXpNet ¶
func CheckLinks ¶
func CheckLinks(e *Embedding) portal.Diagnostics
func CleanSegments ¶
func CleanSegments(e *Embedding)
func CollectHops ¶
func CollectHops(wp *Waypoint) [][]*xir.Interface
func CollectLinks ¶
func CollectLinks(wp *Waypoint) []*xir.Connection
func ComputeCosts ¶
func ComputeCosts(hs []*Host)
func ComputeInterfaceConstraints ¶
func ComputeInterfaceConstraints(tbx *xir.Topology)
func DiagnosticDebugf ¶
func DiagnosticDebugf(format string, a ...interface{}) *rz.Diagnostic
func DiagnosticErrorf ¶
func DiagnosticErrorf(format string, a ...interface{}) *rz.Diagnostic
func DiagnosticWarningf ¶
func DiagnosticWarningf(format string, a ...interface{}) *rz.Diagnostic
func DiagnosticsMacWarning ¶
func DiagnosticsMacWarning(ifx *xir.Interface) *rz.Diagnostic
func EmbedHarborLinks ¶
func EmbedHarborLinks( e *Embedding, tbx *xir.Topology, rt RoutingTable, rvx *xir.Device, ) portal.Diagnostics
func EmbedInfranetLinks ¶
func EmbedInfranetLinks( net NetworkMode, e *Embedding, tbx *xir.Topology, rt RoutingTable, rvx *xir.Device, ) portal.Diagnostics
func EmbedLink ¶
func EmbedLink( e *Embedding, x *xir.Connection, tbx *xir.Topology, rt RoutingTable, a *portal.AllocationTable, emubackend xir.Emulation, ) portal.Diagnostics
TODO somewhat of a bottleneck for large LANs
func EmbedLinks ¶
func EmbedLinks( e *Embedding, tbx, xp *xir.Topology, rt RoutingTable, a *portal.AllocationTable, emubackend xir.Emulation, ) portal.Diagnostics
func EmbedNodes ¶
func EmbedNodes( e *Embedding, a *portal.AllocationTable, guests []*Guest, metal, virt []*Host, mzid string, ) portal.Diagnostics
func FillInHostGuestInfo ¶
func FillInHostGuestInfo(ds rz.Diagnostics, nodes map[string]*NodeEmbedding) rz.Diagnostics
func FormatUnits ¶
func Oversubscribed ¶
func Oversubscribed(component string) *rz.Diagnostic
func Provision ¶
func Provision( g *Guest, hosts []*Host, e *Embedding, a *portal.AllocationTable, kind portal.NodeRealization_Kind, mzid string, ) portal.Diagnostics
func ResolveDisks ¶
func ResolveDisks( r *xir.Resource, s *xir.DiskSpec, a *xir.DisksAllocation, ) (*xir.DisksAllocation, rz.Diagnostics)
func ResolveImage ¶
func ResolveImage(r *xir.Resource, s *xir.Node) rz.Diagnostics
func ResolveMemory ¶
func ResolveMemory( r *xir.Resource, s *xir.MemorySpec, a *xir.MemoryAllocation, ) (*xir.MemoryAllocation, rz.Diagnostics)
func ResolveNIC ¶
func ResolveNIC( r *xir.Resource, s *xir.NICSpec, a *xir.NICsAllocation, ) (*xir.NICsAllocation, rz.Diagnostics)
ResolveNIC: find the NICs/Ports that we can allocate to the requested NICSpec return the resulting xir.NICsAllocation
func ResolveNode ¶
func ResolveNode( r *xir.Resource, s *xir.Node, as []*xir.ResourceAllocation, mzid string, ) (*xir.ResourceAllocation, rz.Diagnostics)
func ResolveProc ¶
func ResolveProc( r *xir.Resource, s *xir.ProcSpec, a *xir.ProcAllocation, ) (*xir.ProcAllocation, rz.Diagnostics)
resolve a processor specification embodied by a set of constraints against a resource definition containing a set of processors and return a set of virtual processors as a unit of allocation, given an existing set of allocations
func StringTPAs ¶
func StringTPAs(tbx *xir.Topology) string
func WithGuest ¶
func WithGuest(ds rz.Diagnostics, g *Guest) rz.Diagnostics
func WithHost ¶
func WithHost(ds rz.Diagnostics, h *Host) rz.Diagnostics
Types ¶
type DevAddrMap ¶
type DevAddrMap map[*xir.Device]TPA
func (DevAddrMap) Dump ¶
func (dam DevAddrMap) Dump()
type Embedding ¶
type Embedding struct { Nodes map[string]*NodeEmbedding // map xpnode name to the embedding of that node Links map[*xir.Connection]*portal.LinkRealization // map connection to link realization Endpoints map[*xir.Interface][]*portal.Endpoint // map interface to slice of endpoints on that interface InfrapodServer string // hostname of infrapod server supporting this realization. InfrapodSite string // facility hosting the infrapod server VirtualMacs map[string]bool // MACs allocated for VMs in this embedding LinkEmulation *LinkEmulationParams // Link emulation parameters // contains filtered or unexported fields }
func EmbedSys ¶
Perform system static embeddings. This is for creating static virtual networks that always exist.
- Imaging Network
- Mass storage network
func NewEmbedding ¶
func NewEmbedding() *Embedding
type EndpointMode ¶
type EndpointMode uint8
const ( TrunkMode EndpointMode = iota AccessMode VtepMode )
type IfxAddrMap ¶
type IfxAddrMap map[*xir.Interface]TPA
func (IfxAddrMap) Dump ¶
func (iam IfxAddrMap) Dump()
type InterfaceSelection ¶
type LinkEmulation ¶
type LinkEmulation struct { Interfaces []*portal.Vtep // vteps on the emu server Link *portal.LinkEmulation }
type LinkEmulationParams ¶
type LinkEmulationParams struct { Links []*LinkEmulation // the emulated links Servers storage.EmuServers // emu server allocations Backend xir.Emulation // emulation type }
type MiniLinkRealization ¶
type MiniLinkRealization struct {
Segments map[uint64]*MiniLinkSegment
}
func (*MiniLinkRealization) Equals ¶
func (lrz *MiniLinkRealization) Equals(other *MiniLinkRealization) bool
func (*MiniLinkRealization) ToString ¶
func (lrz *MiniLinkRealization) ToString(indent string) string
type MiniLinkSegment ¶
type MiniLinkSegment struct { Endpoints []*MiniNetPoint Waypoints []*MiniNetPoint }
func MiniLinkSegmentFromLinkSegment ¶
func MiniLinkSegmentFromLinkSegment(seg *portal.LinkSegment) *MiniLinkSegment
func (*MiniLinkSegment) Equals ¶
func (seg *MiniLinkSegment) Equals(other interface{}) bool
type MiniNetPoint ¶
type MiniNetPoint struct { Host string Ifx string Net string // is something along the lines of vlan/phy/vtep or trunk/access/vtep/peer or so Ext string // extra stuff, like is virtual }
func NetPointFromEndpoint ¶
func NetPointFromEndpoint(ep *portal.Endpoint) *MiniNetPoint
func NetPointFromWaypoint ¶
func NetPointFromWaypoint(wp *portal.Waypoint) *MiniNetPoint
func (*MiniNetPoint) Equals ¶
func (np *MiniNetPoint) Equals(other interface{}) bool
func (*MiniNetPoint) Hash ¶
func (np *MiniNetPoint) Hash() uint32
func (MiniNetPoint) String ¶
func (np MiniNetPoint) String() string
type MiniRealization ¶
type MiniRealization struct { Nodes map[string]string Links map[string]*MiniLinkRealization }
func (MiniRealization) Equals ¶
func (mr MiniRealization) Equals(other MiniRealization) bool
func (MiniRealization) ToString ¶
func (mr MiniRealization) ToString() string
type NetworkMode ¶
type NetworkMode uint8
const ( HarborMode NetworkMode = iota InfranetMode XpnetMode )
type NodeEmbedding ¶
type NodeEmbedding struct { Node *xir.Node // node represents the cyber entity Resource *xir.Device // resource represents the physical resource hosting the node Kind portal.NodeRealization_Kind // whether the node is a bare metal or VM entity InfranetAddr string // the infranet address assigned to the node XpnetIdx uint32 // Number of xpnet NICs allocated for the node embedding (VMs only) VmAlloc *xir.ResourceAllocation // XIR representation of the resources allocated for the node (VMs only) }
type PathFinder ¶
type PathFinder struct { Path *Path // contains filtered or unexported fields }
func NewPathFinder ¶
func NewPathFinder( start, finish *End, rt RoutingTable, lsi uint64, tbx *xir.Topology, vrf string, ) (*PathFinder, rz.Diagnostics)
func (*PathFinder) Direction ¶
func (pf *PathFinder) Direction() Direction
func (*PathFinder) Run ¶
func (pf *PathFinder) Run() rz.Diagnostics
type Route ¶
type Route struct { Dev *xir.Interface Destination TPA Mask uint8 Hops uint8 NextHop *xir.Interface Connection *xir.Connection }
func (Route) StringWithId ¶
type RouteMessage ¶
type RoutingTable ¶
A RoutingTable associates the name of a host with a set of routes.
func BuildInfraRoutingTable ¶
func BuildInfraRoutingTable(tbx *xir.Topology) RoutingTable
func BuildRoutingTable ¶
func BuildRoutingTable( tbx *xir.Topology, switchRoles, hostRoles []xir.Role, linkRole xir.LinkRole, ) RoutingTable
func BuildXpRoutingTable ¶
func BuildXpRoutingTable(tbx *xir.Topology) RoutingTable
func (RoutingTable) AnyPaths ¶
func (rt RoutingTable) AnyPaths(from *xir.Interface, to TPA) *Waypoint
func (RoutingTable) Dump ¶
func (rt RoutingTable) Dump(tbx *xir.Topology)
func (RoutingTable) GetRandomShortestRouteTo ¶
func (rt RoutingTable) GetRandomShortestRouteTo(host string, destination TPA) *Route
func (RoutingTable) GetRouteTo ¶
func (rt RoutingTable) GetRouteTo(host string, destination TPA) []Route
func (RoutingTable) GetRouteUsing ¶
func (rt RoutingTable) GetRouteUsing(ifx *xir.Interface) *Route
func (RoutingTable) GetShortestRoutesTo ¶
func (rt RoutingTable) GetShortestRoutesTo(host string, destination TPA) []Route
func (RoutingTable) Paths ¶
func (rt RoutingTable) Paths(from *xir.Interface, to TPA) *Waypoint
func (RoutingTable) ShortestPath ¶
func (rt RoutingTable) ShortestPath(from *xir.Interface, to TPA) (*Waypoint, portal.Diagnostics)
func (RoutingTable) String ¶
func (rt RoutingTable) String(tbx *xir.Topology) string
type TPA ¶
type TPA uint64
func (TPA) GetNetwork ¶
func (TPA) GetTestbed ¶
func (TPA) SetNetwork ¶
func (TPA) SetTestbed ¶
Click to show internal directories.
Click to hide internal directories.