https://dbsgrad.sfsu.edu/~mmurphy/dachen/header_files/net/tcp_h.htm
struct open_request {
struct open_request *dl_next; /* Must be first member! */
__u32 rcv_isn;
__u32 snt_isn;
__u16 rmt_port;
__u16 mss;
__u8 retrans;
__u8 __pad;
unsigned snd_wscale : 4,
rcv_wscale : 4,
tstamp_ok : 1,
sack_ok : 1,
wscale_ok : 1;
/* The following two fields can be easily recomputed I think -AK */
__u32 window_clamp; /* window clamp at creation time */
__u32 rcv_wnd; /* rcv_wnd offered first time */
__u32 ts_recent;
unsigned long expires;
struct or_calltable *class;
struct sock *sk;
union {
struct tcp_v4_open_req v4_req;
#if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE)
struct tcp_v6_open_req v6_req;
#endif
} af;
#ifdef CONFIG_IP_TRANSPARENT_PROXY
__u16 lcl_port; /* LVE */
#endif
};
4.3.5 struct open _ request
The structure keeps account of all the open connection requests which are not yet
accepted by the application (see Fig. 4.12 ). There is one open_request for each
connection request for a listening socket. When the connection request arrives, a
new structure is allocated and various fi elds of this structure are initialized. Most
of the fi elds are initialized from tcp and ip header fi elds of the SYN connection
request and are very specifi c to the connection. These are explained ahead. The
structure is hashed in the listening sockets syn Queue sk → tp_pinfo.af_tcp → listen_
opt → syn_table according to the port number of the connection requester (see Fig.
4.17 ). The SYN/ACK packet is sent to the connection originator (client). When the
fi nal ACK is received for the SYN/ACK packet associated with this connection
request, a new socket is created which is marked to be in the TCP_ESTABLISHED
state because a three - way handshake is over for this connection. Most of the fi elds
of the new socket are duplicated from the parent socket except for the fi elds that
are very specifi c to the connection. Now the open_request node is moved from Syn
queue to the listening sockets (parent) accept queue (see Fig. 4.18 ). Since the new
connection is not yet accepted, it remains in the accept queue and no I/O occurs
over the connection from our end. Now let us discuss struct open_request.
dl _ next : This is the pointer to the next link in the SYN queue collision hash
table for the listening socket.
rcv _ isn : This is the initial sequence number taken from the SYN packet received
as connection request.
snt _ isn : This is the initial sequence number calculated at the listening socket
end. This is calculated each time a new connection request is received. The
cs 4.10. inet_listen() .value is sent in SYN/ACK reply as part of the TCP header ’ s sequence
number fi eld.
rmt _ port : This is the port number of the other end of the TCP connection,
which has generated the connection request. The value is taken from the
TCP header of the SYN packet received as connection request.
mss : This is the maximum segment size used for the TCP connection. The value
is taken from either the TCP mss options (of SYN packet received) or the
tcp_opt structure ( tp → user_mss ), whichever is smaller
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment