Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: jackjack on April 17, 2013, 08:38:50 PM



Title: Listening behind a router
Post by: jackjack on April 17, 2013, 08:38:50 PM
I'm not really into networking and I'm wondering how satoshi client can listen to ports behind a router
I know that upnp does that, but even when I compiled (I may be wrong, it's years ago) without upnp, it's still able to connect to the network (that famous 8-limit)

So:
  • Is it possible to listen behind a router without upnp? If so, how?
  • Or is it connecting to 8 nodes (that have open ports) instead of listening?


Title: Re: Listening behind a router
Post by: Schleicher on April 17, 2013, 11:22:18 PM
The client is actively trying to connect to other clients until the connection limit is reached.
Listening is only possible with UPnP enabled or if you change the router's settings.


Title: Re: Listening behind a router
Post by: grue on April 18, 2013, 01:46:25 AM
  • the client always tries to maintain 8 outgoing connections. this can be done even behind NAT/router
  • the client always listens for incoming connections, accepting until the connection limit is reached
  • the client advertises itself on the network, allowing other clients to open outbound connections to it
If your client's ability to accept incoming connections is hampered (NAT, router, firewall, improper port-forwarding, ISP restrictions), other clients will not be able to connect to you. The only way to exceed 8 connections is to have incoming connections (or editing the source to open more outgoing connections *not recommended*)


Title: Re: Listening behind a router
Post by: jackjack on April 18, 2013, 07:22:30 AM
Thanks guys
Do we know the ratio outgoing-only/upnp enabled clients?


Title: Re: Listening behind a router
Post by: grue on April 18, 2013, 05:29:36 PM
Thanks guys
Do we know the ratio outgoing-only/upnp enabled clients?
1. get a list of peers using getpeerinfo RPC command
2. use telnet to open a TCP connection
3. if the tcp connection succeeds, the screen will turn black, and will eventually boot you back to command prompt. if it fails, it will say connection refused or similar.