Distributed Computing A Programmer’s Perspective.

Slides:



Advertisements
Similar presentations
DISTRIBUTED COMPUTING PARADIGMS
Advertisements

© Janice Regan, CMPT 128, CMPT 371 Data Communications and Networking Socket Programming 0.
Elementary TCP Sockets© Dr. Ayman Abdel-Hamid, CS4254 Spring CS4254 Computer Network Architecture and Programming Dr. Ayman A. Abdel-Hamid Computer.
Today’s topic: Basic TCP API –Socket –Bind –Listen –Connect –Accept –Read –Write –Close.
Socket Programming Application Programming Interface.
Data Communications and Networking (Third Edition)
Networks: TCP/IP Socket Calls1 Elementary TCP Sockets Chapter 4 UNIX Network Programming Vol. 1, Second Ed. Stevens.
Elementary TCP Sockets Chapter 4 UNIX Network Programming Vol. 1, Second Ed. Stevens.
Socket Programming.
Sockets Basics Conectionless Protocol. Today IPC Sockets Basic functions Handed code Q & A.
CS490T Advanced Tablet Platform Applications Network Programming Evolution.
1 Socket Interfaces Professor Jinhua Guo CIS527 Fall 2003.
Tutorial 8 Socket Programming
CS 311 – Lecture 18 Outline IPC via Sockets – Server side socket() bind() accept() listen() – Client side connect() Lecture 181CS Operating Systems.
Socket Addresses. Domains Internet domains –familiar with these Unix domains –for processes communicating on the same hosts –not sure of widespread use.
CSE/EE 461 Getting Started with Networking. Basic Concepts  A PROCESS is an executing program somewhere.  Eg, “./a.out”  A MESSAGE contains information.
McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Application Layer PART VI.
Client Server Model The client machine (or the client process) makes the request for some resource or service, and the server machine (the server process)
What Is TCP/IP? The large collection of networking protocols and services called TCP/IP denotes far more than the combination of the two key protocols.
I NTRODUCTION OF S OCKET P ROGRAMMING L.Aseel AlTurki King Saud University.
Chapter 26 Client Server Interaction Communication across a computer network requires a pair of application programs to cooperate. One application on one.
UNIX Sockets COS 461 Precept 1. Clients and Servers Client program – Running on end host – Requests service – E.g., Web browser Server program – Running.
Basic Socket Programming TCP/IP overview. TCP interface Reference: –UNIX Network Programming, by Richard Stevens. –UNIX man page.
TCP Socket Programming. r An abstract interface provided to the application programmer  File descriptor, allows apps to read/write to the network r Allows.
ECE 4110 – Internetwork Programming Client-Server Model.
Elementary TCP Sockets
CS345 Operating Systems Φροντιστήριο Άσκησης 2. Inter-process communication Exchange data among processes Methods –Signal –Pipe –Sockets.
Sockets CIS 370 Lab 10 UMass Dartmouth. Introduction 4 Sockets provide a simple programming interface which is consistent for processes on the same machine.
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 12 Communicating over.
Jozef Goetz, Application Layer PART VI Jozef Goetz, Position of application layer The application layer enables the user, whether human.
Server Sockets: A server socket listens on a given port Many different clients may be connecting to that port Ideally, you would like a separate file descriptor.
DISTRIBUTED COMPUTING PARADIGMS. Paradigm? A MODEL 2for notes
---- IT Acumens. COM IT Acumens. COMIT Acumens. COM.
The Socket Interface Chapter 21. Application Program Interface (API) Interface used between application programs and TCP/IP protocols Interface used between.
Remote Shell CS230 Project #4 Assigned : Due date :
Networking Tutorial Special Interest Group for Software Engineering Luke Rajlich.
CS 158A1 1.4 Implementing Network Software Phenomenal success of the Internet: – Computer # connected doubled every year since 1981, now approaching 200.
Advanced Sockets API-II Vinayak Jagtap
Hwajung Lee.  Interprocess Communication (IPC) is at the heart of distributed computing.  Processes and Threads  Process is the execution of a program.
CSCE 515: Computer Network Programming UDP Socket Wenyuan Xu Department of Computer Science and Engineering.
UNIX Sockets COS 461 Precept 1. Socket and Process Communication The interface that the OS provides to its networking subsystem application layer transport.
CSE/EE 461 Getting Started with Networking. 2 Basic Concepts A PROCESS is an executing program somewhere. –Eg, “./a.out” A MESSAGE contains information.
Chapter 27 Socket API Interface The interface between an application program and the communication protocols in an operating system is known as the Application.
CS 6401 Introduction to Computer Networks 09/21/2010 Outline - UNIX sockets - A simple client-server program - Project 1 - LAN bridges and learning.
The Client-Server Model And the Socket API. Client-Server (1) The datagram service does not require cooperation between the peer applications but such.
CSCI 330 UNIX and Network Programming Unit XV: Transmission Control Protocol.
S OCKET P ROGRAMMING IN C Professor: Dr. Shu-Ching Chen TA: HsinYu Ha.
Introduction to Sockets
S OCKET P ROGRAMMING IN C Professor: Dr. Shu-Ching Chen TA: Hsin-Yu Ha.
UNIX Sockets Outline UNIX sockets CS 640.
Inter-Process Communication 9.1 Unix Sockets You may regard a socket as being a communication endpoint. –For two processes to communicate, both must create.
1 Spring Semester 2008, Dept. of Computer Science, Technion Internet Networking recitation #7 Socket Programming.
Lecture 3 TCP and UDP Sockets CPE 401 / 601 Computer Network Systems slides are modified from Dave Hollinger.
1 K. Salah Application Layer Module K. Salah Network layer duties.
Sockets Intro to Network Programming. Before the internet... Early computers were entirely isolated No Internet No network No model No external communications.
Last Class: Introduction
Sockets and Beginning Network Programming
MCA – 405 Elective –I (A) Java Programming & Technology
Socket Programming in C
Client-Server Interaction
Network Programming CSC- 341
Socket Programming in C
TCP Sockets Programming
Advanced Network Programming spring 2007
Starting TCP Connection – A High Level View
Sockets Programming Socket to me!.
Sockets Programming Socket to me!.
Internet Networking recitation #8
Outline Communications in Distributed Systems Socket Programming
Today’s topic: Basic TCP API
Presentation transcript:

Distributed Computing A Programmer’s Perspective

Advent of Distributed Computing Early programming models were designed for a single computer – there was no notion of communication between multiple machines With the advent of computer networks, an important question arose – how should communication be presented to the programmer? what communication abstractions make more sense? Different paradigms presented different communication abstractions

Main Issue in Designing Communication Abstractions Should the programmer write communication explicitly or should communication be hidden from the programmer? I see one machine running one program What should I run where? Communication is transparent Communication is explicit

Paradigms for Distributed Computing UNIX IPC (Inter-Process Communication) RPC (Remote Procedure Calls) Distributed Shared Memory Object-Oriented Model Group Communication

Inter-Process Communication (UNIX Socket IPC) Simplest approach – programmer does it all. World consists of multiple machines and data Data is sent from one machine to another using send(machine,port,data) Machine A Machine B Machine C Send()

Remote Procedure Calls Communication is completely hidden World is a single machine running a single sequential program The compiler distributes different program functions to different machines to improve performance Programmer does not have to know that multiple machines are involved

Implementing RPC Making remote function calls look like local ones main() { … function() … } Machine A OS function() { send message wait for reply return } Machine B OS parent() { wait for call call function() send reply } function() { … }

Distributed Objects (CORBA) World is made of objects Programmer invokes methods on objects without having to know where the objects are Objects reside on multiple machines. System delivers method calls to objects across network (CORBA)

Distributed Objects (CORBA) ORB handles remote object invocations main () { … obj.method() … } Object Request Broker Distributed Objects Find object

Distributed Shared Memory (Not widely used) Program has big virtual address space Address space is distributed among multiple machines Code segment Data segment Machine A Machine B Machine C Machine D Machine E Program

Group Communication World consists of multicast groups Each group may span multiple machines Programmer knows about groups but does not have to worry about their physical locations A message sent to a group is received by all members

Important Observation All distributed communication paradigms can be built on top of IPC. Models of distributed computing using IPC: Client-server Peer-to-peer

Client-Server Model World is made of: Servers: machine who provide services to a population of clients (e.g., web servers, pop mail servers, audio servers, etc) Clients: those who connect to servers (e.g., browsers, mail clients, etc) Servers are “well known”

Peer-to-Peer All machines are equal – there is no separation into servers and clients Machines collectively perform a service to their peers Advantages: No central point of failure Potentially more scalable Disadvantages: More difficult to program

The Socket Abstraction Client Client plugs into a server port Connection creates a bi-directional pipe Server Port

A Simple Client-Server Program bind() Well-known port listen() accept() read() write() close() eof()? write() read() connect() socket() close() Client Server

The socket() Call Creates a socket of a particular type int socket (int family, int type, int protocol) Family AF_INET: IPv4 protocols AF_INET6: IPv6 protocols AF_LOCAL: UNIX socket AF_ROUTE: Routing socket Type SOCK_STREAM: Stream (TCP) socket SOCK_DGARM: Datagram (UDP) socket SOCK_RAW: Raw (IP) socket

The bind() Call Executed on the server to assign a (well-known) port address to the socket int bind (int sockfd, const struct sockaddr *myaddr, socklen_t addrlen) IP Address Port Address

The listen() call Moves the socket from the CLOSED to the LISTEN state in the TCP state diagram – socket is now ready to accept connections int listen (int sockfd, int backlog)

Server Initialization OS 1. socket() Web Server 2. bind(80) 3. listen() 80 Listen queue

The connect() Call Establishes a connection with a server int connect (int sockfd, const struct sockaddr *servaddr, socklen_t addrlen)

Connecting to the Server OS 1. socket() Web Server 2. bind(80) 3. listen() 80 Listen queue Client connect() Request from (IP, port)

Busy Server Operation OS Web Server 80 Listen queue Client 1Client 3Client 2 Client requests get queued-up in the listen queue First-come first- served

The accept() Call OS Web Server 80 Listen queue Client 1Client 3Client 2 Client requests get queued-up in the listen queue First-come first- served accept() Connected socket