Open okanchou9 opened 7 years ago
@sihuihan88
Hi Kenie,
The decap configuration is enabled by default. The test should be able to run without any setting. FYI
admin@sonic:~$ docker exec -it swss bash
root@sonic:/# cd etc/swss/config.d/
root@sonic:/etc/swss/config.d#
root@sonic:/etc/swss/config.d#
root@sonic:/etc/swss/config.d# ls
00-copp.config.json ipinip.json mirror.json
root@sonic:/etc/swss/config.d# cat ipinip.json
[
{
"TUNNEL_DECAP_TABLE:IPINIP_TUNNEL" : {
"tunnel_type":"IPINIP",
"src_ip":"25.64.96.17",
"dst_ip":"25.64.96.17",
"dscp_mode":"pipe",
"ecn_mode":"copy_from_outer",
"ttl_mode":"pipe"
},
"OP": "SET"
}
]
root@sonic:/etc/swss/config.d#
admin@sonic:~$ redis-cli
127.0.0.1:6379> select 0
OK
127.0.0.1:6379> keys *TUNNEL*
1) "TUNNEL_DECAP_TABLE:IPINIP_TUNNEL"
127.0.0.1:6379> select 1
OK
127.0.0.1:6379[1]> keys *TUNNEL*
1) "ASIC_STATE:SAI_OBJECT_TYPE_TUNNEL:oid:0x290000000005ac"
2) "ASIC_STATE:SAI_OBJECT_TYPE_TUNNEL_TERM_TABLE_ENTRY:oid:0x2a0000000005ad"
127.0.0.1:6379[1]>
'''
@sihuihan88,
Thank you for the information of decap configuration. Decap is running perfectly after I'm trying to send couple IP-in-IP packet from PTF to DUT and DUT will decap those packets and forward them to correct inner dst IP address.
But I found something strange in the decap script:
Sample code in fib.py:
{# defualt route#}
{% if testbed_type == 't1' %}
0.0.0.0/0 {% for ifname, v in minigraph_neighbors.iteritems() %}{% if "T2" in v.name %}{{ '[%d]' % minigraph_port_indices[ifname]}}{% if not loop.last %} {% endif %}{% endif %}{% endfor %}
{% elif testbed_type == 't0' or testbed_type == 't0-64' or testbed_type == 't1-lag' %}
0.0.0.0/0 {% for portchannel, v in minigraph_portchannels.iteritems() %}
[{% for member in v.members %}{{ '%d' % minigraph_port_indices[member]}}{% if not loop.last %} {% endif %}{% endfor %}]{% if not loop.last %} {% endif %}{% endfor %}
{% endif %}
Sample code in fib.py:
for ip in EXCLUDE_IPV4_PREFIXES:
self._ipv4_lpm_dict[ip] = self.NextHop()
In fib_info.txt, DUT has 3 IPv4 routes as following:
0.0.0.0/0 [30] [29] [28] [31]
192.169.4.64/26 [30] [29] [28] [31]
192.169.8.64/26 [30] [29] [28] [31]]
In lpm.py, function range will get an enumerate of sorted boundary which including the following information:
index, boundary: 0, 0.0.0.0
index, boundary: 1, 192.169.4.64
index, boundary: 2, 192.169.4.128
index, boundary: 3, 192.169.8.64
index, boundary: 4, 192.169.8.128
Also in lpm.py, function range will calculate the IpInterval by route n and n+1 like the following:
interval = self.IpInterval(sorted_boundaries[index], sorted_boundaries[index + 1] - 1)
And the following is the result of interval:
interval: 0.0.0.0 - 192.169.4.63 <--- Incorrect interval
interval: 192.169.4.64 - 192.169.4.127
interval: 192.169.4.128 - 192.169.8.63 <--- Incorrect interval
interval: 192.169.8.64 - 192.169.8.127
There are 2 incorrect intervals found and them will cause decap test failed since DUT will drop them because they are not in the routing table of DUT.
I'm still trying to modify the script to debug those issues, will commit the fix and raise a merge request to master branch. Please let me know if any, thanks.
Regards, Kenie Liu
Hi,
According to the wiki page of IPv4 Decapsulation test: https://github.com/Azure/SONiC/wiki/IPv4-Decapsulation-test
There is a comment to talk about the test assumes all routes and decapsulation are set prior by to test. Would like to know what's the decap setup before running the test since no luck while tried couple configurations of decap rules.
Please let me know if any, thanks.
Regards, Kenie Liu