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.


Constructor Index

 o SimplePointToPointLink(String, long, int, double, double, double, double, double, double, double, Vector)
Create a new link with the specified parameters

Method Index

 o AddNode(Node)
Add a node, maintains the list of connected nodes.
 o ConnectedNodes()
Get the list of connected nodes
 o MTU()
Get the maximum number of data bytes to transmit
 o RemoveNode(Node)
Remove a node
 o run()
Manage uptime and downtime of the link.
 o Timeout(Object)
Deliver a packet.
 o toString()
Convert to a string for printing
 o TransmitPacket(LinkPacket, Node)
Transmit a packet on the link.

Constructors

 o 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

Methods

 o toString
 public String toString()
Convert to a string for printing

Overrides:
toString in class Object
 o ConnectedNodes
 protected Enumeration ConnectedNodes()
Get the list of connected nodes

Returns:
an Enumeration of the currently connected nodes.
 o 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
 o 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
 o MTU
 public int MTU()
Get the maximum number of data bytes to transmit

Returns:
the maximum transmission unit, in bytes
See Also:
MTU
 o 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
 o RemoveNode
 public void RemoveNode(Node n)
Remove a node

See Also:
RemoveNode
 o 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