I am requesting a webpage running on local server port 8080 and was expecting one connection to be established between the server (port 8080) and client (random port). But one additional port is also getting created and connecting to the server with TIME_WAIT
as status. So just wondering what is this time wait connection about?
Before connection to the webserver
netstat -ntap | grep 8080
tcp6 0 0 :::8080 :::* LISTEN 104965/java
After connecting to the web page which returned result immediately.
netstat -ntap | grep 8080
tcp6 0 0 :::8080 :::* LISTEN 104965/java
tcp6 0 0 ::1:8080 ::1:53950 ESTABLISHED 104965/java
tcp6 0 0 ::1:53948 ::1:8080 TIME_WAIT -
tcp6 0 0 ::1:53950 ::1:8080 ESTABLISHED 20656/_Postman --no
Port 53950
is the client random port to speak to server and this is understandable.
But what is the function of port 53948
with status TIME_WAIT
.
After about one minute the port 53948
connection to server is closed. But the port 54950
moves to TIME_WAIT
status.
netstat -ntap | grep 8080
tcp6 0 0 :::8080 :::* LISTEN 104965/java
tcp6 0 0 ::1:8080 ::1:53950 TIME_WAIT -
After about few minutes - a new port (54008) is open and is in TIME_WAIT
status.
netstat -ntap | grep 8080
tcp6 0 0 :::8080 :::* LISTEN 104965/java
tcp6 0 0 ::1:54008 ::1:8080 TIME_WAIT -
After about 5 minutes - all of the ports are closed
netstat -ntap | grep 8080
tcp6 0 0 :::8080 :::* LISTEN 104965/java
Could someone explain what TIME_WAIT
is about and why 2 additional ports are required.
wget
,curl
, or similar. Also, what you're really asking about is the workings of HTTP which are off-topic here as an application-layer protocol...