TCP / IP protocol suite architecture: death can not forget the four layers

1, can not forget the death of four layers


① data link layer
to achieve a network interface card driver to handle the data transmitted on the physical medium (such as Ethernet, Token Ring, etc.). The main ARP and RARP protocol
via the data becomes the data link layer encapsulation frames, Ethernet frames, token ring frame, wherein the Ethernet frame format:

MTU maximum transmission unit, i.e. the maximum number of upper layer protocol data frames (such as IP datagrams) can carry, as such, long IP datagrams may be fragmented transmission.
Description: Ethernet frame MTU = 1500, by ifconfig, netstat view, so that the data section of the IP datagram is a maximum of 1480 bytes (IP datagram header accounts for 20 bytes)
② network layer
main protocols are IP and ICMP
functions:
routing: communication two hosts are not connected directly, but through a plurality of intermediate nodes (routers) connected to the network layer of the task is to choose these intermediate nodes has been determined between two hosts communication
IP is the destination IP address of the packet to determine how to deliver it. If the packet is not sent directly to the destination host, the IP protocol will select the appropriate next-hop router packets and packets delivered to the router to forward. This process is repeated several times, until the packet reaches the destination host, or because of transmission failure packets are discarded. Can be found, IP protocol network layer hop manner using the determined communication path.
Protocol ICMP (Internet Control Message Protocol) is mainly used for detecting a network connection, it is divided into two types: packet error, query message. Details see illustration:

③ transport layer
main protocols: TCP, UDP, SCTP
functions: to provide end (end-to-end) communication application on both hosts. And using the IP protocol communication network layer hop communication paths of different people missing, the transport layer only concerned src and dst, is not concerned with the packet transfer process.

④ The application layer
implemented in user space, the main protocols: telnet, OSPF, DNS, ping procedures

2, TCP / IP works and processes
① package
Q1: How to use the upper-layer protocol is the underlying protocol services provided by it? - Package
A1: application data before being sent to the physical network, one pass down along the stack from, each with their own protocols to the upper header information in a data base.
TCP-> TCP segment, UDP-> UDP datagram, IP-> IP packet, the data link layer -> a frame (Ethernet frame, token ring frame)
Description: TCP, UDP data package similar, the difference is, UDP no need to save a copy of the data, because UDP is unreliable service, when the UDP datagram is sent successfully, the UDP datagram buffer was discarded (if the application detects that the datagram is not the receiving side can be correctly received, and intended to retransmit the data packet, the applications need to copy data from user space to the kernel UDP transmission buffer).


② demultiplexing
Q2: When a frame is transmitted to the destination host on the physical network will be sequentially transmitted along the bottom-up protocol, the specific implementation process? - demultiplexing
A2: sequentially processing the protocol layers responsible for the present data frame header layer to obtain the required information, and finally the processed frame to the destination application.

Ethernet frames (from bottom to top) with a sub-process, shown:

It can be seen that:
1. the IP, the ARP, the RARP protocol uses a data frame transmission, so that the head of the frame type of Ethernet frames to distinguish them. IP, ARP, RARP respective type are: 0x800,0x806,0x835.
2. ICMP protocol, TCP protocol, UDP protocol are used IP protocol, the IP datagram header uses 16-bit protocol field to distinguish them
3. TCP, UDP is a 16-bit port numbers to distinguish between the upper layer application field

③ peer communication layer
to one or more protocols in the same layer on the two ends of the system, a corresponding communication on both sides

https://blog.csdn.net/weixin_36750623/article/details/83956487

 

Guess you like

Origin www.cnblogs.com/wangenxian/p/10929411.html