|
| 1 | +# OpenFlow UDP Socket Protocol |
| 2 | + |
| 3 | + |
| 4 | +This project is an implementation of the [OpenFlow Protocol](https://en.wikipedia.org/wiki/OpenFlow) using the [Node.js UDP Datagram Socket Library](https://nodejs.org/api/dgram.html). The core functionality of this system provides a front-end user interface for the client which connects to the OpenFlow Network. |
| 5 | + |
| 6 | +The OpenFlow network consists of a number of **routers** that **forward message**s and are controlled by a centralised switcher. |
| 7 | + |
| 8 | +The switcher is a simple device that allows the routers to communicate with each other. It also allows the routers to communicate with the network. |
| 9 | + |
| 10 | +## Project Structure |
| 11 | +This project is divided into the following sections: |
| 12 | +- [/Server](/Server) |
| 13 | + - Writen in NodeJS using the [dgram](https://nodejs.org/api/dgram.html) module to create a Switcher and a number of Routers. |
| 14 | +- [/Client](/Client) |
| 15 | + - An [ElectronJS](https://www.electronjs.org/) desktop GUI application which provides a user interface that connects to the OpenFlow Network (in /Server). |
| 16 | + |
| 17 | +## Downloading Repository |
| 18 | +``` |
| 19 | +git clone https://github.com/mangledbottles/OpenFlow-Forwarding.git |
| 20 | +
|
| 21 | +cd OpenFlow-Forwarding |
| 22 | +
|
| 23 | +# See documentation inside /Client for installation of ElectronJS application |
| 24 | +# See documentation inside /Server for installation of NodeJS Switcher and Routers |
| 25 | +``` |
| 26 | + |
| 27 | +## Communication Protocol |
| 28 | +Communication between the Switcher, multiple Routers and multiple Clients is handled by a universal Protocol Type system. |
| 29 | + |
| 30 | +| Protocol Type | Description | Components [Origin -> Destination] | |
| 31 | +| ------------- | ----------- | ---------- | |
| 32 | +| #0 | Switcher accepted this current Router on network | Switcher -> Router | |
| 33 | +| #1 | New Router Detected on Network by Switcher | Router -> Switcher | |
| 34 | +| #2 | Router querying Switcher for information about Clients from Forwarding Table | Router -> Switcher | |
| 35 | +| #3 | Client connecting to Router to get information about Forwarding Table | Client -> Router | |
| 36 | +| #4 | Router received information about a Client from Switcher via Flowtable | Switcher -> Router | |
| 37 | +| #5 | Router received message instructions from Client to send message over the network | Client -> Router | |
| 38 | +| #6 | Router received updated information about current Router | Switcher -> Router | |
| 39 | + |
| 40 | +## Project Functionality |
| 41 | + |
| 42 | +1. Switcher is started to commence the network |
| 43 | +2. 3 Routers are started and join the network |
| 44 | +3. A client ("Alice") joins the network and is connected by the Switcher |
| 45 | +4. A secondary client ("Bob") joins the network and is connected by the Switcher |
| 46 | +5. Alice sends a message to Bob |
| 47 | +6. The message is forwarded from Alice to Router 1 to Router 2 to Router 3 and finally to Bob. |
| 48 | + |
| 49 | + |
| 50 | +## Wireshark |
| 51 | +The following diagram shows the communication between the Switcher, Routers and Clients. |
| 52 | + |
| 53 | +### Example 1: Router connecting to Network via Switcher |
| 54 | +| No. | Time | Source | Destination | Protocol | Length | Info | |
| 55 | +| ---- | ---- | ------ | ----------- | -------- | ----- | ---- | |
| 56 | +| 5 | 10.382165 | 127.0.0.1 | 127.0.0.1 | UDP | 61 | 65469 -> 51510 | |
| 57 | + |
| 58 | +| Hexadecimal Payload | Base10 Decoded | |
| 59 | +| ------------------- | -------------- | |
| 60 | +| 0000 0020 7b 22 74 79 70 65 22 3a 31 2c 22 6d 65 73 73 61 | {"type": 1, "messa | |
| 61 | +| 0010 67 65 22 3a 22 52 6f 75 74 65 72 22 7d | ge":"Router"} | |
| 62 | + |
| 63 | +- Router on port 65469 is sending a message to the Switcher on port 51510 trying to join the network. |
| 64 | +- Type is set to 1, as seen in [Communication Table protocol type 1](#Communication-Protocol). |
| 65 | + |
| 66 | +## References |
| 67 | +- [0] OpenFlow - https://en.wikipedia.org/wiki/OpenFlow |
| 68 | +- [1] Node Datagram Library - https://nodejs.org/api/dgram.html |
0 commit comments