Navies already have a lot to worry about between rival warships and aircraft, but it's only going to get worse when drone swarms of all kinds threaten to overwhelm their defenses. The US Navy might not have that problem, though: DARPA just tapped Raytheon for the second phase of a smart bullet development project that will help fight off swarming attacks. The MAD-FIRES project (Multi Azimuth Defense Fast Intercept Round Engagement System) should lead to ammo that's as fast and small as what you'd find in a medium-caliber gun (20- to 40-caliber), but with the guidance of a missile. if a horde of robotic flyers appeared, a vessel could theoretically take all of them out even if they're approaching from different directions.
Raytheon is expected to finish its work on the second phase by March 2018, so you won't have too long to wait for results. And it's unlikely to be alone when DARPA expects to hand out multiple contracts. Lockheed Martin should be on the short list, for instance. It could still be a while before MAD-FIRES smart bullets enter Navy service, but the relatively close deadline shows that this isn't some far-off, pie-in-the-sky dream.