Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
0975852
fixed a bug with visualizer init not finding the current config
Nov 9, 2016
5d4b926
added first working version of LabelVisualizer
Nov 22, 2016
bd32ae0
added menubar, thicker bars, yAxis range policies
Nov 22, 2016
5db69a5
added dynamic addbox-update for label visualizer
Nov 28, 2016
b9c032a
changed order of plotted label traces to top-to-bottom
Nov 28, 2016
cb2ce98
fixed yAxis Range of the label-visualizer
Nov 28, 2016
b3581bd
added LabelTrace class for cleaner label-trace handling
Nov 28, 2016
cbd28b6
added automatic trace-sizing based on the chart size
Nov 28, 2016
5540efe
updated buttons of LegendItemLabel
Nov 28, 2016
ae5bc92
added automatic label-trace addition to LabelVisualizer
Nov 28, 2016
5bbcaac
added label-visualizer automatic addition configuration capabilities
Nov 28, 2016
e84f8d1
added label-value-representation in menubar and legend
Nov 29, 2016
a01221a
added circular array-list as ringbuffer for timestamp handling in lab…
Nov 29, 2016
c919328
added x-axis intervals and scaling for LabelVisualizer
Nov 29, 2016
19aa553
vis: added connection of multiple components x1 axis
Dec 6, 2016
06fba2b
added checkboxes in menubars for combined selection
Dec 6, 2016
14b5d0b
removed debug print
Dec 6, 2016
e5a7c6e
added configuration capabilities for connected x1-interval sliders
Dec 6, 2016
34c3a12
updated the default to be true
Dec 6, 2016
ae534d0
fixed the timeslider for labelvisualizer
Dec 7, 2016
9a8e435
removed y2-axis grid button for label visualizers
Dec 7, 2016
e615e8f
removed comment block
Dec 7, 2016
49cd9ab
added automatic x-axis synchronization for metric and label visualizers
Dec 7, 2016
308a0da
added full configuration capabilities for label-visualizer
Dec 7, 2016
4114da5
updated the minimum label-vis example config
Dec 7, 2016
69388b0
added error prints to parsing errors during vis-config reading
Dec 7, 2016
33163ea
updated the default vis config
Dec 7, 2016
17fb624
removed visualizers axis-labels from default config
Dec 7, 2016
79fc692
metric-visualizer x-axis label is now correctly read and set from config
Dec 7, 2016
b3c7c58
added "visible" flag for menubar-configs
Dec 7, 2016
14c1104
updated sizes of vis default config
Dec 7, 2016
78588bf
added blackboxwrapper.java
Jan 3, 2017
eecb871
added modellabeler class
Jan 9, 2017
2a2c4f3
added test classes for model labeling
Jan 9, 2017
b7212fc
added labeler fields to test-case
Jan 9, 2017
9df8cfd
updated test paths
Jan 9, 2017
7b8cdb0
renamed blackbox wrapper to modelwrapper
Jan 9, 2017
5b90310
fixed problem with edge-weights metric names in ModelLabeler
Jan 9, 2017
c5d21db
fixed problem with metric names in ModelWrapper
Jan 9, 2017
95564fb
fixed paths in test-case
Jan 9, 2017
a52e42e
added GroundTruthLabelerAttacks
Jan 10, 2017
d2ffdf3
updated test-case
Jan 10, 2017
e84094b
added missing LabelMode
Jan 17, 2017
fdbc2e2
removed debug prints
Jan 17, 2017
d782642
fixed a bug with network-node-weight visualization
Jan 18, 2017
54fb408
fixed ambiguous problem
Jan 18, 2017
cf5b8d6
added gids config
Jan 18, 2017
82810ae
fixed a problem with nullpointer of maindisplay-config
Jan 18, 2017
a5b7e0b
fixed wrong import
Jan 18, 2017
9549d0e
added use of gids config for gvis
Jan 18, 2017
7bfaece
added vis-live-display to test-case
Jan 18, 2017
800c709
added timestamp as second interpretation for vis
Jan 18, 2017
38304ed
added timestamp-offset and proper formatting to visualizers
Jan 18, 2017
6bec08f
changed the inDegree to be shown on y2
Jan 18, 2017
c416848
changed x-axis viewport policy for visualizers
Jan 18, 2017
cbf1fc4
fixed interval selection on visualizers
Jan 19, 2017
9a36e62
added network-node-style rule
Jan 19, 2017
fb7ff18
added NetflowGraph generator
Jan 18, 2017
17acbea
added new netflow graph-generator
Jan 19, 2017
8e7a3cc
fixed visualizers inverted x-axis interval behaviour
Jan 19, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
90 changes: 79 additions & 11 deletions config/gui_default.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"VisualizerPanel": {
"Width": 1500,
"Height": 800,
"InnerWidth": 1600,
"InnerWidth": 2000,
"InnerHeight": 1000
},
"Buttons": {
Expand All @@ -36,7 +36,7 @@
"Name": "Control & Statistics",
"Width": 330,
"Height": 550,
"DateFormat": "hh:mm:ss:SS",
"DateFormat": "HH:mm:ss",

"ShowTimePanel": true,
"TimeSliderButtons": {
Expand Down Expand Up @@ -146,12 +146,12 @@
"LinesPointSize": 5,
"PaintFill": false,
"VerticalBarSize": 5,
"xAxisTitle": "Timestamp",
"xAxisTitle": "",
"xAxisType": "date",
"xAxisFormat": "hh:mm:ss:SS",
"xAxisFormat": "HH:mm:ss",
"xAxisOffset": 0.2,
"y1AxisTitle": "y1",
"y2AxisTitle": "y2"
"y1AxisTitle": "",
"y2AxisTitle": ""
},
"Legend": {
"Width": 190,
Expand Down Expand Up @@ -179,7 +179,9 @@
"MenuBar": {
"Width": 635,
"Height": 50,
"visible": true,
"showIntervalPanel": true,
"connected": true,
"showXOptionsPanel": true,
"showYOptionsPanel": true,
"showCoordsPanel": true,
Expand Down Expand Up @@ -221,10 +223,10 @@
"PaintFill": false,
"VerticalBarSize": 5,
"xAxisOffset": 0.2,
"x1AxisTitle": "x1",
"x2AxisTitle": "x2",
"y1AxisTitle": "y1",
"y2AxisTitle": "y2"
"x1AxisTitle": "",
"x2AxisTitle": "",
"y1AxisTitle": "",
"y2AxisTitle": ""
},
"Legend": {
"Width": 190,
Expand Down Expand Up @@ -252,6 +254,7 @@
"MenuBar": {
"Width": 635,
"Height": 50,
"visible": true,
"showIntervalPanel": true,
"showXOptionsPanel": true,
"showYOptionsPanel": true,
Expand Down Expand Up @@ -286,6 +289,71 @@
}
}
}
}
},
"LabelVisualizerConfigs": {
"LabelVisualizer1": {
"Name": "Label Visualizer 1",
"TraceLength": 1000,
"TraceModeLtd": true,

"AdditionPolicy": "all",
"AdditionList": ["labeler0.type0", "labeler0.type1"],

"position": {
"x": 2,
"y": 0,
"rowspan": 1,
"colspan": 1
},
"Chart": {
"Width": 450,
"Height": 140,
"BarThickness": 0.7,
"xAxisTitle": "Timestamp",
"xAxisType": "date",
"xAxisFormat": "HH:mm:ss",
"y1AxisTitle": "Labels",
},
"Legend": {
"Width": 190,
"Height": 150,

"LegendItem": {
"Width": 165,
"Height": 40,
"Button_Width": 20,
"Button_Height": 20,
"ButtonPanel_Width": 100,
"ButtonPanel_Height": 20,
"NameLabel_Width": 160,
"NameLabel_Height": 16,
"ValueLabel_Width": 60,
"ValueLabel_Height": 20,
"ValueFont": {
"Name": "Dialog",
"Style": "PLAIN",
"Size": 9,
"Color": "BLACK"
}
}
},
"MenuBar": {
"Width": 635,
"Height": 50,
"visible": false,
"showIntervalPanel": true,
"connected": true,
"showXOptionsPanel": true,
"showYOptionsPanel": false,
"showCoordsPanel": true,
"CoordsFont": {
"Name": "Dialog",
"Style": "PLAIN",
"Size": 11,
"Color": "BLACK"
}
},
}
},
}
}
61 changes: 61 additions & 0 deletions config/gui_min_lab.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
{
"MainDisplayConfig": {
"Name": "DNA - Dynamic Network Analyzer",
"LiveDisplayMode": false,
"DefaultDir": "data/test123/run.0/",

"Width": 1680,
"Height": 800,

"VisualizerPanel": {
"Width": 1000,
"Height": 800,
"InnerWidth": 900,
"InnerHeight": 1600
},


"StatsDisplayConfig": {
},

"MetricVisualizerConfigs": {
"MetricVisualizer1": {
"Name": "Metric Visualizer 1",
"position": {
"x": 0,
"y": 0,
},

"VisualizerConfig": {
"SingleConfigs": {
"inDegreeHosts": {
"Type": "MetricVisualizerItem",
"Name": "DegreeDistributionR-HOST.InDegreeDistribution_95p",
"DisplayMode": "linespoint",
"yAxis": "y1",
"visible": true,
}
}
}
}
},
"MultiScalarVisualizerConfigs": {
"MultiScalarVisualizer1": {
"Name": "MultiScalar Visualizer 1",
"position": {
"x": 0,
"y": 2,
}
}
},
"LabelVisualizerConfigs": {
"LabelVisualizer1": {
"Name": "Label Visualizer 2",
"position": {
"x": 0,
"y": 1,
}
}
}
}
}
25 changes: 25 additions & 0 deletions config/gvis/gids.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"GraphPanelConfig": {
"Width": 1024,
"Height": 768,

"TimestampFormat": "HH:mm:ss",
"TimestampOffset": -7200,
"TimestampInSeconds": true,

"StatPanelEnabled": true,
"TextPanelEnabled": true,

"RulesConfig": {
"dna.visualization.graph.rules.nodes.NetworkNodeStyles": {},
"dna.visualization.graph.rules.nodes.NodeSizeByDegree": {
"Name": "defaultNodeSizeByDegree",
"Growth": 0.3,
"Enabled": true,
},
"dna.visualization.graph.rules.edges.EdgeWeightLabel": {
"label": "w=$weight$",
},
}
}
}
7 changes: 7 additions & 0 deletions config/vis/util.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@
## VISUALIZATION UTILITY OPTIONS
########################################


## TIMESTAMP INTERPRETATION SETTINGS ###

## todo: put these in actual vis config
VISUALIZATION_TIMESTAMP_AS_SECOND = true
VISUALIZATION_TIMESTAMP_OFFSET = -7200

## SCREENSHOT SETTINGS #################
VIS_SCREENSHOT_DIR = images/
VIS_SCREENSHOT_FORMAT = png
Expand Down
8 changes: 8 additions & 0 deletions src/dna/graph/generators/network/NetflowBatch.java
Original file line number Diff line number Diff line change
Expand Up @@ -726,4 +726,12 @@ public String getKey(Integer mapping) {

return "unknown";
}

public void setMap(HashMap<String, Integer> map) {
this.map = map;
}

public HashMap<String, Integer> getMap() {
return this.map;
}
}
122 changes: 122 additions & 0 deletions src/dna/graph/generators/network/NetflowGraph.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
package dna.graph.generators.network;

import java.io.IOException;
import java.text.ParseException;
import java.util.ArrayList;
import java.util.concurrent.TimeUnit;

import org.joda.time.DateTime;

import dna.graph.Graph;
import dna.graph.datastructures.GraphDataStructure;
import dna.graph.edges.network.UpdateEvent;
import dna.io.network.NetworkEvent;
import dna.io.network.netflow.NetflowEvent.NetflowDirection;
import dna.io.network.netflow.NetflowEvent.NetflowEventField;
import dna.io.network.netflow.NetflowEventReader;
import dna.io.network.netflow.darpa.DarpaNetflowReader;
import dna.updates.batch.Batch;
import dna.util.network.NetflowAnalysis.EdgeWeightValue;
import dna.util.network.NetflowAnalysis.NodeWeightValue;
import dna.visualization.graph.rules.nodes.NetworkNodeStyles;

public class NetflowGraph extends NetworkGraph {

private NetflowEventReader reader;
private NetflowBatch batchGenerator;

private int batchLengthSeconds;
private int edgeLifeTimeSeconds;

private NetflowEventField[][] edges;
private NetflowDirection[] edgeDirections;
private EdgeWeightValue[] edgeWeights;
private NodeWeightValue[] nodeWeights;

private DateTime initDateTime;
private DateTime firstDateTime;

private Graph graph;

public NetflowGraph(GraphDataStructure gds, long timestampInit, long maximumTimestamp, String dir, String filename,
int batchLengthSeconds, int edgeLifeTimeSeconds, NetflowEventField[][] edges,
NetflowDirection[] edgeDirections, EdgeWeightValue[] edgeWeights, NodeWeightValue[] nodeWeights)
throws IOException, ParseException {
this(gds, timestampInit, maximumTimestamp, dir, filename, batchLengthSeconds, edgeLifeTimeSeconds, true, true,
0, edges, edgeDirections, edgeWeights, nodeWeights);
}

public NetflowGraph(GraphDataStructure gds, long timestampInit, long maximumTimestamp, String dir, String filename,
int batchLengthSeconds, int edgeLifeTimeSeconds, boolean removeZeroDegreeNodes,
boolean removeZeroWeightEdges, int dataOffsetSeconds, NetflowEventField[][] edges,
NetflowDirection[] edgeDirections, EdgeWeightValue[] edgeWeights, NodeWeightValue[] nodeWeights)
throws IOException, ParseException {
super("NetflowGraph", gds, timestampInit);

this.batchLengthSeconds = batchLengthSeconds;
this.edgeLifeTimeSeconds = edgeLifeTimeSeconds;
this.edges = edges;
this.edgeDirections = edgeDirections;
this.edgeWeights = edgeWeights;
this.nodeWeights = nodeWeights;

this.initDateTime = new DateTime(TimeUnit.SECONDS.toMillis(this.timestampInit));
this.firstDateTime = new DateTime(TimeUnit.SECONDS.toMillis(this.timestampInit - edgeLifeTimeSeconds));

this.reader = new DarpaNetflowReader(dir, filename);
this.reader.setBatchIntervalSeconds(batchLengthSeconds);
this.reader.setEdgeLifeTimeSeconds(edgeLifeTimeSeconds);
this.reader.setRemoveZeroDegreeNodes(removeZeroDegreeNodes);
this.reader.setRemoveZeroWeightEdges(removeZeroWeightEdges);
this.reader.setDataOffset(this.reader.getDataOffset() + dataOffsetSeconds);
this.reader.setMinimumTimestamp(this.firstDateTime);
this.reader.setMaximumTimestamp(new DateTime(TimeUnit.SECONDS.toMillis(maximumTimestamp)));

this.batchGenerator = new NetflowBatch("temp", reader, edges, edgeDirections, edgeWeights, nodeWeights);

// set batch-generator for mapping retrieval
NetworkNodeStyles.netflowBatchGenerator = (NetflowBatch) this.batchGenerator;

this.graph = generateGraph();
}

private Graph generateGraph() {
Graph g = this.newGraphInstance();
g.setTimestamp(TimeUnit.MILLISECONDS.toSeconds(this.firstDateTime.getMillis()));

DateTime simTime = this.firstDateTime;

while (simTime.isBefore(this.initDateTime)) {
ArrayList<NetworkEvent> events = this.reader.getEventsUntil(simTime);
if (events.size() > 0) {
Batch b = this.batchGenerator.craftBatch(g, simTime, events, new ArrayList<UpdateEvent>(0), null);
b.apply(g);
}
simTime = simTime.plusSeconds(this.batchLengthSeconds);
}

ArrayList<NetworkEvent> events = this.reader.getEventsUntil(this.initDateTime);
if (events.size() > 0) {
Batch b = this.batchGenerator.craftBatch(g, this.initDateTime, events, new ArrayList<UpdateEvent>(0), null);
b.apply(g);
}

g.setTimestamp(TimeUnit.MILLISECONDS.toSeconds(this.initDateTime.getMillis()));

// return graph
return g;
}

@Override
public Graph generate() {
return this.graph;
}

public NetflowEventReader getReader() {
return this.reader;
}

public NetflowBatch getBatchGenerator() {
return this.batchGenerator;
}
}
5 changes: 5 additions & 0 deletions src/dna/graph/weights/network/NetworkNodeWeight.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ public String toString() {
return buff;
}

@Override
public String asString() {
return toString();
}

public NetworkNodeWeight(WeightSelection ws) {
this("unknown", new double[0]);
}
Expand Down
Loading