class Network

An interconnecting network for communication among computers

Inheritance:


Public Methods

[more] Network(ID newID = 0, string newName = "Network", network_topology newTopology = NOTSET, double bandwidth = -1., double latency = -1.)
Default constructor
[more]void clear(void)
Reset the internal network values to their default values
[more]void setTopology(const network_topology newTopology)
Set the topology of the network
[more]void setBandwidth(const double newBandwidth)
Sets the default bandwidth of links in the network
[more]void setLatency(const double newLatency)
Sets the default latency of links in the network
[more]void setSwitchDelay(const double newDelay)
Sets default delay for network switching
[more]bool buildNetwork(const vector <Computer>& computers)
connects the passed computers by building a network of links and switches
[more]bool reqComm( const Token& token, const ID computer1, const ID computer2, const double msgSize = PAGESIZE)
request a communication between computer1 and computer2
[more]void reqLink(const Token& token)
request to use a link in the network
[more]void reqSwitch(const Token& token)
request to use a switch in the network
[more]bool relLink(const Token& token)
stop using a link in the network
[more]bool relSwitch(const Token& token)
stop using a switch in the network
[more]bool executeEvent(const Token& token)
[more]void killRequest(const Token& token)
Forcibly remove a network request from the network
[more]EventQueue getRoute(ID computer1, ID computer2, const double msgSize = PAGESIZE)
returns a queue of events that will allow computer1 to communicate with computer2
[more]string toString(void) const
returns a string representation of the network
[more]static string topologyToString(network_topology top)
Translates from a network topology value to a string
[more]static network_topology stringToTopology(string name)
Translates from a string to a network topology value
[more]bool activate(void)
Make the network ready for simulation. Turn it on.
[more]TIME getTimeCommunicating(void)


Inherited from SimObj:

Public Methods

ostring getName(void) const
oID getID(void) const
ovoid setName(const string newName)
ovoid setID(const ID newID)


Documentation

The network class is responsible for figuring out the queue of requests needed in order for computer1 to communicate with computer2. All an external object needs to do is call 'reqComm' and the network object does the rest.
o Network(ID newID = 0, string newName = "Network", network_topology newTopology = NOTSET, double bandwidth = -1., double latency = -1.)

ovoid clear(void)

ovoid setTopology(const network_topology newTopology)
When the topology of the network is known, links, switches, and routing tables can be automatically generated quickly - instead of manually specified by the user.

ovoid setBandwidth(const double newBandwidth)

ovoid setLatency(const double newLatency)

ovoid setSwitchDelay(const double newDelay)

obool buildNetwork(const vector <Computer>& computers)
Attempts to build a network given the list of computers passed and the values already set for topology and global bandwidth and latency. Old networks should be destroyed with the clear() method before trying to build a new network!

obool reqComm( const Token& token, const ID computer1, const ID computer2, const double msgSize = PAGESIZE)
This function assumes the communication is round-trip. It will create a queue of events that will allow the two computers to communicate (e.g. first communicate over link1, then use the switch, then link2....)

ovoid reqLink(const Token& token)
The network will use the token passed as an index to an internal map of pending requests. From this, it will be able to tell which link will be requested. It is assumed that this function is being called as a consequence of reqComm being called.

ovoid reqSwitch(const Token& token)
The network will use the token passed as an index to an internal map of pending requests. From this, it will be able to tell which switch will be requested. It is assumed that this function is being called as a consequence of reqComm being called.

obool relLink(const Token& token)

obool relSwitch(const Token& token)

obool executeEvent(const Token& token)

ovoid killRequest(const Token& token)

oEventQueue getRoute(ID computer1, ID computer2, const double msgSize = PAGESIZE)
The events generated will depend on the topology of the network

ostring toString(void) const

ostatic string topologyToString(network_topology top)

ostatic network_topology stringToTopology(string name)

obool activate(void)

oTIME getTimeCommunicating(void)
This function is used for metrics-collecting.
Returns:
the total amount of time that each network component was in use.


This class has no child classes.
Author:
John Oleszkiewicz

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.