0

This is my CoAP Client code for sending requests with incremental payload size:

        CoapClient client = new CoapClient(uri);

        for (int payloadSize = start; payloadSize <= end; payloadSize += stepSize) {

            for (int repeatCount = 0; repeatCount < repeatNo; repeatCount++) {

                //building payload
                StringBuilder sb = new StringBuilder();
                for (int i = 0; i< payloadSize ; i ++)
                    sb.append("a");

                //building request with payload
                Request req = new Request(CoAP.Code.GET);
                req.setPayload(sb.toString().getBytes());

                //sending request
                long sendTime = System.currentTimeMillis();
                CoapResponse response = client.advanced(req);
                long receiveTime = System.currentTimeMillis();

                long transmissionTime = receiveTime - sendTime;
                ...

But, it seems UDP Datagram fragmantation or CoAP block-wise transfer is not happening for the client. What am I doing wrong?

In my local machine, the max payload transferred is about 2300 (less than 2400) bytes. and over internet is about 1400 (less than 1500).

I want to send big requests from the CoAP client to CoAP server. What am I doing wrong? (Specifically to Californium CoAP implementation please.)

Thanks.

sakhoshdel
  • 111
  • 2
  • 8
  • Unclear what you're asking. Your title contradicts the body of your question. Do you mean datagram fragmentation *is* happening? Because that's what explains your results. There's nothing unusual about a maximum payload of 1400 bytes via the Internet, and nothing you can do to increase it. – user207421 Jul 04 '15 at 01:24
  • What I mean in a clear text is that: I want to send payload from CoAP client to CoAP server. but I connot go over 1400 bytes. Why? – sakhoshdel Jul 04 '15 at 13:35
  • Interestingly, from CoAP server to CoAP client I can send a big payload and there is no problem with that! – sakhoshdel Jul 04 '15 at 13:36

0 Answers0