-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathassignment1.html
345 lines (335 loc) · 13.1 KB
/
assignment1.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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>NT laboratories | Assignment 1</title>
<style>
img {
max-width: 800px;
border: 3px solid black;
}
</style>
</head>
<body>
<a href="index.html">
<h1>Network Technologies Laboratory Reports</h1>
</a>
<h2>group 12: Wojciech Michałowski 242222, Piotr Wosiak 242232</h2>
<hr>
<ul>
<a href="assignment1.html">
<li>Assignment 1</li>
</a>
<a href="assignment2.html">
<li>Assignment 2</li>
</a>
<a href="assignment3.html">
<li>Assignment 3</li>
</a>
<li> <a href="https://wmichalowski.github.io/assignment4.html">Assignment 4</a></li>
<li> <a href="https://wmichalowski.github.io/assignment5.html">Assignment 5</a></li>
</ul>
<h2>Assignment 1</h2>
<h3>Theoretical Part</h3>
<ol>
<li><strong>Describe ISO/OSI model and protocol assignment</strong></li>
<p>ISO/OSI model describes how applications communicate over the network. <br>
There are seven layers of ISO/OSI model: <br>
<table border="1">
<tr>
<th>Layer</th>
<th>Examples of protocols</th>
</tr>
<tr>
<td>Application</td>
<td>
<ul>
<li>DNS</li>
<li>HTTP</li>
</ul>
</td>
</tr>
<tr>
<td>Presentation</td>
<td>
<ul>
<li>SSL</li>
<li>TLS</li>
</ul>
</td>
</tr>
<tr>
<td>Session</td>
<td>
<ul>
<li>NetBIOS</li>
<li>PAP</li>
</ul>
</td>
</tr>
<tr>
<td>Transport</td>
<td>
<ul>
<li>TCP</li>
<li>UDP</li>
</ul>
</td>
</tr>
<tr>
<td>Network</td>
<td>
<ul>
<li>IPv4</li>
<li>IPv6</li>
</ul>
</td>
</tr>
<tr>
<td>Link</td>
<td>
<ul>
<li>ARP</li>
<li>CSMA</li>
</ul>
</td>
</tr>
<tr>
<td>Physical</td>
<td>
<ul>
<li>IEEE 802.11</li>
<li>USB</li>
</ul>
</td>
</tr>
</table>
</p>
<li><strong>List Protocol Data Units for corresponding layers</strong></li>
<p>
<table border="1">
<tr>
<th>Layer</th>
<th>Unit</th>
</tr>
<tr>
<td>Application </td>
<td>Message</td>
</tr>
<tr>
<td>Presentation</td>
<td>Message</td>
</tr>
<tr>
<td>Session</td>
<td>Message</td>
</tr>
<tr>
<td>Transport</td>
<td>Segment</td>
</tr>
<tr>
<td>Network</td>
<td>Datagram</td>
</tr>
<tr>
<td>Link</td>
<td>Frame</td>
</tr>
<tr>
<td>Physical</td>
<td>Bits</td>
</tr>
</table>
</p>
<li><strong>Assign the following protocols to corresponding layers: ARP, Bluetooth, DHCP, DNS, FTP, HTTP, ICMP,
IEEE 1394, IEEE 802.11, IGMP, IPv4, IPv6, L2TP, MIME, NetBIOS, NNTP, RS-232, RS-449, RTP, SIP, SLIP,
SSL, TCP, Telnet, TLS, UDP, USB</strong></li>
<p>
<table border="1">
<tr>
<th>Layer</th>
<th>Protocols</th>
</tr>
<tr>
<td>Application</td>
<td>
<ul>
<li>DHCP</li>
<li>DNS</li>
<li>FTP</li>
<li>HTTP</li>
<li>SIP</li>
<li>Telnet</li>
<li>NNTP</li>
</ul>
</td>
</tr>
<tr>
<td>Presentation</td>
<td>
<ul>
<li>SSL</li>
<li>TLS</li>
<li>MIME</li>
</ul>
</td>
</tr>
<tr>
<td>Session</td>
<td>
<ul>
<li>NetBIOS</li>
<li>RTP</li>
</ul>
</td>
</tr>
<tr>
<td>Transport</td>
<td>
<ul>
<li>TCP</li>
<li>UDP</li>
</ul>
</td>
</tr>
<tr>
<td>Network</td>
<td>
<ul>
<li>IPv4</li>
<li>IPv6</li>
<li>ICMP</li>
<li>IGMP</li>
</ul>
</td>
</tr>
<tr>
<td>Link</td>
<td>
<ul>
<li>ARP</li>
<li>L2TP</li>
<li>SLIP</li>
</ul>
</td>
</tr>
<tr>
<td>Physical</td>
<td>
<ul>
<li>Bluetooth</li>
<li>IEEE 802.11</li>
<li>USB</li>
<li>IEEE 1394</li>
<li>RS-232</li>
<li>RS-449</li>
</ul>
</td>
</tr>
</table>
</p>
</ol>
<p>
Sources:
<ul>
<li>https://en.wikipedia.org/wiki/OSI_model</li>
<li>https://ftims.edu.p.lodz.pl/pluginfile.php/34372/mod_resource/content/3/Lecture02_new.pdf</li>
<li>http://kawia.wex.pl/protokolyosi.html</li>
</ul>
</p>
<h3>Practical Part</h3>
<ol>
<li><strong>Use PuTTY client to connect to the web server: studife.it.p.lodz.pl using the appropriate
protocol</strong></li>
<p>Using PuTTY, we connect to the studife.it.p.lodz.pl server using SSH protocol on port 22222. As per SSH
specification, we may specify the login within the URL.</p>
<img src="images/task_1/putty/putty_opened.png" alt="PuTTY window opened">
<p>Once we click "Open" button, we are greeted with the SSH login banner and after we input the password, we may
log in</p>
<img src="images/task_1/putty/putty_login.png" alt="PuTTY login">
<li><strong>Download the webpage using GET html command.</strong></li>
<p>Threre are multiple ways this may be achieved. One way is to use telnet command. Telnet is a protocol that
was once used to remotely control the server. It's ability to send ASCII commands can be used to send a GET
request and using "tee" command, pipe the output both to the terminal and to a file. Throughout the
exercise, we utilised the "localhost" as we were unable to make a request to "studife.it.p.lodz.pl" when
making a request directly from the server.</p>
<img src="images/task_1/putty/telnet_get.png" alt="Telnet GET Request">
<p>However, as it may be noticed, such way of operation is far from being ideal. Not only is telnet outdated,
but also we would have to manually clean the file from the unwanted telnet commands.</p>
<p>A superior solution is to use "curl" or "wget" commands. Curl is a command line tools used to manually send
HTTP requests. Wget is a tool used specifically to download web pages and other assets. In this example, we
used curl command to download the sample page.</p>
<img src="images/task_1/putty/downloaded_page.png" alt="Page downloaded using curl">
<li><strong>Copy the result to the local file.</strong></li>
<p>A simple solution is to use SCP command to copy the file securely to the local folder. The proof is provided
as a part of the next exercise.</p>
<li><strong>Display the file in the browser from local disk.</strong></li>
<img src="images/task_1/putty/file_downloaded_locally.png" alt="File displayed locally">
<li><strong>Use ping to check connection to web server Use Wireshark to find to list all protocols which are
used during this communication. Assign abovementioned protocols to ISO/OSI layers.</strong></li>
<p>As the "studife.it.p.lodz.pl" server is configured in a secure manner, it does not respond to ping requests.
Having consulted with the tutor, we sent ping requests to a different server.</p>
<img src="images/task_1/ping_output.png" alt="Ping output">
<p>We may notice that each ping consists of several layers, as all packets do.</p>
<ul>
<li>Data link layer - Ethernet II, which includes source and destination MAC addresses</li>
<li>Internet layer - Internet Protocol v4</li>
</ul>
<p>ICMP is a protocol that supports Internet Protocol, thus it works on the Internet layer</p>
<p>We could also consider that in the very beginning a DNS query (Appliation layer) is sent to determine the IP
address of the chosen server (google.com in our case).</p>
<p>Next, ARP request (Data-link layer) is sent to determine the MAC address of the next device.</p>
<li><strong>Use ftp protocol to upload your webpage to the server. Use Wireshark to find your password and to
list all protocols which are used during this communication. Assign abovementioned protocols to ISO/OSI
layers.</strong></li>
<img src="images/task_1/ftp_password.png" alt="FTP password">
<p>We may notice that each packet within FTP connection consists of several layers, as all packets do.</p>
<ul>
<li>Data link layer - Ethernet II, which includes source and destination MAC addresses</li>
<li>Internet layer - Internet Protocol v4</li>
<li>Transport layer - Transmission Control Protocol (TCP)</li>
<li>Application layer - File Transfer Protocol (FTP)</li>
</ul>
<p>Since FTP does not encrypt the data that is sent, we may easily find the password within the packets, as
shown on the image above.</p>
<li><strong>Use scp, sftp and scp protocols to upload your webpage to the server. Use Wireshark to find your
password and to list all protocols which are used during this communication. Assign abovementioned
protocols to ISO/OSI layers.</strong></li>
<p>Both SCP and SFTP protocols utilise SSH to encrypt the data that is exchanged between the client and the
server. As a result, we are unable to extract password from the communication. Interestingly, Wireshark
tries to interpret the communication and, e.g. while connecting to port 22, it interprets the communication
as SSH protocol.</p>
<p>SCP Protocol</p>
<ul>
<li>
<p>Port 22</p>
<img src="images/task_1/wireshark_scp_22.png" alt="SCP Port 22">
</li>
<li>
<p>Port 22222</p>
<img src="images/task_1/wireshark_scp_22222.png" alt="SCP Port 22222">
</li>
</ul>
<p>SFTP Protocol</p>
<ul>
<li>
<p>Port 22</p>
<img src="images/task_1/wireshark_sftp_22.png" alt="SFTP Port 22">
</li>
<li>
<p>Port 22222</p>
<img src="images/task_1/wireshark_sftp_22222.png" alt="SFTP Port 22222">
</li>
</ul>
<p>Both protocols make use of the same underlying layers. SFTP is FTP wrapped inside SSH and SCP is a secure
copy method based on SSH:</p>
<ul>
<li>Data link layer - Ethernet II, which includes source and destination MAC addresses</li>
<li>Internet layer - Internet Protocol v4</li>
<li>Transport layer - Transmission Control Protocol (TCP)</li>
<li>Application layer - Secure Shell Protocol</li>
</ul>
</ol>
</body>
</html>