Live data from Hacker News

65535 interfaces ought to be enough for anybody

aakinshin.net

21–30 of 82 posts

Re: 65535 interfaces ought to be enough for anybody

#21
post #13

Earlier quoted context omitted.

A coworker mentioned that multidexing also take ages and uses huge amounts of memory.

Are there any legitimate use cases for that many methods?

It sounds like a ridiculous number of methods until you realize just importing Guava brings in 20k methods, using half the Amazon SDKs would probably bring another 20k-40k, Apache's main utils bring about 10-20k, etc.

Re: 65535 interfaces ought to be enough for anybody

#23
post #13

Earlier quoted context omitted.

A coworker mentioned that multidexing also take ages and uses huge amounts of memory.

Are there any legitimate use cases for that many methods?

For example, the amazon sdk jar has 40,000 alone or something insane. You can hit if you're using a few large libraries.

That said, you can use proguard to strip your unused methods and it usually fine even for large applications.

Re: 65535 interfaces ought to be enough for anybody

#24
post #12

Any time you have a 16-bit count, it won't be enough. It's a dangerous size...

The same is true of 32 bit numbers. 64 bits might finally be enough. crosses fingers

Well, for counts 32 bits is enough, unless you count something really small, like every individual byte in something.

And for counts 64 bits should be enough, since it's 20 billion billion.

Re: 65535 interfaces ought to be enough for anybody

#25
post #22

Also: 65535 tcp-ports ought to be enough for anybody [1] 65534 hardlinks ought to be enough for anybody [2] [1] http://stackoverflow.com/questions/113224/what-is-the-larges... [2] http://unix.stackexchange.com/questions/5629/is-there-a-limi...

I find it extremely awkward that we actually use numbers for ports. Port 80 is typically used for HTTP, but there's nothing preventing another application from using port 80. Why not call the port "HTTP" instead. Better yet why not give it an integer range of ports to go along with the naming - Eg MyApp[1], MyApp[2].

If you want to hide a port from being probed then give it a GUID as a name. No more port scans.

Re: 65535 interfaces ought to be enough for anybody

#26

Earlier quoted context omitted.

The same is true of 32 bit numbers. 64 bits might finally be enough. crosses fingers

Well, for counts 32 bits is enough, unless you count something really small, like every individual byte in something. And for counts 64 bits should be enough, since it's 20 billion billion.

Assuming you managed to accumulate enough items to fill a 64-bit counter, if you got 1 core of your super-fast PC to increment a 64-bit value for each one, it would take over 100 years to count them all. (Assuming you don't just decide to pop -1 in the counter. Presumably you'd want to make sure you haven't miscounted during the accumulation phase.)

Re: 65535 interfaces ought to be enough for anybody

#27
post #22

Also: 65535 tcp-ports ought to be enough for anybody [1] 65534 hardlinks ought to be enough for anybody [2] [1] http://stackoverflow.com/questions/113224/what-is-the-larges... [2] http://unix.stackexchange.com/questions/5629/is-there-a-limi...

The hard links issue often reared its head on Linux, because a sub-directory has a hard-link to its parent directory called "..". So you could only mkdir 32767 directories in any given directory, which hits you fairly fast if you try to do something like sorting numbered files into "000000/00.txt" etc

Re: 65535 interfaces ought to be enough for anybody

#28
post #22

Also: 65535 tcp-ports ought to be enough for anybody [1] 65534 hardlinks ought to be enough for anybody [2] [1] http://stackoverflow.com/questions/113224/what-is-the-larges... [2] http://unix.stackexchange.com/questions/5629/is-there-a-limi...

The hard links issue often reared its head on Linux, because a sub-directory has a hard-link to its parent directory called "..". So you could only mkdir 32767 directories in any given directory, which hits you fairly fast if you try to do something like sorting numbered files into "000000/00.txt" etc. Apparently ext4 finally fixes it if you enable "dir_nlink"

Re: 65535 interfaces ought to be enough for anybody

#29
post #22

Also: 65535 tcp-ports ought to be enough for anybody [1] 65534 hardlinks ought to be enough for anybody [2] [1] http://stackoverflow.com/questions/113224/what-is-the-larges... [2] http://unix.stackexchange.com/questions/5629/is-there-a-limi...

I find it extremely awkward that we actually use numbers for ports. Port 80 is typically used for HTTP, but there's nothing preventing another application from using port 80. Why not call the port "HTTP" instead. Better yet why not give it an integer range of ports to go along with the naming - Eg MyApp[1], MyApp[2]. If you want to hide a port from being probed then give it a GUID as a name. No more port scans.

Easy to do with DNS SRV records. Just add: _http._tcp.hostname SRV priority weight port target. and you can use any available port you like.

Of course, current TCP has 16-bit ports hard coded. But IPv6 has almost unlimited addresses.

For some reason, SRV records are not in wide spread use.

Post reply on HN