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
IoT Protocol is a protocol over TCP based on HTTP for light data traffic.
3
+
IoT Protocol is a protocol over TCP based on HTTP and MQTT for lightweight data traffic.
4
4
5
-
**Motivation**: HTTP 1.1 (*http://*) protocol uses too much data traffic for IoT context. Its request minimum size is 26 bytes (https://stackoverflow.com/a/25065027/1956719) and the HOST param is mandatory for all requests.
5
+
**Motivation**:
6
+
1. HTTP 1.1 (*http://*) protocol is a request-response model is well-suited for web-based applications where clients need to request resources from servers and receive responses back. It is still more commonly used and more widely known among developers. But it uses too much data traffic for IoT context. Its minimum request size is 26 bytes (https://stackoverflow.com/a/25065027/1956719) and the HOST param is mandatory for all requests.
6
7
7
-
The IOT_PROTOCOL (*iot://*) is adapted for IoT context with light data traffic. Its request minimum size is 8 bytes withless to require HOST param for requests.
8
+
2. MQTT (*mqtt://*) is a publish-subscribe messaging protocol, use lightweight data traffic. Its minimum request size is 2 bytes. But it is not stateless and does not provide a request/response pattern, so it isn't restful. MQTT is designed to be a lightweight protocol that minimizes network overhead, which can make it more challenging to handle large or complex data payloads.
9
+
10
+
The **IOT PROTOCOL** (*iot://*) is base on HTTP and MQTT protocols. Is a request-response model adapted for IoT context designed for low-bandwidth, low-power devices. Its minimum request size is 2 bytes without requiring the HOST param for all requests. Supports Full Duplex and can be used for real-time communication up to 255 bytes, middleweight request up to (2^16 -1) bytes (~65Kb) and streaming up to (2^32 -1) bytes (~4.29Gb). Can use TLS/SSL encryption to secure their communications.
11
+
12
+
13
+
IOT PROTOCOL uses middlewares and router's filtering features based on [express nodejs module](https://expressjs.com/) at its Layer Application. Yes, you can use `.use(middleware)`, `.use('/path/to/your/resource', router)`, `response.send(data)` methods to handle the requests.
14
+
15
+
16
+
## Features
17
+
18
+
- Lightweight protocol that minimizes network overhead
19
+
- Minimum request size is 2 bytes
20
+
- Request-response model like HTTP protocol
21
+
- Adaptive requests methods for optimizing data length
22
+
23
+
---
8
24
9
25
## Preamble Version 1
10
26
11
-
```js
12
-
VERSION \n
13
-
METHOD+ID \n
14
-
PATH\n
15
-
[HEADERS \n]
16
-
[BODY_CHAR+BODY_LENGTH \n BODY]
27
+
```
28
+
<MCB + LCB>
29
+
[ID]
30
+
[PATH + ETX]
31
+
[HEADER + ETX]
32
+
[BODY_LENGTH + BODY]
17
33
```
18
34
19
-
### SEPARATOR char
35
+
> `<...>` REQUIRED
20
36
21
-
SEPARATOR char serves to divide pieces of information
37
+
> `[...]` OPTIONAL
22
38
23
-
* Type: `char` | `byte` | `uint8_t`
24
-
* Size: 1 byte
25
-
* Constant:
26
-
* char: `\n`
27
-
* hex: `0xA`
28
-
* decimal: `10`
29
-
* binary: `0b1010`
39
+
---
40
+
### [0]**MCB**: MSB_CONTROL_BYTE
30
41
31
-
### [0] VERSION
42
+
The Most Significant Control Byte. **REQUIRED**
32
43
33
-
Version is the version of iot protocol. Used for compatibility.
@TODO Explains what is a middleware and how its works
@@ -175,3 +209,6 @@ The body / contents of request. **REQUIRED**
175
209
176
210
-`URI` Berners-Lee, T. Fielding, R. L. Masinter "Uniform Resource Identifier (URI): Generic Syntax" STD 66 RFC 3986 DOI 10.17487/RFC3986 <https://www.rfc-editor.org/info/rfc3986>.
177
211
212
+
-`UNICODE` Compart. Unicode Character <https://www.compart.com/en/unicode>
0 commit comments