从客户端到服务器的 HTTP 请求。 TCP/IP 栈之旅
HTTP request from client to server. The TCP/IP stack journey
我试图了解 HTTP 请求从主机到服务器所经过的数据包和硬件的过程。
首先,HTTP 数据被放入 TCP 数据包(第 4 层)。然后将其打包到 IP 数据包(第 3 层)中,由 NIC(第 2 层)构建并通过物理介质(电缆、光纤等)传输(第 1 层)到最近的路由器。
问题1.路由器中的NIC(连接到客户端LAN的那个,因为路由器有两个NIC)是否重建帧并传递有效负载(因此IP包)到路由器的处理器?这似乎合乎逻辑,但我无法在网上找到明确说明这一点的任何地方。
路由器然后有一个IP包并根据它的路由转发它table通过另一个网卡,它再次成帧并传输它。
逐跳,服务器的 NIC 最终接收并重建帧并将它们传递给...(参见问题 2)...,它解压缩 TCP 包,HTTP 信息不知何故是读取并使用给定的参数执行操作。
问题二:内核?是电脑里面负责IP的packaging/unpackaging吗?
问题3:计算机中TCP和"understanding"HTTP是如何负责的?它是 OS 的哪一部分?我猜这也是负责理解 HTTP 的。
我知道还有更多细节,但整个问题太长了。我也很高兴看到有趣的链接以深入了解此事。
Question 1. Does the NIC (the one connected to the client's LAN, since the router has two NICs) in the router reconstructs the frames and passes the payload (so the IP package) to the router's processor? It seems logical, but I have not been able to find anywhere online where this is explicitly said.
我不知道你说的 'reconstruct' 是什么意思。 NIC 接收 帧并将其传递给 CPU,可能是通过 DMA。
The router then has an IP package and forwards it according to its routing table through the other NIC, which frames it again and transmits it.
这个词是'packet',不是'package'。否则正确。
Hop-by-hop, the NIC of the server finally receives & reconstructs the frames
同样,我不知道 'reconstruct' 是什么意思。帧已接收。
and passes them to the ...(See Question 2)..., which unpacks the TCP package and somehow the HTTP information is read and the operation is executed with the arguments given.
Question 2: Kernel? Is it the one responsible for IP packaging/unpackaging inside the computer?
到网络堆栈的 IP 层,将其向上传递到 TCP 层,最终将数据传递到服务器应用程序。
Question 3: How is responsible for TCP and "understanding" HTTP in the computer?
TCP层负责理解TCP。 HTTP是应用层协议,被应用理解。
What part of the OS is it? I am guessing this one is also the responsible for understanding HTTP.
没有'it'。这里有两个单独的问题和两个单独的答案:见上文。
我试图了解 HTTP 请求从主机到服务器所经过的数据包和硬件的过程。
首先,HTTP 数据被放入 TCP 数据包(第 4 层)。然后将其打包到 IP 数据包(第 3 层)中,由 NIC(第 2 层)构建并通过物理介质(电缆、光纤等)传输(第 1 层)到最近的路由器。
问题1.路由器中的NIC(连接到客户端LAN的那个,因为路由器有两个NIC)是否重建帧并传递有效负载(因此IP包)到路由器的处理器?这似乎合乎逻辑,但我无法在网上找到明确说明这一点的任何地方。
路由器然后有一个IP包并根据它的路由转发它table通过另一个网卡,它再次成帧并传输它。
逐跳,服务器的 NIC 最终接收并重建帧并将它们传递给...(参见问题 2)...,它解压缩 TCP 包,HTTP 信息不知何故是读取并使用给定的参数执行操作。
问题二:内核?是电脑里面负责IP的packaging/unpackaging吗?
问题3:计算机中TCP和"understanding"HTTP是如何负责的?它是 OS 的哪一部分?我猜这也是负责理解 HTTP 的。
我知道还有更多细节,但整个问题太长了。我也很高兴看到有趣的链接以深入了解此事。
Question 1. Does the NIC (the one connected to the client's LAN, since the router has two NICs) in the router reconstructs the frames and passes the payload (so the IP package) to the router's processor? It seems logical, but I have not been able to find anywhere online where this is explicitly said.
我不知道你说的 'reconstruct' 是什么意思。 NIC 接收 帧并将其传递给 CPU,可能是通过 DMA。
The router then has an IP package and forwards it according to its routing table through the other NIC, which frames it again and transmits it.
这个词是'packet',不是'package'。否则正确。
Hop-by-hop, the NIC of the server finally receives & reconstructs the frames
同样,我不知道 'reconstruct' 是什么意思。帧已接收。
and passes them to the ...(See Question 2)..., which unpacks the TCP package and somehow the HTTP information is read and the operation is executed with the arguments given.
Question 2: Kernel? Is it the one responsible for IP packaging/unpackaging inside the computer?
到网络堆栈的 IP 层,将其向上传递到 TCP 层,最终将数据传递到服务器应用程序。
Question 3: How is responsible for TCP and "understanding" HTTP in the computer?
TCP层负责理解TCP。 HTTP是应用层协议,被应用理解。
What part of the OS is it? I am guessing this one is also the responsible for understanding HTTP.
没有'it'。这里有两个单独的问题和两个单独的答案:见上文。