CGS 3763 Operating Systems Concepts Spring 2013 Dan C. Marinescu Office: HEC 304 Office hours: M-Wd 11:30 - 12:30 AM
Lecture 13 – Wednesday, February 6, 2013 Last time: Process creation and termination Interprocess communication Message passing Today: Networking concepts Next time Client-server systems Remote procedure call Reading assignments Chapters 3 and 4 of the textbook Chapters 3 and 4 textbook slides Lecture 13
Asynchronicity Asynchronous events occur independently of the main program flow. Asynchronous actions executed in a non-blocking scheme, allowing the main program flow to continue processing. Asynchronous I/O input/output processing that permits a processing to continue before the I/O operations has finished. Asynchronous processes do not share a clock Asynchronous communication the sender does not wait to receive an acknowledgment from the receiver. 9/19/2018
Message passing Processes must have a way to refer to each other. Direct communication a process must explicitly name the recipient or sender of the communication: send(P, message) -Send a message to process P. receive (Q, message)-Receive a message from process Q. Indirect communication messages are sent to and received from mailboxes, or ports. send (A, message) -Send a message to mailbox A. receive (A, message)-Receive a message from mailbox A. 9/19/2018
Blocking and non-blocking send & receive 9/19/2018
Message queues Processes communicating through message passing implement sending and receiving queues. The queues/buffers: Bounded capacity – Unbounded capacity – 9/19/2018
If a message is sent to a mailbox If the mailbox is not full, the message is copied to the mailbox, and the sending thread continues. If the mailbox is full, the sending thread has four options: Wait indefinitely until there is room in the mailbox. Wait at most n milliseconds. Do not wait at all but rather return immediately. Temporarily cache a message. One message can be given to the operating system to keep, even though the mailbox to which that message is being sent is full. When the message can be put in the mailbox, a message is sent back to the sender; only one such message to a full mailbox can be pending at any time for a given sending thread. 9/19/2018
Networking concepts Protocol – a communication discipline; a set of rules obeyed by two entities to communicate with one another. Internet core and periphery. Internet layered architecture. Peer-to-peer communication; each layer running on one host communicates with its peer running on another host. Multiplexing and de-multiplexing of messages. Message delivery to processes. Lecture 13
Lecture 13
Internet layered architecture Lecture 13
Peer-to-peer communication Lecture 13
Local and wide area networks Lecture 13
Multiplexing, de-multiplexing Lecture 13
Multiplexing and de-multiplexing Lecture 13
Ports and socket Lecture 13
Lecture 13
Communications in Client-Server Systems Sockets Remote Procedure Calls Remote Method Invocation (Java) Lecture 13
Sockets A socket is defined as an endpoint for communication Concatenation of IP address and port The socket 161.25.19.8:1625 refers to port 1625 on host 161.25.19.8 Communication takes place between a pair of sockets Lecture 13
Socket Communication Lecture 13