Computer network 14--application process communication

Source: Internet
Author: User

Contents of this page

1. How the Process communicates

2. The role of sockets in communication

3. How the process is addressed

4. Application Layer Protocol

1. How the Process communicates

Every program you run, there will be processes, possibly one, or multiple. It would be boring if it could only be isolated and run alone. Most people want to talk to friends, and so is the process. So how did they do it?

If the processes running on the same host want to communicate with each other, they can be done through interprocess communication mechanisms , which are provided by the operating system , like the dialect of their hometown, and the exchange of nature without any problems. So the question is, what if I want to leave my hometown and go out and do communication with processes running on different hosts ? As the saying goes, speak dialect at home and speak Putonghua outside. The processes running on different hosts need to be conversational, and of course, in a way that everyone understands-- message exchange . Otherwise let a process with win dialect and a process of using MacOS dialect to talk to each other in their own dialect, not let people laughable. So what is the message exchange going through? The answer is: socket.

2. The role of sockets in communication

Socket =socket

Interprocess communication is implemented using the socket Send/Receive message.

It is not difficult to see that the socket is equivalent to a common intermediate language, so that different hosts can communicate smoothly. To make the socket a good translator, the transport infrastructure needs to provide the appropriate API for the process to use. This involves the choice of the transport protocol and the setting of the corresponding parameters . We won't dwell on it.

3. How the process is addressed

How the processes running on different hosts recognize each other, you might say simple! Does every host have an IP? Just follow the IP to find out, right? The question comes again, if your QQ want to chat with your girlfriend's QQ, but when the information according to your girlfriend's IP address passed, but found that your girlfriend opened a process to accept the network information--lol customer service side. So, which process does your message actually pass to? Then you will certainly say to QQ network process Ah, that is which is QQ network process? Right! Here we also need to identify the relevant process, so that the information sent by other processes can successfully reach the destination process. This is the identifier of the process we are talking about (the processes on different hosts communicate with each other and must have this thing). Identifiers consist of an IP address and a port number . The different processes on the host are assigned the corresponding port numbers, just as each household is assigned a house number. For example, the port number of the HTTP server is: 80,mail Sever port number is: 25.

4. Application Layer Protocol

No rules, inadequate surrounding area. In order to communicate properly, network application must have good protocol to standardize communication. Network applications adhere to the application-layer protocol. The application layer protocol can be divided into public protocol and private protocol . The public protocol is defined by the RFC (Request for Comments) and allows interoperability, such as HTTP, SMTP, and so on. The private protocol is mostly peer-to file sharing applications, all developed by the company itself, non-public.

The application layer protocol is mainly used to standardize those aspects?

A. type of message : Request message, Response message. (You have to know what's on the other side to get ready for it)

B. message Syntax (syntax)/format: What fields are in the message, and how each field is described.

C. field Semantics (semantics): The meaning of the information in the field.

D. rules : When a process sends/responds to messages, and so on.

Finally, let's end this article with the HTTP protocol as an example:

Pictures do not understand it's okay, Baidu a bit, you know.


Computer network 14--application process communication

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.