Open more than 65k TCP/IP connections

  • Follow


Hello,
is it any possibility to open more than 65535 TCP/IP connections from
one IP address as client? Because each connection occupied one port, I
can't make more than 65k. Can be established more outgoing connections
(as client) from one port to more different servers simultaneously?
Thank you for any advice.

Ceny

0
Reply ceny (1) 6/12/2006 7:42:27 AM

cenycz wrote:
> Hello,
> is it any possibility to open more than 65535 TCP/IP connections from
> one IP address as client? Because each connection occupied one port, I
> can't make more than 65k. Can be established more outgoing connections
> (as client) from one port to more different servers simultaneously?
> Thank you for any advice.
> 
Why on Earth would you want to?

You can connect to as many servers on the same port as there are
available file descriptors.

-- 
Ian Collins.
0
Reply Ian 6/12/2006 8:11:06 AM


Ian Collins <ian-news@hotmail.com> wrote:
> cenycz wrote:
>> Hello,
>> is it any possibility to open more than 65535 TCP/IP connections from
>> one IP address as client? Because each connection occupied one port, I
>> can't make more than 65k. Can be established more outgoing connections
>> (as client) from one port to more different servers simultaneously?
>> Thank you for any advice.
>> 
> Why on Earth would you want to?
> 
> You can connect to as many servers on the same port as there are
> available file descriptors.

as long as it's less then 64k
0
Reply Cydrome 6/12/2006 11:58:46 AM

Ian Collins wrote:
> cenycz wrote:
> > Hello,
> > is it any possibility to open more than 65535 TCP/IP connections from
> > one IP address as client? Because each connection occupied one port, I
> > can't make more than 65k. Can be established more outgoing connections
> > (as client) from one port to more different servers simultaneously?
> > Thank you for any advice.
> >
> Why on Earth would you want to?
>
> You can connect to as many servers on the same port as there are
> available file descriptors.
>
> --
> Ian Collins.

After making connect near 65k, I receive error "Cannot assign requested
address". There is no problem with available file descriptors. Is it
not possible to increase this count?
Thx

Cenda

0
Reply cenycz 6/12/2006 1:05:58 PM

Hi,

cenycz wrote:
> Ian Collins wrote:
> 
>>cenycz wrote:
>>
>>>Hello,
>>>is it any possibility to open more than 65535 TCP/IP connections from
>>>one IP address as client? Because each connection occupied one port, I
>>>can't make more than 65k. Can be established more outgoing connections
>>>(as client) from one port to more different servers simultaneously?
>>>Thank you for any advice.
>>>
>>
>>Why on Earth would you want to?
>>
>>You can connect to as many servers on the same port as there are
>>available file descriptors.
>>
>>--
>>Ian Collins.
> 
> 
> After making connect near 65k, I receive error "Cannot assign requested
> address". There is no problem with available file descriptors. Is it
> not possible to increase this count?
> Thx
> 
> Cenda
> 

I don't think so, is not the port 16 bit only?

/michael
0
Reply Michael 6/12/2006 1:40:34 PM

cenycz wrote:
> Hello,
> is it any possibility to open more than 65535 TCP/IP connections from
> one IP address as client? Because each connection occupied one port, I
> can't make more than 65k. Can be established more outgoing connections
> (as client) from one port to more different servers simultaneously?
> Thank you for any advice.

Not with TCP, no.  Why on earth would you want to?

--tim

0
Reply Tim 6/12/2006 6:27:13 PM

Tim Bradshaw <tfb+google@tfeb.org> wrote:
> cenycz wrote:
>> Hello,
>> is it any possibility to open more than 65535 TCP/IP connections
>> from one IP address as client? Because each connection occupied one
>> port, I can't make more than 65k. Can be established more outgoing
>> connections (as client) from one port to more different servers
>> simultaneously?  Thank you for any advice.

> Not with TCP, no.  Why on earth would you want to?

In _theory_ since each TCP connection is identified by the four-tuple
of local/remote port and local/remote IP, it should be possible to
have multiple connections from the same local IP/port to different
remote IP/port (think accept() in the other direction).  However, in
practice few if any stacks make that possible - or at least easily
possible.

rick jones
-- 
firebug n, the idiot who tosses a lit cigarette out his car window
these opinions are mine, all mine; HP might not want them anyway... :)
feel free to post, OR email to rick.jones2 in hp.com but NOT BOTH...
0
Reply Rick 6/12/2006 7:02:24 PM

On Mon, 12 Jun 2006 19:02:24 GMT Rick Jones <rick.jones2@hp.com> wrote:
> Tim Bradshaw <tfb+google@tfeb.org> wrote:
>> cenycz wrote:
>>> Hello,
>>> is it any possibility to open more than 65535 TCP/IP connections
>>> from one IP address as client? Because each connection occupied one
>>> port, I can't make more than 65k. Can be established more outgoing
>>> connections (as client) from one port to more different servers
>>> simultaneously?  Thank you for any advice.
>
>> Not with TCP, no.  Why on earth would you want to?
>
> In _theory_ since each TCP connection is identified by the four-tuple
> of local/remote port and local/remote IP, it should be possible to
> have multiple connections from the same local IP/port to different
> remote IP/port (think accept() in the other direction).  However, in
> practice few if any stacks make that possible - or at least easily
> possible.

Doesn't SO_REUSEADDR accomplish this?  Works for me, at least when
specifying the port.

-frank
0
Reply Frank 6/13/2006 4:01:31 AM

Frank Cusack wrote:
> On Mon, 12 Jun 2006 19:02:24 GMT Rick Jones <rick.jones2@hp.com> wrote:
> > Tim Bradshaw <tfb+google@tfeb.org> wrote:
> >> cenycz wrote:
> >>> Hello,
> >>> is it any possibility to open more than 65535 TCP/IP connections
> >>> from one IP address as client? Because each connection occupied one
> >>> port, I can't make more than 65k. Can be established more outgoing
> >>> connections (as client) from one port to more different servers
> >>> simultaneously?  Thank you for any advice.
> >
> >> Not with TCP, no.  Why on earth would you want to?
> >
> > In _theory_ since each TCP connection is identified by the four-tuple
> > of local/remote port and local/remote IP, it should be possible to
> > have multiple connections from the same local IP/port to different
> > remote IP/port (think accept() in the other direction).  However, in
> > practice few if any stacks make that possible - or at least easily
> > possible.
>
> Doesn't SO_REUSEADDR accomplish this?  Works for me, at least when
> specifying the port.
>
> -frank

I thought SO_REUSEADDR can be the solution (I have the parameter from
beginning), however the error is with this parametr initialized.
I can't use this parameter with specifying the source port, because
bind doesn't know the target address+port and directly returns error
(it's parameter in connect) .

Ceny

0
Reply cenycz 6/13/2006 6:27:59 AM

On 12 Jun 2006 23:27:59 -0700 "cenycz" <ceny@email.cz> wrote:
> Frank Cusack wrote:
>> On Mon, 12 Jun 2006 19:02:24 GMT Rick Jones <rick.jones2@hp.com> wrote:
>> > Tim Bradshaw <tfb+google@tfeb.org> wrote:
>> >> cenycz wrote:
>> >>> Hello,
>> >>> is it any possibility to open more than 65535 TCP/IP connections
e>> >>> from one IP address as client?
....
>> Doesn't SO_REUSEADDR accomplish this?  Works for me, at least when
>> specifying the port.
>>
> I thought SO_REUSEADDR can be the solution (I have the parameter from
> beginning), however the error is with this parametr initialized.
> I can't use this parameter with specifying the source port, because
> bind doesn't know the target address+port and directly returns error
> (it's parameter in connect) .

Perhaps you could rephrase that.

-frank
0
Reply Frank 6/13/2006 10:36:36 PM

Frank Cusack wrote:
>
> Doesn't SO_REUSEADDR accomplish this?  Works for me, at least when
> specifying the port.
>
> -frank

As client I can't specify port, how do you do it?

example -
soc1 = socket(..)
...
setsockopt(soc1, SOL_SOCKET, SO_REUSEADDR...)
bind(soc1,...) // specifying port 1
connect(soc1, server_1) // everything ok - first connection from port 1
is established
...
soc2 = socket(..)
...
setsockopt(soc2, SOL_SOCKET, SO_REUSEADDR...)
bind(soc2,...) // specifying port 1
-> I receive error, port already used.

Without bind works OK, but every port can be used only once.

Cenda

0
Reply cenycz 6/14/2006 12:55:44 PM

"cenycz" <ceny@email.cz> writes:

>Without bind works OK, but every port can be used only once.

When connecting to the same server, yes, because the tuple

	<lport, laddr, rport, raddr>

needs to be unique.

So one TCP/IP client can have at most 65K connections to a single
server IP+port.

Casper
0
Reply Casper 6/14/2006 1:05:57 PM

11 Replies
375 Views

(page loaded in 0.202 seconds)

Similiar Articles:


















7/25/2012 1:43:28 AM


Reply: