DOC PREVIEW
Berkeley COMPSCI 162 - Lecture 23 Network Communication Abstractions / Remote Procedure Call

This preview shows page 1-2-14-15-29-30 out of 30 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 30 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 30 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 30 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 30 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 30 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 30 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 30 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

CS162 Operating Systems and Systems Programming Lecture 23 Network Communication Abstractions / Remote Procedure CallReview: Reliable NetworkingReview: TCP Windows and Sequence NumbersGoals for TodayWindow-Based Acknowledgements (TCP)Selective Acknowledgement Option (SACK)Congestion AvoidanceSequence-Number InitializationUse of TCP: SocketsSocket Setup (Con’t)Socket Example (Java)Distributed ApplicationsUsing Messages: Send/Receive behaviorMessaging for Producer-Consumer StyleMessaging for Request/Response communicationAdministriviaGeneral’s ParadoxTwo-Phase CommitTwo phase commit exampleDistributed Decision Making DiscussionByzantine General’s ProblemByzantine General’s Problem (con’t)Remote Procedure CallRPC Information FlowRPC DetailsRPC Details (continued)Problems with RPCCross-Domain Communication/Location TransparencyMicrokernel operating systemsConclusionCS162Operating Systems andSystems ProgrammingLecture 23Network Communication Abstractions /Remote Procedure CallNovember 21, 2007Prof. John Kubiatowiczhttp://inst.eecs.berkeley.edu/~cs162Lec 23.211/21/07 Kubiatowicz CS162 ©UCB Fall 2007Review: Reliable Networking•Layering: building complex services from simpler ones•Datagram: an independent, self-contained network message whose arrival, arrival time, and content are not guaranteed•Performance metrics–Overhead: CPU time to put packet on wire–Throughput: Maximum number of bytes per second–Latency: time until first bit of packet arrives at receiver•Arbitrary Sized messages:–Fragment into multiple packets; reassemble at destination•Ordered messages:–Use sequence numbers and reorder at destination•Reliable messages:–Use Acknowledgements–Want a window larger than 1 in order to increase throughputLec 23.311/21/07 Kubiatowicz CS162 ©UCB Fall 2007Review: TCP Windows and Sequence Numbers•TCP provides a stream abstraction:–Reliable byte stream between two processes on different machines over Internet (read, write, flush)–Input is an unbounded stream of bytes–Output is identical stream of bytes (same order)•Sender has three regions: –Window (colored region) adjusted by sender•Receiver has three regions: –Maximum size of window advertised to sender at setupSentnot ackedSentackedNot yetsentSenderNot yetreceivedReceivedGiven to appReceivedBufferedReceiverRouter Router..zyxwvuts gfedcbaLec 23.411/21/07 Kubiatowicz CS162 ©UCB Fall 2007Goals for Today•Finish discussion of TCP•Messages–Send/receive–One vs. two-way communication•Distributed Decision Making–Two-phase commit/Byzantine Commit•Remote Procedure CallNote: Some slides and/or pictures in the following areadapted from slides ©2005 Silberschatz, Galvin, and Gagne Note: Some slides and/or pictures in the following areadapted from slides ©2005 Silberschatz, Galvin, and Gagne. Many slides generated from my lecture notes by Kubiatowicz.Lec 23.511/21/07 Kubiatowicz CS162 ©UCB Fall 2007Seq:190Size:40Window-Based Acknowledgements (TCP)Seq:230A:190/140Seq:260A:190/100Seq:300A:190/60Seq:190A:340/60Seq:340 A:380/20Seq:380 A:400/0A:100/300Seq:100A:140/260Seq:140A:190/210100Seq:100Size:40140Seq:140Size:50190Seq:230Size:30230 260Seq:260Size:40300Seq:300Size:40340Seq:340Size:40380Seq:380Size:20400Retransmit!Lec 23.611/21/07 Kubiatowicz CS162 ©UCB Fall 2007Selective Acknowledgement Option (SACK)•Vanilla TCP Acknowledgement–Every message encodes Sequence number and Ack–Can include data for forward stream and/or ack for reverse stream•Selective Acknowledgement–Acknowledgement information includes not just one number, but rather ranges of received packets–Must be specially negotiated at beginning of TCP setup»Not widely in use (although in Windows since Windows 98)IP Header(20 bytes)Sequence NumberAck NumberTCP HeaderIP Header(20 bytes)Sequence NumberAck NumberTCP HeaderLec 23.711/21/07 Kubiatowicz CS162 ©UCB Fall 2007Congestion Avoidance•Congestion–How long should timeout be for re-sending messages?»Too longwastes time if message lost»Too shortretransmit even though ack will arrive shortly–Stability problem: more congestion  ack is delayed  unnecessary timeout  more traffic  more congestion»Closely related to window size at sender: too big means putting too much data into network•How does the sender’s window size get chosen?–Must be less than receiver’s advertised buffer size–Try to match the rate of sending packets with the rate that the slowest link can accommodate–Sender uses an adaptive algorithm to decide size of N»Goal: fill network between sender and receiver»Basic technique: slowly increase size of window until acknowledgements start being delayed/lost•TCP solution: “slow start” (start sending slowly)–If no timeout, slowly increase window size (throughput) by 1 for each ack received –Timeout  congestion, so cut window size in half–“Additive Increase, Multiplicative Decrease”Lec 23.811/21/07 Kubiatowicz CS162 ©UCB Fall 2007Sequence-Number Initialization•How do you choose an initial sequence number?–When machine boots, ok to start with sequence #0?»No: could send two messages with same sequence #!»Receiver might end up discarding valid packets, or duplicate ack from original transmission might hide lost packet–Also, if it is possible to predict sequence numbers, might be possible for attacker to hijack TCP connection•Some ways of choosing an initial sequence number:–Time to live: each packet has a deadline.»If not delivered in X seconds, then is dropped»Thus, can re-use sequence numbers if wait for all packets in flight to be delivered or to expire–Epoch #: uniquely identifies which set of sequence numbers are currently being used»Epoch # stored on disk, Put in every message»Epoch # incremented on crash and/or when run out of sequence #–Pseudo-random increment to previous sequence number»Used by several protocol implementationsLec 23.911/21/07 Kubiatowicz CS162 ©UCB Fall 2007Use of TCP: Sockets•Socket: an abstraction of a network I/O queue–Embodies one side of a communication channel»Same interface regardless of location of other end»Could be local machine (called “UNIX socket”) or remote machine (called “network socket”)–First introduced in 4.2 BSD UNIX: big innovation at time»Now most operating systems provide some notion of socket•Using Sockets for Client-Server (C/C++ interface):–On server: set up “server-socket”»Create socket, Bind to protocol


View Full Document

Berkeley COMPSCI 162 - Lecture 23 Network Communication Abstractions / Remote Procedure Call

Documents in this Course
Lecture 1

Lecture 1

12 pages

Nachos

Nachos

41 pages

Security

Security

39 pages

Load more
Download Lecture 23 Network Communication Abstractions / Remote Procedure Call
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Lecture 23 Network Communication Abstractions / Remote Procedure Call and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Lecture 23 Network Communication Abstractions / Remote Procedure Call 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?