Details
-
Bug
-
Status: Open
-
Resolution: Unresolved
-
unspecified
-
None
-
None
-
Operating System: Mac OS
Platform: Macintosh
-
7504
Description
Overview:
StaticMap item is overwrited and only latest staticMappingInfo is stored.
Steps to Reproduce:
This issue can be reproduced with latest Natapp ODL project and Mininet.
After compile and start ODL with natapp, set Nat Type and global ip:
1) Set Nat Type to staticNAT:
curl --user "admin":"admin" -H "Content-type: application/json" -X POST \
http://localhost:8181/restconf/operations/natapp:nat-type \
-d '{"natapp:input":{"type:static":""}}'
2) Set globalIP
curl --user "admin":"admin" -H "Content-type: application/json" -X PUT \
http://localhost:8181/restconf/config/natapp:staticNat/ \
-d '{"staticNat":{"globalIP":["172.0.0.1/32","172.0.0.2/32","172.0.0.3/32","172.0.0.4/32","172.0.0.5/32","172.0.0.6/32","172.0.0.7/32","172.0.0.8/32","172.0.0.9/32","172.0.0.10/32"]}}'
3) Start Mininet:
sudo mn --mac --controller=remote,ip=10.42.0.1,port=6653 --topo=single,10 --switch ovsk,protocols=OpenFlow13
4) Set Flood arp info:
sh ovs-ofctl add-flow s1 arp,actions=FLOOD --protocols OpenFlow13
5) Add missing-table flow
sudo ovs-ofctl add-flow s1 priority=0,actions=output:CONTROLLER --protocols OpenFlow13
6) Set host2 info to support ping command
h2 route add -net 0.0.0.0/0 gw 10.0.0.100
h2 arp -s 10.0.0.100 00:00:00:00:00:01
7) h1 ping h2 in mininet:
h1 ping h2 -c 5
After this command, we can found packets can be transmitted correctly.
In ODL YangUI web page, we can get staticMap of natapp. The content of staticMap include staticMappingInfo with globalIP=172.0.0.10 and localIP=10.0.0.1 .
8) Set host4 info to support ping command
h4 route add -net 0.0.0.0/0 gw 10.0.0.100
h4 arp -s 10.0.0.100 00:00:00:00:00:03
9) h3 ping h4 in mininet:
h3 ping h4 -c 5
Actual Results:
After this command, we can found packets can be transmitted correctly.
BUT, in ODL YangUI web page, The content of staticMap ONLY include staticMappingInfo with globalIP=172.0.0.10 and localIP=10.0.0.3 .
Expected Results:
Here we expect there are 2 items in staticMap:
staticMappingInfo<globalIP172.0.0.10/32> --> localIP:10.0.0.1
staticMappingInfo<globalIP172.0.0.7/32> --> localIP:10.0.0.3
But the previous mapping is overwrited by the latest mapping. As result, there will be only one items in staticMap forever.
Build Date & Hardware:
natapp.rev.2016-01-25, get code from "github:https://github.com/opendaylight/natapp" @2017-01-05.
Build 2017-01-05 on Mac OS 10.12.2
Additional Builds and Platforms:
Build 2017-01-05 on Ubuntu OS 14.4
Additional Information:
This issue may be relative with addStaticMap(String localIP) function in NatYangStore.java.