The internet is growing very fast today. On the one hand, it facilitates people's daily lives, but on the other hand, privacy is exposed to potential threats if the necessary security measures are not taken. A network intrusion detection system (IDS) may be equipped with machine learning algorithms for better accuracy and speed to detect or prevent network attacks in this area. Recent research into intrusion detection and anomalies shows the widespread use of machine learning (ML) algorithms to detect malicious Internet traffic, from a neural network to learning a model to display a sequence of connections between computers on a network by analysis and selection.