Anteprima
Vedrai una selezione di 5 pagine su 17
Appunti Internet of Things Pag. 1 Appunti Internet of Things Pag. 2
Anteprima di 5 pagg. su 17.
Scarica il documento per vederlo tutto.
Appunti Internet of Things Pag. 6
Anteprima di 5 pagg. su 17.
Scarica il documento per vederlo tutto.
Appunti Internet of Things Pag. 11
Anteprima di 5 pagg. su 17.
Scarica il documento per vederlo tutto.
Appunti Internet of Things Pag. 16
1 su 17
D/illustrazione/soddisfatti o rimborsati
Disdici quando
vuoi
Acquista con carta
o PayPal
Scarica i documenti
tutte le volte che vuoi
Estratto del documento

Jitter: precision\reliability in performing periodic operations.

4.1 Networking fundamentals

To define a network we have to define:

- Infrastructure: Host, Link and network devices

- Architecture: the topology of the network, that could be Ring, Mesh , Tree and Star

- set of communication protocols: set of rules that define the information exchange between 2 entities

4.2 Application Layer in Communication Protocols for IoT

An application is a piece of software executed by the host able to communicate with another program

through a network. Due to fragmentation of the communication technology, typically the application layer

is used also to uniform the different languages used to communicate.

Different approach

“web browsing approach: HTTP, COAP

- Client\Server

- Publish\Subscribe: MQTT

4.3 HTTP

Each resource in the web is: managed by a server, identified by a Uniform Resource Location (URL),

accessed synchronously by a client.

The client (active) issues HTTP requests for a specific resource and the server (passive) answer backs.

The transfert is stateless

4.4 COAP - Constrained Application Protocol

Web solutions are hardly applicable on IoT (too costly), so COAP redesign

a web-based service for IoT.

It is an embedded asynchronous web transfer protocol that uses UDP

and a subset of the HTTP methods (gets,post,put, delete).

COAP is characterized by:

- Messages with 4 bytes header

- Reliable exchange though ACK (CoaP take care of reliability), but it can be disable

- Duplicate Detection through messageID and conversation detection TOKEN

Difference between token and ID:

ACK is sent with the same MessageID

Response message is sent with the same Token

if the response is synchronous we have that the package has same token and

message ID, otherwise we can have response with different Id but same Token

The header of a message is composed of: version(1), Message Type, Token Len, Code, MesID, Token.

It has a Stop & Wait approach in dealing with packet loss implemented with an increasing timer: when

time-out expires a message is resent and the time-out timer is doubled and a counter increased, this

procedure is repeated until an ack is received or is reached the max retransmission time or count.

CoaP implements an Observation Service : When included in a GET request, the client is added to the

list of observers of a resource. When a new value of said resource is available, the server sends it back to

the client in a response, without an explicit request

Coap Block Transfer is the protocol that implements fragmentation at the application layer, to avoid

segmentation at lower level. When the Block2 option is added to response messages, it means the

resource has been split into blocks, and the client will make multiple requests. Different header are added:

= “more blocks flag,

nr = incremental block number within original data,m sz = block size

resource discovery “protocol”

Coap also uses a to find links hosted by CoAp servers. You pull a

request: “GET /.well-known/core?optional_query_string” and get a link-header response

4.5. MQTT- Message Queuing Telemetry

MQTT is a Client\Server Publish\Subscribe (asynchronous) messaging transport protocol. It is simple to

implement, supports QoS, lightweight and bandwidth efficient and session awareness.

Wildcards allowed during the subscribing phase: (+) single Level, (#) multilevel.

Each MQTT client opens one connection to the MQTT broker using TCP and it can specify

a password and a lastWillTopic and Message, that will be published if a connection error

occurs .

We have 3 kind of QoS:

- QoS 0 - at most once: best effort transfer

- QoS 1 - al least once: retransmit until an ack is received (1 send + 1 ack received)

- QoS 2 - Exactly once: use some buffer and ack to archive this kind of communication QoS (1

send + 1 PUBREC + 1 PUBREL + 1 PUBCOMP)

In default operation mode when the client disconnects, all the client-related status at the broker is flushed,

but we can set a persistent session : when a client is offline the buffer stores his status: list of subscription

and QoS pending messages, client has to do the same with pending messages.

Retain Flag is used to let The broker stores locally the retained message and send it to any other client

which subscribes which subscribe later

Note that in CoAP clients know the network topology, in MQTT only the broker oversees routing and

delivering messages. CoAP allows connections between nodes, meanwhile MQTT has all clients

connected to a single broker

MQTT-SN is an extended architecture with gateway and forwarders, some messages are "more"

compressed and extended keepalive to support sleeping clients. MQTT-SN specifically aimed at sensor

networks.

5. IoT Platforms

THe goal of the IoT platform is to develop services to collect, manage and use data. we passed from

vertical to horizontal approach with modular services. We Have specialized and general platform

6. Wired Connectivity

we use cable connectivity mainly to interconnection between control devices and field devices, typically to

archive short frequently-exchanged messages with tight requirements in terms of delay and determinism

To share a single communication medium we have 2 protocols:

it “guaranteed” performance with no conflict but a coordination is required

- Scheduled Access:

- Random Access: Opportunistic access to the resources with poor performance with heavy traffic

Can Bus is an example of wired connectivity, everybody receives everything on the bus. To avoid collision

the element senses the bus before transmitting, if the bus is free transmit, otherwise try later. Each

message has a priority, if the transmitting station overheards another transmission on the channel at higher

priority, then quit.

Transport layer is not used to reduce overhead, network layer is not used due to lack of routing function.

Data Link layer is used to access the physical resources

CSMA/CD: an improvement of Can Bus with carrier sensing multiple access and collision detection.

Hub and Switches are used to avoid collision. in a fully Switched LANs we have no collision so no more

CSMA-CD

Ethernet is the most used wired connectivity technology, we don't have any application layer because it

supports many of them, for this reason it provides multiplexing of the application layer. DIfferently from

CANs we have unicast communication and a bigger datasize. Mac address is used to filter purpose.

different classes of ethernet (different adds-on) are used nowadays:

- Class A: compatible with legacy ethernet, we have no priority channels no guarantee on Speeds

- Class B: still compatible, use some label to implement priority and performance guarantee

- Class C: non compatible with legacy ethernet. Like B with scheduling to improve performances.

6.1 Introduction to wireless Connection

Here we present some common wireless communication technology:

- Mobile Radio Network: Same as smartphone

- Cellular IoT Operators: like the above, but dedicated to back-end services

- Capillary Multi-Hop Networks: most used, connect with Multi-Hop: different kind of gateway to

connect the local network to theW back servers

7. Long Range Communication

LoraWAN architecture is one of the most used IoT wireless communication architecture.

it is Association-less, the end-devices just broadcast

their information that some gateway will collect, decode

and forward to a network server, that will delete

duplicate messages, manage ACKs and manage all the

requests communicating with application servers.

The protocol stack is divided into an application layer,

LoraMac needed to manage multiple connection and

collision and a lora modulation (proprietary) system

based on chirp-based spread spectrum. The physical layer can be different because

lora supports multiple onces

The Chip rate and the nominal bit rate are related by the following formulas, where:

- BW is the reference bandwidth

- SF is the adopted spreading factor :number of chips in a single bit time

- CR Collision Rate: bits per package, limited to protect the channel

We have to choose between:

- Fast network -> Low SF

- Reliability network -> High SF

To choose we have a table with different configuration and characteristics, but also a formula that give us

the idea of the most useful configuration in our cases: SNR is inversely proportional to SF

From this formula we can see that the sensibility decrease (reliability increase) as SF increase

A low spreading factor brings faster transmission since the symbols are spread on more chips (2^SF chips

= 1 symbol).

We can classify the loraWAN end devices in 3 classes:

- Class A: fully unbalanced channel, most used to send information to the network and a little slot used

to download information. Can download information only after sending it. high latency but low energy

consumption. ALOHA-like access.

- Class B: more balanced network, some extra slot to receive information

- Class C: fully balanced network, almost always active. Low latency but high energy drain

7.1 Class A device & Message Format

in Class A devices if during the download slot an information incoming is detected, the radio stays on until

all the packets are received.

The encapsulation of the LoRa message is:

application message is encapsulated into the flame

level, that is included into a MAC level, wrapped into

a physical layer.

Into the physical layer we find the following fields:

- Preamble: used to determine the package reception

- Physical header PHDR and PHDR_CRC used for integrity check

The MAC message instead contains the following header field: Mtype used to specify the message type,

Major that tells the message format and RFU (not used now). The MAC payload is divided into:

- DevAddr: end device address

- FCtrl: frame control field to manage adaptive data rate

- FCnt: frame counter

- FCopt: frame options

the frame level is composed instead of the following elements:

- ADR and ADRACKreq are used to manage adaptively the uplink\downlink data rate

- ACK

- Fpeding is used to signal the presence of additional frame to be delivered

- FOpTLen indicates the size of the FOpts

7.2 LoraWAN uplink - ALOHA

aloha-like procedure to handle channel access and retransmission: if a confirmed message is not ACKed,

it is retransmitted after a random timeout ACK-TIMEOUT. No channel feedback required, based only on

ACKS

7.3 Performance Assuming a stationary situation Sin = Sout and traffic distributed

,

according to a Poisson procedure of parameter considering that

= ∗

a transmission last T, we have that , where G is the

traffic on the channel: G = transmission + retransmission

The probability Ps fro a packet transmission to be successful is the probability that no other packet starts

= = ∗

transmission and retransmission: while the throughput is :

Setting : λ1

Dettagli
Publisher
A.A. 2021-2022
17 pagine
SSD Scienze matematiche e informatiche INF/01 Informatica

I contenuti di questa pagina costituiscono rielaborazioni personali del Publisher Joseph22ITA di informazioni apprese con la frequenza delle lezioni di Internet of things e studio autonomo di eventuali libri di riferimento in preparazione dell'esame finale o della tesi. Non devono intendersi come materiale ufficiale dell'università Politecnico di Milano o del prof Cesana Matteo.