You need to do your research on flash units. The highest-ranking Nikon speedlight of any era has almost always been their best flash unit, with high capability, and high build quality, PERFECT functioning, and FULL inter-operability with the entire current Nikon system of its era. Oh, and high price. But, we're talking about a flash that will easily last 10 years, or longer, in normal use. I have some older 25 year-old Nikon flashes that still work. Nikon flash units are NOT built like cheapie Chinese flashes...nor are tbhey priced to compete with them either.
When I say do research, I mean to learn exactly what the features are of a potential flash; Sunpak for example, makes a lower-grade of flash unit for Nikon that doesn't have much "control", compared to their higher-end Sunpak flash model. Saving a few dollars, or even a hundred dollars, might not be the best value for you. Metz makes some fine flash units, not inexpensive. There are a number of new, Chinese-made flashes hitting the market. Prices are low. Many are fairly simple technology. The D3100 does not have FP Synch type high-speed flash outdoors, and is a lower-end body without the high-end Nikon wireless flash features found on mid- and high-end cameras. So...research...kind of helpful to know what you're getting...