I n te r n ati o n al   Jo u r n al   o El e c tr i c a l   an d   C o m p u te r   En gi n e e r i n g   (I JEC E )   V o l .   10 ,   N o .   3 J u n e   20 20 ,   pp .   2668 ~ 2681   IS S N :   2088 - 8708 D O I :   10. 1 1591 / i j e c e . v 10 i 3 . pp2668 - 2681             2668       Jou r n al   h o m e pa ge ht t p: / / i j e c e . i ae s c or e . c om / i nd e x . php / IJ E CE   T r a n sf o r m i n g   a   t r a d i t i o n a l   h o m e   g a t e w a y   i n t o   a   h a r d w a r e - a c c e l e r a t e d   S D N   s w i t c h       S e b as ti an o   M i an o ,   F u l v i o   R i s s o   D e pa r t m e n t   o f   C o m put e r   a n C o nt r o l   E ng i ne e r i ng ,   P o l i t e c ni c o   di   T o r i no ,   I t a l y       A r ti c l e   I n fo     A B S TR A C T   Ar t i c l e   h i s t or y :   R e c e i v e M a y   15,   2019   R e v i s e O c t   31,   2 019   A c c e pt e D e c   6,   20 19       N o w a da y s ,   t r a d i t i o na l   ho m e   g a t e w a y s   m us t   s up po r t   i nc r e a s i ng l y   c o m pl e a ppl i c a - t i o ns   w h i l e   ke e p i ng   t h e i r   c o s t   r e a s o na b l y   l o w .   S o f t w a r e   D e f i n e d   N e t w o r ki ng   ( S D N )   w o u l s i m p l i f y   t he   m a n a g e m e nt   o f   t ho s e   de v i c e s ,   bu t   s uc a a p pr o a c i s   t y pi c a l l y   r e s e r v e f o r   ne w   ha r dw a r e   d e v i c e s ,   s pe c i f i c a l l y   e ng i ne e r e f o r   t hi s   pa r a d i g m .   A s   a   c o ns e que nc e ,   t y pi c a l   S D N - ba s e ho m e   g a t e w a y   pe r f o r m s   t he   s w i t c hi ng   i n   s o f t w a r e ,   r e s ul t i ng   i no n - ne g l i g i b l e   pe r f o r m a nc e   de g r a da t i o n.   I t hi s   pa pe r ,   w e   pr o v i de   o ur   e xp e r i e nc e   a nd   f i ndi ng s   o f   a dd i ng   t h e   O pe nF l o w   s u ppo r t   i n t o   a   no n - O pe nF l o w   c o m pa t i b l e   ho m e   g a t e w a y ,   e xpl o i t i ng   t he   po s s i b l e   ha r dw a r e   s p e e d up  a v a i l a b l e   i n   t he   e x i s t i ng   pl a t f o r m .   W e   pr e s e n t   o ur   s o l ut i o t ha t   t r a ns pa r e n t l y   o f f l o a ds   a   po r t i o o f   t he   O pe nF l o w   r ul e   i n t o   t he   ha r dw a r e ,   w hi l e   ke e p i ng   t he   r e m a i ni ng   o ne s   i s o f t w a r e ,   be i ng   a bl e   t o   s uppo r t   t h e   pr e s e nc e   o f   m ul t i p l e   h a r dw a r e   t a bl e s   w i t a   di f f e r e n t   s e t   o f   f e a t ur e s .   M o r e o v e r ,     w e   i l l us t r a t e   t he   de s i g c ho i c e s   u s e d   t o   i m p l e m e nt   t he   f unc - t i o na l i t i e s   r e qu i r e by   t he   O pe nF l o w   pr o t o c o l   ( e . g . ,   pa c ke t - i n ,   pa c ke t - o ut   m e s s a g e s )   a nd  f i na l l y ,   w e   e v a l ua t e   t he   r e s u l t i ng   a r c hi t e c t u r e ,   s ho w i ng   t he   s i g ni f i c a nt   a dv a nt a g e   i t e r m s   o f   pe r f o r m a nc e   t ha t   c a be   a c hi e v e by   e xpl o i t i ng   t he   unde r l y i ng   ha r dw a r e ,   w hi l e   m a i n t a i n i ng   a S D N - t y pe   a bi l i t y   t o   pr o g r a m   a nd  t o   i ns t a n t i a t e   de s i r e d   ne t w o r k   o pe r a t i o ns   f r o m   a   c e nt r a l   c o nt r o l l e r .   Ke y w or d s :   H a r dw a r e   o f f l o a di n g   O pe n l o w   S of t w a r e   de f i n e n e t w o r ks     C opy r i gh t   ©   2020   I n s t i t ut e   o f   A dv anc e E ng i ne e r i ng   and   S c i e nc e   A l l   r i gh t s   r e s e r v e d .   Cor r e s pon di n g   Au t h or :   S e b a s t i a n o   M i a n o ,     D e pa rt m e n t   o f   Co n t r o l   a n d   Co m put e E n g i n e e ri n g,   P o l i t e c n i c o   di   T o ri n o ,   Co r s o   D uc a   de gl i   A b r u z z i ,   24 ,   10129 ,   T O ,   I t a l y .   E m a i l :   s e b a s t i a n o . m i a n o @ po l i t o . i t       1.   I N TR O D U C TI O N   S of t w a r e   D e f i n e N e t w o r ki n (S D N p r o po s e s   a   n e w   pa r a d i gm   i n t o   t h e   c o m put e r   n e t w o r ki n f i e l d   t h a t   a l l o w s   n e t w o r a dm i n i s t r a t o r s   t o   m a n a ge   n e t w o r s e r vi c e s   f r o m   a   c e n t ra l i z e po i nt   o c o n t r o l   t hr o ug a b s t ra c t i o n   o f   l ow e r   l e ve l   f un c t i o n a l i t y   [1,   2].   T hi s   i s   a c hi e ve by   s e pa r a t i n t h e   s y s t e m   t ha t   m a ke s   de c i s i o n s   a b o ut   w h e r e   t ra f f i c   i s   s e n t   (t h e   c o n t r o l   pl a n e f r o m   t h e   un de rl y i n s y s t e m s   t ha t   f o r w a r t r a f f i c   t t h e   s e l e c t e d   de s t i na t i o n   (t h e   da t a   p l a n e ) .   O f   c o ur s e ,   t hi s   a pp r o a c h   b ri n g s   s i gn i f i c a nt   b e n e f i t s   i n   t h e   m o de rn   da t a   c e nt e w h e r e   t h e   i m p r o v e m a na ge m e n t   o f   t h e   n e t w o r a n d   t h e   a gi l i t y   of   r e - c o n f i gur a t i o n s   m a ke   t h i s   f e a t u r e   a ppe a l i n a n i n   g r e a t   de m a n d ,   gi v e n   a l s o   t h e   hi g h   n u m b e of   s e r ve r s   t h a t   s h o ul b e   h a n d l e d.   A t   t h e   s a m e   t i m e ,   t h e   S D N   i nn o v a t i o n   c a n   b ri n s i g ni f i c a n t   a dv a n c e m e nt s   t o   di ff e r e n t   a r e a s   t o o .   A n   i m po r t a nt   do m a i n   t h a t   s t a r t e d   t o   r e c e i v e   a n   i n c r e a s i n g   c o n s i de r a t i o i s   t h e   a d m i ni s t r a t i o n   o f   h o m e   n e t w o r ks   [3] .   T r a d i t i o n a l   h o m e   ga t e w a y s   a r e   ge t t i ng  h a rde r   t o   m a n a ge   a s   n e w   a ppl i c a t i o n   a r e   i nt r o duc e a n d   m o ve a t   t h e   c us t o m e r   p r e m i s e s .   I n   t h i s   r e ga r d ,   a ppl y i n g   S D N   t o   t h i s   de v i c e   w o ul f a c i l i t a t e   t h e   h o m e   n e t w o r m a na ge m e n t   by   pr o v i di n g   t h e   po s s i b i l i t y   t o   pr o gra m   a n d   c o n t r o l   t h e   h o m e   n e t w o r de v i c e   f r o m   a   c e n t r a l i z e   po i n t   o f   c o n t r o l ,   a l s o   a l l o w i n us e r s   t o   m a na ge   a n c o n f i gur e   t h e   b e h a v i o r   o t h e i r   n e t w o r v i a   hi g h - l e v e l   a ppl i c a t i o n   t h a t   c a n   b e   a l s o   d e s i gn e by   t h i r d - pa rt y   de v e l o pe r   [4].   T o   e n a b l e   t h i s   pa ra d i gm   s h i f t ,   t h e   m o s t   c o m m o w a y   i s   t o   t r a n s f o r m   t h e   h o m e   ga t e w a y   i n t o   a O pe n F l o w   [5]  s w i t c h .   Evaluation Warning : The document was created with Spire.PDF for Python.
Int   J   E l e c   &   Co m E n g     IS S N :   2088 - 8708       T r ans f or m i ng  t r adi t i ona l   hom e   ga t e w ay   i n t har dw ar e - ac c e l e r a t e SD N   s w i t c h   ( Se bas t i ano   M i ano )   2669   E v e n   t h o ugh   o v e r   t h e   y e a r s   di ff e r e n t   h a rdw a r e - b a s e O pe n F l o w   s w i t c h e s   h a v e   b e e n   r e l e a s e [6]  t h a t   pe r f o r m   v e r y   h i g h - s pe e O pe n F l o w   s w i t c h i ng,   t h e   m a j o r i t y   o f   Cus t o m e r   P r e m i s e s   E qui pm e n t ’s   (CP E s s t i l l   us e   S y s t e m   o n   Ch i (S o C)  a r c hi t e c t u r e s   w i t h   a n   i nt e gra t e l a y e r   de v i c e .   L a y e r   s w i t c h i ng  i s   ha r dw a r e - b a s e d,   w h i c h   m e a n s   s w i t c h e s   us e   a ppl i c a t i o n - s pe c i f i c   i n t e g r a t e c i r c ui t   (A S ICs )   f o r   m a ki ng  s w i t c h i n de c i s i o n s   v e r y   qui c kl y .   T h e y   a r e   us u a l l y   t r a di t i o n a l ,   n o n - O pe n F l o w   c o m pa t i b l e   A S ICs ,   w h i c h   m a ke s   t h e   t r a n s i t i o n   t o   S D N -   c o m pl i a nt   s o l ut i o n s   f a r   a w a y .   E xt e n d i n t h e s e   de v i c e s   w i t h   t h e   s uppo r t   f o r   t h e   O pe n F l o w   pr o t o c o l   w o ul e n a b l e   m o r e   f l e x i b l e   a n g ra nul a r   s e r v i c e   pr o v i s i o n i n e v e n   t o   ge n e r a l l y   l i t t l e   o r ga ni z a t i o n s   t ha t   c o ul d n ’t   m a na ge   t h e   c o s t   of   upgr a d i n g   t h e i r   n e t w o r ks   w i t h   n e w   de v i c e s   w i t h   na t i v e   O pe n F l o w   s uppo r t .   A   na i v e   s o l ut i o n   t o   t h i s   a pp r o a c h   w o ul b e   t o   a dd  s of t w a re   S D N   s w i t c h   (e . g. ,   O pe n   v S w i t c h   [7])   i n t o   t h e   h o m e   ga t e w a y ;   i n   t h i s   c a s e ,   t h e   s w i t c hi n i s   do n e   e nt i r e l y   i n   s o f t w a r e ,   r e s ul t i n i n   po o r   pe r f o r m a n c e .   M o r e ov e r ,   o t h e r   h i g h - s pe e pa c ke t   pr o c e s s i n s o l ut i o n s   s uc h   a s   D P D K   [8]  o r   N e t m a [9 ],   w o ul r e qui r e   t o   m a p   o n e   o r   m o r e   n e t w o r i nt e r f a c e   t o   a   CP U   c o r e ,   c o n s um i n g   i m po rt a nt   r e s o ur c e s   f r o m   t h e   CP E   t ha t   c a nn o t   b e   us e t o   ha n dl e   t h e   o t h e r   o pe ra t i o n s .   T o   r e duc e   t h i s   o v e r h e a d   a nd  s pe e dup  t h e   O pe n F l o w   pr o c e s s i n a n d   fo r w a r d i n o f   pa c ke t ,   w e   c o ul e xpl o i t   t h e   ha r dw a r e   a v a i l a b l e   i a   t r a di t i o na l   h o m e   g a t e w a y .   O f   c o ur s e ,   n o t   e v e r y   o pe r a t i o c a n   b e   a c c e l e r a t e d;   i n   f a c t ,   e v e r y   h a r dw a r e   s w i t c h   ha s   a   f i ni t e   n u m b e r   o f   T CA M ,   c ri t i c a l   fo r   i m p l e m e nt i ng  l i n e - s pe e fo r w a r di ng,   a nd  i t   c a n   h o l o n l y   a   l i m i t e n um b e r   o f   f l ow s .   F o r   s o m e   h a r dw a r e ,   th e   n u m b e r   o f   f l ow s   i s   o n l y   o n e   ki n o f   l i m i t a t i o n.   M o s t   s w i t c h e s   w e r e   n o t   de s i g n e w i t h   a n y t h i ng  l i ke   O pe n F l o w   i n   m i n d ,   e s pe c i a l l y   w h e n   t h e i r   i n t e r f a c e   A S ICs   w e r e   l a i o ut .   T h e   c hi ps   do   a   e x c e l l e n t   j ob   of  s w i t c h i n g ,   a n d   f r e que nt l y   ha n dl e   b a s i c   L a y e r   3 - 4   f un c t i o n s   a s   w e l l ,   b ut   O pe n F l o w   a s ks   f o r   a   g r e a t   de a l   m o r e .   T h i s   pa pe r   de s c r i b e s   o ur   e xpe r i e n c e   i n   po rt i ng  O pe n F l o w   on   a l r e a dy   e xi s t i n h a rdw a r e   s w i t c h   w i t n o   s uppo rt   f o r   t h e   O pe n F l o w   s t a n d a r d .   W e   de s c r i b e   o ur   a rc h i t e c t ur e   t h a t   i n t e g ra t e s   a   h y b r i s o f t w a r e   a n d   ha r dw a r e   pi pe l i n e   a n c a c o m pe n s a t e   t h e   ha r dw a r e   l i m i t a t i o n s   i n   t e r m s   o f   s uppo r t e m a t c h e s   a n a c t i o n s ,   off l o a di n o nl y   pa r t   o f   t h e   O pe n F l o w   r ul e s ,   w h i c h   a r e   pr o p e r l y   t r a n s l a t e i nt o   t h e   c o r r e s po n d i n h a rdw a r e   r e l a t e c o m m a n ds .   W h i l e   t hi s   m a pp i n c o ul d   r e s ul t   m o re   ve n do r   s pe c i f i c ,   w e   b e l i e v e   t h a t   t h e   o ve r a l l   a r c hi t e c t u r e   f o r   t h e   o ff l o a di n g   p r e s e n t e i n   t h i s   pa pe r   i s   v e n do r   n e ut ra l   e n o ug h   t o   b e   e xpo r t e i n   o t h e r   pl a t f o r m s   w i t h   s i m i l a r   c ha r a c t e r i s t i c s .   M o r e o ve r ,   w e   pr e s e n t   o ur   a l go r i t h m   t h a t   i s   a b l e   t o   m a t h e   O pe n F l o w   s of t w a r e   pi pe l i n e   i n t o   t h e   c o rr e s po n di ng  h a rdw a r e   pi pe l i n e ,   c o n s i de ri n g   t h e   d i f fe r e nt   n u m b e r   o f   t a b l e s   (e . g. ,   M A C,   V L A N ,   A CL ,   e t c . . a v a i l a b l e   i n   t h e   ha r dw a re   de v i c e ,   w h i l e   m a i n t a i ni n t h e   s e m a n t i c   a n d   pr e c e de n c e   of   t h e   r ul e s .   I n   o u r   w o r k,   w e   us e t h e   ha r dw a r e   pi pe l i n e   of   t h e   N X P   Q o r IQ   T 1040  pl a t f o r m ,   di v i di n t h e   s uppo r t e r u l e s   w i t h i n   t h e   t a b l e s   a v a i l a b l e   i n   t he   i n t e g ra t e s w i t c h   s i l i c o n.   F i n a l l y ,   a l l   t h e   r ul e s   (i n c l udi ng  e i t h e r   t h e   m a t c h   o r   t h e   a c t i o n   p a r t t h a t   c a nn o t   b e   m a ppe w i t h   t h e   e xi s t i ng  h a r dw a r e ,   s uc h   a s   r e w r i t i n a   M A h e a de r,   a r e   e xe c ut e i n   t h e   s o f t w a r e   pi pe l i n e ,   w hi c h   i s   b a s e o n   t h e   o pe n   s o ur c e   xD P [10]   p r o j e c t .   T h i s   pa pe r   i s   o r g a n i z e a s   f o l l ow s :   w e   de s c r i b e   t h e   pl a t f o r m   w e   us e t o   v a l i da t e   o ur  s e l e c t i v e   off l o a di n a l go r i t h m   i n   S e c t i o n   2 .   S e c t i o n   3   i l l us t r a t e s   our   a r c hi t e c t u r a l   de s i g n   f o r   t h e   O pe n F l o w   r ul e s   off l o a di n g ,   a nd  S e c t i o n   pr e s e nt s   t h e   m o s t   s i g n i f i c a n t   i m p l e m e nt a t i o n   de t a i l s   of   o ur   p r o t o t y pe .   F i n a l l y   w e   s h o w   t h e   e v a l ua t i o a nd  r e s ul t s   i S e c t i o n   5   a n d   w e   b r i e f l y   di s c us s   r e l a t e w o r ks   i n   S e c t i o n   6.   S e c t i o n   7   c o n c l ude s   t h e   pa pe r.       2.   B A C K G R O U N D   T h i s   s e c t i o n   p r o v i de s   a   de s c r i pt i o n   of   t h e   pl a t f o r m   t ha t   we   us e d   to   v a l i d a t e   our   s o l ut i o n .   In   p a rt i c ul a r,   we   pr e s e n t   t h e   i n t e r f a c e   a n d   A P Is   t ha t   a r e   us e t o   pr o g r a m   t h e   b e h a v i o r   o f   t h e   h a r dw a r e   s w i t c h   a v a i l a b l e   i t h e   t ra di t i o na l   h o m e   ga t e w a y   t o ge t h e r   w i t h   a   de s c r i pt i o n   of   i t s   h a r dw a r e   pi pe l i n e ,   w h o s e   kn ow l e dge   i s   f un da m e nt a l   t o   c o r r e c t l y   t r a n s l a t e   t h e   s e t   o f   O pe n F l o w   r ul e s   i n t o   de v i c e - s pe c i f i c   e n t ri e s .     2. 1 .     N X P   Q o r I Q   T10 40   T h e   N X P   Q o r IQ   T 104 [ 11 ]   p l a t f o r m   c o n t a i n s   a   f o ur   64  b i t s   CP U   c o r e s   (P ow e r P e 5500),   c o n n e c t e t o   a ddi t i o na l   m o dul e s   b e l o n gi n t o   t h e   D a t a   P a t h   A c c e l e r a t i o n   A r c h i t e c t u r e   (D P A A [ 12 ]   a n d   pe r i p h e r a l   n e t w o r i n t e r f a c e s   r e qui r e f o r   n e t w o r ki n g   a nd  t e l e c o m m u n i c a t i o n s .   It   i nt e g r a t e s   a   G i g a b i t   E t h e rn e t   s w i t c w i t h   e i g h t   G b ps   e xt e rna l   po r t s   a n t w o   i n t e rna l   2. 5   G b ps   po r t s   c o nn e c t e t o   F r a m e   M a n a ge r   (F M a n po rt s .   I a d di t i o n   t o   t y pi c a l   L a y e r - ope r a t i o n s ,   t hi s   m o dul e   i s   a l s o   a b l e   t o   pe r f o r m   L a y e r   2 - T CA M - b a s e t r a f f i c   c l a s s i f i c a t i o n   o n   t h e   i n g re s s   t r a f f i c ,   a pp l y i n a   s pe c i f i c   s e t   of   a c t i o n s   (e . g. ,   p a c ke t   r e di r e c t t o   t h e   p r o c e s s e pa c ke t .   T h e   L A N   po rt s   o f   t h e   L S w i t c m a ke   f o r w a r di ng  de c i s i o n s   b a s e o n l y   o n   L s w i t c h   l o gi c ,   w i t h   n o   i n v o l ve m e n t   f r o m   t h e   F M a n   o r   CP U .   A s   a   c o n s e que n c e ,   t h e   CP U   c a nn o t   t ra c t h e   p a c ke t s   s w i t c h e b e t w e e n   t h e   e i ght   e xt e rn a l   L S w i t c h   po r t s ,   w h i c h   m i g ht   n o t   b e   de s i r a b l e   i n   s o m e   us e   c a s e s .   T o   ove r c o m e   t hi s   l i m i t a t i o n ,   w e   a do pt   a   s pe c i f i c   m e c h a ni s m   t o   r e di r e c t   t h e s e   pa c ke t s   f r o m   t h e   L A N   p o r t s   t o   t h e   CP U ,   w h i c h   c o n s i s t s   i n   us i n t h e   c o p y _ to _ c pu   f l a a s   a c t i o n   i n   t h e   A CL   o r   M A t a b l e ;   Evaluation Warning : The document was created with Spire.PDF for Python.
                                IS S N :   2088 - 8708   Int   J   E l e c   &   Co m E n g ,   V o l .   10 ,   N o .   3 J u n e   2 020   :     26 68   -   2 681   2670   t h i s   f l a c a us e s   t h e   c o p y   of   t h e   pa c ke t   m a t c h i ng  t hi s   e n t r y   i nt o   a n   i n t e rna l   s w i t c CP U   que ue .   In  t hi s   w a y ,   w e   c a n   p r o c e s s   t h e   s uppo r t e f l ow s   i n   ha r dw a r e   a t   l i n e   r a t e ,   w hi l e   t h e   un s up po r t e o n e s   w i l l   b e   r e di r e c t e i nt t h e   h o s t ’s   CP U   w h e r e   t h e y   c a b e   pr o c e s s e by   t h e   s o f t w a r e   s w i t c h .   Ac c e s s   t o   L S w i t c h   P H Y   r e gi s t e r s :   A   de di c a t e U IO   K e rn e l   M o dul e ,   p a rt   o f   t h e   N X P   s of t w a r e   de ve l o pm e n t   ki t ,   m a ps   L S w i t c h   a n p h y s i c a l   r e gi s t e r s   i nt o   us e r   s pa c e ,   h e n c e   off e r i n t h e   po s s i b i l i t y   t pr o g r a m   a nd  c o n t r o l   t h e   b e ha v i o r   o f   t h e   L S w i t c h   t hr o ug h   s y s f s   e n t r i e s .   N o t a b l y ,   t h i s   ke rn e l   m o dul e   a v o i ds   t h e   c o m m o n l y   r e qui r e c o n t e xt   s w i t c h i n b e t w e e n   ke rn e l   a nd  us e r s pa c e ,   b e c a us e   t h e   de v i c e   i s   a c c e s s e d   di r e c t l y   f r o m   us e r   s p a c e .   L S w i t c h   A P Is :   T h e   L S w i t c h   A P r e p r e s e n t s   a   c o m p r e h e n s i v e ,   us e r - f r i e n dl y   a n po w e r f ul   f un c t i o n   l i b ra r y   t h a t   e na b l e s   t o   pr o gr a m   t h e   s w i t c h i ng  m o d ul e   t hr o ugh   hi g h - l e v e l   pr i m i t i v e s ,   w i t h o ut   m a na gi ng  s i ngul a r   r e gi s t e r s .   It   i n c o r po ra t e s   t h e   m o s t   c o m m o n   f u n c t i o n s   s uc h   a s   de v i c e   i n i t i a l i z a t i o n,   po rt   map   s e t up ,   r e s e t   a n c o n f i gu r a t i o n ,   i n c l ud i n m o r e   c o m pl e f un c t i o n s   us e t o   s pe c i fy   t h e   Q ua l i t y   o f   S e r v i c (Q o S c o n f i gu r a t i o n s   a nd  A c c e s s   Co n t r o l   L i s t s   (A CL s e n t ri e s .   L S w i t c h   H a r dw a r e   P i pe l i n e :   T h e   N X P   L S w i t c h   ha r dw a r e   pi pe l i n e   i s   ra t h e r   c o m pl e x,   a s   s h o w n   i n   t h e   h i g h -   l e v e l   v i e w   de pi c t e i n   F i gu r e   1.   I t   i s   c o m po s e of   a   i ng r e s s   a n d   e gr e s s   pi pe l i n e ,   b o t h   w i t h   a   d i f fe r e nt   s e t   o f   t a b l e s   a n a c t i o n s .   W h e n   a   pa c ke t   a rr i v e s   a t   a   p a r t i c ul a i ng r e s s   po r t ,   a f t e r   t r a v e r s i ng   t h e   po r t   M A c o n t r o l l e r,   i t   go e s   t hr o ug h   t h e   i ng r e s s   pi pe l i ne ,   w h e r e   i s   s ub j e c t e t o   t w o   c l a s s i f i c a t i o n   s t e ps .   I n   t h e   f i r s t   (b a s i c c l a s s i f i c a t i o n   s t a ge ,   s o m e   b a s i c   i n f o r m a t i o n   (e . g. ,   V L A N   t a g ,   Q o S   c l a s s ,   D S CP   v a l ue a r e   e xt ra c t e f r o m   t h e   pa c ke t   a n us e i n   t h e   n e xt   c l a s s i f i c a t i o n   s t e p.   I n   t h e   s e c o n d,   A dv a n c e M ul t i - s t a ge   c l a s s i f i c a t i o n   s t e p,   t hr e e   T CA M s   (na m e IS 1 ,   IS a nd  E S 0)  s e r v e   di ff e r e n t   pu r po s e s .   T h e   IS t a b l e   i m p l e m e nt s   a n   L 3 - a w a r e   c l a s s i f i c a t i o n,   a l l o w i n t o   ove rr i d e   D S CP ,   Q o S ,   V L A N   ID   v a l ue s   a s   a   r e s ul t   o f   a   l o o kup  o n   L 3 - L h e a de r s .   A   s e c o n l o o kup  i s   t h e m a d e   o n   t h e   IS t a b l e ,   w hi c h   a pp l i e s   t y pi c a l   A CL   a c t i o n s   (i . e . ,   pe rm i t ,   de n y ,   po l i c e ,   r e di r e c t ,   m i rr o r   a n c o py   t o   CP U t o   t h e   m a t c h e f r a m e   i n   a   s e que n t i a l   o r de r;   i f   t h e   p a c ke t   m a t c h e s   t h e   c o n d i t i o n   o f   a   gi v e A CL ,   t he   pr o c e s s i n i s   s t o ppe a n d   t h e   a c t i o i s   a pp l i e d,   o t h e r w i s e   i t   a pp l i e s   t h e   de f a ul t   a c t i o n,   w hi c us ua l l y   dr o ps   a l l   t h e   t ra f f i c .   F i na l l y ,   i n   t h e   e gr e s s   pi pe l i n e ,   t h e   E S t a b l e   h a ndl e s   t h e   e gr e s s   fo r w a r di ng  b a s e o n   V L A N   a n Q o S   po l i c i e s .   T h e   s i z e   o t h e s e   T CA M s   i s   f i xe d,   b ut   t h e   n u m b e r   o f   a l l ow e e n t r i e s   de pe n ds   o n   t h e   c o m pl e xi t y   o e a c h   e n t r y   r ul e .   A s   s h o w n   i n   F i gu r e   1,   t h e   L fo r w a r d i n m o dul e   i s   b a s e o n   a   M A T a b l e   s uppo rt i n 8K   e n t ri e s ;   t h e   L f o r w a r di ng  i s   do n e   b a s e d   o n   t h e   V L A N   c l a s s i f i c a t i o n ,   M A C   a dd r e s s e s   a n d   t h e   s e c ur i t y   e n f o r c e m e n t   a s   r e s ul t   o f   IS 2.           F i gu r e   1.   L2   s w i t c h   ha rdw a r e   p i pe l i n e   Evaluation Warning : The document was created with Spire.PDF for Python.
Int   J   E l e c   &   Co m E n g     IS S N :   2088 - 8708       T r ans f or m i ng  t r adi t i ona l   hom e   ga t e w ay   i n t har dw ar e - ac c e l e r a t e SD N   s w i t c h   ( Se bas t i ano   M i ano )   2671   2. 2 .     x D P d   s o ftw ar e   s w i tc h   T h e   e X t e n s i b l e   D a t a P a t h   da e m o n   (xD P d)   [10]   is   a   m u l t i - pl a t f o r m   o pe n - s o ur c e   da t a p a t h   s up po r t i n g   m ul t i p l e   O pe nF l o w   ve r s i o n s   a nd   b ui l t   f o c u s i n g   on   pe r f o r m a n c e   a n d   e x t e ns i b i l i t y ,   in   p a rt i c ul a r   w i t h   r e s pe c t   to   (i )   ne w   ha r dw a r e   pl a t f o r m s   ( n e t w o r k   p r o c e s s o r s ,   FPGAs,   A S ICs ),   (i i )   n e w   O pe n F l o w   v e r s i o n s   a n d   e x t e n s i o n s ,   a n d   (i i i )   di f f e r e nt   m a na ge m e n t   i nt e r f a c e s   (e . g. ,   O F Co n f i g,   CL I,   A M Q P ,   N e t c o n f ).   T h e   xD P d   a r c hi t e c t u r e ,   s h o w n   in   F i gu r e   2,   i n c l ude s   a   H a r dw a r e   A b s t r a c t i o n   L a y e r   (H A L )   t h a t   f a c i l i t a t e s   t h e   po rt i ng   of   t h e   O pe n F l o w   pi pe l i n e   on   di f f e r e nt   ha rdw a r e ,   hi di ng   t h e   ha rdw a r e   t e c hn o l o g y   a n d   v e n do r - s pe c i f i c   f e a t ur e s   f r o m   t h e   m a na ge m e n t   a nd   c o n t r o l   pl a n e   l o gi c .   It   us e s   t h e   R O F L   (R e v i s e d   O pe n F l o w   L i b ra r y )   l i b ra r i e s   [13 ]   as   an   H A L   i m pl e m e n t a t i o n   a n d   f r a m e w o r k   for   c r e a t i ng   O pe n F l o w   a ge nt s   c o m m u n i c a t i ng   w i t h   di f f e r e nt   t y pe s   of   h a rdw a r e   pl a t f o r m s .   T h e   R O F L   l i b r a r y   s e t   is   m a i nl y   c o m po s e d   of   t hr e e   di f f e r e nt   c o m po n e n t s .   T h e   R O F L - c om m o n   l i b ra r y   p r o v i de s   b a s i c   s uppo r t   for   t h e   O pe n F l o w   pr o t o c o l   a n d   m a ps   t h e   p r o t o c o l ’s   w i r e   r e pr e s e nt a t i o n   to   a   s e t   of   C+ +   c l a s s e s .   T h e   R O F L - h al   l i b ra r y   pr o v i de s   a   s e t   of   b a s i c   c a l l b a c k   t ha t   s h o ul d   be   i m p l e m e n t e d   by   t h e   pl a t f o r m -   s pe c i f i c   dri v e r   to   s uppo r t   t h e   O pe n F l o w   p r o t o c o l   f e a t ur e s .   F i na l l y ,   t h e   R O F L - p i p e l i n e   l i b ra r y   is   a   pl a t f o r m -   a g n o s t i c   O pe n F l o w   1. 0,   1 . 2   a nd   1. 3 . X   pi pe l i n e   i m pl e m e nt a t i o n   t ha t   can   be   r e us e d   in   s e v e ra l   pl a t f o r m s .   It   is   us e d   as   s o f t w a r e   O pe n F l o w   pa c ke t   p r o c e s s i n g   l i b ra r y   a n d   s e r v e s   as   da t a - m o de l   a n d   s t a t e   m a na ge r   for   t h e   R O F L - ha l   l i b ra r y .           F i gu r e   2.   xD P d   a r c h i t e c t u r e       3.   O V ER A L L   A R C H I TEC TU R E   F i gu r e   3   de s c r i b e s   t h e   o ve r a l l   a r c hi t e c t u r e   of   t h e   s y s t e m ,   w h i c h   is   m a de   of   a   h a rdw a r e   f as t   pa t h   w h e r e   pa c ke t s   a r e   pr o c e s s e d   by   t h e   L2   s w i t c h   i nt e g ra t e d   i n t o   t h e   pl a t f o r m   a n d   a   s l ow   pat h   t h a t   is   ru nn i ng   in   s o f t w a r e   a n d   is   in   c ha rge   of   pr o c e s s i n g   a l l   p a c ke t s   w h o s e   m a t c h e s   or   a c t i o n s   a r e   n o t   s up po r t e d   by   t h e   ha rdw a r e .   W h e n   a   p a c ke t   a rri v e s   at   an   i ng r e s s   po r t ,   it   is   f i r s t   p r o c e s s e d   by   t h e   ha rdw a r e   pi pe l i n e   a c c o r di n g   to   t h e   r ul e s   i n s t a l l e d   by   t h e   Se l e c t i v e   Of f l oa d i n g   L og i c   c o m po n e n t ,   if   a   m a t c h i n g   r ul e   is   n o t   f o un d,   pa c ke t s   a r e   r e di r e c t e d   to   t h e   NXP   CP U   w h e r e   t h e   xD P d   s o f t w a r e   O pe n F l o w   pi pe l i n e   is   r u nni n g .   It   is   w o r t h   m e n t i o ni n g   t ha t   a l l   t h e   ha r dw a r e   de t a i l s   a r e   h i d de n   by   an   e x t e rna l   us e r   (e . g. ,   O pe n F l o w   c o n t r o l l e r ) ,   w h i c h   p r o g ra m s   t h e   de v i c e   as   a   s i m p l e   O pe n F l o w   s w i t c h ;   t h e   r e s t   of   c o m pon e n t s   w i l l   t a ke   c a r e   of   t ra n s l a t i ng   t h e   O pe n F l o w   to   m a t c h   t h e   ha rdw a r e   t a b l e s   to   s pe e dup   t h e   p a c ke t   p r o c e s s i ng.           F i gu r e   3.   H i g h - l e v e l   de s i g n   Evaluation Warning : The document was created with Spire.PDF for Python.
                                IS S N :   2088 - 8708   Int   J   E l e c   &   Co m E n g ,   V o l .   10 ,   N o .   3 J u n e   2 020   :     26 68   -   2 681   2672   3. 1 .     Th e   s e l e c t i v e   o ffl o ad i n g   l o gi c   c o m p on e n t   T h e   Se l e c t i v e   Of f l o ad i ng   L o gi c   is   t h e   c e n t ra l   c o m po n e n t   of   t h e   a r c hi t e c t u r e   a n d   is   in   c ha rge   of   m a na gi ng   t h e   i n s t a l l a t i o n   of   t h e   f l o w   t a b l e   e n t r i e s ,   m a i n t a i ni n g   pe r   po rt   c o un t e r s   a n d   t ra n s l a t i n g   t h e   O pe n F l o w   m e s s a ge s   c o m i n g   f r o m   t h e   c o n t r o l l e r   w i t h   t h e   c o rr e s po n di n g   p ri m i t i v e s   r e qui r e d   to   i nt e r a c t   w i t h   t h e   ha rdw a r e   s w i t c h .   T hi s   p r o c e s s   t y pi c a l l y   i n v o l v e s   d e c i di n g   w hi c h   f l ow   e n t r y   t h e   de v i c e   c a n   s up po r t   (b a s e d   on   its   f e a t ur e   s e t )   a n d   to   s y n c   t h e   s t a t i s t i c s   f r o m   t h e   d e v i c e   to   t h e   h o s t .   It   c o n s i s t s   of   a   n o rt h b o un d   p a r t   t h a t   is   r e s po n s i b l e   fo r   t h e   s e l e c t i o n   of   t h e   s uppo r t e d   O pe n F l o w   r ul e s   a n d   a   s o ut h b o un d   s i de   w h i c h   is   in   c h a rge   of   t h e   c o m m u n i c a t i o n   w i t h   t h e   de v i c e   a n d   is   t h e r e f o r e   s t ri c t l y   de pe nde nt   on   i t .   T h e   N o r t h b o un d   I nt e r f a c e   s h o ul d   be   a w a r e   of   t h e   s w i t c h   p i pe l i n e   c a pa b i l i t i e s ,   in   pa rt i c ul a r   r e g a r di ng   de v i c e   t a b l e s ,   t h e   m a t c h   t y pe s   a n d   t h e   a c t i o n s   a l l o w e d   on   e a c h   t a b l e .   It   m a i nt a i n s   a   da t a   s t r uc t u r e   for   e a c h   ha rdw a r e   t a b l e   c o n t a i ni n g   t h e   de v i c e   c a pa b i l i t i e s   r e ga rd i n g   s uppo r t e d   m a t c h e s   a n d   a c t i o n s ,   w h i c h   is   us e d   to   c h e c k   if   a   n e w   f l o w   r ul e   is   s ui t a b l e   for   ha r dw a r e   o f f l o a di ng ,   e . g . ,   if   i t ’s   m a t c hi n g   f i e l ds   a r e   a   s ub s e t   of     t h e   o n e s   s uppo r t e d   by   t h e   ha rdw a r e .   W hi l e   t h e   NB   i nt e r f a c e   is   ge n e ri c   e n o ugh   for   b e i n g   e xpo r t e d   f r o m   di f f e r e n t   de v i c e s   (w i t h   s i m i l a r   ha rdw a r e   p i pe l i n e ),   t h e   SB   pa r t   s h o ul d   be   c h a n ge d   to   s uppo r t   t h e   n e w     de v i c e   b e c a us e   it   i n v o l v e s   t h e   f l o w   e n t r y   i n s e r t i o n   s t a ge ,   w h i c h   can   o b v i o us l y   c h a nge   de pe n di ng   on     t h e   u n de rl y i n g   ha rdw a r e   s w i t c h.   T h e   de s c r i pt i o n   of   h o w   t he   c o m m u n i c a t i o n   w i t h   t h e   ha rdw a r e   de v i c e   ha s   b e e n   i m pl e m e n t e d   is   de s c ri b e d   in   S e c t i o n   4.     3. 2 .     S e l e c ti o n   of   th e   o p e n f l o w   r u l e s   fo r   th e   o ffl o ad i n g   An   O pe n F l o w   f l o w _ m o d   m e s s a ge   is   us e d   to   i n s t a l l ,   de l e t e   a n d   m o di fy   a   f l o w   t a b l e   e n t r y ;     as   c o n s e que n c e ,   if   t h e   m e s s a ge   c o n t a i n s   a   f l o w   t h a t   is   s uppo rt e d   by   t h e   ha rdw a r e   de v i c e   it   s h o ul d   be   of f l o a de d   a c c o r d -   i ng l y .   As   s h o w   in   t h e   A l go r i t hm   1,   t h e   f i r s t   o pe ra t i o n   of   t h e   Se l e c t i v e   Of f l oa d i n g   L og i c   is   to   i n s t a l l   t h e   f l o w   i nt o   t h e   S o f t w a r e   S w i t c h   t a b l e .   T h i s   is   do n e   for   t w o   r e a s o n s .   F i r s t l y ,   t h e   t i m e   r e qui r e d   to   i n s e r t   a   n e w   rul e   i n t o   t h e   s o f t w a r e   p i pe l i n e   is   us ua l l y   f a s t e r   t ha n   t h e   o n e   r e qu i r e d   to   i n s e rt   an   e n t r y   i n t o   t h e   h a rdw a r e   s w i t c h   t a b l e s ,   s i n c e   it   is   n o t   a f f e c t e d   by   t h e   ot h e r   e n t r i e s   a l r e a dy   i n s t a l l e d   i nt o   t h e   f o r w a r d i n g   t a b l e s .   S e c o n d l y ,   t hi s   p r o c e s s   w o ul d   s i m pl i f y   t h e   h a ndl i n g   of   P a c k e t O u t   m e s s a ge s .   In de e d,   w h e n   a   P a c k e t O u t   is   r e c e i v e d ,   it   s h o ul d   be   i n j e c t e d   i n t o   t h e   da t a   p l a n e   of   t h e   s w i t c h ,   c a rr y i n g   e i t h e r   a   ra w   pa c ke t   or   i n d i c a t i n g   a   l o c a l   b uf f e r   on   t h e   s w i t c h   c o n t a i n i ng   a   ra w   pa c ke t   to   r e l e a s e .   S i n c e   t h e   b uf f e r s   a r e   h e l d   by   t h e   s o f t w a r e   s w i t c h   i m pl e m e nt a t i o n   a n d   t h e   s o f t w a r e   pi pe l i n e   i n c l ude s   a l l   t h e   r u l e s   i s s ue d   by   t h e   c o nt r o l l e r,   its   p r o c e s s i n g   in   t h e   s o f t w a r e   p i pe l i n e   i s   f a s t e r   t h a n   i n j e c t i ng   t h e   p a c ke t   in   t h e   ha rdw a r e   s w i t c h   pi pe l i n e .     A l go r i th m   1   S e l e c t i o n   of   t h e   rul e   to   of f l o a d   1:   p r o c e d u r e   n e w _ f l o w _ m o d   (f l o w _ e n t r y _ t*   n e w _ e n t r y )   a dd _ e n t r y _ to _ sw _ t a b l e ( n e w _ e n t r y );   2:   if   m a t c h e s _ s uppo rt e d( n e w _ e nt r y )   &&   a c t i o n s _ s u ppo rt e d( n e w _ e n t r y )   th e n   3:   of f l o a d ( n e w _ r u l e );   4:   e l s e   5:   if   m a t c h e s _ s up po rt e d( ne w _ e n t r y )   &   &&   a c t i o n s _ s u ppo rt e d( n e w _ e n t r y )   th e n   6:   ne w _ e nt r y . a c t i o n s   =   c o py _ to _ c pu;   7:   of f l o a d ( n e w _ e n t r y );   8:   e l s e   9:   if   !m a t c h e s _ s u ppo r t e d ( n e w _ e n t r y )   th e n   10:   fo r   e a c h   rul e   in   h w T a b l e s   do   11:   if   r u l e s _ s e t (r u l e )     r ul e s _ s e t ( ne w _ r u l e )   th e n   12:   if   c h e c k _ c o rr e l a t i o n ( n e w _ r u l e ,   rul e )   th e n   13:   de l e t e _ f r o m _ ha rdw a r e ( rul e ) ;   14:   e n d   if   15:   e n d   if   16:   e n d   fo r   17:   e n d   if   18:   e n d   if   19:   e n d   if   20:   e n d   p r o c e d u r e       Evaluation Warning : The document was created with Spire.PDF for Python.
Int   J   E l e c   &   Co m E n g     IS S N :   2088 - 8708       T r ans f or m i ng  t r adi t i ona l   hom e   ga t e w ay   i n t har dw ar e - ac c e l e r a t e SD N   s w i t c h   ( Se bas t i ano   M i ano )   2673   W h e n   t h e   f l o w _m o d   is   i n s t a l l e d   in   t h e   s o f t w a r e   t a b l e ,   it   is   c h e c ke d   to   v e ri fy   its   s ui t a b i l i t y   fo r   t h e   ha r dw a r e   o f f l o a di n g .   In   t hi s   c a s e ,   t h e   Se l e c t i v e   Of f l o ad i ng   L og i c   c o m pa r e s   t h e   m a t c h e s   a n d   a c t i o n s   c o n t a i n e d   in   t h e   m e s s a ge   w i t h   t h e   d a t a   s t ruc t u r e   of   e a c h   ha r dw a r e   t a b l e .   If   t h e   f l o w   i n c l ude s   m a t c h e s   a nd   a c t i o n s   s uppo r t e d   by   t h e   de v i c e   t a b l e s   t h e   S e l e c t i v e   O f f l o a d i n g   L o g i c   de c i de s   t h e   r i g ht   t a b l e   (A CL   or   M A C   t a b l e )   in   w h i c h   pl a c e   t h e   r ul e   (de pe ndi n g   on   t h e i r   f e a t u r e s   s e t ).   P a rt i c u l a rl y ,   t h e   n e w   f l ow _ m od   is   i n s t a l l e d   in   t h e   M A C - t a b l e   if   it   c o n t a i n s   o n l y   L2   de s t   MAC   a n d   V L A N   as   m a t c h   c r i t e ri a   a n d   t h e   a c t i o n s   a r e   t h e   s uppo r t e d   o n e s ;   r e di r e c t - to -   po r t   a n d   s e nd - to - c o nt r o l l e r.   T h e   r e m a i ni n g   s up po r t e d   f l o ws   a r e   p l a c e d   in   t h e   A CL - t a b l e .   A f t e r   t h i s   p r o c e s s ,   t h e   n o rt h b o un d   i nt e r f a c e   c a l l s   t h e   s o ut h b o un d   pa rt   w h i c h   t a ke s   c a r e   of   i n s t a l l   t h e   s pe c i f i e d   r ul e   in   t h e   ha r dw a r e   t a b l e s .   H o w e v e r ,   if   t h e   ha rdw a r e   de v i c e   s uppo r t s   t h e   m a t c h e s   c o n t a i n e d   in   t h e   n e w   e n t r y   b ut   n o t   its   a c t i o n s   l i s t ,   we   n e e d   to   pr o c e s s   t h e   pa c ke t   m a t c hi n g   t ha t   rul e   in   t h e   s of t w a r e   pi pe l i n e .   In   t h i s   c a s e ,   we   i n j e c t   t h e   n e w   r u l e   in   t h e   h a rdw a r e   p i pe l i n e   but   w i t h   a   s i n g l e   a c t i o n   to   r e di r e c t   t h e   p a c ke t   to   t h e   CP U ,   w h e r e   t h e   s o f t w a r e   p i pe l i n e   pr o c e s s i n g   a ppl i e s   t h e   f ul l   a c t i o n   s e t   c o n t a i n e d   in   t h e   o r i gi na l   f l ow _   m o d.   F i na l l y ,   if   t h e   d e v i c e   do e s   n o t   s upp o r t   t h e   n e w   r u l e   m a t c h e s ,   to   r e di r e c t   t h e   p a c ke t s   in   t h e   s o f t w a r e   pi pe l i n e ,   we   s h o ul d   r e m o v e   all   ha r dw a r e   e n t ri e s   t ha t   i n t e r f e r e   w i t h   t h e   ne w   r u l e   m a t c h e s   s e t ,   a v o i di ng   t ha t   a   n e w   pa c ke t   m a t c h e s   t h e   ha rdw a r e   r ul e   i n s t e a d   of   t h e   s of t w a r e   o n e .   W h e n   a   c o rr e l a t e d   rul e   is   di s c o v e r e d,   it   is   de l e t e d   f r o m   t h e   de v i c e   t a b l e s   so   t h a t   a   n e w   pa c ke t   w i l l   m a t c h   t h e   de f a ul t   r u l e   t h a t   r e di r e c t s   all   p a c ke t s   to   t h e   CP U   fo r   t h e   s o f t w a r e   pi pe l i n e   p r o c e s s i n g.     3. 3 .     M ap p i n g   s e l e c te d   o p e n fl o w   r u l e s   on   h ar d w a r e   t a b l e s   T h e   S o ut h b o un d   I nt e r f a c e   of   t h e   Se l e c t i v e   Of f l o ad i ng   L o g i c   ha n dl e s   t h e   m a pp i n g   of   t h e   c h o s e n   O pe n F l o w   r u l e s   i n   t h e   ha rdw a r e   t a b l e s .   T h i s   m a ppi ng   i s ,   of   c o ur s e ,   de pe n de nt   o t h e   u n de r l y i n g   de v i c e .   H o w e v e r,   t h e   o rga ni z a t i o n   of   t h e   MAC   or   A C L   t a b l e   is   a l m o s t   t h e   s a m e   i n   a l l   ha r dw a r e   s w i t c h   A S ICs ,   m a k i n g   t h e   c o n c e pt s   a pp l i e d   to   o ur   of f l o a di ng   a r c hi t e c t u r e   a l s o   a ppl i c a b l e   to   o t h e r   a r c hi t e c t u r e s .   If   a   f l o w   c a n   be   of f l o a de d   in   t h e   MAC   t a b l e ,   t h e   c o rr e s po n di n g   ha rd w a r e   e n t r y   c o n t a i n s   i t s   f i x ed   MAC   a ddr e s s   a n d   V L A N   ID .   If   t h e   e nt r y   c o n t a i n s   an   o ut put   a c t i o n   to   a   s pe c i f i c   p o r t ,   t h e   l i s t   of   de s t i na t i o n   po rt   in   t h e   ha rdw a r e   e n t r y   is   f i l l e d   w i t h   a   B oo l e a n   v a l ue   i n d i c a t i n g   if   t h e   pa c k e t   s h o ul d   be   fo r w a r de d   to   t h a t   pa rt i c ul a r   po rt .     T h e   o ut put _ to _ c o n t r o l l e r   a c t i o n   is   c o n v e rt e d   i n t o   an   a c t i o n   w i t h   t h e   c o p y _ to _ c pu   f l a g   e na b l e d,   i ndi c a t i n g   t h a t   t h e   pa c ke t   s h o ul d   be   s e n t   to   a   s pe c i f i c   CP U   que ue   a n d   t he n   r e di r e c t e d   to   t h e   c o n t r o l l e r   ( h o w   t hi s   t a s k   is   a c h i e v e d   is   s pe c i f i e d   in   S e c t i o n   4 . ).   W h e n   f l o w   is   of f l o a d e d   to   t h e   A C L   t a b l e ,   it   i s   n e c e s s a r y   to   t r a n s l a t e     t h e   fo r m a l i s m   us e d   by   O pe n F l o w   w i t h   t h e   c o m m o n   f i e l ds   c o n t a i n e d   in   an   A C L   e nt r y .   T h e   A CL   us e s   a   l i s t   of   po r t s   a f f e c t e d   by   t h a t   e nt r y .   In   t hi s   c a s e ,   if   a   rul e s   s pe c i f i e s   an   i n g r e s s   po rt ,   i t s   c o rr e s po n di n g   B o o l e a n   v a l ue   is   e n a b l e d   in   t ha t   l i s t .   If   n o t ,   t h e   l i s t   i n c l ude s   a l l   s w i t c h   po rt s .   An   i m po r t a n t   c o n s i de r a t i o n   a b o ut   t hi s   po rt   l i s t   is   r e qui r e d .   I n de e d,   w h e n   an   A C L   r ul e s   i n c l ude   a   b e ha v i o r   t h a t   a l s o   a f f e c t s   an   o ut pu t   po r t ,   t ha t   po rt   s h o ul d   a l s o   be   a dde d   to   t h e   m o ni t o r e d   po rt   l i s t .   T h e   a c t i o n s   s uppo rt e d   by   t h e   A CL   t a b l e   a r e :   pe r m i t ,   d e ny ,   r e di r e c t   a n d   c o py   to   CP U .   An   O pe n F l o w   dr o p   a c t i o n   is   t ra n s l a t e d   in   a   d e ny   a c t i o n   of   t h e   A CL ,   i n c l ud i n g   a   l i s t   of   o ut put   po r t s   for   w h i c h   t h e   a c t i o n   s h o ul d   be   a ppl i e d.   An   OF   o ut put   to   po r t   a c t i o n   is   c o n v e rt e d   in   a   A C L   r e d i r e c t   a c t i o n ,   w hi l e   t h e   o ut pu t   to   c o nt r o l l e r   p r o duc e s   t h e   e na b l i n g   of   t h e   c opy _ to _ c pu   f l a g .   T h e   pr o c e s s   of   m ov i ng   a   f l o w   t a b l e   e n t r y   to   t h e   ha rdw a r e   l a y e r   r e qui r e s   a ddi t i o na l   w o r k   if   t h e   t a b l e   c o n t a i n s   l o w e r   p r i o ri t y   f l o w   e n t r i e s   t ha t   (p a r t i a l l y )   ov e r l a p   t h e   n e w l y   i n s t a l l e d   f l o w   e nt ry .   In   t h e s e   c a s e s ,   t o ge t h e r   w i t h   t h e   f l o w   e n t r y   i n s t a l l a t i o n   in   t h e   s o f t w a r e   l a y e r,   t h e   S e l e c t i v e   Of f l o a di n g   L o gi c   de c i de s   to   a dd   t h e m   to   t h e   A C L   t a b l e   b e c a us e   t h e   MAC   t a b l e   do e s   n o t   ha v e   a   p r i o r i t y   n o t i o n .   A l s o ,   i t   pe r f o r m s   a n   a ddi t i o n a l   a c t i o n   t ha t   is   t h e   de l e t i o n   of   t h e   f l o w   t a b l e   e n t r i e s   w i t h   l o w e r   p ri o ri t y ,   t h a t   a r e   t e m po ra r i l y   c o pi e d   in   t h e   s y s t e m ’s   m e m o r y   a n d   t h e   i n s t a l l a t i o n   of   t h e   n e w   f l o w   e n t r y   w i t h   t h e   o t h e r   p r e v i o us l y   c o pi e d.   On   t h e   o t h e r   ha n d ,     if   t h e   n e w   r ul e   h a s   l o w e r   p ri o r i t y   c o m pa r e d   w i t h   t h o s e   a l r e a dy   i n s t a l l e in   t h e   A CL ,   i t   i s   i n s e rt e a t   t h e   e n d   o t h e   l i s t   w i t h o ut   m o v i n g   t h e   o t h e r s .   T h e   f l o w   t a b l e   e n t r y   de l e t i o n   f r o m   a   h a rdw a r e   t a b l e   i s ,     in   p r i n c i p l e ,   a   f a s t e r   a n d   s i m p l e r   o pe r a t i o n,   w h i l e   t h e   i n s t a l l a t i o n   r e qui r e s   a   r e o r g a ni z a t i o n   of   t h e   p r e v i o us l y   i n s t a l l e d   e n t ri e s .       4.   I M P L E M EN T A T I O N   D ET A I L S   T h e   xD P d/ R O F L   l i b ra r y   s e t   pr o v i de s   a   H a r dw a r e   A b s t ra c t i o n   L a y e r   t h a t   a i m s   at   s i m p l i fy i n g     t h e   s uppo r t   of   O pe n F l o w   on   a   n e w   pl a t f o r m .   T h e   P l at f or m   D r i v e r ,   s h o w n   in   F i gu r e   2,   i n c l ude s   t h e   Se l e c t i v e   Of f l o ad i ng   L og i c   t o ge t h e r   w i t h   i m p l e m e nt a t i o n s   fo r   t h e   b uf f e r   po o l   a nd   t h e   s of t w a r e   pi pe l i n e   us e d   i n t e rna l l y   to   s i m pl i fy   t h e   O pe n F l o w   p o r t i n g   of   t h e   NXP   pl a t f o r m .   T h e   P l at f or m   D r i v e r ,   a l s o ,   us e s   t h e   R O F L - pi pe l i n e   l i b r a r y   to   i m pl e m e n t   an   O pe n F l o w   s of t w a r e   s w i t c h   a n d   i n c l ude s   t h e   l o gi c   to   t r a n s l a t e   t h e   O pe n F l o w   m e s s a ge s   c o m i n g   f r o m   t h e   c o n t r o l l e r   in   s pe c i f i c   r ul e s   (i f   s uppo r t e d)   for   t h e   ha rdw a r e   de v i c e .   T h e   m a i n   f un c t i o na l i t y   pr o v i de d   by   t h e   d ri v e r,   c a n   be   gr o upe d   in   t he s e   4   pa rt s :   ( i )   de v i c e   a nd   d ri v e r   i ni t i a l i z a t i o n,     (i i )   O pe n F l o w   a b s t r a c t i o n   of   t h e   h a rdw a r e   s w i t c h,   (i i i )   po r t   s t a t us   a nd   s t a t i s t i c s ,   (i v )   p a c ke t - in   a n d   pa c ke t - o u t .     Evaluation Warning : The document was created with Spire.PDF for Python.
                                IS S N :   2088 - 8708   Int   J   E l e c   &   Co m E n g ,   V o l .   10 ,   N o .   3 J u n e   2 020   :     26 68   -   2 681   2674   4. 1.     D e v i c e   an d   d r i v e r   i n i ti a l i z at i o n   T h e   L2   S w i t c h   A P Is   p r o v i de   an   i nt e r f a c e   for   a c c e s s i n g   t h e   p hy s i c a l   re g i s t e r s   of   t h e   unde rl y i n g   de v i c e ,   e xpo s e d   to   t h e   us e r   s pa c e   a ppl i c a t i o n s   t hr o ug h   t h e   ke rn e l   m o dul e   de s c r i b e d   in   S e c t i o n   2. 1 .   W r i t i n g   t h e s e   r e c o r ds   a l l o w   us   to   pr o gr a m   a n d   c o nt r o l   t h e   b e ha v i o r   of   t h e   ph y s i c a l   s w i t c h   (i n s e r t   f l o w   r ul e s ,   ge t   s t a t i s t i c s ,   c h a nge   po r t s   b e ha v i o r,   e t c .   .   . ).   H o w e v e r,   we   a l s o   n e e d   to   s e nd/ r e c e i v e   f r a m e s   to   a n d   f r o m   e a c h   de v i c e   po r t .   T h e   NXP   G i ga b i t   E t h e rn e t   s w i t c h   c o r e   us e s   t h e   M II   (M e di a   I n de pe n de n t   I nt e r f a c e ),   w hi c h   p r o v i de s   a   D a t a   i nt e r f a c e   to   t h e   E t h e rn e t   MAC   for   s e n di n g   a n d   r e c e i v i ng   E t h e rn e t   f ra m e s ,   a nd   a   P H Y   m a na ge m e n t   i nt e r f a c e   c a l l e d   M D IO   (M a na ge m e n t   D a t a   I n pu t / O u t pu t )   us e d   to   r e a d   a n d   w ri t e   t h e   c o n t r o l   a n d   s t a t us   r e gi s t e r s .   At   s t a rt -   up   t i m e ,   t h e   d ri v e r   pe r f o r m s   s o m e   i n i t i a l i z a t i o n   s t e ps .   F i rs t l y ,   it   l o c a t e s   (us ua l l y   un de r   / de v / u i oX )   a n d   o pe n s   t h e   U IO   de v i c e ,   ob t a i ni n g   its   f i l e   de s c r i pt o r.   S ub s e que n t l y ,   it   c a l l s   t h e   m m ap   f u n c t i o n   to   m a p   t h e   de v i c e   m e m o r y   i nt o   us e r s pa c e ,   h e n c e   p r o v i d i ng   a c c e s s   to   t h e   de v i c e   r e g i s t e r s .   In   t h e   e n d ,   t h e   M D IO   p h y s i c a l   r e g i s t e r s   a nd   de v i c e s   a r e   o pe n e d   a n d   us e d   to   r e a d   a nd   w ri t e   E t h e rn e t   f r a m e s   f r o m   t h e   p h y s i c a l   po r t s .     4. 2.     O p e n F l o w   ab s tr a c t i o n   of   th e   h ar d w a r e   s w i tc h   An   O pe n F l o w   s w i t c h   t y pi c a l l y   c o n s i s t s   of   s e v e r a l   c o m po n e nt s .   A   v i rt ua l   po rt   m o dul e ,   w h i c h   m a ps   i n g r e s s   a n d   e g r e s s   po r t s   to   s o m e   po r t   a b s t r a c t i o n ,   m a i nt a i n i ng   pe r - po rt   c o unt e r s ;   a   f l o w   t a b l e   w h i c h   pe r f o r m s   l o o kups   on   f l o w   ke y s   e xt ra c t e d   f r o m   pa c ke t   h e a de r s ;   an   a c t i o n   m o dul e ,   w h i c h   e xe c ut e s   a   s e t   of   a c t i o n s   de pe n d -   i n g   on   t h e   r e s ul t   of   t h e   f l o w   t a b l e   l oo kup.   O ur   i m p l e m e nt a t i o n   m i rr o r s   t h e s e   e l e m e n t s   to   a l l o w   t h e   p r o po s e d   s e l e c t i v e   of f l o a d .   D u r i ng   t h e   i ni t i a l i z a t i o n   p ha s e ,   our   de v i c e   d ri v e r   d i s c o v e r s   t h e   p h y s i c a l   po rt s   a v a i l a b l e   in   t h e   ha rdw a r e   s w i t c h   a n d   a d ds   t h e m   to   t h e   xD P d   p h y s i c a l _ s w i t c h   s t r uc t u r e ,   w h i c h   r e p r e s e n t s   a   s i m pl e   ab -   s t r a c t i o n   us e d   to   c o n t r o l   a   ge n e ri c   s w i t c h   w hi l e   h i di n g   pl a t f o r m - s pe c i f i c   f e a t ur e s .   xD P d   pa rt i t i o n s   t h e   p h y s i c a l   s w i t c h   i nt o   L o gi c a l   S w i t c h   I n s t a n c e s   (L S Is ),   a l s o   kn o w n   as   v i r t ual   s w i t c he s .   In   t hi s   d ri v e r   we   us e   a   o n e - to - o n e   m a pp i n g   b e t w e e n   t h e   p h y s i c a l   s w i t c h   a n d   a   s i n gl e   L S I,   h e n c e   m a ppi ng   t h e   p h y s i c a l   po rt s   di r e c t l y   to   O pe n -   F l o w   phy s i c al   por t s .   S i n c e   t h e   O pe n F l o w   c o n t r o l l e r   c a n   a dd  o r   r e m o v e   an   O pe nF l o w   p h y s i c a l   po r t   f r o m   t h e   L S I,   t h e   L S I   may   c o n t a i n   o nl y   a   s ub s e t   of   t h e   ha rdw a r e   s w i t c h   po r t s .     4. 3.     P o r t   m an age m e n t   T h e   O pe n F l o w   pr o t o c o l   i n c l ude s   a l s o   p r i m i t i v e s   to   c o n t r o l   a n d   m a na ge   t h e   s t a t us   of   t h e   p h y s i c a l   s w i t c h ,   s uc h   as   r e a di ng   t h e   s t a t us   of   e a c h   po r t ,   a dd / m o di f y / r e m o v e   a   po r t   f r o m   t h e   d a t a pa t h,   e n a b l e / di s a b l e   f o r w a rdi ng ,   r e t ri e v e   po r t   s t a t i s t i c s   a nd   m o r e .   T h e   P l at f or m   D r i v e r   r e di r e c t s   t h e s e   r e que s t s   to   t h e   ha r dw a r e   s w i t c h   o n c e   t ra n s l a t e d   w i t h   t h e   c o rr e s po n di n g   SDK   API   c a l l .   F urt h e rm o r e ,   a   c o n t r o l l e r   can   a s k   for   po rt   s t a t i s t i c s   (by t e s   r e c e i v e d,   d r o ppe d,   e t c .   .   . ) .   T h e r e f o r e   t h e   d ri v e r   s h o ul d   r e a d   t h e s e   s t a t i s t i c s   f r o m   t h e   ha rdw a r e   s w i t c h   a n d   c o m b i n e   t h e m   w i t h   t h e   s i m i l a r   s t a t s   of   t h e   s o f t w a r e   pi pe l i n e .   As   p r e s e n t e d   b e fo r e ,   t h e   O pe n F l o w   ph y s i c a l   po r t s   of   t h e   L S I   c a n   be   a   s u b s e t   of   t h e   ha r dw a r e   po r t s   a v a i l a b l e   in   t h e   s w i t c h ;   h e n c e   t h e   P l at f or m   D r i v e r   ke e ps   t h e   e xpl i c i t   m a ppi ng   b e t w e e n   t h e m ,   s uc h   as   t h e   f a c t   t ha t   t he   h a rdw a r e   po rt   #5   m a y   a c t ua l l y   c o rr e s po n ds   to   t h e   O pe n F l o w   po r t   #2 .   W h e n   t h e   c o n t r o l l e r   s e n ds   a   m e s s a ge   r e f e r ri n g   to   an   L S I   po rt ,   t h e   d ri v e r   r e t ri e v e s   t h e   c o r r e s po n d i n g   de v i c e   po rt   f r o m   an   i nt e rna l   d a t a   s t ruc t u r e   a n d   t ra n s l a t e s   t h e   O pe nF l o w   c o m m a nd   to   t h e   c o r r e s po n d i n g   SDK   API   c a l l .   W h e n   t h e   c o n t r o l l e r   de c i d e s   to   m o di fy   t h e   s t a t us   of   a   s i n g l e   po r t ,   it   s e n ds   an   O pe n F l o w   m e s s a ge   t ha t   is   r e c e i v e d   by   t h e   c o r r e s po n di n g   L S I .   A f t e r   pa r s i ng   t hi s   m e s s a ge   t h e   R O F L - pi pe l i n e   l i b ra r y   c a l l   t h e   c o rr e s po n d i n g   m e t h o d   in   t h e   R O F L - ha l ,   w h i c h   s h o ul d   be   i m p l e m e n t e d   by   t h e   d ri v e r.   W h e n   t h e   d ri v e r   r e c e i v e s   t hi s   c a l l ,   it   can   re t ri e v e   t h e   c o r r e s po n di ng   po r t   s t r uc t u r e .   H o w e v e r,     t h i s   s t ruc t u r e   c o n t a i ns   a   po rt   num b e r   t h a t   c o ul d   b e   di f f e re nt   f r o m   t h e   p h y s i c a l   po rt   nu m b e r.   In   o r de r   to   r e t ri e v e   t h e   r i g ht   p h y s i c a l   po r t ,   R O F L - h a l   a l l o w s   to   a dd   a   pl a t f o r m   s pe c i f i c   s t r uc t u r e   to   t h e   s w i t c h   po r t   t.   In   t h i s   w a y ,   w h e n   we   r e t ri e v e   t h e   po rt   we   h a v e   a l s o   i t s   c o rr e s po n di n g   p h y s i c a l   po r t   nu m b e r.   To   pr o v i de   a   s e a m l e s s   c o m pa t i b i l i t y   w i t h   O pe n F l o w ,   t h e   P l at f or m   D r i v e r   n e e ds   to   i m pl e m e n t   a l s o     an   a s y n c hr o n o us   e v e n t   ha n dl i n g   m e c ha ni s m ,   w h i c h   is   us e d   to   s e n d   t h e   c o rr e s po n di n g   m e s s a ge   to     t h e   O pe n F l o w   c o n t r o l l e r   (e . g . ,   l i nk   de t e c t e d,   de t a c h e d,   etc.   .   . ).   H o w e v e r,   w h i l e   t h e   SDK   A P Is   pr o v i de   s e v e ra l   f u n c t i o n s   to   que r y   t h e   s w i t c h   fo r   po r t   s t a t us   a n d   s t a t i s t i c s ,   t h e y   do   n o t   pr o v i de   a n y   a s y n c hr o n o us   n o t i f i c a t i o n   m e c ha n i s m .   T h e r e f o r e ,   t h e   P l at f or m   D r i v e r   us e s   a   b a c kg r o u nd   t a s k   m a n a ge r   t h a t   c h e c ks   e v e r y   s e c o n d   t h e   po r t   s t a t us   a nd,   if   n e c e s s a r y ,   n o t i f i e s   t h e   xD P d   Co nt e nt   a nd   M a na ge m e n t   M o dul e   (CM M ),   w hi c h   in   t u rn   p a s s e s   t h i s   i n f o r m a t i o n   to   t h e   O pe n F l o w   c o n t r o l l e r.   In   s h o r t ,   t h e   b a c k gr ou n d   t as k   m an ag e r   is   us e d   to   c h e c k   t h e   f o l l o w i n g   e v e n t s :   (i )   e xp i ra t i o n   of   a   f l o e nt r y ,   (i i )   f r e e   t h e   s pa c e   in   t h e   b uf f e r   po o l   w h e n   a   p a c ke t   b e c o m e s   t o o   o l d,   ( i i i )   upd a t e   t h e   po r t   s t a t us   a n d   s t a t i s t i c s   a n d   (i v )   upd a t e   t h e   f l o w   s t a t s .     4. 4.     P a c k e t - in   an d   p a c k e t - o u t   P a c ke t - In   a n d   P a c ke t - O u t   m e s s a ge s   a r e   a   f un d a m e nt a l   f e a t u re   of   t h e   O pe n F l o w   pr o t o c o l .   T h e   P a c k e t -   In   e na b l e s   a   c o n t r o l l e r   to   r e c e i v e   pa c ke t s   f r o m   t h e   O pe n F l o w   s w i t c h   as   a   r e s ul t   of   a   s pe c i f i c   m a t c h - a c t i o n   t upl e ,   w h i c h   a l l o w s   c o n t e xt - a w a r e   f o r w a r d i ng.   S i m i l a rl y ,   a   P a c k e t - O u t   m e s s a ge   e n a b l e s   a   c o n t r o l l e r   to   i n j e c t   a   pa rt i c ul a r   pa c ke t   i n t o   t h e   s w i t c h ,   h e n c e   ge n e ra t i n g   ad - h o c   t ra f f i c   for   s pe c i f i c   pur po s e s   (e . g. ,   m a na ge m e n t ) .   Evaluation Warning : The document was created with Spire.PDF for Python.
Int   J   E l e c   &   Co m E n g     IS S N :   2088 - 8708       T r ans f or m i ng  t r adi t i ona l   hom e   ga t e w ay   i n t har dw ar e - ac c e l e r a t e SD N   s w i t c h   ( Se bas t i ano   M i ano )   2675   H a n dl i n g   P a c ke t - in   m e s s a ge s :   T h e   ge n e r a t i o n   of   a   P a c k e t - In   m e s s a ge   is   a   c o n s e que n c e   of     a   r e di r e c t - to - c on t r o l l e r   a c t i o n   in   t h e   f l o w   t a b l e ,   w h i c h   r e qui r e s   c o p y i n g   t h e   pa c ke t   f r o m   t h e   p h y s i c a l   s w i t c h   to   t h e   P l at f or m   D r i v e r .   W h e n   a   n e w   f l o w   m o d   c o n t a i ni n g   t h e   r e d i r e c t - to - c o nt r o l l e r   a c t i o n   is   r e c e i v e d,     t h e   Se l e c t i v e   Of f l oa d i n g   L og i c   c o n v e rt s   t h a t   a c t i o n   i n t o   a   ha r dw a r e - de pe nde n t   r ul e   w i t h   t h e   r e di r e c t - to - c p u   f l a g   e na b l e d,   w h i c h   is   s u ppo rt e d   by   bo t h   A C L   a n d   MAC   t a b l e .   In   t hi s   w a y ,   s uc h   a   p a c ke t   is   no   l o n ge r   p a s s i n g   t hr o ugh   t h e   L2   s w i t c h;   i n s t e a d,   it   is   de l i v e r e d   to   t h e   CP U   po r t   (t h e   po r t   #1 0   in   F i gu r e   1)   a nd   s t o r e d   in   a   s pe c i f i c   CP U   q ue u e ,   as   s h o w n   in   F i gu r e   4.   At   t hi s   po i n t ,   t h e   P l a t f or m   D r i v e r   can   r e a d   t h e   p a c ke t   us i n g   t h e   SDK   A P Is ,   h e n c e   t r i gge ri n g   t h e   ge n e ra t i o n   of   t h e   a pp r o pri a t e   O pe nF l o w   m e s s a ge   t o w a rd   t h e   c o n t r o l l e r.   P a c ke t s   t h a t   do   n o t   ha v e   to   go   to   CP U   p o r t s   a r e   h a ndl e d   e n t i r e l y   by   t h e   s w i t c h   l o gi c   a n d   do   n o t   r e qui r e   a n y   CP U   c y c l e s   a n d   ha ppe n   at   w i r e   s pe e d   for   a n y   f r a m e   s i z e .   H o w e v e r,   s i n c e   t h e   P l at f or m   D r i v e r   do e s   n o t   r e c e i v e   a n y   n o t i f i c a t i o n   w h e n   t h e   p a c ke t   r e a c h e s   t h e   CP U   que ue ,   a   n e w   b a c kgr o u nd   f ra m e   e xt ra c t o r   t hr e a d   ha s   b e e n   c r e a t e d   t h a t   po l l s   c o n t i nuo us l y   t h e   CP U   que ue s   fo r   n e w   p a c ke t s .   W h e n   a   ne w   p a c ke t   is   de t e c t e d,   it   ge n e ra t e s   a   P a c ke t - In   m e s s a ge   a n d   s e n ds   it   to   t h e   O pe n F l o w   c o n t r o l l e r   t hr o ug h   t h e   xD P d   Co nt r o l   a n d   M a na ge m e nt   M o dul e .   P a c ke t - in   m e s s a ge s   c a n   c o nt a i n   e i t h e r   t h e   e n t i r e   pa c ke t ,   or   o n l y   a   po r t i o n   of   it.   In   t h e   l a t t e r   c a s e ,     t h e   m e s s a ge   w i l l   c o n t a i n   o nl y   t h e   pa c ke t   h e a de r s   p l us   a   B uf f e r I D   (a u t o m a t i c a l l y   g e n e ra t e d   by   pl a t f o r m   d ri v e r   a n d   o pa que   to   t h e   c o n t r o l l e r )   t ha t   i de n t i f i e s   t h e   p r e c i s e   b uf f e r   t ha t   c o n t a i n s   t h e   a c t u a l   (w h o l e )   p a c ke t .     T h e   c o n t r o l l e r   can   us e   t h e   a b o v e   B uff e r ID   w h e n   a   p a c k e t - o ut   is   ge n e ra t e d ,   t e l l i n g   t h a t   t h e   pa c ke t   u n de r   c o n s i de ra t i o n   is   t h e   o n e   i de n t i f i e d   w i t h   t h e   g i v e n   B uf f e r ID .   T h e   d ri v e r   l o c ks   a n y   b uff e r   c urr e n t l y   in   us e ,   h e n c e   p r e v e nt i ng   it   f r o m   b e i n g   r e us e d   u n t i l   it   h a s   b e e n   ha n dl e d   by   t h e   c o n t r o l l e r   or   a   c o n f i gura b l e   a m o u n t   of   time   ha s   pa s s e d,   a v o i di ng   z o m b i e s   a n d   m e m o r y   e xha us t i o n.   S i n c e   t h e   h a rdw a r e   s w i t c h   do e s   n o t   ha v e   e n o ugh   m e m o r y   to   s t o r e   all   t h e   a b o v e   pa c ke t s ,   we   m o v e   t h e m   in   t h e   m e m o r y   b uff e r   po o l   p r o v i de d   by   xD P d,   i m p l e m e nt e d   in   t h e   de v i c e   m e m o r y   a n d   l i nke d   to   t h e   c o rr e s po n d i n g   L S I.           F i gu r e   4.   P a c ke t - in   a n d   p a c ke t - out       H a n dl i n g   P a c ke t - o ut   m e s s a ge s :   P a c k e t - O u t   m e s s a ge s   a r e   us e d   by   t h e   c o n t r o l l e r   to   fo r c e   a   s pe c i f i c   pa c ke t   (e . g. ,   t h e   o n e   r e c e i v e d   v i a   P a c ke t - i n )   to   be   s e n t   o ut   of   a   s p e c i f i e d   po r t   of   t h e   s w i t c h .   T h e s e   m e s s a ge s   c o n t a i n   a   f ul l   p a c ke t   or   a   b uf f e r   ID   r e f e r e n c i n g   a   p a c ke t   s t o r e d   in   t h e   b uf f e r   po o l .   T h e   m e s s a ge   m us t   a l s o   i n c l ude   a   l i s t   of   a c t i o n s   to   be   a ppl i e d   in   t h e   o r de r   t h e y   a r e   s pe c i f i e d;   an   e m p t y   a c t i o n   l i s t   d r o ps   t h e   p a c ke t .   W h e n   t h e   P a c ke t -   O u t   m e s s a ge   c o n t a i n s   an   a c t i o n   l i s t   w i t h   o nl y   an   o ut pu t   a c t i o n,   t h e   p a c ke t   is   r e t ri e v e d   f r o m   t h e   l o c a l   b uf f e r   a nd   i n j e c t e d,   us i n t h e   ha rdw a r e   s w i t c h   A P I s ,   i n t o   p h y s i c a l   po r t   o f   t h e   s w i t c h .   O t h e r w i s e ,   t h e   pa c ke t   is   i n j e c t e d   di r e c t l y   i n t o   t h e   s o f t w a r e   s w i t c h   p i pe l i n e ,   w hi c h   c o n t a i n s   t h e   w h o l e   s e t   of   f l o w   r ul e s ,   i n c l udi ng   t h e   o n e s   t h a t   a r e   of f l o a de d   to   t h e   ha rdw a r e .   In   t hi s   w a y   t h e   a b o v e   pa c ke t   w i l l   a l w a y s   c r o s s   o n l y     t h e   s o f t w a r e   pi pe l i n e   e v e n   if   it   is   c o m pa t i b l e   w i t h   t h e   r ul e s   pr e s e n t   in   t h e   ha rdw a r e   p i pe l i n e ;   t h e   l i m i t e d   ge n e ra t i o n   ra t e   of   p a c ke t   o ut   m e s s a ge s   m a ke s   t hi s   b e ha v i o r   i n s i g n i f i c a n t   f r o m   t h e   pe r f o r m a n c e   pe r s pe c t i v e .       5.   E V AL U A TI O N   In   t hi s   s e c t i o n   we   e v a l u a t e   t h e   SDN   c a pa b i l i t i e s   of   t h e   t ra d i t i o n a l   h o m e   g a t e w a y ,   w h i c h   c o n s i s t   in   r e c e i v i ng   O pe nF l o w   m e s s a ge s   a n d   c o n f i gu r e   t h e   f o r w a rdi ng   b e ha v i o r   of   t h e   da t a   pl a n e   a c c o r d i ng l y .     In   pa rt i c u l a r,   in   S e c t i o n   5 . 1.   we   v a l i d a t e   t h e   pr o po s e d   h y b r i d   a r c hi t e c t u r e   w h e r e   pa r t   of   t h e   r u l e s   a r e   of f l o a de d   in   t h e   ha r dw a r e   p i pe l i n e   ( i f   s uppo r t e d)   of   t h e   L2   s w i t c h   a v a i l a b l e   in   t h e   h o m e   g a t e w a y   a n d   t h e   r e m a i ni n g   rul e s   a r e   p r o c e s s e d   by   t h e   s o f t w a r e   O pe n F l o w   s w i t c h .   M o r e o v e r,   in   S e c t i o n   5 . 2.   we   e v a l ua t e   t h e   c a pa b i l i t y   of   t h e   t r a d i t i o n a l   h o m e   g a t e w a y   to   a c c e l e r a t e   t h e   Ipv 4   IP S e c   fo r w a r d i n g ,   w hi c h   r e p r e s e n t   a   v a l u a b l e   s c e n a r i o   in   h o m e   a nd   e n t e r p r i s e   n e t w o r ks ,   w h e r e   t h e   t ra f f i c   b e t w e e n   t w o   di f f e r e nt   O pe n F l o w   s w i t c h e s   s h o ul d   be   e n c r y pt e d   to   a v o i d   t h e   ri s k   t ha t   p h y s i c a l   de v i c e s   in   t h e   p a t h   m i g ht   r e a d   or   w r i t e   t h e   c o n t e n t s   of   t h e   t u nn e l   p a c ke t s .   Evaluation Warning : The document was created with Spire.PDF for Python.
                                IS S N :   2088 - 8708   Int   J   E l e c   &   Co m E n g ,   V o l .   10 ,   N o .   3 J u n e   2 020   :     26 68   -   2 681   2676   5. 1 .     x D P d   d r i v e r   e v al u at i o n   F o r   t h i s   t e s t   we   us e d   t h e   e xpe ri m e n t a l   s e t up   de pi c t e d   in   in   F i gu r e   5.   A   w o r ks t a t i o n   a c t i n g   as   b o t h   t ra f f i c   ge n e r a t o r   (s o u r c e )   a nd   r e c e i v e r   (s i nk)   w i t h   t h e   s uf f i c i e nt   n u m b e r   of   G i ga b i t   E t h e rn e t   po r t s   ha s   b e e n   c o n n e c t e d   to   t h e   NXP   ha rdw a r e   pl a t f o r m   u n de r   t e s t ,   i . e . ,   t h e   o n e   pr e s e nt e d   in   S e c t i o n   2. 1 .   T ra f f i c   is   ge n e r a t e d   w i t h   t h e   DPDK   v e r s i o n   of   P kt ge n   [14],   w hi c h   ha s   b e e n   m o di f i e d   in   o r de r   to   s e n d   t ra f f i c   w i t h   t h e   pr o pe r   n e t w o r k   pa r a m e t e r s   (e . g . ,   MAC   a dd r e s s e s r e qui r e d   by   t h e   s pe c i f i c   t e s t .   I n   p a rt i c ul a r,   w e   us e d   D P D K   17. 02. 0 - r c 0   a nd   P kt ge n   3. 0. 1 7.   In   a dd i t i o n,   a   s e c o n d   w o r ks t a t i o n   h o s t s   t h e   o pe n   s o u r c e   Ry u   [15]   O pe nF l o w   c o n t r o l l e r,   w hi c h   is   c o nn e c t e d   to   a   W A N   po r t   t ha t   is   n o t   t e r m i n a t e d   on   t h e   ha r dw a r e   s w i t c h   of   t h e   NXP   b o a r d.   F o r   our   t e s t s ,   w e   us e d   t h e   L2   l e a rn i ng   s w i t c h   a pp l i c a t i o n   (c a l l e d   s i m pl e   s w i t c h . py ),   w h o s e   b e h a v i o r   is   t h e   f o l l o w i ng:   f i rs t l y ,   a f t e r   t h e   c o n n e c t   is   e s t a b l i s h e d   w i t h   t h e   O pe n F l o w   c o n t r o l l e r ,   t h e   a ppl i c a t i o n   i ns t a l l s   a   de f a ul t   r u l e   in   t h e   f l o w   t a b l e   of   t h e   s w i t c h   to   r e di r e c t   a l l   p a c ke t s   to   t h e   c o nt r o l l e r.   A f t e r   t ha t ,   t h e   s w i t c h   s t a rt s   ge n e ra t i n g   P a c k e t - In   m e s s a ge s   fo r   a l l   pa c ke t s   r e c e i v e d;   t h e n,   t h e   c o n t r o l l e r   r e a ds   t h e   s o ur c e   M A C   a ddr e s s e s   of   t h e   r e c e i v e pa c ke t s   a nd   i n s t a l l s   a   n e w   f o r w a r d i ng   r u l e   in   t h e   ha r dw a r e   s w i t c h   as   s o o n   as   a   n e w   MAC   a dd r e s s   is   r e c o gn i z e d   (t hr o ug h   a   s pe c i f i c   f l ow   m o d)   m e s s a ge ).   T h e   o pe r a t i n g   s y s t e m   of   t h e   T 1040   is   c o m pi l e d   w i t h   t h e   v e r s i o n   1 . 7   of   t h e   NXP   SDK   a n d   us e s   t h e   L i n u x   ke rn e l   v e r s i o n   3 . 12 . 19 ;   xD P d   ha s   b e e n   i n s t a l l e d   in   o r de r   to   i m pl e m e nt   t h e   O pe n F l o w   pi pe l i n e .   In   f a c t ,   t w o   di f f e r e nt   v e r s i o n s   of   xD P d   a r e   us e d;   t h e   f i r s t   o n e   is   c o m pi l e d   w i t h   t h e   s uppo r t   for   our   of f l o a d i ng   d r i v e r,   w h i c h   can   of f l o a d   t h e   s u ppo r t e d   r u l e s   to   t h e   ha rdw a r e   s w i t c h   a c c o r di n g   to   o ur   p r o po s e d   a r c hi t e c t u r e .   T h e   s e c o n d   v e r s i o n   is   a   v a ni l l a   x D P d   c o m pi l e w i t h   t h e   G N U / L i n ux   d ri v e r,   w h e r e   t h e   O pe n F l o w   pi pe l i n e   is   i m pl e m e n t e d   e n t i r e l y   in   s o f t w a r e .           F i gu r e   5.   T e s t   s c e na r i o   w i t h   t h e   r y u   OF   c o n t r o l l e r   a nd   t h e   f o rw a rdi ng   (a )   w i t h   t h e   i m p l e m e nt e d   d ri v e r   (g r e e n   pa t h ) ,   (b )   w i t h   t h e   s o f t w a r e   xD P d   p i pe l i n e   as   a   r e f e r e n c e   (b l ue   p a t h )       5. 1 . 1.   Ex p e r i m e n t   s c e n ar i o   To   un de r s t a nd   t h e   ga i n   we   c a n   ge t   f r o m   t h e   ha r dw a r e   s w i t c h i n g   a nd   p r o c e s s i n g ,   we   pe r fo r m e d   4   di f f e r -   e n t   e xpe ri m e nt s   w h e r e   w e   c o m pa r e   t h e   a pp l i c a t i o n   p r o c e s s i n pe r f o r m a n c e   o f   s t a nd a r d   O pe nF l o w   s o f t w a r e   s w i t c h   i m p l e m e n t a t i o n   a ga i n s t   o ur   a r c hi t e c t u r e   t h a t   i m pl e m e nt s   t h e   p r o po s e d   Se l e c t i v e   Of f l o ad i ng   a l go ri t hm .   T h e   go a l   of   t h i s   e xpe ri m e nt   is   n o t   to   s h o w   h o w   t h e   ha r dw a r e   c a n   o ut pe r f o r m   t h e   s o f t w a r e ,   w h i c h   is   e v i de nt .   In s t e a d,   w e   a i m   a t   de m o n s t r a t i n t h a t   ( i us i n t h e   ha rdw a r e   a v a i l a b l e   i n   t h e   pl a t f o r m   w e   c a n   r e duc e   t h e   CP U   pr o c e s s i n g   t ha t   c o n s e que n t l y   b e c o m e s   f r e e   fo r   o t h e r   t a s ks ,   a n d   ( ii )   t ha t   we   c a n   i nt r o duc e   m o r e   f l e xi b i l i t y   to   t h e   pl a t f o r m ,   po t e nt i a l l y   e n a b l i ng   to   s uppo r t   r u l e s   t ha t   a r e   no t   n a t i v e l y   s uppo r t e d   in   t h e   h a rdw a r e ,   w h i l e   s t i l l   l e v e ra g i n g   t h e   h a rdw a r e   f o r   f a s t   o f f l o a di n g ,   i n   a   w a y   t h a t   i s   c o m pl e t e l y   t r a n s pa r e nt   t o   t h e   f o r w a rdi ng   a ppl i c a t i o n .   O u r   t e s t s   m e a s u r e   t h e   t hr o ughput   of   t h e   s w i t c h   in   t w o   di f f e r e nt   o pe ra t i n g   c o n d i t i o n s .   F i r s t ,   we   us e dt h e   P o rt - b a s e d   V L A N   f un c t i o n a l i t y ,   as   de s c r i b e d   in   S e c t i o n   2 . 1.   to   r e di r e c t   all   t h e   p a c ke t s   r e c e i v e d   by     t h e   ha r dw a r e   s w i t c h   to   t h e   i nt e rna l   CP U ,   m a i n t a i ni n g   i ngr e s s   po r t   i n f o r m a t i o n   a n d   a v o i d   s w i t c h i ng   in     t h e   L 2S w i t c h .   T h i s   is   us e d   as   a   b e n c hm a r k i n g ,   s i n c e   it   p r o v i de s   a   s i m pl e   w a y   to   i n t r o duc e   O pe n F l o w   s uppo r t   in   a   t ra d i t i o n a l   s w i t c h   by   m ov i ng   a l l   t h e   p r o c e s s i n g   in   s o f t w a r e .   S e c o n d,   we   t e s t e d   o ur   of f l o a d i ng   d ri v e r   by   s e l e c t i v e l y   m o v i n g   a l l   t h e   s uppo r t e d   r ul e s   i n t o   t h e   ha r dw a r e   s w i t c h ,   h e n c e   p r o v i di ng   a   m o r e   o pt i m i z e d   w a y   to   b r i ng   O pe n F l o w   s uppo r t   to   an   e xi s t i n g   s w i t c hi n g   A S IC .   In   t h e   f i r s t   t w o   t e s t s   (S e c t i o n   5. 1 . 2.   a n d   5 . 1 . 3 . ),   we   c a l c ul a t e   t h e   pe r f o r m a n c e   of   t h e   di f f e r e nt   d ri v e r   i m p l e m e nt a t i o n   in   t e rm s   of   m a xi m u m   t hr o ug h pu t   a n d   we   e va l u a t e   h o w   t h i s   is   a f f e c t e by   t h e   n u m b e r   of   p o r t s   i n v o l v e d   i nt o   t h e   pr o c e s s i n g   a n d   t h e   s i z e   of   t h e   r e c e i v e d   p a c ke t s .   In   p a rt i c ul a r,   we   r e po r t   t h e   t hr o ug hput   in   m i l l i o n   p a c ke t s   pe r   s e c o n ds   (M pps )   a n d   t h e   c o rr e s po n d i n g   C P U   a n d   R A M   c o n s um pt i o n   in   t h e   h o m e   g a t e w a y .   On   t h e   o t h e r   t w o   t e s t s   (S e c t i o n   5. 1. 4. ) ,   we   t a ke   i nt o   a c c o un t   a   s c e n a ri o   w h e r e   o n l y   a   pa rt   of   t h e   r u l e s   c a n   be   of f l o a de d   i nt o   t h e   ha r dw a r e   de v i c e ,   w h i l e   t h e   u n s u ppo rt e d   o n e s   a r e   ha n d l e d   in   t h e   s o f t w a r e   O pe n F l o w   pi pe l i n e .   Evaluation Warning : The document was created with Spire.PDF for Python.
Int   J   E l e c   &   Co m E n g     IS S N :   2088 - 8708       T r ans f or m i ng  t r adi t i ona l   hom e   ga t e w ay   i n t har dw ar e - ac c e l e r a t e SD N   s w i t c h   ( Se bas t i ano   M i ano )   2677   5. 1 . 2.   S i m p l e S w i t c h ap p l i c at i o n :   fo r w a r d i n g   b e tw e e n   t w o   p o r ts   In   t h e   f i r s t   t e s t ,   P C1   a n d   P C 2   e xc h a nge   a   b i di r e c t i o n a l   t ra f f i c   f l o w   at   t h e   m a xi m u m   s pe e d   (2   x   1G b ps ).   W h e n   t h e   r ul e s   a r e   i n s t a l l e d   c o rre c t l y ,   t h e   o v e r a l l   t hr o ug h p ut   of   t h e   s y s t e m   is   de pi c t e d   in   F i g u r e   6a ,   w hi c h   s h o w s   t h a t   o u r   d ri v e r   l e a ds   t o   a   s i g n i f i c a n t   pe r f o r m a n c e   i m p r o ve m e nt   c o m pa r e d   t o   t h e   s o f t w a r e - o nl y   v e r s i o n .   In   f a c t ,   w e   c a n   n o t i c e   t ha t   t h e   l i n e   ra t e   i s   n e v e r   r e a c h e d   w h e n   t h e   s w i t c hi n i s   pe r f o r m e d   e nt i r e l y   i n   s o f t w a r e ,   l i ke l y   due   to   t h e   o v e rh e a d   c a us e d   by   c o p y i n g   t h e   p a c ke t   da t a   f r o m   us e r - s p a c e   to   ke rn e l - s p a c e   m e m o r y   a n d   v i c e   v e r s a .   W i t h   our   d ri v e r,   t h e   s w i t c h i n g   is   pe r f o r m e d   e n t i re l y   in   ha rdw a r e   at   l i n e   ra t e ,   as   s h o w n   by   t h e   l i n e   a s s o c i a t e d   to   t h e   t hr o ug hput   of   t h e   xD P d   ha rdw a r e ,   w hi c h   is   c o m pl e t e l y   o v e r l a ppe d   w i t h   t h e   l i n e   ra t e .     5. 1 . 3.   S i m p l e   S w i tc h   ap p l i c at i o n :   fo r w a r d i n g   b e tw e e n   al l   p o r ts   In   t h e   s e c o n d   e xpe r i m e nt ,   we   us e d   a   t h i r d   m a c hi n e   P C3   e qui ppe d   w i t h   a   qu a d - po rt   I nt e l   I350   G i g a b i t   E t h e rn e t   N IC ,   w h i c h   w a s   i n s t a l l e d   a l s o   in   P C1 .   T h e   f o ur   po r t s   on   P C1   a r e   c o nn e c t e d   to   t h e   f i r s t   f o ur   po r t s   of   t h e   s w i t c h ,   w hi l e   t h e   r e m a i ni n g   po r t s   a r e   a t t a c h e d   t o   P C3.   B o t h   P C1  a n d   P C 3   ge n e ra t e   b i di r e c t i o na l   t ra f f i c   us i n P kt ge n   DPDK   a t   t h e   m a xi m u m   r a t e ,   w i t h   t h e   s a m e   L2   S w i t c h   Ry u   a ppl i c a t i o n   us e b e fo r e .   Re s ul t s   a r e   s h o w n   in   F i gu r e   6b ,   w i t h   c o n f i rm s   t ha t   t h e   ha r dw a r e   is   s t i l l   a b l e   to   pe r fo r m   at   l i n e   r a t e   fo r   w ha t e v e r   p a c ke t   s i z e ,   w h i l e   t h e   s o f t w a r e   is   s t i l l   v e r y   m uc h   b e y o n d   t ha t   t hr o ughput .   It   is   w o r t h   n o t i ng   t ha t   t h e   l i n e   ra t e   c a nn o t   be   r e a c h e d   e v e n   in   c a s e   of   a   m o r e   po w e r f ul   CP U ,   as   t hi s   c o m po n e n t   is   c o nn e c t e d   to   t h e   s w i t c hi n g   ha rdw a r e   w i t h   a   m a xi m um   a gg r e g a t e d   b a n dw i dt h   of   5G b ps ,   gi v e n   by   t h e   t w o   FMAN   po r t s .   I n s t e a d,   t h e   p h y s i c a l   po rt s   c o n n e c t e d   to   t h e   s w i t c h   a c c o un t   for   8   G b ps   of   b i di r e c t i o na l   t ra f f i c ,   i . e . ,   16G b ps ,   w h i c h   is   a l m o s t   t hr e e   t i m e   t h e   c a pa c i t y   of   t h e   i nt e rna l   pa t h s .   F i gu r e   6c   a n d   6d   c o m pa r e s   t h e   CP U   l o a d   b e t w e e n   t h e   xD P d   G N U / L i n ux   pu r e   s o f t w a r e   i m pl e m e nt a -   t i o n   a nd   t h e   s a m e   v a l ue s   us i n g   t h e   i m pl e m e n t e d   d ri v e r.   In   t h e   s e c o n d   e xpe ri m e nt ,   w h e r e   a l l   po rt s   r e c e i v e   f r a m e s   at   t h e   m a x i m u m   ra t e ,   t h e   s o f t w a r e   xD P d   i m pl e m e n t a t i o n   c on s u m e s   a l m o s t   a l l   a v a i l a b l e   CP U   in   t h e   pl a t f o r m   (4. 0   on   a   q ua d   c o r e   r e pr e s e nt s   100%   u t i l i z a t i o n ) ,   g i v e n   t ha t   e v e r y   f l o w   is   h a ndl e d   by   t h e   s y s t e m   CP U .   Co m p a r i ng  t hi s   r e s ul t   w i t h   t h e   L 2s w i t c h   h a rdw a r e   d ri v e r   c o n f i rm s   t h a t ,   t h e   us e   of   t h e   ha r dw a r e   de v i c e   to   pe r f o r m   t h e   p a c ke t   s w i t c hi n g   do e s   n o t   i nv o l v e   t h e   CP U ,   w h i c h   can   be   ut i l i z e d   by   t h e   o t h e r   s y s t e m   pr o c e s s e s .   Of   c o ur s e ,   t h e r e   a r e   o pt i m i z e d   O pe n F l o w   s w i t c h   i m pl e m e n t a t i o n s   (O v S - DPDK   or   xD P d - DPDK)   t h a t   us e   a   s o f t w a r e   ap p r o a c h   to   ob t a i n   s i g n i f i c a n t   v a l ue s   of   t hr o ug h pu t .   H o w e v e r,   t h e s e   t e c hn o l o gi e s   r e qu i r e   t o o   m a n y   r e s o ur c e s   (i . e . ,   CP U   c o r e s )   t h a t   w o ul d   be   pr o hi b i t i v e   in   a   r e s i de nt i a l   CP E ,   w h o s e   c o s t   is   a   v e r y   i m po rt a nt   pa ra m e t e r   to   c o n s i de r.           (a )     (b )       (c )   (d)     F i gu r e   6.   P e r f o r m a n c e   c o m pa ri s o n   b e t w e e n   xD P d   w i t h   t h e   ha rdw a r e   pi pe l i n e   a n d   s o f t w a r e   pi pe l i n e   (S i m p l e   S w i t c h   O pe n F l o w   a ppl i c a t i o n ) ,   (a )   F o r w a rdi n g   b e t w e e n   2   po rt s ,   (b F o r w a r di n g   o a l l   po rt s ,   (c CP U   c o n s um pt i o n   ha r dw a r e   pi pe l i n e ,   (d)   CP U   c o n s um pt i o n   s o f t w a r e   p i pe l i n e         Evaluation Warning : The document was created with Spire.PDF for Python.