You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/iot-edge/iot-edge-runtime.md
+20-23Lines changed: 20 additions & 23 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ description: Learn how the modules, security, communication, and reporting on yo
4
4
author: kgremban
5
5
manager: philmea
6
6
ms.author: kgremban
7
-
ms.date: 03/13/2019
7
+
ms.date: 06/06/2019
8
8
ms.topic: conceptual
9
9
ms.service: iot-edge
10
10
services: iot-edge
@@ -13,7 +13,7 @@ ms.custom: seodec18
13
13
14
14
# Understand the Azure IoT Edge runtime and its architecture
15
15
16
-
The IoT Edge runtime is a collection of programs that need to be installed on a device for it to be considered an IoT Edge device. Collectively, the components of the IoT Edge runtime enable IoT Edge devices to receive code to run at the edge, and communicate the results.
16
+
The IoT Edge runtime is a collection of programs that turn a device into an IoT Edge device. Collectively, the IoT Edge runtime components enable IoT Edge devices to receive code to run at the edge, and communicate the results.
17
17
18
18
The IoT Edge runtime performs the following functions on IoT Edge devices:
19
19
@@ -27,7 +27,7 @@ The IoT Edge runtime performs the following functions on IoT Edge devices:
27
27
28
28

29
29
30
-
The responsibilities of the IoT Edge runtime fall into two categories: communication and module management. These two roles are performed by two components that make up the IoT Edge runtime. The *IoT Edge hub* is responsible for communication, while the *IoT Edge agent* deploys and monitors the modules.
30
+
The responsibilities of the IoT Edge runtime fall into two categories: communication and module management. These two roles are performed by two components that are part of the IoT Edge runtime. The *IoT Edge hub* is responsible for communication, while the *IoT Edge agent* deploys and monitors the modules.
31
31
32
32
Both the IoT Edge hub and the IoT Edge agent are modules, just like any other module running on an IoT Edge device.
33
33
@@ -36,44 +36,39 @@ Both the IoT Edge hub and the IoT Edge agent are modules, just like any other mo
36
36
The IoT Edge hub is one of two modules that make up the Azure IoT Edge runtime. It acts as a local proxy for IoT Hub by exposing the same protocol endpoints as IoT Hub. This consistency means that clients (whether devices or modules) can connect to the IoT Edge runtime just as they would to IoT Hub.
37
37
38
38
>[!NOTE]
39
-
> IoT Edge Hub supports clients that connect using MQTT or AMQP. It does not support clients that use HTTP.
39
+
> IoT Edge hub supports clients that connect using MQTT or AMQP. It does not support clients that use HTTP.
40
40
41
41
The IoT Edge hub is not a full version of IoT Hub running locally. There are some things that the IoT Edge hub silently delegates to IoT Hub. For example, IoT Edge hub forwards authentication requests to IoT Hub when a device first tries to connect. After the first connection is established, security information is cached locally by IoT Edge hub. Subsequent connections from that device are allowed without having to authenticate to the cloud.
42
42
43
-
>[!NOTE]
44
-
>The runtime must be connected every time it tries to authenticate a device.
45
-
46
43
To reduce the bandwidth your IoT Edge solution uses, the IoT Edge hub optimizes how many actual connections are made to the cloud. IoT Edge hub takes logical connections from clients like modules or leaf devices and combines them for a single physical connection to the cloud. The details of this process are transparent to the rest of the solution. Clients think they have their own connection to the cloud even though they are all being sent over the same connection.
47
44
48
45

49
46
50
-
IoT Edge hub can determine whether it's connected to IoT Hub. If the connection is lost, IoT Edge hub saves messages or twin updates locally. Once a connection is reestablished, it syncs all the data. The location used for this temporary cache is determined by a property of the IoT Edge hub’s module twin. The size of the cache is not capped and will grow as long as the device has storage capacity.
47
+
IoT Edge hub can determine whether it's connected to IoT Hub. If the connection is lost, IoT Edge hub saves messages or twin updates locally. Once a connection is reestablished, it syncs all the data. The location used for this temporary cache is determined by a property of the IoT Edge hub’s module twin. The size of the cache is not capped and will grow as long as the device has storage capacity. For more information, see [Offline capabilities](offline-capabilities.md).
51
48
52
49
### Module communication
53
50
54
-
IoT Edge hub facilitates module to module communication. Using IoT Edge hub as a message broker keeps modules independent from each other. Modules only need to specify the inputs on which they accept messages and the outputs to which they write messages. A solution developer then stitches these inputs and outputs together so that the modules process data in the order specific to that solution.
51
+
IoT Edge hub facilitates module to module communication. Using IoT Edge hub as a message broker keeps modules independent from each other. Modules only need to specify the inputs on which they accept messages and the outputs to which they write messages. A solution developer can stitch these inputs and outputs together so that the modules process data in the order specific to that solution.
To send data to the IoT Edge hub, a module calls the SendEventAsync method. The first argument specifies on which output to send the message. The following pseudocode sends a message on output1:
55
+
To send data to the IoT Edge hub, a module calls the SendEventAsync method. The first argument specifies on which output to send the message. The following pseudocode sends a message on **output1**:
To receive a message, register a callback that processes messages coming in on a specific input. The following pseudocode registers the function messageProcessor to be used for processing all messages received on input1:
63
+
To receive a message, register a callback that processes messages coming in on a specific input. The following pseudocode registers the function messageProcessor to be used for processing all messages received on **input1**:
For more information about the ModuleClient class and its communication methods, see the API reference for your preferred SDK language: [C#](https://docs.microsoft.com/dotnet/api/microsoft.azure.devices.client.moduleclient?view=azure-dotnet), [C and Python](https://docs.microsoft.com/azure/iot-hub/iot-c-sdk-ref/iothub-module-client-h), [Java](https://docs.microsoft.com/java/api/com.microsoft.azure.sdk.iot.device.moduleclient?view=azure-java-stable), or [Node.js](https://docs.microsoft.com/javascript/api/azure-iot-device/moduleclient?view=azure-node-latest).
73
70
74
-
The solution developer is responsible for specifying the rules that determine how IoT Edge hub passes messages between modules. Routing rules are defined in the cloud and pushed down to IoT Edge hub in its device twin. The same syntax for IoT Hub routes is used to define routes between modules in Azure IoT Edge.
75
-
76
-
<!--- For more info on how to declare routes between modules, see []. --->
71
+
The solution developer is responsible for specifying the rules that determine how IoT Edge hub passes messages between modules. Routing rules are defined in the cloud and pushed down to IoT Edge hub in its device twin. The same syntax for IoT Hub routes is used to define routes between modules in Azure IoT Edge. For more information, see [Learn how to deploy modules and establish routes in IoT Edge](module-composition.md).
77
72
78
73

79
74
@@ -86,33 +81,35 @@ The [IoT Edge security daemon](iot-edge-security-manager.md) starts the IoT Edge
86
81
Each item in the deployment manifest contains specific information about a module and is used by the IoT Edge agent for controlling the module’s lifecycle. Some of the more interesting properties are:
87
82
88
83
***settings.image** – The container image that the IoT Edge agent uses to start the module. The IoT Edge agent must be configured with credentials for the container registry if the image is protected by a password. Credentials for the container registry can be configured remotely using the deployment manifest, or on the IoT Edge device itself by updating the `config.yaml` file in the IoT Edge program folder.
89
-
***settings.createOptions** – A string that is passed directly to the Docker daemon when starting a module’s container. Adding Docker options in this property allows for advanced options like port forwarding or mounting volumes into a module’s container.
90
-
***status** – The state in which the IoT Edge agent places the module. This value is usually set to *running* as most people want the IoT Edge agent to immediately start all modules on the device. However, you could specify the initial state of a module to be stopped and wait for a future time to tell the IoT Edge agent to start a module. The IoT Edge agent reports the status of each module back to the cloud in the reported properties. A difference between the desired property and the reported property is an indicator of a misbehaving device. The supported statuses are:
84
+
***settings.createOptions** – A string that is passed directly to the Moby container daemon when starting a module’s container. Adding options in this property allows for advanced configurations like port forwarding or mounting volumes into a module’s container.
85
+
***status** – The state in which the IoT Edge agent places the module. Usually, this value is set to *running* as most people want the IoT Edge agent to immediately start all modules on the device. However, you could specify the initial state of a module to be stopped and wait for a future time to tell the IoT Edge agent to start a module. The IoT Edge agent reports the status of each module back to the cloud in the reported properties. A difference between the desired property and the reported property is an indicator of a misbehaving device. The supported statuses are:
91
86
* Downloading
92
87
* Running
93
88
* Unhealthy
94
89
* Failed
95
90
* Stopped
96
91
***restartPolicy** – How the IoT Edge agent restarts a module. Possible values include:
97
-
*Never – The IoT Edge agent never restarts the module.
98
-
*onFailure - If the module crashes, the IoT Edge agent restarts it. If the module shuts down cleanly, the IoT Edge agent does not restart it.
99
-
*Unhealthy - If the module crashes or is deemed unhealthy, the IoT Edge agent restarts it.
100
-
*Always - If the module crashes, is deemed unhealthy, or shuts down in any way, the IoT Edge agent restarts it.
92
+
*`never` – The IoT Edge agent never restarts the module.
93
+
*`on-failure` - If the module crashes, the IoT Edge agent restarts it. If the module shuts down cleanly, the IoT Edge agent does not restart it.
94
+
*`on-unhealthy` - If the module crashes or is considered unhealthy, the IoT Edge agent restarts it.
95
+
*`always` - If the module crashes, is considered unhealthy, or shuts down in any way, the IoT Edge agent restarts it.
101
96
102
97
The IoT Edge agent sends runtime response to IoT Hub. Here is a list of possible responses:
103
98
* 200 - OK
104
99
* 400 - The deployment configuration is malformed or invalid.
105
-
* 417 - The device does not have a deployment configuration set.
100
+
* 417 - The device doesn't have a deployment configuration set.
106
101
* 412 - The schema version in the deployment configuration is invalid.
107
102
* 406 - The IoT Edge device is offline or not sending status reports.
108
103
* 500 - An error occurred in the IoT Edge runtime.
109
104
105
+
For more information, see [Learn how to deploy modules and establish routes in IoT Edge](module-composition.md).
106
+
110
107
### Security
111
108
112
109
The IoT Edge agent plays a critical role in the security of an IoT Edge device. For example, it performs actions like verifying a module’s image before starting it.
113
110
114
-
For more information about the Azure IoT Edge security framework, read about the [IoT Edge security manager](iot-edge-security-manager.md)
111
+
For more information about the Azure IoT Edge security framework, read about the [IoT Edge security manager](iot-edge-security-manager.md).
0 commit comments