Notes on the serial number of TCP packets (SKB) in linux

Source: Internet
Author: User
Note: to modify the TCP protocol, you have encountered the serial number of the tcp group to be modified, however, if the end_seq of SKB is found in the tcp_sendmsg function, but it is not clear that seq is not found, it is initialized there, and

Notes about SKB serial number

To modify the TCP protocol, the serial number of the tcp group to be modified is encountered, but the end_seq of SKB is not found in the tcp_sendmsg function.

I don't know where to initialize it. I tracked the sk_stream_alloc_skb () function for SKB allocation and found it in function skb_entail:

Static inline void skb_entail (struct sock * sk, struct sk_buff * skb)

{
Struct tcp_sock * tp = tcp_sk (sk );
Struct tcp_skb_cb * tcb = TCP_SKB_CB (skb );


Skb-> csum = 0;
Tcb-> seq = tcb-> end_seq = tp-> write_seq;
Tcb-> flags = TCPHDR_ACK;
Tcb-> sacked = 0;
Skb_header_release (skb );
Tcp_add_write_queue_tail (sk, skb );
Sk-> sk_wmem_queued + = skb-> truesize;
Sk_mem_charge (sk, skb-> truesize );
If (tp-> nonagle & TCP_NAGLE_PUSH)
Tp-> nonagle & = ~ TCP_NAGLE_PUSH;

}

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.