Determine which gateway is used by a given node