directory
- An overview of the
- The physical layer
- Data link layer
- Network layer (1) Basic knowledge
- Network layer (2) IP address design and exhaustion
- Network layer (3) Network layer packet transmission process
- Network layer (4) Network layer multicast and other applications
- Transport layer (1) Reliable transport and TCP/UDP
- Transport layer (2) congestion control and handshake waving
Tasks at the application layer
What does the next four layers provide for the topmost layer in general? What is missing now in order to complete our daily use of the Internet? We can think about the functions of the next four layers. We only need to look at the transport layer in the previous section, because each layer is transparent transport, and the transport layer also uses the functions provided by the next three layers. At the transport layer, we only know reliable TCP and unreliable UDP, which can be used to complete the transmission of network data. As for how to find the destination through hardware, it should be implemented at the following levels. We don’t have to care about anything except whether we want reliable transmission or unreliable transmission. So what do we need now? Currently, the transfer service between application processes is provided, but there is still a lack of how application processes use them, and through what application layer protocol. We use a variety of applications, each with its own characteristics, has its own transport characteristics, it is impossible for all applications to use the same protocol. Therefore, at this level, it also encapsulates various protocols that users can intuitively use, through which users can complete the services they want. This is the end of all layers of the computer network. Each protocol in the application layer is designed to solve an application problem that requires the following information:
- Types of messages exchanged between applications, request messages and corresponding messages
- Syntax of the message, meaning of each field
- When and how processes send messages The protocols that are standard applications in the Internet public domain are defined by RFC documents, and you can look up many of the protocols at the application layer are based on the client-server approach, where the client is the service requester and the server is the service provider. Here’s a closer look at some of the protocols we use on a daily basis.
World Wide Web and HTTP protocol
The purpose of the network is to obtain resources, so we in the process of obtaining resources, where will encounter some problems
- How to mark resources on each host and uniquely locate them?
- What protocol is used to implement this markup?
- How can users easily obtain such tags?
- How to standardize the transmitted document data?
In order to solve the above problems, the current solution is the WORLD WIDE WEB (WWW), which is a large-scale, on-line information repository. It uses links to mark resources, which can be easily accessed through links to other sites. With the emergence of the World Wide Web, ordinary people can also use network resources. The World Wide Web is an important milestone. The World Wide Web is a distributed hypermedia system, an extension of hypertext, which refers to text with links to other documents, and hypermedia, which includes multimedia.
So how does the Web solve this problem?
-
Use URL uniform resource locator to locate the resources of the World Wide Web, and make each and every document have a unique URL to provide a unified identification code for resources, which can be used as the address of each resource, because the path format of resources in different operating systems is not unified. Urls also rely on abstraction, regardless of how the operating system’s path format varies. It consists of {protocol}://{host}:{port}/{path}. Protocols commonly used include HTTP and FTP. A host refers to a domain name on the Internet. These two parts are required. HTTP urls are commonly used. The default HTTP port number is 80. You can omit the port number in the link, or if you omit the path, it points to the home page of the site.
-
What protocol is used to implement the various links, which is known as HTTP, which is an application layer protocol, usually using TCP for secure transport. HTTP defines how web servers request Web resources. It’s text-oriented. Each data in the packet is ASC2. And how the server sends the document to the appropriate requester. HTTP is stateless, that is, the server knows that the same user accesses it multiple times. This statelessness simplifies server design, making it easy for servers to support large amounts of concurrency. In addition, HTTP is linkless. Although TCP is used, HTTP connections do not need to be established. The earliest HTTP1.0 if the HTTP transport completed, will close the connection, usually an HTML to request many objects, it is very slow, because every request need to establish a connection, solved the problem in the HTTP1.1 version, it USES the continuous connections, the server after sending response can also keep this connection. This continuous connection also has two working modes, non-pipelined mode and pipelined mode, which can be analogous to the stop-wait protocol continuous ARQ protocol. Http packet format: Request packet: a packet sent from the client to the server. Response packet: A response packet sent from the server to the client consists of the start line, head line, and entity body. The start line of the request and response is different. Start line: Used to distinguish between request packets and response packets. The request message consists of the method, the URL of the requested resource, and the HTTP version. The method is the operation on the requested object. For example, GET(request to read the information marked by the URL), POST(add information to the server), HEAD(request the URL to represent the information header), PUT(store a file in the specified URL), DELETE(DELETE the specified file), etc. Follow this with the full/relative URL and HTTP version (add the host name in the header if relative is used). The beginning line of the response message is called the status line and contains the HTTP version number, the status code, and a simple phrase that explains the status code. The status codes are all 3-digit and divided into five categories.
-
1** Indicates a notification message, such as the request received or is being processed
-
2** indicates success, such as received or known
-
3** indicates redirection
-
4** Indicates a client problem, such as a request function syntax error
-
5** Indicates an error of the server, for example, the server cannot complete the request
Header line: Describes some information about the server and client. There are several key: values in the header that hold the value of each state, and a final line that separates the following entities. Entity body: Transfers data
- How to unify the markup of the document, is HTML hypertext Markup language. You can access any interface on the World Wide Web through it. If any computer can display the web server interface, it must be standardized. This is HTML, the standard language for creating the World Wide Web, which eliminates barriers to communication between computers.
DNS protocol
Computer networks use IP addresses, but we don’t use them when we use other web services. We use domain names such as Baidu.com and Sohu.com. So what protocol is used to convert the domain name we enter into an IP address? DNS protocol.
Proxy server
It stores recent requests and responses temporarily on local disk, and when new requests arrive, it returns the response temporarily, rather than fetching resources from the requested Internet, which the proxy server can use on both the server and client side. This method greatly reduces the time delay of accessing the Internet.
Cookie
Since HTTP is stateless, there is a requirement for the server to mark the user. HTTP uses cookies, stipulating that the World Wide Web can use cookies to track users. When the user uses the website of Cookie, the server of the website will generate A random identification code for A. In addition, an item is generated in the database of the server, and set-cookie: identification code is set in the header line of the response packet to A. The browser receives it and stores it, bringing it with it when it requests the site later. This allows the server to tag the user.