search
HomeCommon ProblemWhat are the layers of the tcp/ip reference model?

The tcp/ip reference model is divided into 4 layers, namely: 1. Data link layer, which implements the network driver of the network card interface to handle the transmission of data on physical media; 2. Network layer, which implements Routing and forwarding of data packets; 3. Transport layer, which provides end-to-end communication for applications on two hosts; 4. Application layer, which is responsible for processing application logic.

What are the layers of the tcp/ip reference model?

The TCP/IP protocol suite is a four-layer protocol system. From bottom to top, they are the data link layer, network layer, transport layer and application layer. Each layer completes different
functions and is implemented through several protocols. The upper layer protocol uses the services provided by the lower layer protocol.
What are the layers of the tcp/ip reference model?

Data link layer (network interface layer)

The data link layer implements the network card interface Network driver to handle the transmission of data over physical media (such as Ethernet, Token Ring, etc.).

Two commonly used protocols in the data link layer are the ARP protocol (Address Resolve Protocol, address resolution protocol) and the RARP protocol (ReverseAddress Resolve Protocol, reverse address resolution protocol). They convert IP addresses to and from the machine's physical address (usually a MAC address, which is used by Ethernet, Token Ring, and 802.11 wireless networks).

The network layer uses an IP address to address a machine, while the data link layer uses a physical address to address a machine. Therefore, the network layer must first convert the IP address of the target machine into its physical address before it can be used. The services provided by the data link layer, This is the purpose of the ARP protocol.

The RARP protocol is only used by certain diskless workstations on the network. Due to the lack of storage devices, diskless workstations cannot remember their own IP addresses, but they can use the physical address on the network card to query the network manager (server or network management software) for their own IP address. The network administrator running the RARP service usually maintains a mapping of physical addresses to IP addresses for all machines on the network.

Network layer

The network layer implements routing and forwarding of data packets. WAN (Wide Area Network, Wide Area Network) usually uses many hierarchical routers to connect dispersed hosts or LAN (Local Area Network, Local Area Network). Therefore, the two communicating hosts are generally not directly connected, but Connected through multiple intermediate nodes (routers). The task of the network layer is to select these intermediate nodes to determine the communication path between the two hosts. At the same time, the network layer hides the details of the network topology connection from the upper layer protocol, so that from the perspective of the transport layer and network applications, the two parties in communication are directly connected.

The core protocol of the network layer is the IP protocol (Internet Protocol). The IP protocol determines how to deliver the data packet based on its destination IP address. If the data packet cannot be sent directly to the destination host, then the IP protocol finds a suitable next hop router for it and delivers the data packet to the router for forwarding. This process is repeated several times, and the packet eventually reaches the destination host, or is discarded due to failure to send. It can be seen that the IP protocol uses a hop by hop method to determine the communication path.

Another important protocol in the network layer is the ICMP protocol (Internet Control Message Protocol). It is an important supplement to the IP protocol and is mainly used to detect network connections.


What are the layers of the tcp/ip reference model?

The 8-bit type field is used to distinguish the message type. It divides

ICMP messages into two major categories
Error messages. This type of message is mainly used to respond to network errors, such as the target is unreachable (type value is 3) and redirection (type value is 5);
query message, this type of message is used to query network information. For example, the ping program uses ICMP messages to check whether the target is reachable (type value is 8). Some ICMP messages also use an 8-bit code field to further subdivide different conditions. For example, a redirect message uses a code value of 0 to indicate network redirection, and a code value of 1 to indicate host redirection.
ICMP messages use a 16-bit checksum field to perform a Cyclic Redundancy Check (CRC) on the entire message (including header and content) to check whether the message is damaged during transmission. Different ICMP message types have different body contents.

Transport layer

The transport layer provides end-to-end communication for applications on two hosts . Different from the hop-by-hop communication method used by the network layer, the transport layer only cares about the origin and destination of the communication and does not care about the transfer process of the data packet.

What are the layers of the tcp/ip reference model?

The vertical solid arrows represent the physical communication between the layers of the TCP/IP protocol suite (data packets are indeed transmitted along these lines), while the horizontal dashed arrows represent logical communication lines. The diagram also describes how different physical networks are connected. It can be seen that the
data link layer (driver) encapsulates the electrical details of the physical network; the network layer encapsulates the details of the network connection; the transport layer encapsulates an end-to-end logical communication link for the application. It is responsible for sending and receiving data, link timeout reconnection, etc.

Transport layer protocol: TCP protocol, UDP protocol.

  • TCP protocol (Transmission Control Protocol, Transmission Control Protocol) provides reliable, connection-oriented and stream-based services for the application layer. The TCP protocol uses timeout retransmission, data acknowledgment, etc. to ensure that data packets are sent correctly to the destination, so the TCP service is reliable. Both parties communicating using the TCP protocol must first establish a TCP connection and maintain some necessary data structures for the connection in the kernel, such as connection status, read and write buffers, and many timers. When the communication ends, both parties must close the connection to release this kernel data. TCP services are stream-based. Stream-based data has no boundary (length) limit and flows continuously from one end of the communication to the other. The sender can write data into the data stream byte by byte, and the receiver can read them out byte by byte.

  • UDP protocol (User Datagram Protocol) is completely opposite to TCP protocol. It provides unreliable, connectionless and datagram-based services for the application layer. "Unreliable" means that the UDP protocol cannot guarantee that the data is correctly transmitted from the sender to the destination. If the data is lost midway, or the destination finds data errors through data verification and discards it, the UDP protocol simply notifies the application of the failure to send. Therefore, applications that use the UDP protocol usually have to handle logic such as data confirmation, timeout retransmission, etc. by themselves. The UDP protocol is connectionless, that is, the communicating parties do not maintain a long-term connection, so the application must clearly specify the address of the receiving end (IP address and other information) every time it sends data. Datagram-based services are relative to stream-based services. Each UDP datagram has a length, and the receiving end must read all its contents at once with this length as the minimum unit, otherwise the data will be truncated.

Application layer

The application layer is responsible for processing the logic of the application.
The data link layer, network layer and transport layer are responsible for handling the details of network communication. This part must be both stable and efficient, so they are all implemented in the kernel space. The application layer is implemented in user space because it is responsible for handling many logics, such as file transfer, name query, and network management. If the application layer is also implemented in the kernel, it will make the kernel very large. Of course, there are also a few server programs that are implemented in the kernel, so that the code does not need to switch back and forth between user space and kernel space (mainly data copying), which greatly improves work efficiency. However, this kind of code is complex to implement, not flexible enough, and not easy to transplant.

Ping is an application, not a protocol. As mentioned earlier, it uses ICMP messages to detect network connections and is an essential tool for debugging the network environment.

The telnet protocol is a remote login protocol that allows us to complete remote tasks locally.

OSPF (Open Shortest Path First, Open Shortest Path First) protocol is a dynamic routing update protocol used for communication between routers to inform each other of their routing information.

DNS (Domain Name Service, Domain Name Service) protocol provides conversion of machine domain names to IP addresses.

Application layer protocols (or programs) may skip the transport layer and directly use services provided by the network layer, such as ping programs and OSPF protocols. Application layer protocols (or programs) can usually use both TCP services and UDP services, such as the DNS protocol. We can view all well-known application layer protocols and which transport layer services they can use through the /etc/services file.

The idea behind the five-layer protocol: the upper layer shields the details of the lower layer and only uses the services it provides. High cohesion and low coupling, each layer focuses on its function, and there is little dependence on the relationship between the layers.

Data packets have different formats at each layer. They are called segments, datagrams, and frames from top to bottom. The data is passed down from the application layer through the protocol stack, and each layer adds the corresponding The header of the layer protocol is finally encapsulated into a frame and sent to the transmission medium. When it reaches the router or destination host, the header is stripped off and delivered to the upper layer requester. This process is called encapsulation, transmission, separation, and decentralization.

The above is the detailed content of What are the layers of the tcp/ip reference model?. For more information, please follow other related articles on the PHP Chinese website!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
tcp/ip的全称是啥tcp/ip的全称是啥Nov 29, 2022 pm 04:25 PM

tcp/ip全称是“Transmission Control Protocol/Internet Protocol”,中文意思为“传输控制协议/网际协议”。TCP/IP协议不仅仅指的是TCP和IP两个协议,而是指一个由FTP、SMTP、TCP、UDP、IP等协议构成的协议簇,只是因为在TCP/IP协议中TCP协议和IP协议最具代表性,所以被称为TCP/IP协议。

如何利用PHP与TCP/IP协议进行数据通信如何利用PHP与TCP/IP协议进行数据通信Jul 29, 2023 pm 01:46 PM

如何利用PHP与TCP/IP协议进行数据通信引言:在现代互联网时代,数据通信是非常重要的一个方面。无论是客户端与服务器之间的通信,还是不同服务器之间的通信,TCP/IP协议一直是最常用的通信协议之一。本文将介绍如何利用PHP语言与TCP/IP协议进行数据通信,并提供相关的代码示例。一、TCP/IP协议简介TCP/IP协议是Internet协议簇的基础,它定义

osi和tcp/ip的区别和联系是什么osi和tcp/ip的区别和联系是什么Aug 15, 2022 pm 01:55 PM

区别:1、TCP/IP是一个协议簇,而OSI是一个模型;2、TCP/IP是五层结构,而OSI是七层结构;3、TCP/IP的第三层仅支持IP协议,OSI支持所有的网络层协议。联系:1、OSI引入了服务、接口、协议、分层的概念,而TCP/IP借鉴了OSI的概念;2、OSI先有模型,后有协议,先有标准,后进行实践,而TCP/IP先有协议和应用再提出了模型,且是参照的OSI模型。

tcp ip参考模型中属于应用层的协议有哪些tcp ip参考模型中属于应用层的协议有哪些Jul 04, 2022 am 10:09 AM

应用层协议有:1、Telnet,允许一台机器上的用户,登录到远程机器上,并进行工作;2、FTP,提供了将文件从一台机器上移到另一台机器上的方法;3、SMTP,是一种提供电子邮件传输的协议;4、SNMP,是用于在IP网络管理网络节点的一种标准协议;5、DNS,主要用于将人们所熟悉的网址“翻译”成电脑可以理解的IP地址;6、HTTP,是一个请求-响应协议,用于在WWW上获取主页。

tcp和ip的区别是什么tcp和ip的区别是什么Sep 04, 2023 pm 02:19 PM

TCP和IP是互联网中两个不同的协议:1、TCP是一种运输层协议,而IP是一种网络层协议;2、TCP提供了数据包的分段、排序、确认和重传等功能,而IP协议负责为数据包提供源和目标地址;3、TCP是面向连接的协议,而IP协议是无连接的;4、TCP还提供流量控制和拥塞控制。

Go语言中的常见TCP/IP错误解析Go语言中的常见TCP/IP错误解析May 31, 2023 pm 10:21 PM

Go语言是一门不断发展壮大的编程语言,它被设计得非常适合实现高性能、可靠性和并发性等方面的网络应用程序。在使用Go编写TCP/IP协议相关的网络程序时,我们很容易遇到各种错误,而一些常见的TCP/IP错误也会给程序的调试带来一定的难度。本文将围绕着如何解决Go语言中的常见TCP/IP错误这一主题展开阐述。一、EOF错误EOF(EndOfFile)错误通常

ip属于计算机网络体系结构的什么协议ip属于计算机网络体系结构的什么协议Aug 29, 2022 pm 04:12 PM

ip属于计算机网络体系结构的“网络层”协议。IP指网际互连协议,是TCP/IP体系中的网络层协议,它可以向传输层提供各种协议的信息,例如TCP、UDP等;对下可将IP信息包放到链路层,通过以太网、令牌环网络等各种技术来传送。

什么协议是internet最基本的协议什么协议是internet最基本的协议Jul 21, 2022 pm 02:17 PM

“TCP/IP”协议是internet最基本的协议。TCP/IP(传输控制协议/网际协议)是一种网络通信协议,它规范了网络上的所有通信设备,尤其是一个主机与另一个主机之间的数据往来格式以及传送方式;TCP/IP协议是internet最核心也是最基本的协议,它严格来说是一个四层的体系结构,应用层、传输层、网络层和数据链路层都包含其中。

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft