Constrained Application Protocol: Difference between revisions

Content deleted Content added
The new CoAPSharp repo contains only a MIT license
ce
 
(7 intermediate revisions by 2 users not shown)
Line 41:
|}
 
=== CoAP Fixedfixed-Sizesize Headerheader ===
The first 4 bytes are mandatory in all CoAP datagrams, they constitute the fixed-size header.
 
These fields can be extracted from these 4 bytes in C via these macros:
<syntaxhighlight lang="c">
#define COAP_HEADER_VERSION(data) ( (0xC0 & (data)[0]) >> 6 )
#define COAP_HEADER_TYPE(data) ( (0x30 & (data)[0]) >> 4 )
Line 195 ⟶ 196:
* Semantic and format this field depends on the respective option.
 
==ProxyActive protocol implementations==
==Implementations==
{| class="wikitable sortable"
|-
Line 202 ⟶ 203:
| coap || Dart || RFC 7252|| Client || Blockwise Transfers, Observe, Multicast, Proxying (partial) || MIT || https://github.com/shamblett/coap
|-
| aiocoap || Python 3 || RFC 7252, RFC 7641, RFC 7959, RFC 8323, RFC 7967, RFC 8132, RFC 9176, RFC 8613, RFC 9528|| Client + Server || Blockwise Transfers, Observe (partial) || MIT || {{URL|https://pypi.python.org/pypi/aiocoap}}
|-
| Californium || Java || RFC 7252, RFC 7641, RFC 7959|| Client + Server || Observe, Blockwise Transfers, Multicast (since 2.x), DTLS (+ DTLS 1.2 Connection ID) || EPL+EDL || {{URL|https://www.eclipse.org/californium}} {{URL|https://github.com/eclipse/californium}}
|-
| cantcoapCoAPSharp || C++/C#, .NET || RFC 7252|| Client + Server || Core, Observe, Block, RD || BSDMIT || {{URL|http://www.coapsharp.com https://github.com/staropramFemtomaxInc/cantcoapcoapsharp}}
|-
| CanopusFreeCoAP || [[Go (programming language)|Go]]C || RFC 7252|| Client + Server ||+ CoreHTTP/CoAP Proxy ||Core, ApacheDTLS, LicenseBlockwise 2.0Transfers || BSD || {{URL|https://github.com/zubairhamedkeith-cullen/canopusFreeCoAP}}
|-
| Go-CoAP || [[Go (programming language)|Go]] || RFC 7252, RFC 8232, RFC 7641, RFC 7959|| Client + Server || Core, Observe, Blockwise, Multicast, TCP/TLS || Apache License 2.0 || {{URL|https://github.com/plgd-dev/go-coap}}
|-
| CoAPjava-coap implementation for|| GoJava || RFC [[Go7252, (programmingRFC language)|Go]]7641, ||RFC 7959, RFC 72528323|| Client + Server || Core + Draft Subscribe || MITApache License 2.0 || {{URL|https://github.com/dustinPelionIoT/gojava-coap}}
|-
| CoAP.NETlibcoap || C# || RFC 7252, coap-13RFC 7390, coap-08RFC 7641, coap-03RFC 7959, RFC 7967, RFC 8132, RFC 8323, RFC 8516, RFC 8613, RFC 8768, RFC 8974, RFC 9175, RFC 9177|| Client + Server || Core, Observe, Multicast, Blockwise Transfers, Patch/Fetch, OSCORE, (D)TLS || 3-clause BSD/GPL || https://github.com/smeshlinkobgm/CoAP.NETlibcoap
|-
|libcoapy
| CoAPSharp || C#, .NET || RFC 7252|| Client + Server || Core, Observe, Block, RD || MIT || http://www.coapsharp.com https://github.com/FemtomaxInc/coapsharp
|Python
| colspan="3" |same support as libcoap
|MIT
|{{URL|https://github.com/anyc/libcoapy}}
|-
| CoAPthonlobaro-coap || PythonC || RFC 7252|| Client + Server + Forward Proxy + Reverse Proxy || Observe, MulticastBlockwise server discovery, CoRE Link Format parsing, Block-wiseTransfers || MIT || https{{URL|http://githubwww.lobaro.com/Tanganelli/CoAPthonlobaro-coap}}
|-
| CoAP ShellmicroCoAPy || JavaMicroPython || RFC 7252|| Client + Server || Observe, Blockwise Transfers, DTLSCore || Apache License 2.0 || {{URL|https://github.com/tzolovinsighio/coap-shell microCoAPy}}
|-
| CoppernanoCoAP || JavaScript (Browser Plugin)C || RFC 7252|| Client + Server || ObserveCore, Blockwise Transfers, DTLS || 3-clause BSDLGPL || {{URL|https://githubapi.com/mkovatsc/Copper https://addons.mozillariot-os.org/firefox/addon/copper-270430/{{Dead link|date=July 2019 |bot=InternetArchiveBot |fix-attempted=yes group__net__nanocoap.html}}
|-
| node-coap || JavascriptJavaScript || RFC 7252,
| eCoAP || C || RFC 7252|| Client + Server || Core || MIT || https://gitlab.com/jobol/ecoap
RFC 7641, RFC 7959
| Client + Server || Core, Observe, Block || MIT || {{URL|https://github.com/mcollina/node-coap}}
|-
| ErbiumQt for ContikiCoAP || C++ || RFC 7252|| Client + Server || Core, Observe, Blockwise Transfers || 3-clauseGPL, BSDCommercial || httphttps://wwwdoc.contiki-osqt.orgio/ (erqt-rest6/qtcoap-example)index.html
|-
| FreeCoAPcoap-rs || CRust || RFC 7252|| Client + Server + HTTP/CoAP Proxy || Core, DTLSMulticast, BlockwiseObserve Transfersoption, ''Too Many Requests'' Response Code || BSDMIT || {{URL|https://github.com/keith-cullenCovertness/FreeCoAPcoap-rs}}
{{URL|https://docs.rs/coap/}}
|-
|-}
| guile-coap || Guile || RFC 7252, RFC 8323 || Client + Server || || GPL-3.0-or-later || https://codeberg.org/eris/guile-coap
 
==Proxy implementations==
There exist [[Proxy server|proxy]] implementations which provide [[Forward proxy|forward]] or [[Reverse proxy|reverse]] proxy functionality for the CoAP protocol and also implementations which translate between protocols like HTTP and CoAP.
 
The following projects provide proxy functionality:
* [http://telecom.dei.unipd.it/pages/read/90/ Squid 3.1.9 with transparent HTTP-CoAP mapping module]
* [https://code.google.com/p/jcoap/ jcoap Proxy]
* [https://github.com/eclipse/californium/tree/master/californium-proxy2 Californium cf-proxy2]
* [https://github.com/Tanganelli/CoAPthon CoAPthon]
* [https://github.com/keith-cullen/FreeCoAP FreeCoAP]
* [https://github.com/obgm/libcoap libcoap]
 
==Projects using CoAP==
{| class="wikitable sortable"
|-
! Name !! Programming Language !! Implemented CoAP version !! Client/Server !! Implemented CoAP features !! License !! Link
| iCoAP || Objective-C || RFC 7252|| Client || Core, Observe, Blockwise Transfers || MIT || https://github.com/stuffrabbit/iCoAP
|-
| java-coapCoAP Shell || Java || RFC 7252,|| RFC 7641, RFC 7959, RFCClient 8323|| ClientObserve, +Blockwise Server ||Transfers, DTLS || Apache License 2.0 || https://github.com/PelionIoTtzolov/java-coap-shell
|-
| jCoAPCopper || JavaJavaScript (browser plugin) || RFC 7252|| Client + Server || Observe, Blockwise Transfers || Apache3-clause License 2.0BSD || https://code.googlegithub.com/pmkovatsc/jcoapCopper https://addons.mozilla.org/firefox/addon/copper-270430/{{Dead link|date=July 2019 |bot=InternetArchiveBot |fix-attempted=yes }}
|-
|}
| libcoap || C || RFC 7252, RFC 7390, RFC 7641, RFC 7959, RFC 7967, RFC 8132, RFC 8323, RFC 8516, RFC 8613, RFC 8768, RFC 8974, RFC 9175, RFC 9177|| Client + Server ||Core, Observe, Multicast, Blockwise Transfers, Patch/Fetch, OSCORE, DTLS || BSD/GPL || https://github.com/obgm/libcoap
 
==Inactive protocol implementations==
{| class="wikitable sortable"
|-
! Name !! Programming Language !! Implemented CoAP version !! Client/Server !! Implemented CoAP features !! License !! Link
| LibNyoci || C || RFC 7252|| Client + Server || Core, Observe, Block, DTLS || MIT || https://github.com/darconeous/libnyoci
|-
| lobaro-coapcantcoap || C++/C || RFC 7252|| Client + Server ||Observe, Blockwise Transfers || MITBSD || httphttps://www.lobarogithub.com/lobaro-coapstaropram/cantcoap
|-
| microcoapCanopus || C[[Go (programming language)|Go]] || RFC 7252|| Client + Server || Core || MITApache License 2.0 || https://github.com/1248zubairhamed/microcoapcanopus
|-
| microCoAPyCoAP implementation for Go || MicroPython[[Go (programming language)|Go]] || RFC 7252|| Client + Server || Core ||+ ApacheDraft LicenseSubscribe 2.0|| MIT || https://github.com/insighiodustin/microCoAPygo-coap
|-
| nanoCoAPCoAP.NET || C# || RFC 7252, coap-13, coap-08, coap-03 || Client + Server || Core, Observe, Blockwise Transfers, DTLS || LGPL3-clause BSD || https://apigithub.riot-os.orgcom/smeshlink/group__net__nanocoapCoAP.htmlNET
|-
| nCoapCoAPthon || JavaPython || RFC 7252|| Client + Server + Forward Proxy + Reverse Proxy || Observe, BlockwiseMulticast Transfersserver discovery, CoRE Link Format parsing, [https://tools.ietf.org/html/draft-kleine-core-coap-endpoint-id-01 Endpoint-IDBlock-Draft]wise || BSDMIT || https://github.com/okleineTanganelli/nCoAPCoAPthon
|-
| eCoAP || C || RFC 7252|| Client + Server || Core || MIT || https://gitlab.com/jobol/ecoap
| node-coap || Javascript || RFC 7252,
RFC 7641, RFC 7959
| Client + Server || Core, Observe, Block || MIT || https://github.com/mcollina/node-coap
|-
| QtErbium CoAPfor Contiki || C++ || RFC 7252|| Client + Server || Core, Observe, Blockwise Transfers || GPL,3-clause CommercialBSD || httpshttp://docwww.qtcontiki-os.ioorg/qt (er-6/qtcoaprest-index.htmlexample)
|-
| guile-coap || Guile || RFC 7252, RFC 8323 || Client + Server || || GPL-3.0-or-later || https://codeberg.org/eris/guile-coap
|-
| iCoAP || Objective-C || RFC 7252|| Client || Core, Observe, Blockwise Transfers || MIT || https://github.com/stuffrabbit/iCoAP
|-
| jCoAP || Java || RFC 7252|| Client + Server || Observe, Blockwise Transfers || Apache License 2.0 || https://code.google.com/p/jcoap/
|-
| CoAPSharpLibNyoci || C#, .NET || RFC 7252|| Client + Server || Core, Observe, Block, RDDTLS || MIT || http://www.coapsharp.com https://github.com/FemtomaxIncdarconeous/coapsharplibnyoci
|-
| LibNyocimicrocoap || C || RFC 7252|| Client + Server || Core, Observe, Block, DTLS || MIT || https://github.com/darconeous1248/libnyocimicrocoap
|-
| nCoap || Java || RFC 7252|| Client + Server || Observe, Blockwise Transfers, CoRE Link Format, [https://tools.ietf.org/html/draft-kleine-core-coap-endpoint-id-01 Endpoint-ID-Draft] || BSD || https://github.com/okleine/nCoAP
|-
| Ruby coap || Ruby || RFC 7252|| Client + Server (david) || Core, Observe, Block, RD || MIT, GPL || https://github.com/nning/coap<br/>https://github.com/nning/david
Line 271 ⟶ 306:
|-
| txThings || Python (Twisted) || RFC 7252|| Client + Server || Blockwise Transfers, Observe (partial) || MIT || https://github.com/mwasilak/txThings/
|-
| coap-rs || Rust || RFC 7252|| Client + Server || Core, Multicast, Observe option, ''Too Many Requests'' Response Code || MIT || https://github.com/Covertness/coap-rs
https://docs.rs/coap/
|-
| YaCoAP || C || || || || MIT || https://github.com/RIOT-Makers/YaCoAP
|-
|}
 
==Proxy implementations==
* [http://telecom.dei.unipd.it/pages/read/90/ Squid 3.1.9 with transparent HTTP-CoAP mapping module]
* [https://code.google.com/p/jcoap/ jcoap Proxy]
* [https://github.com/eclipse/californium/tree/master/californium-proxy2 Californium cf-proxy2]
* [https://github.com/Tanganelli/CoAPthon CoAPthon]
* [https://github.com/keith-cullen/FreeCoAP FreeCoAP]
 
==CoAP group communication==
Line 303 ⟶ 328:
* Certificate, where DTLS is enabled and the device uses [[X.509]] certificates for validation.
 
Research has been conducted on optimizing DTLS by implementing security associates as CoAP resources rather than using DTLS as a security wrapper for CoAP traffic. This research has indicated that improvements of up to 6.5 times none optimized implementations.<ref name="Security as a CoAP resource: An optimized DTLS implementation for the IoT">{{cite book |last1=Capossele |first1=Angelo |last2=Cervo |first2=Valerio |last3=De Cicco |first3=Gianluca |last4=Petrioli |first4=Chiara|title=2015 IEEE International Conference on Communications (ICC) |chapter=Security as a CoAP resource: An optimized DTLS implementation for the IoT |author4-link= Chiara Petrioli |date=June 2015 |journalpublisher=IEEE |pages=529–554 |doi= 10.1109/ICC.2015.7248379|isbn=978-1-4673-6432-4 |s2cid=12568959 }}</ref>
 
In addition to DTLS, RFC8613<ref>{{Cite journal|last1=Palombini|first1=Francesca|last2=Seitz|first2=Ludwig|last3=Selander|first3=Goeran|last4=Mattsson|first4=John|title=Object Security for Constrained RESTful Environments (OSCORE)|url=https://tools.ietf.org/html/rfc8613.html|access-date=2021-05-07|website=tools.ietf.org|year=2019 |doi=10.17487/RFC8613 |s2cid=58380874 |language=en}}</ref> defines the Object Security for Constrained RESTful Environments ([[OSCORE]]) protocol which provides security for CoAP at the application layer.