f r e e r t o s a n d t c p i p c o mmu n i c a t i o n t
play

F r e e R T O S a n d T C P / I P c o mmu n i c - PowerPoint PPT Presentation

A d v a n c e d Wo r k s h o p o n mo d e r n F P G A - b a s e d t e c h n o l o g y f o r S c i e n t i f i c C o mp u t i n g F r e e R T O S a n d T C P / I P c o


  1. A d v a n c e d Wo r k s h o p o n mo d e r n F P G A - b a s e d t e c h n o l o g y f o r S c i e n t i f i c C o mp u t i n g F r e e R T O S a n d T C P / I P c o mmu n i c a t i o n : t h e l w I P l i b r a r y F e r n a n d o R i n c ó n f e r n a n d o . r i n c o n @u c l m . e s S m r 3 2 8 9 – I C T P ( M a y 2 0 1 9 )

  2. C o n t e n t s ● T h e l w I P T C P / I P s t a c k – T h e n e t w o r k s t a c k – T h e s o c k e t c o n c e p t ● A T y p i c a l N e t w o r k A p p l i c a t i o n ● U D P v s T C P ● U s e f u l n e t w o r k t o o l s ● h t t p s : / / w w w . x i l i n x . c o m / v i d e o / s o c / n e t w o r k i n g - w i t h - l w i p - f o c u s e d - f r e e - r t o s . h t m l 2 F r e e R T O S + l w I P S m r 3 2 8 9 – I C T P ( M a y 2 0 1 9 )

  3. l w I P T C P / I P s t a c k ● l w I P s t a n d s f o r L i g h t w e i g h t I P : – S m a l l f o o t p r i n t i m p l e m e n t a t i o n – S p e c i a l l y w e l l s u i t e d f o r e m b e d d e d s y s t e m s ● S u p p o r t s a l a r g e n u m b e r o f n e t w o r k p r o t o c o l s – U D P , T C P , I C M P , A R P , . . . ● A P I s : – B e r k e l e y s o c k e t s : ● r e q u i r e s a n O . S . – R a w A P I ● Wi t h o r w i t h o u t O S ● M o r e c o n t r o l , b u t m o r e c o m p l e x t o u s e ● I n c l u d e d i n x i l i n x S D K – A l s o i n c l u d e s d r i v e r f o r X i l i n x E t h e r n e t d r i v e r – X A P P 1 0 2 6 i s t h e r e f e r e n c e a p p l i c a t i o n n o t e 3 F r e e R T O S + l w I P S m r 3 2 8 9 – I C T P ( M a y 2 0 1 9 )

  4. T h e n e t w o r k s t a c k ● T h e n e t w o r k d e s i g n i s o r g a n i z e d a s a l a y e r s t a c k . ● E a c h l a y e r p r o v i d e s a s e t o f s e r v i c e s t o t h e u p p e r l a y e r a n d r e q u i r e s s e r v i c e s f r o m t h e l o w e r l a y e r . ● T h e l a y e r ' n ' o f a n o d e m a i n t a i n s a v i r t u a l c o n v e r s a t i o n w i t h t h e s a m e l a y e r t h e d e s t i n a t i o n n o d e . T h a t c o n v e r s a t i o n m u s t m e e t a s p e c i fi c p r o t o c o l . 4 F r e e R T O S + l w I P S m r 3 2 8 9 – I C T P ( M a y 2 0 1 9 )

  5. N e t w o r k s o c k e t s ● S o c k e t : – B a s i c a b s t r a c t i o n f o r n e t w o r k p r o g r a m m i n g – C o m b i n a t i o n o f I P + p o r t – I n t e r - p r o c e s s c o m m u n i c a t i o n 5 F r e e R T O S + l w I P S m r 3 2 8 9 – I C T P ( M a y 2 0 1 9 )

  6. N e t w o r k s o c k e t s ● F r o m t h e p r o g r a m m i n g p o i n t o f v i e w – C h a n n e l a b s t r a c t i o n ● B e r k e l e y s o c k e t s ( B S D s o c k e t s | P O S I X s o c k e t s ) – D e f a c t o s t a n d a r d A P I ● L w I P S o c k e t A P I lwip_socket(AF_INET, SOCK_STREAM, 0) – ‘ l i t e ’ v e r s i o n o f B S D s o c k e t s s s e r v e r c l i e n t p r o c e s s p r o c e s s read write B y t e s → socket socket write read ← B y t e s 6 F r e e R T O S + l w I P S m r 3 2 8 9 – I C T P ( M a y 2 0 1 9 )

  7. F r e e R T O S n e t w o r k a p p l i c a t i o n ● B a s i c t e m p l a t e f o r s o c k e t o r i e n t e d p r o g r a m m i n g : – F i r s t s e t u p a n e t w o r k t h r e a d a n d s t a r t F r e e R T O S t a s k s c h e d u l e r – T h e n t h e n e t w o r k t h r e a d : ● I n i t i a l i z e s l w i p ● C o n fi g u r e s a n e t w o r k i n t e r f a c e ● R i s e s t h e i n t e r f a c e ● S t a r t s a n o t h e r t h r e a d f o r t h e r e c e p t i o n ● I n s t a l l s a n y o t h e r n e t w o r k t a s k s ( n e w t h r e a d s ) r e q u i r e d b y t h e a p p l i c a t i o n – We ’ l l s u p p o s e a n e c h o s e r v e r ● F i n a l l y i t d e l e t e s i t s e l f – T h e r e f o r e a f t e r i n i t i a l i z a t i o n s e v e r a l t h r e a d s a r e a c t i v e : ● R e c e p t i o n ● E c h o s e r v e r 7 F r e e R T O S + l w I P S m r 3 2 8 9 – I C T P ( M a y 2 0 1 9 )

  8. F r e e R T O S n e t w o r k a p p l i c a t i o n ● I n i t i a l i z a t i o n : We n e e d F r e e R T O S t o s t a r t t a s k e x e c u t i o n f o r t h e r e s t o f t h e p r o c e d u r e E q u i v a l e n t t o a F r e e R T O S t a s k 8 F r e e R T O S + l w I P S m r 3 2 8 9 – I C T P ( M a y 2 0 1 9 )

  9. F r e e R T O S n e t w o r k a p p l i c a t i o n ● N e t w o r k c o n fi g u r a t i o n t h r e a d S t a t i c I P c o n fi g u r a t i o n … ( c o n t i n u e s i n t h e n e x t s l i d e ) 9 F r e e R T O S + l w I P S m r 3 2 8 9 – I C T P ( M a y 2 0 1 9 )

  10. F r e e R T O S n e t w o r k a p p l i c a t i o n ● N e t w o r k c o n fi g u r a t i o n t h r e a d T a s k s t h a t w i l l r e m a i n a c t i v e : ● N e t w o r k d a t a r e c e p t i o n ● E c h o s e r v e r ( t h a t p r o c e s s e s d a t a r e c e i v e d ) T h i s t a s k i s j u s t f o r c o n fi g u r a t i o n p u r p o s e s 10 F r e e R T O S + l w I P S m r 3 2 8 9 – I C T P ( M a y 2 0 1 9 )

  11. N e t w o r k p r o g r a m m i n g c o n c e p t s : E r r o r c o n t r o l ● N e t w o r k c o m m u n i c a t i o n a t t h e I P l e v e l i s u n r e l i a b l e ● I f r e l i a b i l i t y i s r e q u i r e d a t t h e t r a n s p o r t l a y e r . E r r o r c o n t r o l i s r e s p o n s i b l e f o r : – D e t e c t a n d d i s c a r d c o r r u p t p a c k e t s – K e e p t r a c k o f l o s t a n d d i s c a r d e d p a c k e t s ( r e s e n d ) – D i s c a r d d u p l i c a t e s – B u ff e r o u t - o f - o r d e r p a c k e t s ● I m p l e m e n t e d t h r o u g h : – S e q u e n c e n u m b e r s ( i n p a c k e t s ) – A c k n o w l e d g e m e n t a n d t i m e r s 11 F r e e R T O S + l w I P S m r 3 2 8 9 – I C T P ( M a y 2 0 1 9 )

  12. N e t w o r k p r o g r a m m i n g c o n c e p t s : F l o w c o n t r o l ● B o t h t h e s e n d e r a n d r e c e i v e r a d j u s t t h e t r a n s m i s s i o n s p e e d ● s l i d i n g w i n d o w : – B u ff e r u s e d t o m a k e t h e t r a n s m i s s i o n m o r e e ffi c i e n t ● S e e v i d e o s – a s w e l l a s t o c o n t r o l t h e fl o w o f d a t a s o t h a t t h e d e s t i n a t i o n d o e s n o t b e c o m e o v e r w h e l m e d w i t h d a t a ● T h e d e s t i n a t i o n c a n r e d u c e t h e s i z e o f t h e w i n d o w 12 F r e e R T O S + l w I P S m r 3 2 8 9 – I C T P ( M a y 2 0 1 9 )

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend