Computer network: OSI seven-layer protocol from top to bottom is: application layer, presentation layer, session layer, transport layer, network layer, data link layer, physical link layer

1. Application layer:
main functions: user interface, application program. The application layer exposes all network services to the application process. When an application process accesses the network, all actions are performed through this layer.
Classic Devices: Gateways
Typical Protocols, Standards and Applications: TELNET, FTP, HTTP

2. Presentation layer
Main functions: representation, compression and encryption of data. Defines the format used by applications to exchange data, this layer is responsible for protocol conversion, data encoding, and data compression. The forwarder performs service operations at this layer.
Classic Devices: Gateways
Typical Protocols, Standards and Applications: ASCLL, PICT, TIFF, JPEG, MIDI, MPEG

3. Session layer
Main functions: session establishment and termination, establishing a virtual link between two applications on separate computers, this virtual link is called a session (session). The session layer maintains synchronization between applications by setting checkpoints in the data stream. The work of name recognition and security that allows applications to communicate is done by the session layer.
Classic equipment: Gateway
Typical protocols, standards and applications: RPC, SQL, NFS, X WINDOWS, ASP

4. Transport layer
Main functions: end-to-end control to ensure that data packets are sent in order without errors. The transport layer divides the large number of messages from the session layer into manageable packets to send to the network
Classic device: gateway
Typical protocols, standards and applications: TCP, UDP, SPX

5. Network layer
Main functions: Routing, addressing, the network layer determines the path to transmit the data packet to its destination. It is to convert the logical network address into a physical address. If the data packets are too large to be sent to the destination through a link in the path, it is the job of the network layer to break these packets into smaller packets.
Classic equipment: routers, bridge routers
Typical protocols, standards and applications: IP, IPX, APPLETALK, ICMP

6.
The main function of the data link layer: To ensure the data link with errors, on the one hand, it receives data frames from the network layer (third layer) and encapsulates these frames for the physical layer; The raw data bits are encapsulated into frames at the network layer. play an important intermediary role. The data link layer is improved by the IEEE802 plan to include two sublayers: Media Access Control (MAC) and Logical Link Control (LLC).
Classic equipment: switches, bridges, network cards
Typical protocols, standards and applications: 802.2, 802.3ATM, HDLC, FRAME RELAY

7. Physical layer
Main functions: transmit bit stream, work at the bottom layer, transparently transmit bit stream, which is the transmitted signal
Classic equipment: hub, repeater, cable, transmitter, receiver
Typical protocols, standards and applications: V .35, EIA/TIA-232

Internet protocols and protocol suites

network-01

tcp/ip model and osi model

network-02

IP address: network address (obtained by AND operation of ip address and subnet mask) and host address

network-03

A类IP地址:由1字节的网络地址和3字节主机地址组成,网络地址的最高位必须是“0”
(地址范围1.0.0.1-126.255.255.254)

B类IP地址:由2个字节的网络地址和2个字节的主机地址组成,网络地址的最高位必须是
“10”(128.1.0.1-191.255.255.254)

C类IP地址:由3字节的网络地址和1字节的主机地址组成,网络地址的最高位必须
是“110”(范围192.0.1.1-223.255.255.254)
Simulate client, DNS server, HTTP server implementation

network-04

Network Switch Introduction
网络交换机(又称“网络交换器”),是一个扩大网络的器材,能为子网络中提供更多的连接端口,以便连接更多的计算机 具有性能价格比高、高度灵活、相对简单、易于实现等特点 以太网技术已成为当今最重要的一种局域网组网技术,网络交换机也就成为了最普及的交换机
The role of network switches

Forwarding filtering: When the destination address of a data frame is mapped in the MAC address table, it is forwarded to the port connected to the destination node instead of all ports (if the data frame is a broadcast frame, it is forwarded to all ports)

Learning function: the Ethernet switch learns the MAC address of the device connected to each port, and maps the address with the corresponding port and stores it in the MAC address table in the switch cache

router

Definition: A router (Router), also known as a gateway device (Gateway), is used to connect multiple logically separated networks

A logical network represents a single network or a subnet. When data is transmitted from one subnet to another, the routing function of the router can be used to complete the function of judging the network address and selecting the IP path. For PCs that are not in the same network segment, a default gateway needs to be set to transmit the data. When the router receives a data packet from another network segment, it will decide which port to send the data packet to according to the "routing table". There are static and dynamic methods for routing table settings. Once the router, then the TTL value will be reduced by one

socket introduction

#Definition: socket (referred to as socket) is a way of inter-process communication

UDP protocol

network-05

TCP protocol

network-06

TCP three-way handshake, wave four times
three handshake

network-07

waved four times

network-08

HTTP request flow

Step 1: The browser first sends an HTTP request to the server, request message (request header, request body)

Method: GET or POST, GET only requests resources, POST will include user data;
path: /full/url/path;
domain name: specified by the Host header: Host: www.xxx.com
and other related Headers;
if it is POST, Then the request also includes a Body, containing user data

Step 2: The server returns an HTTP response to the browser, the response message (response header, response body)

Response code: 200 means success, 3xx means redirection, 4xx means there is an error in the request sent by the client, 5xx means an error occurred during server-side processing;
response type: specified by Content-Type;
and other related Headers;
corresponding length: Content-Length: 755
Usually, the HTTP response of the server will carry content, that is, there is a Body, which contains the content of the response, and the HTML source code of the web page is in the Body.

Step 3: If the browser needs to continue to request other resources from the server, it sends an HTTP request again. The HTTP protocol used by the Web adopts a very simple request-response model, which greatly simplifies development.

Note: When we write a page, we only need to send HTML in the HTTP request, without considering how to attach pictures, videos, etc. If the browser needs to request pictures and videos, it will send another HTTP request. Therefore, An HTTP request only processes one resource (at this time, it can be understood as a short connection in the TCP protocol, and each connection only obtains one resource. If multiple connections are needed, multiple connections need to be established)

Digression

In this first year of fast-growing technology, programming is like a ticket to a world of infinite possibilities for many people. In the star lineup of programming languages, Python is like the leading superstar. With its concise and easy-to-understand syntax and powerful functions, it stands out and becomes one of the most popular programming languages ​​in the world.


The rapid rise of Python is extremely beneficial to the entire industry , but " 人红是非多" has caused it to add a lot of criticism, but it still cannot stop its hot development momentum.

Will Python remain relevant and intact for the rest of the next decade? Today, we're going to analyze the facts and dispel some misconceptions.

If you are interested in Python and want to get a higher salary by learning Python, then the following set of Python learning materials must be useful to you!

Materials include: Python installation package + activation code, Python web development, Python crawler, Python data analysis, artificial intelligence, machine learning and other learning tutorials. Even beginners with 0 basics can understand and understand. Follow the tutorial and take you to learn Python systematically from zero basics!

1. Learning routes in all directions of Python

The route of all directions in Python is to organize the commonly used technical points of Python to form a summary of knowledge points in various fields. Its usefulness lies in that you can find corresponding learning resources according to the above knowledge points to ensure that you learn more comprehensively.
insert image description here
2. Python learning software

If a worker wants to do a good job, he must first sharpen his tools. The commonly used development software for learning Python is here!
insert image description here
3. Python introductory learning video

There are also many learning videos suitable for getting started with 0 basics. With these videos, you can easily get started with Python~insert image description here

4. Python exercises

After each video lesson, there are corresponding practice questions, you can test the learning results haha!
insert image description here

Five, Python actual combat case

Optical theory is useless. You have to learn to type codes along with it, and then you can apply what you have learned in practice. At this time, you can learn from some practical cases. This information is also included~insert image description here

6. Python interview materials

After we have learned Python, we can go out and find a job with the skills! The following interview questions are all from first-line Internet companies such as Alibaba, Tencent, and Byte, and some Alibaba bosses have given authoritative answers. After reading this set of interview materials, I believe everyone can find a satisfactory job.
insert image description here
insert image description here
7. Information collection

The full set of learning materials for the above-mentioned full version of Python has been uploaded to the CSDN official website. Those who need it can scan the QR code of the CSDN official certification below on WeChat to receive it for free.

Guess you like

Origin blog.csdn.net/pythonhy/article/details/132345973