aiocoap.numbers.constants module

Constants either defined in the CoAP protocol (often default values for lack of ways to determine eg. the estimated round trip time). Some parameters are invented here for practical purposes of the implementation (eg. DEFAULT_BLOCK_SIZE_EXP, EMPTY_ACK_DELAY).

aiocoap.numbers.constants.COAP_PORT = 5683

The IANA-assigned standard port for COAP services.

aiocoap.numbers.constants.SHUTDOWN_TIMEOUT = 3

Maximum time, in seconds, for which the process is kept around during shutdown

class aiocoap.numbers.constants.TransportTuning

Bases: object

Base parameters that guide CoAP transport behaviors

The values in here are recommended values, often defaults from RFCs. They can be tuned in subclasses (and then passed into a message as transport_tuning), although users should be aware that alteing some of these can cause the library to behave in ways violating the specification, especially with respect to congestion control.

ACK_TIMEOUT = 2.0

The time, in seconds, to wait for an acknowledgement of a confirmable message. The inter-transmission time doubles for each retransmission.

ACK_RANDOM_FACTOR = 1.5

Timeout multiplier for anti-synchronization.

MAX_RETRANSMIT = 4

The number of retransmissions of confirmable messages to non-multicast endpoints before the infrastructure assumes no acknowledgement will be received.

NSTART = 1

Maximum number of simultaneous outstanding interactions that endpoint maintains to a given server (including proxies)

property MAX_TRANSMIT_SPAN

Maximum time from the first transmission of a confirmable message to its last retransmission.

property MAX_TRANSMIT_WAIT

Maximum time from the first transmission of a confirmable message to the time when the sender gives up on receiving an acknowledgement or reset.

MAX_LATENCY = 100.0

Maximum time a datagram is expected to take from the start of its transmission to the completion of its reception.

property PROCESSING_DELAY

“Time a node takes to turn around a confirmable message into an acknowledgement.

property MAX_RTT

Maximum round-trip time.

property EXCHANGE_LIFETIME

time from starting to send a confirmable message to the time when an acknowledgement is no longer expected, i.e. message layer information about the message exchange can be purged

DEFAULT_BLOCK_SIZE_EXP = 6

Default size exponent for blockwise transfers.

EMPTY_ACK_DELAY = 0.1

After this time protocol sends empty ACK, and separate response

property REQUEST_TIMEOUT

Time after which server assumes it won’t receive any answer. It is not defined by IETF documents. For human-operated devices it might be preferable to set some small value (for example 10 seconds) For M2M it’s application dependent.

DEFAULT_LEISURE = 5
property MULTICAST_REQUEST_TIMEOUT
OBSERVATION_RESET_TIME = 128

Time in seconds after which the value of the observe field are ignored.

This number is not explicitly named in RFC7641.