# RMHIL: A Rule Matching Algorithm Based on Heterogeneous Integrated Learning in Software Defined Network

^{1}

^{2}

^{*}

## Abstract

**:**

## 1. Introduction

## 2. Problem Description and Transformation

#### 2.1. Problem Description

#### 2.2. Problem Transformation

## 3. Algorithm Design and Implementation

#### 3.1. Algorithm Design

Algorithm 1: Decision Tree Construction Algorithm (DTC) |

1: Input: initial root node ${\mathrm{x}}_{0}$. |

2: Initialize parameters ($\mathsf{\theta},\mathsf{\omega},\mathsf{\lambda}$), $\mathsf{\lambda}\in \left[0,1\right]$; |

3: For ($\mathrm{n}=0;\mathrm{n}<\mathrm{N};\mathrm{n}++$) |

// N is the maximum number of iterations. |

4: get $\mathsf{\pi}(\mathrm{x}|\mathrm{a},\mathsf{\theta})$; |

5: $\mathrm{x}={\mathrm{x}}_{0}$; |

6: while $\mathrm{f}\left(\mathrm{x}\right)\ne 0$ |

// f(x) = 0 if and only if x is a leaf node. |

7: $\mathrm{a}=\mathsf{\pi}(\mathrm{x}|\mathrm{a},\mathsf{\theta});$ |

8: $\mathrm{x}=\mathrm{NextNode}\left(\mathrm{x},\mathrm{a}\right);$ |

// NextNode(x,a) is to select the next non-leaf node in depth-first traversal order. |

9: NandA(${\mathrm{x}}_{0}$)$\leftarrow \mathrm{x},\mathrm{a}$; |

// NandA(${\mathrm{x}}_{0}$) is used to record all pairs $\left(\mathrm{x},\mathrm{a}\right)$. |

10: End while |

11: $\mathrm{d}\mathsf{\theta}=0,\mathrm{d}\mathsf{\omega}=0;$ |

12: get ${\mathrm{V}}_{\mathrm{n}}\left(\mathrm{x},\mathsf{\omega}\right)$ according to formula (3); |

13: For each$\left(\mathrm{x},\mathrm{a}\right)\in \mathrm{NandA}\left({\mathrm{x}}_{0}\right)$ |

14: get R from environment; |

15: $\mathrm{d}\mathsf{\omega}=\mathrm{d}\mathsf{\omega}+\partial {\left({\mathrm{V}}_{\mathrm{n}}\left(\mathrm{x},\mathsf{\omega}\right)-\mathrm{R}\right)}^{2}/\partial \mathsf{\omega}$; |

16: d$\mathsf{\theta}=\mathrm{d}\mathsf{\theta}+(\partial (\mathsf{\pi}(\mathrm{x}|\mathrm{a},\mathsf{\theta})/\partial \mathsf{\theta})\xb7(\partial \left({\mathrm{V}}_{\mathrm{n}}\left(\mathrm{x},\mathsf{\omega}\right)-\mathrm{R}\right)/\partial \mathsf{\pi}(\mathrm{x}|\mathrm{a},\mathsf{\theta}))$; |

17: End for |

18: $\mathsf{\theta}=\mathsf{\theta}+\mathrm{d}\mathsf{\theta},\mathsf{\omega}=\mathsf{\omega}+\mathrm{d}\mathsf{\omega};$ |

19: End for |

20: Output: strategy $\mathsf{\pi}(\mathrm{x}|\mathrm{a},\mathsf{\theta})$, value function ${\mathrm{V}}_{\mathrm{n}}\left(\mathrm{x},\mathsf{\omega}\right)$ |

Algorithm 2: Rule Matching Algorithm based on Heterogeneous Integrated Learning (RMHIL) |

1: Input: a flow packet and a set of rules |

2: Call Algorithm 1 (DTC) to get strategy $\mathsf{\pi}\text{}(\mathrm{x}|\mathrm{a},\mathsf{\theta});$ |

3: Construct a decision tree of the rule set according to the optimal strategy; |

4: Traverse the decision tree to select the highest priority rule. |

5: Output: the rule matching the flow packet |

#### 3.2. Algorithm Implementation

## 4. Comparative Experimental and Performance Verification

#### 4.1. Matching Time

#### 4.2. Memory Overhead

## 5. Conclusions

- (1)
- With the continuous expansion of network scale and the continuous increase of SDN functional requirements, the most commonly used 5-field matching method will be difficult to meet the demand. Therefore, we must consider the 40-field rule matching. Although the sample construction method is simple and the software is ready, the strategy generation and value function calculation of a large number of 40-field real samples take a lot of time. It is planned to be completed in the next step, and then the algorithm performance test is performed based on the sample.
- (2)
- The algorithm proposed in this paper does not have obvious advantages in memory usage. We consider fusing as the means of reducing the rule overlap problem in the CutTSS algorithm (first dividing the rule set and then constructing the decision tree in parallel) or designing efficient and feasible solutions for the characteristics of the algorithm.
- (3)
- We do not use the countdown in the traditional sense when measuring the matching time.
- (4)
- A custom standard is used to facilitate comparative experiments. To further optimize the matching time of the algorithm proposed in this paper, we consider using GPU version TensorFlow, AWS cloud computing service platform, and other acceleration methods.

## Author Contributions

## Funding

## Data Availability Statement

## Conflicts of Interest

## References

- Zainab, Z.; Vasilis, F.; Zarrar, Y. Will SDN Be Part of 5G? IEEE Commun. Surv. Tutor.
**2018**, 20, 3220–3258. [Google Scholar] - Li, H.; Lu, H.; Fu, X. An optimal and dynamic elephant flow scheduling for SDN-based data center networks. J. Intell. Fuzzy Syst.
**2020**, 38, 247–255. [Google Scholar] [CrossRef] - Stanford University. Clean Slate Program. Available online: http://cleanslate.stanford.edu/ (accessed on 1 June 2021).
- McKeown, N. Software-Defined networking. In Proceedings of the INFOCOM Key Note, Rio de Janeiro, Brazil, 19–25 April 2009. [Google Scholar]
- Zhang, J.J.; Ye, M.H.; Guo, Z.H. CFR-RL: Traffic Engineering with Reinforcement Learning in SDN. IEEE J. Sel. Areas Commun.
**2020**, 38, 2249–2259. [Google Scholar] [CrossRef] - Lu, L. Multi-path allocation scheduling optimization algorithm for network data traffic based on SDN architecture. IMA J. Math. Control. Inf.
**2020**, 37, 1237–1247. [Google Scholar] [CrossRef] - Zhang, H.; Tang, F.; Barolli, L. Efficient flow detection and scheduling for SDN-based big data centers. J. Ambient. Intell. Humaniz. Comput.
**2019**, 10, 1915–1926. [Google Scholar] [CrossRef] - Guo, Z.H.; Dou, S.S.; Liu, S. Maintaining Control Resiliency and Flow Programmability in Software-Defined WANs During Controller Failures. IEEE/ACM Trans. Netw.
**2021**, 1, 1–16. [Google Scholar] [CrossRef] - Zhou, T.Q.; Cai, Z.P.; Xia, J. Traffic engineering for software defined networks. Ruan Jian Xue Bao/J. Softw.
**2016**, 27, 394–417. [Google Scholar] - Xu, X.; Chen, Y.; Hu, L. MTSS: Multi-path traffic scheduling mechanism based on SDN. J. Syst. Eng. Electron.
**2019**, 30, 974–984. [Google Scholar] - Yan, L. Analysis of recursive and non-recursive algorithms for traversing binary trees. Comput. Knowl. Technol.
**2011**, 24, 5941–5942. [Google Scholar] - Liu, P.; Feng, G.L. Analysis and Application of Graph Depth-First Search Traversal Algorithm. J. Qinghai Norm. Univ.
**2007**, 3, 41–44. [Google Scholar] [CrossRef] - Zhu, H. Nested Set Model Application Series Articles. Available online: https://blog.csdn.net/ (accessed on 3 June 2021).
- Gupta, P.; McKeown, N. Packet classification using hierarchical intelligent cuttings. In Proceedings of the Hot Interconnects, Stanford, CA, USA, 18–20 August 1999. [Google Scholar]
- Singh, S.; Baboescu, F.; Varghese, G. Packet classification using multidimensional cutting. In Proceedings of the Conference of the 2003 Conference on Applications, Technologies, Architectures, and Protocols for Computer Communications, Karlsruhe, Germany, 25–29 August 2003. [Google Scholar]
- Balajee, V.; Gwendolyn, V.; Vijaykumar, T.N. EffiCuts: Optimizing Packet Classification for Memory and Throughput. ACM SIGCOMM
**2010**, 40, 207–218. [Google Scholar] - Li, W.J.; Li, X.F.; Li, H. CutSplit: A DecisionTree Combining Cutting and Splitting for Scalable Packet Classification. In Proceedings of the IEEE INFOCOM 2018-IEEE Conference on Computer Communications, Honolulu, HI, USA, 15–19 April 2018. [Google Scholar]
- Li, W.J.; Yang, T.; Rottenstreich, O. Tuple Space Assisted Packet Classification with High Performance on Both Search and Update. IEEE J. Sel. Areas Commun. (JSAC)
**2020**, 38, 1555–1569. [Google Scholar] [CrossRef] - Viktor, S.; Pavol, H.; Ivan, K. Performance analysis of OpenFlow forwarders based on routing granularity in OpenFlow 1.0 and 1.3. In Proceedings of the 19th Conference of Open Innovations Association (FRUCT), Jyväskylä, Finland, 7–11 November 2016. [Google Scholar]
- Valentyn, N.S. Reinforcement Learning Algorithms in Global Path Planning for Mobile Robot. In Proceedings of the International Conference on Industrial Engineering, Applications and Manufacturing (ICIEAM), Sochi, Russia, 25–29 March 2019. [Google Scholar]
- Tian, Y.; Wang, Z.L.; Yin, X. Traffic Engineering in Partially Deployed Segment Routing Over IPv6 Network With Deep Reinforcement Learning. IEEE/ACM Trans. Netw.
**2020**, 28, 1573–1586. [Google Scholar] [CrossRef] - Sun, P.H.; Lan, J.L.; Li, J.F. A Scalable Deep Reinforcement Learning Approach for Traffic Engineering Based on Link Control. IEEE Commun. Lett.
**2021**, 25, 171–175. [Google Scholar] [CrossRef] - Militani, D.R.; de Moraes, H.P.; Rosa, R.L.; Wuttisittikulkij, L.; Ramírez, M.A.; Rodríguez, D.Z. Enhanced Routing Algorithm Based on Reinforcement Machine Learning: A Case of VoIPService. Sensors
**2021**, 21, 504. [Google Scholar] [CrossRef] [PubMed] - Anoop, J.; Doina, B.; Abhishek, V. Comparison of Deep Reinforcement Learning Approaches for Intelligent Game Playing. In Proceedings of the IEEE 9th Annual Computing and Communication Workshop and Conference (CCWC), Las Vegas, NV, USA, 7–9 January 2019. [Google Scholar]
- Eric, L.; Hang, Z.; Xin, J. Neural Packet Classification. In Proceedings of the Conference of the ACM Special Interest Group on Data Communication, London, UK, 11–15 November 2019. [Google Scholar]
- NetFlow. Available online: http://www.cisco.com/c/en/us/products/ios-nx-os-software/ios-netflow/index.html (accessed on 1 June 2021).
- Zhou, Z.H. Machine Learning; Tsinghua University Press: Beijing, China, 2016. [Google Scholar]

**Figure 3.**This is a recurrent neural network model, where a is the parameter passed between the cyclic units.

Source IP/IPv6 Address | Destination IP/IPv6 Address | TCP/UDP Source Port Number | TCP/UDP Destination Port Number | Protocol | Instructions Set | Counters | Priority | Timeout | Cookie |
---|---|---|---|---|---|---|---|---|---|

1.0.0.0/32 | 1.0.1.0/32 | * | * | TCP | drop | 3 | 0 | 00:50 | A |

* | * | 0 | 20 | TCP | add | 5 | 1 | 00:39 | B |

* | * | * | * | TCP | change | 4 | 2 | 00:27 | C |

Data Set | The Number Of Rules | Magnitude | Data Set | The Number of Rules | Magnitude | Data Set | The Number of Rules | Magnitude |
---|---|---|---|---|---|---|---|---|

1 | 799 | 1000 | 11 | 7298 | 10,000 | 21 | 75,100 | 100,000 |

2 | 846 | 1000 | 12 | 8772 | 10,000 | 22 | 83,752 | 100,000 |

3 | 857 | 1000 | 13 | 8833 | 10,000 | 23 | 83,797 | 100,000 |

4 | 863 | 1000 | 14 | 9039 | 10,000 | 24 | 83,966 | 100,000 |

5 | 934 | 1000 | 15 | 9377 | 10,000 | 25 | 88,081 | 100,000 |

6 | 942 | 1000 | 16 | 9418 | 10,000 | 26 | 96,078 | 100,000 |

7 | 961 | 1000 | 17 | 9476 | 10,000 | 27 | 98,180 | 100,000 |

8 | 970 | 1000 | 18 | 9591 | 10,000 | 28 | 99,052 | 100,000 |

9 | 990 | 1000 | 19 | 9655 | 10,000 | 29 | 99,318 | 100,000 |

10 | 990 | 1000 | 20 | 9774 | 10,000 | 30 | 99,480 | 100,000 |

Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. |

© 2022 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

Guo, Y.; Hu, G.; Shao, D.
RMHIL: A Rule Matching Algorithm Based on Heterogeneous Integrated Learning in Software Defined Network. *Sensors* **2022**, *22*, 4739.
https://doi.org/10.3390/s22134739

**AMA Style**

Guo Y, Hu G, Shao D.
RMHIL: A Rule Matching Algorithm Based on Heterogeneous Integrated Learning in Software Defined Network. *Sensors*. 2022; 22(13):4739.
https://doi.org/10.3390/s22134739

**Chicago/Turabian Style**

Guo, Yiping, Guyu Hu, and Dongsheng Shao.
2022. "RMHIL: A Rule Matching Algorithm Based on Heterogeneous Integrated Learning in Software Defined Network" *Sensors* 22, no. 13: 4739.
https://doi.org/10.3390/s22134739