With the continuous development of the network society and the frequent occurrence of network attacks, people's demand for network intrusion detection is increasing. The method of intrusion detection is basically to design a classifier that can distinguish the normal and abnormal data in the data stream, so as to realize the alarm of the attack behavior. This article will use the KDD99 data set in the academic circle to test the quality of intrusion detection algorithms to provide a unified performance evaluation benchmark for intrusion detection systems. This article will build a classifier based on the KNN algorithm, and use the 10% training set in the data set to train the classifier, and then use the corrected test set to test the classifier performance.