T E L K O M N I K A ,   V o l .   1 1 ,   N o .   7 ,   J u l y   2 0 1 3 ,   p p .   3 8 2 6   ~   3 8 3 3   e - I S S N :   2 0 8 7 - 2 7 8 X               3 8 2 6       R e c e i v e d   S e p t e m b e r   1 7 ,   2 0 1 2 ;   R e v i s e d   J a n u a r y   1 0 ,   2 0 1 3 ;   A c c e p t e d   F e b r u a r y   1 9 ,   2 0 1 3   P r e c i s e   C l o c k   S y n c h r o n i z a t i o n   A l g o r i t h m   f o r   D i s t r i b u t e d   C o n t r o l   S y s t e m s         Y i   L i u * 1 ,   H a i y i n g   Y a n g 2     1 , 2 D e p a r t m e n t   o f   C o m p u t e r   C e n t e r ,   L i a o n i n g   U n i v e r s i t y   o f   T e c h n o l o g y     J i n z h o u ,   1 2 1 0 0 1 ,   P R   C h i n a   * C o r r e s p o n d i n g   a u t h o r ,   e - m a i l :   j z l y 7 1 @ 1 2 6 . c o m * 1 ,   y a n g _ h a i y i n g @ 1 6 3 . c o m 2       A b s t r a c t   T h e   d i s t r i b u t e d   c o n t r o l   s y s t e m s   a r e   a p p l i e d   w i d e l y   i n   c o m m u n i c a t i o n ,   n a v i g a t i o n   a n d   p o w e r   f i e l d s .   W i t h   g r o w i n g   i n   b o t h   s y s t e m s   c o m p l e x i t y   a n d   s p e e d   o f   d a t a   e x c h a n g e ,   t h e   r e a l   t i m e   p e r f o r m a n c e   o f   s y s t e m s   i s   r e q u i r e d .   Ex i s t i n g   c l o c k   s y n c h r o n i z a t i o n   t e c h n i q u e s   i n c l u d e   t h o s e   f o r   w i d e - a r e a   n e t w o r k   ( W AN )   a p p l i c a t i o n s   w i t h   l a r g e   p r o p a g a t i o n   d e l a y s ,   e . g . ,   t h e   N e t w o r k   T i m e   Pr o t o c o l   ( N T P) ,   a n d   t h o s e   f o r   c o n t r o l   s y s t e m s   o v e r   l o c a l - a r e a   n e t w o r k s   ( L AN s ) ,   e . g . ,   t h e   I EEE  1 5 8 8   Pr e c i s e   T i m e   Pr o t o c o l   ( P T P) .   H o w e v e r ,   N T P - l i k e   p r o t o c o l s   h a v e   o n l y   m i l l i s e c o n d - s c a l e   p r e c i s i o n ,   w h i c h   i s   t o o   c o a r s e   f o r   m a n y   L AN   a p p l i c a t i o n s   s u c h   a s   i n s t r u m e n t   m o n i t o r i n g   s y s t e m s ,   h i g h - q u a l i t y   d i g i t a l   a u d i o   s y s t e m s   a n d   s e n s o r   n e t w o r k s .   T h e   1 5 8 8   PT l i k e   p r o t o c o l s ,   w h i c h   a r e   s t i l l   u n d e r   d e v e l o p m e n t ,   r e q u i r e   s u p p o r t   o f   a   h i g h l y   p r e c i s e   h a r d w a r e   c l o c k .   T h e   k e y   p o i n t   o f   t h e   e x i s t i n g   E t h e r n e t   t e s t   a n d   m e a s u r e m e n t   i s   t h a t   t h e   m e t h o d   n e e d s   t o   a c h i e v e   p r e c i s i o n   c l o c k   s y n c h r o n i z a t i o n   b e t w e e n   d i f f e r e n t   t e r m i n a l s .   I n   t h i s   p a p e r ,   a n   i m p r o v e d   m e t h o d   i s   p r o p o s e d   w i t h   c o n s i d e r a t i o n   o f   t h e   t i m e   d r i f t   a n d   p r o p a g a t i o n   d e l a y ,   e x p r e s s i n g   m a s t e r - s l a v e   s y n c h r o n i z a t i o n   a s   a   l i n e a r   r e l a t i o n s h i p   a n d   i n d u c t i n g   t h e   l i n e   o f   l e a s t   s q u a r e s   f i t t i n g   a l g o r i t h m   t h a t   t r a d e d   a s   l i n e a r   m a t r i x   f o r m .   T h e   p r e c i s i o n   t i m e   p r o t o c o l   ( PT P )   i s   a l s o   a n a l y z e d   i n   t h i s   p a p e r .   T h e   e x p e r i m e n t   r e s u l t s   s h o w   t h a t   t h e   s y n c h r o n i z a t i o n   a c c u r a c y   r e a c h e s   s u b - m i c r o s e c o n d   g r a d e ,   w h i c h   i s   t h e   s a m e   a s   t h e   PT P.       K e y w o r d s :   d i s t r i b u t e d   c o n t r o l   s y s t e m s ,   c l o c k   s y n c h r o n i z a t i o n   a l g o r i t h m ,   t i m e   d r i f t     C o p y r i g h t   ©   2 0 1 3   U n i v e r s i t a s   A h m a d   D a h l a n .   A l l   r i g h t s   r e s e r v e d .       1 .   I n t r o d u c t i o n   W i t h   t h e   e m e r g e n c e   o f   n e w   t i m e - c r i t i c a l   d i s t r i b u t e d   c o m p u t i n g   p a r a d i g m s ,   s u c h   a s   d i s t r i b u t e d   c o n t r o l   c o n v e r t e r s ,   h u m a n - r o b o t   p h y s i c a l   i n t e r a c t i o n   a n d   a d - h o c   n e t w o r k s   w i t h   a   l a r g e   n u m b e r   o f   d i s p o s a b l e   s e n s o r s ,   p r e c i s e   c l o c k   s y n c h r o n i z a t i o n ,   w h i c h   i s   a n   o l d   t o p i c   o f   r e s e a r c h ,   h a s   r e g a i n e d   i n c r e a s i n g   a t t e n t i o n   a s   a   c r i t i c a l   i s s u e   i n   d i s t r i b u t e d   c o m p u t i n g   e n v i r o n m e n t s   [ 1 - 5 ] .   T o   a c h i e v e   c l o c k   s y n c h r o n i z a t i o n ,   n e t w o r k   d e v i c e s   e x c h a n g e   s y n c h r o n i z a t i o n   m e s s a g e s ,   w h i c h   c a r r y   t i m e s t a m p s ,   f o r   t i m e   c o m p u t a t i o n   a n d   e r r o r   c o m p e n s a t i o n .   T h e r e f o r e ,   t h e   f i e l d   o f   c l o c k   s y n c h r o n i z a t i o n   f o c u s e s   o n   t h e   d e s i g n   o f     m e s s a g e   e x c h a n g e s ,   o f f s e t   c o m p u t a t i o n s ,   a n d   c o m p e n s a t i o n   f o r   c l o c k   d r i f t s .   C l o c k   s y n c h r o n i z a t i o n   r e f e r s   t h a t   e a c h   n o d e   c l o c k   i n   t h e   n e t w o r k e d   a n d   t h e   v a r i o u s   a p p l i c a t i o n   s y s t e m   c l o c k   c o n n e c t i n g   t o   t h e   n e t w o r k e d   i s   s y n c h r o n o u s   w i t h   t h e   C o o r d i n a t e d   U n i v e r s a l   T i m e   ( C o o r d i n a t e d   U n i v e r s a l   T i m e   U T C ) .   W i t h   t h e   i n c r e a s i n g   o f   t h e   c l o c k   s y n c h r o n i z a t i o n   r e q u i r e m e n t s   i n   n e t w o r k e d   c o n t r o l   s y s t e m ,   t h e   c l o c k   s y n c h r o n i z a t i o n   i n   d i s t r i b u t e d   s y s t e m s ,   w h i c h   a r e   b a s e d   o n   E t h e r n e t ,   r e q u i r e s   p r e c i s i o n   t o   t h e   m i c r o s e c o n d   g r a d e .   T h e r e f o r e ,   t h e   c l o c k   s y n c h r o n i z a t i o n   a l g o r i t h m   b e c o m e s   t h e   r e s e a r c h   h o t s p o t .   C u r r e n t l y ,   t h e r e   a r e   t h r e e   a l g o r i t h m s :   N e t w o r k e d   T i m e   P r o t o c o l   ( N T P ) ,   S i m p l e   N e t w o r k e d   T i m e   P r o t o c o l   ( S N T P )   a n d   I E E E   1 5 8 8 .   M i l l s   [ 6 ]   p r o p o s e d   t h e   n e t w o r k e d   t i m e   p r o t o c o l   ( N T P )   s e r v i c e   t o   h a n d l e   l a r g e   n e t w o r k e d s   ( I n t e r n e t )   w i t h   l a r g e   a n d   v a r i a b l e   m e s s a g e   d e l a y s .   I n   t h e   W A N ,   t h e   t i m e   a c c u r a c y   p r o v i d e d   b y   N T P   i s   t e n s   o f   m i l l i s e c o n d s ,   a n d   s u b - m i l l i s e c o n d   i n   t h e   L A N .   A s   t h e   s i m p l i f i c a t i o n   o f   N T P ,   S N T P   a p p l i e s   t o   t h e   s i t u a t i o n   i n   w h i c h   i t   n o t   n e c e s s a r y   t o   u s e   N T P   c o m p l e t e l y .   J o h n   E d s o n   [ 7 ]   p r o p o s e d   I E E E 1 5 8 8   s e r v i c e   t o   E t h e r n e t   o r   d i s t r i b u t e d   b u s   s y s t e m s   u s i n g   m u l t i c a s t   m o d e .   T h e   t i m e   a c c u r a c y   o f   I E E E   1 5 8 8   i s   s u b - m i c r o s e c o n d .   A t   p r e s e n t ,   m o s t   o f   r e s e a r c h e r s   h a v e   f o c u s e d   o n   t h e   u s e   o f   h a r d w a r e   a n d   s o f t w a r e   t e c h n o l o g i e s   t o   a c h i e v e   t h e   c l o c k   s y n c h r o n i z a t i o n ,   a n d   p a y   l e s s   a t t e n t i o n   t o   t h e   t h e o r e t i c a l   r e s e a r c h ,   s o ,   t h e   p a p e r   i s   m a i n l y   t h e o r e t i c a l   d e r i v a t i o n   o f   s y n c h r o n i z a t i o n   a l g o r i t h m .   Evaluation Warning : The document was created with Spire.PDF for Python.
                                              e - I S S N :   2 0 8 7 - 2 7 8 X   T E L K O M N I K A   V o l .   1 1 ,   N o .   7 ,   J u l y   2 0 1 3   :   3 8 2 6     3 8 3 3   3 8 2 7 T h i s   p a p e r   i s   o r g a n i z e d   a s   f o l l o w s .   T h e   d e s c r i p t i o n   o f   t h e   A l g o r i t h m   i s   d e s c r i b e d   i n   S e c t i o n   2 .   R e s u l t s   a n d   d i s c u s s i o n s   a r e   p r e s e n t e d   i n   s e c t i o n   3 .   F i n a l l y ,   S e c t i o n   4   c o n c l u d e s   t h e   p a p e r .       2 .   R e s e a r c h   M e t h o d   2 . 1 .   D e s c r i p t i o n   o f   t h e   A l g o r i t h m   T h e   r e f e r e n c e   t i m e   i n   s u b n e t   i s   t h e   c l o c k   o f   c o n t r o l   s e r v e r   n o d e   a n d   o n   t h i s   b a s i s ,   a   c o n t r o l   c l i e n t   n o d e   i n i t i a t e s   t h e   c l o c k   s y n c h r o n i z a t i o n   t o   r e a d j u s t   i t s   c l o c k .   P a r a m e t e r   D e f i n i t i o n .   C l o c k   s k e w   ( δ )   i s   d e f i n e d   a s   t h e   i n s t a n t a n e o u s   d i f f e r e n c e   b e t w e e n   t h e   r e c o r d e d   t i m e   a n d   t h e   a c t u a l   a b s o l u t e   t i m e .   C l o c k   d r i f t   ( ρ )   o c c u r s   i n   a   c r y s t a l - b a s e d   c l o c k ,   i f   t h e   c o u n t i n g   f r e q u e n c y   v a r i e s ,   c a u s i n g   a   t i m i n g   e r r o r   i n   t h e   p a r t i c u l a r   c l o c k   a n d   g e n e r a t e s   a   d i v e r g i n g   c l o c k   s k e w .   L e t   C c   d e n o t e s   t h e   c o n t r o l   c l i e n t   n o d e   r e q u e s t i n g   t h e   c l o c k   t i m e .   C s   d e n o t e s   t h e   r e s p o n d i n g   c o n t r o l   s e r v e r   n o d e .   N   n o d e   e x i s t   i n   n e t w o r k e d ,   l e t     1 ( ) | c c N a n t n = b e   t h e   s e r i e s   o f   t i m e - s t a m p s   w h e n   t h e   c o n t r o l   c l i e n t   s e n t   t h e   c l o c k   r e q u e s t ,   1 ( ) | s c N b n t n = b e   t h e   s e r i e s   o f   t i m e - s t a m p s   w h e n   t h e   c o n t r o l   s e r v e r   r e c e i v e d   a n d   i m m e d i a t e l y   r e p l i e d   t o   t h e   c l o c k   r e q u e s t ,   a n d     1 ( ) | c c N c n t n = b e   t h e   s e r i e s   o f   t i m e - s t a m p s   w h e n   t h e   r e s p o n s e   t o   t h e   c l o c k   r e q u e s t   a r r i v e d   b a c k   a t   t h e   l o c a l   c l i e n t .   D e f i n i n g     a b s t a s   t h e   a b s o l u t e   t i m e ,   c c i t a s   t h e   l o c a l   t i m e   o f   n o d e   C c ,   s c i t a s   t h e   l o c a l   t i m e   o f   n o d e   C s ,   c s c c n t a n d   s c c c n t a s   t h e   t r a n s m i s s i o n   t i m e s   b e t w e e n   t h e   c o n t r o l   s e r v e r   a n d   t h e   c o n t r o l   c l i e n t .   A l g o r i t h m   D e r i v a t i o n .   R e v i s e   t h e   c l o c k   d r i f t   b e t w e e n   t h e   s e r v e r   a n d   t h e   c l i e n t .   A s s u m i n g   b o t h   c l o c k s   i n   t h e   c o n t r o l   c l i e n t   a n d   t h e   s e r v e r   h a s   a   l i n e a r   g r o w i n g   s k e w   [ 8 ]   t o   t h e   a b s o l u t e   t i m e :       a b s c c a b s c i t t t c c c r d + + =   ( 1 )     a b s c c a b s c i t t t s s s r d + + =   ( 2 )     C o m b i n i n g   ( 1 )   a n d   ( 2 )   t o   e l i m i n a t e a b s t ,   o n e   o b t a i n s   t h e   f o l l o w i n g   l i n e a r   r e l a t i o n :     c k t t c s c i c i + =   ( 3 )     I n   w h i c h       c c s s c c c c c d r r d ) 1 1 ( + + - =   ( 4 )     c s c c k r r + + = 1 1   ( 5 )       D e l a y   m e a s u r e m e n t .   I t   i s   c o m m o n   t o   a s s u m e   t h a t   c s c c n t i s   e q u a l   t o s c c c n t :   [ ] N n t E t E c s s c c c n c c n , , 2 , 1 ] [ ] [ K Î = = m     = - = N n c a c c n t n t N c c 1 ) ) ( ) ( ( 2 1 ˆ m   ( 6 )     T h e   d a t a   p o i n t s   i n   t h e   t i m e   s e r i e s   1 ( ) | s c N b n t n =   a n d 1 ( ) | c c N b n t n =     c a n   b e   w r i t t e n   a s :     c t n t k n t s c c s c c n c a c b + + = ) ) ( ( ) (   ( 7 )   Evaluation Warning : The document was created with Spire.PDF for Python.
T E L K O M N I K A     e - I S S N :   2 0 8 7 - 2 7 8 X     P r e c i s e   C l o c k   S y n c h r o n i z a t i o n   A l g o r i t h m   f o r   D i s t r i b u t e d   C o n t r o l   S y s t e m s   ( Y i   L i u )   3 8 2 8 c s s c c c c c n c c n c a c c t t n t n t + + = ) ( ) (   ( 8 )       R e s p e c t i v e l y ,   f r o m   e q u a t i o n   ( 7 ) ,   w e   o b t a i n :     c n t k n t c s c a c b + + = ) ˆ ) ( ( ) ( m     ( 9 )     H e n c e ,   b y   f i t t i n g   a   s t r a i g h t   l i n e   t h r o u g h   t h e   d a t a   p o i n t s   o f   p l o t     1 ( ) | s c N b n t n = v e r s u s 1 ˆ ( ) | c c N a n t n m = + ,   t h e   g r a d i e n t     ˆ k a n d   i n t e r c e p t ˆ c   c a n   b e   d e t e r m i n e d ,   w h i c h   a r e   e s t i m a t e   f o r   k   a n d   c ,   r e s p e c t i v e l y .   H e r e ,   t h e   l e a s t   s q u a r e s   l i n e - f i t t i n g   a l g o r i t h m   [ 9 ]   i s   e m p l o y e d   w h i c h   i s   g i v e n   a s :     ( ) [ ] ( ) ( ) [ ] s c c c c b T c a c a T c a t T T T k c 1 ˆ ˆ - =   ( 1 0 )     W h e r e     + + + = m m m ˆ ) ( . . . . . . . ˆ ) 2 ( ˆ ) 1 ( 1 . . . 1 1 N t t t T c c c c c a c a c a c a   ( 1 1 )       A n d     [ ] T c b c b c b c b N t t t n t s s s s ) ( . . . . . ) 2 ( ) 1 ( ) ( =   ( 1 2 )     C o n s e q u e n t l y ,   u s i n g   t h e   e s t i m a t e   o f   k ,   c   a n d   m f r o m   ( 6 )   a n d   ( 1 0 ) ,   t h e   c l o c k   r e a d i n g   i n   t h e   c o n t r o l   s e r v e r   c a n   b e   t r a n s f o r m e d   t o   t h e   c l o c k   r e a d i n g   i n   t h e   c o n t r o l   c l i e n t   t h r o u g h   ( 3 ) .   D e t e r m i n e   W h e t h e r   t h e   S y s t e m   i s   S y n c h r o n i z e d .   C l o c k   s y n c h r o n i z a t i o n   i n   r e a l - t i m e   s y s t e m s   i s   a n   o n g o i n g   p r o c e s s .   I n   o r d e r   t o   a v o i d   f r e q u e n t   r e p e t i t i o n   o f   c l o c k   s y n c h r o n i z a t i o n ,   w e   n e e d   t o   c o m p u t e   t h e   v a l u e   o f   s e r v e r - c l i e n t   c l o c k   o f f s e t .   A f t e r   t h e   s e r v e r   c l o c k   s y n c h r o n i z e s   w i t h   t h e   c l i e n t   c l o c k ,   t h e   c l i e n t   c l o c k   w i l l   c a l c u l a t e   e a c h   c l o c k   s y n c h r o n i z a t i o n   p a c k e t   t h a t   r e l e a s e d   f r o m   t h e   s e r v e r   c l o c k ,   i f   t h e   c a l c u l a t e d   o f f s e t   v a l u e   i s   n o t   l e s s   t h a n   o r   n o t   e q u a l   t o   a   v e r y   s m a l l   n u m b e r   w h i c h   d e t e r m i n e d   i n   a d v a n c e   ,   i t   s h o w s   t h e   t w o   c l o c k s   a r e   i n   d i f f e r e n t   s t a t u s   a n d   n e e d   t o   b e   o n l i n e   r e g u l a t e d .   C l o c k   o f f s e t   ( D )   i s   d e f i n e d   a s c s c c d d - .   ) ( ) ) ( ( ) ( ) ( n t n t n t n t t c s c c s c c a c b c a c b c c n - D - = - =   ) ) ( ( ) ( ) ( ) ( D - - = - = n t n t n t n t t s c c c c s c b c c c b c c c c n     I t   i s   c o m m o n   t o   a s s u m e   t h a t     [ ] 0 c s s c c c c c n n E t t - =       - - = D 2 ) ( ) ( 2 c c s c c c a c b t n t n t E   ( 1 3 )     2 . 2 .   S y n c h r o n i z a t i o n   o f   T h e   I E E E   1 5 8 8   U s i n g   t h e   p r e c i s i o n   t i m e   p r o t o c o l   ( P T P )   w h i c h   i s   d e f i n e d   b y   I E E E   1 5 8 8 ,   t h e   w h o l e   n e t w o r k e d   c l o c k   i s   d i v i d e d   i n t o   t w o   t y p e s ,   w h i c h   a r e   n a m e d   t h e   m a s t e r   c l o c k   a n d   t h e   s l a v e   c l o c k .   T h e   o p t i o n a l   c l o c k   o f   t h e   w h o l e   s y s t e m   i s   t h e   g r a n d m a s t e r   c l o c k ,   t h e   m a s t e r   c l o c k   w i t h i n   e a c h   P T P   i s   s e l e c t e d   b y   t h e   b e s t   m a s t e r   c l o c k   a l g o r i t h m   [ 1 0 ,   1 1 ] .   F i g u r e   1   s h o w s   a   t y p i c a l   m a s t e r - s l a v e   c l o c k   c o n f i g u r a t i o n   d i a g r a m .     Evaluation Warning : The document was created with Spire.PDF for Python.
                                              e - I S S N :   2 0 8 7 - 2 7 8 X   T E L K O M N I K A   V o l .   1 1 ,   N o .   7 ,   J u l y   2 0 1 3   :   3 8 2 6     3 8 3 3   3 8 2 9   n o d e 1   S   n o d e 2   M       S   n o d e 3   S   n o d e 4   S   n o d e 5   M       F i g u r e   1 .   M a s t e r - s l a v e   c o n f i g u r a t i o n       F i g u r e   2   s h o w s   t h e   s y n c h r o n i z a t i o n   p r i n c i p l e .   M o r e o v e r ,   w e   c a n   s e e   f r o m   F i g u r e   2   t h a t   t h e   s y n c h r o n i z a t i o n   p r o c e s s   i s   d i v i d e d   i n t o   t w o   p a r t s   t h a t   a r e   s e p a r a t e l y   n a m e d   t h e   o f f s e t   m e a s u r e m e n t   a n d   t h e   d e l a y   m e a s u r e m e n t .       m a s t e r                                     s l a v e   T m = 8 0 s         d e l a y = 1 s           T s = 3 0 s   T m 1 = 8 1                                                     T s = 3 1                           s y n c h r o n i o u s   p a c k e t         T s 1 = 3 2                                                                                           s u b s e q u e n t   p a c k e t             o f f s e t = T s 1 - T m 1   = - 4 9                               .                       T s = T s - o f f s e t   = T s + 4 9   T m = 1 0 1                                                     T s 2 = 1 0 0                                                                                   d e l a y   r e q u e s t   p a c k e t   T m 2 = 1 0 2                                                   d e l a y = [ ( T m 2 - T s 2 ) +   ( T s 1 - o f f s e t - T m 1 ) ] / 2   = 1   T m 3 = 1 0 3                       s y n c h r o n i o u s   p a c k e t             T s 3 = 1 0 4                           s u b s e q u e n t   p a c k e t               T s = T s - ( T s 3 - T m 3 )   .                   + d e l a y = T s - 0   s y n c h r o n i s i o n     F i g u r e   2 .   M a s t e r - s l a v e   s y n c h r o n i z a t i o n       O f f s e t   m e a s u r e m e n t .   M a s t e r   p e r i o d i c a l l y   s e n d s   t h e   s y n c h r o n i z e d   p a c k e t s   t o   a l l   i t s   c h i l d   n o d e s   b y   t h e   w a y   o f   m u l t i c a s t .   T h e   a c c u r a t e   e x p e c t e d   d e l i v e r y   t i m e   o f   s y n c h r o n i z a t i o n   m e s s a g e   i s   i n c l u d e d   i n   t h e   s y n c h r o n i z e d   p a c k e t s ,   t h e n ,   s l a v e   r e c o r d   t h e   t i m e   w h e n   t h i s   s y n c h r o n i z e d   p a c k e t s   i s   r e c e i v e d .   T h e   t i m e   i n f o r m a t i o n   t h a t   i s   i n c l u d e d   i n   t h e   s y n c h r o n i z e d   p a c k e t s   s h o u l d   s a t i s f y   t h e   r e q u i r e m e n t s   o f   t h e   l o w e r   p r e c i s i o n .   I f   t h e   s y s t e m   n e e d s   m o r e   p r e c i s e   c l o c k   s y n c h r o n i z a t i o n ,   m a s t e r   s h o u l d   h a v e   a   s p e c i f i c   m e c h a n i s m ,   w h i c h   c a n   d e t e c t   a   p a c k e t   Evaluation Warning : The document was created with Spire.PDF for Python.
T E L K O M N I K A     e - I S S N :   2 0 8 7 - 2 7 8 X     P r e c i s e   C l o c k   S y n c h r o n i z a t i o n   A l g o r i t h m   f o r   D i s t r i b u t e d   C o n t r o l   S y s t e m s   ( Y i   L i u )   3 8 3 0 t r a n s m i s s i o n   t i m e ,   a n d   t h e n ,   t h i s   s p e c i f i c   t i m e   w i l l   b e   s e n t   t o   s l a v e   i n   t h e   f o r m   o f   s u b s e q u e n t   p a c k e t s .   B y   t h i s   w a y ,   t h e   o f f s e t   c a n   b e   c a l c u l a t e d   b e t w e e n   m a s t e r   a n d   s l a v e .   D e l a y   m e a s u r e m e n t .   A f t e r   a d j u s t i n g   t h e   o f f s e t ,   s l a v e   s e n d s   a   d e l a y   r e q u e s t   p a c k e t   t o   m a s t e r ,   m a s t e r   r e c o r d s   t h e   t i m e   w h e n   t h i s   d e l a y   r e q u e s t   p a c k e t   i s   r e c e i v e d ,   a n d   t h e n   t h i s   t i m e   i n f o r m a t i o n   i s   s e n t   b a c k   t o   t h i s   s l a v e ,   s o ,   s l a v e   c a l c u l a t e   t h e   t r a n s m i s s i o n   d e l a y   b e t w e e n   t h e   m a s t e r   a n d   i t s e l f ,   a n d   t h e n   m a s t e r - s l a v e   c l o c k   s y n c h r o n i z a t i o n   i s   a c h i e v e d .       3 .   R e s u l t s   a n d   A n a l y s i s   3 . 1 .   T e s t   V e r i f y   F i g   3   s h o w s   t h e   s i m p l i f i e d   d a t a   f l o w   a r c h i t e c t u r e   o f   t h e   n e t w o r k e d   c o n t r o l   s y s t e m .   E a c h   n o d e   c o n n e c t s   t o   t h e   b u i l d i n g   s e r v e r   r o o m ,   w h i c h   i s   E t h e r n e t   s w i t c h   h o u s e .   T h e s e   s w i t c h e s   d i r e c t   d a t a   b e t w e e n   a l l   t h e   n o d e s   c o n n e c t e d   t o   t h e m   a n d   t o   t h e   o u t s i d e   w o r l d   t h r o u g h   a n   I n t e r n e t   b a c k b o n e .   T h e   c o n t r o l   s e r v e r   i s   d i r e c t l y   c o n n e c t e d   t o   t h e   p h y s i c a l   s y s t e m ,   w h i c h   h o s t s   a   P C L - 8 1 2 P G   c a r d ,   a   1 0 / 1 0 0 M   a d a p t i v e   N I C   a n d   a   P e n t i u m - 4   p r o c e s s o r   r u n n i n g   o n   w i n d o w s - N T .   T h e   c o n t r o l   c l i e n t   h o s t s   a   1 0 / 1 0 0 M   a d a p t i v e   N I C   a n d   a   P e n t i u m - 4   p r o c e s s o r   r u n n i n g   o n   w i n d o w s - 2 0 0 0 . I n   o r d e r   t o   s i m u l a t e   t h e   b a n d w i d t h   c o n s u m p t i o n   b y   o t h e r   e q u i p m e n t   t h a t   s h a r e   t h e   s a m e   E t h e r n e t   n e t w o r k e d ,   t h r e e   n o d e s   c o n t a i n   2   k i l o b y t e   b u f f e r   q u e u e   a r e   i n t r o d u c e d   b e t w e e n   t h e   c o n t r o l   s e r v e r   a n d   t h e   c l i e n t .   W e   u s e   V C + +   t o   w r i t e   e x p e r i m e n t a l   p r o g r a m s .   D i f f e r e n t   t e r m i n a l s   c o m m u n i c a t e   t h r o u g h   c a l l i n g   S o c k e t .   T w o   t e s t e d   m a c h i n e s   s e p a r a t e l y   r u n   c l i e n t   p r o g r a m s   a n d   s e r v e r   p r o g r a m s .   F i r s t ,   w e   i n i t i a l i z e   c l i e n t   a n d   s e t   u p   c o n n e c t i o n   t o   t h e   r e m o t e   s e r v e r ' s   n e t w o r k e d ,   a n d   t h e n   e n t e r   t h e   t e s t   p a r a m e t e r s   t o   b e g i n   t h e   t e s t .         E t h e r n e t   I n t e r n e t   N o d e   C o n t r o l   s e r v e r   C o n t r o l   c l i e n t 2   N o d e   N o d e   C o n t r o l   c l i e n t 1   P h y s i c a l   s y s t e m       F i g u r e   3 .   N e t w o r k e d   c o n t r o l   s y s t e m   a r c h i t e c t u r e       3 . 2 .   T e s t   D a t a   M a s t e r   c l o c k   i s   t h e   s e r v e r   c l o c k .   S l a v e   c l o c k   i s   t h e   c l i e n t     c l o c k ,   U D P   p r o t o c o l   i s   a d o p t e d   f o r   a l l   d a t a   c o m m u n i c a t i o n   a c t i v i t i e s   b e t w e e n   t h e   c o n t r o l   s e r v e r   a n d   t h e   c l i e n t ,   t h e   d a t a g r a m   i s   5 1 2 b y t e ,   t h e   s a m p l i n g   p e r i o d   i s   1 m s   w i t h o u t   p a c k e t   l o s i n g ,   1 0 0 d a t a   s e t s   w i l l   b e   s e l e c t e d   f r o m   N   d a t a   s e t s   a t   a n   i n t e r v a l   o f   1 0 m i n .   E x p e r i m e n t   p e r f o r m s   f o r   1 2   h o u r s .   I n   t h e   n e t w o r k   e n v i r o n m e n t   o f   1 0 M   r a t e ,   T a b l e   1   s h o w s   t h e   t e s t   r e s u l t s .   I n   t h e   n e t w o r k   e n v i r o n m e n t   o f   1 0 0 M   r a t e ,   T a b l e   2   s h o w s   t h e   t e s t   r e s u l t s .       T a b l e   1 .   P r e - t e s t   R e s u l t   C l o c k   M a s t e r [ m s ]   s l a v e 1 [ m s ]   s l a v e 2 [ m s ]   L o a d   n o r m a l   l o a d   ( n o n - p a c k e t   r e t r a n s m i s s i o n )   M a x - d e v i a t i o n   0   1 9 6   1 8 7   M i n - d e v i a t i o n   0   2 4   2 0   A v e r - d e v i a t i o n   0   7 0   6 6   Evaluation Warning : The document was created with Spire.PDF for Python.
                                              e - I S S N :   2 0 8 7 - 2 7 8 X   T E L K O M N I K A   V o l .   1 1 ,   N o .   7 ,   J u l y   2 0 1 3   :   3 8 2 6     3 8 3 3   3 8 3 1 T a b l e   2 .   P r e - t e s t   R e s u l t   C l o c k   M a s t e r [ m s ]   s l a v e 1 [ m s ]   s l a v e 2 [ m s ]   L o a d   n o r m a l   l o a d   ( n o n - p a c k e t   r e t r a n s m i s s i o n )   M a x - d e v i a t i o n   0   9 3 4   8 6 4   M i n - d e v i a t i o n   0   1 8 9   1 8 0   A v e r - d e v i a t i o n   0   3 7 4   3 4 8       T e s t   r e s u l t   s h o w s   t h a t   w i t h o u t   t h e   u s e   o f   s y n c h r o n i z a t i o n   a l g o r i t h m s .   I n   t h e   n e t w o r k   e n v i r o n m e n t   o f   1 0 M   r a t e ,   a n   a v e r a g e   c l o c k   d e v i a t i o n   f r o m   t h e   m a s t e r   t o   t h e   s l a v e r   i s   a b o u t   7 0 m i l l i s e c o n d s .   I n   t h e   n e t w o r k   e n v i r o n m e n t   o f   1 0 0 M   r a t e ,   a n   a v e r a g e   c l o c k   d e v i a t i o n   f r o m   t h e   m a s t e r   t o   t h e   s l a v e r   i s   a b o u t   3 7 4 m i l l i s e c o n d s .   T h e   s y n c h r o n o u s   p r e c i s i o n   d o e s   n o t   s u i t a b l e   f o r   t h e   r e q u i r e m e n t s   o f   r e a l - t i m e   n e t w o r k e d   c o n t r o l   s y s t e m .   T h e r e f o r e ,   t h e   l e a s t   s q u a r e   m e t h o d   i s   u s e d   t o   s o l v e   t h e   p r o b l e m .     3 . 3 .   P a r t   o f   P r o g r a m   P a r t   o f   f i t t i n g   s t r a i g h t   l i n e   p r o g r a m   F i t L i n e ( d o u b l e   x [ ] ,   d o u b l e   y [ ] , i n t   c o u n t s )   { d o u b l e   m x = 0 ;     d o u b l e   m y = 0 ;     f o r ( i n t   i = 0 ; i < c o u n t s ; i + + ) { m x + = x [ i ] ; m y + = y [ i ] ; }   m x = m x / c o u n t s ;   m y = m y / c o u n t s ;   d o u b l e   * x d ;   x d   =   n e w   d o u b l e [ c o u n t s ] ;   d o u b l e   * y d ;   y d   =   n e w   d o u b l e [ c o u n t s ] ;   d o u b l e   x x s u m = 0 ;     d o u b l e   x y s u m = 0 ;   f o r ( i n t   i = 0 ; i < c o u n t s ; i + + )   { x d   =   x   -   m x ; y d   =   y   -   m y ;   x x s u m   =   x x s u m   +   x d * x d ;   x y s u m   =   x y s u m   +   x d * y d ;   }   d o u b l e   k , c ;   k   =   x y s u m / x x s u m ;   c   =   m y   -   k * m x ; }   P a r t   o f   s y n c h r o n i z a t i o n   p r o g r a m   . .   W h e t h e r   o r   n o t ( d o u b l e   o f f s e t ,   d o u b l e   e x p )   { i n t   f l a g ;   i f ( f a b s ( o f f s e t ) < = e x p )   f l a g = 0 ; e l s e   f l a g = 1 ;   r e t u r n ( f l a g ) ; }   .   S y n c h r o n i z a t i o n ( i n t   f l a g )   { i f ( f l a g )     u p d a t e _ c l o c k ( ) ;   e l s e   w a i t   r e c e i v e m s g ( ) ; }       3 . 4 .   V e r i f i c a t i o n   T a b l e   3   s h o w s   t h e   t e s t   r e s u l t s   u n d e r   t h e   n e t w o r k   e n v i r o n m e n t   o f   1 0 M   r a t e ,   a n   a v e r a g e   c l o c k   d e v i a t i o n   f r o m   t h e   m a s t e r   t o   t h e   s l a v e   i s   a b o u t   9   m i c r o s e c o n d s ,   s y n c h r o n i z a t i o n   a c c u r a c y   i s   l e s s   t h a n   2 5   m i c r o s e c o n d s .   T a b l e   4   s h o w s   t h e   t e s t   r e s u l t s   u n d e r   t h e   n e t w o r k   e n v i r o n m e n t   o f   1 0 0 M   r a t e ,   a n   a v e r a g e   c l o c k   d e v i a t i o n   f r o m   t h e   m a s t e r   t o   t h e   s l a v e   i s   a b o u t   1 3 4   m i c r o s e c o n d s ,   s y n c h r o n i z a t i o n   a c c u r a c y   i s   l e s s   t h a n   3 6 5   m i c r o s e c o n d s .       Evaluation Warning : The document was created with Spire.PDF for Python.
T E L K O M N I K A     e - I S S N :   2 0 8 7 - 2 7 8 X     P r e c i s e   C l o c k   S y n c h r o n i z a t i o n   A l g o r i t h m   f o r   D i s t r i b u t e d   C o n t r o l   S y s t e m s   ( Y i   L i u )   3 8 3 2 T a b l e   3 .   S y n c h r o n i z a t i o n - t e s t   R e s u l t   C l o c k   M a s t e r [ u s ]   s l a v e 1 [ u s ]   s l a v e 2 [ u s ]   L o a d   n o r m a l   l o a d   ( n o n - p a c k e t   r e t r a n s m i s s i o n )   M a x - d e v i a t i o n   0   2 5   2 1   M i n - d e v i a t i o n   0   0   4   A v e r - d e v i a t i o n   0   1 0   8       T a b l e   4 .   S y n c h r o n i z a t i o n - t e s t   R e s u l t   C l o c k   M a s t e r [ u s ]   s l a v e 1 [ u s ]   s l a v e 2 [ u s ]   L o a d   n o r m a l   l o a d   ( n o n - p a c k e t   r e t r a n s m i s s i o n )   M a x - d e v i a t i o n   0   3 6 5   3 2 1   M i n - d e v i a t i o n   0   0   6 2   A v e r - d e v i a t i o n   0   1 4 5   1 2 3       P T P     R e s u l t s .   T a b l e   5   s h o w s   t h e   t e s t   r e s u l t s   u n d e r   t h e   n e t w o r k   e n v i r o n m e n t   o f   1 0 M   r a t e ,   a n   a v e r a g e   c l o c k   d e v i a t i o n   f r o m   t h e   m a s t e r   t o   t h e   s l a v e   i s   a b o u t   7   m i c r o s e c o n d s ,   s y n c h r o n i z a t i o n   a c c u r a c y   i s   l e s s   t h a n   2 4   m i c r o s e c o n d s .       T a b l e   5 .   P T P - t e s t   R e s u l t   C l o c k   M a s t e r [ u s ]   s l a v e 1 [ u s ]   s l a v e 2 [ u s ]   L o a d   n o r m a l   l o a d   ( n o n - p a c k e t   r e t r a n s m i s s i o n )   M a x - d e v i a t i o n   0   2 0   2 4   M i n - d e v i a t i o n   0   0   5   A v e r - d e v i a t i o n   0   6   8       P T P     R e s u l t s .   T a b l e   6   s h o w s   t h e   t e s t   r e s u l t s   u n d e r   t h e   n e t w o r k   e n v i r o n m e n t   o f   1 0 0 M   r a t e ,   a n   a v e r a g e   c l o c k   d e v i a t i o n   f r o m   t h e   m a s t e r   t o   t h e   s l a v e   i s   a b o u t   9 4   m i c r o s e c o n d s ,   s y n c h r o n i z a t i o n   a c c u r a c y   i s   l e s s   t h a n   3 0 4 m i c r o s e c o n d s .       T a b l e   6 .   P T P - t e s t   R e s u l t   C l o c k   M a s t e r [ u s ]   s l a v e 1 [ u s ]   s l a v e 2 [ u s ]   L o a d   n o r m a l   l o a d   ( n o n - p a c k e t   r e t r a n s m i s s i o n )   M a x - d e v i a t i o n   0   2 8 0   3 0 4   M i n - d e v i a t i o n   0   0   6 2   A v e r - d e v i a t i o n   0   8 5   1 0 2       4 .   C o n c l u s i o n   A f t e r   t h e   s y n c h r o n i z a t i o n   o f   m a s t e r   c l o c k ,   i n   t h e   n e t w o r k   e n v i r o n m e n t   o f   1 0 M   r a t e ,   t h e   a v e r a g e   p h a s e   e r r o r   o f   t h e   m a s t e r   c l o c k   i s   a b o u t   9   m i c r o s e c o n d s ,   i n   t h e   n e t w o r k   e n v i r o n m e n t   o f   1 0 0 M   r a t e ,   t h e   a v e r a g e   p h a s e   e r r o r   i s   a b o u t   1 3 4   m i c r o s e c o n d s .   T h e s e   r e s u l t s   i n d i c a t e   t h a t   a   s i m p l e   l e a s t - s q u a r e s   m e t h o d   c a n   s a t i s f y   t h e   r e q u i r e m e n t s   i n   r e a l - t i m e   n e t w o r k e d   c o n t r o l   s y s t e m .   T h e   m e t h o d   i s   s i m p l e   t o   b e   d e s i g n e d   a n d   e a s y   t o   b e   i m p l e m e n t e d ,   a n d   t h a t   t h e   s y n c h r o n i z a t i o n   c l o c k   a c c u r a c y   r e a c h e s   s u b - m i c r o s e c o n d   g r a d e ,   w h i c h   i s   t h e   s a m e   a s   t h e   P T P .           Evaluation Warning : The document was created with Spire.PDF for Python.
                                              e - I S S N :   2 0 8 7 - 2 7 8 X   T E L K O M N I K A   V o l .   1 1 ,   N o .   7 ,   J u l y   2 0 1 3   :   3 8 2 6     3 8 3 3   3 8 3 3 A c k n o w l e d g e m e n t s   T h e   a u t h o r s   g r a t e f u l l y   a c k n o w l e d g e   f i n a n c i a l   s u p p o r t   f r o m   L i a o n i n g   U n i v e r s i t y   o f   T e c h n o l o g y   o f   c h i n a   u n d e r   G r a n t   N u m b e r   X 2 0 7 2 1 8 .       R e f e r e n c e s   [ 1 ]   Sh a m e s ,   AN   Bi s h o p .   R e l a t i v e   c l o c k   s y n c h r o n i z a t i o n   i n   w i r e l e s s   n e t w o r k s .   I EEE  C o m m u n i c a t i o n s   L e t t e r s .   2 0 1 0 ;   1 4 ( 4 ) :   3 4 8 - 3 5 0 .   [ 2 ]   J o h a n n e s s e n .   T i m e   s y n c h r o n i z a t i o n   i n   a   l o c a l   a r e a   n e t w o r k .   C o n t r o l   S y s t e m s   M a g a z i n e .   2 0 0 4 ;   2 :   6 1 - 6 9 .   [ 3 ]   Bl u m   a n d   L   T h i e l e .   C l o c k   s y n c h r o n i z a t i o n   u s i n g   p a c k e t   s t r e a m s .   i n   Pr o c .   o f   1 6 t h   I n t e r n a t i o n a l   Sy m p o s i u m   o n   D i s t r i b u t e d   C o m p u t i n g   2 0 0 2 .   T o u l o u s e .   F r a n c e .   2 0 0 2 :   1 - 8 .   [ 4 ]   M   H a s h i m o t o ,   H   H a s h i z u m e ,   Y   Ka t o h .   D e s i g n   o f   d y n a m i c s   f o r   s y n c h r o n i z a t i o n   b a s e d   c o n t r o l   o f   h u m a n - r o b o t   i n t e r a c t i o n .   i n   Pr o c e e d i n g s   o f   t h e   2 0 0 6   I EEE  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   R o b o t i c s   a n d   Bi o m i m e t i c s   R O BI O 0 6 .   K u n m i n g .   C h i n a .   2 0 0 6 :   7 9 0 - 7 9 5 .   [ 5 ]   M Y   M a ,   L   H u ,   J D   W u ,   X N   H e ,   H   M a .   Sy n c h r o n i z a t i o n   a n a l y s i s   o n   c o n v e r t e r s   w i t h   d i s t r i b u t e d   c o n t r o l .   i n   I EC O N   2 0 0 6 - 3 2 n d   An n u a l   C o n f e r e n c e   o n   I EEE  I n d u s t r i a l   El e c t r o n i c s .   2 0 0 6 :   2 2 3 2 - 2 2 3 7 .   [ 6 ]   D   M i l l s .   I m p r o v e d   Al g o r i t h m s   f o r   Sy n c h r o n i z i n g   C o m p u t e r   N e t w o r k e d   C l o c k s .   I EEE/ AC M   T r a n s   n e t w o r k e d i n g .   1 9 9 5 ;   3 ( 3 ) :   2 4 5 - 2 5 4 .   [ 7 ]   J o h n   Ei d s o n .   M e a s u r e m e n t ,   C o n t r o l ,   a n d   C o m m u n i c a t i o n   U s i n g   I EEE  1 5 8 8 .   L o n d o n .   Sp r i n g e r - Ve r t a g   N e w   Y o r k   I n c .   2 0 0 6 .   [ 8 ]   J   N i l s s o n .   R e a l - t i m e   C o n t r o l   s y s t e m s   w i t h   D e l a y s .   PH .   D .   D i s s e r t a t i o n .   Sw e d e n   L u n d   I n s t i t u t e   o f   T e c h n o l o g y .   D e p a r t m e n t   o f   A u t o m a t i c   C o n t r o l ;   1 9 9 8 .   [ 9 ]   L   L j u n g .   S y s t e m   I d e n t i f i c a t i o n - T h e o r y   f o r   t h e   U s e r .   e d t i e d   b y   Pr e n t i c e - H a l l ,   I n c .   E n g l e w o o d   C l i f f s .   N J .   1 9 8 7 .   [ 1 0 ]   I EEE  St a n d a r d   A s s o c i a t i o n .   1 5 8 8 - 2 0 0 2 .   I EEE  St a n d a r d   f o r   a   p r e c i s i o n   c l o c k   s y n c h r o n i z a t i o n   p r o t o c o l   f o r   n e t w o r k e d   m e a s u r e m e n t   a n d   c o n t r o l   s y s t e m s .   N e w   Y o r k .   I EEE  Pr e s s .   2 0 0 2 .   [ 1 1 ]   Y a n   Z h a n g ,   H e x u   Su n .   Ap p l i c a t i o n   o f   I EEE  1 5 8 8   i n   R e a l - T i m e   I n d u s t r i a l   Et h e r n e t .   M i c r o c o m p u t e r   I n f o r m a t i o n .   C h i n e s e .   2 0 0 5 ;   2 1 ( 9 ) :   1 9 - 2 1 .     Evaluation Warning : The document was created with Spire.PDF for Python.