J-Sim v1.2.1-p7 API

drcl.inet.core
Class Hello

java.lang.Object
  extended bydrcl.DrclObj
      extended bydrcl.comp.Component
          extended bydrcl.net.Module
              extended bydrcl.inet.Protocol
                  extended bydrcl.inet.core.Hello
All Implemented Interfaces:
ActiveComponent, java.lang.Cloneable, InetConstants, InetCoreConstants, ObjectDuplicable, java.io.Serializable
Direct Known Subclasses:
Hellov

public class Hello
extends Protocol
implements ActiveComponent, InetCoreConstants

Component that resides in a node and exchanges information with neighboring nodes. The information collectd is stored in the data structure defined in InterfaceInfo. Other components may query for the neighbor information by sending null to one of its port; in return, the component sends back array of InterfaceInfo. The component may run in two modes: dynamic or static. When in dynamic mode, the neighbor information is maintained with soft-state approach, so that it adapts to topology change. When topology is fixed, it would be better to run it in static mode where information is exchanged once and the neighbor information is never timed out. One may change the mode back and forth during simulation at any time.

See Also:
IFQuery, InterfaceInfo, Serialized Form

Nested Class Summary
 
Nested classes inherited from class drcl.comp.Component
Component.Locks
 
Field Summary
protected  long myself
           
protected  InterfaceInfo[] neighbors
          The vector which keeps track of all the available interfaces of a node.
 
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, id, 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
Hello()
           
Hello(java.lang.String id_)
           
 
Method Summary
 InterfaceInfo _getInterfaceInfo(int ifIndex_)
          Returns the information of a specific interface.
protected  InterfaceInfo[] _queryAll()
          Hookup for Hellov extension.
 void _setInterfaceInfo(int ifindex_, InterfaceInfo if_)
          Sets the information of a specific interface.
 void _setInterfaceInfo(int ifindex_, NetAddress local_, NetAddress peer_)
          Sets the information of a specific interface.
 void _setMTUs(int mtu_)
          Sets the default MTU value.
protected  void _start()
          Implements the startup method of ActiveComponent.
 void clear()
          Clears the neighbor database.
protected  void dataArriveAtDownPort(java.lang.Object data_, Port downPort_)
          The handler invoked when a packet arrives at a "down" port.
 void duplicate(java.lang.Object source_)
          Duplicates the content of source_, including ID, name, child components and connections among them, to this component.
protected  void fireEvent(java.lang.String evtName_, int ifindex_, NetAddress neighbor_)
          Hookup for Hellov extension.
static double getHelloRemovalTimeout()
           
static double getHelloTimeout()
           
 InterfaceInfo[] getInterfaceInfos()
          Returns the information of all interfaces.
 java.lang.String getName()
          Returns the (informational) name of the component.
 java.lang.String info()
          Returns information regarding this component.
 boolean isStaticEnabled()
          Returns true if the static mode is enabled.
protected  void processOther(java.lang.Object data_, Port inPort_)
          The handler invoked when a packet arrived at a port other than the "up", "down" and timer ports.
 void reset()
          Resets the component for being used anew.
static void setHelloRemovalTimeout(double timeout_)
           
 void setInterfaceInfos(InterfaceInfo[] aa_)
          Sets the interface information for all interfaces.
 void setStaticEnabled(boolean v_)
          Enables/disables the static mode.
protected  void timeout(java.lang.Object data_)
          The handler invoked when a timeout event occurs.
 
Methods inherited from class drcl.inet.Protocol
broadcast, broadcast, broadcast, broadcast, broadcast, broadcast, createConfigSwitchPort, createIDChangedEventPort, createIDServicePort, createIFEventPort, createIFQueryPort, createLinkBrokenEventPort, createMcastHostEventPort, createMcastQueryPort, createMulticastRTChangedEventPort, createPktArrivalEventPort, createRTServicePort, createUcastQueryPort, createUnicastRTChangedEventPort, createVIFEventPort, forward, forward, forward, forward, forward, forward, idAddedEventHandler, idRemovedEventHandler, LinkBrokenEventHandler, mcastHostJoinEventHandler, mcastHostLeaveEventHandler, neighborDownEventHandler, neighborUpEventHandler, pktArrivalHandler, routeQueryHandler, routeQueryHandler, rtAddedEventHandler, rtModifiedEventHandler, rtRemovedEventHandler, vNeighborDownEventHandler, vNeighborUpEventHandler
 
Methods inherited from class drcl.net.Module
cancelTimeout, dataArriveAtUpPort, deliver, getAddress, process, removeDefaultDownPort, removeDefaultUpPort, removeTimerPort, setAddress, setTimeout, setTimeoutAt
 
Methods inherited from class drcl.comp.Component
_resume, _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, getDebugLevelNames, getForkManager, getID, 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, portAdded, 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 drcl.DrclObj
clone
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

neighbors

protected InterfaceInfo[] neighbors
The vector which keeps track of all the available interfaces of a node.


myself

protected long myself
Constructor Detail

Hello

public Hello()

Hello

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

getName

public java.lang.String getName()
Description copied from class: Component
Returns the (informational) name of the component.

Overrides:
getName in class Component

setHelloRemovalTimeout

public static final void setHelloRemovalTimeout(double timeout_)

getHelloRemovalTimeout

public static final double getHelloRemovalTimeout()

getHelloTimeout

public static final double getHelloTimeout()

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

clear

public void clear()
Clears the neighbor database.


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 Protocol

_start

protected void _start()
Implements the startup method of ActiveComponent. Specifically, when a Hello starts, it broadcasts its identity to its neighbors via all the available interfaces.

Overrides:
_start in class Component

fireEvent

protected void fireEvent(java.lang.String evtName_,
                         int ifindex_,
                         NetAddress neighbor_)
Hookup for Hellov extension.


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)

processOther

protected void processOther(java.lang.Object data_,
                            Port inPort_)
Description copied from class: Module
The handler invoked when a packet arrived at a port other than the "up", "down" and timer ports.

Overrides:
processOther in class Protocol

_queryAll

protected InterfaceInfo[] _queryAll()
Hookup for Hellov extension.


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

setStaticEnabled

public void setStaticEnabled(boolean v_)
Enables/disables the static mode.


isStaticEnabled

public boolean isStaticEnabled()
Returns true if the static mode is enabled.


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

_setInterfaceInfo

public void _setInterfaceInfo(int ifindex_,
                              NetAddress local_,
                              NetAddress peer_)
Sets the information of a specific interface.


_setInterfaceInfo

public void _setInterfaceInfo(int ifindex_,
                              InterfaceInfo if_)
Sets the information of a specific interface.


_getInterfaceInfo

public InterfaceInfo _getInterfaceInfo(int ifIndex_)
Returns the information of a specific interface.


getInterfaceInfos

public InterfaceInfo[] getInterfaceInfos()
Returns the information of all interfaces.


setInterfaceInfos

public void setInterfaceInfos(InterfaceInfo[] aa_)
Sets the interface information for all interfaces.


_setMTUs

public void _setMTUs(int mtu_)
Sets the default MTU value.


J-Sim v1.2.1-p7 API

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