How can I diagnose intermittent network failures from my MacBook?
Firstly, do you have problems anywhere else, or just trying to connect to your NAS via your D-Link? 

Consistent problems most other places could point to your Mac. Problems only with your equipment, issue is probably closer to home.

I posted an answer to a similar issue on a 2012 MacBook Air. Nutshell version: Apple has implemented Intel's newer power saving techniques which puts various parts of the computer to sleep a lot sooner and more often than older wifi routers will keep alive. I don't have hands-on experience with this issue and the 2011 MacBook Air.

First question I would ask: How old is your D-Link router? More than a year and it's probably my first target. Log into the router and see if you can find a place to increase the amount of time before a "connection timeout" occurs.

If you cannot find a place to extend timeout values, you might be better off looking to replace the router, especially if you have a computer store with liberal return policy. A safe test to see if it is indeed the router or your laptop is to pick up an AirPort Express (about $100, one WAN, one ethernet, one USB printer) or an AirPort Extreme (about $200, one WAN, three ethernet, one USB for printer or TimeMachine hard drive). Configuration with the AirPort Utility is straightforward.

Hook your NAS up to the ethernet port on the AirPort and start transferring files to and from it with your MacBook Air. If the problems disappear, you can either keep the AirPort or return it and purchase a newer wifi router from another company. I'm sure most newer routers support Intel's deep power saving modes, I just haven't used them.

If you still have problems keeping a connection even with an AirPort, then it's probably your Mac.

Good luck!