Re: XMPP connections
Hello, A typical XMPP server will open only one port, port 5222. All clients will connect to that port so in theory an almost unlimited number of connections are possible to that server. This is not particular to XMPP but is a basic TCP/IP client/server feature, exactly the same goes for other services for instance a web server. The 65536 port limit is a client limit, not a server limit. A client can not have more than 65536 connections open to any other host at the same time (65536 is theoretical, in reality this number will be much lower). Regards, Eric. On 11/26/13 11:41, Haider Ali wrote: Hi Everyone Can anyone let me know that how XMPP handle so many connections. Since we know that we can only open 2 ^ 16 = 65536 ports ( connections ) with a single machine. But i came to know that single xmpp server can handle more connections than 65536.
Re: XMPP connections
Hi, On Tue, 26 Nov 2013 at 11:41, Haider Ali wrote: Can anyone let me know that how XMPP handle so many connections. Since we know that we can only open 2 ^ 16 = 65536 ports ( connections ) with a single machine. But i came to know that single xmpp server can handle more connections than 65536. your assumption that there can only be a single connection per port number at a time is wrong. A combination of local IP address and port can be used for many connections at once as long as the remote IP address *or* the remote port number are different between each of them. Server sockets do this automatically with every call to accept(), but for client sockets you have to set the SO_REUSEADDR option to allow a second bind() while socket using the same port number is still open. cu Reinhard
Re: XMPP connections
On Tue, 26 Nov 2013 at 12:09, Eric Koldeweij wrote: The 65536 port limit is a client limit, not a server limit. A client can not have more than 65536 connections open to any other host at the same time (65536 is theoretical, in reality this number will be much lower). A client can even have more connections to a single server as long as all combinations of local and remote port numbers are distinct. So, the actual (theoretical) limit is 64k^2 connections per unique combination of local and remote IP addresses. Or in other words, it is the combination of local IP address, local port number, remote IP address and remote port number that uniquely identifies a TCP connection and if only one of these four values is different we are looking at two separate connections that can exist in parallel. cu Reinhard
Re: XMPP connections
Dnia 2013-11-26, wto o godzinie 01:41 -0900, Haider Ali pisze: Since we know that we can only open 2 ^ 16 = 65536 ports ( connections ) with a single machine. That's a common myth. Google is your friend: http://www.quora.com/TCP-IP/What-is-the-maximum-number-of-simultaneous-TCP-connections-achieved-to-one-IP-address-and-port The TCP/IP standard sets up unique connection identifiers as the tuple of local IP Address, local TCP port number, remote IP address, and remote TCP port number. In your example, the local numbers are both fixed, which leaves approximately 2^32 remote IP (version 4) addresses, and 2^16 TCP port numbers, or an approximate total potential simultaneous TCP connections of 281,474,976,710,656 (2^48, or 2.81 * 10^14, or 281 trillion).