A Survey on the Role of IoT in Agriculture for the Implementation of Smart Livestock Environment

The Internet of Things (IoT) is an emerging paradigm that is transforming real-world things (objects) into smarter devices. IoT is applicable to a variety of application domains including healthcare, smart grid, and agriculture. This domain has started revolutionizing the agriculture industry by providing smart solutions for precision farming, greenhouse management, and livestock monitoring. This article aims to present a comprehensive survey on the role of IoT in the Livestock field by categorizing and synthesizing existing research work in this area. To this end, a detailed discussion has been provided on IoT network infrastructure, topologies and platforms employed for livestock management. In addition, a list of communication protocols and connections of IoT-based livestock systems with relevant technologies have also been explored. Furthermore, numerous IoT-based livestock monitoring, controlling, and tracking applications have been discussed. Apart from this, it also analyses distinct security issues in IoT-based livestock field and developed a collaborative security model to detect and minimize the security risk. Lastly, pertinent open research challenges in the domain of IoT-based livestock management have been presented with future research directions.


I. INTRODUCTION
Internet of Things (IoT) is an emerging paradigm that connects the physical and digital worlds to solve real life problems. IoT forecasts the interconnection of a wide variety of intelligent things/objects in our surroundings, which have the ability to accumulate processes and communicate data [1]. IoT has brought great attention to substantial services providers, industries, and businesses such as smart grids [2], autonomous vehicles [3], healthcare [4], data acquisition [5], and smart farming [6], [7].
IoT enables the vision of smart agriculture through real-time data gathering, analyzing, processing, and allowing the improvement of overall farm management while helping the farmers to make more informed decisions [8]. The growing impact of IoT in agriculture can be categorized into three subdomains i.e. Precision Farming, Greenhouse, and Livestock.
This article aims to review and synthesize the research published in the domain of IoT enabled livestock management. As a matter of fact, scalability, interoperability, and the open/persuasive nature of IoT have revolutionized the livestock industry for vast pastures and constrained farms. Animal health can be easily monitored and tracked using smart wearable sensors and devices such as smart collars [9]. IoT-based livestock not only includes animals' health monitoring and controlling, but also many other deployments have been incorporated such as optimal environment and field supervision for feeding approaches [10], [11], [12]. In addition, bee-hives analysis is also another important aspect in the IoT-based livestock field. Several wireless sensors have been utilized to monitor the behavioural analysis and odour gas [13], [14], [15]. A typical IoT-based system can be divided into four subsystems i.e. things, gateway, communication technologies, and cloud infrastructure as shown in Figure 1. The figure 1 shows that in the IoT perspective "Things" are the objects which communicate and perform with or without human interaction. The things consist of IoT sensors, devices, actuators, buzzers, and many other sensing devices [16]. While, the IoT gateways perform various critical functions from translating protocols to processing, encrypting, managing, and data filtering. In the IoT-based livestock ecosystem gateway exchanges animal's health-related parameters between sensors and devices to communicate with the cloud [17].
Information sharing is the most challenging issue in IoT-based applications, therefore, proper communication technologies are required to share the information effectively and efficiently. Specifically, for real-time information sharing such as animals' health-related information, secure and reliable connectivity is essential. Several wireless communication solutions are available to transmit the animal's farm-related data such as WIFI, Bluetooth, 3G/4G, and ZigBee [18].In cloud infrastructure, multiple storages and servers are linked together to support IoT-based livestock applications i.e., animals' health monitoring and location tracking applications [19]. In addition, cloud infrastructure executes artificial intelligence (AI) and machine learning (ML) based applications to support IoT applications. AI and ML approaches analyze the data obtained from things or IoT sensors to generate useful information for decision-making. With the advanced algorithms of AI and ML machines can evaluate a large volume of data to predict real-time events. These innovations not only help the farmers or agriculturists to diagnose or monitor the animals' health but also reduce the cost of medical treatment.
Recent research developments show that the researchers have been attracted to explore the potential usage of IoT in the field of livestock management. As a result, now there are many applications, prototypes, and services in this field. The research trends in IoT-enabled livestock management consists of network architectures, prototypes, platforms, new applications, interoperability, and security issues. Therefore, a thorough understanding of current research on IoT-based livestock is expected to be very informative for various researchers, stakeholders, farmers, and agriculturists. The collected data IoT-based livestock development applications of cattle, sheep, and goat monitoring, smart poultry farm, and pets management in livestock scenarios. The motivation of the research is to examine the trends in IoT-enabled livestock research and various uncovered issues that are necessary to transform livestock technologies through IoT innovation. The discussion of open research challenges and security also provides future research directions to the researchers and technologists. The survey is organized as follows: Section II provides an overview of IoT-based livestock network infrastructure where we focus on the basic features of IoT-based networks and proposed IoT-Livestock network architecture, topology, and platform. Section III presents an extensive discussion on IoT-enabled applications i.e. monitoring applications, tracking devices, controlling appliances, and mobile apps. Section IV outlines the core IoT communication protocols and relevant technologies in this area. While, Section V highlights IoT organization's efforts for livestock products as well as prototypes. Section VI highlights the pertinence of security issues and challenges as well as future research directions in IoT-enabled livestock. Lastly, the article has been concluded in section VII.

II. IOT BASED-LIVESTOCK INFRASTRUCTURE
IoT network in livestock scenario is the primary element to monitor and to track the animal's behavior. An IoT network maintains the entire livestock infrastructure through its continuous support and provides access to the IoT backbone, while facilitates the livestock data transmission and reception. This section examines the IoT-Livestock network architecture, IoT-Livestock topology, and IoT-Livestock platform. Nevertheless, in order to develop insights into IoT networks, the proposed architecture in [24] and [25] is considered a good starting point.

A. IOT-LIVESTOCK NETWORK ARCHITECTURE
IoT network architecture suggests an outline to specify the physical elements for livestock monitoring and to elaborate their working principles with utilized techniques. The layered structure of IoT-livestock network architecture is shown in Figure 2.

1) APPLICATION LAYER
The Application layer consists of multiple IoT protocols i.e., MQTT, CoAP, XMPP, AMQP, and SSL which can be decreased or increased according to the system requirements. This layer focuses on data flow and migration among all other layers in the whole architecture. Animals' health-related data is routed towards the application layer through android applications or websites and stored for further processing. As MQTT protocol, is a bi-directional and low bandwidth protocol, it provides high reliability to monitor cow's health [26], [28]. Constrained Application Protocol (CoAP) is a web transfer protocol designed for constrained networks and constrained devices in IoT network architecture [27]. In contrast, AMQP protocol follows the publish/subscribe architecture and uses SSL/TSL protocols for security reasons in livestock scenarios [28].

TRANSPORT LAYER
The Transport layer is also known as the host-to-host layer and serves as an interconnection between the application layer and network layer to make communication possible among hardware and software [29]. The primary objective of this layer is to collect and analyze the entire livestock information that is obtained through sensors. The reliability of obtained information is ensured through transmission control protocol (TCP). On the downside, the transmission speed of TCP protocol is slow as compare to user datagram protocol (UDP), but UDP is not reliable as TCP is. Therefore, UDP and TCP protocols are deployed in different applications with respect to their requirements.  [30]. Moreover, data are replied to through sensing devices with the assistance of UDP. Routing protocol for Low Power and Lossy Networks (RPL) support multiple traffic flows and acknowledge the routing metric such as link quality, higher computational cost exchange, and status of battery deployed in the device.

3) PHYSICAL LAYER
The physical layer is the bottom-most layer in IoT network architecture that is responsible to actuate and sense the animal's health-related parameters such as body temperature, rumination, cow's movement, etc. There are four standards at this layer i.e., Z-wave, EPC-Global, LTE, and IEEE 802.15.4. Among these four standards, IEEE 802.15.4 is the most popular and widely used due to its less complexity, minimal power consumption, and low cost [31]. Hence, this standard has been adopted by multiple protocols such as ZigBee, Wireless HART, and ISA100. The other three standards (Z-wave, EPC-Global, and LTE) were also used as an alternative to IEEE 802.15.4 to exchange the information directly from IP.

B. IOT-LIVESTOCK TOPOLOGY
IoT-Livestock network topology is an arrangement of multiple components of an IoT-based livestock network and formalizes ideal scenarios for monitoring animals' health [32]. An IoT-Livestock topology for cow's health monitoring is shown in Figure 3 by implementing an intelligent gateway.

Biochip
IoT Cloud for Animals Health

Interfaces of Multiple Wireless Standards
AHMGateway AHMPackaging Printed Electrode

FIGURE 3. IoT-Livestock Network Topology with Intelligent Gateway
Animal health monitoring (AHM) packaging is an IoT device that administers the misuse of medicine by ensuring pharmaceutical compliance. The Animal Health Monitoring (AHM) gateway consists of multiple health surveillance sensors/devices and interfaces of wireless standards [33]. AHMGateway itself can analyze, scrutinize, store, and display the entire collected data. Another remote monitoring topology is proposed in Figure 4 in which animal's health vitals are captured by using wearable sensors and portable medical devices.
After that collected data is stored and analyzed through various machines that are utilized for aggregation purposes. Based on analysis and aggregation, veterinarians or health experts invigilate animal's health from any location. Moreover, topology also required a network structure to support the streaming of medical videos. For instance, the proposed topology in Figure 4 supports the streaming of animal Cardiology related videos through an interconnected network that is worldwide interoperability for microwave access (WiMAX), international mobile telecommunication (IMT) advanced, and network internet protocol (IP) [34].
In the proposed topology Gateway GPRS Support Node is installed to keep mobile users connected to the internet and IPbased application [39]. Similarly, another gateway WIMAX access service network (ASN) was designed as an end-to-end IP architecture that acts as a central controller. Hence, the fundamental factor of IoT-Livestock topology is to identify the medical roles and associated activities in the whole scenario. Figure 5 shows an IoT-enabled animal health testing (Ultrasound) topology. First of all, animal Ultrasound signals are recorded through connected sensors and wearable devices and then transmitted to the system manager.

FIGURE 4. Remote Monitoring Topology for Animals
After receiving this information, system manager verifies the received information to ensure that it is correct and extract necessary features, classify signals, and redirects it towards health professional for possible animal health care. Further, ultrasound signal capturing service is used to record and store ultrasound signals from wearable devices and sensors. On the other hand, a secure transmission service enables the authenticated transmission of ultrasound signals through the internet. The resource manager handles the web services and other physical resources. Nevertheless, the system manager operates the connected devices and allocates the suitable resources for all services such as collection of things, record service manager, as well as feature extraction and classification. The extraction and classification service extracts the data running on ultrasound apps on Smartphone and store into MYSQL database before transmitting towards IoT livestock health directory. Ultrasound signals and things collection are responsible to cope with the animals' health-related data and store it in a database. In this scenario database monitoring methods and data analytics techniques are responsible to analyse the data obtained through extraction and classification features. Still, they monitor and calculate the workload on a framework such as bandwidth and storage [35]. IoT-enabled livestock healthcare directory is responsible to record and storing the data from ultrasound capturing devices. It also provides continuous surveying for animals by recording Ultrasound signals in portable devices and sends them to desktops or smartphones. Some major services in this health directory are the secure transmission of data, ultrasound signals capturing and extraction, and classification. The veterinarian or livestock manager can access the ultrasound data remotely from this directory without visiting the farm.

C. IOT-LIVESTOCK PLATFORM
The IoT-Livestock platform refers to both cloud computing platform and network platform model [37], [38]. An IoT-based livestock health Information service platform is shown in Figure 6. This information service platform illustrates a systematic hierarchical model of how a farmer or livestock manager can access multiple databases from the business layer with the help of the support layer. Additionally, the data persistent layer contains major informational records and privileges which are vital for IoT-based livestock farming whereas the network layer provides a connection with the physical layer through the multiple IoT communication protocols in order to sense the animal's health-related parameters.
In general, the IoT-Livestock cloud platform consists of applications, smart sensors, devices, communication technology, connection gateway, cloud, and data center [44]. In Figure 7 a cloud-based animal tracking and health monitoring platform is shown which outlines the flow of animal health and other activities-related data. With the assistance of wearable devices and sensors data is transmitted through a connection gateway towards cloud data centers for analysis and further processing. After analysis and processing, the chain of collected data is stored in the cloud that can be accessed by livestock managers and healthcare experts or delivered to external systems.

1) APPLICATION MANAGEMENT
Precision livestock farming consists of monitoring, controlling, tracking, predicting, and automating applications [6]. Most of the applications use IoT sensors and devices to screen and track the animal's health parameters such as temperature, heart rate of an animal, and blood pressure. The herd monitoring applications process and transmit data in real to farmer devices [73]. In this way, the farmer can check the location and health of every individual animal from anywhere at any time.

2) SMART SENSORS AND DEVICES
IoT-based smart sensors and devices monitor the vitality and health of animals in real-time and store illness or diseaserelated information, which enables the farmer to take preventive measures at an early stage. Likewise, grazing tracking devices identify the grazing patterns and gather historical data to identify trends in cattle health.

3) COMMUNICATION TECHNOLOGIES
Communication technologies consist of multiple IoT protocols to collect and analyze livestock data. The most commonly used protocols in this scenario are internet-related technologies such as WIFI, LoraWan, Zigbee, etc [17], [40], [41].

4) CONNECTION GATEWAY
Most of the sensors and devices are not able to connect to the internet for data sharing purposes. To overcome this issue local gateways are designed which act as a mediator among all sensors and devices for controllability, security, and connectivity [36]. Deployment of gateways in livestock farms improves the automation process and controls real-time livestock monitoring systems.

5) CLOUD AND DATA CENTER
Cloud provides a large amount of data storage through large virtualized servers that are interconnected to execute necessary activities such as health data verification, data processing, workload, bandwidth, and centralize the animal's health-related data [37]. Web and data analytics resources are also installed on the internet or cloud which provides on-demand resources via network infrastructure.

6) EDGE / FOG PLANE
Edge and fog computing paradigms have not been exploited yet. They improve the system reaction by minimizing the network delay, meanwhile end devices and computing nodes are highly close to each other. Whereas, in livestock farming the performance requirements of a network are very relaxed, yet channel reliability is the critical issue.

III. IOT LIVESTOCK APPLICATIONS
IoT applications in the Livestock scenario are about empowering the livestock managers with IoT devices and tools that integrate the knowledge services and products to maximize productivity in the global market, save cost and time with reduced men power [45]. In this section, we debated the stateof-the-art livestock applications i.e. Monitoring applications, controlling appliances, tracking devices, and sensor-based applications as shown in Figure 8. However, Table I pays attention only to smartphone applications in livestock scenarios.

A. MONITORING APPLICATIONS
By taking the advantage of IoT technologies farming community can inspect the entire farm conditions without their physical presence. In this way, a real-time decision can be made from anywhere across the world [46]. The most existing studies which are deploying IoT-enabled systems in precision livestock farming, focus on the growth of livestock by monitoring, tracking, and predicting health-related variables. Figure 9 illustrates an ideal livestock monitoring scenario through wearable sensors and devices. Sensed data is transmitted through communication technologies (2g/3g/4g) for further analysis and visualization.

1) DISEASE MONITORING
Animals can get multiple diseases for various reasons such as in a dairy farm, there are a large number of animals, so, it is impossible to measure the health parameters individually on daily basis. In the same way, it is a lengthy and time-consuming process to do it manually, hence, the animal disease can be contagious, thus, it must be caught on time to protect other animals on the farm. To cater to this situation an automotive health monitoring system is required. Animals who are suffering from any disease change their daily habits such as lying down, eating habits, or splitting themselves from the herd. IoT sensors make the animal's health checking process easy for farmers. Mounted or wearable sensors analyze the behavior of animals and keep a record of collected data. The collected data helps the farmers for future decision making such as calling the doctor. Apart from this, any abnormality in an animal's behavior is easily detected with the help of IoT sensors that alerts the farmers through messages or any other means. For example, a livestock manager or doctor can diagnose any disease with the help of sensors or accelerometers to capture animal activities. The primary objective of disease checking sensors is to record the daily life behavior of an animal such as temperature, mooing, pulse rate, and changes in body weight. Vyas et al. [47] proposed a model to detect mastitis disease by using multiple IoT sensors and devices.

2) STRESS MONITORING
The negligence of stress in animals not only causes economic loss but also poses a considerable threat to an individual's food safety. As stress level increases the body temperature and respiration rate in an animal's body also increases for this reason, they produce less milk with the same nutritional diet Also, deficiency of moisture content during the summer season leads to an increase in the level of stress in the animal, which may cause death. IoT sensors and wearable technologies have overcome these challenges by providing objective measurement tools and veterinary observation [48], [49], [50], [51]. Saravanan et al. [52] proposed an IoT-based animal analyzing system to measure the different environmental and cattle health-related parameters such as body temperature and stress level. Identified parameters taken through IoT sensors were stored on a cloud platform. The identified parameters showed a significant rise in milk yield and reduced the insemination cost. Further, the transportation of living sheep is a significant link in the supply chain of goat and sheep for meat. Consequently, it is a primary concern to protect the sheep from death during transportation and damage that occurs because of the excessive amount of stress in the goat or sheep. A wearable stress monitoring system (WSMS) has been proposed to monitor the stress signs remotely during sheep transportation [58]. The designed system record and transmit the sensed data efficiently during sheep transportation and minimizes the effects of stress load.

3) ENVIRONMENT MONITORING IN ANIMAL SHELTER
There are a large number of animal shelters around the world in different countries such as Japan, Taiwan, etc, but keeping the animals in a shelter is not a significant improvement in the livestock field due to several environmental issues. Multiple IoT-based techniques are proposed to monitor the environment in an animal shelter to keep them safe and healthy. Huang et al. [59] proposed Intelligent Stray Animals Tag (ISATAG) architecture to assign a unique identification code to each stray animal. Veterinarians and managers can monitor the living environment as well as physiological conditions through the proposed architecture.

4) FEED INTAKE MONITORING
Feed intake monitoring is considered an exceptional approach for establishing the view of overall animal health. A normal healthy animal (cow) feeds 3-4 hours per day and ruminate for 500-600 min in a day. The process of rumination is characterized via steady rhythmic cow's chewing action lasting about 50's per bolus [60]. Though feeding indications differ from rumination because during the feed process there is a significantly more neck motion. The feeding habits of animals are observed by analyzing their behavior i.e. sleeping and grazing. By knowing this the farmer can make necessary adjustments towards feeding conditions to prevent wastage of food and overfeeding by utilizing IoT technologies [61].

5) RUMINATION MONITORING
Rumination is a process in which an animal's food digestion behavior is measured [62]. Usually, a healthy cow ruminates about 500 min to 600 min in a day. A rumination monitoring device provides an exact indication of an animal's health which is mounted in the nose of the animal [63]. Accelerometer collar measures the rumination period by identifying the chewing frequency and distinguishes between healthy and unhealthy rumination patterns of animals [52].

6) HUMIDITY MONITORING
Finch et al. [64]discussed the direct impact of humidity (i.e. air humidity) on livestock, which affects the thermal regulation of livestock. When the temperature is higher, livestock regulates the temperature of their own body by evaporating heat, but an excessive amount of humidity decreases the temperature variance between air and skin which minimizes the heat. The rise in humidity will also affect the composition of breast milk. Hence, humidity is an important environment monitoring parameter that is made possible by using multiple IoT devices and sensors [65].

7) POULTRY MONITORING
Despite the technological advances in rearing and breeding, modern poultry farms impose vital requirements on the poultry house environment. The parameters such as temperature, carbon dioxide, NH3, and humidity are the most important factors for chicken health [53]. Up-to-date monitoring technologies such as IoT providing scientific management basis for poultry farm managers and assisting to increase the management efficiency within minimum production cost [54]. Mirzaee-Ghaleh et al. [55] reported that for henhouse and livestock Alf Vegard RISC (AVR) controllers were implemented to monitor the humidity, NH3, CO2, and temperature inside the poultry farm. To design the visual application software, the LabVIEW software was used and fuzzy control was implemented to regulate the CO2, temperature, NH3 concentration, and humidity inside the poultry farm.
Besides that, it is identified to design a traditional poultry farm, a remote environment monitoring system has been developed based on ZigBee and ARM technologies [56]. Li et al. [57] proposed an online poultry monitoring system based on wireless sensor networks (WSNs) by using computer network technology and wireless sensor technology. The system was reliable, cost-effective, and monitors the different environmental parameters of the poultry farm.

B. TRACKING APPLICATIONS
With the advancement of technology, processing of long-term and real-time data as well as continuous analysis into the classes of animals has become possible.

FIGURE 9. IoT-Livestock Monitoring Scenario
IoT solutions make tracking of wild and domestic animals easier by delivering an advanced level of information.
Livestock owners can locate the ill cattle via General Packet Radio Service (GPRS) sensors so that they can be separated and taken care of for proper treatment. In this sub-section tracking applications of wildlife and domestic animals have been investigated.

1) WILDLIFE TRACKING
To track and find the exact position of animals, multiple tracking devices have been devised. IoT-based wearable and non-wearable devices are employed to track wild animals. Anthony et al. [67] have proposed architecture to monitor the whooping cranes, by implementing a short-range ad-hoc network for breeding purposes and global cellular networks to track their annual migration. A wireless ad-hoc network system has been proposed to reduce the energy consumption and tracking of wildlife animals over larger geographical areas [68]. Along with that, wearable GPRS collars and ZigBee-based monitoring approaches have been implemented to analyze the monkey's activities in the Mexican jungle [69]. Additionally, multiple studies have been intended to focus on integrating the image processing techniques for animal detection, cloud-based data management, and sensors-based camera networks [70], [71], [72].

2) WHOLE HERD TRACKING
The connectivity of IoT devices, sensors, and actuators aim to manage livestock by tracking their environmental impact, production/reproduction, and other health conditions [73] Maroto et al. [74] proposed a low-cost whole herd tracking solution in which some animals have been tracked through wearable GPS collars and some animals are chased with lowcost Bluetooth tags. The proposed solution is effective for realtime sheep and beef cattle tracking.

C. CONTROLLING AND PREDICTING APPLICATIONS
Animals controlling and predicting has become one of the hot topics for both livestock and wildlife researchers and agriculturists. Wildlife controlling allows the researchers to estimate some key concerns, such as controlling the dangerous animals from crossing the roads to prevent accidents. Yet, livestock detection helps the farmers by identifying severe diseases and many other essential health constraints.

1) WILDLIFE CONTROLLING
IoT detecting devices, sensors, with passive nodes as well as infrasonic sounds are used to control the elephant and wild animals from crossing railways [83]. For detection seismic sensors and IR sensors are also utilized. Dangerous situations caused by wildlife crossing are controlled by using adaptive actuation of light signals which alerts drivers at an early stage [88], [89]. The camera-based sensors with the integration of image processing are employed for the protection and recognition of animals. Sparsogram technique is proposed by Rusu [90] for the classification of data collected about animals' movements.

2) OESTRUS PREDICTION
If the breeding process of an eligible cow is not carried out correctly, then farmers will face severe loss because the production of the milk will be reduced. IoT devices and sensors have revolutionized the oestrus detection issues successfully.
With the help of low-power sensing technologies such as accelerometer sensors are integrated with wireless radio chips for 24 hours per day for oestrus detection. In order to determine the heat in cows, the activity of animals is measured because cattle and cows become restless when they are in heat [75]. The measurement of change in cow's activity is achieved by utilizing MEMs accelerometers, but it is problematic to transfer the whole unprocessed accelerometer data. It may be possible in three-axis accelerometer sensors because the bandwidth of a low-power transmission channel is not sufficient. An oestrus detection method is proposed by Vanrell et al. [76] in which a wearable collar is attached to the animal, whereas, acceleration records are segmented and filtered. Nowadays with the advancement of IoT, several solutions that include IoT-based apps, IoT collars, and software are introduced to help the farmers with estrous detection in cows or a cattle herd [77], [78].

D. AUTOMATIVE APPLICATIONS
In a livestock farm, there is a large number of animals which makes it difficult to measure the water and feed requirements of every animal manually. It is a hard and lengthy process to do it manually and individually. But animal feeding and watering are necessary, if it is not given proper attention then it will lead to heavy loss. So, to cater to this issue, IoT provides innovative and automated milking, feeding, and watering solutions.

1) AUTOMATED MILKING
In a dairy farm manual milking is a very slow and timeconsuming process. This manual milking process is not hygienic and can cause bacterial infection. IoT technology has overcome this challenge effectively by reducing manpower and labor costs through an automated milking system. If the temperature is not ideal then the probabilities of milk getting spoiled are really high, but an automated miking system preserves the milk via smart IoT cooling tanks. Auto milking consists of multiple tasks, for example, cleaning the cow before milking, mounting the milking devices/sensors, routing the animal, and extracting the milk. Milk production depends upon the quality and amount of food that is given to an animal. The assurance of the required amount of nutrients for proper milking is necessary, this is not possible just by looking at the fodder, but it is processed through an automated system. Biz4intellia developed a sensor-based milk monitoring system to resolve the problems associated with monitoring large quantity milk [80]. The entire system is designed with IoT concepts that provide better management and help in keeping the required inventory stock.

2) AUTOMATED FOOD AND WATER SUPPLY
Water is the most important nutrient for every animal. For the profitability and welfare of animals, they must have an adequate amount of water. There is approximately 87% water in milk, therefore, water requirements are vital for milk production [79]. The automated irrigation process is considered an ideal process in most farms due to its efficient and practical nature. The process consists of heated bowls and an insulated floor which is automatically filled with water through a pressure line. On the other hand, the proper amount of food for the animal is also vital, as it determines the quantity of nutrients that are necessary for the production and growth of animals. A valuable or actual food that prevents from overfeeding or underfeeding of nutrients makes the effective use of nutrients [81]. Overfeeding increases the food cost as well as leads to an excessive amount of nutrients that can be too toxic or harmful whereas underfeeding affects animal health and limits production.

E. SENSOR-BASED APPLICATIONS
IoT sensors/devices are assisting livestock managers to track down animal's health with less manpower and labor cost. By using IoT sensors temperature, pulse rate, digestion, respiratory rate, and many other vital are monitored thoroughly and alert the farmers at the very first sign of illness to take correct and effective measures [82]. In this sub-section, sensor-based applications are explained comprehensively.

1) PULSE SENSOR
The pulse sensor is a simple and smaller IoT device that measures the heartbeat by giving digital values. There is no adjustment or any other configuration required. This sensing device is similar to plug and play sensor. After connecting the sensor to power, it starts to give the animal pulses according to the pulse [84].

2) TEMPERATURE SENSOR
Temperature sensors calculate the temperature in different perspectives such as animal's body temperature, animal's shelter temperature, or weather temperature. The most commonly used sensor is LM35 that assesses the temperature between 55 C to +155 C. The sensor is integrated with Arduino devices such as microcontrollers and Raspberry PI [84].

3) SOUND SENSOR
To determine the sound intensity of cattle during illness sound sensor such as the KG181 microphone sensor is used for emergency sound and for the detection of the animal's sickness sound. Currently, the consumption of this sensor is up to 15MA and the operating voltage is 5V DC [85].

4) RUMINATION SENSOR
There is a rumination sensor inside the microphone, and the data generated by this sensor is transmitted towards the cloud through the controller. This is a wearable sensor and mounted on the neck of an animal (cows, buffalo) because whenever the process of rumination starts, the sensor will generate the data quickly [86].

5) MOTION SENSOR
This sensor gauges the 3-dimensional motion of an animal. The motion sensor helps to analyze the movement of cattle and discriminate whether an animal is infected or not. The motion sensor can also club with a rumination sensor and be fitted in the leg or neck of the cattle to monitor their motion [87].

6) HEARTBEAT SENSOR
During the evaluation of a cow's health rate, heartbeat is considered a critical factor. Normally the heartbeat range in a healthy cow is 48-84 times per minute. Attributable to multiple uneasiness and diseases, the fluctuation occurs in the heart rate which is sensed by means of a heartbeat sensor.

7) PHYSICAL GESTURE SENSOR
Gesture assessment can be made by using IoT gesture sensing devices. Cattle or cow's behavior is classified into two categories i.e., traveling and stationary. Stationary activities consist of standing, sleeping, and sitting whereas traveling activities are walking, running, and grazing [66]. Saravanan et al. [52] deployed an accelerometer sensor to determine the animal's gesture behavior.

8) POWER OF HYDROGEN (PH) SENSOR
The PH sensor measures the acidity in cows or basic values of liquid in an animal. The instantaneous measurement through the PH sensor accelerates the treatment process and diagnoses the acidosis disease [91]

9) RESPIRATION SENSOR
The respiration rate of cattle is 26-50 breaths in a minute. Cattle will suffer stress, weakness, pain, or maybe respiratory disease if the respiration rate exceeds the required limit. If cattle become too hot, they pant to enhance the heat loss through evaporation. Otherwise, cattle panting more than 100 breaths in a minute indicate they are in severe heat stress [92].

10) HUMIDITY SENSOR
This type of sensor is applied to evaluate the stress level of cattle. If the humidity level is between 1-72% there will be no stress, if the humidity level is more than 72% then they will be having severe stress [92].

11) CARBON DIOXIDE (CO2) SENSOR
Most of the CO2 comes from the breathing activity of animals. The excessive amount of CO2 becomes a nontoxic substance due to which the concentration of oxygen in the air will drop. A CO2 sensor is a gas sensor that measures the quantity of gas in the air [93].

LIVESTOCK MANAGER
The "Livestock Manager" app is designed for commercial livestock enterprises to keep a detailed record of livestock farms effectively. The livestock manager is made for cattle, sheep, goats, pigs, horses, and rabbits. It handles the multiple identifications during tracking treatment of animals' movement, milk production, calving, pedigree, etc.

MY CATTLE MANAGER
The app of "My Cattle Manager" is specially designed for the administration of the dairy farm to track and record milk production. It supports the bull, heifer, cow, weaners and it is also good for calf and beef cattle's management.

MY FARM
For the organization and the regulation of the animal farm, this app is developed."My Farm" app records core livestock information such as animals' health data, births, deaths, weights, medicines, expenditures revenues, etc.

JAGUZA LIVESTOCK APP
"JAGUZA Livestock" app is aimed at real-time animal disease tracking that assists farmers by diagnosing the diseases, by keeping the record of farm management, and by reporting the animals' sickness.

COW MASTER
"Cow Master" is a comprehensive herd management solution for farms and dairy organizations. This app integrates the herd establishment system to optimize the daily tasks such as milk production and budget of the farm effectively.

MY POULTRY MANAGER
"My Poultry Manger" as the name suggests operates the poultry with detailed reports and modernized records. The poultry farm owner can manage the poultry batches, feed inventory, and track the flocks and eggs.

LIVESTOCK -LIVESTOCK AND PETS
"The Livestock" app is devised by understanding the needs of the entire pets and cattle industry that oversees the dairy farm, provides pet care services, nutritional strategies, and comprehends the dynamics of breeding genetics.

LIVESTOCK BREEDING APPS
By using the app of "Livestock Breeding" farmers can calculate the breeding dates for their livestock. Farmer can set the days in the setting screen that will automatically calculate the dates according to the days setting on the screen.

FEED CALCULATOR
The app of "Feed Calculator" is useful to estimate the feed at the lowest price for livestock. Farmers can formulate the feed recipes for pigs, layers, broilers, tilapia, and catfish.

CATTLE EXPERT SYSTEM
"Cattle Expert System" is an approximately all-in-one app to monitor the cattle farm. The major functionalities of this app include feeding, breeding, disease, calf, and production technology management system for cattle and buffalo.

BIOCONTROL-CATTLE MANAGEMENT
"BovControl-Cattle Management" consists of a data collection and analysis tool to increase the performance of the herd in milk, meat, and genetics.

PASTUREMAP -RANCH MANAGEMENT
To control the livestock and ranch in one place as well as to make the grazing plane easy "PastureMap-Ranch Management" app is formed.
FARMERAPP "FarmerApp" delivers information about animals diseases and prevention mechanisms that farmers can use to prevent animals from malicious diseases.

FEED CALCULATOR
Based on cows' milk and weight, the "Feed Calculator" app offers the required amount of feed.

BREEDING WHEEL
"Breeding wheel" application allows the farmer to supervise the productive and reproductive status of any herd effectively. In this way, farmers can easily identify the reproductive problems and distribution of the calving phase in animals.

COW-NOTES
"The COW-Notes" app is meant to proctor the herd quickly and accurately along with its diagnosis of the major risk factors of metabolic disorders. The identified risk factors are mastitis, energy deficit, lameness, and production disorders.

CATTLE CHECK
"The Cattle Check" app helps to follow the cattle movement and to tell the farmer which animal is missing so that they can find it quickly.

12) HYDROGEN SULPHIDE (H2S) SENSOR:
H2S enters into livestock through the cattle's respiratory system that is dangerous for blood circulation and damages the cell oxidation ability. Thus, an IoT-based H2S sensor is used to measure the amount of hydrogen sulfide in the air [93]

IV. IOT LIVESTOCK COMMUNICATION PROTOCOLS AND RELEVANT TECHNOLOGIES
There are multiple IoT protocols and relevant technologies which are monitoring real-time livestock environments. By utilizing these communication protocols and technologies, a farmer can administer and supervise the livestock farm in a well-organized manner with minimal labor cost and human involvement. In this section, the most relevant technologies and communication protocols in IoT-based livestock are examined.

A. IOT PROTOCOLS AND STANDARDS
IoT protocols are the main modes of communication between connected devices. Without these protocols and standards hardware (devices, sensors, actuators, and other communication devices) would be rendered useless as IoT protocols exchange the data in a structured, secure, and meaningful way. In this section, IoT communication protocols are classified into two categories i.e., IoT network protocols and IoT data protocols.

1) IOT NETWORK PROTOCOLS
IoT network protocols are the set of communication protocols that are used over the internet to connect the devices in IoTbased livestock. End-to-end communication according to the network scope is also allowed by applying the IoT network protocols. The identified IoT network protocols are discussed below:

a: Hypertext Transfer Protocol (HTTP)
The HTTP protocol is used to publish a large amount of data for IoT devices and sensors. The most common function of this protocol is data communication over the web. In IoT-based livestock farming, HTTP protocol is utilized to manage, control and sustain the entire system such as controlling and monitoring devices in livestock [94].

b: Long Range Wide Area Network (LoRaWAN)
LoRaWAN is a procedure that connects multiple batteryoperated things to the internet wirelessly in global or private networks with less memory and power. LoRaWAN protocol is ideal for remote or rural areas where there is a lack of internet coverage or a limited cellular network. Kim et al. [95]proposed a real-time monitoring system by using LoRaWAN technology to analyze the multiple livestock healthcare parameters to provide a better herd management system. By leveraging LoRaWAN technology, long-range low-power sensors are attached to cattle's bodies and communicate through a gateway for connecting to satellite/cloud network to the internet for data analytics and processing. Besides, the utilization of LoRaWAN with biosensors is also an effective approach to predict the core body temperature of cattle [96].

c: Bluetooth
Bluetooth is the widely used short-range communication protocol for wireless data transmission. This protocol is ideal for low cost, less power, wireless and short-range transmission among electronic devices. Bluetooth low energy (BLE) is a low energy Bluetooth version that is mostly employed in animal wearables and plays a vital role in connecting IoT sensors/devices. Saravanan et al. [19] suggested a livestock management system based on cloud IoT to monitor, track, sense, and analyze the collected data via IoT sensors and wearable collars. The sensed and collected data is visualized through Bluetooth-enabled smartphones. A farmer, veterinarian, and health worker can monitor and view the status of an animal's health from anywhere at any time with the help of a Bluetooth-enabled system via a mobile interface.

d: ZigBee
ZigBee practice allows the smart objects to work together and sustenance low-rate data transfer among short distances. A ZigBee-based system is recommended for monitoring the animal's health-related parameters such as body temperature, humidity, heart rate, and rumination [97]. ZigBee-based health monitoring system analyses the stress level according to the thermal humidity index.

2) IOT DATA PROTOCOLS
The low-power IoT devices are connected by using multiple IoT data rules. These principles build point-to-point communication connections with hardware on the user end without an internet connection. In IoT data protocols connectivity is made possible through a wired or cellular network. The most common IoT data protocols used in livestock farming are elaborated below:

a: Message Queue Telemetry Transport (MQTT)
MQTT is the most preferred communication protocol for IoT sensors/devices, as it collects required data from multiple electronic devices to support remote monitoring. MQTT is a publish/subscribe protocol that runs over TCP and supports an event-driven message exchange with the help of wireless networks. Mainly MQTT is used in those devices which are required less memory and low power. For instance, animal health-related parameters, which assist the farmers to monitor the livestock at early stages. Taneja et al. [98]presented an IoTbased application system to monitor and analyze the data obtained from wearable cow's feet. The wearable device predicts the variances in the behavior of animal-related illnesses such as lameness and alerts the livestock manager towards the animal's well-being.

b: Constrained Application Protocol (CoAP)
CoAP protocol is developed to translate the HTTP model so that it can be utilized in network environments and restrictive devices. The client uses the CoAP protocol to send a request to the server and the server sends back a response to the client in HTTP. Chen et al. [101]discussed the hardware, algorithm, communication protocol (CoAP), and whole working process to monitor the cow's oestrus system. The image recognition technique monitors the oestrus behavior of a cow to improve the accuracy of an oestrus detection system.

c: Advanced Message Queuing Protocol (AMQP)
AMQP contains three isolated components i.e., exchange, binding, and message queue. These components exchange and store the messages securely and successfully. AMQP protocol is mainly applied when the farmer wants to track each animal's health-related parameter [99]. AMQP keeps the track of all the messages until each message is delivered to the destination without any failure.

d: Machine-to-Machine (M2M) Communication Protocol:
M2M communication protocol is employed to manage the remote applications of IoT sensors/devices [100]. The protocol is suitable for wildlife monitoring where livestock managers can supervise the wildlife activities remotely. Moreover, this protocol also supports self-assessing and allows the system to operate with respect to environmental changes.

B. IOT RELEVANT TECHNOLOGIES
There is a large number of enabling technologies for IoTlivestock solutions, therefore, it is not possible to make an explicit list. Hence, our study focuses on some core technologies which are revolutionizing IoT based livestock industry.

1) MACHINE LEARNING (ML)
In the last few years, heart disease in animals is at its peak due to multiple environmental factors. Especially, pets (dogs, cats) are not able to immune to this phenomenon, consequently, heart disorders are the main reasons for deaths in animals. On-time heart disease prediction in animals is difficult as the services are unavailable and lack of preventive medical care. In a step towards early detection of heart disorders in domestic animals, IoT and ML technologies are alleviating these curable conditions. Mathur et al. [83]proposed an IoT-based solution by using machine learning approaches to gather health-related data from deployed body sensors. The experiment results indicate that ML approaches are better in predicting heart disorders in animals.

2) CLOUD/FOG COMPUTING
IoT, cloud computing, and fog computing techniques together offer an extensive range of great opportunities for verticals such as livestock farming. For example, in the dairy industry, productivity can be enhanced by taking actionable insights to improve farming practices and yield. Taneja et al. [102] presented a SmartHerd scenario by integrating fog computing and IoT platforms for the animals' health monitoring and behavior analysis in a dairy farm. This conventional cloudbased integration consists of decision-making capabilities and provides actionable awareness to farmers towards animal welfare.

3) ARTIFICIAL INTELLIGENCE
Apart from animals' health monitoring, IoT also revolutionizes poultry farms and dairy farms by implementing IoT devices, sensors, and video/image processing techniques. Singh et al. [104]introduced a comprehensive review on IoT-based poultry monitoring by deploying AI techniques. Additionally, in sheep dairy farms separation of lambs from mothers after birth which is raised by artificial lactation is a common practice. A lowpower distributed AI device has been built to measure the ingestion of lamb's milk as well as future meat prediction and malnutrition [103]. The device consists of CLEC that identifies each lamb and measures the quantity of milk and offers farmers and researchers a prediction.

4) BLOCKCHAIN
The livestock industry is still running on archaic infrastructure due to the utilization of outdated software. The lack of data transfer and data sharing limits the approaches by which cattle farmers can operate the livestock effectively. Leme et al. [105]examine the viability of blockchain technology utilization and propose a solution by employing cloud storage and Blockchain to keep an eye on the overall health of livestock. By making use of blockchain technology farmers can keep the trail of the necessary information and easily transfer the livestock from one location to another. In a nutshell, the deployment of blockchain makes the selling and buying procedures easy for cattle farmers.

V. IOT ENABLED LIVESTOCK INDUSTRY TRENDS AND PRACTICES
The emergence of IoT in livestock has experienced a burst of inventiveness, activities, endeavor capital firms, as well as an exciting entrepreneur. This space manifests as an active group of innovative start-ups and large organizations that are ready to be a part of a giant market and enabling technologies. This section illustrates current IoT wearable devices, sensors, and other monitoring technologies which are designed and developed by top technology firms. The most common and widely used animal healthcare products developed by IoT organizations are shown in Figure 10.

LIVESTOCK BREEDING
China Livestock breeding has a huge impact on the growth of animals and the cure of animal diseases as well as the improvement of animal products. Zhang et al. [123] presented a real-time livestock breeding system by implementing IoT monitoring devices. The devices were implemented in 11 poultry and livestock farms in China. After implementation, the adaptability and stability of monitoring devices were tested. The deployment of devices provides technical support for automation, information, and innovative management of livestock farming. China has applied IoT enabled MYCROP app developed by FAO. They have saved up to 7.5 billion US$ by applying it in all pig farms [124].

CATTLES MONITORING
Australia Ceres Tag co-founder David smith and Melita Smith recognized the cattle farm monitoring problems and developed an architecture using CB-IoT by Amazon Web Services for monitoring cattle. In this project, the Australian team developed a Ceres Tag Management System to collect and transmit the data. The ear tag communicates via satellite to detect emergency diseases in cattle like mouth and foot outbreaks [125].

Russia
Although Russia is implementing innovative technologies such as machine learning and IoT for smart dairy farming, stills there is highest milk deficits according to Food and Agriculture Organization (FAO). To assist the food producers, the Dairy Production Analytics (DPA) service supports IoT enabled cloud system to monitor cow health. A Russian Supplier Mustang is utilizing IoT-based approaches in order to boost up its feeding profit [126].

Brazil
Leme et al. [127] proposed a secure decentralized system in which farmers can exchange information related to cattle's health. The proposed solution monitors the cattle industry in an efficient, decentralized, and secure way. The proposed solution has been in brazil in real-time cattle farms to deal with the information regarding livestock health. Through this IoT-enabled blockchain system, a livestock owner can easily transfer animals from another location for buying and selling purposes.

India
The Indian livestock industry is using different IoT-based animal health monitoring solutions such as heartbeat monitoring, body temperature, and other environmental parameters. A simple cattle's activities monitoring system has been deployed in real-time Indian livestock farms to increase milk productivity [128]. In India, the Stellapps invested $14 million in IoT sensors which gather data across the cow supply [129]. Stellapps has provided a set of apps by using IoT and cloud solutions. The obtained data is stored in a cloud-based system in order to monitor the livestock [130].

Italy
In Italy, IoT-based livestock farming helps the farmers for continuous monitoring of animals during grazing in barns. Further, IoT-enabled LoRa LPWAN technology monitors the cowshed's environmental variables and cattle vital parameters [131].
Whereas, table II highlights some top technologies industries trends and directions. Smarter technologies have developed an innovative rumen cattle bolus to manage cow herds efficiently and prevent them from stress or disease [106]. These bolus tags also measure the temperature fluctuations in the herds 24/7. Apart from this, smarter technologies have also designed cattle tracking collars that provide real-time tracking and accurate visibility about animal's locations [107]. Yabby GPS is designed by Digital Matter for theft recovery and animal tracking. Yabby GPS is a lightweight, tiny, and weatherproof device with up to three years of battery life. This device also checks and tracks the location, movement history, geofencing, speed, and inactivity alerts of an animal [108]. The major function of the UCOWS device is to inspect the daily activities of dairy cows in the real world and upload the collected information of cow's activities to the reader of UCOWS through wireless technology [109].
Fit Bark is a GPS-enabled device that records the pet's (Dog, Cat) health parameters and other activities. If there is an emergency, the device will quickly locate the position of one's pet through embedded LTE cellular services. Fit Bark records the minute-by-minute pet's activity such as distance traveled, sleep quality, calories burned, as well as it evaluates stress, anxiety, pain, and overall health behavior [110].
Cow manager is an innovative ear sensor technology that facilitates the farmers by providing accurate information about the herd's health, nutritional status, fertility, and location. It's easy to install the device without worrying about battery recharge [111]. Cow Manager is a complete plug-and-play system that oversees the entire cow's farm.
The data collected from sensors is transmitted through routers that may be installed outside or inside the farm. In the absence of a power connection of cow manager, a plug-andplay system provides solar panels to monitor the activities of animals.
Moocall sensor is mounted on the tail of an animal that enables the cow to send you a message alert approximately one hour before calving. Moocall sensor detects and records the activity of a cow to determine when a cow will most likely to the calf. Then they send an alert up to two phones to ensure a better start in life for the calf [112]. Baku's device captures the real-time conditions of broiler flocks. Sensors are installed in Baku'sdevice to capture the humidity and temperature inside the broiler's flock. This broiler monitoring device performs tirelessly to update the flock manager about environmental conditions inside the poultry cage [113].
Libelium P and S sensor has been designed for production, animal diseases, and herd reproduction based on internal and external factors of economic indicators, statistical analysis laboratory data, and staff information. This sensor not only reduces the labor cost but also increases productivity and opens new units [114].

VI. IOT CHALLENGES AND SECURITY ISSUES
This section illustrates multiple challenges and security attacks that occur in IoT-based Livestock along with that a security model is also proposed to mitigate the most common security challenges. In the end of this section future research directions have been discussed.

A. CHALLENGES
IoT-enabled livestock comes with the potential and vision of continuous connectivity across physically distant areas where animals, hospitals, and livestock managers coordinate, cooperate and orchestrate healthcare processes. There are many open research challenges in IoT-based livestock that are necessary to overcome before it could become a mainstream platform. This section dissects a deep insight into IoT-enabled livestock open challenges.

1) DATA MANAGEMENT
Data management challenges for IoT-based livestock are similar to those challenges confronted by IoT in other domains. In contrast, in the livestock scenario animal's health-related data come from IoT devices and medical sensors which are attached to their body. Due to the dynamic nature of an animal body, it changes its state continuously. As seen in IoT-livestock applications, there is a constant flux of data coming from IoT devices and sensors through cloud nodes, thus, handling this constant flux of data in terms of volume, velocity, and variety is a noticeable open issue. There are large numbers of data formats which are depending upon end-user applications and healthcare such as ultrasound data that could be transmitted in XML format. The challenges of velocity and data volume are highly associated with fog node hardware in order to process, communicate and store high resolution and high fidelity coming from IoT medical devices.

2) HARDWARE AND SOFTWARE CHALLENGES
The equipment residing in an IoT-enabled livestock system has to be protected from harsh environmental phenomena such as extreme temperatures, vibrations, high humidity, and other dangers like destroying the electronic circuits. The end devices will function reliably and stay active for long periods depending upon the limited power resources of batteries. Subsequently, low power capabilities and appropriate programming techniques are mandatory. Additionally, due to the interconnectivity of multiple devices, a large amount of data is produced that will be beyond the capacity of the resources of small level servers to handle [142], [143].

3) FALSE DATA INJECTION
In data attacks, an attacker modifies or falsifies the data that is important for real-time decision making with the supposition that the adversary has knowledge of the system and its configuration. For instance, injecting false information about cattle or cow health will result in animal death and turn increase in meat and milk deficiency.

4) AUTHORIZATION AND TRUST
In smart livestock applications, on-body sensors, flying drones, and other connected entities interact and communicate with each other and provide efficient and automated experiences. Such communications are directed via edge or cloud networks and machine-to-machine networks that can support MQTT, CoAP, and other communication protocols. Conversely, it is vital to ensure that messages are transmitted from an authorized entity rather than from a malevolent adversary. This information exchange process such as animal's health issues, breeding decision information, current location, and other farm-related parameters data which must be verified by an authorized user i.e. livestock manager or concerned party.
Further, sensors are embedded in animals' body which monitors different health parameters and enables preventive measures [144], [145], [146]. As the livestock farm is placed in a monitored environment, making the adverse conditions in barn or remotely controlled temperature can disrupt the production of animals and result in widespread and epidemics disease.

5) AUTHORIZATION AND SECURE COMMUNICATION
Authentication of connected devices is a vital element in terms of privacy and security. As these devices have limited storage memory and processing power, hence, the legacy public key infrastructure authentication mechanism is not considered as a feasible solution. Alternatively, there are some lightweight secure authentication protocols, which act as a service, are considered more realistic solutions in IoT-livestock network environments [147], [148]. In fact, such authentication mechanisms are not able to consume the limited devices' resources for the authentication process but prevent the unauthorized devices from accessing and connecting the network [149].

6) REGULATORY
Agriculture production mainly livestock is a highly regulated industry. Several countries over the globe have various regulations, supervisory authorities, and laws that follow the specific compliances to sell or produce products [150]. Such compliances are achieved easily by utilizing smart livestock technologies which help the regulators and farmers to audit, inspect and track every step of the production pipeline.

7) SCALABILITY
To develop a smaller measure of IoT on portable devices to collect and process the data, IoT sensors are deployed which enables the livestock manager or farmers to access all healthrelated information through portable devices such as mobile phones. This facility of data accessibility can be scaled to the entire livestock farm so that farmers can monitor the animal's health status from anywhere at any time through smartphones. This monitoring model can be scaled up for larger areas coverage by adding antenna and sensors in the whole area to collect data.

8) STANDARDIZATION AND IMPLEMENTATION CHALLENGES
Integration of smart things into the internet generates multiple challenges in the area of adaptability of current technologies and internet protocols. Over the past few years, extensive research has been made to match the existing technologies and protocols with these things [132]. A large number of heterogeneous devices are contributing to IoT, if these devices use different protocols and standards, then it becomes difficult to achieve high-level interoperability. Therefore, IoT standards such as European Telecommunications Standards Institute (ETSI)and IEEE should develop technological standards to meet standardization challenges. IoT is the network of things that can sense, monitor, and collect data, and communicate with computers and other things IBM IBM helps to Protect Endangered African Rhinos by using IoT technology. A few years ago, Welgevonden and Wageningen University researched rhinos by fueling the idea of predictive analytics, IoT, and IBM cloud. The primary objective of this research was to make poaching predictable to replace the guns effectively with IoT as well as wearable collars with embedded sensors that are mounted on prey animals but not on the rhinos. With the help of IBM's IoT platform, the research team monitors and collects sensor information related to direction, location, movement pattern, and average speed of travel.
The sensed data was used to create algorithms or rule-based patterns made on prey animals in order to respond to the perceived threats. [115]

MICROSOFT
IoT sensors and animal tags are integrated to scrutinize animal health and fertility, trace the herds, manage the feed, and alert farmers to predators. However, uploading data on the cloud and the connectivity of devices can be a very challenging task in rural areas. Microsoft has proposed a solution to overlay the WIFI signals over TV whitespaces to transmit data from drones, sensors, and cameras to the farmer's office. Azure IoT edge handles computer vision algorithms and transfers data to the cloud, no matter whatever the speed of broadband is. [116]

HUAWEI
China telecom partnered with Yinchuan AOTOSO and Huawei has to propose a new business model and solutions for the livestock sector. The proposed solution is called UCOWS that harnesses NB-IoT instead of ZigBee for communication via the smart collar. The collar data is communicated through China Telecom's NB-IoT network and transmitted to a cow management platform. Farmers, vets, and livestock managers have real-time access to cow's health and other activitiesrelated data on a website or mobile app. [117]

CISCO
Integration of edge computing and IoT with a smart CISCO network that consists of IoT sensors are changing the way in which ecosystems and natural resources are protected. CISCO offers a highly integrated and fully functional infrastructure for LoRaWAN that enables the rangers to track and locate the position of rhinos in the park. CISCO LoRaWAN solution is ideal for urban environments which have larger areas. [118]

DELL
Dell technologies have improved the milk yield per cow by analyzing and monitoring the breeding and feeding of the animal through RFID sensors. Analyzing the large amount of produced data related to animals' health records, food consumption, milk production, and making information available to livestock managers or farmers through smartphones for decision making in order to improve milk yield of their cows. Apart from the above-mentioned functions and benefits, dell technologies also improved animals' health that leads to an increase in milk per animal by collecting the data from multiple farms. [119]

KAA IOT
Kaa IoT solutions for livestock management not only improve the farmer's business but also enhance the livelihood of each animal in the herd. Kaa IoT platform improves the livestock environment in five ways i.e. tracking the movement of freerange livestock, health monitoring, tracking animals' feed inventory, feeding alarms, and scheduler. [120]

BOSCH
Bosch Precision Livestock Farming solution controls the economic livestock parameters such as animal's weight which helps the ranchers to manage their large herds. RFID sensors are placed in each one's ear which takes power from an integrated solar panel and signals are transmitted without the internet through the antenna. [121] SAMSUNG Samsung Exynos I S111 is an LTE modem integrated with NB-IoT technology that carries a reliable and wide range of communication along with ultimate power efficiency for low data rate IoT applications. Exynos I S111 also features advanced algorithms of Samsung for a larger coverage and connected things for real-time livestock tracking. [122] For instance, in IoT-enabled livestock data is collected through sensors and transmitted to a cloud server and IoT gateways for further processing and analysis. At this level, challenges regarding IoT sensors and issues related to network implementation in IoT are major concerns [133]. Uniformly, many IoT deployments use TCP/IP protocols that are not appropriate for IoT applications. In this regard, many researchers have proposed multiple solutions to resolve this challenge [134].

9) SENSOR DEPLOYMENT ISSUES
In livestock farming, multiple sensors are installed throughout the animal's farms that are systematized in wireless sensor networks (WSNs). WSNs have severe limitations on processing capability, power consumption, and sensors having small memory [135]. These limitations open up new challenges for sensor-based applications in livestock. The scalability of WSN can enhance the performance of sensor-based applications in livestock by adding new sensors into a network to map extra parameters. Some challenges are associated with the signal strength of sensors as well as a selected area for the implementation of the network.

10) RESOURCE OPTIMIZATION
Livestock farm managers require a process to optimize the resources to decide an optimal number of IoT devices, gateways, and communicated data. Whereas, the size of an animal's farm varies and multi types of sensors are required to detect the farm parameters for livestock [136]. It will necessitate the deployment of statistical models and sophisticated algorithms in order to determine the resource distribution while optimizing the production and mitigating costs.

11) LOCALIZATION
Several considerations must be pondered while deploying IoT systems in livestock. These considerations are IoT devices' capacity to accept the play capability and position that must be installed and linked anywhere in livestock farms without the requirement of gateways [137].

12) HIGH INFRASTRUCTURE COST
There are some cost-related issues in IoT-enabled livestock which can be categorized as operating and setup costs [138]. The operating cost covers the expense of IoT systems in order to facilitate the data processing, knowledge exchange, and maintenance of other devices. Moreover, other operating costs are associated with data sharing among cloud servers, IoT devices, and gateways. Further, the setup cost is based on the expenses of IoT hardware i.e. sensors, gateways, and badges for a smart livestock deployment. However, some IoT providers give free-of-cost subscription packages with limited features, such as limited storage of information and the amount of associated IoT Devices. In this way, the increased features enhance the payment rates.

13) LACK OF AWARENESS
Lack of awareness regarding IoT technology and its application among farmers impeding IoT adoption in livestock environment. This is more likely in developed countries, where a number of farmers are illiterate and live-in remote areas. If the user interface is not available, the farmer's unable to utilize the knowledge that is a noteworthy obstacle [139]. B. SECURITY ATTACKS Authenticity, security, and confidentiality are necessary for IoT-enabled smart livestock farming systems [140]. Therefore, it is necessary to secure IoT networks from external attacks in the perception layer, data aggregation security in the network layer, and make sure that only authorized users can access or modify the data in the application layer. The most common security challenges in the perception layer include physical security i.e. hardware and information acquisition security. Yet, due to distributed nature and fact that IoT devices are deployed in a diverse environment, a single security protocol is not enough [141]. RFID security attacks are generally relevant to the information leakage that can unveil sensitive data. The most common security countermeasures include side-channel attacks, misinformation attacks, DoS attacks, malware injection attacks, jamming attacks, and cloud computing attacks.

1) SIDE-CHANNEL ATTACK
Smart livestock is an IoT use case due to which it hides some IoT vulnerabilities such as side-channel attacks [151]. In these attacks, multiple channels are exploited by an attacker. Such as, in a timing channel attack, computation time with cache hit and cache miss timing patterns can be exploited by adversaries. Hardware glitching is also another possible channel attack in the form of voltage variance and fluctuation in the system. Apart from this, other channel attacks consist of the leakage of possible electromagnetic power consumption patterns or even acoustic and sound channels.

2) MISINFORMATION ATTACK
In this type of attack, an attacker endangers data integrity. The attacker aims to release false information about a livestock farm claiming the outbreak of a disease in animals. Such incorrect data reports look-alike the actual report released by the targeted animal's farm. Since, this mimic report takes a lot of effort, money, and time to prove that the released report is incorrect, thus it must be taken care of

3) DENIAL OF SERVICES (DOS) ATTACKS
IoT devices that are used for the implementation of smart livestock can be used to launch DoS attacks [152]. Usually, there are a large number of connected devices or nodes in the entire farm which leads to DoS attacks. These attacks not only disrupt the normal functionality of operated modules in livestock environments but also leveraged illegitimate cyber services in other domains.

4) MALWARE INJECTION ATTACKS
Malware injection attack is the most prevalent threat to smart livestock farming, in which attacker injects malware into connected devices [153]. Malware is a large-scale threat that acts and propagates automatically through the system by making it a very attractive target point for attackers. IoT in the livestock field is being adopted widely, therefore more animals' farms and whole herds are connected to the internet. Most of the IoT deployments in Livestock farms use the same software components such as ZigBee and LoRa, therefore, the malware that infects a specific smart farm will also infect the other farms with the same system deployments. This type of attack steals the information about livestock and necessary data from animals' related machinery. In addition, it also hinders the functionalities of physical equipment which leaves devastating effects on farm areas and animal health.

5) RADIO FREQUENCY (RF) JAMMING ATTACK
During the smart livestock implementations, most of the devices and equipment depend upon the RF communications such as satellite or cellular networks. Usually, smart farming devices and equipment use global navigation satellite systems (GNSS) in order to enhance efficiency and other animal monitoring and tracking techniques. GNSS is obtained by combining real-time kinematics (RTK) with GPS to increase the precision and accuracy of real-time position data. An attacker may jam SGNN for malicious use by implementing various low-power jammers and disrupt the GNSS over larger areas which prevent the smart devices from properly functioning.

6) CLOUD COMPUTING ATTACKS
Cloud is a decentralized, heterogeneous, diverse, and powerful system. A large number of distributed resources make the cloud system a very hard target whereas, with the advent of innovative cloud concepts such as auto-scaling, selfprovisioning, and on-demand services, attackers can use such resources in their favor and make the cloud's most desirable targets point to an attacker. As it can be noticed that due to the advent of auto-scaling in a cloud environment, the maximum part of a virtual machine (VM)that is hosted on the cloud is configured similarly. If any of the VM is vulnerable, then there are maximum chances that all auto-scaled VMs are also vulnerable. In this regard, malware that infected one VM can easily propagate to all other VMs quickly which launches the distributed denial of services (DDoS) attacks to hinder the cloud functionality. A high-grade DDoS attack with a large number of messages, packets, or requests can deny services to a smart livestock farm, thereby paralyzing the intelligence of IoT-enabled smart livestock farms.

C. PROPOSED SECURITY MODEL
IoT-enabled livestock paradigm is not yet secured and robust because of which it is difficult to predict and identify all possible threats vulnerabilities as well as associated attacks in the IoT livestock domain. Nonetheless, when experts identify tentative security solutions to resolve predictable and apparent problems, they should have the capabilities to mitigate unpredictable and unseen security issues. To achieve such a security solution, a security system should be designed and implemented with dynamic properties. Consider a scenario in which the security mechanism consists of different security schemes to detect and evade IoT-enabled livestock healthcare attacks. Now consider that with an expansion of animal health devices, applications and networks, an attacker pledges an attack that threatens medical information and exploits the farm data's integrity. In such cases, existing security measures are expected to be enough to control and alleviate the new security issues by implementing dynamic algorithms. To address this security problem, this research demonstrates a security model for IoT-enabled livestock services. The proposed model is collaborative in nature as well as utilizes the utmost recent knowledge-based approach. The proposed model is shown in Figure 11 which consists of three services i.e. protection service, detection service, and reaction service. The protection service is designed to lessen the attacks. But, detection service obtains the data from animal's wearable devices, sensors, nodes, and networks. The received data is analyzed for further processing. With the help of a defense mechanism, the reaction services assist the health entities of livestock to survive all attacks.  The entire system and services have been designed by using dynamic algorithms, and there is a robust collaboration among these services in order to defend against existing and possible attacks. On the basis of an intrusion detection system, the detection service generates an action command to the reaction service and shares their detection experience with the protection service to relieve further attacks. In response, the reaction service removes malfunction risks and shares the active involvement with the protection and detection service. Hence, in this way model, inter-collaboration service is achieved.

D. FUTURE RESEARCH DIRECTIONS
The safety and quality of livestock products are not only regarding the consumption and health of animals but also relevant to the sustainable and maintained development of livestock. Furthermore, due to the rapid development of urban and rural populations and continuous growth of the ecommerce industry, the safety of animals and quantity of food poses new hidden dangers. In the future, the high-speed 5G network will play a major role in agriculture industry to improve livestock farming and the quality of food with minimal human effort [154]. The utilization of 5G technology will allow the farmers to be more productive and informed. However, the integration of 5G network with IoT provides an efficient and flexible solution for smart livestock farming. In this way, many unmanned agricultural machines will be operated automatically and achieve an ultimate reliable, secure, energy-efficient, environment friendly, and enable an unmanned livestock farm. In addition, the applications of 5G technology in farming such as predictive maintenance, virtual consultation, data analysis, real-time monitoring, and cloud repositories will improve livestock farming beyond the limits. The 5G-IoT technology also improves the safety and quality of e-commerce livestock products. The integration of 5G network will build a circulation information system to realize information sharing, real-time positioning of an animal, and security of the supply chain of animals as well as livestock products. The 5G-IoT technology also improves the safety and quality of e-commerce livestock products. The integration of 5G network will build a circulation information system to realize information sharing, real-time positioning of an animal, and security of the supply chain of animals as well as livestock products. Zhu et al. [155] also investigated that 5G is not only more efficient, accurate, and convenient agricultural procedures but also improves the circulation of livestock products and animals. Furthermore, the fast expansion of 5G, IoT, and blockchain can construct and formulate smart dairy cow's pasture production. The 5G-IoT + blockchain applications can ensure the safety and quality of milk in dairy farms and are expected to boost the ecological benefits. Additionally, the image processing application of 5G network can endorse efficient management and save labor costs. So, the combination of these technologies will improve the production efficiency and economic benefits of cattle farms [156]. The integration of IoT with blockchain can use smart contract technology to assist the law executor and livestock managers to find out the animal's productivity issues and process them on time. Furthermore, IoT and blockchain technologies can help to build self-organized, trusted, and ecological smart farming solutions in which all parties are involved, even they are unknown and untrusted [157]. In other smart livestock systems, the lack of data transfer and data sharing limits the method by which farmers can monitor and control the livestock farming parameters. The integration of IoT and blockchain technology provides more functional, decentralized, and secure data exchange.

VII. CONCLUSION
This article presents a survey on the recent advancement in the field of IoT-enabled livestock technologies. To this end, it discussed livestock network architecture, platform, and topology that support and maintain IoT backbone as well as facilitate animal's health-related data. In addition, this survey provided detailed research progresses concerning how IoT can monitor the feed grain and health of cattle, sheep, goats, cows, as well as ensure the traceability of wild animals and sustainability of multiple processes involved in livestock. Furthermore, an extensive view on how ongoing advances in IoT-livestock applications, devices, sensors, and communication protocols are revolutionizing the livestock industry. Apart from this, various security issues in this area have been highlighted, and a security model has also been proposed that can minimize the associated security threats. After exploring the IoT-based livestock research comprehensively, it is investigated that future research directions are necessary to provide effective livestock management, monitoring, controlling, and predicting solutions. To sum up, the results of this survey are expected to be useful for researchers, farmers, and policymakers working in the area of IoT-enabled livestock technologies.