### Homework 6 - Understanding bellman ford

by Johnny Borkhoche -
Number of replies: 2

Hello,

Question regarding the very last question of the last problem (routing in the presence of link failures). I have some confusion regarding how BF updates tables:

- After the link failure, clearly in R1's table it's distance to R2 is set to +inf, and it lost the information from R2. It is symmetrical in R2's table.

- After the first exchange, I am lost regarding when does R1 publicize to others that it can reach R2 with cost 3 (through R3). Does R1 update this information in it's table before the first exchange with its neighbors? It could technically do that since after the link failure, we can see in R1's table that it knows that R3 can reach R2 with cost 1, and R1 knows that it can reach R3 with cost2. Or does R1 update this information after the first exchange of information with its neighbors? But if so, it would mean that during the exchange it told others that it can't reach R2. However in the solution, the tables of router R3 and R4 are filled assuming that R1 told them about it's new path to R2 (indeed, in R3's tables we can see inf in the R1/R2 cells due to poisoned reverse, and in R4's tables the R1/R2 cells show cost 3, R4 knows that R1 can reach R2 with cost 3).

Which of the two scenarios is correct? I couldn't figure it out ^^
Thanks!

### Re: Homework 6 - Understanding bellman ford

by Katerina Argyraki -

It's a good question Johnny.

We can actually divide the time "after the failure" into two parts:

- The time *immediately* after the failure, at which moment R1 thinks its cost to R2 is infinite.

- The time after R1 has processed the situation, has looked in its current table for an alternative route, and has realized that it can already each R2 via R3. R1 does this *before it exchanges new information* with its neighbors. This is why we still count it as "immediately after the failure," i.e., before the "next iteration."

In general: After a failure occurs, each router that's adjacent to the failed link registers the failure and checks whether it has an alternative route to the neighbor given its existing table. This all counts as "right after the failure," i.e., before the "next iteration."

Clear?