AUTOSAR FO EXP TimeSensitiveNetworkFeatures
AUTOSAR FO EXP TimeSensitiveNetworkFeatures
AUTOSAR FO R23-11
Disclaimer
This work (specification and/or software implementation) and the material contained in
it, as released by AUTOSAR, is for the purpose of information only. AUTOSAR and the
companies that have contributed to it shall not be liable for any use of the work.
The material contained in this work is protected by copyright and other types of intel-
lectual property rights. The commercial exploitation of the material contained in this
work requires a license to such intellectual property rights.
This work may be utilized or reproduced without any modification, in any form or by
any means, for informational purposes only. For any other purpose, no part of the work
may be utilized or reproduced, in any form or by any means, without permission in
writing from the publisher.
The work has been developed for automotive applications only. It has neither been
developed, nor tested for non-automotive applications.
The word AUTOSAR and the AUTOSAR logo are registered trademarks.
Contents
1 Introduction 5
1.1 Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.2 Scope . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2 Definition of terms and acronyms 6
2.1 Acronyms and abbreviations . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.2 Definition of terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.2.1 Ethernet packet . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.2.2 Ethernet frame . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.2.3 Stream . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.2.4 IEEE1722-based stream . . . . . . . . . . . . . . . . . . . . . 7
2.2.5 Stream data producer . . . . . . . . . . . . . . . . . . . . . . . 7
2.2.6 Stream data consumer . . . . . . . . . . . . . . . . . . . . . . 7
2.2.7 AVTP presentation time . . . . . . . . . . . . . . . . . . . . . . 7
2.2.8 Max transit time . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.2.9 Media clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.2.10 Media clock provider . . . . . . . . . . . . . . . . . . . . . . . . 8
2.2.11 Media clock consumer . . . . . . . . . . . . . . . . . . . . . . . 8
3 Related Documentation 9
3.1 Input documents & related standards and norms . . . . . . . . . . . . . 9
4 Time Sensitive Network in AUTOSAR 10
4.1 Constraints and Assumptions . . . . . . . . . . . . . . . . . . . . . . . . 10
4.2 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
4.2.1 IEEE 802.1AS . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
4.2.2 IEEE 802.1Qav . . . . . . . . . . . . . . . . . . . . . . . . . . 10
4.2.3 IEEE 802.1Qbv . . . . . . . . . . . . . . . . . . . . . . . . . . 11
4.2.4 IEEE 802.1Qcc . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
4.3 Usage of Shapers in the Network . . . . . . . . . . . . . . . . . . . . . . 11
4.3.1 Asynchronous Traffic Shaping . . . . . . . . . . . . . . . . . . 11
4.3.1.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . 11
4.3.1.2 Configuration parameters . . . . . . . . . . . . . . . . 12
4.3.1.3 Guidance on the configuration . . . . . . . . . . . . . . 12
4.3.2 Credit Based Shaper . . . . . . . . . . . . . . . . . . . . . . . 13
4.3.2.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . 13
4.3.2.2 Configuration parameters . . . . . . . . . . . . . . . . 14
4.3.2.3 Guidance on the configuration . . . . . . . . . . . . . . 14
4.4 Ensure Accuracy of Time Synchronization . . . . . . . . . . . . . . . . . 15
4.4.1 Recommendations to support accuracy in an Ethernet network 15
4.4.1.1 Parts in Documents which Reflect Accuracy . . . . . . 15
4.4.1.2 System requirements . . . . . . . . . . . . . . . . . . . 15
4.5 Measurement of the Time Synchronization Quality (Accuracy) . . . . . . 15
4.5.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
1 Introduction
1.1 Objectives
Time-Sensitive Networking (TSN) is a set of standards specified by [1, IEEE 802.1 TSN
Task Group]. It provides end-to-end data transmission with extremely low latency and
high reliability over Ethernet. As a result, TSN is considered as one of the key enabler
for deterministic communication on standard Ethernet, which can further be used to
accurate timing and guarantee data delivery for automotive Ethernet.
The purpose of this document is to give an overview on the relevant TSN features, and
provide examples how to use them together with AUTOSAR platform.
1.2 Scope
This document provides explanatory information and help the automotive engineer to
understand the fundamental TSN features, as well as the basic approach to design a
deterministic network on automotive Ethernet.
The content of this document will address following topics:
• Constraints and Assumptions
• Overview
• Usage of Shapers
• Accuracy of Time Synchronization
• Measure Quality (Accuracy) of Time Synchronization
Table 2.1: Acronyms and abbreviations used in the scope of this Document
Definition: An "Ethernet packet" is an on wire format defined by [5, IEEE Std 802.3-
2022] which includes the following parts: Preamble (7 bytes), SFD (start frame de-
limiter, 1 byte), Ethernet frame (up to 2000 bytes), IPG (inter package gap, 12 byte
times)
Definition: An "Ethernet frame" is on wire format defined [5, IEEE Std 802.3-2022]
which includes the following parts: MAC destination address field (6 bytes), MAC
source address field (6 bytes), Type field (2 bytes), MAC client data field (include op-
tional Q-Tag (4 bytes)) (up to 1982 bytes), optional PAD (padding bytes), FCS (frame
check sequence, 4 bytes)
2.2.3 Stream
Definition: "Max transit time" is defined by [3, IEEE1722-2016]) and represents the
maximal acceptable delay when data of a stream data producer is added to its egress
queue, transferred across the network via an IEEE1722-based stream and this data
is forwarded from the ingress queue of the receiving stream data consumer to a time-
sensitive application.
Definition: A "media clock provider" is an end node in the network which hosts an
media clock. The media clock provider transmit an IEEE1722-based stream to 1 or
multiple media clock consumer. The IEEE1722-based stream is of subtype Clock Ref-
erence Format (CRF) and contain several presentation timestamps which correlates to
the media clock rate.
Definition: A "media clock consumer" is an end node in the network which receives
a IEEE1722-based stream of subtype Clock Reference Format (CRF) from a media
clock provider. The media clock consumer performs a recovery of its media clock (e.g.
PLL) based on the received encapsulated data from the media clock provider.
3 Related Documentation
4.2 Overview
TSN is a set of IEEE 802 standards based on Ethernet. It specifies functions to en-
sure the transmission with bounded low latency and high availability for applications in
automotive or industrial control facilities. The deterministic transmission of time-critical
frames may be achieved by using TSN features of high reliability, low delay, zero packet
loss through traffic shaping, seamless redundant transmission, filtering, priority-based
scheduling, ingress policing and rate limitation.
The basis of TSN standards is global time synchronization. It specifies the clock syn-
chronization mechanism with switches as key nodes based on the data link layer. IEEE
802.1AS [4, IEEE Std 802.1AS] was mainly extended from the simplified version of the
IEEE 1588 (Precision Time Protocol) and it is more suitable for communication trans-
mission scenarios that require high real-time precision in vehicle networks.
IEEE 802.1Qav [6, IEEE Std 802.Qav] can be used to ensure that traditional asyn-
chronous Ethernet data traffic does not interfere with AVB’s real-time audio and video
streams. To avoid competition for network resources between ordinary data traffic and
AVB traffic, the AVB switch differentiates time-sensitive audio and video streams from
ordinary data streams, queues real-time frames and asynchronous frames separately,
and assigns the highest priority to real-time frames. Therefore a so-called Credit Based
Shaper (CBS) could be used for bandwidth limitation to convergence time-sensitive and
time-insensitive traffic.
IEEE 802.1Qbv [7, IEEE Std 802.Qbv] specifies the feature of time-aware shaping,
which allows the scheduling of the transmission of frames with different priorities in
time-triggered windows. Time-aware shaping divides time into fixed windows, and
schedules the transmission of frames within these windows based on their priority.
Time-critical frames are normally given with higher priority and transmitted in a sepa-
rate window, while lower priority frames are transmitted in the remaining time.
Most networks need to be configured while the network is down, which is not suitable
for applications such as in industrial control and automotive network communication.
IEEE 802.1Qcc [8, IEEE Std 802.Qcc] can be used to introduce a Centralized Network
Configuration (CNC) and a Centralized User Configuration (CUC) to implement dy-
namic network configuration, and flexibly configure new devices and data flows when
the network is running.
Table 4.1 gives an overview on the relevant TSN standards.
4.3.1.1 Overview
Asynchronous Traffic Shaping (ATS) is specified by [9, IEEE Std 802.1Qcr-2020] and
provides a traffic shaping concept that can provide bounded latencies for data streams
in a network. It avoids bursts and provides a fair usage of the egress port for streams
arriving on different ingress ports. This is a main difference between the Credit Based
Shaper (CBS) and ATS, as CBS only considers a particular traffic class of an egress
port. The algorithm is loosely based on the token bucket algorithm and uses similar
terminology for the configuration parameters.
ATS is divided into two major functional blocks, one, the ”ATS Eligibility Time Assign-
ment” situated on the ingress side of a bridge, operating on streams identified by the
stream filters using the stream_handle and priority, includes the computational part
of the shaping function. This means it calculates an eligibility time for every frame
received based on the ATS algorithm. The eligibility time is the time when a frame
is eligible for transmission on the egress port. The other functional block, the ”ATS
transmission selection algorithm” is situated on the egress side and shapes the traffic
according to the results calculated by the ”ATS Eligibility Time Assignment”. As the eli-
gibility times of frames of streams from different receive ports can be in non-decreasing
order, ATS queues need to support non-FIFO queues.
1. Streams that are shaped using the ATS algorithm need to be identified on the
ingress side of a bridge. Stream Filters are used to identify the frames of a
stream and associate them with the relevant functions. To use the stream filters,
stream identification functions need to be configured to identify the frames of a
stream.
2. The stream filters can be used to configure a Maximum SDU size filter to protect
the following processing stages from frames that are bigger than the maximum
SDU size of a well-formed frame of the considered stream.
3. The stream filters can be used to remap the stream to a different traffic class
using the IPV assignment provided by stream gates. This is optional and can be
used to prioritize certain streams.
4. The stream filter assigns the Scheduler Instance for the stream, which is respon-
sible to perform the computations to calculate the eligibility time for every frame
of the stream.
(a) The CommittedInformationRate is the rate of the ATS algorithm used to ac-
cumulate ”tokens” in bits/second and represents the average bit rate of the
stream.
(b) The CommittedBurstSize is the maximum number of ”tokens” that can be
accumulated and therefore defines the maximum burst size. It needs to
be set to a larger value than the maximum burst that can evolve due to
interfering traffic.
(c) The SchedulerGroupInstanceID references the EthSwtAtsGroupIn-
stanceEntry the ”ATS Eligibility Time Assignment” is associated with.
All streams received from one upstream port with the same traffic class
need to be associated with the same SchedulerGroupInstanceID. This
guarantees that frames of different streams sharing the same priority and
that are received on the same port are transmitted in the arrival order.
(d) The EthSwtAtsGroupInstanceEntry is also used to configure the EthSwtAts-
GroupMaximumResidenceTime of the Scheduler Group. This parameter de-
fines the latest point in time the calculated eligibility time can have. Frames
that exceed the maximum residence time i.e., with a calculated eligibility time
later than the sum of the arrival time and the EthSwtAtsGroupMaximumRes-
idenceTime are discarded. The value can be derived from the maximum
latency, and a frame of this scheduler group should experience in this bridge.
5. To use the ATS transmission selection algorithm on the egress
side, the traffic class(es) used for ATS traffic need to be config-
ured to use the ATS transmission selection. Therefore, EthSwtPortE-
gressQueueTransmissionSelectionAlgorithm needs to be set to ETH-
SWT_TRANSMISSION_SELECTION_ALGORITHM_ATS.
4.3.2.1 Overview
The Credit Based Shaper (CBS) is specified by [6, IEEE Std 802.Qav] and provides
a traffic shaping concept for high priority, high data rate streams. It was specified as
part of the Audio Video Bridging (AVB) standards. The behavior is similar to ATS, but
the CBS is operating only on Traffic Classes on the egress side of a bridge. Therefore,
there is no differentiation between individual streams within the traffic class as well as
different ingress ports. As a consequence, the Credit Based Shaper is strictly operating
on the order frames are received on all ports, there is no reordering of frames received
on different ports. The Credit Based Shaper minimizes bursts and therefore protects
lower priority traffic from the high priority CBS shaped traffic.
The CBS only exists as one functional block (per traffic class) that is located on the
egress side of a bridge port and makes frames available for transmission selection
based on a credit value. If there is zero or positive credit, frames are available for
transmission, in case there is negative credit, frames of the associated traffic class
are not available for transmission selection. The idleSlope is the main parameter that
defines the rates with which credit is accumulated and reduced, and thereby it directly
controls the data rate of the assigned traffic class on a port.
1. Frames associated with the CBS are identified by the priority. In case there are
ports of the bridge that use the priority intended to be used for CBS traffic for
other traffic, the priorities on those ports need to be remapped by configuring the
priority regeneration table.
2. The idleSlope of the CBS is set according to the average bit rate of all streams
sent with this traffic class on that specific port. A little bit of oversubscription is
necessary to account for frequency differences of the oscillators of the different
bridges in the network. Credit increases with the idleSlope and is reduced with
sendSlope (sendSlope = idleSlope - portTransmitRate).
3. highCredit is set to the maximum amount of credit that can be accumulated in a
queue. This value is calculated based on the maximum amount of interference
by traffic from higher priority traffic classes and the idleSlope parameter.
4. lowCredit is the lowest possible amount of traffic, it can be derived from the max-
imum frame size supported by the traffic class and the sendSlope parameter.
5. To use the CBS algorithm the traffic class(es) used for CBS need to be
configured to use the CBS transmission selection. Therefore, EthSwt-
PortEgressQueueTransmissionSelectionAlgorithm needs to be set to ETH-
SWT_TRANSMISSION_SELECTION_ALGORITHM_CBS.
TSN uses gPTP protocol (IEEE 802.1AS) to get precise timestamps for the nodes in
the Network. IEEE 802.1AS also targets at accuracy of +/-500ns between any two
nodes over 7 hops for Audio Video Bridging using 100 Mb/s links. That means, the
hardware has to support the global time on Ethernet with an end to end accuracy of
+/- 500ns, where end to end describes a network path from a data producer to a data
consumer (e.g. from audio source to an audio sink).
4.5.1 Overview
synchronized, the PPS pulses triggered every second should only have a marginal
time distance in a successful scenario.
However, the 1PPS method is not feasible for automotive environment, where using a
separate output pin for generating the 1PPS signal on the ECU is considered costly.
Furthermore, static offset in the internal clock of a slave may exist and can be canceled
out by an opposite static offset in the logic that drives the 1PPS output. This will result
in an error condition that cannot be observable by using 1PPS measurement method.
In order to mitigate the flaws from 1PPS measurement, Advance methods like Ingress
Reporting Method and Reverse Sync Method may be considered for alternative mea-
surement methods. More details for Ingress Reporting Method and Reverse Sync
Method, please refer to [12, 802.1AS Recovered Clock Quality Testing].
AUTOSAR support to configure the generation of a PPS signal, if the hardware sup-
ports this feature. AUTOSAR support the following configuration options:
• support to configure the rate of a PPS (e.g. 1Hz, 2 Hz, 4 Hz ...)
• support to configure the duty cycle of a PPS (e.g. 50% == 500ms high an 500ms
low if rate is configured for 1Hz)
• support to configure the starting point (either rising edge and falling edge) of a
PPS (Please consider this point for the SysT)