Networking Forums

Networking Forums > Computer Networking > Linux Networking > linux kernel 2.6 packet travel

Reply
Thread Tools Display Modes

linux kernel 2.6 packet travel

 
 
Giacomo
Guest
Posts: n/a

 
      07-01-2005, 11:47 AM
Good morning, i'm a student who, for study purpose, is writing a simple
firewall in linux kernel.
While i've understood the travel an input packet does when enters the linux
kernel, i would like to know what functions are involved in output sending.

I put the hooks to my functions where i found already existing netfilter
hooks and this is the problem:

- while the number of packets traversing input and prerouting hooks is the
same, and all packets incoming pass through the hooks (in the simple case of
2 computer connected without forwarding), the number of packets that appear
in postrouting hook is much grater that the number of packets which i see in
output hooks!

Then i noticed that in ip_output.c, there are many netfilter hooks... and i
was wondering if i should put my hooks everywhere there is a netfilter hook.

First of all, anyway, I would like to count all packets locally generated by
my applications, such as ssh or telnet or ping or nmap, and verify that all
them pass through output AND postrouting hooks.

Thanks a lot to anyone who can tell me any suggestion about packet handling
in linux kernel.

PS: i am running kernel 2.6.11.

thanks in advance

Giacomo Strangolino.


 
Reply With Quote
 
 
 
 
Alexander Harsch
Guest
Posts: n/a

 
      07-01-2005, 03:47 PM
Giacomo wrote:

> Good morning, i'm a student who, for study purpose, is writing a simple
> firewall in linux kernel.
> While i've understood the travel an input packet does when enters the
> linux kernel, i would like to know what functions are involved in output
> sending.
>
> I put the hooks to my functions where i found already existing netfilter
> hooks and this is the problem:
>
> - while the number of packets traversing input and prerouting hooks is the
> same, and all packets incoming pass through the hooks (in the simple case
> of 2 computer connected without forwarding), the number of packets that
> appear in postrouting hook is much grater that the number of packets which
> i see in output hooks!

Outgoing packets: outgoing hook, postrouting hook
Forwarded packets: pre-, input-,postrouting hook
So packets in the postrouting hook, hooks outgoing and forwarded packets.
>
> Then i noticed that in ip_output.c, there are many netfilter hooks... and
> i was wondering if i should put my hooks everywhere there is a netfilter
> hook.

Nope, use the points you can access using Netfilter. Read Rustys Manual.
>
> First of all, anyway, I would like to count all packets locally generated
> by my applications, such as ssh or telnet or ping or nmap, and verify that
> all them pass through output AND postrouting hooks.

Just do it!
>
> Thanks a lot to anyone who can tell me any suggestion about packet
> handling in linux kernel.
>

Alex
> PS: i am running kernel 2.6.11.
>
> thanks in advance
>
> Giacomo Strangolino.


 
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Pktgen - Linux Kernel Packet Generator ynnadmai@gmail.com Linux Networking 0 06-05-2009 04:45 AM
libpcap packet capture in kernel space or usermod in linux?? xzen Linux Networking 0 06-23-2008 03:28 AM
Network packet loss possible inside the linux kernel? Daniel Kay Linux Networking 5 09-24-2007 06:15 PM
how many packet types can travel on Ethernet network? linux.lover Linux Networking 2 01-23-2005 10:33 PM
What is MAX size allocated to packet in kernel??? linux.lover Linux Networking 0 01-10-2005 01:56 PM



1 2 3 4 5 6 7 8 9 10 11