Function call relationships in the tcp protocol stack during tcp three-way handshake in the Linux Kernel

Source: Internet
Author: User
Function call relationships in the tcp protocol stack during tcp three-way handshake in the Linux kernel-Linux general technology-Linux programming and kernel information. For more information, see the following. Recently, I need to modify a set of tcp protocol stacks. I simply looked at the function calling process of the kernel tcp protocol stack. It is just a rough process and I did not make a detailed investigation, take a closer look at the changes. in addition, I only read the tcp part, and none of the following ip addresses is viewed.

Here we will briefly talk about the function call relationship of the three-way handshake that begins with the tcp connection:

Client: (initiate a connection request)

Tcp_v4_connect-> tcp_connect_init
-> Tcp_transmit_skb-> icsk-> icsk_af_ops-> send_check
(Tcp_v4_send_check)
-> Icsk-> icsk_af_ops-> queue_xmit
(Ip_queue_xmit)
Send syn packets externally
-> Inet_csk_reset_xmit_timer

Set the new timer

If you have not received a response for a while:
Tcp_retransmit_timer-> tcp_retransmit_skb-> tcp_transmit_skb
The other operations are the same as above.

Server: (receives syn and returns syn/ack)
Tcp_v4_rcv-> tcp_v4_do_rcv
-> Tcp_v4_hnd_req
-> Tcp_rcv_state_process
-> Icsk-> icsk_af_ops-> conn_request
(Tcp_v4_conn_request)->
-> Tcp_v4_init_sequence
-> Tcp_v4_send_synack
-> Ip_build_and_send_pkt

This is not comprehensive, but it was just written out in a hurry.

Client: (receives syn/ack and returns ack)
Tcp_v4_rcv-> tcp_v4_do_rcv
-> Tcp_rcv_state_process
-> Tcp_rcv_synsent_state_process
-> Tcp_ack
-> Tcp_store_ts_recent
-> Tcp_initialize_rcv_mss
-> Tcp_send_ack
-> Tcp_transmit_skb
-> Tcp_urg
-> Tcp_data_snd_check

Server: (receives ack)
Tcp_v4_do_rcv
-> Tcp_v4_hnd_req
-> Tcp_check_req
-> Inet_sk (sk)-> icsk_af_ops-> syn_recv_sock
-> Tcp_rcv_state_process
-> Tcp_sequence

The above is the description of the function call relationship in the tcp protocol stack of the three-way handshake. Due to the rush in sorting, some problems may exist.
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.