Package: inet.linklayer.ieee8021as
Gptp
simple moduleThis module implements the IEEE 802.1as protocol also known as gPTP. It measures link delays to neighboring gPTP network nodes periodically. The slave and master ports specify where are the connected gPTP network nodes and their roles in the time synchronization domain. The time synchronization is done periodically and the clock module is set.
Inheritance diagram
The following diagram shows inheritance relationships for this type. Unresolved types are missing from the diagram.
Parameters
Name | Type | Default value | Description |
---|---|---|---|
clockModule | string | "" |
relative path of a module that implements IClock; optional |
interfaceTableModule | string |
relative path of the interface table module |
|
gptpNodeType | string |
@enum("GptpNodeType"): MASTER_NODE, BRIDGE_NODE, SLAVE_NODE |
|
domainNumber | int | 0 |
specifies the time domain number used in gPTP messages |
slavePort | string | "" |
port for receiving time (empty for MASTER_NODE) |
masterPorts | object | [] |
ports for sending out time (empty for SLAVE_NODE) |
correctionField | double | 0s |
time correction for link delay measurements |
syncInterval | double | 0.125s |
time interval between SYNC messages |
pdelayInterval | double | 1s |
frequency of link delay measurements |
syncInitialOffset | double | syncInterval |
time of first SYNC message |
pdelayInitialOffset | double | 0s |
time of first link delay measurement |
pDelayReqProcessingTime | double | 8us |
following parameters are used to schedule follow_up and pdelay_resp messages. These numbers must be enough large to prevent creating queue in MAC layer. It means it should be large than transmission time of message sent before |
followUpInterval | double | 7us |
Properties
Name | Value | Description |
---|---|---|
display | i=block/timer | |
selfMessageKinds | inet::GptpSelfMsgKind |
Gates
Name | Direction | Size | Description |
---|---|---|---|
socketIn | input | ||
socketOut | output |
Signals
Name | Type | Unit |
---|---|---|
localTime | simtime_t | |
rateRatio | double | |
peerDelay | simtime_t | |
timeDifference | simtime_t |
Statistics
Name | Title | Source | Record | Unit | Interpolation Mode |
---|---|---|---|---|---|
localTime | vector | linear | |||
rateRatio | vector | samplehold | |||
peerDelay | vector | samplehold | |||
timeDifference | vector | linear |
Scheduled messages (observed)
msg | kind | ctrl | tags | msgname | context |
---|---|---|---|---|---|
ClockEvent | 103 (GptpSelfMsgKind::GPTP_SELF_MSG_SYNC) | selfMsgSync | |||
ClockEvent | 105 (GptpSelfMsgKind::GPTP_SELF_MSG_PDELAY_REQ) | selfMsgPdelay | |||
GptpReqAnswerEvent | 101 (GptpSelfMsgKind::GPTP_SELF_REQ_ANSWER_KIND) | selfMsgPdelayResp |
Direct method calls (observed)
call to | function | info |
---|---|---|
SettableClock | inet::SettableClock::setClockTime | setClockTime |
MessageDispatcher | inet::MessageDispatcher::arrived | arrived |
MessageDispatcher | inet::MessageDispatcher::handleRegisterProtocol | handleRegisterProtocol |
InterfaceTable | inet::InterfaceTable::findInterfaceByName | findInterfaceByName |
Called methods (observed)
function | info | call from |
---|---|---|
inet::Gptp::receiveSignal | receptionEnded | PacketReceiver |
inet::Gptp::receiveSignal | transmissionEnded | PacketTransmitter |
Incoming messages (observed)
Outgoing messages (observed)
gate | msg | kind | ctrl | destModule | tags |
---|---|---|---|---|---|
socketOut | Packet | 0 | EthernetMacHeaderInserter | DispatchProtocolInd, DispatchProtocolReq, InterfaceReq, MacAddressReq, PacketProtocolTag | |
socketOut | Packet | 0 | Ieee8021dRelay | DispatchProtocolInd, DispatchProtocolReq, InterfaceReq, MacAddressReq, PacketProtocolTag | |
socketOut | Packet | 0 | PacketMultiplexer | DispatchProtocolInd, DispatchProtocolReq, InterfaceReq, MacAddressReq, PacketProtocolTag |
Packet operations (observed)
chunkType | packetAction |
---|---|
EthernetMacHeader | peekAt |
GptpBase | peekAt, peekAtFront |
GptpFollowUp | insertAtFront |
GptpPdelayReq | insertAtFront |
GptpPdelayResp | insertAtFront |
GptpPdelayRespFollowUp | insertAtFront |
GptpSync | insertAtFront |
EthernetPhyHeader | peekAtFront |
Shared Tagging operations (observed)
tagType | tagAction |
---|---|
DispatchProtocolInd | addTag |
DispatchProtocolReq | addTagIfAbsent |
GptpIngressTimeInd | addTagIfAbsent, getTag |
InterfaceInd | getTag |
InterfaceReq | addTag |
MacAddressReq | addTag |
PacketProtocolTag | addTag, getTag |
Source code
// // This module implements the IEEE 802.1as protocol also known as gPTP. It // measures link delays to neighboring gPTP network nodes periodically. The // slave and master ports specify where are the connected gPTP network nodes // and their roles in the time synchronization domain. The time synchronization // is done periodically and the clock module is set. // simple Gptp like IApp { parameters: string clockModule = default(""); // relative path of a module that implements IClock; optional string interfaceTableModule; // relative path of the interface table module string gptpNodeType; // @enum("GptpNodeType"): MASTER_NODE, BRIDGE_NODE, SLAVE_NODE int domainNumber = default(0); // specifies the time domain number used in gPTP messages string slavePort = default(""); // port for receiving time (empty for MASTER_NODE) object masterPorts = default([]); // ports for sending out time (empty for SLAVE_NODE) double correctionField @unit(s) = default(0s); // time correction for link delay measurements double syncInterval @unit(s) = default(0.125s); // time interval between SYNC messages double pdelayInterval @unit(s) = default(1s); // frequency of link delay measurements double syncInitialOffset @unit(s) = default(syncInterval); // time of first SYNC message double pdelayInitialOffset @unit(s) = default(0s); // time of first link delay measurement // following parameters are used to schedule follow_up and pdelay_resp messages. // These numbers must be enough large to prevent creating queue in MAC layer. // It means it should be large than transmission time of message sent before double pDelayReqProcessingTime @unit(s) = default(8us); // processing time between arrived PDelayReq and send of PDelayResp double followUpInterval @unit(s) = default(7us); @display("i=block/timer"); @signal[localTime](type=simtime_t); // as clocktime_t @signal[timeDifference](type=simtime_t); @signal[rateRatio](type=double); @signal[peerDelay](type=simtime_t); @statistic[localTime](record=vector; interpolationmode=linear); @statistic[timeDifference](record=vector; interpolationmode=linear); @statistic[rateRatio](record=vector; interpolationmode=samplehold); @statistic[peerDelay](record=vector; interpolationmode=samplehold); @selfMessageKinds(inet::GptpSelfMsgKind); gates: input socketIn; output socketOut; }File: src/inet/linklayer/ieee8021as/Gptp.ned