Thread: [mpls-linux-general] MPLS-Diffserv Instructions
Status: Beta
Brought to you by:
jleu
From: ncc49a <nc...@si...> - 2002-02-20 04:03:32
|
Hi James and Stefano, On a MPLS edge Linux router, I executed the exp2ds instruction for an incoming MPLS label with a premarked EXP field. I think I should see a outgoing packet from the non-MPLS interface with its DSCP field marked accordingly right? But no further forwarding of the packet occurs, i.e the now non- mpls packet does not "leave" the outgoing non-mpls interface. Have u guys encountered this problem before? I have tested.. set_exp, ds2exp works fine.. Haven't tested exp2tc yet though... Anyone knows how to check the actual value of the tc_index from user space? Thanks! Regards, Paul |
From: Stefano A. <avi...@li...> - 2002-02-21 11:43:53
|
Hi Paul and all, On Wed, 20 Feb 2002, ncc49a wrote: > Hi James and Stefano, > > On a MPLS edge Linux router, I executed the exp2ds > instruction for an incoming MPLS label with a premarked EXP > field. > > I think I should see a outgoing packet from the non-MPLS > interface with its DSCP field marked accordingly right? But > no further forwarding of the packet occurs, i.e the now non- > mpls packet does not "leave" the outgoing non-mpls > interface. > > Have u guys encountered this problem before? > Try to include pop instruction before exp2ds instruction, e.g. : mplsadm2 -I gen:100:0 -i pop:exp2ds:1:0x2e:peek In this way it works. This is probably due to the fact that the kernel function used to set DS field doesn't work on packets having the MPLS header. > I have tested.. set_exp, ds2exp works fine.. Haven't > tested exp2tc yet though... Anyone knows how to check the > actual value of the tc_index from user space? > Try to use the dsmark queueing discipline (without setting the set_tc_index parameter) combined with the tcindex filter. tcindex filter classifies packets based on skb->tc_index value and dsmark qdisc can set a different DS field value for the packets of each class (i.e. having the same skb->tc_index value). So looking at the output DS field value, you can check the actual value of skb->tc_index. Let me know if I have helped you Stefano > Thanks! > > Regards, > > Paul > > > _______________________________________________ > mpls-linux-general mailing list > mpl...@li... > https://lists.sourceforge.net/lists/listinfo/mpls-linux-general |
From: ncc49a <nc...@si...> - 2002-02-22 13:29:06
|
Hi Stefano, James and all, Stefano, when I put executed the "pop" before the exp2ds, it worked!! Thanks! However, I encountered another problem. 1) The exp->ds mapping is sometimes reflected incorrectly in the "/proc/mpls_*" files. 2) To test the exp2ds function, I have set up a couple of MPLS routers in serial, with non-MPLS hosts/routers at each ends. I then ping an end host from the other end. The non-Mpls host/router which is the origin will mark a packet's DSCP. The edge MPLS router will mark the EXP bits based on the DSCP value. The edge MPLS router at the end will re-mark the DSCP of the incoming packet, based on its EXP. As the packet returns, it will mark the outgoing EXP bits based on the new DSCP. The origin MPLS edge router will then remark the DSCP (again) based on the incoming new EXP bits. I monitor at the origin MPLS router's interfaces. I find that the new EXP bits on the shim of the returned incoming ping packet is correct. However,the returning packet on the outgoing interface of the origin MPLS edge (connected to the origin non-MPLS host/router) has its DSCP bits marked wrongly. Anyone knows what could be a possible reason? I have also tried the exp2tc.. function. I ran the following script. I think dsmark works like that: NEW_DS_FIELD = (tc_index & MASK) | VALUE. So with a MASK of 0xff and a VALUE of 0, I can check exp2tc function by setting the tc_index to the required DS field value, such that I get the desired DSCP value right? -----------------------------------SCRIPT STARTS-------------------------------------------------------- #!/bin/sh TC=tc ITF=eth1 DEST=192.168.0.1 # NEW_DS_FIELD = (tc_index & MASK) | VALUE # EF -> DSCP:0x2e DS:0xb8 # AF31-> DSCP: 0x1a DS:0x68 # AF21 -> DSCP:0x12 DS:0x48 MASK1=0xff VALUE1=0x0 $TC qdisc del dev $ITF root $TC qdisc add dev $ITF handle 1:0 root dsmark indices 64 $TC class change dev $ITF classid 1:1 dsmark mask $MASK1 value $VALUE1 $TC filter add dev $ITF parent 1:0 protocol ip prio 4 handle 1: u32 divisor 1 $TC filter add dev $ITF parent 1:0 prio 4 u32 \ match ip dst $DEST \ police rate 3Mbit burst 2K continue \ flowid 1:1 ------------------------------SCRIPT ENDS---------------------------------------------------- I have an incoming packet with label 199 and its EXP bit marked accordingly, to say 2. I execute the following command to set an incoming label. mplsadm2 -v -A -I gen:199:0 mplsadm2 -v -I gen:199:0 -i pop:exp2tc:2:184:peek As 184 is 0xb8, I should get a DS field of 0xb8 and a DSCP of 0x2e (EF), right? But, I don't. The whole DS field remains unmarked. I have tried : mplsadm2 -v -I gen:199:0 -i exp2tc:2:184:pop:peek But I dun think that worked either. Stefano, have u tried out the exp2tc function? I may have missed out things or did things wrongly... Do please correct me.. I will appreciate it greatly! Also, regarding counter support provided in /proc/net/mpls_* files. 1) Just to confirm, they are in this order -> pkts/bytes/drops ? 2) May I find out if anyone have verified these figures? Because I have tried comparing the figures of "mpls_in" of one MPLS edge router with the "mpls_out" of the MPLS edge router at the other end, when the only traffic between the 2 routers are ICMP ping packets. They do often differ. Maybe I have misunderstood what the actual figures in the /proc/net/mpls_* measure... Can anyone correct me? Sorry for the LONG mail post...:) Thanks a lot in advance. Regards, Paul |
From: Stefano A. <avi...@li...> - 2002-02-25 16:28:04
|
Hi Paul and all, On Friday 22 February 2002 14:31, ncc49a wrote: > Hi Stefano, James and all, > > Stefano, when I put executed the "pop" before the exp2ds, it worked!! > Thanks! > > However, I encountered another problem. > 1) The exp->ds mapping is sometimes reflected incorrectly in the > "/proc/mpls_*" files. Could you provide any example ? > 2) To test the exp2ds function, I have set up a couple of MPLS routers > in serial, with non-MPLS hosts/routers at each ends. I then ping an end > host from the other end. The non-Mpls host/router which is the origin will > mark a packet's DSCP. The edge MPLS router will mark the EXP bits based on > the DSCP value. The edge MPLS router at the end will re-mark the DSCP of > the incoming packet, based on its EXP. As the packet returns, it will mark > the outgoing EXP bits based on the new DSCP. The origin MPLS edge router > will then remark the DSCP (again) based on the incoming new EXP bits. > > I monitor at the origin MPLS router's interfaces. I find that the > new EXP bits on the shim of the returned incoming ping packet is correct. > However,the returning packet on the outgoing interface of the origin MPLS > edge (connected to the origin non-MPLS host/router) has its DSCP bits > marked wrongly. > > Anyone knows what could be a possible reason? > It seems strange to me. Have you checked that /proc/net/mpls_* content reflects what you want to do ? Anyway, you should provide more information (e.g. the commands you typed and what instead you obtain) to let someone help you. > I have also tried the exp2tc.. function. I ran the following script. I > think dsmark works like that: NEW_DS_FIELD = (tc_index & MASK) | VALUE. So > with a MASK of 0xff and a VALUE of 0, I can check exp2tc function by > setting the tc_index to the required DS field value, such that I get the > desired DSCP value right? No, this is right : New_DS_field = (Old_DS_field & Mask) | Value. > > -----------------------------------SCRIPT > STARTS-------------------------------------------------------- > #!/bin/sh > TC=tc > ITF=eth1 > DEST=192.168.0.1 > # NEW_DS_FIELD = (tc_index & MASK) | VALUE > # EF -> DSCP:0x2e DS:0xb8 > # AF31-> DSCP: 0x1a DS:0x68 > # AF21 -> DSCP:0x12 DS:0x48 > MASK1=0xff > VALUE1=0x0 > $TC qdisc del dev $ITF root > $TC qdisc add dev $ITF handle 1:0 root dsmark indices 64 > $TC class change dev $ITF classid 1:1 dsmark mask $MASK1 value $VALUE1 > $TC filter add dev $ITF parent 1:0 protocol ip prio 4 handle 1: u32 divisor > 1 > $TC filter add dev $ITF parent 1:0 prio 4 u32 \ > match ip dst $DEST \ > police rate 3Mbit burst 2K continue \ > flowid 1:1 > ------------------------------SCRIPT > ENDS---------------------------------------------------- > > I have an incoming packet with label 199 and its EXP bit marked > accordingly, to say 2. I execute the following command to set an incoming > label. > > mplsadm2 -v -A -I gen:199:0 > mplsadm2 -v -I gen:199:0 -i pop:exp2tc:2:184:peek > > As 184 is 0xb8, I should get a DS field of 0xb8 and a DSCP of 0x2e > (EF), right? But, I don't. The whole DS field remains unmarked. I expected this, since mask=0xff and value=0 means that DS field will be left unchanged. > I have tried : > > mplsadm2 -v -I gen:199:0 -i exp2tc:2:184:pop:peek > > But I dun think that worked either. > > Stefano, have u tried out the exp2tc function? I may have missed out > things or did things wrongly... Do please correct me.. I will appreciate it > greatly! > You could try this way: you use a tcindex filter (which classify packets based on skb->tc_index) to select a dsmark class which sets the desired DSCP value. For example: mplsadm2 -v -A -I gen:199:0 mplsadm2 -v -I gen:199:0 -i pop:exp2tc:2:184:peek tc qdisc add dev $ITF handle 1:0 root dsmark indices 64 tc class change dev $ITF classid 1:1 dsmark mask 0x0 value 0xb8 tc filter add dev $ITF parent 1:0 protocol ip prio 1 tcindex mask 0xff tc filter add dev $ITF parent 1:0 protocol ip prio 1 handle 184 tcindex classid 1:1 Thus packets arriving with label 199 and Exp 2 will leave with DS field 0xb8 (DSCP 0x2e). Let me know if this works. If you want more details on dsmark qdisc and tcindex classifier you can get the Linux Advanced Routing & Traffic Control HOWTO at http://lartc.org and see section "DSMARK". Stefano |
From: ncc49a <nc...@si...> - 2002-02-26 19:19:01
|
Hi Stefano, Thanks for replying! Attached are some examples... > > 1) The exp->ds mapping is sometimes reflected incorrectly in the > > "/proc/mpls_*" files. > > Could you provide any example ? > > 2) To test the exp2ds function, I have set up a couple of MPLS routers > > in serial, with non-MPLS hosts/routers at each ends. I then ping an end > > host from the other end. The non-Mpls host/router which is the origin will > > mark a packet's DSCP. The edge MPLS router will mark the EXP bits based on > > the DSCP value. The edge MPLS router at the end will re-mark the DSCP of > > the incoming packet, based on its EXP. As the packet returns, it will mark > > the outgoing EXP bits based on the new DSCP. The origin MPLS edge router > > will then remark the DSCP (again) based on the incoming new EXP bits. > > > > I monitor at the origin MPLS router's interfaces. I find that the > > new EXP bits on the shim of the returned incoming ping packet is correct. > > However,the returning packet on the outgoing interface of the origin MPLS > > edge (connected to the origin non-MPLS host/router) has its DSCP bits > > marked wrongly. > > > > Anyone knows what could be a possible reason? > > > > It seems strange to me. Have you checked that /proc/net/mpls_* content reflects what you want to do ? > Anyway, you should provide more information (e.g. the commands you typed and what instead you obtain) to let someone help you. A1) Script for origin edge MPLS router. --------------SCRIPT STARTS----------------------------------------- #!/bin/sh # Mplsadm path MPLSADM=/usr/src/SW/mpls-beta-1_128/mpls-linux-1128/utils/mplsadm2 $MPLSADM -d $MPLSADM -v -L eth0:0 $MPLSADM -v -A -O gen:18:eth0:ipv4:192.168.0.161 OUT_KEY_18=$(grep 'gen 18' /proc/net/mpls_out | cut -c3-10) $MPLSADM -v -O key:$OUT_KEY_18 -o ds2exp:0xf:46:6:push:gen:18:set:eth0:ipv4:192.168.0.161 iptables -A OUTPUT -d 192.168.0.188/30 -j MPLS --set-key $OUT_KEY_18 iptables -A FORWARD -d 192.168.0.188/30 -j MPLS --set-key $OUT_KEY_18 $MPLSADM -v -A -I gen:199:0 $MPLSADM -v -I gen:199:0 -i pop:exp2ds:2:26:peek $MPLSADM -d --------------SCRIPT ENDS-------------------------------------------- The above sets outgoing packets with DSCP of 0x2e with EXP of 6. It marks incoming packets with EXP 2 with DSCP of 0x1a. A2) "mpls_out" for origin edge MPLS router. --------------START----------------------------------------- 0x00000009 69/5796/0 2 DS2EXP( DS(0e)->EXP(06) ) PUSH(gen 18) SET(eth0,192.168.0.161) --------------END-------------------------------------------- As you can see, the ds2exp mapping shown is 0xe->0x06, when it should be 0x2e->0x06. However, the command seems to be executed corrected i.e a packet with a DSCP of 0x2e is indeed marked with an EXP of 0x06. I think in my last mail, I mentioned this occurred with the exp2ds, my mistake... it is for ds2exp as shown above. A3) "mpls_in" for origin edge MPLS router. --------------START----------------------------------------- 0x40031c00 70/6952/0 gen 199 0 1 POP EXP2DS( EXP(2)->DS(1a) ) PEEK --------------END-------------------------------------------- B1) Script for edge MPLS router at other end. --------------SCRIPT STARTS----------------------------------------- #!/bin/sh # Mplsadm path MPLSADM=/usr/src/SW/mpls-beta-1_128/mpls-linux-1128/utils/mplsadm2 $MPLSADM -d $MPLSADM -v -L eth1:0 $MPLSADM -v -A -I gen:199:0 $MPLSADM -v -A -O gen:19:eth1:ipv4:192.168.0.129 OUT_KEY_19=$(grep 'gen 19' /proc/net/mpls_out | cut -c3-10) $MPLSADM -v -O key:$OUT_KEY_19 -o set_exp:2:push:gen:19:set:eth1:ipv4:192.168.0.129 iptables -A OUTPUT -d 192.168.0.168/29 -j MPLS --set-key $OUT_KEY_19 iptables -A FORWARD -d 192.168.0.168/29 -j MPLS --set-key $OUT_KEY_19 $MPLSADM -d --------------SCRIPT ENDS-------------------------------------------- The above marks outgoing packets with EXP of 2. Thus from the above script A1), the origin edge router when receiving a incoming packet with EXP 2 from router which has ran script B1), it should mark the DSCP of the packet to 0x1a before forwarding it, right? But, it doesn't, it always marks it to a value of 0x3e, and I am unsure why... > > You could try this way: you use a tcindex filter (which classify packets based on skb->tc_index) to select a dsmark class which sets the desired DSCP value. > For example: > > mplsadm2 -v -A -I gen:199:0 > mplsadm2 -v -I gen:199:0 -i pop:exp2tc:2:184:peek > > tc qdisc add dev $ITF handle 1:0 root dsmark indices 64 > tc class change dev $ITF classid 1:1 dsmark mask 0x0 value 0xb8 > tc filter add dev $ITF parent 1:0 protocol ip prio 1 tcindex mask 0xff > tc filter add dev $ITF parent 1:0 protocol ip prio 1 handle 184 tcindex classid 1:1 > > Thus packets arriving with label 199 and Exp 2 will leave with DS field 0xb8 (DSCP 0x2e). > Let me know if this works. > Yup, the above worked! It is like a exp2ds function... thanks! Regards, Paul |
From: Stefano A. <avi...@li...> - 2002-02-27 17:46:17
|
Hi Paul > A1) Script for origin edge MPLS router. > > --------------SCRIPT STARTS----------------------------------------- > #!/bin/sh > # Mplsadm path > MPLSADM=/usr/src/SW/mpls-beta-1_128/mpls-linux-1128/utils/mplsadm2 > $MPLSADM -d > $MPLSADM -v -L eth0:0 > $MPLSADM -v -A -O gen:18:eth0:ipv4:192.168.0.161 > OUT_KEY_18=$(grep 'gen 18' /proc/net/mpls_out | cut -c3-10) > $MPLSADM -v -O key:$OUT_KEY_18 -o > ds2exp:0xf:46:6:push:gen:18:set:eth0:ipv4:192.168.0.161 > iptables -A OUTPUT -d 192.168.0.188/30 -j MPLS --set-key $OUT_KEY_18 > iptables -A FORWARD -d 192.168.0.188/30 -j MPLS --set-key $OUT_KEY_18 > $MPLSADM -v -A -I gen:199:0 > $MPLSADM -v -I gen:199:0 -i pop:exp2ds:2:26:peek > $MPLSADM -d > > --------------SCRIPT ENDS-------------------------------------------- > > The above sets outgoing packets with DSCP of 0x2e with EXP of 6. It marks > incoming packets with EXP 2 with DSCP of 0x1a. > > A2) "mpls_out" for origin edge MPLS router. > > --------------START----------------------------------------- > > 0x00000009 69/5796/0 2 DS2EXP( DS(0e)->EXP(06) ) PUSH(gen 18) > SET(eth0,192.168.0.161) > > --------------END-------------------------------------------- > > As you can see, the ds2exp mapping shown is 0xe->0x06, when it should be > 0x2e->0x06. However, the command seems to be executed corrected i.e a > packet with a DSCP of 0x2e is indeed marked with an EXP of 0x06. This is due to the value you assigned to the mask used by ds2exp (0xf). The role of the mask is the following: a 64-sized array is used to maintain ds-exp couples; the exp value is stored in the element of index ds & mask. When a packet must be sent, its DSCP is ANDed with mask and the result is the index of the element which contain the EXP to set. This means that in your examples also packets with DSCP of 0x1e, 0x3e, 0x4e... will be marked with an EXP of 0x06. If you don't want this, use a mask of 0x3f (the maximum allowed) > I think in my last mail, I mentioned this occurred with the exp2ds, my > mistake... it is for ds2exp as shown above. > > A3) "mpls_in" for origin edge MPLS router. > > --------------START----------------------------------------- > > 0x40031c00 70/6952/0 gen 199 0 1 POP EXP2DS( EXP(2)->DS(1a) ) PEEK > > --------------END-------------------------------------------- > > B1) Script for edge MPLS router at other end. > > --------------SCRIPT STARTS----------------------------------------- > > #!/bin/sh > # Mplsadm path > MPLSADM=/usr/src/SW/mpls-beta-1_128/mpls-linux-1128/utils/mplsadm2 > $MPLSADM -d > $MPLSADM -v -L eth1:0 > $MPLSADM -v -A -I gen:199:0 > $MPLSADM -v -A -O gen:19:eth1:ipv4:192.168.0.129 > OUT_KEY_19=$(grep 'gen 19' /proc/net/mpls_out | cut -c3-10) > $MPLSADM -v -O key:$OUT_KEY_19 -o > set_exp:2:push:gen:19:set:eth1:ipv4:192.168.0.129 > iptables -A OUTPUT -d 192.168.0.168/29 -j MPLS --set-key $OUT_KEY_19 > iptables -A FORWARD -d 192.168.0.168/29 -j MPLS --set-key $OUT_KEY_19 > $MPLSADM -d > > > --------------SCRIPT ENDS-------------------------------------------- > > The above marks outgoing packets with EXP of 2. > > Thus from the above script A1), the origin edge router when receiving a > incoming packet with EXP 2 from router which has ran script B1), it should > mark the DSCP of the packet to 0x1a before forwarding it, right? But, it > doesn't, it always marks it to a value of 0x3e, and I am unsure why... > Are you sure that at the origin edge router packets arrive with EXP 2 ? Since I have some doubt that set_exp works correctly, could you try an equivalent instruction (e.g. ds2exp) ? If this test works, problems are due to set_exp... Let me know, Stefano |
From: <pim...@in...> - 2002-02-28 15:34:36
|
> This is due to the value you assigned to the mask used by ds2exp (0xf). The role of the mask is the following: a 64-sized array is used to maintain ds-exp couples; the exp value is stored in the element of index ds & mask. When a packet must be sent, its DSCP is ANDed with mask and the result is the index of the element which contain the EXP to set. here what I plan to use in the next RSVP-TE release: ds2exp:0x38:0xa:1:0x12:2:0x1a:3:0x22:4:0x2e:5 This maps: AF1x -> 1 AF2x -> 2 AF3x -> 3 AF4x -> 4 EF -> 5 with: (this code is GPL'ed ;) // DSCPstring -> DSCPnum struct {char a[4]; uint8_t b;} dscpe [] = { {"BE", 0 }, {"AF11", 0x0a}, {"AF12", 0x0c}, {"AF13", 0x0e}, {"AF21", 0x12}, {"AF22", 0x14}, {"AF23", 0x16}, {"AF31", 0x1a}, {"AF32", 0x1c}, {"AF33", 0x1e}, {"AF41", 0x22}, {"AF42", 0x24}, {"AF43", 0x26}, {"EF", 0x2e}}; Any comments or thoughts on this mapping? Pim. > This means that in your examples also packets with DSCP of 0x1e, 0x3e, 0x4e... will be marked with an EXP of 0x06. > If you don't want this, use a mask of 0x3f (the maximum allowed) > > > I think in my last mail, I mentioned this occurred with the exp2ds, my > > mistake... it is for ds2exp as shown above. > > > > A3) "mpls_in" for origin edge MPLS router. > > > > --------------START----------------------------------------- > > > > 0x40031c00 70/6952/0 gen 199 0 1 POP EXP2DS( EXP(2)->DS(1a) ) PEEK > > > > --------------END-------------------------------------------- > > > > B1) Script for edge MPLS router at other end. > > > > --------------SCRIPT STARTS----------------------------------------- > > > > #!/bin/sh > > # Mplsadm path > > MPLSADM=/usr/src/SW/mpls-beta-1_128/mpls-linux-1128/utils/mplsadm2 > > $MPLSADM -d > > $MPLSADM -v -L eth1:0 > > $MPLSADM -v -A -I gen:199:0 > > $MPLSADM -v -A -O gen:19:eth1:ipv4:192.168.0.129 > > OUT_KEY_19=$(grep 'gen 19' /proc/net/mpls_out | cut -c3-10) > > $MPLSADM -v -O key:$OUT_KEY_19 -o > > set_exp:2:push:gen:19:set:eth1:ipv4:192.168.0.129 > > iptables -A OUTPUT -d 192.168.0.168/29 -j MPLS --set-key $OUT_KEY_19 > > iptables -A FORWARD -d 192.168.0.168/29 -j MPLS --set-key $OUT_KEY_19 > > $MPLSADM -d > > > > > > --------------SCRIPT ENDS-------------------------------------------- > > > > The above marks outgoing packets with EXP of 2. > > > > Thus from the above script A1), the origin edge router when receiving a > > incoming packet with EXP 2 from router which has ran script B1), it should > > mark the DSCP of the packet to 0x1a before forwarding it, right? But, it > > doesn't, it always marks it to a value of 0x3e, and I am unsure why... > > > > Are you sure that at the origin edge router packets arrive with EXP 2 ? > Since I have some doubt that set_exp works correctly, could you try an equivalent instruction (e.g. ds2exp) ? > If this test works, problems are due to set_exp... > > Let me know, > Stefano > > _______________________________________________ > mpls-linux-general mailing list > mpl...@li... > https://lists.sourceforge.net/lists/listinfo/mpls-linux-general -- Pim Van Heuven Ghent University - IMEC Department of Information Technology (INTEC) Sint-Pietersnieuwstraat, 41 B-9000, Gent, Belgium pim...@in... DiffServ/MPLS(RSVP-TE) for Linux: http://dsmpls.atlantis.rug.ac.be |
From: James R. L. <jl...@mi...> - 2002-02-28 15:52:32
|
This brings up a very good point: Should there be a default set of DSCP -> EXP bit mapping in the kernel (and EXP bits -> DSCP)? The default behavior is not to do EXP or DSCP mappings. By specifing ds2exp or exp2ds without any values, the default set of mappings would be used. By specifing values you override the default mapping. Do people think I should also add the name to DSCP value mapping in mplsadm? What about in the kernel output in /proc/net/mpls_*? BTW, yes I like your mappings. I would like thme included it the MPLS+DiffServ how-to when it is written (any volenteers ;-) Jim On Thu, Feb 28, 2002 at 04:33:17PM +0100, pim...@in... wrote: > > This is due to the value you assigned to the mask used by ds2exp (0xf). The role of the mask is the following: a 64-sized array is used to maintain ds-exp couples; the exp value is stored in the element of index ds & mask. When a packet must be sent, its DSCP is ANDed with mask and the result is the index of the element which contain the EXP to set. > > here what I plan to use in the next RSVP-TE release: > > ds2exp:0x38:0xa:1:0x12:2:0x1a:3:0x22:4:0x2e:5 > > This maps: > AF1x -> 1 > AF2x -> 2 > AF3x -> 3 > AF4x -> 4 > EF -> 5 > > with: > (this code is GPL'ed ;) > // DSCPstring -> DSCPnum > struct {char a[4]; uint8_t b;} dscpe [] = { > {"BE", 0 }, > {"AF11", 0x0a}, > {"AF12", 0x0c}, > {"AF13", 0x0e}, > {"AF21", 0x12}, > {"AF22", 0x14}, > {"AF23", 0x16}, > {"AF31", 0x1a}, > {"AF32", 0x1c}, > {"AF33", 0x1e}, > {"AF41", 0x22}, > {"AF42", 0x24}, > {"AF43", 0x26}, > {"EF", 0x2e}}; > > Any comments or thoughts on this mapping? > > Pim. > > > This means that in your examples also packets with DSCP of 0x1e, 0x3e, 0x4e... will be marked with an EXP of 0x06. > > If you don't want this, use a mask of 0x3f (the maximum allowed) > > > > > I think in my last mail, I mentioned this occurred with the exp2ds, my > > > mistake... it is for ds2exp as shown above. > > > > > > A3) "mpls_in" for origin edge MPLS router. > > > > > > --------------START----------------------------------------- > > > > > > 0x40031c00 70/6952/0 gen 199 0 1 POP EXP2DS( EXP(2)->DS(1a) ) PEEK > > > > > > --------------END-------------------------------------------- > > > > > > B1) Script for edge MPLS router at other end. > > > > > > --------------SCRIPT STARTS----------------------------------------- > > > > > > #!/bin/sh > > > # Mplsadm path > > > MPLSADM=/usr/src/SW/mpls-beta-1_128/mpls-linux-1128/utils/mplsadm2 > > > $MPLSADM -d > > > $MPLSADM -v -L eth1:0 > > > $MPLSADM -v -A -I gen:199:0 > > > $MPLSADM -v -A -O gen:19:eth1:ipv4:192.168.0.129 > > > OUT_KEY_19=$(grep 'gen 19' /proc/net/mpls_out | cut -c3-10) > > > $MPLSADM -v -O key:$OUT_KEY_19 -o > > > set_exp:2:push:gen:19:set:eth1:ipv4:192.168.0.129 > > > iptables -A OUTPUT -d 192.168.0.168/29 -j MPLS --set-key $OUT_KEY_19 > > > iptables -A FORWARD -d 192.168.0.168/29 -j MPLS --set-key $OUT_KEY_19 > > > $MPLSADM -d > > > > > > > > > --------------SCRIPT ENDS-------------------------------------------- > > > > > > The above marks outgoing packets with EXP of 2. > > > > > > Thus from the above script A1), the origin edge router when receiving a > > > incoming packet with EXP 2 from router which has ran script B1), it should > > > mark the DSCP of the packet to 0x1a before forwarding it, right? But, it > > > doesn't, it always marks it to a value of 0x3e, and I am unsure why... > > > > > > > Are you sure that at the origin edge router packets arrive with EXP 2 ? > > Since I have some doubt that set_exp works correctly, could you try an equivalent instruction (e.g. ds2exp) ? > > If this test works, problems are due to set_exp... > > > > Let me know, > > Stefano > > > > _______________________________________________ > > mpls-linux-general mailing list > > mpl...@li... > > https://lists.sourceforge.net/lists/listinfo/mpls-linux-general > > -- > Pim Van Heuven Ghent University - IMEC > Department of Information Technology (INTEC) > Sint-Pietersnieuwstraat, 41 B-9000, Gent, Belgium > pim...@in... > DiffServ/MPLS(RSVP-TE) for Linux: > http://dsmpls.atlantis.rug.ac.be > > > _______________________________________________ > mpls-linux-general mailing list > mpl...@li... > https://lists.sourceforge.net/lists/listinfo/mpls-linux-general -- James R. Leu |
From: Stefano A. <avi...@li...> - 2002-02-28 20:55:58
|
Hi all > > ds2exp:0x38:0xa:1:0x12:2:0x1a:3:0x22:4:0x2e:5 > > > > This maps: > > AF1x -> 1 > > AF2x -> 2 > > AF3x -> 3 > > AF4x -> 4 > > EF -> 5 based on my understanding of draft-ietf-mpls-diff-ext-09.txt, I have some doubts about the utility of the above mapping, unless we want to disregard the drop probability (the above 'x'). According to me, if we want to set up an E-LSP we must encode the full DSCP into the EXP bits (otherwise we lose the drop probability); if we want to set up an L-LSP (which carries packets of a given PSC, e.g. AF1 or AF2) in the EXP bits we should encode just the drop probability. Please correct me if I'm wrong Regards, Stefano |
From: <pim...@in...> - 2002-03-01 10:35:03
|
Stefano Avallone wrote: > > Hi all > > > > ds2exp:0x38:0xa:1:0x12:2:0x1a:3:0x22:4:0x2e:5 > > > > > > This maps: > > > AF1x -> 1 > > > AF2x -> 2 > > > AF3x -> 3 > > > AF4x -> 4 > > > EF -> 5 > > based on my understanding of draft-ietf-mpls-diff-ext-09.txt, I have some doubts about the utility of the above mapping, unless we want to disregard the drop probability (the above 'x'). > According to me, if we want to set up an E-LSP we must encode the full DSCP into the EXP bits (otherwise we lose the drop probability); if we want to set up an L-LSP (which carries packets of a given PSC, e.g. AF1 or AF2) in the EXP bits we should encode just the drop probability. > > Please correct me if I'm wrong No you are correct. If you want to support the drop probability you must encapsulate the complete DSCP in the EXP and restrict yourself to 2 AF classes. AF(12)(123)+BE+EF -> 8 EXP values. Pim. > Regards, > Stefano > > _______________________________________________ > mpls-linux-general mailing list > mpl...@li... > https://lists.sourceforge.net/lists/listinfo/mpls-linux-general -- Pim Van Heuven Ghent University - IMEC Department of Information Technology (INTEC) Sint-Pietersnieuwstraat, 41 B-9000, Gent, Belgium pim...@in... DiffServ/MPLS(RSVP-TE) for Linux: http://dsmpls.atlantis.rug.ac.be |
From: Stefano A. <avi...@li...> - 2002-03-01 13:09:06
|
> No you are correct. If you want to support the drop probability you must > encapsulate the complete DSCP in the EXP and restrict yourself to 2 AF > classes. AF(12)(123)+BE+EF -> 8 EXP values. Or you can create more than one LSP... Stefano |