J-Sim v1.2.1-p7 API

drcl.inet
Class CoreServiceLayer

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

public abstract class CoreServiceLayer
extends Component
implements InetConstants

The container class of the core service layer in the Inet architecture. The core service layer encapsulates the functionality of the network layer and below. It maintains information of the nodes and provides services through defined service ports for the upper layer protocols to access/manipulate the information. In addition, it spontaneously sends out various types of events through defined event ports. The details of the information, the services and the events are described below.

Information

Identity
The core service layer maintains the identities (addresses) that the node owns. It does not distinguish unicast and multicast addresses.
Routing Table
The core service layer maintains a routing table for forwarding packets. The routing table consists of the routing entries (RTEntry) and the keys (RTKey) to the entries.
Neighbor Information
The core service layer maintains the interface-neighbors mapping of this node. The interfaces of this node is indexed from 0 to n-1 where n is the number of interfaces. For each interface, it uses InterfaceInfo to record the information of neighbors that can be accessed at that interface.

Services

SERVICE CONTRACT PORT
Packet Sending PktSending ports in the "up" port group
Packet Delivery PktDelivery ports in the "up" port group
ID Lookup IDLookup .service_id@
ID Configuration IDConfig .service_id@
Route Lookup RTLookup .service_rt@
Route Configuration RTConfig .service_rt@
Interface/Neighbor Query IFQuery .service_if@
PacketFilter Configuration ConfigSwitch .service_configswitch@
Multicast Service ( = ID Configuration) IDConfig .service_mcast@

Events

EVENT NAME EVENT OBJECT PORT DESCRIPTION
Packet Arrival The arriving packet (Packet) .pktarrival@ Exported for every arriving packet no matter it is from local or network.
Identity Added The identities being added (LongObj/long[]) .id@ Exported when a node ID (address)/IDs is/are added.
Identity Removed The identities being removed (LongObj/long[]) .id@ Exported when a node ID (address)/IDs is/are removed.
Route Entry Added The entry being added (RTEntry) .rt_ucast@
.rt_mcast@
Exported when a routing entry is added.
Route Entry Removed The entry being removed (RTEntry) .rt_ucast@
.rt_mcast@
Exported when a routing entry is removed.
Route Entry Modified A two-element array that consists of the old and the new entries (RTEntry) .rt_ucast@
.rt_mcast@
Exported when a routing entry is modified.
Neighbor Up Information of the neighbor (NetAddress) .if@
.vif@
Exported when a neighbor is discovered at an interface.
Neighbor Down Information of the neighbor (NetAddress) .if@
.vif@
Exported when a neighbor is lost at an interface.
Multicast Host The multicast host event (McastHostEvent.Message) .mcastHost@ Exported when the first member joins or last member leaves a multicast group at an interface

This class also provides a set of methods to directly access/manipulate the information at a script environment.

See Also:
CSLBuilder, 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
CoreServiceLayer()
           
CoreServiceLayer(java.lang.String id_)
           
 
Method Summary
abstract  void addAddress(long addr_)
          Adds an identity to this core service layer.
abstract  void addRTEntry(RTKey key_, RTEntry entry_, double timeout_)
          Adds a routing entry to this core service layer.
abstract  double getBandwidth(int ifIndex_)
          Returns the bandwidth of the specified interface.
abstract  java.lang.String getBufferMode(int ifIndex_)
           
abstract  int getBufferSize(int ifIndex_)
          Returns the buffer size of the specified interface.
abstract  long getDefaultAddress()
          Returns the default identity in this core service layer.
abstract  InterfaceInfo getInterfaceInfo(int ifIndex_)
          Returns the interface information of the specified interface.
abstract  InterfaceInfo[] getInterfaceInfos()
          Returns all the interface information in an array.
abstract  double getLinkPropDelay(int ifIndex_)
          Returns the emulated link propagation delay.
abstract  int getMTU(int ifIndex_)
          Returns the MTU of the specified interface.
abstract  Port[][] getNAMPacketEventPorts()
          Returns the ports that output packets that are to be enqueued in and dequeued/dropped from the buffer.
abstract  int getNumOfInterfaces()
          Returns the number of interfaces including virtual ones.
abstract  int getNumOfPhysicalInterfaces()
          Returns the number of physical interfaces
abstract  boolean hasRoutingCapability()
           
 java.lang.String info()
          Returns information regarding this component.
abstract  boolean isLinkEmulationEnabled(int ifIndex_)
           
protected abstract  void portAdded(Port mine_)
          Subclasses must implement this to adapt to ports being added at run-time.
abstract  void removeAddress(long addr_)
          Removes an identity from this core service layer.
abstract  void removeRTEntry(RTKey key_)
          Removes a routing entry from this core service layer.
abstract  RTEntry[] retrieveAllRTEntries()
          Retrieves all RT entries from this core service layer.
abstract  java.lang.Object retrieveRTEntry(RTKey key_, java.lang.String matchMethod_)
          Retrieves an RT entry/RT entries from this core service layer.
abstract  void setBandwidth(double bw_)
          Sets the bandwidth of all the interfaces.
abstract  void setBandwidth(int ifindex_, double bw_)
          Sets the bandwidth of the specified interface.
abstract  void setBuffer(int ifindex_, int bs_, java.lang.String mode_)
          Sets the buffer size of the specified interface.
abstract  void setBuffer(int bs_, java.lang.String mode_)
          Sets the buffer size of all the interfaces.
abstract  void setBufferMode(int ifindex_, java.lang.String mode_)
          Sets the buffer mode of the specified interface.
abstract  void setBufferMode(java.lang.String mode_)
          Sets the buffer mode of all the interfaces.
abstract  void setBufferSize(int bs_)
          Sets the buffer size of all the interfaces.
abstract  void setBufferSize(int ifindex_, int bs_)
          Sets the buffer size of the specified interface.
abstract  void setInterfaceInfo(int ifindex_, InterfaceInfo if_)
          Sets the interface information at the specified interface.
abstract  void setInterfaceInfos(InterfaceInfo[] aa_)
          Sets the interface information of all the interfaces.
abstract  void setLinkEmulationEnabled(int ifIndex_, boolean enabled_)
           
abstract  void setLinkPropDelay(int ifIndex_, double delay_)
          Sets the emulated link propagation delay.
abstract  void setMTU(int ifindex_, int mtu_)
          Sets the MTU of the specified interface.
abstract  void setMTUs(int mtu_)
          Sets the MTUs of all interfaces.
abstract  void setupVIF(int vifindex_, long dest_, int mtu_)
           
abstract  void setupVIF(int vifindex_, long src_, long dest_, int mtu_)
           
 
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, 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

CoreServiceLayer

public CoreServiceLayer()

CoreServiceLayer

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

hasRoutingCapability

public abstract boolean hasRoutingCapability()

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

addAddress

public abstract void addAddress(long addr_)
Adds an identity to this core service layer.


getDefaultAddress

public abstract long getDefaultAddress()
Returns the default identity in this core service layer.


removeAddress

public abstract void removeAddress(long addr_)
Removes an identity from this core service layer.


setInterfaceInfo

public abstract void setInterfaceInfo(int ifindex_,
                                      InterfaceInfo if_)
Sets the interface information at the specified interface.


setInterfaceInfos

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


getInterfaceInfo

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


getInterfaceInfos

public abstract InterfaceInfo[] getInterfaceInfos()
Returns all the interface information in an array.


setBandwidth

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


getBandwidth

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


setBandwidth

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


setBufferSize

public abstract 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 abstract 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 abstract void setBuffer(int ifindex_,
                               int bs_,
                               java.lang.String mode_)
Sets the buffer size of the specified interface.

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

setBufferSize

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

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

setBufferMode

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

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

setBufferMode

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

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

setMTU

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


setMTUs

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


getBufferMode

public abstract java.lang.String getBufferMode(int ifIndex_)

getBufferSize

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

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

getMTU

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


setLinkPropDelay

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


getLinkPropDelay

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


setLinkEmulationEnabled

public abstract void setLinkEmulationEnabled(int ifIndex_,
                                             boolean enabled_)

isLinkEmulationEnabled

public abstract boolean isLinkEmulationEnabled(int ifIndex_)

getNumOfInterfaces

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


getNumOfPhysicalInterfaces

public abstract int getNumOfPhysicalInterfaces()
Returns the number of physical interfaces


addRTEntry

public abstract void addRTEntry(RTKey key_,
                                RTEntry entry_,
                                double timeout_)
Adds a routing entry to this core service layer.


removeRTEntry

public abstract void removeRTEntry(RTKey key_)
Removes a routing entry from this core service layer.


retrieveRTEntry

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

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

retrieveAllRTEntries

public abstract RTEntry[] retrieveAllRTEntries()
Retrieves all RT entries from this core service layer.

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

setupVIF

public abstract void setupVIF(int vifindex_,
                              long dest_,
                              int mtu_)

setupVIF

public abstract void setupVIF(int vifindex_,
                              long src_,
                              long dest_,
                              int mtu_)

portAdded

protected abstract void portAdded(Port mine_)
Subclasses must implement this to adapt to ports being added at run-time.

Overrides:
portAdded in class Component

getNAMPacketEventPorts

public abstract Port[][] getNAMPacketEventPorts()
Returns the ports that output packets that are to be enqueued in and dequeued/dropped from the buffer. Returned is a 2-dimensional port array. The first dimension is outgoing interface. The second dimension consists of three ports: enqueue-event port, dequeue-event port, and drop-event port.


J-Sim v1.2.1-p7 API

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