DOC PREVIEW
CORNELL CS 4410 - Reliable Streams

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:

The 1,000 Foot PictureProject ScopeImplementationConcluding Thoughts (Grading)Project 4Project 4Reliable StreamsRobert EscrivaSlide heritage: Previous TAs → Krzysztof OstrowskiCornell CS 4411, October 25, 2010Project 4AnnouncementsProject 3 due Wednesday at 11:59PM.Project 4 will be due November 7 at 11:59PM.Web page is being updated frequently; check forupdates.Email [email protected] help∗.∗If LATEXhad a blink tag, I’d enclose this in it.Project 4Controlling complexity is the essence of computerprogramming.Brian KernighanProject 41 The 1,000 Foot Picture2 Project Scope3 Implementation4 Concluding Thoughts (Grading)Project 4The 1,000 Foot PictureWhat we’re looking forImplementing TCP is non-trivial; instead, we’ve looselyspecified a reliable stream protocol.This protocol should co-exist with minimsg.Project 4The 1,000 Foot PictureWhat is “reliable”?Guarantee that if a packet is acknowledged (ACKed),it was delivered.Allows the user to know that there was a failure.Packets delivered at least once (not lost in thenetwork).Packets delivered at most once (no duplicates).Guarantees are not absolute; it is sufficient to justdetect errors.Project 4The 1,000 Foot PictureWhat is “reliable”?Guarantee that if a packet is acknowledged (ACKed),it was delivered.Allows the user to know that there was a failure.Packets delivered at least once (not lost in thenetwork).Packets delivered at most once (no duplicates).Guarantees are not absolute; it is sufficient to justdetect errors.Project 4The 1,000 Foot PictureWhat is “stream”?Connection-based (open, close, etc.).The user on each end should treat messages as asequence of bytes.Message boundaries are an application-level concept.Project 4The 1,000 Foot PictureWhat is “stream”?Connection-based (open, close, etc.).The user on each end should treat messages as asequence of bytes.Message boundaries are an application-level concept.Project 4Project ScopeWhat are does reliable streaming involve?Ordering: deliver in sequence (FIFO).Congestion control: a static window size is sufficient.Stream-like semantics:User can send blocks of any size; minisockets shouldfragment the data.Can ask to receive an arbitrary amount of data.Project 4Project ScopeRelation to Project #3Unreliable and reliable protocols will co-exist.Code from Project 3 may be borrowed/reused wherenecessary ...... but your code should be reasonable separate andisolated.The same network interrupt will be used to deliverboth minimsg and miniports.It is up to you to modify the header so that you maydemultiplex the network packets.Project 4Project ScopeBase abstractions (both Project 3 and Project 4)Each protocol has the concept of a port as itsendpoint.network.h is used by both.Ports are identified by number.Project 4Project ScopeA typical example1 Server listens for client connections.2 Client connects by initiating a hand-shake.3 Hand-shake completes.4 Client and server can send data in any direction.5 Client/server may explicitly close the connection.6 No send or receive will succeed after a close.7 Socket is destroyed at the end of communication; thatis, a new socket must be created to repeat thisprocess.Project 4Project ScopeReliabilityAt least once:Delivery confirmation: acknowledgement for every packetreceived (ACK).Retransmission: failure to receive an ACK triggers aretransmission after timeout.At most once:Delivery confirmation: acknowledgement for every packetreceived (ACK).Retransmission: failure to receive an ACK triggers aretransmission afterControl packets should be reliable as well (e.g. if thenetwork duplicates a request to open a connection,the user should not see an error).Project 4Project ScopeStream-like semanticsOrdering is achieved by placing sequence numbers inpackets.Buffering, variable window size, and duplicate suppressionare used in TCP.Flow control is achieved by dropped packets.TCP uses a dynamically changing window size thatchanges with available bandwidth.You may make the window size of minisockets equalto 1.Significantly simplifies implementation.Only one data packet is in transit at any given time (veryslow).Sequence numbers are still necessary to guarantee FIFO.Project 4Project ScopeFragmentationCut the data into arbitrarily sized pieces.Assume that the sending application’s boundaries aremeaningless.Don’t put “reassembling” information into the packets.Receiver will order the packets (by sequence number)and present it to the user as a continuous (potentiallyinfinite) stream of bytes.Project 4Project ScopeReceivingThe receiver specifies an upper bound on the amountof data to receive.It is perfectly acceptable (and very common) forminisockets to provide fewer bytes.Any unconsumed data must be left for the nextreceiver.Because we are implementing a stream, the exactamount of returned data does not matter†.Reconstructing messages is up to the client.†Except if it exceeds the upper bound.Project 4Project ScopeConcurrencyThere is a one-to-one correspondence between serverand client ports, but ...... multiple threads can simultaneously send, andworse ...... multiple threads can simultaneously receive.The threads will need to be queued waiting on the socket.Independent threads can receive random pieces of data.It is up to the application to reassemble the pieces returnedfrom concurrent reads.All control communication must be performedconcurrent with all other communication.Multiple distinct streams may operate in parallel.You may use dedicated threads for handling controlcommunication across all ports.Project 4ImplementationCreating a socketminisocket_t minisocket_server_create(int port,minisocket_error*error);The server is installed on a specific port (this mayfail).Blocks pending a connection from a client.Returns a socket connected with a client.Simplification: one-to-one communication.Only a single client may connect (further attempts will fail).Once a client is connected, further connections are notallowed.Project 4ImplementationConnecting to a socketminisocket_t minisocket_client_create(network_address_t addr,int port,minisocket_error*error);Connect to minisocket port on host addr.This may fail for reasons outlined above.Blocks until a successful connection is established (orit times out).Project 4ImplementationSending and receivingint minisocket_send(minisocket_t socket,minimsg_t msg,int len,minisocket_error*error);int minisocket_receive(minisocket_t socket,minimsg_t msg,int


View Full Document

CORNELL CS 4410 - Reliable Streams

Download Reliable Streams
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 Reliable Streams 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 Reliable Streams 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?