Browse Source

updated level three, made stub script for pingable computer

cecylia 8 years ago
parent
commit
cd2f9d5f31
3 changed files with 24 additions and 21 deletions
  1. 10 1
      js/devicescripts.js
  2. 3 8
      levels/01 Basics/level03.html
  3. 11 12
      levels/01 Basics/level03.json

+ 10 - 1
js/devicescripts.js

@@ -13,6 +13,15 @@ var deviceScripts = {
 		onPacketReceived: function (device, packet) {
 		onPacketReceived: function (device, packet) {
 			//.
 			//.
 		}
 		}
-	}
+	},
+
+    ping: {
+		onPacketReceived: function(device, packet) {
+                    //if(packet.tranport.proto == "icmp"){
+                        //doPacketAnimation(device.id, device.ports[0], 
+		}
+    }
+
+        
 }
 }
 
 

+ 3 - 8
levels/01 Basics/level03.html

@@ -5,18 +5,13 @@ information about how to respond.
 
 
 <p>Pause the simulation to view the packet sent from Alice's computer to Google. There is a new header under the
 <p>Pause the simulation to view the packet sent from Alice's computer to Google. There is a new header under the
 <strong>transport layer</strong>. The header, <strong>proto</strong> defines the <strong>protocol</strong> that will
 <strong>transport layer</strong>. The header, <strong>proto</strong> defines the <strong>protocol</strong> that will
-be run on this layer. The protocol listed is <strong>ICMP</strong>, which refers to a <strong>ping</strong>. When a
+be run on this layer. The protocol listed is <strong>ICMP</strong>, which is used to <strong>ping</strong> computers. When a
 computer receives a packet with an ICMP echo request (ping) they respond by sending back a packet with an ICMP echo
 computer receives a packet with an ICMP echo request (ping) they respond by sending back a packet with an ICMP echo
-(pong). Resume the simulation and notice the packet sent from Google to Alice's computer.
+(pong). Resume the simulation and notice the response packet sent from Google to Alice's computer.
 
 
-<p>To complete this level, you must send 4 more ICMP echo requests (pings) from Alice to Google. Proceed as before,
-by adding a new packet in the Timeline Editor. Remember to add the new <strong>transport layer</strong> header.
-
-<p><em><strong>Hint:</strong> use the 'repeat' feature in the Editor to send the same packet many times!
 
 
 <h3>Level Objectives</h3>
 <h3>Level Objectives</h3>
 
 
 <ul>
 <ul>
-	<li>remember to go to the <strong>next level</strong> in the timeline editor</li>
-	<li>send 4 more ping requests to Google</li>
+    <li>To complete this level, you must send 4 more ICMP echo requests from Alice to Google. Proceed as before, by clicking the + to add new packets. Remember to fill in the new <strong>transport layer</strong> header proto header field.</li>
 </ul>
 </ul>

+ 11 - 12
levels/01 Basics/level03.json

@@ -2,7 +2,6 @@
 	devices:[
 	devices:[
 		{
 		{
 			id:"Alice",
 			id:"Alice",
-			type:"NullComputer",
 			ports:1,
 			ports:1,
 			x:0.25,
 			x:0.25,
 			y:0.5,
 			y:0.5,
@@ -11,10 +10,11 @@
 		},
 		},
 		{
 		{
 			id:"Google",
 			id:"Google",
-			type:"NullComputer",
 			ports:1,
 			ports:1,
 			x:0.75,
 			x:0.75,
-			y:0.5
+			y:0.5,
+			image:"iphone-1",
+			script: deviceScripts.ping
 		}
 		}
 	],
 	],
 	links:[
 	links:[
@@ -26,23 +26,22 @@
 	timeline:[
 	timeline:[
 		{
 		{
 			type:"packet",
 			type:"packet",
-			at:100,
+			at:500,
 			from:"Alice",
 			from:"Alice",
 			payload:{
 			payload:{
-				network:{dstip:"Google"},
+				network:{srcip:"Alice", dstip:"Google"},
 				transport:{proto:"ICMP"}
 				transport:{proto:"ICMP"}
 			}
 			}
 		}
 		}
 	],
 	],
-	triggers:{
-		t0:{
+	triggers:[
+                {
 			type:"packet",
 			type:"packet",
 			device:"Alice",
 			device:"Alice",
 			payload:{
 			payload:{
 				network:{srcip:"Google", dstip:"Alice"}
 				network:{srcip:"Google", dstip:"Alice"}
-			},
-			times:5
-		}
-	},
-	nextLevel:"01 Basics/level04.json"
+			}
+                }
+        ],
+	nextLevel:4
 }
 }