networking udp dns
play

Networking: UDP & DNS 2 User Datagram Protocol - PowerPoint PPT Presentation

Computer Systems and Networks ECPE 170 Jeff Shafer University of the Pacific Networking: UDP & DNS 2 User Datagram Protocol


  1. ì ¡ Computer ¡Systems ¡and ¡Networks ¡ ECPE ¡170 ¡– ¡Jeff ¡Shafer ¡– ¡University ¡of ¡the ¡Pacific ¡ Networking: ¡ UDP ¡& ¡DNS ¡

  2. 2 ¡ ì ¡ User ¡Datagram ¡Protocol ¡(UDP) ¡ Computer ¡Systems ¡and ¡Networks ¡ Fall ¡2016 ¡

  3. 3 ¡ UDP ¡versus ¡TCP ¡ TCP ¡ UDP ¡ Reliable? ¡ Yes ¡ No ¡ (Via ¡acknowledgements ¡and ¡ retransmi3ng) ¡ ConnecDon-­‑ Yes ¡ No ¡ oriented? ¡ (Server ¡has ¡one ¡socket ¡per ¡ (Server ¡has ¡one ¡socket ¡and ¡all ¡ client) ¡ messages ¡from ¡all ¡clients ¡are ¡ received ¡on ¡it) ¡ Programming ¡ Stream ¡ Datagram ¡ model? ¡ (con:nuous ¡flow ¡of ¡data ¡– ¡ (data ¡is ¡sent ¡in ¡its ¡en:rety ¡or ¡not ¡at ¡ may ¡get ¡a ¡li?le ¡bit ¡at ¡a ¡:me) ¡ all. ¡Size ¡of ¡each ¡datagram ¡is ¡small) ¡ ApplicaDons ¡ HTTP ¡(Lab ¡8) ¡ DNS ¡(Lab ¡9) ¡ Web, ¡email, ¡file ¡transfer ¡ Streaming ¡Audio/Video, ¡Gaming ¡ Computer ¡Systems ¡and ¡Networks ¡ Fall ¡2016 ¡

  4. 4 ¡ User ¡Datagram ¡Protocol ¡(UDP) ¡ ì UDP: ¡no ¡“connecCon” ¡ between ¡client ¡and ¡server ¡ applicaCon ¡viewpoint ¡ No ¡handshaking ¡ ì UDP ¡provides ¡unreliable ¡transfer ¡ Sender ¡explicitly ¡ ¡ ì ¡of ¡groups ¡of ¡bytes ¡(“datagrams”) ¡ aJaches ¡IP ¡address ¡ ¡between ¡client ¡and ¡server and ¡port ¡of ¡desCnaCon ¡ ¡ ¡ to ¡each ¡message ¡ Receiver ¡can ¡extract ¡IP ¡ ì address, ¡port ¡of ¡sender ¡ from ¡received ¡datagram ¡ Computer ¡Systems ¡and ¡Networks ¡ Fall ¡2016 ¡

  5. 5 ¡ User ¡Datagram ¡Protocol ¡(UDP) ¡ ì Each ¡UDP ¡message ¡is ¡self-­‑contained ¡and ¡complete ¡ ì Each ¡Cme ¡you ¡read ¡from ¡a ¡UDP ¡socket, ¡you ¡get ¡a ¡ complete ¡message ¡as ¡sent ¡by ¡the ¡sender ¡ ¡ ì That ¡is, ¡assuming ¡it ¡wasn’t ¡lost ¡in ¡transit! ¡ ì Think ¡of ¡UDP ¡sockets ¡as ¡puRng ¡a ¡stamp ¡on ¡a ¡leJer ¡ and ¡sCcking ¡it ¡in ¡the ¡mail ¡ ì No ¡need ¡to ¡establish ¡a ¡connec:on ¡first ¡ ì Receiver ¡has ¡no ¡idea ¡“le?er” ¡is ¡arriving ¡un:l ¡they ¡ look ¡in ¡the ¡mailbox ¡ Computer ¡Systems ¡and ¡Networks ¡ Fall ¡2016 ¡

  6. 6 ¡ Python ¡UDP ¡Programming ¡ ì Two ¡new ¡funcCons: ¡ sendto() ¡and ¡ recvfrom() server_ip = 1.2.3.4 port = 5678 dest_addr = (server_ip, port) s = socket.socket(socket.AF_INET, socket. SOCK_DGRAM ) ... ... bytes_sent = s. sendto (raw_bytes, dest_addr) ... ... max_bytes = 4096 (raw_bytes, src_addr) = s. recvfrom (max_bytes) Computer ¡Systems ¡and ¡Networks ¡ Fall ¡2016 ¡

  7. 7 ¡ ì ¡ Domain ¡Name ¡System ¡(DNS) ¡ Computer ¡Systems ¡and ¡Networks ¡ Fall ¡2016 ¡

  8. 8 ¡ IP ¡Addresses ¡ ì IP ¡version ¡4 ¡addresses ¡are ¡32 ¡bits ¡long ¡ ì IP ¡version ¡6 ¡address ¡are ¡128 ¡bits ¡long ¡ ì Every ¡network ¡interface ¡has ¡at ¡least ¡one ¡IP ¡address ¡ ì A ¡computer ¡might ¡have ¡2 ¡or ¡more ¡IP ¡addresses ¡ ì IPv4 ¡addresses ¡are ¡usually ¡displayed ¡in ¡doJed ¡ decimal ¡notaCon ¡ ì Each ¡byte ¡represented ¡by ¡decimal ¡value ¡ ì Bytes ¡are ¡separated ¡by ¡a ¡period ¡ ì IP ¡address ¡ 0x 8002C2F2 = 128 . 2 . 194 . 242 Computer ¡Systems ¡and ¡Networks ¡ Fall ¡2016 ¡

  9. 9 ¡ Motivation ¡ ì IP ¡addresses ¡are ¡hard ¡to ¡remember ¡ ì 198.16.253.143 ? ¡Or ¡was ¡it ¡ .146 ? ¡ ì Human-­‑friendly ¡names ¡are ¡much ¡beJer ¡ ì engineering.pacific.edu ì How ¡can ¡we ¡translate ¡between ¡the ¡two? ¡ Computer ¡Systems ¡and ¡Networks ¡ Fall ¡2016 ¡

  10. 10 ¡ Early ¡Days ¡(prior ¡to ¡1983) ¡ ì Each ¡computer ¡on ¡the ¡ARPAnet ¡(early ¡Internet) ¡had ¡a ¡single ¡file ¡ hosts.txt ¡maps ¡all ¡known ¡host ¡names ¡to ¡IP ¡address ì ì Master ¡list ¡maintained ¡ ¡by ¡SRI ¡Network ¡ ¡ InformaCon ¡Center ¡ Email ¡them ¡if ¡your ¡ ¡ ì mapping ¡changes ¡ New ¡list ¡produced ¡1-­‑2 ¡ ¡ ì Cmes ¡a ¡week ¡ All ¡hosts ¡download ¡the ¡ ì new ¡list ¡ ì Problems ¡with ¡this ¡approach? ¡ Computer ¡Systems ¡and ¡Networks ¡ Fall ¡2016 ¡

  11. 11 ¡ Domain ¡Name ¡System ¡(DNS) ¡ ì Distributed ¡database ¡ implemented ¡in ¡hierarchy ¡of ¡ many ¡ name ¡servers ¡ ì ApplicaDon-­‑layer ¡protocol ¡ ì Hosts, ¡routers, ¡and ¡name ¡servers ¡communicate ¡to ¡ resolve ¡names ¡(address/name ¡translaCon) ¡ ì Core ¡Internet ¡funcCon ¡implemented ¡as ¡applicaCon-­‑ layer ¡protocol ¡ Computer ¡Systems ¡and ¡Networks ¡ Fall ¡2016 ¡

  12. 12 ¡ DNS ¡is ¡Decentralized ¡ ì No ¡single ¡point ¡of ¡failure ¡ ì No ¡distant ¡centralized ¡database ¡ ì Easier ¡maintenance ¡ ì Take ¡one ¡or ¡a ¡dozen ¡servers ¡offline ¡without ¡issue ¡ ì Support ¡high ¡traffic ¡volume ¡ ì *** ¡Scalability ¡*** ¡

  13. 13 ¡ How ¡many ¡DNS ¡ requests/second ¡ globally? ¡

  14. 14 ¡ DNS: ¡Scalability ¡ Challenging ¡to ¡find ¡data ¡on ¡global ¡DNS ¡requests/sec ¡ ì No ¡global ¡internet ¡“dashboard” ¡ ì Internet ¡is ¡a ¡“network ¡of ¡networks” ¡ ì Would ¡have ¡to ¡inquire ¡with ¡AT&T, ¡Comcast, ¡TimeWarner, ¡Pacific, ¡etc ¡ ì They ¡would ¡have ¡to ¡check ¡stats ¡on ¡all ¡of ¡their ¡local ¡servers ¡ ì Google ¡Public ¡DNS ¡ ì 400 ¡billion ¡requests/day ¡as ¡of ¡Dec ¡2014 ¡ ì 70% ¡internaConal ¡ ì hJp://googlewebmastercentral.blogspot.com/2014/12/google-­‑public-­‑dns-­‑and-­‑locaCon.html ¡ ¡ ì ¡ OpenDNS ¡ ì 80 ¡billion ¡requests/day ¡as ¡of ¡Sept ¡2015 ¡ ì hJp://system.opendns.com/ ¡ ¡ ì

  15. 15 ¡ What’s ¡in ¡a ¡Name? ¡ ì engineering.pacific.edu ì .edu ¡is ¡top-­‑level ¡domain ¡ ì “pacific” ¡belongs ¡to ¡.edu ¡ ì “engineering” ¡belongs ¡to ¡“pacific” ¡ ì Hierarchical! ¡ ¡Read ¡from ¡right ¡to ¡lej ¡ Computer ¡Systems ¡and ¡Networks ¡ Fall ¡2016 ¡

  16. 16 ¡ Distributed, ¡Hierarchical ¡Database ¡ Root DNS Servers org DNS servers edu DNS servers com DNS servers poly.edu umass.edu pbs.org yahoo.com amazon.com DNS servers DNS servers DNS servers DNS servers DNS servers ì Client ¡wants ¡IP ¡for ¡www.amazon.com ¡ Client ¡queries ¡a ¡root ¡server ¡to ¡find ¡com ¡DNS ¡server ¡ 1. Client ¡queries ¡com ¡DNS ¡server ¡to ¡get ¡amazon.com ¡DNS ¡ 2. server ¡ Client ¡queries ¡amazon.com ¡DNS ¡server ¡to ¡get ¡ ¡IP ¡address ¡ 3. for ¡www.amazon.com ¡ Computer ¡Systems ¡and ¡Networks Fall ¡2016 ¡

  17. 17 ¡ DNS: ¡Root ¡Name ¡Servers ¡ Contacted ¡by ¡local ¡name ¡server ¡that ¡can ¡not ¡resolve ¡top-­‑level ¡domain ¡ ì Root ¡name ¡server: ¡ ì Contacts ¡authoritaCve ¡name ¡server ¡for ¡TLD ¡if ¡name ¡mapping ¡not ¡known ¡ ì Gets ¡mapping ¡ ì Returns ¡mapping ¡to ¡local ¡name ¡server ¡ ì ¡13 ¡root ¡name ¡“servers” ¡ worldwide ¡labeled ¡ a ¡-­‑ ¡ m ¡ • Each ¡“server” ¡is ¡really ¡a ¡ cluster ¡ • Some ¡clusters ¡are ¡ geographically ¡distributed ¡ • 504 ¡total ¡in ¡Fall ¡2014 ¡ Computer ¡Systems ¡and ¡Networks ¡ Fall ¡2016 ¡

  18. 18 ¡ DNS: ¡Root ¡Name ¡Servers ¡ hJp://www.root-­‑servers.org/ ¡ ¡ Computer ¡Systems ¡and ¡Networks ¡ Fall ¡2016 ¡

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend