ECE590 Computer and Information Security Fall 2018
Networking Overview
Tyler Bletsch Duke University Some slides adapted from Brian Rogers (Duke)
ECE590 Computer and Information Security Fall 2018 Networking - - PowerPoint PPT Presentation
ECE590 Computer and Information Security Fall 2018 Networking Overview Tyler Bletsch Duke University Some slides adapted from Brian Rogers (Duke) Network fundamentals This course isnt a networking course, so well just hit the highlights
Tyler Bletsch Duke University Some slides adapted from Brian Rogers (Duke)
2
Network
3
4
5
Regional ISP e.g., corporate network Home network Mobile network Global ISP
6
7
8
Router
9
10
11
12
13
14
15
16
Examples: Ethernet, 802.11 WiFi
(the part of the spec that says how to send bits)
Examples: Ethernet, 802.11 WiFi
(the part of the spec that how to send packets to a host on this network)
17
Windows Linux
18
http://www.whatsmyip.org/mac-address-lookup/ Left: ARP listing for my home server Below: Lookup of manufacturer of the “TB-Galaxy-S7” device
19
Example: Internet Protocol (IP)
(how to send packets between networks) Below: Diagnostic tool showing the IP addresses passed on the way from my home to duke.edu
20
21
NAT router Internet Host Host Host
54.2.3.9 192.168.0.1 192.168.0.10 192.168.0.11 192.168.0.12
22
Figure from Wikipedia “IPv6”
23
internet in this config)
get to the internet (NAT router in this case)
with (my router does this too in this case)
24
internet in this config)
with (my router does this too in this case)
get to the internet (NAT router in this case)
25
Example: TCP/UDP
(how to establish a logical channel, maybe even a reliable channel) Below: Sending data between two computers via a raw TCP socket using the ‘netcat’ (nc) tool.
26
27
28
29
30
31
http://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xhtml
32
33
– e.g. 1500 bytes for Ethernet payload size
We’re skipping this sort of stuff. If this were a networking course, we’d spend a looooong time on how TCP works.
34
We’re skipping this sort of stuff. If this were a networking course, we’d spend a looooong time on how TCP works.
35
Example: HTTP, lots more
(fulfill the actual use case) Below: Manually speaking HTTP to request http://google.com/ using the ‘netcat’ (nc) tool.
36
Below: Trace of a Firefox request for http://www.gnu.org/
37
Get http://pics.com/dog.jpg (overall goal) Transport dog.jpg data stream reliably Send packets of data stream across world to pics.com Put electrical pulses on wire that represent the packet Send packet to router on my network; I assume it can eventually reach pics.com
38
39
40
41
Client app Ethernet Driver Ethernet Network TCP IP Server app Ethernet Driver Socket API IP
Application Layer Kernel Transport Layer Network Layer Data Link Layer
Socket API TCP Client side Server side
User process
42
44
socket() connect() write() read() close() socket() bind() listen() accept() read() write() read() close() TCP Client TCP Server
Blocks until connection from client Do work Establish TCP connection Data (request) Data (response) EOF notification
45
Primitive Meaning socket() Create a new communication end point bind() Attach a local address to a socket listen() Announce willingness to accept connections; give queue size accept() Block the caller until a connection attempt arrives connect() Actively attempt to establish a connection send() Send some data over the connection recv() Receive some data from the connection close() Release the connection
46
pid_t pid; int listenfd, connfd; listenfd = socket(...); /***fill the socket address with server’s well known port***/ bind(listenfd, ...); listen(listenfd, ...); for ( ; ; ) { connfd = accept(listenfd, ...); /* blocking call */ if ( (pid = fork()) == 0 ) { /* create a child process to service */ close(listenfd); /* child closes listening socket */ /***process the request doing something using connfd ***/ /* ................. */ close(connfd); exit(0); /* child terminates } close(connfd); /*parent closes connected socket*/ } }
47
48
49
50
51
Wait, there’s a file that we can change on a computer to make it think a certain DNS name points to whatever IP we say it does? Security implications... (Do the hosts + netcat demo)
52
.(root)
edu com gov Top-level domains duke mit ece cs www smtp
53
.(root)
edu com gov Top-level domains duke mit ece cs www smtp
54
.(root)
edu com gov Top-level domains duke mit ece cs www smtp
55
56
57
$TTL 86400 mylab.com. IN SOA PC4.mylab.com. admin@mylab.com. ( 1 ; serial 28800 ; refresh 7200 ; retry 604800 ; expire 86400 ; minimum ttl ) ; mylab.com. IN NS PC4.mylab.com. ; localhost A 127.0.0.1 PC4.mylab.com. A 10.0.1.41 PC3.mylab.com. A 10.0.1.31 PC2.mylab.com. A 10.0.1.21 PC1.mylab.com. A 10.0.1.11
seconds
record. Means: “This name server is authoritative for the zone Mylab.com”
name server
email address of the person in charge
name server
58
root server com server gov server edu server
uci.edu server .virginia.edu server cs.virginia.edu server
59
60
61
HTTP Resolver
Hostname (neon.tcpip-lab.edu) IP address (128.143.71.21)
Name server
Hostname (neon.tcpip-lab.edu) IP address (128.143.71.21)
servers, starting at the root tree
62
.(root)
edu com gov duke mit ece cs www smtp arpa in-addr 150.45.38.128
63
64
65
Adapted from “High-Level Awareness of DNSSEC” by Phil Regnauld and Joe Abley, KENIC/NSRC Workshop, 2011
66
Adapted from “High-Level Awareness of DNSSEC” by Phil Regnauld and Joe Abley, KENIC/NSRC Workshop, 2011