networking crash course - c4cs.github.io · digging deeper connected to (172.217.0.36) port 80 (#0)...

26
Networking Crash Course Matt Terwilliger

Upload: others

Post on 21-Jul-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Networking Crash Course - c4cs.github.io · Digging deeper Connected to (172.217.0.36) port 80 (#0) - what we typed in DNS translates to 172.217.0.36 Computer uses routing table to

NetworkingCrashCourse

MattTerwilliger

Page 2: Networking Crash Course - c4cs.github.io · Digging deeper Connected to (172.217.0.36) port 80 (#0) - what we typed in DNS translates to 172.217.0.36 Computer uses routing table to

BeforeWeStartClient/ServerModelClientrequestsinformationfromserveroverpre-establishedprotocols.

TCP/IPModelApplicationLayer

TransportLayer

InternetLayer

LinkLayer

Page 3: Networking Crash Course - c4cs.github.io · Digging deeper Connected to (172.217.0.36) port 80 (#0) - what we typed in DNS translates to 172.217.0.36 Computer uses routing table to

Client?

Server?

Protocol?

Page 4: Networking Crash Course - c4cs.github.io · Digging deeper Connected to (172.217.0.36) port 80 (#0) - what we typed in DNS translates to 172.217.0.36 Computer uses routing table to

DiggingdeeperLet'suseatoolwe'veseenbefore:

curlhttp://www.google.com/

Page 5: Networking Crash Course - c4cs.github.io · Digging deeper Connected to (172.217.0.36) port 80 (#0) - what we typed in DNS translates to 172.217.0.36 Computer uses routing table to

DiggingdeeperLet'suseatoolwe'veseenbefore:

curlhttp://www.google.com/

Connectedtowww.google.com(172.217.0.36)port80(#0)

www.google.com -whatwetypedin172.217.0.36 -???

Page 6: Networking Crash Course - c4cs.github.io · Digging deeper Connected to (172.217.0.36) port 80 (#0) - what we typed in DNS translates to 172.217.0.36 Computer uses routing table to

DNSdigwww.google.com

Page 7: Networking Crash Course - c4cs.github.io · Digging deeper Connected to (172.217.0.36) port 80 (#0) - what we typed in DNS translates to 172.217.0.36 Computer uses routing table to

DNSdigwww.google.com

dig+tracewww.google.com

Pattern:"Idon'tknowtheanswer,butIknowwhodoes"Recursive/distributedapproach

LimitsdataeachserverisrequiredtostoreNosinglesourceoftruthfortheentireInternet(redundancy)Easiertomanage

Caching

Page 8: Networking Crash Course - c4cs.github.io · Digging deeper Connected to (172.217.0.36) port 80 (#0) - what we typed in DNS translates to 172.217.0.36 Computer uses routing table to

DiggingdeeperConnectedtowww.google.com(172.217.0.36)port80(#0)

www.google.com -whatwetypedinDNStranslates www.google.com to 172.217.0.36Howdoesmycomputer(client)getto 172.217.0.36 (server)?

Page 9: Networking Crash Course - c4cs.github.io · Digging deeper Connected to (172.217.0.36) port 80 (#0) - what we typed in DNS translates to 172.217.0.36 Computer uses routing table to

Routingtraceroutewww.google.com

Page 10: Networking Crash Course - c4cs.github.io · Digging deeper Connected to (172.217.0.36) port 80 (#0) - what we typed in DNS translates to 172.217.0.36 Computer uses routing table to

Routingtraceroutewww.google.com

Page 11: Networking Crash Course - c4cs.github.io · Digging deeper Connected to (172.217.0.36) port 80 (#0) - what we typed in DNS translates to 172.217.0.36 Computer uses routing table to

Routing(continued)Systemmaintainsroutingtable

route-ngetwww.google.com

Page 12: Networking Crash Course - c4cs.github.io · Digging deeper Connected to (172.217.0.36) port 80 (#0) - what we typed in DNS translates to 172.217.0.36 Computer uses routing table to

Routing(continued)Systemmaintainsroutingtable

route-ngetwww.google.com

Whatisen0?

system_profiler

Page 13: Networking Crash Course - c4cs.github.io · Digging deeper Connected to (172.217.0.36) port 80 (#0) - what we typed in DNS translates to 172.217.0.36 Computer uses routing table to

DiggingdeeperConnectedtowww.google.com(172.217.0.36)port80(#0)

www.google.com -whatwetypedinDNStranslates www.google.com to 172.217.0.36Computerusesroutingtabletofind 172.217.0.36Missingalayer(Transport)

Page 14: Networking Crash Course - c4cs.github.io · Digging deeper Connected to (172.217.0.36) port 80 (#0) - what we typed in DNS translates to 172.217.0.36 Computer uses routing table to

PortsAnIPuniquelyidentifiesaninterface.

Whydoweneedports?

Page 15: Networking Crash Course - c4cs.github.io · Digging deeper Connected to (172.217.0.36) port 80 (#0) - what we typed in DNS translates to 172.217.0.36 Computer uses routing table to

PortsAnIPuniquelyidentifiesaninterface.

Whydoweneedports?

TCPvsUDPTwopopularTransportLayerprotocols(butnottheonlyones!)

TCP:Moreguarantees(ordering,best-effortdeliveryattempt)

UDP:Lessoverhead(Fast)

Page 16: Networking Crash Course - c4cs.github.io · Digging deeper Connected to (172.217.0.36) port 80 (#0) - what we typed in DNS translates to 172.217.0.36 Computer uses routing table to

PortsAnIPuniquelyidentifiesaninterface.

Whydoweneedports?

TCPvsUDPTwopopularTransportLayerprotocols(butnottheonlyones!)

TCP:Moreguarantees(ordering,best-effortdeliveryattempt)

UDP:Lessoverhead(Fast)

DifferentusecasesFartherdownthemodelwegothedumbertheprotocolsareNoteverythinghasthesamerequirements

GamingservicemightnotcareifsomedataislostWebsitesobviouslywould

Page 17: Networking Crash Course - c4cs.github.io · Digging deeper Connected to (172.217.0.36) port 80 (#0) - what we typed in DNS translates to 172.217.0.36 Computer uses routing table to

PortsAnIPuniquelyidentifiesaninterface.

Whydoweneedports?

TCPvsUDPTwopopularTransportLayerprotocols(butnottheonlyones!)

TCP:Moreguarantees(ordering,best-effortdeliveryattempt)

UDP:Lessoverhead(Fast)

DifferentusecasesFartherdownthemodelwegothedumbertheprotocolsareNoteverythinghasthesamerequirements

GamingservicemightnotcareifsomedataislostWebsitesobviouslywould

Whataboutwhatwejustsaw?HTTP:TCPport80

DNS:UDPport53

Page 18: Networking Crash Course - c4cs.github.io · Digging deeper Connected to (172.217.0.36) port 80 (#0) - what we typed in DNS translates to 172.217.0.36 Computer uses routing table to

Ports(continued)Q:Whatmakesaserveraserver?

Page 19: Networking Crash Course - c4cs.github.io · Digging deeper Connected to (172.217.0.36) port 80 (#0) - what we typed in DNS translates to 172.217.0.36 Computer uses routing table to

Ports(continued)Q:Whatmakesaserveraserver?

Clientconnectstoalisteningserver.

Page 20: Networking Crash Course - c4cs.github.io · Digging deeper Connected to (172.217.0.36) port 80 (#0) - what we typed in DNS translates to 172.217.0.36 Computer uses routing table to

Ports(continued)Q:Whatmakesaserveraserver?

Clientconnectstoalisteningserver.

SimpleexampleServer:

nc-l9999

Client:

nc127.0.0.19999

Page 21: Networking Crash Course - c4cs.github.io · Digging deeper Connected to (172.217.0.36) port 80 (#0) - what we typed in DNS translates to 172.217.0.36 Computer uses routing table to

WhataboutHTTP?BacktoourcURLexampleRequest:

>GET/HTTP/1.1

>Host:www.google.com

>User-Agent:curl/7.49.1

>Accept:*/*

Page 22: Networking Crash Course - c4cs.github.io · Digging deeper Connected to (172.217.0.36) port 80 (#0) - what we typed in DNS translates to 172.217.0.36 Computer uses routing table to

WhataboutHTTP?(continued)BacktoourcURLexampleResponse:

<HTTP/1.1200OK

<Date:Wed,07Dec201606:54:09GMT

<Expires:-1

<Cache-Control:private,max-age=0

<Content-Type:text/html;charset=ISO-8859-1

<P3P:CP="ThisisnotaP3Ppolicy!Seehttps://www.google.com/support/accounts

/answer/151657?hl=enformoreinfo."

<Server:gws

<X-XSS-Protection:1;mode=block

<X-Frame-Options:SAMEORIGIN

<Set-Cookie:NID=91=srTc7LxMuO_1keewbJvEnV6-ck0Q_GZRtdQmfhGaWQmVCS4L6e2aCuNxky8

i2hDPZwdqbZ2PkA9QFsU3GIOAArpsqPp8mBzr3UqOEc8BiD5V_GTYpVXrqnNw9Ew6XZKsNQYaIy6Tbpr

b-Q;expires=Thu,08-Jun-201706:54:09GMT;path=/;domain=.google.com;HttpOnly

<Accept-Ranges:none

<Vary:Accept-Encoding

<Transfer-Encoding:chunked

Page 23: Networking Crash Course - c4cs.github.io · Digging deeper Connected to (172.217.0.36) port 80 (#0) - what we typed in DNS translates to 172.217.0.36 Computer uses routing table to

TryitOpenawebbrowserLet'sfindtheminimumsetofinformationinavalidHTTPrequest

Page 24: Networking Crash Course - c4cs.github.io · Digging deeper Connected to (172.217.0.36) port 80 (#0) - what we typed in DNS translates to 172.217.0.36 Computer uses routing table to

TryitOpenawebbrowserLet'sfindtheminimumsetofinformationinavalidHTTPrequest

nc-l9999

Note:Notport 80 .Why?<C+d> tosignalendofinput

Page 25: Networking Crash Course - c4cs.github.io · Digging deeper Connected to (172.217.0.36) port 80 (#0) - what we typed in DNS translates to 172.217.0.36 Computer uses routing table to

TryitOpenawebbrowserLet'sfindtheminimumsetofinformationinavalidHTTPrequest

nc-l9999

Note:Notport 80 .Why?<C+d> tosignalendofinput

Request:

>GET/HTTP/1.1

Response:

<HTTP/1.1200OK

Page 26: Networking Crash Course - c4cs.github.io · Digging deeper Connected to (172.217.0.36) port 80 (#0) - what we typed in DNS translates to 172.217.0.36 Computer uses routing table to

WrapUpSomuchmore

SSL/TLSDHCPARPIPv6NATFirewallsetc.

Friday