## 3 Design  
Figure 3 shows the proposed OEC IoT architecture for an IIoT environment, focusing on pallet asset management, autonomous vehicles, and wearables. Such an architecture is composed of three main layers:  
* IoT Network Layer: this layer contains IoT nodes deployed at different spots in a shipyard. These nodes are connected to elements such as pallets, autonomous vehicles, and wearables, allowing them to monitor and exchange relevant data among them. Pallets can be equipped with sensors that allow for the identification and monitoring of their position and/or status. Autonomous vehicles are connected to the IoT network to facilitate the collection and transportation of goods, possibly with constant communication to receive route instructions or real-time updates. Wearables are carried by operators and are used for activity tracking or for monitoring their status and location.
* OEC Smart Gateway Layer: this layer consists of OEC gateways that serve as intermediaries between the IoT nodes in the local network and the Cloud. Each gateway is responsible for aggregating and processing the information coming from the different IoT nodes in the lower layer and for transmitting such information to other gateways or to the Cloud if necessary. Gateways communicate with each other, allowing data to flow dynamically and flexibly. This communication between gateways enables creating a distributed network that can operate even if part of the network loses its connectivity. In order to ensure that the functionality of the Gateways is not affected,it is necessary to assume that they have sufficient resources, such as a stable power supply and a sufficiently high processing capacity.
* Cloud layer: this layer provides a centralized platform for managing large amounts of data, long-term storage solutions, and long-distance communications that may not be possible through edge-based processing.  
To develop the previously described architecture, the protocol stack shown in Figure 4 was devised. The lower protocols of such a stack manage data transmission and linking, while the Opportunistic Network Layer (OEC Network Layer) handles critical discovery and routing services in the distributed network. The Application Layer employs such services to provide functionality and value to users and end devices. Specifically, such layers operate as follows:  
* The Physical (PHY) Layer is in charge of sending data at the hardware level, via physical media such as radio waves or any wireless or wired communications technique.
* The Link Layer manages the data link and assures packet transfer between nodes that are directly linked to one another. Error detection and node synchronization are handled here.  
Figure 3: Proposed opportunistic communications architecture.  
* The Network Layer enables the movement of data packets between devices that are not physically linked. Thus, it defines how data are transported across network nodes.
* The Transport Bridge acts as an intermediate layer between the lower layers and the Opportunistic Network Layer (OEC). It is responsible for facilitating interoperability between the protocols and different technologies at the upper and lower layers.
* The OEC Network Layer is dedicated to managing the characteristics of opportunistic networks. It includes three key services:
* Peer discovery: in charge of finding nearby nodes or devices, allowing opportunistic nodes to connect when they are in communication range.
* Peer routing: manages how data should be routed between peers (nearby devices). Thus, it selects the best routes based on node availability and capacity.
* Data routing: similar to peer routing, but focused on managing the effective transfer of data between network nodes, ensuring that information reaches its destination efficiently, even with the presence of intermittent links.
* Finally, the Application Layer is responsible for displaying data to end users or systems and for providing the interface for users to interact with the IoT network.