Documentation ¶
Index ¶
Constants ¶
View Source
const Nsd int = 2
View Source
const Ntd int = 2
View Source
const RouterCacheSize int = 50
View Source
const Wts int = 100
View Source
const Wtsd int = 2
View Source
const Wtt int = 100
Constants used in the stub-generation algorithm:
Wtt = avg. weight of transit-transit connections Wttd = Wtt delta, that is the weight is in [Wtt - Wttd, Wtt + Wttd] Ntd = nodes transit domain delta (see Wttd) minNt = minimum number of nodes in transit domain edgeNtf = edge factor for a transit domain, that is the number of edges is f * N log N minLatency = minimum latency for intra-domain connections maxLatency = maximum latency for intra-domain connections Nsd = ... minNs = ... edgeNsf = ... mhsp = percent of multi-home stub *connections* The constant values are currently arbirary, but they can be chosen to respect the invariants in the paper.
View Source
const Wttd int = 2
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache interface { Put(key, value interface{}) Get(key interface{}) (interface{}, bool) }
type Connection ¶
func NewStaticConnection ¶
func NewStaticConnection(latency int, router Router) Connection
type LRUCache ¶
type LRUCache struct {
// contains filtered or unexported fields
}
A Cache using the Least Recently Used policy. It is implemented by using a list and a map pointing to list elements.
func NewLRUCache ¶
type Network ¶
type Network struct { Routers []Router // contains filtered or unexported fields }
func NewInternetwork ¶
Generates a 2-level transit-stub topology following the paper: Zegura E., Calvert K. and Bhattacharjee S. How to model an internetwork. In INFOCOM’96 (1996)
T = number of tranasit domains Nt = avg. nodes per transit domain S = number of stub domains Ns = avg. nodes per stub domain The transit domains represent the backbone, whereas a stub is attached to a node in the backbone. The graph is generated as follows: 1. Generate transit domain graph 2. Generate graph from tranasit domain 3. Add stubs 4. Generate multi-homed stubs
func NewRandomUniformNetwork ¶
Generates a connected graph.
Reference: http://economics.mit.edu/files/4622
func (*Network) RandomRouter ¶
type NetworkSimulation ¶
type NetworkSimulation struct { *Simulation // contains filtered or unexported fields }
A NetworkSimulation is a Simulation with a Network attached.
func NewNetworkSimulation ¶
func NewNetworkSimulation(s *Simulation, n *Network) *NetworkSimulation
func (*NetworkSimulation) Network ¶
func (s *NetworkSimulation) Network() *Network
func (*NetworkSimulation) SendPacket ¶
func (s *NetworkSimulation) SendPacket(p Packet)
type Router ¶
type Router interface { Receiver Connect(Connection) error Connections() []Connection Domain() string }
A Router is a Receiver which schedules new events at other routers according to a routing algorithm. We use the Bellman-Ford alogrithm to determine the shortest paths.
func NewShortestPathRouter ¶
Click to show internal directories.
Click to hide internal directories.