-
Notifications
You must be signed in to change notification settings - Fork 1
/
mod1-10.html
333 lines (293 loc) · 16.5 KB
/
mod1-10.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
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Advanced Networking - Module 1 Chapter 10 - Application Layer</title>
<meta name="description" content="Abilitante alle certificazioni Cisco CCENT e CCNA">
<meta name="author" content="Hacklab Cosenza">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<link rel="stylesheet" href="css/reveal.css">
<link rel="stylesheet" href="css/theme/hlcs.css" id="theme">
<!-- Code syntax highlighting -->
<link rel="stylesheet" href="lib/css/zenburn.css">
<!-- Printing and PDF exports -->
<script>
var link = document.createElement( 'link' );
var link = document.createElement( 'link' );
link.rel = 'stylesheet';
link.type = 'text/css';
link.href = window.location.search.match( /print-pdf/gi ) ? 'css/print/pdf.css' : 'css/print/paper.css';
document.getElementsByTagName( 'head' )[0].appendChild( link );
</script>
<!--[if lt IE 9]>
<script src="lib/js/html5shiv.js"></script>
<![endif]-->
</head>
<body>
<div class="reveal">
<!-- Any section element inside of this container is displayed as a slide -->
<div class="slides">
<section>
<h1>Advanced Networking</h1>
<h2>Routing & Switching:</h2>
<h2>Introduction to Networks</h2>
<h3>Chapter 10: Application Layer</h3>
<small><a href="http://hlcs.it">Hacklab Cosenza</a> / Centro di Ricerca su Tecnologia e Innovazione</small>
</section>
<section>
<section>
<h2>The OSI L7: Application</h2>
<img src="http://i.imgur.com/DrBlKz8.gif" style="float: right;">
<p>The <strong>Application Layer</strong> involves the <strong>protocols used by programs</strong> to exchange data, regardless of the underlying network(s).</p>
<p>L2 is <em>link-to-link</em>, L3 is <em>end-to-end</em>, L4 is <em>process-to-process</em>. <strong>L7 is <em>application-to-application</em></strong>.</p>
<p>It is the closest to the user and the one actually <strong>producing the data</strong> content.</p>
</section>
<section>
<h2>TCP/IP vs ISO/OSI L7</h2>
<img src="http://i.imgur.com/DrBlKz8.gif">
<p>The TCP/IP Application Layer functionality is splitted into <strong>3 layers in the ISO/OSI framework</strong>.</p>
<p>Application Layer protocols in the TCP/IP protocol suite includes HTTP, FTP, IMAP, POP, DNS, SMTP, DHCP, Telnet, TFTP, etc.</p>
</section>
</section>
<section>
<section>
<h2>Presentation and Session Layers</h2>
<h3>Layer 6 - Presentation Layer</h3>
<p>Its purpose is to <strong>represent data in a common way</strong>:</p>
<ul>
<li>It <strong>encodes data in a compatible format</strong>, understandable by the destination.</li>
<li>It handles <strong>data compression and decompression</strong>.</li>
<li>It <strong>encrypts and decrypts</strong> for transmission/reception.</li>
</ul>
<p>It's about <strong>file formats and standards</strong> (like JPG, PNG, MPEG).</p>
</section>
<section>
<h2>Presentation and Session Layers</h2>
<h3>Layer 5 - Session Layer</h3>
<p>L5 protocols <strong>initiate (authenticating and authorizing, if necessary), keep active, terminate or restart dialogues</strong> (<em>sessions</em>) between source and destination applications.</p>
<p>Examples are: PAP, SCP, RPC, PPTP, L2TP, etc.</p>
</section>
</section>
<section>
<h2>The Client-Server Model</h2>
<ul>
<li>The host <strong>requesting the information</strong> is a <strong>client</strong>.</li>
<li>The host <strong>responding to the request and providing the information</strong> is a <strong>server</strong>.</li>
</ul>
<p><strong>The client begins the exchange</strong> by requesting data from the server, which responds with stream(s) of data to the client.</p>
<p>Application layer protocols describe the <strong>format of these exchanges between clients and servers</strong>.</p>
<p><u>Actual data (L6)</u> transfer aside, these <u>exchanges (L7)</u> may require user authentication and <u>session management (L5)</u>.</p>
<p>Server software is often implemented as a <strong>background service</strong> (<em>daemon</em>) that waits for requests by the clients.</p>
</section>
<section>
<section>
<h2>Peer-to-Peer (P2P) Model</h2>
<p>In the P2P network model devices are <strong><em>peers</em></strong> to one another: they carry <strong>both roles (client and server) simultaneously</strong>.</p>
<p>Each peer can assume the role of the <strong>client for a particular request</strong>, while acting as a <strong>server role for another</strong> one.</p>
<p>In the P2P network model, <strong>P2P Applications</strong> are essential to coordinate the roles of the peers without centralizing accounts, permissions, data.</p>
<p>They can also operate as an <strong>hybrid</strong>: the actual resource sharing is P2P-based and decentralized, but the <strong>resource indexes are stored on centralized server(s)</strong>. eMule and early BitTorrent are notable examples. </p>
</section>
<section>
<h2>Common P2P Applications</h2>
<p>P2P applications often consist of a background service and the User Interface.</p>
<p>Examples of popular P2P applications include:</p>
<ul>
<li>eDonkey/eMule (<strong>ed2k</strong>-based)</li>
<li>Shareaza/LionShare (<strong>gnutella</strong>-based)</li>
<li>BitTorrent/µTorrent (<strong>BitTorrent</strong>-based)</li>
<li>Bitcoin/Litecoin (<strong>blockchain</strong>-based <strong>Digital Currencies</strong>)</li>
</ul>
</section>
</section>
<section>
<section>
<h2>HyperText Transfer Protocol</h2>
<p>Browsers interpret the URL, recognize the type of data and organize retrieval with the server using the right protocol.</p>
<p>Web pages are identified by their <strong>URL (Uniform Resource Locator)</strong>. When we type an URL into our browser, <strong>pages are requested and served by the HTTP Protocol</strong>.</p>
<p>HTTP is a request/response protocol. It operates exchanging messages and status codes. The 3 most important messages are <strong>GET, POST and PUT</strong>. Relevant status codes include <strong>200 OK, 304 Not Modified, 404 Not Found</strong>.</p>
</section>
<section>
<h2>HyperText Transfer Protocol</h2>
<ul>
<li><strong>GET</strong> - A request to retrieve the data for the specified resource.</li>
<li><strong>POST</strong> - A request to upload data related to the specified resource, example: form data, a comment, etc.</li>
<li><strong>PUT</strong> - A request to upload data and have it stored at the specified URL.</li>
</ul>
</section>
<section>
<h2>HyperText Transfer Protocol</h2>
<img src="http://i.imgur.com/DcUYaKW.png">
<p>HTTP is not a secure protocol and its exchanges are transmitted in plain text, easily interceptable. <strong>HTTPS</strong> combines HTTP with <strong>Secure Socket Layer (SSL)</strong> and <strong>Transport Secure Layer (TLS)</strong> to provide authentication and encryption.</p>
</section>
</section>
<section>
<h2>How E-Mail Works</h2>
<p>Email is a <strong>store-and-forward</strong> messaging system.</p>
<p>Email clients never communicates directly with one another, they <strong>communicate with servers to send and receive email</strong>.</p>
<p><strong>Mail servers communicate between them</strong> to relay messages from domain to domain (or even within one).</p>
<p>The protocol used for <strong>sending mail</strong> (both client-to-server and server-to-server) is the SMTP Protocol.</p>
<p>Clients' MUAs (Mail User Agent) do <strong>mail retrieval</strong> from servers using either POP or IMAP protocols.</p>
<p>All these mail protocols needs <strong>proper configuration of the server address</strong> in the MUA.</p>
</section>
<section>
<h2>Simple Mail Transfer Protocol</h2>
<p>SMTP servers run on <strong>TCP port 25</strong> (587 for Secure SMTP).</p>
<p>The message format used by SMTP <strong>requires at least 2 headers (sender and recipient addresses)</strong> and a message body. Other headers exist, but are optional.</p>
<p>When the SMTP server receives a message, it:</p>
<ul>
<li>stores it on a local account, if the recipient is local.</li>
<li>forwards it to another mail server, using SMTP.</li>
<li>schedules mail for retransmission if the destination server is offline or not reachable. After a certain expiration time, the server replies to the sender with an <strong>undeliverable</strong> notification.</li>
</ul>
</section>
<section>
<section>
<h2>Post Office Protocol</h2>
<p>Server listen for POP connection by clients on <strong>TCP Port 110</strong>.</p>
<p>Generally POP servers <strong>delete the messages</strong> after client retrieval, making it <strong>not ideal for centralized backups and account synchronization</strong>.</p>
</section>
<section>
<h2>Internet Message Access Protocol</h2>
<p>IMAP server software runs on <strong>TCP Port 143</strong> (993 for IMAPS).</p>
<p><strong>Messages are always kept on the server</strong> until manual deletion. Clients make a local copy of their inbox on the server.</p>
<p>It's not only message content that is synchronized with the server, but also <strong>folder hierarchy and other metadata</strong>.</p>
<p><strong>Synchronization is 2-way</strong>, so a mailbox server through IMAP is seamlessly usable on different devices at once.</p>
</section>
</section>
<section>
<section>
<h2>Domain Name System (DNS)</h2>
<p>DNS was created to solve the problem of having to remember long numeric addresses.</p>
<p>It matches <strong><em>domain names</em></strong> to network addresses and performs <em>address resolution</em>. The DNS protocol defines:</p>
<ul>
<li>a <strong>message format</strong> that is used for all kinds of DNS communications (client queries, server responses, error messages, DNS records transfer betweeen servers).</li>
<li><strong>DNS records</strong> and their purposes.</li>
</ul>
<p>The most popular DNS server software is the <em>Berkeley Internet Name Domain</em> (<strong>BIND</strong>) daemon.</p>
</section>
<section>
<h2>How DNS works</h2>
<ul>
<li>Upon receiving a client's query, <strong>the server DNS daemon search in its own DNS records</strong> for a match to that name.</li>
<li>If there's none, <strong>it contact other DNS servers</strong> until it is able to resolve the name.</li>
<li>It then sends a <strong>DNS reply to the client</strong> containing the resolved address, but also put the acquired data into a cache for faster responses and less bandwidth consumption.</li>
</ul>
</section>
<section>
<h2>DNS Hierarchy</h2>
<p>DNS uses a hierarchical system to <strong>build the name-to-address mapping database</strong>. It looks like a reverted tree.</p>
<img src="http://i.imgur.com/MafkxjC.gif">
<p>The database is splitted into small, manageable <strong>DNS zones</strong>. If a server is the <u>original source</u> for records in a certain zone, it is said to be <strong><em>authoritative</em></strong> for those records.</p>
</section>
<section>
<h2>DNS Records</h2>
<ul>
<li><strong>A/AAAA</strong> - Single host address.</li>
<li><strong>NS</strong> - Authoritative name server.</li>
<li><strong>CNAME</strong> - It maps a single network address to multiple names that act as an <strong>alias</strong>.</li>
<li><strong>MX</strong> - Used to list the mail servers associated and responsible for exchanging mail for that domain.</li>
</ul>
</section>
<section>
<h2>DNS Tools</h2>
<pre><code class="no-highlight">stefanauss@barney:~$ nslookup -type=a www.google.it
Server: 127.0.1.1
Address: 127.0.1.1#53
Non-authoritative answer:
Name: www.google.it
Address: 173.194.67.94
stefanauss@barney:~$ nslookup -type=ns www.google.it
Server: 127.0.1.1
Address: 127.0.1.1#53
Non-authoritative answer:
*** Can't find www.google.it: No answer
Authoritative answers can be found from:
google.it
origin = ns1.google.com
mail addr = dns-admin.google.com
serial = 1574670
refresh = 900
retry = 900
expire = 1800
minimum = 60
stefanauss@barney:~$ nslookup www.google.it ns1.google.com
Server: ns1.google.com
Address: 216.239.32.10#53
Name: www.google.it
Address: 74.125.232.143
Name: www.google.it
Address: 74.125.232.151
Name: www.google.it
Address: 74.125.232.159
Name: www.google.it
Address: 74.125.232.152</code></pre>
</section>
</section>
<section>
<section>
<h2>DHCP</h2>
<p><em>Dynamic Host Configuration Protocol</em> allows hosts to <strong>autoconfigure network parameters</strong> such IP address, subnet mask, default gateway and DNS servers.</p>
<p>Addresses are <strong>dynamically</strong> <em>leased</em> from an <strong>address pool</strong>. Those no longer used are returned to the pool for reallocation.</p>
<p>A DHCP server keeps track of leased addresses in the <strong>configured range</strong>, assuring their uniqueness.</p>
</section>
<section>
<h2>DHCP Operations</h2>
<img src="http://i.imgur.com/yq2gExU.jpg">
</section>
<section>
<h2>DHCP Operations</h2>
<ol>
<li>Client broadcasts a <strong>DHCP discover (<em>DHCPDISCOVER</em>)</strong> that will reach any available DHCP server.</li>
<li>Server replies with a <strong>DHCP offer (<em>DHCPOFFER</em>)</strong>, proposing a lease and providing all network parameters and lease duration.</li>
<li>Client sends a <strong>DHCP request (<em>DHCPREQUEST</em>)</strong> precisely to the server and lease offer it is accepting.</li>
<li>Server returns a <strong>DHCP acknowledgment, positive or negative (<em>DHCPACK</em> or <em>DHCPNAK)</em></strong>, and records the lease.</li>
</ol>
<p>Client can <strong>renew their lease</strong> before expiration, or request a previously assigned address through a DHCPREQUEST.</p>
</section>
</section>
<section>
<h2>File Transfer Protocol (FTP)</h2>
<img src="http://i.imgur.com/Tmq2tsM.gif">
<p>FTP is a protocol that allows for <strong>pushing and pulling data</strong> to and from a server. FTP opens 2 TCP connections:</p>
<ul>
<li>One on port 21 is just for <strong>connection control</strong>, commands and replies between client and server.</li>
<li>A second one on port 20 for the <strong>actual data transfer</strong>.</li>
</ul>
</section>
<section>
<h2>Server Message Block (SMB)</h2>
<p>SMB (formerly CIFS) is just a client/server sharing protocol that can <strong>share more than just files</strong>, but also printers, serial ports and inter-process messages.</p>
<p>Unlike FTP, it is made for <strong>long-term connections</strong> that make the resources accessible just as if they were local.</p>
<p>Since Windows 2000, SMB services use DNS for name resolution, abandoning the previous non-TCP/IP solution (NETBIOS).</p>
<p>*nix systems have their implementation of the SMB protocol called <strong>SAMBA</strong>.</p>
</section>
<section>
<h1>End of Lesson</h1>
</section>
</div>
</div>
<script src="lib/js/head.min.js"></script>
<script src="js/reveal.js"></script>
<script>
// More info https://github.com/hakimel/reveal.js#configuration
Reveal.initialize({
controls: true,
progress: true,
history: true,
center: true,
transition: 'slide', // none/fade/slide/convex/concave/zoom
// More info https://github.com/hakimel/reveal.js#dependencies
dependencies: [
{ src: 'lib/js/classList.js', condition: function() { return !document.body.classList; } },
{ src: 'plugin/markdown/marked.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
{ src: 'plugin/markdown/markdown.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
{ src: 'plugin/highlight/highlight.js', async: true, callback: function() { hljs.initHighlightingOnLoad(); } },
{ src: 'plugin/zoom-js/zoom.js', async: true },
{ src: 'plugin/notes/notes.js', async: true }
]
});
</script>
</body>
</html>