You are on page 1of 22

Computer Networks

Lecturer: Dr. Makarem Bamatraf


Application Layer

2
Application Layer
– The application layer is the 5th layer in TCP/IP.

– The application layer provides services to the users.

– Application layer protocols are two types:


• Standard Protocols.
• Nonstandard Protocols.

– Each standard or non-standard protocol is a pair of


programs that interact with the user and the transport
layer to provide a service to the user.

3
Standard Protocols
– Standard Application-Layer
Protocols
• are protocols standardized and
documented by the Internet authority.

• Internet authority such as IANA.

• IANA is owned by ICANN.

4
Nonstandard Protocols
– Nonstandard Protocols are programs written
by a programmer to provide a service to the
user.

– What needed to write programs, is one of the


computer languages, that use the services of
the transport-layer protocols (TCP or UDP).

5
Application Layer Protocols
Paradigm
The paradigms of the application layer
protocols:

– Client-server paradigm.
– Peer-to-peer paradigm.
– Mixed Paradigm

6
Client-server paradigm
– It is the traditional paradigm.

– In this paradigm:
• the Server is an application program that provides
a service.
• the server runs continuously and waiting for
another application program, called the client
process,
• the client makes a connection through the Internet
and asks for a service.

7
8
A Problem of Client/Server
paradigm
– The concentration of the communication load
is on the shoulder of the server.
• which means the server should be a powerful
computer.

– This problem could be solved by:


• making a cluster of physical servers run as one
virtual server.

9
Peer-to-peer paradigm
– A new paradigm, called the peer-to-peer
paradigm.

– Often abbreviated P2P paradigm.

– In this paradigm:
• there is no need for a server to be running all the
time.
• The responsibility is shared between peers.

10
11
Peer-to-peer paradigm (cont.)
– The peer-to-peer paradigm can be used when some
computers connected to the Internet have something
to share with each other.

– Examples:
• BitTorrent, Skype, IPTV, and Internet telephony, that use this
paradigm.

– Advantages of P2P:
• the peer-to-peer paradigm has been proved to be easily
scalable.

• P2P cost-effective in eliminating the need for expensive


servers to be running and maintained all the time.

12
The main challenge of P2P
– Security:
• it is more difficult to create secure communication
between distributed services than between those
controlled by some dedicated servers.

– Applicability:
• not all applications can use this new paradigm.
• that is; not many Internet users are like to become
involved in this paradigm.

13
Mixed Paradigm
– Some applications use a mixture of the two
paradigms.

– For example:
• A light-load client-server communication can be
used to find the address of the peer that can offer a
service.
• When the address of the peer is found, the actual
service can be received from the peer by using the
peer-to-peer paradigm.

14
Client-Server Programming
– A client sends a request.

– A server waits for a request from a client.

– The server:
• handles the request.
• Prepares a result.
• Sends the result back to the client.

15
Application Programming Interface
– We need a 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.

– These set of instructions are called: an


application programming interface (API).

16
Application Programming Interface
– Several APIs have been designed for
communication.

– Three among them are common:


• Socket interface.
• Transport Layer Interface (TLI).
• STREAM.

17
Socket Interface
– The socket interface is:
• a set of instructions that provide communication
between the application layer and the operating
system.

– Socket interface started in the early 1980s at


UC Berkeley as part of a UNIX environment.

18
Socket Interface

19
Sockets
– The idea of sockets allows us to use the set of
all instructions already designed in a
programming language for communication.

20
Socket Addresses
– An application program can be defined by a
port number, a 16-bit integer.

– This means that a socket address should be a


combination of an IP address and a port.

21
Discussion

22

You might also like