Improving Packet Delivery Performance of Publish/Subscribe
42 Slides3.51 MB
Improving Packet Delivery Performance of Publish/Subscribe Protocols in Wireless Sensor Networks Sensors 2013, Volume 13, Issue 1 Presenter: Le Wang
2 Outline 1. Motivation and overview 2. Background Polling Model and Publish/Subscribe Model Publication Discipline MQTT-S and CoQP 3. Simulation Environment 4. Evaluation Single Hop PDR Discarded Publication Ratio (DPR) Retransmitted Publication Ratio Duplicated Publications Ratio Multiple Hop 5. Summary 12/24/2022
3 Motivation MQTT-S and CoAP: Two application protocols for Wireless Sensor Networks (WSN) Based on UDP Provide reliability mechanism in Application layer Reliability Mechanism: Defines a fixed Retransmission TimeOut (RTO). Problems? Too long or too short? Result in a lower Packet Delivery Ratio (PDR). Propose an adaptive RTO: Consists in using a Smooth Round-Trip Time (SRTT) Multiplied by a constant parameter K 12/24/2022
4 Background Polling Model: Applications send queries to sensor nodes to retrieve information. Problem? When an event of interest occurs, in order to react in real-time, the sensor nodes have to be queried continuously. Waste of resources such as energy, processing and bandwidth. 12/24/2022
5 Background Publish/Subscribe Model Entities: Publisher: generate events Subscriber: express interest in events Subscription: Register interest in the event Advantages: Decouple in time: publishers and scubscribers do not need to be actively participating in the interaction at the same time Decouple in space: publishers and subscribers do not need to know each other Publishers and subscribers can produce or consume events in an asynchronous way. 12/24/2022
6 Publication Discipline Activation: when there is a pending confirmation of a publication message, and a new publication is generated MQTT-S publication discipline: CoAP publication discipline: Discard the new publication message Discard the old publication message An inappropriate fixed RTO will result in a higher probability of a new publication message being generated while the RTO is active. Therefore, the 12/24/2022 publication discipline will discard the publication
MQTT-S 7 Extension of the Message Queuing Telemetry Transport (MQTT) Optimized for WSN. Components: Broker node: responsible for managing subscriptions as well as storing and sending publications to corresponding WSN subscriber nodes. Publisher nodes: generate event Subscriber nodes: express interest in events Relay nodes: for multi-hop scenario. 12/24/2022
8 MQTT-S Reliability: QoS Level 0 (QoS0) Offers a best-effort delivery service, no retransmission or Acknowledgements. QoS Level 1 (QoS1) Allows the retransmission of messages until Acked Does not prevent duplicate reception QoS Level 2 (QoS2) Ensures the reception of message Ensures to deliver only once to the destination by four message handshake. Parameters for QoS1 and QoS2: Fixed RTO: 10-15 seconds. Retransmission number: 3-5 12/24/2022
9 MQTT-S Publication Discipline: “stop and wait” mechanism for the transmissions of publication messages with QoS1 and QoS2. A publisher node has to wait for the termination of its publication message flow with the broker node before it can start a new one. If more than one publications are generated, publication discipline is needed. Activity 1: Queue the new publication messages Drawback: cost more source Activity 2: Drop the new publication messages Always attempts to retransmit the old publication message till receive the ACK. Called ‘Persistent mode’ discipline 12/24/2022
10 CoAP Characteristics: RESTful (Representational State Transfer) Resources are identified by Universal Resource Identifiers (URI) UDP based Model: Client/server interaction model Request messages initiate a transaction with a server, which may send a response to the client with a matching transaction ID Polling based: not suitable for requiring information in real-time in order to react when an event of interest occurs. Publish/subscribe interaction model A.k.a: Observer Model A publisher node can send publications to a subscriber node 12/24/2022 (observer) about a event that the subscriber is interested in receiving .
CoAP 11 Publish/subscribe interaction model A subscriber constantly to observe the events by registering its interest in the event (GET request to the publisher node). Subscription Action: Publisher node establishes an observation relationship between the subscriber and the event. The publisher notifies each subscriber node that has an observation relationship with the event. Observer Model: High scalability Use caches and proxy nodes that multiplex the interest of multiple subscribers in the same event into a single association 12/24/2022
12 CoAP Reliability: Non-Confirmable (NON) message: Correspond to MQTT-S QoS 0 No ACK to messages Confirmable (CON) message: Correspond to MQTT-S QoS 1 ACK messages received Fixed RTO Random number between and ACK TIMEOUT constant and an ACK TIMEOUT multiplied by ACK-RANDOM-FACTOR UnACKed messages within RTO are retransmitted RTO is doubled (Exponential back-off mechanism) MAX RETRANSMIT: Maximum retransmission numbers 12/24/2022
13 CoAP Publication Discipline: “stop and wait” mechanism for the transmission of CON messages. Same with MQTT-S. Publication discipline is also needed to handle publication messages generated while the publication message flow is in progress (RTO is active) Activity: Stop the retransmission of old publication message Transmit the new publication message with the number of attempts remaining from the old publication message. 12/24/2022
14 MQTT-S and CoAP Fixed RTO: Too short: give rise to spurious retransmissions, waste bandwidth, energy and computation. Too long: lead to slow or late reaction to the loss of packets, increase delay ,decrease PDR. Suitable for deployments when RTT is close to the defined RTO value. Not suitable for scalability and flexibility features by the publish/subscribe model on WSN. Adaptive RTO: Compute smoothed RTT (SRTT) SRTT (1 - a) x SRTT a x RTT Compute RTO RTO SRTT x K 12/24/2022
15 Summary of Publication Discipline Publication discipline has a direct impact on the number of discarded publication messages. Publisher nodes discard greater number of publication msgs than broker node, because publisher is in charge of publication message generation. Situation when not receiving ACK: Not receive publication message, require retransmission from publisher Received publication message, ACK is lost. Result in duplicate publication. Limitations: Goodness of MQTT S/CoAP publication discipline is beyond the scope Decrease in the number of discarded publications also depend on the publication generation rate in addition to adaptive RTO, which is beyond the control of an adaptive 12/24/2022 RTO.
Simulation Environment 16 OMNet Goal: monitor and control acritical parameters in a warehouse through a WSN deployment. Devices: Publisher nodes measure the critical parameters in the warehouse One publisher node receives publication messages in a besteffort mode for monitoring process, i.e., MQTT-S QoS 0 / CoAP NON Another publisher node receives publication messages in reliable mode for controlling critical parameters, i.e., MQTT-S QoS 1 / CoAP CON Broker node: Receive periodic signal from publisher nodes Refer to the central node in MQTT-S or proxy node for CoAP 12/24/2022
17 Simulation Environment Single Hop Subscribers and publisher nodes are place at the same distance from the broker to achieve fairness among nodes. Multiple Hop: Publication messages originated in publisher nodes located from more than one hop away are received through the broker node to which the subscriber nodes are connected. Broker node subscribes on behalf of its subscriber nodes to 12/24/2022 another broker node that the publisher node with information of interest connected to.
18 Simulation Environment Other parameters A confidence interval with probability of 95% A given parameter lies within the interval with a probability of 95% 12/24/2022
19 Performance Metrics Packet Delivery Ratio (PDR): To evaluate the performance of the reliability mechanism of MQTT-S and CoAP, i.e., QoS x, CON/NON. PDR Duplicated publication messages are not take into account Discarded Publications Ratio (DPR): To evaluate the impact of the publication discipline in the PDR. If DRP increases, PDR will decrease DPR 12/24/2022
20 Performance Metrics Retransmitted Publications Ratio: To evaluate the effect of the RTO value. Good RTO could reduce spurious retransmission. RPR Duplicated publication messages are not take into account Duplicated Publications Ratio: Duplicated Publications Ratio In broker and subscriber node with QoS1 (MQTT-S) In subscriber node with CON (CoAP) 12/24/2022
Single Hop 21 SMQTT-S: Subscriber PDR VS # of Publisher Nodes 1. # of publisher nodes increases, PDR decreases 2. 3. 4. K increases, PDR increases because spurious retransmissions are reduced QoS 0 with K 3 has the highest PDR without MAC ACK; QoS 0 with K 2 has the highest PDR with MAC ACK PDR of QoS 1 is lower than QoS 0 because additional msgs of QoS 1 congest faster Recovered by MAC ACK before MQTT-S retransmission are activated Without MAC ACK With MAC ACK Spurious retransmissions as MQTT-S retransmission activated before MAC ACK 12/24/2022 # of Publisher Nodes
Single Hop 22 CoAP: Subscriber PDR VS # of Publisher Nodes 1. # of publisher nodes increases, PDR decreases 2. K 2 has the highest PDR with/without MAC ACK 3. MAC ACK is required for NON when # of publisher 40; CON when # of publisher 30. Recovered by MAC ACK before CoAP retransmission are activated Without MAC ACK With MAC ACK Spurious retransmissions as CoAP retransmission activated before MAC ACK 12/24/2022 # of Publisher Nodes
23 Single Hop RTO SMQTT-S: fixed RTO vs adaptive 1. PDR with fixed RTO is lower than adaptive RTO, as fixed RTO cause the MQTT-S retransmission to be activated too late to recover the message losses. 2. QoS 0: PDR increase 64% (20 nodes) and 23% (100 nodes); QoS 1: PDR increase 76% (10 nodes) and 21% (100 nodes); 3. MAC ACK is not sufficient to recover the message losses. QoS 0: PDR increase 38% (20 nodes) and 12% (100 nodes); QoS 1: PDR increase 40% (20 nodes) and 10% (100 nodes). Without MAC ACK With MAC ACK 12/24/2022
Single Hop CoAP: fixed RTO vs adaptive RTO 24 1. Compared with Default fixed RTO 1. 2. 2. Without MAC ACK: NON: PDR increase 34% (30 nodes) and 13% (100 nodes) ;CON: PDR increase 38% (30 nodes) and 14% (100 nodes) With MAC ACK: CON: PDR increase 38% (30 nodes) and 14% (100 nodes) ;CON: PDR increase 26% (30 nodes) and 4% (100 nodes) Compared with RFC6298 1. 2. Without MAC ACK: NON: PDR increase 5% (50 nodes) and 3% (100 nodes) ;CON: PDR increase 38% (30 nodes) and 14% (100 nodes) With MAC ACK: CON: PDR increase 13% (30 nodes) and 1% (100 nodes) ;CON: PDR increase 26% (30 nodes) and 4% (100 nodes) Without MAC ACK With MAC ACK 12/24/2022
Single Hop Comparison of RTT and RTO Measurements 25 MQTT-S PUB’s RTO is higher than BK RTO after 60 nodes More publishers are competing for access to the channel, then collision increases The RTO therefore increases as the retransmissions are activated Higher RTO with MAC ACK is obtained due the use of MAC ACK Without MAC ACK With MAC ACK 12/24/2022 # of Publisher Nodes
Single Hop Comparison of RTT and RTO Measurements 26 CoAP A change after 60 nodes without MAC ACK More publishers are competing for access to the channel, then collision increases RTO increases slow because the publication discipline of CoAP results in the cancellation of retransmissions. A change after 40 nodes with MAC ACK because the MAC ACK causes the network congest faster. Without MAC ACK With MAC ACK 12/24/2022 # of Publisher Nodes
Single Hop Discarded Publication Ratio (DPR) 27 MQTT-S Publishers discard more msgs than Brokers as Publishers discard the new generated msgs and keep sending old msgs if ACK is not received. DPR decreases as K increases, except K 4: The retransmission of MQTT-S is activated too late to recover publication message, hence resulting higher DPR Without MAC ACK: K 3 when lowest DPR; With MAC ACK: K 2 when lowest DPR Without MAC ACK With MAC ACK 12/24/2022
Single Hop 28 Discarded Publication Ratio (DPR) CoAP As K increases, lower DPR obtained, except K 2 Why? Without MAC ACK Publisher nodes obtain a lower DPR without MAC ACK than with MAC ACK, as the absence of MAC ACK reduces the delay. i.e., when RTO is active, the probability of generating a new publication is also reduced. With MAC ACK 12/24/2022
Single Hop Retransmitted Publication Ratio 29 MQTT-S Lowest retransmitted messages is obtained with K 4 with MAC ACK due to the decrease spurious retransmissions caused by application retransmissions and MAC ACK However, the retransmissions are activated too late for packet recovery due to a larger RTO when K 4. Therefore, K 3 is adopted. Without MAC ACK With MAC ACK 12/24/2022
Single Hop Retransmitted Publication Ratio 30 CoAP Lowest Retransmissions when K 4, but it is not sufficient. Based on the results from the previous experiments, K 2 is adopted. 12/24/2022
Single Hop Comparison of MQTT-S with CoAP 31 Retransmitted msg ratio for CoAP is lower than MQTT-S Because the publication discipline of CoAP always cancel the old msgs to send the new generated msgs; while MQTT-S always retransmit the old msgs. MQTT-S CoAP 12/24/2022
Single Hop Duplicated Publications Ratio 32 MQTT-S Duplicated msgs reduce PDR because of useless data K increases, number of duplicated messages decreases. K 4 with MAC ACK reaches the lowest ratio of duplicated msgs. While K 3 for highest PDR, because MQTT-S react faster when losing msgs and consequently spurious retransmission may be produced 12/24/2022
Single Hop 33 Duplicated Publications Ratio CoAP Similar with MQTT-S. Even though K 4 get the lowest duplicat msgs, K 2 get the highest PDR. CoAP receive fewer duplicated msgs than MQTT-S because of the publication discipline. 12/24/2022
Single Hop Extend 34 Single-Hop Extended Scenario QoS 1 12/24/2022
Single Hop Extend Single-Hop Extended Scenario 35 MQTT-S MQTT-S With MAC ACK Without MAC ACK CoAP CON Without MAC ACK NON With MAC ACK 12/24/2022
Single Hop Extend Single-Hop Extended Scenario 36 MQTT-S: K 3 reach highest PDR; CoAP: K 2 reach highest PDR; PDR is lower than in the single-hop scenario because The second broker increases the network load and results in packet losses Msgs between the broker nodes are sent in QoS 1, which results in more congestion Network load with 70 nodes is similar to 100 nodes in single hop scenario, because the second broker node increase traffic. Therefore, the result are showed up to 70 publisher nodes. MQTT-S: QoS 0 gets higher PDR with MAC ACK; QoS 1 gets highest PDR without MAC ACK. MAC ACK is required when node # 40; CoAP: Highest PDR is obtained without MAC ACK; NON: MAC ACK is required when node # 40; CON: MAC ACK is required when node # 30; 12/24/2022
Single Hop Extend Single-Hop Extended Scenario 37 Retransmission Publication Ratio decreases as K increases. K 4 gets the lower retransmission publication ratio with MAC ACK Still adopt K 3 for MQTT-S, K 2 for CoAP, because of the highest PDR. K increases, energy consumption decreases. With use of the adaptive RTO of MQTT-S and CoAP consume up to 8% more energy than fixed RTO, which creates a trade-off between energy consumption and the PDR. Max PDR by CoAP is better than MQTT-S because of the publication discipline. If PDR is the goal, choose CoAP! 12/24/2022
38 Multi-Hop Scenario Msgs from a publisher node are routed to the broker node through multiple nodes; The received msgs by the broker node are routed to the subscriber nodes. 12/24/2022
Multi-Hop Scenario MQTT-S: PDR vs # of nodes 39 MQTT-S 1. The network load with 40 nodes is similar to 100 nodes in single-hop scenario, therefore only obtain the results up to 40 nodes. 2. K 3.5 with MAC ACK gets the highest PDR. The increase in RTT and packet losses, therefore MAC ACK is necessary to recover packets losses. 12/24/2022
Multi-Hop Scenario CoAP: PDR vs # of nodes 40 CoAP K 2.5 gets the highest PDR without MAC ACK. Because CoAP can react properly without MAC ACK with K 2.5. The MAC ACK leads to an increase of the message delay. 12/24/2022
41 Summary Evaluate three scenarios: single-hop, single-hop extended and multi-hop scenarios with parameters of fixed RTO, adaptive RTO, MAC ACK. Result: the adaptive RTO provides an increase in PDR. An adaptive RTO method is more suitable in order to react properly to changing network conditions. MAC ACK is not suitable for the lowest K value, as it may bring high congestion and decrease PDR. Non-persistent mode CoAP leads to a higher PDR than persistent mode MQTT-S due to the publication disciplines. Future work: adapt the K value dynamically to the network conditions: duplicated publication ratio, DPR and retransmitted publication ratio. 12/24/2022
42 Thank You! 12/24/2022