Download presentation
Presentation is loading. Please wait.
Published byJuniper Fields Modified over 9 years ago
1
Courtesy: Nick McKeown, Stanford More on IP and Packet Forwarding Tahir Azim
2
Courtesy: Nick McKeown, Stanford Mapping Computer Names to IP addresses The Domain Naming System (DNS) Names are hierarchical and belong to a domain: –e.g. elaine17.stanford.edu –Common domain names:.com,.edu,.gov,.org,.net,.uk (or other country-specific domain). –Top-level names are assigned by the Internet Corporation for Assigned Names and Numbers (ICANN). –A unique name is assigned to each organization. DNS Client-Server Model –DNS maintains a hierarchical, distributed database of names. –Servers are arranged in a hierarchy. –Each domain has a “root” server. –An application needing an IP address is a DNS client.
3
Courtesy: Nick McKeown, Stanford Mapping Computer Names to IP addresses The Domain Naming System (DNS) A DNS Query 1.Client asks local server. 2.If local server does not have address, it asks a set of other designated servers. 3.If none of the designated servers have the address, the local server asks the root server of the requested domain. 4.Addresses are cached in case they are requested again. E.g. www.eecs.berkeley.edu.stanford.edu.berkeley.edu.eecs.berkeley.edu.edu “What is the IP address of www.eecs.berkeley.eduwww.eecs.berkeley.edu?” e.g. gethostbyname() Client application
4
Courtesy: Nick McKeown, Stanford An example of names and addresses Mapping the path between two hosts > host cms.niit.edu.pk cms.niit.edu.pk has address 202.125.157.200 > tracert www.berkeley.edu [traceroute or tracepath in Linux/Unix]www.berkeley.edu Tracing route to arachne-lb.berkeley.edu [169.229.131.92] over a maximum of 30 hops: 1 3 ms 1 ms 24 ms 192.168.1.1 2 38 ms 49 ms 49 ms 203.99.176.1 3 40 ms 39 ms 39 ms 203.99.170.26 4 103 ms 39 ms 124 ms rwp44.pie.net.pk [202.125.148.163] 5 109 ms 57 ms 84 ms pos2-2.khi77gsrc1.pie.net.pk [202.125.159.45] 6 60 ms 59 ms 59 ms g3-0.khi77gw1.pie.net.pk [202.125.128.162] 7 206 ms 204 ms 203 ms t2a6-p9-0.uk-lon2.eu.bt.net [166.49.160.129] 8 206 ms 229 ms 209 ms t2c1-ge7-0.uk-lon2.eu.bt.net [166.49.176.43] 9 207 ms 206 ms * t2c1-p3-0.uk-glo.eu.bt.net [166.49.208.98] 10 * 205 ms 203 ms t2c1-p9-3.uk-eal.eu.bt.net [166.49.195.206] 11 292 ms 294 ms 294 ms t2c1-p5-0-0.us-ash.eu.bt.net [166.49.164.65] 12 377 ms 369 ms 367 ms eq-exch.bb-peer01.loudoun.va.ena.net [206.223.115.45] 13 446 ms 442 ms 367 ms 137.164.129.11 14 375 ms 374 ms 394 ms 137.164.129.2 15 360 ms * 417 ms te4-1--160.tr01-plalca01.transitrail.net [137.164.129.34] 16 433 ms * 359 ms calren-trcust.plalca01.transitrail.net [137.164.131.254] 17 376 ms 366 ms 357 ms ucb--svl-dc1-egm.cenic.net [137.164.23.66] 18 365 ms * 362 ms g3-17.inr-202-reccev.Berkeley.EDU [128.32.0.35] 19 365 ms 364 ms 362 ms t1-1.inr-211-srb.Berkeley.EDU [128.32.255.43] 20 363 ms 358 ms 374 ms arachne-lb.Berkeley.EDU [169.229.131.92]
5
Courtesy: Nick McKeown, Stanford Example Mapping the path between two hosts cms.niit.edu.pk > host bbr2-rtr.stanford.edu | sort -n bbr2-rtr.Stanford.EDU has address 128.12.1.49 bbr2-rtr.Stanford.EDU has address 171.64.0.126 bbr2-rtr.Stanford.EDU has address 171.64.1.133 bbr2-rtr.Stanford.EDU has address 171.64.1.152 bbr2-rtr.Stanford.EDU has address 171.64.1.161 bbr2-rtr.Stanford.EDU has address 171.64.1.242 bbr2-rtr.Stanford.EDU has address 171.64.1.26 bbr2-rtr.Stanford.EDU has address 171.64.1.9 bbr2-rtr.Stanford.EDU has address 171.64.1.97 bbr2-rtr.Stanford.EDU has address 171.64.3.242 bbr2-rtr.Stanford.EDU has address 171.64.7.60 bbr2-rtr.Stanford.EDU has address 171.66.1.249 bbr2-rtr.Stanford.EDU has address 171.66.16.1 bbr2-rtr.Stanford.EDU has address 171.67.1.193 bbr2-rtr.Stanford.EDU has address 171.67.20.1 bbr2-rtr.Stanford.EDU has address 171.67.254.242 bbr2-rtr.Stanford.EDU has address 171.67.255.126 bbr2-rtr.Stanford.EDU has address 172.24.1.9 bbr2-rtr.Stanford.EDU has address 172.27.20.1 bbr2-rtr.Stanford.EDU has address 192.168.2.129 bbr2-rtr.Stanford.EDU has address 192.168.7.154
6
Courtesy: Nick McKeown, Stanford An aside: Error Reporting (ICMP) and traceroute Internet Control Message Protocol: –Used by a router/end-host to report some types of error: –E.g. Destination Unreachable: packet can’t be forwarded to/towards its destination. –E.g. Time Exceeded: TTL reached zero, or fragment didn’t arrive in time. Traceroute uses this error to its advantage. –An ICMP message is an IP datagram, and is sent back to the source of the packet that caused the error.
7
Courtesy: Nick McKeown, Stanford How a Router Forwards Datagrams Every datagram contains a destination address. The router determines the prefix to which the address belongs, and routes it to the“Network ID” that uniquely identifies a physical network. All hosts and routers sharing a Network ID share same physical network.
8
Courtesy: Nick McKeown, Stanford How a Router Forwards Datagrams 128.9/16 128.9.16/20 128.9.176/20 128.9.19/24 128.9.25/24 142.12/19 65/8 PrefixPort 3 2 2 7 2 1 3 128.17.14.1 128.17.20.1 128.17.10.1 128.17.14.1 128.17.16.1 Next-hop R1 R2 R3 R4 1 2 3 128.17.20.1 128.17.16.1 e.g. 128.9.16.14 => Port 2 Forwarding/routing table
9
Courtesy: Nick McKeown, Stanford Forwarding Datagrams Is the datagram for a host on a directly attached network? If no, consult forwarding table to find next-hop.
10
Courtesy: Nick McKeown, Stanford Inside a router Link 1, ingressLink 1, egress Link 2, ingressLink 2, egress Link 3, ingressLink 3, egress Link 4, ingressLink 4, egress Choose Egress Choose Egress Choose Egress Choose Egress
11
Courtesy: Nick McKeown, Stanford Inside a router Link 1, ingressLink 1, egress Link 2, ingressLink 2, egress Link 3, ingressLink 3, egress Link 4, ingressLink 4, egress Choose Egress Choose Egress Choose Egress Forwarding Decision Forwarding Table
12
Courtesy: Nick McKeown, Stanford Forwarding in an IP Router Lookup packet DA in forwarding table. –If known, forward to correct port. –If unknown, either (i)drop packet, or (ii)forward to some default port Decrement TTL, update header Checksum. Forward packet to outgoing interface. Transmit packet onto link. Question: How is the address looked up in a real router?
13
Courtesy: Nick McKeown, Stanford Making a Forwarding Decision Class-based addressing Class AClass BClass CD 212.17.9.4 Class A Class B Class C 212.17.9.0Port 4 Exact Match Routing Table: IP Address Space 212.17.9.0
14
Courtesy: Nick McKeown, Stanford Associative Lookups “Contents addressable memory” (CAM) Network Address Port Number Associative Memory or CAM Search Data 32 Port Number Hit? Advantages: Simple Disadvantages Slow High Power Small Expensive Search data is compared with every entry in parallel All 2 32 addresses are not stored
15
Courtesy: Nick McKeown, Stanford Hashed Lookups Hashing Function Memory Address Data Search Data Port number Hit? { 16 32
16
Courtesy: Nick McKeown, Stanford Lookups Using Hashing An example Hashing Function 16 #1#2#3#4 #1#2 #1#2#3 Linked list of entries with same hash key. Memory Search Data Port number Hit? 32
17
Courtesy: Nick McKeown, Stanford Lookups Using Hashing Advantages: Simple Expected lookup time can be small Disadvantages Non-deterministic lookup time Inefficient use of memory
18
Courtesy: Nick McKeown, Stanford Trees and Tries Binary Search Tree: <> <><> log 2 N N entries Binary Search Trie: (“reTRIEval”) 01 0101 111010 Requires 32 memory references, regardless of number of addresses.
19
Courtesy: Nick McKeown, Stanford Search Tries Multiway tries reduce the number of memory references 16-ary Search Trie 0000, ptr1111, ptr 0000, 01111, ptr 000011110000 0000, 0 1111, ptr 111111111111 Question: Why not just keep increasing the degree of the trie?
20
Courtesy: Nick McKeown, Stanford Classless Addressing CIDR 0 2 32 -1 128.9/16 128.9.16.14 128.9.16/20128.9.176/20 128.9.19/24 128.9.25/24 Most specific route = “longest matching prefix” Question: How can we look up addresses if they are not an exact match?
21
Courtesy: Nick McKeown, Stanford Ternary CAMs 10.1.1.321 10.1.1.02 10.1.3.03 10.1.0.04 255.255.255.255 255.255.255.0 255.255.0.0 255.0.0.010.0.0.04 ValueMask Priority Encoder Port Associative Memory Port Note: Most specific routes appear closest to top of table Ternary CAM allows a third matching state of "X" or "Don't Care" for one or more bits in the stored dataword For example, a ternary CAM might have a stored word of "10XX0" which will match any of the four search words "10000", "10010", "10100", or "10110".
22
Courtesy: Nick McKeown, Stanford Longest prefix matches using Binary Tries Example Prefixes: a) 00001 b) 00010 c) 00011 d) 001 e) 0101 f) 011 g) 10 h) 1010 i) 111 j) 111100 e f g h i j 01 a bc d k k) 11110001
23
Courtesy: Nick McKeown, Stanford Lookup Performance Required LineLine RatePktsize=40BPktsize=240B T11.5Mbps4.68Kpps0.78Kpps OC3155Mbps480Kpps80Kpps OC12622Mbps1.94Mpps323Kpps OC482.5Gbps7.81Mpps1.3Mpps OC19210Gbps31.25Mpps5.21Mpps
24
Courtesy: Nick McKeown, Stanford Discussion Why was the Internet Protocol designed this way? –Why connectionless, datagram, best-effort? –Why not automatic retransmissions? –Why fragmentation in the network? Must the Internet address be hierarchical? What address does a mobile host have? Are there other ways to design networks? Google: Clean Slate Internet Design
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.