forked from PetrerW/TSST-Project
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
86 changed files
with
3,040 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<configuration> | ||
<startup> | ||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" /> | ||
</startup> | ||
</configuration> |
24 changes: 24 additions & 0 deletions
24
NetworkEmulation/NetworkNode/BorderNodeCommutationTable.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace NetworkNode | ||
{ | ||
/// <summary> | ||
/// Klasa z tabelą komutacji węzłów brzegowych. | ||
/// </summary> | ||
public class BorderNodeCommutationTable | ||
{ | ||
/// <summary> | ||
/// Tabela komutacji węzłów brzegowych | ||
/// </summary> | ||
public List<BorderNodeCommutationTableRow> Table { get; set; } | ||
|
||
public BorderNodeCommutationTable() | ||
{ | ||
Table = new List<BorderNodeCommutationTableRow>(); | ||
} | ||
} | ||
} |
124 changes: 124 additions & 0 deletions
124
NetworkEmulation/NetworkNode/BorderNodeCommutationTableRow.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,124 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Net; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace NetworkNode | ||
{ | ||
/// <summary> | ||
/// Klasa zawierająca tablicę komutacji pakietów w węzłach na brzegu sieci. | ||
/// TODO: Dodaj pole zwiazane z odlegloscia od celu, cos jak AS-PATH czy ilosc hopow. NMS bedzie to wpisywal | ||
/// </summary> | ||
public class BorderNodeCommutationTableRow | ||
{ | ||
/// <summary> | ||
/// Jakim adresem IP przyszedł pakiet? | ||
/// </summary> | ||
public IPAddress IP_IN { get; set; } | ||
|
||
/// <summary> | ||
/// Jakim portem przyszedł pakiet? | ||
/// </summary> | ||
public short port_in { get; set; } | ||
|
||
/// <summary> | ||
/// Jakie pasmo przypisać temu łączu? | ||
/// </summary> | ||
public short band { get; set; } | ||
|
||
/// <summary> | ||
/// Jaką częstotliwość przypisać temu łączu? | ||
/// </summary> | ||
public short frequency { get; set; } | ||
|
||
/// <summary> | ||
/// Jaką wydajnośc modulacji nadać łączu? | ||
/// </summary> | ||
public short modulationPerformance { get; set; } | ||
|
||
/// <summary> | ||
/// Jaką prędkość bitową nadać temu łączu? | ||
/// </summary> | ||
public short bitRate { get; set; } | ||
|
||
/// <summary> | ||
/// Na jaki adres chmury przesłać pakiet? | ||
/// </summary> | ||
public IPAddress IPSocketOUT { get; set; } | ||
|
||
/// <summary> | ||
/// Na jaki port przeslać pakiet? | ||
/// </summary> | ||
public short socketPort { get; set; } | ||
|
||
/// <summary> | ||
/// Ile hopow pokona pakiet od brzegowego routera? | ||
/// </summary> | ||
public short hopsNumber { get; set; } | ||
|
||
public BorderNodeCommutationTableRow() | ||
{ | ||
//empty | ||
} | ||
|
||
/// <summary> | ||
/// Konstruktor ze wszystkimi parametrami. | ||
/// </summary> | ||
/// <param name="IP_IN"></param> | ||
/// <param name="port_in"></param> | ||
/// <param name="band"></param> | ||
/// <param name="frequency"></param> | ||
/// <param name="modulationPerformance"></param> | ||
/// <param name="bitRate"></param> | ||
/// <param name="IPSocketOUT"></param> | ||
/// <param name="socketPort"></param> | ||
public BorderNodeCommutationTableRow(string IP_IN, short port_in, short band, short frequency, | ||
short modulationPerformance, short bitRate, string IPSocketOUT, short socketPort, short hopsNumber) | ||
{ | ||
this.IP_IN = IPAddress.Parse(IP_IN); | ||
this.port_in = port_in; | ||
this.band = band; | ||
this.frequency = frequency; | ||
this.modulationPerformance = modulationPerformance; | ||
this.bitRate = bitRate; | ||
this.IPSocketOUT = IPAddress.Parse(IPSocketOUT); | ||
this.socketPort = socketPort; | ||
this.hopsNumber = hopsNumber; | ||
} | ||
|
||
/// <summary> | ||
/// TODO: Przemysl jakie parametry na wejsciu i wyjsciu beda | ||
/// Funkcja obliczajaca efektywnosc modulacji na podstawie ilosci hopow do celu, jaka modulacje ma uzyc. | ||
/// </summary> | ||
/// <param name="hopsNumber"></param> | ||
public static short determineModulationPerformance(short hopsNumber) | ||
{ | ||
/* | ||
switch (hopsNumber) | ||
{ | ||
case 1: | ||
return 8; | ||
case 2: | ||
return 7; | ||
case 3: | ||
return 6; | ||
case 4: | ||
return 5; | ||
case 5: | ||
return 4; | ||
case 6: | ||
return 3; | ||
case 7: | ||
return 2; | ||
default: | ||
return 1; | ||
} | ||
if (hopsNumber <= 7) | ||
return (short)(9 - hopsNumber); | ||
*/ | ||
return 0; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace NetworkNode | ||
{ | ||
/// <summary> | ||
/// Tablica komutacji routera, także brzegowego. | ||
/// </summary> | ||
public class CommutationTable | ||
{ | ||
public List<CommutationTableRow> Table { get; set; } | ||
|
||
public CommutationTable() | ||
{ | ||
this.Table = new List<CommutationTableRow>(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Net; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace NetworkNode | ||
{ | ||
/// <summary> | ||
/// Rząd tabeli kierowania pakietów dla węzłów NIEbrzegowych. | ||
/// </summary> | ||
public class CommutationTableRow | ||
{ | ||
/// <summary> | ||
/// Tunelem o jakiej częstotliwości przyszedł pakiet? | ||
/// Liczby naturalne od 0 do 63. | ||
/// </summary> | ||
public short frequency_in { get; set; } | ||
|
||
/// <summary> | ||
/// Na jaki port skierować pakiet? | ||
/// </summary> | ||
public short port_out { get; set; } | ||
|
||
/// <summary> | ||
/// Na jaki adres IP skierować pakiet? | ||
/// </summary> | ||
public IPAddress IP_OUT { get; set; } | ||
|
||
public CommutationTableRow() | ||
{ | ||
//empty | ||
} | ||
|
||
/// <summary> | ||
/// Konstruktor ze wszystkimi parametrami. | ||
/// </summary> | ||
/// <param name="frequency_in"></param> | ||
/// <param name="port_out"></param> | ||
/// <param name="IP_OUT"></param> | ||
public CommutationTableRow(short frequency_in, short port_out, string IP_OUT) | ||
{ | ||
this.frequency_in = frequency_in; | ||
this.port_out = port_out; | ||
this.IP_OUT = IPAddress.Parse(IP_OUT); | ||
} | ||
} | ||
} |
Oops, something went wrong.