\documentclass[twocolumn, 10pt]{article}
\usepackage{acronym}
\usepackage{tikz}
\usepackage{cleveref}
\usetikzlibrary{calc,shapes,arrows}
\title{BGP model and other oddities}
\begin{document}
\maketitle
\acrodef{ADV}{advertisement}
\acrodef{AS}{autonomous system}
\acrodef{MiCe}{Milani Centrality}
We model a eBGP speaker graph; in the following \ac{AS}, speaker and node are used interchangeably.
\section{Preliminaries}
Nodes form a communication network to propagate BGP \acp{ADV}, the BGP messages.
\acp{ADV} can be of several types, the two related to prefix/destinations are
\begin{itemize}
\item UPDATE;
\item WITHDRAWAL.
\end{itemize}
We are not interested in the others, devoted to connection management.
We use the terms prefix and destination interchangeably and they indicate an IP subnet or a collection of IP subnets.
A route is a pair $r=(d,\xi)$ of destination and attributes.
$\xi$ contains information such as:
\begin{itemize}
\item path, which is a list of \acp{AS};
\item originator id, which is the IP address for the entry point of the originating \ac{AS}.
\end{itemize}
\section{BGP graph}
Nodes form a strongly connected bidirectional graph $G(V,E)$.
We indicate as $G^k(V^k, E^k)$ the fully connected subgraph of tier-one BGP nodes, such that, $V^k\subset V,\ E^K = V^k\times V^k$.
Links can be either peer-to-peer or customer-provider depending on the role involved nodes are playing.
We indicate with $\Lambda=\{\pi,c,s\}$ the labels indicating peer, consumer and provider respectively.
The function $\lambda:E\to \Lambda$ assigns to a node edge $(i,j)$ the role $i$ has with respect to $j$.
Hence, $\lambda(i,j) = \pi \iff \lambda(j,i)=\pi$ and $\lambda(i,j) = c \iff \lambda(j,i)=s$
Note that, $\lambda(i,j) = \pi\ \forall i,j\in V^k$.
We call $N_i = \{j\in V: \exists (i,j)\in E\}$ the set of neighbours for node $i$ and $C_i=\{j\in N_i: \lambda(i,j)=s\}$ the set of customers of node $i$.
\section{Advertisement propagation}
When a node $i\in V$ generates an \ac{ADV} for the route $r$, it is propagated to all nodes using the links of $G(V,E)$.
Propagation considers:
\begin{itemize}
\item $\lambda()$;
\item node policies blocking \ac{ADV} forwarding.
\end{itemize}
In the following we neglect blocking policies for the ease of analysis but it should not change it too much.
\begin{figure}
\centering
\begin{tikzpicture}
\tikzset{edge/.style = {->,> = latex',line width=0.2mm}}
\node[rectangle,text width=5em,align=center,draw=black] (b1) {$j$ receives $r$ from $i$};
\node[diamond,text width=4em,align=center,draw=black,below of=b1,node distance=7em] (b2) {$\lambda(i,j)==c?$};
\node[rectangle,text width=5em,align=center,draw=black] at ($(b2.west)+(-1.0,-1.5)$) (b3) {$j$ propagates to $C_j$};
\node[rectangle,text width=5em,align=center,draw=black] at ($(b2.east)+(+1.0,-1.5)$) (b4) {$j$ propagates to $N_j\setminus \{i\}$};
\draw[edge] (b1)->(b2);
\draw[edge] (b2)-|(b3) node[midway, draw=none, above] {n} ;
\draw[edge] (b2)-|(b4) node[midway, draw=none, above] {y} ;
\end{tikzpicture}
\caption{Flow chart for \ac{ADV} forwarding.}
\label{fig:adv_forwarding}
\end{figure}
\cref{fig:adv_forwarding} represents the deciding policy for \ac{ADV} forwarding using the standard policy of \textit{no-valley and prefer-customer}~\cite{elmokashfi2010scalability}.
Propagation policies and $G$ structure (it includes a full meshed graph $G^k$ of nodes with peer links), implies a very specific pattern of route propagation from one node $i\in V\setminus V^k$ to the rest of the network.
We model this pattern by sub-dividing the graph $G$ in three components as the propagation happens in three phases:
\begin{itemize}
\item Phase 1: node $i\in V\setminus V^k$ generates an \ac{ADV} for route $r$ and this spreads toward a node $z\in V^k$; we call the resulting sub-graph $G^{(1)}(V^{(1)},E^{(1)})$;
\item Phase 2: \ac{ADV} propagates toward tier one nodes $V^k$; the resulting sub-graph is $G^{(2)}=G^k$;
\item Phase 3: \ac{ADV} propagates from $z\in V^k$ to all the nodes $j\in V\setminus V^k\setminus V^{(1)}$; we call the resulting sub-graph $G^{(3)}(V^{(3)},E^{(3)})$.
\end{itemize}
\subsection{Phase 1 graph}
Let $i$ be the \ac{ADV} originator and $j\in V$ another node in $G$.
$j\in V^{(1)} \iff \exists p_{ij}$ a path in $G$ between $i$ and $j$, with $p_{ij}=(i,k_0)\dots (k_l,j)$ such that:
\begin{itemize}
\item $k_x\notin V^k,\ \forall x=0,\dots,l$;
\item we have one of the following conditions:
\begin{itemize}
\item $\lambda(\rho,t)=c\ \forall (\rho,t)\in p_{ij}$;
\item $\exists z\leq l: \lambda(\rho,t)=c\ \forall (\rho,t)\in p_{ik_z}, \lambda(k_z,k_{z+1})=\pi, \lambda(\rho,t)=s\ \forall (\rho,t)\in p_{k_{z+1},j}$
\end{itemize}
\end{itemize}
\subsection{Phase 3 graph}
Phase 3 graph is the one connecting the nodes $V^k$ to all the nodes $V^{(3)}=V\setminus V^k\setminus V^{(1)}$.
$j\in V^{(3)} \iff \exists p_{ij}$ a path in $G$ between $i\in V^k$ and $j$, with $p_{ij}=(i,k_0)\dots (k_l,j)$ such that:
\begin{itemize}
\item $j,k_x\notin V^k\cup V^{(1)},\ \forall x=0,\dots,l$;
\item $\lambda(\rho,t)=s\ \forall (\rho,t)\in p_{ij}$;
\end{itemize}
\subsection{Propagation graph}
Given an originator $i\in V\setminus V^k$, we call propagation graph $G^P=(V^{(1)}\cup V^{(2)}\cup V^{(3)},E^{(1)}\cup E^{(2)}\cup E^{(3)})$ the graph comprising all the feasible links for \ac{ADV} propagation.
\section{MRAI timers}
For each neighbour $j$, every node $i$ consider an MRAI timer value $T_{ij}$.
The typical value for it is 30 seconds.
Each node will consider route advertisements separately.
Routes can differ for the destination $d$ or for attributes $\xi$.
If two routes share the same destination $d$ but they include different attributes $\xi_1\neq \xi_2$ then node $i$ will process two different UPDATES messages.
With respect to the destination $d$, node $i$ will not send more than one message every $T_{ij}$ seconds.
If multiple route messages $r_1,\dots,r_m$ arrive to $i$ for the same destination $d$ but with different attributes $\xi_1,\dots,\xi_m$, node $i$ will propagate them separately, waiting $T_{ij}$ seconds between one transmission and the other\footnote{Note: this behaviour is mandated by the RFC, section 9.2.1.1 which foresees anyway some overhead issues in actual implementation. Solution to overhead is left to implementers.}.
For each destination $d$, node $i$ has a queue of route advertisements $r_1,\dots,r_m$, and, for each $j\in N_i$ it keeps a function $\tau(i,j,d): V\times V\times D\to [0,T_{ij}]$ expressing the minimum remaining time for another transmission.
\subsection{Fabrikant issue}
In the Fabrikant et al. paper~\cite{fabrikant2011something} it is describe a possible issue related to timers and path exploration.
This issue happens when there are multipaths in the propagation graph $G^P$ and a specific timer allocation $T_{ij}$.
In the following we suppose that all nodes $i$ have $\tau(i,j,d)=0,\ \forall j\in N_i$ (ready to fire).
\textbf{Duplicate ADV.} Let $i\in V$ originate a route advertisement $r$ and let $j\in V$ receives it at certain time $t_0$.
$j$ will process the \ac{ADV} and propagate it at time $t_0+\epsilon$; if $j$ finds more advantageous, given the new advertisement, to reach $d$ through another node, let's say $z\in V$, it will implement that in its routing table and will propagate the \ac{ADV} with the modified $\xi$.
However, if $z$ also receives the \ac{ADV} from $i$ at $t_0$, it has to change its routing table and propagate the \ac{ADV} accordingly but, if it does that at time greater than $t_0+\epsilon$, it happens that $j$ indeed receives the updated route from $z$ which may change again its routing table but it cannot propagate the new information as $\tau(j,k,d)>0,\ \forall k\in N_j$.
This behaviour makes $j$ send two \acp{ADV} for the same destination $d$, the first of which was computed on outdated information.
Worse than that, the updated \ac{ADV} cannot be propagated before $T_{ik}$ seconds to the neighbours $k\in N_j$.
\textbf{Duplicate duplication.} Suppose that $k\in N_j$ receives the \ac{ADV} at time $t_0+\epsilon$.
$k$ generates hence an \ac{ADV} and propagates the wrong information.
The duplication can happen again and $k$ receives at $t_1$ an \ac{ADV} from a node $h$ in a path from $k$ and $j$.
So $k$ has to wait $\tau(j,x,d)$ seconds before sending the updated information to its neighbour $x\in N_k$.
Now, if $T_{kx} > T_{jk}$ then $k$ will receive the update from $j$ and send only one duplicate \ac{ADV}.
But, if $T_{kx} < T_{jk}$ it means that the forementioned step can be repeated twice and $k$ will send a total of 4 \ac{ADV} messages.
\textbf{Exponential explosion.} In general and in presence of multipaths, if $p_{ij}=(i,k_0),\dots,(k_l,j)$ is a propagation path (a path in $G^P$), then the number of \ac{ADV} messages (and route oscillation) is exponential on the overall number of decreasing timers on the path.
\section{Solution sketch}
Ideally, we would like to have increasing $T_{ij}$ along the propagation paths in $G^P$.
Because of path aggregation\footnote{It is an important feature but Bird does not perform it.}, $\xi$ does not describe the exact path but just a sequence of node subsets.
Hence, it is difficult for a node to select its timer wrt its neighbours.
Instead we can use \ac{MiCe} to infer the position of a node\footnote{We would need the position on the path but \ac{MiCe} is computed graph-wide.} and tune the timers $T_{ij}$ accordingly.
Since, two nodes $j_1,j_2$ at the periphery, hence with similar centrality, could be one in $G^{(1)}$ and the other in $G^{(3)}$ respectively, we need to consider their case separately.
Considering a graph-wide maximum timer $T=30$ and \ac{MiCe} centrality $c_i\in [0,1]$ for node $i$, one strategy could be to assign:
\begin{itemize}
\item $T_{ij}=\frac{Tc_i}{2},\ \forall i\in V^{(1)}$
\item $T_{ij}=\frac{T}{2},\ \forall i\in V^k$
\item $T_{ij}=\frac{T(1-c_i)}{2}+\frac{T}{2}=\frac{T(2-c_i)}{2},\ \forall i\in V^{(3)}$
\end{itemize}
\textbf{Note:} we are not sure about \ac{MiCe} normalization in the interval $[0,1]$ applicability.
\bibliographystyle{IEEEtran}
\bibliography{biblio}
\end{document}