NetSim Source Code Help
Loading...
Searching...
No Matches
Congestion.c File Reference
#include "main.h"
#include "TCP.h"
Include dependency graph for Congestion.c:

Go to the source code of this file.

Data Structures

struct  stru_bic
 
struct  stru_congestion_var
 

Macros

#define BICTCP_BETA_SCALE
 
#define BICTCP_B
 
#define ACK_RATIO_SHIFT   4
 

Typedefs

typedef struct stru_bic BIC
 
typedef struct stru_bicPBIC
 
typedef struct stru_congestion_var CONGESTIONVAR
 
typedef struct stru_congestion_varPCONGESTIONVAR
 

Functions

void cubic_ack_received (PNETSIM_SOCKET s)
 
void init_cubic (PNETSIM_SOCKET s)
 
static bool isReno (PNETSIM_SOCKET s)
 
static bool isBIC (PNETSIM_SOCKET s)
 
static bool isNewReno (PNETSIM_SOCKET s)
 
static bool isFastRetransmit (PNETSIM_SOCKET s)
 
static bool isFastRecovery (PNETSIM_SOCKET s)
 
static PCONGESTIONVAR get_congestionvar (PNETSIM_SOCKET s)
 
static void set_congestionvar (PNETSIM_SOCKET s, PCONGESTIONVAR data)
 
static UINT16 congestion_get_MSS (PNETSIM_SOCKET s)
 
static UINT16 congestion_get_WND (PNETSIM_SOCKET s)
 
static UINT32 congestion_get_RCV_WND (PNETSIM_SOCKET s)
 
static void set_ssthres (PNETSIM_SOCKET s, UINT32 newssthres)
 
static UINT32 get_ssthres (PNETSIM_SOCKET s)
 
static void set_cwnd (PNETSIM_SOCKET s, UINT32 newcwnd)
 
static UINT32 get_cwnd (PNETSIM_SOCKET s)
 
UINT32 get_cwnd_print (PNETSIM_SOCKET s)
 
static bool tcp_in_slow_start (PNETSIM_SOCKET s)
 
static void bictcp_reset (PBIC ca)
 
static void bictcp_init (PNETSIM_SOCKET sk, PTCP_DEV_VAR tcp)
 
static void init_congestion (PNETSIM_SOCKET s)
 
static void increase_cwnd (PNETSIM_SOCKET s, UINT16 increase)
 
static void congestion_set_IW (PNETSIM_SOCKET s)
 
static void congestion_set_MSS (PNETSIM_SOCKET s, UINT16 mss)
 
static bool isDupAck (PNETSIM_SOCKET s, PCONGESTIONVAR var)
 
static bool isFullAck (PNETSIM_SOCKET s, PCONGESTIONVAR var)
 
static void slowStart (PNETSIM_SOCKET s, PCONGESTIONVAR var)
 
static void CongestionAvoidance (PNETSIM_SOCKET s, PCONGESTIONVAR var)
 
static void FastRetransmit (PNETSIM_SOCKET s, PCONGESTIONVAR var)
 
static void FastRecovery (PNETSIM_SOCKET s, PCONGESTIONVAR var)
 
static void newReno_FastRecovery (PNETSIM_SOCKET s, PCONGESTIONVAR var)
 
static UINT32 bictcp_recalc_ssthresh (PNETSIM_SOCKET sk)
 
static void bictcp_update (PNETSIM_SOCKET sk)
 
static void bictcp_cong_avoid (PNETSIM_SOCKET sk, UINT32 segmentAcked)
 
static void bictcp_fastretransmit (PNETSIM_SOCKET s)
 
static void bictcp_acked (PNETSIM_SOCKET sk)
 
static void oldtahoe_ack_received (PNETSIM_SOCKET s)
 
static void tahoe_ack_received (PNETSIM_SOCKET s)
 
static void reno_ack_received (PNETSIM_SOCKET s)
 
static void newreno_ack_received (PNETSIM_SOCKET s)
 
static void bic_ack_received (PNETSIM_SOCKET s)
 
static void congestion_rto_timeout (PNETSIM_SOCKET s)
 
void congestion_setcallback (PNETSIM_SOCKET s)
 

Macro Definition Documentation

◆ ACK_RATIO_SHIFT

#define ACK_RATIO_SHIFT   4

Definition at line 43 of file Congestion.c.

◆ BICTCP_B

#define BICTCP_B
Value:
4 /*
* In binary search,
* go to point (max+min)/N
*/

Definition at line 27 of file Congestion.c.

◆ BICTCP_BETA_SCALE

#define BICTCP_BETA_SCALE
Value:
1024 /* Scale factor beta calculation
* max_cwnd = snd_cwnd * beta
*/

Definition at line 25 of file Congestion.c.

Typedef Documentation

◆ BIC

typedef struct stru_bic BIC

◆ CONGESTIONVAR

◆ PBIC

typedef struct stru_bic* PBIC

◆ PCONGESTIONVAR

Function Documentation

◆ bic_ack_received()

static void bic_ack_received ( PNETSIM_SOCKET  s)
static

Definition at line 785 of file Congestion.c.

◆ bictcp_acked()

static void bictcp_acked ( PNETSIM_SOCKET  sk)
static

Definition at line 625 of file Congestion.c.

◆ bictcp_cong_avoid()

static void bictcp_cong_avoid ( PNETSIM_SOCKET  sk,
UINT32  segmentAcked 
)
static

Definition at line 544 of file Congestion.c.

◆ bictcp_fastretransmit()

static void bictcp_fastretransmit ( PNETSIM_SOCKET  s)
static

Definition at line 578 of file Congestion.c.

◆ bictcp_init()

static void bictcp_init ( PNETSIM_SOCKET  sk,
PTCP_DEV_VAR  tcp 
)
static

Definition at line 229 of file Congestion.c.

◆ bictcp_recalc_ssthresh()

static UINT32 bictcp_recalc_ssthresh ( PNETSIM_SOCKET  sk)
static

Definition at line 439 of file Congestion.c.

Here is the call graph for this function:

◆ bictcp_reset()

static void bictcp_reset ( PBIC  ca)
inlinestatic

Definition at line 219 of file Congestion.c.

Here is the call graph for this function:

◆ bictcp_update()

static void bictcp_update ( PNETSIM_SOCKET  sk)
inlinestatic

Definition at line 468 of file Congestion.c.

◆ congestion_get_MSS()

static UINT16 congestion_get_MSS ( PNETSIM_SOCKET  s)
inlinestatic

Definition at line 117 of file Congestion.c.

◆ congestion_get_RCV_WND()

static UINT32 congestion_get_RCV_WND ( PNETSIM_SOCKET  s)
inlinestatic

Definition at line 127 of file Congestion.c.

Here is the call graph for this function:

◆ congestion_get_WND()

static UINT16 congestion_get_WND ( PNETSIM_SOCKET  s)
inlinestatic

Definition at line 122 of file Congestion.c.

Here is the call graph for this function:

◆ congestion_rto_timeout()

static void congestion_rto_timeout ( PNETSIM_SOCKET  s)
static

Definition at line 829 of file Congestion.c.

◆ congestion_set_IW()

static void congestion_set_IW ( PNETSIM_SOCKET  s)
static

Definition at line 298 of file Congestion.c.

◆ congestion_set_MSS()

static void congestion_set_MSS ( PNETSIM_SOCKET  s,
UINT16  mss 
)
static

Definition at line 311 of file Congestion.c.

◆ congestion_setcallback()

void congestion_setcallback ( PNETSIM_SOCKET  s)

Definition at line 853 of file Congestion.c.

Here is the caller graph for this function:

◆ CongestionAvoidance()

static void CongestionAvoidance ( PNETSIM_SOCKET  s,
PCONGESTIONVAR  var 
)
static

Definition at line 345 of file Congestion.c.

◆ cubic_ack_received()

void cubic_ack_received ( PNETSIM_SOCKET  s)

Definition at line 693 of file CUBIC.c.

◆ FastRecovery()

static void FastRecovery ( PNETSIM_SOCKET  s,
PCONGESTIONVAR  var 
)
static

Definition at line 406 of file Congestion.c.

◆ FastRetransmit()

static void FastRetransmit ( PNETSIM_SOCKET  s,
PCONGESTIONVAR  var 
)
static

Definition at line 358 of file Congestion.c.

◆ get_congestionvar()

static PCONGESTIONVAR get_congestionvar ( PNETSIM_SOCKET  s)
inlinestatic

Definition at line 107 of file Congestion.c.

Here is the caller graph for this function:

◆ get_cwnd()

static UINT32 get_cwnd ( PNETSIM_SOCKET  s)
static

Definition at line 186 of file Congestion.c.

Here is the caller graph for this function:

◆ get_cwnd_print()

UINT32 get_cwnd_print ( PNETSIM_SOCKET  s)

Definition at line 200 of file Congestion.c.

Here is the caller graph for this function:

◆ get_ssthres()

static UINT32 get_ssthres ( PNETSIM_SOCKET  s)
static

Definition at line 155 of file Congestion.c.

Here is the caller graph for this function:

◆ increase_cwnd()

static void increase_cwnd ( PNETSIM_SOCKET  s,
UINT16  increase 
)
static

Definition at line 273 of file Congestion.c.

◆ init_congestion()

static void init_congestion ( PNETSIM_SOCKET  s)
static

Definition at line 243 of file Congestion.c.

◆ init_cubic()

void init_cubic ( PNETSIM_SOCKET  s)

Definition at line 290 of file CUBIC.c.

◆ isBIC()

static bool isBIC ( PNETSIM_SOCKET  s)
inlinestatic

Definition at line 83 of file Congestion.c.

◆ isDupAck()

static bool isDupAck ( PNETSIM_SOCKET  s,
PCONGESTIONVAR  var 
)
static

Definition at line 325 of file Congestion.c.

◆ isFastRecovery()

static bool isFastRecovery ( PNETSIM_SOCKET  s)
inlinestatic

Definition at line 100 of file Congestion.c.

◆ isFastRetransmit()

static bool isFastRetransmit ( PNETSIM_SOCKET  s)
inlinestatic

Definition at line 93 of file Congestion.c.

◆ isFullAck()

static bool isFullAck ( PNETSIM_SOCKET  s,
PCONGESTIONVAR  var 
)
static

Definition at line 330 of file Congestion.c.

◆ isNewReno()

static bool isNewReno ( PNETSIM_SOCKET  s)
inlinestatic

Definition at line 88 of file Congestion.c.

◆ isReno()

static bool isReno ( PNETSIM_SOCKET  s)
inlinestatic

Definition at line 77 of file Congestion.c.

◆ newreno_ack_received()

static void newreno_ack_received ( PNETSIM_SOCKET  s)
static

Definition at line 739 of file Congestion.c.

◆ newReno_FastRecovery()

static void newReno_FastRecovery ( PNETSIM_SOCKET  s,
PCONGESTIONVAR  var 
)
static

Definition at line 413 of file Congestion.c.

◆ oldtahoe_ack_received()

static void oldtahoe_ack_received ( PNETSIM_SOCKET  s)
static

Definition at line 636 of file Congestion.c.

◆ reno_ack_received()

static void reno_ack_received ( PNETSIM_SOCKET  s)
static

Definition at line 698 of file Congestion.c.

◆ set_congestionvar()

static void set_congestionvar ( PNETSIM_SOCKET  s,
PCONGESTIONVAR  data 
)
inlinestatic

Definition at line 112 of file Congestion.c.

◆ set_cwnd()

static void set_cwnd ( PNETSIM_SOCKET  s,
UINT32  newcwnd 
)
static

Definition at line 169 of file Congestion.c.

◆ set_ssthres()

static void set_ssthres ( PNETSIM_SOCKET  s,
UINT32  newssthres 
)
static

Definition at line 141 of file Congestion.c.

◆ slowStart()

static void slowStart ( PNETSIM_SOCKET  s,
PCONGESTIONVAR  var 
)
static

Definition at line 335 of file Congestion.c.

◆ tahoe_ack_received()

static void tahoe_ack_received ( PNETSIM_SOCKET  s)
static

Definition at line 656 of file Congestion.c.

◆ tcp_in_slow_start()

static bool tcp_in_slow_start ( PNETSIM_SOCKET  s)
inlinestatic

Definition at line 214 of file Congestion.c.