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