(IPv4/IPv6) Dualstack in stateless mode - different dst mac in port per flow by ARP/ND

148 views
Skip to first unread message

hakl...@gmail.com

unread,
Jul 20, 2018, 9:23:37 AM7/20/18
to TRex Traffic Generator
Hi,
when using e.g. VRRP v3 for IPv4 and IPv6 on the next-hop (from TREX perspective) SUT interface it can happen that packet dst MAC address will be different for IPv4 and IPv6 packet flows on same TREX port.

Below is how I currently do this for scapy IPv4 stream:

c.set_service_mode(ports = [0, 1], enabled = True)
c.set_l3_mode(port = 0, src_ipv4 = c_ip_port_0, dst_ipv4 = c_ip_gw_port_0)
c.set_l3_mode(port = 1, src_ipv4 = c_ip_port_1, dst_ipv4 = c_ip_gw_port_1)

# ARP resolve ports 0, 1
c.resolve(ports = [0, 1])

c.set_service_mode(ports = [0, 1], enabled = False)

# add the stream to the TREX L3VPN TX port
c.add_streams([s1lat], ports = [first_port])
c.add_streams([s101lat], ports = [second_port])

What would be the procedure, for doing this with dualstack streams, dynamically using ARP and ND? (expecting different MAC DST per IP version)

Can I do similar, to above example. Using ND after adding the IPv4 streams to port, to resolve IPv6 DST MAC and then append the IPv6 stream to port?
or what would be the recommended procedure?

Thanks/Håkan

Andreas Bourges

unread,
Jul 23, 2018, 2:10:07 AM7/23/18
to TRex Traffic Generator
Hi,


> What would be the procedure, for doing this with dualstack streams, dynamically using ARP and ND? (expecting different MAC DST per IP version)
>
> Can I do similar, to above example. Using ND after adding the IPv4 streams to port, to resolve IPv6 DST MAC and then append the IPv6 stream to port?
> or what would be the recommended procedure?

...you could use service-arp and service-IPv6ND to resolve dst mac addresses and then build the stream packets using scapy (including Ethernet() information). I think examples for both services are in the stateless user-manual (https://trex-tgn.cisco.com/trex/doc/trex_stateless.html#_services).

best regards,

Andreas

hakl...@gmail.com

unread,
Sep 4, 2018, 10:05:45 AM9/4/18
to TRex Traffic Generator
Hi,
thanks for the answer it was helpfull, just some late feedback on the STLServiceIPv6ND.

Using TREX version 2.39, I noticed that when resolving address with capital characters A-F in dst_ip variable, service function did not accept NA from address owner (even if NA was correctly received):

ipv6_gw_port_1="2001:306:1:0:ffff:ffff:ffff:fffe" ####Works!
ipv6_gw_port_1="2001:306:1:0:FFFF:FFFF:FFFF:FFFE" ####Does not work!
ctx_1 = c.create_service_ctx(port = 1)

nd_service = STLServiceIPv6ND( ctx_1,
src_ip = ipv6_port_1,
dst_ip = ipv6_gw_port_1,
# vlan = [ 500, 22],
timeout=2,
verify_timeout=6,
# fmt = "QQ",
verbose_level = STLServiceIPv6ND.INFO

)
ctx_1.run(nd_service)

NA is sent correctly by address owner for both cases. But for the upper case case it seems like answer does not match STLServiceIPv6ND expected. Think it probably upper/lower case comparison issue.

Thanks/Håkan

Andreas Bourges

unread,
Sep 4, 2018, 11:57:30 AM9/4/18
to TRex Traffic Generator
I'll have a look at this once I'm back from Holliday...

Thanks,

Andreas

Andreas Bourges

unread,
Sep 10, 2018, 1:39:30 AM9/10/18
to TRex Traffic Generator
Hi,

just got a short glimps at the code - I think scapy results are returned using lower-case IPv6 addresses and thus the filtering of incoming NA messages fails in the IPv6ND plugin. Workaround would be to lower-case all target addresses when being called (one-liner). Since I'm still on holliday, it'll take some time to propose a patch to the TRex team. But once identified it's easy to implement a workaround :)

Thanks,

Andreas

hakl...@gmail.com

unread,
Dec 19, 2018, 10:02:29 AM12/19/18
to TRex Traffic Generator
Hi,
now trying to use TREX version 2.49. And it seems IPv6ND service module is no longer there?


[root@trex-1-vm-nfvi-1190 stl]# python
Python 2.7.5 (default, Aug 4 2017, 00:39:18)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-16)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from stl_path import *
>>> from trex_stl_lib.api import *
>>> from trex_stl_lib.services.trex_stl_service_IPv6ND import STLServiceIPv6ND
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named services.trex_stl_service_IPv6ND
>>>

Yaroslav Brustinov

unread,
Dec 19, 2018, 11:24:15 AM12/19/18
to hakl...@gmail.com, TRex Traffic Generator

--
You received this message because you are subscribed to the Google Groups "TRex Traffic Generator" group.
To unsubscribe from this group and stop receiving emails from it, send an email to trex-tgn+u...@googlegroups.com.
To post to this group, send email to trex...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trex-tgn/9201197a-8579-4ea9-84a4-83b44b018629%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

hakl...@gmail.com

unread,
Dec 20, 2018, 4:58:49 AM12/20/18
to TRex Traffic Generator
Hi,
thanks for the answer. I have seen this but thought it was still backward compatible. Will check importing LIB new style when I get access to the system.

Thanks/Håkan

Andreas Bourges

unread,
Dec 23, 2018, 3:53:51 AM12/23/18
to TRex Traffic Generator
Hi Hakan,

Please note that there's a problem in v2.49 regarding ARP and ND services. This happened during API consolidation. I already have the fix here (just a few minor changes), but didn't issue the pull request, since I wanted to add some unit tests for the two services. I might split the two things and do the pull request for the bugfix in the next days and add the tests later...

Best regards,

Andreas

Reply all
Reply to author
Forward
0 new messages