Computer network network reference model

Preface

This paper combs the layered model of computer network.

Term introduction

Entities: The active elements of the nth layer become n-layer entities, and the entities in the same layer are called peer entities.
Protocol: The rules, standards, or agreements established for data exchange between peer entities in the network are called network protocols.
Interface: the entrance for the upper layer to use the lower layer service.
Service: The function call provided by the lower layer for the adjacent upper layer.

Insert picture description hereSDU service data unit: the data that should be transmitted to complete the functions required by the user
PCI protocol control information: the information that controls the operation of the
protocol PDU protocol data unit: the data unit transmitted between peer levels

TCP/IP reference model

(Transfer Control Protocol/Internet Protocol)
image.png
image.png

Quartic model diagram

  • Transmission unit
    image.png

Application layer

Determines the communication activities when providing application services to users.

  • Main functions: Provide users with an interface and handle specific applications; data encryption, decryption, compression, and decompression; define data representation standards.
  • For example, FTP (File Transfer Protocol)
    DNS (Domain NameServer) domain name service protocol provides domain name to IP address conversion, allowing decentralized management of domain name resources.
    HTTP;
    SMTP (Simple Message Transfer Protocol);
    POP3 (Post Office Protocol) is used to send and receive mail;
    RIP (Routing Information Protocol) is a protocol used by routers to exchange routing information on IP networks;
    Radius (RemoteAuthentication Dial In) User Service) Dial-up access remote authentication protocol to complete the authentication, authorization, and accounting functions of access users;
    etc.;

Transport layer

Provides communication between two processes in a network connection, that is, end-to-end communication. The transmission unit is a segment or user datagram.

  • Main functions:
    reliable transmission, unreliable transmission,
    error control,
    flow control,
    multiplexing and demultiplexing

    • Multiplexing: Multiple application layer processes can use the services of the transport layer below at the same time.
    • Decentralization: The transport layer delivers the received information to the corresponding process in the upper application layer.
  • Commonly used protocols:
    There are two protocols with different properties in the transport layer: TCP (Transmission Control Protocol) and UDP (User Data Protocol).

Network layer

It is used to process datagrams flowing on the network, data packets from the source host to the destination host, routing and forwarding, and to provide communication services for different hosts on the packet switching network. The transmission unit is a datagram.

  • Main functions:
    routing selection,
    flow control,
    error control,
    congestion control

  • Commonly used protocols:
    P protocol, IP is the main protocol of the network layer, and its function is the main function of the network layer. One is to provide logical addressing, the other is to provide routing functions, and the third is to encapsulate and decapsulate packets.
    ICMP, ARP, and RARP protocols assist IP work.

data link layer

The main task is to assemble datagrams from the network layer into frames, and the transmission unit of the data link layer is a frame.

  • Main functions:
    Encapsulate and encapsulate frames
    Error control: Frame error, bit error
    Flow control
    Access (access) control: Control access to the channel

  • Including the control operating system, hardware device drivers, network adapters, and optical fiber and other physically visible parts. The scope of hardware is within the scope of the link layer.

  • The data link layer is divided into MAC sublayer (media access control sub-layer medium access control sub-layer) and LLC (logic link control sub-layer logical link control sub-layer) sublayer.
    The MAC sublayer is responsible for specifying how data is transmitted through the physical line and communicates with the physical layer down. It defines functions such as physical addressing, network topology, line specification, error notification, in-order delivery, and flow control.
    The LLC sublayer is responsible for identifying the protocol type and encapsulating the data for transmission over the network. The LLC sublayer mainly performs most of the functions of the data link layer and some functions of the network layer. For example, the frame sending and receiving function, when sending, the frame is composed of the sent data plus the address and CRC check, etc., when the frame is received, the frame is split, address recognition, CRC check, and frame sequence control, error control, and flow Control and other functions. In addition, it also performs some network layer functions such as datagrams, virtual circuits, and multiplexing.

  • Commonly used protocols:
    SDLC, HDLC, PPP, STP

Physical layer

The main task is to realize the transparent transmission of bit streams on physical media. The transmission unit of the physical layer is a bit.

  • Main functions:
    define interface characteristics,
    define transmission mode: simplex, half duplex, full duplex,
    define transmission rate,
    bit synchronization,
    bit coding

  • Commonly used protocols:
    Rj45, 802.3

TCP/IP communication transport stream

Communication flow 2
Insert picture description here
Communication flow

Responsibilities of each protocol in the communication process

Packet refers to the basic information unit transmitted through the network.
The basic packet consists of a header (containing the addresses of the sending system and the receiving system) and a body or payload (containing the data to be transmitted).
When a packet passes through the TCP/IP protocol stack, the protocols on each layer will add or delete fields in the basic header. When the protocol on the sending system adds data to the packet header, this process is called data encapsulation .
In addition, each layer has a different name for the changed package, as shown in the figure.

Sender

  1. Application layer: the origin of communication
    When a user on a system sends a message or issues a command that must access the remote system, the packet history is started. The application protocol will set the format of the packet so that the corresponding transport layer protocol (TCP or UDP) can process the packet.

  2. Transport layer:
    When data arrives at the transport layer, the protocol on this layer starts the data encapsulation process. The transport layer encapsulates the application data into the transport protocol data unit.

    • Use TCP protocol
      TCP uses segments to determine whether the receiving system is ready to receive data. TCP divides the data received from the application layer into multiple segments, and then appends a header to each segment.
      The segment header contains the sending port and receiving port, segment ordering information, and a data field called a checksum . The TCP protocol on both hosts will use checksum data to determine if there is an error in the data transmission.
      A three-way handshake is used to establish a connection.
    • Using UDP Protocol
      Unlike TCP, UDP does not check whether the data has arrived at the receiving host. Instead, UDP sets the format of the message received from the application layer to UDP packets. UDP will append a header to each packet. This header contains the sending port and receiving port, a field containing the packet length, and a checksum.
      The sending UDP process will try to send the packet to the peer UDP process on the receiving host. The application layer will determine whether the receiving UDP process will confirm the receipt of the packet. UDP does not require any notification of receipt. UDP does not use the three-way handshake.
  3. Network layer: The location where the packet is to be transmitted. The
    IP protocol will process these segments and packets at that location.
    IP prepares to transmit these segments and packets by formatting them into multiple units called IP datagrams . Then, IP determines the IP address of the datagram so that it can be efficiently delivered to the receiving host.
    IP will add **IP packet header** to the segment or packet. The information in the IP packet header includes the IP addresses of the sending and receiving hosts, the length of the datagram, and the order in which the datagram is sorted. If the datagram exceeds the byte size allowed by the network packet and must be fragmented, this information is provided.

  4. Data link layer: framing position The
    data link layer protocol (such as PPP) will format the IP datagram as a frame .
    These protocols will append a third header and a footnote to "framing" the datagram.
    Frame header field includes a CRC ( cyclic redundancy check , cyclic redundancy check, CRC), a frame for checking whether errors via the network media. Then, the data link layer will pass the frame to the physical layer.

  5. Physical network layer: where the frame is sent and received
    The physical network layer on the sending host receives the frame and converts the IP address into a hardware address suitable for the network medium. Then, the physical network layer sends the frame out through the network medium.

Receiving end

When the packet arrives at the receiving host, the packet will pass through the TCP/IP protocol stack in the reverse order of its sending order.
Each protocol on the receiving host also deletes the header information, which is appended to the packet through the peer-to-peer protocol on the sending host.

The following process will occur:

  1. The physical network layer receives packets in frame format. The physical network layer calculates the CRC of the packet, and then sends the frame to the data link layer.

  2. The data link layer checks whether the CRC of the frame is correct, and then deletes the frame header and CRC. Finally, the data link layer sends the frame to the Internet layer.

  3. The Internet layer reads the information in the header to identify the transmission. Then, the Internet layer will determine whether the packet is a segmented packet. If the transmission is performed in segments, IP will reassemble the segments into the original datagram. Then, IP will remove the IP packet header and pass the datagram to the transport layer protocol.

  4. The transport layer (TCP, SCTP, and UDP) reads the header to determine the application layer protocol that must receive the data. Then, TCP, SCTP or UDP will delete its related headers. TCP, SCTP, or UDP sends the message or stream to the receiving application.

  5. The application layer receives the message. Then, the application layer will perform the operation requested by the sending host.

Guess you like

Origin blog.csdn.net/u014099894/article/details/112163551