How to query Kernel how it would route packets?

How to query Kernel how it would route packets?

Post by Thomas Herzo » Sun, 16 Oct 2005 01:43:46



Hi, together,

I am currently developing a Signaling Protocol instance, which will
signal along a IP "Flow".

Thus I have addressing information the like

"Flow Source IP"/"Flow Destination IP"

Now I want to query the Linux kernel, how it woul route Pakets with that
source and destination. (This is essential to me, as I must not use
other interfaces than these, which are used for the flow, and a router
would have many of them *ggg*)

I found that the program "ip" is able to do such queries
("ip route get 10.10.0.1 from 10.10.0.6"),
but I found still no way to query the kernel programmatically from a C++
  program.

Has anyone some hints to as where to look for information or even a
solution?

"man 7 ip" and referenced manpages did not help thus far...

Many thanks,
Thomas

 
 
 

How to query Kernel how it would route packets?

Post by buck » Sun, 16 Oct 2005 03:16:51


On Fri, 14 Oct 2005 18:43:46 +0200, Thomas Herzog


>Hi, together,

>I am currently developing a Signaling Protocol instance, which will
>signal along a IP "Flow".

>Thus I have addressing information the like

>"Flow Source IP"/"Flow Destination IP"

>Now I want to query the Linux kernel, how it woul route Pakets with that
>source and destination. (This is essential to me, as I must not use
>other interfaces than these, which are used for the flow, and a router
>would have many of them *ggg*)

>I found that the program "ip" is able to do such queries
>("ip route get 10.10.0.1 from 10.10.0.6"),
>but I found still no way to query the kernel programmatically from a C++
>  program.

>Has anyone some hints to as where to look for information or even a
>solution?

>"man 7 ip" and referenced manpages did not help thus far...

>Many thanks,
>Thomas

I haven't looked at it, but perhaps this will help?
http://www.coverfire.com/lql/

--
buck

 
 
 

How to query Kernel how it would route packets?

Post by David Goodenoug » Sun, 16 Oct 2005 03:54:16



> Hi, together,

> I am currently developing a Signaling Protocol instance, which will
> signal along a IP "Flow".

> Thus I have addressing information the like

> "Flow Source IP"/"Flow Destination IP"

> Now I want to query the Linux kernel, how it woul route Pakets with that
> source and destination. (This is essential to me, as I must not use
> other interfaces than these, which are used for the flow, and a router
> would have many of them *ggg*)

> I found that the program "ip" is able to do such queries
> ("ip route get 10.10.0.1 from 10.10.0.6"),
> but I found still no way to query the kernel programmatically from a C++
>   program.

> Has anyone some hints to as where to look for information or even a
> solution?

> "man 7 ip" and referenced manpages did not help thus far...

> Many thanks,
> Thomas

Use the Source Luke.  The source of ip that is.

David
_________________________________________
Usenet Zone Free Binaries Usenet Server
More than 140,000 groups
Unlimited download
http://www.usenetzone.com to open account

 
 
 

How to query Kernel how it would route packets?

Post by thomas.her.. » Thu, 20 Oct 2005 20:21:09



> Use the Source Luke.  The source of ip that is.

> David

Thanks for the hint ;-)

I hoped not to have to do it, as core utilities in Linux tend to be
developed by the ultimate hackers and the chance for "normal people" to
understand these is somewhat limited *ggg*

But I will have a look at it, as it seems there is no other way :-)

 
 
 

How to query Kernel how it would route packets?

Post by David Goodenoug » Fri, 21 Oct 2005 02:40:29




>> Use the Source Luke.  The source of ip that is.

>> David

> Thanks for the hint ;-)

> I hoped not to have to do it, as core utilities in Linux tend to be
> developed by the ultimate hackers and the chance for "normal people" to
> understand these is somewhat limited *ggg*

> But I will have a look at it, as it seems there is no other way :-)

Well you can always look in the source and find the author, or at least
the last person who messed with it, and try asking them.

David
_________________________________________
Usenet Zone Free Binaries Usenet Server
More than 140,000 groups
Unlimited download
http://www.usenetzone.com to open account

 
 
 

1. Linux routing & packet read query!

Hi,
I believe , each incoming packet in a Linux box would consult the
routing stack & then be routed out of the resolved o/p interface.(analogous to a
router)

I need to load a kernel loadable module at each o/p interface to
capture all outgoing packets (after they have consulted the routing
stack), queue them according to some priority & then schedule them for
transmission.
IS THIS POSSIBLE ?? If yes, how do I do it?

Plus would there be any conflict between the separate modules while
taking their respective packets ?

This means that I have to recieve packets from the IP layer. Is there
any particular section of code in the 2.4 kernel source code -- which
could give me a clue.

Thanks in advance,
Rajat.

==================================
Poster's IP address: 202.177.132.140
Posted via http://nodevice.com
Linux Programmer's Site

2. COLA FAQ 3 of 7 06-Sep-2002

3. How to compile driver into kernel?

4. Routing problem with source-based routing and routing packets back to sender machine.

5. bttv: readee error, no picture but sound

6. query about sending udp packets in kernel mode

7. unresolved symbols when trying to install ppp.o module (RH 5.0 2.0.34)

8. Newbie Routing Query (Dual routes)

9. Routing: can linux listen for packets and route them to a machine other than itself?

10. route packet based on incoming interface, not by routing table??

11. Odd routing behaviour on return route for packets under 2.0.33

12. routing question - is it possible to route based on destination port of the packet?