39
”From Standard Ethernet to Real Time Ethernet” Distributed Real-Time Systems (TI-DRTS) – Track 3 Version: 30-8-2008

Distributed Real-Time Systems (TI-DRTS) – Track 3kurser.iha.dk/eit/tidrts/Powerpoint/RealTimeEthernet.pdf · Distributed Real-Time Systems (TI-DRTS) ... The OSI Model, TCP/IP and

Embed Size (px)

Citation preview

Page 1: Distributed Real-Time Systems (TI-DRTS) – Track 3kurser.iha.dk/eit/tidrts/Powerpoint/RealTimeEthernet.pdf · Distributed Real-Time Systems (TI-DRTS) ... The OSI Model, TCP/IP and

”From Standard Ethernet to Real Time Ethernet”

Distributed Real-Time Systems (TI-DRTS) –

Track 3

Version: 30-8-2008

Page 2: Distributed Real-Time Systems (TI-DRTS) – Track 3kurser.iha.dk/eit/tidrts/Powerpoint/RealTimeEthernet.pdf · Distributed Real-Time Systems (TI-DRTS) ... The OSI Model, TCP/IP and

Slide 2© Ingeniørhøjskolen i Århus

Abstract

• Part One:– Standard versus Switched Ethernet

– TCP/IP communication & Real-time

• Part Two:– Real-time Ethernet – overview– Standards and products

Page 3: Distributed Real-Time Systems (TI-DRTS) – Track 3kurser.iha.dk/eit/tidrts/Powerpoint/RealTimeEthernet.pdf · Distributed Real-Time Systems (TI-DRTS) ... The OSI Model, TCP/IP and

Slide 3© Ingeniørhøjskolen i Århus

The OSI Model, TCP/IP and Ethernet

MAC

LLC

IP

Physicallayer (1)

802.3 Ethernet

802.5Token Ring

ICMP

IGMP

Data Linklayer (2)

Networklayer (3)

Transportlayer (4) TCP UDP

Sessionlayer (5)

Application

Session

SocketsConnection orStream

Connectionless orDatagram

Page 4: Distributed Real-Time Systems (TI-DRTS) – Track 3kurser.iha.dk/eit/tidrts/Powerpoint/RealTimeEthernet.pdf · Distributed Real-Time Systems (TI-DRTS) ... The OSI Model, TCP/IP and

Slide 4© Ingeniørhøjskolen i Århus

Ethernet and Real-time ?

• Standard Ethernet is based on CSMA/CD (Carrier Sense Multiple Access / Collision Detection) bus access

• Random back off algorithm • Ethernet was defined as a half duplex bus

– with a minimum packet length of 64 bytes (46 bytes user data)

– necessary for collision detection– inefficient for transmission of control data

Page 5: Distributed Real-Time Systems (TI-DRTS) – Track 3kurser.iha.dk/eit/tidrts/Powerpoint/RealTimeEthernet.pdf · Distributed Real-Time Systems (TI-DRTS) ... The OSI Model, TCP/IP and

Slide 5© Ingeniørhøjskolen i Århus

Standard Ethernet Bus Topology

CSMA/CD

Problem for real-time: not deterministic !

Page 6: Distributed Real-Time Systems (TI-DRTS) – Track 3kurser.iha.dk/eit/tidrts/Powerpoint/RealTimeEthernet.pdf · Distributed Real-Time Systems (TI-DRTS) ... The OSI Model, TCP/IP and

Slide 6© Ingeniørhøjskolen i Århus

Protocol Overhead

User DataTCPHeader

20 bytes

LLC

8 bytes

CRCMAC

14 bytes 4 bytes

46-1500 bytes data

IPHeader

20 bytes

66 bytes protocol overhead

Page 7: Distributed Real-Time Systems (TI-DRTS) – Track 3kurser.iha.dk/eit/tidrts/Powerpoint/RealTimeEthernet.pdf · Distributed Real-Time Systems (TI-DRTS) ... The OSI Model, TCP/IP and

Slide 7© Ingeniørhøjskolen i Århus

Ethernet Frame Format

64 bytes minimum frame1518 bytes maximum frame

User data < 46 bytes is padded up to 46 bytes

802.3 MAC

Page 8: Distributed Real-Time Systems (TI-DRTS) – Track 3kurser.iha.dk/eit/tidrts/Powerpoint/RealTimeEthernet.pdf · Distributed Real-Time Systems (TI-DRTS) ... The OSI Model, TCP/IP and

Slide 8© Ingeniørhøjskolen i Århus

Switched Ethernet and Real Time

Full duplex point to point connections with no collisions !

Page 9: Distributed Real-Time Systems (TI-DRTS) – Track 3kurser.iha.dk/eit/tidrts/Powerpoint/RealTimeEthernet.pdf · Distributed Real-Time Systems (TI-DRTS) ... The OSI Model, TCP/IP and

Slide 9© Ingeniørhøjskolen i Århus

Ethernet Switch forwarding methods

• Store and forward• the switch buffers and performs a checksum on

each frame before forwarding it• rejects a frame with error

• Cut through• the switch reads up to the destination address

before starting to forward the frame • no error checking with this method

Page 10: Distributed Real-Time Systems (TI-DRTS) – Track 3kurser.iha.dk/eit/tidrts/Powerpoint/RealTimeEthernet.pdf · Distributed Real-Time Systems (TI-DRTS) ... The OSI Model, TCP/IP and

Slide 10© Ingeniørhøjskolen i Århus

Key Real Time Terms

• Latency – Delay in communications due to transmission

media, including switches and/or routers

• Jitter – Variation in delay (or Latency) in regards to

latency– Lower jitter values allow real-time systems to deal

with latency by taking advantage of time offsets

• Deterministic– A system is deterministic if it guarantees an upper

limit on latency

Page 11: Distributed Real-Time Systems (TI-DRTS) – Track 3kurser.iha.dk/eit/tidrts/Powerpoint/RealTimeEthernet.pdf · Distributed Real-Time Systems (TI-DRTS) ... The OSI Model, TCP/IP and

Slide 11© Ingeniørhøjskolen i Århus

Ethernet Switch Data

• Typical latency for port to port communication in a switch is less than 50 µs , depending on packet size

• Typical jitter values is around 100 ns

Page 12: Distributed Real-Time Systems (TI-DRTS) – Track 3kurser.iha.dk/eit/tidrts/Powerpoint/RealTimeEthernet.pdf · Distributed Real-Time Systems (TI-DRTS) ... The OSI Model, TCP/IP and

Slide 12© Ingeniørhøjskolen i Århus

Ethernet Switch Latency

Latency: 10-140 µs

Page 13: Distributed Real-Time Systems (TI-DRTS) – Track 3kurser.iha.dk/eit/tidrts/Powerpoint/RealTimeEthernet.pdf · Distributed Real-Time Systems (TI-DRTS) ... The OSI Model, TCP/IP and

Slide 13© Ingeniørhøjskolen i Århus

Gigabit Switch interconnections

Page 14: Distributed Real-Time Systems (TI-DRTS) – Track 3kurser.iha.dk/eit/tidrts/Powerpoint/RealTimeEthernet.pdf · Distributed Real-Time Systems (TI-DRTS) ... The OSI Model, TCP/IP and

Slide 14© Ingeniørhøjskolen i Århus

Latency: Switch versus Router

Page 15: Distributed Real-Time Systems (TI-DRTS) – Track 3kurser.iha.dk/eit/tidrts/Powerpoint/RealTimeEthernet.pdf · Distributed Real-Time Systems (TI-DRTS) ... The OSI Model, TCP/IP and

Slide 15© Ingeniørhøjskolen i Århus

TCP/IP communication & Real-time (1)

• Be aware of Nagels Algorithm• Nagels Algorithm is a solution to the

“small packet problem”• An application emitting data in small

chunks i.e. 1 byte results in a huge overhead (66 bytes overhead)

• Works by coalescing a number of small outgoing messages and send them all at once

Page 16: Distributed Real-Time Systems (TI-DRTS) – Track 3kurser.iha.dk/eit/tidrts/Powerpoint/RealTimeEthernet.pdf · Distributed Real-Time Systems (TI-DRTS) ... The OSI Model, TCP/IP and

Slide 16© Ingeniørhøjskolen i Århus

TCP/IP communication & Real-time (2)

Nagel’s Algorithm:

if there is new data to send

if the window size and available data is >= MSS

send complete MSS size segment now

else

if there is unconfirmed data still in the pipe

enqueue data in the buffer until an acknowledge is received

else

send data immediately

where MSS= Maximum Segment Size

Page 17: Distributed Real-Time Systems (TI-DRTS) – Track 3kurser.iha.dk/eit/tidrts/Powerpoint/RealTimeEthernet.pdf · Distributed Real-Time Systems (TI-DRTS) ... The OSI Model, TCP/IP and

Slide 17© Ingeniørhøjskolen i Århus

TCP/IP communication & Real-time (3)

• TCP delayed acknowledgement:– when receiving some data from the net it is

assumed that the local application will send a reply very soon

• so there’s no need to send an ACK immediately• an ACK is piggybacked on the next outgoing data• if no data is send out in max 500 ms an ACK is

sent anyway• the delay is traditionally 200 ms (max 500 ms)

Page 18: Distributed Real-Time Systems (TI-DRTS) – Track 3kurser.iha.dk/eit/tidrts/Powerpoint/RealTimeEthernet.pdf · Distributed Real-Time Systems (TI-DRTS) ... The OSI Model, TCP/IP and

Slide 18© Ingeniørhøjskolen i Århus

TCP/IP communication & Real-time (4)

Nagle and delayed ACK algorithms interacting

Client Server

Data (part 1)

2-500 msACK

Data (part 2)

response + ACK 2-500 ms

Page 19: Distributed Real-Time Systems (TI-DRTS) – Track 3kurser.iha.dk/eit/tidrts/Powerpoint/RealTimeEthernet.pdf · Distributed Real-Time Systems (TI-DRTS) ... The OSI Model, TCP/IP and

Slide 19© Ingeniørhøjskolen i Århus

TCP/IP communication & Real-time (5)

const int on=1;setsockopt (s, IPROTO_TCP, TCP_NODELAY ,

&on, sizeof(on));

Solutions:

1. Disabling the Nagle Algorithm:

2. Avoid repeated write of small data packets without reading

3. When possible use one large write instead of multiple small writes

Page 20: Distributed Real-Time Systems (TI-DRTS) – Track 3kurser.iha.dk/eit/tidrts/Powerpoint/RealTimeEthernet.pdf · Distributed Real-Time Systems (TI-DRTS) ... The OSI Model, TCP/IP and

Slide 20© Ingeniørhøjskolen i Århus

Real-time Ethernet – Overview

EPLProfinet v.3Sercos-IIIEtherCAT

Ethernet/IP

Hardware

Sof

twar

e(O

SI l

ayer

3+4

)

Proprietary

Pro

prie

tary

Standard Compliant

Sta

ndar

d C

ompl

iant

Page 21: Distributed Real-Time Systems (TI-DRTS) – Track 3kurser.iha.dk/eit/tidrts/Powerpoint/RealTimeEthernet.pdf · Distributed Real-Time Systems (TI-DRTS) ... The OSI Model, TCP/IP and

Slide 21© Ingeniørhøjskolen i Århus

Openness (Profinet)

Page 22: Distributed Real-Time Systems (TI-DRTS) – Track 3kurser.iha.dk/eit/tidrts/Powerpoint/RealTimeEthernet.pdf · Distributed Real-Time Systems (TI-DRTS) ... The OSI Model, TCP/IP and

Slide 22© Ingeniørhøjskolen i Århus

Time Slot Mechanism (EPL, Profinet v3, Sercos III)

Page 23: Distributed Real-Time Systems (TI-DRTS) – Track 3kurser.iha.dk/eit/tidrts/Powerpoint/RealTimeEthernet.pdf · Distributed Real-Time Systems (TI-DRTS) ... The OSI Model, TCP/IP and

Slide 23© Ingeniørhøjskolen i Århus

Deterministic Channel

Page 24: Distributed Real-Time Systems (TI-DRTS) – Track 3kurser.iha.dk/eit/tidrts/Powerpoint/RealTimeEthernet.pdf · Distributed Real-Time Systems (TI-DRTS) ... The OSI Model, TCP/IP and

Slide 24© Ingeniørhøjskolen i Århus

Telegram Structuring: (EPL, Profinet v3, Sercos III)

Page 25: Distributed Real-Time Systems (TI-DRTS) – Track 3kurser.iha.dk/eit/tidrts/Powerpoint/RealTimeEthernet.pdf · Distributed Real-Time Systems (TI-DRTS) ... The OSI Model, TCP/IP and

Slide 25© Ingeniørhøjskolen i Århus

Telegram Structuring(EtherCAT)

Page 26: Distributed Real-Time Systems (TI-DRTS) – Track 3kurser.iha.dk/eit/tidrts/Powerpoint/RealTimeEthernet.pdf · Distributed Real-Time Systems (TI-DRTS) ... The OSI Model, TCP/IP and

Slide 26© Ingeniørhøjskolen i Århus

ProfiNet v3 (1)

Realtime: Cycle times from 250µs with 30 axis and 50% TCP/IP. 150 axis in 1ms. Synchronisation <1µs.

Page 27: Distributed Real-Time Systems (TI-DRTS) – Track 3kurser.iha.dk/eit/tidrts/Powerpoint/RealTimeEthernet.pdf · Distributed Real-Time Systems (TI-DRTS) ... The OSI Model, TCP/IP and

Slide 27© Ingeniørhøjskolen i Århus

Profinet v3 (2)

• Defined by Profibus International with more than 1200 members and regional organisations in 25 countries on all continent.

• More than 25 companies with 100+ products• For I/O and other realtime functions down to

1ms:– Direct addressing and prioritised messages are

used (RT channel)– No restrictions for TCP/IP-traffic but shorter delays

can occur in switches due to the priority– The switches use reserved framing in realtime

while permitting 50 to 100% of normal TCP/IP– Special asic-based switches

Page 28: Distributed Real-Time Systems (TI-DRTS) – Track 3kurser.iha.dk/eit/tidrts/Powerpoint/RealTimeEthernet.pdf · Distributed Real-Time Systems (TI-DRTS) ... The OSI Model, TCP/IP and

Slide 28© Ingeniørhøjskolen i Århus

Sercos IIIDeveloped from the Sercos bus for drives. Supported by the Intressengemeinschaft SERCOS Interface e.V. with 66 members

Realtime: Cycle times from 31.25µs with eight axes/0% TCP/IP. 150 axes in 1ms/ 50% TCP/IP. Synchronisation <1µs..

Page 29: Distributed Real-Time Systems (TI-DRTS) – Track 3kurser.iha.dk/eit/tidrts/Powerpoint/RealTimeEthernet.pdf · Distributed Real-Time Systems (TI-DRTS) ... The OSI Model, TCP/IP and

Slide 29© Ingeniørhøjskolen i Århus

EtherCATDeveloped by Beckhoff in 2003. Supported by the EtherCAT Technology Group with some 140 members

Realtime: Cycle times from 30µs. 100 axes in 100µs. Synchronisation <1µs

Page 30: Distributed Real-Time Systems (TI-DRTS) – Track 3kurser.iha.dk/eit/tidrts/Powerpoint/RealTimeEthernet.pdf · Distributed Real-Time Systems (TI-DRTS) ... The OSI Model, TCP/IP and

Slide 30© Ingeniørhøjskolen i Århus

EPL: Ethernet Power Link (1)

Realtime: Cycle time from 0.2ms with eight axes. Maximum 20 axes restricted by a maximum of 10 hubs between master and drive. Synchronisation <1µs.

Page 31: Distributed Real-Time Systems (TI-DRTS) – Track 3kurser.iha.dk/eit/tidrts/Powerpoint/RealTimeEthernet.pdf · Distributed Real-Time Systems (TI-DRTS) ... The OSI Model, TCP/IP and

Slide 31© Ingeniørhøjskolen i Århus

EPL: Ethernet Power Link (2)

• Ethernet Powerlink Powerlink was developed by Bernecker + Rainer (B&R) in 2001 and supported by EPSG (EPL Standardisation Group) .

• Main producer companies: B&R, AMK, Baldor, Fraba, Lenze, Pepperl+Fuchs, Port and Smart Network Devices.

• Powerlink was early to market with products for motion control and have taken a market share in this niche with more than 60,000 nodes installed.

• Method: Closed segment with a master providing synchronisation and time slots. One of the slots open for small TCP/IP-messages (1% bandwidth).

Page 32: Distributed Real-Time Systems (TI-DRTS) – Track 3kurser.iha.dk/eit/tidrts/Powerpoint/RealTimeEthernet.pdf · Distributed Real-Time Systems (TI-DRTS) ... The OSI Model, TCP/IP and

Slide 32© Ingeniørhøjskolen i Århus

Ethernet/IP (1)

CIP: Common Industrial Protocol

Standard

Realtime: Cyclic communication 10-100ms. Synchronis ation about 10µs.

Page 33: Distributed Real-Time Systems (TI-DRTS) – Track 3kurser.iha.dk/eit/tidrts/Powerpoint/RealTimeEthernet.pdf · Distributed Real-Time Systems (TI-DRTS) ... The OSI Model, TCP/IP and

Slide 33© Ingeniørhøjskolen i Århus

Ethernet/IP (2)

• (IP=Industrial Protocol ) Defined by Rockwell. • Supported by the ODVA with some 250 members. • Main producer is Rockwell for controllers, I/O, HMI

and drives; • Accu-Sort Systems, Datalogic and Sick: bar code

readers; • Acromag, Phoenix and Wago: I/O; • Bosch Rexroth, Parker Hannifin and SMC: valves.• About 21 certified products. • In spring 2004 General Motors declared that it would

standardise on Ethernet/IP for its automation programs.

Page 34: Distributed Real-Time Systems (TI-DRTS) – Track 3kurser.iha.dk/eit/tidrts/Powerpoint/RealTimeEthernet.pdf · Distributed Real-Time Systems (TI-DRTS) ... The OSI Model, TCP/IP and

Slide 34© Ingeniørhøjskolen i Århus

Ethernet/IP – Method (3)

• Based on normal TCP/IP with alternative UDP/IP as an object embedding protocol,

• CIP (Common Interface Protocol)• Transports I/O-data, configuration and

diagnostics over normal Ethernet. • Non-deterministic with reaction time down to

10ms. • Synchronisation (CIPsynq - IEC61588) can

be added. • Bandwidth for TCP/IP 90-100%.

Page 35: Distributed Real-Time Systems (TI-DRTS) – Track 3kurser.iha.dk/eit/tidrts/Powerpoint/RealTimeEthernet.pdf · Distributed Real-Time Systems (TI-DRTS) ... The OSI Model, TCP/IP and

Slide 35© Ingeniørhøjskolen i Århus

Distributed IEEE 1588 clocks in Ethernet/IP

Page 36: Distributed Real-Time Systems (TI-DRTS) – Track 3kurser.iha.dk/eit/tidrts/Powerpoint/RealTimeEthernet.pdf · Distributed Real-Time Systems (TI-DRTS) ... The OSI Model, TCP/IP and

Slide 36© Ingeniørhøjskolen i Århus

Real-time Comparison

Page 37: Distributed Real-Time Systems (TI-DRTS) – Track 3kurser.iha.dk/eit/tidrts/Powerpoint/RealTimeEthernet.pdf · Distributed Real-Time Systems (TI-DRTS) ... The OSI Model, TCP/IP and

Slide 37© Ingeniørhøjskolen i Århus

Comparison of theoretical packet throughput: field buses vs. Ethernet

Page 38: Distributed Real-Time Systems (TI-DRTS) – Track 3kurser.iha.dk/eit/tidrts/Powerpoint/RealTimeEthernet.pdf · Distributed Real-Time Systems (TI-DRTS) ... The OSI Model, TCP/IP and

Slide 38© Ingeniørhøjskolen i Århus

Summary

• The response time of a communication system typically depends less than 10 % on the network

• Enabling of Real-time requirements through:– Switched full-duplex Ethernet– Fast Ethernet (100Mb) or Gigabit Ethernet– Transport protocol UDP instead of TCP– Quality of service (data prioritization)– Network segmentation via VLAN– Time synchronization via IEEE1588

Page 39: Distributed Real-Time Systems (TI-DRTS) – Track 3kurser.iha.dk/eit/tidrts/Powerpoint/RealTimeEthernet.pdf · Distributed Real-Time Systems (TI-DRTS) ... The OSI Model, TCP/IP and

Slide 39© Ingeniørhøjskolen i Århus

References - for more details

• “Effective TCP/IP Programming” Jon C. Snader, Addison Wesley 2000

• http://www.ethernet-powerlink.orghttp://www.ethercat.orghttp://www.odva.orghttp://www.fieldbus.orghttp://www.modbus.orghttp://www.profinet.comhttp://www.profibus.comhttp://www.sercos.org

• http://ethernet.industrial-networking.com/ieb/articledisplay.asp?id=854