Network Control Plane

post hero image

Table of Contents

Data Plane & Control Plane

Network layer only provide best-effort service: it will put as much effort as possible to carry out the transportation of packages (whatever that means).

Network layer can be subdivided into two different planes that perform different tasks:

  • Data plane: performs the forwarding of the packets,
  • Control plane: performs the routing of the packets.

Before discussing the duties of those planes, let’s deepen some network-related topics.

Forwarding & Routing

Network layer’s main tasks are forwarding and routing.

When a packet is traveling from a sender host H1 to a receiver host H2, it will pass through many intermediate routers (R1, R2, …, Rn). It is said that a packet is forwarded to the subsequent router when it moves from router Ri to router Ri+1. Forwarding is performed by data plane.

Network layer has to determinate the best path that packets need to follow through the network of routers. This task is performed by the control plane using different routing algorithms.

Forwarding is the local action of with which the router moves packets from an input interface to an output interface. It is usually hardware-implemented since it occurs in a very short time period (nanoseconds). Routing is the global action that defines the packages route from source host to destination host. It is usually software-implemented since it occurs in longer time period (seconds).

In order to forward a packet, the router extracts one or more fields from the packet’s header. It puts those values inside the so called forwarding table. This table will tell the router the right output interface to which forward the packet. Which values to insert into the forwarding tables are determinate by the previously mentioned routing algorithms.

Control Plane Approaches

Routers have to integrate both the planes of Network layer. As mentioned before, data plane is usually hardware-implemented. On the other hand, control plane has experienced an “evolution” from hardware to software.

In the traditional approach, the control plane is hardware-implemented and the routing algorithm is implemented in all every router of the network. The routing functions communicate to each other to choose the values to insert within the forwarding tables.

Unlike the traditional approach, in the SDN approach (Software-Defined Network) the control plane is software-implemented. It makes use of a network entity called remote controller, which is physically distinct from the router. The controller evaluates and distributes the forwarding tables to all the routers. The network is “software defined” since the controller is software-implemented. Those implementations are very often open source!

Introduction to Control Plane

Routing Algorithms

The objective of a routing algorithm is to determinate the path from a source host to a destination host, across the routers network. Usually, the best path is the one with the lower cost.

Routing problems are phrased through the use of graphs. Given N nodes and a set of links E, the graph G=(N,E) is the set of nodes where each link connects a pair of nodes from N. Within the context of routing, graph nodes are the routers, and their physical connections are the links.

Each link is associated with a cost due to:

  1. connection physical length,
  2. connection speed,
  3. connection price

For the sake of easiness, given two nodes xx and yy:

  • yy is a neighbor of xx if (x,y)(x,y) is an link of E,
  • the links are bi-directionals (x,y)(y,x)(x,y) \equiv (y,x)
    • (x,y)(x,y) is the link from xx to yy
    • (y,x)(y,x) is the link from yy to xx
  • the cost will be approximated to an integer scalar: c(x,y)Nc(x,y) \in \N

The link may also be called edge. The cost can also be denoted with l(x,y)Nl(x,y) \in \N if you approximate the cost to the connection length. A path in a graph is a sequences of nodes such that each pair of nodes is an link that belongs to E. The cost of a path is the sum of the costs of all the links through the path.


Classifications Criteria

The are many classification criteria, which can also overlap to create complex algorithms suitable for different situations. Each algorithm is a cost/performance trade-off that solves optimization problems with cost functions related to: number of hops, bit-rate, overall or local delay, overall or local throughput, actual cost to power repeaters to send information over a node, cost to pass through a radio base/fiber/satellite physical device.

Centralization

A (routing) algorithm is centralized when the minimum cost path is evaluated by having a global and complete knowledge of the network. The evaluation is performed in a single place, like a controller logically centralized, or replicated in every router in the network.

An algorithm is decentralized when the minimum cost path is evaluated in a distribute and iterative way. Nodes only know the connection costs of the neighbor nodes. Nodes iteratively learn information about the state of the network to calculate the route step-by-step (or, rather to say, hop-by-hop).

Static VS Dynamic

An algorithm is static when the path is resolved in advance: the routing table cannot change over time. The path from a given source to the same (given) destination rarely changes, most of the time because of a human interaction.

An algorithm is dynamic when routing changes over time due to changes in terms of network load or network topology. Moreover, other services may cause the routing rules to change. The routing table is periodically modified. Those algorithms are more sensitive to network changes but are more prone to problems such as loop routing.

Load Sensitiveness

An algorithm is load-sensitive when the connection costs dynamically variate according to the congestion level. The first ARPAnet routing algorithms were of this kind.

On the other hand, an algorithm is load-insensitive when the connection costs is not affected by the network congestion level.

Activeness

An algorithm is proactive when the path is resolved when creating the connection. An algorithm is reactive when the path is resolved as needed, packet by packet.

Consistency

An algorithm is uniform when the alert for algorithm management is sent to all nodes. An algorithm is nonuniform when the alert is only sent to a set of nodes (clustering).

The LS (Link State) algorithm sends to all network nodes a special packet called LSP: Link State Packet. LS uses broadcast to sent that packet to the whole network. LSP contains information about destination and source addresses: the history of all nodes that have transmitted that packet, plus the cost of the various links. It has up-to-date information on existing links. There is a cost/performance trade-off: the faster the LSP is sent, the more up-to-date the network state, but it takes up more of the network’s time to send overhead information in place of actual data.

Dijkstra Algorithm

This algorithm solves the problem of finding the shortest path. Let’s analyze a centralized version from 1959.

D(v)D(v) is the overall cost from source SS to a generic node vv. Given a couple of nodes xx and yy, the distance between them is denoted with l(x,y)l(x,y). If there is no connection between them, then l(x,y)=l(x,y) = \infty. Lastly, NN is the number of nodes the packet go through, MM is overall output number of all the NN nodes, and F\mathcal{F} is the set of nodes selected for the packet transition.

Algorithm steps:

  1. initialization:
    • at first, the set of selected nodes is only the source: F={S}\mathcal{F} = \{S\}
    • all the v nodes have their own distances: vF,  D(v)=l(S,v)\forall v \notin \mathcal{F},\; D(v)=l(S,v)
  2. among all the nodes not yet selected, let’s choose the one with lower distance from S:
    wF    zF,  zw,  D(w)D(z)w\notin \mathcal{F} \; | \; \forall z \notin \mathcal{F},\;z\neq w,\; D(w)\leq D(z)
  3. selection of node chosen at step 2: F=F{w}\mathcal{F} = \mathcal{F} \cup \{w\}
  4. evaluate new distances starting from ww: i.e. passing through the nodes of the updated F\mathcal{F} set
  5. if F<M|\mathcal{F}| < M go back to step 2, else stop.

Let’s take a sample network and build the distance table starting from node AA, such that SAS \equiv A.

routing sample nodes

The nodes directly connected with A have the following distances:

D(B)=l(A,B)=2,D(D)=l(A,D)=4,D(E)=l(A,E)=6,\begin{equation} \begin{split} D(B)&=l(A,B) = 2,\\ D(D)&=l(A,D) = 4,\\ D(E)&=l(A,E) = 6,\\ \end{split} \end{equation}

Let’s build a table where F\mathcal{F} grows progressively until it contains all the nodes in the network.

F\mathcal{F}D(B)D(B)D(C)D(C)D(D)D(D)D(E)D(E)D(F)D(F)
{A}\small \{A\}2l(A,B)2 \\ \scriptsize l(A,B)\infty4l(A,D)4 \\ \scriptsize l(A,D)6l(A,E)6 \\ \scriptsize l(A,E)\infty
{A,B}\small \{A,B\}2211l(A,B)+l(B,C)11 \\ \scriptsize l(A,B)+l(B,C)44663l(A,B)+l(B,F)3 \\ \scriptsize l(A,B) + l(B,F)
{A,B,F}\small \{A,B,F\}227l(A,B)+l(B,F)+l(F,C)7 \\ \scriptsize l(A,B)+l(B,F)+l(F,C)446633
{A,B,F,D}\small \{A,B,F,D\}2277445l(A,D)+l(D,E)5 \\ \scriptsize l(A,D)+l(D,E)33
{A,B,F,D,E}\small \{A,B,F,D,E\}2277445533
{A,B,F,D,E,C}\small \{A,B,F,D,E,C\}2277445533

Note that where the path is not specified (under the cost number), it is equal to the above line’s path. Please note that, in the formula D(D)=4D(D)=4, the inner DD refers to the node, while the outer DD stands for distance from the source. With nn nodes all at the same distance, the chosen one is randomly taken.

The graph below shows how to reach all the various nodes as a result of the Dijkstra algorithm calculations.

Routing Sample Resolved

Bellman-Ford Algorithm

B-F routing algorithm is centralized. Unlike Dijkstra, it sets the destination dd. Given the node ii and the iteration number hh, then DihD_i^h is the distance from node ii to destination dd at the hh-th algorithm iteration. Keep in mind that the path starts from the node ii and arrives to the destination dd.

Algorithm steps:

  1. initialization:
    • Ddh=0  hD_d^h =0\;\forall h
    • all distances are infinite: Di0=+  idD_i^0 = +\infty \; \forall i \neq d
  2. selection of node ii within the path from kk to dd
    • Dkh+1=minj{Dkh,l(k,j)+Djh}  kdD_k^{h+1}=\underset{j}{\text{min}} \big\{D_k^h,l(k,j)+D_j^h \big\}\;\forall k \neq d
    • i=arg minkd{Dkk+1 }i = \underset{k \neq d}{\text{arg min}} \big\{D_k^{k+1}\ \big\}
  3. if Dih+1=Dih  iD_i^{h+1}=D_i^h\;\forall i then stop, else go back to step 2

Let’s take the same sample network. Given the destination d=Ad=A.

routing sample nodes

Within step 2, you have to take all the jj nodes which are at most hh jumps away from the destination.

hhDAhD_A^hDBhD_B^hDChD_C^hDDhD_D^hDEhD_E^hDFhD_F^h
0\bold{0}0l(A,A)0 \\ \scriptsize l(A,A)\infty\infty\infty\infty\infty
1\bold{1}002l(B,A)2 \\ \scriptsize l(B,A)\infty4l(D,A)4 \\ \scriptsize l(D,A)6l(E,A)6 \\ \scriptsize l(E,A)\infty
2\bold{2}002210l(C,E)+l(E,A)10 \\ \scriptsize l(C,E)+l(E,A)44 \\ \small 5l(E,D)+l(D,A)5 \\ \scriptsize l(E,D)+l(D,A)3l(F,B)+l(B,A)3 \\ \scriptsize l(F,B)+l(B,A)
3\bold{3}00227l(C,F)+l(F,B)+l(B,A)7 \\ \scriptsize l(C,F)+l(F,B)+l(B,A)445533
4\bold{4}002277445533

The graph below shows how to reach all the various nodes. It has the same result of Dijkstra solution.

Routing Sample Resolved

Distance Vector

D-V is one of the most popular distributed and proactive algorithms. It’s a distributed version of B-F. Each node keeps a routing table with information about:

  • destination address
  • next hop: next node address to reach the destination
  • overall link cost

This information forms a vector of costs (i.e., distances) to all possible destinations: DVDV. The vector has the information to reach any destination. Locally, nodes make a decision (by exchanging information with neighboring nodes) to decide the path to the destination:

DV:DV(i)=[DV1(i),DV2(i),  ,  DVk(i),  ]DV: DV^{(i)} = \Big[DV^{(i)}_1, DV^{(i)}_2, \;\dots,\;DV^{(i)}_k,\;\dots \Big]

The algorithm steps are only a couple. At first, all the directly connected nodes (1 hop) exchange each other the distance vectors to node ii, i.e. DV:DV(i)DV: DV^{(i)}. Then, when the node ii gets a DV(j)DV^{(j)}, it checks if it has a better path for each destination kk:

l(i,j)+DVk(j)<DVk(i)l(i,j) + DV^{(j)}_k < DV^{(i)}_k

If this disequation is false, do nothing. If it is true, update the routing table from ii to kk with:

DVk(i)=l(i,j)+DVk(j)DV^{(i)}_k = l(i,j) + DV^{(j)}_k

as next hop for ii to kk: the node jj.

Let’s take the same sample network. Consider a subnetwork with i=Ai=A. Given the initial state kk, the direct links to neighboring nodes are:

kkDV(B)DV^{(B)}DV(D)DV^{(D)}DV(E)DV^{(E)}
A224466
B00\infty\infty
C99\infty44
D\infty0011
E\infty1100
F11\infty33

Please Note: NH means next hop. The node A initially has:

kkDV(A)DV^{(A)}NH(A)NH^{(A)}
A00A
B22B
C\infty/
D44D
E66E
F\infty/

Let’s analyze how does DV(A)DV^{(A)} vary when pieces of information from the other distance vectors are exchanged.

If DV(B)DV^{(B)} gets into DV(A)DV^{(A)}, you’ll get:

kkDV(A)DV^{(A)}NH(A)NH^{(A)}
A00A
B22B
C1111B
D44D
E66E
F33B

But what if DV(E)DV^{(E)} gets into DV(A)DV^{(A)}, intead?

kkDV(A)DV^{(A)}NH(A)NH^{(A)}
A00A
B22B
C1010E
D44D
E66E
F99E

There is no a right order for the DV(k)DV^{(k)} to get into DV(A)DV^{(A)}. This process is iterative, so now we should progressively add all the other distance vectors (which won’t be done here as a matter of brevity). A distributed algorithm needs to be constantly updated dynamically.

Count to infinity

Let’s analyze a D-V issue.

ABCA \longleftrightarrow B \longleftrightarrow C

Assuming both links have unit cost:

DVC(A)=2  ;  NHC(A)=BDVC(B)=1  ;  NHC(B)=C\begin{equation} \begin{split} DV^{(A)}_C &= 2\;;\; NH^{(A)}_C = B \\ DV^{(B)}_C &= 1\;;\; NH^{(B)}_C = C \end{split} \end{equation}

If the link between B and C gets broken, B updates the distance vector:

DVC(B)=  ;  NHC(B)=/DV^{(B)}_C = \infty\;;\; NH^{(B)}_C = /

Note that next hopes are evaluated by the nodes themselves. When the distance vector exchange happens:

  1. A gets from B: DVC(A)=DV^{(A)}_C = \infty, NHC(A)=/NH^{(A)}_C = /
  2. B gets from A: DVC(B)=3DV^{(B)}_C = 3, NHC(B)=ANH^{(B)}_C = A

When the exchange happens again:

  1. A gets from B: DVC(A)=4DV^{(A)}_C = 4, NHC(A)=BNH^{(A)}_C = B
  2. B gets from A: DVC(B)=DV^{(B)}_C = \infty, NHC(B)=/NH^{(B)}_C = /

It goes on counting endlessly until a deadlock occurs.