How to apply a hierarchy of edge devices at scale to ISA-95 IIoT environments

Published 04-28-2021 08:00 AM 1,424 Views
Microsoft

Using a hierarchy of IoT Edge devices in manufacturing scenarios lets customers keep their existing infrastructure but at the same time customers can benefit from being able to fully address, manage and control the IoT edge devices on the factory floor, even if they are completely disconnected from the Internet.

 

This helps to address critical challenges in the implementation of Industrial IoT such as the balance between security and business value, as well as how to effectively implement new technology within the context of a legacy infrastructure.

One of the established concepts in operational technology is the ISA-95 standard and the Purdue model of control. These define the models, interactions and relationships between systems in well understood layers. These layers are in turn used to define the network infrastructure, with strict interfaces between layers controlled by firewalls.

Azure IoT Edge in a nested hierarchy is ideally placed to address many of these requirements and help you to build secure and manageable edge solutions within established structures.

 

 

Let us move beyond the Tutorials to create a hierarchy of IoT Edge devices and answer the following questions:

  • Which steps and configurations should you carry out to make your IIoT edge solution production ready?
  • How to secure communications between edge devices and the IoT Hub
  • What are best practices to scale your deployments across a fleet of devices and keep your configurations clear and manageable.
  • What are the extra steps needed to deploy a hierarchy of  IoT Edge devices with 3 or more layers?
  • How would you manage and control lower-level disconnected devices?
  • How can I control what happens when connectivity between layers or the cloud is lost?

To make this real we have set up a sample configuration of 3 physical IoT Edge devices in a nested configuration defined as:

“Level 3 – Lower Layer Device”, “Level 4 – Lower Layer Gateway” and “Level 5 – Top Layer Gateway”.

 

To give you a glimpse of the configuration we have built and how it maps to the ISA-95 levels, check out this diagram:

 

steffi_grois_3-1619104624396.png

 

You can find a step-by-step tutorial how to enable and use all of these best practices on this GitHub. Make sure to check it out.

 

Getting your IIoT edge solution production ready

 

Most of the best practice for implementing edge solutions for industrial IoT applies, whether you are using a nested configuration or not. Introductory reading here is the excellent checklist for getting your IoT edge instance ready for production.

On top of that, we would advise you to use a set of best practices that the Azure IoT Services have to offer, namely:

  • Securing communications
    • Use Root CA X.509 certificates to authenticate and secure communications between parent and child devices, as well as to the IoT Hub.
    • Use existing company public key infrastructure if possible, for managing your certificates with dedicated intermediate certificates for signing the edge certificates.
    • Consider a separate intermediate certificate outside the enterprise chain of trust to sign the edge CA certificates.
  • Deployment management
    • Tag your devices in the Device Twins to identify a target group of devices via queries
    • Use automatic deployments and jobs to apply the same configuration to a set of devices
    • Use layered deployments to extend the capabilities of some devices without having to change configurations for all devices in the fleet
  • Connectivity resilience
    • Store and forward messages if the devices are separated from the network on the device using the Time To Live Setting in Device Twin

Certificates for a hierarchy of edge devices

 

To establish communication and authentication between the devices and the cloud, Industrial IoT companies often prefer using certificate-based authentication instead of using symmetric keys. We also recommend using X.509 based authentication with a chain extending to a trusted root CA for added security in productive environments.

On top of using a certificate for the authentication to the cloud, you would be required to use certificates to establish trust between the parent and child devices for transparent gateway operations.

Even in a nested scenario, every IoT Edge device needs to have its own unique device identity in the IoT Hub. Crucially, this means that you would usually generate two sets of certificates for each device:

 

  • An optional device client certificate and key for each device to identify and authenticate the device to the IoT Hub. Alternatively, this could be a symmetric key and the user is free to mix authentication modes within the nested hierarchy.
  • A required signing CA certificate, so that the edge can sign its own workload client certificates. These are used to secure connections between the different components on an IoT Edge device or between an IoT Edge device and any leaf devices in a nested hierarchy. This concept is further explained in our documentation.

If you are unsure about the terminology, check out this blogpost: The layman’s guide to X.509 certificate jargon

On the layer 4 device, the respective part of the files would look like the following. Look closely at the naming differences to understand the different certificate sets:

 

steffi_grois_0-1619101382842.png

 

If you need more details how to apply the certificates to the devices and to IoT Hub, check out the GitHub.

 

Using layered deployments to roll out configurations at scale

 

Instead of setting the modules and deployment manifests manually for each IoT Edge device, it is recommended to use automatic deployments for a fleet of devices and especially in production scenarios. In a nested edge scenario, we have seen particular value in the use of layered deployments to fine tune workloads.

 

Deployments are rolled out to device populations by matching user defined target conditions, for example device twin properties or tags, in a strict priority order.

Layered Deployments can be used to expand the deployment to include additional modules or override configurations on top of a base deployment manifest.

Tags are very useful to group a set of devices by using the Device Twin or Module Twin of IoT Edge Devices.

 

Our devices have the following tags set to true in their device twins.

 

 

Level 5 – Top Layer Gateway 

Level 4 – Lower Layer Gateway

Level 3 – Lower Layer Device 

Tag Names

topnestededge

tempsensor

nestededge

nestedgateway

tempsensor

nestededge

tempsensor

 

In detail we have the following configuration:

  • One base deployment manifest for the top layer Gateway (layer 5) for devices where topnestededge=true. This is a basic deployment manifest with the system modules and the API proxy module needed for nested operations. Since this has an internet connection we get obtain images directly from the Microsoft Container Registry (MCR).
  • One layered deployment manifest for the layer 5 edge devices to deploy the Simulated Temperature also from the MCR. This targets device with both tags.tempsensor=true AND tags.topnestededge=true
  • One base deployment manifest for the lower layer devices (layer 3 + 4) with tag nestededge. This only contains the system modules with an image that points to $upstream. This tells the edge runtime to pull images from the parent edge device.
  • One layered deployment manifest for the lower layer 4 Edge Device to deploy the IoTEdgeAPIProxy from $upstream. This applies to all devices with tag nestedgateway.
  • One layered deployment manifest for the lower layer 3 + 4 Edge Devices to deploy the Simulated Temperature Sensor from $upstream.

In IoT Hub, all deployments together look like the following: 

 

steffi_grois_1-1619101489579.png

 

Some other examples of layered deployments are also available in the GitHub.

 

Use the Module Twin or Direct Methods to send commands and desired configurations to lower-layer devices

 

As we have created IoT Hub Device Identities for all devices, we are able to control these devices from the cloud directly.

If we would like to update the Module Twin of our Level 3 device, for example, we would change the desired property for the respective module to enable it.

steffi_grois_2-1619104358755.png

 

On top of that, we can also send direct methods directly from the cloud to a lower layer device. The message will be received by the top layer device and be routed through the edgeHubs of each device in the hierarchy until it reaches its designated device.

While sending direct methods to a lower layer device is a good way to directly control even disconnected devices, it requires the lower layer device to be connected to and discoverable by a parent device.

 

But what happens if a lower-layer device would go offline due to a networking failure of its parent?

What happens to the up – and downstream data flow on the lower levels?

 

How do the devices recover if the connection between the layers is separated?

 

In a nested hierarchy, each device has a dependency on its parent devices for connectivity. If the network connection is severed on a device in a given layer, then all devices that are residing in lower layers will also be unable to continue sending messages.

In our example, if the network connection of the layer 4 device is disconnected, both the layer 4 device and layer 3 device recognize this, and the normal store and forward functionality of the Edge Hub starts buffering. Layer 5 remains unaware and continues sending its messages to the IoT Hub. Once the network connections are re-established, each device automatically sends their queued messages in the original order. The time of how long a message should be stored is defined as the TTL (“Time To Live”) in the Module Identity twin for edgeHub of each device. The standard TTL setting is 7200 seconds or two hours.

 

"$edgeHub":{
	"properties.desired": {
		"schemaVersion": "1.0",
		"routes": {},
		"storeAndForwardConfiguration": {
			"timeToLiveSecs": 7200
		}
	}
}

 

 

If fine tuning is required the both the TTL and the priority of messages can also be defined in the routing rules for the edgeHub. The actual number of messages able to be stored on the device of course depends on the disk size of the device.

Device twin updates, cloud-to-device messages and direct method calls that are targeting a device that is temporarily offline, will also be queued in the IoT Hub whilst the edge is offline. They will be sent on, as long as the device reappears within the defined TTL period for C2D or the timeout for a direct method. This needs to considered in the solution design to avoid potential message loss or undesired operations occurring after they are still needed. The most robust way of communicating configuration, operational parameters and status remains the device or module twins.

See Operate devices offline - Azure IoT Edge | Microsoft Docs if you would like to learn more about offline behavior of IoT Edge devices.

 

Conclusion

 

We have walked through the practical application of nesting IoT Edge devices in industrial IoT and shown some best practice in managing the complexity in managing many heterogenous workloads on the edge. For more technical detail please visit the linked GitHub repository.

Want to try out and deploy a simulated purdue network model using IoT Edge?  Look at this Github!

Stay informed. For the latest updates on new releases, tools, and resources, stay tuned to this blog and follow us @MSIoTDevs on Twitter.

%3CLINGO-SUB%20id%3D%22lingo-sub-2280321%22%20slang%3D%22en-US%22%3EHow%20to%20apply%20a%20hierarchy%20of%20edge%20devices%20at%20scale%20to%20ISA-95%20IIoT%20environments%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2280321%22%20slang%3D%22en-US%22%3E%3CP%3EUsing%20a%20hierarchy%20of%20IoT%20Edge%20devices%20in%20manufacturing%20scenarios%20lets%20customers%20keep%20their%20existing%20infrastructure%20but%20at%20the%20same%20time%20customers%20can%20benefit%20from%20being%20able%20to%20fully%20address%2C%20manage%20and%20control%20the%20IoT%20edge%20devices%20on%20the%20factory%20floor%2C%20even%20if%20they%20are%20completely%20disconnected%20from%20the%20Internet.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThis%20helps%20to%20address%20critical%20challenges%20in%20the%20implementation%20of%20Industrial%20IoT%20such%20as%20the%20balance%20between%20security%20and%20business%20value%2C%20as%20well%20as%20how%20to%20effectively%20implement%20new%20technology%20within%20the%20context%20of%20a%20legacy%20infrastructure.%3C%2FP%3E%0A%3CP%3EOne%20of%20the%20established%20concepts%20in%20operational%20technology%20is%20the%20ISA-95%20standard%20and%20the%20Purdue%20model%20of%20control.%20These%20define%20the%20models%2C%20interactions%20and%20relationships%20between%20systems%20in%20well%20understood%20layers.%20These%20layers%20are%20in%20turn%20used%20to%20define%20the%20network%20infrastructure%2C%20with%20strict%20interfaces%20between%20layers%20controlled%20by%20firewalls.%3C%2FP%3E%0A%3CP%3EAzure%20IoT%20Edge%20in%20a%20nested%20hierarchy%20is%20ideally%20placed%20to%20address%20many%20of%20these%20requirements%20and%20help%20you%20to%20build%20secure%20and%20manageable%20edge%20solutions%20within%20established%20structures.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CDIV%20style%3D%22position%3A%20relative%3B%20left%3A%2012.5%25%3B%20padding-bottom%3A%2042.3%25%3B%20padding-top%3A%200px%3B%20height%3A%200%3B%20overflow%3A%20hidden%3B%20min-width%3A%20320px%3B%20max-width%3A%2075%25%3B%22%3E%3CIFRAME%20src%3D%22https%3A%2F%2Fwww.youtube-nocookie.com%2Fembed%2FKpoNALjeoOw%3Fcontrols%3D0%26amp%3Bautoplay%3Dfalse%26amp%3BWT.mc_id%3Diot-c9-niner%22%20frameborder%3D%220%22%20allowfullscreen%3D%22allowfullscreen%22%20style%3D%22position%3A%20absolute%3B%20top%3A%200%3B%20left%3A%200%3B%20width%3A%20100%25%3B%20height%3A%20100%25%3B%22%20class%3D%22video-iframe%22%20title%3D%22IoT%20Show%20episode%20about%20applying%20a%20hierarchy%20of%20edge%20devices%20at%20scale%20to%20ISA-95%20IIoT%20environments%22%3E%3C%2FIFRAME%3E%3C%2FDIV%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ELet%20us%20move%20beyond%20the%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fazure%2Fiot-edge%2Ftutorial-nested-iot-edge%3Fview%3Diotedge-2020-11%26amp%3Btabs%3Dazure-portal%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3ETutorials%20to%20create%20a%20hierarchy%20of%20IoT%20Edge%20devices%3C%2FA%3E%20and%20answer%20the%20following%20questions%3A%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EWhich%20steps%20and%20configurations%20should%20you%20carry%20out%20to%20make%20your%20IIoT%20edge%20solution%20production%20ready%3F%3C%2FLI%3E%0A%3CLI%3EHow%20to%20secure%20communications%20between%20edge%20devices%20and%20the%20IoT%20Hub%3C%2FLI%3E%0A%3CLI%3EWhat%20are%20best%20practices%20to%20scale%20your%20deployments%20across%20a%20fleet%20of%20devices%20and%20keep%20your%20configurations%20clear%20and%20manageable.%3C%2FLI%3E%0A%3CLI%3EWhat%20are%20the%20extra%20steps%20needed%20to%20deploy%20a%20hierarchy%20of%20%26nbsp%3BIoT%20Edge%20devices%20with%203%20or%20more%20layers%3F%3C%2FLI%3E%0A%3CLI%3EHow%20would%20you%20manage%20and%20control%20lower-level%20disconnected%20devices%3F%3C%2FLI%3E%0A%3CLI%3EHow%20can%20I%20control%20what%20happens%20when%20connectivity%20between%20layers%20or%20the%20cloud%20is%20lost%3F%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3ETo%20make%20this%20real%20we%20have%20set%20up%20a%20sample%20configuration%20of%203%20physical%20IoT%20Edge%20devices%20in%20a%20nested%20configuration%20defined%20as%3A%3C%2FP%3E%0A%3CP%3E%3CEM%3E%E2%80%9CLevel%203%20%E2%80%93%20Lower%20Layer%20Device%E2%80%9D%2C%20%E2%80%9CLevel%204%20%E2%80%93%20Lower%20Layer%20Gateway%E2%80%9D%20and%20%E2%80%9CLevel%205%20%E2%80%93%20Top%20Layer%20Gateway%E2%80%9D.%3C%2FEM%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ETo%20give%20you%20a%20glimpse%20of%20the%20configuration%20we%20have%20built%20and%20how%20it%20maps%20to%20the%20ISA-95%20levels%2C%20check%20out%20this%20diagram%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20align%3D%22center%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22steffi_grois_3-1619104624396.png%22%20style%3D%22width%3A%20800px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F274723iE6CDFC3163E9321C%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22steffi_grois_3-1619104624396.png%22%20alt%3D%22steffi_grois_3-1619104624396.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EYou%20can%20find%20a%20step-by-step%20tutorial%20how%20to%20enable%20and%20use%20all%20of%20these%20best%20practices%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FnanowireUK%2Fazure-iot-walkthroughs%2Ftree%2Fmain%2Fazure-iot-nested-edge%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Eon%20this%20GitHub%3C%2FA%3E.%20Make%20sure%20to%20check%20it%20out.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId--471640781%22%20id%3D%22toc-hId--492942438%22%3EGetting%20your%20IIoT%20edge%20solution%20production%20ready%3C%2FH2%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EMost%20of%20the%20best%20practice%20for%20implementing%20edge%20solutions%20for%20industrial%20IoT%20applies%2C%20whether%20you%20are%20using%20a%20nested%20configuration%20or%20not.%20Introductory%20reading%20here%20is%20the%20excellent%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fazure%2Fiot-edge%2Fproduction-checklist%3Fview%3Diotedge-2018-06%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Echecklist%20for%20getting%20your%20IoT%20edge%20instance%20ready%20for%20production.%3C%2FA%3E%3C%2FP%3E%0A%3CP%3EOn%20top%20of%20that%2C%20we%20would%20advise%20you%20to%20use%20a%20set%20of%20best%20practices%20that%20the%20Azure%20IoT%20Services%20have%20to%20offer%2C%20namely%3A%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3ESecuring%20communications%3CUL%3E%0A%3CLI%3EUse%20Root%20CA%20X.509%20certificates%20to%20authenticate%20and%20secure%20communications%20between%20parent%20and%20child%20devices%2C%20as%20well%20as%20to%20the%20IoT%20Hub.%3C%2FLI%3E%0A%3CLI%3EUse%20existing%20company%20public%20key%20infrastructure%20if%20possible%2C%20for%20managing%20your%20certificates%20with%20dedicated%20intermediate%20certificates%20for%20signing%20the%20edge%20certificates.%3C%2FLI%3E%0A%3CLI%3EConsider%20a%20separate%20intermediate%20certificate%20outside%20the%20enterprise%20chain%20of%20trust%20to%20sign%20the%20edge%20CA%20certificates.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3C%2FLI%3E%0A%3CLI%3EDeployment%20management%3CUL%3E%0A%3CLI%3ETag%20your%20devices%20in%20the%20Device%20Twins%20to%20identify%20a%20target%20group%20of%20devices%20via%20queries%3C%2FLI%3E%0A%3CLI%3EUse%20automatic%20deployments%20and%20jobs%20to%20apply%20the%20same%20configuration%20to%20a%20set%20of%20devices%3C%2FLI%3E%0A%3CLI%3EUse%20layered%20deployments%20to%20extend%20the%20capabilities%20of%20some%20devices%20without%20having%20to%20change%20configurations%20for%20all%20devices%20in%20the%20fleet%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3C%2FLI%3E%0A%3CLI%3EConnectivity%20resilience%3CUL%3E%0A%3CLI%3EStore%20and%20forward%20messages%20if%20the%20devices%20are%20separated%20from%20the%20network%20on%20the%20device%20using%20the%20Time%20To%20Live%20Setting%20in%20Device%20Twin%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CH2%20id%3D%22toc-hId-2015872052%22%20id%3D%22toc-hId-1994570395%22%3ECertificates%20for%20a%20hierarchy%20of%20edge%20devices%3C%2FH2%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ETo%20establish%20communication%20and%20authentication%20between%20the%20devices%20and%20the%20cloud%2C%20Industrial%20IoT%20companies%20often%20prefer%20using%20certificate-based%20authentication%20instead%20of%20using%20symmetric%20keys.%20We%20also%20recommend%20using%20X.509%20based%20authentication%20with%20a%20chain%20extending%20to%20a%20trusted%20root%20CA%20for%20added%20security%20in%20productive%20environments.%3C%2FP%3E%0A%3CP%3EOn%20top%20of%20using%20a%20certificate%20for%20the%20authentication%20to%20the%20cloud%2C%20you%20would%20be%20required%20to%20use%20certificates%20to%20establish%20trust%20between%20the%20parent%20and%20child%20devices%20for%20transparent%20gateway%20operations.%3C%2FP%3E%0A%3CP%3EEven%20in%20a%20nested%20scenario%2C%20every%20IoT%20Edge%20device%20needs%20to%20have%20its%20own%20unique%20device%20identity%20in%20the%20IoT%20Hub.%20Crucially%2C%20this%20means%20that%20you%20would%20usually%20%3CSTRONG%3Egenerate%20two%20sets%20of%20certificates%20for%20each%20device%3C%2FSTRONG%3E%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EAn%20optional%20device%20client%20certificate%20and%20key%20for%20each%20device%20to%20identify%20and%20authenticate%20the%20device%20to%20the%20IoT%20Hub.%20Alternatively%2C%20this%20could%20be%20a%20symmetric%20key%20and%20the%20user%20is%20free%20to%20mix%20authentication%20modes%20within%20the%20nested%20hierarchy.%3C%2FLI%3E%0A%3CLI%3EA%20required%20signing%20CA%20certificate%2C%20so%20that%20the%20edge%20can%20sign%20its%20own%20workload%20client%20certificates.%20These%20are%20used%20to%20secure%20connections%20between%20the%20different%20components%20on%20an%20IoT%20Edge%20device%20or%20between%20an%20IoT%20Edge%20device%20and%20any%20leaf%20devices%20in%20a%20nested%20hierarchy.%20This%20concept%20is%20further%20explained%20in%20our%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fazure%2Fiot-edge%2Fiot-edge-certs%3Fview%3Diotedge-2018-06%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%22%3Edocumentation%3C%2FA%3E.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3EIf%20you%20are%20unsure%20about%20the%20terminology%2C%20check%20out%20this%20blogpost%3A%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Finternet-of-things%2Fthe-layman-s-guide-to-x-509-certificate-jargon%2Fba-p%2F2203540%22%20target%3D%22_self%22%3EThe%20layman%E2%80%99s%20guide%20to%20X.509%20certificate%20jargon%3C%2FA%3E%3C%2FP%3E%0A%3CP%3EOn%20the%20layer%204%20device%2C%20the%20respective%20part%20of%20the%20files%20would%20look%20like%20the%20following.%20Look%20closely%20at%20the%20naming%20differences%20to%20understand%20the%20different%20certificate%20sets%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20align%3D%22center%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22steffi_grois_0-1619101382842.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F274717i939BA2160B9504A1%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22steffi_grois_0-1619101382842.png%22%20alt%3D%22steffi_grois_0-1619101382842.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIf%20you%20need%20more%20details%20how%20to%20apply%20the%20certificates%20to%20the%20devices%20and%20to%20IoT%20Hub%2C%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FnanowireUK%2Fazure-iot-walkthroughs%2Ftree%2Fmain%2Fazure-iot-nested-edge%23common-gateway-setup-offline%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Echeck%20out%20the%20GitHub%3C%2FA%3E.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId-208417589%22%20id%3D%22toc-hId-187115932%22%3EUsing%20layered%20deployments%20to%20roll%20out%20configurations%20at%20scale%3C%2FH2%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EInstead%20of%20setting%20the%20modules%20and%20deployment%20manifests%20manually%20for%20each%20IoT%20Edge%20device%2C%20it%20is%20recommended%20to%20use%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fazure%2Fiot-edge%2Fmodule-deployment-monitoring%3Fview%3Diotedge-2018-06%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%22%3Eautomatic%20deployments%3C%2FA%3E%20for%20a%20fleet%20of%20devices%20and%20especially%20in%20production%20scenarios.%20In%20a%20nested%20edge%20scenario%2C%20we%20have%20seen%20particular%20value%20in%20the%20use%20of%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fazure%2Fiot-edge%2Fmodule-deployment-monitoring%3Fview%3Diotedge-2018-06%23layered-deployment%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%22%3Elayered%20deployments%3C%2FA%3E%20to%20fine%20tune%20workloads.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EDeployments%3C%2FSTRONG%3E%20are%20rolled%20out%20to%20device%20populations%20by%20matching%20user%20defined%20target%20conditions%2C%20for%20example%20device%20twin%20properties%20or%20tags%2C%20in%20a%20strict%20priority%20order.%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3ELayered%20Deployments%3C%2FSTRONG%3E%20can%20be%20used%20to%20expand%20the%20deployment%20to%20include%20additional%20modules%20or%20override%20configurations%20on%20top%20of%20a%20base%20deployment%20manifest.%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3ETags%3C%2FSTRONG%3E%20are%20very%20useful%20to%20group%20a%20set%20of%20devices%20by%20using%20the%20Device%20Twin%20or%20Module%20Twin%20of%20IoT%20Edge%20Devices.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EOur%20devices%20have%20the%20following%20tags%20set%20to%20true%20in%20their%20device%20twins.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CTABLE%20style%3D%22width%3A%20800px%3B%22%20width%3D%22522px%22%3E%0A%3CTBODY%3E%0A%3CTR%3E%0A%3CTD%20width%3D%22122px%22%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%22216px%22%3E%3CP%3ELevel%205%20%E2%80%93%20Top%20Layer%20Gateway%26nbsp%3B%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%22239.333px%22%3E%3CP%3ELevel%204%20%E2%80%93%20Lower%20Layer%20Gateway%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%22222px%22%3E%3CP%3ELevel%203%20%E2%80%93%20Lower%20Layer%20Device%26nbsp%3B%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20width%3D%22122px%22%3E%3CP%3ETag%20Names%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%22216px%22%3E%3CP%3Etopnestededge%3C%2FP%3E%0A%3CP%3Etempsensor%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%22239.333px%22%3E%3CP%3Enestededge%3C%2FP%3E%0A%3CP%3Enestedgateway%3C%2FP%3E%0A%3CP%3Etempsensor%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%22222px%22%3E%3CP%3Enestededge%3C%2FP%3E%0A%3CP%3Etempsensor%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3C%2FTBODY%3E%0A%3C%2FTABLE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIn%20detail%20we%20have%20the%20following%20configuration%3A%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EOne%20base%20deployment%20manifest%20for%20the%20top%20layer%20Gateway%20(layer%205)%20for%20devices%20where%20topnestededge%3Dtrue.%20This%20is%20a%20basic%20deployment%20manifest%20with%20the%20system%20modules%20and%20the%20API%20proxy%20module%20needed%20for%20nested%20operations.%20Since%20this%20has%20an%20internet%20connection%20we%20get%20obtain%20images%20directly%20from%20the%20Microsoft%20Container%20Registry%20(MCR).%3C%2FLI%3E%0A%3CLI%3EOne%20layered%20deployment%20manifest%20for%20the%20layer%205%20edge%20devices%20to%20deploy%20the%20Simulated%20Temperature%20also%20from%20the%20MCR.%20This%20targets%20device%20with%20both%20tags.tempsensor%3Dtrue%20AND%20tags.topnestededge%3Dtrue%3C%2FLI%3E%0A%3CLI%3EOne%20base%20deployment%20manifest%20for%20the%20lower%20layer%20devices%20(layer%203%20%2B%204)%20with%20tag%20nestededge.%20This%20only%20contains%20the%20system%20modules%20with%20an%20image%20that%20points%20to%20%24upstream.%20This%20tells%20the%20edge%20runtime%20to%20pull%20images%20from%20the%20parent%20edge%20device.%3C%2FLI%3E%0A%3CLI%3EOne%20layered%20deployment%20manifest%20for%20the%20lower%20layer%204%20Edge%20Device%20to%20deploy%20the%20IoTEdgeAPIProxy%20from%20%24upstream.%20This%20applies%20to%20all%20devices%20with%20tag%20nestedgateway.%3C%2FLI%3E%0A%3CLI%3EOne%20layered%20deployment%20manifest%20for%20the%20lower%20layer%203%20%2B%204%20Edge%20Devices%20to%20deploy%20the%20Simulated%20Temperature%20Sensor%20from%20%24upstream.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3EIn%20IoT%20Hub%2C%20all%20deployments%20together%20look%20like%20the%20following%3A%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20align%3D%22center%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22steffi_grois_1-1619101489579.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F274718i5734D5838D6396FA%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22steffi_grois_1-1619101489579.png%22%20alt%3D%22steffi_grois_1-1619101489579.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ESome%20other%20examples%20of%20layered%20deployments%20are%20also%20available%20in%20the%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FnanowireUK%2Fazure-iot-walkthroughs%2Ftree%2Fmain%2Fazure-iot-nested-edge%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EGitHub%3C%2FA%3E.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId--1599036874%22%20id%3D%22toc-hId--1620338531%22%3EUse%20the%20Module%20Twin%20or%20Direct%20Methods%20to%20send%20commands%20and%20desired%20configurations%20to%20lower-layer%20devices%3C%2FH2%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAs%20we%20have%20created%20IoT%20Hub%20Device%20Identities%20for%20all%20devices%2C%20we%20are%20able%20to%20control%20these%20devices%20from%20the%20cloud%20directly.%3C%2FP%3E%0A%3CP%3EIf%20we%20would%20like%20to%20update%20the%20Module%20Twin%20of%20our%20Level%203%20device%2C%20for%20example%2C%20we%20would%20change%20the%20desired%20property%20for%20the%20respective%20module%20to%20enable%20it.%3C%2FP%3E%0A%3CP%20align%3D%22center%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22steffi_grois_2-1619104358755.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F274722i5840B4632837649E%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22steffi_grois_2-1619104358755.png%22%20alt%3D%22steffi_grois_2-1619104358755.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EOn%20top%20of%20that%2C%20we%20can%20also%20send%20direct%20methods%20directly%20from%20the%20cloud%20to%20a%20lower%20layer%20device.%20The%20message%20will%20be%20received%20by%20the%20top%20layer%20device%20and%20be%20routed%20through%20the%20edgeHubs%20of%20each%20device%20in%20the%20hierarchy%20until%20it%20reaches%20its%20designated%20device.%3C%2FP%3E%0A%3CP%3EWhile%20sending%20direct%20methods%20to%20a%20lower%20layer%20device%20is%20a%20good%20way%20to%20directly%20control%20even%20disconnected%20devices%2C%20it%20requires%20the%20lower%20layer%20device%20to%20be%20connected%20to%20and%20discoverable%20by%20a%20parent%20device.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EBut%20what%20happens%20if%20a%20lower-layer%20device%20would%20go%20offline%20due%20to%20a%20networking%20failure%20of%20its%20parent%3F%3C%2FP%3E%0A%3CP%3EWhat%20happens%20to%20the%20up%20%E2%80%93%20and%20downstream%20data%20flow%20on%20the%20lower%20levels%3F%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId-888475959%22%20id%3D%22toc-hId-867174302%22%3EHow%20do%20the%20devices%20recover%20if%20the%20connection%20between%20the%20layers%20is%20separated%3F%3C%2FH2%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIn%20a%20nested%20hierarchy%2C%20each%20device%20has%20a%20dependency%20on%20its%20parent%20devices%20for%20connectivity.%20If%20the%20network%20connection%20is%20severed%20on%20a%20device%20in%20a%20given%20layer%2C%20then%20all%20devices%20that%20are%20residing%20in%20lower%20layers%20will%20also%20be%20unable%20to%20continue%20sending%20messages.%3C%2FP%3E%0A%3CP%3EIn%20our%20example%2C%20if%20the%20network%20connection%20of%20the%20layer%204%20device%20is%20disconnected%2C%20both%20the%20layer%204%20device%20and%20layer%203%20device%20recognize%20this%2C%20and%20the%20normal%20store%20and%20forward%20functionality%20of%20the%20Edge%20Hub%20starts%20buffering.%20Layer%205%20remains%20unaware%20and%20continues%20sending%20its%20messages%20to%20the%20IoT%20Hub.%20Once%20the%20network%20connections%20are%20re-established%2C%20each%20device%20automatically%20sends%20their%20queued%20messages%20in%20the%20original%20order.%20The%20time%20of%20how%20long%20a%20message%20should%20be%20stored%20is%20defined%20as%20the%20TTL%20(%E2%80%9CTime%20To%20Live%E2%80%9D)%20in%20the%20Module%20Identity%20twin%20for%20edgeHub%20of%20each%20device.%20The%20standard%20TTL%20setting%20is%207200%20seconds%20or%20two%20hours.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-json%22%3E%3CCODE%3E%22%24edgeHub%22%3A%7B%0A%20%22properties.desired%22%3A%20%7B%0A%20%20%22schemaVersion%22%3A%20%221.0%22%2C%0A%20%20%22routes%22%3A%20%7B%7D%2C%0A%20%20%22storeAndForwardConfiguration%22%3A%20%7B%0A%20%20%20%22timeToLiveSecs%22%3A%207200%0A%20%20%7D%0A%20%7D%0A%7D%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIf%20fine%20tuning%20is%20required%20the%20both%20the%20TTL%20and%20the%20priority%20of%20messages%20can%20also%20be%20defined%20in%20the%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fazure%2Fiot-edge%2Fmodule-composition%3Fview%3Diotedge-2018-06%23priority-and-time-to-live%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Erouting%20rules%20for%20the%20edgeHub%3C%2FA%3E.%20The%20actual%20number%20of%20messages%20able%20to%20be%20stored%20on%20the%20device%20of%20course%20depends%20on%20the%20disk%20size%20of%20the%20device.%3C%2FP%3E%0A%3CP%3EDevice%20twin%20updates%2C%20cloud-to-device%20messages%20and%20direct%20method%20calls%20that%20are%20targeting%20a%20device%20that%20is%20temporarily%20offline%2C%20will%20also%20be%20queued%20in%20the%20IoT%20Hub%20whilst%20the%20edge%20is%20offline.%20They%20will%20be%20sent%20on%2C%20as%20long%20as%20the%20device%20reappears%20within%20the%20defined%20TTL%20period%20for%20C2D%20or%20the%20timeout%20for%20a%20direct%20method.%20This%20needs%20to%20considered%20in%20the%20solution%20design%20to%20avoid%20potential%20message%20loss%20or%20undesired%20operations%20occurring%20after%20they%20are%20still%20needed.%20The%20most%20robust%20way%20of%20communicating%20configuration%2C%20operational%20parameters%20and%20status%20remains%20the%20device%20or%20module%20twins.%3C%2FP%3E%0A%3CP%3ESee%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fazure%2Fiot-edge%2Foffline-capabilities%3Fview%3Diotedge-2018-06%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EOperate%20devices%20offline%20-%20Azure%20IoT%20Edge%20%7C%20Microsoft%20Docs%3C%2FA%3E%20if%20you%20would%20like%20to%20learn%20more%20about%20offline%20behavior%20of%20IoT%20Edge%20devices.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId--918978504%22%20id%3D%22toc-hId--940280161%22%3EConclusion%3C%2FH2%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWe%20have%20walked%20through%20the%20practical%20application%20of%20nesting%20IoT%20Edge%20devices%20in%20industrial%20IoT%20and%20shown%20some%20best%20practice%20in%20managing%20the%20complexity%20in%20managing%20many%20heterogenous%20workloads%20on%20the%20edge.%20For%20more%20technical%20detail%20please%20visit%20the%20linked%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FnanowireUK%2Fazure-iot-walkthroughs%2Ftree%2Fmain%2Fazure-iot-nested-edge%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EGitHub%3C%2FA%3E%20repository.%3C%2FP%3E%0A%3CP%3EWant%20to%20try%20out%20and%20deploy%20a%20simulated%20purdue%20network%20model%20using%20IoT%20Edge%3F%20%26nbsp%3BLook%20at%20this%20Github!%3C%2FP%3E%0A%3CP%3EStay%20informed.%20For%20the%20latest%20updates%20on%20new%20releases%2C%20tools%2C%20and%20resources%2C%20stay%20tuned%20to%20this%20blog%20and%20follow%20us%20%3CA%20href%3D%22https%3A%2F%2Ftwitter.com%2Fmicrosoftiot%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3E%40MSIoTDevs%20%3C%2FA%3Eon%20Twitter.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-2280321%22%20slang%3D%22en-US%22%3E%3CP%20style%3D%22background%3A%20white%3B%22%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3ELearn%20how%20to%20app%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3Ely%20a%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3Econfiguration%20for%20a%20hierarchy%20of%20edge%20devices%20on%20an%20ISA-95%20industrial%20network%20using%20best%20practices%20and%20%3CSPAN%20style%3D%22background%3A%20white%3B%22%3EAzure%20IoT%26nbsp%3B%3C%2FSPAN%3Eservices.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20style%3D%22background%3A%20white%3B%22%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-left%22%20image-alt%3D%22Picture1.jpg%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F274287iE2231F8A39EDA5FA%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Picture1.jpg%22%20alt%3D%22Picture1.jpg%22%20%2F%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2280321%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAzure%20IoT%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EAzure%20IoT%20Edge%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EIIoT%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EIndustrial%20IoT%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Version history
Last update:
‎Apr 28 2021 08:41 AM
Updated by: