In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly introduces the tcp/ip reference model can be divided into several layers, the article is very detailed, has a certain reference value, interested friends must read it!
The tcp/ip reference model is divided into four layers: 1, the data link layer, which implements the network driver of the network card interface to deal with the transmission of data on the physical media; 2, the network layer, which realizes the routing and forwarding of data packets; 3, the transport layer, which provides end-to-end communication for the applications on the two hosts; and 4, the application layer, which is responsible for dealing with the logic of the application.
TCP/IP protocol family is a four-layer protocol system, which is data link layer, network layer, transport layer and application layer from bottom to top. Each floor is completed differently.
And implemented through several protocols, the upper layer protocol uses the services provided by the lower layer protocol.
Data link layer (network interface layer)
The data link layer implements the network driver of the network card interface to handle the transmission of data on physical media (such as Ethernet, token ring, etc.).
The two commonly used protocols in the data link layer are ARP protocol (Address Resolve Protocol, address resolution protocol) and RARP protocol (ReverseAddress Resolve Protocol, inverse address resolution protocol). They implement the translation between IP addresses and machine physical addresses (usually MAC addresses, which are used by Ethernet, token Ring, and 802.11 wireless networks using MAC addresses).
The network layer uses IP addresses to address a machine, while the data link layer uses physical addresses to address a machine, so the network layer must first translate the IP address of the target machine into its physical address before it can use the services provided by the data link layer. This is the purpose of the ARP protocol.
The RARP protocol is only used on some diskless workstations on the network. Due to the lack of storage devices, diskless workstations cannot remember their IP addresses, but they can use the physical addresses on the network card to access the network.
The network manager (server or network management software) queries his own IP address. Network managers running RARP services typically have a mapping of the physical addresses of all machines on the network to IP addresses.
Network layer
The network layer realizes packet routing and forwarding.
WAN (Wide Area Network, wide area network) usually uses many hierarchical routers to connect distributed hosts or LAN (Local Area Network, local area network). Therefore, the two hosts communicating are generally not directly connected, but 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 to the upper layer protocol, so that in the view of the transport layer and the network application, the two sides of the communication are directly connected.
The core protocol of the network layer is IP protocol (Internet Protocol, Internet protocol). The IP protocol determines how to deliver a packet based on its destination IP address. If the packet cannot be sent directly to the target host, the IP protocol finds a suitable next-hop (next hop) router for it and delivers the packet to that router for forwarding. This process is repeated many times, and the packet eventually arrives at the target host, or is discarded due to a transmission failure. It can be seen that the IP protocol uses a hop-by-hop (hop by hop) method to determine the communication path.
Another important protocol in the network layer is the ICMP protocol (Internet Control Message Protocol, Internet Control message Protocol). It is an important supplement to the IP protocol and is mainly used to detect network connections.
The 8-bit type field is used to distinguish message types. It divides ICMP messages into two categories
Error messages, which are mainly used to respond to network errors, such as destination unreachability (type value 3) and redirection (type value 5)
Query messages, which are used to query network information. For example, ping programs use ICMP messages to see if the target is reachable (type value is 8).
Some ICMP messages also use 8-bit code fields to further subdivide different conditions. For example, a redirect message uses a code value of 0 to redirect the network, and a code value of 1 to redirect the host.
ICMP messages use 16-bit checksum fields to perform a cyclic redundancy check (Cyclic Redundancy Check,CRC) on the whole message (including header and content parts) to verify whether the message is damaged during transmission. Different ICMP message types have different text content.
Transport layer
The transport layer provides end-to-end (end to end) communication for applications on two hosts. Different from the hop-by-hop communication used in the network layer, the transport layer only cares about the beginning and destination of the communication, and does not care about the transit process of the packet.
Vertical solid line arrows represent physical communication between the layers of the TCP/IP protocol family (packets do pass along these lines), while horizontal dotted line arrows represent logical communication lines. The connection methods of different physical networks are also described in the figure. Visible
The data link layer (driver) encapsulates the electrical details of the physical network; the network layer encapsulates the details of the network connection; and the transport layer encapsulates an end-to-end logical communication link for the application. It is responsible for data sending and receiving, link timeout reconnection and so on.
Transport layer protocols: TCP protocol, UDP protocol.
TCP protocol (Transmission Control Protocol, Transmission Control Protocol) provides reliable, connection-oriented and flow-based (stream) services for the application layer. TCP protocol uses timeout retransmission, data confirmation and other methods to ensure that packets are correctly sent to the destination, so the TCP service is reliable. Both parties who communicate using TCP protocol must first establish a TCP connection and maintain some necessary data structures for the connection in the kernel, such as the state of the connection, read-write buffers, and many timers. When the communication ends, both parties must close the connection to release the kernel data. TCP services are flow-based. There is no boundary (length) limit for stream-based data, and it flows continuously from one end of the communication to the other. The sender can write data to the data stream byte by byte, and the receiver can read them byte by byte.
UDP protocol (User Datagram Protocol, user Datagram protocol) is the opposite of TCP protocol, which provides unreliable, connectionless and Datagram-based services for the application layer. "unreliable" means that the UDP protocol cannot guarantee the correct transmission of data from the sender to the destination. If the data is lost halfway, or if the destination discards the data through data check, the UDP protocol simply notifies the application that it failed to send. Therefore, applications that use the UDP protocol usually have to handle logic such as data validation, timeout retransmission, and so on. The UDP protocol is connectionless, that is, the two sides of the communication do not maintain a long-term contact, so the application should clearly specify the address of the receiver (information such as IP address) every time the application sends data. Datagram-based services are relative to stream-based services. Each UDP Datagram has a length, and the receiver must read out all its contents at once in the smallest unit of length, otherwise the data will be truncated.
Application layer
The application layer handles the logic of the application.
The data link layer, network layer, and transport layer are responsible for handling the details of network communication, which must be both stable and efficient, so they are all implemented in kernel space. The application layer is implemented in user space because it handles a lot of logic, 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, a small number of server programs are implemented in the kernel, so that the code does not have to switch back and forth between user space and kernel space (mainly data replication), which greatly improves work efficiency. However, this kind of code is complex to implement, inflexible, 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 a necessary tool for debugging the network environment.
The telnet protocol is a remote login protocol that enables us to complete remote tasks locally.
OSPF (Open Shortest Path First, Open shortest path first) protocol is a dynamic routing update protocol, which is used for communication between routers to inform each other of their routing information.
The DNS (Domain Name Service, Domain name Service) protocol provides the translation 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 see all the 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 uses only the services it provides. High cohesion and low coupling, each layer focuses on its function, and the relationship between each layer is less dependent.
Packets have different formats in each layer, which are called segments, datagrams, frames, and data from the application layer through the protocol stack from top to bottom, each passing through a layer with the header of the corresponding layer protocol, and finally encapsulated into a frame and sent to the transmission medium. the head is stripped off by the router or destination host and delivered to the upper layer. This process is called encapsulation, transmission, separation, and division.
These are all the contents of the article "the tcp/ip reference model can be divided into several layers". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.