A2.1.5 · Network fundamentals
A2.1.5 · 网络基础
The TCP/IP Model
TCP/IP 模型
An international parcel passes through distinct stages before it arrives: packed into a box, labelled with an address, routed through sorting hubs, physically carried by a vehicle. The TCP/IP model breaks a network transmission into that same kind of stack of distinct stages.
一个国际包裹送达之前要经过若干明确的阶段:装箱、贴上地址标签、经由分拣中心转运、由交通工具实际运送。TCP/IP 模型正是把一次网络传输拆解为同样这种一层层分明的阶段。
Explainer
讲解
The TCP/IP model (Transmission Control Protocol/Internet Protocol model) is a conceptual model that splits everything involved in a network transmission into four separate layers, each with its own specific job, stacked on top of each other from the physical connection up to the actual application.
TCP/IP 模型(传输控制协议/网际协议模型)是一种概念模型,它把一次网络传输涉及的一切拆分为四个独立的层次,每一层都有自己特定的职责,从最底层的物理连接一直堆叠到最上层的实际应用程序。
Data sent by one device travels DOWN through the four layers, gaining something extra at each one, then travels back UP through the same four layers in reverse at the receiving end, having each addition removed in the opposite order it was added.
一台设备发送的数据会向下穿过这四层,每一层都会为其附加一些额外的内容,到达接收端后再以相反的顺序向上穿过同样的四层,每一次附加的内容都按添加的相反顺序被剥离。
Explainer
讲解
The role of each layer
每一层的作用
Each layer only worries about its own specific job, and passes the result down (or up) to the next layer, which is what lets protocols and hardware from completely different vendors still work together.
每一层只关心自己特定的职责,并把结果向下(或向上)传递给下一层,正是这一点让来自完全不同厂商的协议与硬件依然能够协同工作。
| Layer (top to bottom) | 层次(从上到下) | Role | 职责 | Protocols & devices from this job | 相关协议与设备 |
|---|---|---|---|---|---|
| Application | 应用层 | Defines the format actual programs use to exchange data, the layer closest to what a user sees. | 定义实际程序之间交换数据所使用的格式,是最接近用户所见内容的一层。 | HTTP, HTTPS, DHCP | |
| Transport | 传输层 | Gets data from the correct application on one device to the correct application on another, splitting it into manageable pieces and identifying which application each piece belongs to using port numbers. | 把数据从一台设备上正确的应用程序,传送到另一台设备上正确的应用程序,将数据拆分为可处理的小份,并用端口号标识每一份数据属于哪个应用程序。 | TCP, UDP | |
| Internet | 网际层 | Gets a piece of data from one network to another, choosing the route, using an address that uniquely identifies each device. | 把一份数据从一个网络送到另一个网络,选择路由,使用能唯一标识每台设备的地址。 | Routers; IP addressing | 路由器;IP 编址 |
| Network interface | 网络接口层 | Handles the actual physical transmission itself: converting data into signals (electrical, light or radio) and moving it across real cabling or through the air. | 负责实际的物理传输本身:把数据转换为信号(电信号、光信号或无线电信号),并通过实体线缆或空中将其传送出去。 | Modems, NICs, switches, wireless access points; MAC addresses | 调制解调器、网卡、交换机、无线接入点;MAC 地址 |
This is exactly the same four-layer split used to classify the devices in A2.1.3 and the protocols in A2.1.4, this page is what ties both of those together into one model.
这正是 A2.1.3 中用来划分设备、以及 A2.1.4 中用来划分协议的同一套四层结构,本页正是把两者归纳到同一个模型之中。
Data always crosses these four layers in this order, application at the top down to network interface at the bottom, whichever specific protocol is doing the work at each one.
数据总是按照这个顺序穿过这四层,从最上方的应用层到最下方的网络接口层,无论每一层具体由哪种协议在工作。
Worked example
示例讲解
Sending one request through all four layers
一次请求穿过全部四层
Noah's phone requests a photo from a photo-sharing app's server. Watch the same request gain something new at every layer on the way out, then have each addition stripped back off, in reverse order, when it arrives.
Noah 的手机向一款照片分享应用的服务器请求一张照片。请看同一个请求在发出途中如何在每一层获得一些新内容,到达后又如何按相反顺序被逐层剥离。
Application layer. The photo-sharing app builds a request for the photo, following the rules of its own application protocol. This request is just the app's own data so far, nothing network-specific has been added yet.
应用层。照片分享应用按照自身应用层协议的规则构建出对照片的请求。此时这个请求还只是应用自身的数据,尚未添加任何与网络相关的内容。
Transport layer. The request is handed to the transport layer, which wraps it in a segment carrying a port number (so the server's operating system knows which application it's for) and a sequence number (so it can be reassembled correctly if it's split into more than one piece).
传输层。请求被交给传输层,传输层将其封装进一个段中,携带端口号(使服务器的操作系统知道该请求属于哪个应用程序)和序列号(以便在被拆分为多份时能够正确重组)。
Internet layer. The segment is wrapped again, this time in a packet carrying the source and destination IP addresses, so it can actually be routed across the network toward the right device.
网际层。该段再次被封装,这次封装进一个数据包中,携带源和目的 IP 地址,以便它能够真正被路由穿过网络,送往正确的设备。
Network interface layer. Finally the packet is wrapped once more into a frame carrying the physical hardware (MAC) addresses of the very next device it needs to reach, then converted into an actual signal, radio waves in this case, and transmitted.
网络接口层。最后,数据包再一次被封装进一个帧中,携带下一跳设备的物理硬件(MAC)地址,随后被转换为实际的信号(在这里是无线电波)并发送出去。
Arrival, in reverse. The server's own network interface layer receives the signal and removes the MAC-address wrapper, the internet layer removes the IP-address wrapper, the transport layer removes the port/sequence wrapper, and the application layer is finally left holding the original request, exactly what was sent, unwrapped one layer at a time in the opposite order to how it was wrapped.
到达,逆序进行。服务器自身的网络接口层接收信号并移除 MAC 地址封装,网际层移除 IP 地址封装,传输层移除端口/序列号封装,最终应用层拿到的正是最初发出的那个请求,原封不动,按照封装时相反的顺序逐层被拆解。
This is what "reliable data transmission" actually rests on: the transport layer's sequence numbers let out-of-order pieces be reassembled correctly, the internet layer's addressing gets each piece to the right device at all, and the network interface layer's own error-checking catches damage during physical transmission. Each layer contributes one specific piece of the overall reliability, no single layer does all of it alone.
这正是"可靠数据传输"真正的基础:传输层的序列号让乱序到达的数据能够被正确重组,网际层的编址使每一份数据得以送达正确的设备,而网络接口层自身的错误检测则能捕捉物理传输过程中出现的损坏。每一层各自贡献了整体可靠性中特定的一部分,没有哪一层能独自完成全部工作。
Check your understanding
A packet arrives at a laptop's network card as a stream of electrical signals. Which layer is responsible for converting those signals back into a usable digital frame, and reading the hardware address to check the frame is actually meant for this device?
Common mistake
RecurringA genuinely documented pattern: candidates place a named protocol at the wrong layer, most often putting HTTP or DHCP at the transport layer (confusing them with TCP/UDP, which really do belong there) instead of the application layer where they actually operate.
Protocol at the wrong layer: "HTTP operates at the transport layer, since that's where data actually gets sent across the network." HTTP defines what an application's own data looks like, it doesn't do the actual sending, that's TCP's job one layer down.
Correct layer, correct reasoning: "HTTP operates at the application layer, since it defines the format a web browser and server use to exchange requests and responses. TCP, at the transport layer below it, is what actually gets that HTTP data delivered reliably." Names the right layer for the right reason, distinguishing what a protocol defines from how the data physically moves.
Revision questions
Past-paper style. Write an answer, then reveal the marking points and mark yourself.
[2]Describe the role of the network interface layer in the TCP/IP model.
Marking points
评分要点
- The network interface layer wraps a packet in a frame carrying the physical (MAC) address of the next device to reach.
- It then converts the frame into an actual signal on the medium (radio waves, electrical pulses or light), and on arrival removes the frame wrapper before passing the packet up.
- 网络接口层把数据包包进一个帧,该帧带有下一个要到达设备的物理(MAC)地址。
- 然后它把帧转换成介质上的实际信号(无线电波、电脉冲或光),到达时先去掉帧的封装,再把数据包向上传递。
[3]State which TCP/IP layer each of the following protocols operates at: HTTP, TCP, DHCP.
[6]Explain how the four layers of the TCP/IP model interact to ensure a message is transmitted reliably from one device to another.
Marking points
评分要点
- The application layer builds the request in the format of its own protocol.
- The transport layer wraps it in a segment with a port number (which application) and a sequence number (so out-of-order pieces can be reassembled), and TCP re-sends any lost segment.
- The internet layer wraps it in a packet with source and destination IP addresses so routers can route it to the right device.
- The network interface layer wraps it in a frame with the next-hop MAC address and turns it into a signal.
- At the other end each layer removes its own wrapper in reverse order; the sequence numbers put the data back in order and the checks confirm it arrived complete, which is what makes the transmission reliable.
- 应用层按其自身协议的格式构建请求。
- 传输层把它包进一个带端口号(哪个应用)和序列号(以便重组乱序的片段)的数据段,并且 TCP 重发任何丢失的段。
- 网际层把它包进一个带源和目标 IP 地址的数据包,使路由器能把它路由到正确的设备。
- 网络接口层把它包进一个带下一跳 MAC 地址的帧,并转换成信号。
- 在另一端,每一层按相反顺序去掉自己的封装;序列号把数据放回顺序,校验确认它完整到达,这正是使传输可靠的原因。
Flashcards
Active recall for this statement’s key terms.
Keep this statement’s practice with you
Free account: unlock every revision question and flashcard for A2.1.5, and every other IB CS 2027 statement.