SlideShare a Scribd company logo
COC3130: Computer
Networks
Ash Mohammad Abbas
Lecture 11
Chapter 2: Application Layer
Peer-to-Peer (P2P) Architecture
• In a P2P architecture, there is
minimal (or no) reliance on
dedicated servers in data centers.
• Instead the application exploits
direct communication between pairs
of intermittently connected hosts,
called peers.
• 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.
• Because the peers communicate
without passing through a dedicated
server, the architecture is called
peer-to-peer (P2P).
• Many of today’s most popular and
traffic-intensive applications are
based on P2P architectures.
• These applications include file
sharing (e.g., BitTorrent), peer-
assisted download acceleration (e.g.,
Xunlei), and Internet telephony and
video conference (e.g., Skype).
Application Layer 2-3
P2P architecture
• no always-on server
• arbitrary end systems directly
communicate
• peers request service from other
peers, provide service in return to
other peers
• self scalability – new peers bring
new service capacity, as well as new
service demands
• peers are intermittently connected
and change IP addresses
• complex management
peer-peer
Hybrid of Client-and-Server and P2P
• Some applications have hybrid
architectures, combining both
client-server and P2P elements.
• For example, for many instant
messaging applications, servers are
used to track the IP addresses of
users, but user-to-user messages
are sent directly between user
hosts (without passing through
intermediate servers).
• One of the most compelling
features of P2P architectures is
their self-scalability.
• For example, in a P2P file-sharing
application, although each peer generates
workload by requesting files, each peer
also adds service capacity to the system by
distributing files to other peers.
• P2P architectures are also cost effective,
since they normally don’t require
significant server infrastructure and server
bandwidth (in contrast with clients-server
designs with data centers).
• However, P2P applications face challenges
of security, performance, and reliability
due to their highly decentralized structure.
Process Communication
• Before building your network application,
you also need a basic understanding of
how the programs, running in multiple end
systems, communicate with each other.
• In the jargon of operating systems, it is not
actually programs but processes that
communicate.
• A process can be thought of as a program
that is running within an end system.
• When processes are running on the same
end system, they can communicate with
each other with inter-process
communication, using rules that are
governed by the end system’s operating
system.
• But in this course we are not particularly
interested in how processes in the same
host communicate, but instead in how
processes running on different hosts
(with potentially different operating
systems) communicate.
• Processes on two different end systems
communicate with each other by
exchanging messages across the
computer network.
• A sending process creates and sends
messages into the network; a receiving
process receives these messages and
possibly responds by sending messages
back.
Client and Server Processes
• A network application consists of
pairs of processes that send
messages to each other over a
network.
• For each pair of communicating
processes, we typically label one of
the two processes as the client and
the other process as the server.
• For example, in the Web application
a client browser process exchanges
messages with a Web server
process.
• With the Web, a browser is a client
process and a Web server is a server
process.
• In a P2P file-sharing system, a file is
transferred from a process in one
peer to a process in another peer.
• With P2P file sharing, the peer that is
downloading the file is labeled as the
client, and the peer that is uploading
the file is labeled as the server.
Client and Server Processes
• In some applications, such as in P2P
file sharing, a process can be both a
client and a server.
• Indeed, a process in a P2P file-sharing
system can both upload and
download files.
• Nevertheless, in the context of any
given communication session
between a pair of processes, we can
still label one process as the client
and the other process as the server.
• We define the client and server
processes as follows:
• In the context of a communication
session between a pair of processes,
the process that initiates the
communication (that is, initially
contacts the other process at the
beginning of the session) is labelled
as the client.
• The process that waits to be
contacted to begin the session is the
server.
Client and Server Processes
• In the Web, a browser process
initializes contact with a Web server
process; hence the browser process
is the client and the Web server
process is the server.
• In P2P file sharing, 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.
• When there’s no confusion, we’ll
sometimes also use the terminology
“client side and server side of an
application.”
Interface Between Process and Network
• Most of the applications consist of
pairs of communicating processes,
with the two processes in each pair
sending messages to each other.
• Any message sent from one process
to another must go through the
underlying network.
• A process sends messages into, and
receives messages from, the network
through a software interface called a
socket.
• A process is analogous to a house and
its socket is analogous to its door.
• When a process wants to send a
message to another process on
another host, it shoves the message
out its door (socket).
• 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.
• 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.
Application Layer 2-10
Sockets
• process sends/receives messages to/from its socket
• socket analogous to door
• sending process shoves message out door
• sending process relies on transport infrastructure on other side of door
to deliver message to socket at receiving process
Internet
controlled
by OS
controlled by
app developer
transport
application
physical
link
network
process
transport
application
physical
link
network
process
socket
Socket
• 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.
• 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.
• 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.
• 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
• In order for a process running
on one host to send packets to
a process running on another
host, the receiving process
needs to have an address.
• To identify the receiving
process, two pieces of
information need to be
specified: (1) the address of
the host, and (2) an identifier
that specifies the receiving
process in the destination host.
• In the Internet, the host is
identified by its IP address.
• In addition to knowing the address of the host
to which a message is destined, the sending
process must also identify 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.
• A destination port number serves this purpose.
• 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.

More Related Content

PPTX
COMPUTER NW2 (1).pptx
PPTX
VTU V SEM CNS Module 1 PPT 2018 Batch students
PPTX
Module 1 part 2.pptx with clear notes and explanation
PPT
Week3 applications
PPT
3rd edition chapter2
PPTX
application layer protocols
PPT
Lecture application layer
PDF
Computer Networks Module 1-part 1.pdf
COMPUTER NW2 (1).pptx
VTU V SEM CNS Module 1 PPT 2018 Batch students
Module 1 part 2.pptx with clear notes and explanation
Week3 applications
3rd edition chapter2
application layer protocols
Lecture application layer
Computer Networks Module 1-part 1.pdf

Similar to Types of connections -Peer to peer connection (20)

PPT
unit 3 new syllabus very imp DCN PPT.ppt
PPT
App layer
PPT
Chapter2 application
PPT
Materi Perkuliahan Jaringan Komputer Teknik Informatika Chapter 2
PPTX
applicationa wcRFAHEWTRSSFGCARESTSRD.pptx
PDF
Chapter2[one.]
PPT
Chapter 2
PDF
CS-324-6-3 (1).pdf
PDF
Presentation on Application layer_201.pdf
PDF
Lecture2
PDF
CS-324-6-3 (2).pdf
PDF
sockets SMTP Bmsce ppt information science and engineering
PDF
Application Layer Application Layer Application Layer
PDF
DrShivashankar_Computer Net_Module-3.pdf
PPT
Chapter_2 computer netwprks mod 2 enclosed
PDF
Chapter 25.pdfassssssssssssssvjvvdvdvvdv
PPT
Application Layer-Introduction - detail Things are included
PPT
Lecture-2012-2-Application Layer-Introduction.ppt
PPT
Chapter2 Application
PPTX
Inter process communication by Dr.C.R.Dhivyaa, Assistant Professor,Kongu Engi...
unit 3 new syllabus very imp DCN PPT.ppt
App layer
Chapter2 application
Materi Perkuliahan Jaringan Komputer Teknik Informatika Chapter 2
applicationa wcRFAHEWTRSSFGCARESTSRD.pptx
Chapter2[one.]
Chapter 2
CS-324-6-3 (1).pdf
Presentation on Application layer_201.pdf
Lecture2
CS-324-6-3 (2).pdf
sockets SMTP Bmsce ppt information science and engineering
Application Layer Application Layer Application Layer
DrShivashankar_Computer Net_Module-3.pdf
Chapter_2 computer netwprks mod 2 enclosed
Chapter 25.pdfassssssssssssssvjvvdvdvvdv
Application Layer-Introduction - detail Things are included
Lecture-2012-2-Application Layer-Introduction.ppt
Chapter2 Application
Inter process communication by Dr.C.R.Dhivyaa, Assistant Professor,Kongu Engi...
Ad

Recently uploaded (20)

PPTX
OOP with Java - Java Introduction (Basics)
PDF
Well-logging-methods_new................
PDF
R24 SURVEYING LAB MANUAL for civil enggi
PDF
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
PDF
Enhancing Cyber Defense Against Zero-Day Attacks using Ensemble Neural Networks
PDF
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
PDF
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
PPTX
Construction Project Organization Group 2.pptx
PPTX
Sustainable Sites - Green Building Construction
PDF
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf
PPTX
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
PPTX
UNIT 4 Total Quality Management .pptx
PPTX
CH1 Production IntroductoryConcepts.pptx
PPTX
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
PPTX
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
PPTX
web development for engineering and engineering
PDF
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
PPTX
additive manufacturing of ss316l using mig welding
PDF
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
PDF
Model Code of Practice - Construction Work - 21102022 .pdf
OOP with Java - Java Introduction (Basics)
Well-logging-methods_new................
R24 SURVEYING LAB MANUAL for civil enggi
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
Enhancing Cyber Defense Against Zero-Day Attacks using Ensemble Neural Networks
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
Construction Project Organization Group 2.pptx
Sustainable Sites - Green Building Construction
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
UNIT 4 Total Quality Management .pptx
CH1 Production IntroductoryConcepts.pptx
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
web development for engineering and engineering
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
additive manufacturing of ss316l using mig welding
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
Model Code of Practice - Construction Work - 21102022 .pdf
Ad

Types of connections -Peer to peer connection

  • 1. COC3130: Computer Networks Ash Mohammad Abbas Lecture 11 Chapter 2: Application Layer
  • 2. Peer-to-Peer (P2P) Architecture • In a P2P architecture, there is minimal (or no) reliance on dedicated servers in data centers. • Instead the application exploits direct communication between pairs of intermittently connected hosts, called peers. • 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. • Because the peers communicate without passing through a dedicated server, the architecture is called peer-to-peer (P2P). • Many of today’s most popular and traffic-intensive applications are based on P2P architectures. • These applications include file sharing (e.g., BitTorrent), peer- assisted download acceleration (e.g., Xunlei), and Internet telephony and video conference (e.g., Skype).
  • 3. Application Layer 2-3 P2P architecture • no always-on server • arbitrary end systems directly communicate • peers request service from other peers, provide service in return to other peers • self scalability – new peers bring new service capacity, as well as new service demands • peers are intermittently connected and change IP addresses • complex management peer-peer
  • 4. Hybrid of Client-and-Server and P2P • Some applications have hybrid architectures, combining both client-server and P2P elements. • For example, for many instant messaging applications, servers are used to track the IP addresses of users, but user-to-user messages are sent directly between user hosts (without passing through intermediate servers). • One of the most compelling features of P2P architectures is their self-scalability. • For example, in a P2P file-sharing application, although each peer generates workload by requesting files, each peer also adds service capacity to the system by distributing files to other peers. • P2P architectures are also cost effective, since they normally don’t require significant server infrastructure and server bandwidth (in contrast with clients-server designs with data centers). • However, P2P applications face challenges of security, performance, and reliability due to their highly decentralized structure.
  • 5. Process Communication • Before building your network application, you also need a basic understanding of how the programs, running in multiple end systems, communicate with each other. • In the jargon of operating systems, it is not actually programs but processes that communicate. • A process can be thought of as a program that is running within an end system. • When processes are running on the same end system, they can communicate with each other with inter-process communication, using rules that are governed by the end system’s operating system. • But in this course we are not particularly interested in how processes in the same host communicate, but instead in how processes running on different hosts (with potentially different operating systems) communicate. • Processes on two different end systems communicate with each other by exchanging messages across the computer network. • A sending process creates and sends messages into the network; a receiving process receives these messages and possibly responds by sending messages back.
  • 6. Client and Server Processes • A network application consists of pairs of processes that send messages to each other over a network. • For each pair of communicating processes, we typically label one of the two processes as the client and the other process as the server. • For example, in the Web application a client browser process exchanges messages with a Web server process. • With the Web, a browser is a client process and a Web server is a server process. • In a P2P file-sharing system, a file is transferred from a process in one peer to a process in another peer. • With P2P file sharing, the peer that is downloading the file is labeled as the client, and the peer that is uploading the file is labeled as the server.
  • 7. Client and Server Processes • In some applications, such as in P2P file sharing, a process can be both a client and a server. • Indeed, a process in a P2P file-sharing system can both upload and download files. • Nevertheless, in the context of any given communication session between a pair of processes, we can still label one process as the client and the other process as the server. • We define the client and server processes as follows: • In the context of a communication session between a pair of processes, the process that initiates the communication (that is, initially contacts the other process at the beginning of the session) is labelled as the client. • The process that waits to be contacted to begin the session is the server.
  • 8. Client and Server Processes • In the Web, a browser process initializes contact with a Web server process; hence the browser process is the client and the Web server process is the server. • In P2P file sharing, 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. • When there’s no confusion, we’ll sometimes also use the terminology “client side and server side of an application.”
  • 9. Interface Between Process and Network • Most of the applications consist of pairs of communicating processes, with the two processes in each pair sending messages to each other. • Any message sent from one process to another must go through the underlying network. • A process sends messages into, and receives messages from, the network through a software interface called a socket. • A process is analogous to a house and its socket is analogous to its door. • When a process wants to send a message to another process on another host, it shoves the message out its door (socket). • 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. • 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.
  • 10. Application Layer 2-10 Sockets • process sends/receives messages to/from its socket • socket analogous to door • sending process shoves message out door • sending process relies on transport infrastructure on other side of door to deliver message to socket at receiving process Internet controlled by OS controlled by app developer transport application physical link network process transport application physical link network process socket
  • 11. Socket • 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. • 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. • 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. • 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.
  • 12. Addressing Processes • In order for a process running on one host to send packets to a process running on another host, the receiving process needs to have an address. • To identify the receiving process, two pieces of information need to be specified: (1) the address of the host, and (2) an identifier that specifies the receiving process in the destination host. • In the Internet, the host is identified by its IP address. • In addition to knowing the address of the host to which a message is destined, the sending process must also identify 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. • A destination port number serves this purpose. • 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.