An anonymous communication system is an overlay network built on top of the Internet that integratedly uses various anonymous technologies such as data forwarding, content encryption and traffic obfuscation to conceal the relationships between the communication entities and hide their communication content from being revealed. Since it is quite difficult to traceback and locate the communication entities, considerable abuse problems have sprung up. Specifically, the hidden services of anonymous network are most often abusively used to establish darknets where diverse illegal activities take place, bringing huge harm to the individuals and society. At present, it lacks comprehensive and deep technical analysis and research survey in the field of anonymous communication system and darknet study. Based on the status quo, this paper first elaborates on the basic concepts of the two terms and their relationships, then continues to demonstrate the work mechanisms and three key technologies of the anonymous communication system in detail including anonymous access, anonymous routing and darknet services with an exemplification of the four mainstream darknets, which are Tor, I2P, Freenet and ZeroNet. On this basis, the paper summarizes the state-of-the-art anonymous communication attacks and defense technology, and introduces the research work on current darknet governance as well. Finally, the developing trend of the next generation anonymous communication system is prospected, and the challenges of the darknet governance and relevant countermeasures are also discussed.