The Hukou System
There is a system in China called the Hukou System. This is a class system that registers households and identifies them as pertaining to a certain class. This also goes for geographical areas. It basically says that you can't stay in a place out of your class for longer than three days unless you have a temporary residence permit. This is a system put in place to keep track of how folks are mingling about.
This law was inspired by ancient Chinese traditions that worked to create a caste system. The case file is as follows: Urban or rural status, legal address, religion, physical description, and sector of activity. The goal is to limit internal migration and stop rural residents from moving to cities.