4. Advanced Routing Mechanisms PA159: Net-Centric Computing I. Eva Hladká Faculty of Informatics Masaryk University Autumn 2010 Eva Hladká (Fl MU) 4. Advanced Routing Mechanisms Autumn 2010 1 / 63 Lecture Overview I (1) Routing: Recapitulation o Distributed Routing o Autonomous Systems (2) Distance Vector Routing Protocols RIP protocol IGRP protocol o EIGRP protocol Comparison (3) Link State Routing Protocols OSPF Protocol IS-IS Protocol (4) Path Vector Routing Protocols BGP Protocol (5) Router Architectures Router Introduction IP Address Lookup Algorithms o IP Packet Filtering and Classification Eva Hladka (FIMU) 4. Advanced Routing Mechanisms Autumn 2010 2 / 63 Routing: Recapitulation Lecture Overview I (l) Routing: Recapitulation o Distributed Routing o Autonomous Systems [^1 Distance Vector Routing Protocols RIP protocol IGRP protocol • EIGRP protocol Comparison Fšl Link State Routing Protocols OSPF Protocol IS-IS Protocol Path Vector Routing Protocols BGP Protocol [^1 Router Architectures Router Introduction IP Address Lookup Algorithms • IP Packet Filtering and Classification Eva Hladka (FIMU) 4. Advanced Routing Mechanisms Autumn 2010 3 / 63 Routing: Recapitulation Routing in General o Internet on the L3 - datagram apporach to packet switching o upper layer data are encapsulated into datagrams o datagrams (their fragments) travel through the network independently on each other • the global knowledge of the network's topology is problematic A • Routing = the process of finding a path in the network between two communicating nodes o the route/path has to satisfy certain constraints o influenced by several factors: o static ones: network topology o dynamic ones: network load Eva Hladká (Fl MU) 4. Advanced Routing Mechanisms Autumn 2010 4 / 63 Routing: Recapitulation A Real Network Example Figure: The topology of the IP/MPLS layer of the CESNET2 network. Eva Hladka (FI MU) 4. Advanced Routing Mechanisms Autumn 2010 S / 63 Routing: Recapitulation Routing - the goal o the main goal of routing is: o to find optimal paths o the optimality criterion is a metric - a cost assigned for passing through a network o to deliver a data packet to its receiver o the routing usually does not deal with the whole packet path o the router deals with just a single step - to whom should be the particular packet forwarded • somebody "closer" to the recipient o so-called hop-by-hop principle o the next router then decides, what to further do with the received packet 4. Advanced Routing Mechanisms Autumn 2010 6 / 63 Routing: Recapitulation Routing - Mathematical View o the routing can be seen as a problem of graph theory o a network can be represented by a graph, where: o nodes represent routers (identified by their IP addresses) • edges represent routers' interconnection (a data link) • edges' value = the communication cost • based on the employer metric - hop count, links' delay, links' usage, etc. o the goal: to find paths having minimal costs between any two nodes in the network 4. Advanced Routing Mechanisms Autumn 2010 7 / 63 Routing: Recapitulation Routing - Mathematical View Graph Theory Algorithms Two very important algorithms have profound impact on data networks: Bellman-Ford algorithm and Dijkstra's algorithm o both allow to compute shortest paths from a single source o to a single destination - Bellman-Ford, complexity O(LN) o to all the destinations - Dijkstra, complexity O(N2) (can be improved to O(L + NlogN)) o both of them have centralized and distributed variants o variants for widest-path computation also exist o so-called widest-path routing algorithms o algorithms, that use a non-additive concave property to define distance cost between two nodes o e.g., bandwidth - the bandwidth of a path is determined by the link with the minimum available bandwidth o i.e., if m(P) = min{m(ni, n2), m(n2, n3),m(n,-, nj)} == concave property further details: o PB165: Graphs and networks (prof. Matyska, doc. Hladká, dr. Rudova) Eva Hladka (FIMU) 4. Advanced Routing Mechanisms Autumn 2010 8 / 63 Routing: Recapitulation Routing - basic approaches distributed^ vs. centralized hop-by-hop vs. source-based deterministic vs. stochastic single-path vs. multi-path dynamic path selection vs. static path selection I INTERNET J 4. Advanced Routing Mechanisms Autumn 2010 9 / 63 Routing: Recapitulation Distributed Routing Distributed Routing - Basic Approaches Basic approaches to distributed routing: o Distance Vector (DV) - Bellman-Ford algorithm o the neighboring routers periodically (or when the topology changes) exchange complete copies of their routing tables based on the content of received updates, a router updates its information and increments its distance vector number o a metric indicating the number of hops in the network • i.e., "all pieces of information about the network just to my neighbors" • Link State (LS) - Dijkstra's algorithm o the routers periodically exchange information about states of the links, to which they are directly connected o they maintain complete information about the network topology - every router is aware of all the other routers in the network o once acquired, the Dijkstra algorithm is used for shortest paths computation • i.e., "information about just my neighbors to everyone" 4. Advanced Routing Mechanisms Autumn 2010 10 / 63 Routing: Recapitulation Distributed Routing Distributed Routing - Link State vs. Distance Vector Link State Distance Vector O Complexity: O every node has to know the cost of every link in the network == O(nE) messages O once a link state changes, the change has to be propagated to every node O Speed of convergence: 9 O(n2) alg., sends O(nE) messages sustains from oscillations O Robustness: O wrongly functional/compromised router spreads wrong information just about the links it is directly connected to every router computes routing tables on its own = separated from routing information propagation = a form of robustness O Usage: suitable for large networks Complexity: once a link state changes, the change has to be propagated just to the closest neighbors; it is further propagated just in cases, when the changed state leads to a change in the current shortest paths tree Speed of convergence: O may converge more slowly than LS problems with routing loops/cycles, count-to-infinity problem Robustness: bad computation is spread through the network == may lead to a "confusion" of other routers (bad routing tables) Usage: suitable just for smaller networks 4. Advanced Routing Mechanisms Autumn 2010 11 / 63 Routing: Recapitulation Distributed Routing Distributed Routing - Path Vector Path Vector (PV) o a variant of DV routing o in comparison with the DV, whole paths are sent in the PV (not only the end nodes) o allows a simple detection of loops o allows a definition of rules/policies (friendly vs. non-friendly ASs) 4. Advanced Routing Mechanisms Autumn 2010 12 / 63 Routing: Recapitulation Autonomous Systems Autonomous Systems • the goal of Internet's division into Autonomous Systems is: o a reduction of routing overhead o simpler routing tables, a reduction of exchanged information, etc. o a simplification of the whole network management o particular internets are managed by various institutions/organizations • autonomous systems = domains o a 16bit identifier is assigned to every AS/domain o Autonomous System Number (ASN) - RFC 1930 o assigned by ICANN (Internet Corporation For Assigned Names and Numbers) o correspond to administrative domains o networks and routers inside a single AS are managed by a single organization/institution o e.g., CESNET, PASNET, ... a distinction according to the way an AS is connected to the Internet: Stub AS o Multihomed AS Transit AS Eva Hladka (FIMU) 4. Advanced Routing Mechanisms Autumn 2010 13/63 Routing: Recapitulation Autonomous Systems Autonomous Systems - routing o separated routing because of scalability reasons: o interior routing o routing inside an AS • under the full control of AS's administrator(s) o the primary goal is the performance o so-called Interior Gateway Protocols (IGP) (e.g., RIP, OSPF, (E)IGRP, IS-IS) exterior routing routing among ASs o the primary goal is the support of defined policies and scalability o so-called Exterior Gateway Protocols (EGP) (e.g., BGP-4) o a cooperation of interior and exterior routing protocols is necessary Autumn 2010 14 / 63 Distance Vector Routing Protocols RIP protocol Lecture Overview I Hi! Routing: Recapitulation • Distributed Routing • Autonomous Systems (2) Distance Vector Routing Protocols RIP protocol IGRP protocol o EIGRP protocol Comparison Fšl Link State Routing Protocols OSPF Protocol IS-IS Protocol Path Vector Routing Protocols BGP Protocol [^1 Router Architectures Router Introduction IP Address Lookup Algorithms • IP Packet Filtering and Classification Eva Hladka (FIMU) 4. Advanced Routing Mechanisms Autumn 2010 16/63 Distance Vector Routing Protocols RIP protocol RIP protocol Routing Information Protocol (RIP) o the principal actor of the DV routing o RIPvl (RFC 1058) - the first routing protocol used in TCP/IP-based network in an intradomain environment o RIPv2 (RFC 1723) - adds several features (e.g., explicit masking and an authentication of routing information) o RIPng (RFC 2081) - RIPv2's extension to support IPv6 addresses/networks o the number of hops is used as a metric o transfer of a packet between two neighboring routers = 1 hop o the routers send the information periodically every 30 seconds o messages sent over UDP protocol o supports triggered updates when a state of a link changes o timeout 180s (detection of connection errors) o usage: suitable for small networks and stable links not advisable for redundant networks Eva Hladka (FIMU) 4. Advanced Routing Mechanisms Autumn 2010 17/63 Distance Vector Routing Protocols RIP protocol RIP protocol - version 1 Message Format I. 4. Advanced Routing Mechanisms Autumn 2010 18 / 63 Distance Vector Routing Protocols RIP protocol RIP protocol - version 1 Message Format II. o Command - indicates, whether the message is a request (a router is asking its neighbor for DV information) or a response • Version - RIP version • Address family identifier - identifies the address family (set to 2 for the IP address family) o IP address - the destination network (identified by a subnet or a host) o Metric - hop count to the destination (a number in the range (1..16), 16 = infinity) RIPvl messages are broadcast. 4. Advanced Routing Mechanisms Autumn 2010 19 / 63 Distance Vector Routing Protocols RIP protocol RIP protocol - version 1 Problems Analysis RIPvl suffers from several problems: o slow convergence and problems with routing loops/cycles - imposed by DV approach • infinity = 16 == the RIPvl cannot be used for networks with minimal amount of hops between any two routers > 15 o has no way (no field in the messages) to indicate anything specific about the network being addressed o RIPvl assumes that an address included follows a Class A, Class B, or Class C boundary implicitly o == it does NOT support variable length subnet masking 4. Advanced Routing Mechanisms Autumn 2010 20 / 63 Distance Vector Routing Protocols RIP protocol RIP protocol - version 2 Message Format I. Eva Hladka (FI MU) 4. Advanced Routing Mechanisms Autumn 2010 21 / 63 Distance Vector Routing Protocols RIP protocol RIP protocol - version 2 Message Format II. New fields introduced by RIPv2: o Route tag - used to differentiate internal routes within a RIP routing domain from external routes (the ones obtained from an external routing protocol) Subnet mask - allows routing based on subnet instead of doing classful routing (eliminates a major limitation of RIPvl) Next hop - an advertising router might want to indicate a next hop that is different from itself RIPv2 messages are multicast on 224.0.0.9. 4. Advanced Routing Mechanisms Autumn 2010 22 / 63 Distance Vector Routing Protocols IGRP protocol Interior Gateway Routing Protocol (IGRP) Interior Gateway Routing Protocol (IGRP): o developed by Cisco primarily to overcome the hop count limit and hop count metric of RIPvl o differs from the RIPvl in the following ways: o DV updates include five different metrics for each route o runs directly over IP with protocol (type field set to 9) o allows multiple paths for a route for the purpose of load balancing o external routes can be advertised o does NOT support variable length subnet masking 4. Advanced Routing Mechanisms Autumn 2010 23 / 63 Distance Vector Routing Protocols IGRP protocol Interior Gateway Routing Protocol (IGRP) Message Format I. 01234567 012345670123456701234567 14 bytes Version OPcode (1 nibble) (1 nibble) Hdition (1 byte) Autonomous System Number (2 bytes) Number of Internal Routes (2 bytes) \iimbc-i' i' Sy,--km Woules (2 bytes) Number of Exterior Routes (2 bytes) Checksum (2 bytes) Destination (3 bytes) Delay (3 bytes) Delay Bandwidth (3 bytes) Bandwidth MTU (2 bytes) Reliability (1 byte) Load (1 bytu) Hyp Count (1 byte) Destination (3 bytes) Destination Delay (3 bytes) Bandwidth (3 bytes) MTU (2 bytes) MTU Reliability (1 byte) Load (1 byte) Hyp Count íl nyt-) Eva Hladka (FI MU) 4. Advanced Routing Mechanisms Autumn 2010 24 / 63 Distance Vector Routing Protocols IGRP protocol Interior Gateway Routing Protocol (IGRP) Message Format II. • Version - set to 1 • Opcode - ^ Command field in RIPvl O Edition - counter incremented by the sender (prevents from receiving an old update) • Autonomous system number - ID number of an IGRP process O Number of interior routes - a field to indicate the number of routing entries in an update message that are subnets of a directly connected network Number of system routes - a counterpart of the number of interior routes Number of exterior routes - the number of route entries that are default networks • Checksum - value calculated on the entire IGRP packet (header + entries) o Destination - the destination network for which the distance vector is generated (just 3B are used!) o Delay, Bandwidth, Reliability, Load - fields for composite metric computation o Hop count - a number between 0 and 255 used to indicate the number of hops to the destination o MTU - the smallest MTU of any link along the route to the destination IGRP messages are multicast on 224.0.0.10. Eva Hladka (FIMU) 4. Advanced Routing Mechanisms Autumn 2010 25 / 63 Distance Vector Routing Protocols IGRP protocol Interior Gateway Routing Protocol (IGRP) Composite Metric Computation I. The IGRP uses a composite metric to compute a link cost: o included to provide flexibility to compute better or more accurate routes from a link cost rather than just using a hop count o based on four factors: bandwidth (B), delay (D), reliability (R), and o along with five nonnegative real-number coefficients (K1, K2, K3, K4, K5) for weighting these factors o set on the routers • The composite metric, C ("cost of a link"), is given as follows: load (L) (K1 x B + K2 x B + K3 x D) x ( K5 if K5 = 0 (1) C = Ki x B + K2 x 256 - L B + K3 x D, R + K4 if K5 = 0 (2) 256 L 4. Advanced Routing Mechanisms Autumn 2010 26 / 63 Distance Vector Routing Protocols IGRP protocol Interior Gateway Routing Protocol (IGRP) Composite Metric Computation II. o example: r+K4 considers the reliability of a link o i.e., if K5 = 0 (the above part is not included), all the links have the same level of reliability • the default, often used case: Ki = K3 = 1 and K2 = K4 = K5 = 0 o the composite metric reduces: Cdefauit = B + D o How can we compare bandwidth (kbps, Mbps) with delay (sec, milisec)? a transformation process is necessary to map the raw parameters to a comparable level o see the literature o further details: Medhi, D. and Ramasamy, K.: Network Routing: Algorithms, Protocols, and Architectures. 4. Advanced Routing Mechanisms Autumn 2010 27 / 63 Distance Vector Routing Protocols IGRP protocol Interior Gateway Routing Protocol (IGRP) Analysis o the protocol message includes all the different metric components rather than the composite metric o == the composite metric is left to a router to be computed o it is extremely important to ensure that each router is configured with the same value of the coefficients Ki, K2, K3, K4, K5 • if NOT set equally, the routers' view of the shortest paths would be different o may cause routing problems 4. Advanced Routing Mechanisms Autumn 2010 28 / 63 Distance Vector Routing Protocols EIGRP protocol Enhanced Interior Gateway Routing Protocol (EIGRP) Enhanced Interior Gateway Routing Protocol (EIGRP): o another routing protocol developed by Cisco o it enhances IGRP in many ways (e.g., it provides loop-free routing, provides reliable delivery, allows variable length subnet masking, etc.) the composite metric remains the same as in IGRP o originally designed for IPv4 only, IPv6 version proposed afterwards 4. Advanced Routing Mechanisms Autumn 2010 29 / 63 Distance Vector Routing Protocols Comparison DV Protocols Comparison Protocol RHV1 RIPv2 IGRP EIGRP RIPng Address IPv4 IPv4 IPv4 IPv4 IPv6 Family Metric Hop Hop Composite Composite Hop Information Unreliable, unreliable, Unreliable, Reliable, Unreliable, Communica- broadcast multicast multicast multicast multicast tion Routing Bellman- Bellman- Bellman- Diffusing Bellman- Computation Ford Ford Ford computation Ford VLSM/CIDR No Yes No Yes v6-based Remark Slow conver- Slow conver- Slow conver- Fast, loop- Slow con- gence; split gence; split gence; split free conver- vergence; horizon horizon horizon gence; chatty split hori- protocol zon Figure: Comparison of protocols in the distance vector protocol family. Eva Hladka (FIMU) 4. Advanced Routing Mechanisms Autumn 2010 30 / 63 Link State Routing Protocols OSPF Protocol Lecture Overview I Routing: Recapitulation • Distributed Routing • Autonomous Systems Distance Vector Routing Protocols RIP protocol IGRP protocol • EIGRP protocol Comparison (3) Link State Routing Protocols OSPF Protocol IS-IS Protocol Path Vector Routing Protocols BGP Protocol [^1 Router Architectures Router Introduction IP Address Lookup Algorithms • IP Packet Filtering and Classification Eva Hladká (FIMU) 4. Advanced Routing Mechanisms Autumn 2010 31 / 63 Link State Routing Protocols OSPF Protocol Open Shortest Path First (OSPF) I. Open Shortest Path First (OSPF) o currently the mostly used LS protocol o gathers link state information from available routers and constructs a topology map of the network o metric: cost o NO hop-count • a number (in the range between 1 and 65535) assigned to each router's network interface o the lower the number is, the better the link/path is (i.e., will be preferred) by default, every interface is automatically assigned a cost derived from the link's throughput o cost = 100000000/bandwidth (bw in bps) o might be manually edited 4. Advanced Routing Mechanisms Autumn 2010 32 / 63 Link State Routing Protocols OSPF Protocol Open Shortest Path First (OSPF) II. o features: message authentication o up to OSPFv2 □ OSPFv3 (running on IPv6) no longer supports protocol-internal authentication (instead, it relies on IPv6 protocol security (IPsec)) routing areas □ next layer of hierarchy - autonomous systems can be divided into subdomains (routing areas) o to simplify administration and optimize traffic and resource utilization (lower amount of messages exchanged among same-area routers) o load-balancing o OSPF can make use of more outgoing links with the same (lowest) cost • so-called Equal-Cost MultiPath (ECMP) o CIDR/Variable Length Subnet Mask support o OSPF messages are encapsulated directly in IP datagrams (protocol number 89) OSPF handles its own error detection and correction functions o multicast is used for OSPF messages delivery (224.0.0.5 and 224.0.0.6 for IPv4, FF02::5 and FF02::6 for IPv6) Eva Hladka (FIMU) 4. Advanced Routing Mechanisms Autumn 2010 33 / 63 Link State Routing Protocols OSPF Protocol Open Shortest Path First (OSPF) III. Message Format I. 0 1 2 * 1 5 b 7 O]2.T-1Sci7<)1234567012315 ID ■tes) Checksum (2 bytes) Authentication Type (2 bvtes) Authentication (4 bvtes) Authentication (4 bytes) Figure: OSPF packet common header. OSPF messages: o Hello Packet o Database Description Packet o Link State Request Packet o Link State Update Packet o Link State Acknowledgement Packet Eva Hladka (FI MU) 4. Advanced Routing Mechanisms Autumn 2010 34 / 63 Link State Routing Protocols IS-IS Protocol Intermediate System To Intermediate System (IS-IS) I. o Intermediate System To Intermediate System (IS-IS) o standardized by the ISO as a mechanism for communication between network devices (termed Intermediate Systems) o developed at the same time as the OSPF originally designed for ISO-developed OSI Network Layer service called CLNS (Connectionless Network Service) o later extended to support routing of IP datagrams - called Integrated IS-IS or Dual IS-IS o RFC 1195 o key similarities with the OSPF: both protocols provide network hierarchy through two-level areas o both protocols use Hello packets to initially form adjacencies and then continue to maintain them o both protocols support variable length subnet masks o both protocols maintain a link state database and perform shortest path computation using the Dijkstra's algorithm 4. Advanced Routing Mechanisms Autumn 2010 35 / 63 Link State Routing Protocols IS-IS Protocol Intermediate System To Intermediate System (IS-IS) II. o key differences with the OSPF: o while OSPF packets are encapsulated in IP datagrams, IS-IS packets are encapsulated directly in link layer frames • IS-IS's run on top of layer 2 makes it relatively safer from spoofs or attacks IS-IS is neutral regarding the type of network addresses for which it can route o easily adapted to support IPv6 o OSPF needed a major overhaul (OSPFv3) in order to support IPv6 o IS-IS allows overload declaration - an overloaded router may not be considered in path computation • OSPF's link metric value is in the range 1 to 65, 535, while IS-IS's metric value is in the range 0 to 63 (narrow metric) o further extended to the range 0 to 16, 777, 215 (wide metric) □ OSPF provides a richer set of extensions and added features • IS-IS is less "chatty" and can scale to support larger networks 4. Advanced Routing Mechanisms Autumn 2010 36 / 63 Path Vector Routing Protocols BGP Protocol Lecture Overview I Hi! Routing: Recapitulation • Distributed Routing • Autonomous Systems r2| Distance Vector Routing Protocols • RIP protocol • IGRP protocol • EIGRP protocol • Comparison F3I Link State Routing Protocols a OSPF Protocol • IS-IS Protocol (4) Path Vector Routing Protocols o BGP Protocol Router Architectures Router Introduction IP Address Lookup Algorithms • IP Packet Filtering and Classification Eva Hladka (FIMU) 4. Advanced Routing Mechanisms Autumn 2010 37 / 63 Path Vector Routing Protocols BGP Protocol Border Gateway Protocol (BGP) I. Border Gateway Protocol (BGP) o currently version 4 (BGP-4) o RFC 1771 • proposed due to Internet's grow and demands on complex topologies support o supports redundant topologies, deals with loops/cycles, etc. o used to communicate information about networks currently residing in an autonomous system to other autonomous systems the exchange is done by setting up a communication session between bordering autonomous systems o the communication channel is set on top of the TCP protocol o the BGP relies on a fully reliable transport protocol o allows a definition of routing rules (policies) uses a hop count metric • uses CIDR for paths' aggregation 4. Advanced Routing Mechanisms Autumn 2010 38 / 63 Path Vector Routing Protocols BGP Protocol 4. Advanced Routing Mechanisms Autumn 2010 39 / 63 Path Vector Routing Protocols BGP Protocol Border Gateway Protocol (BGP) III. Advertisements o the BGP basis upon advertisements sent among BGP peers: o sent through reliable point-to-point communication channels o TCP, port 179 o an advertisement consists of: a destination network address (using CIDR notation) □ path attributes (e.g., the ASs on the path, next-hop router, etc.) o once paths are advertised to an AS, a routing policy takes place o a routing policy defines, which ASs are allowed to transit data through the particular AS, to which ASs the data are allowed to be forwarded, etc. o peering contracts are big bussiness (no standards exist) o if a routing policy is not defined, the shortest path is chosen 4. Advanced Routing Mechanisms Autumn 2010 40 / 63 Path Vector Routing Protocols BGP Protocol Border Gateway Protocol (BGP) III. Message Types o OPEN - initiates a BGP session between a pair of BGP routers o allows routers to introduce themselves and to announce their capabilities • includes router's authentication information o UPDATE used to advertise routing information from one BGP router to another ("push model") used to withdraw a previously announced advertisment o the advertised information is valid until being explicitly withdrawn! o KEEPALIVE o exchanged when there is no other traffic allows the BGP routers to distinguish between a failed connection and a BGP peer that has nothing to say NOTIFICATION - used to close a session or to report an error o e.g., rejecting an OPEN message or reporting a problem with UPDATE message • ROUTE-REFRESH - a specific request to re-advertise all of the routes in router's routing table using UPDATE messages • not defined in the original BGP-4 (RFC 1771), but added by RFC 2918 Eva Hladka (FI MU) 4. Advanced Routing Mechanisms Autumn 2010 41 / 63 Path Vector Routing Protocols BGP Protocol Border Gateway Protocol (BGP) IV. Routing table size Prefixes announced on the Internet 350000 300000 250000 » 200000 the prefixes in the forwarding table against which the destination address needs to be matched can be of arbitrary lengths 4. Advanced Routing Mechanisms Autumn 2010 55 / 63 Router Architectures IP Address Lookup Algorithms Address Lookup with CIDR - Longest Prefix Matching Requirements I. Lookup Speed o Internet traffic measurements show that roughly 50 % of the packets that arrive at a router are TCP-acknowledgment packets, which are typically 40-byte long o thus, the prefix lookup has to happen in the time it takes to forward such a minimum-size packet (40 bytes) o known as wire-speed forwarding o wire-speed forwarding for: □ 1 Gbps link == prefix lookup should not exceed 320nanosec o 10 Gbps link == prefix lookup should not exceed 32nanosec o 40 Gbps link == prefix lookup should not exceed 8 nanosec 1 Gbps computed as: 40 bytes X 8 bits/byte 1X109 bps = 320 nanosec 4. Advanced Routing Mechanisms Autumn 2010 56 / 63 Router Architectures IP Address Lookup Algorithms Address Lookup with CIDR - Longest Prefix Matching Requirements II. Memory Usage o i.e., the amount of memory consumed by the data structures of the algorithm o a memory-efficient algorithm can effectively use the fast but small cache memory Scalability algorithms are expected to scale both in speed and memory as the size of the forwarding table increases Updatability route changes occur fairly frequently o rates varying from a few prefixes per second to a few hundred prefixes per second o == the route changes require updating the forwarding table data structure in the order of milliseconds or less 4. Advanced Routing Mechanisms Autumn 2010 57 / 63 Router Architectures IP Address Lookup Algorithms Address Lookup with CIDR - Longest Prefix Matching Algorithms I. Naive Algorithms o the simplest algorithm for finding the best matching prefix is a linear search of prefixes o time complexity is O(N) o N ... number of prefixes in a forwarding table o useful if there are very few prefixes to search; otherwise the search time degrades as N becomes large Trie-based Algorithms • note: "trie" comes from "retrieval", not from "tree" o several variants proposed: o Binary Tries o Multibit Tries o Compressed Multibit Tries 4. Advanced Routing Mechanisms Autumn 2010 58 / 63 Router Architectures IP Address Lookup Algorithms Address Lookup with CIDR - Longest Prefix Matching Algorithms II. Figure: Binary trie data structure example. 4. Advanced Routing Mechanisms Autumn 2010 59 / 63 Router Architectures IP Address Lookup Algorithms Address Lookup with CIDR - Longest Prefix Matching Algorithms II. Other Approaches o Search by Length Algorithms o Search by Value Approaches o Hardware Algorithms o RAM-Based Lookup, Ternary CAM-Based Lookup, Multibit Tries in Hardware, etc. Further details: o Medhi, D. and Ramasamy, K.: Network Routing: Algorithms, Protocols, and Architectures. 4. Advanced Routing Mechanisms Autumn 2010 60 / 63 Router Architectures IP Packet Filtering and Classification IP Packet Filtering and Classification I. Importance of Packet Classification/Filtering: o Providing preferential treatment for different types of traffic o to provide different service guarantees for different types of traffic, an ISP might maintain different paths for the same source and destination addresses Flexibility in accounting and billing o an ISP needs flexible accounting and billing based on the traffic type o == different traffic can be charged at different prices o Preventing malicious attacks o the ability to identify malicious packets and drop them at the point of entry o etc. 4. Advanced Routing Mechanisms Autumn 2010 61 / 63 Router Architectures IP Packet Filtering and Classification IP Packet Filtering and Classification II. The criteria for classification are expressed in terms of rules or policies o using the header fields of the packets o == the forwarding engine needs to examine packet fields other than the destination address to identify the context of the packets o and to perform required processing/actions in order to satisfy user requirements o a collection of such rules/policies - rule/policy database, flow classifier or simply classifier o each rule specifies: o a flow to which a packet may belong (based on expressed conditions) □ exact match, prefix match, range match, regular expression match, etc. o an action which has to be applied to packets belonging to the flow like permit, deny, encrypt, etc. o a packet may match more than one rule in the classifier a cost is associated with each rule to determine an unambiguous match • == the goal is to find the rule with the least cost that matches a packet's header o when the rules are placed in the order based on their cost — the goal is to find the earliest matching rule Eva Hladka (FIMU) 4. Advanced Routing Mechanisms Autumn 2010 62 / 63 Router Architectures IP Packet Filtering and Classification IP Packet Filtering and Classification Algorithms o Naive Algorithms storing the rules in a linked list in the order of increasing cost o storage efficient, but seach-time inefficient (does not scale) o Two-dimensional Solutions Hierarchical Tries, Set Pruning Tries, Grid-of-Tries d -dimensional Solutions o Divide and Conquer Approaches o Lucent Bit Vector, Aggregated Bit Vector, Cross-Producting, Recursive Flow Classification Tuple Space Approaches Decision Tree Approaches o Hierarchical Intelligent Cuttings (HiCuts), HyperCuts, Hardware-Based Solutions Ternary Content Addressable Memory (TCAM) Further details: Medhi, D. and Ramasamy, K.: Network Routing: Algorithms, Protocols, and Architectures. Eva Hladka (FIMU) 4. Advanced Routing Mechanisms Autumn 2010 63 / 63