It is indeed a number and you get it by issuing the socket(2)
system call. It is stored in the process's task_struct
and you need it to send or receive data.
More exactly, the kernel uses the file descriptor to locate File Objects
stored in the files_struct
struct inside the task_struct
. It behaves like a bitmap where the number of the file descriptor represents the position the File Object
occupies inside that structure.