CS415 Minithreads Project 4 Overview - PowerPoint PPT Presentation

About This Presentation
Title:

CS415 Minithreads Project 4 Overview

Description:

Receives information about the remote port used to reply. 8. CS414 Minithreads overview ... Data structures that represents endpoints. Local ports: Usually, ... – PowerPoint PPT presentation

Number of Views:11
Avg rating:3.0/5.0
Slides: 14
Provided by: benjami84
Category:

less

Transcript and Presenter's Notes

Title: CS415 Minithreads Project 4 Overview


1
CS415 Minithreads Project 4 Overview
  • Manpreet Singh
  • manpreet_at_cs.cornell.edu

2
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)

3
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
Networking pseudo-device (2)
  • Network_handler receives a structure
  • typedef struct
  • network_address_t addr - sender
  • char bufferMAX_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
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
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
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
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
Miniports Example
  • Ports 2,3 local ports
  • A,B - Threads
  • Sender A sends a message to Receiver B

10
Miniports Example
  • Creates the remote port 100
  • B receives the message
  • Minithreads system creates the remote port 100

Sender
Receiver
2
3
B
A
100
11
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
Receiver
2
3
B
A
100
12
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
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 October 20, 6 pm
Write a Comment
User Comments (0)
About PowerShow.com