<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://elvis.hcw.ac.at/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Awolfsbauer</id>
	<title>Elvis Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://elvis.hcw.ac.at/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Awolfsbauer"/>
	<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php/Special:Contributions/Awolfsbauer"/>
	<updated>2026-09-10T15:27:11Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.5</generator>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=Constrained_Application_Protocol&amp;diff=1355</id>
		<title>Constrained Application Protocol</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=Constrained_Application_Protocol&amp;diff=1355"/>
		<updated>2019-04-09T14:21:48Z</updated>

		<summary type="html">&lt;p&gt;Awolfsbauer: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The &#039;&#039;&#039;Constrained Application Protocol&#039;&#039;&#039; (&#039;&#039;&#039;CoAP&#039;&#039;&#039;) is a specialized web transfer protocol, as defined in RFC 7252, for use with constrained nodes and constrained networks in the Internet of Things.&lt;br /&gt;
The protocol is designed for machine-to-machine (M2M) applications such as smart energy and building automation.&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
The work on Constrained Environments aims at realizing the REST architecture in a suitable form for the most constrained nodes and networks. The nodes usually consist of 8-bit microcontrollers with limited amounts of RAM and ROM.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
CoAP has the following main features:&lt;br /&gt;
&lt;br /&gt;
* Web protocol fulfilling M2M requirements in constrained environments&lt;br /&gt;
* UDP [RFC0768] binding with optional reliability supporting unicast and multicast requests&lt;br /&gt;
* Asynchronous message exchanges&lt;br /&gt;
* Low header overhead and parsing complexity&lt;br /&gt;
* URI and Content-type support&lt;br /&gt;
* Simple proxy and caching capabilities&lt;br /&gt;
* Stateless HTTP mapping&lt;br /&gt;
* Security binding to Datagram Transport Layer Security (DTLS)&lt;br /&gt;
&lt;br /&gt;
== The Protocol ==&lt;br /&gt;
&lt;br /&gt;
CoAP is similar to the client/server model of HTTP. M2M interactions typically result in a CoAP implementation acting in both client and server roles. A request is sent by a client to request an action on a resource (identified by a URI) on a server. The server then sends a response with a response code (equivalent to that of HTTP). Therefore, efficiency is very important, so CoAP uses UDP, a datagram-oriented transport.&lt;br /&gt;
&lt;br /&gt;
CoAP is however a single protocol, with messaging and request/response as just features of the CoAP header&lt;br /&gt;
&lt;br /&gt;
 +----------------------+&lt;br /&gt;
 |      Application     |&lt;br /&gt;
 +----------------------+&lt;br /&gt;
 +----------------------+  \&lt;br /&gt;
 |  Requests/Responses  |  |&lt;br /&gt;
 |----------------------|  | CoAP&lt;br /&gt;
 |       Messages       |  |&lt;br /&gt;
 +----------------------+  /&lt;br /&gt;
 +----------------------+&lt;br /&gt;
 |          UDP         |&lt;br /&gt;
 +----------------------+&lt;br /&gt;
&lt;br /&gt;
== Message Format ==&lt;br /&gt;
&lt;br /&gt;
By default, the messages are encoded in a simple binary format and transported over UDP. The message format starts with a fixed-size 4-byte header, followed by a variable-length Token value, which can be between 0 and 8 bytes long. Following the Token value comes a sequence of zero or more CoAP Options in Type-Length-Value (TLV) format, optionally followed by a payload that takes up the rest of the datagram.&lt;br /&gt;
&lt;br /&gt;
    0                   1                   2                   3&lt;br /&gt;
    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1&lt;br /&gt;
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+&lt;br /&gt;
   |Ver| T |  TKL  |      Code     |          Message ID           |&lt;br /&gt;
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+&lt;br /&gt;
   |   Token (if any, TKL bytes) ...&lt;br /&gt;
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+&lt;br /&gt;
   |   Options (if any) ...&lt;br /&gt;
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+&lt;br /&gt;
   |1 1 1 1 1 1 1 1|    Payload (if any) ...&lt;br /&gt;
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+&lt;br /&gt;
&lt;br /&gt;
;Version (Ver) (2 bits)&lt;br /&gt;
:Indicates the CoAP Version number. This must set this field to 1 (binary 01). Other values are reserved for future versions.&lt;br /&gt;
&lt;br /&gt;
;Type (T) (2 bits)&lt;br /&gt;
:Indicates if this message is of type Confirmable (0), Non-confirmable (1), Acknowledgement (2), or Reset (3).&lt;br /&gt;
&lt;br /&gt;
;Token Length (TKL) (4 bits)&lt;br /&gt;
:Indicates the length of the variable-length Token field, which may be 0-8 bytes in length.&lt;br /&gt;
&lt;br /&gt;
;CoAP Request/Response Code (8 bits)&lt;br /&gt;
:Splits into a 3-bit class and 5-bit detail.&lt;br /&gt;
&lt;br /&gt;
;Message ID (16 bits)&lt;br /&gt;
:Used to detect message duplication and to match messages of type Acknowledgement/Reset to messages of type Confirmable/Non-confirmable.&lt;br /&gt;
&lt;br /&gt;
== Security Considerations ==&lt;br /&gt;
&lt;br /&gt;
This section gives an overview of possible threats to the protocol as listed in section 11 of [https://tools.ietf.org/html/rfc7252 RFC 7252]. As CoAP realizes a subset of the features of HTTP/1.1, the security considerations in section 15 of [https://www.ietf.org/rfc/rfc2616.txt RFC2616] are also pertinent to CoAP.&lt;br /&gt;
&lt;br /&gt;
Note:&amp;quot;NoSec&amp;quot; mode means that the system simply sends packets over normal UDP over IP and is indicated by the &amp;quot;coap&amp;quot; scheme and the CoAP default port.  The system is secured only by keeping attackers from being able to send or receive packets from the network with the CoAP nodes. There is no protocol-level security (DTLS is disabled). The other available modes for securing CoAP are listed in section 9 of RFC7252.&lt;br /&gt;
&lt;br /&gt;
;Parsing the Protocol and Processing URI&#039;s&lt;br /&gt;
&lt;br /&gt;
The URI processing code in CoAP is likely to be a large source of vulnerabilities and should be implemented very carefully. Vulnerabilities include remotely crashing a node and remotely executing arbitrary code. CoAP aims to reduce the risk of these vulnerabilities by reducing parser complexity and moving much of the URI processing to the clients.&lt;br /&gt;
&lt;br /&gt;
;Proxying and Caching&lt;br /&gt;
&lt;br /&gt;
Proxies are man-in-the-middle by their nature. They can break any IPsec or DTLS protection that would otherwise happen between direct CoAP message exchange. Risks include the loss of confidentiality and availability. If the proxies also cache the threat to confidentiality and integrity of request/response data is amplified as CoAP does not implement cache-suppressing Cache-control as in HTTP/1.1.&lt;br /&gt;
For caching implementations any access control considerations also need to be applied to the value in the cache. A caching proxy must not make cache values available to requests that have lesser transport-security properties.&lt;br /&gt;
&lt;br /&gt;
;Risk of Amplification&lt;br /&gt;
&lt;br /&gt;
As CoAP server reply to request packets with response packets that may be significantly larger an attacker can use CoAP nodes to generate more traffic and use them in a denial-of-service(DoS) attack.  Turning a small attack packet into a larger one is called amplification. The attacker wants to overload a victim but is limited in the amount of traffic can use amplification to generate larger amounts. If a node that enables NoSec access becomes available to an attacker it can access victims on the general internet. UDP provides no way to verify the source address given in the request packet and an attacker can place the IP of the victim in the source address of a request packet to generate a larger packet directed at the victim. The risk is reduced however as constrained networks are only able to generate small amounts of traffic. In contrast the network itself with its limited capacity is a viable victim of an amplification attack. Large amplification factors should not be provided if the request is not authenticated. Also the slicing/blocking modes of CoAP [BLOCK] should be used for large resources. Because CoAP supports the use of multicast IP addresses in requests, CoAP servers should not accept multicast requests that can not be authenticated. Servers should limit the use of multicast requests as they can be a source of an accidental or deliberate DoS attack.&lt;br /&gt;
&lt;br /&gt;
;IP Address Spoofing&lt;br /&gt;
&lt;br /&gt;
As there is no handshake in UDP a rogue endpoint that can read and write messages can attack a single endpoint, a group of endpoints or the whole network. &lt;br /&gt;
&lt;br /&gt;
#Spoofing a Reset message in response to a message making an endpoint &amp;quot;deaf&amp;quot;&lt;br /&gt;
#Spoofing an ACK in response to a CON, preventing the sender of the CON from retransmitting to drown out the actual response&lt;br /&gt;
#Spoofing the entire response with forged payload/options, attacking a single endpoint or the supporting infrastructure&lt;br /&gt;
#Spoofing a multicast request for a target node resulting in network congestion or collapse due to a DoS attack on the victim, or forced wake-up from sleeping&lt;br /&gt;
#Spoofing observe messages&lt;br /&gt;
&lt;br /&gt;
Response spoofing can be mitigated by choosing a nontrivial, randomized token in the request. Other kinds of spoofing can only be detected by CoAP  if Confirmable message semantics are used and if one keeps track of Message ID&#039;s. A client can also attempt to overload a server by sending complex requests as the cost of a CON request is small. This can be used in a battery depletion attack or to make the server run out of resources for processing legitimate traffic. All these attacks can be prevented if a security mode other than NoSec is used.&lt;br /&gt;
&lt;br /&gt;
;Cross-Protocol Attacks&lt;br /&gt;
&lt;br /&gt;
In general, for any pair of protocols, one could have been designed in a way, that enables an attacker to cause the generation of replies that look like messages of the other protocol. Because a CoAP endpoint can be manipulated to send packets to a fake source address it can be used to attack a victim listening to UDP packets at a given IP address and port.&lt;br /&gt;
&lt;br /&gt;
#The attacker sends a message to a CoAP endpoint with the given address as the fake source address.&lt;br /&gt;
#The endpoint replies with a message to the source address.&lt;br /&gt;
#The victim receives a UDP packet that it interprets according to the rules of a different protocol.&lt;br /&gt;
&lt;br /&gt;
This can be used to circumvent firewall rules that prevent direct communication but allow communication from the CoAP endpoint. This scenario can work the other way too. A CoAP endpoint could be attacked from another UDP-based protocol. Attacks are possible if the endpoints rely only on checking IP addresses. To prevent these kinds of attacks  strict checking of syntax of packets received should be implemented. Furthermore endpoints should not authorize actions based on trusting the source IP address of a packet.&lt;br /&gt;
&lt;br /&gt;
;Constrained Node Considerations&lt;br /&gt;
&lt;br /&gt;
Keys should be generated externally and added to the device during manufacturing or commissioning. Due to low processing power constrained nodes are susceptible to timing attacks. Cryptographic principles should be implemented with special care as many nodes are installed in exposed environments and have little resistance to tampering. The scope of credentials assigned to them should be considered carefully. A shared key assigned to a group of nodes may make any single node a target for subverting the entire group.&lt;br /&gt;
&lt;br /&gt;
== Implementations ==&lt;br /&gt;
&lt;br /&gt;
Generic implementations are becoming available for a variety of platforms. Implementations for constrained devices are typically written in C. CoAP is also used between them and more powerful systems such as cloud servers, home centrals, smartphones:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Programming Language !! Client/Server !! License !! Link&lt;br /&gt;
|-&lt;br /&gt;
| Erbium for Contiki || C || Client + Server || 3-clause BSD || http://www.contiki-os.org/&lt;br /&gt;
|-&lt;br /&gt;
| libcoap || C || Client + Server || BSD/GPL || https://libcoap.net/&lt;br /&gt;
|-&lt;br /&gt;
| Eclipse tinydtls || C || Client + Server || EPL+EDL || https://projects.eclipse.org/projects/iot.tinydtls&lt;br /&gt;
|-&lt;br /&gt;
| LibNyoci || C || Client + Server || MIT || https://github.com/darconeous/libnyoci&lt;br /&gt;
|-&lt;br /&gt;
| microcoap || C || Client + Server || MIT || https://github.com/1248/microcoap&lt;br /&gt;
|-&lt;br /&gt;
| cantcoap ||  C++/C || Client + Server || BSD || https://github.com/staropram/cantcoap&lt;br /&gt;
|-&lt;br /&gt;
| Lobaro CoAP || C || Client + Server || MIT || https://www.lobaro.com/portfolio/lobaro-coap/&lt;br /&gt;
|-&lt;br /&gt;
| MR-CoAP || Java ||     || BSD || https://github.com/MR-CoAP/CoAP&lt;br /&gt;
|-&lt;br /&gt;
| Wakaama || C || Client + Server || EPL+EDL || https://www.eclipse.org/wakaama/index.html&lt;br /&gt;
|-&lt;br /&gt;
| coap-node || Javascript || Client || MIT || https://github.com/PeterEB/coap-node&lt;br /&gt;
|-&lt;br /&gt;
| coap-shepherd || Javascript || Server || MIT || https://github.com/PeterEB/coap-shepherd&lt;br /&gt;
|-&lt;br /&gt;
| Californium || Java || Client + Server || EPL+EDL || https://www.eclipse.org/californium&lt;br /&gt;
|-&lt;br /&gt;
| nCoap || Java || Client + Server || BSD || https://github.com/okleine/nCoAP&lt;br /&gt;
|-&lt;br /&gt;
| leshan || Java || Client + Server || EPL+EDL || https://github.com/eclipse/leshan&lt;br /&gt;
|-&lt;br /&gt;
| CoAP.NET || C# || Client + Server || 3-clause BSD || https://github.com/smeshlink/CoAP.NET&lt;br /&gt;
|-&lt;br /&gt;
| CoAPSharp ||  C#, .NET || Client + Server || LGPL || http://www.coapsharp.com&lt;br /&gt;
|-&lt;br /&gt;
| Waher.Networking.CoAP || C# || Server || || https://github.com/PeterWaher/IoTGateway&lt;br /&gt;
|-&lt;br /&gt;
| gen_coap || Erlang || Client + Server || MPL v1.1 || https://github.com/gotthardp/gen_coap&lt;br /&gt;
|-&lt;br /&gt;
| go-coap || Go || Client + Server || MIT || https://github.com/go-ocf/go-coap&lt;br /&gt;
|-&lt;br /&gt;
| node-coap || Javascript || Client + Server || MIT || https://github.com/mcollina/node-coap&lt;br /&gt;
|-&lt;br /&gt;
| coap-cli || Javascript  || || MIT || https://github.com/mcollina/coap-cli&lt;br /&gt;
|-&lt;br /&gt;
| txThings || Python (Twisted) || Client + Server || MIT || https://github.com/mwasilak/txThings&lt;br /&gt;
|-&lt;br /&gt;
| aiocoap || Python 3 || Client + Server ||  MIT || https://github.com/chrysn/aiocoap&lt;br /&gt;
|-&lt;br /&gt;
| CoAPthon || Python || Client + Server || MIT || https://github.com/Tanganelli/CoAPthon&lt;br /&gt;
|-&lt;br /&gt;
| Ruby coap || Ruby || Client || MIT || https://github.com/nning/coap&lt;br /&gt;
|-&lt;br /&gt;
| Ruby david || Ruby || Server || MIT || https://github.com/nning/david&lt;br /&gt;
|-&lt;br /&gt;
| coap-rs || Rust || Client + Server || MIT || https://github.com/Covertness/coap-rs&lt;br /&gt;
|-&lt;br /&gt;
| Copper || JavaScript (Browser Plugin) || Client || BSD || https://github.com/mkovatsc/Copper&lt;br /&gt;
|-&lt;br /&gt;
| iCoAP || Objective-C || Client ||  MIT || https://github.com/stuffrabbit/iCoAP&lt;br /&gt;
|-&lt;br /&gt;
| SwiftCoAP || Swift || Client + Server || MIT || https://github.com/stuffrabbit/SwiftCoAP&lt;br /&gt;
|-&lt;br /&gt;
| nCoap || Java || Client + Server || BSD || https://github.com/okleine/nCoAP&lt;br /&gt;
|-&lt;br /&gt;
| txThings || Python (Twisted) || Client + Server ||  MIT || https://github.com/mwasilak/txThings&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Courses ==&lt;br /&gt;
&lt;br /&gt;
* [[Vertiefendes Wahlfach-Projekt]] (2018)&lt;br /&gt;
* [[CoAP Chat Application for RIOT OS]]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
* RFC 7252: https://tools.ietf.org/html/rfc7252&lt;br /&gt;
* RFC 2616: https://www.ietf.org/rfc/rfc2616.txt&lt;br /&gt;
* CoAP: RFC 7252 Constrained Application Protocol https://coap.technology/&lt;br /&gt;
* Learning Internet of Things: https://www.oreilly.com/library/view/learning-internet-of/9781783553532/&lt;br /&gt;
&lt;br /&gt;
[[Category:Basic]]&lt;/div&gt;</summary>
		<author><name>Awolfsbauer</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=Constrained_Application_Protocol&amp;diff=1354</id>
		<title>Constrained Application Protocol</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=Constrained_Application_Protocol&amp;diff=1354"/>
		<updated>2019-04-09T14:20:01Z</updated>

		<summary type="html">&lt;p&gt;Awolfsbauer: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The &#039;&#039;&#039;Constrained Application Protocol&#039;&#039;&#039; (&#039;&#039;&#039;CoAP&#039;&#039;&#039;) is a specialized web transfer protocol, as defined in RFC 7252, for use with constrained nodes and constrained networks in the Internet of Things.&lt;br /&gt;
The protocol is designed for machine-to-machine (M2M) applications such as smart energy and building automation.&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
The work on Constrained Environments aims at realizing the REST architecture in a suitable form for the most constrained nodes and networks. The nodes usually consist of 8-bit microcontrollers with limited amounts of RAM and ROM.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
CoAP has the following main features:&lt;br /&gt;
&lt;br /&gt;
* Web protocol fulfilling M2M requirements in constrained environments&lt;br /&gt;
* UDP [RFC0768] binding with optional reliability supporting unicast and multicast requests&lt;br /&gt;
* Asynchronous message exchanges&lt;br /&gt;
* Low header overhead and parsing complexity&lt;br /&gt;
* URI and Content-type support&lt;br /&gt;
* Simple proxy and caching capabilities&lt;br /&gt;
* Stateless HTTP mapping&lt;br /&gt;
* Security binding to Datagram Transport Layer Security (DTLS)&lt;br /&gt;
&lt;br /&gt;
== The Protocol ==&lt;br /&gt;
&lt;br /&gt;
CoAP is similar to the client/server model of HTTP. M2M interactions typically result in a CoAP implementation acting in both client and server roles. A request is sent by a client to request an action on a resource (identified by a URI) on a server. The server then sends a response with a response code (equivalent to that of HTTP). Therefore, efficiency is very important, so CoAP uses UDP, a datagram-oriented transport.&lt;br /&gt;
&lt;br /&gt;
CoAP is however a single protocol, with messaging and request/response as just features of the CoAP header&lt;br /&gt;
&lt;br /&gt;
 +----------------------+&lt;br /&gt;
 |      Application     |&lt;br /&gt;
 +----------------------+&lt;br /&gt;
 +----------------------+  \&lt;br /&gt;
 |  Requests/Responses  |  |&lt;br /&gt;
 |----------------------|  | CoAP&lt;br /&gt;
 |       Messages       |  |&lt;br /&gt;
 +----------------------+  /&lt;br /&gt;
 +----------------------+&lt;br /&gt;
 |          UDP         |&lt;br /&gt;
 +----------------------+&lt;br /&gt;
&lt;br /&gt;
== Message Format ==&lt;br /&gt;
&lt;br /&gt;
By default, the messages are encoded in a simple binary format and transported over UDP. The message format starts with a fixed-size 4-byte header, followed by a variable-length Token value, which can be between 0 and 8 bytes long. Following the Token value comes a sequence of zero or more CoAP Options in Type-Length-Value (TLV) format, optionally followed by a payload that takes up the rest of the datagram.&lt;br /&gt;
&lt;br /&gt;
    0                   1                   2                   3&lt;br /&gt;
    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1&lt;br /&gt;
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+&lt;br /&gt;
   |Ver| T |  TKL  |      Code     |          Message ID           |&lt;br /&gt;
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+&lt;br /&gt;
   |   Token (if any, TKL bytes) ...&lt;br /&gt;
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+&lt;br /&gt;
   |   Options (if any) ...&lt;br /&gt;
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+&lt;br /&gt;
   |1 1 1 1 1 1 1 1|    Payload (if any) ...&lt;br /&gt;
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+&lt;br /&gt;
&lt;br /&gt;
;Version (Ver) (2 bits)&lt;br /&gt;
:Indicates the CoAP Version number. This must set this field to 1 (binary 01). Other values are reserved for future versions.&lt;br /&gt;
&lt;br /&gt;
;Type (T) (2 bits)&lt;br /&gt;
:Indicates if this message is of type Confirmable (0), Non-confirmable (1), Acknowledgement (2), or Reset (3).&lt;br /&gt;
&lt;br /&gt;
;Token Length (TKL) (4 bits)&lt;br /&gt;
:Indicates the length of the variable-length Token field, which may be 0-8 bytes in length.&lt;br /&gt;
&lt;br /&gt;
;CoAP Request/Response Code (8 bits)&lt;br /&gt;
:Splits into a 3-bit class and 5-bit detail.&lt;br /&gt;
&lt;br /&gt;
;Message ID (16 bits)&lt;br /&gt;
:Used to detect message duplication and to match messages of type Acknowledgement/Reset to messages of type Confirmable/Non-confirmable.&lt;br /&gt;
&lt;br /&gt;
== Security Considerations ==&lt;br /&gt;
&lt;br /&gt;
This section gives an overview of possible threats to the protocol as listed in section 11 of RFC 7252. As CoAP realizes a subset of the features of HTTP/1.1, the security considerations in section 15 of RFC2616 are also pertinent to CoAP.&lt;br /&gt;
&lt;br /&gt;
Note:&amp;quot;NoSec&amp;quot; mode means that the system simply sends packets over normal UDP over IP and is indicated by the &amp;quot;coap&amp;quot; scheme and the CoAP default port.  The system is secured only by keeping attackers from being able to send or receive packets from the network with the CoAP nodes. There is no protocol-level security (DTLS is disabled). The other available modes for securing CoAP are listed in section 9 of RFC7252.&lt;br /&gt;
&lt;br /&gt;
;Parsing the Protocol and Processing URI&#039;s&lt;br /&gt;
&lt;br /&gt;
The URI processing code in CoAP is likely to be a large source of vulnerabilities and should be implemented very carefully. Vulnerabilities include remotely crashing a node and remotely executing arbitrary code. CoAP aims to reduce the risk of these vulnerabilities by reducing parser complexity and moving much of the URI processing to the clients.&lt;br /&gt;
&lt;br /&gt;
;Proxying and Caching&lt;br /&gt;
&lt;br /&gt;
Proxies are man-in-the-middle by their nature. They can break any IPsec or DTLS protection that would otherwise happen between direct CoAP message exchange. Risks include the loss of confidentiality and availability. If the proxies also cache the threat to confidentiality and integrity of request/response data is amplified as CoAP does not implement cache-suppressing Cache-control as in HTTP/1.1.&lt;br /&gt;
For caching implementations any access control considerations also need to be applied to the value in the cache. A caching proxy must not make cache values available to requests that have lesser transport-security properties.&lt;br /&gt;
&lt;br /&gt;
;Risk of Amplification&lt;br /&gt;
&lt;br /&gt;
As CoAP server reply to request packets with response packets that may be significantly larger an attacker can use CoAP nodes to generate more traffic and use them in a denial-of-service(DoS) attack.  Turning a small attack packet into a larger one is called amplification. The attacker wants to overload a victim but is limited in the amount of traffic can use amplification to generate larger amounts. If a node that enables NoSec access becomes available to an attacker it can access victims on the general internet. UDP provides no way to verify the source address given in the request packet and an attacker can place the IP of the victim in the source address of a request packet to generate a larger packet directed at the victim. The risk is reduced however as constrained networks are only able to generate small amounts of traffic. In contrast the network itself with its limited capacity is a viable victim of an amplification attack. Large amplification factors should not be provided if the request is not authenticated. Also the slicing/blocking modes of CoAP [BLOCK] should be used for large resources. Because CoAP supports the use of multicast IP addresses in requests, CoAP servers should not accept multicast requests that can not be authenticated. Servers should limit the use of multicast requests as they can be a source of an accidental or deliberate DoS attack.&lt;br /&gt;
&lt;br /&gt;
;IP Address Spoofing&lt;br /&gt;
&lt;br /&gt;
As there is no handshake in UDP a rogue endpoint that can read and write messages can attack a single endpoint, a group of endpoints or the whole network. &lt;br /&gt;
&lt;br /&gt;
#Spoofing a Reset message in response to a message making an endpoint &amp;quot;deaf&amp;quot;&lt;br /&gt;
#Spoofing an ACK in response to a CON, preventing the sender of the CON from retransmitting to drown out the actual response&lt;br /&gt;
#Spoofing the entire response with forged payload/options, attacking a single endpoint or the supporting infrastructure&lt;br /&gt;
#Spoofing a multicast request for a target node resulting in network congestion or collapse due to a DoS attack on the victim, or forced wake-up from sleeping&lt;br /&gt;
#Spoofing observe messages&lt;br /&gt;
&lt;br /&gt;
Response spoofing can be mitigated by choosing a nontrivial, randomized token in the request. Other kinds of spoofing can only be detected by CoAP  if Confirmable message semantics are used and if one keeps track of Message ID&#039;s. A client can also attempt to overload a server by sending complex requests as the cost of a CON request is small. This can be used in a battery depletion attack or to make the server run out of resources for processing legitimate traffic. All these attacks can be prevented if a security mode other than NoSec is used.&lt;br /&gt;
&lt;br /&gt;
;Cross-Protocol Attacks&lt;br /&gt;
&lt;br /&gt;
In general, for any pair of protocols, one could have been designed in a way, that enables an attacker to cause the generation of replies that look like messages of the other protocol. Because a CoAP endpoint can be manipulated to send packets to a fake source address it can be used to attack a victim listening to UDP packets at a given IP address and port.&lt;br /&gt;
&lt;br /&gt;
#The attacker sends a message to a CoAP endpoint with the given address as the fake source address.&lt;br /&gt;
#The endpoint replies with a message to the source address.&lt;br /&gt;
#The victim receives a UDP packet that it interprets according to the rules of a different protocol.&lt;br /&gt;
&lt;br /&gt;
This can be used to circumvent firewall rules that prevent direct communication but allow communication from the CoAP endpoint. This scenario can work the other way too. A CoAP endpoint could be attacked from another UDP-based protocol. Attacks are possible if the endpoints rely only on checking IP addresses. To prevent these kinds of attacks  strict checking of syntax of packets received should be implemented. Furthermore endpoints should not authorize actions based on trusting the source IP address of a packet.&lt;br /&gt;
&lt;br /&gt;
;Constrained Node Considerations&lt;br /&gt;
&lt;br /&gt;
Keys should be generated externally and added to the device during manufacturing or commissioning. Due to low processing power constrained nodes are susceptible to timing attacks. Cryptographic principles should be implemented with special care as many nodes are installed in exposed environments and have little resistance to tampering. The scope of credentials assigned to them should be considered carefully. A shared key assigned to a group of nodes may make any single node a target for subverting the entire group.&lt;br /&gt;
&lt;br /&gt;
== Implementations ==&lt;br /&gt;
&lt;br /&gt;
Generic implementations are becoming available for a variety of platforms. Implementations for constrained devices are typically written in C. CoAP is also used between them and more powerful systems such as cloud servers, home centrals, smartphones:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Programming Language !! Client/Server !! License !! Link&lt;br /&gt;
|-&lt;br /&gt;
| Erbium for Contiki || C || Client + Server || 3-clause BSD || http://www.contiki-os.org/&lt;br /&gt;
|-&lt;br /&gt;
| libcoap || C || Client + Server || BSD/GPL || https://libcoap.net/&lt;br /&gt;
|-&lt;br /&gt;
| Eclipse tinydtls || C || Client + Server || EPL+EDL || https://projects.eclipse.org/projects/iot.tinydtls&lt;br /&gt;
|-&lt;br /&gt;
| LibNyoci || C || Client + Server || MIT || https://github.com/darconeous/libnyoci&lt;br /&gt;
|-&lt;br /&gt;
| microcoap || C || Client + Server || MIT || https://github.com/1248/microcoap&lt;br /&gt;
|-&lt;br /&gt;
| cantcoap ||  C++/C || Client + Server || BSD || https://github.com/staropram/cantcoap&lt;br /&gt;
|-&lt;br /&gt;
| Lobaro CoAP || C || Client + Server || MIT || https://www.lobaro.com/portfolio/lobaro-coap/&lt;br /&gt;
|-&lt;br /&gt;
| MR-CoAP || Java ||     || BSD || https://github.com/MR-CoAP/CoAP&lt;br /&gt;
|-&lt;br /&gt;
| Wakaama || C || Client + Server || EPL+EDL || https://www.eclipse.org/wakaama/index.html&lt;br /&gt;
|-&lt;br /&gt;
| coap-node || Javascript || Client || MIT || https://github.com/PeterEB/coap-node&lt;br /&gt;
|-&lt;br /&gt;
| coap-shepherd || Javascript || Server || MIT || https://github.com/PeterEB/coap-shepherd&lt;br /&gt;
|-&lt;br /&gt;
| Californium || Java || Client + Server || EPL+EDL || https://www.eclipse.org/californium&lt;br /&gt;
|-&lt;br /&gt;
| nCoap || Java || Client + Server || BSD || https://github.com/okleine/nCoAP&lt;br /&gt;
|-&lt;br /&gt;
| leshan || Java || Client + Server || EPL+EDL || https://github.com/eclipse/leshan&lt;br /&gt;
|-&lt;br /&gt;
| CoAP.NET || C# || Client + Server || 3-clause BSD || https://github.com/smeshlink/CoAP.NET&lt;br /&gt;
|-&lt;br /&gt;
| CoAPSharp ||  C#, .NET || Client + Server || LGPL || http://www.coapsharp.com&lt;br /&gt;
|-&lt;br /&gt;
| Waher.Networking.CoAP || C# || Server || || https://github.com/PeterWaher/IoTGateway&lt;br /&gt;
|-&lt;br /&gt;
| gen_coap || Erlang || Client + Server || MPL v1.1 || https://github.com/gotthardp/gen_coap&lt;br /&gt;
|-&lt;br /&gt;
| go-coap || Go || Client + Server || MIT || https://github.com/go-ocf/go-coap&lt;br /&gt;
|-&lt;br /&gt;
| node-coap || Javascript || Client + Server || MIT || https://github.com/mcollina/node-coap&lt;br /&gt;
|-&lt;br /&gt;
| coap-cli || Javascript  || || MIT || https://github.com/mcollina/coap-cli&lt;br /&gt;
|-&lt;br /&gt;
| txThings || Python (Twisted) || Client + Server || MIT || https://github.com/mwasilak/txThings&lt;br /&gt;
|-&lt;br /&gt;
| aiocoap || Python 3 || Client + Server ||  MIT || https://github.com/chrysn/aiocoap&lt;br /&gt;
|-&lt;br /&gt;
| CoAPthon || Python || Client + Server || MIT || https://github.com/Tanganelli/CoAPthon&lt;br /&gt;
|-&lt;br /&gt;
| Ruby coap || Ruby || Client || MIT || https://github.com/nning/coap&lt;br /&gt;
|-&lt;br /&gt;
| Ruby david || Ruby || Server || MIT || https://github.com/nning/david&lt;br /&gt;
|-&lt;br /&gt;
| coap-rs || Rust || Client + Server || MIT || https://github.com/Covertness/coap-rs&lt;br /&gt;
|-&lt;br /&gt;
| Copper || JavaScript (Browser Plugin) || Client || BSD || https://github.com/mkovatsc/Copper&lt;br /&gt;
|-&lt;br /&gt;
| iCoAP || Objective-C || Client ||  MIT || https://github.com/stuffrabbit/iCoAP&lt;br /&gt;
|-&lt;br /&gt;
| SwiftCoAP || Swift || Client + Server || MIT || https://github.com/stuffrabbit/SwiftCoAP&lt;br /&gt;
|-&lt;br /&gt;
| nCoap || Java || Client + Server || BSD || https://github.com/okleine/nCoAP&lt;br /&gt;
|-&lt;br /&gt;
| txThings || Python (Twisted) || Client + Server ||  MIT || https://github.com/mwasilak/txThings&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Courses ==&lt;br /&gt;
&lt;br /&gt;
* [[Vertiefendes Wahlfach-Projekt]] (2018)&lt;br /&gt;
* [[CoAP Chat Application for RIOT OS]]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
* RFC 7252: https://tools.ietf.org/html/rfc7252&lt;br /&gt;
* RFC 2616: https://www.ietf.org/rfc/rfc2616.txt&lt;br /&gt;
* CoAP: RFC 7252 Constrained Application Protocol https://coap.technology/&lt;br /&gt;
* Learning Internet of Things: https://www.oreilly.com/library/view/learning-internet-of/9781783553532/&lt;br /&gt;
&lt;br /&gt;
[[Category:Basic]]&lt;/div&gt;</summary>
		<author><name>Awolfsbauer</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=Constrained_Application_Protocol&amp;diff=1353</id>
		<title>Constrained Application Protocol</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=Constrained_Application_Protocol&amp;diff=1353"/>
		<updated>2019-04-09T14:17:03Z</updated>

		<summary type="html">&lt;p&gt;Awolfsbauer: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The &#039;&#039;&#039;Constrained Application Protocol&#039;&#039;&#039; (&#039;&#039;&#039;CoAP&#039;&#039;&#039;) is a specialized web transfer protocol, as defined in RFC 7252, for use with constrained nodes and constrained networks in the Internet of Things.&lt;br /&gt;
The protocol is designed for machine-to-machine (M2M) applications such as smart energy and building automation.&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
The work on Constrained Environments aims at realizing the REST architecture in a suitable form for the most constrained nodes and networks. The nodes usually consist of 8-bit microcontrollers with limited amounts of RAM and ROM.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
CoAP has the following main features:&lt;br /&gt;
&lt;br /&gt;
* Web protocol fulfilling M2M requirements in constrained environments&lt;br /&gt;
* UDP [RFC0768] binding with optional reliability supporting unicast and multicast requests&lt;br /&gt;
* Asynchronous message exchanges&lt;br /&gt;
* Low header overhead and parsing complexity&lt;br /&gt;
* URI and Content-type support&lt;br /&gt;
* Simple proxy and caching capabilities&lt;br /&gt;
* Stateless HTTP mapping&lt;br /&gt;
* Security binding to Datagram Transport Layer Security (DTLS)&lt;br /&gt;
&lt;br /&gt;
== The Protocol ==&lt;br /&gt;
&lt;br /&gt;
CoAP is similar to the client/server model of HTTP. M2M interactions typically result in a CoAP implementation acting in both client and server roles. A request is sent by a client to request an action on a resource (identified by a URI) on a server. The server then sends a response with a response code (equivalent to that of HTTP). Therefore, efficiency is very important, so CoAP uses UDP, a datagram-oriented transport.&lt;br /&gt;
&lt;br /&gt;
CoAP is however a single protocol, with messaging and request/response as just features of the CoAP header&lt;br /&gt;
&lt;br /&gt;
 +----------------------+&lt;br /&gt;
 |      Application     |&lt;br /&gt;
 +----------------------+&lt;br /&gt;
 +----------------------+  \&lt;br /&gt;
 |  Requests/Responses  |  |&lt;br /&gt;
 |----------------------|  | CoAP&lt;br /&gt;
 |       Messages       |  |&lt;br /&gt;
 +----------------------+  /&lt;br /&gt;
 +----------------------+&lt;br /&gt;
 |          UDP         |&lt;br /&gt;
 +----------------------+&lt;br /&gt;
&lt;br /&gt;
== Message Format ==&lt;br /&gt;
&lt;br /&gt;
By default, the messages are encoded in a simple binary format and transported over UDP. The message format starts with a fixed-size 4-byte header, followed by a variable-length Token value, which can be between 0 and 8 bytes long. Following the Token value comes a sequence of zero or more CoAP Options in Type-Length-Value (TLV) format, optionally followed by a payload that takes up the rest of the datagram.&lt;br /&gt;
&lt;br /&gt;
    0                   1                   2                   3&lt;br /&gt;
    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1&lt;br /&gt;
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+&lt;br /&gt;
   |Ver| T |  TKL  |      Code     |          Message ID           |&lt;br /&gt;
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+&lt;br /&gt;
   |   Token (if any, TKL bytes) ...&lt;br /&gt;
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+&lt;br /&gt;
   |   Options (if any) ...&lt;br /&gt;
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+&lt;br /&gt;
   |1 1 1 1 1 1 1 1|    Payload (if any) ...&lt;br /&gt;
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+&lt;br /&gt;
&lt;br /&gt;
;Version (Ver) (2 bits)&lt;br /&gt;
:Indicates the CoAP Version number. This must set this field to 1 (binary 01). Other values are reserved for future versions.&lt;br /&gt;
&lt;br /&gt;
;Type (T) (2 bits)&lt;br /&gt;
:Indicates if this message is of type Confirmable (0), Non-confirmable (1), Acknowledgement (2), or Reset (3).&lt;br /&gt;
&lt;br /&gt;
;Token Length (TKL) (4 bits)&lt;br /&gt;
:Indicates the length of the variable-length Token field, which may be 0-8 bytes in length.&lt;br /&gt;
&lt;br /&gt;
;CoAP Request/Response Code (8 bits)&lt;br /&gt;
:Splits into a 3-bit class and 5-bit detail.&lt;br /&gt;
&lt;br /&gt;
;Message ID (16 bits)&lt;br /&gt;
:Used to detect message duplication and to match messages of type Acknowledgement/Reset to messages of type Confirmable/Non-confirmable.&lt;br /&gt;
&lt;br /&gt;
== Security Considerations ==&lt;br /&gt;
&lt;br /&gt;
This section list some possible threats to the protocol. As CoAP realizes a subset of the features of HTTP/1.1, the security considerations in section 15 of RFC2616 are also pertinent to CoAP.&lt;br /&gt;
&lt;br /&gt;
Note:&amp;quot;NoSec&amp;quot; mode means that the system simply sends packets over normal UDP over IP and is indicated by the &amp;quot;coap&amp;quot; scheme and the CoAP default port.  The system is secured only by keeping attackers from being able to send or receive packets from the network with the CoAP nodes. There is no protocol-level security (DTLS is disabled).&lt;br /&gt;
&lt;br /&gt;
;Parsing the Protocol and Processing URI&#039;s&lt;br /&gt;
&lt;br /&gt;
The URI processing code in CoAP is likely to be a large source of vulnerabilities and should be implemented very carefully. Vulnerabilities include remotely crashing a node and remotely executing arbitrary code. CoAP aims to reduce the risk of these vulnerabilities by reducing parser complexity and moving much of the URI processing to the clients.&lt;br /&gt;
&lt;br /&gt;
;Proxying and Caching&lt;br /&gt;
&lt;br /&gt;
Proxies are man-in-the-middle by their nature. They can break any IPsec or DTLS protection that would otherwise happen between direct CoAP message exchange. Risks include the loss of confidentiality and availability. If the proxies also cache the threat to confidentiality and integrity of request/response data is amplified as CoAP does not implement cache-suppressing Cache-control as in HTTP/1.1.&lt;br /&gt;
For caching implementations any access control considerations also need to be applied to the value in the cache. A caching proxy must not make cache values available to requests that have lesser transport-security properties.&lt;br /&gt;
&lt;br /&gt;
;Risk of Amplification&lt;br /&gt;
&lt;br /&gt;
As CoAP server reply to request packets with response packets that may be significantly larger an attacker can use CoAP nodes to generate more traffic and use them in a denial-of-service(DoS) attack.  Turning a small attack packet into a larger one is called amplification. The attacker wants to overload a victim but is limited in the amount of traffic can use amplification to generate larger amounts. If a node that enables NoSec access becomes available to an attacker it can access victims on the general internet. UDP provides no way to verify the source address given in the request packet and an attacker can place the IP of the victim in the source address of a request packet to generate a larger packet directed at the victim. The risk is reduced however as constrained networks are only able to generate small amounts of traffic. In contrast the network itself with its limited capacity is a viable victim of an amplification attack. Large amplification factors should not be provided if the request is not authenticated. Also the slicing/blocking modes of CoAP [BLOCK] should be used for large resources. Because CoAP supports the use of multicast IP addresses in requests, CoAP servers should not accept multicast requests that can not be authenticated. Servers should limit the use of multicast requests as they can be a source of an accidental or deliberate DoS attack.&lt;br /&gt;
&lt;br /&gt;
;IP Address Spoofing&lt;br /&gt;
&lt;br /&gt;
As there is no handshake in UDP a rogue endpoint that can read and write messages can attack a single endpoint, a group of endpoints or the whole network. &lt;br /&gt;
&lt;br /&gt;
#Spoofing a Reset message in response to a message making an endpoint &amp;quot;deaf&amp;quot;&lt;br /&gt;
#Spoofing an ACK in response to a CON, preventing the sender of the CON from retransmitting to drown out the actual response&lt;br /&gt;
#Spoofing the entire response with forged payload/options, attacking a single endpoint or the supporting infrastructure&lt;br /&gt;
#Spoofing a multicast request for a target node resulting in network congestion or collapse due to a DoS attack on the victim, or forced wake-up from sleeping&lt;br /&gt;
#Spoofing observe messages&lt;br /&gt;
&lt;br /&gt;
Response spoofing can be mitigated by choosing a nontrivial, randomized token in the request. Other kinds of spoofing can only be detected by CoAP  if Confirmable message semantics are used and if one keeps track of Message ID&#039;s. A client can also attempt to overload a server by sending complex requests as the cost of a CON request is small. This can be used in a battery depletion attack or to make the server run out of resources for processing legitimate traffic. All these attacks can be prevented if a security mode other than NoSec is used.&lt;br /&gt;
&lt;br /&gt;
;Cross-Protocol Attacks&lt;br /&gt;
&lt;br /&gt;
In general, for any pair of protocols, one could have been designed in a way, that enables an attacker to cause the generation of replies that look like messages of the other protocol. Because a CoAP endpoint can be manipulated to send packets to a fake source address it can be used to attack a victim listening to UDP packets at a given IP address and port.&lt;br /&gt;
&lt;br /&gt;
#The attacker sends a message to a CoAP endpoint with the given address as the fake source address.&lt;br /&gt;
#The endpoint replies with a message to the source address.&lt;br /&gt;
#The victim receives a UDP packet that it interprets according to the rules of a different protocol.&lt;br /&gt;
&lt;br /&gt;
This can be used to circumvent firewall rules that prevent direct communication but allow communication from the CoAP endpoint. This scenario can work the other way too. A CoAP endpoint could be attacked from another UDP-based protocol. Attacks are possible if the endpoints rely only on checking IP addresses. To prevent these kinds of attacks  strict checking of syntax of packets received should be implemented. Furthermore endpoints should not authorize actions based on trusting the source IP address of a packet.&lt;br /&gt;
&lt;br /&gt;
;Constrained Node Considerations&lt;br /&gt;
&lt;br /&gt;
Keys should be generated externally and added to the device during manufacturing or commissioning. Due to low processing power constrained nodes are susceptible to timing attacks. Cryptographic principles should be implemented with special care as many nodes are installed in exposed environments and have little resistance to tampering. The scope of credentials assigned to them should be considered carefully. A shared key assigned to a group of nodes may make any single node a target for subverting the entire group.&lt;br /&gt;
&lt;br /&gt;
== Implementations ==&lt;br /&gt;
&lt;br /&gt;
Generic implementations are becoming available for a variety of platforms. Implementations for constrained devices are typically written in C. CoAP is also used between them and more powerful systems such as cloud servers, home centrals, smartphones:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Programming Language !! Client/Server !! License !! Link&lt;br /&gt;
|-&lt;br /&gt;
| Erbium for Contiki || C || Client + Server || 3-clause BSD || http://www.contiki-os.org/&lt;br /&gt;
|-&lt;br /&gt;
| libcoap || C || Client + Server || BSD/GPL || https://libcoap.net/&lt;br /&gt;
|-&lt;br /&gt;
| Eclipse tinydtls || C || Client + Server || EPL+EDL || https://projects.eclipse.org/projects/iot.tinydtls&lt;br /&gt;
|-&lt;br /&gt;
| LibNyoci || C || Client + Server || MIT || https://github.com/darconeous/libnyoci&lt;br /&gt;
|-&lt;br /&gt;
| microcoap || C || Client + Server || MIT || https://github.com/1248/microcoap&lt;br /&gt;
|-&lt;br /&gt;
| cantcoap ||  C++/C || Client + Server || BSD || https://github.com/staropram/cantcoap&lt;br /&gt;
|-&lt;br /&gt;
| Lobaro CoAP || C || Client + Server || MIT || https://www.lobaro.com/portfolio/lobaro-coap/&lt;br /&gt;
|-&lt;br /&gt;
| MR-CoAP || Java ||     || BSD || https://github.com/MR-CoAP/CoAP&lt;br /&gt;
|-&lt;br /&gt;
| Wakaama || C || Client + Server || EPL+EDL || https://www.eclipse.org/wakaama/index.html&lt;br /&gt;
|-&lt;br /&gt;
| coap-node || Javascript || Client || MIT || https://github.com/PeterEB/coap-node&lt;br /&gt;
|-&lt;br /&gt;
| coap-shepherd || Javascript || Server || MIT || https://github.com/PeterEB/coap-shepherd&lt;br /&gt;
|-&lt;br /&gt;
| Californium || Java || Client + Server || EPL+EDL || https://www.eclipse.org/californium&lt;br /&gt;
|-&lt;br /&gt;
| nCoap || Java || Client + Server || BSD || https://github.com/okleine/nCoAP&lt;br /&gt;
|-&lt;br /&gt;
| leshan || Java || Client + Server || EPL+EDL || https://github.com/eclipse/leshan&lt;br /&gt;
|-&lt;br /&gt;
| CoAP.NET || C# || Client + Server || 3-clause BSD || https://github.com/smeshlink/CoAP.NET&lt;br /&gt;
|-&lt;br /&gt;
| CoAPSharp ||  C#, .NET || Client + Server || LGPL || http://www.coapsharp.com&lt;br /&gt;
|-&lt;br /&gt;
| Waher.Networking.CoAP || C# || Server || || https://github.com/PeterWaher/IoTGateway&lt;br /&gt;
|-&lt;br /&gt;
| gen_coap || Erlang || Client + Server || MPL v1.1 || https://github.com/gotthardp/gen_coap&lt;br /&gt;
|-&lt;br /&gt;
| go-coap || Go || Client + Server || MIT || https://github.com/go-ocf/go-coap&lt;br /&gt;
|-&lt;br /&gt;
| node-coap || Javascript || Client + Server || MIT || https://github.com/mcollina/node-coap&lt;br /&gt;
|-&lt;br /&gt;
| coap-cli || Javascript  || || MIT || https://github.com/mcollina/coap-cli&lt;br /&gt;
|-&lt;br /&gt;
| txThings || Python (Twisted) || Client + Server || MIT || https://github.com/mwasilak/txThings&lt;br /&gt;
|-&lt;br /&gt;
| aiocoap || Python 3 || Client + Server ||  MIT || https://github.com/chrysn/aiocoap&lt;br /&gt;
|-&lt;br /&gt;
| CoAPthon || Python || Client + Server || MIT || https://github.com/Tanganelli/CoAPthon&lt;br /&gt;
|-&lt;br /&gt;
| Ruby coap || Ruby || Client || MIT || https://github.com/nning/coap&lt;br /&gt;
|-&lt;br /&gt;
| Ruby david || Ruby || Server || MIT || https://github.com/nning/david&lt;br /&gt;
|-&lt;br /&gt;
| coap-rs || Rust || Client + Server || MIT || https://github.com/Covertness/coap-rs&lt;br /&gt;
|-&lt;br /&gt;
| Copper || JavaScript (Browser Plugin) || Client || BSD || https://github.com/mkovatsc/Copper&lt;br /&gt;
|-&lt;br /&gt;
| iCoAP || Objective-C || Client ||  MIT || https://github.com/stuffrabbit/iCoAP&lt;br /&gt;
|-&lt;br /&gt;
| SwiftCoAP || Swift || Client + Server || MIT || https://github.com/stuffrabbit/SwiftCoAP&lt;br /&gt;
|-&lt;br /&gt;
| nCoap || Java || Client + Server || BSD || https://github.com/okleine/nCoAP&lt;br /&gt;
|-&lt;br /&gt;
| txThings || Python (Twisted) || Client + Server ||  MIT || https://github.com/mwasilak/txThings&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Courses ==&lt;br /&gt;
&lt;br /&gt;
* [[Vertiefendes Wahlfach-Projekt]] (2018)&lt;br /&gt;
* [[CoAP Chat Application for RIOT OS]]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
* RFC 7252: https://tools.ietf.org/html/rfc7252&lt;br /&gt;
* RFC 2616: https://www.ietf.org/rfc/rfc2616.txt&lt;br /&gt;
* CoAP: RFC 7252 Constrained Application Protocol https://coap.technology/&lt;br /&gt;
* Learning Internet of Things: https://www.oreilly.com/library/view/learning-internet-of/9781783553532/&lt;br /&gt;
&lt;br /&gt;
[[Category:Basic]]&lt;/div&gt;</summary>
		<author><name>Awolfsbauer</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=Constrained_Application_Protocol&amp;diff=1352</id>
		<title>Constrained Application Protocol</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=Constrained_Application_Protocol&amp;diff=1352"/>
		<updated>2019-04-09T14:07:10Z</updated>

		<summary type="html">&lt;p&gt;Awolfsbauer: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The &#039;&#039;&#039;Constrained Application Protocol&#039;&#039;&#039; (&#039;&#039;&#039;CoAP&#039;&#039;&#039;) is a specialized web transfer protocol, as defined in RFC 7252, for use with constrained nodes and constrained networks in the Internet of Things.&lt;br /&gt;
The protocol is designed for machine-to-machine (M2M) applications such as smart energy and building automation.&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
The work on Constrained Environments aims at realizing the REST architecture in a suitable form for the most constrained nodes and networks. The nodes usually consist of 8-bit microcontrollers with limited amounts of RAM and ROM.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
CoAP has the following main features:&lt;br /&gt;
&lt;br /&gt;
* Web protocol fulfilling M2M requirements in constrained environments&lt;br /&gt;
* UDP [RFC0768] binding with optional reliability supporting unicast and multicast requests&lt;br /&gt;
* Asynchronous message exchanges&lt;br /&gt;
* Low header overhead and parsing complexity&lt;br /&gt;
* URI and Content-type support&lt;br /&gt;
* Simple proxy and caching capabilities&lt;br /&gt;
* Stateless HTTP mapping&lt;br /&gt;
* Security binding to Datagram Transport Layer Security (DTLS)&lt;br /&gt;
&lt;br /&gt;
== The Protocol ==&lt;br /&gt;
&lt;br /&gt;
CoAP is similar to the client/server model of HTTP. M2M interactions typically result in a CoAP implementation acting in both client and server roles. A request is sent by a client to request an action on a resource (identified by a URI) on a server. The server then sends a response with a response code (equivalent to that of HTTP). Therefore, efficiency is very important, so CoAP uses UDP, a datagram-oriented transport.&lt;br /&gt;
&lt;br /&gt;
CoAP is however a single protocol, with messaging and request/response as just features of the CoAP header&lt;br /&gt;
&lt;br /&gt;
 +----------------------+&lt;br /&gt;
 |      Application     |&lt;br /&gt;
 +----------------------+&lt;br /&gt;
 +----------------------+  \&lt;br /&gt;
 |  Requests/Responses  |  |&lt;br /&gt;
 |----------------------|  | CoAP&lt;br /&gt;
 |       Messages       |  |&lt;br /&gt;
 +----------------------+  /&lt;br /&gt;
 +----------------------+&lt;br /&gt;
 |          UDP         |&lt;br /&gt;
 +----------------------+&lt;br /&gt;
&lt;br /&gt;
== Message Format ==&lt;br /&gt;
&lt;br /&gt;
By default, the messages are encoded in a simple binary format and transported over UDP. The message format starts with a fixed-size 4-byte header, followed by a variable-length Token value, which can be between 0 and 8 bytes long. Following the Token value comes a sequence of zero or more CoAP Options in Type-Length-Value (TLV) format, optionally followed by a payload that takes up the rest of the datagram.&lt;br /&gt;
&lt;br /&gt;
    0                   1                   2                   3&lt;br /&gt;
    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1&lt;br /&gt;
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+&lt;br /&gt;
   |Ver| T |  TKL  |      Code     |          Message ID           |&lt;br /&gt;
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+&lt;br /&gt;
   |   Token (if any, TKL bytes) ...&lt;br /&gt;
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+&lt;br /&gt;
   |   Options (if any) ...&lt;br /&gt;
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+&lt;br /&gt;
   |1 1 1 1 1 1 1 1|    Payload (if any) ...&lt;br /&gt;
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+&lt;br /&gt;
&lt;br /&gt;
;Version (Ver) (2 bits)&lt;br /&gt;
:Indicates the CoAP Version number. This must set this field to 1 (binary 01). Other values are reserved for future versions.&lt;br /&gt;
&lt;br /&gt;
;Type (T) (2 bits)&lt;br /&gt;
:Indicates if this message is of type Confirmable (0), Non-confirmable (1), Acknowledgement (2), or Reset (3).&lt;br /&gt;
&lt;br /&gt;
;Token Length (TKL) (4 bits)&lt;br /&gt;
:Indicates the length of the variable-length Token field, which may be 0-8 bytes in length.&lt;br /&gt;
&lt;br /&gt;
;CoAP Request/Response Code (8 bits)&lt;br /&gt;
:Splits into a 3-bit class and 5-bit detail.&lt;br /&gt;
&lt;br /&gt;
;Message ID (16 bits)&lt;br /&gt;
:Used to detect message duplication and to match messages of type Acknowledgement/Reset to messages of type Confirmable/Non-confirmable.&lt;br /&gt;
&lt;br /&gt;
== Security Considerations ==&lt;br /&gt;
&lt;br /&gt;
This section list some possible threats to the protocol. As CoAP realizes a subset of the features of HTTP/1.1, the security considerations in section 15 of RFC2616 are also pertinent to CoAP.&lt;br /&gt;
&lt;br /&gt;
Note:&amp;quot;NoSec&amp;quot; mode means that the system simply sends packets over normal UDP over IP and is indicated by the &amp;quot;coap&amp;quot; scheme and the CoAP default port.  The system is secured only by keeping attackers from being able to send or receive packets from the network with the CoAP nodes. There is no protocol-level security (DTLS is disabled).&lt;br /&gt;
&lt;br /&gt;
;Parsing the Protocol and Processing URI&#039;s&lt;br /&gt;
&lt;br /&gt;
The URI processing code in CoAP is likely to be a large source of vulnerabilities and should be implemented very carefully. Vulnerabilities include remotely crashing a node and remotely executing arbitrary code. CoAP aims to reduce the risk of these vulnerabilities by reducing parser complexity and moving much of the URI processing to the clients.&lt;br /&gt;
&lt;br /&gt;
;Proxying and Caching&lt;br /&gt;
&lt;br /&gt;
Proxies are man-in-the-middle by their nature. They can break any IPsec or DTLS protection that would otherwise happen between direct CoAP message exchange. Risks include the loss of confidentiality and availability. If the proxies also cache the threat to confidentiality and integrity of request/response data is amplified as CoAP does not implement cache-suppressing Cache-control as in HTTP/1.1.&lt;br /&gt;
For caching implementations any access control considerations also need to be applied to the value in the cache. A caching proxy must not make cache values available to requests that have lesser transport-security properties.&lt;br /&gt;
&lt;br /&gt;
;Risk of Amplification&lt;br /&gt;
&lt;br /&gt;
As CoAP server reply to request packets with response packets that may be significantly larger an attacker can use CoAP nodes to generate more traffic and use them in a denial-of-service(DoS) attack.  Turning a small attack packet into a larger one is called amplification. The attacker wants to overload a victim but is limited in the amount of traffic can use amplification to generate larger amounts. If a node that enables NoSec access becomes available to an attacker it can access victims on the general internet. UDP provides no way to verify the source address given in the request packet and an attacker can place the IP of the victim in the source address of a request packet to generate a larger packet directed at the victim. The risk is reduced however as constrained networks are only able to generate small amounts of traffic. In contrast the network itself with its limited capacity is a viable victim of an amplification attack. Large amplification factors should not be provided if the request is not authenticated. Also the slicing/blocking modes of CoAP [BLOCK] should be used for large resources. Because CoAP supports the use of multicast IP addresses in requests, CoAP servers should not accept multicast requests that can not be authenticated. Servers should limit the use of multicast requests as they can be a source of an accidental or deliberate DoS attack.&lt;br /&gt;
&lt;br /&gt;
;IP Address Spoofing&lt;br /&gt;
&lt;br /&gt;
As there is no handshake in UDP a rogue endpoint that can read and write messages can attack a single endpoint, a group of endpoints or the whole network. &lt;br /&gt;
&lt;br /&gt;
#Spoofing a Reset message in response to a message making an endpoint &amp;quot;deaf&amp;quot;&lt;br /&gt;
#Spoofing an ACK in response to a CON, preventing the sender of the CON from retransmitting to drown out the actual response&lt;br /&gt;
#Spoofing the entire response with forged payload/options, attacking a single endpoint or the supporting infrastructure&lt;br /&gt;
#Spoofing a multicast request for a target node resulting in network congestion or collapse due to a DoS attack on the victim, or forced wake-up from sleeping&lt;br /&gt;
#Spoofing observe messages&lt;br /&gt;
&lt;br /&gt;
Response spoofing can be mitigated by choosing a nontrivial, randomized token in the request. Other kinds of spoofing can only be detected by CoAP  if Confirmable message semantics are used and if one keeps track of Message ID&#039;s. A client can also attempt to overload a server by sending complex requests as the cost of a CON request is small. This can be used in a battery depletion attack or to make the server run out of resources for processing legitimate traffic. All these attacks can be prevented if a security mode other than NoSec is used.&lt;br /&gt;
&lt;br /&gt;
;Cross-Protocol Attacks&lt;br /&gt;
&lt;br /&gt;
Because a CoAP endpoint can be manipulated to send packets to a fake source address it can be used to attack a victim listening to UDP packets at a given IP address and port.&lt;br /&gt;
&lt;br /&gt;
#The attacker sends a message to a CoAP endpoint with the given address as the fake source address.&lt;br /&gt;
#The endpoint replies with a message to the source address.&lt;br /&gt;
#The victim receives a UDP packet that it interprets according to the rules of a different protocol.&lt;br /&gt;
&lt;br /&gt;
;Constrained Node Considerations&lt;br /&gt;
&lt;br /&gt;
Keys should be generated externally and added to the device during manufacturing or commissioning. Due to low processing power constrained nodes are susceptible to timing attacks. Cryptographic principles should be implemented with special care as many nodes are installed in exposed environments and have little resistance to tampering. The scope of credentials assigned to them should be considered carefully. A shared key assigned to a group of nodes may make any single node a target for subverting the entire group.&lt;br /&gt;
&lt;br /&gt;
== Implementations ==&lt;br /&gt;
&lt;br /&gt;
Generic implementations are becoming available for a variety of platforms. Implementations for constrained devices are typically written in C. CoAP is also used between them and more powerful systems such as cloud servers, home centrals, smartphones:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Programming Language !! Client/Server !! License !! Link&lt;br /&gt;
|-&lt;br /&gt;
| Erbium for Contiki || C || Client + Server || 3-clause BSD || http://www.contiki-os.org/&lt;br /&gt;
|-&lt;br /&gt;
| libcoap || C || Client + Server || BSD/GPL || https://libcoap.net/&lt;br /&gt;
|-&lt;br /&gt;
| Eclipse tinydtls || C || Client + Server || EPL+EDL || https://projects.eclipse.org/projects/iot.tinydtls&lt;br /&gt;
|-&lt;br /&gt;
| LibNyoci || C || Client + Server || MIT || https://github.com/darconeous/libnyoci&lt;br /&gt;
|-&lt;br /&gt;
| microcoap || C || Client + Server || MIT || https://github.com/1248/microcoap&lt;br /&gt;
|-&lt;br /&gt;
| cantcoap ||  C++/C || Client + Server || BSD || https://github.com/staropram/cantcoap&lt;br /&gt;
|-&lt;br /&gt;
| Lobaro CoAP || C || Client + Server || MIT || https://www.lobaro.com/portfolio/lobaro-coap/&lt;br /&gt;
|-&lt;br /&gt;
| MR-CoAP || Java ||     || BSD || https://github.com/MR-CoAP/CoAP&lt;br /&gt;
|-&lt;br /&gt;
| Wakaama || C || Client + Server || EPL+EDL || https://www.eclipse.org/wakaama/index.html&lt;br /&gt;
|-&lt;br /&gt;
| coap-node || Javascript || Client || MIT || https://github.com/PeterEB/coap-node&lt;br /&gt;
|-&lt;br /&gt;
| coap-shepherd || Javascript || Server || MIT || https://github.com/PeterEB/coap-shepherd&lt;br /&gt;
|-&lt;br /&gt;
| Californium || Java || Client + Server || EPL+EDL || https://www.eclipse.org/californium&lt;br /&gt;
|-&lt;br /&gt;
| nCoap || Java || Client + Server || BSD || https://github.com/okleine/nCoAP&lt;br /&gt;
|-&lt;br /&gt;
| leshan || Java || Client + Server || EPL+EDL || https://github.com/eclipse/leshan&lt;br /&gt;
|-&lt;br /&gt;
| CoAP.NET || C# || Client + Server || 3-clause BSD || https://github.com/smeshlink/CoAP.NET&lt;br /&gt;
|-&lt;br /&gt;
| CoAPSharp ||  C#, .NET || Client + Server || LGPL || http://www.coapsharp.com&lt;br /&gt;
|-&lt;br /&gt;
| Waher.Networking.CoAP || C# || Server || || https://github.com/PeterWaher/IoTGateway&lt;br /&gt;
|-&lt;br /&gt;
| gen_coap || Erlang || Client + Server || MPL v1.1 || https://github.com/gotthardp/gen_coap&lt;br /&gt;
|-&lt;br /&gt;
| go-coap || Go || Client + Server || MIT || https://github.com/go-ocf/go-coap&lt;br /&gt;
|-&lt;br /&gt;
| node-coap || Javascript || Client + Server || MIT || https://github.com/mcollina/node-coap&lt;br /&gt;
|-&lt;br /&gt;
| coap-cli || Javascript  || || MIT || https://github.com/mcollina/coap-cli&lt;br /&gt;
|-&lt;br /&gt;
| txThings || Python (Twisted) || Client + Server || MIT || https://github.com/mwasilak/txThings&lt;br /&gt;
|-&lt;br /&gt;
| aiocoap || Python 3 || Client + Server ||  MIT || https://github.com/chrysn/aiocoap&lt;br /&gt;
|-&lt;br /&gt;
| CoAPthon || Python || Client + Server || MIT || https://github.com/Tanganelli/CoAPthon&lt;br /&gt;
|-&lt;br /&gt;
| Ruby coap || Ruby || Client || MIT || https://github.com/nning/coap&lt;br /&gt;
|-&lt;br /&gt;
| Ruby david || Ruby || Server || MIT || https://github.com/nning/david&lt;br /&gt;
|-&lt;br /&gt;
| coap-rs || Rust || Client + Server || MIT || https://github.com/Covertness/coap-rs&lt;br /&gt;
|-&lt;br /&gt;
| Copper || JavaScript (Browser Plugin) || Client || BSD || https://github.com/mkovatsc/Copper&lt;br /&gt;
|-&lt;br /&gt;
| iCoAP || Objective-C || Client ||  MIT || https://github.com/stuffrabbit/iCoAP&lt;br /&gt;
|-&lt;br /&gt;
| SwiftCoAP || Swift || Client + Server || MIT || https://github.com/stuffrabbit/SwiftCoAP&lt;br /&gt;
|-&lt;br /&gt;
| nCoap || Java || Client + Server || BSD || https://github.com/okleine/nCoAP&lt;br /&gt;
|-&lt;br /&gt;
| txThings || Python (Twisted) || Client + Server ||  MIT || https://github.com/mwasilak/txThings&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Courses ==&lt;br /&gt;
&lt;br /&gt;
* [[Vertiefendes Wahlfach-Projekt]] (2018)&lt;br /&gt;
* [[CoAP Chat Application for RIOT OS]]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
* RFC 7252: https://tools.ietf.org/html/rfc7252&lt;br /&gt;
* RFC 2616: https://www.ietf.org/rfc/rfc2616.txt&lt;br /&gt;
* CoAP: RFC 7252 Constrained Application Protocol https://coap.technology/&lt;br /&gt;
* Learning Internet of Things: https://www.oreilly.com/library/view/learning-internet-of/9781783553532/&lt;br /&gt;
&lt;br /&gt;
[[Category:Basic]]&lt;/div&gt;</summary>
		<author><name>Awolfsbauer</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=Constrained_Application_Protocol&amp;diff=1351</id>
		<title>Constrained Application Protocol</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=Constrained_Application_Protocol&amp;diff=1351"/>
		<updated>2019-04-09T13:52:22Z</updated>

		<summary type="html">&lt;p&gt;Awolfsbauer: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The &#039;&#039;&#039;Constrained Application Protocol&#039;&#039;&#039; (&#039;&#039;&#039;CoAP&#039;&#039;&#039;) is a specialized web transfer protocol, as defined in RFC 7252, for use with constrained nodes and constrained networks in the Internet of Things.&lt;br /&gt;
The protocol is designed for machine-to-machine (M2M) applications such as smart energy and building automation.&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
The work on Constrained Environments aims at realizing the REST architecture in a suitable form for the most constrained nodes and networks. The nodes usually consist of 8-bit microcontrollers with limited amounts of RAM and ROM.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
CoAP has the following main features:&lt;br /&gt;
&lt;br /&gt;
* Web protocol fulfilling M2M requirements in constrained environments&lt;br /&gt;
* UDP [RFC0768] binding with optional reliability supporting unicast and multicast requests&lt;br /&gt;
* Asynchronous message exchanges&lt;br /&gt;
* Low header overhead and parsing complexity&lt;br /&gt;
* URI and Content-type support&lt;br /&gt;
* Simple proxy and caching capabilities&lt;br /&gt;
* Stateless HTTP mapping&lt;br /&gt;
* Security binding to Datagram Transport Layer Security (DTLS)&lt;br /&gt;
&lt;br /&gt;
== The Protocol ==&lt;br /&gt;
&lt;br /&gt;
CoAP is similar to the client/server model of HTTP. M2M interactions typically result in a CoAP implementation acting in both client and server roles. A request is sent by a client to request an action on a resource (identified by a URI) on a server. The server then sends a response with a response code (equivalent to that of HTTP). Therefore, efficiency is very important, so CoAP uses UDP, a datagram-oriented transport.&lt;br /&gt;
&lt;br /&gt;
CoAP is however a single protocol, with messaging and request/response as just features of the CoAP header&lt;br /&gt;
&lt;br /&gt;
 +----------------------+&lt;br /&gt;
 |      Application     |&lt;br /&gt;
 +----------------------+&lt;br /&gt;
 +----------------------+  \&lt;br /&gt;
 |  Requests/Responses  |  |&lt;br /&gt;
 |----------------------|  | CoAP&lt;br /&gt;
 |       Messages       |  |&lt;br /&gt;
 +----------------------+  /&lt;br /&gt;
 +----------------------+&lt;br /&gt;
 |          UDP         |&lt;br /&gt;
 +----------------------+&lt;br /&gt;
&lt;br /&gt;
== Message Format ==&lt;br /&gt;
&lt;br /&gt;
By default, the messages are encoded in a simple binary format and transported over UDP. The message format starts with a fixed-size 4-byte header, followed by a variable-length Token value, which can be between 0 and 8 bytes long. Following the Token value comes a sequence of zero or more CoAP Options in Type-Length-Value (TLV) format, optionally followed by a payload that takes up the rest of the datagram.&lt;br /&gt;
&lt;br /&gt;
    0                   1                   2                   3&lt;br /&gt;
    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1&lt;br /&gt;
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+&lt;br /&gt;
   |Ver| T |  TKL  |      Code     |          Message ID           |&lt;br /&gt;
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+&lt;br /&gt;
   |   Token (if any, TKL bytes) ...&lt;br /&gt;
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+&lt;br /&gt;
   |   Options (if any) ...&lt;br /&gt;
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+&lt;br /&gt;
   |1 1 1 1 1 1 1 1|    Payload (if any) ...&lt;br /&gt;
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+&lt;br /&gt;
&lt;br /&gt;
;Version (Ver) (2 bits)&lt;br /&gt;
:Indicates the CoAP Version number. This must set this field to 1 (binary 01). Other values are reserved for future versions.&lt;br /&gt;
&lt;br /&gt;
;Type (T) (2 bits)&lt;br /&gt;
:Indicates if this message is of type Confirmable (0), Non-confirmable (1), Acknowledgement (2), or Reset (3).&lt;br /&gt;
&lt;br /&gt;
;Token Length (TKL) (4 bits)&lt;br /&gt;
:Indicates the length of the variable-length Token field, which may be 0-8 bytes in length.&lt;br /&gt;
&lt;br /&gt;
;CoAP Request/Response Code (8 bits)&lt;br /&gt;
:Splits into a 3-bit class and 5-bit detail.&lt;br /&gt;
&lt;br /&gt;
;Message ID (16 bits)&lt;br /&gt;
:Used to detect message duplication and to match messages of type Acknowledgement/Reset to messages of type Confirmable/Non-confirmable.&lt;br /&gt;
&lt;br /&gt;
== Security Considerations ==&lt;br /&gt;
&lt;br /&gt;
This section list some possible threats to the protocol. As CoAP realizes a subset of the features of HTTP/1.1, the security considerations in section 15 of RFC2616 are also pertinent to CoAP.&lt;br /&gt;
&lt;br /&gt;
;Parsing the Protocol and Processing URI&#039;s&lt;br /&gt;
&lt;br /&gt;
The URI processing code in CoAP is likely to be a large source of vulnerabilities and should be implemented very carefully. Vulnerabilities include remotely crashing a node and remotely executing arbitrary code. CoAP aims to reduce the risk of these vulnerabilities by reducing parser complexity and moving much of the URI processing to the clients.&lt;br /&gt;
&lt;br /&gt;
;Proxying and Caching&lt;br /&gt;
&lt;br /&gt;
Proxies are man-in-the-middle by their nature. They can break any IPsec or DTLS protection that would otherwise happen between direct CoAP message exchange. Risks include the loss of confidentiality and availability. If the proxies also cache the threat to confidentiality and integrity of request/response data is amplified as CoAP does not implement cache-suppressing Cache-control as in HTTP/1.1.&lt;br /&gt;
For caching implementations any access control considerations also need to be applied to the value in the cache. A caching proxy must not make cache values available to requests that have lesser transport-security properties.&lt;br /&gt;
&lt;br /&gt;
;Risk of Amplification&lt;br /&gt;
&lt;br /&gt;
As CoAP server reply to request packets with response packets that may be significantly larger an attacker can use CoAP nodes to generate more traffic and use them in a denial-of-service(DoS) attack.  Turning a small attack packet into a larger one is called amplification. The attacker wants to overload a victim but is limited in the amount of traffic can use amplification to generate larger amounts. If a node that enables NoSec access becomes available to an attacker it can access victims on the general internet. UDP provides no way to verify the source address given in the request packet and an attacker can place the IP of the victim in the source address of a request packet to generate a larger packet directed at the victim. The risk is reduced however as constrained networks are only able to generate small amounts of traffic. In contrast the network itself with its limited capacity is a viable victim of an amplification attack. Large amplification factors should not be provided if the request is not authenticated. Also the slicing/blocking modes of CoAP [BLOCK] should be used for large resources. Because CoAP supports the use of multicast IP addresses in requests, CoAP servers should not accept multicast requests that can not be authenticated. Servers should limit the use of multicast requests as they can be a source of an accidental or deliberate DoS attack.&lt;br /&gt;
&lt;br /&gt;
;IP Address Spoofing&lt;br /&gt;
&lt;br /&gt;
As there is no handshake in UDP a rogue endpoint that can read and write messages can attack a single endpoint, a group of endpoints or the whole network. &lt;br /&gt;
&lt;br /&gt;
#Spoofing a Reset message in response to a message making an endpoint &amp;quot;deaf&amp;quot;&lt;br /&gt;
#Spoofing an ACK in response to a CON, preventing the sender of the CON from retransmitting to drown out the actual response&lt;br /&gt;
#Spoofing the entire response with forged payload/options, attacking a single endpoint or the supporting infrastructure&lt;br /&gt;
#Spoofing a multicast request for a target node resulting in network congestion or collapse due to a DoS attack on the victim, or forced wake-up from sleeping&lt;br /&gt;
#Spoofing observe messages&lt;br /&gt;
&lt;br /&gt;
Response spoofing can be mitigated by choosing a nontrivial, randomized token in the request. Other kinds of spoofing can only be detected by CoAP  if Confirmable message semantics are used and if one keeps track of Message ID&#039;s. A client can also attempt to overload a server by sending complex requests as the cost of a CON request is small. This can be used in a battery depletion attack or to make the server run out of resources for processing legitimate traffic. All these attacks can be prevented if a security mode other than NoSec is used.&lt;br /&gt;
&lt;br /&gt;
;Cross-Protocol Attacks&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;Constrained Node Considerations&lt;br /&gt;
&lt;br /&gt;
Keys should be generated externally and added to the device during manufacturing or commissioning. Due to low processing power constrained nodes are susceptible to timing attacks. Cryptographic principles should be implemented with special care as many nodes are installed in exposed environments and have little resistance to tampering. The scope of credentials assigned to them should be considered carefully. A shared key assigned to a group of nodes may make any single node a target for subverting the entire group.&lt;br /&gt;
&lt;br /&gt;
== Implementations ==&lt;br /&gt;
&lt;br /&gt;
Generic implementations are becoming available for a variety of platforms. Implementations for constrained devices are typically written in C. CoAP is also used between them and more powerful systems such as cloud servers, home centrals, smartphones:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Programming Language !! Client/Server !! License !! Link&lt;br /&gt;
|-&lt;br /&gt;
| Erbium for Contiki || C || Client + Server || 3-clause BSD || http://www.contiki-os.org/&lt;br /&gt;
|-&lt;br /&gt;
| libcoap || C || Client + Server || BSD/GPL || https://libcoap.net/&lt;br /&gt;
|-&lt;br /&gt;
| Eclipse tinydtls || C || Client + Server || EPL+EDL || https://projects.eclipse.org/projects/iot.tinydtls&lt;br /&gt;
|-&lt;br /&gt;
| LibNyoci || C || Client + Server || MIT || https://github.com/darconeous/libnyoci&lt;br /&gt;
|-&lt;br /&gt;
| microcoap || C || Client + Server || MIT || https://github.com/1248/microcoap&lt;br /&gt;
|-&lt;br /&gt;
| cantcoap ||  C++/C || Client + Server || BSD || https://github.com/staropram/cantcoap&lt;br /&gt;
|-&lt;br /&gt;
| Lobaro CoAP || C || Client + Server || MIT || https://www.lobaro.com/portfolio/lobaro-coap/&lt;br /&gt;
|-&lt;br /&gt;
| MR-CoAP || Java ||     || BSD || https://github.com/MR-CoAP/CoAP&lt;br /&gt;
|-&lt;br /&gt;
| Wakaama || C || Client + Server || EPL+EDL || https://www.eclipse.org/wakaama/index.html&lt;br /&gt;
|-&lt;br /&gt;
| coap-node || Javascript || Client || MIT || https://github.com/PeterEB/coap-node&lt;br /&gt;
|-&lt;br /&gt;
| coap-shepherd || Javascript || Server || MIT || https://github.com/PeterEB/coap-shepherd&lt;br /&gt;
|-&lt;br /&gt;
| Californium || Java || Client + Server || EPL+EDL || https://www.eclipse.org/californium&lt;br /&gt;
|-&lt;br /&gt;
| nCoap || Java || Client + Server || BSD || https://github.com/okleine/nCoAP&lt;br /&gt;
|-&lt;br /&gt;
| leshan || Java || Client + Server || EPL+EDL || https://github.com/eclipse/leshan&lt;br /&gt;
|-&lt;br /&gt;
| CoAP.NET || C# || Client + Server || 3-clause BSD || https://github.com/smeshlink/CoAP.NET&lt;br /&gt;
|-&lt;br /&gt;
| CoAPSharp ||  C#, .NET || Client + Server || LGPL || http://www.coapsharp.com&lt;br /&gt;
|-&lt;br /&gt;
| Waher.Networking.CoAP || C# || Server || || https://github.com/PeterWaher/IoTGateway&lt;br /&gt;
|-&lt;br /&gt;
| gen_coap || Erlang || Client + Server || MPL v1.1 || https://github.com/gotthardp/gen_coap&lt;br /&gt;
|-&lt;br /&gt;
| go-coap || Go || Client + Server || MIT || https://github.com/go-ocf/go-coap&lt;br /&gt;
|-&lt;br /&gt;
| node-coap || Javascript || Client + Server || MIT || https://github.com/mcollina/node-coap&lt;br /&gt;
|-&lt;br /&gt;
| coap-cli || Javascript  || || MIT || https://github.com/mcollina/coap-cli&lt;br /&gt;
|-&lt;br /&gt;
| txThings || Python (Twisted) || Client + Server || MIT || https://github.com/mwasilak/txThings&lt;br /&gt;
|-&lt;br /&gt;
| aiocoap || Python 3 || Client + Server ||  MIT || https://github.com/chrysn/aiocoap&lt;br /&gt;
|-&lt;br /&gt;
| CoAPthon || Python || Client + Server || MIT || https://github.com/Tanganelli/CoAPthon&lt;br /&gt;
|-&lt;br /&gt;
| Ruby coap || Ruby || Client || MIT || https://github.com/nning/coap&lt;br /&gt;
|-&lt;br /&gt;
| Ruby david || Ruby || Server || MIT || https://github.com/nning/david&lt;br /&gt;
|-&lt;br /&gt;
| coap-rs || Rust || Client + Server || MIT || https://github.com/Covertness/coap-rs&lt;br /&gt;
|-&lt;br /&gt;
| Copper || JavaScript (Browser Plugin) || Client || BSD || https://github.com/mkovatsc/Copper&lt;br /&gt;
|-&lt;br /&gt;
| iCoAP || Objective-C || Client ||  MIT || https://github.com/stuffrabbit/iCoAP&lt;br /&gt;
|-&lt;br /&gt;
| SwiftCoAP || Swift || Client + Server || MIT || https://github.com/stuffrabbit/SwiftCoAP&lt;br /&gt;
|-&lt;br /&gt;
| nCoap || Java || Client + Server || BSD || https://github.com/okleine/nCoAP&lt;br /&gt;
|-&lt;br /&gt;
| txThings || Python (Twisted) || Client + Server ||  MIT || https://github.com/mwasilak/txThings&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Courses ==&lt;br /&gt;
&lt;br /&gt;
* [[Vertiefendes Wahlfach-Projekt]] (2018)&lt;br /&gt;
* [[CoAP Chat Application for RIOT OS]]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
* RFC 7252: https://tools.ietf.org/html/rfc7252&lt;br /&gt;
* RFC 2616: https://www.ietf.org/rfc/rfc2616.txt&lt;br /&gt;
* CoAP: RFC 7252 Constrained Application Protocol https://coap.technology/&lt;br /&gt;
* Learning Internet of Things: https://www.oreilly.com/library/view/learning-internet-of/9781783553532/&lt;br /&gt;
&lt;br /&gt;
[[Category:Basic]]&lt;/div&gt;</summary>
		<author><name>Awolfsbauer</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=Constrained_Application_Protocol&amp;diff=1350</id>
		<title>Constrained Application Protocol</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=Constrained_Application_Protocol&amp;diff=1350"/>
		<updated>2019-04-09T13:44:45Z</updated>

		<summary type="html">&lt;p&gt;Awolfsbauer: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The &#039;&#039;&#039;Constrained Application Protocol&#039;&#039;&#039; (&#039;&#039;&#039;CoAP&#039;&#039;&#039;) is a specialized web transfer protocol, as defined in RFC 7252, for use with constrained nodes and constrained networks in the Internet of Things.&lt;br /&gt;
The protocol is designed for machine-to-machine (M2M) applications such as smart energy and building automation.&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
The work on Constrained Environments aims at realizing the REST architecture in a suitable form for the most constrained nodes and networks. The nodes usually consist of 8-bit microcontrollers with limited amounts of RAM and ROM.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
CoAP has the following main features:&lt;br /&gt;
&lt;br /&gt;
* Web protocol fulfilling M2M requirements in constrained environments&lt;br /&gt;
* UDP [RFC0768] binding with optional reliability supporting unicast and multicast requests&lt;br /&gt;
* Asynchronous message exchanges&lt;br /&gt;
* Low header overhead and parsing complexity&lt;br /&gt;
* URI and Content-type support&lt;br /&gt;
* Simple proxy and caching capabilities&lt;br /&gt;
* Stateless HTTP mapping&lt;br /&gt;
* Security binding to Datagram Transport Layer Security (DTLS)&lt;br /&gt;
&lt;br /&gt;
== The Protocol ==&lt;br /&gt;
&lt;br /&gt;
CoAP is similar to the client/server model of HTTP. M2M interactions typically result in a CoAP implementation acting in both client and server roles. A request is sent by a client to request an action on a resource (identified by a URI) on a server. The server then sends a response with a response code (equivalent to that of HTTP). Therefore, efficiency is very important, so CoAP uses UDP, a datagram-oriented transport.&lt;br /&gt;
&lt;br /&gt;
CoAP is however a single protocol, with messaging and request/response as just features of the CoAP header&lt;br /&gt;
&lt;br /&gt;
 +----------------------+&lt;br /&gt;
 |      Application     |&lt;br /&gt;
 +----------------------+&lt;br /&gt;
 +----------------------+  \&lt;br /&gt;
 |  Requests/Responses  |  |&lt;br /&gt;
 |----------------------|  | CoAP&lt;br /&gt;
 |       Messages       |  |&lt;br /&gt;
 +----------------------+  /&lt;br /&gt;
 +----------------------+&lt;br /&gt;
 |          UDP         |&lt;br /&gt;
 +----------------------+&lt;br /&gt;
&lt;br /&gt;
== Message Format ==&lt;br /&gt;
&lt;br /&gt;
By default, the messages are encoded in a simple binary format and transported over UDP. The message format starts with a fixed-size 4-byte header, followed by a variable-length Token value, which can be between 0 and 8 bytes long. Following the Token value comes a sequence of zero or more CoAP Options in Type-Length-Value (TLV) format, optionally followed by a payload that takes up the rest of the datagram.&lt;br /&gt;
&lt;br /&gt;
    0                   1                   2                   3&lt;br /&gt;
    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1&lt;br /&gt;
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+&lt;br /&gt;
   |Ver| T |  TKL  |      Code     |          Message ID           |&lt;br /&gt;
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+&lt;br /&gt;
   |   Token (if any, TKL bytes) ...&lt;br /&gt;
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+&lt;br /&gt;
   |   Options (if any) ...&lt;br /&gt;
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+&lt;br /&gt;
   |1 1 1 1 1 1 1 1|    Payload (if any) ...&lt;br /&gt;
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+&lt;br /&gt;
&lt;br /&gt;
;Version (Ver) (2 bits)&lt;br /&gt;
:Indicates the CoAP Version number. This must set this field to 1 (binary 01). Other values are reserved for future versions.&lt;br /&gt;
&lt;br /&gt;
;Type (T) (2 bits)&lt;br /&gt;
:Indicates if this message is of type Confirmable (0), Non-confirmable (1), Acknowledgement (2), or Reset (3).&lt;br /&gt;
&lt;br /&gt;
;Token Length (TKL) (4 bits)&lt;br /&gt;
:Indicates the length of the variable-length Token field, which may be 0-8 bytes in length.&lt;br /&gt;
&lt;br /&gt;
;CoAP Request/Response Code (8 bits)&lt;br /&gt;
:Splits into a 3-bit class and 5-bit detail.&lt;br /&gt;
&lt;br /&gt;
;Message ID (16 bits)&lt;br /&gt;
:Used to detect message duplication and to match messages of type Acknowledgement/Reset to messages of type Confirmable/Non-confirmable.&lt;br /&gt;
&lt;br /&gt;
== Security Considerations ==&lt;br /&gt;
&lt;br /&gt;
This section list some possible threats to the protocol. As CoAP realizes a subset of the features of HTTP/1.1, the security considerations in section 15 of RFC2616 are also pertinent to CoAP.&lt;br /&gt;
&lt;br /&gt;
;Parsing the Protocol and Processing URI&#039;s&lt;br /&gt;
&lt;br /&gt;
The URI processing code in CoAP is likely to be a large source of vulnerabilities and should be implemented very carefully. Vulnerabilities include remotely crashing a node and remotely executing arbitrary code. CoAP aims to reduce the risk of these vulnerabilities by reducing parser complexity and moving much of the URI processing to the clients.&lt;br /&gt;
&lt;br /&gt;
;Proxying and Caching&lt;br /&gt;
&lt;br /&gt;
Proxies are man-in-the-middle by their nature. They can break any IPsec or DTLS protection that would otherwise happen between direct CoAP message exchange. Risks include the loss of confidentiality and availability. If the proxies also cache the threat to confidentiality and integrity of request/response data is amplified as CoAP does not implement cache-suppressing Cache-control as in HTTP/1.1.&lt;br /&gt;
For caching implementations any access control considerations also need to be applied to the value in the cache. A caching proxy must not make cache values available to requests that have lesser transport-security properties.&lt;br /&gt;
&lt;br /&gt;
;Risk of Amplification&lt;br /&gt;
&lt;br /&gt;
As CoAP server reply to request packets with response packets that may be significantly larger an attacker can use CoAP nodes to generate more traffic and use them in a denial-of-service(DoS) attack.  Turning a small attack packet into a larger one is called amplification. The attacker wants to overload a victim but is limited in the amount of traffic can use amplification to generate larger amounts. If a node that enables NoSec access becomes available to an attacker it can access victims on the general internet. UDP provides no way to verify the source address given in the request packet and an attacker can place the IP of the victim in the source address of a request packet to generate a larger packet directed at the victim. The risk is reduced however as constrained networks are only able to generate small amounts of traffic. In contrast the network itself with its limited capacity is a viable victim of an amplification attack. Large amplification factors should not be provided if the request is not authenticated. Also the slicing/blocking modes of CoAP [BLOCK] should be used for large resources. Because CoAP supports the use of multicast IP addresses in requests, CoAP servers should not accept multicast requests that can not be authenticated. Servers should limit the use of multicast requests as they can be a source of an accidental or deliberate DoS attack.&lt;br /&gt;
&lt;br /&gt;
;IP Address Spoofing&lt;br /&gt;
&lt;br /&gt;
As there is no handshake in UDP a rogue endpoint that can read and write messages can attack a single endpoint, a group of endpoints or the whole network.&lt;br /&gt;
&lt;br /&gt;
Response spoofing can be mitigated by choosing a nontrivial, randomized token in the request. Other kinds of spoofing can only be detected by CoAP  if Confirmable message semantics are used and if one keeps track of Message ID&#039;s. A client can also attempt to overload a server by sending complex requests as the cost of a CON request is small. This can be used in a battery depletion attack or to make the server run out of resources for processing legitimate traffic. All these attacks can be prevented if a security mode other than NoSec is used.&lt;br /&gt;
&lt;br /&gt;
;Cross-Protocol Attacks&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;Constrained Node Considerations&lt;br /&gt;
&lt;br /&gt;
Keys should be generated externally and added to the device during manufacturing or commissioning. Due to low processing power constrained nodes are susceptible to timing attacks. Cryptographic principles should be implemented with special care as many nodes are installed in exposed environments and have little resistance to tampering. The scope of credentials assigned to them should be considered carefully. A shared key assigned to a group of nodes may make any single node a target for subverting the entire group.&lt;br /&gt;
&lt;br /&gt;
== Implementations ==&lt;br /&gt;
&lt;br /&gt;
Generic implementations are becoming available for a variety of platforms. Implementations for constrained devices are typically written in C. CoAP is also used between them and more powerful systems such as cloud servers, home centrals, smartphones:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Programming Language !! Client/Server !! License !! Link&lt;br /&gt;
|-&lt;br /&gt;
| Erbium for Contiki || C || Client + Server || 3-clause BSD || http://www.contiki-os.org/&lt;br /&gt;
|-&lt;br /&gt;
| libcoap || C || Client + Server || BSD/GPL || https://libcoap.net/&lt;br /&gt;
|-&lt;br /&gt;
| Eclipse tinydtls || C || Client + Server || EPL+EDL || https://projects.eclipse.org/projects/iot.tinydtls&lt;br /&gt;
|-&lt;br /&gt;
| LibNyoci || C || Client + Server || MIT || https://github.com/darconeous/libnyoci&lt;br /&gt;
|-&lt;br /&gt;
| microcoap || C || Client + Server || MIT || https://github.com/1248/microcoap&lt;br /&gt;
|-&lt;br /&gt;
| cantcoap ||  C++/C || Client + Server || BSD || https://github.com/staropram/cantcoap&lt;br /&gt;
|-&lt;br /&gt;
| Lobaro CoAP || C || Client + Server || MIT || https://www.lobaro.com/portfolio/lobaro-coap/&lt;br /&gt;
|-&lt;br /&gt;
| MR-CoAP || Java ||     || BSD || https://github.com/MR-CoAP/CoAP&lt;br /&gt;
|-&lt;br /&gt;
| Wakaama || C || Client + Server || EPL+EDL || https://www.eclipse.org/wakaama/index.html&lt;br /&gt;
|-&lt;br /&gt;
| coap-node || Javascript || Client || MIT || https://github.com/PeterEB/coap-node&lt;br /&gt;
|-&lt;br /&gt;
| coap-shepherd || Javascript || Server || MIT || https://github.com/PeterEB/coap-shepherd&lt;br /&gt;
|-&lt;br /&gt;
| Californium || Java || Client + Server || EPL+EDL || https://www.eclipse.org/californium&lt;br /&gt;
|-&lt;br /&gt;
| nCoap || Java || Client + Server || BSD || https://github.com/okleine/nCoAP&lt;br /&gt;
|-&lt;br /&gt;
| leshan || Java || Client + Server || EPL+EDL || https://github.com/eclipse/leshan&lt;br /&gt;
|-&lt;br /&gt;
| CoAP.NET || C# || Client + Server || 3-clause BSD || https://github.com/smeshlink/CoAP.NET&lt;br /&gt;
|-&lt;br /&gt;
| CoAPSharp ||  C#, .NET || Client + Server || LGPL || http://www.coapsharp.com&lt;br /&gt;
|-&lt;br /&gt;
| Waher.Networking.CoAP || C# || Server || || https://github.com/PeterWaher/IoTGateway&lt;br /&gt;
|-&lt;br /&gt;
| gen_coap || Erlang || Client + Server || MPL v1.1 || https://github.com/gotthardp/gen_coap&lt;br /&gt;
|-&lt;br /&gt;
| go-coap || Go || Client + Server || MIT || https://github.com/go-ocf/go-coap&lt;br /&gt;
|-&lt;br /&gt;
| node-coap || Javascript || Client + Server || MIT || https://github.com/mcollina/node-coap&lt;br /&gt;
|-&lt;br /&gt;
| coap-cli || Javascript  || || MIT || https://github.com/mcollina/coap-cli&lt;br /&gt;
|-&lt;br /&gt;
| txThings || Python (Twisted) || Client + Server || MIT || https://github.com/mwasilak/txThings&lt;br /&gt;
|-&lt;br /&gt;
| aiocoap || Python 3 || Client + Server ||  MIT || https://github.com/chrysn/aiocoap&lt;br /&gt;
|-&lt;br /&gt;
| CoAPthon || Python || Client + Server || MIT || https://github.com/Tanganelli/CoAPthon&lt;br /&gt;
|-&lt;br /&gt;
| Ruby coap || Ruby || Client || MIT || https://github.com/nning/coap&lt;br /&gt;
|-&lt;br /&gt;
| Ruby david || Ruby || Server || MIT || https://github.com/nning/david&lt;br /&gt;
|-&lt;br /&gt;
| coap-rs || Rust || Client + Server || MIT || https://github.com/Covertness/coap-rs&lt;br /&gt;
|-&lt;br /&gt;
| Copper || JavaScript (Browser Plugin) || Client || BSD || https://github.com/mkovatsc/Copper&lt;br /&gt;
|-&lt;br /&gt;
| iCoAP || Objective-C || Client ||  MIT || https://github.com/stuffrabbit/iCoAP&lt;br /&gt;
|-&lt;br /&gt;
| SwiftCoAP || Swift || Client + Server || MIT || https://github.com/stuffrabbit/SwiftCoAP&lt;br /&gt;
|-&lt;br /&gt;
| nCoap || Java || Client + Server || BSD || https://github.com/okleine/nCoAP&lt;br /&gt;
|-&lt;br /&gt;
| txThings || Python (Twisted) || Client + Server ||  MIT || https://github.com/mwasilak/txThings&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Courses ==&lt;br /&gt;
&lt;br /&gt;
* [[Vertiefendes Wahlfach-Projekt]] (2018)&lt;br /&gt;
* [[CoAP Chat Application for RIOT OS]]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
* RFC 7252: https://tools.ietf.org/html/rfc7252&lt;br /&gt;
* RFC 2616: https://www.ietf.org/rfc/rfc2616.txt&lt;br /&gt;
* CoAP: RFC 7252 Constrained Application Protocol https://coap.technology/&lt;br /&gt;
* Learning Internet of Things: https://www.oreilly.com/library/view/learning-internet-of/9781783553532/&lt;br /&gt;
&lt;br /&gt;
[[Category:Basic]]&lt;/div&gt;</summary>
		<author><name>Awolfsbauer</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=Constrained_Application_Protocol&amp;diff=1347</id>
		<title>Constrained Application Protocol</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=Constrained_Application_Protocol&amp;diff=1347"/>
		<updated>2019-04-01T19:14:34Z</updated>

		<summary type="html">&lt;p&gt;Awolfsbauer: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The &#039;&#039;&#039;Constrained Application Protocol&#039;&#039;&#039; (&#039;&#039;&#039;CoAP&#039;&#039;&#039;) is a specialized web transfer protocol, as defined in RFC 7252, for use with constrained nodes and constrained networks in the Internet of Things.&lt;br /&gt;
The protocol is designed for machine-to-machine (M2M) applications such as smart energy and building automation.&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
The work on Constrained Environments aims at realizing the REST architecture in a suitable form for the most constrained nodes and networks. The nodes usually consist of 8-bit microcontrollers with limited amounts of RAM and ROM.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
CoAP has the following main features:&lt;br /&gt;
&lt;br /&gt;
* Web protocol fulfilling M2M requirements in constrained environments&lt;br /&gt;
* UDP [RFC0768] binding with optional reliability supporting unicast and multicast requests&lt;br /&gt;
* Asynchronous message exchanges&lt;br /&gt;
* Low header overhead and parsing complexity&lt;br /&gt;
* URI and Content-type support&lt;br /&gt;
* Simple proxy and caching capabilities&lt;br /&gt;
* Stateless HTTP mapping&lt;br /&gt;
* Security binding to Datagram Transport Layer Security (DTLS)&lt;br /&gt;
&lt;br /&gt;
== The Protocol ==&lt;br /&gt;
&lt;br /&gt;
CoAP is similar to the client/server model of HTTP. M2M interactions typically result in a CoAP implementation acting in both client and server roles. A request is sent by a client to request an action on a resource (identified by a URI) on a server. The server then sends a response with a response code (equivalent to that of HTTP). Therefore, efficiency is very important, so CoAP uses UDP, a datagram-oriented transport.&lt;br /&gt;
&lt;br /&gt;
CoAP is however a single protocol, with messaging and request/response as just features of the CoAP header&lt;br /&gt;
&lt;br /&gt;
 +----------------------+&lt;br /&gt;
 |      Application     |&lt;br /&gt;
 +----------------------+&lt;br /&gt;
 +----------------------+  \&lt;br /&gt;
 |  Requests/Responses  |  |&lt;br /&gt;
 |----------------------|  | CoAP&lt;br /&gt;
 |       Messages       |  |&lt;br /&gt;
 +----------------------+  /&lt;br /&gt;
 +----------------------+&lt;br /&gt;
 |          UDP         |&lt;br /&gt;
 +----------------------+&lt;br /&gt;
&lt;br /&gt;
== Message Format ==&lt;br /&gt;
&lt;br /&gt;
By default, the messages are encoded in a simple binary format and transported over UDP. The message format starts with a fixed-size 4-byte header, followed by a variable-length Token value, which can be between 0 and 8 bytes long. Following the Token value comes a sequence of zero or more CoAP Options in Type-Length-Value (TLV) format, optionally followed by a payload that takes up the rest of the datagram.&lt;br /&gt;
&lt;br /&gt;
    0                   1                   2                   3&lt;br /&gt;
    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1&lt;br /&gt;
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+&lt;br /&gt;
   |Ver| T |  TKL  |      Code     |          Message ID           |&lt;br /&gt;
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+&lt;br /&gt;
   |   Token (if any, TKL bytes) ...&lt;br /&gt;
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+&lt;br /&gt;
   |   Options (if any) ...&lt;br /&gt;
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+&lt;br /&gt;
   |1 1 1 1 1 1 1 1|    Payload (if any) ...&lt;br /&gt;
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+&lt;br /&gt;
&lt;br /&gt;
;Version (Ver) (2 bits)&lt;br /&gt;
:Indicates the CoAP Version number. This must set this field to 1 (binary 01). Other values are reserved for future versions.&lt;br /&gt;
&lt;br /&gt;
;Type (T) (2 bits)&lt;br /&gt;
:Indicates if this message is of type Confirmable (0), Non-confirmable (1), Acknowledgement (2), or Reset (3).&lt;br /&gt;
&lt;br /&gt;
;Token Length (TKL) (4 bits)&lt;br /&gt;
:Indicates the length of the variable-length Token field, which may be 0-8 bytes in length.&lt;br /&gt;
&lt;br /&gt;
;CoAP Request/Response Code (8 bits)&lt;br /&gt;
:Splits into a 3-bit class and 5-bit detail.&lt;br /&gt;
&lt;br /&gt;
;Message ID (16 bits)&lt;br /&gt;
:Used to detect message duplication and to match messages of type Acknowledgement/Reset to messages of type Confirmable/Non-confirmable.&lt;br /&gt;
&lt;br /&gt;
== Security Considerations ==&lt;br /&gt;
&lt;br /&gt;
This section list some possible threats to the protocol. As CoAP realizes a subset of the features of HTTP/1.1, the security considerations in section 15 of RFC2616 are also pertinent to CoAP.&lt;br /&gt;
&lt;br /&gt;
;Parsing the Protocol and Processing URI&#039;s&lt;br /&gt;
&lt;br /&gt;
The URI processing code in CoAP is likely to be a large source of vulnerabilities and should be implemented very carefully. Vulnerabilities include remotely crashing a node and remotely executing arbitrary code. CoAP aims to reduce the risk of these vulnerabilities by reducing parser complexity and moving much of the URI processing to the clients.&lt;br /&gt;
&lt;br /&gt;
;Proxying and Caching&lt;br /&gt;
&lt;br /&gt;
Proxies are man-in-the-middle by their nature. They can break any IPsec or DTLS protection that would otherwise happen between direct CoAP message exchange. Risks include the loss of confidentiality and availability. If the proxies also cache the threat to confidentiality and integrity of request/response data is amplified as CoAP does not implement cache-suppressing Cache-control as in HTTP/1.1.&lt;br /&gt;
For caching implementations any access control considerations also need to be applied to the value in the cache. A caching proxy must not make cache values available to requests that have lesser transport-security properties.&lt;br /&gt;
&lt;br /&gt;
;Risk of Amplification&lt;br /&gt;
&lt;br /&gt;
As CoAP server reply to request packets with response packets that may be significantly larger an attacker can use CoAP nodes to generate more traffic and use them in a denial-of-service(DoS) attack.  Turning a small attack packet into a larger one is called amplification. The attacker wants to overload a victim but is limited in the amount of traffic can use amplification to generate larger amounts. If a node that enables NoSec access becomes available to an attacker it can access victims on the general internet. UDP provides no way to verify the source address given in the request packet and an attacker can place the IP of the victim in the source address of a request packet to generate a larger packet directed at the victim. The risk is reduced however as constrained networks are only able to generate small amounts of traffic. In contrast the network itself with its limited capacity is a viable victim of an amplification attack. Large amplification factors should not be provided if the request is not authenticated. Also the slicing/blocking modes of CoAP [BLOCK] should be used for large resources.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;IP Address Spoofing&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;Cross-Protocol Attacks&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;Constrained Node Considerations&lt;br /&gt;
&lt;br /&gt;
Keys should be generated externally and added to the device during manufacturing or commissioning. Due to low processing power constrained nodes are susceptible to timing attacks. Cryptographic principles should be implemented with special care as many nodes are installed in exposed environments and have little resistance to tampering. The scope of credentials assigned to them should be considered carefully. A shared key assigned to a group of nodes may make any single node a target for subverting the entire group.&lt;br /&gt;
&lt;br /&gt;
== Implementations ==&lt;br /&gt;
&lt;br /&gt;
Generic implementations are becoming available for a variety of platforms. Implementations for constrained devices are typically written in C. CoAP is also used between them and more powerful systems such as cloud servers, home centrals, smartphones:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Programming Language !! Client/Server !! License !! Link&lt;br /&gt;
|-&lt;br /&gt;
| Erbium for Contiki || C || Client + Server || 3-clause BSD || http://www.contiki-os.org/&lt;br /&gt;
|-&lt;br /&gt;
| libcoap || C || Client + Server || BSD/GPL || https://libcoap.net/&lt;br /&gt;
|-&lt;br /&gt;
| Eclipse tinydtls || C || Client + Server || EPL+EDL || https://projects.eclipse.org/projects/iot.tinydtls&lt;br /&gt;
|-&lt;br /&gt;
| LibNyoci || C || Client + Server || MIT || https://github.com/darconeous/libnyoci&lt;br /&gt;
|-&lt;br /&gt;
| microcoap || C || Client + Server || MIT || https://github.com/1248/microcoap&lt;br /&gt;
|-&lt;br /&gt;
| cantcoap ||  C++/C || Client + Server || BSD || https://github.com/staropram/cantcoap&lt;br /&gt;
|-&lt;br /&gt;
| Lobaro CoAP || C || Client + Server || MIT || https://www.lobaro.com/portfolio/lobaro-coap/&lt;br /&gt;
|-&lt;br /&gt;
| MR-CoAP || Java ||     || BSD || https://github.com/MR-CoAP/CoAP&lt;br /&gt;
|-&lt;br /&gt;
| Wakaama || C || Client + Server || EPL+EDL || https://www.eclipse.org/wakaama/index.html&lt;br /&gt;
|-&lt;br /&gt;
| coap-node || Javascript || Client || MIT || https://github.com/PeterEB/coap-node&lt;br /&gt;
|-&lt;br /&gt;
| coap-shepherd || Javascript || Server || MIT || https://github.com/PeterEB/coap-shepherd&lt;br /&gt;
|-&lt;br /&gt;
| Californium || Java || Client + Server || EPL+EDL || https://www.eclipse.org/californium&lt;br /&gt;
|-&lt;br /&gt;
| nCoap || Java || Client + Server || BSD || https://github.com/okleine/nCoAP&lt;br /&gt;
|-&lt;br /&gt;
| leshan || Java || Client + Server || EPL+EDL || https://github.com/eclipse/leshan&lt;br /&gt;
|-&lt;br /&gt;
| CoAP.NET || C# || Client + Server || 3-clause BSD || https://github.com/smeshlink/CoAP.NET&lt;br /&gt;
|-&lt;br /&gt;
| CoAPSharp ||  C#, .NET || Client + Server || LGPL || http://www.coapsharp.com&lt;br /&gt;
|-&lt;br /&gt;
| Waher.Networking.CoAP || C# || Server || || https://github.com/PeterWaher/IoTGateway&lt;br /&gt;
|-&lt;br /&gt;
| gen_coap || Erlang || Client + Server || MPL v1.1 || https://github.com/gotthardp/gen_coap&lt;br /&gt;
|-&lt;br /&gt;
| go-coap || Go || Client + Server || MIT || https://github.com/go-ocf/go-coap&lt;br /&gt;
|-&lt;br /&gt;
| node-coap || Javascript || Client + Server || MIT || https://github.com/mcollina/node-coap&lt;br /&gt;
|-&lt;br /&gt;
| coap-cli || Javascript  || || MIT || https://github.com/mcollina/coap-cli&lt;br /&gt;
|-&lt;br /&gt;
| txThings || Python (Twisted) || Client + Server || MIT || https://github.com/mwasilak/txThings&lt;br /&gt;
|-&lt;br /&gt;
| aiocoap || Python 3 || Client + Server ||  MIT || https://github.com/chrysn/aiocoap&lt;br /&gt;
|-&lt;br /&gt;
| CoAPthon || Python || Client + Server || MIT || https://github.com/Tanganelli/CoAPthon&lt;br /&gt;
|-&lt;br /&gt;
| Ruby coap || Ruby || Client || MIT || https://github.com/nning/coap&lt;br /&gt;
|-&lt;br /&gt;
| Ruby david || Ruby || Server || MIT || https://github.com/nning/david&lt;br /&gt;
|-&lt;br /&gt;
| coap-rs || Rust || Client + Server || MIT || https://github.com/Covertness/coap-rs&lt;br /&gt;
|-&lt;br /&gt;
| Copper || JavaScript (Browser Plugin) || Client || BSD || https://github.com/mkovatsc/Copper&lt;br /&gt;
|-&lt;br /&gt;
| iCoAP || Objective-C || Client ||  MIT || https://github.com/stuffrabbit/iCoAP&lt;br /&gt;
|-&lt;br /&gt;
| SwiftCoAP || Swift || Client + Server || MIT || https://github.com/stuffrabbit/SwiftCoAP&lt;br /&gt;
|-&lt;br /&gt;
| nCoap || Java || Client + Server || BSD || https://github.com/okleine/nCoAP&lt;br /&gt;
|-&lt;br /&gt;
| txThings || Python (Twisted) || Client + Server ||  MIT || https://github.com/mwasilak/txThings&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Courses ==&lt;br /&gt;
&lt;br /&gt;
* [[Vertiefendes Wahlfach-Projekt]] (2018)&lt;br /&gt;
* [[CoAP Chat Application for RIOT OS]]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
* RFC 7252: https://tools.ietf.org/html/rfc7252&lt;br /&gt;
* RFC 2616: https://www.ietf.org/rfc/rfc2616.txt&lt;br /&gt;
* CoAP: RFC 7252 Constrained Application Protocol https://coap.technology/&lt;br /&gt;
* Learning Internet of Things: https://www.oreilly.com/library/view/learning-internet-of/9781783553532/&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;/div&gt;</summary>
		<author><name>Awolfsbauer</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=Constrained_Application_Protocol&amp;diff=1346</id>
		<title>Constrained Application Protocol</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=Constrained_Application_Protocol&amp;diff=1346"/>
		<updated>2019-04-01T19:05:04Z</updated>

		<summary type="html">&lt;p&gt;Awolfsbauer: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The &#039;&#039;&#039;Constrained Application Protocol&#039;&#039;&#039; (&#039;&#039;&#039;CoAP&#039;&#039;&#039;) is a specialized web transfer protocol, as defined in RFC 7252, for use with constrained nodes and constrained networks in the Internet of Things.&lt;br /&gt;
The protocol is designed for machine-to-machine (M2M) applications such as smart energy and building automation.&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
The work on Constrained Environments aims at realizing the REST architecture in a suitable form for the most constrained nodes and networks. The nodes usually consist of 8-bit microcontrollers with limited amounts of RAM and ROM.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
CoAP has the following main features:&lt;br /&gt;
&lt;br /&gt;
* Web protocol fulfilling M2M requirements in constrained environments&lt;br /&gt;
* UDP [RFC0768] binding with optional reliability supporting unicast and multicast requests&lt;br /&gt;
* Asynchronous message exchanges&lt;br /&gt;
* Low header overhead and parsing complexity&lt;br /&gt;
* URI and Content-type support&lt;br /&gt;
* Simple proxy and caching capabilities&lt;br /&gt;
* Stateless HTTP mapping&lt;br /&gt;
* Security binding to Datagram Transport Layer Security (DTLS)&lt;br /&gt;
&lt;br /&gt;
== The Protocol ==&lt;br /&gt;
&lt;br /&gt;
CoAP is similar to the client/server model of HTTP. M2M interactions typically result in a CoAP implementation acting in both client and server roles. A request is sent by a client to request an action on a resource (identified by a URI) on a server. The server then sends a response with a response code (equivalent to that of HTTP). Therefore, efficiency is very important, so CoAP uses UDP, a datagram-oriented transport.&lt;br /&gt;
&lt;br /&gt;
CoAP is however a single protocol, with messaging and request/response as just features of the CoAP header&lt;br /&gt;
&lt;br /&gt;
 +----------------------+&lt;br /&gt;
 |      Application     |&lt;br /&gt;
 +----------------------+&lt;br /&gt;
 +----------------------+  \&lt;br /&gt;
 |  Requests/Responses  |  |&lt;br /&gt;
 |----------------------|  | CoAP&lt;br /&gt;
 |       Messages       |  |&lt;br /&gt;
 +----------------------+  /&lt;br /&gt;
 +----------------------+&lt;br /&gt;
 |          UDP         |&lt;br /&gt;
 +----------------------+&lt;br /&gt;
&lt;br /&gt;
== Message Format ==&lt;br /&gt;
&lt;br /&gt;
By default, the messages are encoded in a simple binary format and transported over UDP. The message format starts with a fixed-size 4-byte header, followed by a variable-length Token value, which can be between 0 and 8 bytes long. Following the Token value comes a sequence of zero or more CoAP Options in Type-Length-Value (TLV) format, optionally followed by a payload that takes up the rest of the datagram.&lt;br /&gt;
&lt;br /&gt;
    0                   1                   2                   3&lt;br /&gt;
    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1&lt;br /&gt;
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+&lt;br /&gt;
   |Ver| T |  TKL  |      Code     |          Message ID           |&lt;br /&gt;
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+&lt;br /&gt;
   |   Token (if any, TKL bytes) ...&lt;br /&gt;
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+&lt;br /&gt;
   |   Options (if any) ...&lt;br /&gt;
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+&lt;br /&gt;
   |1 1 1 1 1 1 1 1|    Payload (if any) ...&lt;br /&gt;
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+&lt;br /&gt;
&lt;br /&gt;
;Version (Ver) (2 bits)&lt;br /&gt;
:Indicates the CoAP Version number. This must set this field to 1 (binary 01). Other values are reserved for future versions.&lt;br /&gt;
&lt;br /&gt;
;Type (T) (2 bits)&lt;br /&gt;
:Indicates if this message is of type Confirmable (0), Non-confirmable (1), Acknowledgement (2), or Reset (3).&lt;br /&gt;
&lt;br /&gt;
;Token Length (TKL) (4 bits)&lt;br /&gt;
:Indicates the length of the variable-length Token field, which may be 0-8 bytes in length.&lt;br /&gt;
&lt;br /&gt;
;CoAP Request/Response Code (8 bits)&lt;br /&gt;
:Splits into a 3-bit class and 5-bit detail.&lt;br /&gt;
&lt;br /&gt;
;Message ID (16 bits)&lt;br /&gt;
:Used to detect message duplication and to match messages of type Acknowledgement/Reset to messages of type Confirmable/Non-confirmable.&lt;br /&gt;
&lt;br /&gt;
== Security Considerations ==&lt;br /&gt;
&lt;br /&gt;
This section list some possible threats to the protocol. As CoAP realizes a subset of the features of HTTP/1.1, the security considerations in section 15 of RFC2616 are also pertinent to CoAP.&lt;br /&gt;
&lt;br /&gt;
;Parsing the Protocol and Processing URI&#039;s&lt;br /&gt;
&lt;br /&gt;
The URI processing code in CoAP is likely to be a large source of vulnerabilities and should be implemented very carefully. Vulnerabilities include remotely crashing a node and remotely executing arbitrary code. CoAP aims to reduce the risk of these vulnerabilities by reducing parser complexity and moving much of the URI processing to the clients.&lt;br /&gt;
&lt;br /&gt;
;Proxying and Caching&lt;br /&gt;
&lt;br /&gt;
Proxies are man-in-the-middle by their nature. They can break any IPsec or DTLS protection that would otherwise happen between direct CoAP message exchange. Risks include the loss of confidentiality and availability. If the proxies also cache the threat to confidentiality and integrity of request/response data is amplified as CoAP does not implement cache-suppressing Cache-control as in HTTP/1.1.&lt;br /&gt;
For caching implementations any access control considerations also need to be applied to the value in the cache. A caching proxy must not make cache values available to requests that have lesser transport-security properties.&lt;br /&gt;
&lt;br /&gt;
;Risk of Amplification&lt;br /&gt;
&lt;br /&gt;
As CoAP server reply to request packets with response packets that may be significantly larger an attacker can use CoAP nodes to generate more traffic and use them in a denial-of-service(DoS) attack.  Turning a small attack packet into a larger one is called amplification. The attacker wants to overload a victim but is limited in the amount of traffic can use amplification to generate larger amounts. If a node that enables NoSec access becomes available to an attacker it can access victims on the general internet. UDP provides no way to verify the source address given in the request packet and an attacker can place the IP of the victim in the source address of a request packet to generate a larger packet directed at the victim. The risk is reduced however as constrained networks are only able to generate small amounts of traffic. In contrast the network itself with its limited capacity is a viable victim of an amplification attack. RFC 7252 lists some things to avoid in implementation to reduce the risk and possibility of such attacks.&lt;br /&gt;
&lt;br /&gt;
;IP Address Spoofing&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;Cross-Protocol Attacks&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;Constrained Node Considerations&lt;br /&gt;
&lt;br /&gt;
Keys should be generated externally and added to the device during manufacturing or commissioning. Due to low processing power constrained nodes are susceptible to timing attacks. Cryptographic principles should be implemented with special care as many nodes are installed in exposed environments and have little resistance to tampering. The scope of credentials assigned to them should be considered carefully. A shared key assigned to a group of nodes may make any single node a target for subverting the entire group.&lt;br /&gt;
&lt;br /&gt;
== Implementations ==&lt;br /&gt;
&lt;br /&gt;
Generic implementations are becoming available for a variety of platforms. Implementations for constrained devices are typically written in C. CoAP is also used between them and more powerful systems such as cloud servers, home centrals, smartphones:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Programming Language !! Client/Server !! License !! Link&lt;br /&gt;
|-&lt;br /&gt;
| Erbium for Contiki || C || Client + Server || 3-clause BSD || http://www.contiki-os.org/&lt;br /&gt;
|-&lt;br /&gt;
| libcoap || C || Client + Server || BSD/GPL || https://libcoap.net/&lt;br /&gt;
|-&lt;br /&gt;
| Eclipse tinydtls || C || Client + Server || EPL+EDL || https://projects.eclipse.org/projects/iot.tinydtls&lt;br /&gt;
|-&lt;br /&gt;
| LibNyoci || C || Client + Server || MIT || https://github.com/darconeous/libnyoci&lt;br /&gt;
|-&lt;br /&gt;
| microcoap || C || Client + Server || MIT || https://github.com/1248/microcoap&lt;br /&gt;
|-&lt;br /&gt;
| cantcoap ||  C++/C || Client + Server || BSD || https://github.com/staropram/cantcoap&lt;br /&gt;
|-&lt;br /&gt;
| Lobaro CoAP || C || Client + Server || MIT || https://www.lobaro.com/portfolio/lobaro-coap/&lt;br /&gt;
|-&lt;br /&gt;
| MR-CoAP || Java ||     || BSD || https://github.com/MR-CoAP/CoAP&lt;br /&gt;
|-&lt;br /&gt;
| Wakaama || C || Client + Server || EPL+EDL || https://www.eclipse.org/wakaama/index.html&lt;br /&gt;
|-&lt;br /&gt;
| coap-node || Javascript || Client || MIT || https://github.com/PeterEB/coap-node&lt;br /&gt;
|-&lt;br /&gt;
| coap-shepherd || Javascript || Server || MIT || https://github.com/PeterEB/coap-shepherd&lt;br /&gt;
|-&lt;br /&gt;
| Californium || Java || Client + Server || EPL+EDL || https://www.eclipse.org/californium&lt;br /&gt;
|-&lt;br /&gt;
| nCoap || Java || Client + Server || BSD || https://github.com/okleine/nCoAP&lt;br /&gt;
|-&lt;br /&gt;
| leshan || Java || Client + Server || EPL+EDL || https://github.com/eclipse/leshan&lt;br /&gt;
|-&lt;br /&gt;
| CoAP.NET || C# || Client + Server || 3-clause BSD || https://github.com/smeshlink/CoAP.NET&lt;br /&gt;
|-&lt;br /&gt;
| CoAPSharp ||  C#, .NET || Client + Server || LGPL || http://www.coapsharp.com&lt;br /&gt;
|-&lt;br /&gt;
| Waher.Networking.CoAP || C# || Server || || https://github.com/PeterWaher/IoTGateway&lt;br /&gt;
|-&lt;br /&gt;
| gen_coap || Erlang || Client + Server || MPL v1.1 || https://github.com/gotthardp/gen_coap&lt;br /&gt;
|-&lt;br /&gt;
| go-coap || Go || Client + Server || MIT || https://github.com/go-ocf/go-coap&lt;br /&gt;
|-&lt;br /&gt;
| node-coap || Javascript || Client + Server || MIT || https://github.com/mcollina/node-coap&lt;br /&gt;
|-&lt;br /&gt;
| coap-cli || Javascript  || || MIT || https://github.com/mcollina/coap-cli&lt;br /&gt;
|-&lt;br /&gt;
| txThings || Python (Twisted) || Client + Server || MIT || https://github.com/mwasilak/txThings&lt;br /&gt;
|-&lt;br /&gt;
| aiocoap || Python 3 || Client + Server ||  MIT || https://github.com/chrysn/aiocoap&lt;br /&gt;
|-&lt;br /&gt;
| CoAPthon || Python || Client + Server || MIT || https://github.com/Tanganelli/CoAPthon&lt;br /&gt;
|-&lt;br /&gt;
| Ruby coap || Ruby || Client || MIT || https://github.com/nning/coap&lt;br /&gt;
|-&lt;br /&gt;
| Ruby david || Ruby || Server || MIT || https://github.com/nning/david&lt;br /&gt;
|-&lt;br /&gt;
| coap-rs || Rust || Client + Server || MIT || https://github.com/Covertness/coap-rs&lt;br /&gt;
|-&lt;br /&gt;
| Copper || JavaScript (Browser Plugin) || Client || BSD || https://github.com/mkovatsc/Copper&lt;br /&gt;
|-&lt;br /&gt;
| iCoAP || Objective-C || Client ||  MIT || https://github.com/stuffrabbit/iCoAP&lt;br /&gt;
|-&lt;br /&gt;
| SwiftCoAP || Swift || Client + Server || MIT || https://github.com/stuffrabbit/SwiftCoAP&lt;br /&gt;
|-&lt;br /&gt;
| nCoap || Java || Client + Server || BSD || https://github.com/okleine/nCoAP&lt;br /&gt;
|-&lt;br /&gt;
| txThings || Python (Twisted) || Client + Server ||  MIT || https://github.com/mwasilak/txThings&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Courses ==&lt;br /&gt;
&lt;br /&gt;
* [[Vertiefendes Wahlfach-Projekt]] (2018)&lt;br /&gt;
* [[CoAP Chat Application for RIOT OS]]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
* RFC 7252: https://tools.ietf.org/html/rfc7252&lt;br /&gt;
* CoAP: RFC 7252 Constrained Application Protocol https://coap.technology/&lt;br /&gt;
* Learning Internet of Things: https://www.oreilly.com/library/view/learning-internet-of/9781783553532/&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;/div&gt;</summary>
		<author><name>Awolfsbauer</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=CoAP_Chat_Application_for_RIOT_OS&amp;diff=1332</id>
		<title>CoAP Chat Application for RIOT OS</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=CoAP_Chat_Application_for_RIOT_OS&amp;diff=1332"/>
		<updated>2019-03-26T16:15:46Z</updated>

		<summary type="html">&lt;p&gt;Awolfsbauer: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary == &lt;br /&gt;
&lt;br /&gt;
This documentation describes the setup and usage of a &lt;br /&gt;
[[Constrained Application Protocol | CoAP]]-based, chat application for the [https://riot-os.org/ RIOT] operating system.&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
* Operating system: [https://github.com/RIOT-OS/RIOT RIOT OS]&lt;br /&gt;
* Packages: https://git.fh-campuswien.ac.at/WP-ITS/riochat (Note: this package already includes RIOT OS)&lt;br /&gt;
* Hardware: a compatible MCU, a list is available [https://github.com/RIOT-OS/RIOT/wiki/RIOT-Platforms here]&lt;br /&gt;
 &lt;br /&gt;
In order to build and use this application, you need to install the tool chains used by RIOT. Tutorials on how to do that can be found in the official RIOT GitHub repository and the official documentation:&lt;br /&gt;
&lt;br /&gt;
* The [https://github.com/RIOT-OS/RIOT/wiki RIOT GitHub wiki] contains all the information to get started.&lt;br /&gt;
* A detailed step-by-step [https://github.com/RIOT-OS/Tutorials/blob/master/README.md Tutorial] is also available.&lt;br /&gt;
* The official [https://doc.riot-os.org/index.html RIOT Documentation].&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
&lt;br /&gt;
=== Step 1 ===&lt;br /&gt;
&lt;br /&gt;
Clone the repository from https://git.fh-campuswien.ac.at/WP-ITS/riochat and compile it on the board you are using with: &lt;br /&gt;
&lt;br /&gt;
 make BOARD= &#039;&#039;board name&#039;&#039; all&lt;br /&gt;
&lt;br /&gt;
alternatively you can compile it in native mode, i.e without using an evaluation board:&lt;br /&gt;
&lt;br /&gt;
 make BOARD=native all&lt;br /&gt;
&lt;br /&gt;
If you are using native mode, you will need to setup a [https://github.com/RIOT-OS/RIOT/wiki/Virtual-riot-network#your-first-topology-2-nodes-1-hop Virtual RIOT network] with at least two TAP devices, for communication between nodes. This can be achieved with the following script:&lt;br /&gt;
 &lt;br /&gt;
 RIOT/dist/tools/tapsetup/tapsetup -c 2&lt;br /&gt;
&lt;br /&gt;
Open a two terminals and run two nodes. The first with tap0 and the other with tap1.&lt;br /&gt;
&lt;br /&gt;
 make BOARD=native PORT=tap0 term&lt;br /&gt;
&lt;br /&gt;
 make BOARD=native PORT=tap1 term&lt;br /&gt;
&lt;br /&gt;
=== Step 2 ===&lt;br /&gt;
&lt;br /&gt;
After boot-up you can type &amp;lt;code&amp;gt;help&amp;lt;/code&amp;gt; to see a list of all available commands:&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; help&lt;br /&gt;
 help&lt;br /&gt;
 Command              Description&lt;br /&gt;
 ---------------------------------------&lt;br /&gt;
 server               Riot CoAP Server&lt;br /&gt;
 client               Riot CoAP Client&lt;br /&gt;
 s                    Riot CoAP Server&lt;br /&gt;
 c                    Riot CoAP Client&lt;br /&gt;
 reboot               Reboot the node&lt;br /&gt;
 ps                   Prints information about running threads.&lt;br /&gt;
 ping6                Ping via ICMPv6&lt;br /&gt;
 random_init          initializes the PRNG&lt;br /&gt;
 random_get           returns 32 bit of pseudo randomness&lt;br /&gt;
 nib                  Configure neighbor information base&lt;br /&gt;
 ifconfig             Configure network interfaces&lt;br /&gt;
&lt;br /&gt;
Run client on one board (or terminal for native) and server on another.&lt;br /&gt;
&lt;br /&gt;
=== Step 3 ===&lt;br /&gt;
&lt;br /&gt;
After starting a client on a node you are greeted with the following options:&lt;br /&gt;
&lt;br /&gt;
 Help Screen:&lt;br /&gt;
 Command            Parameters         Description&lt;br /&gt;
 ----------------------------------------------------------------------&lt;br /&gt;
 /discovery[/d]                        send broadcast to find server&lt;br /&gt;
 /connect[/c]                          connect to set server&lt;br /&gt;
 /list[/l]                             list discovered server&lt;br /&gt;
 /info[/i]                             get server info&lt;br /&gt;
 /setserver[/ss]    [serverid]         set server to serverid&lt;br /&gt;
 /setuser[/su]      [username]         set user to username&lt;br /&gt;
 /options[/o]                          show config&lt;br /&gt;
 /help[/h]                             this screen&lt;br /&gt;
 /exit[/e]                             exit RioChat, drop back to Shell&lt;br /&gt;
 ----------------------------------------------------------------------&lt;br /&gt;
 Just type to send messages, when you are connected.&lt;br /&gt;
&lt;br /&gt;
After setting a user with &amp;lt;code&amp;gt;/setuser&amp;lt;/code&amp;gt; you need to run &amp;lt;code&amp;gt;/discovery&amp;lt;/code&amp;gt; to send a broadcast to find the server. &amp;lt;code&amp;gt;/list&amp;lt;/code&amp;gt; shows you a list of discovered servers. Each server has a name a server address (IPv6) and an id. With &amp;lt;code&amp;gt;/setserver&amp;lt;/code&amp;gt; you can set the server id to your desired server and with &amp;lt;code&amp;gt;/connect&amp;lt;/code&amp;gt;, connect to it.&lt;br /&gt;
After you are connected you can type messages and send them to all clients that are connected to the server.&lt;br /&gt;
&lt;br /&gt;
== Used Hardware ==&lt;br /&gt;
&lt;br /&gt;
This project was realized with the [https://github.com/RIOT-OS/RIOT/wiki/Board:-SAMR21-xpro SAMR21-xpro] evaluation board by Atmel. It features the [https://www.microchip.com/wwwproducts/en/ATSAMR21G18A ATSAMR21G18A] SoC by Microchip. It contains an ARM® Cortex®-M0+ based 32-bit MCU with a 2.4GHz RF transceiver compliant with IEEE 802.15.4 standard.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* https://github.com/RIOT-OS&lt;br /&gt;
* https://doc.riot-os.org/index.html&lt;br /&gt;
* https://www.microchip.com/wwwproducts/en/ATSAMR21G18A&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;/div&gt;</summary>
		<author><name>Awolfsbauer</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=CoAP_Chat_Application_for_RIOT_OS&amp;diff=1331</id>
		<title>CoAP Chat Application for RIOT OS</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=CoAP_Chat_Application_for_RIOT_OS&amp;diff=1331"/>
		<updated>2019-03-26T16:10:46Z</updated>

		<summary type="html">&lt;p&gt;Awolfsbauer: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary == &lt;br /&gt;
&lt;br /&gt;
This documentation describes the setup and usage of a &lt;br /&gt;
[[Constrained Application Protocol | CoAP]]-based, chat application for the [https://riot-os.org/ RIOT] operating system.&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
* Operating system: [https://github.com/RIOT-OS/RIOT RIOT OS]&lt;br /&gt;
* Packages: https://git.fh-campuswien.ac.at/WP-ITS/riochat (Note: this package already includes RIOT OS)&lt;br /&gt;
* Hardware: a compatible MCU, a list is available [https://github.com/RIOT-OS/RIOT/wiki/RIOT-Platforms here]&lt;br /&gt;
 &lt;br /&gt;
In order to build and use this application, you need to install the tool chains used by RIOT. Tutorials on how to do that can be found in the official RIOT GitHub repository and the official documentation:&lt;br /&gt;
&lt;br /&gt;
* The [https://github.com/RIOT-OS/RIOT/wiki RIOT GitHub wiki] contains all the information to get started.&lt;br /&gt;
* A detailed step-by-step [https://github.com/RIOT-OS/Tutorials/blob/master/README.md Tutorial] is also available.&lt;br /&gt;
* The official [https://doc.riot-os.org/index.html RIOT Documentation].&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
&lt;br /&gt;
=== Step 1 ===&lt;br /&gt;
&lt;br /&gt;
Clone the repository from https://git.fh-campuswien.ac.at/WP-ITS/riochat and compile it on the board you are using with: &lt;br /&gt;
&lt;br /&gt;
 make BOARD= &#039;&#039;board name&#039;&#039; all&lt;br /&gt;
&lt;br /&gt;
alternatively you can compile it in native mode, i.e without using an evaluation board:&lt;br /&gt;
&lt;br /&gt;
 make BOARD=native all&lt;br /&gt;
&lt;br /&gt;
If you are using native mode, you will need to setup a [https://github.com/RIOT-OS/RIOT/wiki/Virtual-riot-network#your-first-topology-2-nodes-1-hop Virtual RIOT network] with at least two TAP devices, for communication between nodes. This can be achieved with the following script:&lt;br /&gt;
 &lt;br /&gt;
 RIOT/dist/tools/tapsetup/tapsetup -c 2&lt;br /&gt;
&lt;br /&gt;
Open a two terminals and run two nodes. The first with tap0 and the other with tap1.&lt;br /&gt;
&lt;br /&gt;
 make BOARD=native PORT=tap0 term&lt;br /&gt;
&lt;br /&gt;
 make BOARD=native PORT=tap1 term&lt;br /&gt;
&lt;br /&gt;
=== Step 2 ===&lt;br /&gt;
&lt;br /&gt;
After boot-up you can type &amp;lt;code&amp;gt;help&amp;lt;/code&amp;gt; to see a list of all available commands:&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; help&lt;br /&gt;
 help&lt;br /&gt;
 Command              Description&lt;br /&gt;
 ---------------------------------------&lt;br /&gt;
 server               Riot CoAP Server&lt;br /&gt;
 client               Riot CoAP Client&lt;br /&gt;
 s                    Riot CoAP Server&lt;br /&gt;
 c                    Riot CoAP Client&lt;br /&gt;
 reboot               Reboot the node&lt;br /&gt;
 ps                   Prints information about running threads.&lt;br /&gt;
 ping6                Ping via ICMPv6&lt;br /&gt;
 random_init          initializes the PRNG&lt;br /&gt;
 random_get           returns 32 bit of pseudo randomness&lt;br /&gt;
 nib                  Configure neighbor information base&lt;br /&gt;
 ifconfig             Configure network interfaces&lt;br /&gt;
&lt;br /&gt;
Run client on one board (or terminal for native) and server on another.&lt;br /&gt;
&lt;br /&gt;
=== Step 3 ===&lt;br /&gt;
&lt;br /&gt;
After starting a client on a node you are greeted with the following options:&lt;br /&gt;
&lt;br /&gt;
 Help Screen:&lt;br /&gt;
 Command            Parameters         Description&lt;br /&gt;
 ----------------------------------------------------------------------&lt;br /&gt;
 /discovery[/d]                        send broadcast to find server&lt;br /&gt;
 /connect[/c]                          connect to set server&lt;br /&gt;
 /list[/l]                             list discovered server&lt;br /&gt;
 /info[/i]                             get server info&lt;br /&gt;
 /setserver[/ss]    [serverid]         set server to serverid&lt;br /&gt;
 /setuser[/su]      [username]         set user to username&lt;br /&gt;
 /options[/o]                          show config&lt;br /&gt;
 /help[/h]                             this screen&lt;br /&gt;
 /exit[/e]                             exit RioChat, drop back to Shell&lt;br /&gt;
 ----------------------------------------------------------------------&lt;br /&gt;
 Just type to send messages, when you are connected.&lt;br /&gt;
&lt;br /&gt;
After setting a user with &amp;lt;code&amp;gt;/setuser&amp;lt;/code&amp;gt; you need to run &amp;lt;code&amp;gt;/discovery&amp;lt;/code&amp;gt; to send a broadcast to find the server. &amp;lt;code&amp;gt;/list&amp;lt;/code&amp;gt; shows you a list of discovered servers. Each server has a name a server address (IPv6) and an id. With &amp;lt;code&amp;gt;/setserver&amp;lt;/code&amp;gt; you can set the server id to your desired server and with &amp;lt;code&amp;gt;/connect&amp;lt;/code&amp;gt;, connect to it.&lt;br /&gt;
&lt;br /&gt;
== Used Hardware ==&lt;br /&gt;
&lt;br /&gt;
This project was realized with the [https://github.com/RIOT-OS/RIOT/wiki/Board:-SAMR21-xpro SAMR21-xpro] evaluation board by Atmel. It features the [https://www.microchip.com/wwwproducts/en/ATSAMR21G18A ATSAMR21G18A] SoC by Microchip. It contains an ARM® Cortex®-M0+ based 32-bit MCU with a 2.4GHz RF transceiver compliant with IEEE 802.15.4 standard.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* https://github.com/RIOT-OS&lt;br /&gt;
* https://doc.riot-os.org/index.html&lt;br /&gt;
* https://www.microchip.com/wwwproducts/en/ATSAMR21G18A&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;/div&gt;</summary>
		<author><name>Awolfsbauer</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=CoAP_Chat_Application_for_RIOT_OS&amp;diff=1330</id>
		<title>CoAP Chat Application for RIOT OS</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=CoAP_Chat_Application_for_RIOT_OS&amp;diff=1330"/>
		<updated>2019-03-26T16:03:53Z</updated>

		<summary type="html">&lt;p&gt;Awolfsbauer: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary == &lt;br /&gt;
&lt;br /&gt;
This documentation describes the setup and usage of a &lt;br /&gt;
[[Constrained Application Protocol | CoAP]]-based, chat application for the [https://riot-os.org/ RIOT] operating system.&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
* Operating system: [https://github.com/RIOT-OS/RIOT RIOT OS]&lt;br /&gt;
* Packages: https://git.fh-campuswien.ac.at/WP-ITS/riochat (Note: this package already includes RIOT OS)&lt;br /&gt;
* Hardware: a compatible MCU, a list is available [https://github.com/RIOT-OS/RIOT/wiki/RIOT-Platforms here]&lt;br /&gt;
 &lt;br /&gt;
In order to build and use this application, you need to install the tool chains used by RIOT. Tutorials on how to do that can be found in the official RIOT GitHub repository and the official documentation:&lt;br /&gt;
&lt;br /&gt;
* The [https://github.com/RIOT-OS/RIOT/wiki RIOT GitHub wiki] contains all the information to get started.&lt;br /&gt;
* A detailed step-by-step [https://github.com/RIOT-OS/Tutorials/blob/master/README.md Tutorial] is also available.&lt;br /&gt;
* The official [https://doc.riot-os.org/index.html RIOT Documentation].&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
&lt;br /&gt;
=== Step 1 ===&lt;br /&gt;
&lt;br /&gt;
Clone the repository from https://git.fh-campuswien.ac.at/WP-ITS/riochat and compile it on the board you are using with: &lt;br /&gt;
&lt;br /&gt;
 make BOARD= &#039;&#039;board name&#039;&#039; all&lt;br /&gt;
&lt;br /&gt;
alternatively you can compile it in native mode, i.e without using an evaluation board:&lt;br /&gt;
&lt;br /&gt;
 make BOARD=native all&lt;br /&gt;
&lt;br /&gt;
If you are using native mode, you will need to setup a [https://github.com/RIOT-OS/RIOT/wiki/Virtual-riot-network#your-first-topology-2-nodes-1-hop Virtual RIOT network] with at least two TAP devices, for communication between nodes. This can be achieved with the following script:&lt;br /&gt;
 &lt;br /&gt;
 RIOT/dist/tools/tapsetup/tapsetup -c 2&lt;br /&gt;
&lt;br /&gt;
Open a two terminals and run two nodes. The first with tap0 and the other with tap1.&lt;br /&gt;
&lt;br /&gt;
 make BOARD=native PORT=tap0 term&lt;br /&gt;
&lt;br /&gt;
 make BOARD=native PORT=tap1 term&lt;br /&gt;
&lt;br /&gt;
=== Step 2 ===&lt;br /&gt;
&lt;br /&gt;
After boot-up you can type help to see a list of all available commands:&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; help&lt;br /&gt;
 help&lt;br /&gt;
 Command              Description&lt;br /&gt;
 ---------------------------------------&lt;br /&gt;
 server               Riot CoAP Server&lt;br /&gt;
 client               Riot CoAP Client&lt;br /&gt;
 s                    Riot CoAP Server&lt;br /&gt;
 c                    Riot CoAP Client&lt;br /&gt;
 reboot               Reboot the node&lt;br /&gt;
 ps                   Prints information about running threads.&lt;br /&gt;
 ping6                Ping via ICMPv6&lt;br /&gt;
 random_init          initializes the PRNG&lt;br /&gt;
 random_get           returns 32 bit of pseudo randomness&lt;br /&gt;
 nib                  Configure neighbor information base&lt;br /&gt;
 ifconfig             Configure network interfaces&lt;br /&gt;
&lt;br /&gt;
Run client on one board (or terminal for native) and server on another.&lt;br /&gt;
&lt;br /&gt;
=== Step 3 ===&lt;br /&gt;
&lt;br /&gt;
After starting a client on a node you are greeted with the following options:&lt;br /&gt;
&lt;br /&gt;
 Help Screen:&lt;br /&gt;
 Command            Parameters         Description&lt;br /&gt;
 ----------------------------------------------------------------------&lt;br /&gt;
 /discovery[/d]                        send broadcast to find server&lt;br /&gt;
 /connect[/c]                          connect to set server&lt;br /&gt;
 /list[/l]                             list discovered server&lt;br /&gt;
 /info[/i]                             get server info&lt;br /&gt;
 /setserver[/ss]    [serverid]         set server to serverid&lt;br /&gt;
 /setuser[/su]      [username]         set user to username&lt;br /&gt;
 /options[/o]                          show config&lt;br /&gt;
 /help[/h]                             this screen&lt;br /&gt;
 /exit[/e]                             exit RioChat, drop back to Shell&lt;br /&gt;
 ----------------------------------------------------------------------&lt;br /&gt;
 Just type to send messages, when you are connected.&lt;br /&gt;
&lt;br /&gt;
After setting a user with &amp;lt;code&amp;gt;/setuser&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Used Hardware ==&lt;br /&gt;
&lt;br /&gt;
This project was realized with the [https://github.com/RIOT-OS/RIOT/wiki/Board:-SAMR21-xpro SAMR21-xpro] evaluation board by Atmel. It features the [https://www.microchip.com/wwwproducts/en/ATSAMR21G18A ATSAMR21G18A] SoC by Microchip. It contains an ARM® Cortex®-M0+ based 32-bit MCU with a 2.4GHz RF transceiver compliant with IEEE 802.15.4 standard.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* https://github.com/RIOT-OS&lt;br /&gt;
* https://doc.riot-os.org/index.html&lt;br /&gt;
* https://www.microchip.com/wwwproducts/en/ATSAMR21G18A&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;/div&gt;</summary>
		<author><name>Awolfsbauer</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=CoAP_Chat_Application_for_RIOT_OS&amp;diff=1329</id>
		<title>CoAP Chat Application for RIOT OS</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=CoAP_Chat_Application_for_RIOT_OS&amp;diff=1329"/>
		<updated>2019-03-26T15:36:42Z</updated>

		<summary type="html">&lt;p&gt;Awolfsbauer: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary == &lt;br /&gt;
&lt;br /&gt;
This documentation describes the setup and usage of a &lt;br /&gt;
[[Constrained Application Protocol | CoAP]]-based, chat application for the [https://riot-os.org/ RIOT] operating system.&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
* Operating system: [https://github.com/RIOT-OS/RIOT RIOT OS]&lt;br /&gt;
* Packages: https://git.fh-campuswien.ac.at/WP-ITS/riochat (Note: this package already includes RIOT OS)&lt;br /&gt;
* Hardware: a compatible MCU, a list is available [https://github.com/RIOT-OS/RIOT/wiki/RIOT-Platforms here]&lt;br /&gt;
 &lt;br /&gt;
In order to build and use this application, you need to install the tool chains used by RIOT. Tutorials on how to do that can be found in the official RIOT GitHub repository and the official documentation:&lt;br /&gt;
&lt;br /&gt;
* The [https://github.com/RIOT-OS/RIOT/wiki RIOT GitHub wiki] contains all the information to get started.&lt;br /&gt;
* A detailed step-by-step [https://github.com/RIOT-OS/Tutorials/blob/master/README.md Tutorial] is also available.&lt;br /&gt;
* The official [https://doc.riot-os.org/index.html RIOT Documentation].&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
&lt;br /&gt;
=== Step 1 ===&lt;br /&gt;
&lt;br /&gt;
Enter these commands in the shell&lt;br /&gt;
&lt;br /&gt;
 echo foo&lt;br /&gt;
 echo bar&lt;br /&gt;
 test&lt;br /&gt;
then these commands following&lt;br /&gt;
&lt;br /&gt;
 test&lt;br /&gt;
=== Step 2 ===&lt;br /&gt;
&lt;br /&gt;
Make sure to read&lt;br /&gt;
&lt;br /&gt;
* War and Peace&lt;br /&gt;
* Lord of the Rings&lt;br /&gt;
* The Baroque Cycle&lt;br /&gt;
&lt;br /&gt;
== Used Hardware ==&lt;br /&gt;
&lt;br /&gt;
This project was realized with the [https://github.com/RIOT-OS/RIOT/wiki/Board:-SAMR21-xpro SAMR21-xpro] evaluation board by Atmel. It features the [https://www.microchip.com/wwwproducts/en/ATSAMR21G18A ATSAMR21G18A] SoC by Microchip. It contains an ARM® Cortex®-M0+ based 32-bit MCU with a 2.4GHz RF transceiver compliant with IEEE 802.15.4 standard.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* https://github.com/RIOT-OS&lt;br /&gt;
* https://doc.riot-os.org/index.html&lt;br /&gt;
* https://www.microchip.com/wwwproducts/en/ATSAMR21G18A&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;/div&gt;</summary>
		<author><name>Awolfsbauer</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=CoAP_Chat_Application_for_RIOT_OS&amp;diff=1328</id>
		<title>CoAP Chat Application for RIOT OS</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=CoAP_Chat_Application_for_RIOT_OS&amp;diff=1328"/>
		<updated>2019-03-26T15:19:24Z</updated>

		<summary type="html">&lt;p&gt;Awolfsbauer: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary == &lt;br /&gt;
&lt;br /&gt;
This documentation describes the setup and usage of a &lt;br /&gt;
[[Constrained Application Protocol | CoAP]]-based, chat application for the [https://riot-os.org/ RIOT] operating system.&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
* Operating system: [https://github.com/RIOT-OS/RIOT RIOT OS]&lt;br /&gt;
* Packages: https://git.fh-campuswien.ac.at/WP-ITS/riochat (Note: this package already includes RIOT OS)&lt;br /&gt;
* Hardware: a compatible MCU, a list is available [https://github.com/RIOT-OS/RIOT/wiki/RIOT-Platforms here]&lt;br /&gt;
 &lt;br /&gt;
In order to build and use this application, you need to install the toolchains used by RIOT. Tutorials on how to do that can be found in the official RIOT Github repository and the official documentation:&lt;br /&gt;
&lt;br /&gt;
* The [https://github.com/RIOT-OS/RIOT/wiki RIOT GitHub wiki] contains all the information to get started.&lt;br /&gt;
* A detailed step-by-step [https://github.com/RIOT-OS/Tutorials/blob/master/README.md Tutorial] is also available.&lt;br /&gt;
* The official [https://doc.riot-os.org/index.html RIOT Documentation].&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
&lt;br /&gt;
=== Step 1 ===&lt;br /&gt;
&lt;br /&gt;
Enter these commands in the shell&lt;br /&gt;
&lt;br /&gt;
 echo foo&lt;br /&gt;
 echo bar&lt;br /&gt;
&lt;br /&gt;
=== Step 2 ===&lt;br /&gt;
&lt;br /&gt;
Make sure to read&lt;br /&gt;
&lt;br /&gt;
* War and Peace&lt;br /&gt;
* Lord of the Rings&lt;br /&gt;
* The Baroque Cycle&lt;br /&gt;
&lt;br /&gt;
== Used Hardware ==&lt;br /&gt;
&lt;br /&gt;
This project was realized with the [https://github.com/RIOT-OS/RIOT/wiki/Board:-SAMR21-xpro SAMR21-xpro] evaluation board by Atmel. It features the [https://www.microchip.com/wwwproducts/en/ATSAMR21G18A ATSAMR21G18A] SoC by Microchip. It contains an ARM® Cortex®-M0+ based 32-bit MCU with a 2.4GHz RF transceiver compliant with IEEE 802.15.4 standard.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* https://github.com/RIOT-OS&lt;br /&gt;
* https://doc.riot-os.org/index.html&lt;br /&gt;
* https://www.microchip.com/wwwproducts/en/ATSAMR21G18A&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;/div&gt;</summary>
		<author><name>Awolfsbauer</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=CoAP_Chat_Application_for_RIOT_OS&amp;diff=1327</id>
		<title>CoAP Chat Application for RIOT OS</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=CoAP_Chat_Application_for_RIOT_OS&amp;diff=1327"/>
		<updated>2019-03-26T15:07:35Z</updated>

		<summary type="html">&lt;p&gt;Awolfsbauer: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary == &lt;br /&gt;
&lt;br /&gt;
This documentation describes the setup and usage of a &lt;br /&gt;
[[Constrained Application Protocol | CoAP]]-based, chat application for the [https://riot-os.org/ RIOT] operating system.&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
* Operating system: [https://github.com/RIOT-OS/RIOT RIOT OS]&lt;br /&gt;
* Packages: https://git.fh-campuswien.ac.at/WP-ITS/riochat (Note: this package already includes RIOT OS)&lt;br /&gt;
* Hardware: a compatible MCU, a list is available [https://github.com/RIOT-OS/RIOT/wiki/RIOT-Platforms here]&lt;br /&gt;
 &lt;br /&gt;
In order to build and use this application, you need to install the toolchains used by RIOT. Tutorials on how to do that can be found in the official RIOT Github repository and the official documentation:&lt;br /&gt;
&lt;br /&gt;
* The [https://github.com/RIOT-OS/RIOT/wiki RIOT GitHub wiki] contains all the information to get started.&lt;br /&gt;
* A detailed step-by-step [https://github.com/RIOT-OS/Tutorials/blob/master/README.md Tutorial] is also available.&lt;br /&gt;
* The official [https://doc.riot-os.org/index.html RIOT Documentation].&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
&lt;br /&gt;
=== Step 1 ===&lt;br /&gt;
&lt;br /&gt;
Enter these commands in the shell&lt;br /&gt;
&lt;br /&gt;
 echo foo&lt;br /&gt;
 echo bar&lt;br /&gt;
&lt;br /&gt;
=== Step 2 ===&lt;br /&gt;
&lt;br /&gt;
Make sure to read&lt;br /&gt;
&lt;br /&gt;
* War and Peace&lt;br /&gt;
* Lord of the Rings&lt;br /&gt;
* The Baroque Cycle&lt;br /&gt;
&lt;br /&gt;
== Used Hardware ==&lt;br /&gt;
&lt;br /&gt;
[[https://github.com/RIOT-OS/RIOT/wiki/Board:-SAMR21-xpro]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Courses ==&lt;br /&gt;
&lt;br /&gt;
* [[A course where this documentation was used]] (2017, 2018)&lt;br /&gt;
* [[Another one]] (2018)&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* https://wikipedia.org&lt;br /&gt;
* https://google.com&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;/div&gt;</summary>
		<author><name>Awolfsbauer</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=CoAP_Chat_Application_for_RIOT_OS&amp;diff=1326</id>
		<title>CoAP Chat Application for RIOT OS</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=CoAP_Chat_Application_for_RIOT_OS&amp;diff=1326"/>
		<updated>2019-03-26T15:03:57Z</updated>

		<summary type="html">&lt;p&gt;Awolfsbauer: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary == &lt;br /&gt;
&lt;br /&gt;
This documentation describes the setup and usage of a &lt;br /&gt;
[[Constrained Application Protocol | CoAP]]-based, chat application for the RIOT operating system.&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
* Operating system: [https://github.com/RIOT-OS/RIOT RIOT OS]&lt;br /&gt;
* Packages: https://git.fh-campuswien.ac.at/WP-ITS/riochat (Note: this package already includes RIOT OS)&lt;br /&gt;
* Hardware: a compatible MCU, a list is available [https://github.com/RIOT-OS/RIOT/wiki/RIOT-Platforms here]&lt;br /&gt;
 &lt;br /&gt;
In order to build and use this application, you need to install the toolchains used by RIOT. Tutorials on how to do that can be found in the official RIOT Github repository:&lt;br /&gt;
&lt;br /&gt;
* The [https://github.com/RIOT-OS/RIOT/wiki RIOT GitHub wiki] contains all the information to get started.&lt;br /&gt;
* A detailed step-by-step [https://github.com/RIOT-OS/Tutorials/blob/master/README.md Tutorial] is also available.&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
&lt;br /&gt;
=== Step 1 ===&lt;br /&gt;
&lt;br /&gt;
Enter these commands in the shell&lt;br /&gt;
&lt;br /&gt;
 echo foo&lt;br /&gt;
 echo bar&lt;br /&gt;
&lt;br /&gt;
=== Step 2 ===&lt;br /&gt;
&lt;br /&gt;
Make sure to read&lt;br /&gt;
&lt;br /&gt;
* War and Peace&lt;br /&gt;
* Lord of the Rings&lt;br /&gt;
* The Baroque Cycle&lt;br /&gt;
&lt;br /&gt;
== Used Hardware ==&lt;br /&gt;
&lt;br /&gt;
[[https://github.com/RIOT-OS/RIOT/wiki/Board:-SAMR21-xpro]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Courses ==&lt;br /&gt;
&lt;br /&gt;
* [[A course where this documentation was used]] (2017, 2018)&lt;br /&gt;
* [[Another one]] (2018)&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* https://wikipedia.org&lt;br /&gt;
* https://google.com&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;/div&gt;</summary>
		<author><name>Awolfsbauer</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=Constrained_Application_Protocol&amp;diff=1325</id>
		<title>Constrained Application Protocol</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=Constrained_Application_Protocol&amp;diff=1325"/>
		<updated>2019-03-26T14:54:16Z</updated>

		<summary type="html">&lt;p&gt;Awolfsbauer: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The &#039;&#039;&#039;Constrained Application Protocol&#039;&#039;&#039; (&#039;&#039;&#039;CoAP&#039;&#039;&#039;) is a specialized web transfer protocol, as defined in RFC 7252, for use with constrained nodes and constrained networks in the Internet of Things.&lt;br /&gt;
The protocol is designed for machine-to-machine (M2M) applications such as smart energy and building automation.&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
The work on Constrained Environments aims at realizing the REST architecture in a suitable form for the most constrained nodes and networks. The nodes usually consist of 8-bit microcontrollers with limited amounts of RAM and ROM.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
CoAP has the following main features:&lt;br /&gt;
&lt;br /&gt;
* Web protocol fulfilling M2M requirements in constrained environments&lt;br /&gt;
* UDP [RFC0768] binding with optional reliability supporting unicast and multicast requests&lt;br /&gt;
* Asynchronous message exchanges&lt;br /&gt;
* Low header overhead and parsing complexity&lt;br /&gt;
* URI and Content-type support&lt;br /&gt;
* Simple proxy and caching capabilities&lt;br /&gt;
* Stateless HTTP mapping&lt;br /&gt;
* Security binding to Datagram Transport Layer Security (DTLS)&lt;br /&gt;
&lt;br /&gt;
== The Protocol ==&lt;br /&gt;
&lt;br /&gt;
CoAP is similar to the client/server model of HTTP. M2M interactions typically result in a CoAP implementation acting in both client and server roles. A request is sent by a client to request an action on a resource (identified by a URI) on a server. The server then sends a response with a response code (equivalent to that of HTTP). Therefore, efficiency is very important, so CoAP uses UDP, a datagram-oriented transport.&lt;br /&gt;
&lt;br /&gt;
CoAP is however a single protocol, with messaging and request/response as just features of the CoAP header&lt;br /&gt;
&lt;br /&gt;
 +----------------------+&lt;br /&gt;
 |      Application     |&lt;br /&gt;
 +----------------------+&lt;br /&gt;
 +----------------------+  \&lt;br /&gt;
 |  Requests/Responses  |  |&lt;br /&gt;
 |----------------------|  | CoAP&lt;br /&gt;
 |       Messages       |  |&lt;br /&gt;
 +----------------------+  /&lt;br /&gt;
 +----------------------+&lt;br /&gt;
 |          UDP         |&lt;br /&gt;
 +----------------------+&lt;br /&gt;
&lt;br /&gt;
== Message Format ==&lt;br /&gt;
&lt;br /&gt;
By default, the messages are encoded in a simple binary format and transported over UDP. The message format starts with a fixed-size 4-byte header, followed by a variable-length Token value, which can be between 0 and 8 bytes long. Following the Token value comes a sequence of zero or more CoAP Options in Type-Length-Value (TLV) format, optionally followed by a payload that takes up the rest of the datagram.&lt;br /&gt;
&lt;br /&gt;
    0                   1                   2                   3&lt;br /&gt;
    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1&lt;br /&gt;
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+&lt;br /&gt;
   |Ver| T |  TKL  |      Code     |          Message ID           |&lt;br /&gt;
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+&lt;br /&gt;
   |   Token (if any, TKL bytes) ...&lt;br /&gt;
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+&lt;br /&gt;
   |   Options (if any) ...&lt;br /&gt;
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+&lt;br /&gt;
   |1 1 1 1 1 1 1 1|    Payload (if any) ...&lt;br /&gt;
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+&lt;br /&gt;
&lt;br /&gt;
;Version (Ver) (2 bits)&lt;br /&gt;
:Indicates the CoAP Version number. This must set this field to 1 (binary 01). Other values are reserved for future versions.&lt;br /&gt;
&lt;br /&gt;
;Type (T) (2 bits)&lt;br /&gt;
:Indicates if this message is of type Confirmable (0), Non-confirmable (1), Acknowledgement (2), or Reset (3).&lt;br /&gt;
&lt;br /&gt;
;Token Length (TKL) (4 bits)&lt;br /&gt;
:Indicates the length of the variable-length Token field, which may be 0-8 bytes in length.&lt;br /&gt;
&lt;br /&gt;
;CoAP Request/Response Code (8 bits)&lt;br /&gt;
:Splits into a 3-bit class and 5-bit detail.&lt;br /&gt;
&lt;br /&gt;
;Message ID (16 bits)&lt;br /&gt;
:Used to detect message duplication and to match messages of type Acknowledgement/Reset to messages of type Confirmable/Non-confirmable.&lt;br /&gt;
&lt;br /&gt;
== Implementations ==&lt;br /&gt;
&lt;br /&gt;
Generic implementations are becoming available for a variety of platforms. Implementations for constrained devices are typically written in C. CoAP is also used between them and more powerful systems such as cloud servers, home centrals, smartphones:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Programming Language !! Client/Server !! License !! Link&lt;br /&gt;
|-&lt;br /&gt;
| Erbium for Contiki || C || Client + Server || 3-clause BSD || http://www.contiki-os.org/&lt;br /&gt;
|-&lt;br /&gt;
| libcoap || C || Client + Server || BSD/GPL || https://libcoap.net/&lt;br /&gt;
|-&lt;br /&gt;
| Eclipse tinydtls || C || Client + Server || EPL+EDL || https://projects.eclipse.org/projects/iot.tinydtls&lt;br /&gt;
|-&lt;br /&gt;
| LibNyoci || C || Client + Server || MIT || https://github.com/darconeous/libnyoci&lt;br /&gt;
|-&lt;br /&gt;
| microcoap || C || Client + Server || MIT || https://github.com/1248/microcoap&lt;br /&gt;
|-&lt;br /&gt;
| cantcoap ||  C++/C || Client + Server || BSD || https://github.com/staropram/cantcoap&lt;br /&gt;
|-&lt;br /&gt;
| Lobaro CoAP || C || Client + Server || MIT || https://www.lobaro.com/portfolio/lobaro-coap/&lt;br /&gt;
|-&lt;br /&gt;
| MR-CoAP || Java ||     || BSD || https://github.com/MR-CoAP/CoAP&lt;br /&gt;
|-&lt;br /&gt;
| Wakaama || C || Client + Server || EPL+EDL || https://www.eclipse.org/wakaama/index.html&lt;br /&gt;
|-&lt;br /&gt;
| coap-node || Javascript || Client || MIT || https://github.com/PeterEB/coap-node&lt;br /&gt;
|-&lt;br /&gt;
| coap-shepherd || Javascript || Server || MIT || https://github.com/PeterEB/coap-shepherd&lt;br /&gt;
|-&lt;br /&gt;
| Californium || Java || Client + Server || EPL+EDL || https://www.eclipse.org/californium&lt;br /&gt;
|-&lt;br /&gt;
| nCoap || Java || Client + Server || BSD || https://github.com/okleine/nCoAP&lt;br /&gt;
|-&lt;br /&gt;
| leshan || Java || Client + Server || EPL+EDL || https://github.com/eclipse/leshan&lt;br /&gt;
|-&lt;br /&gt;
| CoAP.NET || C# || Client + Server || 3-clause BSD || https://github.com/smeshlink/CoAP.NET&lt;br /&gt;
|-&lt;br /&gt;
| CoAPSharp ||  C#, .NET || Client + Server || LGPL || http://www.coapsharp.com&lt;br /&gt;
|-&lt;br /&gt;
| Waher.Networking.CoAP || C# || Server || || https://github.com/PeterWaher/IoTGateway&lt;br /&gt;
|-&lt;br /&gt;
| gen_coap || Erlang || Client + Server || MPL v1.1 || https://github.com/gotthardp/gen_coap&lt;br /&gt;
|-&lt;br /&gt;
| go-coap || Go || Client + Server || MIT || https://github.com/go-ocf/go-coap&lt;br /&gt;
|-&lt;br /&gt;
| node-coap || Javascript || Client + Server || MIT || https://github.com/mcollina/node-coap&lt;br /&gt;
|-&lt;br /&gt;
| coap-cli || Javascript  || || MIT || https://github.com/mcollina/coap-cli&lt;br /&gt;
|-&lt;br /&gt;
| txThings || Python (Twisted) || Client + Server || MIT || https://github.com/mwasilak/txThings&lt;br /&gt;
|-&lt;br /&gt;
| aiocoap || Python 3 || Client + Server ||  MIT || https://github.com/chrysn/aiocoap&lt;br /&gt;
|-&lt;br /&gt;
| CoAPthon || Python || Client + Server || MIT || https://github.com/Tanganelli/CoAPthon&lt;br /&gt;
|-&lt;br /&gt;
| Ruby coap || Ruby || Client || MIT || https://github.com/nning/coap&lt;br /&gt;
|-&lt;br /&gt;
| Ruby david || Ruby || Server || MIT || https://github.com/nning/david&lt;br /&gt;
|-&lt;br /&gt;
| coap-rs || Rust || Client + Server || MIT || https://github.com/Covertness/coap-rs&lt;br /&gt;
|-&lt;br /&gt;
| Copper || JavaScript (Browser Plugin) || Client || BSD || https://github.com/mkovatsc/Copper&lt;br /&gt;
|-&lt;br /&gt;
| iCoAP || Objective-C || Client ||  MIT || https://github.com/stuffrabbit/iCoAP&lt;br /&gt;
|-&lt;br /&gt;
| SwiftCoAP || Swift || Client + Server || MIT || https://github.com/stuffrabbit/SwiftCoAP&lt;br /&gt;
|-&lt;br /&gt;
| nCoap || Java || Client + Server || BSD || https://github.com/okleine/nCoAP&lt;br /&gt;
|-&lt;br /&gt;
| txThings || Python (Twisted) || Client + Server ||  MIT || https://github.com/mwasilak/txThings&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Courses ==&lt;br /&gt;
&lt;br /&gt;
* [[Vertiefendes Wahlfach-Projekt]] (2018)&lt;br /&gt;
* [[CoAP Chat Application for RIOT OS]]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
* RFC 7252: https://tools.ietf.org/html/rfc7252&lt;br /&gt;
* CoAP: RFC 7252 Constrained Application Protocol https://coap.technology/&lt;br /&gt;
* Learning Internet of Things: https://www.oreilly.com/library/view/learning-internet-of/9781783553532/&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;/div&gt;</summary>
		<author><name>Awolfsbauer</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=CoAP_Chat_Application_for_RIOT_OS&amp;diff=1324</id>
		<title>CoAP Chat Application for RIOT OS</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=CoAP_Chat_Application_for_RIOT_OS&amp;diff=1324"/>
		<updated>2019-03-26T14:52:09Z</updated>

		<summary type="html">&lt;p&gt;Awolfsbauer: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary == &lt;br /&gt;
&lt;br /&gt;
This documentation describes the setup and usage of a &lt;br /&gt;
[[Constrained Application Protocol | CoAP]]-based, chat application for the RIOT operating system.&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
* Operating system: [https://github.com/RIOT-OS/RIOT RIOT OS]&lt;br /&gt;
* Packages: https://git.fh-campuswien.ac.at/WP-ITS/riochat (Note: this package already includes RIOT OS)&lt;br /&gt;
* Hardware: a compatible MCU, a list is available [https://github.com/RIOT-OS/RIOT/wiki/RIOT-Platforms here]&lt;br /&gt;
 &lt;br /&gt;
In order to complete these steps, you must have followed [[Some Other Documentation]] before.&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
&lt;br /&gt;
=== Step 1 ===&lt;br /&gt;
&lt;br /&gt;
Enter these commands in the shell&lt;br /&gt;
&lt;br /&gt;
 echo foo&lt;br /&gt;
 echo bar&lt;br /&gt;
&lt;br /&gt;
=== Step 2 ===&lt;br /&gt;
&lt;br /&gt;
Make sure to read&lt;br /&gt;
&lt;br /&gt;
* War and Peace&lt;br /&gt;
* Lord of the Rings&lt;br /&gt;
* The Baroque Cycle&lt;br /&gt;
&lt;br /&gt;
== Used Hardware ==&lt;br /&gt;
&lt;br /&gt;
[[https://github.com/RIOT-OS/RIOT/wiki/Board:-SAMR21-xpro]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Courses ==&lt;br /&gt;
&lt;br /&gt;
* [[A course where this documentation was used]] (2017, 2018)&lt;br /&gt;
* [[Another one]] (2018)&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* https://wikipedia.org&lt;br /&gt;
* https://google.com&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;/div&gt;</summary>
		<author><name>Awolfsbauer</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=CoAP_Chat_Application_for_RIOT_OS&amp;diff=1323</id>
		<title>CoAP Chat Application for RIOT OS</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=CoAP_Chat_Application_for_RIOT_OS&amp;diff=1323"/>
		<updated>2019-03-26T14:43:13Z</updated>

		<summary type="html">&lt;p&gt;Awolfsbauer: Created page with &amp;quot;== Summary ==   This documentation describes the setup and usage of a CoAP-based, chat application for the RIOT operating system.  == Requirements ==  * Operating system: RIOT...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary == &lt;br /&gt;
&lt;br /&gt;
This documentation describes the setup and usage of a CoAP-based, chat application for the RIOT operating system.&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
* Operating system: RIOT OS https://github.com/RIOT-OS/RIOT&lt;br /&gt;
* Packages: https://git.fh-campuswien.ac.at/WP-ITS/riochat (Note: this package already includes RIOT OS&lt;br /&gt;
* Hardware: a compatible MCU, a list is available [https://github.com/RIOT-OS/RIOT/wiki/RIOT-Platforms here]&lt;br /&gt;
&lt;br /&gt;
In order to complete these steps, you must have followed [[Some Other Documentation]] before.&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
&lt;br /&gt;
=== Step 1 ===&lt;br /&gt;
&lt;br /&gt;
Enter these commands in the shell&lt;br /&gt;
&lt;br /&gt;
 echo foo&lt;br /&gt;
 echo bar&lt;br /&gt;
&lt;br /&gt;
=== Step 2 ===&lt;br /&gt;
&lt;br /&gt;
Make sure to read&lt;br /&gt;
&lt;br /&gt;
* War and Peace&lt;br /&gt;
* Lord of the Rings&lt;br /&gt;
* The Baroque Cycle&lt;br /&gt;
&lt;br /&gt;
== Used Hardware ==&lt;br /&gt;
&lt;br /&gt;
[[https://github.com/RIOT-OS/RIOT/wiki/Board:-SAMR21-xpro]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Courses ==&lt;br /&gt;
&lt;br /&gt;
* [[A course where this documentation was used]] (2017, 2018)&lt;br /&gt;
* [[Another one]] (2018)&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* https://wikipedia.org&lt;br /&gt;
* https://google.com&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;/div&gt;</summary>
		<author><name>Awolfsbauer</name></author>
	</entry>
</feed>