Chapter 14 Application Layer and Client-Server Model.

Slides:



Advertisements
Similar presentations
Socket Programming Application Programming Interface.
Advertisements

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.
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)
McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Application Layer PART VI.
TCP Socket Programming. r An abstract interface provided to the application programmer  File descriptor, allows apps to read/write to the network r Allows.
CS1652 September 13th, 2012 The slides are adapted from the publisher’s material All material copyright J.F Kurose and K.W. Ross, All Rights.
Fall 2000Datacom 11 Socket Programming Review Examples: Client and Server-Diagnostics UDP versus TCP Echo.
IT1352-NETWORK PROGRAMMING AND MANAGEMENT
9/12/2015B.R1 Socket Abstraction and Interprocess Communication B.Ramamurthy CSE421.
2: Application Layer 1 Chapter 2: Application layer r 2.1 Principles of network applications r 2.2 Web and HTTP r Internet gaming r 2.3 FTP r 2.4 Electronic.
The Application Layer Application Services (Telnet, FTP, , WWW) Reliable Stream Transport (TCP) Connectionless Packet Delivery Service (IP) Unreliable.
McGraw-Hill©The McGraw-Hill Companies, Inc., 2000 Chapter 16 Socket Interface
Lab #1: Network Programming using Sockets By J. H. Wang Nov. 28, 2011.
Slides for Chapter 4: Interprocess Communication From Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edition 4, © Addison-Wesley.
McGraw-Hill©The McGraw-Hill Companies, Inc., 2000 Chapter 16 Socket Interface.
Chapter 2 Applications and Layered Architectures Sockets.
Slides for Chapter 4: Interprocess Communication From Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edition 4, © Addison-Wesley.
Socket Programming Lec 2 Rishi Kant. Review of Socket programming Decide which type of socket – stream or datagram. Based on type create socket using.
CS 158A1 1.4 Implementing Network Software Phenomenal success of the Internet: – Computer # connected doubled every year since 1981, now approaching 200.
1 Computer Networks An Introduction to Computer Networks University of Tehran Dept. of EE and Computer Engineering By: Dr. Nasser Yazdani Lecture 3: Sockets.
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.
Sockets Socket = abstraction of the port concept: –Application programs request that the operating system create a socket when one is needed –O.S. returns.
Chapter 2 Applications and Layered Architectures Sockets.
2: Application Layer1 Chapter 2: Application layer r 2.1 Principles of network applications r 2.2 Web and HTTP r 2.3 FTP r 2.4 Electronic Mail  SMTP,
Programming with UDP – II Covered Subjects: Creating UDP sockets Client Server Sending data Receiving data Connected mode.
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.
S OCKET P ROGRAMMING IN C Professor: Dr. Shu-Ching Chen TA: Hsin-Yu Ha.
Review: – Why layer architecture? – peer entities – Protocol and service interface – Connection-oriented/connectionless service – Reliable/unreliable service.
Read() recv() connection establishment Server (connection-oriented protocol) blocks until connection from client Client socket() bind() listen() accept()
CSCI 330 UNIX and Network Programming Unit XIV: User Datagram Protocol.
©The McGraw-Hill Companies, Inc., 2000© Adapted for use at JMU by Mohamed Aboutabl, 2003Mohamed Aboutabl1 1 Chapter 16 Socket Interface.
Socket programming in C. Socket programming with TCP Client must contact server server process must first be running server must have created socket (door)
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.
1 Socket Interface. 2 Basic Sockets API Review Socket Library TCPUDP IP EthernetPPP ARP DHCP, Mail, WWW, TELNET, FTP... Network cardCom Layer 4 / Transport.
SOCKET PROGRAMMING Presented By : Divya Sharma.
Socket Abstraction and Interprocess Communication
Chapter 10 IPv4 and IPv6 Interoperability
CS 1652 Jack Lange University of Pittsburgh
Socket Programming in C
Review: TCP Client-Server Interaction
Interprocess Communication
CHAPTER 8 ELEMENTARY UDP SOCKETS
Transport layer API: Socket Programming
Socket Abstraction and Interprocess Communication
Berkeley API Socket Programming
Chapter 16 Socket Interface.
Berkeley API Socket Programming
Chapter 2: Application layer
Socket Abstraction and Interprocess Communication
Socket Abstraction and Inter-process Communication
Chapter 06. UDP Server/Client.
Socket Abstraction and Interprocess Communication
Interprocess Communication
Socket Abstraction and Interprocess Communication
Socket Abstraction and Interprocess Communication
Socket Abstraction and Interprocess Communication
Socket Abstraction and Inter-process Communication
Socket Abstraction and Inter-process Communication
Socket Programming Neil Tang 09/08/2008
Berkeley API Socket Programming
IPv4 and IPv6 Interoperability
Chapter 2: Application layer
Presentation transcript:

Chapter 14 Application Layer and Client-Server Model

Figure 14-1

Client-Server Model

Figure 14-3

Concurrencia  Type of Running in Clientes  Iteratively: one-by-one  Concurrently: at the same time  Concurrency in Services:  Conectionless Iterative Server: from the same cliente of from different clients (i.e. UDP)  Conection-Oriented Concurrent Server: serves many clients at the same time.

Conectionless Iterative Server

Conection-Oriented Concurrent Server

Procesos  Concepto  Identificación  Creación

Identificación

Figure 14-10

Creación

Figure 14-12

Figure 14-13

Figure 14-14

Figure 14-15

Figure 14-16

Chapter 24 Socket Interface

Socket Types

Conectionless Iterative Server

Conection-Oriented Concurren Server

Figure (repeated), Part I

Figure (repeated), Part II

Figure 24-27, Part I

Figure 24-27, Part II

Sockets used for datagrams ServerAddress and ClientAddress are socket addresses Sending a messageReceiving a message bind(s, ClientAddress) sendto(s, "message", ServerAddress) bind(s, ServerAddress) amount = recvfrom(s, buffer, from) s = socket(AF_INET, SOCK_DGRAM, 0)

Sockets used for streams Requesting a connectionListening and accepting a connection bind(s, ServerAddress); listen(s,5); sNew = accept(s, ClientAddress); n = read(sNew, buffer, amount) s = socket(AF_INET, SOCK_STREAM,0) connect(s, ServerAddress) write(s, "message", length) s = socket(AF_INET, SOCK_STREAM,0) ServerAddress and ClientAddress are socket addresses

#include #define MAXBUF 256 #define PORT 2000 void main(void) { char buf[MAXBUF]; int activeSocket; int remoteAddrLen; struct sockaddr_in remoteAddr; struct sockaddr_in localAddr; struct hostent *hptr;

activeSocket = socket(AF_INET, SOCK_DGRAM, 0); memset(&remoteAddr, 0,sizeof(remoteAddr)); remoteAddr.sin_family =AF_INET; remoteAddr.sin_port=htons(PORT); hptr=gethostbyname("a-domain-name"); memcpy((char*)&remoteAddr.sin_addr.s_addr,hptr->h_addr_list[0],hptr- >h_length); connect(activeSocket, &remoteAddr, sizeof(remoteAddr)); memset(buf, 0, MAXBUF); remoteAddrLen = sizeof(remoteAddr); while { sendto(activeSocket, buf, sizeof(buf), 0, &remoteAddr,sizeof(remoteAddr$ memset(buf, 0, sizof(buf)); recvfrom(activeSocket, buf, MAXBUF, 0, &remoteAddr,&remoteAddrLen); printf("%s\n", buf); memset(buf, 0, sizeof(buf)); }; close(activeSocket); }

Anexo

Socket System Calls

Figure 24-18

Figure 24-21

Data types

Internal Sockets Address Structure

Sockets Structure

Byte Ordering

Figure 24-8

Order Translation

Byte Manipulation functions

Information About Remote Host

Figure 24-14