Class Internet

java.lang.Object
  extended by Internet

public class Internet
extends java.lang.Object

The Internet class provides delivery of Packet objects between TCPEntity objects. This abstraction represents the view of the internet from just above the multiplexer/demultipler in the Transport layer.

All methods in this class are static. Messages should be sent to the Internet class object as shown in method comments.


Constructor Summary
Internet()
           
 
Method Summary
static double getReliability()
          Internet.getReliability() returns the probability that a Packet gets delivered in the Internet.
static int getRoundTripTime()
          Internet.getRoundTripTime() returns the average round-trip time for the Internet.
static void printConfiguration()
          Internet.printConfiguration() prints the configuration parameters for the Internet.
static void send(Packet pkt)
          Internet.send(pkt) attempts delivery of pkt to its destination.
static void setReliability(double rel)
          Internet.setReliability(rel) sets the probability that a Packet gets delivered in the Internet to rel.
static void setRoundTripTimes(int min, int max)
          Internet.setRoundTripTimes(min, max) sets the minimum and maximum round-trip time for the Internet to min and max.
static void setSeed(long sd)
          Internet.setSeed(sd) sets the seed for the random number generator used in the Internet to sd.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Internet

public Internet()
Method Detail

printConfiguration

public static void printConfiguration()
Internet.printConfiguration() prints the configuration parameters for the Internet.


setSeed

public static void setSeed(long sd)
Internet.setSeed(sd) sets the seed for the random number generator used in the Internet to sd. This method should only be invoked before a simulation run is started.

For a given seed, the sequence of delivery successes and delivery times will always be the same. If this method is not invoked, the current time will be used to set the seed, resulting in a different sequence of delivery successes and delivery times from one run to another.


getRoundTripTime

public static int getRoundTripTime()
Internet.getRoundTripTime() returns the average round-trip time for the Internet.


setRoundTripTimes

public static void setRoundTripTimes(int min,
                                     int max)
Internet.setRoundTripTimes(min, max) sets the minimum and maximum round-trip time for the Internet to min and max.


getReliability

public static double getReliability()
Internet.getReliability() returns the probability that a Packet gets delivered in the Internet.


setReliability

public static void setReliability(double rel)
Internet.setReliability(rel) sets the probability that a Packet gets delivered in the Internet to rel.


send

public static void send(Packet pkt)
Internet.send(pkt) attempts delivery of pkt to its destination. The probability of its arrival is Internet.getReliability(). The average round-trip time is Internet.getRoundTripTime(). Mysteriously, CLOSE_TYPE packets always arrive and their round-trip time is always about 1.5*max_rtt.