I have both the SB400 and the SB600 and use both. They serve very well for the situations I intended them for and I don't think I can say one is "better" than the other, as such.
The SB400 is more compact, inexpensive, and shoots faster than the SB600. It's excellent for fill in daylight and powerful enough inside to illuminate people at the distances I prefer to shoot.
The SB600 (and the same can be said for the 700/800 and 900 models) are larger, have more power/reach and allows angling of the head in two dimensions (the SB400 goes only up and down). The 800+900 (possibly also the 700 - I haven't checked) have built-in flash command - which means they can command several other flash-groups - very helpful with the D3100 which does not have this feature built-in! But they are also heavier and charge slower and are significantly more expensive.
So, like everything else it's a trade-off.
I chose to have both, because on a given day of shooting, I don't want to haul the big flashes along, just to generate some fill - but I want to be able to gel the flash (a yellow gel for sunlight, for example) to get decent color-balance of skin tones and this is harder do with the built-in flash. I also want to be able to angle/bounce the flash - also impossible with the built-in flash - and finally, I want to shoot fast and not deplete the camera-battery. So for that, the SB400 is absolutely excellent. It's also an extremely easy flash to operate - turn it on and that's it.
The SB600 I use for events and serious portraiture session. It either shoots up into a dome diffuser or is mounted on my bracket and shoots backwards into a mounted 24" umbrella. None of which the SB400 can do. But that's a pretty cumbersome and heavy rig and it burns through a lot of AA batteries..lol.
So, "the best" flash for you, depends entirely on how and where you shoot. I'd be reluctant to agree with the suggest to "just go for the 600/700" just because it's "better". For long sessions, carrying such a large flash on top of the lightweight D3100 gives awkward balance, slows you down (you don't whip that around the same way you'd do with the SB400) and will not inherently give you better flash lighting, unless you shoot outside the capacity/range of the SB400. Besides, if you are venturing into flash-photography, without knowing that you will be using flash all the time, testing out the waters first with the SB400 first for $125 is not a bad idea. And, if you eventually DO decide to really get into flash-photography, you WILL come to love the SB400 even more because of it's weight and ease of use...
Good luck with your choice!