Nettle.FRPControl.NetInfo
Description
This module defines a relational view of the network state and configuration, and provides signal functions that dynamically maintain this view.
- type SwitchTable = [SwitchRecord]
- data SwitchRecord = SwitchRecord {}
- type PortTable = [PortRecord]
- data PortRecord = PortRecord {}
- class HasDataPathID a where
- data NetInfo
- portTable :: NetInfo -> PortTable
- switchTable :: NetInfo -> SwitchTable
- data NetworkMonitorPolicy = NetworkMonitorPolicy {}
- defaultMonitorPolicy :: NetworkMonitorPolicy
- networkInfoRequester :: NetworkMonitorPolicy -> SF (Event (SwitchID, SwitchMessage)) (Event SwitchCommand)
- switchInfo :: SF (Event (SwitchID, SwitchMessage)) NetInfo
- type HostDirectionMap = Map (SwitchID, EthernetAddress) PortID
- hostDirectionsSF :: SF (Event (SwitchID, SwitchMessage)) HostDirectionMap
- hostDirectionsChangeSF :: SF (Event (SwitchID, SwitchMessage)) (Event (HostDirectionMap, HostDirectionMap))
- type HostLocationMap = Map EthernetAddress (SwitchID, PortID)
- hostLocationSF :: SF (Event (SwitchID, SwitchMessage), Topology) HostLocationMap
- withPortStats :: SF (Event PortStats) a -> SF (Event (SwitchID, SwitchMessage)) (Map (SwitchID, PortID) a)
- portRatesMapSF :: SF (Event (SwitchID, SwitchMessage)) (Map (SwitchID, PortID) PortStats)
- nAveragePortRateMap :: Int -> SF (Event (SwitchID, SwitchMessage)) (Map (SwitchID, PortID) PortStats)
Switch and port information
type SwitchTable = [SwitchRecord]Source
A SwitchTable
is a list of SwitchRecord
s
data SwitchRecord Source
Constructors
SwitchRecord | |
Fields
|
Instances
type PortTable = [PortRecord]Source
A list of PortRecord
s; PortRecords
should be uniquely identifiable by their SwitchID
and PortID
.
data PortRecord Source
Constructors
PortRecord | |
Fields
|
Instances
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.
Instances
The NetInfo datatype carries network information in a form that is easily retrieved from switches.
switchTable :: NetInfo -> SwitchTableSource
Project the current SwitchTable
value from a NetInfo
value.
data NetworkMonitorPolicy Source
Constructors
NetworkMonitorPolicy | |
Fields
|
Instances
networkInfoRequester :: NetworkMonitorPolicy -> SF (Event (SwitchID, SwitchMessage)) (Event SwitchCommand)Source
Issues switch queries according to the given NetworkMonitorPolicy
.
switchInfo :: SF (Event (SwitchID, SwitchMessage)) NetInfoSource
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.
hostDirectionsSF :: SF (Event (SwitchID, SwitchMessage)) HostDirectionMapSource
Current HostDirectionMap
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.
type HostLocationMap = Map EthernetAddress (SwitchID, PortID)Source
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.