Principle application layer protocol (a)

Principle application layer protocol (a)

The advantages of a layered architecture can be well reflected here, the development and application layers of the application need not concern requirements running on the network core equipment as the network core equipment can only work on the network layer and below, can not reach the application layer .

1. Network Application Architecture

Unlike Network Architecture

1. For developers, the network architecture is fixed, a collection of whom its services can be used.

2. Network application architecture is designed for developers, how to organize the provision applications on a variety of end systems.

Two mainstream application architecture

Client - server architecture

  • A server having a known address is fixed , and the total open.

  • No direct communication between the client only through the server client IP addresses to communicate with the server.

  • Solve a multi-user server problem : with a large number of data centers, to create powerful virtual server.

  • For example: Web, FTP, telnet, email and so on.

P2P architecture

  • Not by a dedicated server, a communication between the peer and a peer .

  • Applications have very small dependence on a dedicated server in the data center, not even.

  • Many traffic-intensive applications such as: shared files (Bit Torrent, peer assistance Download Accelerator (Thunder) and so on.

Of course, there are mixed, such as many instant messaging applications

  • Server keeps track of the user's IP address ---> L client - server architecture

  • Messages between the user and the user is sent directly between the host ---> P2P architecture

2. Process Communication

Communication is actually a process (process), rather than a program. A process can be considered to run a program on the side of the system .

  • When multiple processes on the same end system, the direct use interprocess communication mechanisms for communication, and the communication rules determined by the operating system.

  • When the process on different end systems communicate with each other, we need to how to do it? That is, the transmitting end generates and transmits the network packet, the receiving side receives the packets and may be sent back by the response packet.

Client and server processes

Network application consists of all sorts of processes composed of two important roles in the process, the customer (client) and server (Server) .

  • Web applications, web servers -> Server process, the browser is the client process.

  • P2P file sharing system, upload files to the server, the file is downloaded client.

Note: Although the P2P process both in a client and a server, but in any given process of being, his identity when determining the total .

Scene in a communication session between a pair of process, the process of initiating communication is identified as customers wait to contact at the start of the painting is the server.

The interface between the process and the computer network

First you have to understand a very important concept: a socket (socket).

The socket is an interface between the application layer and the transport layer.

Because the socket is to establish a network application programming interface, so that the socket is also referred to as an application programming interface (Application Programming Interface).

Note: The application developer can control everything in the socket end of the application layer, but to end the transport layer almost no control over . The control terminal of the transport layer is limited to

1. Select the transport protocol.

2. Several transport layer parameter setting (maximum cache and the maximum packet length, etc.).

Once a transport layer protocol selection, the application layer built on top of the transport services provided by the agreement.

Addressing process

From one host to send a packet to another host, you need to identify the address of the receiving process, or how to find, oh. How to define it?

1. destination host address (the IP address unique identification (IP address)).

2. Specify the receiving process running on the receiving host, in particular, is receiving socket. (Through the port number identification (port number))

Probably just go to the library to find books, the library's address is called the host address, rather than the other schools in the library of their own school to find the book there are number of books of their own, so many books in the library, to distinguish between different number, which is similar to the port number. Multiple processes running on a host, like a library of many books, as the same.

Guess you like

Origin www.cnblogs.com/summerday152/p/11884528.html