Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Computer Networking :
        Principles, Protocols and Practice
                 Part 4 : Network Layer


               ...
Network layer

       Basics
              Datagram mode
              Virtual circuits


       Routing



       IP...
The network layer

      Transport                                             Transport
                     Packets     ...
Two types of datalink layers




CNPP/2008.4.                       © O. Bonaventure, 2007
Two types of datalink layers
     WAN          type datalink layer
              PPP, HDLC
               Reliable exch...
Two types of datalink layers
     WAN          type datalink layer
              PPP, HDLC
               Reliable exch...
Two types of datalink layers
     WAN           type datalink layer
              PPP, HDLC
               Reliable exc...
The datalink service

                         Network                     Network
                         Datalink      ...
Routers

                             LD1
                                      R          LANα

                         ...
Network layer
               Basic principles




CNPP/2008.4.                      © O. Bonaventure, 2007
Network layer
                            Basic principles
       Each     host/router must be identified by a
           ...
Network layer
                         Basic principles
       Each  host/router must be identified by a
        network l...
Network layer
                         Basic principles
       Each  host/router must be identified by a
        network l...
Network layer
                          Basic principles
       Each  host/router must be identified by a
        network ...
Internal organisation of the
                      network layer




CNPP/2008.4.                       © O. Bonaventure, ...
Internal organisation of the
                                         network layer
       Two        possible organisati...
Internal organisation of the
                                         network layer
       Two        possible organisati...
Datagram transmission mode




CNPP/2008.4.                        © O. Bonaventure, 2007
Datagram transmission mode
        Basics
              Each route/host is identified by an address
              Inform...
Datagram transmission mode
        Basics
              Each route/host is identified by an address
              Inform...
Datagram transmission mode (2)
               R1ʼs routing table
                   A via West                            ...
Datagram transmission mode (2)
               R1ʼs routing table
                   A via West                            ...
Datagram transmission mode (2)
               R1ʼs routing table
                   A via West                            ...
Datagram transmission mode (2)
               R1ʼs routing table
                   A via West                            ...
Datagram transmission mode (2)
               R1ʼs routing table
                   A via West                            ...
Virtual circuit organisation




CNPP/2008.4.                       © O. Bonaventure, 2007
Virtual circuit organisation

       Goals
              Keep forwarding on the routers as simple as
               poss...
Virtual circuit organisation

       Goals
              Keep forwarding on the routers as simple as
               poss...
Virtual circuit organisation

       Goals
              Keep forwarding on the routers as simple as
               poss...
Establishment of a virtual circuit


               Addr:B
                                                   Addr:E
     ...
Establishment of a virtual circuit

           Open(Dest=J)
                    Addr:B
                                   ...
Establishment of a virtual circuit

           Open(Dest=J)
                    Addr:B
                             Open(D...
Establishment of a virtual circuit

           Open(Dest=J)
                    Addr:B
                             Open(D...
Establishment of a virtual circuit

           Open(Dest=J)
                    Addr:B
                             Open(D...
Establishment of a virtual circuit

           Open(Dest=J)
                      Addr:B
                               Op...
Establishment of a virtual circuit

           Open(Dest=J)
                      Addr:B
                               Op...
Establishment of a virtual circuit

           Open(Dest=J)
                      Addr:B
                               Op...
Establishment of a virtual circuit

           Open(Dest=J)
                      Addr:B
                               Op...
Establishment of a virtual circuit

           Open(Dest=J)
                      Addr:B
                               Op...
Packet transmission
                         Addr:B
                                                                      ...
Packet transmission (2)
          How unique should virtual circuits identifiers be ?
              globally unique
     ...
Virtual circuits : example

                                   Label forwarding table
                              Inport...
Network layer

       Basics

       Routing
              Static routing
              Distance vector routing
      ...
Routing and Forwarding
     Main          objective of network layer
              transport packets form source to dest...
Routing (2)

       How            to build the routing tables of each router ?

                              A         ...
Selection of the shortest paths




                                            Cost=1                 Cost=1
            ...
Selection of the shortest paths

        Routing table
           A : Local
           D : South
            B : East
    ...
Selection of the shortest paths

                                              Routing table
        Routing table        ...
Selection of the shortest paths

                                              Routing table
        Routing table        ...
Selection of the shortest paths

                                                Routing table
        Routing table      ...
Selection of the shortest paths

                                                Routing table
        Routing table      ...
Static Routing

      Principle
              Network manager or network management
               station computes all ...
Dynamic or distributed routing

       Principle
              routers exchange messages and use a
               distri...
Network layer

       Basics

       Routing
              Static routing
              Distance vector routing
      ...
Distance vector routing

       Basic               principles                            Cost=1            Cost=1
      ...
Distance vector routing (2)
              Routing table maintained by router
                  For each destination d in...
Distance vector routing (3)
              Processing of received distance vectors
               Received(Vector V[],link...
Distance vectors
                                                         example
                  All links have a unit...
Distance vectors
                                                          example
                  All links have a uni...
Distance vectors
                                              example (2)

                                  Routing tabl...
Distance vectors
                                          example (3)

                              Routing table       ...
Distance vectors
                                          example (3)

                              Routing table       ...
Distance vectors
                                         example (4)
                             Routing table

     Rou...
Distance vectors
                                            example (4)
                                Routing table

  ...
Distance vectors
                                                     example (4)
                                        ...
Distance vectors
                                            example (5)
                 B is the first to send its vecto...
Distance vectors
                                               example (5)
                 B is the first to send its ve...
Distance vectors
                                           example (6)
                                   Routing table
 ...
Distance vectors
                                               example (6)
                                       Routing...
Distance vectors
                                                    example (7)
        Routing table                    ...
Distance vectors
                                        Link failures
              How to deal with link failures ?
   ...
Detection of link failures

       Two          types of solutions
              rely on failure information from datali...
How to update the routing table ?

       All   routes that use a failed link are marked
           with an infinite cost
...
How to update the routing table ? (2)

       Reception        of a distance vector
               Received(Vector V[],li...
How to update the routing
                                         table ? (3)
       Routing table              Routing t...
How to update the routing
                                           table ? (3)
       Routing table                Routi...
How to update the routing
                                      table ? (4)


       Routing table                        ...
How to update the routing
                                        table ? (4)


       Routing table                      ...
How to update the routing
                                           table ? (5)

         Routing table                Ro...
How to update the routing
                                           table ? (6)

          Routing table              Rou...
How to update the routing
                                           table ? (6)

          Routing table               Ro...
How to update the routing
                                     table ? (7)

      Routing table           Routing table   ...
How to update the routing
                                         table ? (7)

      Routing table              Routing t...
Second link failure


       Routing table            Routing table                  Routing table
       A : 0 [ Local ] ...
Second link failure


       Routing table            Routing table                  Routing table
       A : 0 [ Local ] ...
Second link failure (2)


       Routing table              Routing table              Routing table
       A : 0 [ Local ...
Second link failure (3)
               Upon reception of Aʼs vector, D updates its
                routing table
       R...
Second link failure (3)
               Upon reception of Aʼs vector, D updates its
                routing table
       R...
Second link failure (4)



       Routing table           Routing table            Routing table
       A : 0 [ Local ]   ...
Second link failure (4)



       Routing table               Routing table             Routing table
       A : 0 [ Local...
Second link failure (5)

        Routing table               Routing table             Routing table
        A : 0 [ Local...
Second link failure (5)

        Routing table                  Routing table               Routing table
        A : 0 [ ...
Second link failure (6)
        Where             does counting to infinity comes
           form ?
              A route...
Split horizon

       Back              to previous example
      Routing table               Routing table              ...
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
4 network.key
Upcoming SlideShare
Loading in …5
×

4 network.key

2,751 views

Published on

Computer Networking : Principles, Protocols and Practice part 4

Published in: Education
  • Be the first to comment

4 network.key

  1. 1. Computer Networking : Principles, Protocols and Practice Part 4 : Network Layer Olivier Bonaventure http://inl.info.ucl.ac.be/ CNPP/2008.4. © O. Bonaventure 2008
  2. 2. Network layer  Basics  Datagram mode  Virtual circuits  Routing  IP : Internet Protocol  Routing in IP networks CNPP/2008.4. © O. Bonaventure, 2007
  3. 3. The network layer Transport Transport Packets Packets Network Network Network Datalink Datalink Datalink Physical Physical Physical  Goal  Allow packets to be forwarded from any source to any destination through heterogeneous networks and routers  Services  Unreliable connectionless service  Reliable connection-oriented service CNPP/2008.4. © O. Bonaventure, 2007
  4. 4. Two types of datalink layers CNPP/2008.4. © O. Bonaventure, 2007
  5. 5. Two types of datalink layers  WAN type datalink layer  PPP, HDLC  Reliable exchange of frames between two hosts attached to the same “link”  Mainly used by wide area networks CNPP/2008.4. © O. Bonaventure, 2007
  6. 6. Two types of datalink layers  WAN type datalink layer  PPP, HDLC  Reliable exchange of frames between two hosts attached to the same “link”  Mainly used by wide area networks CNPP/2008.4. © O. Bonaventure, 2007
  7. 7. Two types of datalink layers  WAN type datalink layer  PPP, HDLC  Reliable exchange of frames between two hosts attached to the same “link”  Mainly used by wide area networks  LAN type datalink layer  Ethernet, Token Ring, FDDI, WiFi, Wimax,  Exchange of frames between hosts attached to the same LAN  limited geographical coverage CNPP/2008.4. © O. Bonaventure, 2007
  8. 8. The datalink service Network Network Datalink Frames Datalink Physical Physical  Service of datalink layer  Unreliable connectionless service  Transmission of frames between hosts directly connected at the physical layer or directly attached to the same LAN  Unreliable transmission (frames can be lost but usually transmission errors are detected)  Most datalink layers have maximum frame length  Connection-oriented service, reliable or not  Transmission of frames between hosts directly connected at the physical layer or directly attached to the same LAN  Reliable or unreliable transmission CNPP/2008.4. © O. Bonaventure, 2007
  9. 9. Routers LD1 R LANα R LANβ Network Network Network Network DL1 DL1 LANα LANα LANβ LANβ  Router  Relay within the network layer  packet is unit of transmission CNPP/2008.4. © O. Bonaventure, 2007
  10. 10. Network layer Basic principles CNPP/2008.4. © O. Bonaventure, 2007
  11. 11. Network layer Basic principles  Each host/router must be identified by a network layer address which is independent from its datalink layer address CNPP/2008.4. © O. Bonaventure, 2007
  12. 12. Network layer Basic principles  Each host/router must be identified by a network layer address which is independent from its datalink layer address  Network layer forwards packets from source to destination through multiple routers CNPP/2008.4. © O. Bonaventure, 2007
  13. 13. Network layer Basic principles  Each host/router must be identified by a network layer address which is independent from its datalink layer address  Network layer forwards packets from source to destination through multiple routers  Network layer service must be completely independent from the service provided by the datalink layer CNPP/2008.4. © O. Bonaventure, 2007
  14. 14. Network layer Basic principles  Each host/router must be identified by a network layer address which is independent from its datalink layer address  Network layer forwards packets from source to destination through multiple routers  Network layer service must be completely independent from the service provided by the datalink layer  Network layer user should not need to know anything about the internal structure of the network layer to be able to send packets CNPP/2008.4. © O. Bonaventure, 2007
  15. 15. Internal organisation of the network layer CNPP/2008.4. © O. Bonaventure, 2007
  16. 16. Internal organisation of the network layer  Two possible organisations  datagrams  virtual circuits CNPP/2008.4. © O. Bonaventure, 2007
  17. 17. Internal organisation of the network layer  Two possible organisations  datagrams  virtual circuits  The internal organisation of the network is orthogonal to the service provided, but often  datagram mode is used to provide a connectionless service  virtual circuits are used to provide a connection- oriented service CNPP/2008.4. © O. Bonaventure, 2007
  18. 18. Datagram transmission mode CNPP/2008.4. © O. Bonaventure, 2007
  19. 19. Datagram transmission mode  Basics  Each route/host is identified by an address  Information is divided in packets  Each packet contains  Source address  Destination address  Payload  Router behavior  Upon packet arrival look at destination address and routing table to decide where the packet should be forwarded  hop-by-hop forwarding, each routers takes a forwarding decision CNPP/2008.4. © O. Bonaventure, 2007
  20. 20. Datagram transmission mode  Basics  Each route/host is identified by an address  Information is divided in packets  Each packet contains  Source address  Destination address  Payload  Router behavior  Upon packet arrival look at destination address and routing table to decide where the packet should be forwarded  hop-by-hop forwarding, each routers takes a forwarding decision  Examples  IP (IPv4 and IPv6)  CLNP  IPX CNPP/2008.4. © O. Bonaventure, 2007
  21. 21. Datagram transmission mode (2) R1ʼs routing table A via West R5ʼs routing table ... A via West R2ʼs routing table ... I via East A via West J via East I via West ... J via East I via South-East Addr:B J via East Addr:E R1 Addr:D R5 Addr:A R2 R3ʼs routing table Addr:H A via North-West Addr:C ... Addr:I I via North-East R4 J via North-East R3 Addr:J R4ʼs routing table  The routing tables of all routers must be A via North ... coherent to ensure that a packet sent by I via West any source will reach its destination J via North CNPP/2008.4. © O. Bonaventure, 2007
  22. 22. Datagram transmission mode (2) R1ʼs routing table A via West R5ʼs routing table ... A via West R2ʼs routing table ... I via East A via West J via East I via West ... J via East I via South-East Addr:B J via East Addr:E R1 Addr:D SRC:A Dst:J BlaBla R5 Addr:A R2 R3ʼs routing table Addr:H A via North-West Addr:C ... Addr:I I via North-East R4 J via North-East R3 Addr:J R4ʼs routing table  The routing tables of all routers must be A via North ... coherent to ensure that a packet sent by I via West any source will reach its destination J via North CNPP/2008.4. © O. Bonaventure, 2007
  23. 23. Datagram transmission mode (2) R1ʼs routing table A via West R5ʼs routing table ... A via West R2ʼs routing table ... I via East A via West J via East I via West ... J via East I via South-East Addr:B J via East Addr:E R1 Addr:D SRC:A Dst:J BlaBla R5 Addr:A R2 R3ʼs routing table Addr:H A via North-West Addr:C ... Addr:I I via North-East R4 J via North-East R3 Addr:J R4ʼs routing table  The routing tables of all routers must be A via North ... coherent to ensure that a packet sent by I via West any source will reach its destination J via North CNPP/2008.4. © O. Bonaventure, 2007
  24. 24. Datagram transmission mode (2) R1ʼs routing table A via West R5ʼs routing table ... A via West R2ʼs routing table ... I via East A via West J via East I via West ... J via East I via South-East Addr:B J via East Addr:E R1 Addr:D SRC:A Dst:J BlaBla R5 Addr:A R2 R3ʼs routing table Addr:H A via North-West Addr:C ... Addr:I I via North-East R4 J via North-East R3 Addr:J R4ʼs routing table  The routing tables of all routers must be A via North ... coherent to ensure that a packet sent by I via West any source will reach its destination J via North CNPP/2008.4. © O. Bonaventure, 2007
  25. 25. Datagram transmission mode (2) R1ʼs routing table A via West R5ʼs routing table ... A via West R2ʼs routing table ... I via East A via West J via East I via West ... J via East I via South-East Addr:B J via East Addr:E R1 Addr:D SRC:A Dst:J BlaBla R5 Addr:A R2 R3ʼs routing table Addr:H A via North-West Addr:C ... Addr:I I via North-East R4 J via North-East R3 Addr:J R4ʼs routing table  The routing tables of all routers must be A via North ... coherent to ensure that a packet sent by I via West any source will reach its destination J via North CNPP/2008.4. © O. Bonaventure, 2007
  26. 26. Virtual circuit organisation CNPP/2008.4. © O. Bonaventure, 2007
  27. 27. Virtual circuit organisation  Goals  Keep forwarding on the routers as simple as possible  consulting a routing table for each packet is costly from a performance viewpoint CNPP/2008.4. © O. Bonaventure, 2007
  28. 28. Virtual circuit organisation  Goals  Keep forwarding on the routers as simple as possible  consulting a routing table for each packet is costly from a performance viewpoint  Solution  Before transmitting packets containing data, create a virtual circuit that links source and destination through the network  During the virtual circuit establishment, efficient datastructures are updated on each transit router to simplify forwarding  Use the virtual circuits to forward the packets  All packets will follow the same path CNPP/2008.4. © O. Bonaventure, 2007
  29. 29. Virtual circuit organisation  Goals  Keep forwarding on the routers as simple as possible  consulting a routing table for each packet is costly from a performance viewpoint  Solution  Before transmitting packets containing data, create a virtual circuit that links source and destination through the network  During the virtual circuit establishment, efficient datastructures are updated on each transit router to simplify forwarding  Use the virtual circuits to forward the packets  All packets will follow the same path  Example  ATM, X.25, Frame Relay, MPLS, gMPLS CNPP/2008.4. © O. Bonaventure, 2007
  30. 30. Establishment of a virtual circuit Addr:B Addr:E R1 Addr:D R5 Addr:A R2 Addr:H Addr:C Addr:I R4 R3 Addr:J CNPP/2008.4. © O. Bonaventure, 2007
  31. 31. Establishment of a virtual circuit Open(Dest=J) Addr:B Addr:E R1 Addr:D R5 Addr:A R2 Addr:H Addr:C Addr:I R4 R3 Addr:J Hop-by-hop routing Each router consults its routing table to forward vc establishment CNPP/2008.4. © O. Bonaventure, 2007
  32. 32. Establishment of a virtual circuit Open(Dest=J) Addr:B Open(Dest=J) Addr:E R1 Addr:D R5 Addr:A R2 Addr:H Addr:C Addr:I R4 R3 Addr:J Hop-by-hop routing Each router consults its routing table to forward vc establishment CNPP/2008.4. © O. Bonaventure, 2007
  33. 33. Establishment of a virtual circuit Open(Dest=J) Addr:B Open(Dest=J) Open(Dest=J) Addr:E R1 Addr:D R5 Addr:A R2 Addr:H Addr:C Addr:I R4 R3 Addr:J Hop-by-hop routing Each router consults its routing table to forward vc establishment CNPP/2008.4. © O. Bonaventure, 2007
  34. 34. Establishment of a virtual circuit Open(Dest=J) Addr:B Open(Dest=J) Open(Dest=J) Addr:E Open(Dest=J) R1 Addr:D R5 Addr:A R2 Addr:H Addr:C Addr:I R4 R3 Addr:J Hop-by-hop routing Each router consults its routing table to forward vc establishment CNPP/2008.4. © O. Bonaventure, 2007
  35. 35. Establishment of a virtual circuit Open(Dest=J) Addr:B Open(Dest=J) Open(Dest=J) Addr:E Open(Dest=J) R1 Addr:D R5 Addr:A Open(Dest=I) R2 Addr:H Addr:C Addr:I R4 R3 Addr:J Hop-by-hop routing Each router consults its routing table to forward vc establishment Source routing/ explicit routing Source (or first hop router) indicates in vc establishment packet the path to be followed CNPP/2008.4. © O. Bonaventure, 2007
  36. 36. Establishment of a virtual circuit Open(Dest=J) Addr:B Open(Dest=J) Open(Dest=J) Addr:E Open(Dest=J) R1 Addr:D R5 Addr:A Open(Dest=I) R2 Addr:H Addr:C Open(Dest=I; Route=R3,R2,R4)) Addr:I R4 R3 Addr:J Hop-by-hop routing Each router consults its routing table to forward vc establishment Source routing/ explicit routing Source (or first hop router) indicates in vc establishment packet the path to be followed CNPP/2008.4. © O. Bonaventure, 2007
  37. 37. Establishment of a virtual circuit Open(Dest=J) Addr:B Open(Dest=J) Open(Dest=J) Addr:E Open(Dest=J) R1 Addr:D R5 Addr:A Open(Dest=I) R2 Open(Dest=I; Route=R2,R4)) Addr:H Addr:C Open(Dest=I; Route=R3,R2,R4)) Addr:I R4 R3 Addr:J Hop-by-hop routing Each router consults its routing table to forward vc establishment Source routing/ explicit routing Source (or first hop router) indicates in vc establishment packet the path to be followed CNPP/2008.4. © O. Bonaventure, 2007
  38. 38. Establishment of a virtual circuit Open(Dest=J) Addr:B Open(Dest=J) Open(Dest=J) Addr:E Open(Dest=J) R1 Addr:D R5 Addr:A Open(Dest=I) R2 Open(Dest=I; Route=R2,R4)) Open(Dest=I; Route=R4)) Addr:H Addr:C Open(Dest=I; Route=R3,R2,R4)) Addr:I R4 R3 Addr:J Hop-by-hop routing Each router consults its routing table to forward vc establishment Source routing/ explicit routing Source (or first hop router) indicates in vc establishment packet the path to be followed CNPP/2008.4. © O. Bonaventure, 2007
  39. 39. Establishment of a virtual circuit Open(Dest=J) Addr:B Open(Dest=J) Open(Dest=J) Addr:E Open(Dest=J) R1 Addr:D R5 Addr:A Open(Dest=I) R2 Open(Dest=I; Route=R2,R4)) Open(Dest=I; Route=R4)) Addr:H Addr:C Open(Dest=I; Route=R3,R2,R4)) Addr:I R4 R3 Addr:J Hop-by-hop routing Each router consults its routing table to forward vc establishment Source routing/ explicit routing Source (or first hop router) indicates in vc establishment packet the path to be followed CNPP/2008.4. © O. Bonaventure, 2007
  40. 40. Packet transmission Addr:B Addr:E R1 Addr:D R5 Addr:A R2 Circuit:123 BlaBla Addr:H Addr:C Addr:I R4 R3 Addr:J  Packet contents  virtual circuit identifier  packet payload  What kind of virtual circuit identifier  Naive solution  unique identifier for all virtual circuits inside network  How to coordinate allocation of vc identifiers ? CNPP/2008.4. © O. Bonaventure, 2007
  41. 41. Packet transmission (2)  How unique should virtual circuits identifiers be ?  globally unique  unrealistic  unique inside a given network  then coordination among routers is necessary  unique on a given link  easier to manage, no coordination required, but  virtual circuit identifier may need to be changed from link to link  How to update the virtual circuit identifier of packets  All routers must contain a label forwarding table  this table is updated every time a virtual circuit is established Label forwarding table Inport Inlabel Outport Outlabel West L1 East L1 West L2 East L3 N-W L1 North L1 CNPP/2008.4. © O. Bonaventure, 2007
  42. 42. Virtual circuits : example Label forwarding table Inport Inlabel Outport Outlabel Label table South L2 S- E L1 Flow1 : L1 via BR1 Flow2 : L2 via BR1 BR2 BR3 BR1 Label table Flow3 : L1 via BR1 Label forwarding table Label forwarding table Inport Inlabel Outport Outlabel Inport Inlabel Outport Outlabel West L1 East L1 West L1 North L2 West L2 East L3 West L2 East L1 N-W L1 North L1 S-W L1 East L2 CNPP/2008.4. © O. Bonaventure, 2007
  43. 43. Network layer  Basics  Routing  Static routing  Distance vector routing  Link state routing  IP : Internet Protocol  Routing in IP networks CNPP/2008.4. © O. Bonaventure, 2007
  44. 44. Routing and Forwarding  Main objective of network layer  transport packets form source to destination  Two mechanisms are used in network layer  forwarding  algorithm use by each router to determine on which interface each packet should be sent to reach its destination or follow its virtual circuit  relies on the routing table maintained by each router  routing  algorithm (usually distributed) that distributes to all routers the information that allows them to build their routing tables CNPP/2008.4. © O. Bonaventure, 2007
  45. 45. Routing (2)  How to build the routing tables of each router ? A B CC D EE  Principle  Include in the routing table of each router the path to allow it to reach each destination  Which path to be included in the routing table  From A to C ?  From D to B CNPP/2008.4. © O. Bonaventure, 2007
  46. 46. Selection of the shortest paths Cost=1 Cost=1 A B CC Cost=1 Cost=1 Cost=1 Cost=1 D EE  Principle  Associate a weight/cost to each link  Each router chooses the lowest cost path  How to ensure that the routing tables of all routers are coherent ? CNPP/2008.4. © O. Bonaventure, 2007
  47. 47. Selection of the shortest paths Routing table A : Local D : South B : East C : East [via B] E: East [via B] Cost=1 Cost=1 A B CC Cost=1 Cost=1 Cost=1 Cost=1 D EE  Principle  Associate a weight/cost to each link  Each router chooses the lowest cost path  How to ensure that the routing tables of all routers are coherent ? CNPP/2008.4. © O. Bonaventure, 2007
  48. 48. Selection of the shortest paths Routing table Routing table A : West A : Local B : Local D : South C : East B : East D : South [via E] C : East [via B] E : South E: East [via B] Cost=1 Cost=1 A B CC Cost=1 Cost=1 Cost=1 Cost=1 D EE  Principle  Associate a weight/cost to each link  Each router chooses the lowest cost path  How to ensure that the routing tables of all routers are coherent ? CNPP/2008.4. © O. Bonaventure, 2007
  49. 49. Selection of the shortest paths Routing table Routing table A : West Routing table A : Local B : Local A : West [via B] D : South C : East B : West B : East D : South [via E] C : Local C : East [via B] E : South D : West [via B] E: East [via B] E : South West Cost=1 Cost=1 A B CC Cost=1 Cost=1 Cost=1 Cost=1 D EE  Principle  Associate a weight/cost to each link  Each router chooses the lowest cost path  How to ensure that the routing tables of all routers are coherent ? CNPP/2008.4. © O. Bonaventure, 2007
  50. 50. Selection of the shortest paths Routing table Routing table A : West Routing table A : Local B : Local A : West [via B] D : South C : East B : West B : East D : South [via E] C : Local C : East [via B] E : South D : West [via B] E: East [via B] E : South West Cost=1 Cost=1 A B CC Routing table A : North Cost=1 Cost=1 B : North [via A] Cost=1 C : East [via E] D : Local Cost=1 E : East D EE  Principle  Associate a weight/cost to each link  Each router chooses the lowest cost path  How to ensure that the routing tables of all routers are coherent ? CNPP/2008.4. © O. Bonaventure, 2007
  51. 51. Selection of the shortest paths Routing table Routing table A : West Routing table A : Local B : Local A : West [via B] D : South C : East B : West B : East D : South [via E] C : Local C : East [via B] E : South D : West [via B] E: East [via B] E : South West Cost=1 Cost=1 A B CC Routing table A : North Cost=1 Cost=1 Routing table B : North [via A] A : North [via B] Cost=1 B : North C : East [via E] D : Local Cost=1 C : North-East E : East D EE D : West E : Local  Principle  Associate a weight/cost to each link  Each router chooses the lowest cost path  How to ensure that the routing tables of all routers are coherent ? CNPP/2008.4. © O. Bonaventure, 2007
  52. 52. Static Routing  Principle  Network manager or network management station computes all routing tables and downloads them on all routers  How to compute routing tables ?  shortest path algorithms  more complex algorithms to provide load balancing or traffic engineering  Advantages of static routing  Easy to use in a small network  routing tables can be optimised  Drawbacks of static routing  does not adapt dynamically to network load  how to deal with link and router failures ? CNPP/2008.4. © O. Bonaventure, 2007
  53. 53. Dynamic or distributed routing  Principle  routers exchange messages and use a distributed algorithm to build their routing tables  used in almost all networks  Advantages  can easily adapt routing tables to events  Drawbacks  more complex to implement than static routing  Most common distributed routing methods  Distance vector routing  Link state routing CNPP/2008.4. © O. Bonaventure, 2007
  54. 54. Network layer  Basics  Routing  Static routing  Distance vector routing  Link state routing  IP : Internet Protocol  Routing in IP networks CNPP/2008.4. © O. Bonaventure, 2007
  55. 55. Distance vector routing  Basic principles Cost=1 Cost=1  Configuration of each router R  Cost of each link Cost=2  When it boots, a router only knows itself  Each router sends periodically to all its neighbours a vector that contains for each destination that it knows 1. Destination address 2. Distance between transmitting router and destination • distance vector is a summary of the routerʼs routing table  Each router will update its routing table based on the information received from its neighbours CNPP/2008.4. © O. Bonaventure, 2007
  56. 56. Distance vector routing (2)  Routing table maintained by router  For each destination d inside routing table  R[d].cost = total cost of shortest path to reach d  R[d].link = outgoing link used to reach d via shortest path  Distance vector sent to neighbours  For each destination d  V[d].cost = total cost of shortest path to reach d Every N seconds: Vector=null; for each destination=d in R[] { Vector=Vector+Pair(d,R[d].cost); } for each interface { Send(Vector); } CNPP/2008.4. © O. Bonaventure, 2007
  57. 57. Distance vector routing (3)  Processing of received distance vectors Received(Vector V[],link l) { /* received vector from link l */ for each destination=d in V[] { if (d isin R[]) { if ((V[d].cost+l.cost) < R[d].cost) { /* shorter path */ R[d].cost=V[d].cost+l.cost; R[d].link=l; } } else { /* new route */ R[d].cost=V[d].cost+l.cost; R[d].link=l; } } CNPP/2008.4. © O. Bonaventure, 2007
  58. 58. Distance vectors example  All links have a unit cost Routing table Routing table B : 0 [Local] Routing table A : 0 [ Local ] C : 0 [Local] A B CC Routing table D : 0 [Local] Routing table D D EE E : 0 [Local] CNPP/2008.4. © O. Bonaventure, 2007
  59. 59. Distance vectors example  All links have a unit cost Routing table Routing table B : 0 [Local] Routing table A : 0 [ Local ] C : 0 [Local] A=0 A B CC A=0 Routing table D : 0 [Local] Routing table D D EE E : 0 [Local] When a router boots, it only knows itself. Its distance vector thus contains only its address CNPP/2008.4. © O. Bonaventure, 2007
  60. 60. Distance vectors example (2) Routing table Routing table B : 0 [Local] Routing table A : 0 [ Local ] A : 1 [West] C : 0 [Local] A B CC D=0 ; A=1 Routing table D : 0 [Local] Routing table A : 1 [North] D D EE E : 0 [Local] D=0 ; A=1 CNPP/2008.4. © O. Bonaventure, 2007
  61. 61. Distance vectors example (3) Routing table Routing table Routing table A : 0 [ Local ] B : 0 [Local] D : 1 [South] C : 0 [Local] A : 1 [West] A B CC Routing table Routing table D : 0 [Local] E : 0 [Local] A : 1 [North] D D EE D : 1 [West] A : 2 [West] CNPP/2008.4. © O. Bonaventure, 2007
  62. 62. Distance vectors example (3) Routing table Routing table Routing table A : 0 [ Local ] B : 0 [Local] D : 1 [South] C : 0 [Local] A : 1 [West] C=0 A B CC C=0 Routing table Routing table D : 0 [Local] E : 0 [Local] A : 1 [North] D D EE D : 1 [West] A : 2 [West] CNPP/2008.4. © O. Bonaventure, 2007
  63. 63. Distance vectors example (4) Routing table Routing table B : 0 [Local] Routing table A : 0 [ Local ] A : 1 [West] D : 1 [South] C : 1 [East] C : 0 [Local] A B CC Routing table Routing table E : 0 [Local] D : 0 [Local] D : 1 [West] A : 1 [North] D D EE A : 2 [West] C : 1 [North-East] CNPP/2008.4. © O. Bonaventure, 2007
  64. 64. Distance vectors example (4) Routing table Routing table B : 0 [Local] Routing table A : 0 [ Local ] A : 1 [West] D : 1 [South] C : 1 [East] C : 0 [Local] A B CC E=0;D=1;A=2;C=1 E=0;D=1;A=2;C=1 Routing table Routing table E : 0 [Local] D : 0 [Local] D : 1 [West] A : 1 [North] D D EE A : 2 [West] C : 1 [North-East] E=0;D=1;A=2;C=1 CNPP/2008.4. © O. Bonaventure, 2007
  65. 65. Distance vectors example (4) Routing table Routing table B : 0 [Local] Routing table A : 0 [ Local ] A : 1 [West] D : 1 [South] C : 1 [East] C : 0 [Local] A B CC E=0;D=1;A=2;C=1 E=0;D=1;A=2;C=1 Routing table Routing table E : 0 [Local] D : 0 [Local] D : 1 [West] A : 1 [North] D D EE A : 2 [West] C : 1 [North-East] E=0;D=1;A=2;C=1  Reception of distance vector on B  New route to reach E and D, longer route for A  Reception of distance vector on C  New routes to reach D, A and E  Reception of distance vector on D  New routes to reach E and C, longer route for A CNPP/2008.4. © O. Bonaventure, 2007
  66. 66. Distance vectors example (5)  B is the first to send its vector Routing table B : 0 [Local] A : 1 [West] Routing table Routing table C : 1 [East] C : 0 [Local] A : 0 [ Local ] E : 1 [South] E : 1 [South-West] D : 1 [South] D : 2 [South] D : 2 [South-West] A : 3 [South-West] A B CC Routing table Routing table D : 0 [Local] A : 1 [North] E : 0 [Local] E : 1 [East] D D EE D : 1 [West] A : 2 [West] C : 2 [East] C : 1 [North-East] CNPP/2008.4. © O. Bonaventure, 2007
  67. 67. Distance vectors example (5)  B is the first to send its vector Routing table B : 0 [Local] A : 1 [West] Routing table Routing table C : 1 [East] C : 0 [Local] A : 0 [ Local ] E : 1 [South] E : 1 [South-West] D : 1 [South] D : 2 [South] D : 2 [South-West] A : 3 [South-West] B=0;A=1;C=1;D=2;E=1 A B CC B=0;A=1;C=1;D=2;E=1 Routing table Routing table D : 0 [Local] A : 1 [North] E : 0 [Local] E : 1 [East] D D EE D : 1 [West] A : 2 [West] C : 2 [East] C : 1 [North-East] CNPP/2008.4. © O. Bonaventure, 2007
  68. 68. Distance vectors example (6) Routing table Routing table B : 0 [Local] Routing table A : 0 [ Local ] A : 1 [West] C : 0 [Local] D : 1 [South] C : 1 [East] E : 1 [South-West] B : 1 [East] E : 1 [South] D : 2 [South-West] C : 2 [East] D : 2 [South] A : 2 [West] E : 2 [East] B : 1 [West] A B CC Routing table Routing table D : 0 [Local] E : 0 [Local] A : 1 [North] D : 1 [West] E : 1 [East] D D EE A : 2 [West] C : 1 [North-East] C : 2 [East] B : 1 [North] CNPP/2008.4. © O. Bonaventure, 2007
  69. 69. Distance vectors example (6) Routing table Routing table B : 0 [Local] Routing table A : 0 [ Local ] A : 1 [West] C : 0 [Local] D : 1 [South] C : 1 [East] E : 1 [South-West] B : 1 [East] E : 1 [South] D : 2 [South-West] C : 2 [East] D : 2 [South] A : 2 [West] E : 2 [East] B : 1 [West] A B CC A=0;B=1;C=2;D=1;E=2 Routing table Routing table D : 0 [Local] E : 0 [Local] A : 1 [North] D : 1 [West] E : 1 [East] D D EE A : 2 [West] C : 1 [North-East] C : 2 [East] B : 1 [North] CNPP/2008.4. © O. Bonaventure, 2007
  70. 70. Distance vectors example (7) Routing table Routing table Routing table A : 0 [ Local ] B : 0 [Local] C : 0 [Local] D : 1 [South] A : 1 [West] E : 1 [South-West] B : 1 [East] C : 1 [East] D : 2 [South-West] C : 2 [East] E : 1 [South] A : 2 [West] E : 2 [East] D : 2 [South] B : 1 [West] A B CC Routing table D : 0 [Local] Routing table A : 1 [North] E : 0 [Local] E : 1 [East] D : 1 [West] C : 2 [East] D D EE A : 2 [West] C : 1 [North-East] B : 2 [North] B : 1 [North]  All routers know how to reach all other routers  Routing tables are stable  If a distance vector is sent by one router, it will not cause any change to the routing table of other routers in the network CNPP/2008.4. © O. Bonaventure, 2007
  71. 71. Distance vectors Link failures  How to deal with link failures ? A B CC DD EE  Two problems must be solved for failures  How to detect that the link has failed ?  How to indicate to all routers that they should update their routing table since the paths that use link A-B do not work anymore ? CNPP/2008.4. © O. Bonaventure, 2007
  72. 72. Detection of link failures  Two types of solutions  rely on failure information from datalink or physical layer  fast and reliable  unfortunately not supported by all datalink/physical layers  ask each router to regularly send its distance vector (e.g. every 30 seconds)  If a router does not receive a refresh for a route in a distance vector from one of its neighbours during some time (e.g. 90 seconds), it assumes that the route is not available anymore CNPP/2008.4. © O. Bonaventure, 2007
  73. 73. How to update the routing table ?  All routes that use a failed link are marked with an infinite cost Routing table Routing table Routing table A : 0 [ Local ] B : 0 [Local] C : 0 [Local] D : 1 [South] A:∞ E : 1 [South-West] B:∞ C : 1 [East] D : 2 [South-West] C:∞ E : 1 [South] A : 2 [West] D : 2 [South] B : 1 [West] E:∞ A B CC Routing table A=0;B=∞;C=∞;D=1;E=∞ D : 0 [Local] Routing table A : 1 [North] E : 0 [Local] E : 1 [East] D : 1 [West] C : 2 [East] D D EE A : 2 [West] C : 1 [North-East] B : 2 [North] B : 1 [North] CNPP/2008.4. © O. Bonaventure, 2007
  74. 74. How to update the routing table ? (2)  Reception of a distance vector Received(Vector V[],link l) { /* received vector from link l */ for each destination=d in V[] { if (d isin R[]) { if ( ((V[d].cost+l.cost) < R[d].cost) OR ( R[d].link == l) ) { /* better route or change to current route */ R[d].cost=V[d].cost+l.cost; R[d].link=l; } } else { /* new route */ R[d].cost=V[d].cost+l.cost; R[d].link=l; } } CNPP/2008.4. © O. Bonaventure, 2007
  75. 75. How to update the routing table ? (3) Routing table Routing table Routing table A : 0 [ Local ] B : 0 [Local] C : 0 [Local] D : 1 [South] A:∞ E : 1 [South-West] B:∞ C : 1 [East] D : 2 [South-West] C:∞ E : 1 [South] A : 2 [West] D : 2 [South] B : 1 [West] E:∞ A B CC Routing table A=0;B=∞;C=∞;D=1;E=∞ D : 0 [Local] Routing table A : 1 [North] E : 0 [Local] E : 1 [East] D : 1 [West] C : 2 [East] D D EE A : 2 [West] C : 1 [North-East] B : 2 [North] B : 1 [North] CNPP/2008.4. © O. Bonaventure, 2007
  76. 76. How to update the routing table ? (3) Routing table Routing table Routing table A : 0 [ Local ] B : 0 [Local] C : 0 [Local] D : 1 [South] A:∞ E : 1 [South-West] B:∞ C : 1 [East] D : 2 [South-West] C:∞ E : 1 [South] A : 2 [West] D : 2 [South] B : 1 [West] E:∞ A B CC Routing table A=0;B=∞;C=∞;D=1;E=∞ D : 0 [Local] Routing table A : 1 [North] E : 0 [Local] E : 1 [East] D : 1 [West] C : 2 [East] D D EE A : 2 [West] C : 1 [North-East] B : 2 [North] B : 1 [North]  D must remove from its routing tables all the routes that it learned from its North link and are announced now with an ∞ cost CNPP/2008.4. © O. Bonaventure, 2007
  77. 77. How to update the routing table ? (4) Routing table Routing table Routing table C : 0 [Local] A : 0 [ Local ] B : 0 [Local] D : 1 [South] E : 1 [South-West] A:∞ D : 2 [South-West] B:∞ C : 1 [East] C:∞ A : 2 [West] E : 1 [South] B : 1 [West] E:∞ D : 2 [South] A B CC Routing table D : 0 [Local] Routing table A : 1 [North] E : 0 [Local] E : 1 [East] D : 1 [West] C : 2 [East] D D EE A : 2 [West] C : 1 [North-East] B:∞ B : 1 [North] CNPP/2008.4. © O. Bonaventure, 2007
  78. 78. How to update the routing table ? (4) Routing table Routing table Routing table C : 0 [Local] A : 0 [ Local ] B : 0 [Local] D : 1 [South] E : 1 [South-West] A:∞ D : 2 [South-West] B:∞ C : 1 [East] C:∞ A : 2 [West] E : 1 [South] B : 1 [West] E:∞ D : 2 [South] A B CC Routing table D=0;B= ∞;A=1;C=2;E=11 D : 0 [Local] Routing table A : 1 [North] E : 0 [Local] E : 1 [East] D : 1 [West] C : 2 [East] D D EE A : 2 [West] C : 1 [North-East] B:∞ B : 1 [North] CNPP/2008.4. © O. Bonaventure, 2007
  79. 79. How to update the routing table ? (5) Routing table Routing table Routing table A : 0 [ Local ] B : 0 [Local] C : 0 [Local] D : 1 [South] A:∞ E : 1 [South-West] B:∞ C : 1 [East] D : 2 [South-West] C : 3 [South] E : 1 [South] A : 2 [West] E : 2 [South] D : 2 [South] B : 1 [West] B=0;A=∞;C=1;E=1;D=2 A B CC Routing table B=0;A=∞;C=1;E=1;D=2 D : 0 [Local] Routing table A : 1 [North] E : 0 [Local] E : 1 [East] D : 1 [West] C : 2 [East] D D EE A : 2 [West] C : 1 [North-East] B:∞ B : 1 [North] CNPP/2008.4. © O. Bonaventure, 2007
  80. 80. How to update the routing table ? (6) Routing table Routing table Routing table A : 0 [ Local ] B : 0 [Local] C : 0 [Local] D : 1 [South] A:∞ E : 1 [South-West] B:∞ C : 1 [East] D : 2 [South-West] E : 1 [South] A : ∞∞ C : 3 [South] E : 2 [South] D : 2 [South] B : 1 [West] A B CC Routing table D : 0 [Local] A : 1 [North] E : 1 [East] C : 2 [East] D D EE Routing table B:∞ E : 0 [Local] D : 1 [West] A : 2 [West] C : 1 [North-East] B : 1 [North] CNPP/2008.4. © O. Bonaventure, 2007
  81. 81. How to update the routing table ? (6) Routing table Routing table Routing table A : 0 [ Local ] B : 0 [Local] C : 0 [Local] D : 1 [South] A:∞ E : 1 [South-West] B:∞ C : 1 [East] D : 2 [South-West] E : 1 [South] A : ∞∞ C : 3 [South] E : 2 [South] D : 2 [South] B : 1 [West] A B CC Routing table E=0;A=2;D=1;C=1;B=1 D : 0 [Local] E=0;A=2;D=1;C=1;B=1 A : 1 [North] E : 1 [East] C : 2 [East] D D EE Routing table B:∞ E : 0 [Local] E=0;A=2;D=1;C=1;B=1 D : 1 [West] A : 2 [West] C : 1 [North-East] B : 1 [North] CNPP/2008.4. © O. Bonaventure, 2007
  82. 82. How to update the routing table ? (7) Routing table Routing table Routing table A : 0 [ Local ] B : 0 [Local] C : 0 [Local] D : 1 [South] A : 3 [South] E : 1 [South-West] B:∞ C : 1 [East] D : 2 [South-West] C : 3 [South] E : 1 [South] A: 3 [South-West] E : 2 [South] D : 2 [South] B : 1 [West] A B CC Routing table A=1;B=2;C=2;D=1;E=1 Routing table D : 0 [Local] E : 0 [Local] A : 1 [North] D : 1 [West] E : 1 [East] A : 2 [West] C : 2 [East] D D EE C : 1 [North-East] B : 1 [North] B : 2 [East] CNPP/2008.4. © O. Bonaventure, 2007
  83. 83. How to update the routing table ? (7) Routing table Routing table Routing table A : 0 [ Local ] B : 0 [Local] C : 0 [Local] D : 1 [South] A : 3 [South] E : 1 [South-West] B:∞ C : 1 [East] D : 2 [South-West] C : 3 [South] E : 1 [South] A: 3 [South-West] E : 2 [South] D : 2 [South] B : 1 [West] A B CC Routing table A=1;B=2;C=2;D=1;E=1 Routing table D : 0 [Local] E : 0 [Local] A : 1 [North] D : 1 [West] E : 1 [East] A : 2 [West] C : 2 [East] D D EE C : 1 [North-East] B : 1 [North] B : 2 [East]  Failure has been recovered, all routers are now reachable again from any router CNPP/2008.4. © O. Bonaventure, 2007
  84. 84. Second link failure Routing table Routing table Routing table A : 0 [ Local ] B : 0 [Local] C : 0 [Local] D : 1 [South] A : 3 [South] E : 1 [South-West] B : 3 [South] C : 1 [East] D : 2 [South-West] C : 3 [South] E : 1 [South] A: 3 [South-West] E : 2 [South] D : 2 [South] B : 1 [West] A B CC Routing table Routing table D : 0 [Local] E : 0 [Local] A : 1 [North] D : 1 [West] E : 1 [East] A : 2 [West] C : 2 [East] D D EE C : 1 [North-East] B : 1 [North] B : 2 [East] D detects the failure  If it is the first to send its distance vector, failure is detected and router A updates its routing table CNPP/2008.4. © O. Bonaventure, 2007
  85. 85. Second link failure Routing table Routing table Routing table A : 0 [ Local ] B : 0 [Local] C : 0 [Local] D : 1 [South] A : 3 [South] E : 1 [South-West] B : 3 [South] C : 1 [East] D : 2 [South-West] C : 3 [South] E : 1 [South] A: 3 [South-West] E : 2 [South] D : 2 [South] B : 1 [West] A B CC Routing table A=1;B=∞;C=∞;D=1;E=∞ Routing table D : 0 [Local] E : 0 [Local] A : 1 [North] D : 1 [West] E : 1 [East] A : 2 [West] C : 2 [East] D D EE C : 1 [North-East] B : 1 [North] B : 2 [East] D detects the failure  If it is the first to send its distance vector, failure is detected and router A updates its routing table CNPP/2008.4. © O. Bonaventure, 2007
  86. 86. Second link failure (2) Routing table Routing table Routing table A : 0 [ Local ] B : 0 [Local] C : 0 [Local] D : 1 [South] A : 3 [South] E : 1 [South-West] B : 3 [South] C : 1 [East] D : 2 [South-West] C : 3 [South] E : 1 [South] A: 3 [South-West] E : 2 [South] D : 2 [South] B : 1 [West] A B CC Routing table A=0;D=1;B=3;C=3;E=2 Routing table D : 0 [Local] E : 0 [Local] A : 1 [North] D : 1 [West] E:∞ A : 2 [West] C:∞ D D EE C : 1 [North-East] B : 1 [North] B:∞  But if A sends its distance vector before having received or processed Dʼs updated distance vector ... CNPP/2008.4. © O. Bonaventure, 2007
  87. 87. Second link failure (3)  Upon reception of Aʼs vector, D updates its routing table Routing table Routing table Routing table A : 0 [ Local ] B : 0 [Local] C : 0 [Local] D : 1 [South] A : 3 [South] E : 1 [South-West] B : 3 [South] C : 1 [East] D : 2 [South-West] C : 3 [South] E : 1 [South] A: 3 [South-West] E : 2 [South] D : 2 [South] B : 1 [West] A B CC Routing table Routing table D : 0 [Local] E : 0 [Local] A : 1 [North] D : 1 [West] E : 3 [North] A : 2 [West] C : 4 [North] D D EE C : 1 [North-East] B : 1 [North] B : 4 [North] CNPP/2008.4. © O. Bonaventure, 2007
  88. 88. Second link failure (3)  Upon reception of Aʼs vector, D updates its routing table Routing table Routing table Routing table A : 0 [ Local ] B : 0 [Local] C : 0 [Local] D : 1 [South] A : 3 [South] E : 1 [South-West] B : 3 [South] C : 1 [East] D : 2 [South-West] C : 3 [South] E : 1 [South] A: 3 [South-West] E : 2 [South] D : 2 [South] B : 1 [West] A B CC Routing table D=0;A=1;E=3;C=4;B=4 Routing table D : 0 [Local] E : 0 [Local] A : 1 [North] D : 1 [West] E : 3 [North] A : 2 [West] C : 4 [North] D D EE C : 1 [North-East] B : 1 [North] B : 4 [North] CNPP/2008.4. © O. Bonaventure, 2007
  89. 89. Second link failure (4) Routing table Routing table Routing table A : 0 [ Local ] B : 0 [Local] C : 0 [Local] D : 1 [South] A : 3 [South] E : 1 [South-West] B : 5 [South] C : 1 [East] D : 2 [South-West] C : 5 [South] E : 1 [South] A: 3 [South-West] E : 4 [South] D : 2 [South] B : 1 [West] A B CC Routing table Routing table D : 0 [Local] E : 0 [Local] A : 1 [North] D : 1 [West] E : 3 [North] A : 2 [West] C : 4 [North] D D EE C : 1 [North-East] B : 1 [North] B : 4 [North] CNPP/2008.4. © O. Bonaventure, 2007
  90. 90. Second link failure (4) Routing table Routing table Routing table A : 0 [ Local ] B : 0 [Local] C : 0 [Local] D : 1 [South] A : 3 [South] E : 1 [South-West] B : 5 [South] C : 1 [East] D : 2 [South-West] C : 5 [South] E : 1 [South] A: 3 [South-West] E : 4 [South] D : 2 [South] B : 1 [West] A B CC Routing table A=0;D=1;B=5;C=5;E=4 Routing table D : 0 [Local] E : 0 [Local] A : 1 [North] D : 1 [West] E : 3 [North] A : 2 [West] C : 4 [North] D D EE C : 1 [North-East] B : 1 [North] B : 4 [North] CNPP/2008.4. © O. Bonaventure, 2007
  91. 91. Second link failure (5) Routing table Routing table Routing table A : 0 [ Local ] B : 0 [Local] C : 0 [Local] D : 1 [South] A : 3 [South] E : 1 [South-West] B : 5 [South] C : 1 [East] D : 2 [South-West] C : 5 [South] E : 1 [South] A: 3 [South-West] E : 4 [South] D : 2 [South] B : 1 [West] A B CC Routing table Routing table D : 0 [Local] E : 0 [Local] A : 1 [North] D : 1 [West] E : 5[North] A : 2 [West] C : 6 [North] D D EE C : 1 [North-East] B : 1 [North] B : 6 [North]  This problem is called counting to infinity  How can we avoid it ? CNPP/2008.4. © O. Bonaventure, 2007
  92. 92. Second link failure (5) Routing table Routing table Routing table A : 0 [ Local ] B : 0 [Local] C : 0 [Local] D : 1 [South] A : 3 [South] E : 1 [South-West] B : 5 [South] C : 1 [East] D : 2 [South-West] C : 5 [South] E : 1 [South] A: 3 [South-West] E : 4 [South] D : 2 [South] B : 1 [West] A B CC Routing table Routing table D : 0 [Local] A=1;D=0;B=6;C=6;E=5 E : 0 [Local] A : 1 [North] D : 1 [West] E : 5[North] A : 2 [West] C : 6 [North] D D EE C : 1 [North-East] B : 1 [North] B : 6 [North]  This problem is called counting to infinity  How can we avoid it ? CNPP/2008.4. © O. Bonaventure, 2007
  93. 93. Second link failure (6)  Where does counting to infinity comes form ?  A router announces on a link routes that it has already learned via this link  How to avoid counting to infinity ?  split horizon  each router creates a distance vector for each link  on link i, router does not announce the routers learned over link i Pseudocode Every N seconds: for each link=l { /* one different vector for each link */ Vector=null; for each destination=d in R[] { if (R[d].link<>l) { Vector=Vector+Pair(d,R[d].cost); } } Send(Vector); } CNPP/2008.4. © O. Bonaventure, 2007
  94. 94. Split horizon  Back to previous example Routing table Routing table Routing table A : 0 [ Local ] B : 0 [Local] C : 0 [Local] D : 1 [South] A : 3 [South] E : 1 [South-West] B : 3 [South] C : 1 [East] D : 2 [South-West] C : 3 [South] E : 1 [South] A: 3 [South-West] E : 2 [South] D : 2 [South] B : 1 [West] A B CC Routing table Routing table D : 0 [Local] E : 0 [Local] A : 1 [North] D : 1 [West] E : 1 [East] A : 2 [West] C : 2 [East] D D EE C : 1 [North-East] B : 1 [North] B : 2 [East]  A will not pollute Dʼs routing table with split horizon CNPP/2008.4. © O. Bonaventure, 2007

×