Network basics (prerequisite for understanding network knowledge)

Preface

        Before formally learning the network, we need to understand some basic knowledge about computer networks. This article mainly explains these basic knowledge and takes everyone step by step into the world of Internet networks;

1. The concepts of local area network and wide area network

        The premise of formally understanding these concepts is that we must understand the significance of the emergence of the network; in the history of computer development, it can be said that the emergence of the network is inevitable. As long as computers appear, there will definitely be the emergence of computer networks. When we use computers to carry out When completing some tasks, the problem of collaborative task completion will inevitably arise. To solve this problem, we must use some means to connect computers to facilitate our task collaboration; this is the meaning of the emergence of computers;

1. LAN

        LAN is a "way" to connect computers. We connect computers through switches, routers and other equipment, which form a LAN. In fact, the concept of LAN is relative; (for example, our home routers form a LAN , information exchange between devices connected to the router only needs to pass through the router)

2. Wide Area Network

        WAN is a concept relative to LAN. It connects two hosts that are far apart, and the data may be forwarded by multiple devices before finally transmitting the data to the target host; (For example, I have a friend who will , we often chat together on the Internet, and Dilireba is on a business trip in Shanghai, and we are in our hometown in Hubei. Dilireba wants to send me a message, and this message will be forwarded through many intermediate devices, and we will It can be understood that my equipment and Dilireba’s equipment are connected through the WAN)

3. Summary

        Don’t take the concepts of local area network and wide area network too seriously. The distance is relative. In the above example, we look at the distance between the two cities. But if we use the entire earth as a reference, then the distance between the two cities is very far. The distance between cities is negligible, so we say that local area network and wide area network are only relative concepts;

2. Agreement

1. What is the agreement?

        We often hear others talk about the concept of protocols (it doesn’t matter if you haven’t heard of it). In the course of Jiwang, you may hear various different protocols, and the essence of these protocols is agreement. Those who use the same protocol The parties comply with the rules of the agreement;

        For example, I wonder if you have played similar games with your friends when you were young. For example, my friends and I want to go to the Internet cafe to play with me. They usually call me downstairs, but they are afraid of being called by my mother. I heard that, so we made an agreement to change the location of the Internet cafe to Dongmen Pavilion, and they would call me downstairs, "XXX, let's go to Dongmen Pavilion together, do you want to go?" This is actually the essence. It is also an agreement designated by my friends and I;

2. Protocol layering

        In fact, our network protocols are layered. Each layer has one or more different protocols. Each layer of the protocol provides some interfaces so that the other layer can use it. Let’s give another example. ;

        Let’s take the above story of my friend and I secretly going to an Internet cafe as an example, except that the background of the story has been switched. My friend and I communicate through the landline at home; my friend and I think we are communicating directly Communication, but in fact, I was talking to my landline phone, and he heard me through the receiver of the landline. This seemingly same-layer protocol is one of the characteristics of layering;

Summarize:

  • Each layer has one or more protocols;
  • Everyone on the same layer thinks they are communicating directly with the other party;
  • Different layer protocols are connected using interfaces;
  • The role of layering is low coupling between layers

3. Network model

1. OSI seven-layer model

Subordinate layer effect Representation Agreement
Application layer Responsible for communication between programs HTTP/HTTPS等
presentation layer Responsible for conversion between data formats LPP, NBSSP, etc.
session layer Responsible for connection management between communications SSL, TLS, etc.
transport layer Responsible for the transmission strategy between two hosts TCP, UDP, etc.
Network layer Responsible for address management and routing IP, ICMP, etc.
data link layer Responsible for the transmission and selection of data frames between devices ARP, RARP, etc.
physical layer Responsible for the transmission method of photoelectric signals DSL, ISDN, etc.

        Regarding the OSI seven-layer model, we can understand it as a perfectly designed model in theory, but in practice, we use the TCP/IP protocol suite more extensively;

2. TCP/IP four-layer model

        For the TCP/IP protocol suite, we optimize the upper three layers into an application layer. We don't care about the physical layer, because we don't involve computer hardware. We only need to care about the following four layers;

        When actually writing programs, we usually use the TCP/IP four-layer model;

4. Encapsulation and separation

1. Packaging

        Before understanding encapsulation, we first understand the concept of header. Each layer of protocol will add header information to itself, and these header information are called headers, and the information passed to us by the upper layer is called payload; we deliver it to us by the upper layer The data is added with a header and then distributed to the lower layer. This process is called encapsulation;

        For this concept, we only need to have a general impression, and we will focus on learning each header later;

2. Divide

        Since each layer has different protocols, when our network information is sent to the other end for upward delivery, we will deliver it to the specific protocol through the information in the protocol header. This process is called decentralization;

Guess you like

Origin blog.csdn.net/Nice_W/article/details/133375408