networking crash course - c4cs.github.io · digging deeper connected to (172.217.0.36) port 80 (#0)...
TRANSCRIPT
BeforeWeStartClient/ServerModelClientrequestsinformationfromserveroverpre-establishedprotocols.
TCP/IPModelApplicationLayer
TransportLayer
InternetLayer
LinkLayer
Client?
Server?
Protocol?
DiggingdeeperLet'suseatoolwe'veseenbefore:
curlhttp://www.google.com/
DiggingdeeperLet'suseatoolwe'veseenbefore:
curlhttp://www.google.com/
Connectedtowww.google.com(172.217.0.36)port80(#0)
www.google.com -whatwetypedin172.217.0.36 -???
DNSdigwww.google.com
DNSdigwww.google.com
dig+tracewww.google.com
Pattern:"Idon'tknowtheanswer,butIknowwhodoes"Recursive/distributedapproach
LimitsdataeachserverisrequiredtostoreNosinglesourceoftruthfortheentireInternet(redundancy)Easiertomanage
Caching
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)?
Routingtraceroutewww.google.com
Routingtraceroutewww.google.com
Routing(continued)Systemmaintainsroutingtable
route-ngetwww.google.com
Routing(continued)Systemmaintainsroutingtable
route-ngetwww.google.com
Whatisen0?
system_profiler
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)
PortsAnIPuniquelyidentifiesaninterface.
Whydoweneedports?
PortsAnIPuniquelyidentifiesaninterface.
Whydoweneedports?
TCPvsUDPTwopopularTransportLayerprotocols(butnottheonlyones!)
TCP:Moreguarantees(ordering,best-effortdeliveryattempt)
UDP:Lessoverhead(Fast)
PortsAnIPuniquelyidentifiesaninterface.
Whydoweneedports?
TCPvsUDPTwopopularTransportLayerprotocols(butnottheonlyones!)
TCP:Moreguarantees(ordering,best-effortdeliveryattempt)
UDP:Lessoverhead(Fast)
DifferentusecasesFartherdownthemodelwegothedumbertheprotocolsareNoteverythinghasthesamerequirements
GamingservicemightnotcareifsomedataislostWebsitesobviouslywould
PortsAnIPuniquelyidentifiesaninterface.
Whydoweneedports?
TCPvsUDPTwopopularTransportLayerprotocols(butnottheonlyones!)
TCP:Moreguarantees(ordering,best-effortdeliveryattempt)
UDP:Lessoverhead(Fast)
DifferentusecasesFartherdownthemodelwegothedumbertheprotocolsareNoteverythinghasthesamerequirements
GamingservicemightnotcareifsomedataislostWebsitesobviouslywould
Whataboutwhatwejustsaw?HTTP:TCPport80
DNS:UDPport53
Ports(continued)Q:Whatmakesaserveraserver?
Ports(continued)Q:Whatmakesaserveraserver?
Clientconnectstoalisteningserver.
Ports(continued)Q:Whatmakesaserveraserver?
Clientconnectstoalisteningserver.
SimpleexampleServer:
nc-l9999
Client:
nc127.0.0.19999
WhataboutHTTP?BacktoourcURLexampleRequest:
>GET/HTTP/1.1
>Host:www.google.com
>User-Agent:curl/7.49.1
>Accept:*/*
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
TryitOpenawebbrowserLet'sfindtheminimumsetofinformationinavalidHTTPrequest
TryitOpenawebbrowserLet'sfindtheminimumsetofinformationinavalidHTTPrequest
nc-l9999
Note:Notport 80 .Why?<C+d> tosignalendofinput
TryitOpenawebbrowserLet'sfindtheminimumsetofinformationinavalidHTTPrequest
nc-l9999
Note:Notport 80 .Why?<C+d> tosignalendofinput
Request:
>GET/HTTP/1.1
Response:
<HTTP/1.1200OK
WrapUpSomuchmore
SSL/TLSDHCPARPIPv6NATFirewallsetc.
Friday