DRCL J-Sim API

drcl.inet.mac
Class Mac_802_11

java.lang.Object
  extended bydrcl.DrclObj
      extended bydrcl.comp.Component
          extended bydrcl.net.Module
              extended bydrcl.inet.mac.Mac_802_11
All Implemented Interfaces:
ActiveComponent, java.lang.Cloneable, ObjectCloneable, ObjectDuplicable, java.io.Serializable

public class Mac_802_11
extends Module
implements ActiveComponent

This class implements IEEE802.11 protocol. Part of this class is ported from ns-2.1b7a implementation.

Author:
Ye Ge
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class drcl.comp.Component
Component.Locks
 
Field Summary
static java.lang.String EVENT_LINK_BROKEN
          The event type of the link broken event.
static int MAC_ACK
          ACK sent
static int MAC_ATIM
          Inside ATIM window
static int MAC_BEACON
          Beacon transmitted
static long MAC_BROADCAST
          Broadcast mac address.
static int MAC_COLL
          Collision state
static int MAC_CTS
          CTS sent
static int MAC_IDLE
          Idle state
static int MAC_POLLING
          Polling state
static int MAC_RECV
          Recving state
static int MAC_RTS
          RTS sent
static int MAC_SEND
          Transmitting state
static java.lang.String[] MAC_STATE
          Broadcast mac address.
 boolean MAC_TRACE_ALL_ENABLED
          Flag to enable and disable tracing all events.
 boolean MAC_TRACE_CW_ENABLED
          Flag to enable and disable tracing changes of CW.
 boolean MAC_TRACE_EVENT_ENABLED
          Flag to enable and disable tracing certain special events.
 boolean MAC_TRACE_PACKET_ENABLED
          Flag to enable and disable tracing packet arriving and departal events.
 boolean MAC_TRACE_TIMER_ENABLED
          Flag to enable and disable tracing timer events.
static int MF_ACK
          Acknowledgement
static int MF_BEASON
          beaconing
static int MF_CF_END
          contention free period end
static int MF_CONTROL
          used as mask for control frame
static int MF_CTS
          Clear to send
static int MF_DATA
          Used as a mask for data frame
static int MF_DATA_ACK
          Ack for data frame
static int MF_POLL
          Polling
static int MF_RTS
          Request to send
static int MF_SLOTS
          Announce slot open for contension
static int PSM_PWR_AWAKE
          PSM enabled but not in power saving
static int PSM_PWR_SAVE
          PSM enabled and in power saving
 
Fields inherited from class drcl.net.Module
downPort, PortGroup_DOWN, PortGroup_UP, 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_GARBAGE_DISPLAY_ENABLED, FLAG_GARBAGE_ENABLED, 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
 
Constructor Summary
Mac_802_11()
           
 
Method Summary
 double bandwidth()
          Gets the channel bandwidth.
 void disable_MAC_TRACE_ALL()
          Turns off the MAC_TRACE_ALL_ENABLED flag.
 void disable_MAC_TRACE_CW()
          Turns off the MAC_TRACE_CW_ENABLED flag.
 void disable_MAC_TRACE_EVENT()
          Turns off the MAC_TRACE_EVENT_ENABLED flag.
 void disable_MAC_TRACE_PACKET()
          Turns off the MAC_TRACE_PACKET_ENABLED flag.
 void disable_MAC_TRACE_TIMER()
          Turns off the MAC_TRACE_TIMER_ENABLED flag.
 void disable_PSM()
          Disable PSM mode
 void enable_MAC_TRACE_ALL()
          Turns on the MAC_TRACE_ALL_ENABLED flag.
 void enable_MAC_TRACE_CW()
          Turns on the MAC_TRACE_CW_ENABLED flag.
 void enable_MAC_TRACE_EVENT()
          Turns on the MAC_TRACE_EVENT_ENABLED flag.
 void enable_MAC_TRACE_PACKET()
          Turns on the MAC_TRACE_PACKET_ENABLED flag.
 void enable_MAC_TRACE_TIMER()
          Turns on the MAC_TRACE_TIMER_ENABLED flag.
 void enable_PSM()
          Enable PSM mode and set psm_mode_ to PSM_PWR_SAVE
 long getMacAddress()
          Get the Mac address
 void set_MAC_PSM(boolean b_)
          Set PSM mode
 void set_MAC_TRACE_ALL_ENABLED(boolean b_)
          Sets the MAC_TRACE_ALL_ENABLED flag.
 void set_MAC_TRACE_CW_ENABLED(boolean b_)
          Sets the MAC_TRACE_CW_ENABLED flag.
 void set_MAC_TRACE_EVENT_ENABLED(boolean b_)
          Sets the MAC_TRACE_EVENT_ENABLED flag.
 void set_MAC_TRACE_PACKET_ENABLED(boolean b_)
          Sets the MAC_TRACE_PACKET_ENABLED flag.
 void set_MAC_TRACE_TIMER_ENABLED(boolean b_)
          Sets the MAC_TRACE_TIMER_ENABLED flag.
 void setATIMWindow(double atim_)
          Set the size of ATIM window
 void setBandwidth(double bw_)
          Sets the channel bandwidth and calculates all related variables.
 void setBeaconInterval(double beacon_)
          Set the length of beacon interval
 void setMacAddress(long addr_)
          Set the MAC address
 void setMalicious(boolean b_)
          Sets the is_malicious flag.
 void setRTSThreshold(int rstthreshold_)
          Set the RTS threshold (size of packet to transmit RTS)
 void setSeed(long seed)
          Set the random number generator seed.
 
Methods inherited from class drcl.net.Module
cancelTimeout, duplicate, setTimeout, setTimeoutAt
 
Methods inherited from class drcl.comp.Component
addComponent, addComponent, addEventPort, addEventPort, addForkPort, addPort, addPort, addPort, addPort, addPort, addPort, addPort, addPort, addServerPort, addServerPort, cancelFork, connect, containsComponent, containsComponent, containsPort, debug, disconnectAll, disconnectAllPeers, disconnectAllPorts, drop, drop, error, error, expose, exposeEventPorts, exposePort, exposePort, exposePort, exposePort, exposePort, findAvailable, findAvailable, findAvailable, fork, forkAt, getAllComponents, getAllPorts, getAllPorts, getAllWiresInside, getAllWiresInsideOut, getAllWiresOut, getComponent, getComponentFlag, getComponentFlag, getContract, getContractHT, getContractHT, getDebugFlagsInBinary, getDebugLevelNames, getID, getName, getParent, getPort, getPort, getRoot, getTime, iduplicate, info, isAncestorOf, isContainer, isDebugEnabled, isDebugEnabledAt, isDirectlyRelatedTo, isDirectOutputEnabled, isEnabled, isErrorNoticeEnabled, isEventExportEnabled, isGarbageDisplayEnabled, isGarbageEnabled, isPortRemovable, isStarted, isStopped, isTraceEnabled, lock, notify, notifyAll, operate, reboot, removeAll, removeAllComponents, removeAllPorts, removeAllPorts, removeComponent, removeComponent, removePort, removePort, removePort, reset, resume, run, sduplicate, send, sendAt, setComponentFlag, setComponentFlag, setDebugEnabled, setDebugEnabled, setDebugEnabledAt, setDebugEnabledAt, setDebugEnabledAt, setDirectOutputEnabled, setDirectOutputEnabled, setEnabled, setErrorNoticeEnabled, setErrorNoticeEnabled, setEventExportEnabled, setEventExportEnabled, setExecutionBoundary, setGarbageDisplayEnabled, setGarbageDisplayEnabled, setGarbageEnabled, setGarbageEnabled, setID, setID, setName, setPort, setPort, setTraceEnabled, setTraceEnabled, sleepFor, sleepUntil, stop, toString, unexpose, unlock, useLocalForkManager, useLocalForkManager, wait
 
Methods inherited from class drcl.DrclObj
clone
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

MAC_TRACE_ALL_ENABLED

public boolean MAC_TRACE_ALL_ENABLED
Flag to enable and disable tracing all events.


MAC_TRACE_PACKET_ENABLED

public boolean MAC_TRACE_PACKET_ENABLED
Flag to enable and disable tracing packet arriving and departal events.


MAC_TRACE_CW_ENABLED

public boolean MAC_TRACE_CW_ENABLED
Flag to enable and disable tracing changes of CW.


MAC_TRACE_EVENT_ENABLED

public boolean MAC_TRACE_EVENT_ENABLED
Flag to enable and disable tracing certain special events.


MAC_TRACE_TIMER_ENABLED

public boolean MAC_TRACE_TIMER_ENABLED
Flag to enable and disable tracing timer events.


EVENT_LINK_BROKEN

public static final java.lang.String EVENT_LINK_BROKEN
The event type of the link broken event.

See Also:
Constant Field Values

MAC_BROADCAST

public static final long MAC_BROADCAST
Broadcast mac address.

See Also:
Constant Field Values

MAC_STATE

public static final java.lang.String[] MAC_STATE
Broadcast mac address. Used in LL_Demo.


MAC_IDLE

public static final int MAC_IDLE
Idle state

See Also:
Constant Field Values

MAC_POLLING

public static final int MAC_POLLING
Polling state

See Also:
Constant Field Values

MAC_RECV

public static final int MAC_RECV
Recving state

See Also:
Constant Field Values

MAC_SEND

public static final int MAC_SEND
Transmitting state

See Also:
Constant Field Values

MAC_RTS

public static final int MAC_RTS
RTS sent

See Also:
Constant Field Values

MAC_CTS

public static final int MAC_CTS
CTS sent

See Also:
Constant Field Values

MAC_ACK

public static final int MAC_ACK
ACK sent

See Also:
Constant Field Values

MAC_COLL

public static final int MAC_COLL
Collision state

See Also:
Constant Field Values

MAC_BEACON

public static final int MAC_BEACON
Beacon transmitted

See Also:
Constant Field Values

MAC_ATIM

public static final int MAC_ATIM
Inside ATIM window

See Also:
Constant Field Values

MF_BEASON

public static final int MF_BEASON
beaconing

See Also:
Constant Field Values

MF_CONTROL

public static final int MF_CONTROL
used as mask for control frame

See Also:
Constant Field Values

MF_SLOTS

public static final int MF_SLOTS
Announce slot open for contension

See Also:
Constant Field Values

MF_RTS

public static final int MF_RTS
Request to send

See Also:
Constant Field Values

MF_CTS

public static final int MF_CTS
Clear to send

See Also:
Constant Field Values

MF_ACK

public static final int MF_ACK
Acknowledgement

See Also:
Constant Field Values

MF_CF_END

public static final int MF_CF_END
contention free period end

See Also:
Constant Field Values

MF_POLL

public static final int MF_POLL
Polling

See Also:
Constant Field Values

MF_DATA

public static final int MF_DATA
Used as a mask for data frame

See Also:
Constant Field Values

MF_DATA_ACK

public static final int MF_DATA_ACK
Ack for data frame

See Also:
Constant Field Values

PSM_PWR_SAVE

public static final int PSM_PWR_SAVE
PSM enabled and in power saving

See Also:
Constant Field Values

PSM_PWR_AWAKE

public static final int PSM_PWR_AWAKE
PSM enabled but not in power saving

See Also:
Constant Field Values
Constructor Detail

Mac_802_11

public Mac_802_11()
Method Detail

set_MAC_TRACE_ALL_ENABLED

public void set_MAC_TRACE_ALL_ENABLED(boolean b_)
Sets the MAC_TRACE_ALL_ENABLED flag.


set_MAC_TRACE_PACKET_ENABLED

public void set_MAC_TRACE_PACKET_ENABLED(boolean b_)
Sets the MAC_TRACE_PACKET_ENABLED flag.


set_MAC_TRACE_CW_ENABLED

public void set_MAC_TRACE_CW_ENABLED(boolean b_)
Sets the MAC_TRACE_CW_ENABLED flag.


set_MAC_TRACE_EVENT_ENABLED

public void set_MAC_TRACE_EVENT_ENABLED(boolean b_)
Sets the MAC_TRACE_EVENT_ENABLED flag.


set_MAC_TRACE_TIMER_ENABLED

public void set_MAC_TRACE_TIMER_ENABLED(boolean b_)
Sets the MAC_TRACE_TIMER_ENABLED flag.


set_MAC_PSM

public void set_MAC_PSM(boolean b_)
Set PSM mode


enable_PSM

public void enable_PSM()
Enable PSM mode and set psm_mode_ to PSM_PWR_SAVE


disable_PSM

public void disable_PSM()
Disable PSM mode


setMalicious

public void setMalicious(boolean b_)
Sets the is_malicious flag.


enable_MAC_TRACE_ALL

public void enable_MAC_TRACE_ALL()
Turns on the MAC_TRACE_ALL_ENABLED flag.


enable_MAC_TRACE_PACKET

public void enable_MAC_TRACE_PACKET()
Turns on the MAC_TRACE_PACKET_ENABLED flag.


enable_MAC_TRACE_CW

public void enable_MAC_TRACE_CW()
Turns on the MAC_TRACE_CW_ENABLED flag.


enable_MAC_TRACE_EVENT

public void enable_MAC_TRACE_EVENT()
Turns on the MAC_TRACE_EVENT_ENABLED flag.


enable_MAC_TRACE_TIMER

public void enable_MAC_TRACE_TIMER()
Turns on the MAC_TRACE_TIMER_ENABLED flag.


disable_MAC_TRACE_ALL

public void disable_MAC_TRACE_ALL()
Turns off the MAC_TRACE_ALL_ENABLED flag.


disable_MAC_TRACE_PACKET

public void disable_MAC_TRACE_PACKET()
Turns off the MAC_TRACE_PACKET_ENABLED flag.


disable_MAC_TRACE_CW

public void disable_MAC_TRACE_CW()
Turns off the MAC_TRACE_CW_ENABLED flag.


disable_MAC_TRACE_EVENT

public void disable_MAC_TRACE_EVENT()
Turns off the MAC_TRACE_EVENT_ENABLED flag.


disable_MAC_TRACE_TIMER

public void disable_MAC_TRACE_TIMER()
Turns off the MAC_TRACE_TIMER_ENABLED flag.


setRTSThreshold

public void setRTSThreshold(int rstthreshold_)
Set the RTS threshold (size of packet to transmit RTS)


setBeaconInterval

public void setBeaconInterval(double beacon_)
Set the length of beacon interval


setATIMWindow

public void setATIMWindow(double atim_)
Set the size of ATIM window


setBandwidth

public void setBandwidth(double bw_)
Sets the channel bandwidth and calculates all related variables.

Parameters:
bw_ - channel bandwidth (bps)

bandwidth

public double bandwidth()
Gets the channel bandwidth.


setMacAddress

public void setMacAddress(long addr_)
Set the MAC address

Parameters:
addr_ - the MAC address

getMacAddress

public long getMacAddress()
Get the Mac address


setSeed

public void setSeed(long seed)
Set the random number generator seed. This method is used in simulation setup script files.


DRCL J-Sim API

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