📄 fea.tex
字号:
%% $XORP: xorp/docs/fea/fea.tex,v 1.21 2007/03/15 00:43:12 pavlin Exp $%\documentclass[11pt]{article}%\usepackage[dvips]{changebar}\usepackage{subfigure}\usepackage{fullpage}\usepackage{setspace}\usepackage{times}\usepackage{latexsym}\usepackage{epsfig}\usepackage{graphicx}\usepackage{xspace}\usepackage{color}\usepackage{amsmath}\usepackage{rotating}\usepackage{moreverb}\usepackage{listings}\usepackage{alltt}\usepackage{stmaryrd}%\usepackage[dvipdf]{graphics}%\usepackage[dvips]{graphicx}%\usepackage{xorp}\definecolor{gray}{rgb}{0.5,0.5,0.5}\newcommand{\etc}{\emph{etc.}\xspace}\newcommand{\ie}{\emph{i.e.,}\xspace}\newcommand{\eg}{\emph{e.g.,}\xspace}%\newcommand{\comment}[1]{{\color{gray}[\textsf{#1}]}}%\newcommand{\comment}[1]{}% Changebar stuff% \newenvironment{colorcode}{\color{blue}}{}% \renewcommand{\cbstart}{\begin{colorcode}}% \renewcommand{\cbend}{\end{colorcode}}% \pagestyle{empty}\begin{document}\title{XORP Forwarding Engine Abstraction \\\vspace{1ex}Version 1.4}\author{ XORP Project \\ International Computer Science Institute \\ Berkeley, CA 94704, USA \\ {\it http://www.xorp.org/} \\ {\it feedback@xorp.org}}\date{March 20, 2007}\maketitle%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\section{Introduction}\label{sec:introduction}The role of the Forwarding Engine Abstraction (FEA) in XORP is toprovide a uniform interface to the underlying forwarding engine. Itshields XORP processes from concerns over variations betweenplatforms. As a result, XORP processes need not be concerned whetherthe router is comprised of a single machine, or cluster of machines;or whether the network interfaces are simple, like a PCI Ethernetadapter, or are smart and have processing resources, like an Intel IXPcards.The FEA performs four distinct roles: \emph{interface management},\emph{forwarding table management}, \emph{raw packet I/O},and \emph{TCP/UDP socket I/O}. Those aredescribed briefly inSection~\ref{sec:introduction:interface_management},Section~\ref{sec:introduction:forwarding_table_management},Section~\ref{sec:introduction:raw_packet_io},and Section~\ref{sec:introduction:tcp_udp_socket_io}respectively.Section~\ref{sec:design_and_implementation} presentsthe design and implementation of the FEA components.FEA status summary is in Section~\ref{sec:status}.In a standard XORP system, the Multicast Forwarding Engine Abstraction(MFEA) is part of the FEA. The MFEA is conceptually distinct fromFEA and is used for multicast-specific abstraction of the underlying system.Combining the MFEA with the FEA reduces the load on the system. Forinformation about the MFEA architecture, see \cite{xorp:mfea}.%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\subsection{Interface Management}\label{sec:introduction:interface_management}In the normal course of interaction, the RouterManager process is theprincipal source of interface configuration requests to the FEA. TheRouterManager constructs the interface configuration from the routerconfiguration files and the input it receives at the command line.The type of requests the RouterManager sends to the FEA are to enableinterfaces, create virtual interfaces, set interface MTU's, and soforth. The FEA interprets and executes these requests in a mannerappropriate for the underlying forwarding plane.Processes can register with the FEA to be notified of changes ininterface configuration. The registered processes are notified ofchanges, and may query the FEA on the receipt of an update notificationto determine the change that occurred. These notifications areprimarily of interest to routing protocols since these need to knowwhat the state of each interface is at a given time.\begin{figure}[htbp] \begin{center} \includegraphics[width=0.80\textwidth]{figs/ifmgmt} \caption{FEA Interface Management interaction with other XORP processes} \label{fig:ifmgmt} \end{center}\end{figure}Both of the above interactions are depicted in Figure~\ref{fig:ifmgmt}.%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\subsection{Forwarding Table Management}\label{sec:introduction:forwarding_table_management}The FEA primarily receives forwarding table configuration information from theRIB process. The RIB arbitrates between the routes proposed by thedifferent routing processes, and propagates the results into the FEA'sforwarding table interface. The FEA accepts requests to insert andremove routing entries and propagates the necessary changes into theforwarding plane. The FEA also supports queries on the currentcontents of the forwarding table.Finally, processes can register with the FEA to receive update notificationsabout changes to the forwarding table.%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\subsection{Raw Packet I/O}\label{sec:introduction:raw_packet_io}Routing protocols, such as OSPF, need to be able to send and receivepackets on specific interfaces in the forwarding plane in order toexchange routing information and to determine the liveness of connectedpaths. Since the forwarding plane may be distributed across multiplemachines, these routing protocols delegate the I/O operations on thesepackets to the FEA. The FEA supports sending and receiving raw packetson specific interfaces.The transmission of raw packets through the FEA is straightforward, therouting process simply hands the FEA a raw packet and indicates whichinterface it should be sent on. The reception of raw packets is handledthrough a register-notify interface where the routing process registerswhich types of packets on which interfaces it is interested.%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\subsection{TCP/UDP Socket I/O}\label{sec:introduction:tcp_udp_socket_io}Routing protocols, such as BGP or RIP, need to be able to send and receiveTCP or UDP packets to/from a specific IP address in order to establishpeering connectivity and to exchange routing information.Similar to the raw packet I/O delegation, the FEA can be used todelegate the TCP/UDP socket I/O operations.The handling of TCP or UDP operations is done by simply extending theUNIX TCP/UDP socket interface such that all relevant socket operationshave XRL front-end interface.%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\section{Design and Implementation}\label{sec:design_and_implementation}%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\subsection{Overview}The FEA fulfills four discrete roles: Interface Management, ForwardingTable Management, Raw Packet I/O, and TCP/UDP Socket I/O. The InterfaceManagement and Forwarding Table Management roles follow a similardesign pattern since both relate to the setting and getting ofconfiguration state. The Raw Packet I/O and TCP/UDP Socket I/O havelittle in common with the other two roles.The Interface Management and Forwarding Table Management roles usetransactions for setting configuration state. The transactions are acollection of grouped operations that are queued until committed oraborted. Transactions provide atomic updates to the forwarding plane,which has the virtue of ensuring a consistent state at any particularinstant of time. In addition, forwarding plane updates may incur perupdate costs, and grouping operations may help to reducethese. Queries of the configuration state happen on the immediatestate, and are independent of any transactions that are in progress.The FEA, as with other XORP processes, uses the XRL mechanism forinter-process communication and each role of the FEA is represented bya distinct XRL interface. The Interface Management,Raw Packet I/O and TCP/UDP Socket I/O roles support the notion ofclients that notified when event occur and client processes are expectedto implement known interfaces. The FEA XRL and FEA XRL clientinterfaces are shown in Table~\ref{tbl:xifs}.\begin{table}[h]\begin{center}\begin{tabular}{|l|l|l|}\hlineRole & XRL Interface file & Client XRL Interface\\ \hline\hlineInterface Management & {\tt fea\_ifmgr.xif} & {\tt fea\_ifmgr\_client.xif} \\Forwarding Table Management & {\tt redist\_transaction\{4,6\}.xif} & {\tt fea\_fib.xif} \\Raw Packet I/O & {\tt fea\_rawpkt\{4,6\}.xif} & {\tt fea\_rawpkt\{4,6\}\_client.xif} \\TCP/UDP Socket I/O & {\tt socket\{4,6\}.xif} & {\tt socket\{4,6\}\_user.xif} \\\hline\end{tabular}\caption{FEA XRL Interfaces (defined in {\tt \$XORP/xrl/target/fea.tgt})}\label{tbl:xifs}\end{center}\end{table}The XRL handling code is found in {\tt\$XORP/fea/xrl\_target.\{hh,cc\}}. Each XRL interface is handled byan XRL-aware helper class. The helper class understands the semanticsof the implementation, and maps errors and responses to the appropriateXRL forms. The helper classes and their relations to the interfacesare depicted in Figure~\ref{fig:xrl_ifs}.\clearpage\begin{figure}[htbp] \begin{center} \includegraphics[angle=90,height=0.90\textheight]{figs/xrl_ifs} \caption{XRL Interfaces in relation to FEA classes} \label{fig:xrl_ifs} \end{center}\end{figure}\clearpage%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\subsection{Interface Management}To succinctly explain the interface management classes and how theyinteract we first describe the representation of interfaceconfiguration state. Interface configuration state is held within{\tt IfTree} class. The {\tt IfTree} structure is used andmanipulated by all of the the interface management classes. The {\ttIfTree} class is a container of interface state information organizedin a hierarchy:%% This needs re-presenting - it looks crufty\begin{description}\item [\tt IfTree] contains: \begin{description} \item [\tt IfTreeInterface] physical interface representation, contains: \begin{description} \item [\tt IfTreeVif] virtual (logical) interface representation, contains: \begin{description} \item [\tt IfTreeAddr4] Interface IPv4 address and related attributes. \item [\tt IfTreeAddr6] Interface IPv6 address and related attributes. \end{description} \end{description} \end{description}\end{description}Each item in the IfTree hierarchy is derived from {\tt IfTreeItem}.{\tt IfTreeItem} is a base class to track the state of a configurableitem. Items may be in one of four states: {\tt CREATED}, {\ttDELETED}, {\tt CHANGED}, {\tt NO\_CHANGE}. For example, if anitem is added to the tree it will be in the {\tt CREATED} state. The{IfTreeItem::finalize\_state()} method places the item in the {\ttNO\_CHANGE} state and items marked as {\tt DELETED} are actuallyremoved at this time. The state labeling associated with {\tt IfTreeItem} adds a smalldegree of complexity to the {\tt IfTree} classes. However, it allows
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -