The issue is at the network layer. Reinstalling software is not going to make a difference. Its an intermittent network problem that happens randomly. You are losing network connection. This could be due to a bad cable, wireless interference or other issue.
First step would be to diagram your network out and list out all the various devices and how they're connected to each other.
You mentioned a modem earlier.. modem is used to connect to the internet. The issue here is with your local network, not the internet connection. Is that modem also your own router, or do you have other routers/switches/wifi access points?