Updated git submodules
[docs.git] / docs / developer-guide / natapp-developer-guide.rst
1 NATApp Developer Guide
2 ======================
3
4 Overview
5 --------
6
7 NATApp acts as a basic framework for providing NAT functionality to the
8 SDN controller. One can use REST or Java APIs to enter global IP address
9 into YANG Data Store which will be used by the odl-natapp-feature to map
10 local IP to global IP addresses.
11
12 NATApp Architecture
13 -------------------
14
15 NATApp listens on OpenFlow southbound interface for Packet\_In messages.
16 The application parses the message for header information. If the
17 received message has a local IP address the application installs rules
18 on the OpenFlow switch for network address translation from local to
19 global IP addresses. NATApp has NATPacketHandler class that implements
20 the PacketProcessing interface to override the OnPacketReceived
21 notification by which the application is notified of Packet\_In
22 messages.
23
24 NATApp is implemented with the help of a few java classes.
25
26 1. NATPacketHandler
27
28    -  Receives Packet\_In messages coming to the controller and process
29       them appropriately
30
31 2. NATPacketParsing
32
33    -  Decodes Packet\_In messages for packet header information (L2, L3
34       & L4 information)
35
36 3. NATInventoryUtility
37
38    -  Decodes Packet\_In messages for OpenFlow Switch and Port
39       information
40
41 4. NATFlowBuilder
42
43    -  Creates NAT flow rules at the OpenFlow Switch
44
45 5. NATYangStore
46
47    -  Reads Global IP entered by user and maps local IP to Global IP
48       information
49
50 6. NATFlowHandler
51
52    -  Manages expired flows in the switch and frees up used global IP
53       address for future natting.
54
55 Key APIs and Interfaces
56 -----------------------
57
58 1. RPC APIs
59
60    -  Static - Configure Static Natting Functionality
61
62    -  Dynamic - Configure Static Dynamic Functionality
63
64    -  PAT - Configure PAT Functionality
65
66 2. DataStore APIs
67
68    -  StaticNatIp - Configure floating IP addresses for Static Natting
69
70    -  StaticIpMapInfo - Mapped Information between floating and private
71       IP addresses in Static Natting
72
73    -  DynamicNatIp - Configure floating IP addresses for Dynamic Natting
74
75    -  DynamicIpMapInfo - Mapped Information between floating and private
76       IP addresses in Dynamic Natting
77
78    -  PatIp - Configure floating IP addresses for Port Address
79       Translation
80
81    -  PatIpMapInfo - Mapped Information between TCP Port numbers of
82       floating IP and private IP addresses
83
84 3. Notification APIs
85
86    -  DynamicIPExhaustion - Exhaustion of Dynamic Global IP Addresses
87
88    -  PatOverConnection - More than 10 TCP or UDP connections from one
89       private IP address
90