Study Note on "Computer Networks: Top-Down Approach" (2): Application Layer

Application layer protocol principle

The key is the development of network applications can be written into the operating system at different ends and a network communicate with each other procedures.

为什么只在端系统开发程序呢?因为路由器及交换机等网络核心设备并没有应用层,只负责传输数据,我们没必要也不能基于它们开发程序。

Insert picture description here

1 Network Application Architectures

Application architectures (application architectures) are different from network architectures (network architecture). The network architecture is a fixed 5-layer or 7-layer, and provides a specific set of services for applications, such as the physical layer is only responsible for the transmission of data bit stream; and the application architecture specifies how to organize applications on the end system application layer The current mainstream application architecture is client-server architecture and peer-to-peer architecture .

  • Client-server architecture (C / S)
    In the C / S architecture, there is a host that is always open, that is, the server, which accepts service requests from other hosts. The corresponding host that initiates the service request is called Clients. Customers always need to access the server when they need service, which means that the customers do not communicate directly with each other, and the server has a fixed and well-known IP address for access. Common applications that use C / S architecture are Web, FTP, Telnet, and email.
    Insert picture description here
  • Peer-to-peer architecture (P2P)
    In a P2P architecture, hosts can communicate directly with little or no dependence on servers. These hosts are called peers. The relationship between the server and the client in the P2P architecture changes dynamically. The peer that initiates the service request is called the client, and the other peers that provide the service are called the server. In a P2P application layer network, each peer generates a workload on the network, but at the same time increases the service capacity. Common applications that use the P2P architecture include file sharing (such as BitTorrent), download assistance (such as Thunder), and Internet telephony (such as Skype).

2 Processes Communicating

The main body of communication between hosts is a process rather than an application. Within the host process has pipes, message queues and semaphores communication, and the process between the host computer across the network using the packet (message) communicate with each other. Correspondingly, the process that initiated the communication is marked as the client process, and the process that waits for contact at the beginning of the session is called the server process. Similar to the IP address of the host, each process holds a port number (port number) to distinguish each other.

In the context of a communication session between a pair of processes, the process that initiates the communication (that is, initially contacts the other process at the beginning of the session) is labeled as the client. The process that waits to be contacted to begin the session is the server.


Insert picture description here
Socket (socket): socket in the computer network mainly includes two concepts, one is the concept of the socket, that is, socket = (IP address: port number), the data in the transmission process requires not only the IP address to find the destination host, And the port number is needed to find the destination process, because it is the process that really uses the data; one is the concept of the layer, that is, an abstraction layer between the application layer and the transport layer, which abstracts the complex operations of the TCP / IP layer into a few simple ones The API interface functions are provided by the application layer to enable the process to communicate in the network.

为什么应用层和传输层之间不直接传输数据,而要单独设置套接字(socket)层作为媒介?
套接字(socket)主要有3个参数:通信的目的IP地址、使用的传输层协议(TCP或UDP)和使用的端口号。应用层通过传输层进行数据通信时,多个应用程序进程可能需要通过同一个TCP/IP协议端口传输数据,使用套接字就可以根据参数找到目的主机和进程及使用的协议,并数据传输的并发控制交给套接字函数实现。


Published 21 original articles · praised 8 · visits 1495

Guess you like

Origin blog.csdn.net/K_Xin/article/details/105362266