当前位置:网站首页>Netstat common scene record
Netstat common scene record
2022-07-18 21:14:00 【MrMoving】
Parameter description
netstat The parameters of the command are described as follows :
-a: Show ports in all connections ( Without this parameter, the ports in listening status are not displayed by default )
-n: Don't make DNS polling , Show IP( It can speed up the operation )
-r: Show routing table information
-t: Show TCP Port connection status of the transmission protocol
-u: Show UDP Port connection status of the transmission protocol
-l: Only the ports in listening state are listed (state by listen)
-p: Display the corresponding process id And program name
-c: At regular intervals , Execute this netstat command
Return information explanation
[[email protected] app]# netstat -anp
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 2717/master
tcp 0 0 10.10.1.132:6379 0.0.0.0:* LISTEN 9717/redis-server 1
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 1874/nginx: master
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1291/sshd
tcp 0 0 10.10.1.132:6379 10.0.20.3:62257 ESTABLISHED 9717/redis-server 1
tcp 0 0 10.10.1.132:6379 10.10.1.113:51015 ESTABLISHED 9717/redis-server 1
tcp6 0 0 :::8080 :::* LISTEN 6727/java
tcp6 0 0 :::8081 :::* LISTEN 2239/java
tcp6 0 0 :::43381 :::* LISTEN 6819/java
tcp6 0 0 :::22 :::* LISTEN 925/sshd
Proto: The name of the agreement (tcp Agreement or udp agreement )
recv-Q: Network receive queue , Indicates that the received data has been buffered locally , But how much is not taken away by the process recv()
send-Q: Network send queue , It means that the other party did not receive the data or did not Ack Of , Still in the local buffer recv-Q,send-Q These two values should usually be 0, If not for 0 There may be a problem .packets There should be no stacking in either queue . It's not acceptable 0 situation .
Local Address: Represents an open assignment on the local server ip:port
Foreign Address: An external port that communicates with the local port socket. Show rules and Local Address identical
About 0.0.0.0 And :: respectively ipv4 And ipv6 Default of in ip, There is no further explanation here . The third of the three colons is ip Separation from ports
State: Link state
PID/Program:PID Process id,Program That is, use the socket Applications for
Expand ,state explain
| state | describe |
|---|---|
| LISTEN | First, the server needs to open a socket monitor , Status as LISTEN./* The socket is listening for incoming connections. Listening from far away TCP Connection request for port */ |
| SYN_SENT | The client calls... Through the application connect Conduct active open. So the client tcp Send a SYN To request a connection . Then the state is set to SYN_SENT./*The socket is actively attempting to establish a connection. Wait for the matching connection request after sending the connection request */ |
| SYN_RECV | The server should send ACK Confirm the... Of the client SYN, At the same time, I send a SYN. Then the state is set to SYN_RECV/* A connection request has been received from the network. Wait for confirmation of the connection request after receiving and sending a connection request */ |
| ESTABLISHED | Represents an open connection , Both parties can interact or already interact in data ./* The socket has an established connection. Represents an open connection , Data can be transmitted to users */ |
| FIN_WAIT1 | Active shut down (active close) End application call close, So it TCP issue FIN Request to actively close the connection , After entering FIN_WAIT1 state ./* The socket is closed, and the connection is shutting down. Waiting for remote TCP Connection interrupt request for , Or confirmation of previous connection interruption request */ |
| CLOSE_WAIT | Passive closure (passive close) End TCP Receive FIN after , Just send out ACK In response to FIN request ( Its reception is also passed to the upper application as a file Terminator ), And enter CLOSE_WAIT./* The remote end has shut down, waiting for the socket to close. Waiting for the connection interrupt request from the local user */ |
| FIN_WAIT2 | Active closing termination to ACK after , It's in FIN-WAIT-2 ./* Connection is closed, and the socket is waiting for a shutdown from the remote end. From remote TCP Wait for connection interrupt request */ |
| LAST_ACK | After a period of passive shutdown , Applications that receive the end of file The sequence will call CLOSE Close the connection . This leads to its TCP Also send a FIN, Waiting for each other's ACK. It's in LAST-ACK ./* The remote end has shut down, and the socket is closed. Waiting for acknowledgement. Wait for the original send to remote TCP The confirmation of the interrupt request */ |
| TIME_WAIT | Received at active shutdown FIN after ,TCP Is sent ACK package , And enter TIME-WAIT state ./* The socket is waiting after close to handle packets still in the network. Wait enough time to make sure that the remote TCP Receive confirmation of connection interrupt request */ |
| CLOSING | Relatively rare ./* Both sockets are shut down but we still don’t have all our data sent. Waiting for remote TCP Confirmation of connection interruption */ |
| CLOSED | The passive closing end receives ACK After package , It's in closed The state of . End of connection ./* The socket is not being used. There is no connection state */ |
| UNKNOWN | Unknown Socket state ./* The state of the socket is unknown. */ |
remarks :
SYN: ( Sync sequence number ,Synchronize Sequence Numbers) The logo is only established on three handshakes TCP Valid when connected . Means a new TCP Connection request .
ACK: ( Confirmation number ,Acknowledgement Number) It's right TCP The confirmation mark of the request , At the same time, it indicates that the peer system has successfully received all data .
FIN: ( End mark ,FINish) To end a TCP Come back . But the corresponding port is still open , Ready to receive subsequent data .
边栏推荐
- 劍指 Offer 57. 和為s的兩個數字
- What is industrial planning? How to make industrial planning for industrial parks
- UE4 Lights UWorld to FScene [2]
- R language uses LM function to build regression model and BoxCox function of mass package to find the best power transformation to improve the fitting degree of the model (determine the best λ Paramet
- redis实现分布式锁
- R语言使用lm函数构建多元回归模型、并根据模型系数写出回归方程、使用summary函数计算出模型的汇总统计信息(R方、F统计量、残差分布、残差标准误差、系数等)
- How to do fine operation management in industrial parks
- Sword finger offer 57 - ii Continuous positive sequence with sum s
- UE4 shadow: perobjectshadow verification
- Embedded development: seven techniques for accelerating firmware development
猜你喜欢

【js 封装一个简单的异步API,获取异步操作结果和过程解析】
![[JS encapsulates a simple asynchronous API to obtain asynchronous operation results and process parsing]](/img/98/fa6006639acfff1b49f47b9a64688e.png)
[JS encapsulates a simple asynchronous API to obtain asynchronous operation results and process parsing]

What skills do software test engineers need to master if they need to speak 20K? I dare to be higher with these skills~

How to do fine operation management in industrial parks

Pending issues

Redis cluster

Learning notes of Transe model

Discussion on ble Bluetooth battery service

OpenCV 教程 02: OpenCV 的核心操作

激活navicat提示rsa public key not find的问题
随机推荐
[try to hack] NTLM and LM Foundation
高数下|二重积分的概念及性质|高数叔|手写笔记
Daily question brushing record (XXV)
C language as a push box
剑指 Offer 53 - II. 0~n-1中缺失的数字
R language uses LM function to build multiple regression model, writes regression equation according to model coefficient, and uses summary function to calculate the summary statistical information of
jenkins安装
leetcode:1552. Magnetic force between two balls [maximum value of maximum value = two points]
鸿蒙开发板上安装HAP应用方法之经典
Classic application method of installing HAP on Hongmeng development board
Ten million level data MySQL distinct group by
[cloud native] Devops (IV): integrated sonar Qube
What skills do software test engineers need to master if they need to speak 20K? I dare to be higher with these skills~
Sword finger offer 54 The k-th node of binary search tree
Flutter 绘制非常有趣的贝塞尔曲线动画
World Tour Finals 2019 D - Distinct Boxes 题解
【Try to Hack】NTLM和LM基础
Markdown 基本语法格式
Sword finger offer 53 - ii Missing numbers from 0 to n-1
Programming implementation of I2C communication protocol