Alt.Binz forum
New Alt.Binz versions => Requests => Closed requests => Topic started by: TheGreatVirus on May 12, 2010, 09:32:25 am
-
Please add multi WAN support! I use multiple WAN connections daily and being able to assign threads to a different WAN connection wold make this app AMAZING on so many levels! Please consider it!
-
Can't you try modifying your OS or router? Play with the routing tables.
-
would it not be cooler to just add it into the application?
-
this would be great.
there are some good newsreader out there, but not one has this ability.
got 2 connections myself.
would be great if alt.binz could use 10 connections from one router and 10 from the second one.
shared account or even 2 accounts.
this could speed up downloads.
you can't modify your os or router that way.
-
That's because an application doesn't have to need to know how to get to some point.
multi-wan routers aren't built for something like that either.
You can more or less "force" to use the 2 connections if you have a spare pc, and setup a static route to the server on that one, while you use the other route on your computer.
But yet again multi-wan routers aren't made for that purpose, they (90% of the time) send traffic with the same destination IP over the same line. It would wreak havoc otherwise. (go look up how TCP works.)
If you have 2 computers in your network with their own PPPoE/internet connection, then it becomes a whole different story.
If you have 2 seperate usenet accounts on separate providers it's actually quite easy.
Check the ranges on the servers, and just setup your multi-wan router with those as static routes. (if you're able to that is, but i guess it would be a shame to publish a multi-wan router w/o any type of ruleset capability)
-
Is their any chance we can get this feature? I have been waiting for over a year now...
-
I'm not sure it's even possible
-
Anything is possible.
Simply tie (assign) some of the threads to a different adapter.
I have coded apps in the past to support the ability to select an adapter for net use.
An example would be 10 threads to one adapter and 10 to another.
Newsgroups would be one the few things this would be Ok with as it downloads in chunks.
-
I don't think binding to different adapter will do the job. I don't see how would it be possible without messing with routes.
-
I have coded apps in the past to support the ability to select an adapter for net use.
Please point me to or send me example of such application.
-
Bumping this feature request.
The backend is actually quite simple to implement. Most of the work would be in the UI to assign specific NIC cards to each server.
When you call bind() on the socket, you pass the local address associated with a specific network card. All traffic for that socket will then travel through this specific network card. You typically need to assign a different Newsgroup provider account per network card because otherwise they will think you're sharing accounts due to traffic coming from different IP addresses.
The user will handle the rest. He will assign each network card to a specific router/gateway for each ISP. I do this right now. I have one internal NIC assigned to one ISP and a second USB Ethernet adapter assigned to another ISP. It would be great if altbinz allowed me to download from serverA over one network adapter and download from serverB on the other adapter.
-
I know this is a tricky feature, probably not as easily implemented as what has been suggested, but I'd definitely add my support to it as well.
I currently have two ADSL connections (for reasons too complicated to get into at the moment) and having Multi-WAN support would definitely be useful, but of course, it only works with News Servers which accept two separate IP addresses, so maybe a block account with some providers or if you are lucky, maybe you can use one account with two IP addresses (rare, but possible).
At the moment, I have two separate computers set up with Alt.Binz, one connected to each ADSL modem/router/gateway so I can download via both connections - not ideal, but it works for the moment.
I'd rather have some way of load balancing across two modems - from a laptop that could be achieved using Wireless on one and Wired LAN on the other I guess.
I'll defer to rdl to see whether he thinks it is even possible to implement, but I'd definitely find it useful.
Thanks in advance. Cheers.
-
I'm still waiting for someone to point me to application that is able to receive from 2 network adapters...
-
Actually rdl you have a good point
People interested in load balancing could have a look at these options I've researched below:
A networking engineer colleague of mine suggested Zeroshell WAN balancing:
http://www.zeroshell.net/listing/internet_load_balancing.pdf
zeroshell looks the most promising and have a good look at the PDF I've linked as it has an excellent example of the type of situation many people are talking about - two different WANs with a load balancer in the middle.
My colleague also mentioned ClearOS as a possible solution.
He suggested that might be the easiest to set up if I didn't want to outlay any money on new routing hardware to test load balancing (and for testing, just re-purpose an old pc or find the cheapest SFF pc with two NICs).
Here's another software solution I found while researching:
ForceBindIP
https://r1ch.net/projects/forcebindip
Here's some practical example here with links to GUI front ends:
https://www.raymond.cc/blog/bind-windows-application-to-specific-network-adapter-with-forcebindip/
But that only works if you want to bind *one* particular application to a particular IP address - this wouldn't work for what people are suggesting - you'd need two instances of Alt-Binz running, each bound to a different IP and I think that very much defeats the original request. However, it might suit someone who wants to force all their NSP traffic down one WAN and general browsing down another.
- a another way might be to use Windows' own route tables:
Found online here: http://superuser.com/questions/224783/how-to-take-advantage-of-two-internet-connections-wifi-wired
e.g. If you have a big download and you check that it is coming from a server whose IP address is 10.10.10.199 then add a route in windows routing table as
route delete 0.0.0.0
route add 10.10.10.0 mask 255.0.0.0 10.2.1.1 metric 10
route add 0.0.0.0 mask 0.0.0.0 192.168.15.1 metric 20
First line will remove your default route. i.e Windows will not forward packets via one interface.
Second line tells it to route all traffic destined for 10.10.10.X here X can be any number between 0-255 to go through interface whose IP is 10.2.1.1. It will also give it a metric of 10 (lower the metric the more preferred that route is).
Third line adds a default gateway. Route all the traffic which you cant find any route command through this interface. It will pass rest of all traffic through 192.168.15.1 interface.
Using the example above, providing you have two separate ethernet adapters (and the key here would be, could you use the WiFi *AND* the LAN port on a laptop at the same time?), make sure the two different modems have different IP subnets ranges.
Using this solution, potentially you could add a route for each Newshost's server - but it doesn't give you any fine control - only by the metric number, the lower the number, the more preferred the route will be.
I also found another piece of software called iNetFusion which *might* achieve a similar result, but I'd have to look at it further, and it's not free.
http://www.clusterlinks.com
http://www.clusterlinks.com/features
Also as I eluded to at the start, a load balancing router will do the job, but there's no way to specify which packets go up which path without adding static routes - which shouldn't be too difficult - again, not a Alt.binz specific solution, but you might be able to add route tables so that one news host routes up one WAN in preference to another.
I've been looking at a Ubiqiti Edgerouter Lite which will load balance two WANs - but I've had no practical experience with it.
This example below, shows a TP Link TL-R480T+ Router which can combine up to four WANs:
http://www.techkhoji.com/how-to-combine-multiple-internet-connections/
One important thing to consider - a re-purposed PC is going to cost you real $$ in terms of power cost - as an example, my colleague suggested the following:
If you work on around 130w for a desktop machine (the older they are, typically the more power they consume) at an average rate of AUD$0.28 cents per kWh (that's about average here in my state, but varies all over AU, and of course all over the world) that = ~$320/year to run. An Edgerouter Lite at 5w works out to around $12/year - or about $1 month."
So he makes a good point here, re-purposing an old PC to run ClearOS, Zeroshell or another type desktop PC solution, is going to be expensive in terms of power consumption, where as a dedicated Load Balancing capable router such as the TP Link I mentioned or the Edgerouter Lite, is going to be much cheaper.
I know this doesn't help the thread specifically, but at least I'm looking into some options. ;)
Regards.
-
I'm not sure whether this helps rdl, but my colleague found this:
https://github.com/falahati/NetworkAdapterSelector
Both parts of the solution are in pure C# using EasyHook library and SharpShell framework. It was a little experiment to see how stable is EasyHook and how SharpShell can perform in terms of performance.
Tested by a colleague of mine using Arch Linux:
simple test code(linux(should work on windows))
import socket
s = socket.socket()
s.bind((get_ip_address('eth0'),0))
s.connect(('http://www.google.com/',80))
forced it through eth0 on test 1
then I reran and forced it through wlan0
I'm not sure whether it will be compatible with your existing code, but maybe it is worth investigating?
He is happy to discuss directly with you on irc if you like.
Cheers.
-
I'm still waiting for someone to point me to application that is able to receive from 2 network adapters...
That's the whole point. There is no usenet client currently available that supports two network adapters. That's why we're asking for this feature. It would be unique to altbinz and might get more people to use it.
I already explained above how to implement it but I can go into more details if you need. The only change is to your winsock Bind() call in order to specify which network card to use. That's what the ForceBindIP() application does. It patches all your calls to Bind() to make them use a specific local address.
My current altbinz work-around is to add static routes for specific news servers. Something like this:
route add x.y.0.0 MASK 255.255.0.0 192.168.1.101
Replace x.y from the IP address of your news server. Replace 192.168.1.101 with the IP address of the gateway associated with your second network card.
I left the other parts of the address as 0.0 because most providers have multiple servers for load-balancing. Sometimes the x.y also changes for their backup servers so you may need to add multiple routes to make sure they all use your second network adapter. You can use task manager to verify that traffic is going through your secondary network adapter. Having this feature built into altbinz would make life much easier since you would not need to keep updating the IP address of your news provider when they add or change servers.
Mixing wifi and ethernet is fine. You just need a different network card associated with each gateway/ISP. I use a USB->Ethernet adapter for my slower ISP.
-
I'm still waiting for someone to point me to ANY windows application that is able to send/receive from 2 network adapters at the same time in one instance...
You can easily bind to secondary NIC, just as ForceBindIP does, BUT after that all trafic in that instance goes over that NIC. You can try to bind again, but it still goes over the NIC you first bind to.
I really can't be more clearer, so unless someone points me to the right app, I say this can't be done without messing with the routes.
-
Freeproxy binds to multiple nics and forwards traffic to any of those nics. It runs as a single process or service. I used to use it for forwarding usenet before switching to static routes.
Are you working in C/C++? If I have some spare time I can try making you a proof-of-concept demo.
-
I'll take a look at freeproxy.
-
I verified this works fine to connect a single process client through 2 different NICs to the same server. The server process accepted two connections. One from 192.168.1.7 and the other from 192.168.1.102. Here is most of the code for the client. I can give you server code as well but it's not important for this example. Your server setup window in altbinz would need to have 3 fields: address, port, and optional local ip. If you look at freeproxy, you can see they have a drop-down list of network cards instead of local bind address - this just makes it easier for the user but is not required.
const char *serverAddressStr = "your news server url or ip";
int nPort = 119; //server port
const char *localNicAddressStr[2] = { "192.168.1.7", "192.168.1.102" }; //addresses assigned to each of your network cards.
u_long serverAddress = inet_addr(serverAddressStr);
if (serverAddress == INADDR_NONE)
{
// serverAddressStr isn't a dotted IP, so resolve it through DNS
hostent* pHE = gethostbyname(serverAddressStr);
if (pHE == 0)
return INADDR_NONE;
serverAddress = *((u_long*)pHE->h_addr_list[0]);
}
SOCKET sd[2];
//connect each network card to the server
for (int i = 0; i < 2; ++i)
{
sd[i] = socket(AF_INET, SOCK_STREAM, 0);
if (sd[i] != INVALID_SOCKET) {
sockaddr_in sinRemote;
sinRemote.sin_family = AF_INET;
sinRemote.sin_addr.s_addr = serverAddress;
sinRemote.sin_port = htons(nPort);
sockaddr_in sinInterface;
u_long nLocalAddr = inet_addr(localNicAddressStr[i]);
sinInterface.sin_family = AF_INET;
sinInterface.sin_addr.s_addr = nLocalAddr;
sinInterface.sin_port = 0; //assign automatic port
if (bind(sd[i], (sockaddr*)&sinInterface, sizeof(sockaddr_in)) != SOCKET_ERROR)
{
if (connect(sd[i], (sockaddr*)&sinRemote, sizeof(sockaddr_in)) == SOCKET_ERROR)
sd[i] = INVALID_SOCKET;
}
}
}
//send and receive message from each network card
const char* EchoMessage = "Echo Message";
const int EchoMessageLen = strlen(EchoMessage);
for (int i = 0; i < 2; ++i)
{
if (send(sd[i], EchoMessage, EchoMessageLen, 0) != SOCKET_ERROR)
{
//get reply from server
char ReadBuffer[128];
int TotalBytes = 0;
while (TotalBytes < EchoMessageLen)
{
int NewBytes = recv(sd[i], ReadBuffer + TotalBytes, 128 - TotalBytes, 0);
TotalBytes += NewBytes;
}
}
}
-
Done