TCP/IP Five-Layer Software Model Overview

201 阅读3分钟

TCP/IP Five-Layer Software Model Overview

  • tcp-ip 五层软件模型预览
  • 原文
  • just for 学习用,侵删;
  • 全英也不难,读起来,没啥障碍;

Basic Needs for TCP/IP Communication

Some of the applications we use require us to move data across a network from point A to point B. The Transmission (传播) Control Protocol/Internet Protocol (TCP/IP) network provides a framework for transmitting(传送) this data, and it requires some basic information from us to move this data.

image.png

We need to specify(指定) if we want the most reliable(可靠的) or fastest transmissions(传输) and we need to specify where we want the data delivered(发表). Sometimes our data is routed based on its IP addresses and sometimes its routed based on its MAC address. The data we send needs both addressing capabilities. This information needs to be sent along with all transmitted data. We also need to physically transmit the data from one location to another.


TCP/IP Five Layer Software Model Overview

We need to provide this basic information needed by TCP/IP in a standard format the network can understand. This format is provided by its five-layer software model.

Each layer provides TCP/IP with the basic information it needs to move our data across the network. These layers group functions according to the task that needs to be performed. Every function in this model is targeted to help a specific layer perform its job.

image.png

Each layer only communicates with adjacent(邻近的) layers. Software running in a higher layer does not have to know about or perform tasks delegated(委托) to lower layer functions and vice versa. For example, the software you write for your application only needs to know how to request a connection with a remote host using the Transport layer. It doesn’t need to know how bits are encoded before transmission. That’s the Physical layer’s job.

You are probably familiar with the seven-layer OSI model. TCP/IP simplifies this model to five layers. OSI stands for Open Systems Interconnect which is a standard communication systems model. The top four layers of the seven layer OSI model have been condensed into the top two TCP/IP layers.


TCP/IP Five

Layer Model Summary

Before we discuss each layer, let’s briefly(略略, 简要地) summarize what each layer does.

Application Layer

As you might have guessed, the Application layer is where applications requiring network communications live. Examples of these applications include email clients and web browsers. These applications use the Transport Layer to send requests to connect to remote hosts.

Transport Layer(传输层)

The Transport layer establishes(建立) the connection between applications running on different hosts. It uses TCP for reliable(可靠的) connections and UDP for fast connections. It keeps track of the processes running in the applications above it by assigning(分配) port numbers to them and uses the Network layer to access the TCP/IP network.

Network Layer

The Network layer is responsible for creating the packets that move across the network. It uses IP addresses to identify the packet’s source and destination(目的地, 终点, 地头).

Data Link Layer

The Data Link layer is responsible(负责任的) for creating the frames that move across the network. These frames encapsulate(封装) the packets and use MAC addresses to identify the source and destination(目的地).

Physical Layer

The Physical layer encodes and decodes the bits found in a frame and includes the transceiver(收发器) that drives and receives the signals on the network.

image.png

Transmit(发送, 发射, 传递) Data Using Network Layers

Now that we know the primary(基本的) job of each layer, let’s see how they work together to send and receive data across a TCP/IP network.

This is a simplified view of how the network layers work together to generate frames. Higher layers pass information to lower layers. Each layer adds information called a header to the data being passed to it. This header contains information the layer needs to perform its job. We will start at the Application layer.

从上到下,每传输一层,就往head里添加信息

Application Layer

The Application layer generates a message. In this case, the specific application is a web browser requesting a webpage download. This message is then sent to the Transport layer.

Transport Layer

The Transport layer adds the TCP or UDP header which includes the source and destination port addresses. Additional information like the packet sequence number used for TCP will also be added to the header. The data generated by the transport layer is referred to as a Segment(段) if TCP is used, and is referred to as a Datagram(数据报) if UDP is used. This segment is then sent to the Network layer.

Network Layer

The Network layer adds a header including the source and destination(目的地) IP address to generate a packet. This packet is then sent to the Data Link layer.

Data Link Layer

The Data Link layer adds a header containing the MAC address information to create a frame. The frame is then sent it to the Physical layer to transmit the bits.

image.png

TCP/IP Five Layer Software Model Terminology Reference

image.png