Interstellar communication. III. Optimal frequency to maximize data rate