Discussion on Fragmentation & Content Format Negotiation in MQTT Binding Source: Sung-Chan Choi,...
-
Upload
bruno-hunter -
Category
Documents
-
view
225 -
download
6
Transcript of Discussion on Fragmentation & Content Format Negotiation in MQTT Binding Source: Sung-Chan Choi,...
Discussion on Fragmentation & Content Format Negotiation in MQTT Binding
Source: Sung-Chan Choi, Yong-Suk Park, Jaeho Kim ([email protected])Data: 2015-03-23
PRO-2015-0739-Discussion_on_fragmentation_&_content_format_negotiation_in_MQTT_binding
Fragmentation Issue
• TS-0010 describes– Note: MQTT packets are subjected to a theoretical
maximum message size of 256MB, but it is good practice not to send packets that are bigger than a 100kB. If a larger amount of data needs to be sent, it should be segmented into multiple PUBLISH packets.
MQTT Fragmentation
Fixed Variable Payload
MQTT Message Format
• In order to reassemble fragmented application messages which are delivered over MQTT payload, when the application message is to be fragmented, there need to express the information about fragmented sequence number, flag indicating more fragmented message following or not, ..
• And this information may be included in MQTTT Payload part
MQTT Fragmentation
MQTT Client MQTT Client
• Identification• Fragmented Data Sequence Number• More Fragmented Data Indication
Flag• Fragmented Data Size
Frag4 Frag3 Frag2 Frag1
Each Fragmentation data may need following information
Frag1Frag2Frag3Frag4
MQTT Broker
Example
MQTT Client MQTT ClientApplication data size: 200KBFragmentation data size: 50KB
PUBLISH #w77e/0/1/51200
PUBLISH #w77e/1/1/51200
PUBLISH #w77e/2/1/51200
PUBLISH #w77e/3/0/51200
ID/SequenceNumber/MoreFlag/FragmentDataSize
MQTT Broker
Content Format Negotiation• In HTTP binding, for negotiation, it uses “Accept” and
“Content-type” in HTTP Header Fields• In MQTT binding TS-0010, section 6.5.3 content
format negotiation describes the similar concept as in HTTP binding
• To this end, we can define parameters for example,– MQ-M2M-ACCEPT– MQ-M2M-DATATYPE
• And this information could be included in MQTT payload
Example
MQTT Client MQTT Client
PUBLISH MQ-M2M-ACCEPT=“application/onem2m-res+xml” MQ-M2M-DATATYPE=“application/onem2m-res+xml”
MQTT Broker
PUBLISH MQ-M2M-DATATYPE=“application/onem2m-res+xml”
Request
Response
Protocol Binding
• Option1– Allocate bytes in MQTT payload for fragmentation
& content format negotiation information and save the information as string data format
MQTT Payload
Fragmentation Part Negotiation Part
“#w77e/0/1/51200” “MQ-M2M-ACCEPT=application/onem2m-res+xml, MQ-M2M-DATATYPE=application/onem2m-res+xml”
Protocol Binding
• Option2– Allocate MQTT payload byte in more detail for
each fragmentation & content format negotiation information
MQTT Payload
Fragmentation Part Negotiation Part
ID Sequence Number More Flag FragmentDataSize
10bytes 20bytes 1bytes 30bytesExample
Protocol Binding
MQTT Payload
Fragmentation Part Negotiation Part
MQ-M2M-ACCEPT MQ-M2M-DATATYPE
30bytes 30bytesExample