TSN Basics
TSN Basics
TSN Basics
Content GMBH
• What is TSN?
• Why do we need/want TSN?
• How does TSN work?
• TSN and OPC-UA
• Migration paths towards TSN/OPC-UA
• Why are FPGAs/SoCs the best choice for TSN?
• An implementation of TSN on an FPGA/SoC
• Summary
What is TSN? GMBH
Overview
History of OT Communication
Generation 2 (~100Mbit/s)
Real Time Ethernet
Generation 1 (~10Mbit/s)
Fieldbuses
Generation 0 (Kbit/s)
Serial Communication
RS-232, RS-485, Profibus, Modbus, CanOpen, Profinet, Ethernet Powerlink, TSN according to IEEE 802.1 &
Descrete IO Connections DeviceNet, ControlNet, Data EtherNet/IP, EtherCAT, OPC-UA
... Highway, Sercos I/II Sercos III
... ...
History of OT Communication
* Source: HMS Industrial Networks. Annual study of the industrial network market 2018
Why do we need/want TSN? GMBH
Overview
Priority Handling
• IEEE 802.1Q
• VLAN (QoS)
• Distinguish between high priority, reserved and
best effort traffic classes (and even more)
• Know which traffic is important and has hard real-
time requirements, which traffic might have soft
real-time requirements and which traffic is just best
effort traffic
• It is the base for everything else in TSN
• Most of the other standards are Amendments to
IEEE802.1Q (e.g. Qbv, Qch, Qav etc.)
How does TSN work? GMBH
Synchronization
Scheduling
• IEEE 802.1Qbv
• Cycles and Time Slots
• Based on the synchronized time, the transmission
is divided into cycles and time slots
• Defines when a frame is allowed to be sent
depending on the traffic class
• Reserved time slots
• Guaranteed time slot to send a frame
• Best effort traffic will not block the network for real-
time traffic
• Can change order of frames (between traffic
classes)
How does TSN work? GMBH
Scheduling
Scheduling
• Exclusive access
• Only one traffic class per time
• Frames must end before the end of a phase
• Guard Bands might be required
Cycle
N+1
N
How does TSN work? GMBH
Scheduling
• Overlapping access
• Frames must end before the end of a phase
• Priority scheduling during overlap
Cycle
N+1
N
How does TSN work? GMBH
Scheduling
• Multicycle access
• Frames must end before the end of a cycle
• Priority scheduling during overlap
• Multiple phases of same class per cycle
High Priority Cyclic Phase Cyclic Phase Cyclic Phase Cyclic Phase
Medium Priority Reserved Phase Reserved Phase Reserved Phase Reserved Phase
Cycle
N+1
N
How does TSN work? GMBH
Preemption
Preemption
Preemption
Frame 2 Frame 3
Frame 6
Mux Frame Output Frame 5 (1P) Frame 1 Frame 2 Frame 3 Frame 5 (1F) Frame 4 Frame 5 (2F) Frame 6 (1P)
64 bytes
64 bytes
64 bytes
64 bytes
64 bytes
64 bytes
64 bytes
64 bytes
>=
>=
>=
>=
>=
>=
How does TSN work? GMBH
Cyclic Forwarding
• IEEE 802.1Qch
• Deterministic forwarding
• The delay depends on number of hops
• Each hop stores the frames received in one cycle
and forwards it in the next cycle
• Maximum delay of each communication path can
be easily calculated for real-time frames
• Cyclic Forwarding normally not done for best
effort traffic
• Frames will come as bursts in the next cycle
• Can change order of frames between different
traffic classes
How does TSN work? GMBH
Cyclic Forwarding
Received Frames
mixed traffic
Cycle
Cycle
Cycle
Cycle
N+1
N+2
N+3
N
• Cyclic Forwarding
Transmitted Frames Node 1
combined with Cyclic
Phase
Cyclic
Phase
Cyclic
Phase
Cyclic
Phase
Res Res Res Res
• Best effort
forwarded when
Cycle
Cycle
Cycle
Cycle
N+1
N+2
N+3
N
possible (no
Transmitted Frames Node 2
Cyclic For- Cyclic
Phase
Cyclic
Phase
Cyclic
Phase
Cyclic
Phase
Res Res Res Res
warding)
High Priority Phase Phase
1 5
Phase
12 13
Phase
Best Effort Best Effort Best Effort Best Effort
Medium Priority Phase Phase
2 6
Phase
9 10
Phase
Low Priority 3 4 7 8 11 14 18
Cycle
Cycle
Cycle
Cycle
N+1
N+2
N+3
N
How does TSN work? GMBH
Traffic Shaping
• IEEE 802.1Qav
• Credit Based Shaper
• Two functionalities in one
• Avoid bursts of frames of the same traffic class or
stream
• Change priorities between different traffic classes or
streams
• Per stream or traffic class
• Can change order of frames
• Between different traffic classes
• Between different streams
How does TSN work? GMBH
Traffic Shaping
• Algorithm
• Decrement credit during sending (depending on
frame length)
• Increment credit when sending has to wait
• Allow sending only when credit is >=0
• Max and Min credit values for maximum wait time
and maximum burst lengths
• When credit >0 and not waiting to send set credit
to 0
• Increment and Decrement can be chosen
How does TSN work? GMBH
Traffic Shaping
Frame 3
Frame 8
Priority Credit 1
Priority Credit 2
Frame Output Frame 1 Frame 6 Frame 2 Frame 7 Frame 3 Frame 8 Frame 9 Frame 4 Frame 5 Frame 1 0
How does TSN work? GMBH
• IEEE 802.1Qci
• Filtering and Policing of incoming frames
• Protection against excess bandwidth usage, burst
sizes as well as against faulty or malicious
endpoints
• Fault isolation to one segment and not the whole
network
• Filter frames on ingress port based on:
• Arrival times
• Rates
• Bandwidth
How does TSN work? GMBH
Network Redundancy
• IEEE 802.1CB
• Network Redundancy
• Seamless redundancy (zero loss)
• Duplicating frames on sending to multiple paths
• Duplicate rejection on reception (take first)
• Redundancy Tagging of Frames
• Can be HSR or PRP according to IEC 62439-3 or
the scheme defined in IEEE 802.1CB which is
basically the same as HSR
How does TSN work? GMBH
• NETCONF/RESTCONF&YANG vs SNMP&MIB vs
OPC-UA vs LLDP
• Configuration and supervision of the TSN nodes
• Multiple schemes are currently present in the TSN
implementations
• Not 100% clear which scheme will win
• Probably NETCONF/RESTCONF&YANG for the
Network Infrastructure
• Probably OPC-UA for End Nodes (since it is there?)
• Big topic in the testbeds and standardization
How does TSN work? GMBH
And now?
Overview
Overview
• Data modeling
Transport
Ethernet TSN
• Two main communication schemes
• Client/Server 1:1 (Configuration in TSN)
• Publisher/Subscriber 1:N (Data Streams in TSN)
• Work in progress
• Most functionalities are already there
• Extensions coming bit by bit
• Many open source implementations of OPC-UA
• In ANSI C, C++, Java, .NET, etc.
Migration path towards TSN GMBH
Overview
Interoperability Testing
OPC UA
Transport
(UDP, TCP, IP)
CPU
Data Data
RT RT
Source Talker
MAC Listener
Sink
(Sensor) (Drive)
Priority Priority
Handler Handler
and and
Arbiter Mux
Priority Priority
ITF PTP Preemption Handler Handler Preemption PTP ITF
Filter Filter
IN RX Merge and and Merge RX IN
Cycle Tag Cycle Tag
2.5 Port Switch
PHY with Redundancy PHY
(HSR/PRP/FRER)
Scheduler Scheduler
ITF PTP Preemption Priority Priority Preemption PTP ITF
and and
OUT TX Split Queues Queues Split TX OUT
Cycle Check Cycle Check
Clock
How can a TSN switched End-node be
GMBH
• But:
• To keep the design simple and to have no
requirements on external RAM (DDR3/DDR4…) all
FIFOs and Buffers are implemented with Block-RAM
• The size of the FIFOs depends on the Cycle duration
and Link Speed (10/100/1000Mbit/s) since in worst
case a frame has to be buffered for a whole Cycle and
the Link Speed defines the maximum number of
frames (bytes/s)
• For Cycle durations over 1ms and a Link Speed of >=1G
it might be better to use external RAM
• If the Cycle duration, Link Speed, Maximum Bandwidth
usage and even the Schedule is known at synthesis
time, buffers can be reduced quite a bit
Summary GMBH
TSN
Thank you!
NetTimeLogic GmbH
www.nettimelogic.com
[email protected]