Distributed Systems Overview
Distributed Systems Overview
Uploaded image
give detailed answers to each questions
Q.1 (a) Define distributed system. List advantages and disadvantages of distributed
system.
A distributed system is a collection of independent computers that appear to the users of the system
as a single coherent system. These systems communicate and coordinate their actions by passing
messages.
Advantages
1. Scalability: Distributed systems can easily scale horizontally by adding more nodes.
2. Fault Tolerance: If one node fails, others can take over, ensuring reliability.
3. Resource Sharing: Resources like hardware, software, and data can be shared.
4. Performance: Tasks can be executed in parallel, improving overall performance.
5. Cost Efficiency: Use of low-cost hardware instead of expensive mainframes.
Disadvantages
1. Transparency:
Access Transparency: Hides differences in data representation.
Location Transparency: Users don’t need to know where resources are located.
Replication Transparency: Hides replication details.
2. Scalability:
Systems must scale up efficiently without performance degradation.
3. Concurrency:
Printed using Save ChatGPT as PDF, powered by PDFCrowd HTML to PDF API. 1/8
Managing multiple users accessing shared resources simultaneously.
4. Fault Tolerance:
Ensuring the system continues working even when a component fails.
5. Resource Management:
Allocation and scheduling of resources across the system.
6. Security:
Protecting data and resources from unauthorized access.
7. Performance:
Optimizing communication and resource access to ensure efficiency.
1. Client-Server Systems:
Clients request services, and servers provide responses. Example: Web servers.
2. Peer-to-Peer Systems:
All nodes act as both clients and servers. Example: BitTorrent.
3. Clustered Systems:
Multiple servers work together as a single system. Example: High-performance computing.
4. Grid Computing:
Resources are shared across multiple systems over a network.
5. Cloud Computing:
Provides on-demand computing resources via the internet. Example: AWS, Azure.
6. Distributed Databases:
Data is stored across multiple nodes. Example: Google Bigtable.
Q.2 (b) Discuss flat name space and hierarchical names with examples.
Printed using Save ChatGPT as PDF, powered by PDFCrowd HTML to PDF API. 2/8
`www.google.com` → Top-level domain: `.com`, Subdomain: `google`, Host: `www`.
1. Layered Architecture: Divides the system into layers (e.g., application, transport, network).
Q.3 (a) The TCP/IP connection between client and server is stateful. State True or
False. Justify your answer.
False.
TCP/IP itself is a stateless protocol. However, the TCP connection maintains a stateful connection
for the duration of communication.
Stateful means TCP keeps track of session states like connection establishment, data transmission,
and termination.
Q.3 (c) Explain how Lamport’s logical clock is implemented in distributed systems.
Printed using Save ChatGPT as PDF, powered by PDFCrowd HTML to PDF API. 3/8
Aspect Authentication Authorization
Steps:
Q.5 (c) Explain Diffie-Hellman key exchange algorithm with a suitable example.
The Diffie-Hellman algorithm allows two parties to securely exchange cryptographic keys over a public
channel.
Steps:
Example:
Public: p = 23, g = 5.
Alice’s private key: a = 6, Bob’s private key: b = 15.
Alice sends A = 56 mod 23 = 8.
Bob sends B = 515 mod 23 = 19.
Shared key: K = 196 mod 23 = 2.
Printed using Save ChatGPT as PDF, powered by PDFCrowd HTML to PDF API. 4/8
Let me know if you need answers for other questions or additional clarifications!
Q.2 (c) What is flat naming? Explain broadcasting, multicasting, and forward pointer
techniques to resolve flat naming.
Flat Naming
In a flat name space, names are unique identifiers without any hierarchical structure.
It is simple but inefficient for large systems since searching for a name requires checking all
entities.
1. Broadcasting:
A message is sent to all nodes in the system.
If the intended recipient identifies the message, it responds.
Advantages: Simple to implement.
Disadvantages: High network overhead.
2. Multicasting:
A message is sent to a group of nodes instead of all nodes.
Only relevant nodes respond.
Advantages: Reduces overhead compared to broadcasting.
Disadvantages: Group management can be complex.
3. Forward Pointers:
When an object moves, a pointer is left at the old location pointing to the new location.
Subsequent requests follow the chain of pointers to find the object.
Advantages: Ensures the object can be located.
Disadvantages: Long pointer chains can increase latency.
1. Client Tier:
The front-end interface (web browsers) where users interact.
Handles input, displays content, and sends HTTP requests.
2. Web Server Tier:
Processes client requests and forwards them to the application server.
Example: Apache, Nginx.
Printed using Save ChatGPT as PDF, powered by PDFCrowd HTML to PDF API. 5/8
3. Application Server Tier:
Contains the business logic of the system.
Processes data and handles dynamic content generation.
4. Database Tier:
Stores and retrieves data for the application.
Example: MySQL, Oracle.
Flow:
Client → HTTP Request → Web Server → Application Server → Database → Response back to
Client.
1. Two-Tier Architecture:
The client interacts directly with the server.
Example: Database applications where the client directly queries the database.
2. Three-Tier Architecture:
Separates presentation, application logic, and data storage into three layers:
Client Tier → Application Server → Database.
Example: Web applications.
3. Multi-Tier Architecture:
Extends three-tier by adding more layers (e.g., caching, load balancing).
Improves scalability and fault tolerance.
4. Peer-to-Peer (P2P):
All nodes act as both clients and servers.
Example: File sharing applications like BitTorrent.
1. Centralized Algorithm:
A central coordinator grants access to the critical section.
Advantages: Simple to implement.
Disadvantages: Single point of failure, bottleneck.
2. Token-Based Algorithm:
A token circulates among nodes, and only the node holding the token can enter the critical
section.
Advantages: No contention.
Disadvantages: Token loss requires recovery mechanisms.
3. Ricart-Agrawala Algorithm:
A node sends requests to all other nodes for permission to enter the critical section.
Other nodes reply with a timestamp-based decision.
Advantages: Fair and efficient.
Disadvantages: High message overhead.
4. Lamport’s Algorithm:
Printed using Save ChatGPT as PDF, powered by PDFCrowd HTML to PDF API. 6/8
Uses logical clocks to order requests.
Similar to Ricart-Agrawala but ensures ordering using timestamps.
1. Privacy:
Ensuring that sensitive information is not accessed by unauthorized entities.
Example: Encrypting data.
2. Authenticity:
Verifying that the sender of the message is who they claim to be.
Example: Digital signatures.
3. Integrity:
Ensuring that data is not altered during transmission.
Example: Hashing techniques (MD5, SHA).
Data-centric consistency models define the rules for maintaining consistency in distributed systems:
1. Strict Consistency:
A read returns the most recent write.
Hard to achieve in distributed systems.
2. Sequential Consistency:
All processes see the same order of updates, but not necessarily in real-time.
3. Causal Consistency:
If one event causally affects another, the order is preserved.
4. Eventual Consistency:
All nodes will eventually converge to the same state.
Example: DNS systems.
Printed using Save ChatGPT as PDF, powered by PDFCrowd HTML to PDF API. 7/8
1. Clock Drift:
Physical clocks run at slightly different speeds, causing drift.
2. Latency:
Delays in message transmission affect synchronization.
3. Network Delays:
Variable network delays make accurate time synchronization difficult.
4. Fault Tolerance:
Handling node failures while maintaining synchronization.
5. Accuracy:
Ensuring minimal deviation between clocks.
1. Backward Recovery:
The system rolls back to a previous consistent state after a failure.
Example: Database transactions using checkpoints.
2. Forward Recovery:
The system moves forward by applying recovery procedures to reach a consistent state.
Example: Error-correcting codes in data transmission.
Features:
1. Remote Method Invocation (RMI): Objects can invoke methods on remote objects.
2. Object Transparency: Location and access to objects are transparent to the user.
3. Middleware: Systems like CORBA and Java RMI facilitate communication.
Example:
A banking application where customer objects are distributed across servers but accessed
seamlessly.
Printed using Save ChatGPT as PDF, powered by PDFCrowd HTML to PDF API. 8/8