Bitcoin Forum
April 16, 2024, 06:11:55 PM *
News: Latest Bitcoin Core release: 26.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Running bitcoind across multiple connections  (Read 1022 times)
dave111223 (OP)
Legendary
*
Offline Offline

Activity: 1190
Merit: 1001


View Profile WWW
November 04, 2014, 10:24:14 AM
 #1

I have bitcoind setup with a fallback connection on the network.

So if the primary internet connection goes down, a secondary backup connection automatically kicks in.

The problem is that when the connection/IP is changed all existing peer connections hang and take really long time to connect to different peers.

Possible solutions:
- Is there a way to set a peer ping timeout?  So that if a peer takes longer than say 10seconds it is replaced
- Is there a way to force bitcoind to reconnect/replace all new peer connections?

I'm guessing many of the existing peers are already tied up with the primary connection IP, so potentially do not have any free spots for the new IP, so probably would need to find new peers.
1713291115
Hero Member
*
Offline Offline

Posts: 1713291115

View Profile Personal Message (Offline)

Ignore
1713291115
Reply with quote  #2

1713291115
Report to moderator
1713291115
Hero Member
*
Offline Offline

Posts: 1713291115

View Profile Personal Message (Offline)

Ignore
1713291115
Reply with quote  #2

1713291115
Report to moderator
1713291115
Hero Member
*
Offline Offline

Posts: 1713291115

View Profile Personal Message (Offline)

Ignore
1713291115
Reply with quote  #2

1713291115
Report to moderator
The trust scores you see are subjective; they will change depending on who you have in your trust list.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1713291115
Hero Member
*
Offline Offline

Posts: 1713291115

View Profile Personal Message (Offline)

Ignore
1713291115
Reply with quote  #2

1713291115
Report to moderator
1713291115
Hero Member
*
Offline Offline

Posts: 1713291115

View Profile Personal Message (Offline)

Ignore
1713291115
Reply with quote  #2

1713291115
Report to moderator
1713291115
Hero Member
*
Offline Offline

Posts: 1713291115

View Profile Personal Message (Offline)

Ignore
1713291115
Reply with quote  #2

1713291115
Report to moderator
2112
Legendary
*
Offline Offline

Activity: 2128
Merit: 1065



View Profile
November 04, 2014, 11:37:39 AM
 #2

So if the primary internet connection goes down, a secondary backup connection automatically kicks in.
What do you mean by "automatically kicks in"?

I've seen many multihomed machines with incorrectly set up routing tables that continue to send packets via if1 with the source address of if0. With correctly set up routing the ICMP no-route replies take care of closing stale if0 sockets.

Please comment, critique, criticize or ridicule BIP 2112: https://bitcointalk.org/index.php?topic=54382.0
Long-term mining prognosis: https://bitcointalk.org/index.php?topic=91101.0
dave111223 (OP)
Legendary
*
Offline Offline

Activity: 1190
Merit: 1001


View Profile WWW
November 04, 2014, 12:14:05 PM
 #3

So if the primary internet connection goes down, a secondary backup connection automatically kicks in.
What do you mean by "automatically kicks in"?

I've seen many multihomed machines with incorrectly set up routing tables that continue to send packets via if1 with the source address of if0. With correctly set up routing the ICMP no-route replies take care of closing stale if0 sockets.


The connection switching is done at the router; nothing changes on the actual machine (the primary/backup internet connection is for the entire network).
2112
Legendary
*
Offline Offline

Activity: 2128
Merit: 1065



View Profile
November 04, 2014, 12:36:29 PM
 #4

The connection switching is done at the router; nothing changes on the actual machine (the primary/backup internet connection is for the entire network).
Sounds like your "router" is actually a "NAT gateway/router". Get a better one doing a proper maintenance of the NAT state which will close all the stale NAT entries and send proper ICMP responses (edit: or TCP RST) to your machine.

Please comment, critique, criticize or ridicule BIP 2112: https://bitcointalk.org/index.php?topic=54382.0
Long-term mining prognosis: https://bitcointalk.org/index.php?topic=91101.0
spin
Sr. Member
****
Offline Offline

Activity: 362
Merit: 261


View Profile
November 04, 2014, 12:51:17 PM
 #5

I run a bitcoind that is available on two external IPs at the same time.   You need to forward your port 8333 on both external connections on the router to the machine running bitcoind in your internal network.  Plus you need some rule/process for determining which outgoing connections go out via which interface.

If both connections are alive at the same time you should appear to the world as to separate nodes on your two external ips.  If you only turn on the secondary ip when the first fails you would have some time for the existing nodes to go stale.  I think it's 90mins.  Of course your outbound connections should refresh sooner but old connections may sit there for 90mins before formally closed.

Also from the point of view of bitcoin your external ip has changed.  You need to probably implement this PR for it to work well, otherwise it may never advertise the new external ip:
https://github.com/bitcoin/bitcoin/pull/5161

Also see https://github.com/bitcoin/bitcoin/issues/48

In my case I do not need ot advertise the second ip so it's not an issue.

If you liked this post buy me a beer.  Beers are quite cheap where I live!
bc1q707guwp9pc73r08jw23lvecpywtazjjk399daa
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!