TCB结构中各变量统计

 

Date

Author

Description

2006-11-20

Kevin

First Draft

TCB结构取自kernel 2.6.16.27,

RX                  : 变量只被”接收”模块访问

TX                      : 变量只被”发送”模块访问

Timer                : 变量只被”超时处理”模块访问

RX, TX               : 变量只被”接收/发送”模块访问

RX, Timer             : 变量只被”接收/超时处理”模块访问

TX, Timer             : 变量只被”发送/超时处理”模块访问

RX, TX, Timer         : 变量只被”接收/发送/超时处理”模块访问

struct tcp_sock {

/* inet_connection_sock has to be the first member of tcp_sock */

struct inet_connection_sock   inet_conn;

int   tcp_header_len;      /* Bytes of tcp header to send              */                  // RX, TX

/*

*    Header prediction flags

*    0x5?10 << 16 + snd_wnd in net byte order

*/

__u32     pred_flags;                                                                           // RX, TX

/*

*    RFC793 variables by their proper names. This means you can

*    read the code and the spec side by side (and laugh ...)

*    See RFC793 and RFC1122. The RFC writes these in capitals.

*/

__u32     rcv_nxt;  /* What we want to receive next   */                                            // RX, TX

__u32     snd_nxt;  /* Next sequence we send             */                                                     // RX, TX

__u32     snd_una;  /* First byte we want an ack for    */                                                     // RX, TX

__u32     snd_sml;  /* Last byte of the most recently transmitted small packet */                         // TX

__u32     rcv_tstamp;     /* timestamp of last received ACK (for keepalives) */                      // Timer

__u32     lsndtime; /* timestamp of last sent data packet (for restart window) */             // RX, TX, Timer

/* Data for direct copy to user */

struct {

struct sk_buff_head       prequeue;

struct task_struct    *task;

struct iovec            *iov;

int                 memory;

int                 len;

} ucopy;                                                                                                                         // RX, Timer

__u32     snd_wl1; /* Sequence for window update           */                                              // RX

__u32     snd_wnd; /* The window we expect to receive     */                                              // RX, TX, Timer

__u32     max_window; /* Maximal window ever seen from peer      */                                // RX, TX

__u32     mss_cache;     /* Cached effective mss, not including SACKS */                           // RX, TX

__u16     xmit_size_goal;      /* Goal for segmenting output packets  */                           // TX

/* XXX Two bytes hole, try to pack */

__u32     window_clamp;      /* Maximal window to advertise          */                   // RX, TX

__u32     rcv_ssthresh;   /* Current window clamp                    */                       // RX, TX

__u32     frto_highmark;       /* snd_nxt when RTO occurred */                         // RX

__u8       reordering;     /* Packet reordering metric.         */                                              // RX

__u8       frto_counter;   /* Number of new acks after RTO */                                              // RX

__u8       nonagle;  /* Disable Nagle algorithm?             */                                     // TX

__u8       keepalive_probes; /* num of allowed keep alive probes      */                  // Timer

/* RTT measurement */

__u32     srtt;         /* smoothed round trip time << 3  */                                                            // RX, TX

__u32     mdev;            /* medium deviation                    */                                                     // RX

__u32     mdev_max;     /* maximal mdev for the last rtt period */                                        // RX

__u32     rttvar;            /* smoothed mdev_max               */                                                     // RX

__u32     rtt_seq;    /* sequence number to update rttvar     */                                                  // RX

__u32     packets_out;    /* Packets which are "in flight"     */                                               // RX, TX, Timer

__u32     left_out;  /* Packets which leaved network   */                                                            // RX, TX

__u32     retrans_out;    /* Retransmitted packets out         */                                                  // RX, TX

/*

*      Options received (usually on last packet, some only on SYN packets).

*/

struct tcp_options_received rx_opt;                                                                                          // RX, TX

/*

*    Slow start and congestion control (see also Nagle, and Karn & Partridge)

*/

__u32     snd_ssthresh;   /* Slow start size threshold           */                              // RX, TX

__u32     snd_cwnd;      /* Sending congestion window             */                                              // RX, TX

__u16     snd_cwnd_cnt;       /* Linear increase counter             */                          // RX

__u16     snd_cwnd_clamp; /* Do not allow snd_cwnd to grow above this */                  // RX

__u32     snd_cwnd_used;                                                                                                    // RX, TX

__u32     snd_cwnd_stamp;                                                          // RX, TX

struct sk_buff_head       out_of_order_queue; /* Out of order segments go here */

__u32     rcv_wnd; /* Current receiver window          */                                  // RX, TX

__u32     rcv_wup; /* rcv_nxt on last window update sent  */                              // RX, TX

__u32     write_seq;       /* Tail(+1) of data held in tcp send buffer */                         // RX, TX

__u32     pushed_seq;    /* Last pushed seq, required to talk to windows */                    // TX

__u32     copied_seq;     /* Head of yet unread data            */                              // RX, TX

/*    SACKs data    */

struct tcp_sack_block duplicate_sack[1]; /* D-SACK block */                              // RX, TX

struct tcp_sack_block selective_acks[4]; /* The SACKS themselves*/                        // RX, TX

struct tcp_sack_block recv_sack_cache[4];                                              // RX

/* from STCP, retrans queue hinting */

struct sk_buff* lost_skb_hint;

struct sk_buff *scoreboard_skb_hint;

struct sk_buff *retransmit_skb_hint;

struct sk_buff *forward_skb_hint;

struct sk_buff *fastpath_skb_hint;

int     fastpath_cnt_hint;                                                          // RX

int     lost_cnt_hint;                                                              // RX

int     retransmit_cnt_hint;                                                         // TX

int     forward_cnt_hint;                                                           // TX

__u16     advmss;          /* Advertised MSS               */                                   // RX, TX

__u16     prior_ssthresh; /* ssthresh saved at recovery start */                                // RX, TX

__u32     lost_out;  /* Lost packets                     */                                        // RX, TX

__u32     sacked_out;     /* SACK'd packets                */                                    // RX, TX

__u32     fackets_out;    /* FACK'd packets                */                                    // RX, TX

__u32     high_seq; /* snd_nxt at onset of congestion   */                                    // RX, TX

__u32     retrans_stamp; /* Timestamp of the last retransmit,                     // RX, TX

* also used in SYN-SENT to remember stamp of

* the first SYN. */

__u32     undo_marker; /* tracking retrans started here. */                       // RX, TX

int   undo_retrans;  /* number of undoable retransmissions. */                    // RX, TX

__u32     urg_seq;  /* Seq of received urgent pointer */                          // RX

__u16     urg_data; /* Saved octet of OOB data and control flags */                // RX

__u8       urg_mode;      /* In urgent mode          */                                                // RX, TX

__u8       ecn_flags;       /* ECN status bits.                */                         // RX

__u32     snd_up;          /* Urgent pointer           */                                        // RX, TX

__u32     total_retrans;   /* Total retransmits for entire connection */

__u32     bytes_acked;   /* Appropriate Byte Counting - RFC3465 */

unsigned int           keepalive_time;        /* time before keep alive takes place */     // RX, Timer

unsigned int           keepalive_intvl;  /* time interval between keep alive probes */    // Timer

int                 linger2;                                                     // RX, Timer

unsigned long last_synq_overflow;

/* Receiver side RTT estimation */

struct {

__u32     rtt;

__u32     seq;

__u32     time;

} rcv_rtt_est;                                                                         // RX

/* Receiver queue space */

struct {

int   space;

__u32     seq;

__u32     time;

} rcvq_space;                                                                                  // RX

}

可见,TCB结构中大多数变量都会被”发送”,”接收”模块同时修改, 不可能以下理想情况: ”发送”模块访问一部分标量,”接收”模块

访问一部分变量,互不冲突.

所以, 在设计中必须解决多TCB结构的竞争访问问题.

转载于:https://www.cnblogs.com/e-shannon/p/10381367.html

TCP/IP研究(2)-TCB相关推荐

  1. OSI参考模型与TCP/IP协议的比较研究

     OSI参考模型与TCP/IP协议的比较研究  OSI参考模型与TCP/IP协议的比较研究 摘要:OSI参考模型与TCP/IP协议是网际互联中的两个重要协议体系.本文从首先分别介绍了两个协议体系的产生 ...

  2. 一场由nginx优化引起的tcp/ip及tcpdump研究

    一场由nginx优化引起的tcp/ip及tcpdump研究 在这里不得不再吐槽下国内整个IT粗糙浮躁,度娘下来的中文文档几尽抄袭~google下来的文档英文文档质量远高于国内中文文档. 用ie或没有安 ...

  3. 服务器ipv4协议认证,基于TCP/IP应用层密码认证协议的研究

    Internet在全世界盛行,它的基础协议就是传输控制协议/网际协议(TCP/IP).TCP/IP是一种网络通信协议,它规范了网络上的所有通信设备,尤其是一个主机与另一个主机之间的数据往来以及传送方式 ...

  4. 计算机网络拥塞解决方法,对TCP/IP计算机网络拥塞控制的研究

    摘 要: 为提升计算机的网络性能,更好地避免拥塞现象的发生,需要对其进行必要的技术控制.鉴于此,对基于TCP/IP协议的网络拥塞控制方法进行分析.在TCP拥塞控制中主要采用TCP Tahoe,TCP ...

  5. 基于TI C6000的TCP/IP协议栈的研究与实现

    本文来自:东北大学信息学院 李松  吴建华 <TI C6000DSP上TCP/IP协议栈的实现> 有适当删减. 摘要:针对TIC6000系列DSP网络开发工具NDK进行研究,结合TMS32 ...

  6. 深入理解网络通信与tcp/ip协议

    计算机网络发展简史 1.诞生阶段,20世纪60年代中期之前的第一代计算机网络是以单个计算机为中心的远程联机系统. 2.ARPANET,多个主机通过通信线路互联起来.60年代初.当时,美国国防部为了保证 ...

  7. TCP/IP网络协议详解

    一. 计算机网络体系结构分层 一图看完本文 计算机网络体系结构分层 计算机网络体系结构分层 Frame:   物理层的数据帧概况 Ethernet II: 数据链路层以太网帧头部信息 Internet ...

  8. TCP/IP协议族(第4版)

    链接:https://pan.baidu.com/s/1Pia2by1s83kiVXEyU-dPRg 密码:ruur <世界著名计算机教材精选·TCP/IP协议族(第4版)>可作为大学生和 ...

  9. wireshark的使用教程--用实践的方式帮助我们理解TCP/IP中的各个协议是如何工作的

     wireshark的使用教程 --用实践的方式帮助我们理解TCP/IP中的各个协议是如何工作的 wireshark是一款抓包软件,比较易用,在平常可以利用它抓包,分析协议或者监控网络,是一个比较好的 ...

最新文章

  1. MPB:扬州大学王梦芝组-反刍动物瘤胃原虫18S rRNA测序分析技术
  2. 进程和程序:编写shell——《Unix/Linux编程实践教程》读书笔记(第8章)
  3. 【Java基础】HashMap原理详解
  4. Java SE 6 新特性: JMX 与系统管理(转载)-asp.net关注
  5. Firefox 插件解决 LeetCode 海外版自动跳转到中文版问题
  6. thinkphp3 php jwt,thinkphp框架使用JWTtoken的方法详解
  7. Spring MVC Controller 的同一个 URL 请求,根据逻辑判断返回 JSON 或者 HTML 视图
  8. ubuntu窗口最小化消失,任务栏上无法找到的解决方法
  9. 林斌首曝红米骁龙855旗舰新机:3200万像素弹出式前置摄像头
  10. 百会云办公:国内首家微信办公一站式解决方案
  11. 服务器SNMP协议测试
  12. Unity 复制内容到剪贴板
  13. 5.3 使用数据结构对真实世界建模
  14. mysql杀死锁死的进程_如何杀死MySQL进程
  15. 捕捉“五一劳动节”海报设计灵感
  16. 神经网络常用的训练方式,神经网络训练过程详解
  17. 解决-画图程序无法读取-无效的位图文件
  18. Paper之EfficientDet: 《Scalable and Efficient Object Detection—可扩展和高效的目标检测》的翻译及其解读—续篇
  19. Arduino三位数码管
  20. flat2lla matlab,Convert from flat Earth position to array of geodetic coordinates

热门文章

  1. Identify ksusetxn DID:An Deadlock ID
  2. 关于IIS连接数限制的介绍
  3. 3.redis集群部署3主3从
  4. Vue.js视频教程
  5. EditPlus注册码 亲测最新版可用
  6. 二叉树的实现(Java语言描述)
  7. Linux/Unix操作系统目录结构的来历
  8. php fpm 日志记录,使用Nginx在PHP-FPM 7上启用错误日志记录?
  9. python怎么打开turtle_python的turtle库真好玩
  10. springboot中使用websocket_在 Spring Boot 项目中使用 activiti