Hands-On Industrial Internet of Things
上QQ阅读APP看书,第一时间看更新

Industrial protocols

The reference model for computer networks is the Open Systems Interconnection (OSI) model, which was developed by the International Organization for Standardization (ISO). It is a conceptual model to which the computer networks, makers can refer to rather than a precise description of a real network. In the ISO/OSI model, every node of the network can be sketched as a hierarchical structure of seven levels, as shown in the following diagram:

Functional layers in the ISO/OSI model

The functional layers in the OSI model are explained as follows:

  • The first level, starting from the bottom, is level 1, or the physical level. This includes the mechanical and electrical connections between the nodes, together with the software drivers for the communication ports. The features of this level establish some parameters of the network, such as the speed and the transmission mechanisms.
  • The second level is the data link. Like all of the following levels, it is implemented in the network software of each node. This level is responsible for the exactness of the flow of the structured sequences of bits that are exchanged between the nodes. These are also called frames. These frames are composed of the information to be transmitted, plus a control code that is added at the beginning and checked upon arrival. If an error occurs, an attempt to restore the right sequence is carried out using the control code that was added. If the attempt fails, the re-transmission of the corrupted sequence of bits is requested. The primary responsibility of this level is to ensure an error-free connection between the nodes.
  • The third level, the network level, guarantees a logical path between two nodes that are not directly connected. This level defines the characteristics of the network from a management perspective, such as the node addresses, the regulation of the accesses, and the treatment of the collisions. In summary, this level implements the routing and the interconnections between the nodes.
  • Level 4, the transport level, independently implements the transport functions of the network structures of the underlying lower levels, ensuring the transfer and the integrity of the messages and their re-transmission, if necessary. It acts as an interface between the network and the application software of the next three levels.
  • From level 5, the session level, we enter the user area. This level manages the ordinary data exchange and the synchronism between the nodes, making the remote connection possible. This level therefore includes the functionalities necessary to support the exchange of information between different machines.
  • Level 6, the presentation level, is the level where the information is encoded and vice versa. The sequences of the binary data are related to their meaning and represented in the form of texts, figures, and so on.
  • Level 7, the application level, provides interfaces and services to application programs, such as file transfers between nodes, distributed databases, web applications, and so on.

In summary, the ISO/OSI model can be described as follows:

  • The real physical connection between the nodes only exists at the first level. For all other levels, there is a virtual connection.
  • Each level is responsible for a defined set of functions such as coding, fragmentation, or routing. These are implemented by specific entities or functional blocks.
  • Each level can interact with the level below and above on the same node. Each level can also interact with the same level on other nodes.
  • In passing the sequences of bits (data packets) from one level to a lower one, a piece of information is added to mark and identify it. This is known as a Protocol Data Unit (PDU).
  • Each level adds its own PDU to the information received from an above level and removes it if the information comes from a level below. This is known as an encapsulation technique.

The main features that differentiate these computer networks are their topology, the transmission media, and the mechanism or protocol for accessing the network. The topology defines the physical schema of the network, or how the different nodes are connected to each other. The following are some examples of topologies:

  • An example of a topology is the bus or open loop. This topology does not have any problem adding or deleting nodes, since the information moves independently, but there is only one possible route between the nodes.
  • Another example is the ring or closed loop, in which the messages cross the nodes. In this case, the latter must be able to identify which node is the receiver of the message and eventually send it back.
  • A further example is the star topology, where a primary node is connected directly to all other nodes. All messages have to go through the primary node.

Hybrid topologies are also possible.

Transmission media defines the physical support through which the information flows. Its characteristics obviously have a direct influence on network performance. The simplest transmission media is the twisted pair, which can either be shielded or not. Other transmission media include the following:

  • Coaxial cable: This is more difficult to install, but it does support multiple modulated transmission channels at different frequencies due to its bandwidth.
  • Optical fibre: This is the best transmission medium in terms of its transmission rate, immunity to noise, and the possibility of having multiple channels inside the same physical media. However, it is more expensive and its installation is more hardworking.
  • Powerline: These use low powerlines from between 230 and 400 V to transmit a frequency modulated signal. They can reach speeds of a few hundred KBps, but there is often noise on the network.
  • Wireless networks: These use infrared frequencies and industrial field radio frequencies. They do not require wiring, but they suffer from interference problems and noise.

The access method defines how the nodes can access the network and avoid transmission conflicts. Some access methods are explained as follows:

  • Centralized access or the polling method: In this method, a master node systematically interrogates other nodes. It is a deterministic, simple, and reliable method that is easy to manage and implement, but it does not allow high transmission speeds, nor prioritizing the accesses.
  • Token access method: In this method, a specific sequence of bits called a token is sequentially transferred between all of the nodes that are connected to a network with a ring topology, or a token ring. When a station receives the token, it re-transmits it and adds the message within a predetermined time interval. This is a deterministic access method. The ring can be also logical rather than physical and therefore reconfigurable. In this case, we refer to it as a token bus.
  • Carrier Sense Multiple Access/Collision Detection (CSMA/CD): According to this method, each node listens to the current carrier on the transmission media to ensure that the channel is free before transmission. This does not guarantee that there are no collisions. During the transmission, the station keeps listening to detect any collisions; if a collision occurs, the message is re-transmitted after a randomly determined time interval. The main problem with this type of access method is the lack of determinism. Its efficiency also depends on the number of connected nodes.
  • Producer/consumer access method: In this method, one of the nodes is the broker of the network. The nodes are identified either as producers of a specific set of information or consumers of that information. The broker of the network, rather than enabling a node to transmit or preventing it from doing so, allows the communication of a specific set of information implicitly by allowing the node producer to transmit it and the consumers to receive it. The sequence in which the information is enabled to be transferred determines the time needed to update the information, therefore ensuring the determinism of the network.
  • Time division method: In this method, a time range is cyclically assigned to each node to transmit its information. This method ensures full determinism, but it is difficult to implement because you need to have time synchronization between all of the nodes. In addition, sometimes it is assigned to a node to transmit, even if it does not have any communication targets.