Class PHY

  • All Implemented Interfaces:
    java.lang.Cloneable, Actor, Executable, FiringsRecordable, Initializable, TypedActor, Changeable, Debuggable, DebugListener, Derivable, Instantiable, ModelErrorHandler, MoMLExportable, Moveable, Nameable

    public class PHY
    extends NetworkActorBase
    The PHY class implements a physical layer which does the following: 1) collision detection; 2) carrier sense; 3) send TxStartConfirm to the MAC when TxStart is received; send TxEnd to the MAC when transmission is completed; send RxStart to the MAC when reception starts; send RxData and RxEnd to the MAC when reception ends. Things that can be added: 1) not send channel status in the transmit state; 2) The first received signal is above the sensitivity, so the PHY decides to receive it. If the second signal is much stronger, the PHY can abort the reception of the 1st one and receive the 2nd one instead.
    Since:
    Ptolemy II 4.0
    Version:
    $Id$
    Author:
    Charlie Zhong
    Pt.AcceptedRating:
    Red (reviewmoderator)
    Pt.ProposedRating:
    Red (czhong)
    • Field Detail

      • aPreambleLength

        public Parameter aPreambleLength
        The size of the Preamble header in a frame. The Preamble header contains synchronization information and timing information for the frame.
      • aPlcpHeaderLength

        public Parameter aPlcpHeaderLength
        The size of the PLCP header in a frame. The PLCP header contains logical information for the physical layer to decode the frame.
      • SNRThresholdInDB

        public Parameter SNRThresholdInDB
        The threshold for the signal to be recognized from interference. It is specified in decibels (10 * log10(r), where r is the power ratio. This is a double that defaults to Infinity, which indicates that all overlapping messages are lost to collisions.
      • sensitivity

        public Parameter sensitivity
        The power threshold above which the signal can be detected at the receiver. Any message with a received power below this number is ignored. This has type double and defaults to 0.0, which indicates that all messages (with nonzero power) will be received.
      • fromMAC

        public TypedIOPort fromMAC
        Port receiving messages from the MAC
      • fromChannel

        public TypedIOPort fromChannel
        Port receiving messages from the channel
      • toMAC

        public TypedIOPort toMAC
        Port sending messages to the MAC
      • channelStatus

        public TypedIOPort channelStatus
        Port sending channel status to the MAC
      • PHYConfirm

        public TypedIOPort PHYConfirm
        Port sending transmit confirmation to the MAC
      • toChannel

        public TypedIOPort toChannel
        Port sending messages to the channel
      • _aPreambleLength

        protected int _aPreambleLength
      • _aPlcpHeaderLength

        protected int _aPlcpHeaderLength
      • _sensitivity

        protected double _sensitivity
      • _SNRThresholdInDB

        protected double _SNRThresholdInDB
      • RxStartMsgFields

        protected static final java.lang.String[] RxStartMsgFields
      • RxEndMsgFields

        protected static final java.lang.String[] RxEndMsgFields
      • RxDataMsgFields

        protected static final java.lang.String[] RxDataMsgFields
      • SignalMsgFields

        protected static final java.lang.String[] SignalMsgFields
      • ChMsgFields

        protected static final java.lang.String[] ChMsgFields
      • _duration

        protected Variable _duration
    • Constructor Detail

      • PHY

        public PHY​(CompositeEntity container,
                   java.lang.String name)
            throws IllegalActionException,
                   NameDuplicationException
        Construct an actor with the specified name and container. The container argument must not be null, or a NullPointerException will be thrown. If the name argument is null, then the name is set to the empty string. This constructor write-synchronizes on the workspace.
        Parameters:
        container - The container.
        name - The name of the actor.
        Throws:
        IllegalActionException - If the container is incompatible with this actor.
        NameDuplicationException - If the name coincides with an actor already in the container.