How does an application communicate the desired source port to the kernel ?

eg. for a known application, source ports are fixed. So how does kernel know about that fixed port.

TIA,
Gaurav