The term "NAS" is short for "network-attached storage." It is a type of storage drive that is specifically designed to be shared over a wired or wireless network. Just because a drive is on the network doesn't mean that you can't use the native Windows "Disk Defragmenter" tool to defragment it. You just have to do so from the computer to which the network-attached storage drive is physically connected.
Click "System Tools."
Click "Disk Defragmenter." Click on the listing for the network-attached storage device you want to defragment. Click the "Defragment" button to defrag your network-attached storage drive.