J-Sim v1.2.1-p7 API

drcl.inet
Class Node

java.lang.Object
  extended bydrcl.DrclObj
      extended bydrcl.comp.Component
          extended bydrcl.inet.Node
All Implemented Interfaces:
java.lang.Cloneable, InetConstants, ObjectDuplicable, java.io.Serializable

public class Node
extends Component
implements InetConstants

The container class for a network node.

In the INET framework, a node consists of the core service layer (CSL) and the "upper" protocol layer (UPL). UPL contains transport protocols, applications and other modules. The structure in this layer is not defined in the framework, so components in this layer may form an arbitrary graph. CSL provides a set of well-defined services (that are common in most network architectures) to modules in the UPL. In some sense, CSL encapsulates the functionality of all the network layer, the link layer and the physical layer.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class drcl.comp.Component
Component.Locks
 
Field Summary
 
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.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
Node()
           
Node(java.lang.String id_)
           
 
Method Summary
 void add(Component c_, java.lang.String llpid_, int port_)
           
 void addAddress(long addr_)
          Adds a network address to this node.
 void addRTEntry(RTKey key_, RTEntry entry_, double timeout_)
          Adds an RT entry to this node.
protected  void componentAdded(Component child_)
          Notified when a component is added.
static Node create(long nodeAddr_)
           
 double getBandwidth(int ifIndex_)
          Returns the bandwidth of the ifindex_th interface.
 java.lang.String getBufferMode(int ifIndex_)
          Returns the buffer operation mode.
 int getBufferSize(int ifIndex_)
          Returns the buffer size of the ifindex_th interface.
 CoreServiceLayer getCSL()
           
 long getDefaultAddress()
          Returns the default network address of this node.
 InterfaceInfo getInterfaceInfo(int ifIndex_)
          Returns the interface information of the ifindex_th interface.
 InterfaceInfo[] getInterfaceInfos()
          Returns the interface information of all the interfaces.
 double getLinkPropDelay(int ifIndex_)
          Returns the emulated link propagation delay.
 int getMTU(int ifIndex_)
          /** Returns the MTU of the specified interface.
 int getNumOfInterfaces()
          Returns the number of interfaces including virtual ones.
 int getNumOfPhysicalInterfaces()
          Returns the number of physical interfaces
 boolean hasRoutingCapability()
           
 java.lang.String info()
          Returns information regarding this component.
 boolean isLinkEmulationEnabled(int ifIndex_)
           
protected  void portAdded(Port mine_)
          Notified when a port is added.
 void propagates(Address addr_)
          Propagates the address scheme through this node.
 void removeAddress(long addr_)
          Removes a network address from this node.
 void removeRTEntry(RTKey key_)
          Removes an RT entry from this node.
 RTEntry[] retrieveAllRTEntries()
          Retrieves all RT entries from this node.
 java.lang.Object retrieveRTEntry(RTKey key_, java.lang.String matchMethod_)
          Retrieves an RT entry/RT entries from this node.
 void setBandwidth(double bw_)
          Sets the bandwidth of all the interfaces.
 void setBandwidth(int ifindex_, double bw_)
          Sets the bandwidth of the ifindex_th interface.
 void setBuffer(int ifindex_, int bs_, java.lang.String mode_)
          Sets the buffer size of the ifindex_th interface.
 void setBuffer(int bs_, java.lang.String mode_)
          Sets the buffer size of all the interfaces.
 void setBufferMode(int ifIndex_, java.lang.String mode_)
          Sets the buffer mode of the specified interface.
 void setBufferMode(java.lang.String mode_)
          Sets the buffer mode of all the interfaces.
 void setBufferSize(int bs_)
          Sets the buffer size of all the interfaces.
 void setBufferSize(int ifindex_, int bs_)
          Sets the buffer size of the ifindex_th interface.
 void setInterfaceInfo(int ifindex_, InterfaceInfo if_)
          Sets the interface information of the ifindex_th interface.
 void setInterfaceInfos(InterfaceInfo[] aa_)
          Sets the interface information of all the interfaces.
 void setLinkEmulationEnabled(int ifIndex_, boolean enabled_)
           
 void setLinkPropDelay(int ifIndex_, double delay_)
          Sets the emulated link propagation delay.
 void setMTU(int ifindex_, int mtu_)
          Sets the MTU of the specified interface.
 void setMTUs(int mtu_)
          Sets the MTU of all the interfaces.
 
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, componentRemoved, connect, containsComponent, containsComponent, containsPort, debug, disconnectAll, disconnectAllPeers, disconnectAllPorts, drop, drop, duplicate, 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, 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, process, reboot, removeAll, removeAllComponents, removeAllPorts, removeAllPorts, removeComponent, removeComponent, removePort, removePort, removePort, reset, 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
 

Constructor Detail

Node

public Node()

Node

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

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

create

public static Node create(long nodeAddr_)

getCSL

public CoreServiceLayer getCSL()

hasRoutingCapability

public boolean hasRoutingCapability()

getDefaultAddress

public long getDefaultAddress()
Returns the default network address of this node.


addAddress

public void addAddress(long addr_)
Adds a network address to this node. The first address added is set to be the default.


removeAddress

public void removeAddress(long addr_)
Removes a network address from this node.


setBandwidth

public void setBandwidth(int ifindex_,
                         double bw_)
Sets the bandwidth of the ifindex_th interface.


setBandwidth

public void setBandwidth(double bw_)
Sets the bandwidth of all the interfaces.


getBandwidth

public double getBandwidth(int ifIndex_)
Returns the bandwidth of the ifindex_th interface.


setBufferSize

public void setBufferSize(int ifindex_,
                          int bs_)
Sets the buffer size of the ifindex_th interface.

Parameters:
bs_ - buffer size in bytes or packets depending on the mode.

setBufferSize

public void setBufferSize(int bs_)
Sets the buffer size of all the interfaces.

Parameters:
bs_ - buffer size in bytes or packets depending on the mode.

setBuffer

public void setBuffer(int bs_,
                      java.lang.String mode_)
Sets the buffer size of all the interfaces.

Parameters:
bs_ - buffer size in bytes or packets depending on the mode.
mode_ - can be either "packet" or "byte".

setBuffer

public void setBuffer(int ifindex_,
                      int bs_,
                      java.lang.String mode_)
Sets the buffer size of the ifindex_th interface.

Parameters:
bs_ - buffer size in bytes or packets depending on the mode.
mode_ - can be either "packet" or "byte".

setBufferMode

public void setBufferMode(java.lang.String mode_)
Sets the buffer mode of all the interfaces.

Parameters:
mode_ - can be either "packet" or "byte".

setBufferMode

public void setBufferMode(int ifIndex_,
                          java.lang.String mode_)
Sets the buffer mode of the specified interface.

Parameters:
mode_ - can be either "packet" or "byte".

getBufferSize

public int getBufferSize(int ifIndex_)
Returns the buffer size of the ifindex_th interface.

Returns:
the buffer size in bytes or packets depending on the mode.
See Also:
getBufferMode(int)

getBufferMode

public java.lang.String getBufferMode(int ifIndex_)
Returns the buffer operation mode.

Returns:
either "packet" or "byte".

setMTU

public void setMTU(int ifindex_,
                   int mtu_)
Sets the MTU of the specified interface.


setMTUs

public void setMTUs(int mtu_)
Sets the MTU of all the interfaces.


getMTU

public int getMTU(int ifIndex_)
/** Returns the MTU of the specified interface.


setInterfaceInfo

public void setInterfaceInfo(int ifindex_,
                             InterfaceInfo if_)
Sets the interface information of the ifindex_th interface.

See Also:
InterfaceInfo

getInterfaceInfo

public InterfaceInfo getInterfaceInfo(int ifIndex_)
Returns the interface information of the ifindex_th interface.

See Also:
InterfaceInfo

getInterfaceInfos

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

See Also:
InterfaceInfo

setInterfaceInfos

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

See Also:
InterfaceInfo

getNumOfInterfaces

public int getNumOfInterfaces()
Returns the number of interfaces including virtual ones.


getNumOfPhysicalInterfaces

public int getNumOfPhysicalInterfaces()
Returns the number of physical interfaces


addRTEntry

public void addRTEntry(RTKey key_,
                       RTEntry entry_,
                       double timeout_)
Adds an RT entry to this node.

See Also:
RTKey, RTEntry

removeRTEntry

public void removeRTEntry(RTKey key_)
Removes an RT entry from this node.

See Also:
RTKey, RTEntry

retrieveRTEntry

public java.lang.Object retrieveRTEntry(RTKey key_,
                                        java.lang.String matchMethod_)
Retrieves an RT entry/RT entries from this node.

Returns:
RTEntry[] if matchMethod_ is MATCH_ALL or MATCH_WILDCARD.
See Also:
RTKey, RTEntry

retrieveAllRTEntries

public RTEntry[] retrieveAllRTEntries()
Retrieves all RT entries from this node.

Returns:
all RT entries in RTEntry[].
See Also:
RTKey, RTEntry

setLinkPropDelay

public void setLinkPropDelay(int ifIndex_,
                             double delay_)
Sets the emulated link propagation delay. Used with link emulation enabled at that interface.


getLinkPropDelay

public double getLinkPropDelay(int ifIndex_)
Returns the emulated link propagation delay. Used with link emulation enabled at that interface.


setLinkEmulationEnabled

public void setLinkEmulationEnabled(int ifIndex_,
                                    boolean enabled_)

isLinkEmulationEnabled

public boolean isLinkEmulationEnabled(int ifIndex_)

componentAdded

protected void componentAdded(Component child_)
Notified when a component is added.

Overrides:
componentAdded in class Component

portAdded

protected void portAdded(Port mine_)
Notified when a port is added.

Overrides:
portAdded in class Component

add

public void add(Component c_,
                java.lang.String llpid_,
                int port_)

propagates

public void propagates(Address addr_)
Propagates the address scheme through this node.


J-Sim v1.2.1-p7 API

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