Presentation is loading. Please wait.

Presentation is loading. Please wait.

CS415 Minithreads Project 3 Overview Adrian Bozdog (Adi)

Similar presentations


Presentation on theme: "CS415 Minithreads Project 3 Overview Adrian Bozdog (Adi)"— Presentation transcript:

1 CS415 Minithreads Project 3 Overview Adrian Bozdog (Adi) adrianb@cs.cornell.edu

2 CS414 Minithreads overview2 What you have to do  Implement unreliable communication  Simulate IP/UDP protocol  No UDP check-sum  No UDP fragmentation  There is an IP layer that sends and receives messages (see network.c)  Start using Jornada systems  Run Project 3 on both PC desktops and Jornada systems

3 CS414 Minithreads overview3 Networking pseudo-device (1)  It allows communication between minithreads systems  Does not control which thread processes a received packet  Interrupt-driven implementation  Network_handler  executed for each received packet  Uses the stack of the current thread  It should finish as soon as possible  Initialized using network_initialize function

4 CS414 Minithreads overview4 Networking pseudo-device (2)  Network_handler receives a structure:  typedef struct {  network_address_t addr; - sender  char buffer[MAX_NETWORK_PKT_SIZE]; - the body of entire message  int size; - the length of the entire message  } network_interrupt_arg_t;  Call Network_initialize function  After clock_initialize()  Before enabling interrupts and running threads

5 CS414 Minithreads overview5 Networking functions  Network_send_pkt – sends a packet  Destination  Header (body, length)  Data (body,length)  Header:  Extra information  About the sender  About the receiver  As small as possible

6 CS414 Minithreads overview6 Minimsg Layer  Identifies the end-points of the communication (ports)  The sender assembles the header used to identifies the endpoints  The receiver  examines the header  Identifies destination  Enqueues the packet in the right place

7 CS414 Minithreads overview7 Minimsg Functions  Minimsg_send:  Non-blocking  Parameters:  local and remote ports  The message and its length  Appends the header to the message  Sends the entire data using network_send  Minimsg_receive:  Blocks the thread until it receives a message on the specified port  Receives information about the remote port – used to reply

8 CS414 Minithreads overview8 Miniports  Data structures that represents endpoints  Local ports:  Usually, used for listening  Remote ports:  Created when a packet is received  Bound to a sending “remote” port  Allows the receiver to reply

9 CS414 Minithreads overview9 Miniports Example  Ports 2,3 – local ports  A,B - Threads  Sender A sends a message to Receiver B Sender 2 Receiver A B 3

10 CS414 Minithreads overview10 Miniports Example  Creates the remote port 100  B receives the message;  Minithreads system creates the remote port 100 Sender 2 Receiver A B 3 100

11 CS414 Minithreads overview11 Miniports Example  B replies to A  B uses the remote port as the destination of the message; the message is relayed to the sending port Sender 2 Receiver A B 3 100

12 CS414 Minithreads overview12 Miniports – hints  Local communication  Be aware of miniport_destroy function called by the receiver  Remote_miniport – pointer to the local port  Miniport_send implemented based on the “remote port”  Miniports  Identified by numbers  Assigned them successive numbers  Local miniports – starts from 0  Remote miniports – starts from 32768

13 CS414 Minithreads overview13 Implementation hints  Do not add unnecessary data to the header (ex: header length)  Include the address of the sender (used by the routing protocol later)  Port operations must be O(1)  Do not waste resources  Remote miniports are destroyed by the application  Build other test cases  Network_initialize returns the ip address of the machine  Due Date: March 3, 12 pm

14 CS414 Minithreads overview14 Jornada systems  Every group must have at least a Jornada system  Come to my office (Upson 5152)  I’ll post an announcement  You must fill check-out forms  Information for using Jornada in the assignment description


Download ppt "CS415 Minithreads Project 3 Overview Adrian Bozdog (Adi)"

Similar presentations


Ads by Google