libcoap  4.3.0
Rate Control

The transmission parameters for CoAP rate control ("Congestion Control" in stream-oriented protocols) are defined in https://tools.ietf.org/html/rfc7252#section-4.8. More...

Macros

#define COAP_DEFAULT_ACK_TIMEOUT   ((coap_fixed_point_t){2,0})
 Number of seconds when to expect an ACK or a response to an outstanding CON message. More...
 
#define COAP_DEFAULT_ACK_RANDOM_FACTOR   ((coap_fixed_point_t){1,500})
 A factor that is used to randomize the wait time before a message is retransmitted to prevent synchronization effects. More...
 
#define COAP_DEFAULT_MAX_RETRANSMIT   4
 Number of message retransmissions before message sending is stopped RFC 7252, Section 4.8 Default value of MAX_RETRANSMIT is 4. More...
 
#define COAP_DEFAULT_NSTART   1
 The number of simultaneous outstanding interactions that a client maintains to a given server. More...
 
#define COAP_DEFAULT_LEISURE   (5U)
 The maximum number of seconds before sending back a response to a multicast request. More...
 
#define COAP_MAX_TRANSMIT_SPAN(s)
 The MAX_TRANSMIT_SPAN definition for the session (s). More...
 
#define COAP_MAX_TRANSMIT_WAIT(s)
 The MAX_TRANSMIT_WAIT definition for the session (s). More...
 
#define COAP_MAX_LATENCY   100
 The MAX_LATENCY definition. More...
 
#define COAP_PROCESSING_DELAY(s)
 The PROCESSING_DELAY definition for the session (s). More...
 
#define COAP_MAX_RTT(s)    ((2 * COAP_MAX_LATENCY) + COAP_PROCESSING_DELAY(s))
 The MAX_RTT definition for the session (s). More...
 
#define COAP_EXCHANGE_LIFETIME(s)    (COAP_MAX_TRANSMIT_SPAN(s) + (2 * COAP_MAX_LATENCY) + COAP_PROCESSING_DELAY(s))
 The EXCHANGE_LIFETIME definition for the session (s). More...
 
#define COAP_NON_LIFETIME(s)    (COAP_MAX_TRANSMIT_SPAN(s) + COAP_MAX_LATENCY)
 The NON_LIFETIME definition for the session (s). More...
 

Detailed Description

The transmission parameters for CoAP rate control ("Congestion Control" in stream-oriented protocols) are defined in https://tools.ietf.org/html/rfc7252#section-4.8.

Macro Definition Documentation

◆ COAP_DEFAULT_ACK_RANDOM_FACTOR

#define COAP_DEFAULT_ACK_RANDOM_FACTOR   ((coap_fixed_point_t){1,500})

A factor that is used to randomize the wait time before a message is retransmitted to prevent synchronization effects.

RFC 7252, Section 4.8 Default value of ACK_RANDOM_FACTOR is 1.5

Configurable using coap_session_set_ack_random_factor()

Definition at line 412 of file coap_session.h.

◆ COAP_DEFAULT_ACK_TIMEOUT

#define COAP_DEFAULT_ACK_TIMEOUT   ((coap_fixed_point_t){2,0})

Number of seconds when to expect an ACK or a response to an outstanding CON message.

RFC 7252, Section 4.8 Default value of ACK_TIMEOUT is 2

Configurable using coap_session_set_ack_timeout()

Definition at line 403 of file coap_session.h.

◆ COAP_DEFAULT_LEISURE

#define COAP_DEFAULT_LEISURE   (5U)

The maximum number of seconds before sending back a response to a multicast request.

RFC 7252, Section 4.8 DEFAULT_LEISURE is 5.

Definition at line 435 of file coap_session.h.

◆ COAP_DEFAULT_MAX_RETRANSMIT

#define COAP_DEFAULT_MAX_RETRANSMIT   4

Number of message retransmissions before message sending is stopped RFC 7252, Section 4.8 Default value of MAX_RETRANSMIT is 4.

Configurable using coap_session_set_max_retransmit()

Definition at line 420 of file coap_session.h.

◆ COAP_DEFAULT_NSTART

#define COAP_DEFAULT_NSTART   1

The number of simultaneous outstanding interactions that a client maintains to a given server.

RFC 7252, Section 4.8 Default value of NSTART is 1

Definition at line 427 of file coap_session.h.

◆ COAP_EXCHANGE_LIFETIME

#define COAP_EXCHANGE_LIFETIME (   s)     (COAP_MAX_TRANSMIT_SPAN(s) + (2 * COAP_MAX_LATENCY) + COAP_PROCESSING_DELAY(s))

The EXCHANGE_LIFETIME definition for the session (s).

RFC 7252, Section 4.8.2 Calculation of EXCHANGE_LIFETIME MAX_TRANSMIT_SPAN + (2 * MAX_LATENCY) + PROCESSING_DELAY

Definition at line 495 of file coap_session.h.

◆ COAP_MAX_LATENCY

#define COAP_MAX_LATENCY   100

The MAX_LATENCY definition.

RFC 7252, Section 4.8.2 MAX_LATENCY is 100.

Definition at line 468 of file coap_session.h.

◆ COAP_MAX_RTT

#define COAP_MAX_RTT (   s)     ((2 * COAP_MAX_LATENCY) + COAP_PROCESSING_DELAY(s))

The MAX_RTT definition for the session (s).

RFC 7252, Section 4.8.2 Calculation of MAX_RTT (2 * MAX_LATENCY) + PROCESSING_DELAY

Definition at line 486 of file coap_session.h.

◆ COAP_MAX_TRANSMIT_SPAN

#define COAP_MAX_TRANSMIT_SPAN (   s)
Value:
((s->ack_timeout.integer_part * 1000 + s->ack_timeout.fractional_part) * \
((1 << (s->max_retransmit)) -1) * \
(s->ack_random_factor.integer_part * 1000 + \
s->ack_random_factor.fractional_part) \
/ 1000000)

The MAX_TRANSMIT_SPAN definition for the session (s).

RFC 7252, Section 4.8.2 Calculation of MAX_TRAMSMIT_SPAN ACK_TIMEOUT * ((2 ** (MAX_RETRANSMIT)) - 1) * ACK_RANDOM_FACTOR

Definition at line 444 of file coap_session.h.

◆ COAP_MAX_TRANSMIT_WAIT

#define COAP_MAX_TRANSMIT_WAIT (   s)
Value:
((s->ack_timeout.integer_part * 1000 + s->ack_timeout.fractional_part) * \
((1 << (s->max_retransmit + 1)) -1) * \
(s->ack_random_factor.integer_part * 1000 + \
s->ack_random_factor.fractional_part) \
/ 1000000)

The MAX_TRANSMIT_WAIT definition for the session (s).

RFC 7252, Section 4.8.2 Calculation of MAX_TRAMSMIT_WAIT ACK_TIMEOUT * ((2 ** (MAX_RETRANSMIT + 1)) - 1) * ACK_RANDOM_FACTOR

Definition at line 457 of file coap_session.h.

◆ COAP_NON_LIFETIME

#define COAP_NON_LIFETIME (   s)     (COAP_MAX_TRANSMIT_SPAN(s) + COAP_MAX_LATENCY)

The NON_LIFETIME definition for the session (s).

RFC 7252, Section 4.8.2 Calculation of NON_LIFETIME MAX_TRANSMIT_SPAN + MAX_LATENCY

Definition at line 504 of file coap_session.h.

◆ COAP_PROCESSING_DELAY

#define COAP_PROCESSING_DELAY (   s)
Value:
((s->ack_timeout.integer_part * 1000 + s->ack_timeout.fractional_part + 500) \
/ 1000)

The PROCESSING_DELAY definition for the session (s).

RFC 7252, Section 4.8.2 Calculation of PROCESSING_DELAY PROCESSING_DELAY set to ACK_TIMEOUT

Definition at line 476 of file coap_session.h.