Package: inet.linklayer.ppp
Ppp
simple modulePPP 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 IPacketQueue) 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 to store packets waiting for transmission. Conceptually, the queue is of infinite size, but for better diagnostics one can specify a hard limit in the packetCapacity 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
Used in compound modules
| Name | Type | Description |
|---|---|---|
| PppInterface | compound module |
This module implements a PPP network interface. |
Parameters
| Name | Type | Default value | Description |
|---|---|---|---|
| interfaceTableModule | string |
The path to the InterfaceTable module |
|
| displayStringTextFormat | string | "rate: %b\nsent: %s, rcvd: %r\nqueue: %q, drop: %d" | |
| sendRawBytes | bool | false |
when true packets are serialized into a sequence of bytes before sending out |
| mtu | int | 4470B | |
| stopOperationExtraTime | double | -1s |
extra time after lifecycle stop operation finished |
| stopOperationTimeout | double | 2s |
timeout value for lifecycle stop operation |
Properties
| Name | Value | Description |
|---|---|---|
| lifecycleSupport | ||
| class | Ppp | |
| display | i=block/rxtx |
Gates
| Name | Direction | Size | Description |
|---|---|---|---|
| upperLayerIn | input | ||
| upperLayerOut | output | ||
| phys | inout |
Signals
| Name | Type | Unit |
|---|---|---|
| rxPkOk | inet::Packet | |
| packetReceivedFromLower | cPacket | |
| packetReceivedFromUpper | cPacket | |
| packetDropped | inet::Packet | |
| packetSentToLower | inet::Packet | |
| packetSentToUpper | cPacket | |
| transmissionStateChanged | long |
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 | |
| packetDropInterfaceDown | packet drop: interface down | packetDropReasonIsInterfaceDown(packetDropped) | 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 | |
| transmissionState | tx state | transmissionStateChanged | timeavg, vector | sample-hold | |
| packetDropIncorrectlyReceived | packet drop: incorrectly received | packetDropReasonIsIncorrectlyReceived(packetDropped) | count, sum(packetBytes), vector(packetBytes) | none |
Scheduled messages (observed)
| msg | kind | ctrl | tags | msgname | context |
|---|---|---|---|---|---|
| omnetpp::cMessage | 0 | pppEndTxEvent |
Direct method calls (observed)
| call to | function | info |
|---|---|---|
| MessageDispatcher | inet::MessageDispatcher::arrived | arrived |
| PcapRecorder | inet::PcapRecorder::receiveSignal | packetReceivedFromLower |
| PcapRecorder | inet::PcapRecorder::receiveSignal | packetSentToLower |
| inet.examples.diffserv.onedomain.DSQueue1 | inet::queueing::CompoundPacketQueueBase::pullPacket | pullPacket |
| inet.examples.diffserv.onedomain.DSQueue2 | inet::queueing::CompoundPacketQueueBase::pullPacket | pullPacket |
| inet.examples.inet.netperfmeter.REDQueue | inet::queueing::CompoundPacketQueueBase::pullPacket | pullPacket |
| Ppp | inet::Ppp::receiveSignal | POST_MODEL_CHANGE |
| Ppp | inet::Ppp::receiveSignal | PRE_MODEL_CHANGE |
| Ppp | inet::Ppp::refreshOutGateConnection | refreshOutGateConnection |
| InterfaceTable | inet::InterfaceTable::interfaceChanged | interfaceChanged |
| DiffservQueue | inet::queueing::CompoundPacketQueueBase::pullPacket | pullPacket |
| DropTailQueue | inet::queueing::PacketQueue::pullPacket | pullPacket |
Called methods (observed)
| function | info | call from |
|---|---|---|
| inet::Ppp::handleCanPullPacketChanged | handleCanPullPacketChanged | DropTailQueue, PacketQueue, PriorityScheduler, WrrScheduler |
| inet::Ppp::handleOperationStage | handleOperationStage | ScenarioManager |
| inet::Ppp::receiveSignal | POST_MODEL_CHANGE | -=Network=-, ScenarioManager, Ppp |
| inet::Ppp::receiveSignal | PRE_MODEL_CHANGE | -=Network=-, ScenarioManager, Ppp |
| inet::Ppp::refreshOutGateConnection | refreshOutGateConnection | Ppp |
Incoming messages (observed)
| gate | msg | kind | ctrl | srcModule | tags |
|---|---|---|---|---|---|
| phys$i | Packet | 0 | Ppp | PacketProtocolTag |
Outgoing messages (observed)
| gate | msg | kind | ctrl | destModule | tags |
|---|---|---|---|---|---|
| phys$o | Packet | 0 | Ppp | PacketProtocolTag | |
| upperLayerOut | Packet | 0 | Ipv4 | DispatchProtocolReq, InterfaceInd, PacketProtocolTag | |
| upperLayerOut | Packet | 0 | Ipv6 | DispatchProtocolReq, InterfaceInd, PacketProtocolTag | |
| upperLayerOut | Packet | 0 | Mpls | DispatchProtocolReq, InterfaceInd, PacketProtocolTag |
Pull in messages (observed)
| gate | msg | kind | ctrl | srcModule | tags |
|---|---|---|---|---|---|
| upperLayerIn | Packet | 0 | DropTailQueue | InterfaceReq, PacketProtocolTag, DirectionTag?, DispatchProtocolInd?, DscpInd?, EcnInd?, HopLimitInd?, InterfaceInd?, L3AddressInd?, MacAddressInd?, MacAddressReq?, MulticastReq?, NetworkProtocolInd?, SocketReq?, TosInd?, TransportProtocolInd? | |
| upperLayerIn | Packet | 0 | PacketQueue | DispatchProtocolInd, InterfaceInd, InterfaceReq, NetworkProtocolInd, PacketProtocolTag | |
| upperLayerIn | Packet | 0 | PriorityScheduler | DispatchProtocolInd, InterfaceInd, InterfaceReq, NetworkProtocolInd, PacketProtocolTag, MacAddressInd? | |
| upperLayerIn | Packet | 0 | WrrScheduler | DispatchProtocolInd, InterfaceInd, InterfaceReq, NetworkProtocolInd, PacketProtocolTag, MacAddressInd? |
Packet operations (observed)
| chunkType | packetAction |
|---|---|
| PppHeader | insertAtFront, peekAtFront, popAtFront |
| PppTrailer | insertAtBack, peekAtBack, popAtBack |
Shared Tagging operations (observed)
| tagType | tagAction |
|---|---|
| clearTags | |
| DispatchProtocolReq | addTagIfAbsent |
| InterfaceInd | addTagIfAbsent |
| PacketProtocolTag | addTag, addTagIfAbsent, getTag, removeTag |
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 ~IPacketQueue) // 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 to store packets waiting for transmission. // Conceptually, the queue is of infinite size, but for better diagnostics // one can specify a hard limit in the packetCapacity 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 // simple Ppp { parameters: string interfaceTableModule; // The path to the InterfaceTable module string displayStringTextFormat = default("rate: %b\nsent: %s, rcvd: %r\nqueue: %q, drop: %d"); bool sendRawBytes = default(false); // when true packets are serialized into a sequence of bytes before sending out int mtu @unit(B) = default(4470B); @lifecycleSupport; double stopOperationExtraTime @unit(s) = default(-1s); // extra time after lifecycle stop operation finished double stopOperationTimeout @unit(s) = default(2s); // timeout value for lifecycle stop operation @class(Ppp); @display("i=block/rxtx"); @signal[transmissionStateChanged](type=long); // 1:transmit, 0:idle @signal[rxPkOk](type=inet::Packet); @signal[packetDropped](type=inet::Packet); @signal[packetSentToLower](type=inet::Packet); @signal[packetReceivedFromLower](type=cPacket); @signal[packetSentToUpper](type=cPacket); @signal[packetReceivedFromUpper](type=cPacket); @statistic[transmissionState](title="tx state"; source=transmissionStateChanged; 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[packetDropIncorrectlyReceived](title="packet drop: incorrectly received"; source=packetDropReasonIsIncorrectlyReceived(packetDropped); record=count,sum(packetBytes),vector(packetBytes); interpolationmode=none); @statistic[packetDropInterfaceDown](title="packet drop: interface down"; source=packetDropReasonIsInterfaceDown(packetDropped); 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 upperLayerIn; output upperLayerOut; inout phys @labels(PppFrame); }File: src/inet/linklayer/ppp/Ppp.ned