# A Comprehensive Survey on Knowledge-Defined Networking
## 5 Control Plane
### Control Models
#### 5.3.2 Packet vs. Flow Control  
In conventional networks, the basic unit of control is the packet, where packets are routed using the information contained in the headers, such as source IP, destination IP, etc. Thus, the highest level of granularity of control is packet control. Fine-grained packet forwarding refers to the ability to direct traffic using specific criteria, such as packet content. The following are some advantages of fine-grained packet control. Due to its high level of granularity, fine-grained control of traffic can increase flexibility and decrease network congestion. Additionally, it enables the development of network rules tailored specifically for each application to enhance performance. Additionally, it can boost network visibility, which helps with debugging. The following are some disadvantages of fine-grained packet control. It may introduce more overhead in control plane communication as individual rules for each packet need to be installed in the switches by the control plane, thus increasing the latency and slowing down the network. It can be complex to implement in large networks, such that its scalability is low. An attacker may use fabricated fine-grained forwarding to forward traffic to a compromised server by bypassing security measures. The traditional OpenFlow protocol implements packet-based flow rules that send a packet-in message to the controller when the switch is unaware of the flow rule for a packet (when a flow table mismatch occurs), where the controller will compute routes and update the flow table entry of the switch. This reactive approach of OpenFlow for packet control is a high-granularity control approach that introduces vulnerabilities in denial of service attacks as well [339]. A routing protocol for cluster-based KDN where packet matching for flow tables using 14 header match fields has been proposed in research [340]. A fine-grained traffic monitoring system that generates flow rules for such fine-grained traffic using a Markov decision process and a double-deep Q-network algorithm constrained by the expected level of statistics details and flow-table limits has been implemented as a high-granular control method [341]. A technique for reducing overhead for control plane communication for packet forwarding, where a buffer is created in the switch for flow table mismatches and collected mismatched entries are buffered and sent to the controller to reduce control plane overhead and increase switch overhead, has been studied in [342]. A system that attempts to prevent IP spoofing attacks using an IP source validation scheme that has granularity in IP packets, with subnet-level granularity for intra-domain and IP address-based granularity for inter-domain, has been studied in [343]. Considering the fact that the controller enables a fine level of granularity for controlling traffic and creating forwarding rules, the work in [344] shows that attackers can predict and reconstruct these forwarding rules. A unified controller known as Magneto for fine-grained path control in KDN and legacy hybrid networks, which uses magnet MAC addresses to dynamically map IP addresses to magnetic MAC addresses at hosts using the address resolution protocol, has been used for routing [345]. A fine-grained security policy implementation has been feasible for the controller with the aid of virtual networks, which deny unauthenticated access to the network [346]. A fine granular inter-domain routing matching multiple IP header fields with the aid of the OpenFlow protocol for routing control can also reduce redundant flow entries for inter-domain settings [347]. When thinking in terms of applications, they send packets as a flow of many packets, such as QoS-based flows. Thus, applications may be better served using flow-based control. Furthermore, abstraction of flows can result in aggregated flows that can be matched to obtain the required task. Let us briefly discuss the pros and cons of coarse-grained flow control. Some advantages of coarse-grained flow control follow.