Simple Module PPP

Package: inet.linklayer.ppp
File: src/inet/linklayer/ppp/PPP.ned

C++ definition

PPP implementation.

Packets are encapsulated in PPPFrame.

PPP is a complex protocol with strong support for link configuration and maintenance. This model ignores those details, and only performs simple encapsulation/decapsulation and queuing.

In routers, PPP relies on an external queue module (see IOutputQueue) to model finite buffer, implement QoS and/or RED, and requests packets from this external queue one-by-one.

In hosts, no such queue is used, so PPP contains an internal queue named txQueue to queue up packets waiting for transmission. Conceptually, txQueue is of infinite size, but for better diagnostics one can specify a hard limit in the txQueueLimit parameter -- if this is exceeded, the simulation stops with an error.

There is no buffering done on received packets -- they are just decapsulated and sent up immediately.

See also: PPPInterface, IOutputQueue, PPPFrame

PPP

Usage diagram:

The following diagram shows usage relationships between types. Unresolved types are missing from the diagram.

Inheritance diagram:

The following diagram shows inheritance relationships for this type. Unresolved types are missing from the diagram.

Used in compound modules:

Name Type Description
PPPInterface compound module

PPP interface. Complements the PPP module with an output queue for QoS and RED support.

Parameters:

Name Type Default value Description
interfaceTableModule string

The path to the InterfaceTable module

txQueueLimit int 1000

only used if queueModule==""; zero means infinite

queueModule string ""

path of external (QoS,RED,etc) queue module

mtu int 4470B

Properties:

Name Value Description
display i=block/rxtx

Gates:

Name Direction Size Description
netwIn input
netwOut output
phys inout

Signals:

Name Type Unit
rxPkOk PPPFrame
packetReceivedFromLower cPacket
packetReceivedFromUpper cPacket
NF_PP_RX_END TxNotifDetails
packetSentToLower PPPFrame
dropPkBitError cPacket
packetSentToUpper cPacket
txState long
dropPkIfaceDown cPacket
NF_PP_TX_END TxNotifDetails
NF_PP_TX_BEGIN TxNotifDetails

Statistics:

Name Title Source Record Unit Interpolation Mode
rcvdPkFromHL packets received from higher layer packetReceivedFromUpper count, sum(packetBytes), vector(packetBytes) none
passedUpPk packets passed to higher layer packetSentToUpper count, sum(packetBytes), vector(packetBytes) none
droppedPkBitError packets dropped/bit error dropPkBitError count, sum(packetBytes), vector(packetBytes) none
droppedPkIfaceDown packets dropped/interface down dropPkIfaceDown count, sum(packetBytes), vector(packetBytes) none
rxPkOk packets received OK rxPkOk count, sum(packetBytes), vector(packetBytes) none
txPk packets transmitted packetSentToLower count, sum(packetBytes), vector(packetBytes) none
txState tx state timeavg, vector sample-hold

Source code:

//
// PPP implementation.
//
// Packets are encapsulated in ~PPPFrame.
//
// PPP is a complex protocol with strong support for link configuration
// and maintenance. This model ignores those details, and only performs
// simple encapsulation/decapsulation and queuing.
//
// In routers, PPP relies on an external queue module (see ~IOutputQueue)
// to model finite buffer, implement QoS and/or RED, and requests packets
// from this external queue one-by-one.
//
// In hosts, no such queue is used, so PPP contains an internal
// queue named txQueue to queue up packets waiting for transmission.
// Conceptually, txQueue is of infinite size, but for better diagnostics
// one can specify a hard limit in the txQueueLimit parameter -- if this is
// exceeded, the simulation stops with an error.
//
// There is no buffering done on received packets -- they are just decapsulated
// and sent up immediately.
//
// @see ~PPPInterface, ~IOutputQueue, ~PPPFrame
//
simple PPP
{
    parameters:
        string interfaceTableModule;   // The path to the InterfaceTable module
        int txQueueLimit = default(1000);  // only used if queueModule==""; zero means infinite
        string queueModule = default("");  // path of external (QoS,RED,etc) queue module
        int mtu @unit("B") = default(4470B);
        @display("i=block/rxtx");

        @signal[txState](type=long);    // 1:transmit, 0:idle
        @signal[rxPkOk](type=PPPFrame);
        @signal[dropPkIfaceDown](type=cPacket);  //TODO currently both upper and lower; todo separate them
        @signal[dropPkBitError](type=cPacket);
        @signal[packetSentToLower](type=PPPFrame);
        @signal[packetReceivedFromLower](type=cPacket);
        @signal[packetSentToUpper](type=cPacket);
        @signal[packetReceivedFromUpper](type=cPacket);
        @signal[NF_PP_TX_BEGIN](type=TxNotifDetails);
        @signal[NF_PP_TX_END](type=TxNotifDetails);
        @signal[NF_PP_RX_END](type=TxNotifDetails);
        @statistic[txState](title="tx state"; record=timeavg,vector; interpolationmode=sample-hold);
        @statistic[txPk](title="packets transmitted"; source=packetSentToLower; record=count,"sum(packetBytes)","vector(packetBytes)"; interpolationmode=none);
        @statistic[rxPkOk](title="packets received OK"; source=rxPkOk; record=count,"sum(packetBytes)","vector(packetBytes)"; interpolationmode=none);
        @statistic[droppedPkBitError](title="packets dropped/bit error"; source=dropPkBitError; record=count,"sum(packetBytes)","vector(packetBytes)"; interpolationmode=none);
        @statistic[droppedPkIfaceDown](title="packets dropped/interface down"; source=dropPkIfaceDown; record=count,"sum(packetBytes)","vector(packetBytes)"; interpolationmode=none);
        @statistic[rcvdPkFromHL](title="packets received from higher layer"; source=packetReceivedFromUpper; record=count,"sum(packetBytes)","vector(packetBytes)"; interpolationmode=none);
        @statistic[passedUpPk](title="packets passed to higher layer"; source=packetSentToUpper; record=count,"sum(packetBytes)","vector(packetBytes)"; interpolationmode=none);

    gates:
        input netwIn;
        output netwOut;
        inout phys @labels(PPPFrame);
}