Search code examples
dtlscalifornium

Query related to Connection Id exchange between DTLS Client & Server using Californium Scandium core


I am exploring on DTLS 1.2 using Californium-Scandium demo-apps projects. It appears that Scandium-core README.md supports the latest draft of Connection Identifiers for DTLS 1.2. According to Connection Identifiers for DTLS 1.2, the CID exchange happens between the Client & the server if client and server wants to talk on based of Connection Id. enter image description here When I run the demo-apps of Scandium Server & Scandium Client, I am not able to see the exchange of CID happening between the client and the server. Though I can see the Connection Id generation on Client as well Server side of DTLS. I have added the logger in the Record.java but the connection Id is always null in the loggers. My question is whether the CID exchange logic between the DTLS Server and DTLS client is implemented in scandium-core API? If yes, please help me to find out the classes used for this.


Solution

  • For version 2.6.0, neither the ExampleDTLSClient nor the ExampleDTLSServer comes "out of the box" with CID enabled (but I will change that for 3.0 :-) ).

    If you want to see that "out of the box" use the "cf-secure" demo. Start the client with "CID:0" for "support CID", and the server with "CID:6" to use a 6 bytes CID.

    To enable CID for ExampleDTLSClient and ExampleDTLSServer, add to the DtlsConfigurationBuilder a

    builder.setConnectionIdGenerator(new SingleNodeConnectionIdGenerator(cidLength));
    

    Use cidLength 0 for the client (support) and 6 for the server (use 6 bytes).