[Network] Network Basics (1)


foreword

This content is only a brief introduction to the network, and does not involve too much in-depth knowledge.


1. Background of computer network

1. Network Development

(1) Independent

The computers are independent of each other, and each terminal holds the data of the corresponding user.

insert image description here


(2) Internet interconnection

Everyone uses their own independent computers, and can switch freely between businesses at any time, and shared data is centrally managed by the server.

insert image description here


(3) Local area network LAN

There are many computers, and the computers are connected by switches and routers.

insert image description here


(4) WAN

Connect computers thousands of miles away.

insert image description here


2. Network protocol

The transmission medium between computers is optical signal and electrical signal, and information such as 0 and 1 is represented by "frequency" and "strength". In order to transmit various information between all hosts, a unified data format needs to be agreed upon.

1. OSI seven-layer model

(1 Introduction

The OSI (Open System Interconnection, Open System Interconnection) seven-layer network model, called the Open System Interconnection Reference Model, is a logical definition and specification. This model logically divides the network into 7 layers, each of which has related and corresponding physical devices, such as routers, switches and so on.

The OSI seven-layer model is a framework design method, and its main function is to help different types of hosts realize data transmission;
its greatest advantage is to clearly distinguish the three concepts of service, interface and protocol. Clear and theoretically complete. Reliable communication is achieved between different systems and different networks through seven hierarchical structure models.


(2) Structure

Its structure is as follows:

insert image description here

However, it is complex and impractical, so here we mainly introduce the TCP/IP four-layer model.


2. TCP/IP model

(1 Introduction

TCP/IP is synonymous with a set of protocols, and it also includes many protocols that make up the TCP/IP protocol suite.
The TCP/IP communication protocol adopts a 5-layer hierarchical structure, and each layer calls the network provided by the next layer to complete its own needs.


(2) Structure

  1. Physical layer: responsible for the transmission of optical and electrical signals. For example, the network cable (twisted pair) commonly used in the current Ethernet and the coaxial cable used in the early Ethernet. The capability of the physical layer determines the maximum transmission rate, transmission distance, and anti-interference. The hub (Hub) works at the physical layer.
  2. Data link layer: responsible for the transmission and identification of data frames between devices. For example, the driver of the network card device, frame synchronization (that is, what signal detected from the network line is counted as the start of a new frame), conflict detection (automatic retransmission if a conflict is detected), data error checking, etc. There are standards such as Ethernet, Token Ring, and Wireless LAN. The switch (Switch) works at the data link layer.
  3. Network layer: responsible for address management and routing. For example, in the IP protocol, a host is identified by an IP address, and a data transmission line (route) between the two hosts is planned by means of a routing table. Routers work at the network layer.
  4. Transport Layer: Responsible for data transfer between two hosts. For example, the Transmission Control Protocol (TCP) ensures that data is reliably sent from the source host to the destination host.
  5. Application layer: Responsible for communication between applications, such as Simple Email Transfer (SMTP), File Transfer Protocol (FTP), Network Remote Access Protocol (Telnet), etc. Network programming is mainly aimed at the application layer.

insert image description here


3. Basic process of network transmission

1. Packet encapsulation and demultiplexing

(1 Introduction

  • Different protocol layers have different names for data packets, which are called segments at the transport layer, datagrams at the network layer, and frames at the data link layer.

  • When application layer data is sent to the network through the protocol stack, each layer protocol must add a data header (header), which is called encapsulation.

  • The header information contains some information such as how long the header is, how long the payload is, what the upper layer protocol is, and so on.

  • The data is encapsulated into frames and sent to the transmission medium. After reaching each layer of protocol of the destination host, the corresponding header is removed, and the data is handed over to the corresponding upper-layer protocol for processing according to the "upper-layer protocol field" in the header.


(2) Process

Data needs to be added to the header (header) of the corresponding layer at each layer.
insert image description here


2. TCP/IP communication process

In a unified local area network, two hosts can communicate directly. The communication between them needs to be completed through the encapsulation and unpacking process of each layer.

insert image description here


Fourth, the network address management

1. IP address

There are two versions of the IP protocol, IPv4 and IPv6. In the following content, all references to the IP protocol, unless otherwise specified, refer to IPv4 by default.

An IP address is used in the IP protocol to identify the addresses of different hosts in a network.

For IPv4, an IP address is a 4-byte, 32-bit integer; for IPv6, an IP address is a 16-byte, 128-bit integer.
Usually a "dotted decimal" string representation is also used An IP address, such as 192.168.0.1, is represented by one
byte per number separated by dots, in the range 0 - 255.


2. Know the MAC address

MAC addresses are used to identify connected nodes in the data link layer.

The length is 48 bits, or 6 bytes. It is generally expressed in the form of a hexadecimal number plus a colon (such as 08:00:27:03:fb:19).

The MAC address is determined when the network card leaves the factory and cannot be modified. MAC addresses are usually unique (but mac addresses in virtual machines are not real mac addresses and may conflict).


Thanks for reading, if there are any mistakes, please criticize and correct

Guess you like

Origin blog.csdn.net/weixin_51983604/article/details/123802818