All Packages Class Hierarchy This Package Previous Next Index
Class link.SimplePointToPointLink
java.lang.Object
|
+----timer.TimerClient
|
+----link.SimplePointToPointLink
- public class SimplePointToPointLink
- extends TimerClient
- implements Link, Runnable
A simple point to point link that implements a randomized
delivery model. No reordering is ever permitted, which does
alter the simple latency model somewhat.
-
SimplePointToPointLink(String, long, int, double, double, double, double, double, double, double, Vector)
- Create a new link with the specified parameters
-
AddNode(Node)
- Add a node, maintains the list of connected nodes.
-
ConnectedNodes()
- Get the list of connected nodes
-
MTU()
- Get the maximum number of data bytes to transmit
-
RemoveNode(Node)
- Remove a node
-
run()
- Manage uptime and downtime of the link.
-
Timeout(Object)
- Deliver a packet.
-
toString()
- Convert to a string for printing
-
TransmitPacket(LinkPacket, Node)
- Transmit a packet on the link.
SimplePointToPointLink
public SimplePointToPointLink(String name,
long seed,
int mtu,
double bandwidthMean,
double bandwidthSD,
double bandwidthWalk,
double latencyMean,
double latencySD,
double latencyWalk,
double dropProb,
Vector downtime)
- Create a new link with the specified parameters
- Parameters:
- name - the debug name for this link
- seed - the seed for the random number generator
- mtu - the maximum transmission unit, in bytes
- bandwidthMean - the long-term average bandwidth, in Mb/s
- bandwidthSD - the standard deviation on the bandwidth distribution
- bandwidthWalk - is the tendency towards random walks, from 0.0 to 1.0
- latencyMean - the long-term average latency, in ms
- latencySD - the standard deviation on the latency distribution
- latencyWalk - is the tendency towards random walks, from 0.0 to 1.0
- dropProb - is the probability that packets are dropped
- downtime - is a vector of TimeIntervals during which
this link will be unavilable. If null then it
will always be available
toString
public String toString()
- Convert to a string for printing
- Overrides:
- toString in class Object
ConnectedNodes
protected Enumeration ConnectedNodes()
- Get the list of connected nodes
- Returns:
- an Enumeration of the currently connected nodes.
TransmitPacket
public void TransmitPacket(LinkPacket p,
Node n)
- Transmit a packet on the link. Samples to find the transmit time,
then waits for that time to simulate transmission.
While one node is
transmitting all others are blocked. Fair queuing is not
attempted. The packets arrive at the other end after
the latency (also sampled), with the constraint that they
arrive in order and not exceed the arrival bandwidth.
Different nodes may be transmitting at the same time,
but any particular node is limited to transmitting a
single packet at a time. Attempts for a single node
to transmit multiple packets in parallel will block.
- Parameters:
- p - the packet to transmit
- n - the node (router) sending the packet
- See Also:
- TransmitPacket
Timeout
public void Timeout(Object info)
- Deliver a packet. Timeouts are used to deal with the
latency, so when the timeout fires, deliver the packet.
- Parameters:
- info - an ArrivalRecord describing the
packet to deliver
- Overrides:
- Timeout in class TimerClient
MTU
public int MTU()
- Get the maximum number of data bytes to transmit
- Returns:
- the maximum transmission unit, in bytes
- See Also:
- MTU
AddNode
public void AddNode(Node n)
- Add a node, maintains the list of connected nodes. At
most two nodes may be connected at any time.
- See Also:
- AddNode
RemoveNode
public void RemoveNode(Node n)
- Remove a node
- See Also:
- RemoveNode
run
public void run()
- Manage uptime and downtime of the link. Alert registered
clients when the link comes and goes, adn block further
transmission (to be nice, current transmissions complete).
All Packages Class Hierarchy This Package Previous Next Index