Re: [mpls-linux-general] configuring mpls through ioctl()
Status: Beta
Brought to you by:
jleu
|
From: James R. L. <jl...@mi...> - 2004-06-24 01:17:41
|
On Wed, Jun 23, 2004 at 06:09:58PM +0300, Muhammad R. Sami wrote: > Can I issue ioctl system calls from within my libipq application program to > configure MPLS routing from my application, if yes, can anyone please > provide me with some example code on how to perform this task. > Regards, Yes you can. All the example code you should need is in mpls-linux/utils/mplsadm.c > Muhammad R. Sami > Research Assistant, > Computer Engineering Department > P.O.Box 354 > King Fahd University of Petroleum & Minerals > Dhahran 31261 > Saudi Arabia. > Tel: +96638601423 > Cell: +96657982951 > www.ccse.kfupm.edu.sa/sami > > -----Original Message----- > From: James R. Leu [mailto:jl...@mi...] > Sent: Tuesday, June 22, 2004 7:06 PM > To: Muhammad R. Sami > Subject: Re: [mpls-linux-general] packet identification > > All of the mplsadm features can be called via ioctl(). Looking at > the code for mplsadm will give you an example of how to do it. > > On Tue, Jun 22, 2004 at 06:58:27PM +0300, Muhammad R. Sami wrote: > > I want to write an application that can issue mplsadm commands from > within, > > such that I do not have to configure MPLS (labels, LSP, EXP) manually. > Here > > are the steps: > > > > 1- Receive packet from kernel to my application through libipq > > 2- Check packet payload and then decide on NF_ACCEPT/NF_DROP. > > 3- If NF_ACCEPT, then configure MPLS by issuing the mplsadm instructions > > from within the application for all accepted packets. > > > > I might also need to set queuing priority here on the basis of EXP value. > > > > Regards, > > > > Muhammad R. Sami > > Research Assistant, > > Computer Engineering Department > > P.O.Box 354 > > King Fahd University of Petroleum & Minerals > > Dhahran 31261 > > Saudi Arabia. > > Tel: +96638601423 > > Cell: +96657982951 > > www.ccse.kfupm.edu.sa/sami > > -----Original Message----- > > From: James R. Leu [mailto:jl...@mi...] > > Sent: Tuesday, June 22, 2004 6:37 PM > > To: Muhammad R. Sami > > Subject: Re: [mpls-linux-general] packet identification > > > > On Tue, Jun 22, 2004 at 06:18:11PM +0300, Muhammad R. Sami wrote: > > > I am using libipq to manipulate packets at userspace. I want to know > > whether > > > I can issue an mplsadm configuration command from within my application. > > For > > > example, after receiving the packet from the kernel through libipq, I > > would > > > like to set EXP value for all such packets by issuing the set_exp > command > > > from within that application. If this is possible, please let me know > > soon. > > > regards > > > > I'm not sure what you're asking. Are you trying to manipulate the > > packet buffer in userland then send it? Or are you trying to configure > the > > forwarding plan to do the manipulation? > > > > > > > Muhammad R. Sami > > > Research Assistant, > > > Computer Engineering Department > > > P.O.Box 354 > > > King Fahd University of Petroleum & Minerals > > > Dhahran 31261 > > > Saudi Arabia. > > > Tel: +96638601423 > > > Cell: +96657982951 > > > www.ccse.kfupm.edu.sa/sami > > > -----Original Message----- > > > From: James R. Leu [mailto:jl...@mi...] > > > Sent: Monday, June 21, 2004 5:11 PM > > > To: Muhammad R. Sami > > > Subject: Re: [mpls-linux-general] packet identification > > > > > > On Sun, Jun 20, 2004 at 12:48:24PM +0300, Muhammad R. Sami wrote: > > > > You outlined the following steps, require assistance for the > following. > > > > > > > > > > > > > > > > A quick overview of what you will need to setup: > > > > > > > > -bind a IPv4 route to a LSP-----DONE > > > > > > > > -use iptables to identify and mark packets----DONE > > > > > > > > -use the markings to set EXP values (or choose differnt LSPs)----DONE > > > > > > > > -use EXP value to determin queuing priority--------How to do this > part? > > > How > > > > can I assign priority on the basis of EXP bits value? > > > > > > Use the exp2tc or exp2ds instructions then use 'tc' to setup the queues > > and > > > priorities. > > > > > > Look at: > > > > > > http://www.linuxsecurity.com/resource_files/firewalls/Adv-Routing-HOWTO/2.4r > > > outing.html > > > > > > In particular read how to use the TCINDEX. > > > > > > > > > > > > > > > > > > > > > -- > > > James R. Leu > > > jl...@mi... > > > > > > > -- > > James R. Leu > > jl...@mi... > > > > -- > James R. Leu > jl...@mi... > -- James R. Leu jl...@mi... |