CDA 6530 Performance Models of Computers and Networks

  • Slides: 9
Download presentation
CDA 6530: Performance Models of Computers and Networks Project 3 Q&A

CDA 6530: Performance Models of Computers and Networks Project 3 Q&A

q q Structure definition in Matlab: q q m = 300; n =300; Node=struct('status',

q q Structure definition in Matlab: q q m = 300; n =300; Node=struct('status', zeros(m, n), 'infect. Time', zeros(m, n), 'Infect. Other. Time', zeros(m, n)); Or you can define: Node. State = zeros(m, n); q Node. Infect. Time = zeros(m, n); q Node. Infect. Other. Time = zeros(m, n); q 2

Multiple Way to Remember Infection Traffic q Define a queue variable to remember: Generated

Multiple Way to Remember Infection Traffic q Define a queue variable to remember: Generated infection traffic source (or destination) q Active time (when the source passes the traffic to all its neighbors, or when a vulnerble node receives the traffic) q q Quite complicated since the event queue is very dynamic 3

Multiple Way to Remember Infection Traffic (my approach) q Use each infected node variable

Multiple Way to Remember Infection Traffic (my approach) q Use each infected node variable to remember when its outgoing infection traffic reach its neighbors q Node. Infect. Other. Time(i, j) save the time for infection traffic reaching the node(i, j)’s neighbors 4

q How to determine neighboring nodes? You don’t need the code to remember the

q How to determine neighboring nodes? You don’t need the code to remember the topology since it is so regular q Node(a, b)’s 4 neighbors: q Upper node: (a-1, b), Down node: (a+1, b) q Left node: (a, b-1), right node: (a, b+1) q q q Make sure you check if any of the above 4 nodes are non-exist For S 2, you also need to check if the node is one of those 10 shortcut nodes q If yes, considering the 5 th neighboring node 5

q How to decide the simulation end time? q At current discrete time k,

q How to decide the simulation end time? q At current discrete time k, check all nodes: q If all (Node. Infect. Other. Time(. , . ) < k), then stop q It means there does not exist any future infection traffic anymore 6

Infection Activity from sending node angle q At current time t: q If the

Infection Activity from sending node angle q At current time t: q If the Node. State(j, k) == ‘infected’ If the Node. Infect. Other. Time(j, k) == t, %the node infection traffic reach its neighbors now! q q q Check all its neighbors to see if any neighbor is infected now, if the neighbor node(a, b) is infected now: q Node. State(a, b) = infected; q Node. Infect. Time(a, b) = t; q generate Poisson distr. delay time x; q Node. Infect. Other. Time(a, b) = x +t +1; If Node. State(j, k) == ‘vulnerable’ q Do nothing 7

Two Actions for Every Infected Node q Act 1: when node(a, b) becomes infected

Two Actions for Every Infected Node q Act 1: when node(a, b) becomes infected at current discrete time t q q Change its status: Node. State(a, b) = INFECTED; Assign: q q Node. Infect. Time(a, b) = t; x = Poisson. Generator(); Node. Infect. Other. Time(a, b) = t + x + 1; Act 2: when an infected node delivers infection traffic to its neighbors q q q When? if (Node. State(a, b) == INFECTED && t == Node. Infect. Other. Time(a, b) ) Check each of its neighbor: If neighbor node(c, d) is vulnerable and will be infected? q Run Act 1 for the node(c, d) 8

q start. Time = cputime; q Simulation…. q simulate. CPUTime = cputime – start.

q start. Time = cputime; q Simulation…. q simulate. CPUTime = cputime – start. Time; 9