Method for industrial communication via TSN
11153416 · 2021-10-19
Assignee
Inventors
- Franz-Josef GÖTZ (Heideck, DE)
- Jürgen SCHMITT (Fürth, DE)
- Thomas Talanis (Heroldsbach, DE)
- Frank Volkmann (Nuremberg, DE)
Cpc classification
H04L65/65
ELECTRICITY
H04L67/12
ELECTRICITY
International classification
G05B19/418
PHYSICS
Abstract
A method is provided which enables industrial communication via the TSN protocol by means of sockets. Owing to the described method, the possibility of communicating with the socket programming known to the programmer via TSN streams is provided. As a result, simple use of the new TSN quality for simple Internet (IP) programming is possible. Existing applications can easily be expanded for TSN and can therefore benefit from the robustness of TSN in a simple manner. In addition, parallel operation is possible; the same mechanism is always used.
Claims
1. A method for industrial communication by an application via time-sensitive networking (TSN) from a TSN server to at least one TSN client by means of OPC-UA (Object Linking and Embedding for Process Control-Unified Architecture), the method comprising: a) in a configuration phase, establishing a data stream with the following steps: creating a socket and setting up a connection of the application to a TCP/IP stack, binding the created socket to an address of a TSN driver, configuring the connection of the created socket by transmitting reservation parameters from the application to the created socket, establishing a TSN stream and setting by means of the TSN driver a StreamID which is returned to the application, communicating the StreamID to the at least one TSN client, and b) in a productive phase, after the TSN stream is established with at least one receiver in the form of the at least one TSN client, transmitting user data to the at least one TSN client using the socket.
2. The method of claim 1, wherein a separate communication class is used for creating the socket for the TSN and binding the created socket to the address.
3. The method of claim 1, wherein an address structure used for binding the created socket to the address includes an IP address and an identifier for the TSN stream.
4. The method of claim 1, wherein the established TSN stream can be changed only by closing the established TSN stream and freshly setting up a new TSN stream.
5. The method of claim 1, wherein the established TSN stream is closed automatically when a fault occurs or when the at least one TSN client is not connected to the TSN server.
6. The method of claim 1, wherein when the TSN stream is established, a time window is defined that indicates the period after which the established TSN stream is automatically closed when the at least one TSN client is not connected to the TSN server.
7. The method of claim 1, wherein the application comprises Publish-Subscribe (PUB-SUB) messaging.
Description
BRIEF DESCRIPTION OF THE DRAWING
(1)
(2)
(3)
(4)
DETAILED DESCRIPTION OF PREFERRED EMBODIMENTS
(5) In order to implement the concept, a new communication class is defined in the IP environment (today SOCK_DGRAM (UDP) and SOCK_STREAM (TCP)—this is complemented by SOCK_TS_STREAM (TSN)).
(6) To expand the address structure, a new address family is moreover defined (AF_INET_TS). The address structure then contains not only the IP address but also the stream ID.
(7) Such expansions are provided for in the TCP/IP environment.
(8) Establishing the connection at the talker end is depicted by way of example and analogously to
(9) An application produces a socket with this new class and the new address family. socket=socket (AF_INET_TS, SOCK_TS_STREAM, 0)
(10) In the second step, this socket is bound to an address. This binding produces a specific connection to a network card (and hence also to the correct TSN driver in the destination network). The address structure follows the newly defined address family; the stream ID in the structure is 0. bind (socket, address, address_len)
(11) Hence, the connection between socket OS (application) and network card TSN (TSN driver) is produced.
(12) This special TS_STREAM socket is in the configuration mode; such a mode is not known to UDP.
(13) In the configuration mode, the application sends the reservation parameters (TSpec, etc.) to the socket using the send( ) standard.
(14) Alternatively, the configuration data can also be transferred to the driver using ioctl( ) (via the socket).
(15) The TSN driver evaluates these data. The new TSN stream is established. The TSN driver returns the StreamID it has generated to the application from this new stream via the socket.
(16) The application reads this stream ID from the socket and can send it to potential listeners “out of band” (e.g. via another TCP connection).
(17) Only when one or more listeners link to this stream in the network does the TSN driver send the event of complete establishment of the stream to the application via the socket. As a result, the configuration mode is left and the application begins to cyclically send the user data to the socket (productive mode).
(18) From this mode, there is no way provided to return to the configuration mode. Should this be necessary, this stream needs to be closed and set up afresh.
(19) If faults occur in the productive mode, e.g. all listeners have disconnected, the TSN driver closes the connection. The application therefore knows that there are no further listeners there, or the stream no longer exists for another reason. During the configuration phase, the application can set a timeout for how long the TSN driver maintains the stream if there are no listeners present.
(20) Establishing the connection at the listener end:
(21) The listener is provided with the address having a stream ID as well as an (optional, application-oriented) content description of the stream “out of band” (e.g. via a separate TCP connection).
(22) The listener produces a socket having the same new class as described above. socket=socket (AF_INET_TS, SOCK_TS_STREAM, 0)
(23) In the second step, this socket is bound to the local address. This binding produces a specific connection to a network card (and hence also to the correct TSN driver in the destination network). The address structure contains not only the IP address but also the stream ID.
(24) The overwritten address structure is denoted by the address family AF_INET_TS. bind (socket, address, address_len);
(25) After the successful bind, the listener is immediately in the productive mode and awaits the cyclic packets of the talker. Packets from the stream are received by means of RecvFrom( ); the address used for RcvFrom (parameter: src_Adress) is the stream address received via “out-of-band”. recvfrom (socket, buffer, length, flags, src_addr, src_len)
(26) To clarify: a listener will never send to the socket. Communication in the case of TSN is always unidirectional from precisely one talker to any number of listeners.
(27) If the listener wishes to disconnect, he closes the socket. Close(Socket);
(28) The method described provides the possibility of communicating using socket programming, known to the “Internet” programmer, via TSN streams. This allows simple use of the new TSN quality for simple Internet (IP) programming.
(29) Existing applications can be expanded for TSN without great complexity, so that they easily benefit from the robustness of TSN.
(30) Parallel operation is possible “seamlessly”—the same mechanism is always used.