linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Query about Tun/Tap Modules
@ 2001-09-09 15:28 Shiva Raman Pandey
  2001-09-09 15:59 ` Erik Andersen
  2001-09-09 17:46 ` Jeff Dike
  0 siblings, 2 replies; 5+ messages in thread
From: Shiva Raman Pandey @ 2001-09-09 15:28 UTC (permalink / raw)
  To: kernelnewbies, linux-kernel

Hello All,
I want to trap the ethernet packets from ethernet driver and then send it
through a Bluetooth stack whose output will be in turn send through IP then
TCP layers and vice-versa.(As a result inserting bluetooth stack between
ethernet and IP layers) It is clear from the picture below.


|--------------------------------------------|
|             TCP                                              |
|--------------------------------------------|
                            |
               bi directional Interface
                            |
|--------------------------------------------|
|             IP                                                 |
|--------------------------------------------|
                            |
               bi directional Interface

|---------------------------------------------------------

|                                                |

|   Bluetooth                              |

|   Stack                                    |

|                                                |

|                                                |

|                                                |

|                                                |

|---------------------------------------------------------
               bi directional Interface
                            |
|--------------------------------------------|
|             Ethernet                                         |
|--------------------------------------------|


For these message tapping I got this module called Tun/Tap at
http://vtun.sourceforge.net/tun
Some info about this is available at
http://www.linuxhq.com/kernel/v2.4/doc/networking/tuntap.txt.html   also.

I compiled this module, made install, and insmod also.
Till here no problem.
My queries are -

Q1 : Now I am not able to understand how to use this module for my above
stated purpose.
     If anybody has used this utility(Tun/tap) before , please let me know
how to get these ethernet packet going towards IP layer and IP packets going
towards ethernet driver.

Q2. What can be other ways, not very complicated  to solve my purpose
instead of using Tun/Tap.

Q3. All the debug message are going to /var/log/messages, even if I send
with the loglevel 1. How to get them on screen? How can I see the default
console loglevel?

Hope to get an early reply.

Thanks  a lot.
Shiva Raman Pandey
Research Associate-Computer Science R&D
Sasken Communication Technologies Limited.
Bangalore-India







^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Query about Tun/Tap Modules
  2001-09-09 15:28 Query about Tun/Tap Modules Shiva Raman Pandey
@ 2001-09-09 15:59 ` Erik Andersen
  2001-09-09 16:13   ` Peter T. Breuer
  2001-09-09 17:46 ` Jeff Dike
  1 sibling, 1 reply; 5+ messages in thread
From: Erik Andersen @ 2001-09-09 15:59 UTC (permalink / raw)
  To: Shiva Raman Pandey; +Cc: linux-kernel

On Sun Sep 09, 2001 at 08:58:56PM +0530, Shiva Raman Pandey wrote:
> 
> Q2. What can be other ways, not very complicated  to solve my purpose
> instead of using Tun/Tap.

The network block device can be used via loopback...

 -Erik

--
Erik B. Andersen   email:  andersee@debian.org
--This message was written using 73% post-consumer electrons--

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Query about Tun/Tap Modules
  2001-09-09 15:59 ` Erik Andersen
@ 2001-09-09 16:13   ` Peter T. Breuer
  0 siblings, 0 replies; 5+ messages in thread
From: Peter T. Breuer @ 2001-09-09 16:13 UTC (permalink / raw)
  To: andersen; +Cc: Shiva Raman Pandey, linux-kernel

"Erik Andersen wrote:"
> On Sun Sep 09, 2001 at 08:58:56PM +0530, Shiva Raman Pandey wrote:
> > 
> > Q2. What can be other ways, not very complicated  to solve my purpose
> > instead of using Tun/Tap.
> 
> The network block device can be used via loopback...

Not totally relaibly, however. It must deadlock when writing to a
server on the same machine, because when we run out of memory
we must free buffers by flushing pending writes on devices, which will
send packets for the nbd out to loaclhost and to the local server, where
they will take a buffer just prior to being written to disk ... and
of course they won't succeed because we are out of memory.

I would like the algorithms that free buffers to avoid the device
that caused the memory pressure. Since they can't do that, the
next best thing is to avoid it some of the time, which they
can do by avoiding everything randomly. Please add randomness under
stress, people.

Peter

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Query about Tun/Tap Modules
  2001-09-09 15:28 Query about Tun/Tap Modules Shiva Raman Pandey
  2001-09-09 15:59 ` Erik Andersen
@ 2001-09-09 17:46 ` Jeff Dike
  1 sibling, 0 replies; 5+ messages in thread
From: Jeff Dike @ 2001-09-09 17:46 UTC (permalink / raw)
  To: Shiva Raman Pandey; +Cc: kernelnewbies, linux-kernel

shiva@sasken.com said:
> Q1 : Now I am not able to understand how to use this module for my
> above stated purpose.
>      If anybody has used this utility(Tun/tap) before , please let me
> know how to get these ethernet packet going towards IP layer and IP
> packets going towards ethernet driver. 

It's not clear how similar my use of TUN/TAP is to what you want, but UML uses
TUN/TAP as one mechanism to network a virtual machine to the host, and it
works quite well.

See tuntap_up() in 
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/user-mode-linux/tools/uml_net/uml_net.c?rev=1.10&content-type=text/vnd.viewcvs-markup
for setting up a TUN/TAP interface and 
tuntap_user_read() and tuntap_user_write() (which are both trivial)
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/user-mode-linux/linux/arch/um/drivers/tuntap_user.c?rev=1.2&content-type=text/vnd.viewcvs-markup
for getting packets in and out of the interface.

				Jeff


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Query about Tun/Tap Modules
@ 2001-09-09 16:15 Peter T. Breuer
  0 siblings, 0 replies; 5+ messages in thread
From: Peter T. Breuer @ 2001-09-09 16:15 UTC (permalink / raw)
  To: linux kernel

"Erik Andersen wrote:"
> On Sun Sep 09, 2001 at 08:58:56PM +0530, Shiva Raman Pandey wrote:
> > 
> > Q2. What can be other ways, not very complicated  to solve my purpose
> > instead of using Tun/Tap.
> 
> The network block device can be used via loopback...

Not totally relaibly, however. It must deadlock when writing to a
server on the same machine, because when we run out of memory
we must free buffers by flushing pending writes on devices, which will
send packets for the nbd out to loaclhost and to the local server, where
they will take a buffer just prior to being written to disk ... and
of course they won't succeed because we are out of memory.

I would like the algorithms that free buffers to avoid the device
that caused the memory pressure. Since they can't do that, the
next best thing is to avoid it some of the time, which they
can do by avoiding everything randomly. Please add randomness under
stress, people.

Peter

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2001-09-09 16:29 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-09-09 15:28 Query about Tun/Tap Modules Shiva Raman Pandey
2001-09-09 15:59 ` Erik Andersen
2001-09-09 16:13   ` Peter T. Breuer
2001-09-09 17:46 ` Jeff Dike
2001-09-09 16:15 Peter T. Breuer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).