[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-rt
Subject:    Re: [Rtl] help with RTSock...am not understanding anything.
From:       Robert Kavaler <kavaler () berkeley ! innomedia ! com>
Date:       2004-10-08 3:55:27
Message-ID: 41660FAF.4040604 () berkeley ! innomedia ! com
[Download RAW message or body]

vishal changrani wrote:

> Ok heres what I understand of RTSock as per your documentation....
>  
> RTSock enables one to send and recieve UDP packets to and from a Real 
> time task. However the actual connection is still established by a 
> user space task which uses the standard network driver like in my case 
> the 3Com59x.
>  
> So what if I use a real time fifo (as provided by RTLinux) to 
> communicate between the real time task and user space task. i.e. 
> Instead of using sockets in real time task,  UDP packets will be 
> fowarded to the real time task via the real time fifo?

I think that what you are asking is what is the benefit of using rtsock 
over just the user space program feed all incoming UDP packets into the 
realtime program via an rtfifo, and do the same in the other direction?  
Let me answer that question.

The benefits of rtsock include:
1. it does not require a user task at all because a similar process is 
done in the linux kernel
    a. this eliminates the unpredictable and load dependent delay 
associated with waking the user task to do this transfer, which 
eliminates most of the jitter in packet receive times,
    b. this elimates the management of these user tasks,
2. Rtsock uses the same skb structure used by the kernel, eliminating 
the copy-in copy-out associated with any user level task.  In fact, if 
you use the rtfifo approach you will see that all receive and transmit 
packets are copied at least twice each, while with rtsock NO coping is 
performed.  This means you can pump more packets from an rt source than 
you can from a user-task source.

There are other benefits you will find, such as the elimination of 
arbritrary interfaces (e.g. formatting stuff on the fifo) and the 
resulting ease of design and coding.  Of course, you have to understand 
what is going on, which does take time.  But time is better spent 
understanding and organizing than writing code.

I hope this answers your questions.  BTW, if you look, I do implement a 
FIFO like the rtfifo, but it is much more efficient because it only uses 
pointers (4 bytes each) as data types.

Robert

> Please let me know if what I have interpreted is correct since I have 
> to carry on my work in this direction.
>  
> I apologize for bugging you.
>  
> Hope you will reply soon,
> Vishal Changrani
>  
>
>
> */Robert Kavaler <kavaler@berkeley.innomedia.com>/* wrote:
>
>     I doubt there is such help available, but I wrote rtsock so I may be
>     able to help.
>
>     Did you try the example? Did it work? After you try it, the next step
>     is to understand it, which may be where you are. I think it is
>     hard to
>     explain (I wrote the documentation too, that was the best I could
>     do).
>     The fundamental design of rtsock pushes all of the opening and
>     closing
>     and binding and connecting and error handling of sockets to user
>     space,
>     where they are done as usual, and only the processing of UDP
>     packets is
>     done in the realtime process. *If you want your entire code,
>     including
>     opening and closing the sockets and binding/connected them, to run in
>     realtime then rtsock is NOT for you*. Now given that you have both
>     realtime and user space things going on with rtsock, you should
>     look at
>     the example of the realtime part and see what i s going on there. The
>     user space part is identical to standard socket programming with the
>     exception of one additional ioctl to the rtsock device. This call is
>     used to bind (i.e. pass) the user space created socket with the
>     rtsock
>     handler.
>
>     I hope this helps as a place to start.
>
>     Robert
>
>
>     vishal changrani wrote:
>
>     > Hi all...
>     > I want to do some network programming in RTlinuc. As per the
>     archives
>     > I tired to use RTsock. However..am finding it very hard how to
>     write a
>     > simple code in RTsock.
>     > I apologize if I am sounding naive but I have done socket
>     programming
>     > in C but am not able to comprehend at al the exmaples of RTSock,
>     > Is there any book or online help for RTSock programming which
>     teaches
>     > the basics and stuff.
>     >
>     > Please help,
>     > Vishal Changrani
>     >
>     >
>     ------------------------------------------------------------------------
>     > Do you Yahoo!?
>     > ; vote.yahoo.com - Register online to vote today!
>     >
>     >------------------------------------------------------------------------
>     >
>     >_______________________________________________
>     >Rtl mailing list
>     >Rtl@rtlinux.org
>     >http://www2.fsmlabs.com/mailman/listinfo/rtl
>     >
>     >
>
> ------------------------------------------------------------------------
> Do you Yahoo!?
> vote.yahoo.com <http://vote.yahoo.com> - Register online to vote today! 


_______________________________________________
Rtl mailing list
Rtl@rtlinux.org
http://www2.fsmlabs.com/mailman/listinfo/rtl
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic