# A Comprehensive Survey on Knowledge-Defined Networking
## 3 Knowledge Plane
### Knowledge Generation Plane
#### 3.3.2 Generating Knowledge Using Machine Learning Methods
An ensemble learning approach has been proposed by combining K-nearest neighbor, Naive Bayes, support vector machines, and Self-Organizing Maps (SOMs) to detect anomalous behavior of data traffic in KDN, where the combination of SVM and SOM has resulted in high accuracy and detection rates with a low false alarm rate [178]. Ensemble learning using a random forest and gradient boosting has resulted in better performance than individual supervised machine learning approaches for Virtual Private Network (VPN) traffic classification [179]. Reinforcement Learning Approaches for Generating Knowledge  
Reinforcement learning involves an agent in a given state taking actions to maximize future rewards obtained from the environment. Deep reinforcement learning combines ANN and reinforcement learning to achieve both function approximation and target optimization, mapping states and actions leading to rewards [180]. A Deep Reinforcement Learning (DRL) framework is utilized to train Graph Neural Networks (GNNs) using prioritized experience replay from the experiences learned by the controllers to predict the optimum routing path with the minimum average delay between source and destination nodes [181]. Similarly, another research highlights how closed loop control can be used for automatic routing in a KDN using deep reinforcement learning with the Deep Deterministic Policy Gradient (DDPG) to learn experiential knowledge, which also includes network monitoring to realize the interaction with the environment [44]. Routing optimization by adding a graph neural network to learn using deep reinforcement learning for message passing, which interacts with the network topology environment and extracts exploitable knowledge using the message passing process of information between the links with the goal of load balancing of network traffic, has been studied for KDNs in [182]. Ipv6 low-power wireless personal area networks have a routing protocol called the routing protocol for low-power lossy networks, which determines routes based on rank values and is thus vulnerable to rank attacks, which create non-optimized routes for packet forwarding. An alternative routing framework for the low-power wireless personal area network using the KDN paradigm, which uses reinforcement learning with Direct Acyclic Graphs (DAGs) for routing optimization at the controller having a QoS provisioning packet forwarding scheme preventing rank attacks, has been presented in [183]. A knowledge plane has been added to the SDN where reinforcement learning considering link-state information is utilized for making routing decisions, taking advantage of the global view and control in the KDN paradigm [184]. A reinforcement learning routing algorithm solving a traffic engineering problem in terms of throughput and delay using experience, where an agent learns a policy to suggest better routing paths, has been studied in [185]. To resist the dynamic change in flow control rules when the network is under attack, a deep reinforcement learning-based QoS-aware secure routing protocol has been utilized in a KDN that extracts knowledge from the history of traffic demands to dynamically optimize the routing policy [186]. Using real-time information of network state and flow statistics, a multi-path routing scheme for different flows by training using the Markov Decision Process (MDP) and Q-learning has been used in [187]. In the preceding scheme, remaining flows are redistributed according to the QoS priority to complete multi-path routing when there is no link that satisfies the bandwidth requirement. A global load-balanced routing scheme using reinforcement learning that makes a global policy for routing and load-balancing considering network resources for all flows coming from different sources has been studied in [188].