In the OSI model, Data Link Layer protocols are concerned with establishing/terminating a connection between two nodes and ensuring reliable data transfer. They also implement protocols for flow-control between the nodes.
Overview
LIN is a broadcast-serial network. The data link layer implements a Master-Slave principle for medium access control. All messages are initiated by the Master with at most one Slave replying to a given message identifier. The Master node controls the issuance of data frames on the bus, makes sure that they are sent with the right interval and periodicity, and that every frame gets enough time space on the bus.
The LIN network is described by a LIN Description File (LDF), which contains information about frames and signals (including timing). This file is used for the creation of software drivers in both Master and Slave nodes.
The LIN bus was designed to transport short control messages (2, 4, or 8 bytes). The data that are exchanged in the frames are referred to as Signals.
The LIN data transfer model is based on the publish-subscribe model, for example:
Note:
- Frame Slot A, Frame Slot B, and Frame Slot C are cyclic (i.e. they cycle regularly through all the nodes).
- The Nodes that reply to the header are the PUBLISHERS.
- The Nodes that listen are the SUBSCRIBERS.
- Frame Slot A
- Point-to-Point (Slave-to-Master or Slave-to-Slave) communications.
- SLAVE1 Publishes and MASTER and/or SLAVE2 Subscribes.
- Point-to-Point (Slave-to-Master or Slave-to-Slave) communications.
- Frame Slot B
- Multicast (Master-to-one-or-more Slaves) communications.
- MASTER Publishes and SLAVE1 and/or SLAVE2 Subscribes.
- Multicast (Master-to-one-or-more Slaves) communications.
- Frame Slot C
- Point-to-Point (Slave-to-Master or Slave-to-Slave) communications.
- SLAVE2 Publishes and MASTER and/or SLAVE1 Subscribes.
- Point-to-Point (Slave-to-Master or Slave-to-Slave) communications.
Summary
A LIN cluster contains (at most) 1 node designated as the LIN-Master:
- Contains a Master Task which sends Headers at regular intervals based on the LDF.
- Contains a Slave Task which either:
A LIN cluster contains up to 16 nodes designated as LIN-Slaves: