# Precision Agriculture: A Remote Sensing Monitoring System Architecture +
## 4 The Network Layer
### The Middleware Layer  
The Middleware Layer is responsible for establishing and controlling the association between IoT sensor devices. More specifically, the services of this layer include smart device management by the use of different transport protocols to forward the generated data from the involved IoT devices. Most of these transport standards use the Transmission Control Protocol (TCP) or the User Datagram Protocol (UDP) for forwarding information. There is a wide variety of data protocols [29] that belong to this layer towards developing an efficient managing platform for smart field devices. However, choosing the most appropriate device management technology depends on software and hardware specifications, network and technology architecture and communication standards being used in the according system to achieve maximum and efficient performance. In the view of using different kind of smart entities in an agriculture monitoring system, the services of this architectural layer facilitate the desired interoperability of the technologies introduced. All collected data will be stored on a remote server and transmitted to the client machine through Application Programming Interfaces (APIs) that provide web services for third-party users. APIs enable device communication in an application level for different kinds of purposes and are based on different architectures to transfer data from the server to the client. * The MQTT-SN (Message Queuing Telemetry Transport For Sensor Networks) is a messaging protocol that facilitates device data collection and communication with servers using brokers. A broker is a network entity which arranges transactions between other network entities. By using the MQTT protocol, a precision agriculture monitoring system can enable smart sensor devices to publish messages to a broker and/or subscribe to a broker in order to receive certain messages. The exchanged messages will be organized by topics that act as a system for dispatching messages to subscribers. * The CoAP (Constrained Application Protocol) is another popular protocol for IoT device data management. CoAP is based on a request/response pattern of communication allowing constrained devices to have web service functionalities. It is an HTTP-like web transfer protocol with the ability to extend the Representational State Transfer (REST) architecture to Low-Power Wireless Personal Area Networks (LoWPANs). REST is an architectural style for providing standards between computer systems on the web, while distinguishing the concerns of client and server. * The XMPP-IoT (Extensible Messaging and Presence Protocol) is an open technology for real-time communication based on XML messages between connected devices and the available server. XMPP can efficiently power instant messaging, collaboration and content syndication in a smart farm monitoring system between all network entities. * Device and asset management in a precision agriculture monitoring system can also be implemented using the Mihini [30] software. Mihini is an open-source project by Eclipse Technology that enables communication between an M2M server and the applications running on an embedded gateway. M3 DA is the protocol used for the transport of M2M data. M3 DA can allow user applications to exchange typed data/commands back and forth with an M2M server, in a way that optimizes the use of bandwidth. * The OMA SpecWorks's Lightweight M2M [31] is another device management protocol for M2M or IoT devices. It can be used in a smart farming information system to efficiently transfer service data from the network to resource-constrained devices. In contrast to traditional M2M standards in which a device usually needs to keep up multiple stacks of technologies, protocols and security services, the LwM2M scheme allows the existence of one stack of technology for device management, not only on the level of the device itself, but also on the application level. In addition, LwM2M is based on protocol and security standards from the Internet Engineering Task Force (IETF).