Class ConcreteNodeTraffic

java.lang.Object
  extended by NodeTraffic
      extended by ConcreteNodeTraffic

public class ConcreteNodeTraffic
extends NodeTraffic

The ConcreteNodeTraffic class extends the functionality of the abstract NodeTraffic class. It defines the traffic configuration of the generated messages of a node and also facilitates the encoding of Header and Data flits.

Version:
1.0

Field Summary
static long LOCAL_IN
           
static long LOCAL_OUT
           
 
Fields inherited from class NodeTraffic
address, nextMsgGenTime
 
Constructor Summary
ConcreteNodeTraffic(int address)
          Constructor of the class.
 
Method Summary
protected  Flit createDataFlit(int vcId, int curCycle, int destination)
          Generates a data flit and return it to message generator method.
protected  Flit createHeaderFlit(int destination, int noOfFlit, int vcId, int curCycle)
          Generates a header flit and return it to message generator method.
private  int generateDestinationForFatTreeNetwork(int address)
          Returns the address of a destination node in the fat tree network randomly.
private  int generateDestinationForMeshNetwork(int address)
          Returns the address of a destination node in the Mesh network randomly.
private  int generateDestinationForOctalNetwork(int address)
           
private  int generateDestinationForTorusNetwork(int address)
          Returns the address of a destination node in the Torus network randomly.
 java.util.Vector generateMessage(int curCycle, int curMessageCount)
           Generates a packet and sets the next message generation time for the node.
protected  int getDestination()
          Returns the address of the destination node.
protected  int getMessageSize()
           Returns the message size in flits, which may be either fixed or exponential random number computed from the average message length(in bytes) and flit length (in bits).
protected  int getNextMsgGenTime()
          Return the nextMsgGenTime (next message generation time) variable of this class.
 void setNextMsgGenTime(int curCycle)
          Updates the state variable nextMessageGenTime of this class (inherited from NodeTraffic class) by calculating a time from exponential distribution using the average inter message generation time and adding this time with curCycle.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOCAL_IN

public static long LOCAL_IN

LOCAL_OUT

public static long LOCAL_OUT
Constructor Detail

ConcreteNodeTraffic

public ConcreteNodeTraffic(int address)
Constructor of the class. It also invokes constructor of the base NodeTraffic class.

Parameters:
address - address of the node to which this class belongs
Method Detail

generateMessage

public java.util.Vector generateMessage(int curCycle,
                                        int curMessageCount)

Generates a packet and sets the next message generation time for the node.

moveNodeTrafficFromNodeToSwitch(nCycle) method of Network object calls the updateOutput(nCycle) method of Node which then checks if actual parameter nCycle is equal to the state variable nextMessageGenTime of NodeTraffic objects and if so then that method calls this generateMessage method.

The methods performs in the following steps.

Specified by:
generateMessage in class NodeTraffic
Parameters:
curCycle - current simulation cycle
curMessageCount - current message stored in the buffer of the node
Returns:
a Vector data structure containing the whole packet

setNextMsgGenTime

public void setNextMsgGenTime(int curCycle)
Updates the state variable nextMessageGenTime of this class (inherited from NodeTraffic class) by calculating a time from exponential distribution using the average inter message generation time and adding this time with curCycle. The method is called by Network Initialization method and updateOutput() method of Node just after calling generateMessage().

Specified by:
setNextMsgGenTime in class NodeTraffic
Parameters:
curCycle - current simulation cycle

getNextMsgGenTime

protected int getNextMsgGenTime()
Return the nextMsgGenTime (next message generation time) variable of this class.

Specified by:
getNextMsgGenTime in class NodeTraffic
Returns:
next message generation time

getDestination

protected int getDestination()
Returns the address of the destination node. This method calls an appropriate method for generating address of the destination according to the network topology.

Specified by:
getDestination in class NodeTraffic
Returns:
address of the destination node

createHeaderFlit

protected Flit createHeaderFlit(int destination,
                                int noOfFlit,
                                int vcId,
                                int curCycle)
Generates a header flit and return it to message generator method. It generates the header flit in following fashion.

createDataFlit

protected Flit createDataFlit(int vcId,
                              int curCycle,
                              int destination)
Generates a data flit and return it to message generator method. It generates the data flit in following fashion:

Specified by:
createDataFlit in class NodeTraffic
Parameters:
destination - address of the destination node
vcId - virtual channel no
curCycle - current simulation cycle
Returns:
Data Flit

getMessageSize

protected int getMessageSize()

Returns the message size in flits, which may be either fixed or exponential random number computed from the average message length(in bytes) and flit length (in bits).

Specified by:
getMessageSize in class NodeTraffic
Returns:
message length in flits

generateDestinationForMeshNetwork

private int generateDestinationForMeshNetwork(int address)
Returns the address of a destination node in the Mesh network randomly. This address is encoded in the appropriate format for the Mesh network and it is computed in the following manner:

Parameters:
address - address of the source node
Returns:
address of a destination node (mesh network)

generateDestinationForTorusNetwork

private int generateDestinationForTorusNetwork(int address)
Returns the address of a destination node in the Torus network randomly. This address is encoded in the appropriate format for the Torus network and it is computed in the following manner:

Parameters:
address - address of the source node
Returns:
address of a destination node (Torus network)

generateDestinationForFatTreeNetwork

private int generateDestinationForFatTreeNetwork(int address)
Returns the address of a destination node in the fat tree network randomly.

Parameters:
address - address of the source node
Returns:
address of a destination node (fat tree network)

generateDestinationForOctalNetwork

private int generateDestinationForOctalNetwork(int address)