I was wondering how many simultaneous sockets a linux box can open for TCP, UDP and ICMP communications in IPv4 and IPv6. While there are several replies about handling incoming (mainly TCP) connections, I didn't see a clear statement about outgoing.
My understanding is as follows:
TCP: as TCP is based on ports, one can only open a number of sockets equal to the number of ephemeral ports, which on my box is
cat /proc/sys/net/ipv4/ip_local_port_range 32768 60999 # == 28231
If I want to increase that number (without changing the above configuration), I would need to create additional interfaces and I would gain about 28K additional connections per interface, right ?
Is there any per system process consideration to be taken here ?
I can see that working with additional (virtual) interfaces and public IPs, but will that still work if I define private IPs on virtual interfaces and NAT them through a unique public IP?
UDP: I believe the same holds for UDP as UDP also uses ports. If I have both UDP and TCP traffic, both would compete for the 28K ports, right ?
ICPM: ICMP is not based on ports so what is the limit on the number of open (raw) sockets ? Is it taken from the max number of opened FD pool:
cat /proc/sys/fs/file-max 9223372036854775807
IPv6: all above was IPv4 related, but what are the differences between IPv4 and IPv6 on that matter ?
This is a bit messy as things are not very clear for me. Thanks in advance for your enlightenment!