% vim: spell spelllang=en

\documentclass[11pt,xcolor={usenames,dvipsnames},aspectratio=169]{beamer}
\usetheme{metropolis}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage[T1]{fontenc}

\usepackage{texlib/my_listings}
\usepackage{texlib/todo}

\usepackage{booktabs}
\usepackage[thicklines]{cancel}

\renewcommand{\CancelColor}{\color{red}}

%\usepackage{inconsolata}


\lstdefinelanguage{iproute} {
    morekeywords={inet6},
    sensitive=true,
}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\title{Announcing IPv4 routes with an IPv6 next-hop in the Babel
routing protocol}
\subtitle{\textit{aka.}
    \href{https://datatracker.ietf.org/doc/draft-bastian-babel-v4ov6/}{
draft-bastian-babel-v4ov6}}
\author[\slidecountline]
{Théophile Bastian, Juliusz Chroboczek}
\date{}
%\subject{}
%\logo{}
\institute{
    \href{https://ens.fr/}{ENS Paris},
    \href{https://www.irif.fr/}{IRIF},
    \href{https://www.nexedi.com/}{Nexedi}}

\begin{document}

\maketitle{}

\begin{frame}{Traditional routing}
    \begin{align*}
        \text{Network prefix (IPvX)} \quad &\longrightarrow
        \quad \text{Next-Hop (IPvX)}
    \end{align*}

    \pause{}

    \begin{table}
        \centering
        \textbf{IPv4 routing table} \\
        \medskip
        \begin{tabular}{@{} lcl @{}}
            \toprule
            Prefix & $\rightarrow$ & Next-Hop \\
            \midrule
            default & & 10.42.0.254 \\
            10.102.0.0/16 & & 10.102.0.1 \\
            10.102.10.0/24 & & 10.102.10.1 \\
            \only<3>{10.0.0.0/8 & & % \makebox[0pt]{\color{red}---}
            \xcancel{fd80:1::1}} \\
            \bottomrule
        \end{tabular}
    \end{table}
\end{frame}

\begin{frame}{The router's job}
    \begin{figure}
        \centering
        \includegraphics[width=\columnwidth]{imgs/pdf/routing.pdf}
    \end{figure}
\end{frame}

\begin{frame}{What's under the hull?}
    \begin{figure}
        \centering
        \only<1>{\includegraphics[width=\columnwidth]{imgs/_autogen/mac/01.pdf}}
        \only<2>{\includegraphics[width=\columnwidth]{imgs/_autogen/mac/02.pdf}}
        \only<3>{\includegraphics[width=\columnwidth]{imgs/_autogen/mac/03.pdf}}
        \only<4>{\includegraphics[width=\columnwidth]{imgs/_autogen/mac/04.pdf}}
        \only<5>{\includegraphics[width=\columnwidth]{imgs/_autogen/mac/05.pdf}}
        \only<6>{\includegraphics[width=\columnwidth]{imgs/_autogen/mac/06.pdf}}
        \only<7>{\includegraphics[width=\columnwidth]{imgs/_autogen/mac/07.pdf}}
        \only<8>{\includegraphics[width=\columnwidth]{imgs/_autogen/mac/08.pdf}}
        \only<9>{\includegraphics[width=\columnwidth]{imgs/_autogen/mac/09.pdf}}
        \only<10>{\includegraphics[width=\columnwidth]{imgs/_autogen/mac/10.pdf}}
        \only<11>{\includegraphics[width=\columnwidth]{imgs/_autogen/mac/11.pdf}}
    \end{figure}
\end{frame}

\begin{frame}{Why would we want this?}
    \begin{itemize}
        \item Supporting both v4 and v6 is cumbersome: twice the configuration
        \item v6-only core, still serve v4 to clients
        \item IPv6 has \alert{link-local} and \alert{automatic addresses}
            (SLAAC)
            \begin{itemize}
                \item no need for DHCP or IP addresses configuration \emph{at all}!
            \end{itemize}
    \end{itemize}
\end{frame}

\begin{frame}[fragile]{Supported in Linux since 5.2}
    \begin{block}{d1566268 -- 2019-04-05 -- ipv4: Allow ipv6 gateway with ipv4 routes}
        \quad{}Add support for \lstbash{RTA_VIA} and allow an IPv6 nexthop for v4
        routes.
    \end{block}

    \vspace{1em}

    \begin{itemize}
        \item{} Usually, add a v4 route with
            \begin{lstlisting}[language=iproute, numbers=none]
# ip route add 10.42.0.0/16 via 10.40.0.42 dev eno1
            \end{lstlisting}

        \item{} v4-over-v6 (recent kernel):
            \begin{lstlisting}[language=iproute, numbers=none]
# ip route add 10.42.0.0/16 via inet6 fe80::a0de:baf:b39b dev eno1
            \end{lstlisting}
    \end{itemize}

\end{frame}

\section{Babel protocol extension}

\begin{frame}{Advertising v4-over-v6 routes}
    \textbf{An IPv4 interface} never announces v4-over-v6 routes

    \vspace{1em}

    \textbf{A v6-only interface}
    \begin{itemize}
        \item{} \alert{Installs a v4 route} nevertheless when receiving it
        \item{} \alert{Announces a v4-over-v6 route} for each v4 route
    \end{itemize}
\end{frame}

\begin{frame}{Introducing a new AE}
    In Babel, \alert{Address Encodings} (AEs) define the type of address/prefix
    contained in a TLV.
    \begin{itemize}
        \item IPv4 address
        \item IPv6 address
        \item link-local IPv6 address
        \item[$\bigstar$] \alert{v4-over-v6 address}
    \end{itemize}
\end{frame}

\begin{frame}{Backwards compatibility}
    \textbf{With older implementations}
    \begin{itemize}
        \item Ignore v4-over-v6 routes
        \item No state updates missed
    \end{itemize}

    \vspace{2em}

    \textbf{With older kernels}
    \begin{itemize}
        \item Won't advertise a route that cannot be locally set
        \item In babeld, detect kernel version
    \end{itemize}
\end{frame}

\end{document}
