sidnet.stack.users.topological_tree_aggregation.routing
Class RouteBezier

java.lang.Object
  extended by sidnet.stack.users.topological_tree_aggregation.routing.RouteBezier
All Implemented Interfaces:
JistAPI.Proxiable, JistAPI.Timeless, Protocol, NetInterface.NetHandler, RouteInterface, RouteInterface.BezierRouting

public class RouteBezier
extends java.lang.Object
implements RouteInterface.BezierRouting


Nested Class Summary
 
Nested classes/interfaces inherited from interface jist.swans.route.RouteInterface
RouteInterface.Aodv, RouteInterface.BezierRouting, RouteInterface.Dsr, RouteInterface.ECGRIDRouting, RouteInterface.GenericRouting, RouteInterface.HeartbeatProtocol, RouteInterface.MultiTreeRouting, RouteInterface.RandomPathRouting, RouteInterface.ShortestPathRouting, RouteInterface.Zrp
 
Field Summary
 java.util.HashMap<java.lang.Integer,Bezier> bezierCurveLeft
          Beziers
 java.util.HashMap<java.lang.Integer,Bezier> bezierCurveRight
           
static boolean DEBUG_MODE
          debug mode.
static int EXPIRATION_PERIOD
           
 int nQinitHandled
           
static TopologyGUI topologyVisualizationTool
           
static long TRANSMISSION_JITTER
          The maximum amount of jitter before sending a packet.
 
Constructor Summary
RouteBezier(NetAddress localAddr, Node myNode, PanelContext hostPanelContext, int PATH_COUNT, int THETA_ANGLE, int CP_LENGTH, double COMM_RANGE, int VERT_PIPE_SAME, int ALTERNATION_POLICY, double commRangeFt, double extensionFactor)
           
 
Method Summary
 double alpha(int hopCount, int maxHopCount)
           
 double angle360From3Points(double X1, double Y1, double X0, double Y0, double X2, double Y2)
           
 double AngleConsecutinvePointsOnCurve(Bezier bezierCurve, int hopCount, int maxHopCount)
           
 double beta(int hopCount, int maxHopCount)
           
 double computeAngle(double X0, double Y0, int hopCount, int maxHopCount, int index)
           
 void createBezierCurves(Location2D srcLoc, Location2D sinkLoc, int index, int NN, double Theta, int backLength, boolean leftHanded, boolean draw)
           
 double Distance(double x1, double y1, double x2, double y2)
           
 double DistanceConsecutinvePointsOnCurve(Bezier bezierCurve, int hopCount, int maxHopCount)
           
 void dropNotify(Message msg, MacAddress nextHopMac, Reason reason)
          Notification mechanism for packet dropped due to various "Reasons"
 NetAddress getDestIp()
          Returns destination ip address.
 NetAddress GetNextHop2(int queryId, long s_seq, NetMessage.Ip msg)
           
 double getNextPointOnCurve(double current_t, Bezier bezierCurve, double cur_X, double cur_Y, double factor)
           
 RouteInterface.BezierRouting getProxy()
           
 double getShortestPointToCurve(double initial_t, Bezier bezierCurve, double cur_X, double cur_Y)
           
 NetAddress getThroughShortestPath(Location2D destLocation)
           
 boolean onLeft(double Xs, double Ys, double Xd, double Yd, double X0, double Y0)
           
 void peek(NetMessage msg, MacAddress lastHopMac)
          Called by the network layer for every incoming packet.
 void receive(Message msg, NetAddress src, MacAddress lastHop, byte macId, NetAddress dst, byte priority, byte ttl)
          Receive a message from network layer.
 void send(NetMessage msg)
          Send a message through the routing protocol
 void sendToAppLayer(Message msg, NetAddress src)
           
 void sendToLinkLayer(Message msg, NetAddress originalSourceIP, NetAddress finalDestinationIP, NetAddress nextHopDestIP)
           
 void sendToLinkLayer(NetMessage.Ip ipMsg, NetAddress nextHopDestIP)
           
 void setAppInterface(AppInterface appInterface)
           
 void setNetEntity(NetInterface netEntity)
           
 void setupMyNode(Node myNode)
           
 void start()
          Start running protocol.
 double t(int hopCount, int maxHopCount)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEBUG_MODE

public static final boolean DEBUG_MODE
debug mode.

See Also:
Constant Field Values

TRANSMISSION_JITTER

public static final long TRANSMISSION_JITTER
The maximum amount of jitter before sending a packet.

See Also:
Constant Field Values

nQinitHandled

public int nQinitHandled

bezierCurveLeft

public java.util.HashMap<java.lang.Integer,Bezier> bezierCurveLeft
Beziers


bezierCurveRight

public java.util.HashMap<java.lang.Integer,Bezier> bezierCurveRight

topologyVisualizationTool

public static TopologyGUI topologyVisualizationTool

EXPIRATION_PERIOD

public static final int EXPIRATION_PERIOD
See Also:
Constant Field Values
Constructor Detail

RouteBezier

public RouteBezier(NetAddress localAddr,
                   Node myNode,
                   PanelContext hostPanelContext,
                   int PATH_COUNT,
                   int THETA_ANGLE,
                   int CP_LENGTH,
                   double COMM_RANGE,
                   int VERT_PIPE_SAME,
                   int ALTERNATION_POLICY,
                   double commRangeFt,
                   double extensionFactor)
Method Detail

setupMyNode

public void setupMyNode(Node myNode)

getProxy

public RouteInterface.BezierRouting getProxy()

setNetEntity

public void setNetEntity(NetInterface netEntity)

setAppInterface

public void setAppInterface(AppInterface appInterface)

getDestIp

public NetAddress getDestIp()
Returns destination ip address.

Returns:
destination ip address

dropNotify

public void dropNotify(Message msg,
                       MacAddress nextHopMac,
                       Reason reason)
Description copied from interface: NetInterface.NetHandler
Notification mechanism for packet dropped due to various "Reasons"

Specified by:
dropNotify in interface NetInterface.NetHandler

peek

public void peek(NetMessage msg,
                 MacAddress lastHopMac)
Description copied from interface: RouteInterface
Called by the network layer for every incoming packet. A routing implementation may wish to look at these packets for informational purposes, but should not change their contents.

Specified by:
peek in interface RouteInterface
Parameters:
msg - incoming packet
lastHopMac - last link-level hop of incoming packet

send

public void send(NetMessage msg)
Description copied from interface: NetInterface.NetHandler
Send a message through the routing protocol

Specified by:
send in interface NetInterface.NetHandler
Specified by:
send in interface RouteInterface
Parameters:
msg - outgoing packet

receive

public void receive(Message msg,
                    NetAddress src,
                    MacAddress lastHop,
                    byte macId,
                    NetAddress dst,
                    byte priority,
                    byte ttl)
Description copied from interface: NetInterface.NetHandler
Receive a message from network layer.

Specified by:
receive in interface NetInterface.NetHandler
Parameters:
msg - message received
src - source network address
lastHop - source link address
macId - incoming interface
dst - destination network address
priority - packet priority
ttl - packet time-to-live

createBezierCurves

public void createBezierCurves(Location2D srcLoc,
                               Location2D sinkLoc,
                               int index,
                               int NN,
                               double Theta,
                               int backLength,
                               boolean leftHanded,
                               boolean draw)

alpha

public double alpha(int hopCount,
                    int maxHopCount)

beta

public double beta(int hopCount,
                   int maxHopCount)

t

public double t(int hopCount,
                int maxHopCount)

onLeft

public boolean onLeft(double Xs,
                      double Ys,
                      double Xd,
                      double Yd,
                      double X0,
                      double Y0)

angle360From3Points

public double angle360From3Points(double X1,
                                  double Y1,
                                  double X0,
                                  double Y0,
                                  double X2,
                                  double Y2)

computeAngle

public double computeAngle(double X0,
                           double Y0,
                           int hopCount,
                           int maxHopCount,
                           int index)

AngleConsecutinvePointsOnCurve

public double AngleConsecutinvePointsOnCurve(Bezier bezierCurve,
                                             int hopCount,
                                             int maxHopCount)

DistanceConsecutinvePointsOnCurve

public double DistanceConsecutinvePointsOnCurve(Bezier bezierCurve,
                                                int hopCount,
                                                int maxHopCount)

Distance

public double Distance(double x1,
                       double y1,
                       double x2,
                       double y2)

getShortestPointToCurve

public double getShortestPointToCurve(double initial_t,
                                      Bezier bezierCurve,
                                      double cur_X,
                                      double cur_Y)

getNextPointOnCurve

public double getNextPointOnCurve(double current_t,
                                  Bezier bezierCurve,
                                  double cur_X,
                                  double cur_Y,
                                  double factor)

getThroughShortestPath

public NetAddress getThroughShortestPath(Location2D destLocation)

GetNextHop2

public NetAddress GetNextHop2(int queryId,
                              long s_seq,
                              NetMessage.Ip msg)

sendToLinkLayer

public void sendToLinkLayer(Message msg,
                            NetAddress originalSourceIP,
                            NetAddress finalDestinationIP,
                            NetAddress nextHopDestIP)

sendToLinkLayer

public void sendToLinkLayer(NetMessage.Ip ipMsg,
                            NetAddress nextHopDestIP)

sendToAppLayer

public void sendToAppLayer(Message msg,
                           NetAddress src)

start

public void start()
Description copied from interface: Protocol
Start running protocol.

Specified by:
start in interface Protocol