47
COS 461: Computer Networks Spring 2010 (MW 3:00‐4:20pm in CS 105) Prof. Mike Freedman Teaching Assistants: Muneeb Ali and David Shue hNp://www.cs.princeton.edu/courses/archive/spr10/cos461/ 1

COS 461: Computer · PDF fileCOS 461: Computer Networks ... answer quesons (parcipaon!) ... Internet (3rd edion), by Kurose and Ross

Embed Size (px)

Citation preview

Page 1: COS 461: Computer  · PDF fileCOS 461: Computer Networks ... answer quesons (parcipaon!) ... Internet (3rd edion), by Kurose and Ross

COS461:ComputerNetworks

Spring2010(MW3:00‐4:20pminCS105)

Prof.MikeFreedman

TeachingAssistants:MuneebAliandDavidShuehNp://www.cs.princeton.edu/courses/archive/spr10/cos461/

1

Page 2: COS 461: Computer  · PDF fileCOS 461: Computer Networks ... answer quesons (parcipaon!) ... Internet (3rd edion), by Kurose and Ross

GoalsforToday’sClass

•  COS461overview–  Goalsofthecourse–  Structureofthecourse–  Learningthematerial–  Programmingassignments–  Coursegrading–  Academicpolicies

•  Keyconceptsindatanetworking–  Protocols–  Layering–  ResourceallocaVon–  Naming

2

Page 3: COS 461: Computer  · PDF fileCOS 461: Computer Networks ... answer quesons (parcipaon!) ... Internet (3rd edion), by Kurose and Ross

WhatYouLearninThisCourse

•  Skill:networkprogramming–  Socketprogramming–  DesigningandimplemenVngprotocols

•  Knowledge:howtheInternetworks–  IPprotocolsuite–  Internetarchitecture–  ApplicaVons(Web,DNS,P2P,…)

•  Insight:keyconceptsinnetworking–  Protocols–  Layering–  ResourceallocaVon–  Naming

3

Page 4: COS 461: Computer  · PDF fileCOS 461: Computer Networks ... answer quesons (parcipaon!) ... Internet (3rd edion), by Kurose and Ross

StructureoftheCourse(1stHalf)•  Startatthetop

–  Sockets:howapplicaVonsviewtheInternet–  Protocols:essenValelementsofaprotocol

•  Thenstudythe“narrowwaist”ofIP–  IPbest‐effortpacket‐deliveryservice–  IPaddressingandpacketforwarding

•  Andhowtobuildontopofthenarrowwaist–  Transportprotocols(TCP,UDP)–  DomainNameSystem(DNS)–  Glue(ARP,DHCP,ICMP)–  End‐systemsecurityandprivacy(NAT,firewalls)

•  LookingunderneathIP–  Linktechnologies(Ethernet)

4

Page 5: COS 461: Computer  · PDF fileCOS 461: Computer Networks ... answer quesons (parcipaon!) ... Internet (3rd edion), by Kurose and Ross

StructureoftheCourse(2ndHalf)•  Andhowtogetthetrafficfromheretothere

–  InternetrouVngarchitecture(the“inter”inInternet)–  IntradomainandinterdomainrouVngprotocols

•  Specialnetworkingtopics– MulVcast,Over/Underlaynetworking–  Datacenternetworks– Wirelessandmobility

•  BuildingapplicaVons– MulVcast,Over/Underlaynetworking–  HTTPandContentDistribuVonNetworks–  Peer‐to‐peer,DHTs,BitTorrent–  Distributedsystems:Consistencyandagreement–  NetworkandcommunicaVonsecurity 5

Page 6: COS 461: Computer  · PDF fileCOS 461: Computer Networks ... answer quesons (parcipaon!) ... Internet (3rd edion), by Kurose and Ross

LearningtheMaterial:People•  Lecture(Prof.MikeFreedman)

– When:MW3:00‐4:20inComputerScience105–  SlidesavailableonlineatcourseWebsite–  Officehours(room308)onMon,4:20‐5:00(orbyappt)–  Email:mfreed+cos461atcs.princeton.edu

•  TeachingAssistants– MuneebAli

•  E‐mail:muneeb+cos461atcs.princeton.edu–  DavidShue

•  E‐mail:dshue+cos461atcs.princeton.edu

•  Mainemail:cos461‐staffatlists.cs.princeton.edu

6

Page 7: COS 461: Computer  · PDF fileCOS 461: Computer Networks ... answer quesons (parcipaon!) ... Internet (3rd edion), by Kurose and Ross

LearningtheMaterial:MailingList•  Mailinglist

–  Ifyou’reenrolled,youshouldbeonit– E‐mail:cos461atlists.cs.princeton.edu– Signup:hNps://lists.cs.princeton.edu/mailman/lisVnfo/cos461

•  Readofen– GoodplacetoaskquesVons– Butdonotpostyourcode

•  Reply,too– GoodplacetoanswerquesVons(parVcipaVon!)

7

Page 8: COS 461: Computer  · PDF fileCOS 461: Computer Networks ... answer quesons (parcipaon!) ... Internet (3rd edion), by Kurose and Ross

LearningtheMaterial:Books•  Requiredtextbook

–  ComputerNetworks:ASystemsApproach(4thedi:on),byPetersonandDavie[Okaytousethe3rdediVon]

– Mostlycoversthematerialinthefirsthalfoftheclass•  Booksonreserve

– Networkingtextbooks•  ComputerNetworking:ATop‐DownApproachFeaturingtheInternet(3rdedi:on),byKuroseandRoss

•  ComputerNetworks(4thedi:on),byTanenbaum– Networkprogrammingreferences

•  TCP/IPIllustrated,Volume1:TheProtocols,byStevens•  UnixNetworkProgramming,Volume1:TheSocketsNetworkingAPI(3rdEdi:on),byStevens,Fenner,&Rudolf

•  Onlineresources–  E.g.onsocketprogramming

8

Page 9: COS 461: Computer  · PDF fileCOS 461: Computer Networks ... answer quesons (parcipaon!) ... Internet (3rd edion), by Kurose and Ross

GradingandSchedule•  Assignments(10%each)

–  95%3hours,70%2dayslate,50%>3dayslate– Onefreelatedayduringsemester– Mustcompleteallassignmentstopass

•  Twoexams(45%total)– Midtermexambeforespringbreak(20%)–  Finalexamduringexamperiod(25%)

•  ClassparVcipaVon(5%)–  Inlecture– Onthelistserv– Willgrade0‐5

9

Page 10: COS 461: Computer  · PDF fileCOS 461: Computer Networks ... answer quesons (parcipaon!) ... Internet (3rd edion), by Kurose and Ross

ProgrammingAssignments•  Fiveassignments

–  IntroducVontosockets(SunFeb14)–  SimpleHTTPproxy–  AdvancedHTTPproxy–  Reliabletransport–  IProuter(SunApr12)‐‐nolateaccepted

10

Page 11: COS 461: Computer  · PDF fileCOS 461: Computer Networks ... answer quesons (parcipaon!) ... Internet (3rd edion), by Kurose and Ross

FaciliVesforProgramming•  ComputerclusterinFriendCenter010

–  FriendCenter010computers– Machines:labpc‐XX.cs.princeton.eduforXXof01to30– Why:commonenvironment,andaccesstolabTAs

•  Accessingyouraccount–  Ifyouareenrolled,youhavealabpcaccount–  UsingyourOITloginandpassword

•  Loggingintothemachinesremotely–  SSHtoportal.cs.princeton.edu,andthentoFC010–  NeedaCSaccount,ifyoudon’thaveonealready–  hNps://csguide.cs.princeton.edu/requests/account–  Requesta“classaccount”

11

Page 12: COS 461: Computer  · PDF fileCOS 461: Computer Networks ... answer quesons (parcipaon!) ... Internet (3rd edion), by Kurose and Ross

FaciliVesforProgramming•  OtheropVon:yourownPC(notrecommended)

–  RunningGNUtoolsonLinux,or–  RunningGNUtoolsonWindows,or

–  RunningastandardCdevelopmentenvironment– DevelopmentenvironmentnotsupportedbyTAs

•  SuggesVon:testaccessthisweek–  LoggingintotheFC010cluster– WriVngandrunning“HelloWorld”inC

•  Submirngassignments– UsingBlackboard– Moredetailscomingsoon! 12

Page 13: COS 461: Computer  · PDF fileCOS 461: Computer Networks ... answer quesons (parcipaon!) ... Internet (3rd edion), by Kurose and Ross

GraduateStudents:TwoChoices•  PickoneoftwoopVons

– Dothefiveprogrammingassignments

– Or,firsttwoassignments,plusresearchproject

•  Researchprojects– Networking‐relatedresearchproblem

– Musthaveasystemsprogrammingcomponent– Write‐upofprojectdueonDean’sDate– Talktomeaboutaprojectbeforespringbreak

13

Page 14: COS 461: Computer  · PDF fileCOS 461: Computer Networks ... answer quesons (parcipaon!) ... Internet (3rd edion), by Kurose and Ross

Policies:WriteYourOwnCodeProgramminginanindividualcreaVveprocessmuchlike

composiVon.YoumustreachyourownunderstandingoftheproblemanddiscoverapathtoitssoluVon.DuringthisVme,discussionswithfriendsareencouraged.However,whentheVmecomestowritecodethatsolvestheproblem,suchdiscussionsarenolongerappropriate‐theprogrammustbeyourownwork.

IfyouhaveaquesVonabouthowtousesomefeatureofC,UNIX,etc.,youcancertainlyaskyourfriendsortheTA,butdonot,underanycircumstances,copyanotherperson'sprogram.Lerngsomeonecopyyourprogramorusingsomeoneelse'scodeinanyformisaviola7onofacademicregula7ons."Usingsomeoneelse'scode"includesusingsoluVonsorparValsoluVonstoassignmentsprovidedbycommercialwebsites,instructors,preceptors,teachingassistants,friends,orstudentsfromanypreviousofferingofthiscourseoranyothercourse. 14

Page 15: COS 461: Computer  · PDF fileCOS 461: Computer Networks ... answer quesons (parcipaon!) ... Internet (3rd edion), by Kurose and Ross

Okay,solet’sgetstarted…withacrashcourseindatanetworking

15

Page 16: COS 461: Computer  · PDF fileCOS 461: Computer Networks ... answer quesons (parcipaon!) ... Internet (3rd edion), by Kurose and Ross

KeyConceptsinNetworking•  Protocols

–  Speakingthesamelanguage–  SyntaxandsemanVcs

•  Layering–  Standingontheshouldersofgiants– Akeytomanagingcomplexity

•  ResourceallocaVon– DividingscareresourcesamongcompeVngparVes– Memory,linkbandwidth,wirelessspectrum,paths,…

– Distributedvs.centralizedalgorithms•  Naming

– Whattocallcomputers,services,protocols,…•  Architecturalprinciples:End‐to‐end,etc.

16

Page 17: COS 461: Computer  · PDF fileCOS 461: Computer Networks ... answer quesons (parcipaon!) ... Internet (3rd edion), by Kurose and Ross

Protocols:CalendarService•  Makinganappointmentwithyouradvisor

•  Specifyingthemessagesthatgobackandforth– Andanunderstandingofwhateachpartyisdoing

17

Please meet with me for 1.5 hours starting at

1:30pm on February 8, 200?

I can’t. I can’t. Yes!

Please meet with me for 1.5 hours starting at

3:00pm on February 8, 2009?

Please meet with me for 1.5 hours starting at

4:30pm on February 8, 2009?

Page 18: COS 461: Computer  · PDF fileCOS 461: Computer Networks ... answer quesons (parcipaon!) ... Internet (3rd edion), by Kurose and Ross

Okay,SoThisisGerngTedious•  You:Whenareyoufreetomeetfor1.5hoursduringthenexttwoweeks?

•  Advisor:10:30amonFeb8and1:15pmonFeb9.

•  You:Bookmefor1.5hoursat10:30amonFeb8.•  Advisor:Yes.

18

Page 19: COS 461: Computer  · PDF fileCOS 461: Computer Networks ... answer quesons (parcipaon!) ... Internet (3rd edion), by Kurose and Ross

Well,NotQuiteEnough•  Student#1:Whencanyoumeetfor1.5hoursduringthe

nexttwoweeks?•  Advisor:10:30amonFeb8and1:15pmonFeb9.•  Student#2:Whencanyoumeetfor1.5hoursduringthe

nexttwoweeks?•  Advisor:10:30amonFeb8and1:15pmonFeb9.•  Student#1:Bookmefor1.5hoursat10:30amonFeb8.•  Advisor:Yes.•  Student#2:Bookmefor1.5hoursat10:30amonFeb8.•  Advisor:Uh…well…Icannolongercanmeetthen.I’mfree

at1:15pmonFeb9.•  Bookmefor1.5hoursat1:15pmonFeb9.•  Advisor:Yes.•  Advisor:Wait…amItalkingtoStudent1or2?

19

Page 20: COS 461: Computer  · PDF fileCOS 461: Computer Networks ... answer quesons (parcipaon!) ... Internet (3rd edion), by Kurose and Ross

SpecifyingtheDetails•  HowtoidenVfyyourself?

–  Name?Socialsecuritynumber?

•  HowtorepresentdatesandVme?–  Time,day,month,year?InwhatVmezone?–  NumberofsecondssinceJan1,1970?

•  WhatgranulariVesofVmestouse?–  AnypossiblestartVmeandmeeVngduraVon?– MulVplesoffiveminutes?

•  Howtorepresentthemessages?–  Strings?Recordwithname,startVme,andduraVon?

•  Whatdoyoudoifyoudon’tgetaresponse?–  Askagain?Replyagain?

20

Page 21: COS 461: Computer  · PDF fileCOS 461: Computer Networks ... answer quesons (parcipaon!) ... Internet (3rd edion), by Kurose and Ross

Example:HyperTextTransferProtocol

21

GET /courses/archive/spr09/cos461/ HTTP/1.1 Host: www.cs.princeton.edu User-Agent: Mozilla/4.03 CRLF

HTTP/1.1 200 OK Date: Mon, 2 Feb 2009 13:09:03 GMT Server: Netscape-Enterprise/3.5.1 Last-Modified: Mon, 42 Feb 2009 11:12:23 GMT Content-Length: 21 CRLF Site under construction

Request

Response

Page 22: COS 461: Computer  · PDF fileCOS 461: Computer Networks ... answer quesons (parcipaon!) ... Internet (3rd edion), by Kurose and Ross

Example:IPPacket

22

4-bit Version

4-bit Header Length

8-bit Type of Service (TOS) 16-bit Total Length (Bytes)

16-bit Identification 3-bit Flags 13-bit Fragment Offset

8-bit Time to Live (TTL)

8-bit Protocol 16-bit Header Checksum

32-bit Source IP Address

32-bit Destination IP Address

Options (if any)

Payload

Page 23: COS 461: Computer  · PDF fileCOS 461: Computer Networks ... answer quesons (parcipaon!) ... Internet (3rd edion), by Kurose and Ross

IP:Best‐EffortPacketDelivery

23

•  Packetswitching– Senddatainpackets– Headerwithsource&desVnaVonaddress

•  Best‐effortdelivery– Packetsmaybelost– Packetsmaybecorrupted– Packetsmaybedeliveredoutoforder

source destination

IP network

Page 24: COS 461: Computer  · PDF fileCOS 461: Computer Networks ... answer quesons (parcipaon!) ... Internet (3rd edion), by Kurose and Ross

Example:TransmissionControlProtocol

•  CommunicaVonservice(socket)–  Ordered,reliablebytestream–  SimultaneoustransmissioninbothdirecVons

•  Keymechanismsatendhosts–  Retransmitlostandcorruptedpackets–  Discardduplicatepacketsandputpacketsinorder–  Flowcontroltoavoidoverloadingthereceiverbuffer–  CongesVoncontroltoadaptsendingratetonetworkload

24 source network destination

TCP connection

Page 25: COS 461: Computer  · PDF fileCOS 461: Computer Networks ... answer quesons (parcipaon!) ... Internet (3rd edion), by Kurose and Ross

ProtocolStandardizaVon•  CommunicaVnghostsspeakingthesameprotocol

–  StandardizaVontoenablemulVpleimplementaVons–  Or,thesamefolkshavetowriteallthesofware

•  StandardizaVon:InternetEngineeringTaskForce–  Basedonworkinggroupsthatfocusonspecificissues–  Produces“RequestForComments”(RFCs)

•  Promotedtostandardsviaroughconsensusandrunningcode•  E.g.,RFC1945on“HyperTextTransferProtocol–HTTP/1.0”

–  IETFWebsiteishNp://www.ie|.org

•  Defactostandards:samefolkswriVngthecode–  P2Pfilesharing,BitTorrent,Skype,Flashvideos(RTMP)–  <yourprotocolhere>… 25

Page 26: COS 461: Computer  · PDF fileCOS 461: Computer Networks ... answer quesons (parcipaon!) ... Internet (3rd edion), by Kurose and Ross

KeyConceptsinNetworking•  Protocols

–  Speakingthesamelanguage–  SyntaxandsemanVcs

•  Layering–  Standingontheshouldersofgiants– Akeytomanagingcomplexity

26

Page 27: COS 461: Computer  · PDF fileCOS 461: Computer Networks ... answer quesons (parcipaon!) ... Internet (3rd edion), by Kurose and Ross

Layering:AModularApproach•  Sub‐dividetheproblem

– Eachlayerreliesonservicesfromlayerbelow– Eachlayerexportsservicestolayerabove

•  InterfacebetweenlayersdefinesinteracVon– HidesimplementaVondetails– Layerscanchangewithoutdisturbingotherlayers

27 Link hardware

Host-to-host connectivity

Application-to-application channels

Application

Page 28: COS 461: Computer  · PDF fileCOS 461: Computer Networks ... answer quesons (parcipaon!) ... Internet (3rd edion), by Kurose and Ross

IPSuite:EndHostsvs.Routers

28

HTTP

TCP

IP

Ethernet interface

HTTP

TCP

IP

Ethernet interface

IP IP

Ethernet interface

Ethernet interface

SONET interface

SONET interface

host host

router router

HTTP message

TCP segment

IP packet IP packet IP packet

Page 29: COS 461: Computer  · PDF fileCOS 461: Computer Networks ... answer quesons (parcipaon!) ... Internet (3rd edion), by Kurose and Ross

TheInternetProtocolSuite

29

UDP TCP

Data Link

Physical

Applications

The Hourglass Model

Waist

The waist facilitates interoperability

FTP HTTP TFTP NV

TCP UDP

IP

NET1 NET2 NETn …

Page 30: COS 461: Computer  · PDF fileCOS 461: Computer Networks ... answer quesons (parcipaon!) ... Internet (3rd edion), by Kurose and Ross

LayerEncapsulaVon

30

Get index.html

Connection ID

Source/Destination

Link Address

User A User B

Page 31: COS 461: Computer  · PDF fileCOS 461: Computer Networks ... answer quesons (parcipaon!) ... Internet (3rd edion), by Kurose and Ross

WhatiftheDataDoesn’tFit?

31

Problem: Packet size

Solution: Split the data across multiple packets

•  On Ethernet, max IP packet is 1500 bytes

•  Typical Web page is 10 kbytes

GET inde x.ht ml

GET index.html

Page 32: COS 461: Computer  · PDF fileCOS 461: Computer Networks ... answer quesons (parcipaon!) ... Internet (3rd edion), by Kurose and Ross

ProtocolDemulVplexing•  MulVplechoicesateachlayer

32

FTP HTTP TFTP NV

TCP UDP

IP

NET1 NET2 NETn …

TCP/UDP IP

Port Number

Network

Protocol Field

Type Field

Page 33: COS 461: Computer  · PDF fileCOS 461: Computer Networks ... answer quesons (parcipaon!) ... Internet (3rd edion), by Kurose and Ross

DemulVplexing:PortNumbers•  DifferenVatebetweenmulVpletransfers

–  KnowingsourceanddesVnaVonhostisnotenough–  Needanidforeachtransferbetweenthehosts

•  Usewell‐knownportstodiscoveraparVcularservice–  E.g.,HTTPserverrunningonport80–  E.g.,FTPserverrunningonport21–  ButhowdifferenVateifserveralwaysport80?

33

HTTP transfers

FTP transfer

Page 34: COS 461: Computer  · PDF fileCOS 461: Computer Networks ... answer quesons (parcipaon!) ... Internet (3rd edion), by Kurose and Ross

IsLayeringHarmful?•  LayerNmayduplicatelowerlevelfuncVonality

–  E.g.,errorrecoverytoretransmitlostdata

•  LayersmayneedsameinformaVon–  E.g.,Vmestamps,maximumtransmissionunitsize

•  Strictadherencetolayeringmayhurtperformance–  E.g.,hidingdetailsaboutwhatisreallygoingon

•  Somelayersarenotalwayscleanlyseparated–  Inter‐layerdependenciesforperformancereasons–  Somedependenciesinstandards(headerchecksums)

•  Headersstarttogetreallybig–  SomeVmesmoreheaderbytesthanactualcontent

34

Page 35: COS 461: Computer  · PDF fileCOS 461: Computer Networks ... answer quesons (parcipaon!) ... Internet (3rd edion), by Kurose and Ross

KeyConceptsinNetworking•  Protocols

–  Speakingthesamelanguage–  SyntaxandsemanVcs

•  Layering–  Standingontheshouldersofgiants– Akeytomanagingcomplexity

•  ResourceallocaVon– DividingscareresourcesamongcompeVngparVes– Memory,linkbandwidth,wirelessspectrum,paths,…

– Distributedvs.centralizedalgorithms

35

Page 36: COS 461: Computer  · PDF fileCOS 461: Computer Networks ... answer quesons (parcipaon!) ... Internet (3rd edion), by Kurose and Ross

ResourceAllocaVon:Queues

•  Sharingaccesstolimitedresources–  E.g.,alinkwithfixedservicerate

•  Simplestcase:first‐in‐firstoutqueue–  Servepacketsintheordertheyarrive– Whenbusy,storearrivingpacketsinabuffer– Droppacketswhenthequeueisfull

•  Anybodyhearof“NetworkNeutrality”?36

Page 37: COS 461: Computer  · PDF fileCOS 461: Computer Networks ... answer quesons (parcipaon!) ... Internet (3rd edion), by Kurose and Ross

WhatiftheDatagetsDropped?

37

Internet GET index.html

Problem: Lost Data

Internet GET index.html

Solution: Timeout and Retransmit

GET index.html GET index.html

Page 38: COS 461: Computer  · PDF fileCOS 461: Computer Networks ... answer quesons (parcipaon!) ... Internet (3rd edion), by Kurose and Ross

WhatiftheDataisOutofOrder?

38

Solution: Add Sequence Numbers

Problem: Out of Order

GET x.ht inde ml

GET x.htindeml

GET index.html

ml 4 inde 2 x.ht 3 GET 1

Page 39: COS 461: Computer  · PDF fileCOS 461: Computer Networks ... answer quesons (parcipaon!) ... Internet (3rd edion), by Kurose and Ross

ResourceAllocaVon:CongesVonControl

•  Whatiftoomanyfolksaresendingdata?– Sendersagreetoslowdowntheirsendingrates– …inresponsetotheirpacketsgerngdropped

•  TheessenceofTCPcongesVoncontrol– KeytoprevenVngcongesVoncollapseoftheInternet

39

Page 40: COS 461: Computer  · PDF fileCOS 461: Computer Networks ... answer quesons (parcipaon!) ... Internet (3rd edion), by Kurose and Ross

TransmissionControlProtocol•  Flowcontrol:window‐based

–  Senderlimitsnumberofoutstandingbytes(windowsize)–  Receiverwindowensuresdatadoesnotoverflowreceiver

•  CongesVoncontrol:adapVngtopacketlosses–  Conges:onwindowtriestoavoidoverloadingthenetwork(increasewithsuccessfuldelivery,decreasewithloss)

–  TCPconnecVonstartswithsmalliniValcongesVonwindow

time cong

esti

on w

indo

w

slow start congestion avoidance

Page 41: COS 461: Computer  · PDF fileCOS 461: Computer Networks ... answer quesons (parcipaon!) ... Internet (3rd edion), by Kurose and Ross

KeyConceptsinNetworking•  Protocols

–  Speakingthesamelanguage–  SyntaxandsemanVcs

•  Layering–  Standingontheshouldersofgiants– Akeytomanagingcomplexity

•  ResourceallocaVon– DividingscareresourcesamongcompeVngparVes– Memory,linkbandwidth,wirelessspectrum,paths,…

– Distributedvs.centralizedalgorithms•  Naming

– Whattocallcomputers,services,protocols,…

41

Page 42: COS 461: Computer  · PDF fileCOS 461: Computer Networks ... answer quesons (parcipaon!) ... Internet (3rd edion), by Kurose and Ross

Naming:DomainNameSystem(DNS)

•  ProperVesofDNS– Hierarchicalnamespacedividedintozones–  TranslaVonofnamesto/fromIPaddresses– DistributedoveracollecVonofDNSservers

•  ClientapplicaVon–  Extractservername(e.g.,fromtheURL)–  InvokesystemcalltotriggerDNSresolvercode

•  E.g.,gethostbyname()onwww.cs.princeton.edu

•  ServerapplicaVon–  ExtractclientIPaddressfromsocket– OpVonallyinvokesystemcalltotranslateintoname

•  E.g.,gethostbyaddr()on“12.34.158.5”42

Page 43: COS 461: Computer  · PDF fileCOS 461: Computer Networks ... answer quesons (parcipaon!) ... Internet (3rd edion), by Kurose and Ross

DomainNameSystem

com edu org ac uk zw arpa

unnamed root

bar

west east

foo my

ac

cam

usr

in- addr

12

34

56

generic domains country domains

my.east.bar.edu usr.cam.ac.uk

12.34.56.0/24

Page 44: COS 461: Computer  · PDF fileCOS 461: Computer Networks ... answer quesons (parcipaon!) ... Internet (3rd edion), by Kurose and Ross

DNSResolverandLocalDNSServer

Application

DNS resolver

Local DNS server

1 10

DNS cache

DNS query 2

DNS response 9

Root server

3

4

Top-level domain server

5

6

Second-level domain server

7

8

•  CachingbasedonVme‐to‐live(TTL)specifiedbyauthorita:veDNSserver,i.e.,oneresponsiblefordomainname–  ReduceslatencyinDNStranslaVon–  ReducesloadonauthoritaVveDNSservers

Page 45: COS 461: Computer  · PDF fileCOS 461: Computer Networks ... answer quesons (parcipaon!) ... Internet (3rd edion), by Kurose and Ross

KeyConceptsinNetworking•  Protocols

–  Speakingthesamelanguage–  SyntaxandsemanVcs

•  Layering–  Standingontheshouldersofgiants– Akeytomanagingcomplexity

•  ResourceallocaVon– DividingscareresourcesamongcompeVngparVes– Memory,linkbandwidth,wirelessspectrum,paths,…

– Distributedvs.centralizedalgorithms•  Naming

– Whattocallcomputers,services,protocols,…•  Architecturalprinciples:End‐to‐end,etc.

45

Page 46: COS 461: Computer  · PDF fileCOS 461: Computer Networks ... answer quesons (parcipaon!) ... Internet (3rd edion), by Kurose and Ross

TOCS,1981

46

•  Reliability(TCPvs.IP•  Security(SSLvs.IPSec)•  …

Page 47: COS 461: Computer  · PDF fileCOS 461: Computer Networks ... answer quesons (parcipaon!) ... Internet (3rd edion), by Kurose and Ross

Conclusions•  CourseobjecVves

– Networkprogramming,howtheInternetworks,andkeyconceptsinnetworking

•  Keyconceptsinnetworking– Protocols,layers,resourceallocaVon,andnaming

•  Nextlecture:networkprogramming– SocketabstracVon(importantforassignment#1)– ReadChapter1ofthePeterson/Daviebook– Skimtheonlinereferencematerialonsockets

–  (Re)familiarizeyourselfwithCprogramming47