Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
61 views18 pages

Unit 1

This document discusses several examples of distributed systems including web search engines, massively multiplayer online games, and financial trading systems. It explains how they work at a high level and why distributed systems are important as they allow processing large amounts of data and connecting many users seamlessly.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
61 views18 pages

Unit 1

This document discusses several examples of distributed systems including web search engines, massively multiplayer online games, and financial trading systems. It explains how they work at a high level and why distributed systems are important as they allow processing large amounts of data and connecting many users seamlessly.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 18

Sure, let's break down these examples of distributed systems into simpler terms:

### Web Search

**Example:** Google Search

**What it is:** A web search engine like Google indexes (catalogs) all the information on the
Internet, including web pages, images, and videos, so you can find what you're looking for by typing
keywords.

**How it works:**

1. **Infrastructure:** Google uses a huge number of computers around the world, all connected
together.

2. **File System:** They have a special system to store and quickly read massive amounts of data.

3. **Data Access:** They need to access large datasets very quickly.

4. **Lock Service:** This helps manage tasks like making sure no two computers are trying to update
the same data at the same time.

5. **Programming Model:** They use a special way of writing programs that can run many tasks in
parallel across all these computers.

### Massively Multiplayer Online Games (MMOGs)

**Example:** EVE Online

**What it is:** These are games where thousands of players interact with each other in a persistent
virtual world over the internet.

**How it works:**

1. **Client-Server Model:** EVE Online uses a centralized server where the game's world is stored
and maintained. Players connect to this server from their devices.

2. **Cluster Architecture:** The server itself is not just one computer but a group of connected
computers (a cluster) to handle the large number of players.

3. **Load Partitioning:** The game's world is divided into different sections (like star systems in EVE
Online), and different computers handle different sections.

4. **Optimized Communication:** The game ensures that messages between players and the server
are fast and efficient to keep the game responsive.
**Other Models:**

1. **Distributed Servers:** Some games use multiple servers located in different places. Players are
connected to the nearest or least busy server to ensure a good experience.

2. **Peer-to-Peer:** Researchers are exploring systems where players' devices connect directly to
each other, sharing the load of running the game.

### Financial Trading

**Example:** Automated Trading Systems

**What it is:** These systems manage and execute trades in financial markets automatically, based
on real-time data.

**How it works:**

1. **Event Feeds:** Financial trading systems receive real-time data (events) like stock prices,
economic news, etc.

2. **Adapters:** These systems convert different formats of incoming data into a common format
that the system can process.

3. **Complex Event Processing (CEP):** The system analyzes these data streams to detect patterns
that might indicate a good trading opportunity.

4. **Automated Responses:** Based on detected patterns, the system can automatically place and
manage buy or sell orders, often faster than human traders could.

### Why These Systems Are Important:

Distributed systems like these are crucial because they allow for the management and processing of
enormous amounts of data, provide real-time responses, and connect millions of users or devices
seamlessly. Understanding the technology behind these systems is essential for modern computing,
as it underpins many services and applications we use daily.
2. Resource Sharing
### What is Resource Sharing in Distributed Systems?

**Resource sharing** in distributed systems means using shared resources like hardware, data, and
services across multiple users and devices over a network. Here’s a simple breakdown:

1. **Hardware Resources:**

- **Example:** Printers and disks.

- **Why:** To reduce costs by sharing one printer or disk among many users instead of everyone
having their own.

2. **Data Resources:**

- **Example:** Shared files or databases.

- **Why:** So users can collaborate and access the same information without needing multiple
copies.

3. **Service Resources:**

- **Example:** Search engines or currency converters.

- **Why:** Users access these services to perform tasks like searching the web or converting
currencies without worrying about the underlying servers.

### How Resource Sharing Works:

1. **Service Concept:**

- A **service** is a part of a computer system that manages resources and provides functionalities
(e.g., file service, printing service).

- Users interact with these services via defined operations like reading or writing a file.

2. **Client-Server Model:**

- **Server:** A running program on a networked computer that provides a service.

- **Client:** A program that requests a service from a server.

- **Interaction:** The client sends a request to the server, and the server responds, known as a
**remote invocation**.
3. **Communication:**

- Resources are encapsulated within computers and accessed via communication interfaces.

- This ensures resources are accessed and updated reliably and consistently.

### Everyday Examples:

1. **Web Browsing:**

- A web browser (client) requests web pages from a web server.

2. **Email:**

- An email client (like Outlook) requests and sends emails through an email server.

3. **Networked Printers:**

- A user sends a document to a shared printer on the network.

### Key Points:

- Users often think about what they can do (e.g., print a document, search the web) rather than the
technical details of how it works.

- The terms "client" and "server" describe roles in a communication process, not just the computers.

- Services restrict access to resources to ensure consistent and reliable operations.

In summary, resource sharing in distributed systems allows multiple users to access and use
resources efficiently, regardless of where those resources are physically located.
3. Challenges of DS
Distributed systems, which are networks of computers that work together to achieve a common goal,
face several key challenges. Let's break these down into simpler terms:

### 1. Heterogeneity

Heterogeneity refers to the variety and differences in distributed systems. These systems are
composed of different types of networks, computer hardware, operating systems, programming
languages, and implementations by various developers. For these diverse components to work
together, they need to communicate using common standards and protocols, like the Internet
protocols. Middleware, a software layer, helps mask these differences and allows for smooth
interaction between components.

### 2. Openness

Openness in distributed systems means that new services can be easily added and existing ones can
be modified. This is achieved by publishing the specifications and documentation of key software
interfaces. Open systems allow for easy integration of new hardware and software components from
different vendors, ensuring flexibility and extensibility.

### 3. Security

Security is crucial in distributed systems as they handle valuable information. It has three main
components:

- **Confidentiality:** Protecting information from unauthorized access.

- **Integrity:** Ensuring that data is not altered or corrupted.

- **Availability:** Making sure that the system and data are accessible when needed.

Challenges include securely transmitting sensitive information, verifying the identity of users, and
protecting against attacks like denial of service (bombarding a service with fake requests to disrupt it)
and the risks associated with mobile code (executable programs that can be transferred and run on
different computers).

### 4. Scalability

Scalability is the ability of a distributed system to handle growth efficiently. As the number of users
and resources increases, the system should:

- **Control physical resource costs:** Ensure that adding more resources, like servers, is cost-
effective.

- **Control performance loss:** Maintain performance even as the system grows.

- **Prevent running out of resources:** For example, making sure there are enough IP addresses.
- **Avoid performance bottlenecks:** Distribute tasks efficiently to prevent any one component
from becoming overloaded.

### 5. Failure Handling

Failures are inevitable in distributed systems, but the goal is to manage them effectively. Techniques
include:

- **Detecting failures:** Identifying when something goes wrong, like using checksums to detect
data corruption.

- **Masking failures:** Hiding or mitigating the impact of failures, such as retransmitting messages
or using redundant data storage.

- **Concurrency:** Ensuring that multiple clients can access shared resources without interfering
with each other, maintaining consistency and correctness.

### 6. Transparency

Transparency means making the distributed nature of the system invisible to users and application
programmers. They should see the system as a single entity rather than a collection of independent
components. Types of transparency include:

- **Access transparency:** Accessing local and remote resources in the same way.

- **Location transparency:** Accessing resources without knowing their physical or network


location.

- **Concurrency transparency:** Allowing multiple processes to use shared resources


simultaneously without conflict.

### 7. Quality of Service (QoS)

QoS refers to the ability of the system to meet certain performance standards, especially for time-
critical applications like streaming video. The system should provide guaranteed computing and
communication resources to ensure tasks are completed on time. QoS is important for ensuring
reliable and timely access to resources, even under heavy load.

In summary, distributed systems must handle a variety of challenges, including dealing with diverse
components, maintaining security, scaling efficiently, managing failures, ensuring transparency, and
meeting quality of service requirements. These challenges require careful design and
implementation to ensure the system operates effectively and efficiently.
4. Architectural Model
### Introduction to Architectural Models in Distributed Systems

#### What is Architecture in Systems?

- **System Architecture**: This is about how different parts of a system are


organized and how they interact. Think of it as the blueprint that ensures the system
works well now and can handle future needs.
- **Key Goals**: The architecture should make the system reliable, easy to manage,
adaptable, and cost-effective.
- **Building Architecture Analogy**: Just like a building's architecture determines its
look, structure, and style (like gothic or modern), a system's architecture sets the
framework for its design.

### Main Architectural Models in Distributed Systems

1. **Core Architectural Elements**: Basic components and methods that form the
foundation of modern distributed systems.
2. **Composite Architectural Patterns**: These combine basic elements in various
ways to create more complex and sophisticated systems.
3. **Middleware Platforms**: These support the different programming styles that
emerge from the architectural patterns.

#### Key Architectural Styles

1. **Client-Server Model**
- **Description**: The most common model. Clients request services from servers,
which provide the requested resources.
- **Example**: A web server that provides web pages to browsers (clients).
Sometimes servers can be clients of other servers, like a web server that requests
data from a file server.
- **Concurrent Tasks**: For instance, a search engine serves user queries (as a
server) and runs web crawlers that fetch data from other web servers (as clients).

2. **Peer-to-Peer (P2P) Model**


- **Description**: All processes in the system play similar roles without a clear
client-server distinction. They interact as equals (peers).
- **Benefits**: Scales better as it utilizes the resources of all participating
computers, distributing the load more evenly.
- **Example**: BitTorrent, where users share pieces of files directly with each
other.

### Architectural Patterns in Distributed Systems

- **Layered Architecture**
- **Concept**: The system is divided into layers, with each layer providing services
to the one above it and using services from the one below.
- **Example**: A network time service where multiple layers ensure accurate time
distribution across systems.

- **Tiered Architecture**
- **Two-Tier vs. Three-Tier**:
- **Two-Tier**: Splits the application logic between client and server.
- **Advantage**: Low interaction latency.
- **Disadvantage**: Complexity in splitting logic across client and server.
- **Three-Tier**: Separates presentation logic, application logic, and data logic into
three distinct layers.
- **Advantage**: Easier maintenance and scalability.
- **Disadvantage**: More complexity and potentially higher latency due to
additional layers.
- **Example**: Wikipedia's multi-tier architecture handles high volumes of web
requests effectively.
- **AJAX (Asynchronous JavaScript and XML)**
- **Role**: Enhances the standard client-server interaction by allowing fine-grained,
asynchronous communication between the browser (client) and the server.
- **Benefit**: Improves user experience by making web applications more
responsive.

### Conclusion

- **Trade-Offs**: Every architectural choice comes with trade-offs affecting


performance, scalability, and maintenance.
- **Skill in Design**: Understanding and managing these trade-offs is crucial for
designing effective distributed systems.

5. Fundamental Model:
### Fundamental Model
The fundamental model is a simplified representation of a distributed system. It helps
us understand and reason about how the system behaves, its possible failures, and
security risks.

### Purpose of a Fundamental Model


1. **Explicit Assumptions**: Clearly state what assumptions we are making about
the system.
2. **Generalizations**: Determine what is possible or impossible based on those
assumptions. This helps in developing general algorithms and guarantees based on
logical analysis and proofs.

### Interaction Model in Detail


1. **Communication Performance**:
- **Latency**: The delay in message delivery.
- Includes transmission time, network access delay, and operating system
processing time.
- **Bandwidth**: The amount of data that can be transmitted in a given time.
- **Jitter**: Variation in message delivery time, important for multimedia data.

2. **Computer Clocks and Timing**:


- Each computer has its own clock, leading to time discrepancies (clock drift).
- **Clock Synchronization**: Methods like GPS can help, but they are not always
practical.

3. **Synchronous vs. Asynchronous Systems**:


- **Synchronous Systems**: Boundaries are set for process execution time,
message delivery time, and clock drift. Realistic but hard to guarantee.
- **Asynchronous Systems**: No time bounds for process execution, message
delivery, or clock drift. This is more realistic for systems like the Internet.

4. **Event Ordering**:
- **Logical Time**: Used to order events without relying on perfectly synchronized
clocks.
- **Example**: In an email exchange, even without synchronized clocks, you can
infer the order of events (e.g., replies follow original messages).

### Practical Implications


- **Design Decisions**: Knowing the interaction model helps in making informed
design decisions, like using timeouts in synchronous systems or allowing flexibility in
asynchronous systems.
- **Handling Delays**: Designs must account for communication delays and clock
drift, especially for real-time applications like voice conferencing.

Simplified Explanation of the Failure Model in Distributed Systems

In a distributed system, both processes (programs) and communication channels


(networks) can fail in various ways. Understanding these failures helps in designing
systems that can handle them effectively. Here’s a simplified breakdown of the failure
model:

#### Types of Failures:

1. **Omission Failures:** When something doesn't happen that should have.


- **Process Omission Failures:** A process (program) crashes and stops working
completely. It’s as if it’s turned off and won’t turn back on. For example, if a server
goes down, it won't respond to requests.
- **Communication Omission Failures:** Messages that are supposed to be sent or
received don’t make it. For example:
- **Send-Omission Failure:** A process tries to send a message, but it doesn’t
leave its outgoing buffer.
- **Receive-Omission Failure:** A message reaches the incoming buffer of a
process but is not picked up by the process.

2. **Arbitrary (Byzantine) Failures:** These are the worst kinds of failures where
anything can go wrong.
- A process might perform incorrect steps or provide wrong outputs.
- Communication channels might deliver corrupted messages, fake messages, or
duplicate messages.

3. **Timing Failures:** These apply to systems where timing is critical.


- **Process Timing Failures:** A process takes too long to perform a task.
- **Communication Timing Failures:** Messages take too long to be delivered.
- **Clock Failures:** The local clock of a process deviates from real-time too much.

#### Dealing with Failures:


1. **Fail-Stop Behavior:** This is when a process stops completely, and other
processes can detect this stoppage. For example, if a process fails to respond within a
certain time, it is assumed to have failed.

2. **Masking Failures:** This involves designing systems in a way that hides failures
or makes them less severe. For example:
- Using multiple servers to hold copies of data, so if one fails, others can still provide
the service.
- Retransmitting messages that don’t get delivered to ensure they eventually reach
their destination.

3. **Reliable Communication:** Ensuring that messages are delivered correctly and


without duplication.
- **Validity:** A message sent will eventually be received.
- **Integrity:** The message received is the same as the one sent, and no message
is received more than once.

### Key Points:

- **Omission Failures:** Failures where actions don’t happen as expected (process


crashes or messages are lost).
- **Arbitrary Failures:** Random and unpredictable failures, the most difficult to
handle.
- **Timing Failures:** Failures related to time limits being exceeded in processes or
message delivery.
- **Handling Failures:** Techniques like fail-stop behavior, masking failures, and
ensuring reliable communication help in managing these failures.

Understanding these types of failures and how to handle them is crucial for designing
robust and reliable distributed systems.
Simplified Explanation of the Security Model in Distributed Systems

In a distributed system, resources are shared and accessed over a network, making
security a critical concern. The security model aims to protect processes (programs)
and communication channels (networks) from unauthorized access and attacks.
Here's a simplified explanation:

#### Key Components of the Security Model:

1. **Protecting Objects and Processes:**


- **Objects:** These are resources like files or services managed by servers. Users
interact with these objects through clients.
- **Principals:** These are the entities (users or processes) that have access rights
to objects. For example, only certain users can read or modify a file.
- **Access Rights:** These specify what actions a principal can perform on an
object. For example, some users can only read a file, while others can edit it.
- **Verification:** Servers verify the identity of the user making a request to ensure
they have the necessary access rights. Clients verify the server’s identity to ensure
they’re communicating with the correct server.

2. **Securing Interactions:**
- **Messages:** Processes communicate by sending messages over the network.
These messages can be intercepted, altered, or faked by attackers.
- **The Enemy:** An attacker can send false messages, read messages between
processes, or even alter them. The security model must account for these threats.

3. **Threats:**
- **To Processes:** Servers and clients can receive messages from unknown or
malicious sources. Without verifying the sender’s identity, they can't ensure the
message is legitimate.
- **To Communication Channels:** Messages can be intercepted, altered, or
replayed by attackers. For example, an attacker could resend a request to transfer
money multiple times.

#### Defeating Security Threats:

1. **Cryptography and Shared Secrets:**


- **Encryption:** Scrambling a message so only the intended recipient can read it.
This ensures that even if a message is intercepted, its contents remain secret.
- **Shared Secrets:** A known piece of information (like a password) shared
between two processes. If a message proves knowledge of this secret, it confirms the
sender’s identity.

2. **Authentication:**
- **Proof of Identity:** Including encrypted information in a message that verifies
the sender’s identity and message authenticity.
- **Example:** When a client requests a file from a server, the request includes an
encrypted part that proves the client’s identity and request details. The server
decrypts this to verify the request.

3. **Secure Channels:**
- **Building Secure Channels:** Using encryption and authentication to create a
secure communication path between processes.
- **Properties of Secure Channels:**
- **Identity Verification:** Both processes reliably know who they are
communicating with.
- **Privacy and Integrity:** Ensures that messages are private and unaltered
during transmission.
- **Replay Protection:** Messages include timestamps to prevent attackers from
reusing them later.
#### Other Security Concerns:

1. **Denial of Service (DoS) Attacks:** Overloading a service with excessive requests


to disrupt its normal operations.
2. **Mobile Code:** Executing code received from elsewhere (e.g., email
attachments) can pose security risks if the code is malicious.

#### Practical Application:

- **Balancing Security and Cost:** Implementing security measures like encryption


and access control can be resource-intensive. The security model helps analyze
threats and balance the cost of security techniques against the risks.

By understanding these components and how they work together, we can design
distributed systems that are secure against various threats while maintaining efficient
operation.
6. Networking and Internetworking:
Networking refers to connecting computers and other devices to share information
and resources. Internetworking involves linking multiple networks together to form a
larger network, like the Internet. Here's a simpler breakdown of the main concepts:

### Networking Basics

1. **Communication Subsystem**:
- **Definition**: A collection of hardware and software that provides
communication facilities for a distributed system.
- **Components**:
- **Hardware**: Routers, switches, bridges, hubs, repeaters, network interfaces.
- **Software**: Protocol stacks, communication handlers, drivers.
- **Hosts**: Devices like computers and smartphones that use the network.
- **Nodes**: Any device, including computers and switching devices, connected to
a network.

2. **Types of Networks**:
- **Personal Area Networks (PANs)**: Connect personal devices like smartphones
and tablets within a short range (e.g., Bluetooth).
- **Local Area Networks (LANs)**: Connect devices within a small area like a
building (e.g., Ethernet).
- **Metropolitan Area Networks (MANs)**: Cover larger areas like cities (e.g., cable
networks).
- **Wide Area Networks (WANs)**: Cover large geographic areas, even worldwide
(e.g., the Internet).
- **Wireless Networks**: Include WiFi, WiMAX, and cellular networks (3G, 4G, 5G).

### Internetworking

- **Definition**: Linking multiple networks together to form an internetwork.


- **Example**: The Internet, which integrates various types of networks to provide a
seamless communication medium.

### Network Performance Characteristics

1. **Range**: Distance over which the network operates (e.g., Bluetooth has a range
of 10-30 meters, while the Internet spans the globe).
2. **Bandwidth**: Amount of data transmitted per second (e.g., Ethernet can reach
up to 10 Gbps, while WiFi varies from 11 to 108 Mbps).
3. **Latency**: Time delay in data transmission (e.g., LANs have low latency of 1-10
milliseconds, while WANs can have higher latency up to 500 milliseconds).

### Network Types and Technologies


1. **LANs**: High speed, low latency, typically within buildings (e.g., Ethernet).
2. **WANs**: Lower speed, higher latency, span large distances (e.g., the Internet
using IP routing).
3. **MANs**: High-speed connections within cities, often using technologies like DSL
or cable modems.
4. **Wireless Networks**: Provide connectivity without wires, varying in range and
speed (e.g., WiFi, Bluetooth, WiMAX, 3G/4G).

### Network Principles

1. **Packet Switching**: Data is broken into packets that are transmitted


independently through the network. Each packet may take a different route to its
destination.
2. **Data Streaming**: Continuous transmission of data (e.g., video and audio)
requires high bandwidth and low latency to ensure real-time delivery.
3. **Switching Schemes**:
- **Broadcasting**: Transmits data to all nodes, and each node picks up what is
relevant to it.
- **Circuit Switching**: Establishes a dedicated path between sender and receiver
for the duration of the communication (like traditional phone systems).
- **Packet Switching**: Data is sent in packets through a network with no fixed
path, making efficient use of the network.
- **Frame Relay**: Switches small packets (frames) quickly, useful for real-time
applications like video conferencing.

### Internetworking Challenges

1. **Network Errors**: Issues like packet loss, delayed packets, and duplicate packets
can occur.
2. **Quality of Service (QoS)**: Ensuring sufficient bandwidth, low latency, and
reliability for applications, especially for real-time data like streaming video.
### Key Takeaways

- Networking connects devices within a specific area to share resources.


- Internetworking links multiple networks into a larger network, allowing widespread
communication like the Internet.
- Different types of networks serve different purposes, from personal to global scale.
- Network performance is measured by range, bandwidth, and latency.
- Effective networking requires managing data transmission efficiently and ensuring
quality of service for various applications.

6.

You might also like