J-Sim v1.2.1-p7 API

drcl.inet.core
Class PktDispatcher

java.lang.Object
  extended bydrcl.DrclObj
      extended bydrcl.comp.Component
          extended bydrcl.net.Module
              extended bydrcl.inet.core.PktDispatcher
All Implemented Interfaces:
java.lang.Cloneable, InetConstants, InetCoreConstants, ObjectDuplicable, java.io.Serializable

public class PktDispatcher
extends Module
implements InetCoreConstants

Implements the packet dispatcher component in the inet router architecture. Fragmentation is simulated, but not yet emulated.

See Also:
PktSending, PktDelivery, IDLookup, RTLookup, Serialized Form

Nested Class Summary
 
Nested classes inherited from class drcl.comp.Component
Component.Locks
 
Field Summary
static int DEBUG_FRAGMENT
           
static int DEBUG_PIP
           
static int DEBUG_REASSEMBLE
           
 
Fields inherited from class drcl.net.Module
address, downPort, PortGroup_DOWN, PortGroup_UP, timerPort, upPort
 
Fields inherited from class drcl.comp.Component
FLAG_COMPONENT_NOTIFICATION, FLAG_DEBUG_ENABLED, FLAG_DIRECT_OUTPUT_ENABLED, FLAG_ENABLED, FLAG_ERROR_ENABLED, FLAG_EVENT_ENABLED, FLAG_EXPOSED, FLAG_GARBAGE_DISPLAY_ENABLED, FLAG_GARBAGE_ENABLED, FLAG_HAS_EXPOSED_CHILD, FLAG_PORT_NOTIFICATION, FLAG_STARTED, FLAG_STOPPED, FLAG_TRACE_ENABLED, FLAG_UNDEFINED_START, infoPort, locks, name, parent, PortGroup_DEFAULT_GROUP, PortGroup_EVENT, PortGroup_SERVICE, Root, Trace_DATA, Trace_SEND
 
Fields inherited from interface drcl.inet.core.InetCoreConstants
CONFIG_PORT_ID, PULL_PORT_ID
 
Fields inherited from interface drcl.inet.InetConstants
BYTE_MODE, DEFAULT_BANDWIDTH, DEFAULT_BUFFER_SIZE, DEFAULT_MTU, EVENT_ID_CHANGED_PORT_ID, EVENT_IDENTITY_ADDED, EVENT_IDENTITY_REMOVED, EVENT_IF_NEIGHBOR_DOWN, EVENT_IF_NEIGHBOR_UP, EVENT_IF_PORT_ID, EVENT_LINK_BROKEN, EVENT_LINK_BROKEN_PORT_ID, EVENT_MCAST_HOST_PORT_ID, EVENT_PKT_ARRIVAL, EVENT_PKT_ARRIVAL_PORT_ID, EVENT_RT_ENTRY_ADDED, EVENT_RT_ENTRY_MODIFIED, EVENT_RT_ENTRY_REMOVED, EVENT_RT_MCAST_CHANGED_PORT_ID, EVENT_RT_UCAST_CHANGED_PORT_ID, EVENT_VIF_NEIGHBOR_DOWN, EVENT_VIF_NEIGHBOR_UP, EVENT_VIF_PORT_ID, HOST_ENTRY_EXT, ID_CSL, MCAST_QUERY_PORT_ID, PACKET_MODE, PID_AODV, PID_DV, PID_DVMRP, PID_HELLO, PID_IGMP, PID_OSPF, PID_RSVP, PID_TCP, PID_UDP, SERVICE_CONFIGSW_PORT_ID, SERVICE_ID_PORT_ID, SERVICE_IF_PORT_ID, SERVICE_MCAST_PORT_ID, SERVICE_RT_PORT_ID, UCAST_QUERY_PORT_ID
 
Constructor Summary
PktDispatcher()
           
PktDispatcher(java.lang.String id_)
           
 
Method Summary
 int _getMTU(int index_)
           
 int _getSequenceNo()
           
 void _setMTU(int index_, int mtu_)
           
 void _setMTUs(int mtu_)
          Sets the maximum fragmentation size at all interfaces.
 void _setSequenceNo(int sn_)
           
 void bind(Identity id_)
           
 void bind(RT rt_)
           
 java.lang.Object clone()
          Returns a clone of this object.
protected  void dataArriveAtDownPort(java.lang.Object data_, Port downPort_)
          The handler invoked when a packet arrives at a "down" port.
protected  void dataArriveAtUpPort(java.lang.Object data_, Port upPort_)
          The handler invoked when a packet arrives at an "up" port.
 void duplicate(java.lang.Object source_)
          Duplicates the content of source_, including ID, name, child components and connections among them, to this component.
 java.lang.String[] getDebugLevelNames()
          Returns the names of defined debug levels; subclasses should override this method if debug levels are defined.
 double getFragmentTTL()
           
 int getHeaderSize()
           
 int[][][] getLabelSwitches()
          Returns the label switching incoming label map.
 int[] getMTUs()
           
 int getRouteCacheSize()
           
 int[] getSwitches()
          Returns the switching cross connect table.
 VIFPack getVIFs()
          Returns the VIF pack data structure regarding the VIF setup on this component.
 java.lang.String info()
          Returns information regarding this component.
 boolean isFragmentEnabled()
           
 boolean isLabelSwitchingEnabled()
           
 boolean isPIPEnabled()
           
 boolean isRouteCacheEnabled()
           
 boolean isRTLookup()
          Returns true this PktDispatcher needs route lookup service.
 boolean isSwitchingEnabled()
           
 boolean isTTLCheckEnabled()
           
protected  void portAdded(Port p_)
          The hookup method for subclasses to handle the event when the port p_ is added to the component.
 void removeLabelSwitch(int incomingIf_, int incomingLabel_)
          Removes the label switching incoming label map entry at the incoming interface and the incoming label.
 void removeLabelSwitches(int incomingIf_)
          Removes the label switching incoming label map entry at the incoming interface.
 void removeSwitch(int incomingIf_)
          Removes the switching cross connect table entry at the incoming interface.
 void reset()
          Resets the component for being used anew.
 void setFragmentEnabled(boolean enabled_)
           
 void setFragmentTTL(double ttl_)
           
 void setHeaderSize(int hsize_)
           
 void setLabelSwitch(int incomingIf_, int[][] switch_)
          Sets the label switching incoming label map entry at the incoming interface.
 void setLabelSwitch(int incomingIf_, int incomingLabel_, int outgoingIf_, int outgoingLabel_)
          Sets the label switching incoming label map entry at the incoming interface and the incoming label.
 void setLabelSwitches(int[][][] map_)
          Sets the label switching incoming label map.
 void setLabelSwitchingEnabled(boolean enabled_)
           
 void setMTUs(int[] mtu_)
           
 void setPIPEnabled(boolean enabled_)
           
 void setRouteCacheEnabled(boolean enabled_)
           
 void setRouteCacheSize(int size_)
           
 void setSwitch(int incomingIf_, int outgoingIf_)
          Sets the switching cross connect table entry at the incoming interface.
 void setSwitches(int[] connectTable_)
          Sets the switching cross connect table.
 void setSwitchingEnabled(boolean enabled_)
           
 void setTTLCheckEnabled(boolean v_)
           
 void setVIF(int vif_, long peer_)
          Adds a virtual interface and the corresponding up port to this component.
 void setVIF(int vif_, long myself_, long peer_)
          Adds a virtual interface and the corresponding up port to this component.
 void setVIFs(VIFPack pack_)
          Installs the VIF pack on this component.
protected  void timeout(java.lang.Object data_)
          The handler invoked when a timeout event occurs.
 
Methods inherited from class drcl.net.Module
cancelTimeout, deliver, getAddress, process, processOther, removeDefaultDownPort, removeDefaultUpPort, removeTimerPort, setAddress, setTimeout, setTimeoutAt
 
Methods inherited from class drcl.comp.Component
_resume, _start, _stop, addComponent, addComponent, addEventPort, addEventPort, addForkPort, addPort, addPort, addPort, addPort, addPort, addPort, addPort, addPort, addServerPort, addServerPort, cancelFork, componentAdded, componentRemoved, connect, containsComponent, containsComponent, containsPort, debug, disconnectAll, disconnectAllPeers, disconnectAllPorts, drop, drop, error, error, expose, exposeEventPorts, exposePort, exposePort, exposePort, exposePort, exposePort, findAvailable, findAvailable, findAvailable, finishing, fork, forkAt, getAllComponents, getAllPorts, getAllPorts, getAllWiresInside, getAllWiresInsideOut, getAllWiresOut, getComponent, getComponentFlag, getComponentFlag, getContract, getContractHT, getContractHT, getDebugFlagsInBinary, getForkManager, getID, getName, getParent, getPort, getPort, getRoot, getRuntime, getTime, iduplicate, isAncestorOf, isComponentNotificationEnabled, isContainer, isDebugEnabled, isDebugEnabledAt, isDirectlyRelatedTo, isDirectOutputEnabled, isEnabled, isErrorNoticeEnabled, isEventExportEnabled, isGarbageDisplayEnabled, isGarbageEnabled, isPortNotificationEnabled, isPortRemovable, isStarted, isStopped, isTraceEnabled, lock, notify, notifyAll, operate, portRemoved, reboot, removeAll, removeAllComponents, removeAllPorts, removeAllPorts, removeComponent, removeComponent, removePort, removePort, removePort, resume, run, sduplicate, send, sendAt, setComponentFlag, setComponentFlag, setComponentNotificationEnabled, setContract, setDebugEnabled, setDebugEnabled, setDebugEnabledAt, setDebugEnabledAt, setDebugEnabledAt, setDirectOutputEnabled, setDirectOutputEnabled, setEnabled, setErrorNoticeEnabled, setErrorNoticeEnabled, setEventExportEnabled, setEventExportEnabled, setExecutionBoundary, setGarbageDisplayEnabled, setGarbageDisplayEnabled, setGarbageEnabled, setGarbageEnabled, setID, setID, setName, setPort, setPort, setPortNotificationEnabled, setPortRemovable, setRuntime, setTraceEnabled, setTraceEnabled, sleepFor, sleepUntil, stop, toString, unexpose, unlock, useLocalForkManager, useLocalForkManager, wait, yield
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEBUG_FRAGMENT

public static final int DEBUG_FRAGMENT
See Also:
Constant Field Values

DEBUG_REASSEMBLE

public static final int DEBUG_REASSEMBLE
See Also:
Constant Field Values

DEBUG_PIP

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

PktDispatcher

public PktDispatcher()

PktDispatcher

public PktDispatcher(java.lang.String id_)
Method Detail

getDebugLevelNames

public java.lang.String[] getDebugLevelNames()
Description copied from class: Component
Returns the names of defined debug levels; subclasses should override this method if debug levels are defined.

Overrides:
getDebugLevelNames in class Component

reset

public void reset()
Description copied from class: Component
Resets the component for being used anew. All the internal variables must be set to the initial state. All the ports and child components are reset as well.

Overrides:
reset in class Component

duplicate

public void duplicate(java.lang.Object source_)
Description copied from class: Component
Duplicates the content of source_, including ID, name, child components and connections among them, to this component. Subclasses need to override this method to copy its own variables.

Specified by:
duplicate in interface ObjectDuplicable
Overrides:
duplicate in class Module

clone

public java.lang.Object clone()
Description copied from class: DrclObj
Returns a clone of this object. By default, this method creates an object of the same class and calls DrclObj.duplicate(Object) to duplicate the content of this object to the newly-created one.

This method uses getClass().newInstance() to create new instance. Hence, subclasses need to override this method only if the subclass is not declared as public or does not have explicit no-argument constructor. A subclass may override this method for performance reason.

Specified by:
clone in interface ObjectDuplicable
Overrides:
clone in class DrclObj

info

public java.lang.String info()
Description copied from class: Component
Returns information regarding this component. Subclasses should override this method to provide useful information at run time.

Overrides:
info in class Component

portAdded

protected void portAdded(Port p_)
Description copied from class: Component
The hookup method for subclasses to handle the event when the port p_ is added to the component.

Overrides:
portAdded in class Component

bind

public void bind(Identity id_)

bind

public void bind(RT rt_)

isTTLCheckEnabled

public boolean isTTLCheckEnabled()

setTTLCheckEnabled

public final void setTTLCheckEnabled(boolean v_)

setFragmentEnabled

public void setFragmentEnabled(boolean enabled_)

isFragmentEnabled

public boolean isFragmentEnabled()

setPIPEnabled

public void setPIPEnabled(boolean enabled_)

isPIPEnabled

public boolean isPIPEnabled()

setRouteCacheEnabled

public void setRouteCacheEnabled(boolean enabled_)

isRouteCacheEnabled

public boolean isRouteCacheEnabled()

setSwitchingEnabled

public void setSwitchingEnabled(boolean enabled_)

isSwitchingEnabled

public boolean isSwitchingEnabled()

setLabelSwitchingEnabled

public void setLabelSwitchingEnabled(boolean enabled_)

isLabelSwitchingEnabled

public boolean isLabelSwitchingEnabled()

setRouteCacheSize

public void setRouteCacheSize(int size_)

getRouteCacheSize

public int getRouteCacheSize()

setHeaderSize

public void setHeaderSize(int hsize_)

getHeaderSize

public int getHeaderSize()

isRTLookup

public boolean isRTLookup()
Returns true this PktDispatcher needs route lookup service. A PktDispatcher may not need route lookup service if the number of the outgoing interfaces is less than two.


_setSequenceNo

public void _setSequenceNo(int sn_)

_getSequenceNo

public int _getSequenceNo()

getFragmentTTL

public double getFragmentTTL()

setFragmentTTL

public void setFragmentTTL(double ttl_)

_setMTU

public void _setMTU(int index_,
                    int mtu_)

_setMTUs

public void _setMTUs(int mtu_)
Sets the maximum fragmentation size at all interfaces.


_getMTU

public int _getMTU(int index_)

setMTUs

public void setMTUs(int[] mtu_)

getMTUs

public int[] getMTUs()

timeout

protected void timeout(java.lang.Object data_)
Description copied from class: Module
The handler invoked when a timeout event occurs. Subclasses should override it to handle such an event.

Overrides:
timeout in class Module
See Also:
Module.setTimeout(Object, double), Module.setTimeoutAt(Object, double)

dataArriveAtUpPort

protected void dataArriveAtUpPort(java.lang.Object data_,
                                  Port upPort_)
Description copied from class: Module
The handler invoked when a packet arrives at an "up" port. Subclasses should override it to handle such an event.

Overrides:
dataArriveAtUpPort in class Module

dataArriveAtDownPort

protected void dataArriveAtDownPort(java.lang.Object data_,
                                    Port downPort_)
Description copied from class: Module
The handler invoked when a packet arrives at a "down" port. Subclasses should override it to handle such an event.

Overrides:
dataArriveAtDownPort in class Module

setVIF

public void setVIF(int vif_,
                   long peer_)
Adds a virtual interface and the corresponding up port to this component.


setVIF

public void setVIF(int vif_,
                   long myself_,
                   long peer_)
Adds a virtual interface and the corresponding up port to this component.


setVIFs

public void setVIFs(VIFPack pack_)
Installs the VIF pack on this component.


getVIFs

public VIFPack getVIFs()
Returns the VIF pack data structure regarding the VIF setup on this component.


setSwitches

public void setSwitches(int[] connectTable_)
Sets the switching cross connect table.


getSwitches

public int[] getSwitches()
Returns the switching cross connect table.


setSwitch

public void setSwitch(int incomingIf_,
                      int outgoingIf_)
Sets the switching cross connect table entry at the incoming interface.


removeSwitch

public void removeSwitch(int incomingIf_)
Removes the switching cross connect table entry at the incoming interface.


setLabelSwitches

public void setLabelSwitches(int[][][] map_)
Sets the label switching incoming label map.


getLabelSwitches

public int[][][] getLabelSwitches()
Returns the label switching incoming label map.


setLabelSwitch

public void setLabelSwitch(int incomingIf_,
                           int[][] switch_)
Sets the label switching incoming label map entry at the incoming interface.


setLabelSwitch

public void setLabelSwitch(int incomingIf_,
                           int incomingLabel_,
                           int outgoingIf_,
                           int outgoingLabel_)
Sets the label switching incoming label map entry at the incoming interface and the incoming label.


removeLabelSwitches

public void removeLabelSwitches(int incomingIf_)
Removes the label switching incoming label map entry at the incoming interface.


removeLabelSwitch

public void removeLabelSwitch(int incomingIf_,
                              int incomingLabel_)
Removes the label switching incoming label map entry at the incoming interface and the incoming label.


J-Sim v1.2.1-p7 API

Copyright © 1998-2003 Distributed Real-time Computing Lab (DRCL). All Rights Reserved.     ~ To J-Sim Home ~