Remote Procedure Calls, TLI, STREAMS

Size: px
Start display at page:

Download "Remote Procedure Calls, TLI, STREAMS"

Transcription

1 Remote Procedure Calls, TLI, STREAMS 13 RPC, TLI, STREAMS Hannes Lubich, Page 1 Goals of this Lecture Understand the design of remote procedure calls in general and the design and programming of the Sun Remote Procedure Call Package in particular. Understand the general concept of Unix STREAMS and their use for designing modular communication drivers. Understand the the general concept of the Transport Layer Interface (TLI) as a generalisation of the original socket interface. 13 RPC, TLI, STREAMS Hannes Lubich, Page 2 1

2 General RPC Design Client Process Server Process Local Procedure Call Client Routines Client "Stub" (Un)-Marshalling Server Routines Server- "Stub" Local Procedure Call System Call Network Routines Local Kernel Network Communication Network Routines Remote Kernel Data Conversion And Notification W.R. Stevens: UNIX Network Programming, Figure RPC, TLI, STREAMS Hannes Lubich, Page 3 Sun RPC - Published RPC-Protocol 2, RFC RPC-Data Description Language (XDR), RFC Source code for Unix is available: "rpcgen", XDR Coding Library, Run-time Library - Now termed ONC (Open Network Computing) 13 RPC, TLI, STREAMS Hannes Lubich, Page 4 2

3 Parameter Passing - Call by value - Call by reference - Sun RPC only allows one (structured) argument or result value. - Multiple arguments or results must be packed into a single struct. 13 RPC, TLI, STREAMS Hannes Lubich, Page 5 Server / Client Binding - Finding a remote server - Finding the required service on the remote server - Sun RPC uses the standard Unix method for finding servers on the Internet (gethostbyname, DNS), some implementations also support the clnt_broadcast() library call to find servers. - All server programs, program versions and remote procedures are identified with unique numbers. - A portmapper process (Linux: rpcbind) using port 111 on each system serves as the central local registry for available RPC services. It is possible to have server programs started via the inetd daemon (rpcgen compile option and a corresponding entry in /etc/inetd.conf). 13 RPC, TLI, STREAMS Hannes Lubich, Page 6 3

4 The RPC Portmapping Sequence 1) The server creates a socket and registers program number, program version, procedures, and port number. 2) The client contacts the port mapper, requesting a program, version and remote procedure number. If known, the portmapper returns the corresponding port number. 3,4) The client can now invoke the remote procedure with the server. portmapper Daemon (1) (2) (3) (4) RPC Client RPC Server Local System Remote System W.R. Stevens: UNIX Network Programming, Figure RPC, TLI, STREAMS Hannes Lubich, Page 7 Selecting the Transport Protocol - RPC is independent from transport services /protocols - Mapping to popular transport services /protocols - Sun RPC supports the use of TCP and UDP In case of UDP, the size of arguments or results may not exceed 8192 bytes 13 RPC, TLI, STREAMS Hannes Lubich, Page 8 4

5 Exception Handling - In addition to local errors, further errors may occur within the server system and during data transport. - Cancellation of operations on the server by the client - Termination of the client before the server has finished - Sun RPC uses automatic re-sending of packets in case of UDP, and recognises lost connections in TCP (keepalive option on socket, see setsockopt). - Sun RPC does not support a separate control channel. 13 RPC, TLI, STREAMS Hannes Lubich, Page 9 Call Semantics - Procedure is executed exactly once - Procedure is executed at most once - Procedure is executed at least once (only acceptable for idempotent operations) - Sun RPC uses unique transaction numbers for each call. - The server maintains a cache of recent requests, and the results returned, and re-sends the associated results in case of duplicate remote procedure calls. 13 RPC, TLI, STREAMS Hannes Lubich, Page 10 5

6 Security Considerations - Security within the local system - Security within the network subsystem - Security within the RPC package - Security within RPC-based applications - Sun RPC supports 3 security levels: Null, Unix, DES - Null is the default value. - Unix contains a timestamp, the hostname of the sending system, as well as the user ID and group ID of the client process, and all groups the client process belongs to. - Usage of the DES level is described in RFC RPC, TLI, STREAMS Hannes Lubich, Page 11 Data Representation (XDR) I - Byte Ordering: big endian - Signed Integer Format: 2 s complement - Floating Point Format: proprietary - Supported Data Types: 32 bit logical value (boolean) Signed / unsigned 32 bit integer Signed / unsigned 64 bit integer 32 and 64 bit floating point values ASCII character set 13 RPC, TLI, STREAMS Hannes Lubich, Page 12 6

7 Data Representation (XDR) II - Further Supported Data Types: Enumeration Structs Fixed-length single-dimensional array Variable-length single-dimensional array Discriminated union Fixed-length opaque data Variable-length opaque data 13 RPC, TLI, STREAMS Hannes Lubich, Page 13 RPC Programming Example Server Procedures Server dir_proc.c cc list_svc Server Stub list_svc.c RPC Specification list.x rpcgen list.h list_xdr.c RPC Runtime Library Client Main Program rls.c list_clnt.c Client Stub cc Client rls W.R. Stevens: UNIX Network Programming, Figure RPC, TLI, STREAMS Hannes Lubich, Page 14 7

8 The XDR Specification: list.x /* list.x: Remote directory listing protocol */ const MAXNAMELEN = 255; /* maximum length of a name */ typedef string nametype<maxnamelen>; /* a directory entry */ typedef struct namenode *namelist; /* a link in the listing */ /* A node in the directory listing */ struct namenode { nametype name; /* name of directory entry */ namelist next; }; /* next entry */ /* The result of a READDIR operation */ union readdir_res switch (int errno) { case 0: namelist list; /* no error: return dir listing */ default: void; }; /* error; nothing to return */ program DIRPROG { version DIRVERS { readdir_res READDIR (nametype) = 1; } = 1; } = 0x ; 13 RPC, TLI, STREAMS Hannes Lubich, Page 15 Program Number Registration Distributed namespace administration See /etc/rpc (exact path and filename depending on Unix variant used) 0x x1FFFFFFF: administered by ONC 0x x3FFFFFFF: defined by user 0x x5FFFFFFF: dynamically assigned 0x xFFFFFFFF: reserved for future use 13 RPC, TLI, STREAMS Hannes Lubich, Page 16 8

9 /* rls.c: remote directory listing client */ #include <stdio.h> #include <rpc/rpc.h> #include "list.h" extern int errno; main (ac, av) int ac; char **av; { CLIENT *cl; char *server; char *dir; readdir_res *result; namelist nl; if (ac!= 3) { fprintf (stderr "usage: %s host directory\n", av[0]); exit (1); } /* Remember what our command line argument refers to */ server = av[1]; dir = av[2]; The Client Program: rls.c I 13 RPC, TLI, STREAMS Hannes Lubich, Page 17 The Client Program: rls.c II /* Create client handle used for calling MESSAGEPROC on the * server designated on the command line. We tell the RPC * package to use the TCP protocol when contacting the server.*/ cl = clnt_create (server, DIRPROG, DIRVERS, "tcp"); if (cl == NULL) { /* Couldn't establish connection with server. * Print error message and die. */ clnt_pcreateerror (server); exit (1); } /* Call the remote procedure readdir on the server side */ result = readdir_1 (&dir, cl); if (result == NULL) { /* An error occurred while calling the server. * Print error message and die. */ clnt_perror (cl, server); exit (1); } 13 RPC, TLI, STREAMS Hannes Lubich, Page 18 9

10 The Client Program: rls.c III } /* Okay, we successfully called the remote procedure. */ if (result -> errno!= 0) { /* A remote system error occurred. * Print error message and die. */ errno = result -> errno; perror (dir); exit (1); } /* Successfully got a directory listing. * Print it out. */ for (nl = result->readdir_res_u.list; nl!= NULL; nl = nl->next) printf ("%s\n", nl -> name); exit (0); 13 RPC, TLI, STREAMS Hannes Lubich, Page 19 The Server Procedure: dir_proc.c I /* dir_proc.c: remote readdir implementation */ #include <rpc/rpc.h> #include <sys/dir.h> #include <stdio.h> #include "list.h" extern int errno; extern char *malloc(); extern char *strdup(); readdir_res * readdir_1_svc (dirname) nametype *dirname; { DIR *dirp; structdirect *d; namelist nl; namelist *nlp; static readdir_res res; /* must be static */ fprintf (stderr, "RPC-INVOKE-REQUEST: list directory %s\n", *dirname); /* Open directory */ dirp = opendir (*dirname); if (dirp == NULL) { res.errno = errno; fprintf (stderr, "RPC-ERROR: errno == %d\n", errno); return (&res); } 13 RPC, TLI, STREAMS Hannes Lubich, Page 20 10

11 The Server Procedure: dir_proc.c II } /* Free previous result */ xdr_free (xdr_readdir_res, &res); /* Collect directory entries * Memory allocated here will be freed by xdr_free() * next time readdir_1_svc is called */ nlp = &res.readdir_res_u.list; while (d = readdir (dirp)) { nl = *nlp = (namenode *) malloc (sizeof (namenode)); nl -> name = strdup (d -> d_name); nlp = & nl -> next; } *nlp = NULL; /* Return the result */ res.errno = 0; closedir (dirp); fprintf (stderr, "RPC-INVOKE-RESULT: sending directory result\n"); return (&res); 13 RPC, TLI, STREAMS Hannes Lubich, Page 21 all: rls: list_svc: list.h: rls.o: list_clnt.o: list_xdr.o: list_svc.o: dir_proc.o: The Makefile rls list_svc rls.o list_clnt.o list_xdr.o cc rls.o list_clnt.o list_xdr.o -o rls list_svc.o dir_proc.o list_xdr.o cc list_svc.o dir_proc.o list_xdr.o -o list_svc list.x rpcgen list.x rls.c list.h cc -c rls.c list_clnt.c list.h cc -c list_clnt.c list_xdr.c list.h cc -c list_xdr.c list_svc.c list.h cc -c list_svc.c dir_proc.c list.h cc -c dir_proc.c neat: rm -f *.o core a.out list.h \ list_clnt.c list_xdr.c list_svc.c clean: rm -f rls list_svc *.o core \ a.out list.h list_clnt.c list_xdr.c list_svc.c 13 RPC, TLI, STREAMS Hannes Lubich, Page 22 11

12 Layer Integration RPC Application Presentation Session Cntl Transport Network Data Link Physical NFS RPC XDR RPC Library TCP UDP IP Ethernet Link Logical Link Control Ethernet Token Ring S.G. Kochan/P.H. Wood: UNIX Networking, Figure RPC, TLI, STREAMS Hannes Lubich, Page 23 Use and Limits of RPC - Servers are mostly stateless: all operations are independent from each other robust against errors within the client, server or network - Performance (local versus remote procedures) - Service strategies (single server, 1 server per client, ) - Distribution strategies (where to put servers) 13 RPC, TLI, STREAMS Hannes Lubich, Page 24 12

13 The Transport Layer Interface (TLI) Developed by AT&T as a common communications interface First released as part of System V Release 3 (1986) Part of the System V Interface Definition (SVID) First release without a provider module (i.e. without connection to TCP/IP) Further development of TLI with Sun Microsystems 13 RPC, TLI, STREAMS Hannes Lubich, Page 25 Basic Concepts of TLI Common communications interface for all data transport mechanisms below (TCP/IP, OSI, Novell, ) Corresponds to the interface between session layer (5) and transport layer (4) of the OSI reference model. TLI is only an interface to the lower protocol layers and translates TLI requests into the native protocol operations of the underlying service. TLI must be explicitly bound to every program wishing to use it. 13 RPC, TLI, STREAMS Hannes Lubich, Page 26 13

14 The Functional Model of TLI Calling TLI Functions application TLI functions user program kernel Operating system protocol software Calling Operating System Functions D. Comer, Internetworking with TCP/IP, Vol. III 13 RPC, TLI, STREAMS Hannes Lubich, Page 27 TLI Terminology Transport Endpoint (TEP): - Actual State - Actual Event - Implementation as a finite state machine Communication Descriptors: - Provided as file descriptors - Device special files are used to select a transport service (e.g. /dev/tcp) Addressing: - No pre-defined format - When using TCP/IP as the transport service, the known structure sockaddr_in is used (Quelle: M. Vogt, TIK, ETHZ) 13 RPC, TLI, STREAMS Hannes Lubich, Page 28 14

15 Client TLI Call Sequence Server t_open t_bind t_connect t_open t_bind t_listen t_open t_bind t_accept t_snd t_rcv t_close D. Comer, Internetworking with TCP/IP, Vol. III t_rcv t_snd t_close 13 RPC, TLI, STREAMS Hannes Lubich, Page 29 TLI versus Sockets TLI Interface User address space Sockets Complete subsystem Kernel address space t_listen + t_accept listen + accept (Quelle: M. Vogt, TIK, ETHZ) 13 RPC, TLI, STREAMS Hannes Lubich, Page 30 15

16 STREAMS Designed by D. Ritchie for System V Release 3 Programming environment for the development of communication protocols Toolbox design with re-usable modules Provides implementation of commonly used modules Mapping of existing communication services (pipes, terminal-i/o etc.) onto STREAMS services Not supported by some Unix variants (e.g. Linux) 13 RPC, TLI, STREAMS Hannes Lubich, Page 31 STREAM Components Stream Head: interface between kernel address space and user address space STREAMS Device Driver: mapping between a generic data format and the specific data format required for a device Messages: data travelling through a stream requiring memory allocation etc. Module: self-contained data processing step within a STREAM 13 RPC, TLI, STREAMS Hannes Lubich, Page 32 16

17 Design of a STREAM fd[0] fd[1] q_info head head q_info open() close()... Stream functions read queue write queue q_next read queue q_next write queue Further modules can be introduced to a stream (push) or removed from a stream (pop). open() close()... Stream functions Each module has a read and a write queue and provides two procedures: put (calling a neighbour module when passing data) und service (flow control). The Streams Scheduler calls each module cyclically. There are special modules for communication (e.g. multiplexers). 13 RPC, TLI, STREAMS Hannes Lubich, Page 33 Summary: RPC, STREAMS, TLI User-accessible API RPC TLI User Space Sockets STREAMS Kernel Space 13 RPC, TLI, STREAMS Hannes Lubich, Page 34 17

Remote Procedure Call Implementations

Remote Procedure Call Implementations Remote Procedure Call Implementations Sun ONC(Open Network Computing) RPC. Implements at-most-once semantics by default. At-least-once (idempotent) can also be chosen as an option for some procedures.

More information

Process Concept: views of a process Process Scheduling CSCI 6730/ 4730 Operating Systems

Process Concept: views of a process Process Scheduling CSCI 6730/ 4730 Operating Systems Chapter 3: Processes: Outline Process Concept: views of a process Process Scheduling CSCI 6730/ 4730 Operating Systems Operations on Processes Cooperating Processes Inter Process Communication (IPC) RPC:

More information

Lecture 12 RPC RPC RPC. Writing an RPC Program. Sun RPC RPC. February 9+11, 2005

Lecture 12 RPC RPC RPC. Writing an RPC Program. Sun RPC RPC. February 9+11, 2005 RPC Lecture 12 RPC February 9+11, 2005 Remote Procedure Call Follows application-oriented approach (emphasizes problem over communication) Design program and then divide it. RPC RPC There exists a way

More information

Chapter 3: Processes: Outline. Operating Systems. Remote Procedure Calls (RPC) Client-Server Remote Machine Communication Mechanisms

Chapter 3: Processes: Outline. Operating Systems. Remote Procedure Calls (RPC) Client-Server Remote Machine Communication Mechanisms Chapter 3: Processes: Outline Operating Systems RPC: Processes Process Concept: views of a process Process Scheduling Operations on Processes Cooperating Processes Inter Process Communication (IPC) Local

More information

Remote Procedure Calls (RPC)

Remote Procedure Calls (RPC) Distributed Computing Remote Procedure Calls (RPC) Dr. Yingwu Zhu Problems with Sockets Sockets interface is straightforward [connect] read/write [disconnect] BUT it forces read/write mechanism We usually

More information

Chapter 3: Client-Server Paradigm and Middleware

Chapter 3: Client-Server Paradigm and Middleware 1 Chapter 3: Client-Server Paradigm and Middleware In order to overcome the heterogeneity of hardware and software in distributed systems, we need a software layer on top of them, so that heterogeneity

More information

Presentation Services. Presentation Services: Motivation

Presentation Services. Presentation Services: Motivation Presentation Services need for a presentation services ASN.1 declaring data type encoding data types implementation issues reading: Tannenbaum 7.3.2 Presentation Services: Motivation Question: suppose

More information

Distributed Systems 8. Remote Procedure Calls

Distributed Systems 8. Remote Procedure Calls Distributed Systems 8. Remote Procedure Calls Paul Krzyzanowski pxk@cs.rutgers.edu 10/1/2012 1 Problems with the sockets API The sockets interface forces a read/write mechanism Programming is often easier

More information

Distributed Program Design Typical Sockets Approach. Remote Procedure Call. Remote Subroutine

Distributed Program Design Typical Sockets Approach. Remote Procedure Call. Remote Subroutine Distributed Program Design Typical Sockets Approach Communication-Oriented Design Design protocol first. Build programs that adhere to the protocol. Application-Oriented Design Build application(s). Divide

More information

6 Remote Procedure Call (RPC)

6 Remote Procedure Call (RPC) 6 Remote Procedure Call (RPC) RFC 1831 (Sun) invoke procedure on remote host in analogy to local procedure call programming interface: (local) procedure call remote procedure call active client calls server

More information

CSE 333 SECTION 3. POSIX I/O Functions

CSE 333 SECTION 3. POSIX I/O Functions CSE 333 SECTION 3 POSIX I/O Functions Administrivia Questions (?) HW1 Due Tonight Exercise 7 due Monday (out later today) POSIX Portable Operating System Interface Family of standards specified by the

More information

Remote Procedure Call

Remote Procedure Call Remote Procedure Call Outline Concept of RPC SunRPC Spring 2009 CSE30264 1 RPC Timeline Server Request Blocked Blocked Reply Computing Blocked Spring 2009 CSE30264 2 RPC There exists a way for processes

More information

ECE 435 Network Engineering Lecture 2

ECE 435 Network Engineering Lecture 2 ECE 435 Network Engineering Lecture 2 Vince Weaver http://web.eece.maine.edu/~vweaver vincent.weaver@maine.edu 31 August 2017 Announcements Homework 1 will be posted. Will be on website, will announce

More information

RPC Programming. Some knowledge of C & Unix A network with at least two connected machines.

RPC Programming. Some knowledge of C & Unix A network with at least two connected machines. RPC Programming 1.0 Prerequisites Some knowledge of C & Unix A network with at least two connected machines. 2.0 Objectives: 1. To understand the basic principles of RPC 2. To develop a program which returns

More information

ECE 435 Network Engineering Lecture 2

ECE 435 Network Engineering Lecture 2 ECE 435 Network Engineering Lecture 2 Vince Weaver http://web.eece.maine.edu/~vweaver vincent.weaver@maine.edu 6 September 2018 Announcements Homework 1 will be posted. Will be on website, will announce

More information

The RPC abstraction. Procedure calls well-understood mechanism. - Transfer control and data on single computer

The RPC abstraction. Procedure calls well-understood mechanism. - Transfer control and data on single computer The RPC abstraction Procedure calls well-understood mechanism - Transfer control and data on single computer Goal: Make distributed programming look same - Code libraries provide APIs to access functionality

More information

Last Class: RPCs. Today:

Last Class: RPCs. Today: Last Class: RPCs RPCs make distributed computations look like local computations Issues: Parameter passing Binding Failure handling Lecture 4, page 1 Today: Case Study: Sun RPC Lightweight RPCs Remote

More information

Distributed Systems. How do regular procedure calls work in programming languages? Problems with sockets RPC. Regular procedure calls

Distributed Systems. How do regular procedure calls work in programming languages? Problems with sockets RPC. Regular procedure calls Problems with sockets Distributed Systems Sockets interface is straightforward [connect] read/write [disconnect] Remote Procedure Calls BUT it forces read/write mechanism We usually use a procedure call

More information

CSE 333 SECTION 3. POSIX I/O Functions

CSE 333 SECTION 3. POSIX I/O Functions CSE 333 SECTION 3 POSIX I/O Functions Administrivia Questions (?) HW1 Due Tonight HW2 Due Thursday, July 19 th Midterm on Monday, July 23 th 10:50-11:50 in TBD (And regular exercises in between) POSIX

More information

RPC Paradigm. Lenuta Alboaie Andrei Panu

RPC Paradigm. Lenuta Alboaie Andrei Panu RPC Paradigm Lenuta Alboaie (adria@info.uaic.ro) Andrei Panu (andrei.panu@info.uaic.ro) 1 Content Remote Procedure Call (RPC) Preliminaries Characteristics XDR (External Data Representation) Functioning

More information

CSC209: Software tools. Unix files and directories permissions utilities/commands Shell programming quoting wild cards files

CSC209: Software tools. Unix files and directories permissions utilities/commands Shell programming quoting wild cards files CSC209 Review CSC209: Software tools Unix files and directories permissions utilities/commands Shell programming quoting wild cards files ... and systems programming C basic syntax functions arrays structs

More information

CSC209: Software tools. Unix files and directories permissions utilities/commands Shell programming quoting wild cards files. Compiler vs.

CSC209: Software tools. Unix files and directories permissions utilities/commands Shell programming quoting wild cards files. Compiler vs. CSC209 Review CSC209: Software tools Unix files and directories permissions utilities/commands Shell programming quoting wild cards files... and systems programming C basic syntax functions arrays structs

More information

Lecture 8: February 17

Lecture 8: February 17 CMPSCI 677 Operating Systems Spring 2016 Lecture 8: February 17 Lecturer: Prashant Shenoy Scribe: Ravi Choudhary 8.1 Communications in Distributed Systems This lecture will deal with communication between

More information

NFS Design Goals. Network File System - NFS

NFS Design Goals. Network File System - NFS Network File System - NFS NFS Design Goals NFS is a distributed file system (DFS) originally implemented by Sun Microsystems. NFS is intended for file sharing in a local network with a rather small number

More information

Operating Systems. 18. Remote Procedure Calls. Paul Krzyzanowski. Rutgers University. Spring /20/ Paul Krzyzanowski

Operating Systems. 18. Remote Procedure Calls. Paul Krzyzanowski. Rutgers University. Spring /20/ Paul Krzyzanowski Operating Systems 18. Remote Procedure Calls Paul Krzyzanowski Rutgers University Spring 2015 4/20/2015 2014-2015 Paul Krzyzanowski 1 Remote Procedure Calls 2 Problems with the sockets API The sockets

More information

C 1. Recap: Finger Table. CSE 486/586 Distributed Systems Remote Procedure Call. Chord: Node Joins and Leaves. Recall? Socket API

C 1. Recap: Finger Table. CSE 486/586 Distributed Systems Remote Procedure Call. Chord: Node Joins and Leaves. Recall? Socket API Recap: Finger Table Finding a using fingers CSE 486/586 Distributed Systems Remote Procedure Call Steve Ko Computer Sciences and Engineering University at Buffalo N102" 86 + 2 4! N86" 20 +

More information

Remote Procedure Call (RPC) and Transparency

Remote Procedure Call (RPC) and Transparency Remote Procedure Call (RPC) and Transparency Brad Karp UCL Computer Science CS GZ03 / M030 10 th October 2014 Transparency in Distributed Systems Programmers accustomed to writing code for a single box

More information

Desarrollo de Aplicaciones en Red. El modelo de comunicación. General concepts. Models of communication. Message Passing

Desarrollo de Aplicaciones en Red. El modelo de comunicación. General concepts. Models of communication. Message Passing Desarrollo de Aplicaciones en Red El modelo de comunicación José Rafael Rojano Cáceres http://www.uv.mx/rrojano 1 2 General concepts As we saw in a Distributed System the logical and physical component

More information

CSC209 Review. Yeah! We made it!

CSC209 Review. Yeah! We made it! CSC209 Review Yeah! We made it! 1 CSC209: Software tools Unix files and directories permissions utilities/commands Shell programming quoting wild cards files 2 ... and C programming... C basic syntax functions

More information

Sun Remote Procedure Call Mechanism

Sun Remote Procedure Call Mechanism Sun Remote Procedure Call Mechanism Originally developed by Sun, but now widely available on other platforms (including Digital Unix). Also known as Open Network Computing (ONC). Sun RPC package has an

More information

7 Distributed File Systems

7 Distributed File Systems Single tree /etc Global File system /progs Drives mounted over the network to create a single tree /user /sys Network Forest of drives 7 Distributed File Systems C: D: E: F: Drives mounted over the network

More information

Remote Procedure Calls CS 707

Remote Procedure Calls CS 707 Remote Procedure Calls CS 707 Motivation Send and Recv calls I/O Goal: make distributed nature of system transparent to the programmer RPC provides procedural interface to distributed services CS 707 2

More information

TELE402. Internetworking. TELE402 Lecture 1 Protocol Layering 1

TELE402. Internetworking. TELE402 Lecture 1 Protocol Layering 1 TELE402 Internetworking TELE402 Lecture 1 Protocol Layering 1 People Lecturer Dr. Zhiyi Huang Email: hzy@cs.otago.ac.nz Phone: 479-5680 Office: 1.26 Owheo Building Teaching Assistant Kai-Cheung Leung Email:

More information

Today CSCI Communication. Communication in Distributed Systems. Communication in Distributed Systems. Remote Procedure Calls (RPC)

Today CSCI Communication. Communication in Distributed Systems. Communication in Distributed Systems. Remote Procedure Calls (RPC) Today CSCI 5105 Communication in Distributed Systems Overview Types Remote Procedure Calls (RPC) Instructor: Abhishek Chandra 2 Communication How do program modules/processes communicate on a single machine?

More information

MSc Integrated Electronics Networks Assignment. Investigation of TCP/IP Sockets and Ports. Gavin Cameron

MSc Integrated Electronics Networks Assignment. Investigation of TCP/IP Sockets and Ports. Gavin Cameron MSc Integrated Electronics Networks Assignment Investigation of TCP/IP Sockets and Ports Gavin Cameron Introduction TCP and IP (Transmission Control Protocol / Internet Protocol) are two protocols from

More information

System Models and Communication

System Models and Communication System Models and Communication http://idc.hust.edu.cn/~rxli/ Outline Terminology Client-Server Model OSI Model vs. Middleware Model Summary Ruixuan Li School of Computer Science and Technology Huazhong

More information

Introduction and Overview Socket Programming Lower-level stuff Higher-level interfaces Security. Network Programming. Samuli Sorvakko/Nixu Oy

Introduction and Overview Socket Programming Lower-level stuff Higher-level interfaces Security. Network Programming. Samuli Sorvakko/Nixu Oy Network Programming Samuli Sorvakko/Nixu Oy Telecommunications software and Multimedia Laboratory T-110.4100 Computer Networks October 5, 2009 Agenda 1 Introduction and Overview 2 Socket Programming 3

More information

CS307 Operating Systems Processes

CS307 Operating Systems Processes CS307 Processes Fan Wu Department of Computer Science and Engineering Shanghai Jiao Tong University Spring 2018 Process Concept Process a program in execution An operating system executes a variety of

More information

Processes. Process Concept. The Process. The Process (Cont.) Process Control Block (PCB) Process State

Processes. Process Concept. The Process. The Process (Cont.) Process Control Block (PCB) Process State CS307 Process Concept Process a program in execution Processes An operating system executes a variety of programs: Batch system jobs Time-shared systems user programs or tasks All these activities are

More information

CSCI-243 Exam 2 Review February 22, 2015 Presented by the RIT Computer Science Community

CSCI-243 Exam 2 Review February 22, 2015 Presented by the RIT Computer Science Community CSCI-43 Exam Review February, 01 Presented by the RIT Computer Science Community http://csc.cs.rit.edu C Preprocessor 1. Consider the following program: 1 # include 3 # ifdef WINDOWS 4 # include

More information

CSCE 455/855 Distributed Operating Systems

CSCE 455/855 Distributed Operating Systems CSCE 455/855 Distributed Operating Systems Spring 2001 Steve Goddard Programming Assignment 1 (PA1), January 29 Due: 6:00pm February 12 The focus of this semester s Distributed Operating Systems course

More information

Preface to the First Edition Preface to the Second Edition Acknowledgments UNIX Operating System Environment p. 1 UNIX: Past and Present p.

Preface to the First Edition Preface to the Second Edition Acknowledgments UNIX Operating System Environment p. 1 UNIX: Past and Present p. Preface to the First Edition p. xv Preface to the Second Edition p. xvii Acknowledgments p. xix UNIX Operating System Environment p. 1 UNIX: Past and Present p. 2 History and Growth of UNIX p. 2 Flavors

More information

Introduction and Overview Socket Programming Higher-level interfaces Final thoughts. Network Programming. Samuli Sorvakko/Nixu Oy

Introduction and Overview Socket Programming Higher-level interfaces Final thoughts. Network Programming. Samuli Sorvakko/Nixu Oy Network Programming Samuli Sorvakko/Nixu Oy Telecommunications software and Multimedia Laboratory T-110.4100 Computer Networks October 16, 2008 Agenda 1 Introduction and Overview Introduction 2 Socket

More information

Lecture 2. Outline. Layering and Protocols. Network Architecture. Layering and Protocols. Layering and Protocols. Chapter 1 - Foundation

Lecture 2. Outline. Layering and Protocols. Network Architecture. Layering and Protocols. Layering and Protocols. Chapter 1 - Foundation Lecture 2 Outline Wireshark Project 1 posted, due in a week Lab from a different textbook Work through the lab and answer questions at the end Chapter 1 - Foundation 1.1 Applications 1.2 Requirements 1.3

More information

UNIT 1 TCP/IP PROGRAMMING CONCEPTS

UNIT 1 TCP/IP PROGRAMMING CONCEPTS UNIT 1 TCP/IP PROGRAMMING CONCEPTS TCP/IP Programming Concepts Structure Page Nos. 1.0 Introduction 5 1.1 Objectives 5 1.2 Client Server Communication 6 1.2.1 Designing Client/Server Programs 7 1.2.2 Socket

More information

Outline. EEC-681/781 Distributed Computing Systems. The OSI Network Architecture. Inter-Process Communications (IPC) Lecture 4

Outline. EEC-681/781 Distributed Computing Systems. The OSI Network Architecture. Inter-Process Communications (IPC) Lecture 4 EEC-681/781 Distributed Computing Systems Lecture 4 Department of Electrical and Computer Engineering Cleveland State University wenbing@ieee.org Outline Inter-process communications Computer networks

More information

ECE 650 Systems Programming & Engineering. Spring 2018

ECE 650 Systems Programming & Engineering. Spring 2018 ECE 650 Systems Programming & Engineering Spring 2018 Programming with Network Sockets Tyler Bletsch Duke University Slides are adapted from Brian Rogers (Duke) Sockets We ve looked at shared memory vs.

More information

Elementary TCP Sockets

Elementary TCP Sockets Elementary TCP Sockets Chapter 4 UNIX Network Programming Vol. 1, Second Ed. Stevens Distributed Computer Systems 1 socket interface Application 1 Application 2 socket interface user kernel user kernel

More information

Features of C. Portable Procedural / Modular Structured Language Statically typed Middle level language

Features of C. Portable Procedural / Modular Structured Language Statically typed Middle level language 1 History C is a general-purpose, high-level language that was originally developed by Dennis M. Ritchie to develop the UNIX operating system at Bell Labs. C was originally first implemented on the DEC

More information

Distributed Objects and Remote Invocation. Programming Models for Distributed Applications

Distributed Objects and Remote Invocation. Programming Models for Distributed Applications Distributed Objects and Remote Invocation Programming Models for Distributed Applications Extending Conventional Techniques The remote procedure call model is an extension of the conventional procedure

More information

[MS-UNMP]: User Name Mapping Protocol. Intellectual Property Rights Notice for Open Specifications Documentation

[MS-UNMP]: User Name Mapping Protocol. Intellectual Property Rights Notice for Open Specifications Documentation [MS-UNMP]: Intellectual Property Rights Notice for Open Specifications Documentation Technical Documentation. Microsoft publishes Open Specifications documentation ( this documentation ) for protocols,

More information

Inter-process Communication: RPC

Inter-process Communication: RPC Inter-process Communication: RPC Dr. Yong Guan Department of Electrical and Computer Engineering & Information Assurance Center Iowa State University Outline for Today s Talk Inter-process Communication:

More information

EECS122 Communications Networks Socket Programming. Jörn Altmann

EECS122 Communications Networks Socket Programming. Jörn Altmann EECS122 Communications Networks Socket Programming Jörn Altmann Questions that will be Addressed During the Lecture What mechanisms are available for a programmer who writes network applications? How to

More information

Transactions on Information and Communications Technologies vol 10, 1995 WIT Press, ISSN

Transactions on Information and Communications Technologies vol 10, 1995 WIT Press,   ISSN Understanding the programming techniques for client-server architectures V. Dobrota,* S.D. Bate,* M. Cosma," D. Zinca* "Technical University ofcluj-napoca, Department of Communications, 3400 Cluj-Napoca,

More information

Distributed Systems. 03. Remote Procedure Calls. Paul Krzyzanowski. Rutgers University. Fall 2017

Distributed Systems. 03. Remote Procedure Calls. Paul Krzyzanowski. Rutgers University. Fall 2017 Distributed Systems 03. Remote Procedure Calls Paul Krzyzanowski Rutgers University Fall 2017 1 Socket-based communication Socket API: all we get from the OS to access the network Socket = distinct end-to-end

More information

Outline. Interprocess Communication. Interprocess Communication. Communication Models: Message Passing and shared Memory.

Outline. Interprocess Communication. Interprocess Communication. Communication Models: Message Passing and shared Memory. Eike Ritter 1 Modified: October 29, 2012 Lecture 14: Operating Systems with C/C++ School of Computer Science, University of Birmingham, UK Outline 1 2 3 Shared Memory in POSIX systems 1 Based on material

More information

Application Programming Interfaces

Application Programming Interfaces Application Programming Interfaces Stefan D. Bruda Winter 2018 SYSTEM CALLS Machine 1 Machine 2 Application 1 Application 3 Application 4 Application 5 Application 2 API (system functions) API (system

More information

NETWORK PROGRAMMING. Instructor: Junaid Tariq, Lecturer, Department of Computer Science

NETWORK PROGRAMMING. Instructor: Junaid Tariq, Lecturer, Department of Computer Science NETWORK PROGRAMMING CSC- 341 25 Instructor: Junaid Tariq, Lecturer, Department of Computer Science 26 9 Lecture Sockets as means for inter-process communication (IPC) application layer Client Process Socket

More information

Introduction and Overview Socket Programming Higher-level interfaces Final thoughts. Network Programming. Samuli Sorvakko/Nixu Oy

Introduction and Overview Socket Programming Higher-level interfaces Final thoughts. Network Programming. Samuli Sorvakko/Nixu Oy Network Programming Samuli Sorvakko/Nixu Oy Telecommunications software and Multimedia Laboratory T-110.4100 Computer Networks October 9, 2006 Agenda 1 Introduction and Overview Introduction 2 Socket Programming

More information

Distributed Systems Exam 1 Review. Paul Krzyzanowski. Rutgers University. Fall 2016

Distributed Systems Exam 1 Review. Paul Krzyzanowski. Rutgers University. Fall 2016 Distributed Systems 2016 Exam 1 Review Paul Krzyzanowski Rutgers University Fall 2016 Question 1 Why does it not make sense to use TCP (Transmission Control Protocol) for the Network Time Protocol (NTP)?

More information

A Client-Server Exchange

A Client-Server Exchange Socket programming A Client-Server Exchange A server process and one or more client processes Server manages some resource. Server provides service by manipulating resource for clients. 1. Client sends

More information

Communication. Distributed Systems Santa Clara University 2016

Communication. Distributed Systems Santa Clara University 2016 Communication Distributed Systems Santa Clara University 2016 Protocol Stack Each layer has its own protocol Can make changes at one layer without changing layers above or below Use well defined interfaces

More information

Chapter 3: Process Concept

Chapter 3: Process Concept Chapter 3: Process Concept Chapter 3: Process Concept Process Concept Process Scheduling Operations on Processes Inter-Process Communication (IPC) Communication in Client-Server Systems Objectives 3.2

More information

Chapter 3: Process Concept

Chapter 3: Process Concept Chapter 3: Process Concept Chapter 3: Process Concept Process Concept Process Scheduling Operations on Processes Inter-Process Communication (IPC) Communication in Client-Server Systems Objectives 3.2

More information

PRINCIPLES OF OPERATING SYSTEMS

PRINCIPLES OF OPERATING SYSTEMS PRINCIPLES OF OPERATING SYSTEMS Tutorial-1&2: C Review CPSC 457, Spring 2015 May 20-21, 2015 Department of Computer Science, University of Calgary Connecting to your VM Open a terminal (in your linux machine)

More information

Assignment 2 Group 5 Simon Gerber Systems Group Dept. Computer Science ETH Zurich - Switzerland

Assignment 2 Group 5 Simon Gerber Systems Group Dept. Computer Science ETH Zurich - Switzerland Assignment 2 Group 5 Simon Gerber Systems Group Dept. Computer Science ETH Zurich - Switzerland t Your task Write a simple file server Client has to be implemented in Java Server has to be implemented

More information

CS Programming In C

CS Programming In C CS 24000 - Programming In C Week Two: Basic C Program Organization and Data Types Zhiyuan Li Department of Computer Science Purdue University, USA 2 int main() { } return 0; The Simplest C Program C programs

More information

DISTRIBUTED PROCESSING SOFTWARE ENVIRONMENTS

DISTRIBUTED PROCESSING SOFTWARE ENVIRONMENTS DISTRIBUTED PROCESSING SOFTWARE ENVIRONMENTS The environment or framework for supporting distributed processing can usefully be divided into three main approaches: Distributed processing is supported via

More information

416 Distributed Systems. RPC Day 2 Jan 11, 2017

416 Distributed Systems. RPC Day 2 Jan 11, 2017 416 Distributed Systems RPC Day 2 Jan 11, 2017 1 Last class Finish networks review Fate sharing End-to-end principle UDP versus TCP; blocking sockets IP thin waist, smart end-hosts, dumb (stateless) network

More information

CSci 4061 Introduction to Operating Systems. IPC: Basics, Pipes

CSci 4061 Introduction to Operating Systems. IPC: Basics, Pipes CSci 4061 Introduction to Operating Systems IPC: Basics, Pipes Today Directory wrap-up Communication/IPC Test in one week Communication Abstraction: conduit for data exchange between two or more processes

More information

Session NM056. Programming TCP/IP with Sockets. Geoff Bryant Process software

Session NM056. Programming TCP/IP with Sockets. Geoff Bryant Process software Session NM056 Programming TCP/IP with Sockets Geoff Bryant Process software Course Roadmap Slide 57 NM055 (11:00-12:00) Important Terms and Concepts TCP/IP and Client/Server Model Sockets and TLI Client/Server

More information

Sockets Sockets Communication domains

Sockets Sockets Communication domains Sockets Sockets The original method for process communication in UNIX is pipes. A disadvantage with pipes is that they can only be used by processes that have the same parent process. When communicating

More information

CSC 271 Software I: Utilities and Internals

CSC 271 Software I: Utilities and Internals CSC 271 Software I: Utilities and Internals Lecture 13 : An Introduction to File I/O in Linux File Descriptors All system calls for I/O operations refer to open files using a file descriptor (a nonnegative

More information

Chapter 4: Processes

Chapter 4: Processes Chapter 4: Processes Process Concept Process Scheduling Operations on Processes Cooperating Processes Interprocess Communication Communication in Client-Server Systems 4.1 Process Concept An operating

More information

CS240: Programming in C

CS240: Programming in C CS240: Programming in C Lecture 15: Unix interface: low-level interface Cristina Nita-Rotaru Lecture 15/Fall 2013 1 Streams Recap Higher-level interface, layered on top of the primitive file descriptor

More information

Oral. Total. Dated Sign (2) (5) (3) (2)

Oral. Total. Dated Sign (2) (5) (3) (2) R N Oral Total Dated Sign (2) (5) (3) (2) Assignment Group- A_07 Problem Definition Write a program using TCP socket for wired network for following Say Hello to Each other ( For all students) File transfer

More information

Chapter 3: Processes. Operating System Concepts 9 th Edition

Chapter 3: Processes. Operating System Concepts 9 th Edition Chapter 3: Processes Silberschatz, Galvin and Gagne 2013 Chapter 3: Processes Process Concept Process Scheduling Operations on Processes Interprocess Communication Examples of IPC Systems Communication

More information

CS454/654 Midterm Exam Fall 2004

CS454/654 Midterm Exam Fall 2004 CS454/654 Midterm Exam Fall 2004 (3 November 2004) Question 1: Distributed System Models (18 pts) (a) [4 pts] Explain two benefits of middleware to distributed system programmers, providing an example

More information

CS 417 9/18/17. Paul Krzyzanowski 1. Socket-based communication. Distributed Systems 03. Remote Procedure Calls. Sample SMTP Interaction

CS 417 9/18/17. Paul Krzyzanowski 1. Socket-based communication. Distributed Systems 03. Remote Procedure Calls. Sample SMTP Interaction Socket-based communication Distributed Systems 03. Remote Procedure Calls Socket API: all we get from the to access the network Socket = distinct end-to-end communication channels Read/write model Line-oriented,

More information

COP 4610: Introduction to Operating Systems (Spring 2014) Chapter 3: Process. Zhi Wang Florida State University

COP 4610: Introduction to Operating Systems (Spring 2014) Chapter 3: Process. Zhi Wang Florida State University COP 4610: Introduction to Operating Systems (Spring 2014) Chapter 3: Process Zhi Wang Florida State University Contents Process concept Process scheduling Operations on processes Inter-process communication

More information

416 Distributed Systems. RPC Day 2 Jan 12, 2018

416 Distributed Systems. RPC Day 2 Jan 12, 2018 416 Distributed Systems RPC Day 2 Jan 12, 2018 1 Last class Finish networks review Fate sharing End-to-end principle UDP versus TCP; blocking sockets IP thin waist, smart end-hosts, dumb (stateless) network

More information

Process. Program Vs. process. During execution, the process may be in one of the following states

Process. Program Vs. process. During execution, the process may be in one of the following states What is a process? What is process scheduling? What are the common operations on processes? How to conduct process-level communication? How to conduct client-server communication? Process is a program

More information

SunLink OSI 8.1 TLI Programmer s Reference

SunLink OSI 8.1 TLI Programmer s Reference SunLink OSI 8.1 TLI Programmer s Reference A Sun Microsystems, Inc. Business 2550 Garcia Avenue Mountain View, CA 94043 U.S.A. Part No.: 801-7170-12 Revision A, March 1995 1995 Sun Microsystems, Inc. 2550

More information

Hyo-bong Son Computer Systems Laboratory Sungkyunkwan University

Hyo-bong Son Computer Systems Laboratory Sungkyunkwan University Sockets Hyo-bong Son (proshb@csl.skku.edu) Computer Systems Laboratory Sungkyunkwan University http://csl.skku.edu Client-Server Model Most network application is based on the client-server model: A server

More information

Distributed Systems Theory 4. Remote Procedure Call. October 17, 2008

Distributed Systems Theory 4. Remote Procedure Call. October 17, 2008 Distributed Systems Theory 4. Remote Procedure Call October 17, 2008 Client-server model vs. RPC Client-server: building everything around I/O all communication built in send/receive distributed computing

More information

External Data Representation (XDR)

External Data Representation (XDR) External Data Representation (XDR) Prof. Chuan-Ming Liu Computer Science and Information Engineering National Taipei University of Technology Taipei, TAIWAN NTUT, TAIWAN 1 Introduction This chapter examines

More information

XDR External Data Representation. XDR as a case study XDR

XDR External Data Representation. XDR as a case study XDR XDR External Data Representation Process A XDR Encode/Decode Transport Process A XDR Encode/Decode Transport Netprog: XDR 1 XDR as a case study Sun RPC uses XDR. A good example of a layer. Interesting

More information

CS349/SE382 A1 C Programming Tutorial

CS349/SE382 A1 C Programming Tutorial CS349/SE382 A1 C Programming Tutorial Erin Lester January 2005 Outline Comments Variable Declarations Objects Dynamic Memory Boolean Type structs, enums and unions Other Differences The Event Loop Comments

More information

A Fast Review of C Essentials Part I

A Fast Review of C Essentials Part I A Fast Review of C Essentials Part I Structural Programming by Z. Cihan TAYSI Outline Program development C Essentials Functions Variables & constants Names Formatting Comments Preprocessor Data types

More information

CSCI 171 Chapter Outlines

CSCI 171 Chapter Outlines Contents CSCI 171 Chapter 1 Overview... 2 CSCI 171 Chapter 2 Programming Components... 3 CSCI 171 Chapter 3 (Sections 1 4) Selection Structures... 5 CSCI 171 Chapter 3 (Sections 5 & 6) Iteration Structures

More information

CSE 333 Lecture 16 - network programming intro

CSE 333 Lecture 16 - network programming intro CSE 333 Lecture 16 - network programming intro Hal Perkins Department of Computer Science & Engineering University of Washington Today Network programming - dive into the Berkeley / POSIX sockets API -

More information

Kurt Schmidt. October 30, 2018

Kurt Schmidt. October 30, 2018 to Structs Dept. of Computer Science, Drexel University October 30, 2018 Array Objectives to Structs Intended audience: Student who has working knowledge of Python To gain some experience with a statically-typed

More information

Socket programming in C

Socket programming in C Socket programming in C Sven Gestegård Robertz September 2017 Abstract A socket is an endpoint of a communication channel or connection, and can be either local or over the network.

More information

Variables Data types Variable I/O. C introduction. Variables. Variables 1 / 14

Variables Data types Variable I/O. C introduction. Variables. Variables 1 / 14 C introduction Variables Variables 1 / 14 Contents Variables Data types Variable I/O Variables 2 / 14 Usage Declaration: t y p e i d e n t i f i e r ; Assignment: i d e n t i f i e r = v a l u e ; Definition

More information

CHAPTER 3 - PROCESS CONCEPT

CHAPTER 3 - PROCESS CONCEPT CHAPTER 3 - PROCESS CONCEPT 1 OBJECTIVES Introduce a process a program in execution basis of all computation Describe features of processes: scheduling, creation, termination, communication Explore interprocess

More information

OS COMPONENTS OVERVIEW OF UNIX FILE I/O. CS124 Operating Systems Fall , Lecture 2

OS COMPONENTS OVERVIEW OF UNIX FILE I/O. CS124 Operating Systems Fall , Lecture 2 OS COMPONENTS OVERVIEW OF UNIX FILE I/O CS124 Operating Systems Fall 2017-2018, Lecture 2 2 Operating System Components (1) Common components of operating systems: Users: Want to solve problems by using

More information

structs as arguments

structs as arguments Structs A collection of related data items struct record { char name[maxname]; int count; ; /* The semicolon is important! It terminates the declaration. */ struct record rec1; /*allocates space for the

More information

RMI: Design & Implementation

RMI: Design & Implementation RMI: Design & Implementation Operating Systems RMI 1 Middleware layers Applications, services RMI and RPC request-reply protocol marshalling and external data representation Middleware layers UDP and TCP

More information

Interprocess Communication

Interprocess Communication Interprocess Communication Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved. 0-13-239227-5 Introduction Applications, services

More information

Chapter 3: Processes. Operating System Concepts Essentials 8 th Edition

Chapter 3: Processes. Operating System Concepts Essentials 8 th Edition Chapter 3: Processes Silberschatz, Galvin and Gagne 2011 Chapter 3: Processes Process Concept Process Scheduling Operations on Processes Interprocess Communication Examples of IPC Systems Communication

More information