📄 design.tex
字号:
\documentclass{article}\usepackage{url}\title{Routing policy filters\\design v0.01}\author{ab $<$a.bittau@cs.ucl.ac.uk$>$}\begin{document}\maketitle\section{Introduction}When dealing with routing policies, the life-time of a route and the stageswhich is goes through in order to be accepted must be considered. It isimportant to understand at which stages policy filtering may be applied and theconsequences which result in choosing a particular stage rather than a differentone. Routes being advertised also need the same consideration.\section{Imported routes}The flow of routes from the protocols into the RIB (import) may be summarized inthree main steps. In each step, the route is in a different state:\begin{description}\item[originated] The routing protocol just learned about this route. It isfresh and with its original content, just as it was advertised. This staterelates to BGP's RibIn Table for example.\item[accepted] The routing protocol accepts the route as its own best route forthe particular destination. The route is now ready to be introduced into the RIB.This state relates to right after BGP's Decision Table.\item[winner] This is the route that ``won''(out of the accepted ones) for aparticular destination. Winning is controlled by the administrative distance ofprotocols. It is the route actually used for forwarding. This state is rightafter the RIB's ExtInt table. These routes are communicated to the FEA in orderto be installed in the kernel.\end{description}\begin{figure}\setlength{\unitlength}{1mm}\begin{picture}(115,70)%\put(0,0){\framebox(115,70){}} % top labels\put(0,65){{\em Originated}}\put(20,66){\vector(1,0){17}}\put(40,65){{\em Accepted}}\put(57,66){\vector(1,0){35}}\put(95,65){{\em Winner}}% Define routing protocols\newsavebox{\protocol}\savebox{\protocol}{% incoming arrows\multiput(0,5)(0,2){3}{\vector(1,0){15}}% decision box\put(15,2){\framebox(15,10){Decision}}% %protocol boundary\put(5,0){\dashbox(35,22)[t]{Routing protocol}}% labels\put(6,1){{\em pre}}\put(31,1){{\em post}}}% Draw two routing protocols and outgoing lines\multiput(0,0)(0,30){2}{\usebox{\protocol}}\put(30,7){\vector(2,1){30}}\put(30,37){\vector(2,-1){30}}% rib decision box and outgoing\put(60,17){\framebox(15,10){Decision}}\put(75,22){\vector(1,0){15}}% winner box\put(90,17){\framebox(15,10){{\em Winner}}}% rib boundary\put(50,7){\dashbox(60,30)[t]{RIB}}% labels\put(51,8){{\em pre}}\put(76,8){{\em post}}\end{picture}\caption{\label{inrouteflow}Flow of imported routes}\end{figure}Figure~\ref{inrouteflow} illustrates the stages routes need to go through inorder to become winners. The routing protocols and the RIB are similar in termsof functionality --- they both take in multiple routes and make a {\em decision}regarding which route is best, and output that single route. The decision inrouting protocols is local, i.e. the route is confronted against other routesoriginated by the same protocol. On the other hand, the decision made by theRIB is global as all routes from all routing protocols are confronted. Thisexplains why being accepted by a routing protocol does not necessarily mean thatthe route is the best overall, and thus the winner.The decision process will eliminate some of the known routes, and it is notpolicy based. Two additional states may be defined in order to aid discussionsabout policy filter placement:\begin{description}\item[pre-decision] This state is just before the route enters a decision stage.For example, it relates to the originated state.\item[post-decision] This state is right after a decision has been made. Forexample, when a route is accepted.\end{description}\subsection{Import policies}The location of where a policy filter is placed has various implications. Whenmatching import policies, attributes of the protocol itself are normallyconsidered. This suggests that import filters should be placed somewhere withinthe routing protocol, as the RIB does not have enough information about protocolspecific fields.There are now two locations where a filter may be placed: pre or post decision.Placing a filter in pre-decision gives the user more control as all incomingroutes may be matched and not only the accepted ones. However, this additionalcontrol may lead to inefficiency if policies are bogus. Consider a policy whichrejects a route which would have been accepted among the other ones. This mayresult in the use of a non optimal route.Another example of where the location of filtering is critical is the following.Consider two routes A and B for the same destination X, where A would have beenaccepted in the absence of policies. Suppose the policy specifies to reject allroutes which match A. If the filter was placed in pre-decision, B would be theonly route for X and would be accepted. Conversely, placing the filter inpost-decision will reject the route and the RIB will not know how to reach X(when it probably should).Import policy matching and execution may, in all cases, be achieved in routingprotocols at the pre-decision state. Doing so, gives the policy the most controland trust. It also ensures that the decision will be based on routes which havealready been filtered (and possibly modified).\section{Exported routes}The life-time of exported routes may be summarized in two main states:\begin{description}\item[winners] The definition is the same as for imported routes. Only winner(``best'') routes are considered for possible advertisement.\item[ready] This is the final state of the route, just before the advertisementis sent to the network. The route is in fact a complete advertisement packet ofthe specific protocol used for the export.\end{description}\begin{figure}\setlength{\unitlength}{1mm}\begin{center}\begin{picture}(80,55)%\put(0,0){\framebox(80,55){}} %winner routes\put(5,20){\framebox(15,10){{\em Winners}}}\put(0,15){\dashbox(25,20)[t]{RIB}}\put(20,25){\vector(2,1){30}}\put(20,25){\vector(2,-1){30}}% Define routing protocols\newsavebox{\protocolexp}\savebox{\protocolexp}{% ready box\put(10,2){\framebox(15,10){{\em Ready}}}% %protocol boundary\put(0,0){\dashbox(35,20)[t]{Routing protocol}}}% routing protocols\multiput(40,2)(0,30){2}{\usebox{\protocolexp}}\multiput(65,9)(0,30){2}{\vector(1,0){15}}\end{picture}\end{center}\caption{\label{expflow}Flow of exported routes}\end{figure}Figure~\ref{expflow} illustrates how routes exit the RIB until they becomecomplete advertisements and sent off to the network. \subsection{Export policies}Matching export policies is less trivial as it is based on both source anddestination. The only place where destination information is available, is inthe routing protocol at the {\em ready} state. This is also the best place toexecute the policy actions as it may involve changing protocol specificattributes. However, export policies are matched according to their source as well, with theadditional constraint that routes must be winners. Protocol specific sourcematching may be achieved in the protocol post-decision stage offigure~\ref{inrouteflow}, as protocol specific fields are known there. However, theroute may lose in the RIB and never become a winner. If the route does become awinner, it will be forwarded to the relevant routing protocols foradvertisement.Export policy matching should occur in three logical steps. First the policymust match its source at the post-decision stage of the originating routingprotocol. Next, the route must win and be forwarded to the requested protocols,which is accomplished at the post-decision stage of the RIB. Finally, the routeis matched according to its destination at the ready stage of the exportingprotocol. At this point, the appropriate action may take place.If the source and destination protocols are the same in an export policy, thenthere is no redistribution involvement in the RIB. Routes flow across therouting protocol directly.\section{Policy filter pipeline}Import policy filtering is atomic as all matching and action execution is donein a single stage. Conversely, export policy filtering is spread out acrossvarious stages a route goes through. Figure~\ref{filters} illustrates how thematching may be achieved. The diagram is simplified, as matching should occurinternally to the protocols and the RIB, and not just before or after. Thepositions drawn should reflect the pre/post decision stages inside the protocolsand the RIB, except for position 4 which reflects the {\em ready} state.\begin{figure}\setlength{\unitlength}{1mm}\begin{picture}(120,70)%\put(0,0){\framebox(120,70){}} % incoming lines\newsavebox{\arrows}\savebox{\arrows}{\multiput(0,2)(0,2){3}{\vector(1,0){15}}\multiput(0,22)(0,2){3}{\vector(1,0){15}}}\put(0,0){\usebox{\arrows}}% bypass line\put(40,3){same protocol}\put(30,2){\vector(1,0){55}}% routing protocols\newsavebox{\proto}\savebox{\proto}{\multiput(0,0)(0,20){2}{\framebox(15,10){\parbox{15mm}{\begin{center}Routing\\Protocol\end{center}}}}}\put(15,0){\usebox{\proto}}% outgoing lines\put(30,5){\vector(2,1){20}}\put(30,25){\vector(2,-1){20}}% rib\put(50,10){\framebox(15,10){RIB}}% outgoing\put(65,15){\vector(2,1){20}}\put(65,15){\vector(2,-1){20}}%out proto and arrows\put(85,0){\usebox{\proto}}\put(100,0){\usebox{\arrows}}% import match+action\put(5,65){\parbox[t]{30mm}{Import\\match\\action}}\put(7,1){\dashbox(5,50)[t]{1}}% export source match\put(30,65){\parbox[t]{30mm}{Export\\source match}}\put(32,1){\dashbox(5,50)[t]{2}}% export redistribution\put(65,65){\parbox[t]{30mm}{Export\\redistribution\\winning routes}}\put(67,6){\dashbox(5,45)[t]{3}}% export destination match and action\put(100,65){\parbox[t]{30mm}{Export\\dest match\\action}}\put(102,1){\dashbox(5,50)[t]{4}}\end{picture}\caption{\label{filters}Location of policy filter elements. Note that routesexported using the same protocol of their origin, bypass the RIB and the position3 filter.}\end{figure}Import policies are completely evaluated before export policies. All exportpolicy matching is performed at later stages. This implies routes may have beenmodified by the import policies, making it impossible for export policies tomatch against original routes. This is a safe decision as the RIB itself willonly use the possibly modified routes, thus the information being exported iscoherent. The following example illustrates the concept:\begin{verbatim}policy-statement in { source { protocol rip; } action { modify metric=3;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -