NetSim Source Code Help
Loading...
Searching...
No Matches
TCB.h
Go to the documentation of this file.
1#pragma once
2/************************************************************************************
3* Copyright (C) 2022 *
4* TETCOS, Bangalore. India *
5* *
6* Tetcos owns the intellectual property rights in the Product and its content. *
7* The copying, redistribution, reselling or publication of any or all of the *
8* Product or its content without express prior written consent of Tetcos is *
9* prohibited. Ownership and / or any other right relating to the software and all *
10* intellectual property rights therein shall remain at all times with Tetcos. *
11* *
12* This source code is licensed per the NetSim license agreement. *
13* *
14* No portion of this source code may be used as the basis for a derivative work, *
15* or used, for any purpose other than its intended use per the NetSim license *
16* agreement. *
17* *
18* This source code and the algorithms contained within it are confidential trade *
19* secrets of TETCOS and may not be used as the basis for any other software, *
20* hardware, product or service. *
21* *
22* Author: Shashi Kant Suman *
23* *
24* ----------------------------------------------------------------------------------*/
25
26#ifndef _NETSIM_TCB_H_
27#define _NETSIM_TCB_H_
28#ifdef __cplusplus
29extern "C" {
30#endif
31
32 typedef struct stru_tcp_queue_info
33 {
35 double time;
39 typedef struct stru_tcp_queue
40 {
44
46 {
47 TCP_CONNECTION_STATE tcp_state; ///< Present State of the TCP Connection.
48 TCP_CONNECTION_STATE tcp_prev_state; ///< Present State of the Connection.
49
51
52
53 /*Send Sequence Variables as per RFC 793 page number 18
54
55 SND.UNA - send unacknowledged
56 SND.NXT - send next
57 SND.WND - send window
58 SND.UP - send urgent pointer
59 SND.WL1 - segment sequence number used for last window update
60 SND.WL2 - segment acknowledgment number used for last window
61 update
62 ISS - initial send sequence number
63 */
65 {
74
75 /* Receive Sequence Variables
76
77 RCV.NXT - receive next
78 RCV.WND - receive window
79 RCV.UP - receive urgent pointer
80 IRS - initial receive sequence number
81 */
83 {
89
90 /*Current Segment Variables
91
92 SEG.SEQ - segment sequence number
93 SEG.ACK - segment acknowledgment number
94 SEG.LEN - segment length
95 SEG.WND - segment window
96 SEG.UP - segment urgent pointer
97 SEG.PRC - segment precedence value
98 */
100 {
108
111
113 {
114 double RTO;
115 double SRTT;
116 double RTT_VAR;
118#define TCP_RTO(tcb) (tcb->TCP_TIMER.RTO)
119#define TCP_SRTT(tcb) (tcb->TCP_TIMER.SRTT)
120#define TCP_RTTVAR(tcb) (tcb->TCP_TIMER.RTT_VAR)
124
126
127 //Congestion algo data
129
130 //Congestion Algo callback
138
139 //Delayed Ack
144
145 //Time wait timer
149
150 //SACK
153 {
160 bool isSackOption; //Check whether current ack has sack option
162
163 //Send Variable
165 {
166 UINT8 Wind_Shift; //RFC 7323
167 bool TS_OK; //RFC 7323
169
170 //Receive Variable
172 {
173 UINT8 Wind_Shift; //RFC 7323
175
176 //Window Scaling
178
179 //Timestamp option
181 UINT32 TSVal; //Received TSval
182
184
185#ifdef __cplusplus
186}
187#endif
188#endif //_NETSIM_TCB_H_
#define UINT64
Definition: Linux.h:37
#define UINT
Definition: Linux.h:38
#define UINT32
Definition: Linux.h:35
#define UINT16
Definition: Linux.h:33
#define UINT8
Definition: Linux.h:31
struct stru_tcp_queue_info * PQueueInfo
struct stru_tcp_queue_info Queueinfo
struct stru_tcp_queue TCP_QUEUE
struct stru_tcp_Transmission_Control_Block * PTCB
struct stru_tcp_Transmission_Control_Block TCB
struct stru_tcp_queue * PTCP_QUEUE
enum enum_tcp_variant TCPVARIANT
enum enum_tcpstate TCP_CONNECTION_STATE
enum enum_tcp_ack_type TCPACKTYPE
#define PNETSIM_SOCKET
Definition: TCP_Header.h:24
struct stru_tcp_Transmission_Control_Block::stru_sack_scoreboard prevScoreboard
void(* init_congestionalgo)(PNETSIM_SOCKET)
Definition: TCB.h:131
TCP_CONNECTION_STATE tcp_state
Present State of the TCP Connection.
Definition: TCB.h:47
NetSim_PACKET * eventPacketptr
Definition: TCB.h:123
struct stru_tcp_Transmission_Control_Block::stru_tcb_send_seq_var SND
void(* rto_expired)(PNETSIM_SOCKET)
Definition: TCB.h:133
UINT32(* get_RCVWND)(PNETSIM_SOCKET)
Definition: TCB.h:137
struct stru_tcp_Transmission_Control_Block::stru_tcp_rcv Rcv
UINT16(* get_MSS)(PNETSIM_SOCKET)
Definition: TCB.h:134
struct stru_tcp_Transmission_Control_Block::stru_tcp_timer TCP_TIMER
struct stru_tcp_Transmission_Control_Block::stru_tcp_snd Snd
struct stru_tcp_Transmission_Control_Block::stru_tcb_recv_seq_var RCV
void(* set_MSS)(PNETSIM_SOCKET s, UINT16)
Definition: TCB.h:136
UINT16(* get_WND)(PNETSIM_SOCKET)
Definition: TCB.h:135
void(* ack_received)(PNETSIM_SOCKET)
Definition: TCB.h:132
struct stru_tcp_Transmission_Control_Block::stru_sack_scoreboard scoreboard
TCP_CONNECTION_STATE tcp_prev_state
Present State of the Connection.
Definition: TCB.h:48
struct stru_tcp_Transmission_Control_Block::stru_tcb_curr_seg_var SEG
bool isSacked
Definition: TCB.h:36
double time
Definition: TCB.h:35
NetSim_PACKET * packet
Definition: TCB.h:34
struct stru_tcp_queue_info * next
Definition: TCB.h:37
UINT size
Definition: TCB.h:41
PQueueInfo queue
Definition: TCB.h:42