<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V5.0//EN" "/usr/share/xml/docbook/schema/dtd/5.0/docbook.dtd" [
<!ENTITY url.quagga '<link xmlns="http://docbook.org/ns/docbook" xlink:href="http://www.quagga.net/">
  <citetitle>Quagga</citetitle></link>'>
<!ENTITY url.linuxmag '<link xmlns="http://docbook.org/ns/docbook" xlink:href="http://www.linuxmag-france.org/">
  <citetitle>Linux Magazine</citetitle></link>'>
<!ENTITY url.misc '<link xmlns="http://docbook.org/ns/docbook" xlink:href="http://www.miscmag.com/">
  <citetitle>Multi-system &amp; Internet Security
  Cookbook</citetitle> (<acronym>MISC</acronym>)</link>'>
<!ENTITY url.pmassol '<link xmlns="http://docbook.org/ns/docbook" xlink:href="http://www.pmassol.net/">
  <citetitle>Pacôme Massol</citetitle></link>'>
<!ENTITY url.pmassol.ospf '<link xmlns="http://docbook.org/ns/docbook" xlink:href="http://pmassol.net/lm/ospf.html">
  <citetitle>Zebra et OSPF</citetitle></link>'>
<!ENTITY url.pmassol.zebra '<link xmlns="http://docbook.org/ns/docbook" xlink:href="http://pmassol.net/zebra.html">
  <citetitle>GNU Zebra</citetitle></link>'>
<!ENTITY url.zebra.statique '<link xmlns="http://docbook.org/ns/docbook" xlink:href="http://www.inetdoc.net/guides/zebra.statique/">
  <citetitle>1ère partie, routage statique</citetitle></link>'>
<!ENTITY url.zebra.rip '<link xmlns="http://docbook.org/ns/docbook" xlink:href="http://www.inetdoc.net/guides/zebra.rip/">
  <citetitle>2ème partie, routage RIP</citetitle></link>'>
<!ENTITY url.ietf '<link xmlns="http://docbook.org/ns/docbook" xlink:href="http://ietf.org/">
  <citetitle>The Internet Engineering Task Force</citetitle></link>'>
<!ENTITY url.rfc2328 '<link xmlns="http://docbook.org/ns/docbook" xlink:href="http://www.faqs.org/rfcs/rfc2328.html">
  <acronym>RFC2328</acronym></link>'>
<!ENTITY url.ospf.rfclist '<link xmlns="http://docbook.org/ns/docbook" xlink:href="http://tools.ietf.org/wg/ospf/">
  <citetitle>ospf RFC List</citetitle></link>'>
]>
<article xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="zebra.ospf" xml:lang="fr">
<info>
  <title xmlns:xlink="http://www.w3.org/1999/xlink">Initiation au routage, 3ème partie</title>

  <abstract xmlns:xlink="http://www.w3.org/1999/xlink">
    <para xmlns:xlink="http://www.w3.org/1999/xlink">Cet article est le troisième d'une série rédigée par Pacôme Massol
    sur l'utilisation d'un système GNU/Linux comme routeur. L'article a été
    publié dans le numéro 51 de <citetitle xmlns:xlink="http://www.w3.org/1999/xlink">Linux Magazine</citetitle> en Juin
    2003. La version publiée ici ne contient que quelques différences mineures
    sur la présentation et la configuration du logiciel.</para>
  </abstract>

  <authorgroup xmlns:xlink="http://www.w3.org/1999/xlink">
    <author xmlns:xlink="http://www.w3.org/1999/xlink">
      <personname xmlns:xlink="http://www.w3.org/1999/xlink">
      <firstname xmlns:xlink="http://www.w3.org/1999/xlink">Pacôme</firstname><surname xmlns:xlink="http://www.w3.org/1999/xlink">Massol</surname>
      </personname>
      <personblurb xmlns:xlink="http://www.w3.org/1999/xlink">
	<para xmlns:xlink="http://www.w3.org/1999/xlink">Article publié dans le n°51 de <link xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.linuxmag-france.org/">
  <citetitle xmlns:xlink="http://www.w3.org/1999/xlink">Linux Magazine</citetitle></link> - Juin
	2003</para>
      </personblurb>
      <affiliation xmlns:xlink="http://www.w3.org/1999/xlink">
        <address xmlns:xlink="http://www.w3.org/1999/xlink"><email xmlns:xlink="http://www.w3.org/1999/xlink">pacome.massol(at)laposte.net</email></address>
      </affiliation>
    </author>
    <editor xmlns:xlink="http://www.w3.org/1999/xlink">
      <personname xmlns:xlink="http://www.w3.org/1999/xlink">
      <firstname xmlns:xlink="http://www.w3.org/1999/xlink">Philippe</firstname><surname xmlns:xlink="http://www.w3.org/1999/xlink">Latu</surname>
      </personname>
      <personblurb xmlns:xlink="http://www.w3.org/1999/xlink">
	<para xmlns:xlink="http://www.w3.org/1999/xlink">Responsable de la publication de cet article sur le site Linux
	France.</para>
      </personblurb>
      <affiliation xmlns:xlink="http://www.w3.org/1999/xlink">
        <orgname xmlns:xlink="http://www.w3.org/1999/xlink">Linux France</orgname>
        <address xmlns:xlink="http://www.w3.org/1999/xlink"><email xmlns:xlink="http://www.w3.org/1999/xlink">philippe.latu(at)inetdoc.net</email></address>
      </affiliation>
    </editor>
  </authorgroup>

  <keywordset xmlns:xlink="http://www.w3.org/1999/xlink">
    <keyword xmlns:xlink="http://www.w3.org/1999/xlink">massol</keyword>
    <keyword xmlns:xlink="http://www.w3.org/1999/xlink">pacome</keyword>
    <keyword xmlns:xlink="http://www.w3.org/1999/xlink">reseau</keyword>
    <keyword xmlns:xlink="http://www.w3.org/1999/xlink">zebra</keyword>
    <keyword xmlns:xlink="http://www.w3.org/1999/xlink">cisco</keyword>
    <keyword xmlns:xlink="http://www.w3.org/1999/xlink">route</keyword>
    <keyword xmlns:xlink="http://www.w3.org/1999/xlink">router</keyword>
    <keyword xmlns:xlink="http://www.w3.org/1999/xlink">routeur</keyword>
    <keyword xmlns:xlink="http://www.w3.org/1999/xlink">routage</keyword>
    <keyword xmlns:xlink="http://www.w3.org/1999/xlink">ip</keyword>
    <keyword xmlns:xlink="http://www.w3.org/1999/xlink">ipv4</keyword>
    <keyword xmlns:xlink="http://www.w3.org/1999/xlink">ipv6</keyword>
    <keyword xmlns:xlink="http://www.w3.org/1999/xlink">rip</keyword>
    <keyword xmlns:xlink="http://www.w3.org/1999/xlink">ripd</keyword>
    <keyword xmlns:xlink="http://www.w3.org/1999/xlink">ospf</keyword>
    <keyword xmlns:xlink="http://www.w3.org/1999/xlink">ospfd</keyword>
    <keyword xmlns:xlink="http://www.w3.org/1999/xlink">bgp</keyword>
    <keyword xmlns:xlink="http://www.w3.org/1999/xlink">bgpd</keyword>
    <keyword xmlns:xlink="http://www.w3.org/1999/xlink">linux</keyword>
    <keyword xmlns:xlink="http://www.w3.org/1999/xlink">quagga</keyword>
  </keywordset>
</info>

<sect1 xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="zebra.ospf.legal.meta">
  <title xmlns:xlink="http://www.w3.org/1999/xlink">Copyright et Licence</title>

  <literallayout xmlns:xlink="http://www.w3.org/1999/xlink" class="monospaced">
  Copyright (c) 2002-2005 Pacôme Massol
  Permission is granted to copy, distribute and/or modify this document
  under the terms of the GNU Free Documentation License, Version 1.2
  or any later version published by the Free Software Foundation;
  with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
  Texts.  A copy of the license is included in the sect2 entitled "GNU
  Free Documentation License".
  </literallayout>

  <literallayout xmlns:xlink="http://www.w3.org/1999/xlink" class="monospaced">
  Copyright (c) 2002-2005 Pacôme Massol
  Permission est accordée de copier, distribuer et/ou modifier ce
  document selon les termes de la Licence de Documentation Libre GNU
  (GNU Free Documentation License), version 1.1 ou toute version
  ultérieure publiée par la Free Software Foundation ; sans
  Sections Invariables ; sans Texte de Première de Couverture, et
  sans Texte de Quatrième de Couverture. Une copie de
  la présente Licence est incluse dans la sect2 intitulée
  « Licence de Documentation Libre GNU ».
  </literallayout>

  <sect2 xmlns:xlink="http://www.w3.org/1999/xlink">
    <title xmlns:xlink="http://www.w3.org/1999/xlink">Meta-information</title>
    <para xmlns:xlink="http://www.w3.org/1999/xlink">Cet article est écrit avec <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.docbook.org">
    <citetitle xmlns:xlink="http://www.w3.org/1999/xlink">DocBook</citetitle></link> XML sur un système
    <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.debian.org">
    <citetitle xmlns:xlink="http://www.w3.org/1999/xlink">Debian GNU/Linux</citetitle></link>.
    Il est disponible en version imprimable au format PDF :
    <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.inetdoc.net/pdf/zebra.ospf.pdf">
    <literal xmlns:xlink="http://www.w3.org/1999/xlink">zebra.ospf.pdf</literal></link>.</para>

    <para xmlns:xlink="http://www.w3.org/1999/xlink">Toutes les commandes utilisées dans ce document ne sont pas
    spécifiques à une version particulière des systèmes UNIX ou GNU/Linux.
    Comme la distribution <citetitle xmlns:xlink="http://www.w3.org/1999/xlink">Debian GNU/Linux</citetitle> est
    utilisée pour l'ensemble des supports du projet
    <citetitle xmlns:xlink="http://www.w3.org/1999/xlink">inetdoc.LiNUX</citetitle>, voici une liste des paquets
    contenant les commandes nécessaires :</para>
    <itemizedlist xmlns:xlink="http://www.w3.org/1999/xlink">
      <listitem xmlns:xlink="http://www.w3.org/1999/xlink">
      <para xmlns:xlink="http://www.w3.org/1999/xlink"><application xmlns:xlink="http://www.w3.org/1999/xlink">net-tools</application> - The NET-3 networking
      toolkit</para>
      </listitem>
      <listitem xmlns:xlink="http://www.w3.org/1999/xlink">
      <para xmlns:xlink="http://www.w3.org/1999/xlink"><application xmlns:xlink="http://www.w3.org/1999/xlink">quagga</application> - Unofficial successor of the
      Zebra BGP/OSPF/RIP routing daemon</para>
      </listitem>
      <listitem xmlns:xlink="http://www.w3.org/1999/xlink">
      <para xmlns:xlink="http://www.w3.org/1999/xlink"><application xmlns:xlink="http://www.w3.org/1999/xlink">quagga-doc</application> - info files for
      quagga</para>
      </listitem>
      <listitem xmlns:xlink="http://www.w3.org/1999/xlink">
      <para xmlns:xlink="http://www.w3.org/1999/xlink"><application xmlns:xlink="http://www.w3.org/1999/xlink">zebra</application> &amp;
      <application xmlns:xlink="http://www.w3.org/1999/xlink">zebra-doc</application> - anciens paquets non mis à jour
      depuis 2003.</para> 
      </listitem>
    </itemizedlist>

    <para xmlns:xlink="http://www.w3.org/1999/xlink">Les copies d'écran présentées ici correspondent à la publication
    initiale. Depuis, les versions de <application xmlns:xlink="http://www.w3.org/1999/xlink">Zebra</application> puis de
    <application xmlns:xlink="http://www.w3.org/1999/xlink">Quagga</application> ont évolué et l'affichage des
    informations de routage a été modifié. Cependant, ces modifications ne
    devraient pas gêner les lecteurs.</para>
  </sect2>
</sect1>

<sect1 xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="zebra.ospf.avant-propos">
  <title xmlns:xlink="http://www.w3.org/1999/xlink">Avant-propos</title>

  <para xmlns:xlink="http://www.w3.org/1999/xlink">Ce document est la suite de deux articles publiés respectivement dans
  <link xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.linuxmag-france.org/">
  <citetitle xmlns:xlink="http://www.w3.org/1999/xlink">Linux Magazine</citetitle></link> numéros 42 de septembre et 43 d'octobre 2002. Étant donné que
  cela remonte déjà à quelques temps, un rapide résumé est peut-être nécessaire
  avant de passer au vif du sujet : le protocole de routage dynamique
  <acronym xmlns:xlink="http://www.w3.org/1999/xlink">OSPF</acronym> et sa mise en œuvre avec
  <application xmlns:xlink="http://www.w3.org/1999/xlink">Zebra</application>.</para>

  <sect2 xmlns:xlink="http://www.w3.org/1999/xlink">
    <title xmlns:xlink="http://www.w3.org/1999/xlink">Résumé des épisodes précédents</title>

  <para xmlns:xlink="http://www.w3.org/1999/xlink">Le routeur est un élément essentiel dans l'aiguillage des paquets de
  données dans un inter-réseau. Pour chaque paquet reçu, il extrait le préfixe
  réseau de l'adresse IP de destination du paquet et le recherche dans une
  table qu'il possède en mémoire. Cette table de routage contient
  essentiellement une liste d'adresses réseau et, pour chacune, le moyen de
  l'atteindre, à savoir l'adresse d'un routeur immédiatement voisin et situé
  sur la route vers la destination. Si le routeur trouve dans cette table le
  préfixe réseau, il transmet le paquet sur le réseau du routeur voisin
  concerné. Ce processus sera renouvelé par le routeur voisin et ainsi de
  suite, de proche en proche le paquet sera orienté vers sa destination.</para>

  <para xmlns:xlink="http://www.w3.org/1999/xlink">Seulement voilà, il faut saisir les tables de routage ! Travail
  fastidieux pour les petits doigts agiles de l'administrateur lorsque les
  réseaux sont de grande taille. De plus, compte tenu de l'évolution du nombre
  de réseaux à interconnecter dans le cas d'internet, il est de toute façon
  devenu impossible de se cantonner au routage statique (souvenez-vous, dans le
  document <link xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.inetdoc.net/guides/zebra.statique/">
  <citetitle xmlns:xlink="http://www.w3.org/1999/xlink">1ère partie, routage statique</citetitle></link> nous nous sommes adonnés aux joies de la saisie
  de routes statiques avec <application xmlns:xlink="http://www.w3.org/1999/xlink">Zebra</application>).</para>

  <para xmlns:xlink="http://www.w3.org/1999/xlink">C'est pourquoi, le routage dynamique a été imaginé afin d'alléger la
  charge d'administration mais aussi pour réaliser des réseaux tolérants aux
  pannes d'un routeur ou d'une liaison. <acronym xmlns:xlink="http://www.w3.org/1999/xlink">RIP</acronym> est un bon
  exemple de protocole de routage dynamique (reportez-vous au document
  <link xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.inetdoc.net/guides/zebra.rip/">
  <citetitle xmlns:xlink="http://www.w3.org/1999/xlink">2ème partie, routage RIP</citetitle></link> pour découvrir tous ses secrets). Les routeurs supportant
  <acronym xmlns:xlink="http://www.w3.org/1999/xlink">RIP</acronym> s'échangent périodiquement des informations sur les
  routes qu'ils possèdent (les fameux «vecteurs de distance»). Si une panne se
  produit, les routeurs immédiatement voisins notent que certaines routes sont
  devenues inaccessibles et propagent l'information aux autres. Mais hélas,
  <acronym xmlns:xlink="http://www.w3.org/1999/xlink">RIP</acronym> souffre de certaines limitations qui ont poussé l'IETF
  (<link xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://ietf.org/">
  <citetitle xmlns:xlink="http://www.w3.org/1999/xlink">The Internet Engineering Task Force</citetitle></link>) à plancher sur un protocole plus robuste, plus efficace, plus
  paramétrable et supportant des réseaux de grande taille. Cette merveille
  s'appelle <acronym xmlns:xlink="http://www.w3.org/1999/xlink">OSPF</acronym> (<citetitle xmlns:xlink="http://www.w3.org/1999/xlink">Open Shortest Path
  First</citetitle>).</para>

  <para xmlns:xlink="http://www.w3.org/1999/xlink">Le fonctionnement de ce protocole est défini dans le document
  <link xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.faqs.org/rfcs/rfc2328.html">
  <acronym xmlns:xlink="http://www.w3.org/1999/xlink">RFC2328</acronym></link>. Les logiciels de <application xmlns:xlink="http://www.w3.org/1999/xlink">Zebra</application> et de son
  successeur <application xmlns:xlink="http://www.w3.org/1999/xlink">Quagga</application> supportent cette définition du
  protocole <acronym xmlns:xlink="http://www.w3.org/1999/xlink">OSPF</acronym>.</para>
  </sect2>
</sect1>

<sect1 xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="zebra.ospf.concepts">
  <title xmlns:xlink="http://www.w3.org/1999/xlink">Les grands principes d'OSPF</title>

  <para xmlns:xlink="http://www.w3.org/1999/xlink"><acronym xmlns:xlink="http://www.w3.org/1999/xlink">OSPF</acronym> est un protocole de routage dynamique défini
  par l'<acronym xmlns:xlink="http://www.w3.org/1999/xlink">IETF</acronym> à la fin des années 80. Il a fait l'objet d'un
  historique relativement complexe de RFCs (Voir <link xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://tools.ietf.org/wg/ospf/">
  <citetitle xmlns:xlink="http://www.w3.org/1999/xlink">ospf RFC List</citetitle></link>). Ce
  protocole a deux caractéristiques essentielles :</para>

  <itemizedlist xmlns:xlink="http://www.w3.org/1999/xlink">
    <listitem xmlns:xlink="http://www.w3.org/1999/xlink">
    <para xmlns:xlink="http://www.w3.org/1999/xlink">Il est ouvert : c'est le sens du terme
    <wordasword xmlns:xlink="http://www.w3.org/1999/xlink">Open</wordasword> de <acronym xmlns:xlink="http://www.w3.org/1999/xlink">OSPF</acronym>. Son
    fonctionnement est connu de tous.</para>
    </listitem>
    <listitem xmlns:xlink="http://www.w3.org/1999/xlink">
    <para xmlns:xlink="http://www.w3.org/1999/xlink">Il utilise l'algorithme <acronym xmlns:xlink="http://www.w3.org/1999/xlink">SPF</acronym> pour
    <wordasword xmlns:xlink="http://www.w3.org/1999/xlink">Shortest Path First</wordasword>, plus connu sous le nom
    d'algorithme de Dijkstra, afin d'élire la meilleure route vers une
    destination donnée.</para>
    </listitem>
  </itemizedlist>

  <para xmlns:xlink="http://www.w3.org/1999/xlink">Examinons une topologie qui nous servira de support pour les
  explications :</para>

  <figure xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="spf1">
    <title xmlns:xlink="http://www.w3.org/1999/xlink">Exemple de topologie</title>

  <mediaobject xmlns:xlink="http://www.w3.org/1999/xlink">
  <imageobject xmlns:xlink="http://www.w3.org/1999/xlink">
    <imagedata fileref="images/spf1.png" format="PNG" contentwidth="12cm" width="12.5cm"/>
  </imageobject>
  <caption xmlns:xlink="http://www.w3.org/1999/xlink">
    <para xmlns:xlink="http://www.w3.org/1999/xlink">Exemple de topologie</para>
  </caption>
  </mediaobject>
  </figure>

  <sect2 xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="zebra.ospf.concepts.cost">
    <title xmlns:xlink="http://www.w3.org/1999/xlink">La notion de coût</title>

  <para xmlns:xlink="http://www.w3.org/1999/xlink">Supposons que du routeur R1 on cherche à atteindre le réseau
  192.168.1.0. Dans une telle situation, Le protocole <acronym xmlns:xlink="http://www.w3.org/1999/xlink">RIP</acronym>
  aurait élu la route passant par R5 puisque c'est la plus courte en termes de
  saut. Cependant, imaginez que les liens représentés sous forme d'éclairs
  soient «rapides» (de type FastEthernet à 100 Mbps par exemple) et que les
  liens représentés sous formes de segments droits soient «lents» (de type
  Ethernet à 10 Mbps par exemple). Le choix du protocole RIP n'est plus du tout
  pertinent !</para>

  <para xmlns:xlink="http://www.w3.org/1999/xlink">Le protocole <acronym xmlns:xlink="http://www.w3.org/1999/xlink">OSPF</acronym> fonctionne différemment. Il
  attribue un coût à chaque liaison (appelée <emphasis xmlns:xlink="http://www.w3.org/1999/xlink">lien</emphasis> dans le
  jargon <acronym xmlns:xlink="http://www.w3.org/1999/xlink">OSPF</acronym>) afin de privilégier l'élection de certaines
  routes. Plus le coût est faible, plus le lien est intéressant. Par défaut, les
  coûts suivants sont utilisés en fonction de la bande passante du
  lien :</para>

  <informaltable xmlns:xlink="http://www.w3.org/1999/xlink">
    <tgroup xmlns:xlink="http://www.w3.org/1999/xlink" cols="2">
    <colspec xmlns:xlink="http://www.w3.org/1999/xlink" colwidth="2.5*"/>
    <colspec xmlns:xlink="http://www.w3.org/1999/xlink" colwidth="1*"/>
    <thead xmlns:xlink="http://www.w3.org/1999/xlink">
      <row xmlns:xlink="http://www.w3.org/1999/xlink">
        <entry xmlns:xlink="http://www.w3.org/1999/xlink">Type de réseau</entry><entry xmlns:xlink="http://www.w3.org/1999/xlink">Coût par défaut</entry>
      </row>
    </thead>
    <tbody xmlns:xlink="http://www.w3.org/1999/xlink">
      <row xmlns:xlink="http://www.w3.org/1999/xlink">
        <entry xmlns:xlink="http://www.w3.org/1999/xlink">FDDI, FastEthernet</entry><entry xmlns:xlink="http://www.w3.org/1999/xlink">1</entry>
      </row>
      <row xmlns:xlink="http://www.w3.org/1999/xlink">
        <entry xmlns:xlink="http://www.w3.org/1999/xlink">Ethernet 10 Mbps</entry><entry xmlns:xlink="http://www.w3.org/1999/xlink">10</entry>
      </row>
      <row xmlns:xlink="http://www.w3.org/1999/xlink">
        <entry xmlns:xlink="http://www.w3.org/1999/xlink">E1 (2,048 Mbps)</entry><entry xmlns:xlink="http://www.w3.org/1999/xlink">48</entry>
      </row>
      <row xmlns:xlink="http://www.w3.org/1999/xlink">
        <entry xmlns:xlink="http://www.w3.org/1999/xlink">T1 (1,544 Mbps)</entry><entry xmlns:xlink="http://www.w3.org/1999/xlink">65</entry>
      </row>
      <row xmlns:xlink="http://www.w3.org/1999/xlink">
        <entry xmlns:xlink="http://www.w3.org/1999/xlink">64 Kbps</entry><entry xmlns:xlink="http://www.w3.org/1999/xlink">1562</entry>
      </row>
      <row xmlns:xlink="http://www.w3.org/1999/xlink">
        <entry xmlns:xlink="http://www.w3.org/1999/xlink">56 Kbps</entry><entry xmlns:xlink="http://www.w3.org/1999/xlink">1758</entry>
      </row>
      <row xmlns:xlink="http://www.w3.org/1999/xlink">
        <entry xmlns:xlink="http://www.w3.org/1999/xlink">19.2 Kbps</entry><entry xmlns:xlink="http://www.w3.org/1999/xlink">5208</entry>
      </row>
    </tbody>
    </tgroup>
  </informaltable>

  <para xmlns:xlink="http://www.w3.org/1999/xlink">La formule de calcul est simplissime :</para>
  
<screen xmlns:xlink="http://www.w3.org/1999/xlink" width="80">                      10^8
  coût =  -------------------------------
           bande passante du lien en bps
</screen>

  <para xmlns:xlink="http://www.w3.org/1999/xlink">La référence <literal xmlns:xlink="http://www.w3.org/1999/xlink">10^8</literal> correspond à un débit maximum de
  100Mbps. Dans le cas où l'on utilise des interfaces avec un débit supérieur,
  il est possible de redéfinir la référence avec une commande du type
  <userinput xmlns:xlink="http://www.w3.org/1999/xlink">auto-cost reference-bandwidth 1000</userinput> pour la valeur
  <literal xmlns:xlink="http://www.w3.org/1999/xlink">10^9</literal>.</para>

  <para xmlns:xlink="http://www.w3.org/1999/xlink">Le protocole <acronym xmlns:xlink="http://www.w3.org/1999/xlink">OSPF</acronym> privilégie les routes qui ont un
  coût faible, donc celles qui sont supposées rapides en terme de débit
  théorique.</para>
  </sect2>

  <sect2 xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="zebra.ospf.concepts.database">
    <title xmlns:xlink="http://www.w3.org/1999/xlink">La base de données topologique</title>

  <para xmlns:xlink="http://www.w3.org/1999/xlink">Avec le protocole <acronym xmlns:xlink="http://www.w3.org/1999/xlink">OSPF</acronym>, tous les routeurs d'un même
  réseau (on parle de «zone» dans le vocabulaire <acronym xmlns:xlink="http://www.w3.org/1999/xlink">OSPF</acronym>, ceci vous sera expliqué
  avant la mise en pratique) travaillent sur une base de données topologique
  identique qui décrit le réseau. Cette base a été constituée pendant une
  première phase de découverte qui vous sera expliquée un peu plus loin.
  Examinons la base de données suivante qui décrit la topologie de la <xref xmlns:xlink="http://www.w3.org/1999/xlink" linkend="spf1"/> :</para>

  <informaltable xmlns:xlink="http://www.w3.org/1999/xlink">
    <tgroup xmlns:xlink="http://www.w3.org/1999/xlink" cols="2">
    <thead xmlns:xlink="http://www.w3.org/1999/xlink">
      <row xmlns:xlink="http://www.w3.org/1999/xlink">
        <entry xmlns:xlink="http://www.w3.org/1999/xlink">Arc</entry>
	<entry xmlns:xlink="http://www.w3.org/1999/xlink">Coût</entry>
      </row>
    </thead>
    <tbody xmlns:xlink="http://www.w3.org/1999/xlink">
      <row xmlns:xlink="http://www.w3.org/1999/xlink">
        <entry xmlns:xlink="http://www.w3.org/1999/xlink">R1, R2</entry><entry xmlns:xlink="http://www.w3.org/1999/xlink" align="right">1</entry>
      </row>
      <row xmlns:xlink="http://www.w3.org/1999/xlink">
        <entry xmlns:xlink="http://www.w3.org/1999/xlink">R1, R5</entry><entry xmlns:xlink="http://www.w3.org/1999/xlink" align="right">10</entry>
      </row>
      <row xmlns:xlink="http://www.w3.org/1999/xlink">
        <entry xmlns:xlink="http://www.w3.org/1999/xlink">R2, R3</entry><entry xmlns:xlink="http://www.w3.org/1999/xlink" align="right">1</entry>
      </row>
      <row xmlns:xlink="http://www.w3.org/1999/xlink">
        <entry xmlns:xlink="http://www.w3.org/1999/xlink">R3, R4</entry><entry xmlns:xlink="http://www.w3.org/1999/xlink" align="right">10</entry>
      </row>
      <row xmlns:xlink="http://www.w3.org/1999/xlink">
        <entry xmlns:xlink="http://www.w3.org/1999/xlink">R3, R5</entry><entry xmlns:xlink="http://www.w3.org/1999/xlink" align="right">1</entry>
      </row>
      <row xmlns:xlink="http://www.w3.org/1999/xlink">
        <entry xmlns:xlink="http://www.w3.org/1999/xlink">R4, R5</entry><entry xmlns:xlink="http://www.w3.org/1999/xlink" align="right">10</entry>
      </row>
      <row xmlns:xlink="http://www.w3.org/1999/xlink">
        <entry xmlns:xlink="http://www.w3.org/1999/xlink">R4, 192.168.1.0</entry><entry xmlns:xlink="http://www.w3.org/1999/xlink" align="right">10</entry>
      </row>
    </tbody>
    </tgroup>
  </informaltable>
  </sect2>

  <sect2 xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="zebra.ospf.concepts.spf">
    <title xmlns:xlink="http://www.w3.org/1999/xlink">L'élection des meilleures routes</title>

  <para xmlns:xlink="http://www.w3.org/1999/xlink">L'algorithme SPF de Dijsktra va traiter cette base de données afin de
  déterminer les routes les moins coûteuses. Une fois le traitement réalisé,
  chaque routeur se voit comme la racine d'un arbre contenant les meilleures
  routes. Par exemple :</para>

  <informaltable xmlns:xlink="http://www.w3.org/1999/xlink" frame="none" colsep="0">
    <tgroup xmlns:xlink="http://www.w3.org/1999/xlink" cols="2">
    <tbody xmlns:xlink="http://www.w3.org/1999/xlink">
      <row xmlns:xlink="http://www.w3.org/1999/xlink">
        <entry xmlns:xlink="http://www.w3.org/1999/xlink">
	  <mediaobject xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="spf2">
	    <imageobject xmlns:xlink="http://www.w3.org/1999/xlink">
	    <imagedata fileref="images/spf2.png" format="PNG" align="left" contentwidth="3.5cm" width="4.5cm"/>
	    </imageobject>
	    <caption xmlns:xlink="http://www.w3.org/1999/xlink">
	    <para xmlns:xlink="http://www.w3.org/1999/xlink">Topologie vue de R1</para>
	    </caption>
	  </mediaobject>
	</entry>
	<entry xmlns:xlink="http://www.w3.org/1999/xlink">
	  <mediaobject xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="spf3">
	    <imageobject xmlns:xlink="http://www.w3.org/1999/xlink">
	    <imagedata fileref="images/spf3.png" format="PNG" align="right" contentwidth="3.5cm" width="4.5cm"/>
	    </imageobject>
	    <caption xmlns:xlink="http://www.w3.org/1999/xlink">
	    <para xmlns:xlink="http://www.w3.org/1999/xlink">Topologie vue de R5</para>
	    </caption>
	  </mediaobject>
	</entry>
      </row>
    </tbody>
    </tgroup>
  </informaltable>

  <para xmlns:xlink="http://www.w3.org/1999/xlink">Dans l'exemple, entre R1 et 192.168.1.0, la meilleure route passe par
  R2, R3 et R4 pour un coût total de 1 + 1 + 10 + 10 soit 22.</para>
  </sect2>

  <sect2 xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="zebra.ospf.concepts.table">
    <title xmlns:xlink="http://www.w3.org/1999/xlink">La détermination d'une table de routage</title>

  <para xmlns:xlink="http://www.w3.org/1999/xlink">La base de données topologique décrit le réseau mais ne sert pas
  directement au routage. La table de routage est déterminée par l'application
  de l'algorithme du SPF sur la base topologique. Sur R1, voici un extrait de
  la table de routage calculée par SPF au sujet du réseau
  192.168.1.0 :</para>

  <informaltable xmlns:xlink="http://www.w3.org/1999/xlink">
    <tgroup xmlns:xlink="http://www.w3.org/1999/xlink" cols="3">
    <thead xmlns:xlink="http://www.w3.org/1999/xlink">
      <row xmlns:xlink="http://www.w3.org/1999/xlink">
        <entry xmlns:xlink="http://www.w3.org/1999/xlink">Réseau de destination</entry>
	<entry xmlns:xlink="http://www.w3.org/1999/xlink">Moyen de l'atteindre</entry>
	<entry xmlns:xlink="http://www.w3.org/1999/xlink">Coût</entry>
      </row>
    </thead>
    <tbody xmlns:xlink="http://www.w3.org/1999/xlink">
      <row xmlns:xlink="http://www.w3.org/1999/xlink">
        <entry xmlns:xlink="http://www.w3.org/1999/xlink">192.168.1.0</entry>
        <entry xmlns:xlink="http://www.w3.org/1999/xlink">R2</entry>
        <entry xmlns:xlink="http://www.w3.org/1999/xlink">22</entry>
      </row>
    </tbody>
    </tgroup>
  </informaltable>

  <para xmlns:xlink="http://www.w3.org/1999/xlink">Sur R5, on aura l'extrait suivant :</para>
  
  <informaltable xmlns:xlink="http://www.w3.org/1999/xlink">
    <tgroup xmlns:xlink="http://www.w3.org/1999/xlink" cols="3">
    <thead xmlns:xlink="http://www.w3.org/1999/xlink">
      <row xmlns:xlink="http://www.w3.org/1999/xlink">
        <entry xmlns:xlink="http://www.w3.org/1999/xlink">Réseau de destination</entry>
	<entry xmlns:xlink="http://www.w3.org/1999/xlink">Moyen de l'atteindre</entry>
	<entry xmlns:xlink="http://www.w3.org/1999/xlink">Coût</entry>
      </row>
    </thead>
    <tbody xmlns:xlink="http://www.w3.org/1999/xlink">
      <row xmlns:xlink="http://www.w3.org/1999/xlink">
        <entry xmlns:xlink="http://www.w3.org/1999/xlink">192.168.1.0</entry>
        <entry xmlns:xlink="http://www.w3.org/1999/xlink">R4</entry>
        <entry xmlns:xlink="http://www.w3.org/1999/xlink">20</entry>
      </row>
    </tbody>
    </tgroup>
  </informaltable>
  </sect2>
</sect1>

<sect1 xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="zebra.ospf.details">
  <title xmlns:xlink="http://www.w3.org/1999/xlink">Le fonctionnement d'OSPF un peu plus en détail</title>

  <para xmlns:xlink="http://www.w3.org/1999/xlink">Pour administrer un réseau <acronym xmlns:xlink="http://www.w3.org/1999/xlink">OSPF</acronym> correctement, il est indispensable de
  comprendre le fonctionnement interne du protocole.</para>

  <para xmlns:xlink="http://www.w3.org/1999/xlink">à l'intérieur d'une même zone, les routeurs fonctionnant sous <acronym xmlns:xlink="http://www.w3.org/1999/xlink">OSPF</acronym>
  doivent préalablement remplir les tâches suivantes avant de pouvoir effectuer
  leur travail de routage :</para>

  <orderedlist xmlns:xlink="http://www.w3.org/1999/xlink">
    <listitem xmlns:xlink="http://www.w3.org/1999/xlink">
    <para xmlns:xlink="http://www.w3.org/1999/xlink"><xref xmlns:xlink="http://www.w3.org/1999/xlink" linkend="zebra.ospf.details.hello"/>,</para>
    </listitem>
    <listitem xmlns:xlink="http://www.w3.org/1999/xlink">
    <para xmlns:xlink="http://www.w3.org/1999/xlink"><xref xmlns:xlink="http://www.w3.org/1999/xlink" linkend="zebra.ospf.details.dr"/>,</para>
    </listitem>
    <listitem xmlns:xlink="http://www.w3.org/1999/xlink">
    <para xmlns:xlink="http://www.w3.org/1999/xlink"><xref xmlns:xlink="http://www.w3.org/1999/xlink" linkend="zebra.ospf.details.routes"/>,</para>
    </listitem>
    <listitem xmlns:xlink="http://www.w3.org/1999/xlink">
    <para xmlns:xlink="http://www.w3.org/1999/xlink"><xref xmlns:xlink="http://www.w3.org/1999/xlink" linkend="zebra.ospf.details.routes.election"/>,</para>
    </listitem>
    <listitem xmlns:xlink="http://www.w3.org/1999/xlink">
    <para xmlns:xlink="http://www.w3.org/1999/xlink"><xref xmlns:xlink="http://www.w3.org/1999/xlink" linkend="zebra.ospf.details.maintain"/>.</para>
    </listitem>
  </orderedlist>

  <sect2 xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="zebra.ospf.details.initial">
    <title xmlns:xlink="http://www.w3.org/1999/xlink">État initial</title>

  <para xmlns:xlink="http://www.w3.org/1999/xlink">Le processus de routage <acronym xmlns:xlink="http://www.w3.org/1999/xlink">OSPF</acronym> est inactif sur tous les routeurs de la
  <xref xmlns:xlink="http://www.w3.org/1999/xlink" linkend="spf1"/>.</para>
  </sect2>

  <sect2 xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="zebra.ospf.details.hello">
    <title xmlns:xlink="http://www.w3.org/1999/xlink">Établir la liste des routeurs voisins : <wordasword xmlns:xlink="http://www.w3.org/1999/xlink">Hello, my
    name is R1 and I'm an OSPF router.</wordasword></title>

  <para xmlns:xlink="http://www.w3.org/1999/xlink">Les routeurs <acronym xmlns:xlink="http://www.w3.org/1999/xlink">OSPF</acronym> sont bien élevés. Dès qu'ils sont
  activés, ils n'ont qu'une hâte : se présenter et faire connaissance avec
  leurs voisins. En effet, lorsque le processus de routage est lancé sur R1
  (commande <userinput xmlns:xlink="http://www.w3.org/1999/xlink">router ospf</userinput>), des paquets de données
  (appelés paquets <literal xmlns:xlink="http://www.w3.org/1999/xlink">HELLO</literal>) sont envoyés sur chaque interface
  où le routage dynamique a été activé (commande
  <userinput xmlns:xlink="http://www.w3.org/1999/xlink">network</userinput>).</para>

  <para xmlns:xlink="http://www.w3.org/1999/xlink">L'adresse <emphasis xmlns:xlink="http://www.w3.org/1999/xlink">multicast</emphasis> 224.0.0.5 est utilisée, tout
  routeur <acronym xmlns:xlink="http://www.w3.org/1999/xlink">OSPF</acronym> se considère comme destinataire. Ces paquets
  ont pour but de s'annoncer auprès de ses voisins. Deux routeurs sont dits
  voisins s'ils ont au moins un lien en commun. Par exemple, sur la <xref xmlns:xlink="http://www.w3.org/1999/xlink" linkend="spf1"/>, R1 et R2 sont voisins mais pas R1 et R3.</para>

  <para xmlns:xlink="http://www.w3.org/1999/xlink">Lorsque le processus de routage <acronym xmlns:xlink="http://www.w3.org/1999/xlink">OSPF</acronym> est lancé sur R2, celui-ci
  récupère les paquets <literal xmlns:xlink="http://www.w3.org/1999/xlink">HELLO</literal> émis par R1 toutes les 10
  secondes (valeur par défaut du temporisateur appelé <wordasword xmlns:xlink="http://www.w3.org/1999/xlink">hello
  interval</wordasword>). R2 intègre l'adresse IP de R1 dans une base de
  données appelée «base d'adjacences» (<wordasword xmlns:xlink="http://www.w3.org/1999/xlink">adjacencies
  database</wordasword>). Cette base contient les adresses des routeurs
  voisins. Vous pourrez visionner son contenu grâce à la commande
  <userinput xmlns:xlink="http://www.w3.org/1999/xlink">show ip ospf neighbor</userinput>. R2 répond à R1 par un paquet IP
  <emphasis xmlns:xlink="http://www.w3.org/1999/xlink">unicast</emphasis>. R1 intègre l'adresse IP de R2 dans sa propre
  base d'adjacences. Ensuite, généralisez ce processus à l'ensemble des
  routeurs de la zone.</para>

  <para xmlns:xlink="http://www.w3.org/1999/xlink">Cette phase de découverte des voisins est fondamentale puisque
  <acronym xmlns:xlink="http://www.w3.org/1999/xlink">OSPF</acronym> est un protocole à état de liens. Il lui faut
  connaître ses voisins pour déterminer s'ils sont toujours joignables et donc
  déterminer l'état du lien qui les relie.</para>
  </sect2>

  <sect2 xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="zebra.ospf.details.dr">
    <title xmlns:xlink="http://www.w3.org/1999/xlink">Élire le routeur désigné et le routeur désigné de secours</title>

  <para xmlns:xlink="http://www.w3.org/1999/xlink">Dans une zone <acronym xmlns:xlink="http://www.w3.org/1999/xlink">OSPF</acronym> composée de réseaux de diffusion
  (<wordasword xmlns:xlink="http://www.w3.org/1999/xlink">broadcast networks</wordasword>) ou de réseaux à accès multiples
  sans diffusion (<acronym xmlns:xlink="http://www.w3.org/1999/xlink">NBMA</acronym> ou <wordasword xmlns:xlink="http://www.w3.org/1999/xlink">non broadcast multiple
  access networks</wordasword>), pour chacun de ces deux types de réseau, un
  routeur doit être élu «routeur désigné» (<acronym xmlns:xlink="http://www.w3.org/1999/xlink">DR</acronym> ou
  <wordasword xmlns:xlink="http://www.w3.org/1999/xlink">Designated Router</wordasword>) et un autre «routeur désigné de
  secours» (<acronym xmlns:xlink="http://www.w3.org/1999/xlink">BDR</acronym> ou <wordasword xmlns:xlink="http://www.w3.org/1999/xlink">Backup Designated
  Router</wordasword>). Le «routeur désigné» (<acronym xmlns:xlink="http://www.w3.org/1999/xlink">DR</acronym>) est un
  routeur particulier qui sert de référent pour la base de données topologique
  représentant le réseau.</para>

  <para xmlns:xlink="http://www.w3.org/1999/xlink">Pourquoi élire un routeur désigné ? Cela répond à trois
  objectifs :</para>

  <itemizedlist xmlns:xlink="http://www.w3.org/1999/xlink">
    <listitem xmlns:xlink="http://www.w3.org/1999/xlink">
    <para xmlns:xlink="http://www.w3.org/1999/xlink">réduire le trafic lié à l'échange d'informations sur l'état des liens
    (car il n'y a pas d'échange entre tous les routeurs mais entre chaque
    routeur et le DR),</para>
    </listitem>
    <listitem xmlns:xlink="http://www.w3.org/1999/xlink">
    <para xmlns:xlink="http://www.w3.org/1999/xlink">améliorer l'intégrité de la base de données topologique (car cette
    base de données doit être unique),</para>
    </listitem>
    <listitem xmlns:xlink="http://www.w3.org/1999/xlink">
    <para xmlns:xlink="http://www.w3.org/1999/xlink">accélérer la convergence (souvenez-vous, c'était le talon d'Achille
    de <acronym xmlns:xlink="http://www.w3.org/1999/xlink">RIP</acronym>).</para>
    </listitem>
  </itemizedlist>

  <para xmlns:xlink="http://www.w3.org/1999/xlink">Comment élire le DR ? Autrement dit, qui va se taper la corvée
  d'expliquer à ses petits camarades la topologie du réseau ? On ne
  demande pas qui sait parler anglais ou couper les cheveux comme au temps de
  la conscription. Mais comme il faut bien un critère, le routeur élu est celui
  qui a la plus grande priorité (<wordasword xmlns:xlink="http://www.w3.org/1999/xlink">Router ID</wordasword> ou
  <acronym xmlns:xlink="http://www.w3.org/1999/xlink">RID</acronym>). La priorité est un nombre sur 8 bits fixé par
  défaut à 1 sur tous les routeurs. Pour départager les routeurs ayant la même
  priorité, celui qui est élu a la plus grande adresse IP sur une interface de
  boucle locale (<wordasword xmlns:xlink="http://www.w3.org/1999/xlink">loopback interface</wordasword>) ou sur un autre
  type d'interface active. Le <acronym xmlns:xlink="http://www.w3.org/1999/xlink">BDR</acronym> sera le routeur avec la
  deuxième plus grande priorité.</para>

  <para xmlns:xlink="http://www.w3.org/1999/xlink">Afin de s'assurer que votre routeur préféré sera élu
  <acronym xmlns:xlink="http://www.w3.org/1999/xlink">DR</acronym>, il suffit de lui affecter une priorité supérieure à 1
  avec la commande <userinput xmlns:xlink="http://www.w3.org/1999/xlink">ospf priority</userinput>. Vous devrez faire ceci
  avant d'activer le processus de routage sur les routeurs car, une fois élu,
  le DR n'est jamais remis en cause même si un routeur avec une priorité plus
  grande apparaît dans la zone.</para>
  </sect2>

  <sect2 xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="zebra.ospf.details.routes">
    <title xmlns:xlink="http://www.w3.org/1999/xlink">Découvrir les routes</title>

  <para xmlns:xlink="http://www.w3.org/1999/xlink">Il faut maintenant constituer la base de données topologique. Les
  routeurs communiquent automatiquement les routes pour les réseaux qui
  participent au routage dynamique (ceux déclarés avec la commande
  <userinput xmlns:xlink="http://www.w3.org/1999/xlink">network</userinput>). <application xmlns:xlink="http://www.w3.org/1999/xlink">Zebra</application> et son
  successeur <application xmlns:xlink="http://www.w3.org/1999/xlink">Quagga</application> étant multiprotocoles, ils
  peuvent également diffuser des routes provenant d'autres sources que
  <acronym xmlns:xlink="http://www.w3.org/1999/xlink">OSPF</acronym>, grâce à la commande
  <userinput xmlns:xlink="http://www.w3.org/1999/xlink">redistribute</userinput>.</para>

  <para xmlns:xlink="http://www.w3.org/1999/xlink">Chaque routeur (non <acronym xmlns:xlink="http://www.w3.org/1999/xlink">DR</acronym> ou <acronym xmlns:xlink="http://www.w3.org/1999/xlink">BDR</acronym>)
  établit une relation maître/esclave avec le <acronym xmlns:xlink="http://www.w3.org/1999/xlink">DR</acronym>. Le
  <acronym xmlns:xlink="http://www.w3.org/1999/xlink">DR</acronym> initie l'échange en transmettant au routeur un résumé
  de sa base de données topologique via des paquets de données appelés
  <acronym xmlns:xlink="http://www.w3.org/1999/xlink">LSA</acronym> (<wordasword xmlns:xlink="http://www.w3.org/1999/xlink">Link State
  Advertisement</wordasword>).</para>
  
  <para xmlns:xlink="http://www.w3.org/1999/xlink">Ces paquets comprennent essentiellement l'adresse du routeur, le coût
  du lien et un numéro de séquence. Ce numéro est un moyen pour déterminer
  l'ancienneté des informations reçues. Si les <acronym xmlns:xlink="http://www.w3.org/1999/xlink">LSA</acronym> reçus
  sont plus récents que ceux dans sa base topologique, le routeur demande une
  information plus complète par un paquet <acronym xmlns:xlink="http://www.w3.org/1999/xlink">LSR</acronym>
  (<wordasword xmlns:xlink="http://www.w3.org/1999/xlink">Link State Request</wordasword>). Le <acronym xmlns:xlink="http://www.w3.org/1999/xlink">DR</acronym>
  répond par des paquets <acronym xmlns:xlink="http://www.w3.org/1999/xlink">LSU</acronym> (<wordasword xmlns:xlink="http://www.w3.org/1999/xlink">Link State
  Update</wordasword>) contenant l'intégralité de l'information demandée.
  Ensuite, le routeur (non <acronym xmlns:xlink="http://www.w3.org/1999/xlink">DR</acronym> ou <acronym xmlns:xlink="http://www.w3.org/1999/xlink">BDR</acronym>)
  transmet les routes meilleures ou inconnues du <acronym xmlns:xlink="http://www.w3.org/1999/xlink">DR</acronym>.</para>

  <para xmlns:xlink="http://www.w3.org/1999/xlink">L'administrateur peut consulter la base de données topologique grâce à
  la commande <userinput xmlns:xlink="http://www.w3.org/1999/xlink">show ip ospf database</userinput>.</para>
  </sect2>

  <sect2 xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="zebra.ospf.details.routes.election">
    <title xmlns:xlink="http://www.w3.org/1999/xlink">Élire les routes à utiliser</title>

  <para xmlns:xlink="http://www.w3.org/1999/xlink">Lorsque le routeur est en possession de la base de données topologique,
  il est en mesure de créer la table de routage. L'algorithme du
  <acronym xmlns:xlink="http://www.w3.org/1999/xlink">SPF</acronym> est appliqué sur la base topologique. Il en ressort
  une table de routage contenant les routes les moins coûteuses.</para>

  <para xmlns:xlink="http://www.w3.org/1999/xlink">Il faut noter que sur une base de données topologique importante, le
  calcul consomme pas mal de ressources CPU car l'algorithme est relativement
  complexe.</para>
  </sect2>

  <sect2 xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="zebra.ospf.details.maintain">
    <title xmlns:xlink="http://www.w3.org/1999/xlink">Maintenir la base topologique</title>

  <para xmlns:xlink="http://www.w3.org/1999/xlink">Lorsqu'un routeur détecte un changement de l'état d'un lien (cette
  détection se fait grâce aux paquets HELLO adressés périodiquement par le
  routeur à ses voisins), celui-ci émet un paquet <acronym xmlns:xlink="http://www.w3.org/1999/xlink">LSU</acronym> sur
  l'adresse <emphasis xmlns:xlink="http://www.w3.org/1999/xlink">multicast</emphasis> 224.0.0.6 : le
  <acronym xmlns:xlink="http://www.w3.org/1999/xlink">DR</acronym> et le <acronym xmlns:xlink="http://www.w3.org/1999/xlink">BDR</acronym> de la zone se considèrent
  comme destinataires.</para>
  
  <para xmlns:xlink="http://www.w3.org/1999/xlink">Le <acronym xmlns:xlink="http://www.w3.org/1999/xlink">DR</acronym> et le <acronym xmlns:xlink="http://www.w3.org/1999/xlink">BDR</acronym> intègrent cette
  information à leur base topologique. Le <acronym xmlns:xlink="http://www.w3.org/1999/xlink">DR</acronym> et diffuse
  l'information sur l'adresse 224.0.0.5 (tous les routeurs
  <acronym xmlns:xlink="http://www.w3.org/1999/xlink">OSPF</acronym> sans distinction). C'est le protocole d'inondation.
  Toute modification de la topologie déclenche une nouvelle exécution de
  l'algorithme du SPF et une nouvelle table de routage est constituée.</para>
  </sect2>

  <sect2 xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="zebra.ospf.details.conclusion">
    <title xmlns:xlink="http://www.w3.org/1999/xlink">Conclusion partielle</title>

  <para xmlns:xlink="http://www.w3.org/1999/xlink">Voilà pour les principes fondamentaux d'<acronym xmlns:xlink="http://www.w3.org/1999/xlink">OSPF</acronym> mais
  des notions importantes restent à évoquer si vous souhaitez déployer
  <acronym xmlns:xlink="http://www.w3.org/1999/xlink">OSPF</acronym> sur de grands réseaux (en particulier sur le
  fonctionnement d'<acronym xmlns:xlink="http://www.w3.org/1999/xlink">OSPF</acronym> sur un réseau point à point et sur
  l'agrégation de routes). Si vous voulez approfondir, reportez-vous au livre
  de <link xmlns:xlink="http://www.w3.org/1999/xlink" linkend="huitema">C. Huitema cité en bibliographie</link> qui, bien
  qu'un peu ancien est très complet sur la question. Bien sûr, vous pouvez
  toujours vous plonger dans les différentes RFC qui constituent
  <acronym xmlns:xlink="http://www.w3.org/1999/xlink">OSPF</acronym> (la <link xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.faqs.org/rfcs/rfc2328.html">
  <acronym xmlns:xlink="http://www.w3.org/1999/xlink">RFC2328</acronym></link> en particulier) et dont la lecture
  est toujours aussi agréable et passionnante ! (je plaisante, bien
  sûr).</para>

  <para xmlns:xlink="http://www.w3.org/1999/xlink">Avant d'attaquer la pratique, un dernier concept : les zones
  <acronym xmlns:xlink="http://www.w3.org/1999/xlink">OSPF</acronym>.</para>
  </sect2>
</sect1>

<sect1 xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="zebra.ospf.area">
  <title xmlns:xlink="http://www.w3.org/1999/xlink">Le concept de zone (<wordasword xmlns:xlink="http://www.w3.org/1999/xlink">area</wordasword>)</title>

  <para xmlns:xlink="http://www.w3.org/1999/xlink">Contrairement à <acronym xmlns:xlink="http://www.w3.org/1999/xlink">RIP</acronym>, <acronym xmlns:xlink="http://www.w3.org/1999/xlink">OSPF</acronym> a été
  pensé pour supporter de très grands réseaux. Mais, qui dit grand réseau, dit
  nombreuses routes. Donc, afin d'éviter que la bande passante ne soit
  engloutie dans la diffusion des routes, <acronym xmlns:xlink="http://www.w3.org/1999/xlink">OSPF</acronym> introduit le
  concept de zone (<wordasword xmlns:xlink="http://www.w3.org/1999/xlink">area</wordasword>). Le réseau est divisé en
  plusieurs zones de routage qui contiennent des routeurs et des hôtes.</para>

  <para xmlns:xlink="http://www.w3.org/1999/xlink">Chaque zone, identifiée par un numéro, possède sa propre topologie et
  ne connaît pas la topologie des autres zones. Chaque routeur d'une zone
  donnée ne connaît que les routeurs de sa propre zone ainsi que la façon
  d'atteindre une zone particulière, la zone numéro 0. Toutes les zones doivent
  être connectées physiquement à la zone 0 (appelée
  <wordasword xmlns:xlink="http://www.w3.org/1999/xlink">backbone</wordasword> ou réseau fédérateur). Elle est constituée
  de plusieurs routeurs interconnectés. Le <wordasword xmlns:xlink="http://www.w3.org/1999/xlink">backbone</wordasword>
  est chargé de diffuser les informations de routage qu'il reçoit d'une zone
  aux autres zones. Tout routage basé sur <acronym xmlns:xlink="http://www.w3.org/1999/xlink">OSPF</acronym> doit posséder
  une zone 0.</para>

  <figure xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="spf4">
    <title xmlns:xlink="http://www.w3.org/1999/xlink">Réseau découpé en trois zones</title>

  <mediaobject xmlns:xlink="http://www.w3.org/1999/xlink">
  <imageobject xmlns:xlink="http://www.w3.org/1999/xlink">
    <imagedata fileref="images/spf4.png" format="PNG" contentwidth="12cm" width="12.5cm"/>
  </imageobject>
  <caption xmlns:xlink="http://www.w3.org/1999/xlink">
    <para xmlns:xlink="http://www.w3.org/1999/xlink">Réseau découpé en trois zones</para>
  </caption>
  </mediaobject>
  </figure>

  <para xmlns:xlink="http://www.w3.org/1999/xlink">Sur la <xref xmlns:xlink="http://www.w3.org/1999/xlink" linkend="spf4"/>, le réseau est découpé en trois zones
  dont le <wordasword xmlns:xlink="http://www.w3.org/1999/xlink">backbone</wordasword>. Les routeurs de la zone 1, par
  exemple, ne connaissent pas les routeurs de la zone 2 et encore moins la
  topologie de la zone 2. L'intérêt de définir des zones est de limiter le
  trafic de routage, de réduire la fréquence des calculs du plus court chemin
  par l'algorithme SPF ainsi que d'avoir une table de routage plus petite (ce
  qui accélère la convergence). Les routeurs R1 et R4 sont particuliers
  puisqu'ils sont «à cheval» entre plusieurs zones (on les appelle
  <acronym xmlns:xlink="http://www.w3.org/1999/xlink">ABR</acronym> pour <wordasword xmlns:xlink="http://www.w3.org/1999/xlink">Area Border Router</wordasword> ou
  routeur de bordure de zone). Ces routeurs maintiennent une base de données
  topologique pour chaque zone à laquelle il sont connectés. Les
  <acronym xmlns:xlink="http://www.w3.org/1999/xlink">ABR</acronym> sont des points de sortie pour les zones ce qui
  signifie que les informations de routage destinées aux autres zones doivent
  passer par l'<acronym xmlns:xlink="http://www.w3.org/1999/xlink">ABR</acronym> local à la zone. L'<acronym xmlns:xlink="http://www.w3.org/1999/xlink">ABR</acronym>
  se charge alors de retransmettre les informations de routage au
  <wordasword xmlns:xlink="http://www.w3.org/1999/xlink">backbone</wordasword>.</para>

  <para xmlns:xlink="http://www.w3.org/1999/xlink">Les <acronym xmlns:xlink="http://www.w3.org/1999/xlink">ABRs</acronym> du <wordasword xmlns:xlink="http://www.w3.org/1999/xlink">backbone</wordasword>
  ensuite redistribueront ces informations aux autres zones auxquelles ils sont
  connectés.</para>
</sect1>

<sect1 xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="zebra.ospf.lab">
  <title xmlns:xlink="http://www.w3.org/1999/xlink">Place à la pratique</title>

  <para xmlns:xlink="http://www.w3.org/1999/xlink">Nous allons travailler avec le réseau suivant :</para>

  <figure xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="spf5">
    <title xmlns:xlink="http://www.w3.org/1999/xlink">La topologie de travail</title>

  <mediaobject xmlns:xlink="http://www.w3.org/1999/xlink">
  <imageobject xmlns:xlink="http://www.w3.org/1999/xlink">
    <imagedata fileref="images/spf5.png" format="PNG" contentwidth="12cm" width="12.5cm"/>
  </imageobject>
  <caption xmlns:xlink="http://www.w3.org/1999/xlink">
    <para xmlns:xlink="http://www.w3.org/1999/xlink">Topologie de travail</para>
  </caption>
  </mediaobject>
  </figure>

  <para xmlns:xlink="http://www.w3.org/1999/xlink">Le réseau a été découpé en trois zones. Vous remarquez que la zone 0
  permet de fédérer l'ensemble du réseau. Il s'agit du
  <wordasword xmlns:xlink="http://www.w3.org/1999/xlink">backbone</wordasword> dont nous avons déjà discuté. Le découpage
  de ce réseau en trois zones est un cas d'école dont le but est d'examiner la
  configuration d'OSPF dans un contexte multi-zone.</para>

  <para xmlns:xlink="http://www.w3.org/1999/xlink">Généralement, on considère qu'une zone peut accueillir plusieurs
  dizaines de routeurs.</para>
  
  <para xmlns:xlink="http://www.w3.org/1999/xlink">Pour ne pas surcharger ces lignes inutilement, nous nous en tiendrons
  ici à la configuration de R1, R2 et R3. Vous verrez que la configuration
  n'est pas très complexe. Par symétrie, il est facile de l'adapter aux autres
  routeurs.</para>
  
  <para xmlns:xlink="http://www.w3.org/1999/xlink">Pour votre service, chers lecteurs, j'ai mis en ligne une carte
  cliquable (<link xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://pmassol.net/lm/ospf.html">
  <citetitle xmlns:xlink="http://www.w3.org/1999/xlink">Zebra et OSPF</citetitle></link>) qui vous permettra de consulter l'état, la
  configuration complète et la table de routage des six routeurs.</para>
  
  <para xmlns:xlink="http://www.w3.org/1999/xlink">Enfin, avant de commencer, vous trouverez une traduction partielle de
  la documentation de <application xmlns:xlink="http://www.w3.org/1999/xlink">Zebra</application> à la page :
  <link xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://pmassol.net/zebra.html">
  <citetitle xmlns:xlink="http://www.w3.org/1999/xlink">GNU Zebra</citetitle></link>.</para>

  <sect2 xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="zebra.ospf.lab.start">
    <title xmlns:xlink="http://www.w3.org/1999/xlink">Situation de départ</title>

  <para xmlns:xlink="http://www.w3.org/1999/xlink">Vous devez créer des fichiers de configuration rudimentaires sur chaque
  routeur pour les services <application xmlns:xlink="http://www.w3.org/1999/xlink">Zebra</application>ou
  <application xmlns:xlink="http://www.w3.org/1999/xlink">Quagga</application> :</para>

  <itemizedlist xmlns:xlink="http://www.w3.org/1999/xlink">
    <listitem xmlns:xlink="http://www.w3.org/1999/xlink">
    <para xmlns:xlink="http://www.w3.org/1999/xlink">Fichier <filename xmlns:xlink="http://www.w3.org/1999/xlink">/etc/zebra/zebra.conf</filename> ou
    <filename xmlns:xlink="http://www.w3.org/1999/xlink">/etc/quagga/zebra.conf</filename> pour le démon principal.</para>
    <para xmlns:xlink="http://www.w3.org/1999/xlink">Exemple pour R1 :</para>
<screen xmlns:xlink="http://www.w3.org/1999/xlink" width="80">hostname R1(ZEBRA)
password foo
</screen>
    </listitem>
    <listitem xmlns:xlink="http://www.w3.org/1999/xlink">
    <para xmlns:xlink="http://www.w3.org/1999/xlink">Fichier <filename xmlns:xlink="http://www.w3.org/1999/xlink">/etc/zebra/ospfd.conf</filename> ou
    <filename xmlns:xlink="http://www.w3.org/1999/xlink">/etc/quagga/ospfd.conf</filename> pour le démon <systemitem xmlns:xlink="http://www.w3.org/1999/xlink" role="daemon">ospfd</systemitem></para>
    <para xmlns:xlink="http://www.w3.org/1999/xlink">Exemple pour R1 :</para>
<screen xmlns:xlink="http://www.w3.org/1999/xlink" width="80">hostname R1(OSPF)
password foo
</screen>
    </listitem>
  </itemizedlist>
  
  <para xmlns:xlink="http://www.w3.org/1999/xlink">Vous devez ensuite démarrer (ou redémarrer) les deux démons zebra et
  ospfd sur chaque routeur.</para>

  <note xmlns:xlink="http://www.w3.org/1999/xlink">
    <title xmlns:xlink="http://www.w3.org/1999/xlink">Précaution avec une configuration manuelle</title>
    <para xmlns:xlink="http://www.w3.org/1999/xlink">Veillez bien à respecter l'ordre d'exécution des services :
    d'abord <userinput xmlns:xlink="http://www.w3.org/1999/xlink">zebra -d</userinput> puis <userinput xmlns:xlink="http://www.w3.org/1999/xlink">ospfd</userinput>
    ensuite.</para>
  </note>

  <para xmlns:xlink="http://www.w3.org/1999/xlink">Enfin, sur R1 entrez dans le terminal de configuration de <systemitem xmlns:xlink="http://www.w3.org/1999/xlink" role="daemon">ospfd</systemitem> via <command xmlns:xlink="http://www.w3.org/1999/xlink">telnet</command> sur le port
  2604 :</para>

<screen xmlns:xlink="http://www.w3.org/1999/xlink" width="80">Linux# telnet localhost ospfd

Hello, this is zebra (version 0.91a).
Copyright 1996-2001 Kunihiro Ishiguro.

User Access Verification
Password:
R1(OSPF)&gt; enable
R1(OSPF)#
</screen>

  <para xmlns:xlink="http://www.w3.org/1999/xlink">Si vous avez envie de suivre précisément les échanges de messages entre
  routeurs, <application xmlns:xlink="http://www.w3.org/1999/xlink">Zebra</application> propose un puissant mécanisme de
  débogage grâce à la commande <command xmlns:xlink="http://www.w3.org/1999/xlink">debug</command> (je vous laisse
  découvrir tous ses paramètres). Supposons que je veuille garder une trace de
  tous les messages HELLO émis par R1 :</para>

<screen xmlns:xlink="http://www.w3.org/1999/xlink" width="80">R1(OSPF)# conf t
R1(OSPF)(config)# log file /var/log/zebra/ospfd.log
R1(OSPF)(config)# debug ospf packet hello send detail
</screen>

  <para xmlns:xlink="http://www.w3.org/1999/xlink">Il faut que le répertoire <filename xmlns:xlink="http://www.w3.org/1999/xlink" class="directory">/var/log/zebra</filename> existe.</para>
  </sect2>

  <sect2 xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="zebra.ospf.lab.ospf">
    <title xmlns:xlink="http://www.w3.org/1999/xlink">Activation du processus de routage</title>

  <para xmlns:xlink="http://www.w3.org/1999/xlink">Dans le mode <option xmlns:xlink="http://www.w3.org/1999/xlink">config</option>, nous allons activer le processus
  <acronym xmlns:xlink="http://www.w3.org/1999/xlink">OSPF</acronym> :</para>

<screen xmlns:xlink="http://www.w3.org/1999/xlink" width="80">R1(OSPF)(config)# router ospf
R1(OSPF)(config-router)#
</screen>
  </sect2>

  <sect2 xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="zebra.ospf.lab.routing">
    <title xmlns:xlink="http://www.w3.org/1999/xlink">Activation des annonces de routes</title>

  <para xmlns:xlink="http://www.w3.org/1999/xlink">Le processus de routage <acronym xmlns:xlink="http://www.w3.org/1999/xlink">OSPF</acronym> est activé mais rien ne
  se passe. Comme pour <acronym xmlns:xlink="http://www.w3.org/1999/xlink">RIP</acronym>, il faut indiquer sur quel(s)
  réseau(x) on souhaite que le routage dynamique soit opérationnel. Ceci se
  fait par la commande <userinput xmlns:xlink="http://www.w3.org/1999/xlink">network</userinput>. Mais, nouveauté par
  rapport à RIP qui n'intègre pas le concept de zone, il faut indiquer à quelle
  zone sera rattaché le réseau. Sur la <xref xmlns:xlink="http://www.w3.org/1999/xlink" linkend="spf5"/>, on voit que R1
  est relié à deux réseaux. Le réseau 30.0.0.0/8 est attaché à la zone 0 et le
  réseau 11.0.0.0/8 à la zone 1. La configuration se fait donc de cette
  manière :</para>

<screen xmlns:xlink="http://www.w3.org/1999/xlink" width="80">R1(OSPF)(config-router)# network 30.0.0.0/8 area 0
R1(OSPF)(config-router)# network 11.0.0.0/8 area 1
</screen>

  <para xmlns:xlink="http://www.w3.org/1999/xlink">Que se passe-t-il sur le réseau ? R1 envoie des paquets HELLO sur
  les interfaces pour lesquelles la commande <userinput xmlns:xlink="http://www.w3.org/1999/xlink">network</userinput> a
  été saisie. Mais personne n'est là pour les écouter. Activez le routage sur
  R2 en adaptant les commandes aux spécificités du routeur. Je vous aide un
  peu. Sur R2, vous réaliserez les configurations suivantes :</para>

<screen xmlns:xlink="http://www.w3.org/1999/xlink" width="80">R2(OSPF)(config-router)# network 11.0.0.0/8 area 1
R2(OSPF)(config-router)# network 12.0.0.0/8 area 1
</screen>

  <para xmlns:xlink="http://www.w3.org/1999/xlink">Enfin, sur R3, vous réaliserez les configurations
  suivantes :</para>

<screen xmlns:xlink="http://www.w3.org/1999/xlink" width="80">R3(OSPF)(config-router)# network 12.0.0.0/8 area 1
R3(OSPF)(config-router)# network 192.168.3.0/24 area 1
</screen>

  <para xmlns:xlink="http://www.w3.org/1999/xlink">Mais sur R3, il y a une particularité. Le réseau 192.168.3.0/24
  contient des ordinateurs mais aucun routeur. La commande
  <userinput xmlns:xlink="http://www.w3.org/1999/xlink">network</userinput> va diffuser sur ce réseau des annonces de
  routes ce qui consomme inutilement de la bande passante. Par conséquent, nous
  allons désactiver cette diffusion :</para>

<screen xmlns:xlink="http://www.w3.org/1999/xlink" width="80">R3(OSPF)(config-router)# passive-interface eth1
</screen>

  <para xmlns:xlink="http://www.w3.org/1999/xlink">Ainsi, aucune route n'est diffusée sur cette interface. De même, aucune
  annonce de route ne sera prise en compte. Le réseau sera considéré comme
  étant d'extrémité (<wordasword xmlns:xlink="http://www.w3.org/1999/xlink">stub</wordasword>).</para>
  </sect2>

  <sect2 xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="zebra.ospf.lab.display">
    <title xmlns:xlink="http://www.w3.org/1999/xlink">Affichage de la configuration</title>
    
  <para xmlns:xlink="http://www.w3.org/1999/xlink">Affichons la configuration complète de R1 :</para>

<screen xmlns:xlink="http://www.w3.org/1999/xlink" width="80">R1(OSPF)(config-router)# end
R1(OSPF)# show running-config

Current configuration:
!
hostname R1(OSPF)
password foo
!
!
!
interface lo
!
interface eth0
!
interface eth1
!
router ospf
network 11.0.0.0/8 area 1
network 30.0.0.0/8 area 0
!
line vty
!
end
</screen>

  <para xmlns:xlink="http://www.w3.org/1999/xlink">Affichons la configuration complète de R3 :</para>

<screen xmlns:xlink="http://www.w3.org/1999/xlink" width="80">R3(OSPF)# show running-config

Current configuration:
!
hostname R3(OSPF)
password foo
!
!
!
interface lo
!
interface eth0
!
interface eth1
!
router ospf
passive-interface eth1
network 12.0.0.0/8 area 1
network 192.168.3.0/24 area 1
!
line vty
!
end
</screen>

  <para xmlns:xlink="http://www.w3.org/1999/xlink">J'espère que vous avez la même configuration. Si ce n'est pas le cas,
  vous pouvez annuler une ligne contenant une erreur en vous remettant au même
  endroit où vous avez saisi la commande et en saisissant à nouveau la
  commande, mais en la faisant précéder de <option xmlns:xlink="http://www.w3.org/1999/xlink">no</option>.</para>

  <para xmlns:xlink="http://www.w3.org/1999/xlink">Pour enregistrer la configuration, je vous rappelle que l'on
  saisit :</para>

<screen xmlns:xlink="http://www.w3.org/1999/xlink" width="80">R1(OSPF)# copy running-config startup-config
</screen>

  <para xmlns:xlink="http://www.w3.org/1999/xlink">Reproduisez maintenant ces manipulations sur l'ensemble des routeurs du
  réseau.</para>
  </sect2>

  <sect2 xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="zebra.ospf.lab.state">
    <title xmlns:xlink="http://www.w3.org/1999/xlink">État des routeurs</title>

  <para xmlns:xlink="http://www.w3.org/1999/xlink">Nos petits routeurs ont, en principe, bien travaillé. Dans chaque zone,
  ils ont élu leur chef, le routeur désigné (<acronym xmlns:xlink="http://www.w3.org/1999/xlink">DR</acronym>), ils ont
  échangé leurs connaissances et calculé une magnifique table de routage,
  ultra-optimale. En résumé, les deux stations d'extrémité de la figure doivent
  pouvoir s'atteindre avec une commande <command xmlns:xlink="http://www.w3.org/1999/xlink">ping</command>. Si jamais ce
  n'est pas le cas, c'est que probablement vous vous êtes trompé dans une
  configuration. Dans ce cas, reprenez la configuration de chaque appareil.
  Utilisez les outils <command xmlns:xlink="http://www.w3.org/1999/xlink">ping</command>, <command xmlns:xlink="http://www.w3.org/1999/xlink">tcpdump</command> et
  <command xmlns:xlink="http://www.w3.org/1999/xlink">traceroute</command> pour contrôler votre configuration et suivre
  les paquets. Et n'oubliez pas que dans un <command xmlns:xlink="http://www.w3.org/1999/xlink">ping</command>, il y a un
  aller mais aussi un retour !</para>

  <para xmlns:xlink="http://www.w3.org/1999/xlink">Afin d'illustrer ce dont nous avons discuté dans la toute première
  partie de cet article, examinons l'état du routeur R1. Nous pouvons faire un
  diagnostic très complet de l'appareil en utilisant les nombreuses
  sous-commandes de <userinput xmlns:xlink="http://www.w3.org/1999/xlink">show ip ospf</userinput>. Vous constaterez que
  les informations fournies par <systemitem xmlns:xlink="http://www.w3.org/1999/xlink" role="daemon">ospfd</systemitem>
  sur son état sont beaucoup plus conséquentes que celles que l'on pouvait
  extirper de <systemitem xmlns:xlink="http://www.w3.org/1999/xlink" role="daemon">ripd</systemitem>.</para>

  <para xmlns:xlink="http://www.w3.org/1999/xlink">Dans un premier temps, je vous propose d'examiner l'état de santé
  général du routeur R3 :</para>

<screen xmlns:xlink="http://www.w3.org/1999/xlink" width="80">R3(OSPF)# show ip ospf
 OSPF Routing Process, Router ID: 192.168.3.254
 Supports only single TOS (TOS0) routes
 This implementation conforms to RFC2328
 RFC1583Compatibility flag is disabled
 SPF schedule delay 5 secs, Hold time between two SPFs 10 secs
 Refresh timer 10 secs
 Number of external LSA 0
 Number of areas attached to this router: 1

 Area ID: 0.0.0.1
   Shortcutting mode: Default, S-bit consensus: no
   Number of interfaces in this area: Total: 2, Active: 2
   Number of fully adjacent neighbors in this area: 1
   Area has no authentication
   Number of full virtual adjacencies going through this area: 0
   SPF algorithm executed 13 times
   Number of LSA 9
</screen>

  <para xmlns:xlink="http://www.w3.org/1999/xlink">Le premier bloc décrit le fonctionnement général du routeur : l'ID
  du routeur (égale à sa plus grande adresse IP), conformité aux RFC, valeurs
  des temporisateurs. Une seule zone est attachée à ce routeur. C'est la zone 1
  (exprimée en notation décimale pointée). Notre routeur a deux interfaces dans
  la zone, il n'a qu'un seul voisin. L'algorithme du SPF a été exécuté 13 fois.
  La base de données topologique contient neuf états de liens
  (<acronym xmlns:xlink="http://www.w3.org/1999/xlink">LSA</acronym>). Si notre routeur était attaché à plusieurs zones,
  le deuxième bloc serait répété autant de fois que de zones. Vous pourrez le
  constater sur R1.</para>

  <para xmlns:xlink="http://www.w3.org/1999/xlink">Maintenant, listons nos informations sur les routeurs
  voisins :</para>

<screen xmlns:xlink="http://www.w3.org/1999/xlink" width="80">R3(OSPF)# show ip ospf neighbor

Neighbor ID  Pri  State       Dead Time Address   Interface  RXmtL  RqstL  DBsmL
12.0.0.1     1    Full/Backup 00:00:34  12.0.0.1  eth0       0      0      0
</screen>

  <para xmlns:xlink="http://www.w3.org/1999/xlink">Déchiffrons ces informations. La différence entre la colonne ID et la
  colonne <emphasis xmlns:xlink="http://www.w3.org/1999/xlink">Address</emphasis>, c'est que l'ID identifie l'appareil
  dans le réseau alors que l'adresse correspond à l'interface à laquelle nous
  sommes relié avec ce routeur. La colonne <emphasis xmlns:xlink="http://www.w3.org/1999/xlink">State</emphasis> nous
  apprend deux choses : il est synchronisé avec le routeur désigné
  (<acronym xmlns:xlink="http://www.w3.org/1999/xlink">DR</acronym>) grâce à la mention <emphasis xmlns:xlink="http://www.w3.org/1999/xlink">Full</emphasis>, c'est
  le routeur désigné de secours (<acronym xmlns:xlink="http://www.w3.org/1999/xlink">BDR</acronym>) de la zone grâce à
  l'indicateur <emphasis xmlns:xlink="http://www.w3.org/1999/xlink">Backup</emphasis>. Ce routeur sera déclaré comme
  inactif si nous ne recevons pas de message HELLO d'ici 34 secondes
  (<emphasis xmlns:xlink="http://www.w3.org/1999/xlink">Dead Time</emphasis>).</para>

  <para xmlns:xlink="http://www.w3.org/1999/xlink">Voyons le contenu de la base de données topologique de R3 :</para>

<screen xmlns:xlink="http://www.w3.org/1999/xlink" width="80">R3(OSPF)# show ip ospf database
       OSPF Router with ID (192.168.3.254)
                Router Link States (Area 0.0.0.1)

Link ID         ADV Router      Age   Seq#       CkSum   Link count
12.0.0.1        12.0.0.1        981   0x80000006 0xf9e2  2
30.0.0.1        30.0.0.1        952   0x80000003 0xb13e  1
192.168.3.254   192.168.3.254   1063  0x80000005 0x15b7  2

       Net Link States (Area 0.0.0.1)

Link ID         ADV Router      Age   Seq#       CkSum
11.0.0.2        12.0.0.1        981   0x80000001 0xda39
12.0.0.2        192.168.3.254   1063  0x80000001 0x5d0b

       Summary Link States (Area 0.0.0.1)

Link ID         ADV Router      Age   Seq#       CkSum   Route
21.0.0.0        30.0.0.1        837   0x80000001 0x0d08  21.0.0.0/8
22.0.0.0        30.0.0.1        702   0x80000001 0x64a5  22.0.0.0/8
30.0.0.0        30.0.0.1        976   0x80000001 0x33e2  30.0.0.0/8
172.18.0.0      30.0.0.1        599   0x80000001 0x4a0d  172.18.0.0/24
</screen>

  <para xmlns:xlink="http://www.w3.org/1999/xlink">Ces trois tableaux présentent de façon synthétique l'ensemble des
  <acronym xmlns:xlink="http://www.w3.org/1999/xlink">LSA</acronym> stockés dans la base topologique.</para>
  
  <itemizedlist xmlns:xlink="http://www.w3.org/1999/xlink">
    <listitem xmlns:xlink="http://www.w3.org/1999/xlink">
    <para xmlns:xlink="http://www.w3.org/1999/xlink">Le premier tableau contient des <acronym xmlns:xlink="http://www.w3.org/1999/xlink">LSA</acronym> diffusés par
    chaque routeur. Ils décrivent l'état des interfaces de chaque
    routeur.</para>
    </listitem>
    <listitem xmlns:xlink="http://www.w3.org/1999/xlink">
    <para xmlns:xlink="http://www.w3.org/1999/xlink">Le deuxième tableau contient des <acronym xmlns:xlink="http://www.w3.org/1999/xlink">LSA</acronym> diffusés par
    le routeur désigné (<acronym xmlns:xlink="http://www.w3.org/1999/xlink">DR</acronym>). Ils décrivent la liste des
    routeurs présents dans chaque réseau.</para>
    </listitem>
    <listitem xmlns:xlink="http://www.w3.org/1999/xlink">
    <para xmlns:xlink="http://www.w3.org/1999/xlink">Le dernier tableau contient un résumé des routes diffusées par le
    routeur de bordure de zone (<acronym xmlns:xlink="http://www.w3.org/1999/xlink">ABR</acronym>). Ce sont des routes
    qu'il a reçu via le réseau fédérateur (<wordasword xmlns:xlink="http://www.w3.org/1999/xlink">backbone</wordasword>)
    par les routeurs des autres zones.</para>
    </listitem>
  </itemizedlist>
  
  <para xmlns:xlink="http://www.w3.org/1999/xlink">L'âge et le numéro de séquence sont utilisés pour mettre à jour la base
  lorsque des <acronym xmlns:xlink="http://www.w3.org/1999/xlink">LSA</acronym> sont reçus. La somme de contrôle
  (<wordasword xmlns:xlink="http://www.w3.org/1999/xlink">checksum</wordasword> noté <acronym xmlns:xlink="http://www.w3.org/1999/xlink">CkSum</acronym> est utilisée
  pour contrôler l'intégrité des LSA.</para>

  <para xmlns:xlink="http://www.w3.org/1999/xlink">Pour obtenir des informations détaillées sur chaque
  <acronym xmlns:xlink="http://www.w3.org/1999/xlink">LSA</acronym>, vous pouvez compléter la commande <userinput xmlns:xlink="http://www.w3.org/1999/xlink">show ip
  ospf database</userinput> par les options suivantes :
  <userinput xmlns:xlink="http://www.w3.org/1999/xlink">router</userinput>, <userinput xmlns:xlink="http://www.w3.org/1999/xlink">network</userinput> ou
  <userinput xmlns:xlink="http://www.w3.org/1999/xlink">summary</userinput>. Par exemple : <userinput xmlns:xlink="http://www.w3.org/1999/xlink">show ip ospf
  database router 192.168.3.254</userinput> (qui correspond à la troisième
  ligne du premier tableau) vous apprendra que ce router est relié à deux
  réseaux : un de transit (12.0.0.0/8) et un d'extrémité
  (<wordasword xmlns:xlink="http://www.w3.org/1999/xlink">stub</wordasword>) 192.168.3.0/24.</para>

  <para xmlns:xlink="http://www.w3.org/1999/xlink">Enfin, si vous voulez consulter la table de routage obtenue après
  traitement par SPF des différents <acronym xmlns:xlink="http://www.w3.org/1999/xlink">LSA</acronym>, vous n'aurez qu'à
  saisir un <userinput xmlns:xlink="http://www.w3.org/1999/xlink">show ip ospf route</userinput>.</para>
  
  <note xmlns:xlink="http://www.w3.org/1999/xlink">
    <title xmlns:xlink="http://www.w3.org/1999/xlink">Rappel important</title>
    <para xmlns:xlink="http://www.w3.org/1999/xlink">Il existe une différence entre cette table et celle utilisée par le
    démon <systemitem xmlns:xlink="http://www.w3.org/1999/xlink" role="daemon">zebra</systemitem> pour le routage
    proprement dit. Souvenez-vous que <application xmlns:xlink="http://www.w3.org/1999/xlink">Zebra</application> et
    <application xmlns:xlink="http://www.w3.org/1999/xlink">Quagga</application> sont multi-protocole et qu'ils ont une
    architecture modulaire (voir LM 43 : <link xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.inetdoc.net/guides/zebra.rip/">
  <citetitle xmlns:xlink="http://www.w3.org/1999/xlink">2ème partie, routage RIP</citetitle></link>). Chaque démon
    calcule une table de routage à partir des informations dont il dispose (et
    qui ne sont pas nécessairement les mêmes pour chaque démon). Ensuite, ils
    transmettent chacun leur table au démon <systemitem xmlns:xlink="http://www.w3.org/1999/xlink" role="daemon">zebra</systemitem> qui en fait la synthèse. Cette synthèse
    constitue la véritable table de routage utilisée pour router les
    paquets.</para>
  </note>

  <para xmlns:xlink="http://www.w3.org/1999/xlink">Nous avons fait un tour d'horizon des principales commandes de
  <application xmlns:xlink="http://www.w3.org/1999/xlink">Zebra</application> permettant de surveiller l'état de ospfd. Il
  y en a encore beaucoup d'autres que je vous laisse découvrir (faites un
  <userinput xmlns:xlink="http://www.w3.org/1999/xlink">show ip ospf ?</userinput> par exemple). Il nous reste à observer
  la table de routage obtenue par <application xmlns:xlink="http://www.w3.org/1999/xlink">Zebra</application>. Quittez
  <systemitem xmlns:xlink="http://www.w3.org/1999/xlink" role="daemon">ospfd</systemitem> et connectez-vous sur le démon
  <systemitem xmlns:xlink="http://www.w3.org/1999/xlink" role="daemon">zebra</systemitem> via la commande
  <userinput xmlns:xlink="http://www.w3.org/1999/xlink">telnet localhost 2601</userinput> :</para>

<screen xmlns:xlink="http://www.w3.org/1999/xlink" width="80">R3(Zebra)&gt; show ip route
Codes: K - kernel route, C - connected, S - static, R - RIP, O - OSPF,
       B - BGP, &gt; - selected route, * - FIB route

O&gt;* 11.0.0.0/8 [110/20] via 12.0.0.1, eth0, 00:12:48
O      12.0.0.0/8 [110/10] is directly connected, eth0, 00:14:09
C&gt;* 12.0.0.0/8 is directly connected, eth0
O&gt;* 21.0.0.0/8 [110/40] via 12.0.0.1, eth0, 00:11:18
O&gt;* 22.0.0.0/8 [110/50] via 12.0.0.1, eth0, 00:10:16
O&gt;* 30.0.0.0/8 [110/30] via 12.0.0.1, eth0, 00:12:13
C&gt;* 127.0.0.0/8 is directly connected, lo
O&gt;* 172.18.0.0/24 [110/60] via 12.0.0.1, eth0, 00:08:48
O      192.168.3.0/24 [110/10] is directly connected, eth1, 00:14:19
C&gt;* 192.168.3.0/24 is directly connected, eth1
</screen>

  <para xmlns:xlink="http://www.w3.org/1999/xlink">Les routes notées 'O' ont été découvertes par <acronym xmlns:xlink="http://www.w3.org/1999/xlink">OSPF</acronym>.
  Entre crochets, on observe la distance administrative du protocole (110 par
  défaut pour <acronym xmlns:xlink="http://www.w3.org/1999/xlink">OSPF</acronym>) et le coût de la route pour accéder au
  réseau. Dans le cas de la topologie étudiée, il n'y a que des réseaux à 10
  Mbits/s, donc avec un coût par défaut de 10 pour chaque lien.</para>
  </sect2>
  
  <sect2 xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="zebra.ospf.lab.secure">
    <title xmlns:xlink="http://www.w3.org/1999/xlink">Quelques éléments sur la sécurité</title>

  <sect3 xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="zebra.ospf.lab.secure.filter">
    <title xmlns:xlink="http://www.w3.org/1999/xlink">Filtrer la diffusion des routes</title>

  <para xmlns:xlink="http://www.w3.org/1999/xlink">Le premier inconvénient d'un protocole de routage dynamique comme
  <acronym xmlns:xlink="http://www.w3.org/1999/xlink">OSPF</acronym> est sa volubilité. Il a tendance à dévoiler tout un
  tas d'informations sur les réseaux qu'un administrateur consciencieux n'a pas
  forcément envie de révéler. Pour limiter la diffusion des routes au strict
  minimum, ospfd intègre, à l'instar de <systemitem xmlns:xlink="http://www.w3.org/1999/xlink" role="daemon">ripd</systemitem>, un mécanisme de liste de contrôle d'accès
  (<wordasword xmlns:xlink="http://www.w3.org/1999/xlink">access-lists</wordasword>).</para>
  
  <para xmlns:xlink="http://www.w3.org/1999/xlink">Reportez-vous à l'article <link xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.inetdoc.net/guides/zebra.rip/">
  <citetitle xmlns:xlink="http://www.w3.org/1999/xlink">2ème partie, routage RIP</citetitle></link> publié dans le numéro 43 de
  <link xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.linuxmag-france.org/">
  <citetitle xmlns:xlink="http://www.w3.org/1999/xlink">Linux Magazine</citetitle></link>. La configuration est strictement identique. J'en profite pour
  faire un peu de publicité : si vous êtes intéressés par les problèmes de
  sécurité, je vous conseille l'excellent magazine <link xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.miscmag.com/">
  <citetitle xmlns:xlink="http://www.w3.org/1999/xlink">Multi-system &amp; Internet Security
  Cookbook</citetitle> (<acronym xmlns:xlink="http://www.w3.org/1999/xlink">MISC</acronym>)</link>. La série
  d'articles sur la «protection de l'infrastructure réseau IP» constitue sur
  certains points un approfondissement intéressant.</para>
  </sect3>

  <sect3 xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="zebra.ospf.lab.secure.crypt">
    <title xmlns:xlink="http://www.w3.org/1999/xlink">Protéger les annonces de routes</title>

  <para xmlns:xlink="http://www.w3.org/1999/xlink">Le deuxième inconvénient d'un protocole de routage dynamique comme
  <acronym xmlns:xlink="http://www.w3.org/1999/xlink">OSPF</acronym> est sa naïveté. Il croit tout ce qu'on lui dit ! Un
  petit malin pourrait s'amuser à diffuser des routes farfelues à vos routeurs,
  ce qui pourrait provoquer des dénis de service. Pour pallier à cela, on peut
  activer l'authentification des annonces sur une zone. Voici les manipulations
  à réaliser sur chaque routeur :</para>

<screen xmlns:xlink="http://www.w3.org/1999/xlink" width="80">Routeur(OSPF)(config-router)# area 1 authentication message-digest
</screen>

  <para xmlns:xlink="http://www.w3.org/1999/xlink">Ensuite, pour chaque interface participant à la diffusion des
  routes :</para>

<screen xmlns:xlink="http://www.w3.org/1999/xlink" width="80">Routeur(OSPF)(config)# int ethx
Routeur(OSPF)(config-if)# ospf message-digest-key 1 md5 motdepasse
</screen>

  <para xmlns:xlink="http://www.w3.org/1999/xlink">Vous adapterez le «motdepasse» à vos besoins. Ce mot de passe doit bien
  sûr être connu de tous les routeurs.</para>
  </sect3>
  </sect2>
</sect1>

<sect1 xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="zebra.ospf.conclusion">
  <title xmlns:xlink="http://www.w3.org/1999/xlink">Conclusion</title>

  <para xmlns:xlink="http://www.w3.org/1999/xlink"><acronym xmlns:xlink="http://www.w3.org/1999/xlink">OSPF</acronym> est un protocole de routage dynamique moderne,
  robuste et conçu pour les grands réseaux. On constate qu'il est nettement
  plus complexe que <acronym xmlns:xlink="http://www.w3.org/1999/xlink">RIP</acronym>. Pas forcément dans sa configuration
  mais dans son fonctionnement interne. Un inconvénient de ce protocole est
  qu'il peut être gourmand en puissance de calcul et en mémoire lorsque le
  réseau comporte beaucoup de routes ou qu'il y a de fréquentes modifications
  de topologie.</para>

  <para xmlns:xlink="http://www.w3.org/1999/xlink"><acronym xmlns:xlink="http://www.w3.org/1999/xlink">OSPF</acronym> est un protocole <acronym xmlns:xlink="http://www.w3.org/1999/xlink">IGP</acronym>
  (<wordasword xmlns:xlink="http://www.w3.org/1999/xlink">Interior Gateway Protocol</wordasword>), c'est-à-dire qu'il agit
  au sein d'un système autonome. Un <acronym xmlns:xlink="http://www.w3.org/1999/xlink">AS</acronym>
  (<wordasword xmlns:xlink="http://www.w3.org/1999/xlink">Autonomous System</wordasword>) est un ensemble de réseaux gérés
  par un administrateur commun. Chaque système autonome possède un numéro
  identifiant sur 16 bits délivré par l'<acronym xmlns:xlink="http://www.w3.org/1999/xlink">IANA</acronym>
  (<wordasword xmlns:xlink="http://www.w3.org/1999/xlink">Internet Assigned Numbers Authority</wordasword>) ou ses
  délégations. Classiquement, les multinationales, les opérateurs de télécom ou
  les fournisseurs d'accès à Internet détiennent un numéro de système
  autonome.</para>
  
  <para xmlns:xlink="http://www.w3.org/1999/xlink">Pour assurer le routage entre les systèmes autonomes, un protocole de
  type <acronym xmlns:xlink="http://www.w3.org/1999/xlink">EGP</acronym> (<wordasword xmlns:xlink="http://www.w3.org/1999/xlink">Exterior Gateway
  Protocol</wordasword>) doit être mis en oeuvre. Dans le cas de l'Internet,
  c'est généralement <acronym xmlns:xlink="http://www.w3.org/1999/xlink">BGP</acronym> (<wordasword xmlns:xlink="http://www.w3.org/1999/xlink">Border Gateway
  Protocol</wordasword>) qui assume cette mission. <acronym xmlns:xlink="http://www.w3.org/1999/xlink">BGP</acronym>,
  protocole supporté par Zebra, constitue un vaste terrain
  d'investigation.</para>
  
  <para xmlns:xlink="http://www.w3.org/1999/xlink">Pour terminer, je voudrais saluer tous mes étudiants de BTS
  Informatique de gestion à Loudun qui m'ont aidé dans la réalisation de ce
  document.</para>

  <sect2 xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="zebra.ospf.conclusion.biblio">
    <title xmlns:xlink="http://www.w3.org/1999/xlink">Bibliographie</title>
    
  <variablelist xmlns:xlink="http://www.w3.org/1999/xlink">
    <varlistentry xmlns:xlink="http://www.w3.org/1999/xlink">
      <term xmlns:xlink="http://www.w3.org/1999/xlink"><citetitle xmlns:xlink="http://www.w3.org/1999/xlink">TCP/IP : Architecture, protocoles et
      applications</citetitle></term>
      <listitem xmlns:xlink="http://www.w3.org/1999/xlink">
      <para xmlns:xlink="http://www.w3.org/1999/xlink">Douglas COMER, DUNOD. ISBN: 2-10-005384-1 (09/2001) 830 p.</para>
      </listitem>
    </varlistentry>
    <varlistentry xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="huitema">
      <term xmlns:xlink="http://www.w3.org/1999/xlink"><citetitle xmlns:xlink="http://www.w3.org/1999/xlink">Le routage dans l'Internet</citetitle></term>
      <listitem xmlns:xlink="http://www.w3.org/1999/xlink">
      <para xmlns:xlink="http://www.w3.org/1999/xlink">Christian HUITEMA, EYROLLES. ISBN: 2-212-08902-3 (10/1994) 418 p.</para>
      </listitem>
    </varlistentry>
  </variablelist>
  </sect2>

  <sect2 xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="zebra.ospf.conclusion.links">
    <title xmlns:xlink="http://www.w3.org/1999/xlink">Liens</title>

  <itemizedlist xmlns:xlink="http://www.w3.org/1999/xlink">
    <listitem xmlns:xlink="http://www.w3.org/1999/xlink">
    <para xmlns:xlink="http://www.w3.org/1999/xlink"><link xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.quagga.net/">
  <citetitle xmlns:xlink="http://www.w3.org/1999/xlink">Quagga</citetitle></link></para>
    </listitem>
    <listitem xmlns:xlink="http://www.w3.org/1999/xlink">
    <para xmlns:xlink="http://www.w3.org/1999/xlink"><link xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.linuxmag-france.org/">
  <citetitle xmlns:xlink="http://www.w3.org/1999/xlink">Linux Magazine</citetitle></link></para>
    </listitem>
    <listitem xmlns:xlink="http://www.w3.org/1999/xlink">
    <para xmlns:xlink="http://www.w3.org/1999/xlink">Version originale du document et page personnelle de
    <link xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.pmassol.net/">
  <citetitle xmlns:xlink="http://www.w3.org/1999/xlink">Pacôme Massol</citetitle></link></para>
    </listitem>
  </itemizedlist>
  </sect2>
</sect1>
</article>

