-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
120 lines (115 loc) · 5.02 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>
Sliding Window Protocol Simulator
</title>
<link rel="stylesheet" href="./css/index.css" />
<link rel="stylesheet" href="./css/bootstrap.min.css">
</head>
<body>
<div class="container-fluid">
<form method="GET" action="#">
<div class="row align-items-end">
<div class="form-group col col-md-3">
<label for="number-windows-input">Number of windows</label>
<input type="number" class="form-control" id="number-windows-input" value="6" />
</div>
<div class="form-group col col-md-3">
<label for="frequency-input">Time between each sent packet(s)</label>
<input type="number" class="form-control" id="frequency-input" value="1" />
</div>
<div class="form-group col col-md-3">
<label for="transmission-delay-input">Transmission Delay(s)</label>
<input type="number" class="form-control" id="transmission-delay-input" value="4" />
</div>
<div class="form-group col col-md-3">
<label for="timeout-input">Timeout(s)</label>
<input type="number" class="form-control" id="timeout-input" value="15" />
</div>
</div>
<div class="row justify-content-md-center">
<div class="form-group col col-md-auto">
<input type="button" class="form-control" value="Start" id="start-stop-button" onclick="startSimulation(document.getElementById('number-windows-input').value,document.getElementById('frequency-input').value,document.getElementById('transmission-delay-input').value,document.getElementById('timeout-input').value);">
</div>
</div>
</form>
</div>
<hr/>
<div class="container-fluid">
<div class="row justify-content-around">
<canvas class="col col-md-auto" id="simulation-frame">
<!-- <div class="row top" id="sender-row">
<div class="rectangle">
<div class="row justify-content-md-center">
0
</div>
</div>
</div>
<div class="row bottom" id="reciever-row">
<div class="rectangle">
<div class="row justify-content-md-center">
0
</div>
</div>
</div> -->
</canvas>
<div class="col col-lg-2" id="legends">
<ul>
<li class="row justify-content-between">
<div class="rectangle">
<div class="row justify-content-md-center">
0
</div>
</div>
Normal frame
</li>
<li class="row justify-content-between">
<div class="rectangle" style="background:#333399;">
<div class="row justify-content-md-center">
0
</div>
</div>
Arrived at receiver
</li>
<li class="row justify-content-between">
<div class="rectangle" style="background:#333399;">
<div class="row justify-content-md-center">
</div>
</div>
Sending packet
</li>
<li class="row justify-content-between">
<div class="rectangle" style="background:#66AAAA;">
<div class="row justify-content-md-center">
0
</div>
</div>
Acknowlegded at sender
</li>
<li class="row justify-content-between">
<div class="rectangle" style="background:#66AAAA;">
<div class="row justify-content-md-center">
</div>
</div>
Sending Ack
</li>
</ul>
</div>
</div>
</div>
<hr/>
<div class="row justify-content-center">
<div class="col col-lg-10">
<script src="https://gist.github.com/ilayaraja97/f79ab9dd0c38e98878be57c36c6a3863.js"></script>
</div>
</div>
</body>
<!-- <script src="./js/jquery.min.js"></script> -->
<script src="./js/paperjs-v0.11.5/dist/paper-full.min.js"></script>
<script type="text/javascript">
paper.install(window);
</script>
<script src="./js/index.js"></script>
</html>