Merge "SNMP4SDN Project Documents: get started guide, user guide, developer guide"
[docs.git] / manuals / developer-guide / src / main / asciidoc / snmp4sdn / snmp4sdn-developer.adoc
1 == SNMP4SDN Developer Guide
2 === Overview
3 We propose a southbound plugin that can control the off-the-shelf commodity Ethernet switches for the purpose of building SDN using Ethernet switches. For Ethernet switches, forwarding table, VLAN table, and ACL are where one can install flow configuration on, and this is done via SNMP and CLI in the proposed plugin. In addition, some settings required for Ethernet switches in SDN, e.g., disabling STP and flooding, are proposed.
4
5 .SNMP4SDN as an OpenDaylight southbound plugin 
6 image::snmp4sdn_in_odl_architecture.jpg["SNMP4SDN as an OpenDaylight southbound plugin",width=400]
7
8 === Architecture
9 The modules in the plugin are depicted as the following figure. 
10
11 .Modules in the SNMP4SDN Plugin
12 image::snmp4sdn_modules.jpg["Modules in the SNMP4SDN Plugin",width=400]
13
14 * AclService: add/remove ACL profile and rule on the switches.
15 * FdbService: add/modify/remove FDB table entry on the switches.
16 * VlanService: add/modify/remove VLAN table entry on the switches.
17 * TopologyService: query and acquire the subnet topology.
18 * InventoryService: acquire the switches and their ports.
19 * DiscoveryService: probe and resolve the underlying switches as well as the port pairs connecting the switches. The probing is realized by SNMP queries. The updates from discovery will also be reflected to the TopologyService.
20 * MiscConfigService: do kinds of settings on switches
21 ** Supported STP and ARP settings such as enable/disable STP, get port's STP state, get ARP table, set ARP entry, and others
22 * VendorSpecificHandler: to assist the flow configuration services to call the switch-talking modules with correct parameters value and order.
23 * Switch-talking modules
24 ** For the services above, when they need to read or configure the underlying switches via SNMP or CLI, these queries are dealt with the modules SNMPHandler and CLIHandler which directly talk with the switches. The SNMPListener is to listen to snmp trap such as link up/down event or switch on/off event.
25
26 === Design
27 In terms of the architecture of the SNMP4SDN Plugin's features, the features include flow configuration, topology discovery, and multi-vendor support. Their architectures please refer to Wiki (https://wiki.opendaylight.org/view/SNMP4SDN:Developer_Guide#Design[Developer Guide - Design]).
28
29 === Installation and Configuration Guide
30 * Please refer to the 'Getting Started Guide' in https://www.opendaylight.org/downloads, find the SNMP4SDN section.
31 * For the latest full guide, please refer to Wiki (https://wiki.opendaylight.org/view/SNMP4SDN:Installation_Guide[Installation Guide], https://wiki.opendaylight.org/view/SNMP4SDN:User_Guide#Configuration[User Guide - Configuration]).
32
33 === Tutorial
34 * For the latest full guide, please refer to Wiki (https://wiki.opendaylight.org/view/SNMP4SDN:User_Guide#Tutorial_.2F_How-To[User Guide - Tutorial]).
35
36 // === Commit the code via Git CLI
37 // The steps to commit code is the same with controller's project, please refer to Wiki (https://wiki.opendaylight.org/view/OpenDaylight_Controller:Pulling,_Hacking,_and_Pushing_the_Code_from_the_CLI#Commit_the_code_via_Git_CLI[here]). Just note to replace the Git location as 
38 // ----
39 // ssh://username@git.opendaylight.org29418/snmp4sdn.git
40 // ----
41
42 === Programmatic Interface(s)
43 SNMP4SDN Plugin exposes APIs via MD-SAL with YANG model. The methods (RPC call) and data structures for them are listed below.
44
45 ==== TopologyService
46 * RPC call
47 ** get-edge-list
48 ** get-node-list
49 ** get-node-connector-list
50 ** set-discovery-interval (given interval time in seconds)
51 ** rediscover
52
53 * Data structure
54 ** node: composed of node-id, node-type
55 ** node-connector: composed of node-connector-id, node-connector-type, node
56 ** topo-edge: composed of head-node-connector-id, head-node-connector-type, head-node-id, head-node-type, tail-node-connector-id, tail-node-connector-type, tail-node-id, tail-node-type
57
58 ==== VlanService
59 * RPC call
60 ** add-vlan (given node ID, VLAN ID, VLAN name)
61 ** add-vlan-and-set-ports (given node ID, VLAN ID, VLAN name, tagged ports, untagged ports)
62 ** set-vlan-ports (given node ID, VLAN ID, tagged ports, untagged ports)
63 ** delete-vlan (given node ID, VLAN ID)
64 ** get-vlan-table (given node ID)
65
66 ==== AclService
67 * RPC call
68 ** create-acl-profile (given node ID, acl-profile-index, acl-profile)
69 ** del-acl-profile (given node ID, acl-profile-index)
70 ** set-acl-rule (given node ID, acl-index, acl-rule)
71 ** del-acl-rule (given node ID, acl-index)
72 ** clear-acl-table (given node ID)
73
74 * Data structure
75 ** acl-profile-index: composed of profile-id, profile name
76 ** acl-profile: composed of acl-layer, vlan-mask, src-ip-mask, dst-ip-mask
77 ** acl-layer: IP or ETHERNET
78 ** acl-index: composed of acl-profile-index, acl-rule-index
79 ** acl-rule-index: composed of rule-id, rule-name
80 ** acl-rule: composed of port-list, acl-layer, acl-field, acl-action
81 ** acl-field: composed of vlan-id, src-ip, dst-ip
82 ** acl-action: PERMIT or DENY
83
84 ==== FdbService
85 * RPC call
86 ** set-fdb-entry (given fdb-entry)
87 ** del-fdb-entry (given node-id, vlan-id, dest-mac-adddr)
88 ** get-fdb-entry (given node-id, vlan-id, dest-mac-adddr)
89 ** get-fdb-table (given node-id)
90
91 * Data structure
92 ** fdb-entry: composed of node-id, vlan-id, dest-mac-addr, port, fdb-entry-type
93 ** fdb-entry-type: OTHER/INVALID/LEARNED/SELF/MGMT
94
95 ==== MiscConfigService
96 * RPC call
97 ** set-stp-port-state (given node-id, port, is_nable)
98 ** get-stp-port-state (given node-id, port)
99 ** get-stp-port-root (given node-id, port)
100 ** enable-stp (given node-id)
101 ** disable-stp (given node-id)
102 ** delete-arp-entry (given node-id, ip-address)
103 ** set-arp-entry (given node-id, arp-entry)
104 ** get-arp-entry (given node-id, ip-address)
105 ** get-arp-table (given node-id)
106
107 * Data structure
108 ** stp-port-state: DISABLE/BLOCKING/LISTENING/LEARNING/FORWARDING/BROKEN
109 ** arp-entry: composed of ip-address and mac-address
110
111 ==== SwitchDbService
112 * RPC call
113 ** reload-db
114 (The following 4 RPC implemention is TBD)
115 ** add-switch-entry
116 ** delete-switch-entry
117 ** clear-db
118 ** update-db
119
120 * Data structure
121 ** switch-info: compose of node-ip, node-mac, community, cli-user-name, cli-password, model
122
123 === Help
124 * https://wiki.opendaylight.org/view/SNMP4SDN:Main[SNMP4SDN Wiki]
125 * SNMP4SDN Mailing List (https://lists.opendaylight.org/mailman/listinfo/snmp4sdn-users[user], https://lists.opendaylight.org/mailman/listinfo/snmp4sdn-dev[developer])
126 * https://wiki.opendaylight.org/view/SNMP4SDN:User_Guide#Troubleshooting[Latest troubleshooting in Wiki]
127