Question on TCP / IP Port Binding

I would like to know if the server application will always respond to the same port? I read somewhere that the server will use a different port to continue listening to the "listening" port. Can someone provide me more details? Thank!

+3
source share
2 answers

As part of the process of establishing TCP communications, a communications channel is established on another port. The source and destination β€œport” numbers correspond to 16-bit fields in the TCP packet header. Once the channel is established, communication takes place on this port with the corresponding source port and target port values ​​in the header fields.

; TCP- , , .

+2

TCP- , TCP- .

TCP- (address1, port1) (address2, port2) - TCP-.

, , (address, port), .

, netstat Oracle , 1521, :

Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address               Foreign Address             State
tcp        0      0 0.0.0.0:1521                0.0.0.0:*                   LISTEN
tcp        0      0 127.0.0.1:1521              127.0.0.1:32776             ESTABLISHED
tcp        0      0 192.168.9.126:1521          192.168.9.124:32798         ESTABLISHED
tcp        0      0 192.168.9.126:1521          192.168.9.124:32823         ESTABLISHED
tcp        0      0 192.168.9.126:1521          192.168.9.124:32822         ESTABLISHED
tcp        0      0 192.168.9.126:1521          192.168.9.124:32821         ESTABLISHED
tcp        0      0 192.168.9.126:1521          192.168.9.124:32820         ESTABLISHED
tcp        0      0 192.168.9.126:1521          192.168.9.124:32819         ESTABLISHED
tcp        0      0 192.168.9.126:1521          192.168.9.124:32818         ESTABLISHED
tcp        0      0 127.0.0.1:1521              127.0.0.1:30536             ESTABLISHED
tcp        0      0 192.168.9.126:1521          192.168.9.124:36969         ESTABLISHED
tcp        0      0 127.0.0.1:32776             127.0.0.1:1521              ESTABLISHED
tcp        0      0 127.0.0.1:30536             127.0.0.1:1521              ESTABLISHED
tcp        0      0 192.168.9.126:1521          192.168.9.124:37786         ESTABLISHED
tcp        0      0 192.168.9.126:1521          192.168.9.124:37035         ESTABLISHED
tcp        0      0 192.168.9.126:1521          192.168.9.124:37034         ESTABLISHED
tcp        0      0 192.168.9.126:1521          192.168.9.124:33018         ESTABLISHED
+2

Source: https://habr.com/ru/post/1729424/


All Articles