1 Client API Goals: evolvable, easy to use Design decision: –event-driven, non-blocking programming model –Data items are immutable Main data structure:

Slides:



Advertisements
Similar presentations
Operating System Structures
Advertisements

IS 1181 IS 118 Introduction to Development Tools VB Chapter 06.
Cs4411 – Operating Systems Practicum November 4, 2011 Zhiyuan Teo Supplementary lecture 4.
Precept 3 COS 461. Concurrency is Useful Multi Processor/Core Multiple Inputs Don’t wait on slow devices.
CS490T Advanced Tablet Platform Applications Network Programming Evolution.
Informationsteknologi Friday, November 16, 2007Computer Architecture I - Class 121 Today’s class Operating System Machine Level.
PAWN: A Novel Ingestion Workflow Technology for Digital Preservation
Domain Name System: DNS
1 Process Description and Control Chapter 3 = Why process? = What is a process? = How to represent processes? = How to control processes?
The University of New Hampshire InterOperability Laboratory Serial ATA (SATA) Protocol Chapter 10 – Transport Layer.
Lecturer: Ghadah Aldehim
NetSim ZigBee Simulation Code Walkthrough in 10 steps
Chapter Oracle Server An Oracle Server consists of an Oracle database (stored data, control and log files.) The Server will support SQL to define.
Chapter 17 Domain Name System
RFid Technology TELE 480 Presentation. What is RFid? RFid is an ADC technology that uses radio- frequency waves to transfer data between a reader and.
The EPIKH Project (Exchange Programme to advance e-Infrastructure Know-How) WMPROXY API Python & C++ Diego Scardaci
Hardware Definitions –Port: Point of connection –Bus: Interface Daisy Chain (A=>B=>…=>X) Shared Direct Device Access –Controller: Device Electronics –Registers:
Programmer's view on Computer Architecture by Istvan Haller.
1-1 Embedded Network Interface (ENI) API Concepts Shared RAM vs. FIFO modes ENI API’s.
CP104 Introduction to Programming File I/O Lecture 33 __ 1 File Input/Output Text file and binary files File Input/output File input / output functions.
CSE 486/586, Spring 2012 CSE 486/586 Distributed Systems Distributed Shared Memory Steve Ko Computer Sciences and Engineering University at Buffalo.
Chapter 4: Interprocess Communication‏ Pages
The Socket Interface Chapter 21. Application Program Interface (API) Interface used between application programs and TCP/IP protocols Interface used between.
The Socket Interface Chapter 22. Introduction This chapter reviews one example of an Application Program Interface (API) which is the interface between.
1 Kyung Hee University Chapter 18 Domain Name System.
Network Programming Eddie Aronovich mail:
UNIX Files File organization and a few primitives.
 Remote Procedure Call (RPC) is a high-level model for client-sever communication.  It provides the programmers with a familiar mechanism for building.
1 UNIT 13 The World Wide Web Lecturer: Kholood Baselm.
Alternative Architecture for Information in Digital Libraries Onno W. Purbo
FTP Server API Implementing the FTP Server Registering FTP Command Callbacks Data and Control Port Close Callbacks Other Server Calls.
Miscellaneous NBT Team Naming (1/2) Client: global, unique identifier PM: global, unique identifier –This is the policy identifier DIM: global,
Chapter 29 World Wide Web & Browsing World Wide Web (WWW) is a distributed hypermedia (hypertext & graphics) on-line repository of information that users.
CS 346 – Chapter 11 File system –Files –Access –Directories –Mounting –Sharing –Protection.
The Client-Server Model And the Socket API. Client-Server (1) The datagram service does not require cooperation between the peer applications but such.
GLOBAL EDGE SOFTWERE LTD1 R EMOTE F ILE S HARING - Ardhanareesh Aradhyamath.
OOSSE Week 8 JSP models Format of lecture: Assignment context JSP models JSPs calling other JSPs i.e. breaking up work Parameter passing JSPs with Add.
Linux File system Implementations
File Systems cs550 Operating Systems David Monismith.
Stream Spider Distributed Music Streaming Service with Sliced Music Files from Different Originating Hosts Justin Steffy and Michael D. Elder.
Lecture 4 Mechanisms & Kernel for NOSs. Mechanisms for Network Operating Systems  Network operating systems provide three basic mechanisms that support.
Manish Kumar,MSRITSoftware Architecture1 Remote procedure call Client/server architecture.
David Adams ATLAS ATLAS distributed data management David Adams BNL February 22, 2005 Database working group ATLAS software workshop.
GAME203 – C Files stdio.h C standard Input/Output “getchar()”
Computer Science Lecture 3, page 1 CS677: Distributed OS Last Class: Communication in Distributed Systems Structured or unstructured? Addressing? Blocking/non-blocking?
Socket Programming. Computer Science, FSU2 Interprocess Communication Within a single system – Pipes, FIFOs – Message Queues – Semaphores, Shared Memory.
1 Why Threads are a Bad Idea (for most purposes) based on a presentation by John Ousterhout Sun Microsystems Laboratories Threads!
AFS/OSD Project R.Belloni, L.Giammarino, A.Maslennikov, G.Palumbo, H.Reuter, R.Toebbicke.
TCP/IP1 Address Resolution Protocol Internet uses IP address to recognize a computer. But IP address needs to be translated to physical address (NIC).
Distributed Computing & Embedded Systems Chapter 4: Remote Method Invocation Dr. Umair Ali Khan.
1 UNIT 13 The World Wide Web. Introduction 2 Agenda The World Wide Web Search Engines Video Streaming 3.
1 UNIT 13 The World Wide Web. Introduction 2 The World Wide Web: ▫ Commonly referred to as WWW or the Web. ▫ Is a service on the Internet. It consists.
Instructor Notes This is a straight-forward lecture. It introduces the OpenCL specification while building a simple vector addition program The Mona Lisa.
Topic 4: Distributed Objects Dr. Ayman Srour Faculty of Applied Engineering and Urban Planning University of Palestine.
Processes and threads.
Module 11: File Structure
Chapter 3 Internet Applications and Network Programming
Out-of-Process Components
Programming Models for Distributed Application
DUCKS – Distributed User-mode Chirp-Knowledgeable Server
An overview of the kernel structure
Beginning C Lecture 11 Lecturer: Dr. Zhao Qinpei
CS703 - Advanced Operating Systems
Chapter 2: Operating-System Structures
Introduction to Operating Systems
Out-of-Process Components
Outline Review of Quiz #1 Distributed File Systems 4/20/2019 COP5611.
Overview Multimedia: The Role of WINS in the Network Infrastructure
Chapter 2: Operating-System Structures
Last Class: Communication in Distributed Systems
Presentation transcript:

1 Client API Goals: evolvable, easy to use Design decision: –event-driven, non-blocking programming model –Data items are immutable Main data structure: di_node

2 Control Flow cbk_fun(…); … di_fun(…, cbk_fun); … marshal parameters… … create callback data structure, cbk… di_register_callback(…); send(cbk, …); … recv(cbk, …); … use cbk to retrieve callback associated info… … invoke callback … … free data struct. cbk … Client recv(cbk, …); … execute command … send(cbk, …); // send reply // back DIM/PM/Directory/… This code is executed in the cl_select() loop

3 di_node Data item data structure: –Metadata associated/stored with every data item –Created when a data item is looked up Fields –id: globally unique identifier –name: data item name –type: bulk (e.g., file transfer), stream (live, VoD), … Each type will have different constraints All types present the abstraction of a byte-stream –size: data item size –owner / access rights –mode: access mode in which the data item has been opened (e.g., Read / Write / Delete) –constraints: min download speed, max download speed, etc Need to decide how to compute the mix/max rates –Others: coding-format: specifies how the content is coded tags: keywords associated to this data item (can be used for search) …

4 Core Client API Generic functions: –di_init(); –di_exit(); –di_select(); –di_lookup(); DI-centric functions (all take as an argument a data item) –di_free(); –di_open(); –di_close(); –di_read(); –di_seek(); –di_write(); Note: di_init(), di_exit(), di_select(), di_free() and di_close() are blocking functions; the rest are non- blocking

5 di_init() Synopsis: errcode = di_init(); Description: blocking function call that initialize the client context: –Find an i3 server, and use it to contact other system components, e.g., DIMS and PMs –Contact database if new profile, and eventually obtain the list of policies the client belongs to –For each policy contact the corresponding PM –Contact the DIMs corresponding to data items and chunks the client stores

6 di_exit(); Synopsis: errcode = di_exit(); Description: blocking function performing the following operations: –Inform relevant PMs and DIMs –Update database with latest statistics –Free data structures allocated by di_init();

7 di_select(); Synopsis: di_select(…..); Description: preserve semantics of the select() function call, but in addition handles our protocol messages

8 di_register_callback() Synopsis: di_register_callback(di_node, cbk_fun(), cl_data); Description: A callback is registered for every non- blocking di_*() function to signal the client when di_*() has been completed Fields: –di_node: data item for which the callback is registered, if any –cbk_fun(): callback function invoked upon completion of corresponding di_*(…); –cl_data: client specific data; passed back to client in cbk_fun(…) Note: this function doesn’t need to be part of API

9 di_lookup() (1/2) Synopsis: di_lookup(search_string, flags, timeout, lookup_fun(), cid); Description: function which returns a list of data items that meet the search criteria Fields: –search_string: string used to search for a data item; relevant only when an existing data item is accessed (i.e., mode = Read OR Delete) –flags: specify how the search string should be interpreted (e.g., file name, tags, …) –timeout: timeout associated with this function call; used to return an error code if the function doesn’t complete –lookup_fun: function to be invoked on callback –cid: unique identifier associated with this function call; used to distinguish among multiple di_open() issued in parallel

10 di_lookup() (2/2) Callback registration: di_register_callback(NULL, lookup_fun(), cid); –Note: in this case, cid represents cl_data Callback function: lookup_fun(cid, di_node_list, errcode); –di_node_list: list of id_nodes of the data items that match the “search_string” –errcode: error code associated with this function call Open issue: –Need to decide what to do when di_node_list is too large

11 di_free() Synopsis: di_free(di_node); Description: free di_node returned by di_lookup();

12 di_open() (1/2) Synopsis: di_open(di_node, mode, timeout, open_fun()); Description: open a di_node for read/write/delete. In the case of “read”, this function checks whether there is a DIM associated with the data item (i.e., there is a seed for the data item), and if yes allocates required buffers. Fields: –di_node: data item to be opened. –mode: Read / Write / Delete –timeout: timeout associated with this function call; used to return an error code if the function doesn’t complete –open_fun: function to be invoked on callback

13 di_open() (2/2) Callback registration: di_register_callback(di_node, open_fun(), NULL); Callback function: open_fun(di_node, errcode); –di_node: data item that has been opened –errcode: error code associated with this function call

14 di_close() Synopsis: di_close(di_node); Description: this function frees the buffers allocated by di_open(). The function is blocking (it is executed locally).

15 di_read() (1/2) Synopsis: di_read(di_node, start_byte, last_byte, timeout, read_fun()); Description: this function requests all bytes from the input stream between start_byte and last_byte. A callback is invoked when one of the following events happen: –The incoming buffer has received all required bytes –The “timeout” expires –The byte-stream ends before reaching last_byte –There is a gap in the byte sequence, e.g., due to packet loss in live streaming –The last byte in the buffer has been written, and the buffer is about to wrap-around

16 di_read() (2/2) Callback registration: di_register_callback(di_node, read_fun(), NULL); Callback function: read_fun(di_node, ptr, size, s_byte, errcode); returns a contiguous sequence of bits from the incoming stream between s_byte and s_byte+size –ptr: pointer in the buffer from where the client should read data –size: how many bytes should the client read –s_byte: the byte in the byte-stream stored at location “ptr”. If no bytes are lost, then s_byte coincides with the start_byte value passed in di_read(); Otherwise, s_byte > start_byte. Also s_byte+size <= last_byte –errcode: specifies whether the timeout has been triggered or if any of the data item constraints have been violated (e.g., receiving rate too low or too high) Note: in the case of file sharing and VoD no data should be lost, and thus s_byte=start_byte

17 di_write() (1/2) Synopsis: di_write(di_node, fd, timeout, write_fun()); Description: create a live stream or a data item to be distributed via VoD or file sharing Fields: –di_node: data item structure associated with the file. This is created using di_open(di_node, “w”, timeout, open_fun()); –fd: For live streaming, this is the descriptor of the video device. A DIM is created for this data item. In addition, the database and the data item directory are updated. For VoD and file sharing, this is the descriptor of the file containing the data item. The file is divided into chunks which are stored locally, and the information about the data item is stored in the database and the data item directory.

18 di_write() (2/2) Callback registration: di_register_callback(di_node, write_fun(), NULL); Callback function: write_fun(di_node, errcode);

19 di_delete() Synopsis: di_delete(di_node, timeout, delete_fun()); Description: delete data item; update database and data item directory. This function only applies to VoD and file-sharing data items Callback registration: di_register_callback(di_node, delete_fun(), NULL); Callback function: delete_fun(di_node, errcoe);