Message on a Network

Message on a Network preview image

1 collaborator

Default-person Mukesh Godara (Author)

Tags

(This model has yet to be categorized with any tags)
Visible to everyone | Changeable by the author
Model was written in NetLogo 6.0.2 • Viewed 377 times • Downloaded 13 times • Run 0 times
Download the 'Message on a Network' modelDownload this modelEmbed this model

Do you have questions or comments about this model? Ask them here! (You'll first need to log in.)


WHAT IS IT?

This model demonstrates the spread of a virus through a network. Although the model is somewhat abstract, one interpretation is that each node represents a computer, and we are modeling the progress of a computer virus (or worm) through this network. Each node may be in one of three states: susceptible, infected, or resistant. In the academic literature such a model is sometimes referred to as an SIR model for epidemics.

HOW IT WORKS

Each time step (tick), each infected node (colored red) attempts to infect all of its neighbors. Susceptible neighbors (colored green) will be infected with a probability given by the VIRUS-SPREAD-CHANCE slider. This might correspond to the probability that someone on the susceptible system actually executes the infected email attachment. Resistant nodes (colored gray) cannot be infected. This might correspond to up-to-date antivirus software and security patches that make a computer immune to this particular virus.

Infected nodes are not immediately aware that they are infected. Only every so often (determined by the VIRUS-CHECK-FREQUENCY slider) do the nodes check whether they are infected by a virus. This might correspond to a regularly scheduled virus-scan procedure, or simply a human noticing something fishy about how the computer is behaving. When the virus has been detected, there is a probability that the virus will be removed (determined by the RECOVERY-CHANCE slider).

If a node does recover, there is some probability that it will become resistant to this virus in the future (given by the GAIN-RESISTANCE-CHANCE slider).

When a node becomes resistant, the links between it and its neighbors are darkened, since they are no longer possible vectors for spreading the virus.

HOW TO USE IT

Using the sliders, choose the NUMBER-OF-NODES and the AVERAGE-NODE-DEGREE (average number of links coming out of each node).

The network that is created is based on proximity (Euclidean distance) between nodes. A node is randomly chosen and connected to the nearest node that it is not already connected to. This process is repeated until the network has the correct number of links to give the specified average node degree.

The INITIAL-OUTBREAK-SIZE slider determines how many of the nodes will start the simulation infected with the virus.

Then press SETUP to create the network. Press GO to run the model. The model will stop running once the virus has completely died out.

The VIRUS-SPREAD-CHANCE, VIRUS-CHECK-FREQUENCY, RECOVERY-CHANCE, and GAIN-RESISTANCE-CHANCE sliders (discussed in "How it Works" above) can be adjusted before pressing GO, or while the model is running.

The NETWORK STATUS plot shows the number of nodes in each state (S, I, R) over time.

THINGS TO NOTICE

At the end of the run, after the virus has died out, some nodes are still susceptible, while others have become immune. What is the ratio of the number of immune nodes to the number of susceptible nodes? How is this affected by changing the AVERAGE-NODE-DEGREE of the network?

THINGS TO TRY

Set GAIN-RESISTANCE-CHANCE to 0%. Under what conditions will the virus still die out? How long does it take? What conditions are required for the virus to live? If the RECOVERY-CHANCE is bigger than 0, even if the VIRUS-SPREAD-CHANCE is high, do you think that if you could run the model forever, the virus could stay alive?

EXTENDING THE MODEL

The real computer networks on which viruses spread are generally not based on spatial proximity, like the networks found in this model. Real computer networks are more often found to exhibit a "scale-free" link-degree distribution, somewhat similar to networks created using the Preferential Attachment model. Try experimenting with various alternative network structures, and see how the behavior of the virus differs.

Suppose the virus is spreading by emailing itself out to everyone in the computer's address book. Since being in someone's address book is not a symmetric relationship, change this model to use directed links instead of undirected links.

Can you model multiple viruses at the same time? How would they interact? Sometimes if a computer has a piece of malware installed, it is more vulnerable to being infected by more malware.

Try making a model similar to this one, but where the virus has the ability to mutate itself. Such self-modifying viruses are a considerable threat to computer security, since traditional methods of virus signature identification may not work against them. In your model, nodes that become immune may be reinfected if the virus has mutated to become significantly different than the variant that originally infected the node.

RELATED MODELS

Virus, Disease, Preferential Attachment, Diffusion on a Directed Network

NETLOGO FEATURES

Links are used for modeling the network. The layout-spring primitive is used to position the nodes and links such that the structure of the network is visually clear.

Though it is not used in this model, there exists a network extension for NetLogo that you can download at: https://github.com/NetLogo/NW-Extension.

HOW TO CITE

If you mention this model or the NetLogo software in a publication, we ask that you include the citations below.

For the model itself:

Please cite the NetLogo software as:

COPYRIGHT AND LICENSE

Copyright 2008 Uri Wilensky.

CC BY-NC-SA 3.0

This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License. To view a copy of this license, visit https://creativecommons.org/licenses/by-nc-sa/3.0/ or send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.

Commercial licenses are also available. To inquire about commercial licenses, please contact Uri Wilensky at uri@northwestern.edu.

Comments and Questions

Please start the discussion about this model! (You'll first need to log in.)

Click to Run Model

turtles-own
[
 message-received?
 abstraction-score
 expression-score

]

to setup
 clear-all
 setup-nodes
 setup-spatially-clustered-network
 ask n-of initial-outbreak-size turtles
   [ assign-group ]
 ask links [ set color white ]
 reset-ticks
end 

to setup-nodes
 set-default-shape turtles "circle"
 create-turtles number-of-nodes
 [
   ; for visual reasons, we don't put any nodes *too* close to the edges
   setxy (random-xcor * 0.95) (random-ycor * 0.95)
   become-neutral
   set abstraction-score random 3
   set expression-score random 2
 ]
end 

to setup-spatially-clustered-network
 let num-links (average-node-degree * number-of-nodes) / 2
 while [count links < num-links ]
 [
   ask one-of turtles
   [
     let choice (min-one-of (other turtles with [not link-neighbor? myself])
                  [distance myself])
     if choice != nobody [ create-link-with choice ]
   ]
 ]
 ; make the network look a little prettier
 repeat 10
 [
   layout-spring turtles links 0.3 (world-width / (sqrt number-of-nodes)) 1
 ]
end 

to go
 if all? turtles [message-received?]
   [ stop ]
 spread-messages
 tick
end 

to become-crowd
 set message-received? true
 set color violet
end 

to become-herd
 set message-received? true
 set color cyan
end 

to become-mob
 set message-received? true
 set color brown
end 

to become-gang
 set message-received? true
 set color yellow
end 

to become-neutral
 set message-received? false
 set color white
end 

to assign-group
 if (abstraction-score < message-abstraction and expression-score <= message-expression ) [
     become-crowd
 ]
 if (abstraction-score <= message-abstraction and expression-score > message-expression ) [
     become-mob
 ]
 if (abstraction-score >= message-abstraction and expression-score < message-expression ) [
     become-herd
 ]
 if (abstraction-score > message-abstraction and expression-score >= message-expression ) [
     become-gang
 ]
end 

to spread-messages
 ask turtles with [message-received?]
   [ ask link-neighbors with [not message-received?]
    [
     assign-group
    ]
   ]
end 

There is only one version of this model, created about 6 years ago by Mukesh Godara.

Attached files

File Type Description Last updated
Message on a Network.png preview Preview for 'Message on a Network' about 6 years ago, by Mukesh Godara Download

This model does not have any ancestors.

This model does not have any descendants.