📄 pim_arch.tex
字号:
%% $XORP: xorp/docs/pim/pim_arch.tex,v 1.25 2007/03/15 00:43:14 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 PIM-SM Routing Daemon \\\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}%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\subsection{Overview}This document provides an overview of the XORP PIM-SM~\cite{PIM-SM}Routing Daemon. It is intended to provide a starting point for softwaredevelopers who wish to modify this software.A router running PIM-SM interacts with other PIM-SM routers andmulticast group members, computes the multicast routing state, and installsthe corresponding multicast forwarding state in the multicast forwardingengine.The chosen architecture for the XORP PIM-SM implementation emphasizes oncorrectness and extensibility rather than high performance or minimalmemory footprint. PIM-SM is a fairly complicated protocol, therefore itis very important that the implementation follows closely the protocolspecification. Otherwise, premature optimization or ``cutting corners''might introduce problems that are difficult to find. Only after theimplementation is well tested, we wouldtry to optimize those parts of the implementation that should proveto be a bottleneck.Currently (March 2007), the PIM-SM implementation is basedon the specification in the following documents:\begin{itemize} \item \verb=draft-ietf-pim-sm-v2-new-11.{ps,txt}= (The core PIM-SM specification). \item \verb=draft-ietf-pim-sm-bsr-03.{ps,txt}= (The Bootstrap mechanism specification).\end{itemize}The only major feature not implemented yet is security.%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\subsection{Acronyms}Acronyms used in this document:\begin{itemize} \item {\bf MFC}: {\bf M}ulticast {\bf F}orwarding {\bf C}ache: another name for an entry in the multicast forwarding engine (typically used on UNIX systems). \item {\bf MFEA}: {\bf M}ulticast {\bf F}orwarding {\bf E}ngine {\bf A}bstraction \item {\bf MLD/IGMP}: {\bf M}ulticast {\bf L}istener {\bf D}iscovery/{\bf I}nternet {\bf G}roup {\bf M}anagement {\bf P}rotocol \item {\bf MRIB}: {\bf M}ulticast {\bf R}outing {\bf I}nformation {\bf B}ase \item {\bf PIM-SM}: {\bf P}rotocol {\bf I}ndependent {\bf M}ulticast--{\bf S}parse {\bf M}ode \item {\bf RIB}: {\bf R}outing {\bf I}nformation {\bf B}ase\end{itemize}%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\subsection{PIM-SM Design Architecture Overview}\begin{figure}[htbp] \begin{center} \includegraphics[width=6.0in]{figs/pim_design_overview} \caption{PIM-SM design overview} \label{fig:pim_design_overview} \end{center}\end{figure}Figure~\ref{fig:pim_design_overview} provides a general overview of thePIM-SM components. For each component there is a C++ class with exactlythe same name. The main components are briefly described below:\begin{itemize} \item {\bf PimNode:} a representation of a single PIM-SM routing unit (\eg a virtual PIM-SM router). Typically, there would be a single PimNode per PIM-SM router. \item {\bf PimVif:} PIM-specific virtual (network) interface that is used for sending and receiving PIM control packets. \item {\bf PimScopeZoneTable:} the table that contains information about scoped zones. \item {\bf PimMrt:} PIM-specific multicast routing table. \item {\bf PimBsr:} the PIM-Bootstrap mechanism unit. \item {\bf RpTable:} the table with the PIM-SM RP information. \item {\bf PimMribTable:} the table with the MRIB information. \item {\bf PimConfig:} contains PIM-specific configuration.\end{itemize}Those components are described in details inSection~\ref{sec:components_description}.For information about the interaction between the PIM-SM and other modulessee \cite{xorp:multicast_arch}.%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\section{Components Description}\label{sec:components_description}%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\subsection{PimNode Description}PimNode is a representation of a single PIM-SM routing unit (\eg avirtual PIM-SM router).Typically, there would be a single PimNode per PIM-SM router.However, in some cases a PIM-SM router may have more than onerouting unit. For example, it could have one PimNode for IPv4, andanother one for IPv6 multicast routing. Further, if we want torun PIM-SM in a simulation environment, each PIM-SM router within thatsimulation will be represented by a single PimNode.From a developer's point of view, PimNode contains all the state related tothe PIM-SM routing unit, and exports the front-end interface to interact withthat unit.For example, PimNode contains the methods tostart/stop or configure PIM-SM, to send/receive PIM control packetsto/from the routing unit, or to get protocol-related statistics.Those methods are described in the following files:\begin{itemize} \item \verb=pim/pim_node.hh= \item \verb=libproto/proto_node.hh= \item \verb=libproto/proto_unit.hh=\end{itemize}PimNode itself does not implement the mechanisms to communicate withother routing units (\eg to send or receive control packets to/from thenetwork), or to perform other PIM-independent operations such asinstalling multicast forwarding entries in the multicast forwardingengine. Those mechanisms are outside the scope of PimNode, and must beimplemented separately.PimNode contains several pure virtual methods (\eg\verb=join_multicast_group()= is used to join a multicast group onan interface) that must be implemented by a class that inherits PimNode.For example, XrlPimNode is a class that uses PimNode as a base class;XrlPimNode uses XRL-based communication mechanisms between PimNodeand other XORP components such as the MFEA and MLD/IGMP modules.By default, PimNode is disabled; therefore, on startup it must be enabledexplicitly.%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\subsection{PimVif Description}PimVif is a PIM-specific virtual (network) interface that is used for sendingand receiving PIM control packets. It includes the methods for processing andcomposing PIM control messages, as well as various state per interface(\eg the information about PIM-SM neighbors).Typically, there would be one PimVif per network interface such asphysical interface, tunnel, or the loopbackinterface. In addition, there would be one special PimVif virtualinterface: the PIM Register virtual interface that is used for sendingand receiving PIM Register messages. Not all virtual interfaces areused by PIM; for example, all interfaces that are not multicastcapable, and the loopback interface are ignored for multicastrouting.Typically, from developer's point of view, all interaction with PimVifwould be through PimNode~\footnote{For simplicity, currently (March 2007)there are few occasions when XrlPimNode uses direct access to PimVif.}.The public interface for PimVif contains the methods to manipulate avirtual (network) interface. Those methods are to start/stop/enable/disable avirtual interface, and to configure it. The methods are described inthe following files:
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -