"Computer Networks: Top-Down Approach" Study Notes - Chapter 5 Network Layer: Control Plane

As a network-wide logic, the control plane not only controls how routers forward datagrams along the end-to-end path from source host to destination host , but also controls how network layer components and services are configured and managed.

5.1 Overview

Forwarding tables (in the case of destination-based forwarding) and flow tables (in the case of universal forwarding) are the primary elements linking the data plane and control plane of the network layer.

How are forwarding tables and flow tables calculated, maintained, and installed?

  • Per-router control : each router has a routing component that communicates with routing components in other routers to compute the value of its forwarding table
  • Logical centralized control : Logical centralized controller computes and distributes forwarding tables for use by each router

The controller interacts with a control agent (CA) in each router via a well-defined protocol to configure and manage the router's forwarding tables

5.2 Routing Algorithm

Purpose: To determine a good path through the router network from the sender to the receiver (equivalent to routing).

  • Better path : A path with a smaller index
  • Indicators : number of stations, delay, cost, queue length, etc., or the weighted average of some simple indicators

Routing algorithm : a part of the network layer software that completes the routing function

Graph abstraction for networks

Figure: G = (N,E)

  • N = set of routers = { u, v, w, x, y, z }

  • E = rail set ={ (u,v), (u,x), (v,x), (v,w), (x,w), (x,y), (w,y), ( w,z), (y,z)}

  • side has a price

  • c(x,x') = link cost(x,x')

  • If (x, y) belongs to E, node y is also called a neighbor of node x

The input of routing : topology, cost of edge, source node

The output of the route : the collection tree of the source node

A path (path) in graph G = (N, E) is a sequence of nodes (x 1 , x 2 , ... , x p ), and the cost is the sum of the cost of all edges along the path, namely c(x 1 , x 2 )+c(x 2 , x 3 )+…+c(x p-1 , x p ), the lowest cost path is also the shortest path , that is, the path with the least number of links between the source and the destination .

Principles of Routing Algorithms

  • Correctness : Algorithms must be correct and complete
  • Simplicity : Algorithms should be simple on a computer
  • Robustness : Algorithms should be able to adapt to changes in traffic and network topology
  • Stability : Generated routes should not wobble
  • Fairness : fair to every site
  • Optimality : the optimality of a certain indicator

Classification of Routing Algorithms

  • Centralized routing algorithm : use complete, global network knowledge to calculate the lowest cost path from source to destination. The algorithm takes the connectivity between all nodes and the cost of all links as input. Algorithms with global state information are often called link state (Link State, LS ) algorithms, because the algorithm must know the cost of each link in the network.
  • Decentralized routing algorithm : The router calculates the least cost path in an iterative, distributed manner. Each node starts working with only knowledge of the cost of its directly connected links. The Distance -Vector ( DV ) algorithm is a decentralized routing algorithm in which each node maintains a vector of cost (distance) estimates to all other nodes in the network.
  • Static routing algorithm : routing changes very slowly over time, and is usually adjusted manually (such as manually editing a link cost)
  • Dynamic routing algorithm : Change the routing path as the network traffic load or topology changes.
  • Load Sensitive Algorithm : The link overhead will change dynamically to reflect the current congestion level of the underlying link.
  • Load-sluggish algorithm : because the cost of a link does not explicitly reflect its current (or recent) congestion level

5.2.1 Link state routing algorithm

In link state algorithms, the network topology and all link costs are known . In reality, it is done by letting each node broadcast link state packets to all other nodes in the network, where each link state packet contains the identification and cost of the link it is connected to, which is often completed by the link state broadcast algorithm . The result is that all nodes have a unified, complete view of the network.

The link-state routing algorithm in , called Dijkstra's algorithm , computes the lowest-cost paths from a node (the source node, let's call it u) to all other nodes in the network. Through k iterations , the lowest cost paths to k destination nodes can be known. Define the following tokens

  • D(v): To this iteration of the algorithm, from the source node to the destination node. The cost of the least cost path
  • p(v) previous node along the current lowest cost path from source to v
  • N': subset of nodes; if from source to. The lowest cost path of is known, n in N'

When the LS algorithm terminates, for each node we get the previous node along its lowest cost path from the source node. For each previous node, we have its previous nodes, in this way we can construct the complete path from source node to all destination nodes.

What is the computational complexity of this algorithm?

In the first iteration, we need to search all n nodes, in the second iteration, we need to check n-1 nodes, and in the third iteration for n-2 nodes, the nodes that need to be searched in all iterations With a total of n(n+1)/2, the link-state algorithm has worst-case complexity O(n 2 )

5.2.2 Distance Vector Routing Algorithm

The distance vector algorithm is an iterative, asynchronous and distributed algorithm, while the LS algorithm is an algorithm that uses global information.

  • Distributed : each node receives some information from one or more directly connected neighbors, performs computations, and then distributes the results of its computations to its neighbors
  • Iteration : This process continues until there is no more information to exchange between neighbors
  • Asynchronous : all nodes are not required to operate in lockstep with each other

Let d x (y) be the cost of the lowest cost path from node x to node y. Then the minimum overhead is related to the well-known Bellman-Ford equation, namely
dx ( y ) = minv { c ( x , y ) + dv ( y ) } d_x(y)= min_v\lbrace c(x,y)+d_v( y)\rbracedx(y)=minv{ c(x,y)+dv(y)}

example:

Core ideas:

  • Each node transmits its own distance vector estimate to its neighbors, and when the timing or DV changes, let the other party calculate
  • When x receives a DV from a neighbor, it does its own calculation and updates its own distance vector
  • The estimated value of D x (y) eventually converges to the actual minimum cost value d x (y)

What each node does:

Features of DV

Good news travels fast, bad news travels slowly

  • Good news: Good news spreads at the speed of advancing one router per exchange cycle, such as a router accessing or having a shorter path

  • Bad news travels very slowly

    for example:

A solution to the slow transmission of bad news: the split horizon algorithm

But the split-horizon algorithm fails in some topological forms (there are loops )

Comparison of LS and DV Algorithms

  • Message complexity (DV wins)
    • LS: There are n nodes, E links, sending O(nE) messages, global propagation
    • DV: Only exchange information with neighbors, local dissemination
  • Convergence time (LS wins)
    • LS: O(n 2 ) algorithm, may oscillate
    • DV: Convergence is slow, there may be routing loops
  • Robustness : what happens when a router fails (LS wins)
    • LS: Nodes advertise incorrect link costs. Each node only calculates its own routing table. Error messages have less impact, are localized, and the routing is more robust.
    • DV: DV nodes may advertise incorrect path costs to all nodes in the entire network. Each node's routing table may be used by other nodes

5.3 Routing within an Autonomous System in the Internet: OSPF

Autonomous System (AS)

Open Shortest Path First (OSPF):

  • Use the LS algorithm
    • LS packets are distributed across the network (within an AS)
    • The global network topology and cost are maintained in each node
    • Routing calculation using Dijkstra algorithm
  • OSPF advertisement information carries: one entry for each neighboring router
  • The notification information will be spread throughout the AS (by flooding)

characteristic:

  • Security : All OSPF packets are authenticated
  • Multiple paths with the same cost are allowed
  • For each link, there are multiple cost matrices for different TOS
  • Integrated support for unicast and multicast
  • Hierarchical OSPF support in large networks

5.4 Routing between ISPs : BGP

Hierarchical Routing: Divide the Internet into ASs (Router Areas)

Routing becomes: 2 levels of routing

  • **AS internal routing: **Routers in the same AS run the same routing protocol
  • Running inter-AS routing protocol between AS

Advantages of Hierarchical Routing

  • Solved the scale problem
  • management problem solved

In the Internet, all ASs run the same inter-AS routing protocol, called the Border Gateway Protocol (Broder Gateway Protocol, BGP ), which glues thousands of ISPs together in the Internet. BGP is a distributed and asynchronous protocol

5.4.1 The role of BGP

For destinations located in the same AS, the entries in the router's forwarding table are determined by the AS internal routing protocol . And what about destinations located outside the AS? This is where BGP comes in.

A router's forwarding table will have entries of the form (x,I), where x is a prefix (eg 138.16.68/22) and I is the interface number of one of the router's interfaces .

  • Obtain the reachability information of the prefix from the neighbor AS . BGP allows each subnet to advertise its existence to the rest of the Internet

  • Determine the "best" route to that prefix . To determine the best route, the router will locally run a BGP route selection process

  • eBGP : Obtain subnet reachability information from adjacent ASes, spanning BGP connections between two ASs

  • iBGP : Spread the obtained subnet reachability information to all routers inside the AS, and BGP sessions between two routers in the same AS

5.4.2 Advertise BGP routing information

The following network has 3 autonomous systems AS1, AS2 and AS3

BGP session : In BGP, each pair of routers exchanges routing information over a semi-permanent TCP connection using port 179.

Propagate reachability information, using iBGP and eBGP sessions

  1. Gateway router 3a first sends an eBGP message "AS3 x" to gateway router 2c
  2. Gateway router 2c then sends iBGP packet "AS3 x" to all other routers in AS2 (including gateway router 2a)
  3. Gateway router 2a then sends an eBGP message "AS2 AS3 x" to gateway router 1c
  4. Gateway router 1c uses iBGP to send a message "AS2 AS3 x" to all routers in AS1
  5. After this process is complete, each router in AS1 and AS2 knows that x exists and also knows the AS path to x

There may be several different paths from a given router to a given destination, each passing through a different sequence of ASs. In the above case, there are two paths from AS1 to x: the path "AS2 AS3 x" via Router 1c; and the new path "AS3 x" via Router 1c.

5.4.3 Determining the best route

When a router advertises a prefix over a BGP connection, it includes some BGP attributes in the prefix

A prefix and its attributes are called a route . Two more important attributes are AS-PATH and NEXT HOP

  • The AS-PATH attribute contains the list of ASs through which the advertisement has been passed. BGP routers also use the AS-PATH attribute to detect and prevent advertisement loops. If a router sees its own AS included in the route list, it will reject the advertisement
  • The NEXT PATH attribute provides the critical link between inter-AS and intra-AS routing protocols. NEXT HOP is the IP address of the router interface where AS PATH starts

1. Hot Potato Routing

Steps for adding AS outgoing prefixes in Hot Potato routing.

Hot potato routing is based on the idea that, for router 1b, to get the packet out of its AS as quickly as possible (more specifically, with the lowest possible cost ), without worrying about the cost of the rest of its AS to the destination.

2. Router Selection Algorithm

If there are two or more routes to the same prefix, the following elimination rules are invoked sequentially until one route remains

  1. A route is assigned a local preference value as one of its attributes (except AS PATH and NEXT-HOP )
  2. From the remaining routes (all with the same highest local preference value), the route with the shortest AS PATH will be chosen.
  3. From the remaining routes (all with the same highest local preference value and the same AS-PATH length), use hot potato routing, i.e. choose the route with the closest NEXT-HOP router
  4. If there are still multiple routes left, the router uses the BGP identifier to choose the route

5.4.4 IP Anycast

BGP is also often used to implement IP anycast (anycast) service, which is usually used in DNS

  • A CDN company assigns its multiple servers the same IP address and advertises that IP address from each of those servers using standard BGP. When a BGP router receives multiple route advertisements for the IP address, it treats these advertisements as providing different paths to the same physical location.

  • When configuring its routing table, each router will locally use the BGP routing algorithm to pick the "best" (eg, closest, as determined by AS hop count) route to that IP address

  • After this initial BGP address advertisement phase, the CDN is able to proceed with its main task of distributing content.

  • When the client wants to send a request to that IP address, the Internet router forwards the request packet to the "nearest" server, as defined by the BGP routing algorithm

In practice CDNs usually choose not to use IP anycast, which is widely used by DNS systems to direct DNS requests to the nearest root DNS server

5.4.5 Routing Policy

In the route selection algorithm, in fact, the route is firstly selected according to the local preference attribute , and the local preference value is determined by the local AS policy .

example:

[External link image transfer failed, the source site may have an anti-leeching mechanism, it is recommended to save the image and upload it directly (img-cw3TldXO-1679193844693) (C:\Users\86159\AppData\Roaming\Typora\typora-user-images\ 1676111345769.png)]

W, X, and Y are the access ISPs, while A, B, and C are the backbone provider networks.

Assume an ISP only wants to route traffic to/ from its customer network (does not want to carry traffic between other ISPs, i.e. does not advertise: not to nor from my customers)

  • A advertises the path Aw to B and C

  • B chooses not to announce BAw to C :

    • B cannot obtain income from the route of CBAw, because C, A, and w are not customers of B
    • C thus cannot know the existence of the CBAw path: the network perceived by each ISP is inconsistent with the real one
  • C may eventually route to w via CAw (instead of using B)

  • X is a dual access, multi-homed stub network, connected to 2 networks

  • Policy forces X: X does not want to route packets from B through X to C, so X does not advertise to B that it can actually be routed to C

5.5 SDN Control Plane

Traditional way : per-router (Per-router) control plane

Individual router algorithm elements in each router , interacting at the control plane

SDN approach : logically centralized control plane

A different (usually remote) controller interacts with local Control Agents (CAs)

SDN architecture has 4 key characteristics

  • Flow-based forwarding . The packet forwarding work of the switch controlled by SDN can be performed based on any number of header field values ​​in the transport layer, network layer or link layer header.
  • The data plane is separated from the control plane . The data plane consists of network switches, which are relatively simple (but fast) devices that enforce "match plus action" rules in their flow tables. The control plane consists of servers and software that decides and manages the switch flow tables
  • Network control functions: located outside the data plane switch .
  • Programmable network . The network is programmable through network control applications running in the control plane.

5.5.1 SDN Control Plane: SDN Controller and SDN Network Control Application

The SDN control plane is roughly divided into two parts, namely the SDN controller and the SDN network control application .

The functions of the controller can be roughly organized into three levels

  • Communication layer: communication between SDN controller and controlled network devices .
  • Network-wide state management layer
  • Interface to the network control application layer . The controller interacts with the network control application through its "northbound" interface.

5.5.2 OpenFlow protocol

The OpenFlow protocol runs between the SDN controller and the SDN-controlled switch or other devices that implement the OpenFlow API. The protocol runs on top of TCP , using the default port number of 6653

The important messages flowing from the controller to the controlled switch are as follows

  • Configuration : This message allows the controller to query and set the configuration parameters of the switch
  • Modify state : This message is used by the controller to add/delete or modify entries in the switch flow table and set switch port characteristics.
  • Read Status : This message is used by the controller to collect statistics and counter values ​​from the switch's flow table and ports.
  • Send packet : This message is used by the controller to send a specific message from a specific port on the controlled switch

The important messages flowing from the controlled switch to the controller are as follows:

  • Packet In : Passes the packet (and its control) to the controller, see packet-out message from the controller
  • Flow removal : delete flow entries on the switch
  • Port Status : Notifies the controller of port changes

Network administrators do not need to program switches directly by creating/sending flow tables, but use the app on the controller to automatically calculate and configure

5.5.3 Example of Data Plane and Control Plane Interaction

insert image description here

  1. S1, experienced a link failure, using the OpenFlow message to notify the controller: port status message
  2. The SDN controller receives the OpenFlow message and updates the link state information
  3. The Dijkstra routing algorithm application is invoked (this status change message was previously registered)
  4. The Dijkstra routing algorithm accesses the network topology information in the controller, and the link state information calculates new routes
  5. The link state routing app interacts with the flow table calculation element in the SDN controller to calculate the new required flow table
  6. The controller uses OpenFlow to install a new flow table on the switch that needs to be updated

5.6 ICMP: Internet Control Message Protocol

Internet Control Message Protocol (ICMP) , used by hosts and routers to communicate with each other at the network layer.

ICMP is usually considered a part of IP , but it is on top of IP in terms of architecture, because ICMP messages are carried in IP packets.

ICMP messages are carried as IP payloads

The ICMP message has a type field and an encoding field , and contains the header and the first 8 bytes of the IP datagram that caused the ICMP message to be generated for the first time (so that the sender can determine the datagram that caused the error)

Traceroute program

This program allows us to trace the route from one host to any host in the world. Traceroute is implemented using ICMP packets

To determine the names and addresses of all routers between the source and destination, Traceroute in the source host sends a series of ordinary IP datagrams to the destination host

Each of these datagrams carries a UDP segment with an unreachable UDP port number.

  • First one: TTL=1
  • The second one: TTL=2, etc.
  • The source host also starts a timer for each datagram

When the nth datagram arrives at the nth router, the nth router observes that the TTL of the datagram has just expired

  • The router discards the datagram
  • Then send an ICMP message (type 11, code 0) to the source
  • The message includes the name and IP address of the router

When the ICMP message arrives, the source calculates the RTT

Criteria for stopping:

  • The UDP segment finally reaches the destination host
  • The target returns an ICMP "port unreachable" message (type 3, code 3) to the source host
  • When the source host gets this message, stop

5. 7 Network management and SNMP

What is network management?

Network management includes the setup, integration and coordination of hardware, software and human elements to monitor, test, poll, configure, analyze, evaluate and control network and network element resources to meet real-time, operational performance and service requirements at a reasonable cost quality requirements

5.7.1 Network management framework

  • A management server is an application, usually with human participation, that runs on a centralized network management workstation in a network operations center (NOC).
  • A managed device is a piece of network equipment (including its software) that resides on a managed network. In a managed device, there are several so-called managed objects
  • The information associated with each managed object in a managed device is collected in the **Management Information Base (MIB)** and we will see the value of this information available to the management server
  • In each managed device also resides a network management agent , which is a process running in the managed device, which communicates with the management server, and takes local actions in the managed device under the command and control of the management server .
  • The final component of the network management framework is the network management protocol . This protocol runs between the management server and managed devices, allowing the management server to query the status of managed devices and take actions on these devices indirectly through its agents.

5.7.2 Simple Network Management Protocol

Simple Network Management Protocol is an application-layer protocol used to pass network management control and information messages between management servers and agents executing on behalf of the management servers.

The most common use of SNMP is the request-response mode, in which the SNMP management server sends a request to the SNMP agent. After receiving the request, the agent performs some actions and then sends a reply to the request.

The second commonly used SNMP is a non-request message sent by the agent to the management server, which is called a trap message (trap message)

Seven types of messages defined by SNMPv2

insert image description here

between the server and managed devices, allowing the management server to query the status of managed devices and take actions on those devices indirectly through its proxy.

Guess you like

Origin blog.csdn.net/qq_51684393/article/details/129647748