Uploaded image for project: 'Qpid Proton'
  1. Qpid Proton
  2. PROTON-144

Reduce byte overhead for small payloads

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • proton-0.2, proton-0.3
    • proton-c-0.22.0
    • proton-c

    Description

      In constrained bandwidth scenarios (e.g. on a cellular data network) any byte overhead is very costly.

      From the traces for a simple app, we are seeing a large overhead (>100 bytes) in the message payload for sending a two byte message. It seems like there are some default properties like the to and reply-to addresses that the proton client stamps onto a message and also there is padding on the actual two byte payload itself.

      To be able to successfully embed the proton lib in such resource constrained devices the byte overhead needs to be trimmed down as much as the protocol allows.

      ---------------------------
      Details of test app
      ---------------------------

      The testing environment is OpenSUSE 11.4 64bit, the AMQP library is from SVN updated usually once a day although commits have slowed since the push for 0.2 and libopenssl version 1.0.0e-34.17.1.

      The debugging output is all from proton, to get the debugging output set the Env variable "PN_TRACE_FRM=1"
      The test is done connecting to localhost and sending a message across as simply as possible:
      client:
      pn_messenger_t *messenger = pn_messenger("b");
      pn_messenger_start(messenger);
      pn_message_t *message = pn_message();
      pn_message_set_address(message, "amqps://0.0.0.0/a");
      char data[2] =

      {(unsigned char)0xff, (unsigned char)0xff}

      ;
      pn_message_load_data(message, data, 2);
      pn_messenger_put(messenger, message);
      pn_messenger_send(messenger);

      server code:
      pn_messenger_t *messenger = pn_messenger("a");
      pn_messenger_start(messenger);
      pn_messenger_subscribe(messenger, "amqps://~0.0.0.0");
      pn_message_t *message = pn_message();
      pn_messenger_recv(messenger, 1);
      pn_messenger_get(messenger, message);
      size_t size = 2;
      char data[2];
      pn_message_save_data(message, data, &size);

      server output:
      Accepted from localhost.localdomain:36331
      -> SASL
      [0x622180:0] -> SASL-MECHANISMS @64 [@PN_SYMBOL[:ANONYMOUS]]
      [0x622180:0] -> SASL-OUTCOME @68 [0]
      -> AMQP
      [0x61c7c0:0] -> OPEN @16 ["a", null, null, null, null, null, null, null, null]
      <- SASL
      [0x622180:0] <- SASL-INIT @65 [:ANONYMOUS, b""]
      <- AMQP
      [0x61c7c0:0] <- OPEN @16 ["b", "0.0.0.0", null, null, null, null, null, null, null]
      [0x61c7c0:1] <- BEGIN @17 [null, 0, 1024, 1024]
      [0x61c7c0:1] <- ATTACH @18 ["sender-xxx", 1, false, null, null, @40 ["a", 0, null, 0, false, null, null, null, null, null, null], @41 ["a", 0, null, 0, false, null, null], null, null, 0]
      [0x61c7c0:1] -> BEGIN @17 [1, 0, 1024, 1024]
      [0x61c7c0:1] -> ATTACH @18 ["sender-xxx", 1, true, null, null, @40 ["a", 0, null, 0, false, null, null, null, null, null, null], @41 ["a", 0, null, 0, false, null, null], null, null, 0]
      [0x61c7c0:1] -> FLOW @19 [0, 1024, 0, 1024, 1, 0, 1, null, false]
      [0x61c7c0:1] <- TRANSFER @20 [1, 0, b"\x00\x00\x00\x00\x00\x00\x00\x00", 0, true, false] (133) "\x00\x80\x00\x00\x00\x00\x00\x00\x00p\xd0\x00\x00\x00\x10\x00\x00\x00\x05V\x00P\x04@V\x00p\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00s\xd0\x00\x00\x00F\x00\x00\x00\x0d@@\xb1\x00\x00\x00\x11amqps://0.0.0.0/a@\xb1\x00\x00\x00\x08amqp://b@@@\x83\x00\x00\x00\x00\x00\x00\x00\x00\x83\x00\x00\x00\x00\x00\x00\x00\x00@p\x00\x00\x00\x00@\x00\x80\x00\x00\x00\x00\x00\x00\x00w\xb0\x00\x00\x00\x02\xff\xff"

      client output:
      Connected to 0.0.0.0:5671
      -> SASL
      [0x620020:0] -> SASL-INIT @65 [:ANONYMOUS, b""]
      <- SASL
      [0x620020:0] <- SASL-MECHANISMS @64 [@PN_SYMBOL[:ANONYMOUS]]
      [0x620020:0] <- SASL-OUTCOME @68 [0]
      <- AMQP
      [0x61a840:0] <- OPEN @16 ["a", null, null, null, null, null, null, null, null]
      -> AMQP
      [0x61a840:0] -> OPEN @16 ["b", "0.0.0.0", null, null, null, null, null, null, null]
      [0x61a840:1] -> BEGIN @17 [null, 0, 1024, 1024]
      [0x61a840:1] -> ATTACH @18 ["sender-xxx", 1, false, null, null, @40 ["a", 0, null, 0, false, null, null, null, null, null, null], @41 ["a", 0, null, 0, false, null, null], null, null, 0]
      [0x61a840:1] <- BEGIN @17 [1, 0, 1024, 1024]
      [0x61a840:1] <- ATTACH @18 ["sender-xxx", 1, true, null, null, @40 ["a", 0, null, 0, false, null, null, null, null, null, null], @41 ["a", 0, null, 0, false, null, null], null, null, 0]
      [0x61a840:1] <- FLOW @19 [0, 1024, 0, 1024, 1, 0, 1, null, false]
      [0x61a840:1] -> TRANSFER @20 [1, 0, b"\x00\x00\x00\x00\x00\x00\x00\x00", 0, true, false] (133) "\x00\x80\x00\x00\x00\x00\x00\x00\x00p\xd0\x00\x00\x00\x10\x00\x00\x00\x05V\x00P\x04@V\x00p\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00s\xd0\x00\x00\x00F\x00\x00\x00\x0d@@\xb1\x00\x00\x00\x11amqps://0.0.0.0/a@\xb1\x00\x00\x00\x08amqp://b@@@\x83\x00\x00\x00\x00\x00\x00\x00\x00\x83\x00\x00\x00\x00\x00\x00\x00\x00@p\x00\x00\x00\x00@\x00\x80\x00\x00\x00\x00\x00\x00\x00w\xb0\x00\x00\x00\x02\xff\xff

      Attachments

        Issue Links

          Activity

            People

              astitcher Andrew Stitcher
              affandar Affan Dar
              Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: