CSE 127 Week 8 Discussion · 2020-05-20 · 1. Your laptop uses DHCP (Dynamic Host Configuration...

38
CSE 127 Week 8 Discussion Ariana Mirian Zoom Props to Deian Stefan for Slides

Transcript of CSE 127 Week 8 Discussion · 2020-05-20 · 1. Your laptop uses DHCP (Dynamic Host Configuration...

Page 1: CSE 127 Week 8 Discussion · 2020-05-20 · 1. Your laptop uses DHCP (Dynamic Host Configuration Protocol) to bootstrap itself on the local network. A. New host doesn’t have an

CSE127Week8DiscussionArianaMirian

Zoom

PropstoDeian StefanforSlides

Page 2: CSE 127 Week 8 Discussion · 2020-05-20 · 1. Your laptop uses DHCP (Dynamic Host Configuration Protocol) to bootstrap itself on the local network. A. New host doesn’t have an

Thisisbeingrecorded

Page 3: CSE 127 Week 8 Discussion · 2020-05-20 · 1. Your laptop uses DHCP (Dynamic Host Configuration Protocol) to bootstrap itself on the local network. A. New host doesn’t have an

PA4duetomorrow!

Page 4: CSE 127 Week 8 Discussion · 2020-05-20 · 1. Your laptop uses DHCP (Dynamic Host Configuration Protocol) to bootstrap itself on the local network. A. New host doesn’t have an

OverviewofToday

• Overviewoflasttwolectures• Somenewinformation

• BriefoverviewofPA5• ToolsthatmightbehelpfulduringthePA

• Openofficehours(iftime)

Page 5: CSE 127 Week 8 Discussion · 2020-05-20 · 1. Your laptop uses DHCP (Dynamic Host Configuration Protocol) to bootstrap itself on the local network. A. New host doesn’t have an

OSI Layers(Open Systems Interconnection)

Application• End user layer• HTTP, FTP, Skype, SSH, SMTP, DNS

Presentation• Syntax, byte order, compression, encryption• SSL, SSH, MPEG, JPEG

Session• Connection establishment and maintenance• APIs, sockets

Transport• End-to-end connections between processes• TCP, UDP

Network• Addressing, routing between nodes• IP

Data Link• Link management, frames• Ethernet, WiFi

Physical• Physical wires• Photons, RF modulation

Page 6: CSE 127 Week 8 Discussion · 2020-05-20 · 1. Your laptop uses DHCP (Dynamic Host Configuration Protocol) to bootstrap itself on the local network. A. New host doesn’t have an

Basic Internet Archictecture “Hourglass”Narrow waist = interoperability

IP

Copper Fiber

TCP

FTPHTTPSMTPDNSNTP

IP

Cellular

Radio

WiFi Ethernet

UDP

Application layer

Transport layer

Network layer

Link layer

Physical layer

Page 7: CSE 127 Week 8 Discussion · 2020-05-20 · 1. Your laptop uses DHCP (Dynamic Host Configuration Protocol) to bootstrap itself on the local network. A. New host doesn’t have an

Workingexample

Youconnectyourlaptoptoacaféwifi networkandtypeucsd.edu intoyourbrowser’sURLbar.Whathappens?

Page 8: CSE 127 Week 8 Discussion · 2020-05-20 · 1. Your laptop uses DHCP (Dynamic Host Configuration Protocol) to bootstrap itself on the local network. A. New host doesn’t have an

Workingexample

Youconnectyourlaptoptoacaféwifi networkandtypeucsd.edu intoyourbrowser’sURLbar.Whathappens?

1. YourlaptopusesDHCP(DynamicHostConfigurationProtocol)tobootstrapitselfonthelocalnetwork.

Page 9: CSE 127 Week 8 Discussion · 2020-05-20 · 1. Your laptop uses DHCP (Dynamic Host Configuration Protocol) to bootstrap itself on the local network. A. New host doesn’t have an

Workingexample

Youconnectyourlaptoptoacaféwifi networkandtypeucsd.edu intoyourbrowser’sURLbar.Whathappens?

1. YourlaptopusesDHCP(DynamicHostConfigurationProtocol)tobootstrapitselfonthelocalnetwork.A. Newhostdoesn’thaveanIPaddress,doesn’tknowwhotoask

Page 10: CSE 127 Week 8 Discussion · 2020-05-20 · 1. Your laptop uses DHCP (Dynamic Host Configuration Protocol) to bootstrap itself on the local network. A. New host doesn’t have an

Workingexample

Youconnectyourlaptoptoacaféwifi networkandtypeucsd.edu intoyourbrowser’sURLbar.Whathappens?

1. YourlaptopusesDHCP(DynamicHostConfigurationProtocol)tobootstrapitselfonthelocalnetwork.A. Newhostdoesn’thaveanIPaddress,doesn’tknowwhotoaskB. BroadcastsDHCPDISCOVERto255.255.255.255withitsMACaddress

Page 11: CSE 127 Week 8 Discussion · 2020-05-20 · 1. Your laptop uses DHCP (Dynamic Host Configuration Protocol) to bootstrap itself on the local network. A. New host doesn’t have an

Workingexample

Youconnectyourlaptoptoacaféwifi networkandtypeucsd.edu intoyourbrowser’sURLbar.Whathappens?

1. YourlaptopusesDHCP(DynamicHostConfigurationProtocol)tobootstrapitselfonthelocalnetwork.A. Newhostdoesn’thaveanIPaddress,doesn’tknowwhotoaskB. BroadcastsDHCPDISCOVERto255.255.255.255withitsMACaddressC. DHCPserverrespondswithconfig:leaseonhostIPaddress,gatewayIP

address,DNSserverinformation

Page 12: CSE 127 Week 8 Discussion · 2020-05-20 · 1. Your laptop uses DHCP (Dynamic Host Configuration Protocol) to bootstrap itself on the local network. A. New host doesn’t have an

Workingexample

Youconnectyourlaptoptoacaféwifi networkandtypeucsd.edu intoyourbrowser’sURLbar.Whathappens?

2.YourlaptopmakesanARPrequesttolearntheMACaddressofthelocalrouter.

Page 13: CSE 127 Week 8 Discussion · 2020-05-20 · 1. Your laptop uses DHCP (Dynamic Host Configuration Protocol) to bootstrap itself on the local network. A. New host doesn’t have an

Workingexample

Youconnectyourlaptoptoacaféwifi networkandtypeucsd.edu intoyourbrowser’sURLbar.Whathappens?

2.YourlaptopmakesanARPrequesttolearntheMACaddressofthelocalrouter.

A. Everyconnectionoutsidethelocalnetworkwillbeencapsulatedinalink-layerframewiththelocalrouter’sMACaddressasthedestination.

Page 14: CSE 127 Week 8 Discussion · 2020-05-20 · 1. Your laptop uses DHCP (Dynamic Host Configuration Protocol) to bootstrap itself on the local network. A. New host doesn’t have an

Workingexample

Youconnectyourlaptoptoacaféwifi networkandtypeucsd.edu intoyourbrowser’sURLbar.Whathappens?

2.YourlaptopmakesanARPrequesttolearntheMACaddressofthelocalrouter.

A. Everyconnectionoutsidethelocalnetworkwillbeencapsulatedinalink-layerframewiththelocalrouter’sMACaddressasthedestination.

B. YourlaptopencapsulateseachIPpacketinanEthernetframeaddressedtothelocalrouter

Page 15: CSE 127 Week 8 Discussion · 2020-05-20 · 1. Your laptop uses DHCP (Dynamic Host Configuration Protocol) to bootstrap itself on the local network. A. New host doesn’t have an

WorkingexampleYouconnectyourlaptoptoacaféwifi networkandtypeucsd.edu intoyourbrowser’sURLbar.Whathappens?

2.YourlaptopmakesanARPrequesttolearntheMACaddressofthelocalrouter.

A. Everyconnectionoutsidethelocalnetworkwillbeencapsulatedinalink-layerframewiththelocalrouter’sMACaddressasthedestination.

B. YourlaptopencapsulateseachIPpacketinaWIFIEthernetframeaddressedtothelocalrouter

C. Thelocalrouterde-capsulates theseEthernetframesandre-encodesthemtoforwardthemonitsfiberconnectiontoitsupstreamISP,ortoanotherpartofthenetwork.

Page 16: CSE 127 Week 8 Discussion · 2020-05-20 · 1. Your laptop uses DHCP (Dynamic Host Configuration Protocol) to bootstrap itself on the local network. A. New host doesn’t have an

WorkingexampleYouconnectyourlaptoptoacaféwifi networkandtypeucsd.edu intoyourbrowser’sURLbar.Whathappens?

2.YourlaptopmakesanARPrequesttolearntheMACaddressofthelocalrouter.

A. Everyconnectionoutsidethelocalnetworkwillbeencapsulatedinalink-layerframewiththelocalrouter’sMACaddressasthedestination.

B. YourlaptopencapsulateseachIPpacketinaWIFIEthernetframeaddressedtothelocalrouter

C. Thelocalrouterde-capsulates theseEthernetframesandre-encodesthemtoforwardthemonitsfiberconnectiontoitsupstreamISP,ortoanotherpartofthenetwork.

D. Eachhopre-encodesthelinklayerforitsownnetwork.

Page 17: CSE 127 Week 8 Discussion · 2020-05-20 · 1. Your laptop uses DHCP (Dynamic Host Configuration Protocol) to bootstrap itself on the local network. A. New host doesn’t have an

WorkingexampleYouconnectyourlaptoptoacaféwifi networkandtypeucsd.edu intoyourbrowser’sURLbar.Whathappens?

3.YoulaptopdoesaDNSlookuponucsd.eduA. ItlearnedtheIPaddressofaDNSserverfromtherouterorwasalready

hardcodedin(8.8.8.8)

Page 18: CSE 127 Week 8 Discussion · 2020-05-20 · 1. Your laptop uses DHCP (Dynamic Host Configuration Protocol) to bootstrap itself on the local network. A. New host doesn’t have an

WorkingexampleYouconnectyourlaptoptoacaféwifi networkandtypeucsd.edu intoyourbrowser’sURLbar.Whathappens?

3.YoulaptopdoesaDNSlookuponucsd.eduA. ItlearnedtheIPaddressofaDNSserverfromtherouterorwasalready

hardcodedin(8.8.8.8)B. EachrequestisaDNSqueryencapsulatedinoneormoreUDPpackets

encapsulatedinoneormoreIPpackets

Page 19: CSE 127 Week 8 Discussion · 2020-05-20 · 1. Your laptop uses DHCP (Dynamic Host Configuration Protocol) to bootstrap itself on the local network. A. New host doesn’t have an

WorkingexampleYouconnectyourlaptoptoacaféwifi networkandtypeucsd.edu intoyourbrowser’sURLbar.Whathappens?

3.YoulaptopdoesaDNSlookuponucsd.eduA. ItlearnedtheIPaddressofaDNSserverfromtherouterorwasalready

hardcodedin(8.8.8.8)B. EachrequestisaDNSqueryencapsulatedinoneormoreUDPpackets

encapsulatedinoneormoreIPpacketsC. Eachresponsetellsthelaptopwhatauthoritynameserver toquery,untilit

learnsthefinalIPAddress(132.239.180.101)forucsd.edu

Page 20: CSE 127 Week 8 Discussion · 2020-05-20 · 1. Your laptop uses DHCP (Dynamic Host Configuration Protocol) to bootstrap itself on the local network. A. New host doesn’t have an

WorkingexampleYouconnectyourlaptoptoacaféwifi networkandtypeucsd.edu intoyourbrowser’sURLbar.Whathappens?

3.YoulaptopdoesaDNSlookuponucsd.eduA. ItlearnedtheIPaddressofaDNSserverfromtherouterorwasalready

hardcodedin(8.8.8.8)B. EachrequestisaDNSqueryencapsulatedinoneormoreUDPpackets

encapsulatedinoneormoreIPpacketsC. Eachresponsetellsthelaptopwhatauthoritynameserver toquery,untilit

learnsthefinalIPAddress(132.239.180.101)forucsd.eduD. Thisaddressiscached,alongwiththeauthoritiesforthehierarchyinthe

hostname

Page 21: CSE 127 Week 8 Discussion · 2020-05-20 · 1. Your laptop uses DHCP (Dynamic Host Configuration Protocol) to bootstrap itself on the local network. A. New host doesn’t have an

WorkingexampleYouconnectyourlaptoptoacaféwifi networkandtypeucsd.edu intoyourbrowser’sURLbar.Whathappens?

4.YoulaptopopensaTCPconnectionto132.239.180.101

Page 22: CSE 127 Week 8 Discussion · 2020-05-20 · 1. Your laptop uses DHCP (Dynamic Host Configuration Protocol) to bootstrap itself on the local network. A. New host doesn’t have an

WorkingexampleYouconnectyourlaptoptoacaféwifi networkandtypeucsd.edu intoyourbrowser’sURLbar.Whathappens?

4.YoulaptopopensaTCPconnectionto132.239.180.101A. EachpacketoftheTCPhandshakeisencodedinanIPpacketthatis

encodedasEthernetframesthataredecodedandre-encodedastheypassthroughthenetwork

Page 23: CSE 127 Week 8 Discussion · 2020-05-20 · 1. Your laptop uses DHCP (Dynamic Host Configuration Protocol) to bootstrap itself on the local network. A. New host doesn’t have an

WorkingexampleYouconnectyourlaptoptoacaféwifi networkandtypeucsd.edu intoyourbrowser’sURLbar.Whathappens?

4.YoulaptopopensaTCPconnectionto132.239.180.101A. EachpacketoftheTCPhandshakeisencodedinanIPpacketthatis

encodedasEthernetframesthataredecodedandre-encodedastheypassthroughthenetwork

B. ThelocalrouterhasaroutingtablethatcontainsIPprefixesthatitmatchesagainsttheIPaddressthattellsitwhataddresstoforwardthepacketsto

Page 24: CSE 127 Week 8 Discussion · 2020-05-20 · 1. Your laptop uses DHCP (Dynamic Host Configuration Protocol) to bootstrap itself on the local network. A. New host doesn’t have an

WorkingexampleYouconnectyourlaptoptoacaféwifi networkandtypeucsd.edu intoyourbrowser’sURLbar.Whathappens?

4.YoulaptopopensaTCPconnectionto132.239.180.101A. EachpacketoftheTCPhandshakeisencodedinanIPpacketthatis

encodedasEthernetframesthataredecodedandre-encodedastheypassthroughthenetwork

B. ThelocalrouterhasaroutingtablethatcontainsIPprefixesthatitmatchesagainsttheIPaddressthattellsitwhataddresstoforwardthepacketsto

C. ThepacketpassesthroughaseriesofAutonomousSystems(AS)

Page 25: CSE 127 Week 8 Discussion · 2020-05-20 · 1. Your laptop uses DHCP (Dynamic Host Configuration Protocol) to bootstrap itself on the local network. A. New host doesn’t have an

WorkingexampleYouconnectyourlaptoptoacaféwifi networkandtypeucsd.edu intoyourbrowser’sURLbar.Whathappens?

4.YoulaptopopensaTCPconnectionto132.239.180.101A. EachpacketoftheTCPhandshakeisencodedinanIPpacketthatis

encodedasEthernetframesthataredecodedandre-encodedastheypassthroughthenetwork

B. ThelocalrouterhasaroutingtablethatcontainsIPprefixesthatitmatchesagainsttheIPaddressthattellsitwhataddresstoforwardthepacketsto

C. ThepacketpassesthroughaseriesofAutonomousSystems(AS)D. E.g.sbcglobal.net ->att.net ->leve3.net->cenic.net ->ucsd.edu

Page 26: CSE 127 Week 8 Discussion · 2020-05-20 · 1. Your laptop uses DHCP (Dynamic Host Configuration Protocol) to bootstrap itself on the local network. A. New host doesn’t have an

WorkingexampleYouconnectyourlaptoptoacaféwifi networkandtypeucsd.edu intoyourbrowser’sURLbar.Whathappens?

5.YourlaptopsendsaHTTPGETrequestinsidetheTCPconnection6.BasedontheHTTPresponse,yourlaptopperformsanewDNSlookup,TCPhandshake,andHTTPGETforeveryresourceintheHTMLasitrenders

Page 27: CSE 127 Week 8 Discussion · 2020-05-20 · 1. Your laptop uses DHCP (Dynamic Host Configuration Protocol) to bootstrap itself on the local network. A. New host doesn’t have an

Networkattacksoverview

• DNSCachepoisoning

Page 28: CSE 127 Week 8 Discussion · 2020-05-20 · 1. Your laptop uses DHCP (Dynamic Host Configuration Protocol) to bootstrap itself on the local network. A. New host doesn’t have an

https://www.cloudflare.com/learning/dns/dns-over-tls/

Page 29: CSE 127 Week 8 Discussion · 2020-05-20 · 1. Your laptop uses DHCP (Dynamic Host Configuration Protocol) to bootstrap itself on the local network. A. New host doesn’t have an

https://www.cloudflare.com/learning/dns/dns-over-tls/

Page 30: CSE 127 Week 8 Discussion · 2020-05-20 · 1. Your laptop uses DHCP (Dynamic Host Configuration Protocol) to bootstrap itself on the local network. A. New host doesn’t have an

DNSoverTLSandDNSoverHTTPS

• DNSoverTLS– usesTLSoverUDPtoprotectDNSqueries• Port853

• DNSoverHTTPS– usesHTTPSprotocol/porttotransferDNSqueries• Port443

• Whytwodifferentsolutions?Aren’ttheythesame?• Twodifferentprotocols/groupsofpeoplewritingthem• ProsandConsofeach

Page 31: CSE 127 Week 8 Discussion · 2020-05-20 · 1. Your laptop uses DHCP (Dynamic Host Configuration Protocol) to bootstrap itself on the local network. A. New host doesn’t have an

https://blog.chromium.org/2020/05/a-safer-and-more-private-browsing-DoH.html

Page 32: CSE 127 Week 8 Discussion · 2020-05-20 · 1. Your laptop uses DHCP (Dynamic Host Configuration Protocol) to bootstrap itself on the local network. A. New host doesn’t have an

Networkattacksoverview

• DNSCachepoisoning• DenialofService• Resourceconsumptionofservice• TCPhandshakesareexpensive

• Networkperimeterdefenses• Heyyou!Getoffmyfirewall!

Page 33: CSE 127 Week 8 Discussion · 2020-05-20 · 1. Your laptop uses DHCP (Dynamic Host Configuration Protocol) to bootstrap itself on the local network. A. New host doesn’t have an

PA5Overview!

Page 34: CSE 127 Week 8 Discussion · 2020-05-20 · 1. Your laptop uses DHCP (Dynamic Host Configuration Protocol) to bootstrap itself on the local network. A. New host doesn’t have an

PA5overview

• PlannedtobereleasedThursdayorFriday,2weekstofinishit(harddeadlineofJune11th becauseweneedtoturningrades)• Scavengerhunt!YouneedtofindStefan’s“password”• Nothisactualpassword…

• We’llsendyouanemailwithatarfile• Fromthere,needtofigureouthowtogetthepassword• Scavengerhuntsopleasebecautiousofspoilers…cometoofficehoursorutilizeprivatepostsonPiazza

Page 35: CSE 127 Week 8 Discussion · 2020-05-20 · 1. Your laptop uses DHCP (Dynamic Host Configuration Protocol) to bootstrap itself on the local network. A. New host doesn’t have an

Overviewoftoolsyoumayneed

• nc• nmap• ssh• tcpdump• wget

Page 36: CSE 127 Week 8 Discussion · 2020-05-20 · 1. Your laptop uses DHCP (Dynamic Host Configuration Protocol) to bootstrap itself on the local network. A. New host doesn’t have an

Overviewoftoolsyoumayneed

• Nc – allowsyoutomakeconnectionslocally• Nmap – scanports/IPs(locallyandexternally)• Ssh – connecttoservers• Tcpdump – viewtrafficonmachine• Wget – downloadoffilesfrominternet

• Allofthesehave“man”pages!

Page 37: CSE 127 Week 8 Discussion · 2020-05-20 · 1. Your laptop uses DHCP (Dynamic Host Configuration Protocol) to bootstrap itself on the local network. A. New host doesn’t have an

NetCat (shoutout toJuliaEvans)

Page 38: CSE 127 Week 8 Discussion · 2020-05-20 · 1. Your laptop uses DHCP (Dynamic Host Configuration Protocol) to bootstrap itself on the local network. A. New host doesn’t have an

Happyhunting!