4 ICMP, Fragmentation, Ipv6, DHCP, NAT.Pptx
Total Page:16
File Type:pdf, Size:1020Kb
1/19/11 DNS Caching DNS Name Resolution Exercises Show the DNS resolution paths, assuming the DNS hierarchy shown in the figures and assuming caching: • Once a (any) name server learns mapping, it caches mapping • thumper.cisco.com looks up bas.cs.princeton.edu • to reduce latency in DNS translation • thumper.cisco.com looks up opt.cs.princeton.edu • Cache entries timeout (disappear) after some time (TTL) • thumper.cisco.com looks up cat.ee.princeton.edu • TTL assigned by the authoritative server responsible for the host name • thumper.cisco.com looks up ket.physics.princeton.edu • Local name servers typically also cache • bas.cs.princeton.edu looks up dog.ee.princeton.edu • TLD name servers to reduce visits to root name servers • opt.cs.princeton.edu looks up cat.ee.princeton.edu • all other name server referrals • both positive and negative results 1 2 Peterson & Davie 2nd. ed., pp. 627, 628 DNS Design Points DNS Design Points DNS serves a core Internet function application application At which protocol layer does the DNS operate? transport •host, routers, and name servers communicate to " transport resolve names (name to address translation) DNS serves a core Internet function •complexity at network’s “edge” At which protocol layer does the DNS operate? network network •host, routers, and name servers communicate to " resolve names (name to address translation) link Why not centralize DNS? link •complexity at network’s “edge” •single point of failure physical •traffic volume physical •performance: distant centralized database Why not centralize DNS? •maintenance ➡doesn’t scale! DNS is “exploited” for server load balancing, how? 3 4 1 1/19/11 DNS protocol, messages DNS protocol, messages DNS protocol : query and reply messages, both with same message format Name, type fields for a query msg header . identification: 16 bit # for RRs in reponse query, reply to query uses to query same # . flags: records for - query or reply authoritative servers - recursion desired - recursion available additional “helpful” - reply is authoritative info that may be used 5 6 The Internet Network Layer Packet and Packet Header Previously . the Internet is a packet switched network: Host, router network layer functions: data is parceled into packets each packet carries a destination address each packet is routed independently Transport layer: TCP, UDP packets can arrive out of order packets may not arrive at all Routing protocols Forwarding protocol (IP) • addressing conventions • path selection Just as with the postal system, the “content” you want to send must datagram format • RIP, OSPF, BGP • be put into an envelope and the envelope must be addressed Network • packet handling conventions layer forwarding “Signalling” The “envelope” in this case is the packet header table protocol (ICMP) • error reporting • router “signaling” Recall: protocols are rules (“syntax” and “grammar” ) governing communication between nodes Link layer: Ethernet, WiFi, SONET, ATM The format of a packet header is part of a protocol Physical layer: copper, fiber, radio, microwave For packet forwarding on the Internet, the protocol is the Internet Protocol (IP) 7 8 2 1/19/11 Encapsulation IPv4 Packet Header Format usually 20 bytes" Each protocol has its own “envelope” usually IPv4 (without options) • each protocol attaches its header to the packet 4-bit 4-bit 8-bit • so we have a protocol wrapped inside another protocol 16-bit total length (bytes) IP fragmentation version hdr len Type of Service • each layer of header contains a protocol demultiplexing field to (bytes) (TOS) 3-bit identify the “packet handler” the next layer up, e.g., 16-bit Identification source Flags 13-bit Fragment Offset • protocol number M application • port number Ht M transport max number 8-bit Time to H H 8-bit Protocol 16-bit header checksum n t M network remaining hops Live (TTL) H H H M l n t link (decremented at physical each router) 32-bit Source IP Address H H H M l n t link Hl Hn Ht M physical upper layer protocol to deliver payload to, 32-bit Destination IP Address switch e.g., ICMP (1), UDP (17), TCP (6) Options (if any) H H M e.g. timestamp, destination n t network Hn Ht M error H H H M record route message M application l n t link Hl Hn Ht M check segment H M taken, specify t transport physical Payload (e.g., TCP/UDP packet, max size?) header datagram/packet H H M route n t network H H H M frame l n t link router physical 9 10 Packet Forwarding IP Addressing: Introduction Goal: deliver packets through routers from source to 223.1.1.1 destination IP address: 32-bit identifier for 223.1.2.1 • source node puts destination address in packet header host/router interface 223.1.1.2 • each router node on the Internet: 223.1.1.4 223.1.2.9 • looks up destination address in its routing table routing algorithm interface: connection between • we’ll study several path selection (i.e., routing) algorithms 223.1.2.2 host/router and physical link 223.1.1.3 223.1.3.27 • sends the packet to the next hop towards the destination local forwarding table • routes may change during session dest address output link • routers typically have 0100 3 0101 2 multiple interfaces • analogy: driving, asking directions 0111 2 1001 1 • host may have multiple 223.1.3.1 223.1.3.2 interfaces destination address in arriving packet’s header • IP address associated with 1 each interface 0111 3 2 223.1.1.1 = 11011111 00000001 00000001 00000001 223 1 1 1 11 12 3 1/19/11 Flat vs. Hierarchical Addressing IPv4 Addressing 4 Independent of physical hardware address Flat addressing: 1 2 2 2 32-bit number represented as dotted decimal: • each router needs 10 entries " 3 2 in its routing table 4 - • for ease of reference 5 5 • each # is the decimal representation of an octet 6 6 7 7 Divided into two parts: 8 2 9 7 • network prefix, globally assigned 10 2 • route to network first 11 2 • host ID, assigned locally Hierarchical addressing: • hosts only need to know the default router, Example: 12.34.158.0/24 is a 24-bit network prefix with 28 host addresses usually its border router • each border router keeps in its routing table: • next hop to other networks 12 34 158 5 • all hosts within its own network 3.1 2.* 2.1 00001100 00100010 10011110 00000101 1.* 1.1 4.* 2.1 3.2 3.2 note that for routing table, we store the next hop address 3.3 3.3 instead of the interface number 3.4 3.4 Network (24 bits) Host (8 bits) 13 14 Subnets Classfull Addresses For the example network prefix: 12.34.158.0/24 223.1.1.1 • how many hosts can the network have? A network can be further 223.1.2.1 divided into subnets 223.1.1.2 What is a good partition of the 32-bit address space" 223.1.1.4 223.1.2.9 between the network and host parts? What’s a subnet ? 223.1.2.2 • device interfaces with same 223.1.1.3 223.1.3.27 Historically . classfull addresses: subnet part of IP address Class A: 0*, very large /8 blocks (e.g., MIT has 18.0.0.0/8) • can physically reach each other LAN Class B: 10*, large /16 blocks (e.g,. UM has 141.213.0.0/16) without intervening router Class C: 110*, small /24 blocks (e.g., AT&T Labs has 192.20.225.0/24) 223.1.3.1 223.1.3.2 Class D: 1110*, multicast groups Class E: 11110*, reserved for future use Problems: a network consisting of 3 subnets 1. the Goldilock problem: everybody wanted a Class B 2. address space usage became inefficient 3. routing table explosion 4. and then, address space became scarce… 15 16 • by 1992, half of Class B has been allocated, would have been exhausted by 3/94 4 1/19/11 Classless InterDomain Routing (CIDR) CIDR: Hierarchical Address Allocation Network portion of address is of arbitrary length, Prefixes are key to Internet routing scalability determined by a prefix mask •address allocation by ICANN, ARIN/RIPE/APNIC and by ISPs •routing protocols and packet forwarding based on prefixes Uses two 32-bit numbers to represent a network address •today, routing tables contain ~150,000-200,000 prefixes network number = IP address + mask 12.0.0.0/16 IP address:" Usually written as a.b.c.d/x, " 12.1.0.0/16 12.3.0.0/24 : 12.4.0.0 00001100 00000100 00000000 00000000 where x is number of bits " 12.2.0.0/16 12.3.1.0/24 : in the network portion of " 12.3.0.0/16 : : : address: 12.4.0.0/15 mask:" 12.0.0.0/8 12.3.254.0/24 255.254.0.0 11111111 11111110 00000000 00000000 : : 12.253.0.0/19 : 12.253.32.0/19 Another example: " 12.253.64.0/19 Network Prefix for hosts 200.23.16.0/23 12.253.0.0/16 12.253.96.0/19 network host 12.254.0.0/16 12.253.128.0/19 prefix part 12.253.160.0/19 11001000 00010111 00010000 00000000 12.253.192.0/19 17 18 CIDR: Route Aggregation Longest Prefix Match: More specific routes Hierarchical addressing allows efficient advertisement of routing information: ISPs-R-Us has a more specific route to Organization 1 Organization 0 Organization 0 200.23.16.0/23 200.23.16.0/23 “Send me anything Organization 1 “Send me anything with addresses 200.23.18.0/23 Organization 2 beginning with addresses Organization 2 beginning 200.23.20.0/23 .