📄 libxipc_overview.tex
字号:
%% $XORP: xorp/docs/libxipc/libxipc_overview.tex,v 1.19 2007/03/15 00:43:13 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 Inter-Process Communication Library Overview \\\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%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\begin{abstract}Extensibility and robustness are key goals of the eXtensible OpenRouter Project (XORP). A step towards satisfying both of these goalsis to separate the functional components of a router into independenttasks and to execute each of these tasks as separate processes. Froman extensibility perspective this allows components of the router tobe started, stopped, and exchanged dynamically, and to be distributedacross a number of hosts. From a robusness perspective, the processesare afforded the protection mechanisms afforded by modern operatingsystems so a failure of one routing task does not necessarily bringthe router to a halt. The routing tasks do need to communicate and wehave developed an asynchronous remote procedure call mechanism that iscapable of working with multiple transport protocols between remotehosts and can leverage existing IPC mechanisms within a singlehost. This document discusses aspects of the design and the directionsit may take in future.\end{abstract}%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\section{Introduction}Robustness and extensibility are two of the goals of the XORP project.One way a router can achieve robustness is to run routing protocols inprotected environments, such as separate userland processes on amodern operating system. And one way a router can achieveextensibility is to be independent of the details about where thoserouting processes are running and what the composition of theforwarding plane is. The routing processes and network interfacescould be running on one machine or distributed across a cluster ofmachines that appear as single router. A necessary feature oncerouting protocols are running in distinct processes and potentially ondistinct machines is an inter-process communication mechanism. Incontrast to traditional inter-process communication schemes, thescheme employed in the XORP project can utilize multiple transportprotocols and potentially communicate with unmodified componentsthrough these protocols, for instance SNMP or HTTP.The lofty goals of XORP's Inter-Process Communication (XIPC) scheme are:\begin{itemize} \item to provide all of the IPC communication mechanisms that a router is likely to need, \eg sockets, ioctl's, System V messages, shared memory. \item to provide a consistent and transparent interface irrespective of the underlying transport mechanism used. \item to transparently select the appropriate IPC mechanism when alternatives exist. \item to provide an asynchronous interface. \item to be efficient. \item to potentially wrapper communication with non-XORP processes, \eg HTTP and SNMP servers. \item to be renderable in human readable form so XORP processes can read and write commands from configuration files.\end{itemize}The XIPC goals are realized through XORP Resource Locators (XRLs) andthe XORP IPC (XIPC) library. XRLs are responsible for describing aninter-process calls and their arguments. An XRL may be represented inhuman readable form that allows for easy manipulation with editingtools and invocation from the command line during development.XORP processes export XRL interfaces to a process known as the {\emFinder} and inform it of which IPC schemes are available to invokeeach XRL. The Finder is then able to provide a resolution service forXORP processes. When a process needs to dispatch an XRL it firstcontacts the Finder, obtains details on which IPC mechanisms areavailable to contact the process, and then instantiatesa suitable transport.The XIPC library provides the framework for handling and manipulatingXRLs, communicating with the Finder, and common protocol families forconducting IPC. In addition to the XIPC library, an interfacedefinition language exists, together with tools to translate theseinto callable C++ interfaces and into a set of C++ handler routinesfor handling the receipt of XRL calls. These tools are described indocument \cite{xorp:xrl_interfaces}. The tools reduce the amount offamiliarity the working programmer needs to have with the internals ofthe XIPC library. This document provides an overview of the XIPClibrary and is the recommended starting point before using thelibrary.%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\section{XORP Resource Locators (XRL's)}The mechanism we've settled on for IPC within XORP processes is mediatedthrough \emph{Xorp Resource Locators} (XRL's). An XRL describes aprocedure call. It comprises the protocol family to be used fortransport, the arguments for the protocol family, the interface of thetarget being called and its version, the method, and an argumentlist. Examples of XRLs in their human readable forms are shown infigure \ref{fig:human-readable}. The existence of a human readableform for XRLs is chiefly a convenience for humans who need to workwith XRLs and not indicative of how they work internally.Resolved and unresolved forms of the same are XRL are depicted infigure \ref{fig:human-readable}. The unresolved form is the startingpoint for the majority of inter-process communication. In theunresolved form the protocol family is set to ``finder'' and theprotocol parameters set to the target name that the XRL call isintended for. A process wishing to dispatch an XRL for the first timepasses the unresolved XRL to the Finder, which returns the resolvedform with the appropriate protocol family and protocol familyarguments. The finder may also modify the other components of theXRL, but doesn't usually do so. This functionality may be useful whensupporting backwards compatibility of interfaces, \ie the Finder couldmodify the interface number and method name.The resolved forms of XRLs are typically maintained in a client sidecache so the Finder need not be consulted for each XRL dispatch.%%%%%%%%%%%%%%%%%%%%%\clearpage\begin{sidewaysfigure}(a) Unresolved form:\begin{centering}\small\begin{verbatim}finder://fea/fti/0.1/add_route?net:ipv4net=10.0.0.1/8&gateway:ipv4=192.150.187.1+----- +-- +-- +-- +-------- +------------------------------------------------| | | | | || | | | Method Arguments| | | || | | Interface version
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -