As far as I know, before launch operators have to set waypoints that the sub can travel to without communications. Then it can either surface to get more instructions or simply go ahead and execute some set of previously loaded instructions, whatever they may be.
The sub itself doesn't need to surface. It just needs to deploy a float on a long wire to the surface, then reel it back in.