Networks Have Layers - Understanding The OSI Model

22
Networks Have Layers Brandon Checketts

Transcript of Networks Have Layers - Understanding The OSI Model

Page 1: Networks Have Layers - Understanding The OSI Model

Networks Have LayersBrandon Checketts

Page 2: Networks Have Layers - Understanding The OSI Model

Who Am I

● My father is a network engineer for a government contractor (I grew up with this stuff)

● Degree on Telecommunications Administration● Background in Linux System Administration● Now mostly work in Software Development● Lead people here at RoundSphere / BookScouter / Seller

Labs

Page 4: Networks Have Layers - Understanding The OSI Model

Layers, According to Who?

● OSI Model● TCP/IP Model● Apple Model

Layers are not always distinctly defined (many protocols span multiple layers)

In modern technology, many protocols tunnel other protocols….it can be a mess.

Page 7: Networks Have Layers - Understanding The OSI Model

The OSI Layers

● Application, Presentation, Session, Transport, Network, Data, Physical

● All People Seem To Need Data Processing● People Don’t Need Those Stupid Packets Anyway● Please Do Not Throw Sausage Pizza Away● Please Do Not Teach Students Pointless Acronyms

Page 8: Networks Have Layers - Understanding The OSI Model

Local networks, remote networks?● You can talk to hosts on a local network without going through a router● Hosts on a different network, require going through a router.

Page 9: Networks Have Layers - Understanding The OSI Model

Hubs, Switches, Routers, oh my!

● Hubs = Layer 1● Switches = Layer 2● Routers = Layer 3● Modern devices claim to handle All 7-Layers

○ (DNS Recursion, HTTP Caching, Load Balancing, VOIP, VPN, etc)

Page 10: Networks Have Layers - Understanding The OSI Model

Layer 1 - PhysicalHow the physical device transmits bits over a distance

Deals with electrical signals, optical signals, etc

● 100BASE-TX● 802.11● DSL● RS-232● T-1, OC-3

Page 11: Networks Have Layers - Understanding The OSI Model

Layer 2 - Data LinkDefines how “Frames” are defined, transmitted, error-checked over a physical media

Frames to not cross between Local Networks

Protocols deals with congestion, retrying delivery, identifying errors

● Spanning Tree Protocol● Frame Relay● PPP● ATM

Page 12: Networks Have Layers - Understanding The OSI Model

Layer 3 - The Network LayerDefines how networks communicate with other networks. Allows a “packet” to get from a host one one network to a host on another network. Deals with unique network-level addresses and routing packets between networks.

● IPv4, IPv6● IPX, X.25● ICMP● Networking Protocols (RIP, OSPF, EIGRP, BGP)

Page 13: Networks Have Layers - Understanding The OSI Model

Layer 4 - The Transport LayerResponsible for making sure that packets arrive to destination reliably, and in correct sequence

● TCP / UDP● NetBIOS, SPX● iSCSI● Appletalk

Page 14: Networks Have Layers - Understanding The OSI Model

Layer 5 - The Session LayerEstablishes sessions that span over time

● (TCP/IP largely combines this with Layer 4 - Transport)● NetBIOS● PPTP● SSH?

Page 15: Networks Have Layers - Understanding The OSI Model

Layer 6 - The Presentation LayerResponsible for delivering and formatting data for the Application layer

Encryption

Data Compression

● SSL / TLS● Gzip● XML, JSON? (probably not)

Page 16: Networks Have Layers - Understanding The OSI Model

Layers 7 - The Application LayerMost of the protocols you know and love (and hate?)

● HTTP, SMTP, FTP, IMAP● DHCP, LDAP, ● RTMP, Samba, Appleshare● NFS, DNS,

Page 17: Networks Have Layers - Understanding The OSI Model

Why stop at 7?

● Layer 8 - The “User”● Layer 9 - The Organization● Layer 10 - The Government

Page 18: Networks Have Layers - Understanding The OSI Model

Wireshark

● PCap, WinPCap are the packet capture programs

● Wireshark is a frontend for PCap● Wireshark is a really nice interface for viewing

captured packet streams● Really good at digging into protocol details

Page 19: Networks Have Layers - Understanding The OSI Model

Demo: Capture Simple Ping1. ARP request / response from my computer2. DNS Request / Response from 4.2.2.13. Ping Requests4. Ping Replies

a. (Can dig into any of these packets to see lower-level protocols)

Page 20: Networks Have Layers - Understanding The OSI Model

Demo: Capture HTTP Request● Filter just DNS to see hots that the site is using● TCP Syn (#16), Syn-Ack (#22), and Ack (#23)● #34-43 are TCP Packets Re-assembled in #50

○ (1514 bytes each, re-assembled #50 shows size of 15,275 bytes)

● #911 out-of-order TCP Packet● #1183 SSL Certificate Exchange● TCP Window Sizing if fascinating :)

Page 21: Networks Have Layers - Understanding The OSI Model

Demo: Capture WPA Key Exchange?Some wireless cards (mostly Windows) don’t support capturing raw packets:

https://wiki.wireshark.org/CaptureSetup/WLAN

Filter for ‘eapol’

Page 22: Networks Have Layers - Understanding The OSI Model

Questions?●