Networking ch2

2021-09-20  本文已影响0人  Wilbur_

Before building your network application, you also need a basic understanding of how the programs, running in multiple end systems, communicate with each other.

Processes Communicating

Program means processes in computer systems jargon. So it is not actually programs but processes that communicate. A process can be thought of as a program that is running within an end system.

When process running on same host, they can communicate with each other through host's operating system. But when they running on different hosts (potentially different operating systems), they communicate with each other by exchanging messages across the computer network. (is this what message queue is all about??)

A sending process creates and sends messages into the network; a receiving process receives these messages and
possibly responds by sending messages back.

Is this what lamport is talking about?? We are exchanging messages on different process and one important thing is to garantee the correctness of the messages!

We define the client and server pro-cesses as follows:
In the context of a communication session between a pair of processes, the pro-
cess 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.

A process sends messages into, and receives messages from, the network through a software interface called a socket.

In addition to knowing the address of the host to which a message is destined, the sending process must
also identify the receiving process (more specifically, the receiving socket) running in
the host. This information is needed because in general a host could be running many
network applications. A destination port number serves this purpose.

port number used to identify which process is being runned on the host device

2.4 DNS

In order to identify host name from their IP address, we need a directory service that translates hostnames to IP addresses. This is main task of the Internet's ** domain name system (DNS) ** The DNS is

  1. A distributed database implemented in a hierarchy of DNS servers
  2. an application-layer protocol that allows hosts to query the distributed database.
    The DNS servers are often UNIX machines running the Berkeley Internet Name Domain (BIND) software
    The DNS protocol runs over UDP and uses port 53.

DNS is commonly employed by other application-layer protocols -- including HTTP and SMTP to translate user-supplied hostnames to IP addresses. As an example, consider what happens when a browser request the URL www.someschool.edu/index.html
In order for the user's host to be able to send an HTTP request message to the web server www.someschool.edu, the user's host must first obtain the IP address of www.someschool.edu. This is done as follows.

  1. The same user machines runs the client side of the DNS application
  2. The browser extracts the hostname, www.someschool.edu, from the URL and passes the hostname to the client side of the DNS application.
  3. The DNS client sends a query containing the hostname to a DNS server.
  4. The DNS client eventually receives a reply, which includes the IP address for the hostname.
  5. Once the browser receives the IP address from DNS, it can initiate a TCP connection to the HTTP server process located at port 80 at that IP address.
上一篇下一篇

猜你喜欢

热点阅读