Options

count to infinity

hodgey87hodgey87 Member Posts: 232
hi all,

could anyone please explain count to infinity

thanks

Comments

  • Options
    -prophet--prophet- Member Posts: 62 ■■□□□□□□□□
    I found more then a handful of sites on Google explaining the problem:

    http://wiki.uni.lu/secan-lab/Count-To-Infinity+Problem.html

    http://computer.howstuffworks.com/routing-algorithm4.htm

    etc...

    Cheers,
    -prophet-
  • Options
    NetstudentNetstudent Member Posts: 1,693 ■■■□□□□□□□
    Counting to infinity is just another name for a routing loop. In distance vector routing, routing loops usually occur when an interface goes down, or when two routers send updates to each other at the same time.

    You really need a nice pictorial to fully understand it. See in Distance Vector routing, one metric is hop count. When a router sends an update to a neighbor, it first increments the hop count of each route in the update by 1.

    Say router A has a directly connected subnet 192.168.1.0 255.255.255.0, when routerA sends an update to RouterB, routerA increments the hop copunt by 1. So the directly connected route on RouterA has a hop count of 0, but when it sends the update to RouterB, routerA increments it so that RouterB knows that 192.168.1.0 is 1 hop away. Same goes when routerB sends an update to routerC, by the time the update gets to routerC, then ROuterC will know that 192.168.1.0 is 2 hops away.

    When a loop occurs the data just keeps getting sent back and forth back and forth because a router is advertising an invalid route which it thinks is valid but really isn't. This is the problem with "routing by rumor" because rumors are not always true. Each time the update gets sent it's hop count is incremented by 1. So it will go back and forth untill the hop count reaches it's max. So in RIP a routing update will go back and forth 15 times because it has a max hop count of 15.

    This is counting to infinity because the routing update went back and forth with the hop count going up and up and up and up.
    There is no place like 127.0.0.1 BUT 209.62.5.3 is my 127.0.0.1 away from 127.0.0.1!
  • Options
    hodgey87hodgey87 Member Posts: 232
    thanks for all the replies

    greatly appreciated icon_cool.gif
  • Options
    tech-airmantech-airman Member Posts: 953
    hodgey87 wrote:
    hi all,

    could anyone please explain count to infinity

    thanks

    To help illustrate this issue, imagine that you're at home during a holiday weekend and you've got your father, mother, and a brother. So let's say you're hungry. Imagine yourself a routed protocol packet. So you go to your brother and ask "When are we eating?" Well, your brother says "Go ask mother." So you move yourself from your brother to your mother. Then you ask your mother "When are we eating?" Your mother says, "Ask your father." So you move yourself from mother to father. Then you ask "When are we eating?" Your father says, "Ask your brother." So you move yourself from father to brother. Then you ask your brother again, "When are we eating?" Your brother says the same thing he said before "Ask your mother." Then you go to your mother, ask the question and you get the same reply "Ask your father." Then you go to your father, ask the question and you get the same reply "Ask your brother." You are now in what they call in networking a "routing loop." The reason why it's called "count to infinity" is because the counting starts when you went to your brother the first time. Then the count goes to 2 when you went to your mother. The count went to 3 when you went to your father. The count went to 4 when you went to your brother again. Theoretically, you could remain in the routing loop until infinity which is a loooong time.

    Now, let's add a level of realism called "patience." Let's say that after 16 times of being passed around you're going to run out of patience and hop into the car and go get some fast food. So, let's say the above situation happens again, this time, keeping count of the number of times you're told "Ask your [the next person]". So you get passed from person to person, the count goes up from 1, 2, 3, 4, ..., 16. At that point, you get fed up, hop into the car and go get some fast food.

    Networkingly speaking, this is what happens with the routing protocol RIP. See, instead of actually waiting for the infinity-eth time of being passed around or routed from router to router to router, RIP decides that instead of counting to infinity, RIP defines infinity as 16 hops. Infinity in this case is the "unreachable" condition. Networkingly, this is accounted for using the Time To Live or TTL field within the IP header of the routed packet. Every time a router receives the routed packet, it reads the TTL field within the current IP header, subtracts one from the current value, then rewrites the lower value back into the TTL field of the new IP header before forwarding the packet. So if the 15th router that receives the IP packet doesn't know the destination network either, the packet is dropped. That means the packet failed to communicate with the destination.

    I hope this helps.
  • Options
    chrissmith51chrissmith51 Registered Users Posts: 1 ■□□□□□□□□□
    Hi,

    I also have a problem with this, which I haven't found the answer to despite everything I read. I understand the concept and how it all works, but was under the impression that updates were only applied to the routing table if they indicated a better route than that which already existed. With the count to infinity problem - as far as I'm aware - the metric keeps increasing, and by my understanding would never be inserted into other routing tables since it will always be higher than the route which already exists.

    I know I am wrong, but I can't find in my reasoning where I am wrong!

    Help?!

    Chris
  • Options
    Michael2Michael2 Member Posts: 305 ■■■□□□□□□□
    To help illustrate this issue, imagine that you're at home during a holiday weekend and you've got your father, mother, and a brother. So let's say you're hungry. Imagine yourself a routed protocol packet. So you go to your brother and ask "When are we eating?" Well, your brother says "Go ask mother." So you move yourself from your brother to your mother. Then you ask your mother "When are we eating?" Your mother says, "Ask your father." So you move yourself from mother to father. Then you ask "When are we eating?" Your father says, "Ask your brother." So you move yourself from father to brother. Then you ask your brother again, "When are we eating?" Your brother says the same thing he said before "Ask your mother." Then you go to your mother, ask the question and you get the same reply "Ask your father." Then you go to your father, ask the question and you get the same reply "Ask your brother." You are now in what they call in networking a "routing loop." The reason why it's called "count to infinity" is because the counting starts when you went to your brother the first time. Then the count goes to 2 when you went to your mother. The count went to 3 when you went to your father. The count went to 4 when you went to your brother again. Theoretically, you could remain in the routing loop until infinity which is a loooong time.

    Excuse me. I may be wrong and correct me if I am but that doesn't sound a thing like the count-to-infinity problem to me. It is, however, an excellent example of a routing loop.
    In distance-vector routing, routers periodically broadcast their entire routing tables to one another. Somehow this consumes less memory than link-state protocols which is why it's used at all, incredibly stupid as it is.
    Imagine it like this. Router A sends packets to router D at a cost of three hops. Router A receives a routing table from router D saying that it costs three hops to send a message to router D. At some point, router C which is en route to router D crashes. Router A does not know this and sends a packet to router D. Now router B is unaware that there is no alternate route, regardless of path cost. So it immediately sends the packet back to router A and tells router A it will cost one more hop to get to router D. This goes on until router A updates its routing table to 16.
    Alternately, you could imagine a link between the routers going down or becoming disconnected. Same basic scenario. The routers in front of the break don't know that they can't send packets to the routers behind the break and simply continue to update their routing tables.
Sign In or Register to comment.