©The McGraw-Hill Companies, Inc., 2000© Adapted for use at JMU by Mohamed Aboutabl, 2003Mohamed Aboutabl1 1 Chapter 16 Socket Interface.

Slides:



Advertisements
Similar presentations
Chapter 14 Application Layer and Client-Server Model.
Advertisements

Data Communications and Networking (Third Edition)
UDP and Multi-thread Socket Programming
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.
Generic Transport Service Primitives Listen –notify Transport layer a call is expected Connect –establish Transport layer connection Send (or Write) Receive.
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.
CSCE 515: Computer Network Programming Chin-Tser Huang University of South Carolina.
EECS122 Communications Networks Socket Programming January 30th, 2003 Jörn Altmann.
Tutorial 8 Socket Programming
1 Generic Transport Service Primitives Listen –notify Transport layer a call is expected Connect –establish Transport layer connection Send (or Write)
CS3771 Today: network programming with sockets  Previous class: network structures, protocols  Next: network programming Sockets (low-level API) TODAY!
McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Application Layer PART VI.
An Introduction to Internetworking. Algorithm for client-server communication with UDP (connectionless) A SERVER A CLIENT Create a server-socket (listener)and.
I NTRODUCTION OF S OCKET P ROGRAMMING L.Aseel AlTurki King Saud University.
McGraw-Hill©The McGraw-Hill Companies, Inc., 2001 Chapter 24 TCP/IP.
Process-to-Process Delivery:
Server Design Discuss Design issues for Servers Review Server Creation in Linux.
Hands On Networking Socket Programming Ram P Rustagi, ISE Dept Abhishek Gupta, ISE Dept Laxmi Kuber, MCA Dept June 28-30, 2012.
Operating Systems Chapter 9 Distributed Communication.
Socket Programming. Introduction Sockets are a protocol independent method of creating a connection between processes. Sockets can be either – Connection.
Chapter 17 Networking Dave Bremer Otago Polytechnic, N.Z. ©2008, Prentice Hall Operating Systems: Internals and Design Principles, 6/E William Stallings.
Chapter 23 TCP/IP Overview Network Layer Transport Layer Application Layer WCB/McGraw-Hill  The McGraw-Hill Companies, Inc., 1998.
 Socket  The combination of an IP address and a port number. (RFC 793 original TCP specification)  The name of the Berkeley-derived application programming.
Jozef Goetz, Application Layer PART VI Jozef Goetz, Position of application layer The application layer enables the user, whether human.
Chapter 2 OSI Model and TCP/IP
McGraw-Hill©The McGraw-Hill Companies, Inc., 2000 Chapter 16 Socket Interface
Sockets API Overview Sockets with UDP Sockets with TCP Fast Sockets (Fast UDP) IP Multicasting.
 Wind River Systems, Inc Chapter - 13 Network Programming.
Dr. John P. Abraham Professor University of Texas Pan American Internet Applications and Network Programming.
McGraw-Hill©The McGraw-Hill Companies, Inc., 2000 Chapter 16 Socket Interface.
Inter-process communication: Socket. socket Internet socket From Wikipedia, the free encyclopedia Jump to: navigation,
Chapter 2 Applications and Layered Architectures Sockets.
The Socket Interface Chapter 22. Introduction This chapter reviews one example of an Application Program Interface (API) which is the interface between.
Remote Shell CS230 Project #4 Assigned : Due date :
Connectionless Sockets SWE 344 Internet Protocols & Client Server Programming.
1 COMP/ELEC 429/556 Introduction to Computer Networks Creating a Network Application Some slides used with permissions from Edward W. Knightly, T. S. Eugene.
Overview of TCP/IP protocols –Application layer (telnet, ssh, http, ftp, etc) The things that we use daily. –Transport layer (TCP, UDP) Allows processes.
CS 158A1 1.4 Implementing Network Software Phenomenal success of the Internet: – Computer # connected doubled every year since 1981, now approaching 200.
TELE202 Lecture 15 Socket programming 1 Lecturer Dr Z. Huang Overview ¥Last Lecture »TCP/UDP (2) »Source: chapter 17 ¥This Lecture »Socket programming.
Position of application layer. Application layer duties.
Introduction to Socket
Chapter 27 Socket API Interface The interface between an application program and the communication protocols in an operating system is known as the Application.
Client/Server Socket Programming Project
©The McGraw-Hill Companies, Inc., 2000© Adapted for use at JMU by Mohamed Aboutabl, 2003Mohamed Aboutabl1 1 Chapter 15 Application Layer and Client-Server.
Socket Programming.
Advanced UNIX programming Fall 2002, lecture 16 Instructor: Ashok Srinivasan Acknowledgements: The syllabus and power point presentations are modified.
S OCKET P ROGRAMMING IN C Professor: Dr. Shu-Ching Chen TA: HsinYu Ha.
Introduction to Sockets
Berkeley Socket Abstraction
1 Dimension of Server Designs r Iterative vs Concurrent r Connection-oriented vs. connectionless r Stateful and stateless m Constrained by application.
Netprog: Client/Server Issues1 Issues in Client/Server Programming Refs: Chapter 27.
McGraw-Hill Chapter 23 Process-to-Process Delivery: UDP, TCP Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Client-server communication Prof. Wenwen Li School of Geographical Sciences and Urban Planning 5644 Coor Hall
Socket Programming in C CS587x Lecture 3 Department of Computer Science Iowa State University.
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.
SOCKET PROGRAMMING Presented By : Divya Sharma.
Socket Programming original by Joonbok Lee KAIST heavily adapted by /Jens.
Introduction To Application Layer
Client-Server Model and Sockets
CHAPTER 8 ELEMENTARY UDP SOCKETS
Interacting With Protocol Software
Process-to-Process Delivery:
Chapter 16 Socket Interface.
PART VI Application Layer.
CSC Advanced Unix Programming, Fall 2015
An Introduction to Internetworking
Process-to-Process Delivery: UDP, TCP
Presentation transcript:

©The McGraw-Hill Companies, Inc., 2000© Adapted for use at JMU by Mohamed Aboutabl, 2003Mohamed Aboutabl1 1 Chapter 16 Socket Interface

©The McGraw-Hill Companies, Inc., 2000© Adapted for use at JMU by Mohamed Aboutabl, 2003Mohamed Aboutabl2 2 CONTENTS SOME DEFINITIONS SOCKETS BYTE ORDERING ADDRESS TRANSFORMATION BYTE MANIPULATION FUNCTIONS INFORMATION ABOUT REMOTE HOST SOCKET SYSTEM CALLS CONNECTIONLESS ITERATIVE SERVER

©The McGraw-Hill Companies, Inc., 2000© Adapted for use at JMU by Mohamed Aboutabl, 2003Mohamed Aboutabl3 3 CONTENTS (continued) UDP CLIENT-SERVER PROGRAMS CONNECTION-ORIENTED CONCURRENT SERVER TCP CLIENT-SERVER PROGRAMS

©The McGraw-Hill Companies, Inc., 2000© Adapted for use at JMU by Mohamed Aboutabl, 2003Mohamed Aboutabl4 4 SOME DEFINITIONS 16.1

©The McGraw-Hill Companies, Inc., 2000© Adapted for use at JMU by Mohamed Aboutabl, 2003Mohamed Aboutabl5 5 Figure 16-1 Data types

©The McGraw-Hill Companies, Inc., 2000© Adapted for use at JMU by Mohamed Aboutabl, 2003Mohamed Aboutabl6 6 Figure 16-2 Internet address structure

©The McGraw-Hill Companies, Inc., 2000© Adapted for use at JMU by Mohamed Aboutabl, 2003Mohamed Aboutabl7 7 SOCKETS 16.2

©The McGraw-Hill Companies, Inc., 2000© Adapted for use at JMU by Mohamed Aboutabl, 2003Mohamed Aboutabl8 8 Figure 16-3 Socket address

©The McGraw-Hill Companies, Inc., 2000© Adapted for use at JMU by Mohamed Aboutabl, 2003Mohamed Aboutabl9 9 Figure 16-4 Socket structure

©The McGraw-Hill Companies, Inc., 2000© Adapted for use at JMU by Mohamed Aboutabl, 2003Mohamed Aboutabl10 10 Figure 16-5 Socket types

©The McGraw-Hill Companies, Inc., 2000© Adapted for use at JMU by Mohamed Aboutabl, 2003Mohamed Aboutabl11 11 BYTE ORDERING 16.3

©The McGraw-Hill Companies, Inc., 2000© Adapted for use at JMU by Mohamed Aboutabl, 2003Mohamed Aboutabl12 12 Figure 16-6 Big-endian byte order

©The McGraw-Hill Companies, Inc., 2000© Adapted for use at JMU by Mohamed Aboutabl, 2003Mohamed Aboutabl13 13 Figure 16-7 Little-endian byte order

©The McGraw-Hill Companies, Inc., 2000© Adapted for use at JMU by Mohamed Aboutabl, 2003Mohamed Aboutabl14 14 The byte order for the TCP/IP protocol suite is big endian.

©The McGraw-Hill Companies, Inc., 2000© Adapted for use at JMU by Mohamed Aboutabl, 2003Mohamed Aboutabl15 15 Figure 16-8 Byte-order transformation

©The McGraw-Hill Companies, Inc., 2000© Adapted for use at JMU by Mohamed Aboutabl, 2003Mohamed Aboutabl16 16 Figure 16-9 Declarations for byte-order transformation

©The McGraw-Hill Companies, Inc., 2000© Adapted for use at JMU by Mohamed Aboutabl, 2003Mohamed Aboutabl17 17 ADDRESS TRANSFORMATION 16.4

©The McGraw-Hill Companies, Inc., 2000© Adapted for use at JMU by Mohamed Aboutabl, 2003Mohamed Aboutabl18 18 Figure Address transformation

©The McGraw-Hill Companies, Inc., 2000© Adapted for use at JMU by Mohamed Aboutabl, 2003Mohamed Aboutabl19 19 Figure Declarations for address transformation functions

©The McGraw-Hill Companies, Inc., 2000© Adapted for use at JMU by Mohamed Aboutabl, 2003Mohamed Aboutabl20 20 BYTE MANIPULATION FUNCTIONS 16.5

©The McGraw-Hill Companies, Inc., 2000© Adapted for use at JMU by Mohamed Aboutabl, 2003Mohamed Aboutabl21 21 Figure Declarations for byte-manipulation functions

©The McGraw-Hill Companies, Inc., 2000© Adapted for use at JMU by Mohamed Aboutabl, 2003Mohamed Aboutabl22 22 INFORMATION ABOUT REMOTE HOST 16.6

©The McGraw-Hill Companies, Inc., 2000© Adapted for use at JMU by Mohamed Aboutabl, 2003Mohamed Aboutabl23 23 Figure Hostent structure

©The McGraw-Hill Companies, Inc., 2000© Adapted for use at JMU by Mohamed Aboutabl, 2003Mohamed Aboutabl24 24 SOCKET SYSTEM CALLS 16.7

©The McGraw-Hill Companies, Inc., 2000© Adapted for use at JMU by Mohamed Aboutabl, 2003Mohamed Aboutabl25 25 Figure Declaration for socket function Create a blank socket.

©The McGraw-Hill Companies, Inc., 2000© Adapted for use at JMU by Mohamed Aboutabl, 2003Mohamed Aboutabl26 26 Figure Declaration for bind function Server Application binds a socket to a given socket address.

©The McGraw-Hill Companies, Inc., 2000© Adapted for use at JMU by Mohamed Aboutabl, 2003Mohamed Aboutabl27 27 Figure Declaration for connect function Client Application actively opens a connection with a remote server socket

©The McGraw-Hill Companies, Inc., 2000© Adapted for use at JMU by Mohamed Aboutabl, 2003Mohamed Aboutabl28 28 Figure Declaration for listen function Server Application is ready to receive connection requests

©The McGraw-Hill Companies, Inc., 2000© Adapted for use at JMU by Mohamed Aboutabl, 2003Mohamed Aboutabl29 29 Figure Declaration for accept function Server Application accepts the next connection request. A new “child” socket is created and initialized by the Operating System. Its socket descriptor is the “return value” If no requests pending, sleep.

©The McGraw-Hill Companies, Inc., 2000© Adapted for use at JMU by Mohamed Aboutabl, 2003Mohamed Aboutabl30 30 Figure Declaration for sendto function Application sends UDP data to a remote socket

©The McGraw-Hill Companies, Inc., 2000© Adapted for use at JMU by Mohamed Aboutabl, 2003Mohamed Aboutabl31 31 Figure Declaration for recvfrom function Get the next message arriving at a socket, as well as the socket address of the sender. Usually used by a UDP process

©The McGraw-Hill Companies, Inc., 2000© Adapted for use at JMU by Mohamed Aboutabl, 2003Mohamed Aboutabl32 32 Figure Declaration for read function Read the next message arriving at a specific Stream (i.e. TCP) socket. Assumes that the connection has already been opened.

©The McGraw-Hill Companies, Inc., 2000© Adapted for use at JMU by Mohamed Aboutabl, 2003Mohamed Aboutabl33 33 Figure Declaration for write function Send a message to a specific Stream (i.e. TCP) socket. Assumes that the connection has already been opened.

©The McGraw-Hill Companies, Inc., 2000© Adapted for use at JMU by Mohamed Aboutabl, 2003Mohamed Aboutabl34 34 Figure Declaration for close function Terminate the TCP connection

©The McGraw-Hill Companies, Inc., 2000© Adapted for use at JMU by Mohamed Aboutabl, 2003Mohamed Aboutabl35 35 CONNECTIONLESS ITERATIVE SERVER 16.8

©The McGraw-Hill Companies, Inc., 2000© Adapted for use at JMU by Mohamed Aboutabl, 2003Mohamed Aboutabl36 36 Socket interface for connectionless iterative server

©The McGraw-Hill Companies, Inc., 2000© Adapted for use at JMU by Mohamed Aboutabl, 2003Mohamed Aboutabl37 37 UDP CLIENT-SERVER PROGRAMS 16.9

©The McGraw-Hill Companies, Inc., 2000© Adapted for use at JMU by Mohamed Aboutabl, 2003Mohamed Aboutabl38 38 CONNECTION-ORIENTED CONCURRENT SERVER 16.10

©The McGraw-Hill Companies, Inc., 2000© Adapted for use at JMU by Mohamed Aboutabl, 2003Mohamed Aboutabl39 39 Figure Socket interface for connection-oriented concurrent server

©The McGraw-Hill Companies, Inc., 2000© Adapted for use at JMU by Mohamed Aboutabl, 2003Mohamed Aboutabl40 40 Figure (repeated), Part I

©The McGraw-Hill Companies, Inc., 2000© Adapted for use at JMU by Mohamed Aboutabl, 2003Mohamed Aboutabl41 41 Figure (repeated), Part II

©The McGraw-Hill Companies, Inc., 2000© Adapted for use at JMU by Mohamed Aboutabl, 2003Mohamed Aboutabl42 42 Figure 16-27, Part I Client and Server

©The McGraw-Hill Companies, Inc., 2000© Adapted for use at JMU by Mohamed Aboutabl, 2003Mohamed Aboutabl43 43 Figure 16-27, Part II