Simulation of the IEEE 1588 Precision Time Protocol in OMNeT++ - - PowerPoint PPT Presentation

simulation of the ieee 1588 precision time protocol in
SMART_READER_LITE
LIVE PREVIEW

Simulation of the IEEE 1588 Precision Time Protocol in OMNeT++ - - PowerPoint PPT Presentation

Simulation of the IEEE 1588 Precision Time Protocol in OMNeT++ Wolfgang Wallner wolfgang-wallner@gmx.at September 15, 2016 Presentation Outline Introduction Motivation Problem statement Presentation Outline Introduction Motivation


slide-1
SLIDE 1

Simulation of the IEEE 1588 Precision Time Protocol in OMNeT++

Wolfgang Wallner wolfgang-wallner@gmx.at September 15, 2016

slide-2
SLIDE 2

Presentation Outline

Introduction Motivation Problem statement

slide-3
SLIDE 3

Presentation Outline

Introduction Motivation Problem statement Basic concepts Clock Model Precision Time Protocol

slide-4
SLIDE 4

Presentation Outline

Introduction Motivation Problem statement Basic concepts Clock Model Precision Time Protocol Implementation Clock Model for OMNeT++ PTP in OMNeT++

slide-5
SLIDE 5

Presentation Outline

Introduction Motivation Problem statement Basic concepts Clock Model Precision Time Protocol Implementation Clock Model for OMNeT++ PTP in OMNeT++ Conclusion

slide-6
SLIDE 6

Presentation Outline

Introduction Motivation Problem statement Basic concepts Clock Model Precision Time Protocol Implementation Clock Model for OMNeT++ PTP in OMNeT++ Conclusion

slide-7
SLIDE 7

Motivation

Motivation:

◮ Distributed real-time systems need a global time base

slide-8
SLIDE 8

Motivation

Motivation:

◮ Distributed real-time systems need a global time base ◮ Requirements depend on the application

◮ Precision ◮ Cost ◮ Fault tolerance ◮ ...

slide-9
SLIDE 9

Motivation

Motivation:

◮ Distributed real-time systems need a global time base ◮ Requirements depend on the application

◮ Precision ◮ Cost ◮ Fault tolerance ◮ ...

◮ IEEE 1588 specifies the Precision Time Protocol (PTP)

slide-10
SLIDE 10

Motivation

◮ PTP provides a large feature set

◮ Design space exploration is challenging

slide-11
SLIDE 11

Motivation

◮ PTP provides a large feature set

◮ Design space exploration is challenging

◮ Experimenting with real hardware is expensive

◮ Prohibitive for experiments with larger networks

slide-12
SLIDE 12

Motivation

◮ PTP provides a large feature set

◮ Design space exploration is challenging

◮ Experimenting with real hardware is expensive

◮ Prohibitive for experiments with larger networks

⇒ Use simulation to avoid costs and provide flexibility

slide-13
SLIDE 13

Presentation Outline

Introduction Motivation Problem statement Basic concepts Clock Model Precision Time Protocol Implementation Clock Model for OMNeT++ PTP in OMNeT++ Conclusion

slide-14
SLIDE 14

Problem statement

◮ Simulation goal

Provide a tool for PTP design space exploration

slide-15
SLIDE 15

Problem statement

◮ Simulation goal

Provide a tool for PTP design space exploration

◮ Requirements:

◮ simple ◮ efficient ◮ realistic

slide-16
SLIDE 16

Problem statement

Simulation components:

slide-17
SLIDE 17

Problem statement

Simulation components:

slide-18
SLIDE 18

Problem statement

Simulation components:

slide-19
SLIDE 19

Problem statement

Simulation components:

slide-20
SLIDE 20

Simulation Components: Network

Network components

◮ Prior work suggets usage of

OMNeT++

◮ INET library provides common

network components

slide-21
SLIDE 21

Simulation Components: Clocks

Clocks Various noise sources:

◮ Random noise ◮ Deterministic influences

◮ Environment, Aging, Drift, ...

slide-22
SLIDE 22

Simulation Components: Clocks

Clocks Various noise sources:

◮ Random noise ◮ Deterministic influences

◮ Environment, Aging, Drift, ...

slide-23
SLIDE 23

Simulation Components: PTP

PTP Components

◮ PTP Hardware

◮ Timestamping NICs, ...

◮ Software Components

◮ PTP Stack ◮ Clock Servo

slide-24
SLIDE 24

Problem statement: Summary

Problem Statement (revised)

◮ Implement PTP in OMNeT++ ◮ Provide realistic clock noise

slide-25
SLIDE 25

Presentation Outline

Introduction Motivation Problem statement Basic concepts Clock Model Precision Time Protocol Implementation Clock Model for OMNeT++ PTP in OMNeT++ Conclusion

slide-26
SLIDE 26

Clock model I

The model of a digital clock consists of two parts:

◮ Oscillator ◮ Counter ◮ Both parts may suffer from noise

slide-27
SLIDE 27

Clock model II

Modified clock model:

◮ Oscillator and counter are perfect ◮ Additional components:

◮ Noise generator ◮ Correction stage

slide-28
SLIDE 28

Basic definitions

Frequency Stability Analysis Discipline of judging clock stability Important attribute: Time Deviation (TD) Instantaneous time departure from a nominal time

→ How wrong is this clock (now)?

slide-29
SLIDE 29

Visualization of Time Deviation

slide-30
SLIDE 30

Combined Powerlaw Noise

Figure: Combination of different PLNs

slide-31
SLIDE 31

Presentation Outline

Introduction Motivation Problem statement Basic concepts Clock Model Precision Time Protocol Implementation Clock Model for OMNeT++ PTP in OMNeT++ Conclusion

slide-32
SLIDE 32

PTP - Intro

Precision Time Protocol

◮ Network based clock synchronization ◮ Compromise between cost and precision

slide-33
SLIDE 33

PTP - Concepts

PTP Concepts

◮ Network nodes are called

clocks

slide-34
SLIDE 34

PTP - Concepts

PTP Concepts

◮ Network nodes are called

clocks

◮ Clocks have ports

slide-35
SLIDE 35

PTP - Concepts

PTP Concepts

◮ Network nodes are called

clocks

◮ Clocks have ports ◮ Ports have states

slide-36
SLIDE 36

PTP - Concepts

PTP Concepts

◮ Network nodes are called

clocks

◮ Clocks have ports ◮ Ports have states ◮ Ports communitate via

messages

slide-37
SLIDE 37

PTP - Concepts

PTP Concepts

◮ Network nodes are called

clocks

◮ Clocks have ports ◮ Ports have states ◮ Ports communitate via

messages

◮ Nodes can

◮ timestamp messages ◮ scale their local clock

slide-38
SLIDE 38

PTP - Services

PTP Services

◮ Clock hierarchy ◮ Offset estimation ◮ Configuration

slide-39
SLIDE 39

PTP - Services

PTP Services

◮ Clock hierarchy

◮ Best Master Clock algorithm ◮ Root is called grand master

◮ Offset estimation ◮ Configuration

slide-40
SLIDE 40

PTP - Services

PTP Services

◮ Clock hierarchy

◮ Best Master Clock algorithm ◮ Root is called grand master

◮ Offset estimation

◮ Timestamp broadcast ◮ Path Delay measurement

◮ Configuration

slide-41
SLIDE 41

PTP - Services

PTP Services

◮ Clock hierarchy

◮ Best Master Clock algorithm ◮ Root is called grand master

◮ Offset estimation

◮ Timestamp broadcast ◮ Path Delay measurement

◮ Configuration

slide-42
SLIDE 42

PTP - Services

PTP Services

◮ Clock hierarchy

◮ Best Master Clock algorithm ◮ Root is called grand master

◮ Offset estimation

◮ Timestamp broadcast ◮ Path Delay measurement

◮ Configuration

slide-43
SLIDE 43

Presentation Outline

Introduction Motivation Problem statement Basic concepts Clock Model Precision Time Protocol Implementation Clock Model for OMNeT++ PTP in OMNeT++ Conclusion

slide-44
SLIDE 44

Clock model for OMNeT++

Clock model hierarchy

◮ Different modules for

different tasks

slide-45
SLIDE 45

Clock model for OMNeT++

HardwareClock

◮ Convert global real-time

to locale estimate

◮ Real-time:

perfect, continous

◮ Estimate:

non-perfect, discrete

slide-46
SLIDE 46

Clock model for OMNeT++

TdGen

◮ Provide the Time

Deviation (TD) for a given point in time

◮ Future TD values may be

estimates

slide-47
SLIDE 47

Clock model for OMNeT++

AdjustableClock

◮ Provide abstraction on

top of HardwareClock

◮ Add linear correction

slide-48
SLIDE 48

Clock model for OMNeT++

ScheduleClock

◮ Locale alternative to

scheduleAt()

◮ Internal event queue

slide-49
SLIDE 49

Presentation Outline

Introduction Motivation Problem statement Basic concepts Clock Model Precision Time Protocol Implementation Clock Model for OMNeT++ PTP in OMNeT++ Conclusion

slide-50
SLIDE 50

PTP Stack

Basic PTP node

◮ Architecture is based on

StandardHost and EthernetSwitch from

INET library

slide-51
SLIDE 51

PTP Stack

PTP stack

◮ Implements core of IEEE 1588

◮ Message types ◮ BMC algorithm ◮ Port states ◮ Data sets ◮ Clock types ◮ Delay mechanisms ◮ ...

slide-52
SLIDE 52

PTP Ethernet Mapping

PTP Ethernet Mapping

◮ Annex F of IEEE 1588 ◮ PTP over Ethernet

slide-53
SLIDE 53

PTP Clock servo

Clock servo

◮ Generic interface ◮ 1 implementation:

◮ PI controller

slide-54
SLIDE 54

Logical Link Control

Logical Link Control

◮ Layer 2 access ◮ Move frames to correct

application based on EtherType

slide-55
SLIDE 55

PTP NIC

PTP NIC

◮ Clock ◮ PHY ◮ MAC

slide-56
SLIDE 56

Presentation Outline

Introduction Motivation Problem statement Basic concepts Clock Model Precision Time Protocol Implementation Clock Model for OMNeT++ PTP in OMNeT++ Conclusion

slide-57
SLIDE 57

Project State

Current project state

◮ Code released as GPL

◮ github.com/w-wallner

◮ Thesis finished

◮ Simulation of time-synchronized networks using

IEEE 1588-2008 [7]

◮ Papers

◮ ISPCS1 2016, Stockholm ◮ OMNeT++ Community Summit 2016, Brno

1Conference with a focus on Precision Time Protocol (PTP)

slide-58
SLIDE 58

Outlook

Future work

◮ PTP features ◮ Hardware properties

◮ Deterministic clock influences ◮ Switch models (queues)

◮ More clock servos

slide-59
SLIDE 59

Conclusion

Conclusion

◮ Simulation approach is feasible

◮ Clocks can be implemented efficiently ◮ Assembling PTP networks is easy with Graphical User

Interface (GUI)

◮ Simulation has already been useful for teaching PTP ◮ There is strong interest for such a simulation

slide-60
SLIDE 60

Questions

◮ Do you have any questions?

slide-61
SLIDE 61

Thanks Thanks for your attention!

slide-62
SLIDE 62

Acronyms I

AAS Austrian Academy of Sciences ADEV Allan Deviation AVAR Allan Variance BC Boundary Clock BMC Best Master Clock DES Discrete Event Simulation E2E End-to-End FFM Flicker Frequency Modulation FPM Flicker Phase Modulation FSA Frequency Stability Analysis GUI Graphical User Interface LLC Logical Link Control NIC Network Interface Card OC Ordinary Clock OMNeT++ Objective Modular Network Testbed in C++ P2P Peer-to-Peer

slide-63
SLIDE 63

Acronyms II

PI proportional-integral PLN Powerlaw Noise PSD Power Spectral Density PTP Precision Time Protocol RW Random Walk TC Transparent Clock TD Time Deviation WFM White Frequency Modulation WPM White Phase Modulation

slide-64
SLIDE 64

References I

John C. Eidson Measurement, Control, and Communication Using IEEE 1588 Springer, 2006 Georg Gaderer, et al An Oscillator Model for High-Precision Synchronization Protocol Discrete Event Simulation Proceedings of the 39th Annual Precise Time and Time Interval Meeting, 2007 IEEE Std 1139-2008 IEEE Standard Definitions of Physical Quantities for Fundamental Frequency and Time Metrology - Random Instabilities 2009

slide-65
SLIDE 65

References II

  • N. Jeremy Kasdin and Todd Walter

Discrete Simulation of Power Law noise Proceedings of the 1992 IEEE Frequency Control Symposium, 1992 William J. Riley Handbook of Frequency Stability Analysis NIST Special Publication 1065, 2008 Enrico Rubiola The Leeson effect - Phase noise in quasilinear oscillators ArXiv Physics e-prints, 2005

  • W. Wallner

Simulation of Time-synchronized Networks using IEEE 1588-2008 Master’s thesis, Faculty of Informatics, Vienna University of Technology, 2016

slide-66
SLIDE 66

Dropped Slides

Dropped Slides

slide-67
SLIDE 67

Motivation

PTP: Compromise between cost and precision

slide-68
SLIDE 68

Motivation

PTP: Compromise between cost and precision

slide-69
SLIDE 69

Motivation

PTP: Compromise between cost and precision

slide-70
SLIDE 70

Motivation

PTP: Compromise between cost and precision

slide-71
SLIDE 71

Problem statement

Reminder: Any simulation is just as good as its models. Possible risks of simulation include:

◮ Too naive clock model → false positives ◮ Clumsy control loop → false negatives

slide-72
SLIDE 72

Frequency Stability Analysis - Intro

◮ We need to justify the stability of clocks ◮ This discipline is called Frequency Stability Analysis (FSA) ◮ Literature:

◮ Handbook of Frequency Stability Analysis[5] ◮ IEEE 1139 [3]

(Standard definitions for random instabilities)

slide-73
SLIDE 73

Clock Noise: Description

Two important measures for description of noise:

Sy(f)

Power Spectral Density (PSD) One-sided PSD of y(t) Useful for frequency domain analysis

slide-74
SLIDE 74

Clock Noise: Description

Two important measures for description of noise:

Sy(f)

Power Spectral Density (PSD) One-sided PSD of y(t) Useful for frequency domain analysis

σ2

y(τ)

Allan Variance (AVAR) Special variance to measure stabilty of clocks Useful for time domain analysis

slide-75
SLIDE 75

Powerlaw Noise I

Random noise in oscillators has a special PSD shape:

Sy(f) ∝ fα Definition

This is called Powerlaw Noise (PLN)

slide-76
SLIDE 76

Powerlaw Noise II

Special cases for α:

◮ 2

WPM White Phase Modulation

◮ 1

FPM Flicker Phase Modulation

◮ 0

WFM White Frequency Modulation

◮ -1

FFM Flicker Frequency Modulation

◮ -2

RW Random Walk

slide-77
SLIDE 77

Powerlaw Noise examples

slide-78
SLIDE 78

Allan Variance

Allan Variance

◮ Problem: standard variance does not converge

slide-79
SLIDE 79

Allan Variance

Allan Variance

◮ Problem: standard variance does not converge ◮ Alternative: Allan Variance (AVAR)

slide-80
SLIDE 80

Allan Variance

Allan Variance

◮ Problem: standard variance does not converge ◮ Alternative: Allan Variance (AVAR) ◮ Equally widespread: Allan Deviation (ADEV)

slide-81
SLIDE 81

Allan Variance

Allan Variance

◮ Problem: standard variance does not converge ◮ Alternative: Allan Variance (AVAR) ◮ Equally widespread: Allan Deviation (ADEV) ◮ Example:

slide-82
SLIDE 82

Relationship AVAR/PSD I

PLNs have characteristic AVAR: Image was taken from [6].

slide-83
SLIDE 83

Relationship AVAR/PSD II

Table B.2 of IEEE 1139[3]: PLN

Sy(f) σ2

y(τ)

RW

h−2 · f−2 A · h−2 · τ1

FFM

h−1 · f−1 B · h−1 · τ0

WFM

h0 · f0 C · h0 · τ−1

FPM

h1 · f1 D · h1 · τ−2

WPM

h2 · f2 E · h2 · τ−2

◮ A, B and C are constants ◮ D and E depend on certain parameters

slide-84
SLIDE 84

PTP - Timestamp modes

Different timestamp modes:

◮ 1-step clocks ◮ 2-step clocks

slide-85
SLIDE 85

PTP - Timestamp modes

Different timestamp modes:

◮ 1-step clocks

◮ Capable of timestamping outgoing frames on-the-fly ◮ Needs explicit hardware support

◮ 2-step clocks

slide-86
SLIDE 86

PTP - Timestamp modes

Different timestamp modes:

◮ 1-step clocks

◮ Capable of timestamping outgoing frames on-the-fly ◮ Needs explicit hardware support

◮ 2-step clocks

◮ Not capable to timestamp on-the-fly ◮ Use FollowUp messages

slide-87
SLIDE 87

PTP - State machine

3 non-transient states:

◮ MASTER ◮ SLAVE ◮ PASSIVE

slide-88
SLIDE 88

PTP - Best Master Clock algorithm

◮ Clocks decide periodically about port states ◮ Next port state depends on

◮ received Announce messages ◮ timeouts ◮ synchronization errors ◮ ...

◮ Best Master Clock (BMC) is eventually consistent ◮ BMC results in a forest

slide-89
SLIDE 89

PTP - Simple BMC example I

◮ At first, all nodes start in LISTENING

slide-90
SLIDE 90

PTP - Simple BMC example II

◮ They see an idle PTP network, and try to become MASTER

slide-91
SLIDE 91

PTP - Simple BMC example III

◮ As the nodes start to see Announce messages, some ports

change to SLAVE

slide-92
SLIDE 92

PTP - Simple BMC example IV

◮ Final hierarchy

slide-93
SLIDE 93

BMC example: rings

◮ Example network with 1 good clock ◮ Passive states break rings

slide-94
SLIDE 94

BMC example: 2 excellent clocks

◮ Example network 2 excellent clocks ◮ Passive states divide network

slide-95
SLIDE 95

PTP - Synchronization principle

Two tasks:

◮ Timestamp distribution ◮ Delay estimation

slide-96
SLIDE 96

PTP - Clock types I

Ordinary Clock (OC)

◮ 1 port ◮ typical end node

slide-97
SLIDE 97

PTP - Clock types II

Boundary Clock (BC)

◮ multiple ports ◮ otherwise similar to OC

slide-98
SLIDE 98

PTP - Clock types III

Transparent Clock (TC)

◮ multiple ports ◮ tries to not influence the PTP network

◮ residence time correction

◮ introduced in IEEE 1588-2008

slide-99
SLIDE 99

PTP - Delay mechanisms I

◮ End-to-End (E2E) ◮ Peer-to-Peer (P2P)

slide-100
SLIDE 100

PTP - Delay mechanisms II

◮ E2E: Slave measures and corrects full distance ◮ P2P: Each nodes measures and corrects small part ◮ Advantages E2E:

◮ Expected precision

◮ Advantages P2P:

◮ Reduced overhead ◮ Fast reaction on path change

slide-101
SLIDE 101

PLN simulation - Combining PSDs I

◮ Combined PSD results in expected AVAR

slide-102
SLIDE 102

PLN simulation - Prior work

Austrian Academy of Sciences (AAS) Prior work:

◮ Was engaged in PTP and PLN simulation ◮ Several publications, e.g.

◮ Gaderer, et al

An Oscillator Model for High-Precision Synchronization Protocol Discrete Event Simulation, 2007[2]

◮ Served as inspiration

slide-103
SLIDE 103

PLN simulation - Prior work

Prior work: Kasdin/Walter Method

◮ N. Jeremy Kasdin and Todd Walter,

Discrete Simulation of Power Law noise, 1992[4]

◮ Generic method for PLN generation ◮ Basis for AAS papers ◮ Approach: Filtering of white noise

slide-104
SLIDE 104

PLN simulation - Prior work

Kasdin/Walter approach: Filtering of white noise

slide-105
SLIDE 105

PLN simulation - Challenges

◮ Problem solved theoretically by KW-approach ◮ Too complex for practical simulation purpose

◮ Maximum simulation time is limited ◮ Inefficient for Discrete Event Simulation (DES)

slide-106
SLIDE 106

PLN simulation - Approaches

Maximum simulation time

◮ Combining PSDs with different fs ◮ IIR filters for even α

Efficiency

◮ Skip unneeded PSD contributions

slide-107
SLIDE 107

PLN simulation - Combining PSDs

Combining PSDs

slide-108
SLIDE 108

PLN simulation - Benchmark I

◮ Time Deviation at different sampling rates

◮ Overall clock wander determined by Random Walk (RW) ◮ High frequency noise is there when needed

slide-109
SLIDE 109

PLN simulation - Benchmark II

◮ Simulation speed ∝ 1/fs ◮ Results on my systems (Intel Core i7 2.00GHz):

slide-110
SLIDE 110

PLN simulation - Benchmark III

◮ Correct ADEV for any sampling rate

slide-111
SLIDE 111

PTP NIC - MAC

PTP MAC

◮ Timestamps

Event messages need ingress and egress timestamps

◮ Residence time correction

When acting as a TC, the MAC must correct the residence time

  • f outgoing frames
slide-112
SLIDE 112

PTP NIC - Clock

Clock

◮ Timestamps

Used to timestamp events

◮ Scalable

Controlled by Clock Servo

◮ Event scheduling

PTP stack relies on it for timeouts

⇒ Clock Noise

slide-113
SLIDE 113

Node nodes

Node Symbols

slide-114
SLIDE 114

Example network

Example network

slide-115
SLIDE 115

Debugging and Logging

Debugging and Logging

Figure: Port States and State Decisions

slide-116
SLIDE 116

Message symbols

Message Symbols

slide-117
SLIDE 117

Example network

Example network with PTP devices and standard office gear.

slide-118
SLIDE 118

Experiment A1: Best Master Clock Algorithm

Experiment A1: Best Master Clock Algorithm

slide-119
SLIDE 119

Best Master Clock Algorithm

Figure: Example network from Eidson’s book[1].

slide-120
SLIDE 120

Best Master Clock Algorithm

Figure: Simulation of the example network from Eidson’s book.

slide-121
SLIDE 121

Example Oscillators

◮ LibPLN implements 2 example oscillators

slide-122
SLIDE 122

Experiment 1: Sync Interval

Experiment 1: Sync Interval

slide-123
SLIDE 123

Simple Network

Simple test network

slide-124
SLIDE 124

Parameter Study: Sync Interval

Parameter Study: Sync Interval

Figure: Mean value of the offset

slide-125
SLIDE 125

Parameter Study: Sync Interval

Parameter Study: Sync Interval

Figure: Jitter2 of the offset 2|Max − Min|

slide-126
SLIDE 126

Experiment: Path Asymmetry

Experiment: Path Asymmetry

slide-127
SLIDE 127

Asymmetry

Configuration

◮ Network with 2 PTP nodes ◮ 3 Configurations

◮ No path asymmetry ◮ Path asymmetry without correction ◮ Path asymmetry with correction

slide-128
SLIDE 128

Asymmetry