I am trying to understand what are linux services/process involved in making tcp 3-way handshake. for example who send reject flag [R.] for SYN request.
example: port 8088 is listening and 8089 is open. tcpdump output below after making a connection request on both the ports.
for 8089:
$ sudo tcpdump -i any -nn port 8088 or port 8089
04:23:12.260621 IP 192.168.112.129.52298 > 192.168.112.129.8089: Flags [S], seq 300539809, win 43690, options [mss 65495,sackOK,TS val 19840756 ecr 0,nop,wscale 7], length 0
04:23:12.260637 IP 192.168.112.129.8089 > 192.168.112.129.52298: Flags [R.], seq 0, ack 300539810, win 0, length 0
for 8088:
$ sudo tcpdump -i any -nn port 8088 or port 8089
04:23:21.680070 IP 192.168.112.129.42814 > 192.168.112.129.8088: Flags [S], seq 670408355, win 43690, options [mss 65495,sackOK,TS val 19850176 ecr 0,nop,wscale 7], length 0
04:23:21.680087 IP 192.168.112.129.8088 > 192.168.112.129.42814: Flags [S.], seq 1185731197, ack 670408356, win 43690, options [mss 65495,sackOK,TS val 19850176 ecr 19850176,nop,wscale 7], length 0
04:23:21.680098 IP 192.168.112.129.42814 > 192.168.112.129.8088: Flags [.], ack 1, win 342, options [nop,nop,TS val 19850176 ecr 19850176], length 0
so here which linux service sending sending [R.] for 8089 and [S.] SYN-ACK for 8088? also how the packet reach listener, what is the flow? what will be the flow when firewall rule is added (using iptables) to drop packet on 8089?
thanks in advance :)
lsof
,netstat
orss
)? Or are you specifically interested in what's going on at the TCP/IP/ethernet levels, in the Linux kernel?