First, the Application layer protocol principle
1. Network Application Architecture
The architecture of the application is significantly different from the architecture of the network. From the perspective of the application developer, the network architecture is fixed and provides a specific set of services for the application.
Application Architecture (Application architecture) is designed by application developers to specify how the application is organized on various end systems.
Two mainstream architectures for modern Web applications: client/server architecture and peer-to-peer architecture.
client/server architecture (Client-sever architecture): A host that is always open is called a server, and it serves requests from many other hosts called clients. The client host can be opened sometimes or always. A typical example is a Web application that always opens a Web server that serves a request to a browser running on a client host. When a Web server receives a request from a client for an object, it sends the requested object as a response to the client. Note that in a client/server architecture, clients cannot communicate directly with each other, for example, two browsers cannot communicate directly in a Web application. Another characteristic of the client/server architecture is that the server has a fixed, known address, called an IP address. Because the server has a fixed, well-known address and is always open, the client is always able to contact the server by sending a group to its address. Some of the more well-known applications with client/server architecture include Web, FTP, Telnet, and e-mail.
in-Peer architecture (Peer-to architecture), there is minimal reliance on infrastructure servers that are always turned on. The hosts of any intermittent connection are called peers and communicate directly with each other. The peer is not owned by the service provider, but is owned by the user-controlled desktops and laptops, and most peers reside in the home, university, and office. Because this peer communication does not have to go through a dedicated server, the architecture is referred to as peers to peers (referred to as peers). Today, most of the popular traffic-intensive applications are peer architecture, including file distribution, file search/sharing, Internet telephony, and IPTV (PPLive). Some apps have a hybrid architecture, which is a combination of client/server and peer-to-peer elements. For example, for many instant messaging, a farm is used to track a user's IP address, but a user-to-user message is sent directly between the user's host (without having to pass through an intermediary server). One of the most prominent features of the peer-to architecture is its self-extensibility (self-scalability). For example, in a one-to-peer file sharing app, although each peer is loaded by the request file, the other peer distribution files in each peer direction also add to the system's ability to service. Peer-to architecture is also cost effective because they typically do not require a large server infrastructure and server bandwidth. To reduce costs, service providers (MSN, Yahoo, etc.) are becoming increasingly interested in systems for peer-to architecture. On the other hand, due to the highly distributed and open nature of the peer-to application, the security of the system is of particular concern.
2. Process Communication
2.1 client and server processes :
Network applications are made up of paired processes that send messages to and from each other over the network. For example, in a Web application, a client browser process exchanges messages with a Web server process. In a peer-to file sharing system, a file is transferred from a process in one peer to a process in another peer. For each pair of process communication, one of the two processes is typically represented as a client , while another process is represented as a server (server). In the web, a browser is a client process, and a Web server is a server process. For peer-to-peer file sharing, peers who download files are marked as clients, and peers who upload files are referred to as servers.
In a communication session between a given pair of processes, the process initiating the communication is marked as a client , and the process waiting to be contacted at the beginning of the session is the server .
interface between the 2.2 process and the computer network :
Most applications consist of a communication process pair, and each pair of two processes sends messages to each other. Messages sent from one process to another must pass through the following network. The process sends and receives messages over the network through a software interface called a socket (socket).
A process is analogous to a house, and its sockets can be likened to its door. When a process wants to send a message to another process located on another host, it launches the message to the door (socket). The sending process assumes that there is a transport infrastructure between the door and the other side, and that the facility will transmit the message to the doorway of the destination process. Once the message arrives at the destination host, it passes through the message receiving process's door (socket) and the receiving process handles the message accordingly.
Because sockets are programmable interfaces that establish network applications on a network, sockets are also referred to as application programming interfaces between applications and networks (application programming Interface,api). The application developer can control everything on the application layer of the socket, but there is little control over the transport side of the socket.
The application developer's control of the transport layer is limited to: Select Transport Layer protocol may be able to set the pass transport layer parameters, such as maximum cache, maximum message length. Once the application developer chooses a Transport layer protocol (if available), the application is built on top of the Transport layer service provided by the Protocol.
2.3 transport services available for Applications :
2.4 Transportation services provided by the Internet
2.5 Application layer protocol
Ii. Web applications and HTTP protocols
Third, File Transfer protocol: FTP
Iv. e-mail in the Internet
V. DNS: Directory services for the Internet
Six, peer-to application
Seven, TCP socket programming
Eight, UDP socket programming
Computer network-Application layer