TCP port 70000 on AIX 6.1? (Surely higher than allowed maximum?)

Looking at /etc/services on AIX 6.1, I noticed some bizarre port numbers which exceed the 16-bit maximum port number for TCP (i.e. they are higher than 65535.)

sco_printer 70000/tcp sco_spooler # For System V print IPC
sco_s5_port 70001/tcp lpNet_s5_port # For future use

The file appears to be the original. That is, no other application has changed it:
# lppchk -c bos.net.tcp.client

This is the OS version:
# oslevel -r
6100-02

Is this a bug, since it seems meaningless to have these entries?

the comment "For future use" may stand for both defined services

same under aix5.3

There are no obvious and known limitations by default.

/etc/services is read via getservent > line by line > first match wins
There may a line lenth limit but I have used port 80000 be for for some things

Okay. I have an answer:

The OS simply takes the bottom 16 bits of the port number and connects to that. So, for comparison, I can telnet to the ssh port (22), by connecting to port 65536+22 = 65558. I.e. the 2^16 bit (65536) gets masked off.

root@hostname:/ >telnet localhost 65558
Trying...
Connected to loopback.
Escape character is '^]'.
SSH-2.0-OpenSSH_5.0

Protocol mismatch.
Connection closed.

I tried this on another port too. Also, the same behaviour on Linux. So, presumably connecting to port 70000/tcp is really the same as connecting to 70000-65536 = 4464/tcp.

Anybody knows what's the reason of that? I don't see any.

Interesting, I have never thought about it.

(2^16) + 80 = 65616

http://www.unix.com:65616

The UNIX and Linux Forums - Learn UNIX and Linux from Experts

-----Post Update-----

Because port numbers are 16 bit integers, a long standing Internet standard.