here - NJIT

entomologistsamoanΛογισμικό & κατασκευή λογ/κού

15 Αυγ 2012 (πριν από 5 χρόνια και 29 μέρες)

238 εμφανίσεις

CS 656 Project, Spring ‘
11
-

Test Cases for Phase 1

Instructions



Output all the logs in text files (don’t use log4j).



Don’t use complex package structure or any fancy libraries that are hard to include using
AFS/sunlab command prompt.



Don’t compel the TA to change fields deep inside properties files (e.g., in case of using netbeans)
to run your program on every node.



The log file should log the following events

clearly
.

(you will miss points if it is not clear)

o

Receiving LSP info (fro
m whom, TTL etc)

o

Users’ changes to path cost, link status

o

All the e
vents occurring at every timer ticks

o

Routing table

whenever you calculate shortest path



Keep all your source files in a flat directory. This way it will be easier to compile and run. To run

the program following command should be sufficient to run your program in AFS/sunlab:

> cd YourProgramDirectory

> javac YourProgram.java

> java YourProgram topology.txt



The
Follo
w
i
ng topology is used for testing (you should generate the topology file from

it):










Test Cases


(
35

points)

Test C
ase 1:

Read the input file and calculate the routes.
The log files will be verified to see
that duplicate LSPs are dropped, old LSPs replaced by new LSPs, and TTL values properly decremented.
The log files should contain the forwarding tables in the form of (des
tination, next_hop) pairs and the
shortest paths to all destinations. For example, the shortest paths, calculated on A and E, are as follows:


C

D

B

A

E

1

7

4


A

2

3

2

R

5

Router

Link cost

Shortest Path
s

for A

B

A B Cost 2

C

A B C Cost 3

D

A B C D Cost 5

E

A B C D E Cost

8



Shortest Path
s

for E

A

E D C B A Cost 8

B

E D C B Cost 6

C

E D C Cost 5

D

E D Cost 3


(
15
points)

Test Case 2:

At
router B
, issue the command,

link C down
. The B
-
C lin
k will be down. The log
files will contain the updated forwarding tables and shortest paths.

After the change is propagated to all
routers,
the shortest paths, calcu
lated on A and E, are
:

Shortest Path
s

for A

B

A B Cost 2

C

A B
D C

Cost
8

D

A B D Cost
6

E

A B D E Cost

9


Shortest Path
s

for E

A

E D B A Cost
9

B

E D B Cost
7

C

E D C Cost 5

D

E D Cost 3


(20

points)

Test Case 3:
At router B, issue the command,
link C up 1
. In response to this comman
d, the
topology is the same as

the original. Then,
at C,

issue

link E change 2
.

This
command will change the link
cost of C
-
E from 7 to 2.
After the changes are propagated to all routers, the shortest paths, calculated on
A and E, are:

Shortest Path
s

for A

B

A B Cost 2

C

A B C Cost
3

D

A B
C
D Cost
5

E

A B
C
E Cost
5



Shortest Path
s

for E

A

E
C
B A Cost
5

B

E
C

B Cost
3

C

E C Cost
2

D

E D Cost
2


(3
0

points)

Test Case 4:

At router
D
, issue the commands

link C
down, link B down, link E down
. The
topology will be

without D
after these commands
.
Remember
, the cost of C
-
E link

was set to 2 in the
previous test case.

After all LSPs from

D are removed from the network (due to their TTL becoming 0),
the shortest paths at A and E are:

Shortest Path
s

for A

B

A B Cost 2

C

A B C Cost 3

E

A B C E Cost 5


Shortest Path
s

for E

A

E C B A Cost 5

B

E C B Cost 3

C

E C Cost 2