Solved

Code Executes Multiple Times

Posted on 2012-04-02
4
745 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 32

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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

746 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now