Presentation is loading. Please wait.

Presentation is loading. Please wait.

15-744: Computer Networking L-3 Addressing/Forwarding.

Similar presentations


Presentation on theme: "15-744: Computer Networking L-3 Addressing/Forwarding."— Presentation transcript:

1 15-744: Computer Networking L-3 Addressing/Forwarding

2 L-3; 9-17-02© Srinivasan Seshan, 20022 Routing How do routers process IP packets Forwarding lookup algorithms Assigned reading [D+97] Small Forwarding Tables for Fast Routing Lookups [BV01] Scalable Packet Classification

3 L-3; 9-17-02© Srinivasan Seshan, 20023 Outline IP address allocation Alternative methods for packet forwarding IP route lookup Variable prefix match algorithms

4 L-3; 9-17-02© Srinivasan Seshan, 20024 IP Address Problem (1991) Address space depletion In danger of running out of classes A and B Why? Class C too small for most domains Very few class A – IANA (Internet Assigned Numbers Authority) very careful about giving Class B – greatest problem Sparsely populated – but people refuse to give it back

5 L-3; 9-17-02© Srinivasan Seshan, 20025 IP Address Utilization (‘98) http://www.caida.org/outreach/resources/learn/ipv4space/

6 L-3; 9-17-02© Srinivasan Seshan, 20026 Solution 1 – CIDR Assign multiple class C addresses Assign consecutive blocks RFC1338 – Classless Inter-Domain Routing (CIDR)

7 L-3; 9-17-02© Srinivasan Seshan, 20027 Classless Inter-Domain Routing Do not use classes to determine network ID Assign any range of addresses to network Use common part of address as network number e.g., addresses 192.4.16 - 196.4.31 have the first 20 bits in common. Thus, we use this as the network number netmask is /20, /xx is valid for almost any xx Enables more efficient usage of address space (and router tables)

8 L-3; 9-17-02© Srinivasan Seshan, 20028 Solution 2 - NAT Network Address Translation (NAT) Alternate solution to address space Kludge (but useful) Sits between your network and the Internet Translates local network layer addresses to global IP addresses Has a pool of global IP addresses (less than number of hosts on your network)

9 L-3; 9-17-02© Srinivasan Seshan, 20029 NAT Illustration Global Internet Private Network Pool of global IP addresses Operation: Source (S) wants to talk to Destination (D): Create S g -S p mapping Replace S p with S g for outgoing packets Replace S g with S p for incoming packets D & S can be just IP addresses or IP addresses + port #’s PG DgDg SpSp Data NAT DestinationSource DgDg SgSg Data

10 L-3; 9-17-02© Srinivasan Seshan, 200210 Solution 3 - IPv6 Scale – addresses are 128bit Header size? Simplification Removes infrequently used parts of header 40byte fixed size vs. 20+ byte variable IPv6 removes checksum Relies on upper layer protocols to provide integrity IPv6 eliminates fragmentation Requires path MTU discovery Requires 1280 byte MTU Flows Help soft state systems Maps well onto TCP connection or stream of UDP packets on host- port pair

11 L-3; 9-17-02© Srinivasan Seshan, 200211 IPv6 Header Source Address Destination Address 04162432 VersionClassFlow Label Payload LengthNext HeaderHop Limit 1219

12 L-3; 9-17-02© Srinivasan Seshan, 200212 Summary: Internet Architecture Packet-switched datagram network IP is the “compatibility layer” Hourglass architecture All hosts and routers run IP Stateless architecture no per flow state inside network IP TCPUDP ATM Satellite Ethernet

13 L-3; 9-17-02© Srinivasan Seshan, 200213 Summary: Minimalist Approach Dumb network IP provide minimal functionalities to support connectivity Addressing, forwarding, routing Smart end system Transport layer or application performs more sophisticated functionalities Flow control, error control, congestion control Advantages Accommodate heterogeneous technologies (Ethernet, modem, satellite, wireless) Support diverse applications (telnet, ftp, Web, X windows) Decentralized network administration

14 L-3; 9-17-02© Srinivasan Seshan, 200214 Summary: IP Design Relatively simple design Some parts not so useful (TOS, options) Beginning to show age Unclear what the solution will be  probably IPv6

15 L-3; 9-17-02© Srinivasan Seshan, 200215 Outline IP address allocation Alternative methods for packet forwarding IP route lookup Variable prefix match algorithms

16 L-3; 9-17-02© Srinivasan Seshan, 200216 Techniques for Forwarding Packets Source routing Packet carries path Table of virtual circuits Connection routed through network to setup state Packets forwarded using connection state Table of global addresses (IP) Routers keep next hop for destination Packets carry destination address

17 L-3; 9-17-02© Srinivasan Seshan, 200217 Source Routing List entire path in packet Driving directions (north 3 hops, east, etc..) Router processing Examine first step in directions Strip first step from packet Forward to step just stripped off Receiver Packet R2, R3, R Sender 2 3 4 1 2 3 4 1 2 3 4 1 R2 R3 R1 R3, RR

18 L-3; 9-17-02© Srinivasan Seshan, 200218 Source Routing Advantages Switches can be very simple and fast Disadvantages Variable (unbounded) header size Sources must know or discover topology (e.g., failures) Typical use Ad-hoc networks (DSR) Machine room networks (Myrinet)

19 L-3; 9-17-02© Srinivasan Seshan, 200219 Virtual Circuits/Tag Switching Connection setup phase Use other means to route setup request Each router allocates flow ID on local link Creates mapping of inbound flow ID/port to outbound flow ID/port Each packet carries connection ID Sent from source with 1 st hop connection ID Router processing Lookup flow ID – simple table lookup Replace flow ID with outgoing flow ID Forward to output port

20 L-3; 9-17-02© Srinivasan Seshan, 200220 Virtual Circuits Examples Receiver Packet 1,5  3,7 Sender 2 3 4 1 1,7  4,2 2 3 4 1 2 3 4 1 2,2  3,6 R2 R3 R1 5726

21 L-3; 9-17-02© Srinivasan Seshan, 200221 Virtual Circuits Advantages More efficient lookup (simple table lookup) More flexible (different path for each flow) Can reserve bandwidth at connection setup Easier for hardware implementations Disadvantages Still need to route connection setup request More complex failure recovery – must recreate connection state Typical uses ATM – combined with fix sized cells MPLS – tag switching for IP networks

22 L-3; 9-17-02© Srinivasan Seshan, 200222 IP Datagrams on Virtual Circuits Challenge – when to setup connections At bootup time – permanent virtual circuits (PVC) Large number of circuits For every packet transmission Connection setup is expensive For every connection What is a connection? How to route connectionless traffic?

23 L-3; 9-17-02© Srinivasan Seshan, 200223 IP Datagrams on Virtual Circuits Traffic pattern Few long lived flows Flow – set of data packets from source to destination Large percentage of packet traffic Improving forwarding performance by using virtual circuits for these flows Other traffic uses normal IP forwarding

24 L-3; 9-17-02© Srinivasan Seshan, 200224 Global Addresses (IP) Each packet has destination address Each switch has forwarding table of destination  next hop At v and x: destination  east At w and y: destination  south At z: destination  north Distributed routing algorithm for calculating forwarding tables

25 L-3; 9-17-02© Srinivasan Seshan, 200225 Global Address Example Receiver Packet R Sender 2 3 4 1 2 3 4 1 2 3 4 1 R2 R3 R1 RR R  3 R  4 R  3 R

26 L-3; 9-17-02© Srinivasan Seshan, 200226 Router Table Size One entry for every host on the Internet 100M entries,doubling every year One entry for every LAN Every host on LAN shares prefix Still too many, doubling every year One entry for every organization Every host in organization shares prefix Requires careful address allocation

27 L-3; 9-17-02© Srinivasan Seshan, 200227 Global Addresses Advantages Stateless – simple error recovery Disadvantages Every switch knows about every destination Potentially large tables All packets to destination take same route

28 L-3; 9-17-02© Srinivasan Seshan, 200228 Summary Source RoutingGlobal Addresses Header SizeWorstOK – Large address Router Table SizeNone Number of hosts (prefixes) Forward OverheadBestPrefix matching Virtual Circuits Best Number of circuits Pretty Good Setup OverheadNone Error RecoveryTell all hostsTell all routers Connection Setup Tell all routers and Tear down circuit and re-route

29 L-3; 9-17-02© Srinivasan Seshan, 200229 Outline IP address allocation Alternative methods for packet forwarding IP route lookup Variable prefix match algorithms

30 L-3; 9-17-02© Srinivasan Seshan, 200230 Original IP Route Lookup Address classes A: 0 | 7 bit network | 24 bit host (16M each) B: 10 | 14 bit network | 16 bit host (64K) C: 110 | 21 bit network | 8 bit host (255) Address would specify prefix for forwarding table Simple lookup

31 L-3; 9-17-02© Srinivasan Seshan, 200231 Original IP Route Lookup – Example www.cmu.edu address 128.2.11.43www.cmu.edu Class B address – class + network is 128.2 Lookup 128.2 in forwarding table Prefix – part of address that really matters for routing Forwarding table contains List of class+network entries A few fixed prefix lengths (8/16/24) Large tables 2 Million class C networks 32 bits does not give enough space encode network location information inside address – i.e., create a structured hierarchy

32 L-3; 9-17-02© Srinivasan Seshan, 200232 CIDR Revisited Supernets Assign adjacent net addresses to same org Classless routing (CIDR) How does this help routing table? Combine routing table entries whenever all nodes with same prefix share same hop

33 L-3; 9-17-02© Srinivasan Seshan, 200233 CIDR Example Network provide is allocated 8 class C chunks, 201.10.0.0 to 201.10.7.255 Allocation uses 3 bits of class C space Remaining 21 bits are network number, written as 201.10.0.0/21 Replaces 8 class C routing entries with 1 combined entry Routing protocols carry prefix with destination network address Longest prefix match for forwarding

34 L-3; 9-17-02© Srinivasan Seshan, 200234 CIDR Illustration Provider is given 201.10.0.0/21 201.10.0.0/22201.10.4.0/24201.10.5.0/24201.10.6.0/23 Provider

35 L-3; 9-17-02© Srinivasan Seshan, 200235 CIDR Shortcomings Multi-homing Customer selecting a new provider 201.10.0.0/21 201.10.0.0/22 201.10.4.0/24 201.10.5.0/24201.10.6.0/23 or Provider 2 address Provider 1Provider 2

36 L-3; 9-17-02© Srinivasan Seshan, 200236 Routing to the Network H2 H3 H4 R1 10.1.1/24 10.1.1.2 10.1.1.4 Provider 10.1/16 10.1.8/24 10.1.0/24 10.1.1.3 10.1.2/23 R2 10.1.0.2 10.1.8.4 10.1.0.1 10.1.1.1 10.1.2.2 10.1.8.1 10.1.2.1 10.1.16.1 H1 Packet to 10.1.1.3 arrives Path is R2 – R1 – H1 – H2

37 L-3; 9-17-02© Srinivasan Seshan, 200237 Routing Within the Subnet Routing table at R2 H2 H3 H4 R1 10.1.1/24 10.1/16 10.1.8/24 10.1.0/24 10.1.1.3 10.1.2/23 R2 10.1.0.2 10.1.8.4 10.1.0.1 10.1.1.1 10.1.2.2 10.1.8.1 10.1.2.1 10.1.16.1 H1 DestinationNext HopInterface 127.0.0.1 lo0 Default or 0/0provider10.1.16.1 10.1.8.0/2410.1.8.1 10.1.2.0/2310.1.2.1 10.1.0.0/2310.1.2.210.1.2.1 Packet to 10.1.1.3 Matches 10.1.0.0/23 10.1.1.2 10.1.1.4

38 L-3; 9-17-02© Srinivasan Seshan, 200238 Routing Within the Subnet H2 H3 H4 R1 10.1.1/24 10.1/16 10.1.8/24 10.1.0/24 10.1.1.3 10.1.2/23 R2 10.1.0.2 10.1.8.4 10.1.0.1 10.1.1.1 10.1.2.2 10.1.8.1 10.1.2.1 10.1.16.1 H1 Routing table at R1 DestinationNext HopInterface 127.0.0.1 lo0 Default or 0/010.1.2.110.1.2.2 10.1.0.0/2410.1.0.1 10.1.1.0/2410.1.1.110.1.1.4 10.1.2.0/2310.1.2.2 Packet to 10.1.1.3 Matches 10.1.1.1/31 Longest prefix match 10.1.1.2/3110.1.1.2 10.1.1.4

39 L-3; 9-17-02© Srinivasan Seshan, 200239 Routing Within the Subnet H2 H3 H4 R1 10.1.1/24 10.1/16 10.1.8/24 10.1.0/24 10.1.1.3 10.1.2/23 R2 10.1.0.2 10.1.8.4 10.1.0.1 10.1.1.1 10.1.2.2 10.1.8.1 10.1.2.1 10.1.16.1 H1 Routing table at H1 DestinationNext HopInterface 127.0.0.1 lo0 Default or 0/010.1.1.110.1.1.2 10.1.1.0/2410.1.1.210.1.1.1 10.1.1.3/3110.1.1.2 Packet to 10.1.1.3 Direct route Longest prefix match 10.1.1.2 10.1.1.4

40 L-3; 9-17-02© Srinivasan Seshan, 200240 Outline IP address allocation Alternative methods for packet forwarding IP route lookup Variable prefix match algorithms

41 L-3; 9-17-02© Srinivasan Seshan, 200241 Compressed Trie Using Sample Database 01 Root P5P4 01 P1 0 0 P6 P7 P8 0 0 0 P2 0 0 1 P3 P1 = 10* P2 = 111* P3 = 11001* P4 = 1* P5 = 0* P6 = 1000* P7 = 100000* P8 = 1000000* Sample DatabaseCompressed Trie 1

42 L-3; 9-17-02© Srinivasan Seshan, 200242 Skip Count vs. Path Compression P1 P2 P3P4 0 0 0 1 1 1 1 P1 P2 P3 P4 0 0 01 (Skip count) Skip 2 or 11 (path compressed) 1 Removing one way branches ensures # of trie nodes is at most twice # of prefixes Using a skip count requires exact match at end and backtracking on failure  path compression simpler

43 L-3; 9-17-02© Srinivasan Seshan, 200243 How To Do Variable Prefix Match 128.2/16 10 16 19 128.32/16 128.32.130/240128.32.150/24 default 0/0 0 Traditional method – Patricia Tree Arrange route entries into a series of bit tests Worst case = 32 bit tests Problem: memory speed is a bottleneck Bit to test – 0 = left child,1 = right child

44 L-3; 9-17-02© Srinivasan Seshan, 200244 Speeding up Prefix Match (P+98) Cut prefix tree at 16 bit depth 64K bit mask Bit = 1 if tree continues below cut (root head) Bit = 1 if leaf at depth 16 or less (genuine head) Bit = 0 if part of range covered by leaf

45 L-3; 9-17-02© Srinivasan Seshan, 200245 Prefix Tree 1 0 000101110001111 123456789101112131415 Port 1Port 5Port 7 Port 3 Port 9 Port 5

46 L-3; 9-17-02© Srinivasan Seshan, 200246 Prefix Tree 1 0 000101110001111 123456789101112131415 Subtree 1Subtree 2 Subtree 3

47 L-3; 9-17-02© Srinivasan Seshan, 200247 Speeding up Prefix Match (P+98) Each 1 corresponds to either a route or a subtree Keep array of routes/pointers to subtree Need index into array – how to count # of 1s Keep running count to 16bit word in base index + code word (6 bits) Need to count 1s in last 16bit word Clever tricks Subtrees are handled separately

48 L-3; 9-17-02© Srinivasan Seshan, 200248 Speeding up Prefix Match (P+98) Scaling issues How would it handle IPv6 Update issues Other possibilities Why were the cuts done at 16/24/32 bits? Improve data structure by shuffling bits

49 L-3; 9-17-02© Srinivasan Seshan, 200249 Speeding up Prefix Match - Alternatives Route caches Temporal locality Many packets to same destination Other algorithms Waldvogel – Sigcomm 97 Binary search on prefixes Works well for larger addresses Bremler-Barr – Sigcomm 99 Clue = prefix length matched at previous hop Why is this useful?

50 L-3; 9-17-02© Srinivasan Seshan, 200250 Binary Search on Ranges Problem: Slow search (log 2 N+1 = 20 for a million prefixes) and update (O(n)). 0000 1000 1010 1011 1111 P1 P2 P3 P2 P3 P1 -- - => Prefixes P1 = 1*, P2 = 10*, P3 = 101* Encode each prefix as range and place all range endpoints in binary search table or tree. Need two next hops per entry for > and = case. [Lampson, Srinivasan, Varghese]

51 L-3; 9-17-02© Srinivasan Seshan, 200251 Speeding up Prefix Match - Alternatives Content addressable memory (CAM) Hardware based route lookup Input = tag, output = value associated with tag Requires exact match with tag Multiple cycles (1 per prefix searched) with single CAM Multiple CAMs (1 per prefix) searched in parallel Ternary CAM 0,1,don’t care values in tag match Priority (I.e. longest prefix) by order of entries in CAM

52 L-3; 9-17-02© Srinivasan Seshan, 200252 Next Lecture: Routers & Routing High-speed router architecture Intro to routing protocols Assigned reading [McK97] A Fast Switched Backplane for a Gigabit Switched Router RIP/OSPF


Download ppt "15-744: Computer Networking L-3 Addressing/Forwarding."

Similar presentations


Ads by Google