nettle-frp-0.1: FRP for controlling networks of OpenFlow switches.

Nettle.FRPControl.NetInfo

Contents

Description

This module defines a relational view of the network state and configuration, and provides signal functions that dynamically maintain this view.

Synopsis

Switch and port information

type SwitchTable = [SwitchRecord]Source

A SwitchTable is a list of SwitchRecords

data SwitchRecord Source

Constructors

SwitchRecord 

Fields

switchID :: SwitchID

switch identifier

packetBufferSize :: Integer

maximum number of packets buffered at the switch

numberFlowTables :: Integer

number of flow tables

capabilities :: [SwitchCapability]

switch's capabilities

supportedActions :: [ActionType]

actions supported by the switch

type PortTable = [PortRecord]Source

A list of PortRecords; PortRecords should be uniquely identifiable by their SwitchID and PortID.

data PortRecord Source

Constructors

PortRecord 

Fields

portSwitch :: SwitchID

Switch the port belongs to

portID :: PortID

Port ID of the port

portAddr :: EthernetAddress

Hardware (Ethernet) address of the port.

spanningTreeState :: SpanningTreePortState

Spanning tree protocol state for this port

isPortDown :: Bool
 
isLinkDown :: Bool
 
isUsedForFlooding :: Bool
 

class HasDataPathID a whereSource

Type class for records having datapath-id fields. Having records implement this class allows the client to use uniform syntax for fields of different records.

Methods

dPID :: a -> SwitchIDSource

data NetInfo Source

The NetInfo datatype carries network information in a form that is easily retrieved from switches.

Instances

portTable :: NetInfo -> PortTableSource

Project the current PortTable value from a NetInfo value.

switchTable :: NetInfo -> SwitchTableSource

Project the current SwitchTable value from a NetInfo value.

data NetworkMonitorPolicy Source

Constructors

NetworkMonitorPolicy 

Fields

switchFeaturesRefreshPeriod :: Time

Amount of time (in seconds) between switch feature queries

portStatisticsRefreshPeriod :: Time

Amount of time (in seconds) between port statistics queries

networkInfoRequester :: NetworkMonitorPolicy -> SF (Event (SwitchID, SwitchMessage)) (Event SwitchCommand)Source

Issues switch queries according to the given NetworkMonitorPolicy.

Host information

type HostDirectionMap = Map (SwitchID, EthernetAddress) PortIDSource

Map giving the next hop PortID (if it is known) to a host from a given switch.

hostDirectionsChangeSF :: SF (Event (SwitchID, SwitchMessage)) (Event (HostDirectionMap, HostDirectionMap))Source

Outputs an event whenever the host direction information changes. Outputs both the previous and the updated host direction map.

Port Statistics

withPortStats :: SF (Event PortStats) a -> SF (Event (SwitchID, SwitchMessage)) (Map (SwitchID, PortID) a)Source

Applies the given signal function to each switch-port pair in the network.

portRatesMapSF :: SF (Event (SwitchID, SwitchMessage)) (Map (SwitchID, PortID) PortStats)Source

Computes the rate of change of the port statistics vector by calculating - for each component of the vector - the difference between the last two samples and dividing by the time difference. This measurements are then held until the next sample is observed.

nAveragePortRateMap :: Int -> SF (Event (SwitchID, SwitchMessage)) (Map (SwitchID, PortID) PortStats)Source

Tracks the average rate of change of the port statistics using a moving average of the last n port statistics updates, where n is the first argument to the function.