Skip to contentSkip to conversation

Generating pseudo-packets with netfilter

DISCUSSION Dai MIKURUBE 1 participant 2 messages Dec 19, 2006

lore
Share & tools
lore
#0 lore raw

Hi,

I'm a student at Tokyo Institute of Technology.

I'd like to do following operations, and I thought do them with netfilter. But I don't know hot to do this actually.

Could you tell me...
- Can I do the following operations with netfilter?
- If I can, how to do them?

My purpose is to make the Linux Kernel believe that a packet has come. (In fact, any packet has not arrived.)

I could do this without netfilter but with tunneling device as follows.

[Any UserProcess] - [Kernel] - <Tunnel> - [Intermediate Process] - <Physical eth0>

"Intermediate Process" usually passes any packet through, and send a packet into "Kernel" via "Tunnel" if necessary.

Finally, I'd like to do this without tunneling device as follows.

[Any UserProcess] - [Kernel] - ((???)) - [Physical eth0]

At first, I thought that netfilter can act as ((???)) with my Kernel Module. But netfilter seems to be not able to generate packets out of nothing...

Can I do this with netfilter?
# If not, I'd like to know another way to do this... :-(

Thanks,

Signature · 2 lines
Dai MIKURUBE
   [email protected]
#1 lore raw

Hi,

I make a supplementary explanation.

Finally, my purpose is to make "Pseudo 3-Way Handshake".

At first, a user process create a socket (with socket()) and make it TCP_LISTEN (with listen()).

Next, I'd like to make it's status CONNECTED without any external computers for some reason. In order to do this, it's necessary that the Linux Kernel believes a SYN packet has come. So, of cource, to handle a SYN+ACK pakcet and to reply an ACK packet are required.

If netfilter cannot generate packets out of nothing, I think to take the following way:

1. My module call netif_receive_skb() directly to send a SYN packet.
2. Kernel replys a SYN+ACK packet,
and my module catches it with netfilter.
3. My module DROPs the packet,
and my module replys an ACK packet with netif_receive_skb().

But it seems to be a little hard. I'm happy if it can be done with netfilter.

Signature · 2 lines
Dai MIKURUBE
   [email protected]