Understanding of AWS IoT Core and WebSocket
Hi Friends, In this blog, I will explain how AWS IOT and WebSocket works.
AWS IoT Core
AWS IoT Core is managed cloud service that lets connected devices easily and securely interact with cloud applications and other cloud services.
AWS IoT Core can support billions of devices and trillions of messages and can process and route those messages to AWS endpoints to other devices reliably and securely.
With AWS IoT Core, your application can keep track of and communicate with all your devices, all the time, even when they are not connected.
In the AWS IoT Core, we can choose the following communication protocol
- MQTT
- HTTPS
- MQTT over WSS
- LoRaWAN
The AWS IoT Core message broker supports devices and clients that use MQTT and MQTT over WSS protocols to publish and subscribe to messages. It also supports devices and clients that use the HTTPS protocol to publish messages.
How does AWS IoT core work?
AWS IoT Core provides services to connect your devices to the AWS cloud so that other cloud services and applications can interact with your internet-connected devices.
AWS IoT core messaging services:
The AWS IoT Core connectivity services provide secure communication with IoT devices and manage the messages that pass between them and AWS IoT.
Device Gateway:
Device Gateway enables devices to securely and efficiently with AWS IoT. Device communication is secured by secure protocols that use X.509 certificates.
Message broker:
Message broker provides a secure mechanism for devices and AWS IoT applications to publish and receive messages from each other.
We can use MQTT directly and MQTT over WebSocket to publish and subscribe. Devices and clients can also use the HTTP REST interface to publish data to the message broker.
The message broker distributes device data to devices that subscribed to it and to other AWS IoT Core services such as Device shadow service and Rule engine.
Control Services:
The AWS IoT control services provide device security, management, and registration features.
- Custom authentications services:
We can define custom authorizers that allow us to manage your own authentication and authorization strategy using a custom authentication service and a Lamda function. Custom authorizers allow AWS IoT to authenticate your devices and authorize operations using bearer token authentication and authorization strategies.
- Device Provisioning services:
Device provisioning services allows us to provision devices using a template that describes the resources required for your device. Devices use certificates to authenticate with AWS IoT. Policies determine which operations a device can perform in AWS IoT.
- Security and Identity services:
Provides shared responsibility for security in the AWS cloud. Your devices must keep their credentials safe to securely send data to the message broker. The message broker and rules engine use AWS security features to send data securely to devices or other AWS services.
Data services:
AWS IoT Core data services help your IoT solutions provide a reliable application experience even with devices that are not connected.
- Device shadow:
Device Shadow is a JSON document used to store and retrieve current state information for a device. The device shadow service maintains a device’s state so that applications can communicate with a device whether the device is online or offline. When a device is offline, the Device Shadow service manages its data for connected applications. When the device reconnects, it synchronizes its state with that of its shadow in the Device Shadow service.
Rule Engine:
The Rule Engine connects data from the message broker to other AWS services for storage and additional processing.
For Example, We can SQL-based language to select data from message payloads and process and send it to other AWS services such as AWS S3 bucket, Amazon DynamoDB, and AWS Lambda.
WebSocket
WebSocket is a computer communications protocol, providing full-duplex communication channels over a single TCP connection. The WebSocket protocol was standardized by the IETF as RFC 6455 in 2011, and the WebSocket API in Web IDL is being standardized by the W3C. — Wikipedia.
Websocket is the advanced technology to open two-way communication between the client’s browser and the server.
Using the WebSocket user can send data to the server and at the same time, users can receive the data from the server.
Device Provisioning and authorization:
We are provisioning devices manually using custom authentication. For authorization, we can use JWT web Token.
Thank you for reading. Have a nice day!