From: <bro...@us...> - 2008-03-14 06:26:16
|
Revision: 160 http://gridsim.svn.sourceforge.net/gridsim/?rev=160&view=rev Author: brobergj Date: 2008-03-13 23:26:19 -0700 (Thu, 13 Mar 2008) Log Message: ----------- Minor fixes and javadoc comments Modified Paths: -------------- branches/gridsim4.0-branch2/source/gridsim/net/flow/FilterFlow.java branches/gridsim4.0-branch2/source/gridsim/net/flow/FlowInput.java branches/gridsim4.0-branch2/source/gridsim/net/flow/FlowLink.java branches/gridsim4.0-branch2/source/gridsim/net/flow/FlowOutput.java branches/gridsim4.0-branch2/source/gridsim/net/flow/FlowPacket.java branches/gridsim4.0-branch2/source/gridsim/net/flow/FlowRouter.java Modified: branches/gridsim4.0-branch2/source/gridsim/net/flow/FilterFlow.java =================================================================== --- branches/gridsim4.0-branch2/source/gridsim/net/flow/FilterFlow.java 2008-03-14 01:06:34 UTC (rev 159) +++ branches/gridsim4.0-branch2/source/gridsim/net/flow/FilterFlow.java 2008-03-14 06:26:19 UTC (rev 160) @@ -29,7 +29,7 @@ * * * @author James Broberg - * @since GridSim Toolkit 4.0 + * @since GridSim Toolkit 5.0 * @invariant $none */ public class FilterFlow extends Sim_predicate Modified: branches/gridsim4.0-branch2/source/gridsim/net/flow/FlowInput.java =================================================================== --- branches/gridsim4.0-branch2/source/gridsim/net/flow/FlowInput.java 2008-03-14 01:06:34 UTC (rev 159) +++ branches/gridsim4.0-branch2/source/gridsim/net/flow/FlowInput.java 2008-03-14 06:26:19 UTC (rev 160) @@ -1,10 +1,14 @@ /* - * Title: GridSim Toolkit - * Description: GridSim (Grid Simulation) Toolkit for Modeling and Simulation - * of Parallel and Distributed Systems such as Clusters and Grids - * Licence: GPL - http://www.gnu.org/copyleft/gpl.html + * ** Network and Service Differentiation Extensions to GridSim 4.0 ** * - * $Id: Input.java,v 1.7 2005/09/02 04:12:04 anthony Exp $ + * Author: James Broberg (based on Input.java) + * + * March 2007 + * + * Licence: GPL - http://www.gnu.org/copyleft/gpl.html + * + * FlowInput.java - Simulates a network input port + * */ package gridsim.net.flow; @@ -19,19 +23,19 @@ import eduni.simjava.*; /** - * GridSim Input class defines a port through which a simulation entity + * GridSim FlowInput class defines a port through which a simulation entity * receives data from the simulated network. * <p> * It maintains an event queue * to serialize the data-in-flow and delivers to its parent entity. - * It accepts messages that comes from GridSim entities 'Output' entity + * It accepts messages that comes from GridSim entities 'FlowOutput' entity * and passes the same to the GridSim entity. - * It simulates Network communication delay depending on Baud rate + * It simulates Network communication delay depending on current bottleneck Baud rate * and data length. Simultaneous inputs can be modeled using multiple * instances of this class. * - * @author Manzur Murshed and Rajkumar Buyya - * @since GridSim Toolkit 1.0 + * @author James Broberg + * @since GridSim Toolkit 5.0 * @invariant $none */ public class FlowInput extends Sim_entity implements NetIO @@ -47,7 +51,7 @@ /** - * Allocates a new Input object + * Allocates a new FlowInput object * @param name the name of this object * @param baudRate the communication speed * @throws NullPointerException This happens when creating this entity @@ -71,9 +75,9 @@ } /** - * Sets the Input entities link. This should be used only if the network + * Sets the FlowInput entities link. This should be used only if the network * extensions are being used. - * @param link the link to which this Input entity should send data + * @param link the link to which this FlowInput entity should send data * @pre link != null * @post $none */ @@ -131,7 +135,7 @@ /** * This is an empty method and only applicable to - * {@link gridsim.net.Output} class. + * {@link gridsim.net.FlowOutput} class. * @param gen a background traffic generator * @param userName a collection of user entity name (in String object). * @return <tt>false</tt> since this method is not used by this class. @@ -182,11 +186,11 @@ // if the simulation finishes then exit the loop if (ev.get_tag() == GridSimTags.END_OF_SIMULATION) { break; - // Check if initial flow duration estimation was accurate + // Check forecast of active flow and pass it onto Entity if still active } else if(ev.get_tag() == GridSimTags.FLOW_HOLD) { System.out.println(super.get_name() + ".body(): checkForecast() + at time = " + GridSim.clock()); checkForecast(ev); - // Update flow duration forecast + // Update flow duration forecast as a flow's bottleneck bandwidth has changed } else if (ev.get_tag() == GridSimTags.FLOW_UPDATE) { System.out.println(super.get_name() + ".body(): updateForecast() + at time = " + GridSim.clock()); updateForecast(ev); @@ -217,7 +221,6 @@ private void checkForecast(Sim_event ev) { int pktID = (Integer) ev.get_data(); // ID of flow to be checked FlowPacket fp = null; // Reference to flow packet that needs forecast update - FlowPacket fpAck = null; System.out.println(super.get_name() + ".checkForecast(): checking pkt id # " + pktID); @@ -229,7 +232,6 @@ super.sim_schedule(inPort_, GridSimTags.SCHEDULE_NOW, fp.getTag() , io.getData()); activeFlows_.remove(pktID); - // Send ack to source of flow System.out.println(super.get_name() + ".checkForecast(): flow came from " + GridSim.getEntityName(fp.getSrcID()) + " heading to " + GridSim.getEntityName(fp.getDestID())); @@ -239,26 +241,7 @@ FlowLink fl = (FlowLink) it.next(); fl.deregisterFlow(fp); } - - /* - int oldDestID = fp.getDestID(); - int oldSrcID = fp.getSrcID(); - - IO_data ackData = new IO_data(fp.getData(), fp.getSize(), oldSrcID-2); - fpAck = new FlowPacket(ackData,fp.getID(),fp.getSize(),GridSimTags.FLOW_RETURN,oldDestID+2, - oldSrcID-2, fp.getNetServiceType(), 1, 1); - fpAck.setSize(fp.getSize()); - fpAck.setRemSize(0); - fpAck.setStartTime(fp.getStartTime()); - fpAck.setLatency(fp.getLatency()); - - System.out.println("Sending flow packet ack to link at time = " + GridSim.clock() + " id is " - + fpAck.getID()); - super.sim_schedule(GridSim.getEntityId("Output_" + GridSim.getEntityName(oldDestID)), - GridSimTags.SCHEDULE_NOW, GridSimTags.FLOW_ACK, fpAck); - - //super.sim_schedule(super.get_id(), GridSimTags.SCHEDULE_NOW, GridSimTags.FLOW_ACK, fpAck); */ - + } else { System.out.println(super.get_name() + ".checkForecast(): pkt id # " + pktID + " already removed"); @@ -267,8 +250,9 @@ } /** - * Update the forecast of a flow, delete the old forecast and schedule a new flow hold - * event in the future with the corrected forecast + * Update the forecast of a flow by deleting the old forecast and scheduling a new flow hold + * event in the future with the corrected forecast (based on new bottleneck bandwidth and + * the amount of flow already sent) * * @param ev the flow update notification event * @pre ev != null @@ -293,6 +277,7 @@ "BW old is " + bandwidthOld + " last update " + fp.getUpdateTime()); Iterator it = (fp.getLinks_()).iterator(); + // Find the source link of this notification and the associated bottleneck bandwidth while (it.hasNext()) { FlowLink fl = (FlowLink) it.next(); if (fl.get_id() == sourceID) { @@ -305,6 +290,7 @@ duration = (fp.getRemSize()*BITS)/fp.getBandwidth_(); System.out.println(super.get_name() + " new forecast end time is " + (GridSim.clock() + duration)); + // Find old forecast and delete it! FilterFlow filter = new FilterFlow(fp.getID(), GridSimTags.FLOW_HOLD); cancelledFlow = this.sim_cancel(filter, null); @@ -314,7 +300,9 @@ } System.out.println(super.get_name() + " setting updated forecast for packet #" + fp.getID()); + // Make a note of the time when this forecast update was performed fp.setUpdateTime(GridSim.clock()); + // Set new future event with the correct finish time super.sim_schedule(super.get_id(), duration, GridSimTags.FLOW_HOLD , new Integer(fp.getID())); } Modified: branches/gridsim4.0-branch2/source/gridsim/net/flow/FlowLink.java =================================================================== --- branches/gridsim4.0-branch2/source/gridsim/net/flow/FlowLink.java 2008-03-14 01:06:34 UTC (rev 159) +++ branches/gridsim4.0-branch2/source/gridsim/net/flow/FlowLink.java 2008-03-14 06:26:19 UTC (rev 160) @@ -3,11 +3,11 @@ * * Author: James Broberg * - * August 2007 + * March 2007 * * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * - * FlowLink.java - Simulates a network link with active flows + * FlowLink.java - Simulates a network link with active flows (based on SimpleLink.java) * */ @@ -27,14 +27,14 @@ * on SimpleLink.java by Gokul Poduval & Chen-Khong Tham * * @invariant $none - * @since GridSim Toolkit 4.0 + * @since GridSim Toolkit 5.0 * @author James Broberg, The University of Melbourne */ public class FlowLink extends Link { private Vector q_; - private HashMap flows_; // Stores references to flows that are currently active on this link + private HashMap activeFlows_; // Stores references to flows that are currently active on this link private double lastUpdateTime_; // a timer to denote the last update time private int inEnd1_; private int outEnd1_; @@ -107,7 +107,7 @@ { lastUpdateTime_ = 0.0; q_ = new Vector(); - flows_ = new HashMap(); + activeFlows_ = new HashMap(); inEnd1_ = -1; outEnd1_ = -1; inEnd2_ = -1; @@ -334,7 +334,7 @@ { System.out.println(super.get_name() + " enque() + at time = " + GridSim.clock()); int tag = ((Packet)ev.get_data()).getTag(); - // Register passing flow as active on this link + // Register passing flow, gridlet or junk as active on this link if (tag == GridSimTags.FLOW_SUBMIT || tag == GridSimTags.GRIDLET_SUBMIT || tag == GridSimTags.GRIDLET_SUBMIT_ACK || tag == GridSimTags.GRIDLET_RETURN || tag == GridSimTags.JUNK_PKT) { @@ -389,13 +389,6 @@ tag = np.getTag(); } - - //if (np.getTag() == GridSimTags.FLOW_RETURN) { - // System.out.println(super.get_name() + ".deque() Dereg flow # " + np.getID() +" here"); - // Deregister passing flow as it is now de-active on this link - // ((FlowPacket)np).addLatency(this.getDelay()); - // deregisterFlow(np); - //} // sends the packet super.sim_schedule(dest, GridSimTags.SCHEDULE_NOW, tag, np); @@ -430,7 +423,9 @@ } /** - * Registers active flow to link, and link to flow + * Registers active flow to the link, and the link to flow. + * Notifies the destination of any active flows if the bottleneck + * bandwidth is changed. * @param np a packet * @pre $none * @post $none @@ -440,18 +435,18 @@ FlowPacket tempFlow = null; // Add flow to link - flows_.put(np.getID(), np ); + activeFlows_.put(np.getID(), np ); System.out.println(super.get_name() + ".registerFlow(): registering flow #" + np.getID() - + " total of " + flows_.size() + " flows"); + + " total of " + activeFlows_.size() + " flows"); // Register link to flow ((FlowPacket)np).addLink(this); // Check if this affects any existing flows - Iterator<Integer> flowsIter = flows_.keySet().iterator(); + Iterator<Integer> flowsIter = activeFlows_.keySet().iterator(); while(flowsIter.hasNext()) { - tempFlow = (FlowPacket) flows_.get(flowsIter.next()); + tempFlow = (FlowPacket) activeFlows_.get(flowsIter.next()); // If change in bandwidth affects an existing flow i.e. is < current bottleneck if (this.getBaudRate() < tempFlow.getBandwidth_() && tempFlow.getID() != np.getID()) { // Need to notify flow @@ -468,7 +463,8 @@ } /** - * Deregisters active flow on link + * Deregisters active flow on link. Notifies the destination of any active + * flows if the bottleneck bandwidth is changed. * @param np a packet * @pre $none * @post $none @@ -477,15 +473,16 @@ FlowPacket fp = null; FlowPacket tempFlow; - if ((fp = (FlowPacket) flows_.remove(np.getID())) != null) { + // If the flow hasn't been removed already, remove from active flow list + if ((fp = (FlowPacket) activeFlows_.remove(np.getID())) != null) { System.out.println(super.get_name() + ".deregisterFlow() success flow # " + np.getID() + " " + fp.getBandwidth_()); // Check if this affects any existing flows - Iterator<Integer> flowsIter = flows_.keySet().iterator(); + Iterator<Integer> flowsIter = activeFlows_.keySet().iterator(); while(flowsIter.hasNext()) { - tempFlow = (FlowPacket) flows_.get(flowsIter.next()); + tempFlow = (FlowPacket) activeFlows_.get(flowsIter.next()); // If change in bandwidth affects an existing flow i.e. is > current bottleneck // AND this link is the particular flow's bottleneck if (this.getBaudRate() > tempFlow.getBandwidth_() && tempFlow.getID() != np.getID() && @@ -507,14 +504,14 @@ /** * Returns available baudRate depending on number of - * active flows + * active flows (MIN_MAX bandwidth sharing model) * @pre $none * @post $none */ public synchronized double getBaudRate() { - if (flows_.size() != 0) { - System.out.println(super.get_name() + ".getBaudRate() Getting latest baud! " + (super.baudRate_)/(flows_.size())); - return (super.baudRate_)/(flows_.size()); + if (activeFlows_.size() != 0) { + System.out.println(super.get_name() + ".getBaudRate() Getting latest baud! " + (super.baudRate_)/(activeFlows_.size())); + return (super.baudRate_)/(activeFlows_.size()); } else { System.out.println(super.get_name() + ".getBaudRate() Getting latest baud! " + (super.baudRate_)); return super.baudRate_; Modified: branches/gridsim4.0-branch2/source/gridsim/net/flow/FlowOutput.java =================================================================== --- branches/gridsim4.0-branch2/source/gridsim/net/flow/FlowOutput.java 2008-03-14 01:06:34 UTC (rev 159) +++ branches/gridsim4.0-branch2/source/gridsim/net/flow/FlowOutput.java 2008-03-14 06:26:19 UTC (rev 160) @@ -1,10 +1,14 @@ /* - * Title: GridSim Toolkit - * Description: GridSim (Grid Simulation) Toolkit for Modeling and Simulation - * of Parallel and Distributed Systems such as Clusters and Grids - * Licence: GPL - http://www.gnu.org/copyleft/gpl.html + * ** Network and Service Differentiation Extensions to GridSim 4.0 ** * - * $Id: Output.java,v 1.7 2005/09/02 04:12:04 anthony Exp $ + * Author: James Broberg + * + * March 2007 + * + * Licence: GPL - http://www.gnu.org/copyleft/gpl.html + * + * FlowOutput.java - Simulates a network output port + * */ package gridsim.net.flow; @@ -20,17 +24,17 @@ /** - * GridSim Output defines a port through which a simulation entity sends + * GridSim FlowOutput defines a port through which a simulation entity sends * data to the simulated network. * <p> * It maintains an event queue to serialize * the data-out-flow and delivers to the destination entity. - * It works along with Input entity to simulate network + * It works along with FlowInput entity to simulate network * communication delay. Simultaneous outputs can be modeled by using multiple * instances of this class * - * @author Manzur Murshed and Rajkumar Buyya - * @since GridSim Toolkit 1.0 + * @author James Broberg + * @since GridSim Toolkit 5.0 * @invariant $none */ public class FlowOutput extends Sim_entity implements NetIO @@ -40,18 +44,19 @@ private double baudRate_; // baud rate of this entity private final int SIZE = 8; // 1 byte in bits private static int pktID_ = 0; // packet ID counter - private Vector packetList_; // store a list of packets + private Vector flowList_; // store a list of packets private Random random_; // selects to which junk packets go to private TrafficGenerator gen_; // background traffic generator private ArrayList list_; // list of resources + user entities private boolean hasStarted_; // a flag for background traffic has started private static final int BITS = 8; // 1 byte = 8 bits - private Random rnd; + private Random rnd; // Random number generator to generate unique + // flow ID's /** - * Allocates a new Output object + * Allocates a new FlowOutput object * @param name the name of this object * @param baudRate the communication speed * @throws NullPointerException This happens when creating this entity @@ -66,7 +71,7 @@ super(name); this.baudRate_ = baudRate; link_ = null; - packetList_ = null; + flowList_ = null; pktID_ = 0; outPort_ = new Sim_port("output_buffer"); @@ -187,7 +192,7 @@ { this.link_ = link; baudRate_ = link_.getBaudRate(); - packetList_ = new Vector(); + flowList_ = new Vector(); } /** @@ -286,12 +291,6 @@ case GridSimTags.JUNK_PKT: generateBackgroundTraffic(); break; - - // activate background traffic - //case GridSimTags.FLOW_ACK: - // System.out.println((FlowPacket) ev.get_data()); - // enque((FlowPacket) ev.get_data(),GridSimTags.SCHEDULE_NOW); - // break; default: defaultSend(ev, gisID, statID, shutdownID); @@ -301,7 +300,7 @@ } /** - * Generates few junk packets at the given interval + * Generates few junk flows at the given interval * @pre $none * @post $none */ @@ -342,11 +341,6 @@ int type = gen_.getServiceType(); // packet type int tag = GridSimTags.JUNK_PKT; // packet tag - // we need to packetsize the data, all packets are sent with size MTU. - // only the last packet contains the data, the receiver should - // throw away all other packets - // int MTU = link_.getMTU(); - // int numPackets = (int) Math.ceil( size / (MTU * 1.0) ); /********* // DEBUG info System.out.println(); @@ -371,11 +365,6 @@ System.out.println(super.get_name() + ": Destination id = " + destId + " = " + GridSim.getEntityName(destId) ); *********/ - - // create junk packets or empty NetPacket. - //for (i = 0; i < freq; i++) { - // convertIntoPacket(MTU, numPackets+1, tag, destId, type); - //} convertIntoPacket(size, 1, tag, destId, type); @@ -394,10 +383,6 @@ destId + " = " + GridSim.getEntityName(destId) ); *********/ - // create junk packets or empty NetPacket. - //for (i = 0; i < freq; i++) { - // convertIntoPacket(MTU, numPackets+1, tag, destId, type); - //} convertIntoPacket(size, 1, tag, destId, type); } @@ -447,7 +432,7 @@ IO_data io = (IO_data) ev.get_data(); int destId = io.getDestID(); - /***** // DEBUG info*/ + /***** // DEBUG info System.out.println(super.get_name() + ".defaultSend(): Send to " + GridSim.getEntityName(destId) + " tag = " + ev.get_tag() + " at time = " + GridSim.clock()); /*****/ @@ -484,9 +469,8 @@ } /** - * This method takes data from an entity. If the size of the data is larger - * than the MTU of the link, then the packet is split into mutiple size - * units. After this it calls outEnque() to queue these packets into its + * This method takes data from an entity. The data is encapsulated in a single FlowPacket. + * After this it calls enque() to queue these flows into its * buffer. * * @param ev A Sim_event data that contains all the data for this method @@ -503,24 +487,13 @@ int destId = data.getDestID(); int netServiceType = data.getNetServiceLevel(); - // we need to packetsize the data, all packets are sent with size MTU. - // only the last packet contains the data, the receiver should - // throw away all other packets - //int MTU = link_.getMTU(); - //int numPackets = (int) Math.ceil( size / (MTU * 1.0) ); - - // make dummy packets with null data - //System.out.println("Packetizing data, creating " + numPackets + " dummy packets at time = " + GridSim.clock()); - //convertIntoPacket(MTU, numPackets, tag, destId, netServiceType); - // last packet contains the actual data FlowPacket np = null; - np = new FlowPacket(obj,rnd.nextInt(10000000),size,tag,super.get_id(), + np = new FlowPacket(obj,rnd.nextInt(Integer.MAX_VALUE),size,tag,super.get_id(), destId, netServiceType, 1, 1); System.out.println("Sending flow packet to link at time = " + GridSim.clock() + " id is " + np.getID()); - pktID_++; // increments packet ID enque(np, GridSimTags.SCHEDULE_NOW); } @@ -649,12 +622,10 @@ { - packetList_.add(pkt); - if (packetList_.size() == 1) + flowList_.add(pkt); + if (flowList_.size() == 1) { System.out.println(super.get_name() + ".enque() Size is " + pkt.getSize() + " baud " + link_.getBaudRate()); - // Compute expected duration of flow using bottleneck baudRate - // double total = delay + (pkt.getSize()*SIZE / link_.getBaudRate()); double total = 0.0; System.out.println(super.get_name() + ".enque() Time now " + GridSim.clock() + " delay is " + total); @@ -671,12 +642,12 @@ */ private synchronized void sendPacket() { - if (packetList_ == null || packetList_.isEmpty() == true) { + if (flowList_ == null || flowList_.isEmpty() == true) { return; } // submits the first packet in the list - Packet np = (Packet) packetList_.remove(0); + Packet np = (Packet) flowList_.remove(0); boolean ping = false; // a flag to determine ping packet or not int tag = -1; // event tag ID @@ -725,13 +696,13 @@ // send the packet super.sim_schedule(dest, GridSimTags.SCHEDULE_NOW, tag, np); - /***** // DEBUG info **/ + /***** // DEBUG info ** System.out.println(super.get_name() + " send to " + GridSim.getEntityName(dest) + " tag = " + tag + " time " + GridSim.clock()); /****/ // if the list is not empty, then schedule the next packet in the list - if (packetList_.isEmpty() != true) + if (flowList_.isEmpty() != true) { //double delay = np.getSize() * SIZE / link_.getBaudRate(); double delay = 0.0; Modified: branches/gridsim4.0-branch2/source/gridsim/net/flow/FlowPacket.java =================================================================== --- branches/gridsim4.0-branch2/source/gridsim/net/flow/FlowPacket.java 2008-03-14 01:06:34 UTC (rev 159) +++ branches/gridsim4.0-branch2/source/gridsim/net/flow/FlowPacket.java 2008-03-14 06:26:19 UTC (rev 160) @@ -22,7 +22,7 @@ * Structure of a packet used to encapsulate flow passing through the network. * * @invariant $none - * @since GridSim Toolkit 4.0 + * @since GridSim Toolkit 5.0 * @author James Broberg */ public class FlowPacket implements Packet @@ -63,7 +63,7 @@ /** * Constructs a network flow for data that fits into a single network - * packet. + * flow packet. * * @param data The data to be encapsulated. * @param pktID The ID of this packet @@ -101,7 +101,7 @@ } /** - * This is used to construct a packet that is one in a series. This happens + * This is used to construct a flow that is one in a series. This happens * when a large piece of data is required to be brokwn down into smaller * chunks so that they can traverse of links that only support a certain * MTU. It also allows setting of a classtype so that network schedulers @@ -149,8 +149,8 @@ } /** - * Returns a description of this packet - * @return a description of this packet + * Returns a description of this flow + * @return a description of this flow * @pre $none * @post $none */ @@ -177,8 +177,8 @@ sb.append("GridSimTags.JUNK_PKT"); } else if (tag == GridSimTags.FLOW_SUBMIT) { sb.append("GridSimTags.FLOW_SUBMIT"); -// } else if (tag == GridSimTags.FLOW_RETURN) { -// sb.append("GridSimTags.FLOW_RETURN"); + } else if (tag == GridSimTags.FLOW_ACK) { + sb.append("GridSimTags.FLOW_ACK"); } else { sb.append(tag); } @@ -190,7 +190,7 @@ } /** - * Returns the data encapsulated in this NetPacket + * Returns the data encapsulated in this FlowPacket * @return data encapsulated in this packet * @pre $none * @post $none @@ -201,7 +201,7 @@ /** * Returns the source ID of this packet. The source ID is where the - * NetPacket was originally created. + * FlowPacket was originally created. * * @return the source id. * @pre $none @@ -222,7 +222,7 @@ } /** - * Modifies the data encapsulated in this NetPacket. + * Modifies the data encapsulated in this FlowPacket. * @param data the packet's data * @pre $none * @post $none @@ -232,7 +232,7 @@ } /** - * Gets the size of this packet + * Gets the size of this flow packet * @return the packet size * @pre $none * @post $none @@ -243,7 +243,7 @@ /** * Sets the packet size - * @param size the packet size + * @param size the flow packet size * @return <tt>true</tt> if it is successful, <tt>false</tt> otherwise * @pre size >= 0 * @post $none @@ -260,7 +260,7 @@ /** * Returns the tag associated originally with data that was encapsulated in - * this packet. + * this flow packet. * * @return the tag of the data contained. * @pre $none @@ -271,7 +271,7 @@ } /** - * Returns the destination ID of this packet + * Returns the destination ID of this flow packet * * @return destination ID * @pre $none @@ -282,7 +282,7 @@ } /** - * Sets the destination id of this packet + * Sets the destination id of this flow packet * @param id the destination id * @pre id >= 0 * @post $none @@ -292,7 +292,7 @@ } /** - * Sets the last hop that this NetPacket traversed. This is used to + * Sets the last hop that this FlowPacket traversed. This is used to * determine the next hop at routers. Only routers and hosts/GridResources * set this, links do not modify it. * @param last the entity ID from the last hop @@ -304,7 +304,7 @@ } /** - * Returns the ID of the last hop that this packet traversed. This could be + * Returns the ID of the last hop that this flow packet traversed. This could be * the ID of a router, host or GridResource. * * @return ID of the last hop @@ -316,7 +316,7 @@ } /** - * Sets the network class type of this packet, so that it can receive + * Sets the network class type of this flow packet, so that it can receive * differentiated services. * @param netServiceType a network service type * @pre netServiceType >= 0 @@ -327,8 +327,8 @@ } /** - * Returns the class type of this packet. Used by routers etc. to determine - * the level of service that this packet should obtain. + * Returns the class type of this flow packet. Used by routers etc. to determine + * the level of service that this flow packet should obtain. * * @return the class of this packet * @pre $none @@ -339,7 +339,7 @@ } /** - * Returns the serial number of this packet. + * Returns the serial number of this flow packet. * * @return packet number * @pre $none @@ -350,11 +350,11 @@ } /** - * Returns the total number of packets in this stream. A stream of + * Returns the total number of flow packets in this stream. A stream of * packets is sent whenever the data is too big to be sent as one * packet. * - * @return total number of packets in this stream. + * @return total number of flow packets in this stream. * @pre $none * @post $none */ Modified: branches/gridsim4.0-branch2/source/gridsim/net/flow/FlowRouter.java =================================================================== --- branches/gridsim4.0-branch2/source/gridsim/net/flow/FlowRouter.java 2008-03-14 01:06:34 UTC (rev 159) +++ branches/gridsim4.0-branch2/source/gridsim/net/flow/FlowRouter.java 2008-03-14 06:26:19 UTC (rev 160) @@ -1,5 +1,5 @@ /* - * ** Network and Service Differentiation Extensions to GridSim 3.0 ** + * ** Network and Service Differentiation Extensions to GridSim 5.0 ** * * Author: James Broberg * @@ -25,7 +25,7 @@ /** - * This class implements a Router using a form of RIP for routing. The routing + * This class implements a FlowRouter using a form of RIP for routing. The routing * protocol used here is similar to <a * href="http://www.ietf.org/rfc/rfc1058.txt">Routing Information Protocol * (RIP) </a>. The routing protocol is run before Gridlets etc. can be @@ -37,7 +37,7 @@ * reliable protocol to use. * * @invariant $none - * @since GridSim Toolkit 3.1 + * @since GridSim Toolkit 5.0 * @author James Broberg, The University of Melbourne * @author Gokul Poduval & Chen-Khong Tham, National University of Singapore */ @@ -289,7 +289,7 @@ case GridSimTags.PKT_FORWARD: case GridSimTags.JUNK_PKT: System.out.println(super.get_name() + ".processEvent(): processNetPacket() + at time = " + GridSim.clock()); - processNetPacket(ev, ev.get_tag()); + processFlowPacket(ev, ev.get_tag()); break; case GridSimTags.ROUTER_AD: @@ -316,7 +316,7 @@ * @pre ev != null * @post $none */ - private synchronized void processNetPacket(Sim_event ev, int tag) + private synchronized void processFlowPacket(Sim_event ev, int tag) { //double nextTime = 0; Packet pkt = (Packet) ev.get_data(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |