Computer Network 2. Application Layer

Source: Internet
Author: User

Application Architecture: Generally, network applications have two structures: Client/Server Architecture and peer-to-peer architecture (P2P ).

In client/server architecture, a host that is always open is called a server, which provides services for requests from the client. No direct communication is performed between clients. The server has a fixed ingress address, which is called an IP address and is always on. A server host may not be able to keep up with all of its client requests. Generally, a cluster of hosts is used as the server farm to create powerful virtual servers. Application Services Based on the client server architecture are usually infrastructure-intensive infrastrucuture intensive, because you need to purchase, install, and maintain the server farm.

In the P2P architecture, there is a minimum or no dependency on always open infrastructure servers. The host pair connected at any time is called the peer peers for direct communication. In P2P, the most prominent feature is its self-scalability.


The actual communication process is the process, not the program. Processes of different systems communicate with each other by exchanging packets across computer networks. It can be divided into client processes and server processes. In a given communication session between processes, the process initiating communication is a client process, and the process waiting for connection is a server process.

A process sends and receives packets over the network through a software interface called socket. A socket is an Application Programming Interface API between an application and the network.

Application Services can be classified based on reliable data transmission, throughput, timing, and security.

Reliable data transmission: reliable data transmission reliable data transfer, transport layer for reliable data transmission, when the transport layer uses this service, you can believe that the data is error-free to reach the receiving process. When a transport layer protocol does not provide reliable data transmission, it is acceptable for applications that tolerate loss of loss-tolerant applications, such as multimedia applications, to a certain extent.

Throughput throughput: a program with throughput requirements is called a bandwidth-sensitive application. Most multimedia applications are bandwidth-sensitive. Elastic application elastic appliction can make full use of available throughput as needed.

Timing timing: The Transport Layer Protocol also provides timing assurance, just like throughput assurance. Different applications have different time limits.

Security: transport layer protocols can provide one or more security services for applications.


The Internet or TCP/IP applications use two transport layer protocols: UDP and TCP.

TCP Service: Includes connection-oriented and reliable data transmission services. When the application layer program calls the TCP protocol as its transport layer protocol, the application obtains the two services.

Connection-oriented service: Before the packets start to flow, the client program and the server program exchange transport layer control information, that is, handshaking during the handshake. The handshake prompts that the client and the server are ready for the transmission group. After the handshake, a TCP connection is established between the socket sockets of the two processes.

Reliable data transmission service (reliable data transfer service): Processes for communication, error-free, and data delivered in order.

The UDP Service is connectionless and has no handshake process. UDP cannot ensure that packets are correctly received. There is no congestion control mechanism.


Process addressing processes: the host name or address and the identifier used to specify the processes received on the target host. Hosts are identified by IP addresses. The process is specified by the port number of the destination port.

On a host, multiple processes may use the same port at the same time. For example, multiple browsers use port 80 to browse the webpage, however, the operating system specifies that only one process can use the port and listening port at a time. That is, when you give a process a focus, it is using the port, other processes cannot use ports.


The application layer protocol defines:

The type of the exchanged message, such as the request message and Response Message.

Syntax of various packets, such as each field in the message and its detailed description.

Field semantics, that is, the meaning of the information contained in the field.

Rules for processes when and how to send messages and respond to messages.

Application layer protocols are part of network applications.


Web applications and HTTP protocols:

The Web application layer protocol is hypertext transfer protocol HTTP. HTTP is implemented by two programs: a client program and a server program.

A web page consists of objects, including files, HTML files, image files, and video files. File addressing through URL address. The Web generally contains a basic HTML file and several referenced objects.

HTTP uses TCP as the transport layer protocol. HTTP does not save any information about the client. It is a stateless protocol.

Non-persistent connection: each request/response is sent through a separate TCP connection.

Persistent connection: All requests are sent over the same TCP connection. HTTP uses persistent connections by default.

For non-persistent connections, when a webpage has multiple references, a new connection is required for each loading of the referenced files to transmit data. Round-trip time RTT refers to the time when a group is returned from the client to the server. Each TCP connection has a three-way handshake process.


HTTP message:

Request Message response message: the first line of the request message is the request line require line. The subsequent line is the header line, and the rest is the entity body. The request line has three fields: Method Field, URL field, and HTTP Version. The value of the method field is get, post, head, put, and delete.


Socket programming.

To be continued.


Computer Network 2. Application Layer

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.