24 Oct 2002 splork   » (Master)

Places where policy doesn't belong...

A former boss asked on a mailing list if anyone knew how various OSes chose their source ports for TCP and UDP connections. we got answers. i decided to look at the code and supply an answer for linux 2.4.18 and found the following default source port ranges:

  If the system has >=128mb of ram:
     32768-61000
  If the system has 64-127mb of ram:
     1024-4999
  If the system has 32-63mb of ram:
     2048-4999
  If the system has <32mb ram:
     3072-4999

Sigh. Why? This is a policy decision. If someone has a system with low memory and thinks that this will actually make a difference to their system: Run sysctl in a startup script! sheesh.

Note also that the IANA standard for source ports says to pick a number between 49152 - 65535.

Maybe I'll write up a patch, post it and be laughed at. Or maybe i'll be lazy...

Latest blog entries     Older blog entries

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!