tcp_sock_struct

tcp_sock结构分析

位置:include/linux/tcp.h

基础机构
struct tcp_sock {
/* inet_connection_sock has to be the first member of tcp_sock */
struct inet_connection_sock inet_conn;
u16 tcp_header_len; /* Bytes of tcp header to send      */
u16 gso_segs;   /* Max number of segs per GSO packet    */

/*
 *  Header prediction flags
 *  0x5?10 << 16 + snd_wnd in net byte order
 *  预判标志,判定是否走快速处理路径
 */
__be32  pred_flags;

//都是序列号
/*
 *  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  下一个期望收到的序号   */
u32 copied_seq; /* Head of yet unread data,未读数据开头的序列号      */
u32 rcv_wup;    /* rcv_nxt on last window update sent,窗口更新就是发送ACK,ACK序号有新的变化(snd_una会移动)。发送ACK后就更新成rcv_nxt  */
u32 snd_nxt;    /* Next sequence we send        */

u32 snd_una;    /* First byte we want an ack for    */
u32 snd_sml;    /* Last byte of the most recently transmitted small packet */
u32 rcv_tstamp; /* timestamp of last received ACK (for keepalives) */
u32 lsndtime;   /* timestamp of last sent data packet (for restart window) */

u32 tsoffset;   /* timestamp offset */

struct list_head tsq_node; /* anchor in tsq_tasklet.head list */
unsigned long   tsq_flags;

/* Data for direct copy to user */
struct {
    struct sk_buff_head prequeue;
    struct task_struct  *task;
    struct msghdr       *msg;
    int         memory;
    int         len;
} ucopy;

u32 snd_wl1;    /* Sequence for window update窗口更新的ACK序号 */
u32 snd_wnd;    /* The window we expect to receive,接到对方ACK后,tcphdr中window字段  */
u32 max_window; /* Maximal window ever seen from peer,snd_wnd的最大值  */
u32 mss_cache;  /* Cached effective mss, not including SACKS */

u32 window_clamp;   /* Maximal window to advertise      */
u32 rcv_ssthresh;   /* Current window clamp
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值