Skip to content

Commit

Permalink
fixup! congure_reno: initial import of TCP Reno congestion control
Browse files Browse the repository at this point in the history
  • Loading branch information
miri64 committed Feb 11, 2021
1 parent d065c30 commit c12a17f
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 28 deletions.
4 changes: 2 additions & 2 deletions sys/congure/reno/congure_reno.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ static const congure_snd_driver_t _driver = {
.inter_msg_interval = congure_reno_snd_inter_msg_interval,
.report_msg_sent = congure_reno_snd_report_msg_sent,
.report_msg_discarded = congure_reno_snd_report_msg_discarded,
.report_msg_timeout = congure_reno_snd_report_msg_timeout,
.report_msg_lost = congure_reno_snd_report_msg_lost,
.report_msgs_timeout = congure_reno_snd_report_msgs_timeout,
.report_msgs_lost = congure_reno_snd_report_msgs_lost,
.report_msg_acked = congure_reno_snd_report_msg_acked,
.report_ecn_ce = congure_reno_snd_report_ecn_ce,
};
Expand Down
10 changes: 5 additions & 5 deletions sys/congure/reno/methods/congure_reno_methods.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ static void _enforce_fast_retransmit(congure_reno_snd_t *c)
c->consts->fr(c);
}

void congure_reno_set_mss(congure_reno_snd_t *c, unsigned mss)
void congure_reno_set_mss(congure_reno_snd_t *c, congure_wnd_size_t mss)
{
c->mss = mss;
c->super.cwnd = _calc_init_wnd(c);
Expand Down Expand Up @@ -120,8 +120,8 @@ int _check_resends(clist_node_t *node, void *ctx)
return 0;
}

void congure_reno_snd_report_msg_timeout(congure_snd_t *cong,
congure_snd_msg_t *msgs)
void congure_reno_snd_report_msgs_timeout(congure_snd_t *cong,
congure_snd_msg_t *msgs)
{
congure_reno_snd_t *c = (congure_reno_snd_t *)cong;

Expand Down Expand Up @@ -149,8 +149,8 @@ int _mark_msg_lost(clist_node_t *node, void *ctx)
return 0;
}

void congure_reno_snd_report_msg_lost(congure_snd_t *cong,
congure_snd_msg_t *msgs)
void congure_reno_snd_report_msgs_lost(congure_snd_t *cong,
congure_snd_msg_t *msgs)
{
congure_reno_snd_t *c = (congure_reno_snd_t *)cong;

Expand Down
44 changes: 23 additions & 21 deletions sys/include/congure/reno.h
Original file line number Diff line number Diff line change
Expand Up @@ -176,11 +176,11 @@ struct congure_reno_snd {
* @brief Constants
*/
const congure_reno_snd_consts_t *consts;
uint32_t last_ack; /**< ID of the last ACK reported */
/**
* @brief Maximum segment size of the sender in caller-defined units
*/
unsigned mss;
uint32_t last_ack; /**< ID of the last ACK reported */
congure_wnd_size_t mss;
congure_wnd_size_t ssthresh; /**< Slow-start threshold */
/**
* @brief Sum of caller-defined units of message sizes of all messages
Expand All @@ -203,6 +203,18 @@ struct congure_reno_snd {
void congure_reno_snd_setup(congure_reno_snd_t *c,
const congure_reno_snd_consts_t *consts);

/**
* @defgroup sys_congure_reno_methods The send driver methods for CongURE TCP Reno
* @ingroup sys_congure_reno
*
* Many other congestion control mechanisms are just adaptations of TCP Reno,
* so this makes the methods of @ref sys_congure_reno available to other
* @ref sys_congure modules. Use module `congure_reno_methods` to only compile
* in these methods, but not the driver for `congure_reno_snd_t` or
* @ref congure_reno_snd_setup().
*
* @{
*/
/**
* @brief Set sender maximum segment size.
*
Expand All @@ -212,18 +224,8 @@ void congure_reno_snd_setup(congure_reno_snd_t *c,
* @param[in] c A CongURE state object
* @param[in] mss Maximum segment size of the sender in caller-defined units
*/
void congure_reno_set_mss(congure_reno_snd_t *c, unsigned mss);
void congure_reno_set_mss(congure_reno_snd_t *c, congure_wnd_size_t mss);

/**
* @defgroup sys_congure_reno_methods The send driver methods for CongURE TCP Reno
* @ingroup sys_congure_reno
*
* Many other congestion control mechanisms are just adaptations of TCP Reno,
* so this makes the methods of @ref sys_congure_reno available to other
* @ref sys_congure modules
*
* @{
*/
/**
* @brief Use to override congure_snd_driver_t::init
*
Expand Down Expand Up @@ -263,24 +265,24 @@ void congure_reno_snd_report_msg_sent(congure_snd_t *c, unsigned msg_size);
void congure_reno_snd_report_msg_discarded(congure_snd_t *c, unsigned msg_size);

/**
* @brief Use to override congure_snd_driver_t::report_msg_timeout
* @brief Use to override congure_snd_driver_t::report_msgs_timeout
*
* @param[in] c The CongURE state object.
* @param[in] msgs A collection of messages that are known to be lost.
* The list may be changed by the method.
* The list must not be changed by the method.
*/
void congure_reno_snd_report_msg_timeout(congure_snd_t *c,
congure_snd_msg_t *msgs);
void congure_reno_snd_report_msgs_timeout(congure_snd_t *c,
congure_snd_msg_t *msgs);

/**
* @brief Use to override congure_snd_driver_t::report_msg_lost
* @brief Use to override congure_snd_driver_t::report_msgs_lost
*
* @param[in] c The CongURE state object.
* @param[in] msgs A collection of messages for which the ACK timed
* out. The list may be changed by the method.
* out. The list must not be changed by the method.
*/
void congure_reno_snd_report_msg_lost(congure_snd_t *c,
congure_snd_msg_t *msgs);
void congure_reno_snd_report_msgs_lost(congure_snd_t *c,
congure_snd_msg_t *msgs);

/**
* @brief Use to override congure_snd_driver_t::report_msg_acked
Expand Down

0 comments on commit c12a17f

Please sign in to comment.