[Netexpect-users] Can't make mpls bottom of stack
Eloy Paris
peloy at netexpect.org
Wed Jun 11 09:30:39 UTC 2014
Hi Yousuke,
On Wed, Jun 11, 2014 at 05:22:18PM +0900, Yousuke Takahashi wrote:
> Hi Eloy,
>
> I'm using this great sotware.
> But I find that this tool cannot make MPLS bottom of stack today.
>
> This is an example for tgn. nexp has the same problem.
> -----
> * ip.pcap (correct behavior)
> #tgn -w ip.pcap "ether()/" "ip(src = 192.168.0.1, dst = 192.168.0.20)/"
> "tcp(src = 333 , dst = 4444, window = 16384)/" "data (data = 'random:1200')"
> #tcpdump -nr ip.pcap | less
> reading from file ip.pcap, link-type EN10MB (Ethernet)
> 17:16:58.700152 IP 192.168.0.1.333 > 192.168.0.20.4444: Flags [], seq
> 0:1200, win 16384, length 1200
>
> * mpls.pcap (incorrect behavior; bottom of stack "s = 1" is not to set.)
> # tgn -w mpls.pcap "ether()/" "mpls(label=2999, s = 1)/" "ip(src =
> 192.168.0.1, dst = 192.168.0.20)/" "tcp(src = 333 , dst = 4444, window =
> 16384)/" "data (data = 'random:1200')"
> # tcpdump -nr mpls.pcap | less
> 17:18:16.203560 MPLS (label 2999, exp 0, ttl 0) (label 282624, exp 2, ttl
> 216) (label 4096, exp 0, ttl 0) (label 262255, exp 1, [S], ttl 186)
> 0x0000: c0a8 0001 c0a8 0014 014d 115c 0000 0000 .........M.\....
> 0x0010: 0000 0000 5000 4000 8f94 0000 ceab ba5f ....P. at ........_
> 0x0020: 4388 28c1 0fed b173 229a b58f 0d17 3fbf C.(....s".....?.
> 0x0030: cc21 4dec cc86 92f4 8079 844e 243f ad68 .!M......y.N$?.h
> 0x0040: c7d5 29d6 c2da 49e4 74fe 7481 15b3 41e2 ..)...I.t.t...A.
> -----
>
> Please fix it if you have time.
Sorry about that. It's a bug but the fix is easy. Are you able to build
from sources? Here's the fix:
--- src/pbuild/builders/pdu-mpls.c (revision 410)
+++ src/pbuild/builders/pdu-mpls.c (working copy)
@@ -33,7 +33,8 @@
& LSE_LABEL;
mpls_lse |= (num_next(_pb_pdata(pdu, "experimental") )<< EXP_SHIFT)
& LSE_EXP;
- mpls_lse |= ( (int) _pb_pdata(pdu, "s") << S_SHIFT) & LSE_S;
+ if (_pb_pdata(pdu, "s") )
+ mpls_lse |= LSE_S;
mpls_lse |= num_next(_pb_pdata(pdu, "ttl") ) & LSE_TTL;
mpls_lse = htonl(mpls_lse);
The fix will be included in the next release, though I don't have a
timeframe for it yet.
Cheers,
Eloy Paris.-
netexpect.org
More information about the Netexpect-users
mailing list