More updates. Fixed PingFailed. More VLAN levels

This commit is contained in:
Tim Young 2017-01-26 16:41:29 -06:00
parent 52c7ab63e2
commit 58beb9490b
11 changed files with 1779 additions and 45 deletions

View File

@ -287,6 +287,7 @@
<None Include="Resources\Level5_WirelessRepeater.enbx" /> <None Include="Resources\Level5_WirelessRepeater.enbx" />
<None Include="Resources\Level5_WirelessRepeater2.enbx" /> <None Include="Resources\Level5_WirelessRepeater2.enbx" />
<None Include="Resources\Level5_WirelessRouters.enbx" /> <None Include="Resources\Level5_WirelessRouters.enbx" />
<None Include="Resources\Level6_ConnectTheLaptop.enbx" />
<None Include="Resources\Level6_ForbiddenVLAN.enbx" /> <None Include="Resources\Level6_ForbiddenVLAN.enbx" />
<None Include="Resources\Level6_Intro3_LockedOut.enbx" /> <None Include="Resources\Level6_Intro3_LockedOut.enbx" />
<None Include="Resources\Level6_SorryBoss.enbx" /> <None Include="Resources\Level6_SorryBoss.enbx" />

View File

@ -74,7 +74,7 @@ namespace EduNetworkBuilder
Level5_WirelessAccessPoint, Level5_WirelessCorruption, Level5_Failed, Level5_LostPacket, Level5_HereComesTrouble, Level5_WirelessAccessPoint, Level5_WirelessCorruption, Level5_Failed, Level5_LostPacket, Level5_HereComesTrouble,
Level6_VLAN_Intro, Level6_VLAN_Intro2, Level6_Intro3_LockedOut, Level6_ForbiddenVLAN, Level6_TaggedBetweenSwitches, Level6_VLAN_Intro, Level6_VLAN_Intro2, Level6_Intro3_LockedOut, Level6_ForbiddenVLAN, Level6_TaggedBetweenSwitches,
Level6_VLANRouting, Level6_VLANRouting2, level6_UntaggedAndDHCP, Level6_SorryBoss, Level6_VLANFrustrations, Level6_VLANRouting, Level6_VLANRouting2, level6_UntaggedAndDHCP, Level6_SorryBoss, Level6_VLANFrustrations,
Level6_TwoAccessPoints, Level6_VlanRouting3, Level6_TwoAccessPoints, Level6_VlanRouting3, Level6_ConnectTheLaptop,
} }
public enum DebugPausePoint { none=0, packet_create=1, packet_kill=2, public enum DebugPausePoint { none=0, packet_create=1, packet_kill=2,
@ -172,6 +172,13 @@ namespace EduNetworkBuilder
} }
} }
public class PingTestStatus
{
public string Source;
public string Dest;
public bool Succeeded = false;
}
[Serializable] [Serializable]
public struct ArpEntry public struct ArpEntry
{ {

View File

@ -59,6 +59,7 @@ namespace EduNetworkBuilder
private List<string> PacketColors = new List<string>(); private List<string> PacketColors = new List<string>();
private List<Image> PacketImages = new List<Image>(); private List<Image> PacketImages = new List<Image>();
private List<PingTestStatus> PingTestStats = new List<PingTestStatus>();
public Network(string Name) public Network(string Name)
{ {
@ -808,6 +809,10 @@ namespace EduNetworkBuilder
{ {
string sHost = ReverseDNSLookup(source, sIP); string sHost = ReverseDNSLookup(source, sIP);
string dHost = ReverseDNSLookup(source, dIP); string dHost = ReverseDNSLookup(source, dIP);
if (packet_type == PacketType.ping_answer)
{
RegisterPingSuccess(sHost, dHost);
}
//If we are checking a ping, but we already have done it, we see if there is a ping-again //If we are checking a ping, but we already have done it, we see if there is a ping-again
foreach (NetTest nt in NetTests) foreach (NetTest nt in NetTests)
{ {
@ -1084,6 +1089,15 @@ namespace EduNetworkBuilder
ND.ClearIPConnectionInfo(); ND.ClearIPConnectionInfo();
} }
} }
foreach(PingTestStatus PTS in PingTestStats)
{
if (PTS.Succeeded == false)
{
//We mark it as failed
NoteActionDone(NetTestType.FailedPing, PTS.Source, PTS.Dest);
}
}
PingTestStats.Clear(); //empty it for now.
DebugPausePoint WhatIsSet = NB.GetDebugPauseSetting(); DebugPausePoint WhatIsSet = NB.GetDebugPauseSetting();
if (WhatIsSet != 0) if (WhatIsSet != 0)
{ {
@ -1352,6 +1366,28 @@ namespace EduNetworkBuilder
return found; return found;
} }
public void RegisterPingTest(string source, string dest)
{
PingTestStatus PTS = new PingTestStatus();
PTS.Source = source;
PTS.Dest = dest;
PTS.Succeeded = false;
PingTestStats.Add(PTS);
}
public void RegisterPingSuccess(string source, string dest)
{
foreach (PingTestStatus PST in PingTestStats)
{
if (PST.Source == source &&
PST.Dest == dest)
{
PST.Succeeded = true;
break;
}
}
}
/**************************************** /****************************************
* Do On All Devices * Do On All Devices
* **************************************/ * **************************************/

View File

@ -1290,6 +1290,8 @@ namespace EduNetworkBuilder
//We need to create a packet //We need to create a packet
Packet PingPacket = new Packet(this,Destination, NB.Translate("H_Ping_Title"), PacketType.ping_request); Packet PingPacket = new Packet(this,Destination, NB.Translate("H_Ping_Title"), PacketType.ping_request);
Network myNet = NB.GetNetwork(); Network myNet = NB.GetNetwork();
string dHost = myNet.ReverseDNSLookup(this, Destination);
myNet.RegisterPingTest(hostname, dHost);
myNet.addPacket(PingPacket); myNet.addPacket(PingPacket);
} }

View File

@ -435,17 +435,19 @@ namespace EduNetworkBuilder
} }
if (MyStatus != PacketStatus.finished) if (MyStatus != PacketStatus.finished)
myNet.AddMessage(Tracking); //We only store finished_failed, and finished_ok myNet.AddMessage(Tracking); //We only store finished_failed, and finished_ok
if (sourceIP != null && destIP != null) //if (sourceIP != null && destIP != null)
{ //{
if (MyType == PacketType.ping_answer && MyStatus == PacketStatus.finished_failed) // if (MyType == PacketType.ping_answer && MyStatus == PacketStatus.finished_failed)
{ // {
myNet.NoteActionDone(NetTestType.FailedPing, destIP.GetIPString, sourceIP.GetIPString); // myNet.NoteActionDone(NetTestType.FailedPing, destIP.GetIPString, sourceIP.GetIPString);
} // }
if (MyType == PacketType.ping_request && MyStatus == PacketStatus.finished_failed) // if (MyType == PacketType.ping_request && MyStatus == PacketStatus.finished_failed)
{ // {
myNet.NoteActionDone(NetTestType.FailedPing, sourceIP.GetIPString, destIP.GetIPString); // myNet.NoteActionDone(NetTestType.FailedPing, sourceIP.GetIPString, destIP.GetIPString);
} // if(WhereAmI != null)
} // Console.WriteLine("Dropping at: "+ WhereAmI.hostname);
// }
//}
} }
} }

View File

@ -782,6 +782,16 @@ namespace EduNetworkBuilder.Properties {
} }
} }
/// <summary>
/// Looks up a localized resource of type System.Byte[].
/// </summary>
internal static byte[] Level6_ConnectTheLaptop {
get {
object obj = ResourceManager.GetObject("Level6_ConnectTheLaptop", resourceCulture);
return ((byte[])(obj));
}
}
/// <summary> /// <summary>
/// Looks up a localized resource of type System.Byte[]. /// Looks up a localized resource of type System.Byte[].
/// </summary> /// </summary>

View File

@ -433,4 +433,7 @@
<data name="Level6_VlanRouting3" type="System.Resources.ResXFileRef, System.Windows.Forms"> <data name="Level6_VlanRouting3" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Level6_VlanRouting3.enbx;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>..\Resources\Level6_VlanRouting3.enbx;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data> </data>
<data name="Level6_ConnectTheLaptop" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Level6_ConnectTheLaptop.enbx;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
</root> </root>

File diff suppressed because it is too large Load Diff

View File

@ -4,16 +4,16 @@
<Network> <Network>
<en_message>By default, switches are managed using the "Management Interface" IP Address. Most managed switches have a "Management VLAN" that you can communicate with the Management IP on. When that IP address is not accessible, you are locked out of the switch. You can also lock yourself out by forgetting the password, or forgetting the IP address. <en_message>By default, switches are managed using the "Management Interface" IP Address. Most managed switches have a "Management VLAN" that you can communicate with the Management IP on. When that IP address is not accessible, you are locked out of the switch. You can also lock yourself out by forgetting the password, or forgetting the IP address.
In EduNetworkBuilder, the only real way to lock yourself out is by setting all the VLANs on the management interface to "forbidden", or, if you "firbid" the vlan that the management interface uses. In EduNetworkBuilder, the only real way to lock yourself out is by setting all the VLANs on the management interface to "forbidden", or, if you "forbid" the vlan that the management interface uses.
This puzzle has one switch that you have been locked out of. Reset it. Then, you need to set the trunk-port (port1) to tagged for both vlans, and set the port that pc2 is on to be on vlan 2.</en_message> This puzzle has one switch that you have been locked out of. Reset it (right-click). Then, you need to set the trunk-port (port1) to tagged for both vlans, and set the port that pc2 is on to be on vlan 2.</en_message>
<en_title>VLAN Intro 3 Locked Out</en_title> <en_title>VLAN Intro 3 Locked Out</en_title>
<height>1024</height> <height>1024</height>
<width>1024</width> <width>1024</width>
<itemsize>100</itemsize> <itemsize>100</itemsize>
<showlabels>True</showlabels> <showlabels>True</showlabels>
<level>6</level> <level>6</level>
<sortorder>0.7</sortorder> <sortorder>3.2</sortorder>
<uniqueidentifier>145</uniqueidentifier> <uniqueidentifier>145</uniqueidentifier>
<startinghelplevel>full</startinghelplevel> <startinghelplevel>full</startinghelplevel>
<vlansenabled>True</vlansenabled> <vlansenabled>True</vlansenabled>

View File

@ -40,8 +40,6 @@
<nictype>lo</nictype> <nictype>lo</nictype>
<uniqueidentifier>147</uniqueidentifier> <uniqueidentifier>147</uniqueidentifier>
<usesdhcp>False</usesdhcp> <usesdhcp>False</usesdhcp>
<encryptionkey />
<ssid />
<interface> <interface>
<nicname>lo0</nicname> <nicname>lo0</nicname>
<myip> <myip>
@ -66,8 +64,6 @@
<nictype>wan</nictype> <nictype>wan</nictype>
<uniqueidentifier>150</uniqueidentifier> <uniqueidentifier>150</uniqueidentifier>
<usesdhcp>False</usesdhcp> <usesdhcp>False</usesdhcp>
<encryptionkey />
<ssid />
<interface> <interface>
<nicname>wan0</nicname> <nicname>wan0</nicname>
<myip> <myip>
@ -92,8 +88,6 @@
<nictype>eth</nictype> <nictype>eth</nictype>
<uniqueidentifier>148</uniqueidentifier> <uniqueidentifier>148</uniqueidentifier>
<usesdhcp>False</usesdhcp> <usesdhcp>False</usesdhcp>
<encryptionkey />
<ssid />
<interface> <interface>
<nicname>eth0</nicname> <nicname>eth0</nicname>
<myip> <myip>
@ -131,8 +125,6 @@
<nictype>eth</nictype> <nictype>eth</nictype>
<uniqueidentifier>149</uniqueidentifier> <uniqueidentifier>149</uniqueidentifier>
<usesdhcp>False</usesdhcp> <usesdhcp>False</usesdhcp>
<encryptionkey />
<ssid />
<interface> <interface>
<nicname>eth1</nicname> <nicname>eth1</nicname>
<myip> <myip>
@ -197,8 +189,6 @@
<nictype>lo</nictype> <nictype>lo</nictype>
<uniqueidentifier>143</uniqueidentifier> <uniqueidentifier>143</uniqueidentifier>
<usesdhcp>False</usesdhcp> <usesdhcp>False</usesdhcp>
<encryptionkey />
<ssid />
<interface> <interface>
<nicname>lo0</nicname> <nicname>lo0</nicname>
<myip> <myip>
@ -223,8 +213,6 @@
<nictype>eth</nictype> <nictype>eth</nictype>
<uniqueidentifier>144</uniqueidentifier> <uniqueidentifier>144</uniqueidentifier>
<usesdhcp>True</usesdhcp> <usesdhcp>True</usesdhcp>
<encryptionkey />
<ssid />
<interface> <interface>
<nicname>eth0</nicname> <nicname>eth0</nicname>
<myip> <myip>
@ -264,7 +252,7 @@
<nictype>lo</nictype> <nictype>lo</nictype>
<uniqueidentifier>110</uniqueidentifier> <uniqueidentifier>110</uniqueidentifier>
<usesdhcp>False</usesdhcp> <usesdhcp>False</usesdhcp>
<encryptionkey /> <ssid />
<interface> <interface>
<nicname>lo0</nicname> <nicname>lo0</nicname>
<myip> <myip>
@ -289,7 +277,7 @@
<nictype>management_interface</nictype> <nictype>management_interface</nictype>
<uniqueidentifier>111</uniqueidentifier> <uniqueidentifier>111</uniqueidentifier>
<usesdhcp>False</usesdhcp> <usesdhcp>False</usesdhcp>
<encryptionkey /> <ssid />
<interface> <interface>
<nicname>management_interface0</nicname> <nicname>management_interface0</nicname>
<myip> <myip>
@ -314,7 +302,7 @@
<nictype>port</nictype> <nictype>port</nictype>
<uniqueidentifier>112</uniqueidentifier> <uniqueidentifier>112</uniqueidentifier>
<usesdhcp>False</usesdhcp> <usesdhcp>False</usesdhcp>
<encryptionkey /> <ssid />
<interface> <interface>
<nicname>port1</nicname> <nicname>port1</nicname>
<myip> <myip>
@ -341,7 +329,7 @@
<nictype>port</nictype> <nictype>port</nictype>
<uniqueidentifier>113</uniqueidentifier> <uniqueidentifier>113</uniqueidentifier>
<usesdhcp>False</usesdhcp> <usesdhcp>False</usesdhcp>
<encryptionkey /> <ssid />
<interface> <interface>
<nicname>port2</nicname> <nicname>port2</nicname>
<myip> <myip>
@ -368,7 +356,7 @@
<nictype>port</nictype> <nictype>port</nictype>
<uniqueidentifier>114</uniqueidentifier> <uniqueidentifier>114</uniqueidentifier>
<usesdhcp>False</usesdhcp> <usesdhcp>False</usesdhcp>
<encryptionkey /> <ssid />
<interface> <interface>
<nicname>port3</nicname> <nicname>port3</nicname>
<myip> <myip>
@ -395,7 +383,7 @@
<nictype>port</nictype> <nictype>port</nictype>
<uniqueidentifier>115</uniqueidentifier> <uniqueidentifier>115</uniqueidentifier>
<usesdhcp>False</usesdhcp> <usesdhcp>False</usesdhcp>
<encryptionkey /> <ssid />
<interface> <interface>
<nicname>port4</nicname> <nicname>port4</nicname>
<myip> <myip>
@ -422,7 +410,7 @@
<nictype>port</nictype> <nictype>port</nictype>
<uniqueidentifier>116</uniqueidentifier> <uniqueidentifier>116</uniqueidentifier>
<usesdhcp>False</usesdhcp> <usesdhcp>False</usesdhcp>
<encryptionkey /> <ssid />
<interface> <interface>
<nicname>port5</nicname> <nicname>port5</nicname>
<myip> <myip>
@ -449,7 +437,7 @@
<nictype>port</nictype> <nictype>port</nictype>
<uniqueidentifier>117</uniqueidentifier> <uniqueidentifier>117</uniqueidentifier>
<usesdhcp>False</usesdhcp> <usesdhcp>False</usesdhcp>
<encryptionkey /> <ssid />
<interface> <interface>
<nicname>port6</nicname> <nicname>port6</nicname>
<myip> <myip>
@ -476,7 +464,7 @@
<nictype>port</nictype> <nictype>port</nictype>
<uniqueidentifier>118</uniqueidentifier> <uniqueidentifier>118</uniqueidentifier>
<usesdhcp>False</usesdhcp> <usesdhcp>False</usesdhcp>
<encryptionkey /> <ssid />
<interface> <interface>
<nicname>port7</nicname> <nicname>port7</nicname>
<myip> <myip>
@ -519,7 +507,7 @@
<nictype>lo</nictype> <nictype>lo</nictype>
<uniqueidentifier>122</uniqueidentifier> <uniqueidentifier>122</uniqueidentifier>
<usesdhcp>False</usesdhcp> <usesdhcp>False</usesdhcp>
<encryptionkey /> <ssid />
<interface> <interface>
<nicname>lo0</nicname> <nicname>lo0</nicname>
<myip> <myip>
@ -544,7 +532,7 @@
<nictype>eth</nictype> <nictype>eth</nictype>
<uniqueidentifier>123</uniqueidentifier> <uniqueidentifier>123</uniqueidentifier>
<usesdhcp>False</usesdhcp> <usesdhcp>False</usesdhcp>
<encryptionkey /> <ssid />
<interface> <interface>
<nicname>eth0</nicname> <nicname>eth0</nicname>
<myip> <myip>
@ -585,7 +573,7 @@
<nictype>lo</nictype> <nictype>lo</nictype>
<uniqueidentifier>125</uniqueidentifier> <uniqueidentifier>125</uniqueidentifier>
<usesdhcp>False</usesdhcp> <usesdhcp>False</usesdhcp>
<encryptionkey /> <ssid />
<interface> <interface>
<nicname>lo0</nicname> <nicname>lo0</nicname>
<myip> <myip>
@ -610,7 +598,7 @@
<nictype>eth</nictype> <nictype>eth</nictype>
<uniqueidentifier>126</uniqueidentifier> <uniqueidentifier>126</uniqueidentifier>
<usesdhcp>False</usesdhcp> <usesdhcp>False</usesdhcp>
<encryptionkey /> <ssid />
<interface> <interface>
<nicname>eth0</nicname> <nicname>eth0</nicname>
<myip> <myip>
@ -651,7 +639,7 @@
<nictype>lo</nictype> <nictype>lo</nictype>
<uniqueidentifier>128</uniqueidentifier> <uniqueidentifier>128</uniqueidentifier>
<usesdhcp>False</usesdhcp> <usesdhcp>False</usesdhcp>
<encryptionkey /> <ssid />
<interface> <interface>
<nicname>lo0</nicname> <nicname>lo0</nicname>
<myip> <myip>
@ -676,7 +664,7 @@
<nictype>eth</nictype> <nictype>eth</nictype>
<uniqueidentifier>129</uniqueidentifier> <uniqueidentifier>129</uniqueidentifier>
<usesdhcp>False</usesdhcp> <usesdhcp>False</usesdhcp>
<encryptionkey /> <ssid />
<interface> <interface>
<nicname>eth0</nicname> <nicname>eth0</nicname>
<myip> <myip>
@ -717,7 +705,7 @@
<nictype>lo</nictype> <nictype>lo</nictype>
<uniqueidentifier>131</uniqueidentifier> <uniqueidentifier>131</uniqueidentifier>
<usesdhcp>False</usesdhcp> <usesdhcp>False</usesdhcp>
<encryptionkey /> <ssid />
<interface> <interface>
<nicname>lo0</nicname> <nicname>lo0</nicname>
<myip> <myip>
@ -742,7 +730,7 @@
<nictype>eth</nictype> <nictype>eth</nictype>
<uniqueidentifier>132</uniqueidentifier> <uniqueidentifier>132</uniqueidentifier>
<usesdhcp>False</usesdhcp> <usesdhcp>False</usesdhcp>
<encryptionkey /> <ssid />
<interface> <interface>
<nicname>eth0</nicname> <nicname>eth0</nicname>
<myip> <myip>
@ -863,6 +851,11 @@
<dhost>pc1</dhost> <dhost>pc1</dhost>
<thetest>SuccessfullyPings</thetest> <thetest>SuccessfullyPings</thetest>
</nettest> </nettest>
<nettest>
<shost>laptop0</shost>
<dhost>pc3</dhost>
<thetest>NeedsLocalIPTo</thetest>
</nettest>
<tag>VLAN</tag> <tag>VLAN</tag>
<VLANName <VLANName
ID="1" ID="1"

View File

@ -2,7 +2,7 @@
<EduNetworkBuilder> <EduNetworkBuilder>
<!--This is a network file for EduNetworkBuilder.--> <!--This is a network file for EduNetworkBuilder.-->
<Network> <Network>
<en_message>This map shows how VLANs affect DHCP. Change the ports on net_switch1 that are connected to the wireless access point and laptop1. The WAP does not know how to do VLANS, so you control the VLAN that the accesspoint is connected to on net_switch1. Untag the port for the vlan that the laptop is supposed to be connected to do, doing a dhcp-request after you change it. <en_message>This map shows how VLANs affect DHCP. Change the ports on net_switch1 that are connected to the wireless access point and laptop1. The WAP does not know how to do VLANS, so you control the VLAN that the accesspoint is connected to on net_switch1. Untag the port for the vlan that the laptop is supposed to be connected to do (mouse-over the laptop to see what it is supposed to be "local" to), doing a dhcp-request after you change it.
For this map, the VLAN packets are displayed with the color of the PC on that VLAN. That will help you visualize when the packet is tagged and when it is not.</en_message> For this map, the VLAN packets are displayed with the color of the PC on that VLAN. That will help you visualize when the packet is tagged and when it is not.</en_message>
<en_title>Untagged ports and DHCP</en_title> <en_title>Untagged ports and DHCP</en_title>
<height>1024</height> <height>1024</height>