4 The NATApp User Guide contains information about configuration,
5 administration, management, using and troubleshooting the feature.
10 NATApp provides network different types of address translation
11 functionality for OpenDaylight. After installing this feature, network
12 administrators can select the type of NAT functionality they want to
13 enable by sending a REST API command. Subsequently, the user may enter
14 the gloabl IP addresses to the YANG Data Store through REST APIs. When
15 an OpenDaylight managed enterprise network with local IPs tries to
16 connect to external networks such as Internet, NATApp comes into play
17 and installs appropriate flow rules at the OpenFlow switch for
18 bidirectional NAT translation.
23 NATApp listens on OpenFlow southbound interface for Packet\_In messages.
24 The application parses the message for header information. If the
25 received message has a local IP address the application installs rules
26 on the OpenFlow switch for network address translation from local to
27 global IP addresses. NATApp has NATPacketHandler class that implements
28 the PacketProcessing interface to override the OnPacketReceived
29 notification by which the application is notified of Packet\_In
35 REST APIs are available at the following URI:
36 http://localhost:8181/apidoc/explorer/index.html#!/natapp(2016-01-25)
43 sudo mn --mac --topo=single,10 --controller=remote,ip=127.0.0.1,port=6653
45 Install a flow to flood the ARP packets.
49 sh ovs-ofctl add-flow s1 dl_type=0x0806,actions=FLOOD
51 Check the flow for ARP Flooding
55 sh ovs-ofctl dump-flows s1
57 Administering or Managing NATApp
58 --------------------------------
60 Static NAT and Dynamic NAT
61 ~~~~~~~~~~~~~~~~~~~~~~~~~~
63 First user has to select the type of NAT he wants by using the following
67 http://localhost:8181/restconf/operations/natapp:nat-type
70 {"natapp:input": { "type:static":""}}
73 {"natapp:input": { "type:dynamic":""}}
75 Then user can inject the Global IPs using the following URI
78 http://localhost:8181/restconf/config/natapp:staticNat/
81 {"natapp:staticNat": {"globalIP":["172.0.0.1/32","172.0.0.2/32",
82 "172.0.0.3/32", "172.0.0.4/32", "172.0.0.5/32", "172.0.0.6/32",
83 "172.0.0.7/32", "172.0.0.8/32", "172.0.0.9/32", "172.0.0.10/32"] }}
85 From mininet verify any pair of hosts can ping each other. The NATApp
86 modifies the destination IP address of the ICMP Echo request with the
87 global IP address. Check the mininet flows for this modification.
91 sh ovs-ofctl dump-flows s1
93 Port Address Translation (PAT)
94 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
96 User can select PAT by using the following URI.
99 http://localhost:8181/restconf/operations/natapp:nat-type
102 {"natapp:input": { "type:pat":""}}
104 Then user can inject the Global IPs using the following URI
107 http://localhost:8181/restconf/config/natapp:patNat/
110 {"natapp:patNat": {"globalIP":"172.0.0.1/32"}}
112 From Mininet use the command as xterm h1 h5. At h5 give the following
117 $ ip r add 172.0.0.1/32 dev h5-eth0
118 $ arp -s 172.0.0.1 00:00:00:00:00:01
121 At h1, Give the following command
125 $ echo "TCS" | nc -p 8000 10.0.0.5 5000
129 mininet> sh ovs-ofctl dump-flows s1
130 NXST_FLOW reply (xid=0x4):
131 cookie=0x0, duration=811.272s, table=0, n_packets=5, n_bytes=342, idle_age=13, priority=210,tcp,in_port=1,tp_src=8000 actions=mod_nw_src:172.0.0.1,mod_tp_src:2000,output:5
132 cookie=0x0, duration=499.843s, table=0, n_packets=2, n_bytes=84, idle_age=13, arp actions=FLOOD
133 cookie=0x0, duration=811.203s, table=0, n_packets=3, n_bytes=206, idle_age=13, priority=209,tcp,in_port=5,tp_dst=2000 actions=mod_nw_dst:10.0.0.1,mod_tp_dst:8000,output:1