Message Passing in various contexts Book chapters: Section 4.6, Chapter 16 (16.3, 16.4), Parts of Chapter 15. ------------------------------------------------------------------------------- Message passing among processes on the same machine: . section 4.6; . processes have mailboxes, or ports, for receiving messages from other processes; . processes send message to another process' mailbox (or port); . the send and recv primitives; . inter-process communication can be used to implement process synchronization; Example: critical regions; there can be a master process that manage the critical region, deciding when and which process can enter the critical region; processes wishing to enter the critical region send requests to the master process and wait for replies that say ok; . relatively simple compared with other message passing paradigms, because don't have to deal with message failure and other transmission errors; ------------------------------------------------------------------------------ Message passing among processes on tightly-coupled cluster of machines; . mostly used for parallel scientific computing; . the MPI (Message-Passing Interface) standard for scientific parallel applications that use message passing to coordinate the processes; . characteristics of the message passing implementation: ultra-low overhead, network is of very high speed and has very low error rate; a lot of the error handling are omitted in order to have a high speed implementation of message passing; ------------------------------------------------------------------------------ Message passing across local area network and wide area network; . Internet address (IP address) and port numbers; . socket interface: Example; client/server structure; . socket are created by the user process; a socket is referred to by using a file descriptor; . the server process can "bind" the socket to a particular port number on the server machine; . the server process then "listen" on the socket and "accept" new connection requests; . the client process on the client machine creates a socket, then "connect" the socket to the port number on the server machine to establish a connection; . client and server then exchange messages over the connection; . four layers of protocols (section 15.6): - link layer: low-level protocols that deals with how messages are transmitted over the physical link; for example, modems have their own link layer protocol, ethernet has a different protocol, etc. - IP: also called the Internet Protocol. Deals with how messages are routed through the Internet, and how messages are fragmented and transmitted over the physical links; - TCP (Transmission Control Protocol) and UDP (user datagram protocol): transport-layer protocols, handles end-to-end message transfers, including connection setup and tear-down, error control, flow control, congestion, fragementation and sequencing; - Application layer protocols: such as HTTP, FTP, Telnet protocols; . Domain Name Server (section 15.5.1): translates names of machines to IP addresses; - use a hierarchical design; - uses caching to improve its performance; - Netscape consults DNS for IP addresses of Web servers;