O'Reilly logo
  • Sruthi Pakanati thinks this is interesting:

ignoring 0 because it is reserved

From

Cover of Practical Packet Analysis, 2nd Edition

Note

When programming the Sockets interface, the provision of a zero value is generally taken to mean "let the system choose one for me". Programmers who specify "port 0" know that it is an invalid port. They are asking the operating system to pick and assign whatever non-zero port is available and appropriate for their purpose.