Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Ping an IP from all WANs and start the session on the one with quickest ping.

    Routing and Multi WAN
    1
    1
    1.3k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • A
      AkkerKid
      last edited by

      I have three ISPs going into my box and I'd like to set up my own kind of load balancing.

      At the start of every session with a particular IP, the router should ping the IP from every available WAN connection and whichever WAN returns the ping fastest, it should start the main portion of the session on that WAN.  The router would then make the sessions sticky to that WAN until it times out.

      Benefits:

      1. You're near guaranteed to use the fastest available link to any particular server.

      2. When one link starts being used up by intensive transfers, the ping time it returns for new connections will lengthen and the router will start using the other connection automatically.

      3. When one link goes down, it's ping time will be infinite.  This would force all connections to automatically fail over to the fastest available link still working.

      4. You're pinging the exact server you're trying to connect to instead of pinging the gateway like typical load balancing. (Gateways aren't always ping-able)

      Cons:

      1. There will be a short delay (in the order of milliseconds) added to the start of each new session.

      2. Sessions would have to be well programmed with memory management in mind for scalability in large traffic environments.

      3. You must chose a link after a certain amount of time (say, 200ms) because some IPs will disregard pings.

      4. A rolling list of IPs and the WAN that was used to connect to them would need to be created and any IP entry not used within a certain amount time would need to be deleted.

      Tell me what you think,
      –AkkerKid

      1 Reply Last reply Reply Quote 0
      • First post
        Last post
      Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.