Re: [mpls-linux-devel] About mpls-packet to ip-packet process
Status: Beta
Brought to you by:
jleu
From: 刘磊 <orp...@ms...> - 2008-05-04 03:37:35
|
Thank you first. I was follow the example "IPv4 over MPLS: two LER example for mpls-linux-1.95x". And had follow config. ________________________________________________________________________________________________ 172.16.0.0/24 10.0.0.1/32 | 10.0.0.2/32 dummy0 | dummy0 | | | -----------eth1 eth1------eth2 v eth2------eth3 eth3-------- | HOST A |------------| LER1 |--------------------------| LER2 |---------| HOST B | -----------.1 ^ 2------.2 3------.3 ^ 4----------- | | | | 192.168.0.0/24 192.168.1.0/24 __________________________________________________________________________________________________ HOST A ------ ip route add 10.0.0.2/32 via 192.168.0.2 src 10.0.0.1 LER1 ----- mpls nhlfe add key 0 instructions push gen 1000 nexthop eth2 ipv4 172.16.0.3 (returns key 0x2) ip route add 10.0.0.2/32 via 172.16.0.3 mpls 0x2 echo 1> /proc/sys/net/ipv4/ip_forward mpls labelspace set dev eth2 labelspace 0 mpls ilm add label gen 2000 labelspace 0 mpls nhlfe add key 0 instructions nexthop eth1 ipv4 192.168.0.1 (returns key 0x3) mpls xc add ilm_label gen 2000 ilm_labelspace 0 nhlfe_key 0x3 LER2 ----- mpls labelspace set dev eth2 labelspace 0 mpls ilm add label gen 1000 labelspace 0 <-------------------Had set this mpls nhlfe add key 0 instructions nexthop eth3 ipv4 192.168.1.4 (returns key 0x2) mpls xc add ilm_label gen 1000 ilm_labelspace 0 nhlfe_key 0x2 mpls nhlfe add key 0 instructions push gen 2000 nexthop eth2 ipv4 172.16.0.2 (returns key 0x3) ip route add 10.0.0.1/32 via 172.16.0.2 mpls 0x3 echo 1> /proc/sys/net/ipv4/ip_forward HOST B ------ ip route add 10.0.0.1/32 via 192.168.1.3 src 10.0.0.2 _________________________________________________________________________________________________________________ BUT, the packet from HOST A to HOST B does not through the IP stack on LER2. Is't my config error? And another problem for quagga, that the patch file quagga-mpls.diff can not patch to quagga-0.99.9 (latest unstable release) or quagga-0.98.6 (latest stable release). Do you have the new patch file? Thank you for help. ---------------------------------------- > Date: Thu, 1 May 2008 12:35:52 -0500 > From: jl...@mi... > To: @mindspring.com > CC: mpl...@li... > Subject: Re: [mpls-linux-devel] About mpls-packet to ip-packet process > > On Thu, May 01, 2008 at 03:55:33PM +0000, =?GB2312?B?wfXA2iA8b3JwaGVuX2xlaWxpdUBtc24uY29tPg==?= wrote: >> >> I'm sorry for my poor english. >> Just like the follow instance. >> >> < Client Router>-------| LER |--------{ MPLS NETWORK } >> >> The packet from Client got into MPLS NETWORK, will through 'ip_rcv, ip_rcv_finish (ip_route_input ip_route_input_slow ip_mkroute_input __mkroute_input rt_set_nexthop mpls_set_nexthop mpl_set_nexthop2) ip_forward ip_forward_finish ip_output ip_finish_output ip_finish_output2 mpls_output mpls_output_shim mpls_output2 mpls_send'. Am I right? >> And the packet from MPLS NETWORK to client, will through 'mpls_skb_recv mpls_input mpls_switch mpls_output2 mpls_send neighbour->output'. >> If I want to the packet out from mpls_send got into ip_rcv ......, how to config it? >> "mpls nhlfe add key 0 instruction pop nexthop ethX ipv4 (Client Router's IP)"? Right? > > This is a PHP config, IE no IPv4 route lookup is being done on the LER > when the packet goes from MPLS to IPv4. > > For the packet to go through the IPv4 stack you will want your > ILM to be something like: > > mpls ilm add label gen 200 labelspace 0 > > That is it. The default instruction on a ILM are "pop peek". > Which results in mpls_input() returning MPLS_RESULT_DLV which > ends up with the packet being handle via the IPv4 protocol driver's > (net/ipv4/mpls4.c) local_deliver function. > >> ---------------------------------------- >>> Date: Thu, 1 May 2008 06:45:41 -0500 >>> From: jl...@mi... >>> To: @mindspring.com >>> CC: mpl...@li... >>> Subject: Re: [mpls-linux-devel] About mpls-packet to ip-packet process >>> >>> Just to make sure I understand what you're trying to do: >>> >>> You want to get hooked into the PREROUTE netfilter chain for packets >>> coming to a LER from MPLS. To do this the normal 'pop peek' instructions >>> should work just. If you want to 'force' the trasistion from MPLS to >>> IPv4 for packets coming to a LER from MPLS you can use the 'deliver' >>> instruction on the associated ILM. >>> >>> On Thu, May 01, 2008 at 10:44:42AM +0000, =?GB2312?B?wfXA2iA8b3JwaGVuX2xlaWxpdUBtc24uY29tPg==?= wrote: >>>> >>>> I was follow the example of "IPv4 over MPLS: two LER example for mpls-linux-1.95x". >>>> Do you means I have to change the "mpls nhlfe add key 0 instructions nexthop eth3 ipv4 192.168.1.4 >>>> (returns key 0x2)" to "mpls nhlfe add key 0 instructions deliver nexthop eth3 ipv4 192.168.1.4 >>>> (returns key 0x2)" ? >>>> >>>> ---------------------------------------- >>>>> Date: Wed, 30 Apr 2008 21:16:22 -0500 >>>>> From: jl...@mi... >>>>> To: @mindspring.com >>>>> CC: mpl...@li... >>>>> Subject: Re: [mpls-linux-devel] About mpls-packet to ip-packet process >>>>> >>>>> Hmm. I think you are looking at the PHP code. Take a look at >>>>> the 'deliver' instruction. It will show you that packets destined from >>>>> IPv4 may be configured to go through 'ip_rcv' which will result in >>>>> the packet travesing all of the IPv4 netfilter hooks. >>>>> >>>>> On Wed, Apr 30, 2008 at 03:56:51AM +0000, =?GB2312?B?wfXA2iA8b3JwaGVuX2xlaWxpdUBtc24uY29tPg==?= wrote: >>>>>> >>>>>> Hi all: >>>>>> I found that the packet which from ip stack to mpls stack in the ip_finish_output2 had passed POSTROUTING hook in netfilter. >>>>>> BUT the packet from mpls stack to ip stack just use neighbour->output, which NOT hook in PREROUTING in netfilter. >>>>>> >>>>>> In this way, if I do SNAT for ip packet and send into mpls stack, will NOT do Un-SNAT for the reply packet. >>>>>> >>>>>> Is my understand right? How to solved it? >>>>>> _________________________________________________________________ >>>>>> 用手机MSN聊天写邮件看空间,无限沟通,分享精彩! >>>>>> http://mobile.msn.com.cn/ >>>>>> >>>>> >>>>>> ------------------------------------------------------------------------- >>>>>> This SF.net email is sponsored by the 2008 JavaOne(SM) Conference >>>>>> Don't miss this year's exciting event. There's still time to save $100. >>>>>> Use priority code J8TL2D2. >>>>>> http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone >>>>>> _______________________________________________ >>>>>> mpls-linux-devel mailing list >>>>>> mpl...@li... >>>>>> https://lists.sourceforge.net/lists/listinfo/mpls-linux-devel >>>>> >>>>> >>>>> -- >>>>> James R. Leu >>>>> jl...@mi... >>>> >>>> _________________________________________________________________ >>>> MSN 中文网,最新时尚生活资讯,白领聚集门户。 >>>> http://cn.msn.com >>> >>> -- >>> James R. Leu >>> jl...@mi... >> >> _________________________________________________________________ >> MSN 中文网,最新时尚生活资讯,白领聚集门户。 >> http://cn.msn.com > > -- > James R. Leu > jl...@mi... _________________________________________________________________ MSN 中文网,最新时尚生活资讯,白领聚集门户。 http://cn.msn.com |