Solved

Code Executes Multiple Times

Posted on 2012-04-02
4
748 Views
Last Modified: 2012-06-27
I have compiled code for a simple router program. I am taking a class and I needed to create a program that would simulate routers updating their routing tables. The only real question i have left is i'm not sure if the program should update the routers so often. I have attached all the parts of the program, the exe file and the log file of the output. Can someone take a quick look and let me know if the program should call the update function so many times, as illustrated by the output?

Thanks!

Running one node0/1/2/3.c file will also call the main program prog3.c and the other nodes and initiate the update process between all of the other nodes, also known as routers.
node0.c
node1.c
node2.c
node3.c
prog3.c
RoutingLog.txt
0
Comment
Question by:new435
  • 2
4 Comments
 
LVL 33

Assisted Solution

by:sarabande
sarabande earned 250 total points
ID: 37800293
it is only you who could answer that question. generally, a simulation should be as near as possible to the reality. if in reality you have much less updates it isn't a good simulation at least in that point. note, a simulation is different to a stress test. in the latter you would go the limits but not beyond. if your program is neither a simulation nor a stress test but a unit test you could go beyond the limits and try to produce even worsest scenarios just to proove that your system is stable in every case. such a complete unit test is fine if it has the expected results. if it only finds problems which wouldn't occur in the reality you might loose the right focus and forget to test the normal.

Sara
0
 

Author Comment

by:new435
ID: 37802543
I'm not quite sure how often real routers update themselves, which is why I posed the question.
0
 
LVL 3

Accepted Solution

by:
algorith earned 250 total points
ID: 37803811
I have heard that a poisoned router will be cured in 15 minutes or so on average, but I could not find this number on a quick search.  This article might help http://www.isoc.org/isoc/conferences/ndss/06/proceedings/papers/churn_as_shelter.pdf

Bandwidth limitations might be a good way to decide - i.e. you don't want the router updating so often that it consumes a significant portion of you network's bandwidth.  On the other hand, you do want the bad routing information to be purged as quickly as possible. All of which makes the answer specific to your own situation, which as an assignment is possibly ill-defined.

You could ask the TA...let us know if he can answer...
0
 

Author Comment

by:new435
ID: 37818160
see my program ends up updating > 100 times and im not sure if that is rediculus or not.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

856 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