Upload
trinhnguyet
View
226
Download
1
Embed Size (px)
Citation preview
”From Standard Ethernet to Real Time Ethernet”
Distributed Real-Time Systems (TI-DRTS) –
Track 3
Version: 30-8-2008
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
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
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
Slide 5© Ingeniørhøjskolen i Århus
Standard Ethernet Bus Topology
CSMA/CD
Problem for real-time: not deterministic !
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
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
Slide 8© Ingeniørhøjskolen i Århus
Switched Ethernet and Real Time
Full duplex point to point connections with no collisions !
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
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
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
Slide 12© Ingeniørhøjskolen i Århus
Ethernet Switch Latency
Latency: 10-140 µs
Slide 13© Ingeniørhøjskolen i Århus
Gigabit Switch interconnections
Slide 14© Ingeniørhøjskolen i Århus
Latency: Switch versus Router
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
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
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)
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
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
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
Slide 21© Ingeniørhøjskolen i Århus
Openness (Profinet)
Slide 22© Ingeniørhøjskolen i Århus
Time Slot Mechanism (EPL, Profinet v3, Sercos III)
Slide 23© Ingeniørhøjskolen i Århus
Deterministic Channel
Slide 24© Ingeniørhøjskolen i Århus
Telegram Structuring: (EPL, Profinet v3, Sercos III)
Slide 25© Ingeniørhøjskolen i Århus
Telegram Structuring(EtherCAT)
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.
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
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..
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
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.
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).
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.
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.
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%.
Slide 35© Ingeniørhøjskolen i Århus
Distributed IEEE 1588 clocks in Ethernet/IP
Slide 36© Ingeniørhøjskolen i Århus
Real-time Comparison
Slide 37© Ingeniørhøjskolen i Århus
Comparison of theoretical packet throughput: field buses vs. Ethernet
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
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