-
Notifications
You must be signed in to change notification settings - Fork 1
Home
Welcome to the project wiki!
This project aims to use an SDN controller (Ryu) and a physical OpenFlow SDN switch (Zodiac FX) to monitor Netflix usage among one or more users. A rough overview of the project is detailed below.
The setup is as follows:
Note 1: In some large establishments (eg. universities), it may be their policy to avoid having multiple users (i.e. multiple MAC addresses) connected to the same ethernet port. Thus, a switch would end up being blocked if connected directly. However, using a router in between the switch and the ethernet port can overcome this problem as the router would be seen only as one MAC address.
Note 2: Using a second router increases the number of users that can be connected instead of being limited by the number of ports on the Zodiac FX switch. Also, it simplifies the code that needs to be written on the Zodiac FX.
Note 3: The second router (right) has DHCP disabled to avoid double NAT which could be a problem while trying to stream Netflix. With single NAT, the user would be assigned an IP address by the first router (which has DHCP enabled).
Before we begin, the Zodiac FX must be configured (this can be done by accessing the CLI using a serial communication tool like minicom). While configuring the Zodiac FX, keep in mind that:
-
The Controller IP address must point to the IP address of the computer running RYU.
-
The Gateway IP must be set to the IP address of the first router (i.e. the router connected directly to the ethernet wall port)
Next, we need to insert flows onto the Zodiac FX switch. To do this, we run an OpenFlow Controller REST API application on RYU called ofctl_rest. This application allows us to easily add flows and retrieve flow statistics using REST commands.
Initially, there will be two basic flows on the Zodiac FX to make it act as a dumb switch. Packets coming in to Port 1 would be forwarded to Port 2 and packets coming in to Port 2 would be forwarded to Port 1. This would simply allow the users to access the internet.
Here is the output to GET after installing the two flows:
{ "123917682135395": [
{ "actions": [ "OUTPUT:2" ], "idle_timeout": 0, "cookie": 0, "packet_count": 0, "hard_timeout": 0, "byte_count": 0, "duration_sec": 102, "duration_nsec": 0, "priority": 11111, "length": 88, "flags": 0, "table_id": 0, "match": { "in_port": 1 } }, { "actions": [ "OUTPUT:1" ], "idle_timeout": 0, "cookie": 0, "packet_count": 0, "hard_timeout": 0, "byte_count": 0, "duration_sec": 35, "duration_nsec": 0, "priority": 11111, "length": 88, "flags": 0, "table_id": 0, "match": { "in_port": 2 } }] }
Then, flows are installed for all IP ranges known to be associated with Netflix. These IP ranges are read from a plaintext list of IP ranges scraped from the Hurricane Electric BGP Toolkit - the file can be found in the repo. These flows have a higher priority than the initial flows in order for them to take precedence.
Upon a match with these Netflix flows (for example, when a client begins watching a Netflix video), the packet is sent to the controller, where a separate PACKET_IN function will add a new flow.
(Explain about the packet in handler here when done)
The new flow matches the client's MAC address, effectively allowing the switch to track the Netflix usage of each client.
