The magnetoresistance of mesoscopic NiFe rings is studied by low temperature magnetotransport measurements and numerical simulations. In order not to disturb the magnetic states in the electrical transport measurements, nonmagnetic gold wires are attached to individual rings. The simulations compute the change in resistance that is caused by the anisotropic magnetoresistance (AMR) effect and are based on a combination of magnetostatics for the magnetic domain configuration and electrostatics for the current distribution. Measurements as well as simulations reveal the presence of two stable "onion" states at remanence and a stable "vortex" state near the switching fields. Moreover, a quantitative comparison between experiment and simulation is possible without the use of any free fitting parameters. Apart from the AMR effect, no additional domain wall resistance has to be introduced for the onion state. In the switching region, experiment and simulation reveal the presence of a "stressed vortex" configuration which plays a key role in the quantitative description of the magnetoresistance. The switching behavior of the NiFe rings can be modified by introducing a wedge shaped notch at the expected position of one of the domain walls in the onion state of the rings.