TCP/IP

三次握手

第一次A->B: SYN=1; seq = x
(表示A到B的连接请求) (表示A发送从序号x开始的报文)
第二次B<-A: SYN=1; seq = y; ACK=1; ack = x+1
(表示B到A的连接请求)(表示B发送从序号y开始的报文)(ack有效)
(ack:已经接受到A序号为x的请求,期待从x+1开始的)
第三次A->B: ACK=1; ack = y+1; seq = x+1

4-time close

client -> server
1. active closer: FIN(seq = x)
2. passive closer: ACK(seq = v; ack = x+1) the sequence number for ACK is v
3. passive closer: FIN(seq = w; ack = x+1) the sequence number for FIN is w
4. active closer: ACK(seq = x+1; ack = w+1)

 

difference between 0.0.0.0 and 127.0.0.1 

  • 0.0.0.0 is used for binding to all available network interfaces.
  • 127.0.0.1 is used for communication with the local machine, and it always refers to the loopback interface.

When configuring a service, the choice between 0.0.0.0 and 127.0.0.1 depends on whether you want the service to be accessible only locally (using 127.0.0.1) or from any network interface on the machine (using 0.0.0.0).

posted @ 2023-11-30 21:29  PEAR2020  阅读(2)  评论(0编辑  收藏  举报