Sockets A popular API for client-server interaction.

Slides:



Advertisements
Similar presentations
DISTRIBUTED COMPUTING PARADIGMS
Advertisements

Sockets Programming Network API Socket Structures Socket Functions
RPC Robert Grimm New York University Remote Procedure Calls.
Application Layer 2-1 Chapter 2 Application Layer Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Application Layer – Lecture.
Generic Transport Service Primitives Listen –notify Transport layer a call is expected Connect –establish Transport layer connection Send (or Write) Receive.
Socket Programming.
A CHAT CLIENT-SERVER MODULE IN JAVA BY MAHTAB M HUSSAIN MAYANK MOHAN ISE 582 FALL 2003 PROJECT.
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.
CSCI 4550/8556 Computer Networks Comer, Chapter 3: Network Programming and Applications.
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.
Sockets A popular API for client-server interaction.
1 Generic Transport Service Primitives Listen –notify Transport layer a call is expected Connect –establish Transport layer connection Send (or Write)
Middleware Technologies compiled by: Thomas M. Cosley.
Active X Microsoft’s Answer to Dynamic Content Reference: Using Active X by Brian Farrar QUE
McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Application Layer PART VI.
1 School of Computing Science Simon Fraser University CMPT 771/471: Internet Architecture and Protocols Socket Programming Instructor: Dr. Mohamed Hefeeda.
Remote Procedure Calls. 2 Client/Server Paradigm Common model for structuring distributed computations A server is a program (or collection of programs)
An Introduction to Internetworking. Algorithm for client-server communication with UDP (connectionless) A SERVER A CLIENT Create a server-socket (listener)and.
.NET Mobile Application Development Remote Procedure Call.
Socket Programming References: redKlyde ’ s tutorial set Winsock2 for games (gamedev.net)
TCP/IP protocols Communication over Internet is mostly TCP/IP (Transmission Control Protocol over Internet Protocol) TCP/IP "stack" is software which allows.
Application Layer 2-1 Chapter 2 Application Layer Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012.
1 Chapter Client-Server Interaction. 2 Functionality  Transport layer and layers below  Basic communication  Reliability  Application layer.
HTTP HTTP stands for Hypertext Transfer Protocol. It is an TCP/IP based communication protocol which is used to deliver virtually all files and other.
Introduction to Visual Basic. Quick Links Windows Application Programming Event-Driven Application Becoming familiar with VB Control Objects Saving and.
An program As a simple example of socket programming we can implement a program that sends to a remote site As a simple example of socket.
Prepared by Fareeha Lecturer DCS IIUI 1 Windows API.
ICOM 6115©Manuel Rodriguez-Martinez ICOM 6115 – Computer Networks and the WWW Manuel Rodriguez-Martinez, Ph.D. Lecture 26.
DISTRIBUTED COMPUTING PARADIGMS. Paradigm? A MODEL 2for notes
Dr. John P. Abraham Professor University of Texas Pan American Internet Applications and Network Programming.
Windows Network Programming ms-help://MS.MSDNQTR.2004JAN.1033/winsock/winsock/windows_sockets_start_page_2.htm 井民全.
The Socket Interface Chapter 21. Application Program Interface (API) Interface used between application programs and TCP/IP protocols Interface used between.
SEMINOR. INTRODUCTION 1. Middleware is connectivity software that provides a mechanism for processes to interact with other processes running on multiple.
CE Operating Systems Lecture 3 Overview of OS functions and structure.
School of Engineering and Computer Science Victoria University of Wellington Copyright: Peter Andreae david streader, VUW Networking and Concurrency COMP.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved RPC Tanenbaum.
CS 158A1 1.4 Implementing Network Software Phenomenal success of the Internet: – Computer # connected doubled every year since 1981, now approaching 200.
Distributed Computing A Programmer’s Perspective.
X-WindowsP.K.K.Thambi The X Window System Module 5.
Client-Server Model of Interaction Chapter 20. We have looked at the details of TCP/IP Protocols Protocols Router architecture Router architecture Now.
1 Client-Server Interaction. 2 Functionality Transport layer and layers below –Basic communication –Reliability Application layer –Abstractions Files.
Chapter 13 Session Layer. OSI Application Presentation Session Transport Network Data Link Physical Functions of Session Layer Interhost Communication.
CSIT 220 (Blum)1 Remote Procedure Calls Based on Chapter 38 in Computer Networks and Internets, Comer.
The Client-Server Model And the Socket API. Client-Server (1) The datagram service does not require cooperation between the peer applications but such.
Introduction to Humanities Computing Spring 1999 Lecture Nine.
Part 4: Network Applications Client-server interaction, example applications.
Remote Procedure Call and Serialization BY: AARON MCKAY.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
Lecture 4 Mechanisms & Kernel for NOSs. Mechanisms for Network Operating Systems  Network operating systems provide three basic mechanisms that support.
Networking with JavaN-1 Outline Client-Server Example Steps required on the server side Steps required on the client side.
Socket programming in C. Socket programming Socket API introduced in BSD4.1 UNIX, 1981 explicitly created, used, released by apps client/server paradigm.
12-Jun-16 Event loops. 2 Programming in prehistoric times Earliest programs were all “batch” processing There was no interaction with the user Input Output.
1 K. Salah Application Layer Module K. Salah Network layer duties.
Event loops 16-Jun-18.
MCA – 405 Elective –I (A) Java Programming & Technology
CS 1652 Jack Lange University of Pittsburgh
Chapter 2: System Structures
Chapter 3: Windows7 Part 4.
X Windows.
Event loops.
Event loops 17-Jan-19.
Event loops 17-Jan-19.
Remote Procedure Call Hank Levy 1.
Event loops 8-Apr-19.
Remote Procedure Call Hank Levy 1.
Remote Procedure Call Hank Levy 1.
Event loops.
Event loops 19-Aug-19.
Communication.
Presentation transcript:

Sockets A popular API for client-server interaction

Complete view of a socket Application Presentation Session Transport Network Data Link Physical Application Presentation Session Transport Network Data Link Physical Applications talk to each other via APIs like sockets. Sockets provide the interface to the other layers.

Programmer View of a socket Application socket The networking aspects of a socket are transparent Similar to writing to and reading from a file

Socket API Three popular variations –berkley - older outdated unix API –TLI - newer unix version –winsock - microsoft All very similar Most examples in c but available in other languages

General Approach SERVER CLIENT Sets up a connection to wait for client (port) Asks for connection to server port Responds & sets up a different connection for the dialog Client asks for service Server responds time

Fundamental difference with your programming experience Your programs have predictable input output sequences. Typically defined by order of data in a file or which button was clicked. Can NOT control order in which peer queries or responds. Requires an event-driven paradigm

Event-driven apps While (NOT A TERMINATE EVENT) get next event if a reasonable event occurred process it else error or terminate Consider deadlocks: A waits for B to send a message X B waits for A to send message Y neither does -> deadlock! Like windows programs!

Problems with socket apps Timing problems are new for you Apps typically will deadlock Since input is less predictable, harder to debug. Will need to send/get info through socket and echo to a standard output device whatever is sent/read to aid in debugging

See socket code examples Check out examples on WWW

Adapting the example to your problem Setup and disconnect is very similar Interaction is not as simple as the example read/write are basically executed in your main loop.

Non-socket APIs Other than the three types of sockets, one will typically find RPC in use. RPC stands for Remote Procedure Call RPC effectively extracts a function from your code and runs it on another machine X = sqrt(y) Calc sqrt(y) return results y x

Additional considerations Setting up and launching a server on your OS How many simultaneous servers can run How to handle queues of clients waiting for service