0% found this document useful (0 votes)
75 views

Comp 473 Assignment 1 and 2

The document contains an assignment for a Distributed Systems course. It includes sample code for multicast communication in Java, implementing remote interfaces in Java RMI, and a Java client for CORBA interfaces. It also lists topics for a case study on Google's distributed systems architecture, including the original search engine design, Google Cloud, applications, data centers, scalability requirements, communication paradigms, storage systems, Bigtable database, MapReduce, and security. Finally, it provides prompts for a brief summary of Amazon's distributed platforms.

Uploaded by

Felix Gathage
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
75 views

Comp 473 Assignment 1 and 2

The document contains an assignment for a Distributed Systems course. It includes sample code for multicast communication in Java, implementing remote interfaces in Java RMI, and a Java client for CORBA interfaces. It also lists topics for a case study on Google's distributed systems architecture, including the original search engine design, Google Cloud, applications, data centers, scalability requirements, communication paradigms, storage systems, Bigtable database, MapReduce, and security. Finally, it provides prompts for a brief summary of Amazon's distributed platforms.

Uploaded by

Felix Gathage
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

NAME:LINCOHN MWINZILA KANG’ETHE

REG_NO:S13/02322/19
UNIT TITLE:DISTRIBUTED SYSTEMS
UNIT CODE: COMP 473
LECTURER: MR. KEMEI
DATE:7/3/2023

ASSIGNMENT 1

Repeat the same concepts as in UDP and TCP communication examples given above for the
following middleware protocols.
a) Java API to IP multicast communication i.e give running sample code for Multicast peer joins
a group and sends and receives datagrams
b) Remote interfaces in Java RMI i.e give a running sample code for Java Remote interfaces
Shape and Shape List on client side as well as server side.
c) CORBA client and server i.e give a running sample code for Java client program for CORBA
interfaces Shape and ShapeList

a) Java API to IP multicast communication: Java API provides a simple way to send and
receive IP multicast datagrams using the MulticastSocket class.

Here's a sample code for a multicast peer joining a group and sending/receiving
datagrams:

import java.io.IOException;
import java.net.DatagramPacket;
import java.net.InetAddress;
import java.net.MulticastSocket;

public class MulticastPeer {


public static void main(String[] args) throws IOException {
// Join a multicast group
InetAddress group = InetAddress.getByName("224.0.0.1");
MulticastSocket socket = new MulticastSocket(4446);
socket.joinGroup(group);

// Send a multicast message


String message = "Hello, multicast world!";
byte[] buffer = message.getBytes();
DatagramPacket packet = new DatagramPacket(buffer, buffer.length, group, 4446);
socket.send(packet);

// Receive a multicast message


byte[] recvBuffer = new byte[1024];
DatagramPacket recvPacket = new DatagramPacket(recvBuffer, recvBuffer.length);
socket.receive(recvPacket);
String recvMessage = new String(recvPacket.getData(), 0, recvPacket.getLength());
System.out.println("Received: " + recvMessage);

// Leave the multicast group


socket.leaveGroup(group);
socket.close();
}
}
b) Remote interfaces in Java RMI: Java RMI (Remote Method Invocation) allows objects
running in one JVM to invoke methods on objects running in another JVM, even on a
different machine.

Here's a sample code for defining remote interfaces for Shape and ShapeList, and for
implementing them on the server and client side:

import java.rmi.Remote;
import java.rmi.RemoteException;
import java.util.List;

// Remote interface for a shape


public interface Shape extends Remote {
public void draw() throws RemoteException;
}

// Remote interface for a list of shapes


public interface ShapeList extends Remote {
public void addShape(Shape shape) throws RemoteException;
public List<Shape> getShapes() throws RemoteException;
}

// Server implementation of Shape and ShapeList


public class ShapeListServer implements ShapeList {
private List<Shape> shapes;

public void addShape(Shape shape) throws RemoteException {


shapes.add(shape);
}

public List<Shape> getShapes() throws RemoteException {


return shapes;
}
}

// Client implementation of Shape and ShapeList


public class ShapeListClient {
public static void main(String[] args) throws Exception {
// Get a remote reference to the ShapeList
ShapeList shapeList = (ShapeList) java.rmi.Naming.lookup("rmi://localhost/ShapeList");

// Create a new shape and add it to the ShapeList


Shape shape = new Circle();
shapeList.addShape(shape);

// Get the list of shapes and draw them


List<Shape> shapes = shapeList.getShapes();
for (Shape s : shapes) {
s.draw();
}
}
}

c) CORBA client and server: CORBA (Common Object Request Broker Architecture) is a
middleware technology that allows objects to communicate with each other, even if they
are written in different languages.
Here's a sample code for a Java client program for CORBA interfaces Shape and
ShapeList:

import org.omg.CORBA.*;
import Shape.*;
import ShapeList.*;

public class ShapeListClient {


public static void main(String[] args) throws Exception {
// Initialize the ORB and get a reference to the ShapeList
ORB orb = ORB.init(args, null);
org.omg.CORBA.Object objRef = orb.resolve_initial_references("NameService");

ASSIGNMENT 2
1) Using the concepts of distributed systems learned in previous topics and do own your research
case study to

a) Architecture of the original Google search engine:


The original Google search engine architecture consisted of several distributed components such
as the crawler, indexer, and query processor. The crawler was responsible for scanning the web
pages, and then the indexer would analyze and create an index of the page's content. The query
processor would then receive user requests and query the index to provide relevant results. The
search engine's architecture also included a distributed file system that stored the crawled web
pages and their respective indexes.

b) Google as a cloud provider:


Google provides a cloud computing platform called Google Cloud Platform (GCP). It offers a
wide range of services such as computing, storage, networking, security, and machine learning.
GCP is built on Google's massive-scale infrastructure and provides enterprise-level security and
performance. It is also highly flexible, enabling users to choose from a range of compute options
and programming languages.

c) Example Google Applications:


Some of the popular Google applications include Gmail, Google Drive, Google Maps, Google
Photos, and Google Docs. These applications are built on Google's cloud infrastructure and
leverage its powerful computing and storage capabilities.

d) Google Physical model:


Google has data centers located all over the world, which are connected by a high-speed
network. These data centers house thousands of servers and storage devices and are designed to
be highly resilient and fault-tolerant. Google's physical model also includes custom-designed
hardware, such as its own servers and networking equipment.

e) Overall system architecture key requirements:


The key requirements for Google's system architecture are scalability, fault-tolerance, and high-
performance. Google's architecture is designed to handle massive amounts of data and traffic
while maintaining low latency and high availability. It is also designed to be highly fault-
tolerant, ensuring that the system remains operational even in the face of hardware failures or
other disruptions.

f) Underlying communication paradigms:


Google's architecture uses a variety of communication paradigms, including message passing,
remote procedure calls (RPCs), and publish/subscribe messaging. These communication
paradigms enable different components of the system to communicate with each other efficiently
and reliably.

g) The Google File System as a data storage and coordination service:


The Google File System (GFS) is a distributed file system designed to handle large amounts of
data across multiple servers. It is used as the primary storage system for Google's search engine
and other applications. GFS provides fault-tolerance and replication, ensuring that data is stored
and retrieved reliably.
h) Overall architecture of Bigtable:
Bigtable is a distributed database system that is designed to handle large amounts of structured
data. It is built on top of GFS and provides high-performance, scalable data storage and retrieval.
Bigtable is used by many of Google's applications, including Google Analytics and Google
Earth.

i) The overall execution of a MapReduce program:


MapReduce is a programming model for processing large amounts of data in a distributed
system. In a MapReduce program, the data is first split into smaller chunks and processed in
parallel across multiple servers. The results are then aggregated to produce the final output.
Google's implementation of MapReduce is used in many of its applications, including Google
Search and Google Analytics.

j) Google security policies and security mechanisms:


Google has a strong focus on security and employs a range of policies and mechanisms to ensure
the safety and privacy of its users' data. These include strong encryption, multi-factor
authentication, and continuous monitoring and auditing of its systems. Google also provides a
range of security services for its cloud customers, including network security, identity and access
management, and data protection.

2. Using same handlines in assignment (1) summarize and make your own brief notes on
Amazon platform as distributed systems application.

Amazon is a global leader in e-commerce and cloud computing. It operates several distributed
systems that power its services, such as Amazon.com, Amazon Web Services (AWS), and
Amazon Prime. These systems rely on distributed computing technologies to provide scalable,
reliable, and efficient services to customers worldwide.
Amazon Web Services (AWS) is a cloud computing platform that provides a wide range of
services, including computing, storage, databases, analytics, machine learning, and security.
AWS is built on top of several distributed systems, such as Amazon S3 (Simple Storage
Service), Amazon EC2 (Elastic Compute Cloud), and Amazon DynamoDB.
Amazon S3 is a highly available and durable object storage system that can store and retrieve
any amount of data from anywhere on the web. It is designed to provide 99.999999999%
durability and can sustain the concurrent loss of data in two facilities.
Amazon EC2 is a web service that provides resizable compute capacity in the cloud. It is
designed to make web-scale cloud computing easier for developers. EC2 allows users to launch
instances of virtual machines and run their applications on them.
Amazon DynamoDB is a fully managed NoSQL database service that provides fast and
predictable performance with seamless scalability. It is designed to scale up or down
automatically based on the workload.
Amazon's distributed systems are designed to be fault-tolerant and scalable, with the ability to
handle massive amounts of data and traffic. These systems rely on advanced networking and
communication protocols, such as TCP/IP and UDP, to provide reliable and efficient
communication between distributed nodes.
Overall, Amazon's distributed systems architecture is crucial to its success in providing scalable
and reliable services to its customers

You might also like