GridSim 5.0 beta

gridsim.net.flow
Class FlowLink

Object
  extended by Thread
      extended by Sim_entity
          extended by Link
              extended by FlowLink
All Implemented Interfaces:
Cloneable, Runnable

public class FlowLink
extends Link

This class enables flow level networking over a shared link. It is partially based on SimpleLink.java by Gokul Poduval & Chen-Khong Tham

Since:
GridSim Toolkit 4.2
Author:
James Broberg, The University of Melbourne
Invariant:
$none

Nested Class Summary
 
Nested classes/interfaces inherited from class Thread
Thread.State, Thread.UncaughtExceptionHandler
 
Field Summary
 
Fields inherited from class Link
baudRate_, DEFAULT_BAUD_RATE, DEFAULT_MTU, DEFAULT_PROP_DELAY, delay_, MILLI_SEC, MTU_
 
Fields inherited from class Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
FlowLink(String name, double baudRate, double propDelay, int MTU)
          Constructs a Link which simulates a physical link between two entities.
 
Method Summary
 void attach(Sim_entity end1, Sim_entity end2)
          Connects one entity to another via this link
 void attach(String end1, String end2)
          Connects one entity to another via this link
 void body()
          Handles external events that are coming to this link.
 void deregisterFlow(Packet np)
          Deregisters active flow on link.
 double getBaudRate()
          Returns available baudRate depending on number of active flows (MIN_MAX bandwidth sharing model)
 
Methods inherited from class Link
getDelay, getMTU
 
Methods inherited from class Sim_entity
add_generator, add_param, add_port, clone, get_id, get_name, get_port, get_port, get_stat, run, send_on, set_invisible, set_stat, sim_cancel, sim_completed, sim_current, sim_get_next, sim_get_next, sim_hold_for, sim_hold, sim_pause_for, sim_pause_for, sim_pause_until, sim_pause_until, sim_pause, sim_process_for, sim_process_for, sim_process_until, sim_process_until, sim_process, sim_putback, sim_schedule, sim_schedule, sim_schedule, sim_schedule, sim_schedule, sim_schedule, sim_select, sim_trace, sim_wait_for, sim_wait_for, sim_wait_for, sim_wait, sim_waiting, sim_waiting
 
Methods inherited from class Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FlowLink

public FlowLink(String name,
                double baudRate,
                double propDelay,
                int MTU)
         throws ParameterException,
                NullPointerException
Constructs a Link which simulates a physical link between two entities.

Parameters:
name - Name of this Link
baudRate - baud rate of this link (bits/s)
propDelay - Propogation delay of the Link in milli seconds
MTU - Maximum Transmission Unit of the Link in bytes. Packets which are larger than the MTU should be split up into MTU size units.
For e.g. a 1024 byte packet trying to cross a 576 byte MTU link should get split into 2 packets of 576 bytes and 448 bytes.
Throws:
NullPointerException - This happens when name is empty or null
ParameterException - This happens for the following conditions:
  • name is null
  • baudRate <= 0
  • propDelay <= 0
  • MTU <= 0
Pre Condition:
name != null, baudRate > 0, propDelay > 0, MTU > 0
Post Condition:
$none
Method Detail

attach

public void attach(Sim_entity end1,
                   Sim_entity end2)
Connects one entity to another via this link

Specified by:
attach in class Link
Parameters:
end1 - an entity
end2 - an entity
Pre Condition:
end1 != null, end2 != null
Post Condition:
$none

attach

public void attach(String end1,
                   String end2)
Connects one entity to another via this link

Specified by:
attach in class Link
Parameters:
end1 - an Entity name
end2 - an Entity name
Pre Condition:
end1 != null, end2 != null
Post Condition:
$none

body

public void body()
Handles external events that are coming to this link.

Overrides:
body in class Sim_entity
Pre Condition:
$none
Post Condition:
$none

deregisterFlow

public void deregisterFlow(Packet np)
Deregisters active flow on link. Notifies the destination of any active flows if the bottleneck bandwidth is changed.

Parameters:
np - a packet
Pre Condition:
$none
Post Condition:
$none

getBaudRate

public double getBaudRate()
Returns available baudRate depending on number of active flows (MIN_MAX bandwidth sharing model)

Overrides:
getBaudRate in class Link
Returns:
the baud rate (bits/s)
Pre Condition:
$none
Post Condition:
$none

GridSim 5.0 beta

The University of Melbourne, Australia, 2009