You mean like an ASW Helicopter ? One that was dropping torpedoes on the submarine ?
Let's start with that one and then we can move on to airplanes at 15,000 feet and climbing. How does the sub know where the helicopter is so it can shoot the missile at it?