Open Kilda Java Documentation
org.openkilda.pce.model.AvailableNetwork Class Reference

Public Member Functions

 AvailableNetwork (Driver driver, boolean ignoreBandwidth, long requestedBandwidth)
 
 AvailableNetwork (Driver driver)
 
AvailableNetwork addLink (SwitchId srcDpid, SwitchId dstDpid, int srcPort, int dstPort, int cost, int latency)
 
Map< SwitchId, SimpleSwitchgetSwitches ()
 
SimpleSwitch getSimpleSwitch (SwitchId dpid)
 
Map< String, Integer > getCounts ()
 
void sanityCheck ()
 
void reduceByCost ()
 
AvailableNetwork removeSelfLoops ()
 
void addIslsOccupiedByFlow (String flowId, boolean ignoreBandwidth, long flowBandwidth)
 
String toString ()
 

Detailed Description

Semantically, this class represents an "available network". That means everything in it is active, and the available bandwidth of the isl links matches the criteria specified.

It supports unidirectional links - ie either Inbound or Outbound can be null.

Definition at line 47 of file AvailableNetwork.java.

Constructor & Destructor Documentation

◆ AvailableNetwork() [1/2]

org.openkilda.pce.model.AvailableNetwork.AvailableNetwork ( Driver  driver,
boolean  ignoreBandwidth,
long  requestedBandwidth 
)

Main constructor that reads topology from the database.

Definition at line 58 of file AvailableNetwork.java.

◆ AvailableNetwork() [2/2]

org.openkilda.pce.model.AvailableNetwork.AvailableNetwork ( Driver  driver)

Creates empty representation of network topology.

Definition at line 67 of file AvailableNetwork.java.

Member Function Documentation

◆ addIslsOccupiedByFlow()

void org.openkilda.pce.model.AvailableNetwork.addIslsOccupiedByFlow ( String  flowId,
boolean  ignoreBandwidth,
long  flowBandwidth 
)

Since flow might be already existed and occupied some isls we should take it into account when filtering out ISLs that don't have enough available bandwidth.

Parameters
flowIdcurrent flow id.
ignoreBandwidthdefines whether bandwidth of links should be ignored.
flowBandwidthrequired bandwidth amount that should be available on ISLs.

Definition at line 198 of file AvailableNetwork.java.

◆ addLink()

AvailableNetwork org.openkilda.pce.model.AvailableNetwork.addLink ( SwitchId  srcDpid,
SwitchId  dstDpid,
int  srcPort,
int  dstPort,
int  cost,
int  latency 
)

Creates switches (if they are not created yet) and ISL between them.

Definition at line 89 of file AvailableNetwork.java.

◆ getCounts()

Map<String, Integer> org.openkilda.pce.model.AvailableNetwork.getCounts ( )

This call can be used to determine the effect of things like reduceByCost and removeSelfLoops.

Returns
The count of switches, neighbors, ISLs

Definition at line 112 of file AvailableNetwork.java.

◆ getSimpleSwitch()

SimpleSwitch org.openkilda.pce.model.AvailableNetwork.getSimpleSwitch ( SwitchId  dpid)

Definition at line 104 of file AvailableNetwork.java.

◆ getSwitches()

Map<SwitchId, SimpleSwitch> org.openkilda.pce.model.AvailableNetwork.getSwitches ( )

Definition at line 100 of file AvailableNetwork.java.

◆ reduceByCost()

void org.openkilda.pce.model.AvailableNetwork.reduceByCost ( )

Call this function to reduce the network to single (directed) links between src and dst switches. The algorithm runs on the Outgoing and the Incoming links, which could have different values. Consequently, one of these could be null by the end.

Definition at line 150 of file AvailableNetwork.java.

◆ removeSelfLoops()

AvailableNetwork org.openkilda.pce.model.AvailableNetwork.removeSelfLoops ( )

Eliminate any self loops (ie src and dst switch is the same.

Returns
this

Definition at line 182 of file AvailableNetwork.java.

◆ sanityCheck()

void org.openkilda.pce.model.AvailableNetwork.sanityCheck ( )

This function can be / should be called after initialization so that all of the checks can be made to ensure the data is okay.

Definition at line 135 of file AvailableNetwork.java.

◆ toString()

String org.openkilda.pce.model.AvailableNetwork.toString ( )

Definition at line 267 of file AvailableNetwork.java.


The documentation for this class was generated from the following file: