1.Dns解析
有DNS将域名解析为对应服务器的IP地址
2.建立TCP连接
获得服务器IP后,三次握手才能建立连接。
1)客户->服务端 syn(syn=j);
2)服务端到->客户 ack和syn(ack=j+1,syn=k);
3)客户再发一个ack(ack=k+1) 然后双方达成协议,建立连接。
3.发生http或https请求:
4.处理请求
5.返回响应结果
网络状态码:如200 301 302 403 404
https://www.cnblogs.com/Jun10ng/p/12347055.html
6.浏览器渲染
7.断开连接
tcp四次挥手
1)客户->服务器,需要关闭tcp;2)服务器->客户,准备关闭;3)服务端->客户,确认关闭;4)此时客户端等待两个最大消息存活时间后,客户端->服务端 确认关闭
TIME_WAIT 是为了保证全双工的 TCP 连接正常终止。