Jan 28, 2003CS475: Internetworking with UNIX TCP/IP1 XDR, RPC, NFS Internetworking with UNIX TCP/IP Winter 2002-2003.

Slides:



Advertisements
Similar presentations
1 Communication in Distributed Systems REKs adaptation of Tanenbaums Distributed Systems Chapter 2.
Advertisements

Remote Procedure Call (RPC)
Remote Procedure Call Design issues Implementation RPC programming
RPC Remote Procedure Call Dave Hollinger Rensselaer Polytechnic Institute Troy, NY.
Tam Vu Remote Procedure Call CISC 879 – Spring 03 Tam Vu March 06, 03.
Remote Procedure CallCS-4513, D-Term Remote Procedure Call CS-4513 Distributed Computing Systems (Slides include materials from Operating System.
CS-550: Distributed File Systems [SiS]1 Resource Management in Distributed Systems: Distributed File Systems.
File System Implementation
Socket Programming.
TCP/IP Protocol Suite 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 17 Introduction to the Application.
CS490T Advanced Tablet Platform Applications Network Programming Evolution.
COS 420 DAY 25. Agenda Assignment 5 posted Chap Due May 4 Final exam will be take home and handed out May 4 and Due May 10 Latest version of Protocol.
Chapter 15 – Part 2 Networks The Internal Operating System The Architecture of Computer Hardware and Systems Software: An Information Technology Approach.
© 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.1 Computer Networks and Internets with Internet Applications, 4e By Douglas.
Socket Addresses. Domains Internet domains –familiar with these Unix domains –for processes communicating on the same hosts –not sure of widespread use.
CS-3013 & CS-502, Summer 2006 Network Input & Output1 CS-3013 & CS-502, Summer 2006.
An Introduction to Internetworking. Algorithm for client-server communication with UDP (connectionless) A SERVER A CLIENT Create a server-socket (listener)and.
PRASHANTHI NARAYAN NETTEM.
NFS. The Sun Network File System (NFS) An implementation and a specification of a software system for accessing remote files across LANs. The implementation.
Chapter 4.1 Interprocess Communication And Coordination By Shruti Poundarik.
Client Server Model and Software Design TCP/IP allows a programmer to establish communication between two application and to pass data back and forth.
NETWORK FILE SYSTEM (NFS) By Ameeta.Jakate. NFS NFS was introduced in 1985 as a means of providing transparent access to remote file systems. NFS Architecture.
Chapter 26 Client Server Interaction Communication across a computer network requires a pair of application programs to cooperate. One application on one.
Process-to-Process Delivery:
Chapter 17 Networking Dave Bremer Otago Polytechnic, N.Z. ©2008, Prentice Hall Operating Systems: Internals and Design Principles, 6/E William Stallings.
Networked File System CS Introduction to Operating Systems.
1 Chapter Client-Server Interaction. 2 Functionality  Transport layer and layers below  Basic communication  Reliability  Application layer.
CSC 322 Operating Systems Concepts Lecture - 4: by Ahmed Mumtaz Mustehsan Special Thanks To: Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall,
CS 390- Unix Programming Environment CS 390 Unix Programming Environment Topics to be covered: Distributed Computing Fundamentals.
What is a Distributed File System?? Allows transparent access to remote files over a network. Examples: Network File System (NFS) by Sun Microsystems.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED.
Chapter 10: File-System Interface Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Jan 1, 2005 Chapter 10: File-System.
Dr. John P. Abraham Professor University of Texas Pan American Internet Applications and Network Programming.
Chapter 15 – Part 2 Networks The Internal Operating System The Architecture of Computer Hardware and Systems Software: An Information Technology Approach.
The Socket Interface Chapter 21. Application Program Interface (API) Interface used between application programs and TCP/IP protocols Interface used between.
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.
NFS : Network File System SMU CSE8343 Prof. Khalil September 27, 2003 Group 1 Group members: Payal Patel, Malka Samata, Wael Faheem, Hazem Morsy, Poramate.
CSE 451: Operating Systems Winter 2015 Module 22 Remote Procedure Call (RPC) Mark Zbikowski Allen Center 476 © 2013 Gribble, Lazowska,
Page 1 Remote Procedure Calls Paul Krzyzanowski Distributed Systems Except as otherwise noted, the content of this presentation.
ITEC 502 컴퓨터 시스템 및 실습 Chapter 11-2: File System Implementation Mi-Jung Choi DPNM Lab. Dept. of CSE, POSTECH.
Computer Science Lecture 19, page 1 CS677: Distributed OS Last Class: Fault tolerance Reliable communication –One-one communication –One-many communication.
Chapter 5: Distributed objects and remote invocation Introduction Remote procedure call Events and notifications.
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 3.1 Internet Applications Ch. 28,… (Client-Server Concept, Use of Protocol Ports, Socket API)
Remote Procedure CallCS-502 Fall Remote Procedure Call (continued) CS-502, Operating Systems Fall 2007 (Slides include materials from Operating System.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition File System Implementation.
GLOBAL EDGE SOFTWERE LTD1 R EMOTE F ILE S HARING - Ardhanareesh Aradhyamath.
Remote Procedure Call RPC
EE324 INTRO TO DISTRIBUTED SYSTEMS. Distributed File System  What is a file system?
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.
Computer Science Lecture 3, page 1 CS677: Distributed OS Last Class: Communication in Distributed Systems Structured or unstructured? Addressing? Blocking/non-blocking?
RPC Model, Stubs and Skeletons Divya Nampalli
1 Remote Procedure Calls External Data Representation (Ch 19) RPC Concept (Ch 20)
Distributed File Systems Questions answered in this lecture: Why are distributed file systems useful? What is difficult about distributed file systems?
Computer Science Lecture 4, page 1 CS677: Distributed OS Last Class: RPCs RPCs make distributed computations look like local computations Issues: –Parameter.
03 – Remote invoaction Request-reply RPC RMI Coulouris 5
File System Implementation
File Transfer and access
CMSC621: Advanced Operating Systems Advanced Operating Systems
Chapter 15: File System Internals
Multiple Processor Systems
Multiple Processor and Distributed Systems
Chapter 15: File System Internals
An Introduction to Internetworking
Chapter 15: File System Internals
Last Class: Communication in Distributed Systems
Internet Applications (Telnet, FTP)
Exceptions and networking
Presentation transcript:

Jan 28, 2003CS475: Internetworking with UNIX TCP/IP1 XDR, RPC, NFS Internetworking with UNIX TCP/IP Winter

Jan 28, 2003CS475: Internetworking with UNIX TCP/IP2 XDR Asymmetric data conversion Convert to what other entity understands! Symmetric data conversion Convert to a standard format! Network standard byte order XDR has implicit types 32 bit big-endian integer has exactly 32 bits No explicit information about the “type” of data

Jan 28, 2003CS475: Internetworking with UNIX TCP/IP3 How to convert to XDR? XDR library routines are available These routines are machine dependent Convert data from native format to XDR and vice versa A buffer paradigm is mostly used “Complete” message is converted to XDR Code example: Create a buffer to hold XDR data Append data to the buffer (or XDR stream)

Jan 28, 2003CS475: Internetworking with UNIX TCP/IP4 XDR: code example #include #define BUFFER_SIZE 4000 int i; XDR *xdr_stream; char buf[BUFFER_SIZE]; xdrmem_create(xdr_stream, buf, BUFFER_SIZE, XDR_ENCODE); … i = 35; xdr_int(xdr_stream, &i); // convert integer and append to stream // why are we passing the address of i? … See figure 19.4, page 237 for other data conversion routines

Jan 28, 2003CS475: Internetworking with UNIX TCP/IP5 XDR: code example, receiver #include #define BUFFER_SIZE 4000 int j; XDR *xdr_stream; char buf[BUFFER_SIZE]; xdrmem_create(xdr_stream, buf, BUFFER_SIZE, XDR_DECODE); … // someone filled in the XDR stream xdr_stream here! … xdr_int(xdr_stream, &j); // this is why we were passing the address of i! …

Jan 28, 2003CS475: Internetworking with UNIX TCP/IP6 Using XDR with TCP and UDP TCP is stream oriented Can directly be used with XDR Open TCP socket and get a descriptor fd Use FILE *fdopen(int fd, char* mode) to associate a standard I/O stream to fd (socket fd) Use xdrstdio_create(XDR* xdrs, FILE* stdio_stream, enum xdr_op) to connect a new XDR stream to the I/O descriptor Subsequent calls to XDR conversion routines automatically send XDR data over TCP For use with UDP, records and datagram I/O are described in XDR (see xdrrec_create( ) )

Jan 28, 2003CS475: Internetworking with UNIX TCP/IP7 Remote Procedure Call An Extension of Procedural Call Model In many programming languages (not object oriented), complete program flow is described by procedure (or function) calls If the procedures cross the boundary of a computer, it becomes RPC A communication protocol is required to carry out the remote call to the procedure

Jan 28, 2003CS475: Internetworking with UNIX TCP/IP8 Conventional Procedure Call A single thread of execution Control transfer from one procedure to another Variables of the calling procedure are “frozen” Procedures calls are usually iterative mainproc_Aproc_B

Jan 28, 2003CS475: Internetworking with UNIX TCP/IP9 Distributed Procedure Call Imagine a different “client-server” model Server implements a procedure called by client Client interacts with server as a procedure caller Server represents an implementer of the procedure mainproc_Aproc_B Machine 1Machine 2Machine 3

Jan 28, 2003CS475: Internetworking with UNIX TCP/IP10 Local calls vs. RPC For local calls, a procedure is inactive until it is called. For RPCs, a server process must exist waiting for a call Local procedures generally use a few arguments. RPCs can return arbitrary stream of data RPCs incur higher cost due to network delays Local procedures are generally in the same address space, so pointers are passable Remote procedures do not have access to caller’s I/O descriptors Remote procedures do not write data to the error file of a calling computer

Jan 28, 2003CS475: Internetworking with UNIX TCP/IP11 Shared Data, Remote Programs A single remote program Procedure 1Procedure 2Procedure 3 Shared global data

Jan 28, 2003CS475: Internetworking with UNIX TCP/IP12 RPC: Number of Arguments Calls with large number of arguments are hard to read Data aggregation In a struct, for example XDR tells how to encode structs for sending these across to another machine Typically, all the arguments in RPC are collected in one single struct RPC Identification: (prog, vers, proc) Prog: 32 bits; vers, proc: integers

Jan 28, 2003CS475: Internetworking with UNIX TCP/IP13 More on RPCs Mutual Exclusions At most one procedure in a remote program can be running at a time Ensures integrity of shared data Retransmissions Default timeout mechanism specifies a fixed and non-adaptive timeout A fixed number of retries is also specified Some applications may adapt the timeout on their own, but RPC does not adapt to network delays

Jan 28, 2003CS475: Internetworking with UNIX TCP/IP14 RPC Call Message Format RPC VERSION NUMBER (2) MESSAGE ID REMOTE PROCEDURE (1 for GETATTR) UNIX AUTHENTICATION 160 MESSAGE TYPE (0 FOR CALL) REMOTE PROGRAM (0x000186a3 for NFS) REMOTE PROGRAM VERSION (2) ARGUMENTS FOR REMOTE PROCEDURE (IF APPLICABLE) 31

Jan 28, 2003CS475: Internetworking with UNIX TCP/IP15 Distributed File Systems Network File System (generic name) or Distributed File System Files are “distributed” over a network of computers Examples NFS AFS Coda

Jan 28, 2003CS475: Internetworking with UNIX TCP/IP16 Design Goals Uses same/similar file system interfaces as used for local access Facilities Independent of user location Transparent to the end user Backups Caching Consideration of user mobility (?) Data sharing for a multitude of users

Jan 28, 2003CS475: Internetworking with UNIX TCP/IP17 NFS Very similar to UNIX file system open( ) read( ) write( ) close( ) Provides file access rather than transfer One copy of the file is kept Independent of machine architecture Uses RPC for machine-to-machine communication Provides common login environment It is transparent to the end user

Jan 28, 2003CS475: Internetworking with UNIX TCP/IP18 stat( ) call for file information stat(string filename, stat* stat_block); Provides information on a UNIX file S_ISREG(stat_block->st_mode); //regular file S_ISDIR(stat_block->st_mode); //directory Symbolic links Created using $ ln –s realfile linkfile Traversing a directory tree will not work using stat( ) call Use lstat( ) to traverse directories

Jan 28, 2003CS475: Internetworking with UNIX TCP/IP19 File System Everything you can logically see, not necessarily on the same disk Data is organized in files; files are organized in directories Each file (directory is a special file) is referenced by an i-node which contains: stat( ) info Reference to the data block i-node numbers on a physical device are unique To differentiate between files and directories, looking at data block is not enough; need to go to i-node

Jan 28, 2003CS475: Internetworking with UNIX TCP/IP20 File System If i-numbers associated with the two files on a UNIX file system are same: Data block for the two must be the same This is defined as hard link To create hard link $ ln realfile linkfile How to ensure that i-numbers are unique across machines in a distributed system? Can’t ensure; i-number duplication is allowed Hard links not allowed across physical devices

Jan 28, 2003CS475: Internetworking with UNIX TCP/IP21 Functions of NFS Directory mount From other computers on the local network Directory export To other computers off the local network Has client-server architecture An NFS client is able to mount directories from multiple NFS servers Servers are stateless No information at the server about files open at the client

Jan 28, 2003CS475: Internetworking with UNIX TCP/IP22 NFS File Attributes Just like stat provides information for UNIX files, “file attributes” for NFS are described in the fattr structure Instead of a stat( ) or lstat( ) call as in case of UNIX file system, a remote procedure call fills in the fattr structure

Jan 28, 2003CS475: Internetworking with UNIX TCP/IP23 RPC for NFS Runs on top of UDP Clients specify block size, retransmit attempts, and timeout values rsize, wsize, retrans, timeo Default values are 8KB block, 5 retransmits, and 1s timeout timeo is for the first request; the value is doubled with every retransmit request Generally, processes requesting server files will block until server responds