# SDN-OpenFlow Topology Discovery: An Overview of Performance Issues
## 2 Topology Discovery in SDN Networks
### SDN-Switch Discovery  
According to [58] version 1.5.1, each SDN-Switch must consist of a set of tables, namely, a flow table, a matching table, and a missing table, as well as a control channel to monitor the changing flow in the different SDN-Switches via SDN-Controller. Therefore, in the SDN-OpenFlow, routing processes are based on standard flow tables rather than destination (i.e., IPs or MAC) as in the traditional networks. The flow table is used in conjunction with the logical data structure where packets are processed based on the list of priority entries in these flow tables. In each flow entries for up to 15 fields can be stored in OpenFlow version 1.10 [57], 5 of which are mandatory and the rest are optional. The matching, action, priority, timeout, and counter are the most common fields. Moreover, the SDN-Controller pins these flow entries to the flow table in two approaches: reactive and proactive, and the SDN-Controller determines which one is based on the occurrence of some events. When network activity starts, the SDN-Controller in a reactive approach does not initialize the flow table with any rules. The SDN-Controller will insert rules into the flow table whenever data arrives at switches while the network is running. For the proactive approach, the SDN-Controller will pin the flow entries into the flow table beforehand, when the network is started. The choice of rules is essential in optimizing network performance, particularly in large-scale networks. When packets reach at a switch while the network is running, the incoming packet flow matches the flow entries in the flow table. If no match is found, the SDN-Switch will call the SDN-Controller to request that entries to permit the packet to reach its destination. This includes frequent connections between the SDN-Controller and the SDN-Switch as well as delays before the packet can be transmitted to the next hop. The proactive technique was implemented to reduce the amount of time SDN-Switches and SDN-Controllers had to communicate. Figure 2: Topology discovery processes [29]. In addition, each OpenFlow SDN-Switch is configured with the IP address and the TCP port number of the SDN-Controller. Thus, to join the network, the OpenFlow SDN-Switch creates a TCP session using a three-way handshake (SYN, SYN/ACK, ACK) to initiate the communication with the SDN-Controller. Next, the SDN-Controller sends an OFPT_Features_Request message to the SDN-Switch requesting its current configuration as Media Access Control address (MAC address) and network interfaces. Then, the SDN-Switch will reply with an OFPT_Features_Reply message which contains the requested information. The SDN-Controller stores and uses such information for future network management tasks including re-processing of topology discovery [39]. Figure 3 presents the process of establishing SDN-Switch discovery in SDN networks. After the process of establishing OpenFlow SDN-Switch connection, flow tables will contain the SDN-Switch header information and actions (responsible for giving commands). As illustrated in Figure 2, when the packets are streamed from the data plane to the SDN-Switch, each incoming packet will be checked against the flow tables, when the packet's matching header meets one in the pipeline flow tables, the rules related with the flow entry will be triggered. For each successful match between incoming packet and flow table entries, the counter field will be increased. When the packet flow reaches the input flow table (ingress) and a match is made against flow entries, if no match occurs, it moves to the next flow table using GoTo-Table instruction and then again performs a match with flow entries. This process continues seamlessly until all flow tables are finished, and therefore, the packet will be treated as miss_flow if it does not get a match in one of the flow tables. According to the instructions in the miss_flow entry, it either drops the packet or resends it to the other flow table [56].