Documentation ¶
Index ¶
- Constants
- func NewPerfectLink(from, to NodeCapacity) Link
- type CapacityConnector
- type CapacityMap
- type PerfectCapacityConnector
- type PerfectLink
- type ScheduledCapacityMap
- func (c *ScheduledCapacityMap) AddConnector(id string, capacityConnector CapacityConnector)
- func (c *ScheduledCapacityMap) Connector(id string) CapacityConnector
- func (c *ScheduledCapacityMap) Receiver() events.Receiver
- func (c *ScheduledCapacityMap) RegisterLink(link interfaces.Link)
- func (c *ScheduledCapacityMap) Start(sim *underlay.NetworkSimulation)
- type Scheduler
Constants ¶
View Source
const MaxConnections int = 100
Variables ¶
This section is empty.
Functions ¶
func NewPerfectLink ¶
func NewPerfectLink(from, to NodeCapacity) Link
Types ¶
type CapacityConnector ¶
type CapacityConnector interface { interfaces.DataTransport }
Allow connecting between two nodes via scheduler
func NewCapacityConnector ¶
func NewCapacityConnector( up, down int, capacityMap CapacityMap, ) CapacityConnector
type CapacityMap ¶
type CapacityMap interface { AddConnector(id string, connector CapacityConnector) Connector(id string) CapacityConnector RegisterLink(link interfaces.Link) Start(simulation *underlay.NetworkSimulation) // A simulation Receiver associated with the CapacityMap. Allows // registering observers that follow the map. Receiver() events.Receiver }
Allow access the CapacityConnector
func NewScheduledCapacityMap ¶
func NewScheduledCapacityMap(scheduleInterval int) CapacityMap
type PerfectCapacityConnector ¶
type PerfectCapacityConnector struct {
// contains filtered or unexported fields
}
func (*PerfectCapacityConnector) Connect ¶
func (c *PerfectCapacityConnector) Connect(id string) interfaces.Link
func (*PerfectCapacityConnector) Down ¶
func (c *PerfectCapacityConnector) Down() int
func (*PerfectCapacityConnector) Up ¶
func (c *PerfectCapacityConnector) Up() int
type PerfectLink ¶
Assumptions:
- equal link share & max capacity
- no latency effects
- end-capacity is the bottleneck
func (*PerfectLink) Clear ¶
func (p *PerfectLink) Clear()
func (*PerfectLink) Download ¶
func (p *PerfectLink) Download() <-chan Data
func (*PerfectLink) From ¶
func (p *PerfectLink) From() NodeCapacity
func (*PerfectLink) To ¶
func (p *PerfectLink) To() NodeCapacity
func (*PerfectLink) Upload ¶
func (p *PerfectLink) Upload(data Data)
type ScheduledCapacityMap ¶
A capacity map that uses a capacity scheduler for allowing data transfer between nodes. Note the capacity scheduler is already thread-safe.
func (*ScheduledCapacityMap) AddConnector ¶
func (c *ScheduledCapacityMap) AddConnector( id string, capacityConnector CapacityConnector, )
func (*ScheduledCapacityMap) Connector ¶
func (c *ScheduledCapacityMap) Connector(id string) CapacityConnector
func (*ScheduledCapacityMap) Receiver ¶
func (c *ScheduledCapacityMap) Receiver() events.Receiver
func (*ScheduledCapacityMap) RegisterLink ¶
func (c *ScheduledCapacityMap) RegisterLink(link interfaces.Link)
func (*ScheduledCapacityMap) Start ¶
func (c *ScheduledCapacityMap) Start(sim *underlay.NetworkSimulation)
type Scheduler ¶
type Scheduler interface { Receiver RegisterLink(Link) Schedule() }
The simulator is based on a scheduler which computes the transfer speed associated with each link in the topology. The scheduler runs periodically at an established period, by implementing the Receiver interface and stopping the simulation to recalculate the transfer rates. The main assumption under which the simulator calculates the transfer rates are the equal share and maximum capacity utilization.
func NewScheduler ¶
Click to show internal directories.
Click to hide internal directories.