IEC 61375 TRDP protocol

Description of the IEC 61375 TRDP protocol implementation in the Typhoon HIL toolchain.

The IEC 61375 (IEC 61375 – Train Real-Time Data Protocol [1]) standard specifies Train Communication Network for usage in railway vehicles (trains) mainly intended for the exchange of Train Control and Management system related information, among other applications. This protocol is used for information exchange between Ethernet Train Backbone Nodes connected by Ethernet.

The TRDP protocol has been defined as the standard communication protocol in IP-enabled trains. It allows communication via process data (periodically transmitted data using UDP/IP) and message data (client - server messaging using UDP/IP or TCP/IP).

TRDP is executed by a TRDP layer which is placed on top of the TCP/UDP transport layer. This layer may optionally be extended by a safety layer which provides secure end-to-end data transmission of the safety critical process data and message data between any two end devices in the network.

All TRDP data on wire is defined as big endian and byte alignment. Possible marshalling of user data needs to be done by a specific service primitive called from the application layer before calling the TRDP service primitives to send data. Additionally, a possible unmarshalling of user data needs to be done at application level after receiving data from the TRDP layer. An overview of the protocol stack is shown in Figure 1.
Figure 1. Overview of the TRDP protocol stack

Typhoon HIL devices only support process data at this time.

Process Data

The TRDP process data protocol defines the exchange of PD-PDUs for the transfer of process data.

PD-PDUs shall be cyclically transmitted or transmitted on request between a publisher and one or more subscribers using a connectionless and unconfirmed TRDP service. The publisher has a role of the source of process data, while the subscriber is the sink of the process data. The structure of the PD-PDU is defined in Figure 2 .
Figure 2. PD-PDU structure
Table 1. PD-PDU structure information
Name Type Description
sequenceCounter UINT32 Message sequence counter
protocolVersion VERSION Protocol version
msgType UINT16 Type of the messge
comId UINT32 Communication identifier
etbTopoCnt UINT32 etbTopoCnt value
opTrnTopoCnt UINT32 opTrnTopoCnt value
datasetLength UINT32 Length of the array 'dataset'
reserved01 UINT32 Reserved for future user (=0)
replyComId UINT32 Requested communication identifier
replyIpAddress UINT32 Reply IP address
headerFcs UINT32 Header checksum
dataset UINT8 [datasetLength] User data set

TRDP Configuration Database

In order to exchange data over a Train Communication Network, TRDP needs to be configured, e.g. with information on how to handle the data, where to send data, etc. This information is stored in a Configuration Database. The database can be populated from a configuration file in XML-format [2].
<device attributes> 
  <device-configuration attributes/> 
  <bus-interface-list> 
    <bus-interface attributes>
      <telegram attributes >
        ...
      </telegram>
        ...
    </bus-interface>
    ...
  </bus-interface-list>
  <com-parameter-list>
    <com-parameter attributes/>
    ...
  </com-parameter-list>
  <data-set-list>
    ...
    <data-set>
    ...
   </data-set-list>
   <debug attributes/>
</device>

The XML structure above allows for message customization in the following ways:

  • Device configuration can be used to initialize the TRDP stack of a device.
  • Parameters given with the bus interface configuration can be used as parameters to initialize a specific TRDP session.
  • Communication parameter information describes in which way the communication should take place. In most cases, one set of parameters is sufficient but it is possible to specify specific communication parameters for special situations.
  • Data communication over the Ethernet Train Backbone is done with DataSets. A DataSet is a container of data items, similar to a structure in C language. A DataSet can be up to 1432 bytes long.

TRDP in the Typhoon HIL toolchain

TRDP is implemented in Typhoon HIL software by using the TCNOpen open source C library. It is supported by the following Typhoon HIL devices: HIL402, HIL404, HIL602+, HIL604, and HIL606.

TRDP communication includes two end devices: publisher and subscriber. They use UDP sockets to exchange information in the publisher to subscriber direction. TRDP subscriber binds to the socket, representing the role of the server in socket communication, while the publisher represents a client. It is important to note that the publisher has no means to know if the subscriber received the messages correctly.

One xml configuration file should be implemented on one schematic. There can be multiple TRDP publisher/subscriber components which use different interfaces, but these interfaces should be defined within the same xml configuration file.

Example models for both Publisher and Subscriber are located in Examples Explorer, and example configuration files are located in the accompanying \configuration_files subfolder.

TRDP Publisher

The TRDP Publisher component dialog window is shown in Table 2.

Table 2. TRDP Publisher
component component dialog window component parameters

TRDP Publisher

  • Path to configuration file
  • Telegram IDs
  • Host IP
  • Interface ID
  • Destination IPs and IDs
  • Execution rate

The TRDP Publisher component is configured by importing a file that describes the Publisher device. If the file is properly formatted, TRDP publisher data will be processed and all the extracted information regarding the Telegram com-ids, bus interface IP, bus interface IDs, as well as destination IPs and IDs that are defined in the .xml file will be parsed according to their respective properties in the component dialog window. You can use the combo box to select a possible interface ID, and based on this selected interface, you can choose which telegrams to publish. This is done either by adding/removing telegram IDs from a Telegram ID list or by selecting desired telegrams from the Configuration preview window shown in Table 3.

Figure 3 shows the TRDP Publisher dialog window after the configuration file has been loaded and all properties have been filled based on the .xml file.

Figure 3. TRDP Publisher component properties

In the Telegram IDs property, telegram-com-ids are listed for the first bus interface. The list of telegram IDs can't contain com-ids of telegrams that are not defined in the xml configuration file. Some telegrams that are defined in the configuration file can be excluded, but the list has to have at least one telegram com-id.

Only one bus interface per TRDP Publisher can be published from; the IP of that interface is parsed to the Host IP property. You can change the IP so it differs from the one in the xml file without editing xml file and loading it again.

All bus interfaces from the configuration xml file are listed in the Interface ID combo box, where you can choose which interface to publish from.

Telegrams are published to specific end devices. Each telegram's destination ID and destination IP are shown in the Destination IPs and IDs property. You can edit that property without changing the xml configuration file and loading it again. To add/edit a destination, simply write a list of dictionaries to the Destination IPs and IDs field in the following format: [{'com-id': 1001, 'id': 1, 'ip': '192.168.20.202'}].
  1. 'com-id' - com-id of referenced telegram
  2. 'id' - ID of source, each source that references the same telegram has a unique ID
  3. 'ip' - IP of end device to receive message
Table 3. TRDP Publisher Configuration preview dialog window
Telegrams tab Data sets tab Bus interface tab

In the Telegrams tab, a table of possible telegrams is shown, based on the bus interface selected in the Interface ID property. It is possible to choose which telegram to publish by checking the "Include" button in the last column.

The Data sets tab describes the configuration of all datasets in xml configuration. Every dataset is described in its own tab, which is named by its dataset ID. Multiple telegrams can reference the same dataset.

The Bus interface tab shows the Bus interface configuration in three tables, each representing one attribute of the Bus interface tag in the xml configuration file.

After setting up the configuration, the TRDP Publisher component will have as many ports as dataset elements, and each port will have a dimension corresponding to its dataset element. The name of the port will contain the name of the dataset element if it is defined; if not, the port will be titled "name". A TRDP Publisher component with a pre-loaded "publish.xml" configuration from example folder and its connected ports is shown in Figure 4.
Figure 4. TRDP Publisher component with SCADA inputs

To successfully establish TRDP communication, all devices communicating through TRDP messages must be on the same network and subnet.

TRDP Subscriber

The TRDP Subscriber component dialog window is shown in Table 4.
Table 4. TRDP Subscriber
component component dialog window component parameters
  • Path to configuration file
  • Telegram IDs
  • Host IP
  • Interface ID
  • Destination IPs and IDs
  • Execution rate

The TRDP Subscriber component is configured by importing a file that describes the Subscriber device. If the file is properly formatted, TRDP Subscriber data will be processed and all the extracted information regarding the Telegram com-ids, bus interface IP, bus interface IDs, as well as source IPs and IDs that are defined in the .xml file will be parsed according to their respective properties in the component dialog window. You can use the combo box to select a possible interface ID, and based on this selected interface, you can choose which telegrams to subscribe to. This is done either by adding/removing telegram IDs from a Telegram ID list or by selecting desired telegrams from the Configuration preview window shown in Table 5.

Figure 5 shows the TRDP Subscriber dialog window after the configuration file has been loaded and all properties have been filled based on the .xml file.

Figure 5. TRDP Subscriber component properties

In the Telegram IDs property, telegram-com-ids are listed for the first bus interface. The list of telegram IDs can't contain com-ids of telegrams that are not defined in the xml configuration file. Some telegrams that are defined in the configuration file can be excluded, but the list has to have at least one telegram com-id.

Only one bus interface per TRDP Subscriber can be subscribed to; the IP of that interface is parsed to the Host IP property. You can change the IP so it differs from the one in the .xml file without editing the .xml file and loading it again.

All bus interfaces from the configuration xml file are listed in the Interface ID combo box, where you can choose which interface to subscribe from.

Telegrams are subscribed to specific end devices. Each telegram source ID and source IP is shown in the Source IPs and IDs property. You can edit that property without changing xml configuration file and loading it again. To add/edit a source, simply write a list of dictionaries to the Source IPs and IDs field in the following format: [{'com-id': 1001, 'id': 1, 'ip': '192.168.20.202'}].
  1. 'com-id' - com-id of the referenced telegram
  2. 'id' - ID of source, each source that reference same telegram have unique ID
  3. 'ip' - IP of end device to receive message
Table 5. TRDP Subscriber Configuration preview dialog window
Telegrams tab Data sets tab Bus interface tab

In the Telegrams tab, a table of possible telegrams is shown, based on the bus interface selected in the Interface ID property. It is possible to choose which telegram to subscribe to by checking the "Include" button in last column.

The Data sets tab, describes the configuration of all datasets in xml configuration. Every dataset is described in its own tab, which is named by its dataset ID. Multiple telegrams can reference the same dataset.

The Bus interface tab shows the Bus interface configuration in three tables, each representing one attribute of the Bus interface tag in the xml configuration file.

After setting up the configuration, the TRDP Subscriber component will have as many ports as dataset elements, and each port will have a dimension corresponding to its dataset element. The name of the port will contain the name of the dataset element if dataset element name is defined; if it is not, defined, the port will be titled "name". A TRDP Subscriber component with a pre-loaded "subscribe.xml" configuration from the example folder and its connected ports is shown in Figure 6.
Figure 6. TRDP Subscriber with connected outputs

Virtual HIL support

Virtual HIL currently does not support this protocol. When using a Virtual HIL environment (e.g. when running the model on a local computer), inputs to this component will be discarded and outputs from this component will be zeroed.

References

  1. Institut za standardizaciju Srbije (ISS) "SRPS EN 61375-2-3:2016", 2016, pp. 124 - 136
  2. Institut za standardizaciju Srbije (ISS) "SRPS EN 61375-2-3:2016", 2016, pp. 195 - 214