Networks Communication continued CS4513 Distributed Computing Systems Slides
Networks & Communication (continued) CS-4513 Distributed Computing Systems (Slides include materials from Operating System Concepts, 7 th ed. , by Silbershatz, Galvin, & Gagne, Modern Operating Systems, 2 nd ed. , by Tanenbaum, and Distributed Systems: Principles & Paradigms, 2 nd ed. By Tanenbaum and Van Steen) CS-4513, D-Term 2007 Networks & Communications 1
Review — OSI 7 -layer model Sending Process Application Layer Presentation Layer Session Layer Transport Layer Network Layer Data Link Layer Physical Layer CS-4513, D-Term 2007 Receiving Process Data AH PH Data SH TH NH DH Data Data DT Application Layer Presentation Layer Session Layer Transport Layer Network Layer Data Link Layer Physical Layer Bits Networks & Communications 2
Layered Protocols • OSI 7 -layer model was intended to be a foundation of a family of international standard protocols • Those protocols never gained much acceptance • Role of Session and Presentation layers is murky, at best. • Internet protocols (TCP/IP, etc. ) are dominant CS-4513, D-Term 2007 Networks & Communications 3
The TCP/IP Protocol Layers TCP/IP CS-4513, D-Term 2007 Networks & Communications 4
The TCP/IP Protocol Layers TCP/IP Subsumed by middleware Defined by manufacturers, industry sub-groups, and separate standards bodies CS-4513, D-Term 2007 Networks & Communications 5
Modified Layers CS-4513, D-Term 2007 Networks & Communications 6
Examples of Middleware • • • Authentication protocols Commit protocols for atomic transactions Multimedia protocols Remote procedure protocols … CS-4513, D-Term 2007 Networks & Communications 7
Styles of Communication • Message-oriented • Remote Procedure Call • Streaming CS-4513, D-Term 2007 Networks & Communications 8
Some Terms • Packet: – A unit of communication at Data Link layer – aka datagram • IP Address: – A four-part “number” used by Network Layer to route a packet from one computer to another • Port: – A 16 -bit number used within one computer to identify who/where to send packet to • Well-known port: – A port with number < 1024, used by agreement for standard services – e. g. , • telnet (23), ftp (21), smtp (25), pop (110) CS-4513, D-Term 2007 Networks & Communications 9
More Terms • Socket: – End point of a communication – Usually used in pairs, one for each direction – Comprises [IP Address: Port #] • Connection: – A logical linkage between pairs of sockets at two endpoints for purposes of a particular communication between those endpoints – i. e. , a serial conversation between endpoints CS-4513, D-Term 2007 Networks & Communications 10
Connection • The backbone of most message-oriented communication protocols • Each party retains knowledge of the other • Each party retains information about state of the other (vis a vis the protocol itself) • Each party “knows” if connection is broken • … • Note: some popular protocols are “connectionless” – one side has no state information about other side CS-4513, D-Term 2007 Networks & Communications 11
Establishing a Connection • Process a on machine m creates a socket • OS assigns a new port number q to that socket • Process a attempts to open a connection to machine n: p • p is a well-known port • Process b on machine n is listening on p • Receives request from m: q • Process b forks a process or spawns a thread c to talk with m: q, then resumes listening on p • Thread/process c • Creates a new socket r for this connection • Replies to m: q with return address n: r • a and c continue to communicate over this pair of sockets until they are finished. CS-4513, D-Term 2007 Networks & Communications 12
Typical Client-Server Connection • Create socket • On server side • Bind • I. e. , connect socket to port # (usually well-known port) • Listen • Sit and wait for a communication to come in • Accept • Create new socket for purpose of responding to this caller CS-4513, D-Term 2007 Networks & Communications 13
Notes • Responder to request for connection does not have to be the original server machine • Delegate workload to other server systems • Some systems include a connection ID as part of request to open connection • Unique or randomly chosen • Reduces spoofing of server responses • Unix/Linux will not re-use a socket # within 30 seconds • To avoid confusion between old connection and new CS-4513, D-Term 2007 Networks & Communications 14
Reliable Connections • Transport layer partitions messages into packets • TCP – Transmission Control Protocol • Sequence number of current packet • Sequence number of last packet received correctly • Receiver keeps track of seq. # of packets • Reassembles in right order • Notify sender of missing, broken packets • Sender keeps copy of each packet until receipt acknowledged • Retransmits packets if no acknowledgement • Window defines how many packet buffers to maintain for efficient transmission • Allows many packets in “flight” CS-4513, D-Term 2007 Networks & Communications 15
Reliable Connections (continued) Packet i+1 Packet i+2 Packet i+3 … Packet i+k rec’d i time CS-4513, D-Term 2007 Networks & Communications 16
Reliable Connections (continued) Packet i+1 Packet i+2 Packet i+3 … Packet i+k rec’d i time CS-4513, D-Term 2007 Networks & Communications 17
Reliable Connections (continued) Packet i+1 Packet i+2 Packet i+3 … Packet i+k rec’d i+2 time CS-4513, D-Term 2007 Networks & Communications 18
Reliable Connections (continued) Packet i+1 Packet i+2 Packet i+3 … Packet i+k rec’d i lost rec’d i+2 … rec’d i+2 time CS-4513, D-Term 2007 Networks & Communications 19
Reliable Connections (continued) • If acknowledgement received for packet i • Delete from buffer all packets i • If no acknowledgement received within a reasonable time for packet k • Retransmit from buffer all packets k • Result • • Recovers from loss of packets Recovers from loss of acknowledgements Works well for reasonably reliable internet Doesn’t work so well for noisy, unreliable networks CS-4513, D-Term 2007 Networks & Communications 20
Reminder • How do we know if a packet is received correctly? • Cyclic Redundancy Check (CRC) – Polynomial computed from packet header and body – Usually 16 or 32 bits, computed by hardware – Appended to message – Recomputed on reception, compared with transmitted CRC – Equal packet received correctly CS-4513, D-Term 2007 Networks & Communications 21
Examples of Connection-based Protocols • Telnet (virtual terminal) – 2 -way communication by character stream – Line-by-line organization • SMTP (Simple Mail Transport Protocol) – For sending mail – Layered on top of telnet protocol • POP (Post Office Protocol) – For receiving your mail – Layered on top of telnet protocol • FTP (File Transfer Protocol) – For transmitting ASCII or binary files – Binary data transmission not layered on telnet protocol • … CS-4513, D-Term 2007 Networks & Communications 22
Connection-less communication • Some communication protocols don’t need the overhead of reliable connections – When some number of errors can be tolerated – Where recovery from those errors is easy • UDP – User Datagram Protocol – The internet connection-less protocol (layer 4) – Breaks messages into packets – Does not send acknowledgement of correct receipt CS-4513, D-Term 2007 Networks & Communications 23
Examples • HTTP (Hyper. Text Transport Protocol) – Web server responds directly to requests – If client does not get response, retries request • NFS (Network File System) – For access to files on servers as if they are local – If client does not get response, retries request • RPC (Remote Procedure Call) – Next topic • … CS-4513, D-Term 2007 Networks & Communications 24
Reading Assignment • Silbershatz – rest of Chapter 16 • Tanenbaum & Van Steen – § 4. 1 -§ 4. 3 • Tanenbaum (Modern Operating System): • This topic is not covered CS-4513, D-Term 2007 Networks & Communications 25
Break CS-4513, D-Term 2007 Networks & Communications 26
- Slides: 26