19#ifdef _TEST_CONGESTION_
25#define BICTCP_BETA_SCALE 1024
48#define ACK_RATIO_SHIFT 4
181 assert(var->
cwnd < 65535);
271#ifdef _TEST_CONGESTION_
272 fp = fopen(
"Congestion.csv",
"w");
273 fprintf(fp,
"Called For,Time,CWND,ssThres,Flight Size,Ackno,UNA,\n");
290 assert(var->
cwnd <= 65535);
308 if (var->
SMSS > 2190)
310 else if (var->
SMSS > 1095)
312 else if (var->
SMSS <= 1095)
355 RTT < pstruEventDetails->dEventTime)
464 if (segCwnd <= ca->low_window)
486 if (cwnd <= ca->low_window)
493 if (cwnd < ca->last_max_cwnd)
513 ca->
cnt = cwnd / dist;
519 if (cwnd < ca->last_max_cwnd +
BICTCP_B)
650#ifdef _TEST_CONGESTION_
651 fprintf(fp,
"Ack,%lf,%d,%d,%d,%d,%d\n",
692#ifdef _TEST_CONGESTION_
693 fprintf(fp,
"Ack,%lf,%d,%d,%d,%d,%d\n",
733#ifdef _TEST_CONGESTION_
734 fprintf(fp,
"Ack,%lf,%d,%d,%d,%d,%d\n",
779#ifdef _TEST_CONGESTION_
780 fprintf(fp,
"Ack,%lf,%d,%d,%d,%d,%d\n",
823#ifdef _TEST_CONGESTION_
824 fprintf(fp,
"Ack,%lf,%d,%d,%d,%d,%d\n",
847#ifdef _TEST_CONGESTION_
848 fprintf(fp,
"RTO,%lf,%d,%d,%d,%d,%d\n",
static bool isReno(PNETSIM_SOCKET s)
static void set_congestionvar(PNETSIM_SOCKET s, PCONGESTIONVAR data)
static void bic_ack_received(PNETSIM_SOCKET s)
static UINT16 congestion_get_WND(PNETSIM_SOCKET s)
static void slowStart(PNETSIM_SOCKET s, PCONGESTIONVAR var)
static bool isBIC(PNETSIM_SOCKET s)
static UINT32 get_ssthres(PNETSIM_SOCKET s)
static void newReno_FastRecovery(PNETSIM_SOCKET s, PCONGESTIONVAR var)
static bool isFastRecovery(PNETSIM_SOCKET s)
void cubic_ack_received(PNETSIM_SOCKET s)
static void congestion_set_IW(PNETSIM_SOCKET s)
static bool isNewReno(PNETSIM_SOCKET s)
static void bictcp_acked(PNETSIM_SOCKET sk)
struct stru_congestion_var * PCONGESTIONVAR
static bool isFastRetransmit(PNETSIM_SOCKET s)
void init_cubic(PNETSIM_SOCKET s)
static void set_ssthres(PNETSIM_SOCKET s, UINT32 newssthres)
static bool isDupAck(PNETSIM_SOCKET s, PCONGESTIONVAR var)
static bool isFullAck(PNETSIM_SOCKET s, PCONGESTIONVAR var)
static UINT16 congestion_get_MSS(PNETSIM_SOCKET s)
static void FastRetransmit(PNETSIM_SOCKET s, PCONGESTIONVAR var)
static void bictcp_fastretransmit(PNETSIM_SOCKET s)
static UINT32 bictcp_recalc_ssthresh(PNETSIM_SOCKET sk)
static PCONGESTIONVAR get_congestionvar(PNETSIM_SOCKET s)
static void bictcp_cong_avoid(PNETSIM_SOCKET sk, UINT32 segmentAcked)
static void increase_cwnd(PNETSIM_SOCKET s, UINT16 increase)
static void bictcp_init(PNETSIM_SOCKET sk, PTCP_DEV_VAR tcp)
static void init_congestion(PNETSIM_SOCKET s)
static void congestion_rto_timeout(PNETSIM_SOCKET s)
static void bictcp_update(PNETSIM_SOCKET sk)
static UINT32 get_cwnd(PNETSIM_SOCKET s)
static bool tcp_in_slow_start(PNETSIM_SOCKET s)
static void oldtahoe_ack_received(PNETSIM_SOCKET s)
void congestion_setcallback(PNETSIM_SOCKET s)
static void bictcp_reset(PBIC ca)
UINT32 get_cwnd_print(PNETSIM_SOCKET s)
static void set_cwnd(PNETSIM_SOCKET s, UINT32 newcwnd)
static void congestion_set_MSS(PNETSIM_SOCKET s, UINT16 mss)
static void tahoe_ack_received(PNETSIM_SOCKET s)
static UINT32 congestion_get_RCV_WND(PNETSIM_SOCKET s)
struct stru_congestion_var CONGESTIONVAR
static void reno_ack_received(PNETSIM_SOCKET s)
static void CongestionAvoidance(PNETSIM_SOCKET s, PCONGESTIONVAR var)
static void newreno_ack_received(PNETSIM_SOCKET s)
static void FastRecovery(PNETSIM_SOCKET s, PCONGESTIONVAR var)
#define fnNetSimError(x,...)
bool tcp_sack_lossRecoveryPhase(PNETSIM_SOCKET s)
UINT32 get_highAck(PNETSIM_SOCKET s)
void tcp_sack_fastRetransmit(PNETSIM_SOCKET s)
bool tcp_sack_isLost(PNETSIM_SOCKET s, UINT seqNum)
EXPORTED struct stru_NetSim_EventDetails * pstruEventDetails
double get_RTT(PTCB tcb, UINT ackNo)
static PTCP_DEV_VAR GET_TCP_DEV_VAR(NETSIM_ID d)
UINT32 window_scale_get_cwnd(PNETSIM_SOCKET s)
void resend_segment_without_timeout(PNETSIM_SOCKET s, UINT seq)
UINT16 IW
Size of the sender's congestion window after the three-way handshake is completed.
UINT16 RMSS
To store the size of the largest segment that the receiver is willing to accept.
UINT16 ssthresh
To store slow start threshold value.
UINT16 rwnd
To store the most recently advertised receiver window size value.
UINT16 SMSS
To store the size of the largest segment that the sender can transmit.
UINT16 cwnd
To store Congestion window size value.
void(* init_congestionalgo)(PNETSIM_SOCKET)
struct stru_tcp_Transmission_Control_Block::stru_tcb_send_seq_var SND
void(* rto_expired)(PNETSIM_SOCKET)
UINT32(* get_RCVWND)(PNETSIM_SOCKET)
struct stru_tcp_Transmission_Control_Block::stru_tcp_rcv Rcv
UINT16(* get_MSS)(PNETSIM_SOCKET)
struct stru_tcp_Transmission_Control_Block::stru_tcp_snd Snd
void(* set_MSS)(PNETSIM_SOCKET s, UINT16)
UINT16(* get_WND)(PNETSIM_SOCKET)
void(* ack_received)(PNETSIM_SOCKET)
struct stru_tcp_Transmission_Control_Block::stru_tcb_curr_seg_var SEG