Computer network study notes-application layer

Application layer

1. Domain Name System

The Domain Name System (DNS) is a naming system used on the Internet to convert host names with specific meanings that are easy for people to remember into IP addresses that are easy for machines to process .

DNS adopts the C/S model, and its protocol runs on UDP and uses port 53 .

Conceptually, DNS can be divided into three parts: hierarchical domain name space, domain name server and resolver .

1.1, hierarchical domain name space

Insert picture description here

1.2, domain name server

1.2.1, root domain name server

The root domain name server is the highest level domain name server, and all root domain name servers know the IP addresses of all top-level domain name servers . The root domain name server is also the most important server. No matter which domain name server it is, if you want to resolve any domain name on the Internet, as long as you cannot resolve it yourself, you must first ask for help from the root domain name server . The root domain name server is used to manage the top-level domain . Usually it does not directly convert the domain name to be queried into an IP address, but tells you which top-level domain name server the local domain name server should look for next .

1.2.2, top-level domain name server

These domain name servers are responsible for managing all second-level domain names registered on the top-level domain name server.

1.2.3, authorized domain name server (authorized domain name server)

Each host must be registered with an authorized domain name server. The authority domain name server can always convert the host name under its jurisdiction into the IP address of the host .

1.2.4, local domain name server

The local domain name server is very important to the domain name system. Every Internet Service Provider (ISP) can have a local domain name server . When a host sends a DNS request, the query request message is sent to the host's local domain name server .

1.3, domain name resolution process

Domain name resolution refers to the process of mapping domain names to IP addresses (forward resolution) or mapping IP addresses to domain names (reverse resolution) . There are two ways of domain name resolution: recursive query and query that combines recursion and iteration .

Insert picture description here


2. File Transfer Protocol (FTP)

Insert picture description here


3. Email

Insert picture description here


4. World Wide Web (WWW)

The World Wide Web (WWW) is a narcissistic space in which: the same useful things are called the same "resources" and are identified by a global "Uniform Resource Locator (URL)". These resources are transmitted to the user through the Hypertext Transfer Protocol (HTTP), and the latter obtains the resources by clicking a link.

The general form of the URL is: <protocol>://<host>:<port>/<path> .

The <protocol> includes http, ftp, etc.; <host> is the domain name of the host that stores the resource on the Internet, or it can be an IP address .

4.1. Hypertext Transfer Protocol (HTTP)

HTTP is stateless .

In practical applications, cookies and databases are usually used to track user activities. Cookie is a text file stored in the user's host .

HTTP uses TCP as the transport layer protocol to ensure data reliability. HTTP itself is connectionless .

HTTP can use non-persistent connections or persistent connections .

4.2, HTTP status code

status code English explanation of status code Description
1** Information, the server receives the request and needs the requester to continue the operation
100 Continue carry on. The client should continue its request
101 Switching Protocols Switch the protocol. The server switches the protocol according to the client's request. Can only switch to more advanced protocols, for example, switch to the new version of HTTP protocol
2** Success, the operation was successfully received and processed
200 OK The request was successful. Generally used for GET and POST requests
3** Redirect, requires further action to complete the request
301 Moved Permanently Move permanently. The requested resource has been permanently moved to the new URI, the returned information will include the new URI, and the browser will automatically be directed to the new URI. Any new requests in the future should use the new URI instead
4** Client error, the request contains a syntax error or the request cannot be completed
404 Not Found The server cannot find the resource (web page) according to the client's request. Through this code, the website designer can set a personalized page of "The resource you requested cannot be found"
5** Server error, the server encountered an error while processing the request
501 Not Implemented The server does not support the requested function and cannot complete the request

5. Common application layer protocols

application Use Agreement Well-known port number
FTP data connection TCP 20
FTP control connection TCP 21
TELNET TCP 23
SMTP TCP 25
DNS UDP 53
TFTP UDP 69
HTTP TCP 80
POP3 TCP 110
SNMP UDP 161

Guess you like

Origin blog.csdn.net/qq_36879493/article/details/107836088