Cloud Computing UNIT-5
Cloud Computing UNIT-5
UNIT V
Cloud Application Development: Amazon Web Services : EC2 – instances, connecting clients,
security rules, launching, usage of S3 in Java, Cloud based simulation of a Distributed trust
algorithm, Cloud service for adaptive data streaming , Google: Google App Engine, Google Web
Toolkit, Microsoft: Azure Services Platform, Windows live, Exchange Online, Share Point
Services, Microsoft Dynamics CRM.
Cloud application development is the process through which a Cloud-based app is built. It
involves different stages of software development in cloud. Three cloud delivery models, SaaS,
PaaS, and IaaS; the level of difficulty increases as we move toward the base of the cloud service
pyramid.
• Amazon Machine Images (AMIs) are the basic building blocks of Amazon EC2
An on-demand EC2 instance is an offering from AWS where the subscriber/user can rent the
virtual server per hour and use it to deploy his/her own applications.
Amazon Management Console (AMC) window listing the Amazon Web Services offered at the
time of this writing. The services are grouped into several categories: computing and networking,
storage and content delivery, deployment and management, databases, and application services.
AWS EC2 instance is a virtual server started in a region and the availability zone is selected by
the user.
The local instance store persists only for the duration of an instance; the data will persist if an
instance is started using the Amazon Elastic Block Storage (EBS) and then the instance can be
restarted at a later time.
Fire walls:
First generation - operated below the transport layer, and discarded packets based on the
information in the headers of physical, data link, and network layer protocols.
Second generation - operate at the transport layer and maintain the state of all connections
passing through them and opened the possibility of denial of service attacks.
Third generation - understand widely- used application layer protocols such as FTP,
HTTP, TELNET, SSH, and DNS. These firewalls examine the header of application layer
protocols and support intrusion detection systems (IDS).
Firewalls screen incoming traffic and sometimes filter outgoing traffic as well. A first filter
encountered by the incoming traffic in a typical network is a firewall provided by the operating
system of the router; the second filter is a firewall provided by the operating system running on
the local computer
A rule specifies a filtering option at (i) the network layer, when filtering is based on the
destination/ source IP address; (ii) the transport layer, when filtering is based on
destination/source port number; or (iii) the MAC layer, when filtering is based on the
destination/source MAC address.
For several reasons, including security and the ability of the infrastructure to scale up, the IP
addresses of instances visible to the outside world are mapped internally to private IP addresses.
A virtual machine running under Amazon‘s EC2 has several IP addresses:
1. EC2 Private IP Address. The internal address of an instance; it is only used for routing within
the EC2 cloud.
2. EC2 Public IP Address. Network traffic originating outside the AWS network must use either
the public IP address or the elastic IP address of the instance. The public IP address is
translated using Network Address Translation (NAT) to the private IP address when an
instance is launched and it is valid until the instance is terminated. Traffic to the public
address is forwarded to the private IP address of the instance.
3. EC2 Elastic IP Address. The IP address allocated to an AWS account and used by traffic
originated outside AWS. NAT is used to map an elastic IP address to the private IP address.
1. Sign in to the AWS Management Console at http://aws.amazon.com using your email address
and password and select EC2 service.
2. Use the EC2 Request Instance Wizard to specify the instance type, whether it should be
monitored, and specify a key/value pair for the instance to help organize and search.
3. Provide a name for the key pair. Then on the left-side panel, choose Security Groups under
Network & Security, select the desired security group, and click on the inbound tab to enter the
desired rule.
AWS security. Choose Security Groups under Network & Security, select the desired security
group, and click on the Inbound tab to enter the desired rule:
EC2 Request Instance Wizard is used to (a) specify the number and type of instances and the zone:
(c) Add tags to the instance. A tag is stored in the cloud and consists of a case-sensitive key/value
pair private to the account.
On Linux or Unix systems the port numbers below 1,024 can only be assigned by the root. The
plain ASCII file called services maps friendly textual names for Internet services to their
assigned port numbers and protocol types, as in the following example:
netstat 15/tcp
ftp 21/udp
ssh 22/tcp
telnet 23/tcp
http 80/tcp
A. Launch an instance
1. From the AWS Management Console, select EC2 and, once signed in, go to Launch
Instance Tab.
2. To determine the processor architecture when you want to match the instance with the
hardware, enter the command
uname -m
3. Choose Instance Details to control the number, size, and other settings for instances.
4. To learn how the system works, press Continue to select the default settings.
5. Define the instance‘s security, as discussed in Section 11.3: In the Create Key Pair page
enter a name for the pair and then press Create and Download Key Pair.
6. The key-pair file downloaded in the previous step is a .pem file, and it must be hidden to
prevent unauthorized access. If the file is in the directory awcdir/dada.pem enter the
commands
cd awcdir
9. Press Launch and examine the confirmation page, then press Close to end the examination
of the confirmation page.
10. Press the Instances tab on the navigation panel to view the instance.
11. Look for your Public DNS name. Because by default some details of the ins tance are hidden,
click on the Show/Hide tab on the top of the console and select Public DNS.
12. Record the Public DNS as Public DNS name; it is needed to connect to the instance from the
Linux terminal.
13. Use the ElasticIP panel to assign an Elastic IP address if a permanent IP address is required.
If you get the prompt You want to continue connecting? respond Yes. A warning that the
DNS name was added to the list of known hosts will appear.
sudo - i
Then use yum install commands to install software, e.g., gcc to compile C programs on the
cloud.
nohup ServiceName
To run the service in the background and redirect stdout and stderr to files p.out and p.err,
respectively,
Create an S3 client. S3 access is handled by the class AmazonS3Client instantiated with the
account credentials of the AWS user:
Buckets. An S3 bucket is analogous to a file folder or directory, and it is used to store S3 objects.
Bucket names must be globally unique; hence, it is advisable to check first to see whether the
name exists:
This function returns ―true‖ if the name exists and ―false‖ otherwise. Buckets can be created and
deleted either directly from the AWS Management Console or programmatically as follows:
S3 objects. An S3 object stores the actual data and it is indexed by a key string. A single key
points to only one S3 object in one bucket. Key names do not have to be globally unique, but if
an existing key is assigned to a new object, the original object indexed by that key is lost.
To access this object with key key from the bucket bucket_name use:
The InputStream can be accessed using Scanner, BufferedReader, or any other supported
method. Amazon recommends closing the stream as early as possible, since the content is not
buffered and it is streamed directly from the S3. An open InputStream means an open connection
to S3. For example, the following code will read an entire object and print the contents to the
screen:
The convenience of data access from any site connected to the Internet.
The data transfer rates of wireless networks are increasing; the time to transfer data to
and from cloud is no longer a limiting factor.
Mobile devices have limited resources; whereas new generations of smartphones and
tablet computers are likely to use multicore processors and have a fair amount of
memory, power consumptionis, and will continue to be, a major concern in the near
future.
Cognitive Radio Networks (CRNs) are emerging as a solution to increase the spectrum
utilization by using unused or less used spectrum in radio environments.
Information sharing is necessary because a node alone cannot determine the true
spectrum occupancy. Indeed, a secondary node has a limited transmission and reception
range; node mobility combined with typical wireless channel impairments, such as
multipath fading, shadowing, and noise, add to the difficulty of gathering accurate
information by a single node.
The secondary nodes of an ad hoc CRN compete for free channels, and the information
one node may provide to its neighbors could be deliberately distorted. Malicious nodes
will send false information to the fusion center in a centralized CRN.
The actual meaning of trust is domain and context specific. Consider, for example,
networking; at the MAC layer the multiple-access protocols assume that all senders follow the
channel access policy, e.g., in Carrier Sense Multiple Access with Collision Detection (CSMA-
CD) a sender senses the channel and then attempts to transmit if no one else does. In a store-and-
forward network, trust assumes that all routers follow a best-effort policy to forward packets
toward their destination.
The algorithm computes the trust of node 1 < i < n in each node in its vicinity, j ∈ Vi ,
and requires several preliminary steps. The basic steps executed by a node i at time t are:
1. Determine node i ‘s version of the occupancy report for each one of the K channels:
In this step node i measures the power received on each of the K channels.
2. Determine the set Vi (t) of the nodes in the vicinity of node i . Node i broadcasts a message
and individual nodes in its vicinity respond with their NodeId.
5. Use the location and power information determined in the previous two steps to infer the
status of each channel:
Data partitioning for the simulation of a trust algorithm. The area covered is of size 100 × 100
units. The nodes in the four subareas of size 70 ×70 units are processed by an instance of the
cloud application. The subareas allocated to an instance overlap to allow an instance to have all
the information about a node in its coverage area.
Data streaming is the name given to the transfer of data at a high rate with real-time
constraints. Multimedia applications such as music and video streaming, high-definition
television (HDTV), scientific applications that process a continuous stream of data collected by
sensors, the continuous backup copying to a storage medium of the data flow within a computer,
and many other applications require the transfer of real-time data at a high rate.
The resources necessary to guarantee the timing constraints include CPU cycles and
buffer space at the sender and the receiver, as well as network bandwidth. Adaptive data
streaming determines the data rate based on the available resources. Lower data rates imply
lower quality, but they reduce the demands for system resources.
Accommodating dynamic data flows with timing constraints is nontrivial; only about 18% of the
top 100 global video Web sites use adaptive bit rate (ABR) technologies for streaming.
Design decision is how the two services should interact to optimize performance. Two
alternatives come to mind:
1. The audio service running on the EC2 platform requests the data file from the S3, converts it,
and, eventually, sends it back. The solution involves multiple delays and it is far from optimal.
2. Mount the S3 bucket as an EC2 drive. This solution reduces considerably the start-up time for
audio streaming.
The results of our measurements when the instance is the t1.micro server exhibit a wide range of
conversion times, 13–80 seconds, for the large audio file of about 6.7 MB when we convert from
320 to 192 Kbps.
Google App Engine is a PaaS cloud that provides a complete Web service
environment(Platform)
GAE provides Web application development platform for users.
All required hardware, operating systems and software are provided to clients.
Clients can develop their own applications, while App Engine runs the applications on
Google‘s servers.
GAE helps to easily develop an Web Application
App Engine only supports the Java and Python programming languages.
The Google App Engine (GAE) provides a powerful dis tributed data storage service.
2) Flexible Environment where developers have more flexibility such as running custom
runtimes using Docker, longer request & response timeout, ability to install custom
dependencies/software and SSH into the virtual machine.
GAE Components:
GAE ARCHITECTURE:
App Engine is created under Google Cloud Platform project when an application resource is
created. The Application part of GAE is a top- level container that includes the service, version
and instance-resources that make up the app.
Components of GWT:
o GWT Java-to-JavaScript Compiler: It translates all the Java written code into
JavaScript.
o GWT Development Mode: It allows the developers to run application in development
mode i.e. app run in Java without compiling JavaScript. Development mode allows native
mode plug- in called Google Web Toolkit Developer Plug- in.
To build a GWT application we have four sections, in this last section is optional.
Syntax: name.gwt.xml
Here, "name " is the name of application. All configuration files are in project root directory.
2) UI design: It consists of HTML, CSS or Images which used to design GWT application. We
can configured its location by using <public path = "location address" /> tag. We can find the
configuration files in module configuration.
3) Client Side Code: In this section conversion of all the codes and business logic of application
is converted into JavaScript using GWT compiler. We can find the location of resource
using <source path = "path" /> tag. This code consists of Entry Point code which can be
written without the parameter. When GWT application module is loaded
then EntryPoint.onModuleLoad() method is called each time.
4) Server Side Code: In this section we can execute Server side code. If our application does not
have any backend (server side script or database) then this section is optional.
The components in the Azure Service platform includes Live Services, SQL Azure for targeted
cloud database management, SharePoint Services, Dynamic Customer Relationship
Management (CRM) Services, and AppFabric providing different sets of application-centric
services.
Azure Services:
o Compute services: It includes the Microsoft Azure Cloud Services, Azure Virtual
Machines, Azure Website, and Azure Mobile Services, which processes the data on the
cloud with the help of powerful processors.
1. Windows Azure
2. SQL Services
3. .NET Services
4. Live Services
1. Windows Azure:
Windows Azure is a Cloud-based Operating System.
Provides the Development, hosting, and service management environment to Azure
Services Platform.
Supports existing standards like SOAP, REST, and XML.
Developers can use the Visual Studio skills to build applications and services
Uses of Windows Azure:
• Widows Azure can be used to
1. Add Web Service applications to existing applications
2. Build and Modify applications and then move them onto the Web
3. Make, test, debug, and distribute web services efficiently and inexpensively
4. Reduce the cost of IT Management
2. SQL Services
Microsoft SQL Services extend SQL Server capabilities to the cloud as web-based
services.
3. .NET Services
Microsoft .NET Services are a Set of Microsoft hosted, developer oriented services.
Provides components and high- level class libraries.
Similar to .NET Framework that help developers to focus more on their product
development.
.NET services are also available to other development technologies through the use of
industry standard protocols like REST, SOAP, and HTTP.
Windows Live
Windows Live is the former collective brand name for a set of services and software
products from Microsoft; part of their software plus services platform. A majority of these
services are Web applications, accessible from a browser, but there are also client-side binary
applications that require installation. There are three ways in which Windows Live services are
offered: Windows Essentials applications, web services, and mobile services.
Windows Live is an integrated set of online services that makes it easier and more fun
for consumers to communicate and share with others. The new generation of Windows
Live includes updated experiences for photo sharing, email, and instant messaging, as
well as integration with multiple third-party sites.
These are the key features of the online standard version of the solution:
A 5GB mailbox (additional storage available for purchase—up to 25GB), shared
calendar, contacts, tasks
Outlook Client Connectivity including Outlook Anywhere
Outlook Web Access
Virus/spam filtering via Exchange Hosted Filtering
Push email for Microsoft Windows Mobile 6.0/6.1 and Exchange ActiveSync 12 devices
Coexistence, or the ability for some users to be on mail servers on premises and for some
to be online.
Migration Tools to help you move your current mailbox data into the online environment
SharePoint sites are places where teams can participate in discussions, shared
document collaboration, and surveys. Site content can be accessed from a web
browser and through clients that support web services. Document collaboration
controls allow you to check in, check out, and control document versioning.
Microsoft Office System programs use SharePoint site content. A site‘s
collaborative content—like documents, lists, events, and so forth—can be read and
edited with Microsoft Office Word. Picture editing is also possible. Microsoft
Office Outlook allows SharePoint site event calendars to be viewed side by side
with personal calendars.
SharePoint consulting team will help you with the following customized solutions:
―At Microsoft, we‘re revolutionizing how companies deploy marketing, sales, and service
solutions to users within their organization,‖ said Brad Wilson, general manager of
Microsoft Dynamics CRM at Microsoft.
―Microsoft Dynamics CRM delivers the power of choice to customers, with a familiar
and productive user experience and a multitenant platform that enables fast on-premise
implementations or ‗instant-on‘ deployments over the Internet.‖
In addition to full access through a zero-footprint browser client, the new service delivers
marketing, sales, and service information within a native Microsoft Office experience,
integrated with the desktop tools that employees already use every day, enabling
businesses to ramp up end-user adoption and productivity rapidly.
• Microsoft Dynamics CRM Online Professional Plus delivers all the capabilities of
the Professional version plus offline data synchronization with expanded data
storage, workflow, and customization options that give businesses 20GB of data
storage, 200 configurable workflows, and 200 custom entities. The Professional
Plus edition is priced at US$59 per user per month.