0% found this document useful (0 votes)
46 views

Chapter 25 Introduction To Application Layer

Data communication chapter 25 , Important Notes

Uploaded by

Avijit Roy
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
46 views

Chapter 25 Introduction To Application Layer

Data communication chapter 25 , Important Notes

Uploaded by

Avijit Roy
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 21

Chapter 25

Introduction to Application Layer

Faisal M. Uddin Independent University Bangladesh (IUB)


Data Communication and Computer Networks : CSE 316
25-1 INTRODUCTION

The application layer provides services


to the user. Communication is provided
using a logical connection, which means
that the two application layers assume
that there is an imaginary direct
connection through which they can send
and receive messages. Figure 25.1
shows the idea behind this logical
connection.
Figure 25.1: Logical connection at the application layer
25.25.1 Providing Services

All communication networks that started before the


Internet were designed to provide services to network
users. Most of these networks, however, were
originally designed to provide one specific service.
For example, the telephone network was originally
designed to provide voice service: to allow people all
over the world to talk to each other. This network,
however, was later used for some other services,
such as facsimile (fax), enabled by users adding
some extra hardware at both ends.
25.25.2 Application-Layer Paradigms

It should be clear that to use the Internet we need


two application programs to interact with each
other: one running on a computer somewhere in the
world, the other running on another computer
somewhere else in the world. The two programs
need to send messages to each other through the
Internet infrastructure. However, we have not
discussed what the relationship should be between
these programs. Two paradigms have been
developed : the client-server paradigm and the peer-
to-peer paradigm. We briefly introduce these two
paradigms here.
Figure 25.2: Example of a client-server paradigm
Figure 25.3: Example of a peer-to-peer paradigm
25-2 CLIENT-SERVER PROGRAMMING

In this paradigm, communication at the


application layer is between two running
application programs called processes: a
client and a server. A client is a running
program that initializes the communication
by sending a request; a server is another
application program that waits for a
request from a client.
25.2.1 API

How can a client process communicate with a server


process? A computer program is normally written in
a computer language with a predefined set of
instructions that tells the computer what to do. If we
need a process to be able to communicate with
another process, we need a new set of instructions to
tell the lowest four layers of the TCP/IP suite to
open the connection, send and receive data from the
other end, and close the connection. A set of
instructions of this kind is normally referred to as an
application programming interface (API).
Figure 25.4: Position of the socket interface
Figure : A Sockets used like other sources and sinks
Figure : Use of sockets in process-to-process communication
Figure : A socket address
25.2.2 Using Transport Layer

A pair of processes provide services to the users of


the Internet, human or programs. A pair of
processes, however, need to use the services provided
by the transport layer for communication because
there is no physical communication at the
application layer. As we discussed in Chapters 23
and 24, there are three common transport-layer
protocols in the TCP/IP suite: UDP, TCP, and SCTP.
Most standard applications have been designed to
use the services of one of these protocols.
25.2.3 Iterative Using UDP

An iterative server can process one client request at


a time; it receives a request, processes it, and sends
the response to the requestor before handling
another request. When the server is handling the
request from a client, the requests from other clients,
and even other requests from the same client, need
to be queued at the server site and wait for the server
to be freed. The received and queued requests are
handled in the first-in, first-out fashion. In this
section, we discuss iterative communication using
UDP.
Figure : Sockets for UDP communication
Figure : Flow diagram for iterative UDP communication
25.2.4 Iterative Using TCP

Although iterative communication using TCP is not


very common, because it is simpler we discuss this
type of communication in this section.
Figure : Sockets used in TCP communication

2
Create

5
Create
Figure : Flow diagram for iterative TCP communication
25.2.5 Concurrent Communication

A concurrent server can process several client


requests at the same time. This can be done using
the available provisions in the underlying
programming language. In C, a server can create
several child processes, in which a child can handle
a client. In Java, threading allows several clients to
be handled by each thread. We do not discuss
concurrent server communication in this chapter,
but we briefly discuss it in the book website in the
Extra Material section.

You might also like