-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnetwerk.html
199 lines (117 loc) · 4.2 KB
/
netwerk.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
<!DOCTYPE html>
<html>
<head>
<title>Netwerkin'</title>
<meta charset="utf-8">
<style>
@import url(https://fonts.googleapis.com/css?family=Yanone+Kaffeesatz);
@import url(https://fonts.googleapis.com/css?family=Droid+Serif:400,700,400italic);
@import url(https://fonts.googleapis.com/css?family=Ubuntu+Mono:400,700,400italic);
body { font-family: 'Droid Serif'; }
h1, h2, h3 {
font-family: 'Yanone Kaffeesatz';
font-weight: normal;
}
.remark-code, .remark-inline-code { font-family: 'Ubuntu Mono'; }
</style>
</head>
<body>
<textarea id="source">
class: center, middle
# Netwerkin' 4 fun n profit
---
# Agenda
## may or may not be an accurate ordering, like UDP
* Protocols
* TCP
* UDP
* PACKETS
* TCPDUMP
* ERRATA
---
# PROTOCOLZZZ
A protocol is just a set of rules that determine the format and meaning of frames/messages/packets sent between
servers and clients
---
# TCP
## Transmission Control Protocol
A "connection-oriented" protocol that computers communicate over the internet/network with
TCP has error-checking and guarantees around delivery of data and that packets will be delivered in the order set
---
# UDP
## User Datagram Protocol
A "connectionless" protocol that works like TCP but makes no guarantees around error checking and recovery
It instead continiously sends datagrams (aka ~packets w/o guarantees) to the recepient regardless of receipt
---
# Packets
A packet is a small chunk of data sent over the network with has a header and a payload
This is roughly analogous to a real life package. Your header contains sender and recipient IP addresses (and a few more things) and your payload contains the actual chunk of data (between 1.5kb and 64kb, depending!)
---
# Connection v Connectionless
UDP will just spam whatever you point it at without ensuring that there's anything at the other end
Whereas TCP performs a 3 way handshake first and will disconnect if the client disappears (eventually).
## SYN, SYN-ACK, ACK
This is the 3 way handshake!
_SYN_chronize, _SYN_chronize_ACK_nowledgement, _ACK_nowledge
(host a, host b, host a)
A connection is now established!
---
# what use for?
Basically TCP is more useful where reliability is paramount (http, ssh, smtp, et al)
UDP is useful where speed is key (games, streams, DNS, etc)
---
# TCPDUMP
So that preamble brings us to why we're actually here, `tcpdump`.
tcpdump is a *nix utility that is very likely on your computer if you're running any *nix-like (linux, mac osx)
It essentially allows you to create "dumps" or "traces" of network activity.
## DEMO TIME (oh no)
`tcpdump`
`tcpdump -n`
`tcpdump -n -v(vv)`
`tcpdump -c`
`tcpdump -i`
`tcpdump -w and tcpdump -r`
note: wireshark and some other networking tools can open pcap dumps! They may or may not be friendlier / more intuitive.
---
# Filters
Seeing all network traffic is nice and all, but usually we care about specific bits of data. Filters allow us to accomplish this.
---
## Host / Port
`tcpdump -n -vvv -c 100 -i any host 127.0.0.1`
`tcpdump -n -vvv -c 100 -i any port 3000`
`tcpdump -n -vvv -c 100 -i any host 127.0.0.1 and port 3000`
`tcpdump -n -vvv -c 100 -i any host 127.0.0.1 and (port 3000 or port 4000)`
---
# Making Sense of Things (TM)
## FLAGSSSSSSzzz (flags)
[S] - SYN (Start Connection)
[S.] - SYN-ACK (depending on version)
[.] - No Flag Set
[P] - PSH (Push Data)
[F] - FIN (Finish Connection)
[R] - RST (Reset Connection)
---
# omg so hard 2 read ;_;
## -XX, -A
-XX hex and ascii
-A ascii only
---
# yyyyy?
Often times it can be useful to see your data flowing through the application
_before_ it hits the application layer.
your webserver/webapp/etc tend to do all sorts of things to data that can
obfuscate issues that lie (perhaps) outside the application layer.
---
# THX, NO QUESTIONS
jk but I probably don't have a good answer
Slides available @ http://regretful.ly/netwerk.html
####### ... maybe, I just paid an overdue invoice to my domain regristrar so the DNS hasn't refreshed yet
---
</textarea>
<script src="https://remarkjs.com/downloads/remark-latest.min.js">
</script>
<script>
var slideshow = remark.create();
</script>
</body>
</html>