SlideShare a Scribd company logo
©The McGraw-Hill Companies, Inc., 2000 © Adapted for use at JMU by Mohamed Aboutabl, 2003
1
1
Chapter 15
Application Layer
and
Client-Server Model
 CLIENT-SERVER MODEL
 CONCURRENCY
 PROCESSES
©The McGraw-Hill Companies, Inc., 2000 © Adapted for use at JMU by Mohamed Aboutabl, 2003
2
2
Comparison between OSI and TCP/IP
©The McGraw-Hill Companies, Inc., 2000 © Adapted for use at JMU by Mohamed Aboutabl, 2003
3
3
15.1 Client-server model
 To make any use of the Internet, application programs should run on
the two endpoints of a network connection.
 The applications are the entities that communicate with each other
to exchange services
 “Client” applications request service
 “Server” applications provide service.
©The McGraw-Hill Companies, Inc., 2000 © Adapted for use at JMU by Mohamed Aboutabl, 2003
4
4
Client-Server Relationship: Many-to-One
 Servers
 Run all the time (i.e. infinite)
 Provide service to any client
 Typically specialize in providing
a certain type of service, e.g.
Mail.
 Listen to a well-known port and
passively open connection.
 Clients
 Run when needed, then
terminate (i.e. finite)
 Actively Open TCP or UDP
connection with Server’s socket.
©The McGraw-Hill Companies, Inc., 2000 © Adapted for use at JMU by Mohamed Aboutabl, 2003
5
5
15.1 Concurrency
 Operation mode could be either iterative or concurrent.
 In clients:
 Iterative mode: One client at-a-time in serial
 Concurrent mode: Several clients run at the same time
 In servers:
 Iterative mode: serve one client at-a-time (clients wait in a queue)
 Concurrent mode: serve multiple clients concurrently and
independently.
 In addition, servers could chose the Transport layer protocol:
 UDP, i.e. connectionless
 TCP, i.e. connection-oriented
©The McGraw-Hill Companies, Inc., 2000 © Adapted for use at JMU by Mohamed Aboutabl, 2003
6
6
Server types
Transport Protocol  Operation Mode
©The McGraw-Hill Companies, Inc., 2000 © Adapted for use at JMU by Mohamed Aboutabl, 2003
7
7
Connectionless iterative server
 Clients’ request arrive inside
UDP datagrams and wait in a
queue for the server
 Server processes one
datagram at-a-time, send
response back to client inside
a UDP datagram
 Clients use ephemeral UDP
ports
 Server uses one well-known
UDP port at which all clients’
requests arrive
©The McGraw-Hill Companies, Inc., 2000 © Adapted for use at JMU by Mohamed Aboutabl, 2003
8
8
Connection-Oriented Concurrent Server
 Requests and responses are streams of data
spanning several segments.
 Parent Server passively opens the well-know
port to listen for incoming connection requests
 Once opened, connections now use ephemeral
ports between one client and one Child Server.
©The McGraw-Hill Companies, Inc., 2000 © Adapted for use at JMU by Mohamed Aboutabl, 2003
9
9
15.3 Programs and Processes
 Program: code on disk
 Process: a running instance of a
program.
 Process Control Block:
 ProcessID, UserID, Program
Name.
 Where is the data
 Which line will execute next
 Figure shows two processes of
the same program.
©The McGraw-Hill Companies, Inc., 2000 © Adapted for use at JMU by Mohamed Aboutabl, 2003
10
10
The Process ID & getpid()
©The McGraw-Hill Companies, Inc., 2000 © Adapted for use at JMU by Mohamed Aboutabl, 2003
11
11
Process Creation & fork()
 By Replication
 One-Parent
needed
 After the fork(),
both parent and
child processes
execute the same
line, the one after
the fork()
©The McGraw-Hill Companies, Inc., 2000 © Adapted for use at JMU by Mohamed Aboutabl, 2003
12
12
A program with two fork functions
©The McGraw-Hill Companies, Inc., 2000 © Adapted for use at JMU by Mohamed Aboutabl, 2003
13
13
Return Value of fork()
 In the parent process, fork() returns the processID of the just created
child
 In the child process, fork() simply returns a 0 (which is not a valid
processID)
 This way, each of the two identical replica can detect whether it is
indeed the original parent, or it is the newly created process.
©The McGraw-Hill Companies, Inc., 2000 © Adapted for use at JMU by Mohamed Aboutabl, 2003
14
14
A program that prints the processIDs of the parent and the
child
©The McGraw-Hill Companies, Inc., 2000 © Adapted for use at JMU by Mohamed Aboutabl, 2003
15
15
Example of a server program with parent and child processes
 Parent Server listens indefinitely
(to the well-know port) for
connection requests from clients
 Once a client requests a
connection, a child server process
is created to serve this client (on
an ephemeral port)
 The parent server continues to
listen for more clients

More Related Content

PPT
slide24.ppt ,this my interface for my regular
PPT
unit 3 new syllabus very imp DCN PPT.ppt
PPTX
Introduction to socket programming nbv
PDF
sockets SMTP Bmsce ppt information science and engineering
PDF
CS6551 COMPUTER NETWORKS
PPT
Server and its both type concurrent and iterattive.ppt
DOCX
Internet
PPTX
COMPLEXITY CHAPTER 4 LECTURE FOR FOURTH YEAR .pptx
slide24.ppt ,this my interface for my regular
unit 3 new syllabus very imp DCN PPT.ppt
Introduction to socket programming nbv
sockets SMTP Bmsce ppt information science and engineering
CS6551 COMPUTER NETWORKS
Server and its both type concurrent and iterattive.ppt
Internet
COMPLEXITY CHAPTER 4 LECTURE FOR FOURTH YEAR .pptx

Similar to Lecture 20- Client-Server Model.ppt (20)

PPTX
Chap-3- Process.pptx distributive system
PPTX
applicationa wcRFAHEWTRSSFGCARESTSRD.pptx
PDF
Inter-Process Communication in distributed systems
DOCX
Final networks lab manual
PDF
Lecture2
PPT
Client server
DOCX
Application programming interface sockets
PDF
PDF
Distributed systems short notes module 1
PDF
+ Network Programming.pdf
PDF
DISTRIBUTED SYSTEM CHAPTER THREE UP TO FIVE.pdf
PPTX
Chapter 3-Processes2.pptx
PPT
03 sockets
PPT
IPChhshjdhakjdhiwjsjbdjsndbosoahdiqisj.ppt
PPTX
Processbejdndnnnnnjsnsgsvvdvvvguigv.pptx
PPTX
Processprehsjsjsjskakwkwkejjdbdbdjj.pptx
PPT
2.communcation in distributed system
PPTX
Network Programming-Python-13-8-2023.pptx
PPT
Chapter 3-Processes.ppt
PPT
lecture03 on socket programming000000.ppt
Chap-3- Process.pptx distributive system
applicationa wcRFAHEWTRSSFGCARESTSRD.pptx
Inter-Process Communication in distributed systems
Final networks lab manual
Lecture2
Client server
Application programming interface sockets
Distributed systems short notes module 1
+ Network Programming.pdf
DISTRIBUTED SYSTEM CHAPTER THREE UP TO FIVE.pdf
Chapter 3-Processes2.pptx
03 sockets
IPChhshjdhakjdhiwjsjbdjsndbosoahdiqisj.ppt
Processbejdndnnnnnjsnsgsvvdvvvguigv.pptx
Processprehsjsjsjskakwkwkejjdbdbdjj.pptx
2.communcation in distributed system
Network Programming-Python-13-8-2023.pptx
Chapter 3-Processes.ppt
lecture03 on socket programming000000.ppt
Ad

Recently uploaded (20)

PDF
Sports Quiz easy sports quiz sports quiz
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PPTX
Institutional Correction lecture only . . .
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PPTX
GDM (1) (1).pptx small presentation for students
PDF
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PDF
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PPTX
Cell Types and Its function , kingdom of life
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PPTX
Pharma ospi slides which help in ospi learning
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
Sports Quiz easy sports quiz sports quiz
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
Pharmacology of Heart Failure /Pharmacotherapy of CHF
Institutional Correction lecture only . . .
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
GDM (1) (1).pptx small presentation for students
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
102 student loan defaulters named and shamed – Is someone you know on the list?
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
Final Presentation General Medicine 03-08-2024.pptx
Supply Chain Operations Speaking Notes -ICLT Program
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
O5-L3 Freight Transport Ops (International) V1.pdf
Cell Types and Its function , kingdom of life
STATICS OF THE RIGID BODIES Hibbelers.pdf
Microbial diseases, their pathogenesis and prophylaxis
2.FourierTransform-ShortQuestionswithAnswers.pdf
Pharma ospi slides which help in ospi learning
FourierSeries-QuestionsWithAnswers(Part-A).pdf
Ad

Lecture 20- Client-Server Model.ppt

  • 1. ©The McGraw-Hill Companies, Inc., 2000 © Adapted for use at JMU by Mohamed Aboutabl, 2003 1 1 Chapter 15 Application Layer and Client-Server Model  CLIENT-SERVER MODEL  CONCURRENCY  PROCESSES
  • 2. ©The McGraw-Hill Companies, Inc., 2000 © Adapted for use at JMU by Mohamed Aboutabl, 2003 2 2 Comparison between OSI and TCP/IP
  • 3. ©The McGraw-Hill Companies, Inc., 2000 © Adapted for use at JMU by Mohamed Aboutabl, 2003 3 3 15.1 Client-server model  To make any use of the Internet, application programs should run on the two endpoints of a network connection.  The applications are the entities that communicate with each other to exchange services  “Client” applications request service  “Server” applications provide service.
  • 4. ©The McGraw-Hill Companies, Inc., 2000 © Adapted for use at JMU by Mohamed Aboutabl, 2003 4 4 Client-Server Relationship: Many-to-One  Servers  Run all the time (i.e. infinite)  Provide service to any client  Typically specialize in providing a certain type of service, e.g. Mail.  Listen to a well-known port and passively open connection.  Clients  Run when needed, then terminate (i.e. finite)  Actively Open TCP or UDP connection with Server’s socket.
  • 5. ©The McGraw-Hill Companies, Inc., 2000 © Adapted for use at JMU by Mohamed Aboutabl, 2003 5 5 15.1 Concurrency  Operation mode could be either iterative or concurrent.  In clients:  Iterative mode: One client at-a-time in serial  Concurrent mode: Several clients run at the same time  In servers:  Iterative mode: serve one client at-a-time (clients wait in a queue)  Concurrent mode: serve multiple clients concurrently and independently.  In addition, servers could chose the Transport layer protocol:  UDP, i.e. connectionless  TCP, i.e. connection-oriented
  • 6. ©The McGraw-Hill Companies, Inc., 2000 © Adapted for use at JMU by Mohamed Aboutabl, 2003 6 6 Server types Transport Protocol  Operation Mode
  • 7. ©The McGraw-Hill Companies, Inc., 2000 © Adapted for use at JMU by Mohamed Aboutabl, 2003 7 7 Connectionless iterative server  Clients’ request arrive inside UDP datagrams and wait in a queue for the server  Server processes one datagram at-a-time, send response back to client inside a UDP datagram  Clients use ephemeral UDP ports  Server uses one well-known UDP port at which all clients’ requests arrive
  • 8. ©The McGraw-Hill Companies, Inc., 2000 © Adapted for use at JMU by Mohamed Aboutabl, 2003 8 8 Connection-Oriented Concurrent Server  Requests and responses are streams of data spanning several segments.  Parent Server passively opens the well-know port to listen for incoming connection requests  Once opened, connections now use ephemeral ports between one client and one Child Server.
  • 9. ©The McGraw-Hill Companies, Inc., 2000 © Adapted for use at JMU by Mohamed Aboutabl, 2003 9 9 15.3 Programs and Processes  Program: code on disk  Process: a running instance of a program.  Process Control Block:  ProcessID, UserID, Program Name.  Where is the data  Which line will execute next  Figure shows two processes of the same program.
  • 10. ©The McGraw-Hill Companies, Inc., 2000 © Adapted for use at JMU by Mohamed Aboutabl, 2003 10 10 The Process ID & getpid()
  • 11. ©The McGraw-Hill Companies, Inc., 2000 © Adapted for use at JMU by Mohamed Aboutabl, 2003 11 11 Process Creation & fork()  By Replication  One-Parent needed  After the fork(), both parent and child processes execute the same line, the one after the fork()
  • 12. ©The McGraw-Hill Companies, Inc., 2000 © Adapted for use at JMU by Mohamed Aboutabl, 2003 12 12 A program with two fork functions
  • 13. ©The McGraw-Hill Companies, Inc., 2000 © Adapted for use at JMU by Mohamed Aboutabl, 2003 13 13 Return Value of fork()  In the parent process, fork() returns the processID of the just created child  In the child process, fork() simply returns a 0 (which is not a valid processID)  This way, each of the two identical replica can detect whether it is indeed the original parent, or it is the newly created process.
  • 14. ©The McGraw-Hill Companies, Inc., 2000 © Adapted for use at JMU by Mohamed Aboutabl, 2003 14 14 A program that prints the processIDs of the parent and the child
  • 15. ©The McGraw-Hill Companies, Inc., 2000 © Adapted for use at JMU by Mohamed Aboutabl, 2003 15 15 Example of a server program with parent and child processes  Parent Server listens indefinitely (to the well-know port) for connection requests from clients  Once a client requests a connection, a child server process is created to serve this client (on an ephemeral port)  The parent server continues to listen for more clients