So here's my question in a bit more detailed way:
Lets say we have a routing table as follow:
Code: Select all
DST-ADDRESS PREF-SRC GATEWAY CHECK_GATEWAY
Route A: 0.0.0.0/0 192.168.2.2 NO
Route B: 192.168.3.1 192.168.1.2 YES
Route C: 192.168.1.0/24 192.168.1.1
Route D: 192.168.2.0/24 192.168.2.1
We will also assume both Route A and Route B could be used to connect to 192.168.3.1
The question is that how Route B, being valid or invalid, affects the already established connections to 192.168.3.1
If Route B is valid and we establish a connection, the connection goes straight to Route B. and if meanwhile, Route B becomes invalid, the connection breaks immediately and new connection have to be made which goes through Route A.
But if then Route B becomes available again, those connections that are already established through Route A while Route B was unavailable, wont break immediately but with a delay (between a minute or two it appears) . Now i can only associate that with routing cache.
Here's what I think is happening: If the packets are going through Route B and it suddenly becomes unavailable, since it was the active Route, FIB will have to do the routing decision again. but if they are going through Route A and Route B suddenly becomes available again, since Route A is still valid, FIB will not refresh the cache immediately but only after the routing cache entry expires so new routing decision could made .
It also seems such situation, does not apply to ping. and ping packets, always travel the right Routes in time. which could suggest, routing cache does not apply to icmp packets.
Now my question is, am i right and is this what's happening? or did i miss something?
And exactly how long does it take till routing cache expires and FIB starts to do routing decision again?
PS: Although it seems quite obvious, my goal was to create a fail-over system. and it appears that its working. but i would like to know more about this behavior.
Thanks in advance