Computer Networks Lecture 4.2 PDF
Document Details
Uploaded by EngrossingCornflower
Alexandria University
2024
Sahar M. Ghanem
Tags
Summary
This document is a lecture on Computer Networks, specifically focusing on the Network Layer: Control Plane. It covers topics such as routing algorithms, OSPF and BGP protocols, SDN control, ICMP, and network management.
Full Transcript
Computer Networks The Network Layer: Control Plane Prof. Dr. Sahar M. Ghanem Associate Professor Computer and Systems Engineering Department Faculty of Engineering, Alexandria University Outline Introduction Routing Algorithms Intra-AS Routing in the...
Computer Networks The Network Layer: Control Plane Prof. Dr. Sahar M. Ghanem Associate Professor Computer and Systems Engineering Department Faculty of Engineering, Alexandria University Outline Introduction Routing Algorithms Intra-AS Routing in the Internet: OSPF Routing Among the ISPs: BGP The SDN Control Plane ICMP: The Internet Control Message Protocol Network Management and SNMP, NETCONF/YANG Computer Networks, 2024 (c) Dr. Sahar M. Ghanem 2 Introduction Computer Networks, 2024 (c) Dr. Sahar M. Ghanem 3 The control plane (1/2) The control plane is the network-wide logic that controls: how a datagram is routed along an end-to-end path from the source host to the destination host, how network-layer components and services are configured and managed. Computer Networks, 2024 (c) Dr. Sahar M. Ghanem 4 The control plane (2/2) Two possible approaches for how the forwarding and flow tables are computed, maintained and installed: Per-router control: a routing algorithm runs in each and every router, e.g. OSPF and BGP protocols. Logically centralized control / Software Defined Network (SDN): a logically centralized controller computes and distributes the forwarding tables to be used by each and every router. Generalized match-plus-action abstraction. The controller interacts with a control agent (CA) in each of the routers. Computer Networks, 2024 (c) Dr. Sahar M. Ghanem 5 Computer Networks, 2024 (c) Dr. Sahar M. Ghanem 6 Computer Networks, 2024 (c) Dr. Sahar M. Ghanem 7 Routing Algorithms Computer Networks, 2024 (c) Dr. Sahar M. Ghanem 8 Routing Algorithms The goal of routing algorithms is to determine good paths (i.e. routes), from senders to receivers through the network of routers. Typically, a “good” path is one that has the least cost. In practice, real- world concerns such as policy issues also come into play. A graph is used to formulate routing problems. A graph 𝐺 = (𝑁, 𝐸) is a set 𝑁 of nodes and a collection 𝐸 of edges, where each edge is a pair of nodes from 𝑁. The nodes represent routers and the edges connecting these nodes represent the physical links between these routers. Nodes also can represent networks, and the edge connecting two such nodes represents direction connectivity (know as peering). Computer Networks, 2024 (c) Dr. Sahar M. Ghanem 9 Routing Algorithms: notation (1/2) An edge also has a value representing its cost the physical length, the link speed, or the monetary cost. Any edge (𝑥, 𝑦) in 𝐸, 𝒄(𝒙, 𝒚) denotes its cost. If (𝑥, 𝑦) does not belong to 𝐸, we set 𝒄(𝒙, 𝒚) = ∞. For undirected graph 𝒄(𝒙, 𝒚) = 𝒄(𝒚, 𝒙). A node 𝑦 is said to be a neighbor of node 𝑥 if (𝑥, 𝑦) belongs to 𝐸. Computer Networks, 2024 (c) Dr. Sahar M. Ghanem 10 Routing Algorithms: notation (2/2) A path in the is a sequence of nodes (𝑥1 , 𝑥2 , … , 𝑥𝑝 ) such that each of the pairs 𝑥1 , 𝑥2 , 𝑥2 , 𝑥3 , … , (𝑥𝑝−1 , 𝑥𝑝 ) are edges in 𝐸. The cost of a path is the sum of all the edge costs along the path 𝑐 𝑥1 , 𝑥2 + 𝑐 𝑥2 , 𝑥3 + ⋯ + 𝑐 𝑥𝑝−1 , 𝑥𝑝 The least-cost problem is to find a path between the source and destination that has least cost. If all edges in the graph have the same cost, the least cost path is also the shortest path. Computer Networks, 2024 (c) Dr. Sahar M. Ghanem 11 Computer Networks, 2024 (c) Dr. Sahar M. Ghanem 12 Routing Algorithms Classification (1/3) A centralized routing algorithm computes the least-cost path between a source and destination using complete, global knowledge about the network. Referred to as link-state (LS) algorithms, since the algorithm must be aware of the cost of each link in the network. A decentralized routing algorithm calculation of the least-cost path is carried out in an iterative, distributed manner by the routers. For example, a decentralized routing algorithm is called a distance-vector (DV) algorithm. Computer Networks, 2024 (c) Dr. Sahar M. Ghanem 13 Routing Algorithms Classification (2/3) A second broad way to classify routing algorithms is according to whether they are static or dynamic. In static routing algorithms, routes change very slowly over time, often as a result of human intervention. Dynamic routing algorithms change the routing paths as the network traffic loads or topology change. The algorithm can be run either periodically or in direct response to topology or link cost changes. More responsive to network changes but also more susceptible to problems such as routing loops and route oscillation. Computer Networks, 2024 (c) Dr. Sahar M. Ghanem 14 Routing Algorithms Classification (3/3) A third way to classify routing algorithms is according to whether they are load sensitive or load-insensitive. Today’s Internet routing algorithms (such as RIP, OSPF, and BGP) are load-insensitive, as a link’s cost does not explicitly reflect its current (or recent past) level of congestion. Computer Networks, 2024 (c) Dr. Sahar M. Ghanem 15 The Link-State (LS) Routing Algorithm Each node broadcast link-state packets containing the identities and costs of its attached links using a link-state broadcast algorithm. All nodes have an identical and complete view of the network. Each node can then run the LS algorithm and compute the same set of least-cost paths as every other node. Dijkstra’s algorithm computes the least-cost path from one node (the source, which we will refer to as 𝒖) to all other nodes in the network. The total number of nodes we need to search through over all the iterations is 𝑛(𝑛 + 1)/2. The worst-case complexity of order 𝑂(𝑛2 ). Computer Networks, 2024 (c) Dr. Sahar M. Ghanem 16 Link State Algorithm: notation 𝑫(𝒗): cost of the least-cost path from the source node to destination 𝑣 as of this iteration of the algorithm. 𝒑(𝒗): previous node (neighbor of 𝑣) along the current least-cost path from the source to 𝑣. 𝑵′: subset of nodes; 𝑣 is in 𝑁′ if the least-cost path from the source to 𝑣 is definitively known. The centralized routing algorithm consists of an initialization step followed by a loop. The number of times the loop is executed is equal to the number of nodes in the network. Upon termination, the algorithm will have calculated the shortest paths from the source node 𝒖 to every other node in the network. Computer Networks, 2024 (c) Dr. Sahar M. Ghanem 17 Computer Networks, 2024 (c) Dr. Sahar M. Ghanem 18 Computer Networks, 2024 (c) Dr. Sahar M. Ghanem 19 Computer Networks, 2024 (c) Dr. Sahar M. Ghanem 20 Oscillations Oscillations can occur in any algorithm that uses a congestion or delay- based link metric. Consider a network topology where link costs are equal to the load carried on the link, for example, reflecting the delay that would be experienced. For example, link costs are not symmetric and corresponds to the amount of traffic carried. One solution would be to mandate that link costs not depend on the amount of traffic carried, which is an unacceptable solution. Another solution is to ensure that not all routers run the LS algorithm at the same time. One way to avoid self-synchronization is for each router to randomize the time it sends out a link advertisement. Computer Networks, 2024 (c) Dr. Sahar M. Ghanem 21 Computer Networks, 2024 (c) Dr. Sahar M. Ghanem 22 The Distance-Vector (DV) Routing Algorithm The distance vector (DV) algorithm is iterative, asynchronous, and distributed. It is distributed in that each node receives some information from one or more of its directly attached neighbors, performs a calculation, and then distributes the results of its calculation back to its neighbors. It is iterative in that this process continues on until no more information is exchanged between neighbors. The algorithm is asynchronous in that it does not require all of the nodes to operate in lockstep with each other. Computer Networks, 2024 (c) Dr. Sahar M. Ghanem 23 Bellman-Ford equation Let 𝑑𝑥 (𝑦) be the cost of the least-cost path from node 𝑥 to node 𝑦. Bellman-Ford equation:𝒅𝒙 (𝒚) = 𝒎𝒊𝒏𝒗 {𝒄(𝒙, 𝒗) + 𝒅𝒗 ( 𝒚)}; where 𝑚𝑖𝑛𝑣 is taken over all of 𝑥’s neighbors. The solution to the Bellman-Ford equation provides the entries in node 𝑥’s forwarding table. It also suggests the form of the neighbor-to-neighbor communication that will take place in the DV algorithm. Computer Networks, 2024 (c) Dr. Sahar M. Ghanem 24 Distance Vector: Example The source node u has three neighbors: nodes 𝑣, 𝑥, and 𝑤. 𝑑𝑣 (𝑧) = 5, 𝑑𝑥 (𝑧) = 3, and 𝑑𝑤 (𝑧) = 3 𝑐(𝑢, 𝑣) = 2, 𝑐(𝑢, 𝑥) = 1, and 𝑐(𝑢, 𝑤) = 5 𝑑𝑢 (𝑧) = min{ 2 + 5, 1 + 3, 5 + 3} = 4 Computer Networks, 2024 (c) Dr. Sahar M. Ghanem 25 Distance Vector Algorithm Each node 𝑥 begins with 𝑫𝒙 (𝒚), for all nodes, 𝑦, in 𝑁. Let node 𝑥’s distance vector be 𝑫𝒙 = [𝐷𝑦 (𝑦): 𝑦 𝑖𝑛 𝑁] , which is the vector of cost estimates from 𝑥 to all other nodes, 𝑦, in 𝑁. Each node 𝑥 maintains the following routing information: For each neighbor 𝑣, the cost 𝒄(𝒙, 𝒗) 𝑫𝒙 = [𝐷𝑦 (𝑦): 𝑦 𝑖𝑛 𝑁] 𝑫𝒗 = [𝐷𝑦 : 𝑦 𝑖𝑛 𝑁] for each neighbor 𝑣 From time to time, each node sends a copy of its distance vector to each of its neighbors. Computer Networks, 2024 (c) Dr. Sahar M. Ghanem 26 Computer Networks, 2024 (c) Dr. Sahar M. Ghanem 27 Distance Vector Updates A node 𝑥 updates its distance-vector estimate when it either sees a cost change in one of its directly attached links or receives a distance- vector update from some neighbor. For each destination 𝑦, node 𝑥 also determines 𝑣 ∗ (𝑦) and updates its forwarding table for destination 𝑦, where 𝑣 ∗ (𝑦) that is the next-hop router along the shortest path to 𝑦. Computer Networks, 2024 (c) Dr. Sahar M. Ghanem 28 Distance Vector: Example Each node’s routing table includes its own distance vector and that of each of its neighbors. 𝑫𝒙 = [𝐷𝑥 (𝑥), 𝐷𝑥 (𝑦), 𝐷𝑥 (𝑧)] = [0, 2, 7]; node 𝑥 sends its distance vector 𝑫𝒙 = [0, 2, 7] to both nodes 𝑦 and 𝑧. 𝐷𝑥 (𝑥) = 0 𝐷𝑥 𝑦 = min 𝑐 𝑥, 𝑦 + 𝐷𝑦 𝑦 , 𝑐 𝑥, 𝑧 + 𝐷𝑧 𝑦 = min{2 + 0, 7 + 1} = 2 𝐷𝑥 𝑧 = min 𝑐 𝑥, 𝑦 + 𝐷𝑦 𝑧 , 𝑐 𝑥, 𝑧 + 𝐷𝑧 𝑧 = min{2 + 1, 7 + 0} = 3 At node 𝑥, 𝑣 ∗ (𝑦) = 𝑦 and 𝑣 ∗ (𝑧) = 𝑦. Computer Networks, 2024 (c) Dr. Sahar M. Ghanem 29 Computer Networks, 2024 (c) Dr. Sahar M. Ghanem 30 DV: link cost changes and link failure Example: the link cost from 𝑦 to 𝑥 changes from 4 to 1. At time 𝒕𝟎 , 𝑦 detects the link-cost change, updates its distance vector, and informs its neighbors. At time 𝒕𝟏 , 𝑧 receives the update from 𝑦 and updates its table. It computes a new least cost to 𝑥 and sends its new distance vector to its neighbors. At time 𝒕𝟐 , 𝑦 receives 𝑧’s update and updates its distance table. 𝑦’s least costs do not change and hence 𝑦 does not send any message to 𝑧. The algorithm comes to a quiescent state. Computer Networks, 2024 (c) Dr. Sahar M. Ghanem 31 Computer Networks, 2024 (c) Dr. Sahar M. Ghanem 32 DV: count-to-infinity problem Example: the link cost between 𝑥 and 𝑦 increases from 4 to 60. 𝐷𝑦 (𝑥) = 4, 𝐷𝑦 (𝑧) = 1, 𝐷𝑧 (𝑦) = 1, 𝑎𝑛𝑑 𝐷𝑧 (𝑥) = 5. At time 𝒕𝟎 , 𝑦 detects the link-cost change and computes its new minimum-cost path to 𝑥 to have a cost of 6 (via 𝑧 and is wrong). As of 𝒕𝟏 we have a routing loop! Sometime after 𝒕𝟏 , 𝑧 receives 𝑦’s new distance vector and computes a new least cost to 𝑥 of 𝐷𝑧 (𝑥) = min{50 + 0,1 + 6} = 7. In a similar manner, after receiving 𝑧’s new distance vector, 𝑦 determines 𝐷𝑦 (𝑥) = 8 and sends 𝑧 its distance vector. 𝑧 then determines 𝐷𝑧 (𝑥) = 9 and sends 𝑦 its distance vector, and so on. Computer Networks, 2024 (c) Dr. Sahar M. Ghanem 33 DV: Adding Poisoned Reverse Poisoned reverse solves the looping problem. If 𝑧 routes through 𝑦 to get to destination 𝑥, then 𝑧 will advertise to 𝑦 that its distance to 𝑥 is infinity, that is, 𝑧 will advertise to 𝑦 that 𝐷𝑧 (𝑥) = ∞. Does poisoned reverse solve the general count-to-infinity problem? It does not! Loops involving three or more nodes will not be detected by the poisoned reverse technique. Computer Networks, 2024 (c) Dr. Sahar M. Ghanem 34 Link State vs. Distance Vector (1/2) Message complexity LS requires each node to know the cost of each link in the network. This requires 𝑂(|𝑁| |𝐸|) messages to be sent. The DV algorithm requires message exchanges between directly connected neighbors at each iteration. Speed of convergence The DV algorithm can converge slowly and can have routing loops while the algorithm is converging. DV also suffers from the count-to- infinity problem. Computer Networks, 2024 (c) Dr. Sahar M. Ghanem 35 Link State vs. Distance Vector (2/2) Robustness: What can happen if a router fails, misbehaves, or is sabotaged? Route calculations are somewhat separated under LS, providing a degree of robustness. An incorrect node calculation can be diffused through the entire network under DV. Computer Networks, 2024 (c) Dr. Sahar M. Ghanem 36 Intra-AS Routing in the Internet: OSPF Computer Networks, 2024 (c) Dr. Sahar M. Ghanem 37 Autonomous Systems The view of a homogenous set of routers all executing the same routing algorithm is simplistic for two important reasons: Scale. As the number of routers becomes large (hundreds of millions of routers), the overhead involved in communicating, computing, and storing routing information becomes prohibitive. Administrative autonomy. An ISP desires to operate its network as it pleases or to hide aspects of its network’s internal organization from the outside. Both of these problems can be solved by organizing routers into autonomous systems (ASs), with each AS consisting of a group of routers that are under the same administrative control. Computer Networks, 2024 (c) Dr. Sahar M. Ghanem 38 Intra-AS routing protocol Some tier-1 ISPs use one gigantic AS for their entire network, whereas others break up their ISP into tens of interconnected ASs. An autonomous system is identified by its globally unique autonomous system number (ASN) assigned by ICANN. Routers within the same AS all run the same routing algorithm and have information about each other. The routing algorithm running within an autonomous system is called an intra-autonomous system routing protocol. Open Shortest Path First (OSPF) routing is widely used for intra-AS routing in the Internet. Computer Networks, 2024 (c) Dr. Sahar M. Ghanem 39 OSPF (1/2) OSPF is a link-state protocol that uses flooding of link-state information and a Dijkstra’s least-cost path algorithm. Individual link costs are configured by the network administrator. The administrator might choose to set all link costs to 1 (i.e. minimum-hop routing). The administrator might set the link weights to be inversely proportional to link capacity. A router broadcasts link-state information whenever there is a change in a link’s state. It also broadcasts a link’s state periodically (at least once every 30 minutes), even if the link’s state has not changed.(adds robustness) Computer Networks, 2024 (c) Dr. Sahar M. Ghanem 40 OSPF (2/2) OSPF advertisements are contained in OSPF messages carried directly by IP, with an upper-layer protocol of 89 for OSPF. The OSPF protocol also checks that links are operational via a HELLO message that is sent to an attached neighbor. It also allows an OSPF router to obtain a neighboring router’s database of network-wide link state. Computer Networks, 2024 (c) Dr. Sahar M. Ghanem 41 OSPF Security Exchanges between OSPF routers can be authenticated. Two types of authentication can be configured—simple and MD5. With simple authentication, the same password is configured on each router. When a router sends an OSPF packet, it includes the password in plaintext. MD5 authentication is based on shared secret keys that are configured in all the routers. For each OSPF packet that it sends, the router computes the MD5 hash of the content of the OSPF packet appended with the secret key. Then the router includes the resulting hash value in the OSPF packet. Computer Networks, 2024 (c) Dr. Sahar M. Ghanem 42 OSPF Advances Multiple same-cost paths: a single path need not be chosen for carrying all traffic when multiple equal-cost paths exist. Integrated support for unicast and multicast routing: Multicast OSPF (MOSPF). Computer Networks, 2024 (c) Dr. Sahar M. Ghanem 43 Hierarchy within a single AS An OSPF AS can be configured hierarchically into areas. Each area runs its own OSPF link-state routing algorithm. Within each area, one or more area border routers are responsible for routing packets outside the area. Exactly one OSPF area in the AS is configured to be the backbone area that contains all area border routers in the AS and may contain non-border routers as well. Inter-area routing within the AS requires that the packet be first routed to an area border router (intra-area routing), then routed through the backbone to the area border router that is in the destination area, and then routed to the final destination. Computer Networks, 2024 (c) Dr. Sahar M. Ghanem 44