| 137 | |
| 138 | ==== (9/21) ==== |
| 139 | Realizing that the lack of understanding of the Netty libraries was becoming a severe hindrance, we inspect a few documents to get up-to-speed: |
| 140 | |
| 141 | * Netty Channel handlers: http://www.znetdevelopment.com/blogs/2009/04/21/netty-using-handlers/ |
| 142 | * Official Netty getting-started docs: http://docs.jboss.org/netty/3.1/guide/html/start.html |
| 143 | |
| 144 | With the new resources at hand, we re-document the modifications done to the main Floodlight event handler (Controller.java) in order to intercept and respond to messages from both switches and controller units. |
| 145 | |
| 146 | 1. ''The "server-side" channels.'' A control unit expects two types of incoming connections, 1) from switches, and 2) from other units (peer and downstream). These two are identified by default TCP port values of 6633 and 6644, respectively. The switch channel is handles using OFChannelHandler, which implements the classic !OpenFlow handshake. The unit channel, which we add as the UnitChannelHandler to our Controller.java derivative class (!UnitController.java), deals with the inter-unit handshake, which uses a modified version of !OpenFlow. Both are initialized and added to the same !ChannelGroup when the !UnitController run() method is called. |
| 147 | |
| 148 | 2. ''client-side channels.'' A controller unit with upstream or peer units will connect to other units as clients. |