Upload
rilfiun
View
216
Download
0
Embed Size (px)
Citation preview
8/22/2019 Distributed Cloud Infrastructure Over Web Browsers
1/27
D i s t r i b u t e d C l o u d I n f r a s t r u c t u r e O v e r W e b B r o w s e r s
A . S . A r i y a w a n s a
1 0 8 2 5 2 L
T h e s i s s u b m i t t e d i n p a r t i a l f u l l l m e n t o f t h e r e q u i r e m e n t s f o r
t h e d e g r e e o f M a s t e r o f S c i e n c e
D e p a r t m e n t o f C o m p u t e r S c i e n c e a n d E n g i n e e r i n g
U n i v e r s i t y o f M o r a t u w a
S r i L a n k a
F e b 2 0 1 1
8/22/2019 Distributed Cloud Infrastructure Over Web Browsers
2/27
8/22/2019 Distributed Cloud Infrastructure Over Web Browsers
3/27
D E C L A R A T I O N
I d e c l a r e t h a t t h i s i s m y o w n w o r k a n d t h i s t h e s i s / d i s s e r t a t i o n
d o e s n o t i n c o r p o r a t e w i t h o u t a c k n o w l e d g m e n t a n y m a t e r i a l p r e -
v i o u s l y s u b m i t t e d f o r a D e g r e e o r D i p l o m a i n a n y U n i v e r s i t y o r
o t h e r i n s t i t u t e o f h i g h e r l e a r n i n g a n d t o t h e b e s t o f m y k n o w l e d g e
a n d b e l i e f i t d o e s n o t c o n t a i n a n y m a t e r i a l p r e v i o u s l y p u b l i s h e d
o r w r i t t e n b y a n o t h e r p e r s o n e x c e p t w h e r e t h e a c k n o w l e d g m e n t
i s m a d e i n t h e t e x t .
S t u d e n t N a m e D a t e
A p p r o v e d b y :
S u p e r v i s o r N a m e D a t e
D e p a r t m e n t o f C o m p u t e r S c i e n c e a n d E n g i n e e r i n g
U n i v e r s i t y o f M o r a t u w a
i i i
8/22/2019 Distributed Cloud Infrastructure Over Web Browsers
4/27
C O P Y R I G H T S T A T E M E N T
I h e r e b y g r a n t t h e U n i v e r s i t y o f M o r a t u w a t h e r i g h t t o a r c h i v e
a n d t o m a k e a v a i l a b l e m y t h e s i s o r d i s s e r t a t i o n i n w h o l e o r p a r t
i n t h e U n i v e r s i t y L i b r a r i e s i n a l l f o r m s o f m e d i a , s u b j e c t t o t h e
p r o v i s i o n s o f t h e c u r r e n t c o p y r i g h t a c t o f S r i L a n k a . I r e t r a i n a l l
p r o p r i e t a r y r i g h t s , s u c h a s p a t e n t r i g h t s . I a l s o r e t a i n t h e r i g h t t o
u s e i n f u t u r e w o r k s ( s u c h a s a r t i c l e s o r b o o k s ) a l l o r p a r t o f t h i s
t h e s i s o r d i s s e r t a t i o n .
S t u d e n t N a m e D a t e
I h a v e s u p e r v i s e d a n d a c c e p t e d t h i s t h e s i s / d i s s e r t a t i o n f o r t h e
a w a r d o f t h e d e g r e e .
S u p e r v i s o r N a m e D a t e
D e p a r t m e n t o f C o m p u t e r S c i e n c e a n d E n g i n e e r i n g
U n i v e r s i t y o f M o r a t u w a
i v
8/22/2019 Distributed Cloud Infrastructure Over Web Browsers
5/27
A B S T R A C T
T h e a b s t r a c t g o e s h e r e . U s u a l l y , o n e p a g e .
v
8/22/2019 Distributed Cloud Infrastructure Over Web Browsers
6/27
A C K N O W L E D G E M E N T
T h e a c k n o w l e d g e m e n t g o e s h e r e . U s u a l l y , o n e p a g e .
v i
8/22/2019 Distributed Cloud Infrastructure Over Web Browsers
7/27
C o n t e n t s
D E C L A R A T I O N . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . i i i
C O P Y R I G H T S T A T E M E N T . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . i v
A B S T R A C T . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . v
A C K N O W L E D G E M E N T . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . v i
1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1 . 1 I n t r o d u c t i o n . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1 . 2 M o t i v a t i o n . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1 . 3 C o n c e p t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1 . 4 C h a l l e n g e s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1 . 5 D o m a i n A r e a s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2 . 1 C l o u d C o m p u t i n g . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2 . 2 D e p l o y m e n t a r c h i t e c t u r e s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2 . 2 . 1 P u b l i c C l o u d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2 . 2 . 2 P r i v a t e C l o u d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2 . 2 . 3 F o c u s i n D e e p . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2 . 3 W e b T e c h n o l o g i e s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2 . 3 . 1 A j a x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2 . 3 . 2 H t t p P u l l . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2 . 3 . 3 P a g e S t r e a m i n g . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2 . 3 . 4 S e r v i c e S t r e a m i n g . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 0
2 . 3 . 5 F l a s h S o c k e t C o m m u n i c a t i o n . . . . . . . . . . . . . . . . . . . . . . 1 0
2 . 3 . 6 D i s c u s s i o n . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 0
2 . 4 W e b S o c k e t s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1
2 . 5 R e s e a r c h e s o n W e b S o c k e t s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 2
2 . 5 . 1 R e a l - t i m e C o l l a b o r a t i v e E d i t i n g w i t h W e b S o c k e t s ,
N o d e . j s a n d R e d i s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 2
v i i
8/22/2019 Distributed Cloud Infrastructure Over Web Browsers
8/27
v i i i C o n t e n t s
2 . 5 . 2 E a r t h C o n t r o l . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 3
R e f e r e n c e s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 7
8/22/2019 Distributed Cloud Infrastructure Over Web Browsers
9/27
L i s t o f F i g u r e s
1 . 1 C o n c e p t O v e r v i e w . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
2 . 1 C l o u d S e r v i c e M o d e l . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2 . 2 W e b S o c k e t O v e r v i e w . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1
2 . 3 E a r t h C o n t r o l A r c h i t e c t u r e . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 4
i x
8/22/2019 Distributed Cloud Infrastructure Over Web Browsers
10/27
L i s t o f T a b l e s
x
8/22/2019 Distributed Cloud Infrastructure Over Web Browsers
11/27
C h a p t e r 1
1 . 1 I n t r o d u c t i o n
T h e c o n c e p t o f c l o u d c o m p u t i n g h a s b e c o m e o n e o f t h e m o s t i n n o v a t i v e a n d
a t t r a c t i v e c o n c e p t s i n p a s t f e w y e a r s . I t e v o l v e d w i t h t h r e e b a s i c c o n c e p t s
c a l l e d S o f t w a r e a s a S e r v i c e ( S A A S ) , P l a t f o r m a s a S e r v i c e ( P A A S ) a n d I n -
f r a s t r u c t u r e a s a S e r v i c e ( I A A S ) . A s f a r a s t h e I A A S i s c o n c e r n e d i t i s s i m p l e
a s s u c h t h a t , t h e t a s k w h i c h n e e d s h i g h a v a i l a b i l i t y o f r e s o u r c e s e g : - C P U
p o w e r , s t o r a g e e t c a r e s u b m i t t e d t o t h e c l o u d , g e t s c o m p u t e d t h e r e a n d a s k s
t h e r e s u l t s f r o m i t . B u t i n t h i s p a r a d i g m t h e m i s s i n g p a r t i s t h a t h o w t h e
c l o u d h a n d l e s o r c o m p u t e s t a s k s w i t h i t s i n f r a s t r u c t u r e . C u r r e n t l y t h e c l o u d
i n f r a s t r u c t u r e p r o v i d e s h a v e l a r g e s e t s o f c l u s t e r s s e t u p i n t h e r e e n v i r o n m e n t .
S o t h e c o m p u t a t i o n i s s t i l l c e n t r a l i z e d a n d c l o u d p r o v i d e r s h a v e t o s p e n d l o t
o f m o n e y t o m a i n t a i n t h e i r i n f r a s t r u c t u r e .
W h a t i f w e c a n c h a n g e t h i s p a r a d i g m s u c h t h a t t h e c l o u d i s a l s o d i s t r i b u t e d
a m o n g t h e u s e r s o f t h e I n t e r n e t ? I n o t h e r w o r d s , i f w e c a n c o m e u p w i t h
a f r a m e w o r k w h e r e t h e h i g h c o m p u t a t i o n a l j o b s a r e d i s t r i b u t e d a m o n g t h e
I n t e r n e t u s e r s a n d g e t t h e c o m p u t a t i o n d o n e u s i n g t h e i r o w n C P U p o w e r a n d
g e t c o n t r i b u t i o n t o t h e n a l t a s k c o m p l e t i o n , t h e n e e d o f h a v i n g h i g h c o s t
c l o u d i n f r a s t r u c t u r e c a n b e m i n i m i z e d . U l t i m a t e l y t h e r e s u l t s c o m i n g f r o m
e a c h o f t h e s e u s e r s / c l i e n t s w i l l o u t p u t s t h e t o t a l r e s u l t o f t h e g i v e n t a s k . T h i s
i s w h a t t h e m a i n i n t e n t i o n o f t h e W e b B a s e d D i s t r i b u t e d C l o u d C o m p u t i n g
F r a m e w o r k .
1 . 2 M o t i v a t i o n
A s f a r a s t h e h i s t o r y o f v o l u n t e e r C o m p u t i n g i s c o n c e r n e d i t h a s b e e n e v o l v e d
s i n c e 2 0 0 0 . B u t a l l t h e s o l u t i o n s g i v e n w e r e t o t a l l y b a s e d o n T C P s o t h a t t h e
c l i e n t i n s t a l l a t i o n s a r e a l s o n e e d e d t o d e a l w i t h c l i e n t s e r v e r c o m m u n i c a t i o n .
T h i s l e t s u s e r s t o g o a w a y f r o m t h i s c o n c e p t .
1
8/22/2019 Distributed Cloud Infrastructure Over Web Browsers
12/27
2 1
O n t h e o t h e r h a n d H T T P i s c o n c e r n e d i t w a s o n e w a y c o m m u n i c a t i o n
m e c h a n i s m s o f a r w h e r e t h e c l i e n t o r t h e w e b b r o w s e r n e e d s t o i n i t i a t e t h e
r e q u e s t a l l t h e t i m e f r o m t h e s e r v e r t o g e t t h e o u t p u t . B u t t h i s i s n o t t h e
s i t u a t i o n h e r e a f t e r . W i t h t h e e m e r g e n c e H T M L 5 a n d w e b s o c k e t s , t h e r e i s a
f u l l d u p l e x c o m m u n i c a t i o n m e d i u m b e t w e e n c l i e n t ( w e b b r o w s e r ) a n d s e v e r
s o t h a t i t i s p o s s i b l e t o p u l l a n d p u s h d a t a b e t w e e n e a c h o t h e r .
W e b B a s e d D i s t r i b u t e d C l o u d C o m p u t i n g F r a m e w o r k c o m b i n e s a b o v e
t e c h n o l o g i e s a n d e x t e n d s t h e s o l u t i o n t o w o r k o n w e b b r o w s e r s c o l l a b o r a -
t i v e l y . A s a r e s u l t t h e I n t e r n e t u s e r s c a n v o l u n t a r y p a r t i c i p a t e t o c o m p l e t e a
j o b w h i c h i s p u b l i s h e d o n t h e I n t e r n e t . ( J o b p u b l i s h i n g p r o c e s s i s d i s c u s s e d
l a t e r ) .
1 . 3 C o n c e p t
F i g . 1 . 1 C o n c e p t O v e r v i e w
J o b / T a s k h o s t i n g w e b s i t e c a n b e a n y w e b s i t e o n t h e I n t e r n e t . S i n c e
i t i s n e e d e d u s e r s t o s t a y a t t h e s i t e a s m u c h a s p o s s i b l e , m o s t p r e f e r a b l e
s i t e s w o u l d b e b l o g s i t e s , m a i l c l i e n t s e t c . W i t h t h e i m p l e m e n t a t i o n s o f f a u l t
t o l e r a n t a c t i v i t i e s d i s c u s s e d l a t e r t h i s c a n b e a n y t h e w e b s i t e .
8/22/2019 Distributed Cloud Infrastructure Over Web Browsers
13/27
1 . 4 C h a l l e n g e s 3
J o b P r o v i d e r s c a n b e a n a p p l i c a t i o n w h i c h h a s h i g h c o m p u t a t i o n a l p o w e r
c o n s u m i n g t a s k s s t o r e d o r c a n e v e n b e a h u m a n . J o b p r o v i d e r c a n s u b m i t a
j o b t o o n e o f t h e J o b / T a s k h o s t i n g w e b s i t e s . I t i s p r e f e r r e d t h a t t h e s e j o b s
a r e e a s i l y e a s i l y d i s t r i b u t e d . S u b m i t t e d j o b s a r e p u b l i s h e d o n a p u b l i c w e b
p a g e w h e r e m o s t o f t h e u s e r s a r e v i s i n g . E g : - c o m m o n b l o g p a g e .
C l i e n t s a r e j u s t w e b b r o w s e r s w h i c h s u p p o r t s H T M L 5 ( w e b s o c k e t s ) t e c h -
n o l o g y o r a l t e r n a t i v e t e c h n o l o g i e s w h i c h a r e d i s c u s s e d l a t e r .
W h e n u s e r s v i s i t i n g t h e s i t e u s i n g t h e i r b r o w s e r s , j o b s h o s t e d o n t h a t
s i t e g e t s i n v o k e d a n d b e g i n s t h e s t r e a m i n g p r o c e s s o f d a t a ( w h i c h a r e t o b e
p r o c e s s e d ) a n d t h e c o d e n e e d s f o r t h e e x e c u t i o n t o t h e c l i e n t e n v i r o n m e n t . (
S t a n d a r d a l g o r i t h m s f o r t a s k d i s t r i b u t i o n w i l l b e u s e d h e r e . )
A f t e r t h a t t h e c l i e n t / b r o w s e r s t a r t s t o e x e c u t e t h e j o b .
S a m e w a y e a c h u s e r w h o v i s i t s t h e s i t e w i l l b e g i v e n a p a r t o f t h e j o b t o
b e e x e c u t e d .
A s a r e s u l t m a i n j o b g e t s e x e c u t e d p a r a l l e l s i n d i s t r i b u t e d e n v i r o n m e n t .
( S t a n d a r d s y n c h r o n i z a t i o n a n d c o m m u n i c a t i o n a l g o r i t h m s r e l a t e d t o d i s -
t r i b u t e d c o m p u t i n g w i l l b e a p p l i e d h e r e . )
T h e r e s u l t s o f e a c h p r o c e s s w i l l b e s e n t b a c k t o j o b h o s t e d s e r v e r w h i c h
c a n t h e n o b t a i n t h e n a l r e s u l t .
T h i s p a r a d i g m t r i e s t o a c h i e v e t h e c l o u d c o n c e p t I A A S i n g e o g r a p h i c a l l y
d i s t r i b u t e d e n v i r o n m e n t . H e r e t h e j o b h o s t e d s i t e b e c o m e s t h e c o o r d i n a t o r
a n d c l i e n t b r o w s e r s t h e m s e l v e s b e c o m e t h e n o d e s o n t h e c l o u d w h i c h s h a r e
t h e i r c o m p u t a t i o n a l p o w e r .
1 . 4 C h a l l e n g e s
S i n c e w e b b r o w s e r i s t h e m o s t f r e q u e n t l y u s e d a p p l i c a t i o n i n u s e r s e n v i r o n -
m e n t , b y v i s i t i n g t h e s e j o b h o s t e d s i t e d s h o u l d n o t l e a d t o s l o w d o w n t h e
w h o l e b r o w s e r a p p l i c a t i o n . S p e c i a l l y w h e n i t c o m e s t o b r o w s e r s l i k e G o o g l e -
C h r o m e i t c r e a t e s a s e p a r a t e p r o c e s s f o r e a c h o f t h e t a b i t u s e s t o s i t e t h e
s i t e s . S o s l o w n e s s i n o n e s i t e w o u l d n o t a e c t t h e w h o l e b r o w s e r a p p l i c a t i o n .
S i n c e h e r e w e a r e u s i n g t h e u s e r s c o m p u t a t i o n a l p o w e r , t h e r e s h o u l d b e
a m e c h a n i s m o f a s k i n g t h e p e r m i s s i o n f r o m t h e m b e f o r e e x e c u t i n g t h e j o b s .
T h e r e f o r e w h e n t h e u s e r l o g s o n t o t h e s i t e , h e / s h e w i l l b e a s k e d f o r p e r -
m i s s i o n . O n t h e o t h e r h a n d u s e r s f r e q u e n t l y g o f o r t h o s e s i t e s t o g e t s o m e
s e r v i c e s d o n e . E g : - e m a i l , b l o g r e a d i n g . S o i t i s b e l i e v e d t h a t t h e u s e r s w i l l
g r a n t t h e i r p e r m i s s i o n i n o r d e r t o c o m p e n s a t e t h o s e s e r v i c e s .
A s f a r a s f a u l t t o l e r a n c e i s c o n c e r n e d t h e r e a r e p o s s i b i l i t i e s l i k e c l o s i n g t h e
b r o w s e r o r v i s i n g a n o t h e r w e b p a g e w h i l e e x e c u t i n g t h e j o b s . I n t h e s e t h e r e
s h o u l d b e m e c h a n i s m s t o m a k e t h e j o b s w o r k i n g i n b a c k g r o u n d o r n o t i f y i n g
t h e u s e r a b o u t t h e c o n s e q u e n c e s . L o t s o f r e d u n d a n t t e c h n i q u e s w i l l b e u s e d
t o o b t a i n m o r e r e l i a b l e o u t p u t .
8/22/2019 Distributed Cloud Infrastructure Over Web Browsers
14/27
4 1
1 . 5 D o m a i n A r e a s
F e w o f t h e b u s i n e s s u s e c a s e s w h e r e t h e c o n c e p t c a n b e a p p l i e d a r e a r e d e -
s c r i b e d b e l o w .
7 . 1 . R e a l T i m e M a r k e t D a t a A n a l y s i s T o d a y p e o p l e u s e w e b b a s e d c l i e n t s
t o t r a c k t h e c h a n g e s i n s t o c k m a r k e t d a t a . T h i s a p p l i c a t i o w i l l b e c o m e m o r e
c o n v e n i e n t i f t h e u s e r s c a n s e e t h e h i s t o r y o f t h e s t o c k s a n d h o w t h e y w e r e
u c t u a t e d i n a p i c t o r i a l m a n n e r , w h i l e g e t t i n g t h e u p d a t e s . S i n c e t h i s i s m o r e
c o m p u t a t i o n a l p o w e r n e e d i n g t a s k t h i s c a n b e d i s t r i b u t e d a m o n g t h e u s e r s
w h o a r e v i s i t i n g t h e w e b s i t e , s o t h a t r e a l t i m e c a l c u l a t i o n w i l l b e d o n e . A s
a r e s u l t s s a m e u s e r s c a n v i e w t h e h i s t o r i c a l d e t a i l s i n a s e p a r a t e p a r t o f t h e
w e b a p p l i c a t i o n w h i l e d o i n g t h e o t h e r o r d i n a r y o p e r a t i o n s .
7 . 2 . R e a l T i m e D a t a M i n i n g D a t a m i n i n g i s o n e a r e a w h e r e h i g h c o m p u t a -
t i o n a l p o w e r i s n e e d e d . A l s o d a t a m i n i n g t e c h n i q u e s a r e a l w a y s d e a l i n g w i t h
e m b a r r a s s i n g l y p a r a l l e l , e a s i l y d i s t r i b u t a b l e a l g o r i t h m s . W h e n i t c o m e s t o
t h e b u s i n e s s p o i n t o f v i e w t y p i c a l w e b a p p l i c a t i o n s h a v e t o n s o f d a t a . M a n y
o r g a n i z a t i o n s w a n t t o a n a l y z e t h e s e d a t a a n d n d o u t s o m e p a t t e r n s w h i c h
w i l l h e l p n d i n g p o t e n t i a l o p p o r t u n i t i e s . T h i s a n a l y t i c a l p r o c e s s n e e d s m o r e
C P U p o w e r , b u t s i n c e i t i s n o t p a r t o f m a i n o p e r a t i o n s t h e y m a y n o t u s e
t h e i r l o c a l r e s o u r c e s f o r t h i s p u r p o s e . A s a s o l u t i o n t h e y c a n p u b l i s h s u c h
d a t a m i n i n g o p e r a t i o n s o n t h e i r w e b a p p l i c a t i o n s s o t h a t a n a l y t i c a l p r o c e s s
w i l l a l s o b e e x e c u t e d i n b a c k g r o u n d w h i l e s e r v i n g o t h e r d a y t o d a y s e r v i c e s .
7 . 3 . H i g h C o m p u t a t i o n a l t a s k s r e l a t e d t o w o r l d w i l d w e b . T h e r e a r e s o
m a n y C P U b o u n d a l g o r i t h m s r e l e v a n t t o t h e I N T E R N E T ( w w w ) w h e r e t h e
c o n c e p t c a n b e a p p l i e d . C r e a t i n g I n v e r t e d I n d e x , v e c t o r i m a g e p r o c e s s i n g ,
w e a t h e r d a t a a n a l y s i s a l g o r i t h m s a r e s o m e o f t h e m .
8/22/2019 Distributed Cloud Infrastructure Over Web Browsers
15/27
C h a p t e r 2
2 . 1 C l o u d C o m p u t i n g
" A C l o u d i s a t y p e o f p a r a l l e l a n d d i s t r i b u t e d s y s t e m c o n s i s t i n g o f a c o l l e c t i o n
o f i n t e r c o n n e c t e d a n d v i r t u a l i z e d c o m p u t e r s t h a t a r e d y n a m i c a l l y p r o v i s i o n e d
a n d p r e s e n t e d a s o n e o r m o r e u n i e d c o m p u t i n g r e s o u r c e s b a s e d o n s e r v i c e -
l e v e l a g r e e m e n t s e s t a b l i s h e d t h r o u g h n e g o t i a t i o n b e t w e e n t h e s e r v i c e p r o v i d e r
a n d c o n s u m e r s . [ 1 ]
L e w i s C u n n i n g h a m , a n O r a c l e d a t a a r c h i t e c t d e n e s c l o u d c o m p u t i n g
( m o r e s u c c i n c t l y , b u t s l i g h t l y l e s s a c c u r a t e l y ) , a s u s i n g t h e I n t e r n e t t o a c c e s s
s o m e o n e e l s e ' s s o f t w a r e r u n n i n g o n s o m e o n e e l s e ' s h a r d w a r e i n s o m e o n e e l s e ' s
d a t a c e n t e r w h i l e p a y i n g o n l y f o r w h a t y o u u s e . [ 2 ]
T h e r s t d e n i t i o n i l l u s t r a t e s t h e t r u e d i s t r i b u t e d n a t u r e o f t h e w h o l e
c l o u d c o n c e p t b y h a v i n g c o l l e c t i o n o f i n t e r c o n n e c t e d c o m p u t e r s w h i c h a r e
i n t e n d e d f o r c o m m o n t a s k . W h e r e a s t h e s e c o n d d e n i t i o n m a k e s t h i s c o n c e p t
m o r e u s e f u l w h i l e m a k i n g i t a v a i l a b l e o n t h e i n t e r n e t . M o r e o v e r i t f u r t h e r
p o i n t s o u t t h a t t h e t a s k t o b e p e r f o r m e d w i l l b e r u n n i n g o n s o m e h a r d w a r e
w h i c h a r e b e l o n e d t o s o m e o n e e l s e . . . . . . . . . . . . . .
E v e n t h o u g h t o d a y t h e c l o u d c o m p u t i n g e v o l v e d i n m a n y s u b c a t e g o r i e s ,
s t i l l t h r e e m a i n f u n d a m e n t a l c o n c e p t s r e m a i n s a m e . T h e y a r e ,
1 . S o f t w a r e a s a S e r v i c e ( S A A S )
2 . P l a t f o r m a s a S e r v i c e ( P A A S )
3 . I n f r a s t r u c t u r e a s a S e r v i c e ( I A A S )
5
8/22/2019 Distributed Cloud Infrastructure Over Web Browsers
16/27
6 2
F i g . 2 . 1 C l o u d S e r v i c e M o d e l
2 . 2 D e p l o y m e n t a r c h i t e c t u r e s
W h e n t h e c o n c e p t o f c l o u d b e g a n t o g r o w i n r a p i d m a n n e r p e o p l e t e n d t o
t h i n k a b o u t d i e r e n t d e p l o y m e n t a r c h i t e c t u r e s w h i c h r e e c t s t h e w a y s o f
m a i n t a i n i n g c l o u d s e r v i c e s . A s a r e s u l t s e v e r a l m o d e l w e r e u s e d b a s e d o n t h e
r e q u i r e m e n t s .
2 . 2 . 1 P u b l i c C l o u d
S i n c e I n t e r n e t u s a g e w e n t r e a l l y h i g h w i t h i n l a s t f e w d e c a d e s s o m e c o m p a n i e s
t h o u g h t s h a r i n g t h e r e r e s o u r c e s a s c l o u d s e r v i c e s . A s a r e s u l t a l l t h r e e m a i n
k i n d s o f s e r v i c e s ( I A A S , P A A S , S A A S ) w e r e a v a i l a b l e o n t h e I n t e r n e t . T h e s e
p r o v i d e r s a r e c a l l e d c l o u d s e r v i c e p r o v i d e r s . I n p u b l i c c l o u d e n v i r o n m e n t s
D a t a a n d P r o c e s s i n g a r e t o t a l l y h a n d l e d b y t h e c l o u d s e r v i c e p r o v i d e r i t s e l f .
T h e m a i n a d v a n t a g e s o f t h i s s c e n a r i o a r e ,
N o i n s t a l l a t i o n a n d m a i n t e n a n c e c o s t n e e d e d .
8/22/2019 Distributed Cloud Infrastructure Over Web Browsers
17/27
2 . 2 D e p l o y m e n t a r c h i t e c t u r e s 7
I f y o u n e e d m o r e c o m p u t i n g p o w e r , i t c a n b e o b t a i n e d o n d e m a n d .
2 . 2 . 2 P r i v a t e C l o u d
I n f a c t p r i v a t e c l o u d i s b e c o m i n g m o r e a n d m o r e p o p u l a r a m o n g t h e o r g a -
n i z a t i o n s d u e t o s o m e k e y d i s a d v a n t a g e s o f t h e p u b l i c c l o u d . O n e c o m m o n
s u c h f a c t i s t h a t p r i v a c y . A l l t h e d a t a i s h a n d l e d b y t h e s e r v i c e p r o v i d e r i t s e l f
h e n c e n o g u a r a n t e e t h a t t h e d a t a i s p r o t e c t e d . O n t h e o t h e r h a n d a l r e a d y
e x i s t i n g l e g a c y a p p s a r e h a r d t o m a k e a n i n t e g r a t i o n w i t h t h e m o d e r n p u b l i c
c l o u d s . A s a r e s u l t p r i v a t e c l o u d a r c h i t e c t u r e e m e r g e d .
i n P r i v a t e c l o u d e n v i r o n m e n t s t h e s e t o f c o m p u t e r r e s o u r c e s l i k e h i g h p e r -
f o r m a n c e C P U s , S t o r a g e e t c a r e p l a c e d w h i c h i s o n l y a c c e s s i b l e t o t h e a n o r -
g a n i z a t i o n s o t h a t i t w o r k s a s t h e i n f r a s t r u c t u r e t o t h e i n t e r n a l c l o u d . C l o u d
s e r v i c e p r o v i d i n g a p p l i c a t i o n s a r e r u n n i n g o n t o p o f t h a t . S o a n y t h e m o s t o f
t h e t a s k w h i c h n e e d m o r e p o w e r i n t e r m s o f C P U f o r a n e x a m p l e a r e g i v e n
t o t h e S A A S a p p l i c a t i o n w h i c h r u n s o n t o p t o t h a t i n t e r n a l i n f r a s t r u c t u r e .
T h a t i s w h y t h i s i s c a l l e d C l o u d i n H o u s e .
2 . 2 . 3 F o c u s i n D e e p
W h e t h e r i t i s p r i v a t e o r p u b l i c , a s f a r a s t h e i n f r a s t r u c t u r e o f t h e C l o u d
c o m p u t i n g e n v i r o n m e n t i s c o n c e r n e d i t i s j u s t s t a c k o f C P U s , S t o r a g e e t c
w h i c h a r e c o m b i n e d t o g e t h e r a s a g r i d o n a w e l l c o n t r o l l e d e n v i r o n m e n t . T h e
e x p o s u r e t o t h e p u b l i c o r w i t h i n t h e o r g a n i z a t i o n i s t h e f a c t w h i c h d i e r s
i t ' s p r i v a t e n e s s . O n l y t h e u p p e r l a y e r s l i k e S A A S p r o v i d e s t h e h a r d w a r e a b -
s t r a c t i o n t o m a k e r u n d i e r e n t t y p e o f a p p l i c a t i o n s w h i c h a r e o t h e r w i s e h a r d
t o p e r f o r m o n a s i n g l e p e r s o n a l c o m p u t e r . T h u s t h e C l o u d i s a c e n t r a l i z e d
p o i n t w h i c h p r o v i d e s s e r v i c e s t o i t ' s c o m m u n i t y . W h a t i f w e c a n c h a n g e t h i s
c e n t r a l i z e d d i m e n s i o n s o f c l o u d i n f r a s t r u c t u r e a n d m a k e i t a v a i l a b l e o n t h e
h a r d w a r e w h i c h i t s e l f i s d i s t r i b u t e d ?
O n t h e o t h e r h a n d a s m e n t i o n e d m a i n d i s a d v a n t a g e o f p r i v a t e c l o u d i s
t h a t i t n e e d s d e d i c a t e d h a r d w a r e w i t h i n t h e o r g a n i z a t i o n a l n e t w o r k ( o r a n y
o t h e r p l a c e w h i c h i s o n l y a c c e s s i b l e t o t h e o r g a n i z a t i o n ) . D u e t o l a c k o f r e -
s o u r c e i n m a n y s m a l l l e v e l o r g a n i z a t i o n s a r e g o a w a y o f t h e c o n c e p t o f p r i v a t e
c l o u d . W h a t i f w e c a n n d a s o l u t i o n w h e r e n o a n y f u r t h e r d e d i c a t e d h a r d -
w a r e i s n e e d e d , b u t t h e p e r s o n a l c o m p u t e r s t h e m s e l v e s b e c o m e a n o d e s o f a
d i s t r i b u t e d c l o u d w h e n t h e y a r e i d l e ?
I n 1 9 8 9 , T i m B e r n e r s - L e e , a B r i t i s h c o m p u t e r s c i e n t i s t i n v e n t e d t h e w o r l d
w i l d w e b [ 3 ] . O n t h a t d a y o n w a r d s w w w i s b e i n g u s e d f o r s o m a n y p u r p o s e s .
W i t h t h e e m e r g e n c e o f g r a p h i c a l w e b b r o w s e r i n 1 9 9 3 [ 4 ] , i n f a c t t o t a l I n t e r n e t
8/22/2019 Distributed Cloud Infrastructure Over Web Browsers
18/27
8 2
i s a l m o s t c o n q u e r e d b y i t . A m o n g t h e m o n l i n e e m a i l s , b l o g r e a d i n g , i n f o r -
m a t i o n l e a n i n g a r e b e c o m e m o s t c o m m o n a s w e l l a s v a l u a b l e . D o i n g t h o s e
a c t i v i t i e s m e a n s j u s t t h e r e a d i n g t h e c o n t e x t w h i c h d i s p l a y s t h e o n t h e w e b
b r o w s e r . I n o t h e r w o r d s w h e n d o i n g s o t h e u s e r c o m p u t e r C P U d o e s n o t h i n g
r e l a t e s t o t h a t p a r t i c u l a r w o r k . C a n w e c o n t r i b u t e t h i s C P U s t o d o a n o t h e r
m e a n i n g f u l w o r k w i t h o u t i n t e r r u p t i n g t h e i r m a i n w o r k o n t h e w w w ?
F i n d i n g t h e a n s w e r s t o t h e a b o v e q u e s t i o n s b r i n g s t h e c o n c e p t o f D i s -
t r i b u t e d C l o u d O v e r W e b B r o w s e r s ( D C W B ) . H e r e t h e c l o u d e n v i r o n m e n t
i s e s t a b l i s h e d a m o n g t h e w e b b r o w s e r s s o t h a t e a c h c l i e n t b r o w s e r b e c o m e s
a n o d e i n i t . H e n c e c l o u d e n v i r o n m e n t i n f r a s t r u c t u r e b e c o m e s d i s t r i b u t e d . N o
e x t r a d e d i c a t e d h a r d w a r e i s n e e d e d . T h e j o b s o n t h e c l o u d e n v i r o n m e n t s w i l l
b e t h e s i t e s s o t h e y g e t s e x e c u t e d w h i c h t h e u s e r s a r e s t a y i n g o n t h o s e s i t e s .
2 . 3 W e b T e c h n o l o g i e s
S i n c e t h e c o r e o f D C W B i s t o t a l l y b a s e d o n h t t p , i t s w o r t h t o l o o k a t s e r i e s
o f c u r r e n t w e b r e l a t e d t e c h n o l o g i e s t o a c h i e v e t h e g o a l . O n t h e o t h e r h a n d
n o d e s o f D C W B i s j u s t t h e w e b b r o w s e r s , t h e c l o s e i n t e r a c t i o n b e t w e e n t h o s e
t e c h n o l o g i e s a n d t h e b r o w s e r t e c h n o l o g i e s i s r e a l l y v i t a l .
T h e m a i n f u n c t i o n a l i t y o f t h e D C W B i s g e t t i n g a p a r t o f a d i s t r i b u t e d
t a s k f r o m a h o s t e d p l a c e a n d m a k e i t e x e c u t e o n t h e b r o w s e r c l i e n t a n d s e n d
t h e r e s u l t s b a c k t o t h e s e r v e r . S o i s i t n e e d e d t o s e n d a n d r e c e i v e b o t h t h e
c o d e a n d d a t a b e t w e e n b r o w s e r a n d t h e s e r v e r . I n o r d e r t o a c c o m p l i s h t h i s
c o m m u n i c a t i o n s e v e r a l t e c h n o l o g i e s c a n b e p r o p o s e d .
[ 5 ] P r o v i d e s a c o m p a r i s o n b e t w e e n s e r i e s o f P u s h a n d P u l l T e c h n i q u e s
r e l a t e d t o w e b w h i c h c a n b e u s e d f o r D C W B ' s p u r p o s e .
2 . 3 . 1 A j a x
A J A X i s a n a p p r o a c h t o W e b a p p l i c a t i o n d e v e l o p m e n t U s i n g a c o m b i n a t i o n
o f e s t a b l i s h e d w e b t e c h n o l o g i e s : S t a n d a r d s - b a s e d p r e s e n t a t i o n u s i n g X H T M L
a n d C S S , d y n a m i c D i s p l a y a n d i n t e r a c t i o n w i t h t h e d o c u m e n t o b j e c t M o d e l ,
d a t a e x c h a n g e a n d m a n i p u l a t i o n , a s y n c h r o n o u s R e t r i e v a l u s i n g X M L H t t p R e -
q u e s t a n d J a v a S c r i p t b i n d i n g a l l t o g e t h e r . X M L H t t p R e q u e s t i s a n A P I i m p l e -
m e n t a t i o n b y m o s t m o d e r n W e b - b r o w s e r s c r i p t i n g e n g i n e s D a t a t r a n s m i s s i o n
t o a n d f r o m a w e b s e r v e r v i a H T T P , e s t a b l i s h i n g a n i n d e p e n d e n t c o m m u n i c a -
t i o n c h a n n e l i n t h e b a c k g r o u n d b e t w e e n a c l i e n t a n d s e r v e r . T h e c o m b i n a t i o n
o f t h e s e t e c h n o l o g i e s e n a b l e s w e a d o p t t h e m a i n p a r a d i g m s o f s o f t w a r e e n -
g i n e e r i n g , a s a s a c o m p o n e n t a n d e v e n t - b a s e d , f o r t h e d e v e l o p m e n t o f W e b
a p p l i c a t i o n s . O u r p r e v i o u s w o r k o n a s t y l e o f a r c h i t e c t u r e A J A X S P I A R
8/22/2019 Distributed Cloud Infrastructure Over Web Browsers
19/27
2 . 3 W e b T e c h n o l o g i e s 9
c a l l e d , p r o v i d e s a n o v e r v i e w o f t h e b a n d t o n e w w a y s A p p l i c a t i o n s c a n b e
a r c h i t e c t e d u s i n g A J A X . T h e a d o p t i o n o f A J A X h a s b e c o m e a s e r i o u s o p t i o n
n o t o n l y f o r n e w d e v e l o p m e n t s A p p l i c a t i o n s b u t a l s o f o r m i g r a t i o n o f e x i s t -
i n g w e b s i t e s i n c r e a s e r e s p o n s i v e n e s s . T h e d e v e l o p m e n t o f t h e W e b t h e a d v e n t
o f W e b 2 . 0 , A J A X , a n d i n p a r t i c u l a r t h e U s e r s a n e x p e r i e n c e s i m i l a r t o u s -
i n g a d e s k t o p a p p l i c a t i o n . N o w K n o w n e x a m p l e s a r e G m a i l a n d n e w Y a h o o !
E - m a i l . T h e R E S T s t y l e i s a s e r v e r a t t h e i n i t i a t i v e o f t h e H T T P r e q u e s t i m -
p o s s i b l e . E a c h r e q u e s t m u s t b e i n i t i a t e d b y a c l i e n t p r e c l u d i n g s e r v e r s f r o m
s e n d i n g a s y n c h r o n o u s m e s s a g e s w i t h o u t a c l i e n t r e q u e s t . T h e r e a r e s e v e r a l
s o l u t i o n s u s e d i n p r a c t i c e , s t i l l g e t t h e c u s t o m e r t o u p d a t e s i n r e a l t i m e f r o m
t h e s e r v e r . I n t h i s s e c t i o n w e w i l l S o m e o f t h e s e s o l u t i o n s t o a n a l y z e .
2 . 3 . 2 H t t p P u l l
M a n y A J A X a p p l i c a t i o n s c h e c k w i t h t h e s e r v e r t o t h e u s e r d e n e d t i m e i n -
t e r v a l s t o r e f r e s h ( T T R ) i s k n o w n . T h i s t e s t i s i n d e p e n d e n t o f w h e t h e r t h e
s t a t e h a s c h a n g e d i n b l i n d . T o a c h i e v e h i g h a c c u r a c y o f t h e f r e s h n e s s o f d a t a
a n d d a t a , m a k i n g t h e f r e q u e n c y m u s t b e h i g h . T h i s i n t u r n i n d u c e s h i g h n e t -
w o r k t r a c a n d p o s s i b l y u n n e c e s s a r y m e s s a g e s . T h e p e t i t i o n a l s o c a l l s w a s t e
t i m e f o r c o m p l e t i o n o f t h e e v e n t s o t h a t a d i r e c t i n u e n c e o n t h e r e s p o n s e t o
t h e u s e r . I d e a l l y , t h e i n t e r v a l b e t w e e n t r a i n s i s e q u a l t o t h e r a t e P u b l i s h R a t e
( P R ) , o r i n w h i c h s t a t e c h a n g e s . I f t h e f r e q u e n c y i s t o o l o w , t h e c l i e n t c a n m i s s
s o m e u p d a t e s . T h i s r u l e i s o f t e n u s e d i n W e b - b a s e d s y s t e m s b e c a u s e t h e y a r e
r o b u s t , e a s y t o i m p l e m e n t , m a y f o r o i n e o p e r a t i o n , a n d s c a l e s w e l l t o l a r g e
n u m b e r s o f s u b s c r i b e r s . M e c h a n i s m s s u c h a s A d a p t i v e T T R T T R c h a n g i n g
s e r v e r s , t h e c l i e n t m a y b e o n d i e r e n t f r e q u e n c i e s , a c c o r d i n g t o d e d u c t f r o m
t h e r a t e o f c h a n g e d a t a . T h i s d y n a m i c a p p r o a c h T T R i n t u r n , y i e l d s b e t t e r
r e s u l t s t h a n a s t a t i c m o d e l o f T T R . H o w e v e r , i t w i l l n e v e r r e a c h c o m p l e t e
d a t a a c c u r a c y , a n d i t w i l l c r e a t e u n n e c e s s a r y t r a c .
2 . 3 . 3 P a g e S t r e a m i n g
T h i s m e t h o d s i m p l y c o n s i s t s o f s t r e a m i n g s e r v e r d a t a i n t h e r e s p o n s e o f a
l o n g - l i v e d H T T P c o n n e c t i o n . M o s t w e b s e r v e r s d o s o m e p r o c e s s i n g , s e n d b a c k
a r e s p o n s e , a n d i m m e d i a t e l y e x i t . B u t i n t h i s p a t t e r n , t h e c o n n e c t i o n i s k e p t
o p e n b y r u n n i n g a l o n g l o o p . T h e s e r v e r s c r i p t u s e s e v e n t r e g i s t r a t i o n o r
s o m e o t h e r t e c h n i q u e t o d e t e c t a n y s t a t e c h a n g e s . A s s o o n a s a s t a t e c h a n g e
o c c u r s , i t s t r e a m s t h e n e w d a t a a n d u s h e s i t , b u t d o e s n o t a c t u a l l y c l o s e t h e
c o n n e c t i o n . M e a n w h i l e , t h e b r o w s e r m u s t e n s u r e t h e u s e r - i n t e r f a c e r e e c t s
t h e n e w d a t a , w h i l e s t i l l w a i t i n g f o r r e s p o n s e f r o m t h e s e r v e r t o n i s h .
8/22/2019 Distributed Cloud Infrastructure Over Web Browsers
20/27
1 0 2
2 . 3 . 4 S e r v i c e S t r e a m i n g
S t r e a m i n g S e r v i c e b a s e d o n t h e X M L H t t p R e q u e s t o b j e c t . T h i s t i m e i t ' s a n
X M L H t t p R e q u e s t c o n n e c t i o n t h a t i s l o n g l i v e d i n t h e b a c k g r o u n d i n s t e a d o f
l o a d i n g t h e i n i t i a l p a g e . T h i s p r o v i d e s s o m e e x i b i l i t y r e g a r d i n g t h e d u r a t i o n
a n d f r e q u e n c y o f c o n n e c t i o n s . T h e p a g e w i l l b e l o a d e d n o r m a l l y ( o n c e ) a n d
d i u s i o n c a n b e a c h i e v e d w i t h a p r e d e n e d l i f e t i m e f o r t h e c o n n e c t i o n . T h e
s e r v e r w i l l l o o p i n d e n i t e l y , a s i n s t r e a m i n g p a g e , t h e b r o w s e r h a s t o r e a d
t h e l a s t r e s p o n s e ( r e s p o n s e T e x t ) t o u p d a t e i t s c o n t e n t .
2 . 3 . 5 F l a s h S o c k e t C o m m u n i c a t i o n
U n d e r t h e c o n t r o l o f J a v a S c r i p t , t h e c l i e n t e s t a b l i s h e s a T C P c o n n e c t i o n t o
a u n i d i r e c t i o n a l r e l a y o n t h e s e r v e r . T h e r e l a y s e r v e r d o e s n o t r e a d a n y t h i n g
f r o m t h i s s o c k e t ; i n s t e a d i t i m m e d i a t e l y s e n d s t h e c l i e n t a u n i q u e i d e n t i e r .
N e x t , t h e c l i e n t m a k e s a n H T T P r e q u e s t t o t h e w e b s e r v e r , i n c l u d i n g w i t h i t
t h i s i d e n t i e r . T h e w e b a p p l i c a t i o n c a n t h e n p u s h m e s s a g e s a d d r e s s e d t o t h e
c l i e n t t o a l o c a l i n t e r f a c e o f t h e r e l a y s e r v e r , w h i c h r e l a y s t h e m o v e r t h e F l a s h
s o c k e t . T h e a d v a n t a g e o f t h i s a p p r o a c h i s t h a t i t a p p r e c i a t e s t h e n a t u r a l
r e a d - w r i t e a s y m m e t r y t h a t i s t y p i c a l o f m a n y w e b a p p l i c a t i o n s , i n c l u d i n g
c h a t , a n d a s a c o n s e q u e n c e i t o e r s h i g h e c i e n c y . S i n c e i t d o e s n o t a c c e p t
d a t a o n o u t g o i n g s o c k e t s , t h e r e l a y s e r v e r d o e s n o t n e e d t o p o l l o u t g o i n g
T C P c o n n e c t i o n s a t a l l , m a k i n g i t p o s s i b l e t o h o l d o p e n t e n s o f t h o u s a n d s o f
c o n c u r r e n t c o n n e c t i o n s . I n t h i s m o d e l , t h e l i m i t t o s c a l e i s t h e T C P s t a c k o f
t h e u n d e r l y i n g s e r v e r o p e r a t i n g s y s t e m [ 6 ] .
2 . 3 . 6 D i s c u s s i o n
A s f a r a s t h e t r a d i t i o n a l p u s h t e c h n o l o g i e s d i s c u s s a b o v e a r e c o n c e r n e d e x -
c e p t t h e r a w a s h s o c k e t s , a l l t h e o t h e r s a r e r e a l l y t h e e x t e n d e d v e r s i o n s o f
A j a x . w h i c h m e a n s a l l o f t h e m a r e j u s t p a t c h s o l u t i o n s f o r t h e H T T P c o m -
m u n i c a t i o n b a s e R e q u e s t r s t a n d t h e n r e s p o s e . D u e t o t h a t a h u g e n e t w o r k
b a n d w i t h w a s t a g e h a p p e n e d w h e n t h e s a m e t e c h n o l o g y i s b e i n g u s e d f o r t h e
p u s h f u n c t i o n a l i t y f r o m s e r v e r t o c l i e n t b r o w s e r . F l a s h s o c k e t s o v e r c o m e t h i s
i s s u e s w h i l e p r o v i d i n g t r u e d u p l e x c o m m u n i c a t i o n b e t w e e n s e r v e r a n d c l i e n t .
B e c a u s e a s h p l a y e r i n i t i a t e s a s o c k e t t o c o m m u n i c a t e . B u t t h e p r o b l e m h e r e
i s t h a t i t a s k s t h e u s e r s t o i n s t a l l a d d i t i o n a l c o m p o n e n t ( a s h p l a y e r ) o n t h e i e
b r o w s e r s . O n t h e o t h e r h a n d t h e i n s t a l l e d c o m p o n e n e t l e a d s t o a b i g s e c u r i t y
t h r e a t t o o .
8/22/2019 Distributed Cloud Infrastructure Over Web Browsers
21/27
2 . 4 W e b S o c k e t s 1 1
T h u s , n o n i n s t a l l a b l e , s a f e b u t a t r u e s o c k e t c o m m u n i c a t i o n m e c h a n i s m i s
n e e d e d f o r t h e D C W B t o o b t a i n t h e g o a l o f c o d e a n d d a t a c o m m u n i c a t i o n .
T h i s i s w h e r e t h e w e b s o c k e t s c o m e i n t o p l a y .
2 . 4 W e b S o c k e t s
H T M L 5 W e b S o c k e t s s p e c i c a t i o n d e n e s a n A P I t h a t a l l o w s w e b p a g e s t o
u s e t h e W e b p r o t o c o l S o c k e t s f o r b i d i r e c t i o n a l c o m m u n i c a t i o n w i t h a r e m o t e
h o s t . I t p r e s e n t s W e b S o c k e t i n t e r f a c e a n d d e n e s a c o m m u n i c a t i o n c h a n n e l
f u l l - d u p l e x o p e r a t i n g t h r o u g h a s i n g l e o u t l e t o n t h e W e b . H T M L 5 W e b S o c k -
e t s , a l l o w a c o n s i d e r a b l e r e d u c t i o n o f u n n e c e s s a r y n e t w o r k t r a c a n d l a t e n c y
c o m p a r e d t o t h e i n t e r r o g a t i o n i m p a s s a b l e a n d s o l u t i o n s l o n g s u r v e y t h a t w e r e
u s e d t o s i m u l a t e a f u l l d u p l e x c o n n e c t i o n b y m a i n t a i n i n g t w o c o n n e c t i o n s .
H T M L 5 W e b S o c k e t s c o n s i d e r r i s k s s u c h a s n e t w o r k p r o x i e s a n d r e w a l l s ,
w h i c h e n a b l e s s t r e a m i n g o v e r a n y c o n n e c t i o n , a n d w i t h t h e c a p a c i t y f o r c o m -
m u n i c a t i o n u p s t r e a m a n d d o w n s t r e a m o v e r a s i n g l e c o n n e c t i o n , a p p l i c a t i o n s
H T M L 5 W e b S o c k e t s i n s t e a d o f r e d u c i n g t h e b u r d e n o n t h e s e r v e r s , a l l o w i n g
e x i s t i n g m a c h i n e s t o s u p p o r t m o r e s i m u l t a n e o u s c o n n e c t i o n s . T h e f o l l o w i n g
g u r e s h o w s a b a s i c a r c h i t e c t u r e W e b S o c k e t b a s e d b r o w s e r s u s e a c o n n e c t i o n
W e b S o c k e t f o r f u l l - d u p l e x , d i r e c t c o m m u n i c a t i o n w i t h r e m o t e h o s t s .
F i g . 2 . 2 W e b S o c k e t O v e r v i e w
A u n i q u e f e a t u r e o f t h e W e b S o c k e t s p r o v i d e i s i t s a b i l i t y t o t r a v e r s e
r e w a l l s a n d p r o x i e s , a p r o b l e m a r e a f o r m a n y a p p l i c a t i o n s . C o m e t - s t y l e a p -
p l i c a t i o n s t y p i c a l l y v o t e a l o n g a s a d e f e n s e a g a i n s t t h e r u d i m e n t a r y r e w a l l
8/22/2019 Distributed Cloud Infrastructure Over Web Browsers
22/27
1 2 2
a n d p r o x i e s . T h e t e c h n i q u e i s e e c t i v e b u t n o t w e l l s u i t e d f o r a p p l i c a t i o n s i n
M S - 5 0 0 l a t e n c y o r h i g h t h r o u g h p u t r e q u i r e m e n t s . T e c h n o l o g y - b a s e d p l u g i n s
l i k e A d o b e F l a s h t o s u p p o r t a c e r t a i n l e v e l o f o u t p u t , b u t w i t h t h e p r o x y v e r y
l o n g a n d t h e p r o b l e m o f r e w a l l t r a v e r s a l w e b w e r e c h a r g e d S o c k e t s s o l v e t h i s
p r o b l e m n o w .
A W e b S o c k e t d e t e c t s t h e p r e s e n c e o f a p r o x y s e r v e r a n d a u t o m a t i c a l l y
s w i t c h a t u n n e l t h r o u g h t h e p r o x y . T h e t u n n e l i s a s t a t e m e n t p u b l i s h e d H T T P
C O N N E C T p r o x y s e r v e r t h a t h a n d l e s r e q u e s t s t o t h e p r o x y s e r v e r o n a T C P
/ I P t o a h o s t a n d a s p e c i c p o r t o p e n s e t . O n c e t h e t u n n e l i s e s t a b l i s h e d ,
t h e c o m m u n i c a t i o n c a n o w f r e e l y t h r o u g h t h e p r o x y . S i n c e H T T P / S w o r k s
i n a s i m i l a r w a y u s i n g s o c k e t s t h r o u g h S S L s e c u r e w e b t e c h n o l o g y t h e s a m e
H T T P C O N N E C T . N o t e y o u , t h a t s u p p o r t s W e b S o c k e t s a r e o n l y a t t h e
b e g i n n i n g o f m o d e r n b r o w s e r s ( C h r o m e W e b S o c k e t n o w s u p p o r t s n a t i v e ) .
H o w e v e r , i m p l e m e n t a t i o n s o f b a c k w a r d c o m p a t i b i l i t y , b r o w s e r s t o d a y t h a t
t h e b e n e t s o f t h i s n e w t e c h n o l o g y b e c o m e s a v a i l a b l e .
W e b - b a s e d , l i k e o t h e r p a r t s o f t h e H T M L 5 e o r t o f l o c a l s t o r a g e a n d g e o l o -
c a t i o n , w a s o r i g i n a l l y p a r t o f t h e H T M L 5 s p e c i c a t i o n , b u t w a s m o v e d t o a
s e p a r a t e d o c u m e n t s t a n d a r d s , s o t h a t t h e p r e c i s e s p e c i c a t i o n s . W e b S o c k e t s ,
I n t e r n e t E n g i n e e r i n g T a s k F o r c e ( I E T F ) h a s b e e n p r e s e n t e d b y i t s c r e a t o r ,
t h e W e b H y p e r t e x t A p p l i c a t i o n T e c h n o l o g y W o r k i n g G r o u p ( W H A T W G ) .
T h e a u t h o r s , e v a n g e l i s t s a n d b u s i n e s s e s i n t h e s t a n d a r d i z a t i o n i s s t i l l o n t h e
o r i g i n a l s e t o f f e a t u r e s , i n c l u d i n g W e b - t a k e n , a s t h e " H T M L 5 " .
2 . 5 R e s e a r c h e s o n W e b S o c k e t s
2 . 5 . 1 R e a l - t i m e C o l l a b o r a t i v e E d i t i n g w i t h W e b S o c k e t s ,
N o d e . j s a n d R e d i s
A r e s e a r c h c a r r i e d o u t b y u n i v e r s i t y o f M o r a t u w a , f a c u l t y o f I n f o r m a t i o n
T e c h n o l o g y . T h e m a i n i n t e n t i o n o f t h i s p r o j e c t w a s t h a t m a k i n g r e a l t i m e c o d e
e d i t o r w h e r e a l l t h e d e v e l o p e r s a r e c o n n e c t i n g t o a s i n g l e i n t e r f a c e t h r o u g h
t h e i r w e b b r o w s e r s a n d d o t h e c h a n g e s o n t h e c o d e t h e a t t h e s a m e t i m e .
A l l t h e c h a n g e s b e i n g d o n e d y a p e r s o n , g e t s d i s p l a y e d t o a l l t h e o t h e r s i n
r e a t i m e . T h e i n t e g r a t i o n s t e p s a r e a s f o l l o w s .
w h e n o n e u s e r m a k e s a c h a n g e ; a d i w i l l b e c r e a t e d f o r h i s c h a n g e a n d
s e n t t o s e r v e r . T h e n t h e s e r v e r p o s t s t h i s d i t o o t h e r c o n n e c t e d c o l l a b o r a t o r s
o f t h e p a d . W h e n a u s e r r e c e i v e s a d i , h i s c o n t e n t w i l l b e p a t c h e d w i t h t h e
u p d a t e . S o b o t h t a k i n g d i s a n d a p p l y i n g p a t c h e s g e t s e x e c u t e d o n t h e c l i e n t
s i d e [ 7 ] .
8/22/2019 Distributed Cloud Infrastructure Over Web Browsers
23/27
2 . 5 R e s e a r c h e s o n W e b S o c k e t s 1 3
2 . 5 . 2 E a r t h C o n t r o l
A m u l t i - p l a y e r , r e a l - t i m e g a m e w h i c h r u n s w i t h i n t h e F a c e b o o k s o c i a l n e t -
w o r k i n g w e b s i t e . A l t h o u g h t h i s i s a n e n t e r t a i n m e n t a p p l i c a t i o n , t h e a r c h i t e c -
t u r e o f t h e p r o g r a m u s e s m a n y o f t h e e l e m e n t s t h a t a t e c h n i c a l o r b u s i n e s s
a p p l i c a t i o n m i g h t e m p l o y a n d t h e r e f o r e t h i s d e m o n s t r a t i o n h a s r e l e v a n c e t o
t h e i m p l e m e n t a t i o n o f m o r e s e r i o u s a p p l i c a t i o n s . O p e r a t i o n o f t h e a p p l i c a t i o n
i s a s f o l l o w s .
P l a y e r s i n a n E a r t h C o n t r o l g a m e g e n e r a t e s h i p c o n t r o l a n d r e c o m m a n d s
u s i n g t h e a r r o w k e y s a n d s p a c e b a r , r e s p e c t i v e l y , o n t h e k e y b o a r d . T h e s e c o m -
m a n d s a r e s e n t v i a W e b S o c k e t a n d t h e K a a z i n g G a t e w a y s e r v e r t o a S T O M P
( S t r e a m i n g T e x t O r i e n t a t e d M e s s a g i n g P r o t o c o l ) s e r v e r . T h e S T O M P s e r v e r
t h e n p a s s e s t h e c o m m a n d t o t h e s p e c i c E a r t h C o n t r o l g a m e i n s t a n c e t o w h i c h
t h e p l a y e r h a s b e e n a s s i g n e d .
O p e n r e c e i v i n g a k e y s t r o k e s i g n a l f r o m a b r o w s e r , t h e g a m e i n s t a n c e c o m -
p u t e s t h e r e s u l t i n g c o o r d i n a t e s o f e a c h o f s h i p a n d p l a s m a i n t h e g a m e a n d
s e n d s t h i s c o m p l e t e c o o r d i n a t e d a t a s e t o u t t o e a c h b r o w s e r , a g a i n u s i n g
W e b S o c k e t v i a t h e S T O M P s e r v e r a n d t h e K a a z i n g G a t e w a y .
E a c h g r o u p o f e i g h t p l a y e r s i s a s s i g n e d t o a n i n s t a n c e o f t h e E a r t h C o n t r o l
g a m e s o f t w a r e , a s i l l u s t r a t e d a t r i g h t . A n a d m i n i s t r a t o r p r o g r a m a s s i g n s i n -
c o m i n g u s e r s t o e m p t y p o s i t i o n s i n a n e x i s t i n g g a m e i n s t a n c e o r s t a r t s a n e w
g a m e i n s t a n c e i f n o e x i s t i n g p o s i t i o n s a r e a v a i l a b l e . S c o r i n g a n d o t h e r u s e r
d a t a i s m a n a g e d b y a M y S Q L d a t a b a s e o n t h e s e r v e r [ 8 ] .
8/22/2019 Distributed Cloud Infrastructure Over Web Browsers
24/27
1 4 2
F i g . 2 . 3 E a r t h C o n t r o l A r c h i t e c t u r e
8/22/2019 Distributed Cloud Infrastructure Over Web Browsers
25/27
R e f e r e n c e s
[ 1 ] R . B u y y a , C . S . Y e o , a n d S . V e n u g o p a l , M a r k e t - o r i e n t e d c l o u d c o m -
p u t i n g : V i s i o n , h y p e , a n d r e a l i t y f o r d e l i v e r i n g i t s e r v i c e s a s c o m p u t i n g
u t i l i t i e s , i n H i g h P e r f o r m a n c e C o m p u t i n g a n d C o m m u n i c a t i o n s , 2 0 0 8 .
H P C C ' 0 8 . 1 0 t h I E E E I n t e r n a t i o n a l C o n f e r e n c e o n , 2 0 0 8 .
[ 2 ] C . C . R e q u i r e s , I I T I F ,
[ 3 ] T i m B e r n e r s - L e e - w i k i p e d i a , t h e f r e e e n c y c l o p e d i a .
h t t p : / / e n . w i k i p e d i a . o r g / w i k i / T i m _ B e r n e r s - L e e .
[ 4 ] W e b b r o w s e r - w i k i p e d i a , t h e f r e e e n c y c l o p e d i a .
h t t p : / / e n . w i k i p e d i a . o r g / w i k i / W e b _ b r o w s e r # H i s t o r y .
[ 5 ] E . B o z d a g , A . M e s b a h , a n d A . V . D e u r s e n , A c o m p a r i s o n o f p u s h a n d
p u l l t e c h n i q u e s f o r a j a x , i n W e b S i t e E v o l u t i o n , 2 0 0 7 . W S E 2 0 0 7 . 9 t h
I E E E I n t e r n a t i o n a l W o r k s h o p o n , 2 0 0 7 .
[ 6 ] P u s h t e c h n o l o g y - w i k i p e d i a , t h e f r e e e n c y c l o p e d i a .
h t t p : / / e n . w i k i p e d i a . o r g / w i k i / P u s h _ t e c h n o l o g y .
[ 7 ] L . P e r e r a , R e a l - t i m e c o l l a b o r a t i v e e d i t i n g w i t h w e b s o c k e t s , n o d e . j s
& r e d i s . h t t p : / / l a k t e k . c o m / 2 0 1 0 / 0 5 / 2 5 / r e a l - t i m e - c o l l a b o r a t i v e - e d i t i n g -
w i t h - w e b s o c k e t s - n o d e - j s - r e d i s / .
[ 8 ] B e r g m a n s m e c h a t r o n i c s L L C | W e b S o c k e t a p p l i c a t i o n r e s e a r c h .
h t t p : / / b e r g m a n s . c o m / W e b S o c k e t . h t m l .
1 5
8/22/2019 Distributed Cloud Infrastructure Over Web Browsers
26/27
8/22/2019 Distributed Cloud Infrastructure Over Web Browsers
27/27
R e f e r e n c e s
[ 1 ] R . B u y y a , C . S . Y e o , a n d S . V e n u g o p a l , M a r k e t - o r i e n t e d c l o u d c o m -
p u t i n g : V i s i o n , h y p e , a n d r e a l i t y f o r d e l i v e r i n g i t s e r v i c e s a s c o m p u t i n g
u t i l i t i e s , i n H i g h P e r f o r m a n c e C o m p u t i n g a n d C o m m u n i c a t i o n s , 2 0 0 8 .
H P C C ' 0 8 . 1 0 t h I E E E I n t e r n a t i o n a l C o n f e r e n c e o n , 2 0 0 8 .
[ 2 ] C . C . R e q u i r e s , I I T I F ,
[ 3 ] T i m B e r n e r s - L e e - w i k i p e d i a , t h e f r e e e n c y c l o p e d i a .
h t t p : / / e n . w i k i p e d i a . o r g / w i k i / T i m _ B e r n e r s - L e e .
[ 4 ] W e b b r o w s e r - w i k i p e d i a , t h e f r e e e n c y c l o p e d i a .
h t t p : / / e n . w i k i p e d i a . o r g / w i k i / W e b _ b r o w s e r # H i s t o r y .
[ 5 ] E . B o z d a g , A . M e s b a h , a n d A . V . D e u r s e n , A c o m p a r i s o n o f p u s h a n d
p u l l t e c h n i q u e s f o r a j a x , i n W e b S i t e E v o l u t i o n , 2 0 0 7 . W S E 2 0 0 7 . 9 t h
I E E E I n t e r n a t i o n a l W o r k s h o p o n , 2 0 0 7 .
[ 6 ] P u s h t e c h n o l o g y - w i k i p e d i a , t h e f r e e e n c y c l o p e d i a .
h t t p : / / e n . w i k i p e d i a . o r g / w i k i / P u s h _ t e c h n o l o g y .
[ 7 ] L . P e r e r a , R e a l - t i m e c o l l a b o r a t i v e e d i t i n g w i t h w e b s o c k e t s , n o d e . j s
& r e d i s . h t t p : / / l a k t e k . c o m / 2 0 1 0 / 0 5 / 2 5 / r e a l - t i m e - c o l l a b o r a t i v e - e d i t i n g -
w i t h - w e b s o c k e t s - n o d e - j s - r e d i s / .
[ 8 ] B e r g m a n s m e c h a t r o n i c s L L C | W e b S o c k e t a p p l i c a t i o n r e s e a r c h .
h t t p : / / b e r g m a n s . c o m / W e b S o c k e t . h t m l .
1 7