Standard Ethernet for Real-Time Industrial Application IEEE1588 Precision Time Protocol T3LAB Bologna -13 Dicembre 2012 Agenda Î Î Industrial Ethernet Standard Ethernet in real-time industrial applications Î Switched Ethernet Î IEEE 1588 PTP Protocol Î IEEE 1588 PTP Implementation issues Î Virtual LAN applications Î PTP Network Demo 2 Industrial Ethernet (IE) Î Î Use of the Ethernet family of computer network technologies in an industrial environment, for automation and process control Adapt Ethernet for the needs of industrial processes, which require real time behavior Î Use of standard router, switches, hub, ecc.. Î Interoperability Î Innovation: high data rate up to 1Gbit/s 3 Industrial Ethernet: Fieldbus Overview Î Profinet Î Ethernet/IP Î Sercos III Î Powerlink (B&R) Î Modbus TCP Î EtherCAT (BeckHOFF) Î Switched Ethernet Î Plain Ethernet 4 Industrial Ethernet structures 5 Industrial Ethernet applications IE Fieldbus 6 IE – World Market (IMS Research) Strength of Ethernet TCP/IP, the 'standard' form of Ethernet World market shares for Industrial Ethernet components 7 Standard & Switched Ethernet Î TCP/IP Protocol Î PTP Protocol Î STP/RSTP Protocol Î VLAN Support Î Gigabit Ethernet Î Specialized Ethernet HW Î Managed switches Î Redundant topologies Î Power over Ethernet (PoE) 8 Switched Ethernet architecture Î Predictible performance Î IEEE 1588 HW timestamp Î Standardization Î RSTP support Î QoS feature Î Gigabit Ethernet Î Broadcast & Multicast Î Security with VLAN Î Network analyzers Î Latency increase with number of cascading nodes Î Diagnostics (port status, amount of traffic) 9 IEEE 1588: Standard for a Precision Clock Synchronization Protocol Î Distribution of frequency and time over a packet network 10 Time synchronization in distributed system Î Î Î Î To coordinate measurement instant (sampling, triggering) To measure time intervals (and to calculate derived quantities) As a reference to determine the order of events As a basis for the execution of coordinated actions (time based behavior) – Scheduled execution of scripts – Coordinate actuators 11 Time synchronization is required 12 Why is necessary? Î Oscillator tolerance (PPM) – Typical ±50,±100 PPM Î 100 PPM of deviation → 100usec/sec → 8,5sec/1days 13 How to provide common time base? Î Î Î Message-based: actions are triggered by the reception of a message (Profibus) Cyclic: a periodic timing is made possible by a cyclic communication protocol (SERCOS, Powerlink) Time-based: system time is provided by a synchronized clock implemented in every node – SNTP – IEEE1588: high accuracy for Networked measurements and control systems 14 Typical application of synchronized clock Î Automation and control systems Î Measurement and automatic test systems Î Î Power generation, transmission and distribution systems Telecommunication 15 Automation and control systems Î Application of IEEE 1588 by different organization proposing Real Time Ethernet – Ethernet Powerlink (B&R) – EtherCAT (BECKHOFF) – Profinet (Siemens) Î Real time applications – Time stamping – Cyclic operation 16 IEEE 1588 over UDP 17 Protocol time – one step 18 Protocol time – two step 19 PTP delay & offset MS_difference = t2 – t1 = offset + MS_delay SM_difference = t4 – t3 = -offset + SM_delay MS_difference = offset + MS_Delay SM_difference = -offset + SM_delay MS_Delay = SM_Delay = one_way_delay Offset = (MS_difference - SM_difference)/2 one_way_delay = (MS_difference + SM_difference)/2 20 PTP observed drift 21 IEEE 1588 Message Format 22 Timestamp point 23 Accurate timestamp 24 Influence of timestamp point Î Î Î Messages generate and received by PTP are delayed in an unpredictable way – Scheduling – Limited resource of CPU – Interrupt latency Constant and varying delay components – Transit delay – Jitter Delay effect can be bypassed with HW timestamp support 25 Source of delay and Jitter Î Example: 100Mbps Ethernet – Cable – • 560 ns delay per 100m Hub – • 500 ns delay, jitter about 50 ns Switch – Cut-through: minimal delay 1,12 us Store-and-forward: proportional to frame length – 5,7..122usec Router • • • Greater than Switch 26 IEEE 1588 Multicast Messages 27 Optional improvements Î Fast synch interval at startp-up or re-synch – Speed-up the time of convergence – Non standard Î Unicast PTP Messages – Unicast message negoziation (optional in IEEE1588 v2 standard) – Limit network traffic 28 PTP Network Topologies 29 Boundary clock 30 Transparent clock 31 Transparent clock: Correction Field 32 IEEE 1588 Implementation 33 Software Only Implementation Linux PTPd (source code available) 34 PTPd2 details Î No hardware time stamping support Î Linux kernel space timestamp – (SO_TIMESTAMP ) Advanced clock-servo 35 PTPd2 source code 36 Portable PTP software architecture(I) 37 Portable PTP software architecture (II) 38 PTP Implementation with IEEE1588 HW Î IEEE1588 Managed Ethernet layer2 switch Î Î DSP/uPC/uC with IEEE1588 MAC Freescale Kinetis K60 K70 and X Family Î Freescale i.MX51 Î STM32 39 Hardware timestamp capture 40 T3LAB – PTP Porting KIT Î Based on ptpd2 source code Î Several port has been developed and validated – Different uC/uPC/DSP – Different TCP/IP stack – Different OS (also uC without OS) – Different Network Interface Driver – API for Ethernet micro-switch • With IEEE1588 hardware support (Micrel KSZ8463) • Without hardware support (Micrel KSZ8895) – Use of VLAN technologies to improve PTP synchronization accuracy 41 Port: TI DSP / KSZ8895 Î PTPd porting for DaVinci DSP with DSPBios OS Î Network Interface improvements (timestamp) Î FPGA HW implementation of PTP clock Î Driver for KSZ8895 TI DSP NDK PTP SW PTP Clock FPGA Switch KSZ8895 42 Port: Beagle Board/KSZ8463 Î SPI HW interface for KSZ8463 eval board Î SPI driver for Linux 2.6 Î Configuration API for KSZ8463 Î PTP software modification (HW timestamp of KSZ8463 ) 43 Port: STR9 uC/KSZ8463 Î SPI HW Interface Î PTP porting (network layer modification) Î Configuration API for KSZ8463 Î PTP software modification ( HW timestamp of KSZ8463) 44 Heterogeneous network topologies IEEE 1588 interoperability EVM DM6437 KSZ8895 Linux PC PTP Master Webserver M A R V E L C I S C O KSZ8463 KSZ8463 Beagle Board Beagle Board Linux PC Browser 45 Embedded switch with prioritization Î Î Î Î The switch maintains a separate queue per priority Messages containing time information can be sent with highest priority If highest priority traffic is moderate (e.g. exclusively caused by PTP) contention is very unlikely If the transmission of a low priority frame is in progress, the high priority frame has to wait until the medium is free again (worst case: 122us in a 100Mbps Ethernet) 46 802.1p VLAN Priority Mapping User priority (setsockopt) 802.1p prioriy (sw priority mapping) Switch priority queues 0 0 0 1 1 0 2 2 1 3 3 1 4 4 2 5 5 2 6 6 3 7 7 3 47 VLAN Tag/Untag example 48 VLAN - Sample application 12 nodes ÎMTU = 1500Byte Î100 Mbit/sec ÎThop = 120usec ÎTtot = 1440usec Î VLAN Traffic -low prio -high prio Clock synchronization via PTP IEEE1588 Î Tagged VLAN traffic (802.1q) Î Measure of packet crossing time and packet loss(first-last node) Î High and low priority VLAN Ethernet traffic ÎReal-time and PTP traffic with high priority VLAN tag ÎBest effort traffic with low priority VLAN tag Î 49 PTP Network Demo (Courtesy of Datalogic Automation ) 50 Switched Network topologies Î TI DaVinci DSP with DSPBios OS Î NDK TCP/IP stack Î FPGA for PTP Clock Î Managed KSZ8895 Ethernet switch Î Daisy chain and ring topologies Î PC base application – PTP and VLAN validation 51 PTP Network Demo Î PTP Performance issues – CPU load – PTP task scheduling – Network traffic (vlan traffic increase performance) – PTP Synch message interval (1/8,1/4,1,2 sec) – Clock-servo parameters • Filter • PI controller 52 Clock Servo parameters offset from master filter (I) alpha = 1/2^S y[1] = x[0] y[n] = alpha * x[n-1] + (1-alpha) * y[n-1] Network Offset From Master (S = 1) 400000 300000 200000 100000 [ns] 0 3 -100000 1 -200000 -300000 7 5 9 11 15 19 23 27 31 35 39 43 47 51 55 59 63 67 71 75 79 83 87 91 95 99 13 17 21 25 29 33 37 41 45 49 53 57 61 65 69 73 77 81 85 89 93 97 Test0-192.168.1.10 Test0-192.168.1.11 Test0-192.168.1.17 Test0-192.168.1.2 Test0-192.168.1.3 Test0-192.168.1.4 Test0-192.168.1.5 Test0-192.168.1.6 Test0-192.168.1.7 Test0-192.168.1.8 Test0-192.168.1.9 -400000 -500000 -600000 53 Clock Servo parameters offset from master filter (II) Network Offset From Master (S=4, Ap=1000, Ai=5) 400000 300000 200000 100000 [ns] 0 3 -100000 -200000 1 7 5 9 11 15 19 23 27 31 35 39 43 47 51 55 59 63 67 71 75 79 83 87 91 95 99 13 17 21 25 29 33 37 41 45 49 53 57 61 65 69 73 77 81 85 89 93 97 Test4-192.168.1.10 Test4-192.168.1.11 Test4-192.168.1.17 Test4-192.168.1.2 Test4-192.168.1.3 Test4-192.168.1.4 Test4-192.168.1.5 Test4-192.168.1.6 Test4-192.168.1.7 Test4-192.168.1.8 Test4-192.168.1.9 -300000 -400000 -500000 -600000 54 Clock Servo parameters: PI controller ptpClock->observedDrift += offsetNorm / ptpClock->servo.ai; adj = offsetNorm / ptpClock->servo.ap + ptpClock->observedDrift; Network Offset From Master (S=4, Ai =1000,Ap=10) 400000 300000 200000 100000 [ns] 0 3 -100000 1 -200000 7 5 9 11 15 19 23 27 31 35 39 43 47 51 55 59 63 67 71 75 79 83 87 91 95 99 13 17 21 25 29 33 37 41 45 49 53 57 61 65 69 73 77 81 85 89 93 97 Test8-192.168.1.10 Test8-192.168.1.11 Test8-192.168.1.17 Test8-192.168.1.2 Test8-192.168.1.3 Test8-192.168.1.4 Test8-192.168.1.5 Test8-192.168.1.6 Test8-192.168.1.7 Test8-192.168.1.8 Test8-192.168.1.9 -300000 -400000 -500000 -600000 55 Clock Servo Tuning Offset From Master [ns] Clock Servo Parameters Comparison 300000 200000 100000 0 6 -100000 1 16 26 36 46 56 66 76 86 96 106 116 126 136 146 156 166 176 186 196 206 216 226 236 246 11 21 31 41 51 61 71 81 91 101 111 121 131 141 151 161 171 181 191 201 211 221 231 241 251 -200000 -300000 S=1, Ai=1000,Ap=5 S=4, Ai=1000,Ap=5 S=4, Ai=1000,Ap=10 56 Giuseppe Merendino www.t3lab.it 57
* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project
advertisement