DOC PREVIEW
CORNELL CS 414 - Assignment 3

This preview shows page 1-2-3-4 out of 11 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 11 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 11 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 11 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 11 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 11 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Assignment 3Unreliable NetworkingAri RabkinImplement simple unreliable datagrams (“messages”).Minithreads can send messages between machines, or between threads.Models UDP, the user datagram protocol in the Internet protocol family.GoalsPorts and messagesA message is a sequence of bytes addressed to a particular port on a particular machine.A miniport is a port number + machine address pair.A local miniport (a port on this machine) can also be used to receive messages.What you getWe give you network_address_t, and functions to manipulate it. (See network.h)Treat it as an opaque type, and don’t reach inside it.We give you network interrupts: set up handler via network_initialize()Give you network_send_pkt() to do sends.What you buildSending messages: minimsg_send()Message is either sent out over the wire with appropriate headers, or else delivered locally. Don’t call out to hardware for local sendsReceiver should call minimsg_receive()Blocks until message arrivesConcurrencyPorts should be thread-safe:Multiple threads can call receive, in which case each datagram will be delivered to exactly one of them. (Which one is arbitrary).Multiple concurrent sends should send out complete datagrams (ordering is arbitrary).Packets have headersA packet needs a header specifying who should receive it -- hardware may be broadcast, after all.Add src and dest (addr:port) pairsAlso add a message type fieldNeed length of bodyAnd then a body....Some other things to buildAlso need some functions to manage ports.minimsg_initialize()miniport_local_create()miniport_remote_create()miniport_destroy()Struct is something like...•struct minimsg_hdr {network_address_t src_addr, dst_addr;short src_port, dst_port;int msg_type, msg_len;}GotchasDon’t network_send to local addresses.Don’t leak memoryBe careful with the returned port from receive. Don’t want to free local ports!You shouldn’t use sscanf/sprintf to make headers. Just send binary data.Questions?Anyone used scheduling features of CMS?Come up and sign up for design doc reviews. I didn’t print out sheet -- talk to me. Your questions: now’s the time...I’m not around this


View Full Document

CORNELL CS 414 - Assignment 3

Documents in this Course
Security

Security

49 pages

Processes

Processes

24 pages

Deadlocks

Deadlocks

57 pages

Threads

Threads

5 pages

Threads

Threads

29 pages

Deadlocks

Deadlocks

36 pages

Load more
Download Assignment 3
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 Assignment 3 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 Assignment 3 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?