Time Sensitive Network

Standard technology for deterministic traffic

Quick Explanation

  • Platform to evaluate the entire vehicle network
  • Can be combined with ECU, RTOS, Autosar and software tasks
  • Configure and optimize the credits allocated for different types of traffic
  • Tune the parameters of the Gateway
  • Evaluate the response times for CDT, AVB class A, AVB Class B and Best Effort traffic
  • Compute the power consumed by this network

Protocol

  • IEEE802.1Qbv- Time Aware Shaping
  • IEEE8201.Qbu and IEEE 802.3br- Preemption
  • IEEE 802.1Qca- Path Control and Reservation
  • IEEE 802.1Qcc- Stream Reservation protocol
  • IEEE 802.1Qci- Per stream filtering and policing
  • IEEE 802.1QCB- Frame replication and elimination
  • IEEE 802.1Qch- Cyclic frequency and forwarding
  • IEEE 802.1AS- Enhanced generic Precision Time Protocol
  • TC10 Sleep/Wake-up
  • 10Base-T1S

Overview

Due to the increased requirements in multimedia applications and driver assistance systems, the sheer volume of communication data in queue is continuously increasing. New gateway IP with dramatically improved functionality is required. CAN and Ethernet has come together and now the gateway has to handle both. Gateways have to bridge CAN networks via a backbone Ethernet. The model and the Gateway designed on VisualSim, implement the following standards:

IEEE802.1Qbv- Time Aware Shaping

IEEE 802.1Qbuand IEEE 802.3br- Pre-emption

IEEE 802.1Qca- Path Control and Reservation

IEEE 802.1Qcc- Stream Reservation protocol

IEEE 802.1Qci- Per stream filtering and policing

IEEE 802.1QCB- frame replication and elimination

IEEE 802.1Qch- Cyclic frequency and forwarding

IEEE 802.1AS- Enhanced generic Precision Time Protocol

TC10 Sleep/Wake-up

10Base-T1S

Explanation

Traffic must be of the AVB traffic profile. This traffic will go to other Ethernet network via Gateway or to another node on the same network. In this model frame and signal routing are both supported.

All Ethernet packets including AVB is having a VLAN tag called Task_Priority. Incoming Frames are allotted to their respective priority queues. The highest priority is given for CDT, then AVB classes A and B, then for priorities from 7 to 0 in that order. Time Aware Shaper is used for opening the gates at the required time. User can configure how the gates should work. In the model developed, we allotted first slot to the CDT. The parameter CMI is used for defining the period for which the CDT can be transmitted. If the first slot is named as CDT and another class of data is allocated in that CDT slot, then that class of frames will also enjoy the same privileges that the CDT frames enjoy, but only during the CDT slot alone. If the frame size is greater than the Max size allowed then fragmentation takes place. All the fragmented packets are put together before sending it out to its end destination. For the time slots which are designated to send AVB, we deploy Credit Based Shaper for sending those frames out. For implementing CBS, we are using the parameters SendSlope and IdleSlope. IdleSlope is used to build-up the credit. There is an upper cap for the amount of credit which can be accumulated. It is called as hiCredit. Similarly there is a lower limit called loCredit. SendSlope is decremented at the rate of transmission rate from the IdleSlope. Once a packet has started transmitting, the SendSlope must go on decreasing until the completion of that transmission. At the end of that transmission, if the SendSlope is negative and there were some packets available in the queue, then it will have to build-up enough credit, at least a credit of zero for transmitting again. If at the end of transmission, if there were no available packets in the queue, then IdleSlope must build-up to zero and wait for the next packet to come onto the queue. IdleSlope can build-up the credit only when the packet is available in the queue. Otherwise it should be locked on to credit zero.  Best Effort packets get to send if both A and B are not having enough credits or if both their queues are empty. Another parameter we makes use is MIF. MIF tells the maximum number of packets which can be send during that CMI. After all the slots get a chance each to complete, then the execution goes to the guard band. During guard band both AVB and BE are allowed to send but ensures that they don’t cross onto the next slot. If the packet size is greater than what can be send during guard band, then that packet is fragmented and is send out.

Each of the frames coming into the Switch will have an identifier called “Hash_Id” which is used by the Switch to determine its forwarding path, generate statistics etc.

Parameters

These are some of the important parameters and databases used in the model.

Switch_Name is the parameter which is used to set a unique name for the TSN_Switch. If we have multiple TSN_Switches in the model, then we must make sure that each of the TSN_Switches have unique name.

Switch_Speed_Mhz is the parameter which is used to specify the clock speed of the TSN_Switch. This is used to determine the processing delay across the TSN_Switch.

MTU is the parameter which is used for defining the max size of a packet which can be transmitted.

Fwd_DB is the table which is used for defining forwarding path for each Hash_Id. We can also specify the Priority level for the frame using this table (unless the workload generator generates dynamic frame configurations which already contains the priority details)

Priority_DB is the table which is used for allocating the BW to each type of priority. User can select whether the BW allocated should be all the same in all gateways or whether it should vary from gateway to gateway with the help of a switch parameter called Use_General_Priority.

AVB_Class_to_Priority_DB is the table which is used to define which priority class A and B have been allocated to. As with Priority_DB, here also user can select whether the priority selected should be common to all gateways in the model or to have separate priorities for each gateway. This can also be selected by setting a switch parameter called Use_General_Priority.

Gate_Control_List is the table which is used for defining the number of time slots that the user wish to have. During each time slot, the gates are opened and closed according to how user wishes. This table is used to enter values for CMI, MIF and which gates are to be opened during this time interval.

Guard_Band is the parameter which is used to define the time period of the guard band. There is a guard band before first slot in every transaction.

Idle_Slope_A_Mbps is the parameter which is used to define the rate at which credit is accumulated for class A. It is accepted in Mbps.

Idle_Slope_B_Mbps is the parameter which is used to define the rate at which credit is accumulated for class B. It is accepted in Mbps.

Send_Slope_A_Mbps is the parameter which is used to define the rate at which credit is used up for class A. It is accepted in Mbps.

Send_Slope_B_Mbps is the parameter which is used to define the rate at which credit is used up for class B. It is accepted in Mbps.

Switching_Mode supports two mode of operation. Store_and_Forward and Cut_Through. Under “Store_and_Forward”, all the fragments are assembled together at the destination port before sending it out to the destination device, whereas in “Cut_Through”, all the fragments are sent out immediately.

Link_Bandwidth_Mbps is the parameter which is used to define total Bandwidth for each of the link.

Max_Scheduler_Buffer_Len is the parameter which is used to define the total buffer size of the scheduler at each port interface.

Resource_Controller is the parameter which lets user configure whether to use TSN Scheduler or other scheduling algorithms like Strict Priority, FCFS, LIFO, Round Robin, Weighted Round Robin, Weighted Fair Queuing, Deficit Round Robin, and Round Robin Priority. These other scheduling algorithms can be selected from a pulldown parameter called Scheduling_Algorithm_Non_TSN.

BW_Limiter is the parameter which is used to restrict bandwidth according to the values set in the Priority_DB table.

CDT_Bandwidth_Percentage is the parameter which is used to define the total bandwidth available to CDT class. This is the percentage of Link_Bandwidth_Mbps parameter

Class_A_BW_Percentage is the parameter which defines the percentage of bandwidth that can be used by Class A. Class A shares its bandwidth with a Priority level, typically 5 (can be updated by configuring the parameter AVB_Class_to_Priority_DB ). So this parameter defines, how much of the priority level 5 bandwidth can be used by Class A. If we set this parameter value to be 75.0, then 75% of the bandwidth allocated for priority 5 will be used by Class A.

Class_B_BW_Percentage is the parameter which defines the percentage of bandwidth that can be used by Class B. Class A shares its bandwidth with a Priority level, typically 4 (can be updated by configuring the parameter AVB_Class_to_Priority_DB ). So this parameter defines, how much of the priority level 4 bandwidth can be used by Class B. If we set this parameter value to be 30.0, then 30% of the bandwidth allocated for priority 4 will be used by Class B.

hiCredit is the parameter which defines the upper limit for credit build up (Credit based shaper)

loCredit is the parameter which defines the lower limit for credit usage (Credit based shaper)

Plot_Enabled_Devices is the parameter which can be used to specify the type of statistics that needs to be generated from the TSN_Switch. For example – {“Switch_Stats”} -> this means the TSN_Switch stats will be generated at the end of simulation. { “Switch_Stats”,”ETH0″,”ETH1″} -> this means that on top of Switch stats, sendslope and idleslope plots for packets going through ETH0 and ETH1 port will be generated.  {“ETH0_Separate_Slope_Plots”} -> this means, a more detailed sendslope and idleslope plot for the AVB Class A and B across ETH0 port will be generated.

Save_Stats is the parameter which can be used to specify whether the TSN_Switch stats needs to be saved or not. Once we enable the parameter, a csv file will be generated which provides detailed statistics for each frame sent across the TSN_Switch.

Enable_TC10 is the parameter which is used to enable or disable TC10 Sleep/Wake-up mechanism. We must make sure the link partner supports TC10 signaling. To get started, we could use the Workload_Generator which supports TC10 signaling (Location: Interfaces and Buses-> TSN_Switch -> Workload_Generator)

TC10_Timing_Parameters is a list of parameters which are required to define the TC10 Sleep/Wake-up timing.

Selective_Wakeup_Forwarding is the parameter which is used to determine whether the wakeup signals have to be broadcasted or not. Switches are defined with two options: one is to do selective wakeup forwarding and other is to do a broadcast. So if this parameter is set to a value of false, then wakeup signals are broadcasted to all ports of the switch.

Power_Manager is the parameter which is used to define the Power Manager (PowerTable) name. The defined power manager must contain a state called “Low_Power_Sleep” and define the ports in the following format: “Power_”+Switch_Name+”_”+Port_Name. Port_Names are ETH0,ETH1….,ETH11.

Detailed

idleslope

Idleslope is the rate of credits that is accumulated (in Megabits per second) when there is at least one packet waiting for transmission.  Packets are transmitted when the current value of credits is equal or greater than zero. When there is no packet to be transmitted the amount of credits is set to zero. This is the main tunable of the CBS algorithm and represents the bandwidth that will be consumed.

Equation :

Reservation_value = 55 Mbps
Idleslope = (Reservation_value * 1000000) / 8 = 6.875E6 bps = 6.875 Mbps

sendslope

Sendslope is the rate of credits that is depleted (Megabits per second) when a transmission is occurring. It can be calculated as follows:

Sendslope = (Port transmission rate – Reservation_value)* 1000000) / 8 = 5.625E6 bps = 5.625 Mbps

hiCredit

hiCredit defines the maximum amount of credits (in bytes) that can be accumulated. hiCredit depends on the characteristics of interfering traffic, ‘max_interference_size’ is the maximum size of any burst of traffic that can delay the transmission of a frame that is available for transmission for this traffic class, (IEEE 802.1Q-2014 Annex L, Equation L-3):

hicredit = max_interference_size * (idleslope /Port transmission rate)

loCredit

loCredit is the minimum amount of credits that can be reached:

locredit = max_frame_size * (sendslope / Port transmission rate)

The Ethernet Backbone network

Whenever Ethernet frames are routed through switches, priority rules can be applied. Determined by these rules, the quality of the backbone will be seen by its latency and event jitter.

In automotive applications, the real time conditions and constraints must be achieved and that’s why an Ethernet switch or a router in the automotive system must support Time Sensitive Networking (TSN) and have awareness of its Quality of Service (QoS).

Traffic Classes in IEEE802.1TSN

IEEE802.1TSN (Time Sensitive Networking) is a set of standards to enhance switched Ethernet for time critical industrial and automotive networks.

In addition to AVB class, a time critical Control Data has been added.

The following standards from IEEE have been implemented and those standards are discussed in detail here:

 

IEEE802.1Qbv – Time Aware Shaping

The full title of this PAR is “Standard for Local and Metropolitan Area Networks-Media Access Control (MAC) Bridges and Virtual Bridged Local Area Networks Amendment: Enhancements for Scheduled Traffic”.

This amendment specifies time-aware queue-draining procedures, managed objects and extensions to existing protocols that enable bridges and end stations to schedule the transmission of frames based on timing derived from IEEE Std 802.1AS. Virtual Local Area Network (VLAN) tag encoded priority values are allocated allowing simultaneous support of scheduled traffic, credit-based shaper traffic and other bridged traffic over Local Area Networks (LANs).

Bridges are increasingly used to interconnect devices that support scheduled applications (e.g., industrial automation, process control and vehicle control). This amendment will provide performance assurances of latency and delivery variation to enable these applications in an engineered LAN while maintaining the existing guarantees for the credit-based shaper and best-effort traffic.

The credit-based shaper works well in arbitrary networks (i.e., non-engineered). Networks employing scheduled transmissions are able to control real-time processes. This amendment enables those two kinds of networks to be consolidated into a single network, with a significant cost reduction to the user.

IEEE 802.1Qbu and IEEE 802.3br- Pre-emption

The full title of this PAR is “Standard for Local and Metropolitan Area Networks-Media Access Control (MAC) Bridges and Virtual Bridged Local Area Networks – Amendment: Frame Pre-emption”.

This amendment specifies procedures, managed objects, and protocol extensions that:

  • Define a class of service for time-critical frames that requests the transmitter in a bridged Local Area Network to suspend the transmission of a non-time-critical frame, and allow for one or more time-critical frames to be transmitted. When the time-critical frames have been transmitted, the transmission of the pre-empted frame is resumed. A non-time-critical frame could be pre-empted multiple times.
  • Provide for discovery, configuration, and control of pre-emption service for a bridge port and end station.
  • Ensure that pre-emption is only enabled on a given link if both link partners have that capability.

The purpose of this amendment is to provide reduced latency transmission for scheduled, time-critical frames in a bridged LAN.

A large, non-time-critical frame may start ahead of time-critical frame transmission. This condition leads to excessive latency for the time-critical frame. The lack of transmission pre-emption severely inhibits the capabilities of an application that uses scheduled frame transmission to implement a real-time control network.

IEEE 802.1Qca – Path Control and Reservation

The full title of this PAR is “Standard for Local and Metropolitan Area Networks-Media Access Control (MAC) Bridges and Virtual Bridged Local Area Networks Amendment: Path Control and Reservation”.

This project extends the application of Intermediate System to Intermediate System (IS-IS) to control bridged networks (beyond the capabilities of Shortest Path Bridging) and specifies additional protocols, procedures and managed objects. The new standard will provide explicit path control, bandwidth and stream reservation, redundancy (protection or restoration) for data flows and distribution of control parameters for time synchronization and scheduling.

There is no control protocol that integrates the required control features. The new control protocol will provide explicit forwarding path control thus enabling the use of non-shortest paths. It will also integrate a tool for bandwidth and stream reservation along the forwarding path. Resiliency control mechanisms will be also provided for the data traffic. In addition, the new standard will support carrying control information using IS-IS for time synchronization and scheduling.

IEEE 802.1Qcc- Stream Reservation protocol

The full title of this PAR is “Standard for Local and Metropolitan Area Networks-Media Access Control (MAC) Bridges and Virtual Bridged Local Area Networks Amendment: Stream Reservation Protocol (SRP) Enhancements and Performance Improvements”.

This amendment provides protocols, procedures and managed objects for bridges and end stations that are compatible with existing mechanisms and provide:

  • Support for more streams
  • Configurable SR (stream reservation) classes and streams
  • Better description of stream characteristics
  • Support for Layer 3 streaming
  • Deterministic stream reservation convergence
  • UNI (User Network Interface) for routing and reservations

The first generation of the Stream Reservation Protocol (SRP) has been accepted by the Professional, Industrial, Consumer, and Automotive markets. This set of enhancements extends the capabilities of SRP as requested by those markets.

IEEE 802.1Qci – Per stream filtering and policing

The full title of this PAR is “Standard for Local and Metropolitan Area Networks-Media Access Control (MAC) Bridges and Virtual Bridged Local Area Networks Amendment: Per-Stream Filtering and Policing”.

This standard specifies procedures and managed objects for a bridge to perform frame counting, filtering, policing, and service class selection for a frame based on the particular data stream to which the frame belongs, and a synchronized cyclic time schedule. Policing and filtering functions include the detection and mitigation of disruptive transmissions by other systems in a network, improving the robustness of that network.

The development of standards for Time-Sensitive Networking (TSN) have shown that there exist no interoperable standards that enable a bridge to detect whether or not some systems in a network are conforming to behaviours agreed by configuration and/or protocol exchanges. For example, devices that exceed the allocated bandwidth for one stream can prevent the network from achieving the benefits of TSN for any or all streams, not just the misbehaving stream.

IEEE 802.1QCB – Frame replication and elimination

The full title of this PAR is “Standard for Local and Metropolitan Area Networks-Frame Replication and Elimination for Reliability”.

This standard specifies procedures, managed objects and protocols for bridges and end stations that provide:

  • Identification and replication of frames, for redundant transmission.
  • Identification of duplicate frames.
  • Elimination of duplicate frames.

There are no other 802-compatible solutions providing fault tolerance without failover. To achieve this, it is necessary to create and eliminate duplicate frames. This can be done in end stations and relay nodes (e.g. bridges or routers).

IEEE 802.1Qch – Cyclic frequency and forwarding

The full title of this PAR is “Standard for Local and Metropolitan Area Networks-Media Access Control (MAC) Bridges and Virtual Bridged Local Area Networks Amendment: Cyclic Queuing and Forwarding”.

This amendment specifies synchronized cyclic en-queuing and queue draining procedures, managed objects, and extensions to existing protocols that enable bridges and end stations to synchronize their transmission of frames to achieve zero congestion loss and deterministic latency.

This amendment specifies a transmission selection algorithm that allows deterministic delays through a bridged network to be easily calculated regardless of network topology. This is an improvement of the existing techniques that provides much simpler determination of network delays, reduces delivery jitter, and simplifies provision of deterministic services across a bridged LAN.

IEEE 802.1AS – Enhanced generic Precision Time Protocol

The full title of this PAR is “Standard for Local and Metropolitan Area Networks – Timing and Synchronization for Time-Sensitive Applications in Bridged Local Area Networks”.

This standard specifies the protocol and procedures used to ensure that the synchronization requirements are met for time sensitive applications, such as audio and video, across Bridged and Virtual Bridged Local Area Networks consisting of LAN media where the transmission delays are fixed and symmetrical; for example, IEEE 802.3 full duplex links. This includes the maintenance of synchronized time during normal operation and following addition, removal, or failure of network components and network reconfiguration. It specifies the use of IEEE 1588 specifications where applicable in the context of IEEE Stds 802.1D and 802.1Q. Synchronization to an externally provided timing signal (e.g., a recognized timing standard such as UTC or TAI) is not part of this standard but is not precluded.

This standard enables stations attached to bridged LANs to meet the respective jitter, wander, and time synchronization requirements for time-sensitive applications.

Analysis

For the purpose of analysis, Latency and buffer stats are being plotted. The latency plotted is between the end time ie..the time at which the packet reached its destination and with the time that packet got popped out of the queue. The buffer stats are plotted by checking the queue every 1 microsecond. From the plot you can see an increase in the queue depth for class 3. It is because for this model, as a test case we haven’t allocated any bandwidth for class 3. Since there is no bandwidth allocated, those packets with no bandwidth cannot be transmitted.