Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Comnet 2006 Communication Networks Recitation 3 DNS & ARP.

Similar presentations


Presentation on theme: "1 Comnet 2006 Communication Networks Recitation 3 DNS & ARP."— Presentation transcript:

1 1 Comnet 2006 Communication Networks Recitation 3 DNS & ARP

2 2 Comnet 2006 host names: convenient app-to-app communicationhost names: convenient app-to-app communication IP: efficient large-scale network communicationIP: efficient large-scale network communication MAC: quick-n-easy LAN forwardingMAC: quick-n-easy LAN forwarding Addressing Schemes medellin.cs.columbia.edu 128.119.40.7 E6-E9-00-17-BB-4B

3 3 Comnet 2006 Routing Example 223.1.1.1 223.1.1.2 223.1.1.3 223.1.1.4 223.1.2.9 223.1.2.2 223.1.2.1 223.1.3.2 223.1.3.1 223.1.3.27 A B E Starting at A, given IP datagram addressed to B: look up network address of B, find B on same network as Alook up network address of B, find B on same network as A link layer sends datagram to B inside link-layer framelink layer sends datagram to B inside link-layer frame B’s MAC addr A’s MAC addr A’s IP addr B’s IP addr IP payload datagram frame frame source, dest. address datagram source, dest. address

4 4 Comnet 2006 Translating between addresses Hostname (medellin.cs.columbia.edu) IP address (128.119.40.7) MAC address ( E6-E9-00-17-BB-4B ) DNS ARP

5 5 Comnet 2006 DNS Servers Contacted by local name server when can not resolve nameContacted by local name server when can not resolve name Root name server:Root name server: –contacts authoritative name server if name mapping not known –gets mapping –returns mapping to local name server 13/Anycast13/Anycast

6 6 Comnet 2006 DNS Hierarchy educomorgjp rpialbany DNS Distributed Database rpi.edu DNS DB rpi.edu DNS DB rpi.edu DNS DB

7 7 Comnet 2006 6 1 Simple DNS example host surf.eurecom.fr wants IP address of gaia.cs.umass.edu 1. Contacts its local DNS server, dns.eurecom.fr 2. dns.eurecom.fr contacts root name server, if necessary 3. root name server contacts authoritative name server, dns.umass.edu, if necessary requesting host surf.eurecom.fr gaia.cs.umass.edu root name server authorititive name server dns.umass.edu local name server dns.eurecom.fr 2 3 4 5

8 8 Comnet 2006 5 4 8 1 Intermediate name server requesting host surf.eurecom.fr gaia.cs.umass.edu root name server intermediate name server dns.umass.edu local name server dns.eurecom.fr 2 3 6 7 Root name server may not know authoritative name serverRoot name server may not know authoritative name server may know intermediate name server: who to contact to find authoritative name servermay know intermediate name server: who to contact to find authoritative name server authoritative name server dns.cs.umass.edu

9 9 Comnet 2006 1 8 DNS: iterated queries recursive query: puts burden of name resolution on contacted name serverputs burden of name resolution on contacted name server heavy loadheavy load iterated query: contacted server replies with name of server to contactcontacted server replies with name of server to contact “I don’t know this name, but ask this server”“I don’t know this name, but ask this server” requesting host surf.eurecom.fr gaia.cs.umass.edu root name server local name server dns.eurecom.fr 2 3 4 authoritative name server dns.cs.umass.edu 6 7 intermediate name server dns.umass.edu 5 iterated query

10 10 Comnet 2006 DNS library functions struct hostent *gethostbyname( const char *hostname); struct hostent *gethostbyaddr( const char *addr,size_t len,int family); struct hostent *he; he = gethostbyname( “www.yahoo.com” ); printf( “Address: %s\n”, inet_n_ntoa( he->h_addr ) ); struct in_addr addr; inet_aton( “66.94.230.32”, &addr ); he = gethostbyaddr( &addr, sizeof( addr ), AF_INET ); printf( “Name: %s\n”, he->h_name );

11 11 Comnet 2006 LAN Addresses and ARP 32-bit IP address: network-layer addressnetwork-layer address used to get datagram to destination networkused to get datagram to destination network LAN (or MAC or physical) address: used to get datagram from one interface to another physically-connected interface (same network)used to get datagram from one interface to another physically-connected interface (same network) 48 bit MAC address (for most LANs) burned into the adapter’s ROM48 bit MAC address (for most LANs) burned into the adapter’s ROM

12 12 Comnet 2006 LAN Addresses and ARP Each adapter on the LAN has a unique LAN address

13 13 Comnet 2006 ARP: Address Resolution Protocol Each IP node (Host, Router) on LAN has ARP module and tableEach IP node (Host, Router) on LAN has ARP module and table ARP Table: IP/MAC address mappings for some LAN nodesARP Table: IP/MAC address mappings for some LAN nodes –TTL (Time To Live): time of day after which address mapping will be forgotten (typically 20 minutes) Question: how to determine MAC address of B given B’s IP address?

14 14 Comnet 2006 ARP protocol A knows B's IP address, wants to learn physical address of BA knows B's IP address, wants to learn physical address of B A broadcasts ARP query packet, containing B's IP addressA broadcasts ARP query packet, containing B's IP address –all machines on LAN receive ARP query B receives ARP packet, replies to A with its (B's) physical layer addressB receives ARP packet, replies to A with its (B's) physical layer address A caches (saves) IP-to-physical address pairs until information becomes old (times out)A caches (saves) IP-to-physical address pairs until information becomes old (times out) –soft state: information that times out (goes away) unless refreshed Arp Arp!

15 15 Comnet 2006 ARP Conversation HEY - Everyone please listen! Will 128.213.1.5 please send me her Ethernet address? not me Hi Green! I’m 128.213.1.5, and my Ethernet address is 87:A2:15:35:02:C3

16 16 Comnet 2006 Problem 1 1.Calculate the completion time of transferring a file of size 1KB over a link with speed 10Mb/s and length 3000km. Propagation speed is 200,000Km/s

17 17 Comnet 2006 Solution 1 The completion time is calculated as follows: T = Prop. Delay + Trans. Time T = Prop. Delay + Trans. Time We obtain that: Prop. Delay = 3000 km /(0.2 km/usec) = 15msProp. Delay = 3000 km /(0.2 km/usec) = 15ms Trans. Time = 1KB/1.25MB/s = 8.2 msTrans. Time = 1KB/1.25MB/s = 8.2 ms T = 15ms + 8.2 ms = 23.2 ms

18 18 Comnet 2006 Problem 2: CRC bits Bits represent a polynomial over GF(2)Bits represent a polynomial over GF(2) Example: 100101 = x 5 +x 2 +1Example: 100101 = x 5 +x 2 +1 Addition and subtraction are actually XORsAddition and subtraction are actually XORs Example: 1101 + 111 =Example: 1101 + 111 = 1010

19 19 Comnet 2006 Calculating CRC For data D and Generator G find bits R such that DR = n*G.For data D and Generator G find bits R such that DR = n*G. Same as D00…0 = n*G + RSame as D00…0 = n*G + R R will always be 1 bit shorter than GR will always be 1 bit shorter than G Use long Division with XORUse long Division with XOR

20 20 Comnet 2006 Solution 2 D = 01011000, G=1101, R=???D = 01011000, G=1101, R=??? 01011000000 | 1101 1101 1100 1101 1000 1101 1010 1101 1110 1101 1101011000000 | 1101 1101 1100 1101 1000 1101 1010 1101 1110 1101 11 R=011 n=1100111 DR=01011000011

21 21 Comnet 2006 Solution 2 – In reverse DR = 01011000011, G=1101 01011000011 | 1101 1101 1100 1101 1000 1101 1011 1101 1101 1101 0

22 22 Comnet 2006 CRC – Concluding Remarks If R has r bits, there are 2 r different CRCsIf R has r bits, there are 2 r different CRCs A random string will not be detected as an error in probability 2 -r.A random string will not be detected as an error in probability 2 -r. Robustness for common errors depends on G.Robustness for common errors depends on G. Some standards try to avoid trailing 0’s.Some standards try to avoid trailing 0’s.

23 23 Comnet 2006 Problem 3 2. In CSMA/CD network there are two computers A and B which collide in round 1. Give the table of possible outcomes of the second round and their probabilities. Assume that the initial delay period after the collision is D=1 (the hosts pick a random number between 0 and D before trying to re-transmit).

24 24 Comnet 2006 Solution 3 Case A B Probability Comment Case A B Probability Comment --------------------------------------------------------------- --------------------------------------------------------------- a 0 0 0.25 Collide in round 2 a 0 0 0.25 Collide in round 2 b 0 1 0.25 A successful in round 2 b 0 1 0.25 A successful in round 2 B successful in round 3 B successful in round 3 c 1 0 0.25 B successful in round 2 c 1 0 0.25 B successful in round 2 A successful in round 3 A successful in round 3 d 1 1 0.25 Collide in round 3 d 1 1 0.25 Collide in round 3


Download ppt "1 Comnet 2006 Communication Networks Recitation 3 DNS & ARP."

Similar presentations


Ads by Google