W4

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 16

CHAPTER 2| Application Layer

At End Systems
At the core of network application development is writing programs that run
on different end systems and communicate with each other over the network.
For example,
1. In the Web application there are two distinct programs that communicate
with each other:
- The browser program running in the user’s host (desktop, laptop,
tablet, smartphone, and so on);
- And the Web server program running in the Web server host.
2. As another example, in a Video on Demand application such as Netflix
////////////////////////////////////////////////////////////////////////////////
Note that, Servers often (but certainly not always) are housed in a data center.
Question: (True or False)
1. Network application development is writing programs that run on routers
and switches ( )
2. Servers often (but certainly not always) are housed in a data center ( )
3. The Web server program running in the Web server host ( )
4. Web applications run on routers. ( )
5. Web applications run on application layer of OSI model ( )

Question: (MCQ)
1. …….. Is/are examples of programs that run on different end systems (at
Application Layer).
a. Web application.
b. YouTube
c. Netflix
d. All of Them
2. Application layer offers _______ service.
a. End to end
b. Process to process
c. Both End to end and Process to process
d. None of the mentioned

**************************************************************

For network-core devices


- You do not need and you wouldn’t be able to write software that runs
on network-core devices, such as routers or link-layer switches.
 Network-core devices do not run user applications
 Applications on end systems allows for rapid app development,
propagation.

Question: (True or False)


1. Network-core devices do not run user applications. ( )
******************************************************************
Network Application Architectures
‫بناء التطبيقات على االنترنت له شكلين للبناء أو طريقتين للهيكلة‬

 Keep in mind that an application’s architecture is distinctly different from


the network architecture (e.g., the five-layer Internet architecture discussed
in Chapter 1).
 From the application developer’s perspective, the network architecture is
fixed and provides a specific set of services to applications.
 The application architecture is designed by the application developer and
dictates how the application is structured over the various end systems.

Network Architectures Application Architectures


Refers to the organization of the Designed by the application developer
communication process into layers (Five-
layer architecture)
Fixed and provides a specific set of Client-server or Peer-peer architecture
services to applications
Table 2.1
 There are two architectural paradigms used in modern network
applications:
1. The client-server architecture.
2. The peer-to-peer (P2P) architecture.

Client-server architecture Peer-to-peer (P2P) architecture


Client Server no always-on server
contact, There is an always- - Arbitrary end systems directly
communicate with on host, called the communicate.
server server - Peers request service from other peers,
may be - provide service in return to other peers.
intermittently • self-scalability – new peers bring
connected new service capacity, as well as
new service demands
May have dynamic Permanent (fixed) peers are intermittently connected and
IP addresses IP address change IP addresses
• complex management
do not communicate Peers (End Systems) can communicate
directly with each directly with each other
other
often in data self-scalability – new peers bring new
centers, for scaling service capacity, as well as new service
demands
Not Cost effective, since they normally Cost effective, since they normally don’t
require significant server infrastructure and require significant server infrastructure
server bandwidth. and server bandwidth.
Client-server applications security, P2P applications face challenges of
performance, and reliability are higher than security, performance, and reliability
P2P applications. due to their highly decentralized
structure.
examples: HTTP, IMAP, FTP, Telnet example: P2P file sharing
app Ex: Yahoo, Google, YouTube App Ex: Bit Torrent

 Def1. Server is device that services requests from many other hosts, called
clients.
 Def2. Client End system that communicate with server to request services.
 Def3. A data center, housing a large number of hosts, is often used to create a
powerful virtual server.
Note that,
1. Disadvantage of Client-server architecture: It is a single-server based
architecture which is incapable of holding all the requests from the clients.
For example, a social networking site can become overwhelmed when there
is only one server exists.
2. In Peer-to-peer (P2P) architecture each peer generates workload by
requesting files, each peer also adds service capacity to the system by
distributing files to other peers.

 Note That, The peers are not owned by the service provider, but are instead
desktops and laptops controlled by users, with most of the peers residing in
homes, universities, and offices
Question: (MCQ)
1. Which one of the following is an application architecture paradigms?
a. Peer to peer
b. Client-server
c. HTTP
d. Both Peer-to-Peer & Client-Server

1. The web application for which an always-on Web server services requests from
browsers running on client hosts is an example of ………….
a. Client-server architecture.
b. Peer-to-peer (P2P) architecture.
c. Hybrid architecture.
d. None of the Above.
2. Which of the following is not a feature of a Peer-to-peer (P2P) architecture?
a. self-scalability
b. Cost effective
c. Complex management
d. Do not communicate directly with each other
3. Which of the following is not a Client-server architecture protocol?
a. HTTP
b. SMTP
c. FTP
d. P2P file sharing
4. Which of the following is not a Peer-Peer application?
a. Bit Torrent
b. Yahoo,
c. Google,
d. YouTube
Question: (True or False)
1. In the Web application, two browsers can communicate directly. ( )
2. In the client-server architecture, the server has a fixed, well-known address. ( )
3. One of disadvantages of Client-server architecture is a single-server based
architecture which is incapable of holding all the requests from the clients. ( )
4. A data center, housing a large number of hosts, is often used to create a
powerful virtual server. ( )
5. Client is an always-on host. ( )
6. In Peer-to-peer (P2P) architecture no always-on server. ( )
7. In client-server architecture IP address of the server is always permanent. ( )
8. In client-server architecture IP address of the client is always permanent. ( )
9. In Peer-to-peer (P2P) architecture peers are intermittently connected and
change IP addresses. ( )
10.Client End system that communicate with server to request services. ( )
11.In Peer-to-peer (P2P) architecture Peers (End Systems) cannot communicate
directly with each other. ( )
12.In client-server architecture servers are often in data centers, for scaling. ( )
13.Client-server architecture servers is self-scalability. ( )
14.P2P applications face challenges of security, performance, and reliability due
to their highly decentralized structure. ( )
15.Client-server architecture is not Cost effective, since they normally require
significant server infrastructure and server bandwidth. ( )
16.Server is device that services requests from many other hosts, called clients. ( )
17.No difference between network architecture and application architecture. ( )
18.From the application developer’s perspective, the network architecture is fixed
and provides a specific set of services to applications. ( )
19.The peers are owned by the service provider. ( )
Question: (essay)
1. What is the difference between network architecture and application
architecture?(R2)
Ans: Table 2.1
2. List five nonproprietary Internet applications and the application-layer
protocols that they use.(R1)
Ans: The Web: HTTP; file transfer: FTP; remote login: Telnet; Network
News: NNTP; e-mail: SMTP.
******************************************************************

Processes Communicating
 Def1. Process is a program running within a host.
 Def2. client process: process that initiates communication
 Def3. server process: process that waits to be contacted
Note That,
1. Within same host, two processes communicate using inter-process
communication (defined by OS)

2. Processes in different hosts communicate by exchanging messages. (‫)هام جدا‬


- A sending process creates and sends messages into the network; a
receiving process receives these messages and possibly responds by
sending messages back.
For example, 1. in the Web application a client browser process
exchanges messages with a Web server process.
2. In a P2P file-sharing system, a file is transferred from a process in one
peer to a process in another peer. For each pair of communicating
processes, we typically label one of the two processes as the client and the
other process as the server.
3. Applications with P2P architectures have client processes & server processes.
4. Processes communicating with each other reside in the application layer of the
five-layer protocol stack.
5. In some applications, such as in P2P file sharing, a process can be both a
client and a server. Ex: a process in a P2P file-sharing system can both upload
and download files.
Question: (True and False)
1. In the context of a communication session between a pair of processes, the
process that initiates the communication is labeled as the server. ()
2. The process that waits to be contacted to begin the session is the client. ( )
3. A browser process initializes contact with a Web server process. ()
4. When Peer A asks Peer B to send a specific file, Peer A is the client and
Peer B is the server in the context of this specific communication session. ( )
5. Process is a program running within a router. ()
6. Server process is the process that initiates communication. ()
7. Client process is the process that waits to be contacted. ()
8. Process is a program running within a host. ()
9. Two processes within same host communicate using inter-process
communication (defined by OS). ()
10.Processes in different hosts communicate by exchanging messages ()
11.In some applications, such as in P2P file sharing, a process can be both a
client and a server. ()

Question: (essay)
1. For a communication session between a pair of processes, which process is the
client and which is the server?(R3)
Ans: The process which initiates the communication is the client; the
process that waits to be contacted is the server.
2. For a P2P file-sharing application, do you agree with the statement, “There is
no notion of client and server sides of a communication session”? Why or why
not?(R4)
Ans: No. As stated in the text, all communication sessions have a client side
and a server side. In a P2P file-sharing application, the peer that is
receiving a file is typically the client and the peer that is sending the file is
typically the server.

******************************************************************
The Interface between the Process and the Computer Network
 Def1. Socket is a software interface which a process sends messages into, and
receives messages from, the network through it.

.‫البراجراف التالي هو مجرد مثال توضيحي للفهم ليس أكثر‬

 /* A process is analogous to a house and its socket is analogous to its door.


1. When a process wants to send a message to another process on another host, it
shoves the message out its door (socket).
2. This sending process assumes that there is a transportation infrastructure on the
other side of its door that will transport the message to the door of the
destination process.
3. Once the message arrives at the destination host, the message passes through
the receiving process’s door (socket), and the receiving process then acts on the
message. */
Note That,
1. A socket is the interface between the application layer and the transport
layer within a host. It is also referred to as the Application Programming
Interface (API) between the application and the network, since the socket is
the programming interface with which network applications are built.

2. The application developer has control of everything on the application-


layer side of the socket but has little control of the transport-layer side
of the socket.
3. The only control that the application developer has on the transport layer
side is (1) the choice of transport protocol and (2) perhaps the ability to fix
a few transport-layer parameters such as maximum buffer and maximum
segment sizes (to be covered in Chapter 3).

4. Once the application developer chooses a transport protocol (if a choice is


available), the application is built using the transport-layer services
provided by that protocol.

Addressing processes
To identify the receiving process, two pieces of information need to be specified:
1. The address of the host and (the host is identified by its IP address)
Receiving host device has unique 32-bit IP address.

2. The destination port number, an identifier that specifies the receiving


process in the destination host. (Identifying the receiving process (more
specifically, the receiving socket) running in the host.
This information is needed because in general a host could be running many
network applications.

Note That,
1. Popular applications have been assigned specific port numbers. For
example, a Web server is identified by port number 80.
A mail server process (using the SMTP protocol) is identified by port
number 25.

2. A list of well-known port numbers for all Internet standard protocols can
be found at www.iana.org.

3. IP address and port numbers associated with process on host are called
process Identifier.
Question: (True or False)
1. IP address of host on which process runs suffice for identifying the process. ( )
2. Identifier includes both IP address and port numbers associated with process on
host. ( )
3. Receiving host device has unique 34-bit IP address ( )
4. IP address specifies the receiving process in the destination host ( )
5. IP address is needed because in general a host could be running many network
applications. ( )
6. Popular applications have been assigned specific port numbers. ( )
7. Private or user applications have been assigned specific port numbers also. ( )
8. Receiving host device has multiple 32-bit IP address. ( )
9. Socket is a software interface which a process sends messages into, and
receives messages from, the network through it. ( )
10.Socket is the interface between the application layer and the transport layer
within a host. ( )
11.The application developer has control of everything on the transport-layer side
of the socket but has little control of the application-layer side of the socket. ( )
12.Once the application developer chooses a transport protocol (if a choice is
available), the application is built using the transport-layer services provided by
that protocol. ( )

Question: (MCQ)
1. Process identifier includes ………….. associated with process on host.
a. IP address
b. Port number
c. both IP address and port numbers
d. None Of The Above

2. A Web server is identified by port number……..


a. 20
b. 21
c. 25
d. 80
3. A mail server process (using the SMTP protocol) is identified by port
number………
a. 20
b. 21
c. 25
d. 80

4. The only control that the application developer has on the transport layer
side is……….
a. The choice of transport protocol.
b. The ability to fix a few transport-layer parameters such as maximum
buffer and maximum segment sizes.
c. a and b.
d. None Of them

Question: (essay)
1. What information is used by a process running on one host to identify a
process running on another host?(R5)
Ans: The IP address of the destination host and the port number of the
destination socket.
******************************************************************

An application-layer protocol defines:


Transport services that an app need
‫ انواع الخدمات التي قد تحتاجها التطبيقات‬-
/***Many networks, including the Internet, provide more than one transport-layer
protocol. When you develop an application, you must choose one of the available
transport-layer protocols. How do you make this choice? Most likely, you would
study the services provided by the available transport-layer protocols, and
then pick the protocol with the services that best match your application’s
needs.***/

Services that a transport-layer protocol can offer to


applications:

1. Reliable Data Transfer (data integrity)


Protocol guarantee that the data sent by one end of the application is
delivered correctly and completely to the other end of the application.
Note,
a. When a transport protocol provides this service, the sending process can
just pass its data into the socket and know with complete confidence that
the data will arrive without errors at the receiving process.

b. When a transport-layer protocol doesn’t provide reliable data transfer,


some of the data sent by the sending process may never arrive at the
receiving process. This may be acceptable for loss-tolerant applications,
most notably multimedia applications such as conversational audio/video
that can tolerate some amount of data loss.

2. Throughput
- Applications that have throughput requirements are said to be bandwidth-
sensitive applications.
Note, (some apps (e.g., multimedia) require minimum amount of
throughput to be “effective)
- Elastic applications can make use of as much, or as little, throughput as
happens to be available. Electronic mail, file transfer, and Web transfers
are all elastic applications.
3. Timing
Some apps like interactive real-time applications, such as Internet telephony,
virtual environments, teleconferencing, and interactive games, require low
delay to be “effective”.
/***Long delays in Internet telephony, for example, tend to result in unnatural
pauses in the conversation; in a multiplayer game or virtual interactive
environment, a long delay between taking an action and seeing the response
from the environment (for example, from another player at the end of an end-
to-end connection) makes the application feel less realistic.***/
4. Security
- A transport protocol can provide an application with one or more security
services.
For example, in the sending host, a transport protocol can encrypt all data
transmitted by the sending process, and in the receiving host, the transport-
layer protocol can decrypt the data before delivering the data to the receiving
process.
- Such a service would provide confidentiality between the two processes.
Question: (True and False)
1. Multimedia applications need Reliable Data Transfer. ( )
2. Email applications need Reliable Data Transfer. ( )
3. Web applications do not need Reliable Data Transfer. ( )
4. Multimedia applications are bandwidth-sensitive applications. ( )
5. Interactive games do not need timing Services that a transport-layer protocol
can offer to. ( )
6. Email applications need timing Services that a transport-layer protocol can
offer to. ( )

Question: (MCQ)
1. All the following applications are throughput Elastic applications except……
a. Electronic mail,
b. file transfer,
c. Web transfers
d. Internet telephony

2. E-mail is _________
a. Loss-tolerant application
b. Bandwidth-sensitive application
c. Elastic application
d. None of the mentioned

3. To deliver a message to the correct application program running on a host, the


_______ address must be consulted.
a. IP
b. MAC
c. Port
d. None of the mentioned

4. Which is a time-sensitive service?


a. File transfer
b. File download
c. E-mail
d. Internet telephony
5. Transport services available to applications in one or another form _________
a. Reliable data transfer
b. Timing
c. Security
d. All of the mentioned

6. Electronic mail uses which Application layer protocol?


a. SMTP
b. HTTP
c. FTP
d. SIP

7. Application layer offers _______ service.


a. End to end
b. Process to process
c. Both End to end and Process to process
d. None of the mentioned

8. Application layer protocol defines ____________


a. types of messages exchanged
b. message format, syntax and semantics
c. rules for when and how processes send and respond to messages
d. all of the mentioned

True and false


1. In peer-to-peer architecture the peers communicate with passing through a
dedicated server. ( )
2. An example of a popular P2P application is the file-sharing application
BitTorrent. ( )
3. One of the most compelling features of P2P architectures is their self-scalability
( )

You might also like