TCP TIME_WAIT问题

发布于 2024-12-03 11:44:40 字数 192 浏览 0 评论 0原文

我读过一本TCP和socket编程书。我有一个问题,

TCP的TIME_WAIT状态应该保持2MSL时间段为 书上说。但是互联网如何探索类似的应用程序 没有这个问题吗?

根据文档,是 4 分钟,但是在 Internet explorer 中 我什至不需要等待 10 秒来刷新网页?

这是如何运作的?我很困惑请解释一下。

I have read a TCP and socket programming book. I have a question,

The TIME_WAIT state of the TCP should remain 2MSL time period as
the book said. But how then a internet explore like application
does not have this problem?

According to the documentation, it's 4 minutes , but in Internet explore
I don't have to wait even 10 seconds to refresh a web page?

How this works? I'm confused please explain.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

蔚蓝源自深海 2024-12-10 11:44:40

有几种可能性,我在下面列出了其中一些。

首先,并非所有会话都进入 TIME_WAIT 状态。如果对方关闭连接,则本地转换为 ESTABLISHEDCLOSE_WAITLAST_ACKCLOSED,因此有不涉及TIME_WAIT

其次,TIME_WAIT 状态适用于会话,它是一个 5 元组 {protocol,source-ip,source-port,dest-ip,dest-端口}

如果这些值中的任何一个在下一个会话(通常是源端口)发生变化,则不会受到上一个会话的影响。

最后,浏览器不必在每次请求后关闭会话。为了重用它们,更有可能(为了效率)维护一个打开的会话池,例如当您想要下载包含五十个图像的页面时(一个会话而不是五十一个)。

它甚至可以在页面完全加载后使此类会话保持打开状态,以防您访问该服务器上的其他内容。

There are a few possibilities, some of which I've listed below.

The first is that not all sessions move through the TIME_WAIT state at all. If the other side closes the connection, the local transitions are ESTABLISHED, CLOSE_WAIT, LAST_ACK and CLOSED, so there's no TIME_WAIT involved.

Secondly, the TIME_WAIT state applies to a session, which is a 5-tuple {protocol,source-ip,source-port,dest-ip,dest-port}.

If any of those values change for the next session (usually source-port), that's unaffected by the previous session.

Lastly, the browser doesn't have to shut down the session after each request. It's more likely (for efficiency) to maintain a pool of open sessions in order to re-use them, such as when you want to download a page with fifty images (one session rather than fifty one).

It can even leave such sessions open after a page is fully loaded, on the off-chance you'll access something else on that server.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文