## 2 State of the Art
### Implementation of a SDN Approach over Legacy GPON Equipment  
We propose integrating a SDN approach into commercial GPONs using the OpenFlow standard together with the ODL controller and a set of OVSs connected to GPON devices, OLTs and ONTs, to emulate a SDN layer on these devices. Among the different SDN controllers, we have deployed OpenDayLight (ODL), although other OpenFlow compatible controllers could be deployed. For instance, ODL and ONOS are quite featured SDN controllers, since they show high modularity, good productivity, effective for large scale networks and a good Graphical User Interface (GUI) [26; 27]. Moreover, both are open source and benefit from a large developer and user communities under the Linux Foundation Networking. Moreover, ODL can support so many applications, such as new IoT southbound interfaces, that could make it one of the most important future SDN controllers [26]. As a consequence, we selected ODL in our proposal, although other high-performance SDN controllers, such as ONOS, could be deployed in the same way. In this network scenario, the ODL controller will be able to manage the GPON configuration and its services/profiles according to the stipulated QoS requirements by sending OpenFlow messages to every OVS, as it can be observed in Figure 1.  
Therefore, we deploy an OVS (Central OVS, COVS) on a computer connected to the OLT to implement a SDN layer on the OLT to manage the GPON downstream channel (traffic coming from outside the GPON). In the same computer, a router and a DHCP server were installed to control the IP addresses of the connected ONTs. Moreover, we deployed OVSs (Residential OVS, ROVS) on mini computers connected to each ONT to implement and SDN layer on the ONTs to manage the GPON upstream channel (traffic coming from network subscribers). It can be noticed that in the future, the Openflow switches (COVS and ROVS) should be integrated inside OLTs and ONTs (SDN based OLT/ONT), but as commercial GPON equipment do not support SDN it is necessary to emulate a SDN layer. In order to dynamically control our SDN-GPON approach, we have implemented an SDN management layer controlled by ISPs or Network Operators that communicates with SDN controllers (a single ODL controller in our case) to modify the GPON configuration according to the real-time QoS requirements and the traffic conditions. Therefore, the SDN controller/s and the management layer belong to ISPs/Network Operators that provide Internet connections and services to their residential subscribers, such as data (Internet), VoIP (Voice over IP), and HDTV (High-Definition TV). Therefore, the ODL controller sends OpenFlow messages to the different OVSs (OLT, ONTs) following the instructions of the SDN management layer to configure the QoS requirements of services (e.g., guaranteed bandwidth). These instructions are kept in entries (called flows) of the OpenFlow tables that are created and modified by the SDN controller, so that each entry corresponds to specific service QoS requirements. The flow tables are real-time modified and sent by the ODL by means of flows (one flow corresponds to one entry) encapsulated in OpenFlow messages to the different OVSs when QoS requirements or services should be updated in OLTs and ONTs. Each flow has several matches (match conditions), so each provides a condition that must be met in the packets to be part of the flow, that is, a filter condition for packets at each OVS. In our SDN approach, packets are filtered with the MAC address of the ONT to distinguish the traffic of each residential user. Furthermore, as one service in GPONs must be configured for both channels (upstream, downstream) two flows must be created in the ODL, one sent to the corresponding user through its COV (with the downstream QoS requirements) and another to the corresponding ROVS (with the upstream QoS requirements).