Re: ds2exp; a possible mapping [was Re: [mpls-linux-general] Re: MPLS-Diffserv Instructions + Counte
Status: Beta
Brought to you by:
jleu
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 |