4-7 Network Layer.pptx

download 4-7 Network Layer.pptx

of 109

Transcript of 4-7 Network Layer.pptx

  • 8/13/2019 4-7 Network Layer.pptx

    1/109

    Network Layer (Part 7)

    Computer Networks

    Tutun JuhanaTelecommunication EngineeringSchool of Electrical Engineering & Informatics

    Institut Teknologi Bandung

    4

  • 8/13/2019 4-7 Network Layer.pptx

    2/109

    UNICAST ROUTING PROTOCOLS(RIP, OSPF, AND BGP)

  • 8/13/2019 4-7 Network Layer.pptx

    3/109

    INTRODUCTION

    3

  • 8/13/2019 4-7 Network Layer.pptx

    4/109

    Cost or Metric

    A router is usually attached to several networkswhen it receives a packet, to which network

    should it pass the packet?

    The decision is based on optimization: Which ofthe available pathways is the optimum pathway?

    What is the definition of the term optimum?

    One approach is to assign a cost for passing

    through a networkWe call this cost a metric High cost can be thought of as something bad;

    low cost can be thought of something good

    4

  • 8/13/2019 4-7 Network Layer.pptx

    5/109

    Static versus Dynamic Routing Tables

    A static table is one with manual entries

    A dynamic table, on the other hand, is one

    that is updated automatically when there is

    a change somewhere in the internet

    5

  • 8/13/2019 4-7 Network Layer.pptx

    6/109

    Routing Protocol

    A routing protocol is a combination of rules and

    procedures that lets routers in the internet inform

    each other of changes

    It allows routers to share whatever they know

    about the internet or their neighborhood The routing protocols also include procedures

    for combining information received from other

    routers

    Routing protocols can be either an interior

    protocol or an exterior protocol

    An interior protocol handles intradomain routing

    an exterior protocol handles interdomain routing 6

  • 8/13/2019 4-7 Network Layer.pptx

    7/109

    INTRA- AND INTER-DOMAINROUTING

    7

  • 8/13/2019 4-7 Network Layer.pptx

    8/109

    8

    a group of networks and routers under the authority of a single administration

    intra-domain routing

    inter-domain routing

    AS Numbers is

    assigned for each AS

    Ex: ITBs ASN is

    4796

  • 8/13/2019 4-7 Network Layer.pptx

    9/109

    9

  • 8/13/2019 4-7 Network Layer.pptx

    10/109

    DISTANCE VECTOR ROUTING

    10

  • 8/13/2019 4-7 Network Layer.pptx

    11/109

    This method sees an AS, with all routersand networks, as a graph, a set of nodes

    and lines (edges) connecting the nodes

    A router normally be represented by a nodeA network be represented by a link

    connecting two nodes

    The graph theory used Bellman-Ford (alsocalled Ford-Fulkerson) algorithm to find

    the shortest path between nodes in a

    graph given the distance between nodes11

  • 8/13/2019 4-7 Network Layer.pptx

    12/109

    Bellman-Ford Algorithm

    It looks circular

    To solve the problem, we use iteration to create a shortest distance table(vector) for each node using the following steps:

    1. The shortest distance and the cost between a node and itself is initialized to 0.

    2. The shortest distance between a node and any other node is set to infinity. The cost between a

    node and any other node should be given (can be infinity if the nodes are not connected)

    3. The algorithm repeat as shown in Figure 11.4 until there is no more change in the shortest

    distance vector.

    12

  • 8/13/2019 4-7 Network Layer.pptx

    13/109

    13

  • 8/13/2019 4-7 Network Layer.pptx

    14/109

    Distance Vector Routing Algorithm

    14

  • 8/13/2019 4-7 Network Layer.pptx

    15/109

  • 8/13/2019 4-7 Network Layer.pptx

    16/109

    16

  • 8/13/2019 4-7 Network Layer.pptx

    17/109

    17

  • 8/13/2019 4-7 Network Layer.pptx

    18/109

    18

  • 8/13/2019 4-7 Network Layer.pptx

    19/109

    19

  • 8/13/2019 4-7 Network Layer.pptx

    20/109

    20

  • 8/13/2019 4-7 Network Layer.pptx

    21/109

    Count to Infinity

    21

  • 8/13/2019 4-7 Network Layer.pptx

    22/109

    In distance vector routing, any decrease in cost(good news) propagates quickly, but any

    increase in cost (bad news) propagates slowly

    For a routing protocol to work properly, if a link is

    broken (cost becomes infinity), every other

    router should be aware of it immediately, but in

    distance vector routing, this takes some time.

    The problem is referred to as count to infinity takes several updates before the cost for a

    broken link is recorded as infinity by all routers.

    22

  • 8/13/2019 4-7 Network Layer.pptx

    23/109

    Example of count to infinity

    Two-Node Loop

    23

  • 8/13/2019 4-7 Network Layer.pptx

    24/109

    Another example24

    A converged network

    Source

    http://technet.microsoft.com/en-s/library/cc940478.aspx

  • 8/13/2019 4-7 Network Layer.pptx

    25/109

    The solutions

    25

  • 8/13/2019 4-7 Network Layer.pptx

    26/109

    Defining Infinity

    The first obvioussolution to count to

    infinity is to redefine

    infinity to a smaller

    number

    26

    Most implementations of the Distance VectorProtocol define 16as infinity

    However, this means that distance vector cannot be

    used in large systems The size of the network, in

    each direction, can not exceed 15 hops

  • 8/13/2019 4-7 Network Layer.pptx

    27/109

    Split Horizon

    27

    Split horizon helps reduce convergence time by not

    allowing routers to advertise networks in the

    direction from which those networks were learned

  • 8/13/2019 4-7 Network Layer.pptx

    28/109

    28

    Source

    http://technet.microsoft.com/en-s/library/cc940478.aspx

  • 8/13/2019 4-7 Network Layer.pptx

    29/109

    Split Horizon and Poison Reverse

    29

    Iit announces all networks. However, those networks learned in a

    given direction are announced with a hop count of 16, indicating

    that the network is unreachable It avoids the Distance Vector

    Protocol deleting the route because it has no news about it during a

    certain time duration (timer)

  • 8/13/2019 4-7 Network Layer.pptx

    30/109

    30

  • 8/13/2019 4-7 Network Layer.pptx

    31/109

    Three-Node Instability

    31

  • 8/13/2019 4-7 Network Layer.pptx

    32/109

    RIPRouting Information Protocol

    32

  • 8/13/2019 4-7 Network Layer.pptx

    33/109

    RIP implements distance vector routing directly with someconsiderations

    33

  • 8/13/2019 4-7 Network Layer.pptx

    34/109

    34

  • 8/13/2019 4-7 Network Layer.pptx

    35/109

    RIP Message Format

    35

  • 8/13/2019 4-7 Network Layer.pptx

    36/109

    Requests and Responses

    36

  • 8/13/2019 4-7 Network Layer.pptx

    37/109

    Request

    A request message is sent by a router thathas just come up or by a router that has

    some time-out entries.

    37

  • 8/13/2019 4-7 Network Layer.pptx

    38/109

    Response

    A response can be : Solicited: sent only in answer to a request.

    It contains information about the destination

    specified in the corresponding request Unsolicited: is sent periodically

    every 30 seconds or

    when there is a change in the routing table

    The response is sometimes called an

    update packet

    38

  • 8/13/2019 4-7 Network Layer.pptx

    39/109

    39

  • 8/13/2019 4-7 Network Layer.pptx

    40/109

    Timers in RIP

    40

    controls the

    advertising of

    regular update

    messages

    Governs the validity of a

    route. If the timer is

    reached, route is

    declared unreachable,

    but does not immediatelypurge, instead, it

    continues to advertise

    the route with a metric

    value of 16.

    At the same time when a

    route declared unreachable,

    the garbage collection timer

    is set to 120 s for that route.

    When the count reacheszero, the route is purged

    from the table.

  • 8/13/2019 4-7 Network Layer.pptx

    41/109

    41

  • 8/13/2019 4-7 Network Layer.pptx

    42/109

    RIP Version 2

    It supports

    Classless Addressing

    Authentication

    Multicastinguses the all-router multicast

    address to send the RIP messages only to

    RIP routers in the network.42

  • 8/13/2019 4-7 Network Layer.pptx

    43/109

    Encapsulation

    43

  • 8/13/2019 4-7 Network Layer.pptx

    44/109

    LINK STATE ROUTING

    44

  • 8/13/2019 4-7 Network Layer.pptx

    45/109

    45

    Each node in the domain

    has the entire topology

    of the domainuse

    Dijkstra algo r i thmto

    build a routing table

    The routing table for

    each node is unique

    because the calculations

    are based on different

    interpretations of the

    topology

  • 8/13/2019 4-7 Network Layer.pptx

    46/109

    46

    The whole topology can be compiled from the partial knowledge of each

    node (it knows the state (type, condition, and cost) of its links)

  • 8/13/2019 4-7 Network Layer.pptx

    47/109

    BUILDING ROUTING TABLES

    47

  • 8/13/2019 4-7 Network Layer.pptx

    48/109

    48

  • 8/13/2019 4-7 Network Layer.pptx

    49/109

    Creation of Link State Packet (LSP)

    A link state packet(LSP) carries (among othershuge information)

    1. The node identity

    2. The list of links

    3. A sequence number4. Age

    The first two are needed to make the topology

    The third facilitates flooding and distinguishesnew LSPs from old ones

    The fourth prevents old LSPs from remaining in

    the domain for a long time49

  • 8/13/2019 4-7 Network Layer.pptx

    50/109

  • 8/13/2019 4-7 Network Layer.pptx

    51/109

    Flooding of LSPs

    51

    Formation of Shortest Path Tree:

  • 8/13/2019 4-7 Network Layer.pptx

    52/109

    Formation of Shortest Path Tree:Dijkstra Algorithm

    After receiving all LSPs, each node willhave a copy of the whole topologynot

    sufficient to find the shortest pathto every

    other nodea shortest path treeisneeded

    A shortest path treeis a tree in which the

    path between the root and every othernode is the shortest

    What we need for each node is a shortest

    path tree with that node as the root52

    Dijk l i h

  • 8/13/2019 4-7 Network Layer.pptx

    53/109

    Dijkstra algorithm

    53

  • 8/13/2019 4-7 Network Layer.pptx

    54/109

    54

  • 8/13/2019 4-7 Network Layer.pptx

    55/109

    55

  • 8/13/2019 4-7 Network Layer.pptx

    56/109

    56

    Calculation of Routing Table from

  • 8/13/2019 4-7 Network Layer.pptx

    57/109

    g

    Shortest Path Tree

    57

  • 8/13/2019 4-7 Network Layer.pptx

    58/109

    OSPFOpen Shortest Path First

    58

    A

  • 8/13/2019 4-7 Network Layer.pptx

    59/109

    Area

    OSPF divides an autonomous system into

    areas

    An area is a collection of networks, hosts,

    and routers all contained within anautonomous system

    All networks inside an area must be

    connected

    59

  • 8/13/2019 4-7 Network Layer.pptx

    60/109

    Routers inside an area flood the area with

    routing information

    At the border of an area, special routers

    called area border routerssummarize theinformation about the area and send it to

    other areas

    60

  • 8/13/2019 4-7 Network Layer.pptx

    61/109

    All of the areas inside an autonomoussystem must be connected to a special

    area called the backbone area

    The backboneserves as aprimary areaand

    the other areas as secondary areas

    This does not mean that the routers

    within areas cannot be connected to

    each other

    The routers inside the backbone are

    called the backbone routers

    backbone router can also be an

    area border router

    Each area has an area identification

    The area identification of the

    backboneis zero

    61

  • 8/13/2019 4-7 Network Layer.pptx

    62/109

    62

  • 8/13/2019 4-7 Network Layer.pptx

    63/109

    If, because of some problem, the

    connectivity between a backbone and an

    area is broken, a virtual linkbetween routers

    must be created by the administration toallow continuity of the functions of the

    backbone as the primary area

    63

    M t i

  • 8/13/2019 4-7 Network Layer.pptx

    64/109

    Metric

    The OSPF protocol allows the

    administrator to assign a cost, called the

    metric, to each route

    The metric can be based on a type ofservice (minimum delay, maximum

    throughput, and so on)

    As a matter of fact, a router can havemultiple routing tables, each based on a

    different type of service64

    T pes of Links

  • 8/13/2019 4-7 Network Layer.pptx

    65/109

    Types of Links

    In OSPF terminology, a connection is called a link

    65

    Point to Point Link

  • 8/13/2019 4-7 Network Layer.pptx

    66/109

    Point-to-Point Link

    There is no need to assign a network address to

    this type of link

    66

    Transient Link

  • 8/13/2019 4-7 Network Layer.pptx

    67/109

    Transient Link A transient link is a network with several routers

    attached to it

    67

    It is not efficienteach router needs

    to advertise the neighborhood to four

    other routers

    It is not realisticthere is no single

    network (link) between each pair of

    routers (there is only one network

    (not router)that serves as a crossroad

    between all five routers)

    To show that each router is connected to

    every other router through one single

    networkthe network itself is representedby a node

    A network is not a machineit cannot

    function as a router

    So, one of the routers in the network takes

    this responsibilityIt is assigned a dual

    purposeit is a true routerand a

    designated router

  • 8/13/2019 4-7 Network Layer.pptx

    68/109

    While there is a metric from each node to the designated

    router, there is no metric from the designated router to

    any other nodeWe can only assign a cost to a packet

    that is passing through the network (We cannot charge

    for this twice)

    When a packet enters a network, we assign a cost; when a

    packet leaves the network to go to the router, there is no charge

    68

    Stub Link

  • 8/13/2019 4-7 Network Layer.pptx

    69/109

    Stub Link

    A special case of the transient network

    The link is only onedirectional, from therouter to the network

    69

    Virtual Link

  • 8/13/2019 4-7 Network Layer.pptx

    70/109

    Virtual Link

    When the link between two routers is

    broken, the administration may create a

    virtual link between them using a longer path

    that probably goes through several routers

    70

    Graphical Representation

  • 8/13/2019 4-7 Network Layer.pptx

    71/109

    Graphical Representation

    71

    OSPF Packets

  • 8/13/2019 4-7 Network Layer.pptx

    72/109

    OSPF Packets

    72

    Common Header

  • 8/13/2019 4-7 Network Layer.pptx

    73/109

    Common Header

    73

  • 8/13/2019 4-7 Network Layer.pptx

    74/109

  • 8/13/2019 4-7 Network Layer.pptx

    75/109

  • 8/13/2019 4-7 Network Layer.pptx

    76/109

    76

  • 8/13/2019 4-7 Network Layer.pptx

    77/109

    77

  • 8/13/2019 4-7 Network Layer.pptx

    78/109

    78

    Network Link LSA

  • 8/13/2019 4-7 Network Layer.pptx

    79/109

    Network Link LSA

    79

  • 8/13/2019 4-7 Network Layer.pptx

    80/109

    80

  • 8/13/2019 4-7 Network Layer.pptx

    81/109

    81

  • 8/13/2019 4-7 Network Layer.pptx

    82/109

    Summary Link to Network LSA

  • 8/13/2019 4-7 Network Layer.pptx

    83/109

    Summary Link to Network LSA

    83

    The summary link to network LSA is used by the area border router to

    announce the existence of other networks outside the area

  • 8/13/2019 4-7 Network Layer.pptx

    84/109

    84

    Summary Link to AS Boundary Router LSA

  • 8/13/2019 4-7 Network Layer.pptx

    85/109

    Summary Link to AS Boundary Router LSA

    85

  • 8/13/2019 4-7 Network Layer.pptx

    86/109

    86

    External Link LSA

  • 8/13/2019 4-7 Network Layer.pptx

    87/109

    External Link LSA

    87

    Other Packets

  • 8/13/2019 4-7 Network Layer.pptx

    88/109

    Other Packets

    They are not used as LSAs, but areessential to the operation of OSPF

    88

    Hello Message

  • 8/13/2019 4-7 Network Layer.pptx

    89/109

    Hello Message

    OSPF uses the hello message to create

    neighborhood relationships and to test the

    reachability of neighbors

    89

    Database Description Message

  • 8/13/2019 4-7 Network Layer.pptx

    90/109

    Database Description Message

    90

    Link State Request Packet

  • 8/13/2019 4-7 Network Layer.pptx

    91/109

    Link State Request Packet

    91

  • 8/13/2019 4-7 Network Layer.pptx

    92/109

    Encapsulation

  • 8/13/2019 4-7 Network Layer.pptx

    93/109

    Encapsulation

    93

  • 8/13/2019 4-7 Network Layer.pptx

    94/109

    PATH VECTOR ROUTING

    94

  • 8/13/2019 4-7 Network Layer.pptx

    95/109

    Path vector routing is exterior routingprotocol proved to be useful for interdomain

    or inter-AS routing

    95

    Reachability

  • 8/13/2019 4-7 Network Layer.pptx

    96/109

    Reachability

    96

    Routing Tables

  • 8/13/2019 4-7 Network Layer.pptx

    97/109

    Routing Tables

    A path vector routing table for each router can

    be created if ASs share their reachability list with

    each other97

    Loop Prevention

  • 8/13/2019 4-7 Network Layer.pptx

    98/109

    Loop Prevention

    The instability of distance vector routing andthe creation of loops can be avoided in path

    vector routing. When a router receives a

    reachability information, it checks to see if itsautonomous system is in the path list to any

    destination. If it is, looping is involved and

    that network-path pair is discarded.

    98

    Aggregation

  • 8/13/2019 4-7 Network Layer.pptx

    99/109

    Aggregation

    99

    Policy Routing

  • 8/13/2019 4-7 Network Layer.pptx

    100/109

    y g

    When a router receives a message, it cancheck the path. If one of the autonomous

    systems listed in the path is against its

    policy, it can ignore that path and thatdestination. It does not update its routing

    table with this path, and it does not send this

    message to its neighbors

    100

  • 8/13/2019 4-7 Network Layer.pptx

    101/109

    BGPBorder Gateway ProtocolAn interdomain routing protocol

    101

    Types of Autonomous Systems

  • 8/13/2019 4-7 Network Layer.pptx

    102/109

    yp y

    Stub AS

    Multihomed AS

    Transit AS

    102

    Stub AS

  • 8/13/2019 4-7 Network Layer.pptx

    103/109

    A stub AS has only one connection toanother AS

    The hosts in the AS can send data traffic

    to other Ass The hosts in the AS can receive data

    coming from hosts in other Ass

    Data traffic cannot pass through a stub AS A stub AS is either a source or a sink

    103

    Multihomed AS

  • 8/13/2019 4-7 Network Layer.pptx

    104/109

    A multihomed AS has more than oneconnection to other ASs, but it is still only

    a source or sink for data traffic

    It can receive data traffic from more thanone AS

    It can send data traffic to more than one

    AS, but there is no transient traffic

    It does not allow data coming from one AS

    and going to another AS to pass through

    104

    Transit AS

  • 8/13/2019 4-7 Network Layer.pptx

    105/109

    A transit AS is a multihomed AS that alsoallows transient traffic. Good examples of

    transit ASs are national and international

    ISPs (Internet backbones)

    105

  • 8/13/2019 4-7 Network Layer.pptx

    106/109

    Path Attributes

  • 8/13/2019 4-7 Network Layer.pptx

    107/109

    Well-known attribute

    One that every BGP router must recognize1. Well-known mandatory attribute

    one that must appear in the description of a route

    2. well-known discretionary attribute

    one that must be recognized by each router, but is not required

    to be included in every update message

    Optional attribute

    one that needs not be recognized by every router

    1. optional transitive attribute

    one that must be passed to the next router by the router that

    has not implemented this attribute

    2. optional nontransitive attribute

    one that must be discarded if the receiving router has not implemented

    it. 107

  • 8/13/2019 4-7 Network Layer.pptx

    108/109

    108

    A session is a connection that is established between two BGP

    routers only for the sake of exchanging routing information.

  • 8/13/2019 4-7 Network Layer.pptx

    109/109