libcoap 4.3.1
Rate Control

API for updating transmission parameters for CoAP rate control. More...

+ Collaboration diagram for Rate Control:

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   (4U)
 Number of message retransmissions before message sending is stopped. More...
 
#define COAP_DEFAULT_NSTART   (1U)
 The number of simultaneous outstanding interactions that a client maintains to a given server. More...
 
#define COAP_DEFAULT_DEFAULT_LEISURE   ((coap_fixed_point_t){5,0})
 The number of seconds to use as bounds for multicast traffic RFC 7252, Section 4.8 Default value of DEFAULT_LEISURE is 5.0. More...
 
#define COAP_DEFAULT_PROBING_RATE   (1U)
 The number of bytes/second allowed when there is no response RFC 7252, Section 4.8 Default value of PROBING_RATE is 1. More...
 
#define COAP_DEFAULT_MAX_LATENCY   (100U)
 The MAX_LATENCY definition. More...
 

Functions

void coap_session_set_ack_timeout (coap_session_t *session, coap_fixed_point_t value)
 Set the CoAP initial ack response timeout before the next re-transmit. More...
 
coap_fixed_point_t coap_session_get_ack_timeout (const coap_session_t *session)
 Get the CoAP initial ack response timeout before the next re-transmit. More...
 
void coap_session_set_ack_random_factor (coap_session_t *session, coap_fixed_point_t value)
 Set the CoAP ack randomize factor. More...
 
coap_fixed_point_t coap_session_get_ack_random_factor (const coap_session_t *session)
 Get the CoAP ack randomize factor. More...
 
void coap_session_set_max_retransmit (coap_session_t *session, uint16_t value)
 Set the CoAP maximum retransmit count before failure. More...
 
uint16_t coap_session_get_max_retransmit (const coap_session_t *session)
 Get the CoAP maximum retransmit before failure. More...
 
void coap_session_set_nstart (coap_session_t *session, uint16_t value)
 Set the CoAP maximum concurrent transmission count of Confirmable messages RFC7252 NSTART. More...
 
uint16_t coap_session_get_nstart (const coap_session_t *session)
 Get the CoAP maximum concurrent transmission count of Confirmable messages RFC7252 NSTART. More...
 
void coap_session_set_default_leisure (coap_session_t *session, coap_fixed_point_t value)
 Set the CoAP default leisure time (for multicast) RFC7252 DEFAULT_LEISURE. More...
 
coap_fixed_point_t coap_session_get_default_leisure (const coap_session_t *session)
 Get the CoAP default leisure time RFC7252 DEFAULT_LEISURE. More...
 
void coap_session_set_probing_rate (coap_session_t *session, uint32_t value)
 Set the CoAP probing rate when there is no response RFC7252 PROBING_RATE. More...
 
uint32_t coap_session_get_probing_rate (const coap_session_t *session)
 Get the CoAP probing rate when there is no response RFC7252 PROBING_RATE. More...
 

Detailed Description

API for updating transmission parameters for CoAP 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

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 424 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 415 of file coap_session.h.

◆ COAP_DEFAULT_DEFAULT_LEISURE

#define COAP_DEFAULT_DEFAULT_LEISURE   ((coap_fixed_point_t){5,0})

The number of seconds to use as bounds for multicast traffic RFC 7252, Section 4.8 Default value of DEFAULT_LEISURE is 5.0.

Configurable using coap_session_set_default_leisure()

Definition at line 449 of file coap_session.h.

◆ COAP_DEFAULT_MAX_LATENCY

#define COAP_DEFAULT_MAX_LATENCY   (100U)

The MAX_LATENCY definition.

RFC 7252, Section 4.8.2 MAX_LATENCY is 100.

Definition at line 463 of file coap_session.h.

◆ COAP_DEFAULT_MAX_RETRANSMIT

#define COAP_DEFAULT_MAX_RETRANSMIT   (4U)

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 432 of file coap_session.h.

◆ COAP_DEFAULT_NSTART

#define COAP_DEFAULT_NSTART   (1U)

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

Configurable using coap_session_set_nstart()

Definition at line 441 of file coap_session.h.

◆ COAP_DEFAULT_PROBING_RATE

#define COAP_DEFAULT_PROBING_RATE   (1U)

The number of bytes/second allowed when there is no response RFC 7252, Section 4.8 Default value of PROBING_RATE is 1.

Configurable using coap_session_set_probing_rate()

Definition at line 457 of file coap_session.h.

Function Documentation

◆ coap_session_get_ack_random_factor()

coap_fixed_point_t coap_session_get_ack_random_factor ( const coap_session_t session)

Get the CoAP ack randomize factor.

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

Parameters
sessionThe CoAP session.
Returns
Current ack randomize value

Definition at line 101 of file coap_session.c.

◆ coap_session_get_ack_timeout()

coap_fixed_point_t coap_session_get_ack_timeout ( const coap_session_t session)

Get the CoAP initial ack response timeout before the next re-transmit.

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

Parameters
sessionThe CoAP session.
Returns
Current ack response timeout value

Definition at line 96 of file coap_session.c.

◆ coap_session_get_default_leisure()

coap_fixed_point_t coap_session_get_default_leisure ( const coap_session_t session)

Get the CoAP default leisure time RFC7252 DEFAULT_LEISURE.

Parameters
sessionThe CoAP session.
Returns
Current default_leisure value

Definition at line 116 of file coap_session.c.

◆ coap_session_get_max_retransmit()

uint16_t coap_session_get_max_retransmit ( const coap_session_t session)

Get the CoAP maximum retransmit before failure.

Number of message retransmissions before message sending is stopped RFC7252 MAX_RETRANSMIT

Parameters
sessionThe CoAP session.
Returns
Current maximum retransmit value

Definition at line 106 of file coap_session.c.

◆ coap_session_get_nstart()

uint16_t coap_session_get_nstart ( const coap_session_t session)

Get the CoAP maximum concurrent transmission count of Confirmable messages RFC7252 NSTART.

Parameters
sessionThe CoAP session.
Returns
Current nstart value

Definition at line 111 of file coap_session.c.

◆ coap_session_get_probing_rate()

uint32_t coap_session_get_probing_rate ( const coap_session_t session)

Get the CoAP probing rate when there is no response RFC7252 PROBING_RATE.

Parameters
sessionThe CoAP session.
Returns
Current probing_rate value

Definition at line 121 of file coap_session.c.

◆ coap_session_set_ack_random_factor()

void coap_session_set_ack_random_factor ( coap_session_t session,
coap_fixed_point_t  value 
)

Set the CoAP ack randomize factor.

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

Parameters
sessionThe CoAP session.
valueThe value to set to. The default is 1.5 and should not normally get changed.

Definition at line 47 of file coap_session.c.

+ Here is the call graph for this function:

◆ coap_session_set_ack_timeout()

void coap_session_set_ack_timeout ( coap_session_t session,
coap_fixed_point_t  value 
)

Set the CoAP initial ack response timeout before the next re-transmit.

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

Parameters
sessionThe CoAP session.
valueThe value to set to. The default is 2.0 and should not normally get changed.

Definition at line 37 of file coap_session.c.

+ Here is the call graph for this function:

◆ coap_session_set_default_leisure()

void coap_session_set_default_leisure ( coap_session_t session,
coap_fixed_point_t  value 
)

Set the CoAP default leisure time (for multicast) RFC7252 DEFAULT_LEISURE.

Parameters
sessionThe CoAP session.
valueThe value to set to. The default is 5.0 and should not normally get changed.

Definition at line 76 of file coap_session.c.

+ Here is the call graph for this function:

◆ coap_session_set_max_retransmit()

void coap_session_set_max_retransmit ( coap_session_t session,
uint16_t  value 
)

Set the CoAP maximum retransmit count before failure.

Number of message retransmissions before message sending is stopped RFC7252 MAX_RETRANSMIT

Parameters
sessionThe CoAP session.
valueThe value to set to. The default is 4 and should not normally get changed.

Definition at line 58 of file coap_session.c.

+ Here is the call graph for this function:

◆ coap_session_set_nstart()

void coap_session_set_nstart ( coap_session_t session,
uint16_t  value 
)

Set the CoAP maximum concurrent transmission count of Confirmable messages RFC7252 NSTART.

Parameters
sessionThe CoAP session.
valueThe value to set to. The default is 1 and should not normally get changed.

Definition at line 67 of file coap_session.c.

+ Here is the call graph for this function:

◆ coap_session_set_probing_rate()

void coap_session_set_probing_rate ( coap_session_t session,
uint32_t  value 
)

Set the CoAP probing rate when there is no response RFC7252 PROBING_RATE.

Parameters
sessionThe CoAP session.
valueThe value to set to. The default is 1 and should not normally get changed.

Definition at line 87 of file coap_session.c.

+ Here is the call graph for this function: