Lect 3
Lect 3
Note
In virtually all cases, we are dealing with overlay networks:
data is routed over connections setup between the nodes
(via application level multicasting)
5
Structured P2P Systems
Basic idea
Organize the nodes in a structured overlay network such as
a logical ring and make specific nodes responsible for
services based only on their ID
Note
The system provides an operation
LOOKUP(key) that will efficiently
route the lookup request to the
associated node.
6
Structured P2P Systems
Other example
Organize nodes in a hypercube
7
Unstructured P2P Systems
Observation
Many unstructured P2P systems attempt to maintain a random overlay;
two nodes are linked with probability 𝑝.
Basic principles
Each node is required to contact a randomly selected other node:
• Let each peer maintain a partial view of the network, consisting of c
other nodes
• Each node P periodically selects a node Q from its partial view
• P and Q exchange information and exchange members from their
respective partial views
Note
It turns out that, depending on the exchange, randomness, but also
robustness can be maintained.
8
Unstructured P2P Systems
Observation Searching or Querying Information Strategies
We can no longer look up information deterministically; we
must resort to searching:
• Flooding: node 𝑢 sends a lookup query to all of its
neighbors. A neighbor responds, or forwards (floods) the
request. There are many variations:
– Limited flooding (maximal number of forwarding)
– Probabilistic flooding (flood only with a certain probability).
9
Hybrid P2P Systems
Superpeers (Edge Server Architecture)
Observation)
Sometimes it helps to select a few nodes to do specific work:
superpeer
Examples
• Peers maintaining an
index (for search)
12
Hybrid P2P Systems
Edge-server architecture
Essence
Systems deployed on the Internet where servers are placed at the edge of the
network: the boundary between enterprise networks and the actual Internet.
ISP
ISP
Core Internet
Edge server
Enterprise network
Skype’s principle operation: A wants to contact B
Lookup(F) Node 1
19
Review: Threads
Basic idea: we build virtual processors in software, on top of physical
processors:
20
Context Switching
Thread Usage in Nondistributed Systems
24
Process Vs Thread
Parameter Process Thread
Termination time The process takes more time to terminate. The thread takes less time to terminate.
Creation time It takes more time for creation. It takes less time for creation.
Communication between processes needs Communication between threads requires less time
Communication
more time compared to thread. compared to processes.
Context switching time It takes more time for context switching. It takes less time for context switching.
Sharing It does not share data Threads share data with each other.
25
Threads and Operating System
Threads and Operating System
Conclusion
28
Using Thread at the Server Side
Improve performance:
• Starting a thread is much cheaper than starting a new
process.
• Having a single-threaded server prohibits simply scaling
the server to a multiprocessor system.
• As with clients: hide network latency by reacting to the
next request while the previous one is being replied.
Better structure:
• Most servers have high I/O demands. Using simple, well-
understood blocking calls simplifies the overall structure.
• Multithreaded programs tend to be smaller and easier to
understand due to simplified flow of control.
30
Multithreaded Servers
31
So Far
• Peer to Peer System Architectures
• Thread Review
• Virtual Machine Review
• Clients
32
Virtualization
Observation:
Virtualization is becoming increasingly important:
• Hardware changes faster than software
• Ease of portability and code migration
• Isolation of failing or attacked components
33
VM Monitors on operating systems
Practice: We’re seeing VMMs run on top of existing
operating systems (e.g. VirtualBox, VMWare)
36
Clients: User Interfaces
Essence: A major part of client-side software is focused on
(graphical) user interfaces.
37
So Far
• Peer to Peer System Architectures
• Thread Review
• Virtual Machine Review
• Clients
39
Client-Side Software
Generally tailored for distribution transparency
• access transparency: client-side stubs for RPCs
• location/migration transparency: let client-side software
keep track of actual location
• replication transparency: multiple invocations handled
by client stub:
40
Conclusion
• Peer to Peer System Architectures
• Thread Review
• Virtual Machine Review
• Clients
41