fixing LISP flow mapping addr format table
[docs.git] / manuals / user-guide / src / main / asciidoc / sxp / odl-sxp-user.adoc
1 == SXP User Guide
2
3 === Overview
4 SXP (Source-Group Tag eXchange Protocol) project is an effort to enhance OpenDaylight platform with IP-SGT (IP Address to Source Group Tag) bindings that can be learned from connected SXP-aware network nodes. The current implementation supports SXP protocol version 4 according to the Smith, Kandula - SXP https://tools.ietf.org/html/draft-smith-kandula-sxp-02[IETF draft]. All protocol legacy versions 1-3 are supported as well. Additionally, version 4 adds bidirectional connection type as an extension of a unidirectional one.
5
6 === SXP Architecture
7 The SXP Server manages all connected clients in separate threads and a common SXP protocol agreement is used between connected peers. Each SXP network peer is modelled with its pertaining class, e.g., SXP Server represents the SXP Speaker, SXP Listener the Client. The server program creates the ServerSocket object on a specified port and waits until a client starts up and requests connect on the IP address and port of the server. The client program opens a Socket that is connected to the server running on the specified host IP address and port.
8
9 The SXP Listener maintains connection with its speaker peer. From an opened channel pipeline, all incoming SXP messages are processed by various handlers. Message must be decoded, parsed and validated.
10
11 The SXP Speaker is a counterpart to the SXP Listener. It maintains a connection with its listener peer and sends composed messages.
12
13 The SXP Binding Handler extracts the IP-SGT binding from a message and pulls it into the SXP-Database. If an error is detected during the IP-SGT extraction, an appropriate error code and sub-code is selected and an error message is sent back to the connected peer. All transitive messages are routed directly to the output queue of SXP Binding Dispatcher.
14
15 The IP-SGT Manager handles bindings from multiple connections. If a new data has been added into or deleted from the SXP-Database, or binding’s contributor change is detected, the manager performs an arbitration process above the SXP-Database to resolve the binding duplicity and prevent possible information loops. Finally, it updates the IP-SGT-Master database that consists only of valid and unique bindings, i.e., a single binding per IP address.
16
17 The IP-SGT Manager also contains RPCs that can be used by other OpenDaylight plugins, or by making REST calls, to add, update or to delete bindings in or from the SXP-database.
18
19 The SXP Binding Dispatcher represents a selector that will decides how many data from the SXP-database will be sent and when. It is responsible for message content composition based on maximum message length.
20
21 === Configuring SXP
22 The OpenDaylight Karaf distribution comes pre-configured with baseline SXP
23 configuration.
24
25 - *22-sxp-controller-one-node.xml* (defines the basic parameters)
26
27 === Administering or Managing SXP
28 By RPC (response is XML document containing requested data or operation status):
29
30 * Get Connections
31 POST http://127.0.0.1:8181/restconf/operations/sxp-controller:get-connections
32 [source,xml]
33 ----
34 <input xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
35  <requested-node>0.0.0.100</requested-node>
36 </input>
37 ----
38 * Add Connection
39 POST http://127.0.0.1:8181/restconf/operations/sxp-controller:add-connection
40 [source,xml]
41 ----
42 <input xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
43  <connections>
44   <connection>
45    <!--vpn>vpn1</vpn-->
46    <peer-address>172.20.161.50</peer-address>
47    <!--source-ip></source-ip-->
48    <tcp-port>64999</tcp-port>
49    <!-- Password setup: default | none -->
50    <password>default</password>
51    <!-- Mode: speaker/listener/both -->
52    <mode>speaker</mode>
53    <version>version4</version>
54    <description>Connection to ASR1K</description>
55    <!-- Timers setup: 0 to disable specific timer usability, the default value will be used -->
56    <connection-timers>
57     <!-- Speaker -->
58     <hold-time-min-acceptable>45</hold-time-min-acceptable>
59     <keep-alive-time>30</keep-alive-time>
60    </connection-timers>
61   </connection>
62   <connection>
63    <!--vpn>vpn1</vpn-->
64    <peer-address>172.20.161.178</peer-address>
65    <!--source-ip></source-ip-->
66    <tcp-port>64999</tcp-port>
67    <!-- Password setup: default | none -->
68    <password>default</password>
69    <!-- Mode: speaker/listener/both -->
70    <mode>listener</mode>
71    <version>version4</version>
72    <description>Connection to ISR</description>
73    <!-- Timers setup: 0 to disable specific timer usability, the default value will be used -->
74    <connection-timers>
75     <!-- Listener -->
76     <!-- NON-CONFIGURABLE delete-hold-down-time -->
77     <reconciliation-time>120</reconciliation-time>
78     <hold-time>90</hold-time>
79     <hold-time-min>90</hold-time-min>
80     <hold-time-max>180</hold-time-max>
81    </connection-timers>
82   </connection>
83  </connections>
84 </input>
85 ----
86
87 * Delete Connection
88 POST http://127.0.0.1:8181/restconf/operations/sxp-controller:delete-connection
89 [source,xml]
90 ----
91 <input xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
92  <peer-address>172.20.161.50</peer-address>
93 </input>
94 ----
95 * Add Binding Entry
96 POST http://127.0.0.1:8181/restconf/operations/sxp-controller:add-entry
97 [source,xml]
98 ----
99 <input xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
100  <ip-prefix>192.168.2.1/32</ip-prefix>
101  <sgt>20</sgt >
102 </input>
103 ----
104 * Update Binding Entry
105 POST http://127.0.0.1:8181/restconf/operations/sxp-controller:update-entry
106 [source,xml]
107 ----
108 <input xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
109  <original-binding>
110   <ip-prefix>192.168.2.1/32</ip-prefix>
111   <sgt>20</sgt>
112  </original-binding>
113  <new-binding>
114   <ip-prefix>192.168.3.1/32</ip-prefix>
115   <sgt>30</sgt>
116  </new-binding>
117 </input>
118 ----
119 * Delete Binding Entry
120 POST http://127.0.0.1:8181/restconf/operations/sxp-controller:delete-entry
121 [source,xml]
122 ----
123 <input xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
124  <ip-prefix>192.168.3.1/32</ip-prefix>
125  <sgt>30</sgt >
126 </input>
127 ----
128 * Get Node Bindings 
129 +
130 This RPC gets particular device bindings. An SXP-aware node is identified with a unique Node-ID. If a user requests bindings
131 for a Speaker 20.0.0.2, the RPC will search for an appropriate path, which contains 20.0.0.2 Node-ID, within locally learnt
132 SXP data in the SXP database and replies with associated bindings.
133 POST http://127.0.0.1:8181/restconf/operations/sxp-controller:get-node-bindings
134 [source,xml]
135 ----
136 <input xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
137  <requested-node>20.0.0.2</requested-node>
138 </input>
139 ----
140 * Get Binding SGTs
141 POST http://127.0.0.1:8181/restconf/operations/sxp-controller:get-binding-sgts
142 [source,xml]
143 ----
144 <input xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
145  <ip-prefix>192.168.12.2/32</ip-prefix>
146 </input>
147 ----
148
149 ==== Use cases for SXP
150 Cisco has a wide installed base of network devices supporting SXP. By including SXP in OpenDaylight, the binding of policy groups to IP addresses can be made available for possible further processing to a wide range of devices, and applications running on OpenDaylight. The range of applications that would be enabled is extensive. Here are just a few of them:
151
152 OpenDaylight based applications can take advantage of the IP-SGT binding information. For example, access control can be defined by an operator in terms of policy groups, while OpenDaylight can configure access control lists on network elements using IP addresses, e.g., existing technology.
153
154 Interoperability between different vendors. Vendors have different policy systems. Knowing the IP-SGT binding for Cisco makes it possible to maintain policy groups between Cisco and other vendors.
155
156 OpenDaylight can aggregate the binding information from many devices and communicate it to a network element. For example, a firewall can use the IP-SGT binding information to know how to handle IPs based on the group-based ACLs it has set. But to do this with SXP alone, the firewall has to maintain a large number of network connections to get the binding information. This incurs heavy overhead costs to maintain all of the SXP peering and protocol information. OpenDaylight can aggregate the IP-group information so that the firewall need only connect to OpenDaylight. By moving the information flow outside of the network elements to a centralized position, we reduce the overhead of the CPU consumption on the enforcement element. This is a huge savings - it allows the enforcement point to only have to make one connection rather than thousands, so it can concentrate on its primary job of forwarding and enforcing.
157
158 OpenDaylight can relay the binding information from one network element to others. Changes in group membership can be propagated more readily through a centralized model. For example, in a security application a particular host (e.g., user or IP Address) may be found to be acting suspiciously or violating established security policies. The defined response is to put the host into a different source group for remediation actions such as a lower quality of service, restricted access to critical servers, or special routing conditions to ensure deeper security enforcement (e.g., redirecting the host’s traffic through an IPS with very restrictive policies). Updated group membership for this host needs to be communicated to multiple network elements as soon as possible; a very efficient and effective method of propagation can be performed using OpenDaylight as a centralized point for relaying the information.
159
160 Although the IP-SGT binding is only one specific piece of information, and although SXP is implemented widely in a single vendor’s equipment, bringing the ability of OpenDaylight to process and distribute the bindings, is a very specific immediate useful implementation of policy groups. It would go a long way to develop both the usefulness of OpenDaylight and of policy groups.
161
162