DOC PREVIEW
CORNELL CS 414 - Unreliable Networking

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

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

Unformatted text preview:

Unreliable NetworkingPart II notesPart II questions?Goalminimsg – minithread networkingminimsg – Best Effort Deliveryminiports – minthreads mailboxesminiports – Low-level codeExamplePseudo-Networking detailsNotesSlide 12Questions about Part III?Unreliable NetworkingTom RoederCS415 2005spPart II notesTablet distribution today!2:15-3:15 Upson 4135If you can’t make it, send mail, and we’ll set up some other wayAs usual, you will sign them outWill use them for Part III and onTom has an office hour this weekend3-4pm Saturday, Upson 5138Part II questions?GoalAdd an unreliable networking layerWe will build on this in future projects TCP – add reliabilityAd hoc networking – take away reliance on infrastructureWe give you a wrapper around NT socketsThis is your IP layerYour layer will be like a simplified UDPTwo componentsminimsgminiportsminimsg – minithread networking#define MINIMSG_MAX_MSG_SIZE (4096)typedef struct miniport* miniport_t;typedef char* minimsg_t;extern void minimsg_initialize();extern miniport_t miniport_local_create();extern miniport_t miniport_remote_create(network_address_t addr, int id);extern void miniport_destroy(miniport_t miniport);extern int minimsg_send(miniport_t local, miniport_t remote, minimsg_t msg, int len);extern int minimsg_receive(miniport_t local, miniport_t* remote, minimsg_t msg, int *len);minimsg – Best Effort DeliverySender sideGiven data, formulate a packetHand it off to the network layer to be sentForget about itReceiver sideReceive a packet from the network layerFigure out who has registered to receive itHand it offNote: don’t drop packets or reorder them hereminiports – minthreads mailboxesRecall from lecture that ports allow receptionIf A wants to send to B, A must send to some portB needs to know the port to which to respondWe represent this as local and rem ote portsLocal portUsed for receivingRemote portRepresentation on A of a local port on BUsed for sendingminiports – Low-level codenetwork.[ch] is the socket codeIt really listens on a UDP portWhen a packet comes in on this port, interruptsYou will write a new interrupt handler for miniportsIt will pass it to the right portPoor application mechanismneed to know magic numbered portsThe world still mostly works like thisRanveer will talk later about nameserversExampleA B1202msgblockPseudo-Networking detailsMust call network_initialize()Clock interrupts must be disabledThis is the case after calling minithread_clock_init()Do this before calling any networking functionsYou can run two copies on the same machineWe have provided a function: network_udp_portsnetwork.[ch] also contains code for testing ad hoc networks on wired machinesNotesOn minimsg_receiveYou get back a remote miniportThe caller must free itAs usual, the network handler must be fastSome functions contain network_address_t: Treat as opaqueWe have given you functions to handle themLocal ports created in a sequence should always get the same numbers, regardless of remote ports created between themNotesThere is no fragmentationWe have a max packet size: too high is droppedYou are not required to implement fragmentationTwo types of miniports, but one structUse unions: eg.typedef struct miniport_t {int type; /* LOCAL or REMOTE */unsigned int portnum;union {struct { /* … */ } local;struct { /* … */ } remote;}}Questions about Part


View Full Document

CORNELL CS 414 - Unreliable Networking

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 Unreliable Networking
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 Unreliable Networking 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 Unreliable Networking 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?