Sign in to follow this  

Shutting down a network

This topic is 4746 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

This is a problem I've been dealing with lately. Imagine there's this network that looks something like this: I want to be able to shut down the network without leaving any stranded nodes. That means each node must know the network is shut down. Sounds simple, right? Let's say all the nodes tell each other when they're "dead," dead meaning the can still forward and route messages but don't really generate any of their own. They become switches, basically. When all the nodes are dead then all the nodes should detect that and shut down completely. The way I'm thinking of doing it is that when a node dies it tells all the other nodes it's dead. So imagine nodes 0, 1, 2, and 4 on our imaginary network have died. All that's left is 3. So now 3 dies. As soon as it tells 4 it's dead then 4 goes "oh, they're all dead!" and shuts down completely. 0, 1, and 2 never get the message from 3 so they're left hanging. Every possible solution I can come up with has some "gotcha." I get the feeling this is actually a pretty simple problem, but I can't see it. Any help?

Share this post


Link to post
Share on other sites
What if the counting-machine/service dies?

My way is good because if the node which is routing crashes it doesn't matter if the list gets lost because it won't be doing much routing anyway..

Share this post


Link to post
Share on other sites
BradDaBug,

make it like this:
when the center note 4 got the die msg from last died node 3, it should not shutdown immediately, it needs to forward msg to other died notes 0 and 2 to make sure they are informed, then only shutdown the connection.



regards,
Chung

Share this post


Link to post
Share on other sites
Its quite simple really.

You have each node send a "Tell me when all of your decendents are dead" message.

When they respond, kill your node.

If you get more then one, get every one but the first, and respond to the immediatly.

As soon as you get one, send one to all of your nodes that you know of.
When they all report back, kill your node.

This should spread throughout the network, and eventually bring the entire thing to a halt.

From,
Nice coder

Share this post


Link to post
Share on other sites
What exact type of network topology are you attempting to create? Is there a reason for this unusual daisy chain of connections that a more stable solution can't solve? If you can give me the reason/problem this topology is trying to solve maybe we can come up with a simpler more elegant solution. But if you just want a simple answer, have each connection have a timer. If their timer reaches X amount of time without receiving a packet they can assume the network is dead. This way you dont need to bother with a global counter. BTW what type of network transmission protocal are you using? TCP/IP, UDP/IP, other?

Share this post


Link to post
Share on other sites

This topic is 4746 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this