[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

strong host/multihome/routing confusion

Posted on 2009-07-09
12
Medium Priority
?
439 Views
Last Modified: 2012-05-07
hi,

I have an app that makes multiple tcp connections to a server out on the internet. I am binding the client sockets to addresses of interfaces because I want to be able to specify which interface gets used for which connection. The app is working correctly I believe.

However, I have a windows vista machine, that when it is connected to wireless, and I plug in a 3G stick, the wireless gets knocked out - ie the socket bound to the wireless interface can no longer connect and times out. The 3G works fine, and as soon as I pull the 3G out, the wireless can then connect.

I assume the routing table is getting changed in some way by the 3G stick, but I thought the strong host model of Vista would mean it would work fine.

The wireless is on 192.168.1.73 with gateway to net at 192.168.1.254. Below are the routing tables from "route print" before and after I put the 3g usb stick in.

Please can somebody help me understand what is wrong in the second routing table that stops 192.168.1.73 connecting, even though I have bound to that address with the client socket?

Very many thanks in advance and sorry for the wonky tables.
IPv4 Route Table before 3g stick plugged in
===========================================================================
Active Routes:
Code:
 
Network Destination        Netmask          Gateway       Interface  Metric
0.0.0.0         	0.0.0.0    		192.168.1.254     192.168.1.73     25
127.0.0.0        255.0.0.0         On-link         127.0.0.1    306
127.0.0.1  255.255.255.255         On-link         127.0.0.1    306
127.255.255.255  255.255.255.255         On-link         127.0.0.1    306
192.168.1.0    255.255.255.0         On-link      192.168.1.73    281
192.168.1.73  255.255.255.255         On-link      192.168.1.73    281
192.168.1.255  255.255.255.255         On-link      192.168.1.73    281
224.0.0.0        240.0.0.0         On-link         127.0.0.1    306
224.0.0.0        240.0.0.0         On-link      192.168.1.73    284
255.255.255.255  255.255.255.255         On-link         127.0.0.1    306
255.255.255.255  255.255.255.255         On-link      192.168.1.73    281
 
 
And this is after the 3G stick goes in:
 
IPv4 Route Table
===========================================================================
Active Routes:
Code:
 
Network Destination        Netmask          Gateway       Interface  Metric
          0.0.0.0          0.0.0.0    192.168.1.254     192.168.1.73   4250
          0.0.0.0          0.0.0.0         On-link      10.47.27.129     31
          0.0.0.0  255.255.255.255         On-link      10.47.27.129     31
     10.47.27.129  255.255.255.255         On-link      10.47.27.129    286
        127.0.0.0        255.0.0.0         On-link         127.0.0.1   4531
        127.0.0.1  255.255.255.255         On-link         127.0.0.1   4531
  127.255.255.255  255.255.255.255         On-link         127.0.0.1   4531
      192.168.1.0    255.255.255.0         On-link      192.168.1.73   4506
     192.168.1.73  255.255.255.255         On-link      192.168.1.73   4506
    192.168.1.255  255.255.255.255         On-link      192.168.1.73   4506
        224.0.0.0        240.0.0.0         On-link         127.0.0.1   4531
        224.0.0.0        240.0.0.0         On-link      192.168.1.73   4510
        224.0.0.0        240.0.0.0         On-link      10.47.27.129     31
  255.255.255.255  255.255.255.255         On-link         127.0.0.1   4531
  255.255.255.255  255.255.255.255         On-link      192.168.1.73   4506
  255.255.255.255  255.255.255.255         On-link      10.47.27.129    286

Open in new window

0
Comment
Question by:fraccy2
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
  • 3
12 Comments
 
LVL 10

Assisted Solution

by:Datedman
Datedman earned 1200 total points
ID: 24812487
You're getting two routes to 0.0.0.0/0.0.0.0 which will confuse the machine. :)  That's the route to the Internet. Dunno what the 0.0.0.0/255.255.255.255 does really, I've never seen that but it may kind of screw the wireless connect completely?

Oh holy...I just scrolled it over notice that the 3G stick changes the metric on the other interface to 4250 from 25?  Yikes. Dirty pool.
0
 

Author Comment

by:fraccy2
ID: 24812537
But as I understood it, 192.168.1.73 (the wireless) does have a valid route to 0.0.0.0 with the gateway ( which is my router) 192.168.1.254. So I understand there has to be two routes to 0.0.0.0 but shouldn't it work regardless?

I thought, under normal circumstances, or the weak host model like on XP, that that metric would be used to select the interface, so sure the 3g stick would override the wireless. But I'm using vista, and I've bound to the wireless socket. What part does the metric play here?

I forgot to point out the same app works correctly using ethernet and wireless, and the latencies alone make it clear that the correct interfaces are being used in this case. Perhaps this is because ethernet and wireless are going through the same router..?

0
 
LVL 10

Accepted Solution

by:
Datedman earned 1200 total points
ID: 24812577
No, in my experience you can't have two default gateways and have it work (well?)  First of all your 3G is moving the priority of the other gateway off the chart (metric.)  Second, that 0.0.0.0/255.255.255.255 is weird... but in general no it doesn't work to have two default gateways.

What you *can* do is set a route to a specific address through the wireless.  Should work:
route add x.x.x.x 192.168.1.254
Can make it permanent with -p in the route statement.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:fraccy2
ID: 24812607
Thats interesting I could automate that I suppose and I do indeed always know the destination ip, I'll give it a quick go and come back with how I got on, thankyou...
0
 
LVL 10

Assisted Solution

by:Datedman
Datedman earned 1200 total points
ID: 24812619
I have two NICs in this machine works great setting static routes to certain destinations.

Also you probably have software installed for the 3G that may be configurable but hopefully the static route will work in any case.
0
 
LVL 8

Assisted Solution

by:pgolding00
pgolding00 earned 300 total points
ID: 24813671
its the low (lower) metric on the new default route thats killing the wireless interface when 3g is connected. its ok to have multiple routes to the same destination, but if the metrics are different then the lowest number will be used. if the metrics are the same, some os's will load balance, the ms ones mostly just get all confused.
0
 
LVL 10

Expert Comment

by:Datedman
ID: 24813729
Actually it seems the 3g is killing the metric on the OLD default route, bad behavior IMO. :)
0
 
LVL 8

Expert Comment

by:pgolding00
ID: 24814086
agreed, very bad. and its not just increasing them by a little but, its a huge jump.
0
 

Author Comment

by:fraccy2
ID: 24817243
Thank you for your help, it has at least helped me understand what was wrong. My belief that a strong host model was the only thing I needed was clearly mistaken. My final solution will basically be to modify the routing table with custom entries, have had a fiddle and seen enough evidence that its going to work. I still dont fully understand why it *doesnt* work mind, why cant you bind to a source ip, and just have it go through the relevant default gateway?... Anyway, lifes too short :)
0
 
LVL 10

Expert Comment

by:Datedman
ID: 24817483
>relevant default gateway
pick one, relevant or default :)

0
 

Author Comment

by:fraccy2
ID: 24817544
haha ok well what I mean is if 192.168.1.72 has a route to 0.0.0.0, and I bind my client socket to 192.168.1.72 and try and open a connection to someplace out in the ether, why does it suddenly ignore that route just because there is another default route with better metric? I can understand that is what's happening, and you've shown me a way round it, but I still don't understand why..
0
 
LVL 8

Expert Comment

by:pgolding00
ID: 24819716
fraccy2, its just the way routing works. some things have to be mandatory to provide a basis for higher level protocols. sounds like you are suggesting that the oldest default route should be the one to use? if that was how things worked, what happens if you need to make a valid change to the default route and, more relevantly, how can it be automated? example - hop from one wireless ap to another, which might give you a different ip and subnet, so the default route needs to change too.

in summary, the lowest "cost" or metric route to a destination is the one that a host will choose, for IP networking.
0

Featured Post

Tech or Treat!

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you are thinking of adopting cloud services, or just curious as to what ‘the cloud’ can offer then the leader according to Gartner for Infrastructure as a Service (IaaS) is Amazon Web Services (AWS).  When I started using AWS I was completely new…
In the world of WAN, QoS is a pretty important topic for most, if not all, networks. Some WAN technologies have QoS mechanisms built in, but others, such as some L2 WAN's, don't have QoS control in the provider cloud.
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…
The Task Scheduler is a powerful tool that is built into Windows. It allows you to schedule tasks (actions) on a recurring basis, such as hourly, daily, weekly, monthly, at log on, at startup, on idle, etc. This video Micro Tutorial is a brief intro…
Suggested Courses

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question