Thread: [mpls-linux-general] A smaller network for label stack example
Status: Beta
Brought to you by:
jleu
|
From: <ed...@ti...> - 2004-11-16 17:27:06
Attachments:
schema_rete.jpg
|
Hi i'd like to set a label stack between PCLENTO1 and TOSHIBA (see the atta= chment) After my test should be this: i receive on WINDOWS traffic from 2 host (t= hat represent 2 network) that is destinated to network linked with TOSHIBA and i would that, through my network packets are lab= elled basing on host it come from (packets from host A with a label, packets from be with an other one). How can i do this? I've seen label stack example on mailing list and my answer is: instruct= ion for r3 in the example is for PCLENTO1, those for R4 is for TOSHIBA and noone for R2 in the example, aren't they? Thanks a lots for all help you give me __________________________________________________________________ Tiscali Adsl 2 Mega Free: naviga gratis tutto l'anno! Supera tutti i limiti di velocita' con Tiscali Adsl 2 Mega Free. Sei libero da costi fissi e, se ti abboni entro il 25 novembre, navighi gratis fino al 31 dicembre 2004 e non paghi il costo di adesione.= http://abbonati.tiscali.it/adsl/ |
|
From: James R. L. <jl...@mi...> - 2004-11-16 17:54:32
|
Lets look at the case where you want traffic from different hosts using
different LSPs:
You use iptables to differentiate the traffic from the two different hosts.
iptable -A OUTPUT -s 2.2.2.2/32 -j MARK --set-mark=2
iptable -A OUTPUT -s 3.3.3.3/32 -j MARK --set-mark=3
You then need to make sure you have a route installed for the
destination which points to a NHLFE:
ip route add 4.4.4.4/32 via 192.168.2.1 spec_nh 0x8847 0x4
Where 0x4 is the key for a NHLFE which was created like this:
mplsadm2 -A -O 0
(key 0x2)
mplsadm2 -A -O 0
(key 0x3)
mplsadm2 -A -O 0
(key 0x4)
mplsadm2 -O 0x2 -o push:gen:200:set:eth0:ipv4:192.168.2.1
mplsadm2 -O 0x3 -o push:gen:300:set:eth0:ipv4:192.168.2.1
mplsadm2 -O 0x4 -o nffwd:0xf:0x2:0x2:0x3:0x3
NOTE: the format of the nffwd command is '<mask>:<mark:nhlfe>:<mark:nhlfe>...'
Explaination:
Traffic arrives at the LER with source 2.2.2.2 and destination 4.4.4.4.
Iptables looks at the source and 'marks' the packet with 0x2.
(the mark is internal to the kernel, it is called a nfmark). The packet
continues through the IP stack. At the point of exiting the IP stack
it is redirected to MPLS via the special nexthop 0x4. In the MPLS stack
the NHLFE 0x4 looks to the nfmark on the packet and uses it to forward
it to another NHLFE, if the nfmark is 0x2 the packet is further handled
by NHLFE 0x2. NHLFE 0x2 pushes and label and send that packet.
If you would like to add another level of stacking you could do it two
different ways. Either have NHFLE 0x2 and 0x3 do multiple pushes or you
could have the fwd to another NHLFE which does a push and the final set.
The details of this are left as an excersise for the reader.
On Tue, Nov 16, 2004 at 06:26:56PM +0100, ed...@ti... wrote:
> Hi
> i'd like to set a label stack between PCLENTO1 and TOSHIBA (see the attachment)
> After my test should be this: i receive on WINDOWS traffic from 2 host (that
> represent 2 network) that is destinated to network
> linked with TOSHIBA and i would that, through my network packets are labelled
> basing on host it come from (packets from host A with a label, packets
> from
> be with an other one). How can i do this?
> I've seen label stack example on mailing list and my answer is: instruction
> for r3 in the example is for PCLENTO1, those for R4 is for TOSHIBA and
> noone
> for R2 in the example, aren't they?
> Thanks a lots for all help you give me
>
> __________________________________________________________________
> Tiscali Adsl 2 Mega Free: naviga gratis tutto l'anno!
> Supera tutti i limiti di velocita' con Tiscali Adsl 2 Mega Free.
> Sei libero da costi fissi e, se ti abboni entro il 25 novembre,
> navighi gratis fino al 31 dicembre 2004 e non paghi il costo di adesione.
> http://abbonati.tiscali.it/adsl/
>
>
>
--
James R. Leu
jl...@mi...
|
|
From: <ed...@ti...> - 2004-11-17 10:13:59
|
Many questions for you James, please answer me: 1) when i pass from MPLS to IP i've seen that label space stay already se= tted, how can i remove this setting? (i've tryed mplsadm2 -D -L eth0:0 without success) 2) I've test PHP way, seeing settings of LER (in the last example WINDOWS= ) i've seen that it has already ILM setted, can this setting invalid my tes= t in any way (if i'm right the link between the last LSR and the LER in PHP= way must be all IP, isn't it?) 3) You have told me that "At the point of exiting the IP stack it is redi= rected to MPLS via the special nexthop 0x4." what dooes it mean? NHLFE is an ent= ry in /mpls/out table, can you explain me better? I'd like to send packets from different source to the same destination tr= ough my MPLS network, if i've understtod your explanation you set an LSP with 0X2 NHLFE and an other opne with 0X3, These LSP originate from the source= of traffic to the LER, after you forward these packets trought LSP 0x4. In my intention source and destination of packets are IP hosts, label sta= ck in my idea is made by one from the I-LER to the E-LER and one that explai= n which hosts has generated traffic forwarded. Can you help me? >-- Messaggio Originale -- >From: "James R. Leu" <jl...@mi...> >To: ed...@ti... >Cc: mpl...@li... >Subject: Re: [mpls-linux-general] A smaller network for label stack exam= ple >Reply-To: jl...@mi... >Date: Tue, 16 Nov 2004 11:54:30 -0600 > > >Lets look at the case where you want traffic from different hosts using >different LSPs: > >You use iptables to differentiate the traffic from the two different hos= ts. > > iptable -A OUTPUT -s 2.2.2.2/32 -j MARK --set-mark=3D2 > iptable -A OUTPUT -s 3.3.3.3/32 -j MARK --set-mark=3D3 > >You then need to make sure you have a route installed for the >destination which points to a NHLFE: > > ip route add 4.4.4.4/32 via 192.168.2.1 spec_nh 0x8847 0x4 > >Where 0x4 is the key for a NHLFE which was created like this: > > mplsadm2 -A -O 0 > (key 0x2) > mplsadm2 -A -O 0 > (key 0x3) > mplsadm2 -A -O 0 > (key 0x4) > mplsadm2 -O 0x2 -o push:gen:200:set:eth0:ipv4:192.168.2.1 > mplsadm2 -O 0x3 -o push:gen:300:set:eth0:ipv4:192.168.2.1 > mplsadm2 -O 0x4 -o nffwd:0xf:0x2:0x2:0x3:0x3 > >NOTE: the format of the nffwd command is '<mask>:<mark:nhlfe>:<mark:nhlf= e>...' > >Explaination: > >Traffic arrives at the LER with source 2.2.2.2 and destination 4.4.4.4. >Iptables looks at the source and 'marks' the packet with 0x2. >(the mark is internal to the kernel, it is called a nfmark). The packet= >continues through the IP stack. At the point of exiting the IP stack >it is redirected to MPLS via the special nexthop 0x4. In the MPLS stack= >the NHLFE 0x4 looks to the nfmark on the packet and uses it to forward >it to another NHLFE, if the nfmark is 0x2 the packet is further handled >by NHLFE 0x2. NHLFE 0x2 pushes and label and send that packet. > >If you would like to add another level of stacking you could do it two >different ways. Either have NHFLE 0x2 and 0x3 do multiple pushes or you= >could have the fwd to another NHLFE which does a push and the final set.= >The details of this are left as an excersise for the reader. > > >On Tue, Nov 16, 2004 at 06:26:56PM +0100, ed...@ti... wrote: >> Hi >> i'd like to set a label stack between PCLENTO1 and TOSHIBA (see the attachment) >> After my test should be this: i receive on WINDOWS traffic from 2 host= >(that >> represent 2 network) that is destinated to network >> linked with TOSHIBA and i would that, through my network packets are labelled >> basing on host it come from (packets from host A with a label, packet= s >> from >> be with an other one). How can i do this? >> I've seen label stack example on mailing list and my answer is: instr= uction >> for r3 in the example is for PCLENTO1, those for R4 is for TOSHIBA an= d >> noone >> for R2 in the example, aren't they? >> Thanks a lots for all help you give me >> >> __________________________________________________________________ >> Tiscali Adsl 2 Mega Free: naviga gratis tutto l'anno! >> Supera tutti i limiti di velocita' con Tiscali Adsl 2 Mega Free. >> Sei libero da costi fissi e, se ti abboni entro il 25 novembre, >> navighi gratis fino al 31 dicembre 2004 e non paghi il costo di adesio= ne. >> http://abbonati.tiscali.it/adsl/ >> >> >> > > > >-- >James R. Leu >jl...@mi... > > >------------------------------------------------------- >This SF.Net email is sponsored by: InterSystems CACHE >FREE OODBMS DOWNLOAD - A multidimensional database that combines >robust object and relational technologies, making it a perfect match >for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8 >_______________________________________________ >mpls-linux-general mailing list >mpl...@li... >https://lists.sourceforge.net/lists/listinfo/mpls-linux-general __________________________________________________________________ Tiscali Adsl 2 Mega Free: naviga gratis tutto l'anno! Supera tutti i limiti di velocita' con Tiscali Adsl 2 Mega Free. Sei libero da costi fissi e, se ti abboni entro il 25 novembre, navighi gratis fino al 31 dicembre 2004 e non paghi il costo di adesione.= http://abbonati.tiscali.it/adsl/ |
|
From: James R. L. <jl...@mi...> - 2004-11-17 14:20:12
|
On Wed, Nov 17, 2004 at 11:13:49AM +0100, ed...@ti... wrote: > Many questions for you James, please answer me: > 1) when i pass from MPLS to IP i've seen that label space stay already setted, > how can i remove this setting? (i've tryed mplsadm2 -D -L eth0:0 without > success) mplsadm2 -L eth0:-1 > 2) I've test PHP way, seeing settings of LER (in the last example WINDOWS) > i've seen that it has already ILM setted, can this setting invalid my test > in any way (if i'm right the link between the last LSR and the LER in PHP > way must be all IP, isn't it?) mpls-linux does not do proper PHP. Proper PHP would result in a LSR forwarding an unlabeled IP packet without doing a IP lookup. mpls-linux will always do an IP lookup on unlabeled packet. > 3) You have told me that "At the point of exiting the IP stack it is redirected > to MPLS via the special nexthop 0x4." what dooes it mean? NHLFE is an entry > in /mpls/out table, can you explain me better? I think the best way for you to understand what that means is to read the code. Start looing in linux/net/ipv4/route.c look in the function called rt_set_nexthop(). See how it calls spec_nh->func() in the case of MPLS spec_nh->func() is mpls_set_nexthop() which can be found in linux/net/mpls/mpls_output.c. Notice how mpls_set_nexthop sets dst->child? Now go look at linux/net/ipv4/ip_output.c Look for the function ip_finish_output2(). Notice what happens is dst->child is set? In the case of MPLS dst_output() calls mpls_output() which can be found in linux/net/mpls/mpls_output.c > I'd like to send packets from different source to the same destination trough > my MPLS network, if i've understtod your explanation you set an LSP with > 0X2 NHLFE and an other opne with 0X3, These LSP originate from the source > of traffic to the LER, after you forward these packets trought LSP 0x4. > In my intention source and destination of packets are IP hosts, label stack > in my idea is made by one from the I-LER to the E-LER and one that explain > which hosts has generated traffic forwarded. The example I sent you does exactly that. IP packets from 2 different hosts get sent on different LSPs destined for the same host. > Can you help me? > > > > > > > >-- Messaggio Originale -- > >From: "James R. Leu" <jl...@mi...> > >To: ed...@ti... > >Cc: mpl...@li... > >Subject: Re: [mpls-linux-general] A smaller network for label stack example > >Reply-To: jl...@mi... > >Date: Tue, 16 Nov 2004 11:54:30 -0600 > > > > > >Lets look at the case where you want traffic from different hosts using > >different LSPs: > > > >You use iptables to differentiate the traffic from the two different hosts. > > > > iptable -A OUTPUT -s 2.2.2.2/32 -j MARK --set-mark=2 > > iptable -A OUTPUT -s 3.3.3.3/32 -j MARK --set-mark=3 > > > >You then need to make sure you have a route installed for the > >destination which points to a NHLFE: > > > > ip route add 4.4.4.4/32 via 192.168.2.1 spec_nh 0x8847 0x4 > > > >Where 0x4 is the key for a NHLFE which was created like this: > > > > mplsadm2 -A -O 0 > > (key 0x2) > > mplsadm2 -A -O 0 > > (key 0x3) > > mplsadm2 -A -O 0 > > (key 0x4) > > mplsadm2 -O 0x2 -o push:gen:200:set:eth0:ipv4:192.168.2.1 > > mplsadm2 -O 0x3 -o push:gen:300:set:eth0:ipv4:192.168.2.1 > > mplsadm2 -O 0x4 -o nffwd:0xf:0x2:0x2:0x3:0x3 > > > >NOTE: the format of the nffwd command is '<mask>:<mark:nhlfe>:<mark:nhlfe>...' > > > >Explaination: > > > >Traffic arrives at the LER with source 2.2.2.2 and destination 4.4.4.4. > >Iptables looks at the source and 'marks' the packet with 0x2. > >(the mark is internal to the kernel, it is called a nfmark). The packet > >continues through the IP stack. At the point of exiting the IP stack > >it is redirected to MPLS via the special nexthop 0x4. In the MPLS stack > >the NHLFE 0x4 looks to the nfmark on the packet and uses it to forward > >it to another NHLFE, if the nfmark is 0x2 the packet is further handled > >by NHLFE 0x2. NHLFE 0x2 pushes and label and send that packet. > > > >If you would like to add another level of stacking you could do it two > >different ways. Either have NHFLE 0x2 and 0x3 do multiple pushes or you > >could have the fwd to another NHLFE which does a push and the final set. > >The details of this are left as an excersise for the reader. > > > > > >On Tue, Nov 16, 2004 at 06:26:56PM +0100, ed...@ti... wrote: > >> Hi > >> i'd like to set a label stack between PCLENTO1 and TOSHIBA (see the > attachment) > >> After my test should be this: i receive on WINDOWS traffic from 2 host > >(that > >> represent 2 network) that is destinated to network > >> linked with TOSHIBA and i would that, through my network packets are > labelled > >> basing on host it come from (packets from host A with a label, packets > >> from > >> be with an other one). How can i do this? > >> I've seen label stack example on mailing list and my answer is: instruction > >> for r3 in the example is for PCLENTO1, those for R4 is for TOSHIBA and > >> noone > >> for R2 in the example, aren't they? > >> Thanks a lots for all help you give me > >> > >> __________________________________________________________________ > >> Tiscali Adsl 2 Mega Free: naviga gratis tutto l'anno! > >> Supera tutti i limiti di velocita' con Tiscali Adsl 2 Mega Free. > >> Sei libero da costi fissi e, se ti abboni entro il 25 novembre, > >> navighi gratis fino al 31 dicembre 2004 e non paghi il costo di adesione. > >> http://abbonati.tiscali.it/adsl/ > >> > >> > >> > > > > > > > >-- > >James R. Leu > >jl...@mi... > > > > > >------------------------------------------------------- > >This SF.Net email is sponsored by: InterSystems CACHE > >FREE OODBMS DOWNLOAD - A multidimensional database that combines > >robust object and relational technologies, making it a perfect match > >for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8 > >_______________________________________________ > >mpls-linux-general mailing list > >mpl...@li... > >https://lists.sourceforge.net/lists/listinfo/mpls-linux-general > > > __________________________________________________________________ > Tiscali Adsl 2 Mega Free: naviga gratis tutto l'anno! > Supera tutti i limiti di velocita' con Tiscali Adsl 2 Mega Free. > Sei libero da costi fissi e, se ti abboni entro il 25 novembre, > navighi gratis fino al 31 dicembre 2004 e non paghi il costo di adesione. > http://abbonati.tiscali.it/adsl/ > > > -- James R. Leu jl...@mi... |
|
From: <ed...@ti...> - 2004-11-17 16:19:21
|
>-- Messaggio Originale -- >From: "James R. Leu" <jl...@mi...> I've seen that there is a mail on the mailing list that explain how MPLS for Linux works but i don't remember which it is. I'm going to revisit ma= iling list to find it >To: ed...@ti... >Cc: mpl...@li... >Subject: Re: [mpls-linux-general] A smaller network for label stack exam= ple >Reply-To: jl...@mi... >Date: Wed, 17 Nov 2004 08:20:21 -0600 > > >On Wed, Nov 17, 2004 at 11:13:49AM +0100, ed...@ti... wrote: >> Many questions for you James, please answer me: >> 1) when i pass from MPLS to IP i've seen that label space stay already= >setted, >> how can i remove this setting? (i've tryed mplsadm2 -D -L eth0:0 witho= ut >> success) > >mplsadm2 -L eth0:-1 > >> 2) I've test PHP way, seeing settings of LER (in the last example WIND= OWS) >> i've seen that it has already ILM setted, can this setting invalid my test >> in any way (if i'm right the link between the last LSR and the LER in PHP >> way must be all IP, isn't it?) > >mpls-linux does not do proper PHP. Proper PHP would result in a LSR for= warding >an unlabeled IP packet without doing a IP lookup. mpls-linux will alway= s >do an IP lookup on unlabeled packet. > >> 3) You have told me that "At the point of exiting the IP stack it is redirected >> to MPLS via the special nexthop 0x4." what dooes it mean? NHLFE is an entry >> in /mpls/out table, can you explain me better? > >I think the best way for you to understand what that means is to read th= e >code. >Start looing in linux/net/ipv4/route.c look in the function called >rt_set_nexthop(). See how it calls spec_nh->func() in the case of MPLS >spec_nh->func() is mpls_set_nexthop() which can be found in >linux/net/mpls/mpls_output.c. Notice how mpls_set_nexthop sets dst->chi= ld? >Now go look at linux/net/ipv4/ip_output.c Look for the function >ip_finish_output2(). Notice what happens is dst->child is set? >In the case of MPLS dst_output() calls mpls_output() which can be >found in linux/net/mpls/mpls_output.c > >> I'd like to send packets from different source to the same destination= >trough >> my MPLS network, if i've understtod your explanation you set an LSP wi= th >> 0X2 NHLFE and an other opne with 0X3, These LSP originate from the sou= rce >> of traffic to the LER, after you forward these packets trought LSP 0x4= . >> In my intention source and destination of packets are IP hosts, label stack >> in my idea is made by one from the I-LER to the E-LER and one that exp= lain >> which hosts has generated traffic forwarded. > >The example I sent you does exactly that. IP packets from 2 different hosts >get sent on different LSPs destined for the same host. > >> Can you help me? >> >> >> >> >> >> >> >-- Messaggio Originale -- >> >From: "James R. Leu" <jl...@mi...> >> >To: ed...@ti... >> >Cc: mpl...@li... >> >Subject: Re: [mpls-linux-general] A smaller network for label stack example >> >Reply-To: jl...@mi... >> >Date: Tue, 16 Nov 2004 11:54:30 -0600 >> > >> > >> >Lets look at the case where you want traffic from different hosts usi= ng >> >different LSPs: >> > >> >You use iptables to differentiate the traffic from the two different hosts. >> > >> > iptable -A OUTPUT -s 2.2.2.2/32 -j MARK --set-mark=3D2 >> > iptable -A OUTPUT -s 3.3.3.3/32 -j MARK --set-mark=3D3 >> > >> >You then need to make sure you have a route installed for the >> >destination which points to a NHLFE: >> > >> > ip route add 4.4.4.4/32 via 192.168.2.1 spec_nh 0x8847 0x4 >> > >> >Where 0x4 is the key for a NHLFE which was created like this: >> > >> > mplsadm2 -A -O 0 >> > (key 0x2) >> > mplsadm2 -A -O 0 >> > (key 0x3) >> > mplsadm2 -A -O 0 >> > (key 0x4) >> > mplsadm2 -O 0x2 -o push:gen:200:set:eth0:ipv4:192.168.2.1 >> > mplsadm2 -O 0x3 -o push:gen:300:set:eth0:ipv4:192.168.2.1 >> > mplsadm2 -O 0x4 -o nffwd:0xf:0x2:0x2:0x3:0x3 >> > >> >NOTE: the format of the nffwd command is '<mask>:<mark:nhlfe>:<mark:n= hlfe>...' >> > >> >Explaination: >> > >> >Traffic arrives at the LER with source 2.2.2.2 and destination 4.4.4.= 4. >> >Iptables looks at the source and 'marks' the packet with 0x2. >> >(the mark is internal to the kernel, it is called a nfmark). The pac= ket >> >continues through the IP stack. At the point of exiting the IP stack= >> >it is redirected to MPLS via the special nexthop 0x4. In the MPLS st= ack >> >the NHLFE 0x4 looks to the nfmark on the packet and uses it to forwar= d >> >it to another NHLFE, if the nfmark is 0x2 the packet is further handl= ed >> >by NHLFE 0x2. NHLFE 0x2 pushes and label and send that packet. >> > >> >If you would like to add another level of stacking you could do it tw= o >> >different ways. Either have NHFLE 0x2 and 0x3 do multiple pushes or you >> >could have the fwd to another NHLFE which does a push and the final set. >> >The details of this are left as an excersise for the reader. >> > >> > >> >On Tue, Nov 16, 2004 at 06:26:56PM +0100, ed...@ti... wrote: >> >> Hi >> >> i'd like to set a label stack between PCLENTO1 and TOSHIBA (see th= e >> attachment) >> >> After my test should be this: i receive on WINDOWS traffic from 2 host >> >(that >> >> represent 2 network) that is destinated to network >> >> linked with TOSHIBA and i would that, through my network packets are >> labelled >> >> basing on host it come from (packets from host A with a label, pac= kets >> >> from >> >> be with an other one). How can i do this? >> >> I've seen label stack example on mailing list and my answer is: in= struction >> >> for r3 in the example is for PCLENTO1, those for R4 is for TOSHIBA= >and >> >> noone >> >> for R2 in the example, aren't they? >> >> Thanks a lots for all help you give me >> >> >> >> __________________________________________________________________ >> >> Tiscali Adsl 2 Mega Free: naviga gratis tutto l'anno! >> >> Supera tutti i limiti di velocita' con Tiscali Adsl 2 Mega Free. >> >> Sei libero da costi fissi e, se ti abboni entro il 25 novembre, >> >> navighi gratis fino al 31 dicembre 2004 e non paghi il costo di ade= sione. >> >> http://abbonati.tiscali.it/adsl/ >> >> >> >> >> >> >> > >> > >> > >> >-- >> >James R. Leu >> >jl...@mi... >> > >> > >> >------------------------------------------------------- >> >This SF.Net email is sponsored by: InterSystems CACHE >> >FREE OODBMS DOWNLOAD - A multidimensional database that combines >> >robust object and relational technologies, making it a perfect match >> >for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8 >> >_______________________________________________ >> >mpls-linux-general mailing list >> >mpl...@li... >> >https://lists.sourceforge.net/lists/listinfo/mpls-linux-general >> >> >> __________________________________________________________________ >> Tiscali Adsl 2 Mega Free: naviga gratis tutto l'anno! >> Supera tutti i limiti di velocita' con Tiscali Adsl 2 Mega Free. >> Sei libero da costi fissi e, se ti abboni entro il 25 novembre, >> navighi gratis fino al 31 dicembre 2004 e non paghi il costo di adesio= ne. >> http://abbonati.tiscali.it/adsl/ >> >> >> > >-- >James R. Leu >jl...@mi... > > >------------------------------------------------------- >This SF.Net email is sponsored by: InterSystems CACHE >FREE OODBMS DOWNLOAD - A multidimensional database that combines >robust object and relational technologies, making it a perfect match >for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8 >_______________________________________________ >mpls-linux-general mailing list >mpl...@li... >https://lists.sourceforge.net/lists/listinfo/mpls-linux-general __________________________________________________________________ Tiscali Adsl 2 Mega Free: naviga gratis tutto l'anno! Supera tutti i limiti di velocita' con Tiscali Adsl 2 Mega Free. Sei libero da costi fissi e, se ti abboni entro il 25 novembre, navighi gratis fino al 31 dicembre 2004 e non paghi il costo di adesione.= http://abbonati.tiscali.it/adsl/ |
|
From: James R. L. <jl...@mi...> - 2004-11-17 17:30:22
|
I've CC'ed the mpls-linux-general list On Wed, Nov 17, 2004 at 05:56:32PM +0100, ed...@ti... wrote: > If i've understood what you mean i have to do on WINDOWS (see the attachment) > > iptable -A OUTPUT -s 2.2.2.2/32 -j MARK --set-mark=2 > iptable -A OUTPUT -s 3.3.3.3/32 -j MARK --set-mark=3 > > after > > mplsadm2 -A -O 0 > (key 0x2) > mplsadm2 -A -O 0 > (key 0x3) > mplsadm2 -A -O 0 > (key 0x4) > > ip route add 4.4.4.4/32 via 192.168.2.1 spec_nh 0x8847 0x4 > > then > mplsadm2 -O 0x4 -o nffwd:0xf:0x2:0x2:0x3:0x3 Correct. > then (here is my big doubt) > > when it receive traffic from S1 it gives > > > mplsadm2 -O 0x2 -o push:gen:200:set:eth0:ipv4:192.168.2.1 > > when it receives from S2 > > > mplsadm2 -O 0x3 -o push:gen:300:set:eth0:ipv4:192.168.2.1 > > but how can make it be able to do this choice? > > How it see the MARK 2 and 3? iptables sets the nfmark on the packet as it goes through the kernel. the MPLS instructions nffwd specifically looks at the value of the nfmark and chooses an NHLFE. The parameters to the nffwd instruction indicated how to choose an NHLFE based on the nfmark. In the example above: 0xf indicates that on the first 4 bits of the nfmark should be used (nfmark values 0 - 15) 0x2:0x2 if nfmark == 0x2 then use NHLFE 0x2 0x3:0x3 if nfmark == 0x3 then use NHLFE 0x3 > This is not clear > > -- Messaggio Originale -- > >From: "James R. Leu" <jl...@mi...> > >To: ed...@ti... > >Cc: mpl...@li... > >Subject: Re: [mpls-linux-general] A smaller network for label stack example > >Reply-To: jl...@mi... > >Date: Tue, 16 Nov 2004 11:54:30 -0600 > > > > > >Lets look at the case where you want traffic from different hosts using > >different LSPs: > > > >You use iptables to differentiate the traffic from the two different hosts. > > > > iptable -A OUTPUT -s 2.2.2.2/32 -j MARK --set-mark=2 > > iptable -A OUTPUT -s 3.3.3.3/32 -j MARK --set-mark=3 > > > >You then need to make sure you have a route installed for the > >destination which points to a NHLFE: > > > > ip route add 4.4.4.4/32 via 192.168.2.1 spec_nh 0x8847 0x4 > > > >Where 0x4 is the key for a NHLFE which was created like this: > > > > mplsadm2 -A -O 0 > > (key 0x2) > > mplsadm2 -A -O 0 > > (key 0x3) > > mplsadm2 -A -O 0 > > (key 0x4) > > mplsadm2 -O 0x2 -o push:gen:200:set:eth0:ipv4:192.168.2.1 > > mplsadm2 -O 0x3 -o push:gen:300:set:eth0:ipv4:192.168.2.1 > > mplsadm2 -O 0x4 -o nffwd:0xf:0x2:0x2:0x3:0x3 > > > >NOTE: the format of the nffwd command is '<mask>:<mark:nhlfe>:<mark:nhlfe>...' > > > >Explaination: > > > >Traffic arrives at the LER with source 2.2.2.2 and destination 4.4.4.4. > >Iptables looks at the source and 'marks' the packet with 0x2. > >(the mark is internal to the kernel, it is called a nfmark). The packet > >continues through the IP stack. At the point of exiting the IP stack > >it is redirected to MPLS via the special nexthop 0x4. In the MPLS stack > >the NHLFE 0x4 looks to the nfmark on the packet and uses it to forward > >it to another NHLFE, if the nfmark is 0x2 the packet is further handled > >by NHLFE 0x2. NHLFE 0x2 pushes and label and send that packet. > > > >If you would like to add another level of stacking you could do it two > >different ways. Either have NHFLE 0x2 and 0x3 do multiple pushes or you > >could have the fwd to another NHLFE which does a push and the final set. > >The details of this are left as an excersise for the reader. > > > > > >On Tue, Nov 16, 2004 at 06:26:56PM +0100, ed...@ti... wrote: > >> Hi > >> i'd like to set a label stack between PCLENTO1 and TOSHIBA (see the > attachment) > >> After my test should be this: i receive on WINDOWS traffic from 2 host > >(that > >> represent 2 network) that is destinated to network > >> linked with TOSHIBA and i would that, through my network packets are > labelled > >> basing on host it come from (packets from host A with a label, packets > >> from > >> be with an other one). How can i do this? > >> I've seen label stack example on mailing list and my answer is: instruction > >> for r3 in the example is for PCLENTO1, those for R4 is for TOSHIBA and > >> noone > >> for R2 in the example, aren't they? > >> Thanks a lots for all help you give me > >> > >> __________________________________________________________________ > >> Tiscali Adsl 2 Mega Free: naviga gratis tutto l'anno! > >> Supera tutti i limiti di velocita' con Tiscali Adsl 2 Mega Free. > >> Sei libero da costi fissi e, se ti abboni entro il 25 novembre, > >> navighi gratis fino al 31 dicembre 2004 e non paghi il costo di adesione. > >> http://abbonati.tiscali.it/adsl/ > >> > >> > >> > > > > > > > >-- > >James R. Leu > >jl...@mi... > > > > > >------------------------------------------------------- > >This SF.Net email is sponsored by: InterSystems CACHE > >FREE OODBMS DOWNLOAD - A multidimensional database that combines > >robust object and relational technologies, making it a perfect match > >for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8 > >_______________________________________________ > >mpls-linux-general mailing list > >mpl...@li... > >https://lists.sourceforge.net/lists/listinfo/mpls-linux-general > > > __________________________________________________________________ > Tiscali Adsl 2 Mega Free: naviga gratis tutto l'anno! > Supera tutti i limiti di velocita' con Tiscali Adsl 2 Mega Free. > Sei libero da costi fissi e, se ti abboni entro il 25 novembre, > navighi gratis fino al 31 dicembre 2004 e non paghi il costo di adesione. > http://abbonati.tiscali.it/adsl/ > > > -- James R. Leu jl...@mi... |
|
From: <ed...@ti...> - 2004-11-18 08:15:48
|
Then i statically have to do both following instruction on WINDOWS mplsadm2 -O 0x2 -o push:gen:200:set:eth0:ipv4:192.168.2.1 mplsadm2 -O 0x3 -o push:gen:300:set:eth0:ipv4:192.168.2.1 and after WINDOWS decides basing on source address if use NHLFE 0x2 or 0x= 3 Problem now is for TOSHIBA and PCLENTO1: seeing your example on them i've= to set like ILM 200 and 300, it is strange for me >-- Messaggio Originale -- >From: "James R. Leu" <jl...@mi...> >To: ed...@ti... >Cc: mpl...@li... >Subject: Re: [mpls-linux-general] A smaller network for label stack exam= ple >Reply-To: jl...@mi... >Date: Wed, 17 Nov 2004 11:29:29 -0600 > > >I've CC'ed the mpls-linux-general list > >On Wed, Nov 17, 2004 at 05:56:32PM +0100, ed...@ti... wrote: >> If i've understood what you mean i have to do on WINDOWS (see the atta= chment) >> >> iptable -A OUTPUT -s 2.2.2.2/32 -j MARK --set-mark=3D2 >> iptable -A OUTPUT -s 3.3.3.3/32 -j MARK --set-mark=3D3 >> >> after >> >> mplsadm2 -A -O 0 >> (key 0x2) >> mplsadm2 -A -O 0 >> (key 0x3) >> mplsadm2 -A -O 0 >> (key 0x4) >> >> ip route add 4.4.4.4/32 via 192.168.2.1 spec_nh 0x8847 0x4 >> >> then >> mplsadm2 -O 0x4 -o nffwd:0xf:0x2:0x2:0x3:0x3 > >Correct. > >> then (here is my big doubt) >> >> when it receive traffic from S1 it gives >> >> >> mplsadm2 -O 0x2 -o push:gen:200:set:eth0:ipv4:192.168.2.1 >> >> when it receives from S2 >> >> >> mplsadm2 -O 0x3 -o push:gen:300:set:eth0:ipv4:192.168.2.1 >> >> but how can make it be able to do this choice? >> >> How it see the MARK 2 and 3? > >iptables sets the nfmark on the packet as it goes through the kernel. >the MPLS instructions nffwd specifically looks at the value of the nfmar= k >and chooses an NHLFE. The parameters to the nffwd instruction indicated= >how to choose an NHLFE based on the nfmark. > >In the example above: > >0xf >indicates that on the first 4 bits of the nfmark should be used >(nfmark values 0 - 15) > >0x2:0x2 >if nfmark =3D=3D 0x2 then use NHLFE 0x2 > >0x3:0x3 >if nfmark =3D=3D 0x3 then use NHLFE 0x3 > > >> This is not clear >> >> -- Messaggio Originale -- >> >From: "James R. Leu" <jl...@mi...> >> >To: ed...@ti... >> >Cc: mpl...@li... >> >Subject: Re: [mpls-linux-general] A smaller network for label stack example >> >Reply-To: jl...@mi... >> >Date: Tue, 16 Nov 2004 11:54:30 -0600 >> > >> > >> >Lets look at the case where you want traffic from different hosts usi= ng >> >different LSPs: >> > >> >You use iptables to differentiate the traffic from the two different hosts. >> > >> > iptable -A OUTPUT -s 2.2.2.2/32 -j MARK --set-mark=3D2 >> > iptable -A OUTPUT -s 3.3.3.3/32 -j MARK --set-mark=3D3 >> > >> >You then need to make sure you have a route installed for the >> >destination which points to a NHLFE: >> > >> > ip route add 4.4.4.4/32 via 192.168.2.1 spec_nh 0x8847 0x4 >> > >> >Where 0x4 is the key for a NHLFE which was created like this: >> > >> > mplsadm2 -A -O 0 >> > (key 0x2) >> > mplsadm2 -A -O 0 >> > (key 0x3) >> > mplsadm2 -A -O 0 >> > (key 0x4) >> > mplsadm2 -O 0x2 -o push:gen:200:set:eth0:ipv4:192.168.2.1 >> > mplsadm2 -O 0x3 -o push:gen:300:set:eth0:ipv4:192.168.2.1 >> > mplsadm2 -O 0x4 -o nffwd:0xf:0x2:0x2:0x3:0x3 >> > >> >NOTE: the format of the nffwd command is '<mask>:<mark:nhlfe>:<mark:n= hlfe>...' >> > >> >Explaination: >> > >> >Traffic arrives at the LER with source 2.2.2.2 and destination 4.4.4.= 4. >> >Iptables looks at the source and 'marks' the packet with 0x2. >> >(the mark is internal to the kernel, it is called a nfmark). The pac= ket >> >continues through the IP stack. At the point of exiting the IP stack= >> >it is redirected to MPLS via the special nexthop 0x4. In the MPLS st= ack >> >the NHLFE 0x4 looks to the nfmark on the packet and uses it to forwar= d >> >it to another NHLFE, if the nfmark is 0x2 the packet is further handl= ed >> >by NHLFE 0x2. NHLFE 0x2 pushes and label and send that packet. >> > >> >If you would like to add another level of stacking you could do it tw= o >> >different ways. Either have NHFLE 0x2 and 0x3 do multiple pushes or you >> >could have the fwd to another NHLFE which does a push and the final set. >> >The details of this are left as an excersise for the reader. >> > >> > >> >On Tue, Nov 16, 2004 at 06:26:56PM +0100, ed...@ti... wrote: >> >> Hi >> >> i'd like to set a label stack between PCLENTO1 and TOSHIBA (see th= e >> attachment) >> >> After my test should be this: i receive on WINDOWS traffic from 2 host >> >(that >> >> represent 2 network) that is destinated to network >> >> linked with TOSHIBA and i would that, through my network packets are >> labelled >> >> basing on host it come from (packets from host A with a label, pac= kets >> >> from >> >> be with an other one). How can i do this? >> >> I've seen label stack example on mailing list and my answer is: in= struction >> >> for r3 in the example is for PCLENTO1, those for R4 is for TOSHIBA= >and >> >> noone >> >> for R2 in the example, aren't they? >> >> Thanks a lots for all help you give me >> >> >> >> __________________________________________________________________ >> >> Tiscali Adsl 2 Mega Free: naviga gratis tutto l'anno! >> >> Supera tutti i limiti di velocita' con Tiscali Adsl 2 Mega Free. >> >> Sei libero da costi fissi e, se ti abboni entro il 25 novembre, >> >> navighi gratis fino al 31 dicembre 2004 e non paghi il costo di ade= sione. >> >> http://abbonati.tiscali.it/adsl/ >> >> >> >> >> >> >> > >> > >> > >> >-- >> >James R. Leu >> >jl...@mi... >> > >> > >> >------------------------------------------------------- >> >This SF.Net email is sponsored by: InterSystems CACHE >> >FREE OODBMS DOWNLOAD - A multidimensional database that combines >> >robust object and relational technologies, making it a perfect match >> >for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8 >> >_______________________________________________ >> >mpls-linux-general mailing list >> >mpl...@li... >> >https://lists.sourceforge.net/lists/listinfo/mpls-linux-general >> >> >> __________________________________________________________________ >> Tiscali Adsl 2 Mega Free: naviga gratis tutto l'anno! >> Supera tutti i limiti di velocita' con Tiscali Adsl 2 Mega Free. >> Sei libero da costi fissi e, se ti abboni entro il 25 novembre, >> navighi gratis fino al 31 dicembre 2004 e non paghi il costo di adesio= ne. >> http://abbonati.tiscali.it/adsl/ >> >> >> > > > >-- >James R. Leu >jl...@mi... > > >------------------------------------------------------- >This SF.Net email is sponsored by: InterSystems CACHE >FREE OODBMS DOWNLOAD - A multidimensional database that combines >robust object and relational technologies, making it a perfect match >for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8 >_______________________________________________ >mpls-linux-general mailing list >mpl...@li... >https://lists.sourceforge.net/lists/listinfo/mpls-linux-general __________________________________________________________________ Tiscali Adsl 2 Mega Free: naviga gratis tutto l'anno! Supera tutti i limiti di velocita' con Tiscali Adsl 2 Mega Free. Sei libero da costi fissi e, se ti abboni entro il 25 novembre, navighi gratis fino al 31 dicembre 2004 e non paghi il costo di adesione.= http://abbonati.tiscali.it/adsl/ |