Article reference: Wang Dao postgraduate entrance examination — computer network

1. An overview of the

Because there needs to be a definite communication rule between different network applications.

1.1 Two common network application models

1.1.1 Client/Server Model (Client/Server)

1.1.2 P2P Model (Peer-to-peer)

Network robustness refers to the fact that the P2P model is not prone to failure, and even if one node fails, it can be replaced by other nodes.

Domain Name System Protocol (DNS)

2.1 an overview of the

DNS is the thing that converts a domain name typed in the address bar into an IP address.

2.1.1 the domain name

Domain name iswww.xxx.comOf course this is the simplest kind.comAnd then you can have something called a root, a domain name that goes from left to right and goes up.



2.2 Domain Name Server (DNS Server)

There are many DNS servers, which are divided into three layers according to the hierarchical structure: root DNS server, top-level DNS server, and permission DNS server.

The local domain name server is not a hierarchical structure, because the local host is relatively close to the other host. When the host communicates with another relatively close host, it does not need to go to the higher level server.

The root DNS server does not have only one domain name, but a domain name corresponding to multiple DNS servers. There are 13 such domain names in the world, namely a.rootservers.net, B.rootservers.net, and C.rootservers.net. ~m.rootservers.net

In the domain name server, abc.com seems to be one less than Y.abc.com, but theirThe status is still equal, corresponding to the two permission domain servers.

2.3 Domain name Resolution Process



2.3.1 Recursive Query

In the figure above, the host sends a request to the local DNS server. If it can’t find it, the local DNS server sends a request to the root DNS server (find someone else). If it still can’t find it, the root DNS server sends a request to the top-level DNS server (find someone else). The top-level domain name server sends a request to the permission domain name server (to find someone else) and you can see that each time the next query server changes, instead of the host asking one by one, the server is asking one by one

2.3.2 Iterative Query

In the figure above, the host first sends a request to the local DNS server. If it cannot find the local DNS server, the local DNS server sends the host to the root DNS server. If it still cannot find the local DNS server, The root domain name server tells the host to send a request to the corresponding top-level domain name server (host to find, root domain name to the destination TOP-LEVEL domain name server IP address). If it still cannot find, the top-level domain name server tells the host to send a request to the permission domain name server (host to find, Top-level domain name (TLD) gives target permission to the IP address of the DNS server

2.3.3 Caching

To reduce the waste of resources when you query the same domain name multiple times, the local DNS server stores the latest IP address resolution. The next time you access the same domain name, you do not need to perform so many query steps. The cache host also has storage and the local DNS server can cache the address of the TOP-LEVEL DOMAIN name server, the permission domain name server, so the next time even if you don’t know the IP address, you can cache it faster and you need to update it periodically in order to keep it correct

3. File Transfer Protocol (FTP, TFTP)

3.1 an overview of the

TFTP is a lightweight, easy to implement, small file oriented, UDP file transfer protocol

Here we focus on the FTP protocol

3.2 FTP Server and Client

3.3 Working principles of FTP

Why anonymous logins: For some public servers, adding the authentication phase is an increase in resource overhead, and reducing the authentication phase can save resources to better serve

The difference between a master process and a slave process: The master process opens the port so that data sent from the outside can enter, and allocates the data to each slave process one by one. Slave processes serve this data individually





Note that the main process here is ignored, but it’s not marked, it’s not missing

The client and server establish a TCP connection on port 21, which is called a control connection

And then see if it’s active or passive

In active connection setting, the server proactively sends requests to connect to the client. In this case, the port number is always 20

Passive connection means that the client sends a request and the server establishes a data transmission connection. At this time, the port number is not determined, and the two sides negotiate to get it

After the data transfer is complete, the data connection is disconnected and the control connection remains open until both sides send a disconnect request



You can understand the two transmission modes of FTP

4. Email

4.1 an overview of the

4.1.1 Format of E-mail

4.1.2 Composition structure of email System

The function of the mail server annotation Mail server to send and receive refers to receive mail from your user agent, then to the other side of the mail server to send the mail delivery mail server report mailing the result is the success of the mail server could act as both a client and can be used as the server side, using the C/S mode

SMTP is used for sending mails and POP3 or IMAP is used for receiving mails



4.2 Several mail protocols

4.2.1 Simple Mail Transfer Protocol SMTP

Note that the STMP client and server are not fixed. They can also be servers, and servers can also be users, depending on the sender and receiver. The sender is the client, and the receiver is the server



annotation

You can see here for example

220 service ready
250 OK
421 service not available
550 xxx
354 xxx
12345
Copy the code

It’s all response messages

The reason why RCPT can have multiple commands here is that emails can have multiple recipients, i.e. sent in groups, so multiple RCPT is allowed

Again, the server and client are interchangeable, depending on the situation, with the sender being the client and the receiver being the server

4.2.2 Improve THE MIME protocol of SMTP

MIME improves THE shortcomings of SMTP for sending data and is a functional extension of SMTP

MIME protocols are increasingly being used in browsers to identify different file types with different identifiers, allowing browsers to read related files through MIME

4.2.3 Post Office Protocol POP3

Here the receiver is the client and the mail server is the server

POP3 is pretty simple, but it has a few downsides, including the fact that emails are automatically deleted once downloaded

4.2.4 Complex mail reading protocol — IMAP protocol

4.3 E-mail based on world Wide Web

The difference is that the mail server side of web-based E-mail can be different

In addition, the SMTP/MIME protocol used for sending mails and the POP3/IMAP protocol used for receiving mails are changed to HTTP

5. The World Wide Web and HTTP

5.1 Overview of the Web

Urls are used to identify the location of a resource (text, video, audio, etc.) across the Internet

HTTP is used to deliver these resources to the user

HTML helps designers to design pages, so that pages designed by different designers can be displayed on the interface

5.2 the HTTP protocol

5.2.1 HTTP process

This diagram shows how HTTP works

The server listens for HTTP requests through TCP port 80

Note that HTTP does not download all the resources on the page at one time. You can download only the text part and wait for the next request of the user to transfer other audio and video

5.2.2 Features of HTTP

5.2.3 HTTP Connection modes — Persistent and non-persistent Connections

A non-persistent connection occurs during the third handshake of the TCP three-way handshake. The SERVER sends the HTTP request to the client as the data part of the third handshake. After receiving the request, the server transmits the CORRESPONDING HTTP packet to the client. Time is RTT*2+ document transfer time. The downside is that if you want to transmit again, you have to re-establish the TCP connection and start from scratch

A persistent connection is similar to a non-persistent connection. The HTTP request is sent to the server as the data part of the third handshake. After receiving the request, the server transmits the HTTP packet to the client. However, there is no need to establish new TCP connections when persistent connections require resources

Two types of persistent connection – non – pipeline and pipeline

Unpipelined means you send one, confirm one, and then you send the next one in a row, and then you send multiple acknowledgments which is very similar to the stop wait protocol, back N frame protocol and select retransmission protocol, Computer Networking Notes Part3 Data Link Layer

5.2.4 HTTP Packet Structure

The start line is used to distinguish request packets from response packets. And you can obviously see that the first line is different

The method of the request message is the command, which is what to do to the requested object, such as get/delete, etc. The URL is the resource identifier and the version is what version of HTTP protocol is used

CRLF corresponds to the one in our program;To mark the end of a line. Also, at the end of the entire header line, there is a separate CRLF to distinguish the header line from the entity body



Here are some examples of request messages and some common status codes

6. Mind mapping in this chapter