All of lore.kernel.org
 help / color / mirror / Atom feed
* Implement custom network protocol for local processes
@ 2011-01-17 21:24 Kfir Lavi
  2011-01-17 21:43 ` John Mahoney
  2011-01-18  9:30 ` Vasiliy Kulikov
  0 siblings, 2 replies; 4+ messages in thread
From: Kfir Lavi @ 2011-01-17 21:24 UTC (permalink / raw)
  To: kernelnewbies

Hi,
How can one implement custom header network protocol.
I mean header that wraps regular network packets like ethernet, udp, tcp,
etc...
The sending of this custom packets is done between processes running
locally.
ie. I get a Ethernet packet, inspect it, then add my custom header and
forward
it to another process that listens to a socket, and expect to get data
wrapped with
this custom header.

What is a good way to go about and implement this thing?

Thanks,
Kfir
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20110117/f9593b16/attachment.html 

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

* Implement custom network protocol for local processes
  2011-01-17 21:24 Implement custom network protocol for local processes Kfir Lavi
@ 2011-01-17 21:43 ` John Mahoney
  2011-01-17 21:52   ` Kfir Lavi
  2011-01-18  9:30 ` Vasiliy Kulikov
  1 sibling, 1 reply; 4+ messages in thread
From: John Mahoney @ 2011-01-17 21:43 UTC (permalink / raw)
  To: kernelnewbies

On Mon, Jan 17, 2011 at 4:24 PM, Kfir Lavi <lavi.kfir@gmail.com> wrote:
> Hi,
> How can one implement custom header network protocol.
> I mean header that wraps regular network packets like ethernet, udp, tcp,
> etc...
> The sending of this custom packets is done between processes running
> locally.
> ie. I get a Ethernet packet, inspect it, then add my custom header and
> forward
> it to another process that listens to a socket, and expect to get data
> wrapped with
> this custom header.
>
> What is a good way to go about and implement this thing?

Have you looked at the tun/tap drivers?

Also, try asking this question on a network specific list.

--
John

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

* Implement custom network protocol for local processes
  2011-01-17 21:43 ` John Mahoney
@ 2011-01-17 21:52   ` Kfir Lavi
  0 siblings, 0 replies; 4+ messages in thread
From: Kfir Lavi @ 2011-01-17 21:52 UTC (permalink / raw)
  To: kernelnewbies

On Mon, Jan 17, 2011 at 11:43 PM, John Mahoney <jmahoney@waav.com> wrote:

> On Mon, Jan 17, 2011 at 4:24 PM, Kfir Lavi <lavi.kfir@gmail.com> wrote:
> > Hi,
> > How can one implement custom header network protocol.
> > I mean header that wraps regular network packets like ethernet, udp, tcp,
> > etc...
> > The sending of this custom packets is done between processes running
> > locally.
> > ie. I get a Ethernet packet, inspect it, then add my custom header and
> > forward
> > it to another process that listens to a socket, and expect to get data
> > wrapped with
> > this custom header.
> >
> > What is a good way to go about and implement this thing?
>
> Have you looked at the tun/tap drivers?
>
> Yes I did, they can work for me, but I need to modify the code.
They expect  certain protocols and are not passing anything.
It is a bit ugly to go this way.

Also, try asking this question on a network specific list.
>
> --
> John
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20110117/092fdcb7/attachment.html 

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

* Implement custom network protocol for local processes
  2011-01-17 21:24 Implement custom network protocol for local processes Kfir Lavi
  2011-01-17 21:43 ` John Mahoney
@ 2011-01-18  9:30 ` Vasiliy Kulikov
  1 sibling, 0 replies; 4+ messages in thread
From: Vasiliy Kulikov @ 2011-01-18  9:30 UTC (permalink / raw)
  To: kernelnewbies

Kfir,

On Mon, Jan 17, 2011 at 23:24 +0200, Kfir Lavi wrote:
> Hi,
> How can one implement custom header network protocol.
> I mean header that wraps regular network packets like ethernet, udp, tcp,
> etc...
> The sending of this custom packets is done between processes running
> locally.
> ie. I get a Ethernet packet, inspect it, then add my custom header and
> forward
> it to another process that listens to a socket, and expect to get data
> wrapped with
> this custom header.

You might want to use datagram-oriented UNIX socket to communicate with
client processes.

Also you have to understand what do you want - getting UDP packets on
specific port doesn't require anything special, just bind()'ing to this
port.  But you can get TCP segments only with SOCK_RAW socket.


Thanks,

-- 
Vasiliy

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

end of thread, other threads:[~2011-01-18  9:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-17 21:24 Implement custom network protocol for local processes Kfir Lavi
2011-01-17 21:43 ` John Mahoney
2011-01-17 21:52   ` Kfir Lavi
2011-01-18  9:30 ` Vasiliy Kulikov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.