Real-time Ethernet for industrial control
Search for the word ‘latency’ within the IEEE 802.3 CSMA/CD,
known more commonly as Ethernet, and there will not be many
occurrences. Why? Because Ethernet was never originally
designed for latency-critical, real-time networks, such as industrial
control, voice and video.
Today’s incredibly low Small-Office and Home-Office (SOHO) prices,
combined with interoperability and openness, have driven Ethernet
from the office into our homes and factories. Designing Ethernet into
such applications needs careful consideration and an understanding
of the architecture of switches, repeaters and transceivers to ensure
success.
Switches and repeaters
All of today’s Ethernet switches are based upon
store and forward architecture, which stores the
complete packet and processes prior to
forwarding. By analysing the complete packet a
host of features are now possible, such as Virtual
LANs (VLANs), priority classification and error
checking. The consequence of store and forward
architecture is, however, a non-deterministic
latency behaviour. This is demonstrated by the
latency measurements in Table 1 below using the
Micrel 5-Port Switch, KSZ8995MA, as an example.
The total latency is derived from two
components, packet size and the internal
forwarding delay, and can be calculated as below:
Total Latency = (Packet size x 8) / rate + Forwarding delay.
|
Table 1 shows a constant and small forwarding delay of around 2.7µS
for the Micrel switch, independent of packet size. Hence, fixing the
size of the packets in a network will provide constant switch latency.
To reduce the overall switch latency the packet size should be
reduced to a minimum. However, in reality this may be difficult to
control in a network.

*Latency measured at 100Mbps over 1 metre of CAT5 cable
Table 1: Latency of the KSZ8995MA, 5-Port Ethernet switch
Repeater hubs result in a much simpler architecture than switches.
Repeaters deploy a cut-through architecture, which significantly
diminishes latency by forwarding the incoming packet to all ports,
with the exception of the ingress port, before receiving the complete
packet. This technique offers less in terms of features but delivers
improved latency and packet-size independence compared to the
switch counterpart.
Industrial control networks
Switch and repeater latency is of major significance when deploying
Ethernet into the unique ring topology of industrial control networks
(typically star topology is found elsewhere). Here, total network
latency equals the sum of each of the individual node (Ethernet
switch or repeater) latencies. Solutions for time-critical control
networks have led to a number of industrial-Ethernet standards
evolving, such as PROFInet, EtherCAT, EtherNet/IP, Modbus and
Powerlink. All adopt Ethernet as the physical layer but utilise Layers 3
and up of the Open Systems Interconnection (OSI) network model to
deliver data with accuracies to within 1µS.

Fig.1: Ethernet Powerlink cycle.
Real-time performance is generally implemented by time multiplexing
the communication on the network between the different nodes. Critical
isochronous data transfer is performed at the start of the cycle, followed
by non-critical Transmission Control Protocol/Internet Protocol (TCP/IP)
traffic. Such methods guarantee the real-time performance of the
network whilst still offering compatibility with office networks. This
method is demonstrated in Figure 1, using Ethernet Powerlink as an
example. The Powerlink software stack controls the data flow on the
network using a method called Slot Communication Network
Management (SCNM). One station, the Powerlink manager, assigns
timeslots for each of the stations in the network (cyclic period, Figure 1).
Stations are only allowed to send data when requested by the manager.
As a consequence, only one station can access the bus at any particular
time, removing the possibility of collisions to achieve deterministic
performance. At the end of the cyclic period the network is free to
deliver any non-real-time TCP/IP traffic (asynchronous period, Figure 1).
This provides compatibility with the office layer of the network.
To reduce latency jitter in the network, the Ethernet Powerlink group
recommends using 100Base-TX/FX Ethernet repeater hubs. However,
most Ethernet repeaters today are obsolete in favour of intelligent
switches. The scarcity of Ethernet repeaters often leads to FPGA-based
implementations with external Ethernet PHYs, increasing cost, risk and
time-to-market
This trend is bucked by Micrel’s KSZ88xx,
a new generation of switches and controllers
offering a unique low-latency repeater mode.
This mode provides a maximum port-to-port
latency of 310nS and a total deviation of 40nS,
making it ideal for real-time critical
applications.
Higher-level protocols
An alternative approach to delivering real-time
packets is provided with higher-level protocols
such as IEEE 1588. IEEE 1588 utilises User
Datagram Protocol (UDP) packets over IP on the
Ethernet network to provide synchronisation
down to a microsecond. Such performance
meets the stringent real-time requirements
for motion control applications. ProfiNet,
EtherNet/IP and the EtherCAT industrial-
Ethernet groups have all adopted this
standard for network synchronisation. Figure 2
shows a typical hardware implementation of
the IEEE 1588 functionality.

Fig.2: Hardware implementation of IEEE 1588.
Network synchronisation is achieved using
the Best Master Clock Algorithm (BMCA) to select timing. If the node
is to be a master to many of the nodes in the ring then a highprecision
source is used, such as the Global Positioning System (GPS)
device shown in Figure 2. If the node is not designated as a master
then it will extract timing from the network using the IEEE 1588
protocol or, failing that, the on-board local oscillator.
To synchronise the master and slaves, IEEE 1588 operates Precise
Time Protocol (PTP) based on IP multicasting. The synchronisation
process is divided into two phases as shown in Figure 3. First the
offset time between the master and slave is calculated and corrected.

Fig.3: PTP time synchronisation.
To perform this function the master continuously transmits a unique
message to the slave at defined intervals, usually every 2 seconds.
The second phase of the synchronisation process is the delay
measurement. The slave will send a delay request to the master,
which is returned and the round trip delay calculated using
timestamps. The assumption here is that the delay between master
and slave is always symmetrical.
Conclusion
The accuracy of the time synchronisation will depend greatly on the
ability to time stamp packets as close as possible to the physical-layer
line interface, eliminating any switching- or software-variable delays.
Today hardware implementations are typically realised in an FPGA,
and can provide network synchronisation to within less than 1µS.
Alternatively an IEEE 1588 software-based solution can be implemented
with time stamping performed by the processor. However, it is
difficult to compensate for the non-deterministic latency of the
switch, resulting in synchronisation accuracy of around 10µS to
100µS. Consequently although providing a real-time solution, this
approach is unsuitable for precision applications such as motion
control.
As Ethernet broadens its appeal from the factory to the home,
it is facing challenges that were inconceivable when the IEEE 802.3
specification was first published back in 1985. Next-generation silicon
will need to provide further enhancements to meet the demands
of real-time applications. For now, careful consideration and an
understanding of the Ethernet architecture is essential when
designing such products.