Cn Chp4 [Compatibility Mode]

download Cn Chp4 [Compatibility Mode]

of 200

Transcript of Cn Chp4 [Compatibility Mode]

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    1/200

    Computer NetworksComputer Networks

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    Network Layer

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    2/200

    Chapter 4: Network LayerChapter 4: Network Layer

    Chapter goals: understanding principles

    behind network layerservices: routing (path selection)

    dealing with scale

    Overview: network layer services

    routing principles: pathselection

    hierarchical routing

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    how a router works advanced topics: IPv6,

    mobility

    instantiation and

    implementation in theInternet

    Internet routing protocolsreliable transfer intra-domain

    inter-domain

    whats inside a router?

    IPv6

    mobility

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    3/200

    Chapter 4 OutlineChapter 4 Outline

    4.1 Introduction and Network Service Models

    4.2 Routing Principles4.3 Hierarchical Routing

    4.4 The Internet (IP) Protocol

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    4.5 Routing in the Internet4.6 Whats Inside a Router

    4.7 IPv6

    4.8 Multicast Routing

    4.9 Mobility

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    4/200

    Network Layer FunctionsNetwork Layer Functions

    transport packet fromsending to receiving hosts

    network layer protocols ineveryhost, router

    three important functions:

    applicationtransportnetworkdata linkphysical

    networkdata linkphysical

    networkdata link

    physical

    networkdata link

    networkdata linkphysical

    networkdata linkphysical

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    taken by packets from sourceto dest. (Routing Algorithms)

    forwarding:move packetsfrom routers input to

    appropriate router output call setup:some network

    architectures require routercall setup along path before

    data flows

    networkdata linkphysical

    networkdata linkphysical

    p ysica

    networkdata linkphysical

    applicationtransportnetworkdata linkphysical

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    5/200

    Network Service ModelNetwork Service Model

    Q: What service modelforchannel transportingpackets from sender toreceiver?

    The most importantabstraction provided

    by network layer:

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    guaranteed bandwidth? preservation of inter-packet

    timing (no jitter)? loss-free delivery? in-order delivery? congestion feedback to

    sender?

    virtual circuitor

    datagram?

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    6/200

    Virtual circuitsVirtual circuits

    source-to-destination path behaves much liketelephone circuit

    performance-wise

    network actions along source-to-destination path

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    call setup, teardown for each call beforedata can flow each packet carries VC identifier (not destination host ID)

    everyrouter on source-destination path maintains statefor each passing connection transport-layer connection only involved two end systems

    Link and router resources (bandwidth, buffers) may beallocatedto VC to get circuit-like performance.

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    7/200

    Virtual Circuits: Signaling ProtocolsVirtual Circuits: Signaling Protocols

    used to setup, maintain teardown VC

    used in ATM, frame-relay, X.25 not used in todays Internet

    6. Receive data

    application

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    1. Initiate call

    2. Incoming call

    4. Call connected5. Data flow begins

    application

    transportnetworkdata linkphysical

    transportnetworkdata linkphysical

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    8/200

    Datagram networks:Datagram networks: the Internet modelthe Internet model

    2. Receive Data application

    no call setup at network layer

    routers: no state about end-to-end connections no network-level concept of connection

    packets forwarded using destination host address packets between same source-destination

    pair may take different paths

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    1. Send Data

    application

    transportnetworkdata linkphysical

    transportnetworkdata linkphysical

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    9/200

    Network Layer Service Models:Network Layer Service Models:

    NetworkArchitecture

    Internet

    ATM

    ServiceModel

    best effort

    CBR

    Bandwidth

    none

    constantrate

    Loss

    no

    yes

    Order

    no

    yes

    Timing

    no

    yes

    Congestionfeedback

    no (inferredvia loss)nocongestion

    Guarantees ?

    e

    e

    te

    rate

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    Internet model being extended: Integrated services,Differentiated Services

    Chapter 6

    ATM

    ATM

    ATM

    VBR

    ABR

    UBR

    guaranteedrateguaranteedminimumnone

    yes

    no

    no

    yes

    yes

    yes

    yes

    no

    no

    nocongestionyes

    noCBR:Constantbit

    ra

    VBR:Variablebitrat

    ABR:Availablebit

    ra

    UBR:Unspecified

    bit

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    10/200

    QoS FactorsQoS Factors

    Timing

    Connection Establishment Delay

    End-To-End Delay Connection Establishment Failure Probability

    Throughput or Bandwidth Guarantee

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    Ordering Preservation Congestion Indication (Control)

    Bit-Error rate or Packet-Loss Rate Control

    Protection Priority

    Resilience (Return Back to Normal Operation).

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    11/200

    Service ClasesService Clases

    Guaranteed Quality of Service

    Predictive Quality of Service

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    es or ua y o erv ce

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    12/200

    Guaranteed QoSGuaranteed QoS

    Specified through QoS parameter values deterministic

    statistical

    Single value - average (threshold, target)

    Pair of values - interval

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    Triple of values max., mean, min.

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    13/200

    Predictable ServicePredictable Service

    Parameter bounds based on history, that is, past

    network behavior. Parameter values are measured, and certain

    statistical analyses may be carried out

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    14/200

    Best Effort ServicesBest Effort Services

    No guarantees of quality, no QoS parameter values UDP/IP

    Partial guarantees, some QoS parameter values

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    re g ven. TCP/IP

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    15/200

    Datagram or VC Network: why?Datagram or VC Network: why?

    Internet data exchange among

    computers elastic service, no strict

    timing req. smart end systems

    (computers)

    ATM evolved from telephony human conversation:

    strict timing, reliabilityrequirements

    need for guaranteedservice

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    can adapt, performcontrol, error recovery simple inside network,

    complexity at edge many link types

    different characteristics uniform service is

    difficult

    dumb end systems telephones complexity inside

    network

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    16/200

    Active Queue Management (AQM)Active Queue Management (AQM)

    Performance Degradation in current TCPCongestion Control Multiple packet loss

    Low link utilization

    Congestion colla se

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    The role of the router (i.e., network) Control congestion effectively with a network

    Allocate bandwidth fairly

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    17/200

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    18/200

    FIFO Queueing in the RouterFIFO Queueing in the Router

    (Drop Tail)(Drop Tail)

    Network

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    Single queue maintained

    n er ace

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    19/200

    FIFO Queueing in the RouterFIFO Queueing in the Router

    (Drop Tail)(Drop Tail)

    Network

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    Single queue maintained

    Dequeue from head

    n er ace

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    20/200

    FIFO Queueing in the RouterFIFO Queueing in the Router

    (Drop Tail)(Drop Tail)

    Network

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    Single queue maintained

    Dequeue from head Enqueue at tail

    n er ace

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    21/200

    FIFO Queueing in the RouterFIFO Queueing in the Router

    (Drop Tail)(Drop Tail)

    Network

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    Single queue maintained

    Dequeue from head Enqueue at tailWhen full

    n er ace

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    22/200

    FIFO Queueing in the RouterFIFO Queueing in the Router

    (Drop Tail)(Drop Tail)

    Network

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    Single queue maintained

    Dequeue from head Enqueue at tailWhen full drop arriving packet (drop-tail)

    n er ace

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    23/200

    Active Queue ManagementActive Queue Management

    Goals:

    Better congestion notification for responsive flows(i.e. TCP)

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    Maintain shorter queues

    Fairness in drops (proportional)

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    24/200

    RED OperationRED Operation

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    25/200

    Max Queue Size

    Active Queue ManagementActive Queue Management

    Random Early Detection (RED)Random Early Detection (RED)

    Forced drop

    Drop probability

    Average queue length

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    Time

    ax res o

    Min Threshold

    Probabilistic drops

    No drops

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    26/200

    Chapter 4 OutlineChapter 4 Outline

    4.1 Introduction and Network Service Models

    4.2 Routing Principles Link state routing Distance vector routing

    4.3 Hierarchical Routing

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    4.4 The Internet (IP) Protocol4.5 Routing in the Internet

    4.6 Whats Inside a Router

    4.7 IPv64.8 Multicast Routing

    4.9 Mobility

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    27/200

    RoutingRouting

    Gra h abstraction for

    Goal: determine good path

    (sequence of routers) thrunetwork from source to dest.

    A F

    CB

    12

    2

    5

    35

    3

    Routing protocol

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    routing algorithms: graph nodes are

    routers

    graph edges arephysical links link cost: delay, $ cost,

    or congestion level

    good path: typically means minimum

    cost path

    other definitions possible

    D E1

    2

    Abstract model of a network

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    28/200

    Routing Algorithm ClassificationsRouting Algorithm Classifications

    1. Global: all routers have complete

    topology, link cost info link state algorithms

    1. Static:

    routes update slowly

    over time

    2. D namic:

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    . router knows physically-

    connected neighbors, linkcosts to neighbors

    iterative process ofcomputation, exchange ofinfo with neighbors

    distance vector algorithms

    routes update morequickly

    periodic update

    in response to linkcost changes

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    29/200

    A LinkA Link--State Routing AlgorithmState Routing Algorithm

    Dijkstras algorithm (global) net topology, link costs known to all

    nodes accomplished via link state

    broadcast

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    ll nodes have same information computes least cost paths from one

    node (source) to all other nodes

    gives routing table for that node iterative: after k iterations, know least

    cost path to k destinations.

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    30/200

    Notation:Notation:

    N: set of nodes whoseleast cost path

    definitively knownc(i,j): link cost from node

    i toj. cost infinite if

    A F

    D

    C

    E

    B

    1

    1

    2

    2

    2

    53

    5

    3

    5

    3

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    not direct neighbors p(v): nodes along path

    from source to v

    D(v): current value ofcost of path fromsource to destinationv.

    N: A, B, C, D, E, F

    C(A,C)=5; C(C,A)=5C(B,D)=2; C(D,B)=3

    Source=Ap(F): A-D-E-FD(F)=4

    Example:

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    31/200

    1 Initialization:2 N = {A}

    3 for all nodes v4 if v adjacent to A5 then D(v) = c(A,v)6 else D(v) = infinity

    Dijsktras AlgorithmDijsktras Algorithm

    v

    w

    D(v) c(w,v)

    A

    fnodes(exceptthesource)

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    8 Loop9 find w not in N such that D(w) is a minimum10 add w to N11 update D(v) for all v adjacent to w and not in N:

    12 D(v) = min( D(v), D(w) + c(w,v) )13 /* new cost to v is either old cost to v or known14 shortest path cost to w plus cost from w to v */15 untilall nodes in N

    w

    n(n+1)/2)

    times

    n=numbe

    ro

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    32/200

    Dijkstras Algorithm: exampleDijkstras Algorithm: example

    computes least cost paths from node A to all other nodes

    Step

    0123

    start N

    AADADE

    ADEB

    D(B),p(B)

    2,A-B2,A-B2,A-B2,A-B

    D(C),p(C)

    5,A-C4,A-D-C3,A-D-E-C3,A-D-E-C

    D(D),p(D)

    1,A-D1,A-D1,A-D1,A-D

    D(E),p(E)

    infinity2,A-D-E2,A-D-E2,A-D-E

    D(F),p(F)

    infinityinfinity4,A-D-E-F4,A-D-E-F

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    5 ADEBCFADEBCF, -

    2,A-B3,A-D-E-C3,A-D-E-C

    1,A-

    1,A-D

    , - -

    2,A-D-E4,A-D-E-F4,A-D-E-F

    A F

    D

    C

    E

    B

    1

    1

    1

    2

    2

    2

    53

    53

    D(v): Distance (cost) of A to v.

    P(v): nodes along path fromA to v.

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    33/200

    Dijkstras Algorithm: discussion1Dijkstras Algorithm: discussion1

    Algorithm complexity: Suppose there are nnodes, except source

    First iteration: Search through all nnodes to determine the node,w, not in Nthat has the minimum cost.

    Second iteration: Check n- 1 nodes to determine minimum cost.

    Third iteration: n- 2 nodes, and so on.

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    Total number of nodes searched: n(n+ 1)/2 The implementation of the link state algorithm has worst-case

    complexity of order nsquared: O(n2).

    A more sophisticated implementation of this algorithm, using adata structure known as a heap, can find the minimum in line 9 inlogarithmic rather than linear time, thus reducing the complexity:O( nlog(n) )

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    34/200

    D B

    A

    0

    1

    1

    1+e

    e0 0

    Dijkstras Algorithm: discussion2Dijkstras Algorithm: discussion2

    Oscillations possibility: Suppose link costs are equal to

    the load carried on the link, orthe delay that experienced.

    Link costs are not symmetric,

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    e

    1

    Fig. a- Initial routing

    c(A,B) equals c(B,A) only if theload on both directions on theABlink is the same.

    Nodes B and Doriginates a unit

    of traffic destined for A. Node Coriginates eunit forA.

    Discussion2 (cont )Discussion2 (cont )

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    35/200

    oscillations possible: Algorithm is run: C

    determines (Fig. a) the

    clockwise path to Ahas a costof 1, while thecounterclockwise path to A

    Discussion2 (cont.)Discussion2 (cont.)

    D

    C

    B

    A

    0

    1

    1

    1+e

    e

    e

    1

    0 0

    Fig. a- Initial routing

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    .

    least-cost path to Ais nowclockwise. Similarly, Bdetermines that

    its new least-cost path to Ais

    also clockwise, resulting incosts shown in Fig. b.

    D

    C

    B

    A

    1+e

    00

    0

    1

    2+e

    Fig. b- B, C find betterpath to A is clockwise

    1e

    1

    Discussion2 (cont )Discussion2 (cont )

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    36/200

    oscillations possible:

    When algorithm is run next,nodes B, C, and Dall detect azero-cost ath to Ain the

    Discussion2 (cont.)Discussion2 (cont.)

    Fi . c- B, C, D find better

    D

    C

    B

    A

    01+e1

    2+e

    0

    0

    11

    e

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    counterclockwise direction,and all route their traffic tothe counterclockwise routes.

    The next time the LSalgorithm is run, B, C, and Dallthen route their traffic to theclockwise routes.

    D

    C

    B

    A

    1+e00

    0

    1

    2+e

    11

    e

    path to A is counterclockwise

    Fig. d- B, C, D find better

    path to A is clockwise

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    37/200

    To prevent such oscillations: Solution1 :link costs not depend on the amount of traffic carried ,an

    unacceptable solution since one goal of routing is to avoid highly congested(for example, high-delay) links.

    Solution2 :all routers do not run the LS algorithm at the same time(a reasonable solution). Routers run the LS al orithm with the same eriodicit the

    Dijkstras Algorithm: discussion2Dijkstras Algorithm: discussion2

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    execution instance of the algorithm would not be the same ateach node.

    Researchers have noted: Routers in the Internet can self-synchronize among themselves. That is, even though theyinitially execute the algorithm with the same period but atdifferent instants of time, the algorithm execution instance caneventually become, and remain, synchronized at the routers.

    Avoid such self-synchronization: Introduce randomization intothe period between execution instants of the algorithm at eachnode.

    Distance Vector Routing AlgorithmDistance Vector Routing Algorithm

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    38/200

    Distance Vector Routing AlgorithmDistance Vector Routing Algorithm(Decentralized)(Decentralized)

    Iterative: continues until no

    nodes exchange info. self-terminating: no

    signal to stop

    Distance Table data structure each node has its own:

    row for each possible destination

    column for each directly-attached neighbor to node

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    nodes need notexchange info/iteratein lock step!

    distributed: each node

    communicates onlywithdirectly-attachedneighbors

    example: in node X, for dest. Yvia neighbor Z: DX(Y,Z)

    distance fromX toY, viaZ as next hop

    D (Y,Z)X

    c(X,Z) + min {D (Y,w)}Z

    w

    =

    Di t T bl lDi t T bl l

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    39/200

    Distance Table: exampleDistance Table: example

    2

    D

    CB

    A

    E1

    7

    1

    8

    2source

    ABCD

    A

    17

    64

    B

    1489

    11

    D

    55

    4

    neighbor: j

    estination

    :i

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    B

    w=

    c(E,B) + min {D (A,w)}=

    8 + 6 = 14

    E

    D (A,B)=E

    B

    D (A,C)B

    D

    C

    c(E,B)

    Bs neighbor

    D(i, j)EDistance table:

    Di t t bl i ti t blDi t t bl i ti t bl

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    40/200

    Distance table gives routing tableDistance table gives routing table

    D ()

    A

    A

    1

    B

    14

    D

    5

    E

    cost to destination via

    A A,1

    Outgoing linkto use, costD ()

    E

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    C

    D

    6

    4

    9

    11

    4

    2

    C

    D

    ,

    D,4

    D,4

    Distance table Routing tableof node E

    Di t V t R ti iDi t V t R ti i

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    41/200

    Distance Vector Routing: overviewDistance Vector Routing: overview

    Iterative, asynchronous:each local iteration causedby:

    local link cost change

    message from neighbor: itsleast cost path change

    waitfor (change in local linkcost or message fromneighbor)

    Each node:

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    from neighbor

    Distributed: each node notifies

    neighbors onlywhen its

    least cost path to anydestination changes neighbors then notify

    their neighbors ifnecessary

    recomputedistance table

    if least cost path to any

    destination has changed,

    notifyneighbors

    Distance Vector Algorithm:Distance Vector Algorithm:

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    42/200

    Distance Vector Algorithm:Distance Vector Algorithm:

    1 Initialization:

    2 for all adjacent nodes v:

    At node: X

    X

    v

    *

    DX (*,v)

    Xs adjacentsdestinations

    w

    Y

    DX (y,w)

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    ,v = t e means or a esst nat ons

    4 DX (v,v) = c(X,v)

    5 for all destinations, y6 send minW DX (y,w) to each neighbor /* w over allX's neighbors */

    Distance Vector Algorithm (cont ):Distance Vector Algorithm (cont ):

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    43/200

    Distance Vector Algorithm (cont.):Distance Vector Algorithm (cont.):8 loop

    9 wait ( until I see a link cost change to neighbor v10 or until I receive update from neighbor v )1112 if ( c(X,v) changes by d )

    13 /* change cost to all dest's via neighbor v by d */14 /* note: d could be positive or negative */15 for all destinations y: DX (y,v) = DX (y,v) + d16

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    e se i up ate receive rom v or estination

    18 /* shortest path from V to some Y has changed */19 /* V has sent a new value for its minW DV (Y,w) */20 /* call this received new value is "newval" */21 for the single destination y: DX (Y,v) = c(X,v) + newval

    2223 if we have a new minW DX(Y,w) for any destination Y24 send new value of minW DX(Y,w) to all neighbors25

    26 forever

    Distance Vector Algorithm: exampleDistance Vector Algorithm: example

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    44/200

    Distance Vector Algorithm: exampleDistance Vector Algorithm: example

    2Y

    1

    Node Xs table

    Node Ys table

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    X Z7

    Node Zs table

    time

    new minimum

    Distance Vector Algorithm: exampleDistance Vector Algorithm: example

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    45/200

    Distance Vector Algorithm: exampleDistance Vector Algorithm: example

    2

    Y

    X Z

    1

    7X learns this term from Y

    X sends newDX(Y,Z) to Y and Z

    X dose not sendsDX(Y,Y) to Y and Z.

    1

    2 2

    3

    4

    4

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    D (Y,Z)X c(X,Z) + min {D (Y,w)}w=

    = 7+1 = 8

    Z

    D (Z,Y)X c(X,Y) + min {D (Z,w)}w=

    = 2+1 = 3

    Y

    X learns this term from Z

    1

    1

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    46/200

    Distance Vector: link cost changesDistance Vector: link cost changes

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    47/200

    Distance Vector: link cost changesDistance Vector: link cost changes

    Link cost changes: Routing loop: in order to

    get to X, Y routes through

    Z, and Z routes through Y. count to infinity problem!

    4Y

    X Z

    1

    50

    60

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    algorithmcontinues

    on!

    Poisoned reverse solution: count to infinity problem!Poisoned reverse solution: count to infinity problem!

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    48/200

    y py p

    If Z routes through Y to get to X : Z tells Y its (Zs) distance to X is

    infinite (so Y wont route to X via Z)

    will this completely solve count toinfinity problem?

    4Y

    X Z

    1

    50

    60

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    terminates

    Comparison of LS and DV algorithmsComparison of LS and DV algorithms

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    49/200

    Co p so o S d go t sCo p so o S d go t s

    Message complexity LS: with n nodes, E links,

    O(nE) msgs sent each

    DV: exchange between

    neighbors only convergence time varies

    S eed of Conver ence

    Robustness: what happensif router malfunctions?

    LS: Node (router) can

    advertise incorrect linkcost

    each node computes only

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    LS: O(n2

    ) algorithm requiresO(nE) msgs

    may have oscillations

    DV: convergence time varies

    may be routing loops count-to-infinity problem

    s own a e: ro us ness

    DV: DV node can advertise

    incorrect least-costpaths

    each nodes table used byothers error propagate thru

    network

    Chapter 4 OutlineChapter 4 Outline

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    50/200

    Chapter 4 OutlineChapter 4 Outline

    4.1 Introduction and Network Service Models

    4.2 Routing Principles

    4.3 Hierarchical Routing

    4.4 The Internet (IP) Protocol

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    4.5 Routing in the Internet4.6 Whats Inside a Router

    4.7 IPv6

    4.8 Multicast Routing4.9 Mobility

    Hierarchical RoutingHierarchical Routing

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    51/200

    Hierarchical RoutingHierarchical Routing

    The routing study thus far was idealized

    all routers identical

    network flat

    nottrue in practice

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    scale: with 200 milliondestinations (hosts): cant store all dests in routing

    tables (memory limitation)! routing table exchange would

    leave no bandwidth left forsending data packets!

    DV algorithm that iteratedamong large number ofrouters never converge!

    administrativeautonomy: internet = network of

    networks

    each network admin maywant to control routing in itsown network

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    52/200

    IntraIntra--AS and InterAS and Inter--AS routingAS routing

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    53/200

    IntraIntra AS and InterAS and Inter AS routingAS routing

    Gateways:perform inter-ASrouting amongstthemselves

    perform intra-ASrouters with otherrouters in theirAS

    C

    A

    B

    C.b

    A.a

    A.c

    B.a

    a b

    ad

    bc

    ac

    b

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    Inter/intra-ASrouting in

    gateway A.c

    Routers in an AShave informationabout routing pathswithin that AS.

    IntraIntra--ASASRoutingRouting

    AlgorithmAlgorithm

    InterInter--ASASRoutingRouting

    AlgorithmAlgorithm

    Routing TableRouting Table

    DLDL DLDL DLDL

    PHLPHLPHLPHL PHL To/from B.a and A.aTo/from A.b

    To/from A.d

    IntraIntra--AS and InterAS and Inter--AS routingAS routing

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    54/200

    Host2

    ab

    ac

    b

    C.b

    A.a

    B.a

    A.c

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    A

    Intra-AS routingwithin AS A

    Intra-AS routingwithin AS B

    Host1

    db

    c

    Chapter 4 outlineChapter 4 outline

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    55/200

    pp

    4.1 Introduction and Network Service Models4.2 Routing Principles4.3 Hierarchical Routing

    4.4 The Internet (IP) Protocol 4.4.1 IPv4 addressing 4.4.2 Moving a datagram from source to destination 4.4.3 Data ra or at

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    4.4.4 IP fragmentation 4.4.5 ICMP: Internet Control Message Protocol 4.4.6 DHCP: Dynamic Host Configuration Protocol 4.4.7 NAT: Network Address Translation

    4.5 Routing in the Internet

    4.6 Whats Inside a Router4.7 IPv64.8 Multicast Routing4.9 Mobility

    The Internet Network layerThe Internet Network layer

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    56/200

    yy

    Host, Router network-layer-functions:

    Routing protocolspath selectionRIP, OSPF, BGP

    IP protocoladdressing conventionsdatagram formatpacket handling conventions

    Transport layer: TCP, UDP

    orklayer

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    forwardingtable ICMP protocolerror reporting

    router signaling

    Link layer

    physical layer

    N

    et

    ICMP: Internet Control Message Protocol, RFC792

    Internet Routing ProtocolInternet Routing Protocol

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    57/200

    gg

    Intra-AS: administrator responsible for choice ofrouting algorithm within network Also known as Interior Gateway Protocols (IGP)

    Most common Intra-AS routing protocols:RIP: Routing Information Protocol (RFCs1058,2453)

    It is a distance vector protocol.

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    . .

    OSPF: Open Shortest Path First (RFC2328) (Open Spec.)IGRP: Interior Gateway Routing Protocol (Cisco proprietary)

    These are link-state protocol that uses flooding of link information and a

    Dijkstra least-cost path algorithm.

    Inter-AS: unique standard for inter-AS routing:BGP (RFC1771)

    IP Addressing: IntroductionIP Addressing: Introduction

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    58/200

    IP address: 32-bitidentifier for host,router interface

    interface:connectionbetween host/router

    223.1.1.1

    223.1.1.2

    223.1.1.3

    223.1.1.4223.1.2.9

    223.1.2.2

    223.1.2.1

    223.1.3.27

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    routers typically have

    multiple interfaces

    host may have multipleinterfaces

    IP addressesassociated with eachinterface

    223.1.3.2223.1.3.1

    223.1.1.1 = 11011111 00000001 00000001 00000001

    223 1 11

    IP AddressingIP Addressing

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    59/200

    IP address: network part (high

    order bits)

    host part (low orderbits)

    223.1.1.1

    223.1.1.2

    223.1.1.3

    223.1.1.4 223.1.2.9

    223.1.2.2

    223.1.2.1

    223.1.3.27

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    (from IP addressperspective) device interfaces with

    same network part of

    IP address can physically reach

    each other withoutintervening router

    223.1.3.2223.1.3.1

    network consisting of 3 IP networks

    LAN

    IP AddressingIP Addressing223.1.1.2

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    60/200

    IP AddressingIP Addressing

    How to find thenetworks?

    Detach eachinterface fromrouter, host

    223.1.1.1

    223.1.1.3

    223.1.1.4

    223.1.7.0223.1.9.2

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    crea e s an s o

    isolated networks

    223.1.2.2223.1.2.1

    223.1.2.6

    223.1.3.2223.1.3.1

    223.1.3.27

    223.1.7.1

    223.1.8.0223.1.8.1

    223.1.9.1

    Interconnectedsystem consistingof six networks.

    Getting a datagram from source to dest.Getting a datagram from source to dest.

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    61/200

    IP datagram:miscields

    sourceIP addr

    destIP addr data

    Dest. Net. Next Router Nhops

    223.1.1 1

    223.1.2 223.1.1.4 2223.1.3 223.1.1.4 2

    forwarding table in A

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    datagram remainsunchanged, as it travelssource to destination

    addr fields of interest

    here

    . . .

    223.1.1.2

    223.1.1.3

    223.1.1.4 223.1.2.9

    223.1.2.2

    223.1.2.1

    223.1.3.2223.1.3.1

    223.1.3.27 EB

    Getting a datagram from source to dest.Getting a datagram from source to dest.

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    62/200

    Starting at A, send IPdatagram addressed to B:

    look u net. address of B in

    Dest. Net. Next Router Nhops

    223.1.1 1

    223.1.2 223.1.1.4 2223.1.3 223.1.1.4 2

    miscfields 223.1.1.1 223.1.1.3 data

    forwarding table in A

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    . . .

    223.1.1.2

    223.1.1.3

    223.1.1.4 223.1.2.9

    223.1.2.2

    223.1.2.1

    223.1.3.2223.1.3.1

    223.1.3.27 EB

    forwarding table

    find B is on same net. as A

    link layer will send datagramdirectly to B inside link-layerframe

    B and A are directlyconnected

    Getting a datagram from source to dest.Getting a datagram from source to dest.

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    63/200

    Dest. Net. Next Router Nhops

    223.1.1 1

    223.1.2 223.1.1.4 2223.1.3 223.1.1.4 2Starting at A, dest. E: look up network address of E

    in forwarding table

    miscfields 223.1.1.1 223.1.2.3 data

    forwarding table in A

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    E on differentnetwork

    A, E not directly attached routing table: next hop

    router to E is 223.1.1.4

    link layer sends datagram torouter 223.1.1.4 inside link-layer frame

    datagram arrives at 223.1.1.4

    continued..

    . . .

    223.1.1.2

    223.1.1.3

    223.1.1.4 223.1.2.9

    223.1.2.2

    223.1.2.1

    223.1.3.2223.1.3.1

    223.1.3.27 EB

    Getting a datagram from source to dest.Getting a datagram from source to dest.

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    64/200

    Arriving at 223.1.4,destined for 223.1.2.2

    look u network address of E

    miscfields 223.1.1.1 223.1.2.3 data

    Dest. Net Router Nhops Interface

    223.1.1 - 1 223.1.1.4

    223.1.2 - 1 223.1.2.9223.1.3 - 1 223.1.3.27

    forwarding table in router

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    . . .

    223.1.1.2

    223.1.1.3

    223.1.1.4 223.1.2.9

    223.1.2.2

    223.1.2.1

    223.1.3.2223.1.3.1

    223.1.3.27 EB

    in routers forwarding table

    E on samenetwork as routersinterface 223.1.2.9

    router, E directly attached

    link layer sends datagram to223.1.2.2 inside link-layerframe via interface 223.1.2.9

    datagram arrives at 223.1.2.2

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    65/200

    IP Addresses: ClassIP Addresses: Class--fullfull

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    66/200

    given notion of network, lets re-examine IP addresses:

    class-full addressing:

    0 network hostA

    class1.0.0.0 to127.255.255.255

    format range

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    110 network host

    10 network hostB

    C

    D

    128.0.0.0 to191.255.255.255

    192.0.0.0 to223.255.255.255

    224.0.0.0 to

    239.255.255.255

    32 bits

    1110 multicast address

    E 240.0.0.0 to255.255.255.2551111 reserved

    ClassClass--full Summaryfull Summary

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    67/200

    Address

    ClassApplication

    Number of

    Network

    Bits

    Number of

    Host Bits

    Decimal

    Address

    Ran e

    Number of

    Networks

    Number of

    Possible

    Host

    Class A

    Large

    Networks 8 bits 24 bits 1 - 126 126 16,777,214

    Class BMedium-

    sized16 bits 16 bits 128 - 191 65,534 65,534

    Class CSmall

    24 bits 8 bits 192 - 223 2,097,152 254

    The Class System

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    Class D and E

    12.5%

    Class C

    12.5% Class A50%

    Class B

    25%

    e wor s

    Address depletionAddress depletion

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    68/200

    In 1991 IAB identified 3 dangers Running out of class B addresses

    Increase in nets has resulted in routing table explosion Increase in net/hosts exhausting 32 bit address space

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    Creative address space allocation {RFC 2050} Private addresses {RFC 1918}, Network Address

    Translation (NAT) {RFC 1631}

    Classless InterDomain Routing (CIDR) {RFC 1519}

    IP version 6 (IPv6) {RFC 1883}

    Creative IP address allocationCreative IP address allocation

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    69/200

    Class A addresses 64 127 reserved Handle on individual basis

    Class B only assigned given a demonstrated need Class C

    divided u into 8 blocks allocated to re ional authorities

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    208-223 remains unassigned and unallocated

    Three main registries handle assignments APNIC Asia & Pacific www.apnic.net ARIN N. & S. America, Caribbean & sub-Saharan Africa

    www.arin.net RIPE Europe and surrounding areas www.ripe.net

    Private IP AddressesPrivate IP Addresses

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    70/200

    IP addresses that are not globally unique, but usedexclusively in an organization

    Three ranges: 10.0.0.0 - 10.255.255.255 a single class A net 172.16.0.0 - 172.31.255.255 16 contiguous class Bs

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    192.168.0.0 192.168.255.255 256 contiguous class Cs

    Connectivity provided by Network AddressTranslator (NAT) translates outgoing private IP address to Internet IP

    address, and a return Internet IP address to a private

    address Only for TCP/UDP packets

    Special Purpose IP AddressesSpecial Purpose IP Addresses

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    71/200

    Several Addresses within the classes arereserved for special use.

    0.0.0.0 :Source IP Addr. Just after Boot network part of dest. Addr.= 0 :Source and

    Destination are in same network.

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    Dest. Addr.=255.255.255.255 :Broadcast inSenders network.

    host part of Dest.=111 : Broadcast indestination network.

    Dest. Addr. = 127.anything : Loop Back

    Special Purpose AddressesSpecial Purpose Addresses--ListList

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    72/200

    Address Block Present Use Reference0.0.0.0/8 "This" Network [RFC1700, page 4]10.0.0.0/8 Private-Use Networks [RFC1918]14.0.0.0/8 Public-Data Networks [RFC1700, page 181]24.0.0.0/8 Cable Television Networks39.0.0.0/8 Reserved, subject to allocation [RFC1797]127.0.0.0/8 Loop back [RFC1700, page 5]128.0.0.0/16 Reserved but subject to allocation169.254.0.0/16 Link Local

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    172.16.0.0/12 Private-Use Networks [RFC1918]

    191.255.0.0/16 Reserved but subject to allocation 192.0.0.0/24 Reserved but subject to allocation 192.0.2.0/24 Test-Net192.88.99.0/24 6to4 Relay Anycast [RFC3068]192.168.0.0/16 Private-Use Networks [RFC1918]198.18.0.0/15 Network Interconnect Device Benchmark Testing [RFC2544]223.255.255.0/24 Reserved but subject to allocation 224.0.0.0/4 Multicast [RFC3171]240.0.0.0/4 Reserved for Future Use [RFC1700]

    Class Inter Domain RoutingClass Inter Domain Routing

    (CIDR)(CIDR)

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    73/200

    ( )( )

    Many organization have > 256 computersbut few have more than several thousand

    Instead of giving class B (16384 nets) givesufficient conti uous class C addresses to

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    satisfy needs < 256 addresses assign 1 class C

    < 8192 addresses assign 32 contiguous Class Cnets

    IP addressing: CIDRIP addressing: CIDR

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    74/200

    Classful addressing: inefficient use of address space, address space exhaustion

    e.g., class B net allocated enough addresses for 65K hosts,even if only 2K hosts in that network

    CIDR: Classless Inter Domain Routing (RFC1519)

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    network portion of address of arbitrary length

    address format: a.b.c.d/x, where x is # bits in networkportion of address

    11001000 00010111 00010000 00000000

    network

    part

    host

    part

    200.23.16.0/23

    Bit Masks and Subnet MasksBit Masks and Subnet Masks

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    75/200

    In a production environment this prefix typicallyvaries in length from 8 to 30 bits

    /16 = 255.255.0.0/17 = 255.255.128.0/18 = 255.255.192.0/19 = 255.255.224.0

    /24 = 255.255.255.0/25 = 255.255.255.128/26 = 255.255.255.192/27 = 255.255.255.224

    /8 = 255.0.0.0/9 = 255.128.0.0/10 = 255.192.0.0/11 = 255.224.0.0

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    /30yields two usable hosts and is used for WAN connections

    /20 = 255.255.240.0

    /21 = 255.255.248.0/22 = 255.255.252.0/23 = 255.255.254.0

    /28 = 255.255.255.240

    /29 = 255.255.255.248/30 = 255.255.255.252/31 = not usable/32 = not usable

    /12 = 255.240.0.0

    /13 = 255.248.0.0/14 = 255.252.0.0/15 = 255.254.0.0

    Network Prefix Equivalent Number of Class Addresses Number of Hosts

    Prefix Equivalents

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    76/200

    q

    /27 1/8th of a Class C 32

    /26 1/4th of a Class C 64

    /25 1/2 of a Class C 128

    /24 1 Class C 256

    /23 2 Class C 512

    /22 4 Class C 1,024

    /21 8 Class C 2,048

    /20 16 Class C 4,096

    /19 32 Class C 8,192

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    /18 64 Class C 16,384

    /17 128 Class C 32,768

    /16 256 Class C or 1 Class B 65,536

    /15 512 Class C or 2 Class B 131,072

    /14 1,024 Class C or 4 Class B 262,144

    /13 2048 Class C or 8 Class B 524,288

    /12 4096 Class C or 16 Class B 1,048,576/11 8192 Class C or 32 Class B 2,097,152

    /10 16384 Class C or 64 Class B 4,194,304

    /9 32768 Class C or 128 Class B 8,388,608

    /8 65,536 Class C or 256 Class B or 1 Class A 16,777,216

    ProtocolsProtocols

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    77/200

    Class-full Routing Protocols Classless Routing Protocol

    RIP version1 RIP version2

    IGPR EIGPR

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    EGP OSPF

    BGP3 BGP4

    IS-IS

    ExamplesExamples

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    78/200

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    IP addresses: how to get one?IP addresses: how to get one?

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    79/200

    Q: How does hostget IP address?

    IP addr. is configures into host by admin. in a file Wintel: control-panel->network->configuration-

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    -

    UNIX: /etc/rc.config

    DHCP: Dynamic Host Configuration Protocol (RFC2131):

    dynamically get address from as server plug-and-play

    Subnetting (Extended Network Prefix)Subnetting (Extended Network Prefix)

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    80/200

    Q: How an organization gets network part of IP addr?A: It gets allocated portion of its ISPs address

    space.

    '

    The ISP have been allocated the address block

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    . . .

    Organization 0 11001000 00010111 00010000 00000000 200.23.16.0/23Organization 1 11001000 00010111 00010010 00000000 200.23.18.0/23Organization 2 11001000 00010111 00010100 00000000 200.23.20.0/23

    ... .. . .

    Organization 7 11001000 00010111 00011110 00000000 200.23.30.0/23

    The ISP divides the block into 8 smaller addr.blocks (subnets) and gives them to 8

    organization.

    Hierarchical addressing: route aggregationHierarchical addressing: route aggregation

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    81/200

    Hierarchical addressing allows efficientadvertisement of routing information:

    Send me anything

    200.23.16.0/23

    Organization 0

    Organization 1

    route aggregation orroute summarization.

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    w a ressesbeginning

    200.23.16.0/20

    200.23.18.0/23

    200.23.30.0/23

    Organization 7Internet

    ISP2 Send me anythingwith addressesbeginning199.31.0.0/16

    200.23.20.0/23Organization 2

    ...

    ...

    199.31.0.0/16

    ISP1200.23.16.0/20

    Hierarchical addressing: more specific routesHierarchical addressing: more specific routes

    ISP2 has a more specific route to Organization 1

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    82/200

    Send me anythingwith addressesbeginning

    200.23.16.0/23

    Organization 0

    The routers in Internet use a longest prefix matching rule, and routetoward ISP2, as it advertises the longest (more specific) address prefixthat matches the destination address.

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    200.23.16.0 /20

    200.23.18.0/23

    200.23.30.0/23

    ISP1

    Organization 7 Internet

    Organization 1 ISP2

    Send me anything

    with addressesbeginning 199.31.0.0/16or 200.23.18.0 /23

    200.23.20.0/23

    Organization 2

    ...

    .

    ..

    23 bits

    20 bits

    Subnet MaskSubnet Mask--11

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    83/200

    A subnet mask is applied to the host bits todetermine how the network is subnetted, e.g. if the host is: 137.138.28.228, and the subnet mask

    is 255.255.255.0 then the right hand 8 bits are for thehost (255 is decimal for all bits set in an octet)

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    Host addresses of all bits set or no bits set,

    indicate a broadcast, i.e. the packet is sent to allhosts.

    Subnet MaskSubnet Mask--22

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    84/200

    ISP's block 11001000 00010111 00010000 00000000 200.23.16.0/20ISPs subnet mask 11111111 11111111 11110000 00000000 255.255.240.0

    Organization 0 11001000 00010111 00010000 00000000 200.23.16.0/23Organization 1 11001000 00010111 00010010 00000000 200.23.18.0/23

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    Organization 2 11001000 00010111 00010100 00000000 200.23.20.0/23

    ... .. . .Organization 7 11001000 00010111 00011110 00000000 200.23.30.0/23

    Ors subnet mask 11111111 11111111 11111110 00000000 255.255.254.0

    Network part of an IP address= subnet mask & IP address

    IP addressing: ICANNIP addressing: ICANN

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    85/200

    Q: How does an ISP get block of addresses?

    A: ICANN: Internet Corporation for Assigned

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    allocates addresses manages DNS

    assigns domain names, resolves disputes

    CIDR: Subneting ExampleCIDR: Subneting Example

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    86/200

    You are assigned the CIDR address 200.32.108.0 /22 and

    you must support the network shown in the diagram.

    Create an addressing scheme that will meet the diagramrequirements.

    100 computers

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    100 computers

    100 computers

    300 computers

    CIDR: Subneting ExampleCIDR: Subneting Example

    (Questions)(Questions)

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    87/200

    Given the CIDR address 200.32.108.0 /22

    How many Class C networks do we have? 3 classes

    How many host addresses do we have? 4x254 addresses What is the largest LAN requirement? 300 addresses

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    Host required - 300, 100, 100, 100, and 3 WAN links

    0 0

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    88/200

    200.32.108.0 200.32. 110.0

    255 255

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    0 0

    255 255

    200.32. 109.0 200.32. 111.0

    0 0

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    89/200

    200.32. 110.0

    255 255

    osts

    08.0/

    23

    200.32.108.0

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    0 0

    255 255

    3

    00

    200.32.

    1

    200.32. 109.0

    200.32. 111.0

    0 0 128

    2525

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    90/200

    255 255

    osts

    08.0/

    23

    127

    1

    00h

    osts

    200.

    32.

    110.

    0/

    25

    1

    00h

    osts

    200.3

    2.

    110.

    128/

    200.32.108.0 200.32. 110.0

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    0 0

    255 255

    3

    00

    200.32.

    1

    200.32. 109.0

    200.32. 111.0

    0 0 128

    25 /2

    5

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    91/200

    255 255

    osts

    08.

    0/

    23

    127

    1

    00h

    osts

    200.

    32.

    110.

    0/

    25

    1

    00h

    osts

    200.3

    2.

    110.

    128/2

    200.32.108.0 200.32. 110.0

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    0 0

    255 255

    3

    00

    200.32.

    1

    127

    128

    100h

    osts

    200.3

    2.

    111.0/

    25

    200.32. 109.0 200.32. 111.0

    0 0 128

    25 /25

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    92/200

    255 255

    osts

    08.

    0/

    23

    127

    1

    00h

    osts

    200.

    32.

    110.

    0/

    25

    1

    00h

    osts

    200.3

    2.

    110.

    128/

    200.32.108.0 200.32. 110.0

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    0 0

    255 255

    3

    00

    200.32.

    1

    127

    128

    100h

    osts

    200.3

    2.

    111.0/

    25

    191192

    223

    224

    248

    247

    243252

    251244

    WAN links/30

    240239

    200.32. 109.0 200.32. 111.0

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    93/200

    Company XYZ needs to address 400 hosts

    Supernetting ExampleSupernetting Example--11

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    94/200

    Company XYZ needs to address 400 hosts. Its ISP gives them two contiguous Class C addresses:

    207.21.54.0/24 207.21.55.0/24

    Company XYZ can use a prefix of 207.21.54.0 /23 to supernet these twocontiguous networks. (Yielding 510 hosts) 207.21.54.0 /23

    207.21.54.0/24

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    . . .

    23 bits in common

    Supernetting ExampleSupernetting Example--22

    addressing authority of ISP include XYZ

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    95/200

    addressing authority of ISP,include XYZ,be advertized to Internet as a single supernt

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    CIDR and the ProviderCIDR and the Provider

    example of route aggregation

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    96/200

    advertising address: a.b.c.d/x

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    IPIP datagram formatdatagram format

    ver l h

    32 bitsIP protocol versionNumber[4bits]

    header length total datagramlength (bytes)head type of

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    97/200

    ver length

    16-bit identifier

    Checksum: 1s add of

    16bits words in header

    time to

    live32 bit source IP address

    header length(bytes)[4bits]

    max number

    fragmentation/Reassembly/

    DF, MF Flags

    total datagramlength (bytes)

    upper layerprotocol

    head.len

    type ofservice

    type of data: Priority [3bits]Delay[1bit]

    Throughput[1bit]Reliability[1bit]

    flags fragmentoffset

    upper

    layer

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    data(variable length,typically a TCP

    or UDP segment)

    rema n ng o s(decremented at

    each router)

    o e verpayload to(rfc 1700)

    es na on a ress

    Options (if any)

    e.g. timestamp,record routetaken, specifylist of routersto visit.

    how much overheadwith TCP?

    20 bytes of TCP 20 bytes of IP

    = 40 bytes + applayer overhead

    A packet is unique in Internet by:Id + S. IP Add + D. IP Add + Upper L.

    1 :ICMP6 :TCP17 :UDP

    IP Fragmentation & ReassemblyIP Fragmentation & Reassembly

    network links have MTU

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    98/200

    network links have MTU(max.transfer size) - largestpossible link-level frame.

    different link types,

    different MTUs large IP datagram divided

    (fragmented) within net

    fragmentation:

    in: one large datagramout: 3 smaller datagrams

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    one datagram becomes

    several datagrams reassembled only at final

    destination

    IP header bits used toidentify, order related

    fragments

    reassembly

    IP Fragmentation and ReassemblyIP Fragmentation and Reassembly

    0.3979

    data20 Byte

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    99/200

    ID=x

    offset=0

    fragflag=0

    length=4000

    ID offsetfragflaglength

    Example

    4000 byte

    datagram MTU = 1500 bytes

    4000 Bytes

    0.1479

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    ID=x

    offset=1480

    fragflag=1

    length=1500

    ID=x

    offset=2960

    fragflag=0

    length=1040

    One large datagram becomes3 smaller datagrams.

    14802959

    Network managers or users identify network problems. On f th m st f ntl s d d b in t ls in k s th

    ICMPICMP: Internet Control Message Protocol: Internet Control Message Protocol

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    100/200

    Networ managers or users dent fy networ problems. One of the most frequently used debugging tools invokes the

    ICMP echo requestand echo replymessages.

    A host or router sends an ICMP echo request message to aspecified destination.

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    The command users invoke to send ICMP echo requests is

    namedping. Sophisticated versions of ping send a series ofICMP echo requests, capture responses, and providestatistics about datagram loss. They allow the user tospecify the length of the data being sent and the interval

    between requests. Less sophisticated versions merely sendone ICMP echo request and await a reply.

    Any machine that receives an echo request formulates an

    echo reply and returns it to the original sender. The requestcontains an optional data area; the reply contains a copy of

    ICMP (Cont.)ICMP (Cont.)

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    101/200

    p y g qcontains an optional data area; the reply contains a copy ofthe data sent in the request. The echo request andassociated reply can be used to test whether a destination isreachable and responding. Because both the request andreply travel in IP datagrams, successful receipt of a replyverifies that major pieces of the transport system work.

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    ,the datagram.

    Second, intermediate routers between the source anddestination must be operating and must route thedatagram correctly.

    Third, the destination machine must be running (at least

    it must respond to interrupts), and both ICMP and IPsoftware must be working.

    Finally, all routers along the return path must havecorrect routes.

    ICMP (Cont.)ICMP (Cont.)

    The Internet Control Message Protocol allows routers to send error or

    control messages to other routers or hosts; ICMP providescommunication between the Internet Protocol software on one machine

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    102/200

    g pand the Internet Protocol software on another.

    When a datagram causes an error, ICMP can only report the error

    condition back to the original source of the datagram; the source mustrelate the error to an individual application program or take otheraction to correct the problem.

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    Each ICMP message has its own format. They all begin with the same

    three fields: an 8-bit TYPE field that identifies the message, an 8-bit CODE field that provides further information about the

    message type, a 16-bit CHECKSUM field (ICMP uses the same additive checksum

    algorithm as IP, but the ICMP checksum only covers the ICMPmessage). In addition, ICMP messages that report errors always include the

    header and first 64 data bits of the datagram causing the problem.

    ICMP: TYPE, CODEICMP: TYPE, CODE

    Type Code description0 0 echo reply (ping)

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    103/200

    yp p0 0 echo reply (ping)3 0 dest. network unreachable3 1 dest host unreachable

    3 2 dest protocol unreachable3 3 dest port unreachable3 6 dest network unknown

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    3 7 dest host unknown

    4 0 source quench (congestioncontrol - not used)

    8 0 echo request (ping)9 0 route advertisement

    10 0 router discovery11 0 TTL expired12 0 bad IP header

    ICMPs Message Format: an exampleICMPs Message Format: an example

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    104/200

    OPTIONAL DATAis a variable length field that contains data to be returned to thesender. An echo reply always returns exactly the same data as was received in therequest. IDENTIFIERand SEQUENCE NUMBERare used by the sender to matchreplies to requests. The value of the TYPEfield specifies whether the message is a

    ICMP echo request or reply message format.

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    The ICMP message is encapsulated in an IP datagram, which is furtherencapsulated in a frame for transmission. To identify ICMP, the datagramprotocol field contains the value 1.

    reques or a rep y .

    DHCPDHCP: Dynamic Host Configuration Protocol: Dynamic Host Configuration Protocol

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    105/200

    Goal: allow host to dynamicallyobtain its IP addressfrom network server when it joins network

    Can renew its lease on address in useAllows reuse of addresses (only hold address while connected

    an on

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    Support for mobile users who want to join network (more

    shortly)DHCP overview:

    host broadcasts DHCP discover msg

    DHCP server responds with DHCP offer msg host requests IP address: DHCP request msg

    DHCP server sends address: DHCP ack msg

    DHCP clientDHCP client--server scenarioserver scenario

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    106/200

    223.1.1.1

    223.1.1.2223.1.1.4 223.1.2.9

    223.1.2.1

    DHCPserver

    A

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    223.1.1.3

    223.1.2.2

    223.1.3.2223.1.3.1

    223.1.3.27 arriving DHCPclient needsaddress in thisnetwork

    B

    E

    DHCP clientDHCP client--server scenarioserver scenario

    DHCP server: 223.1.2.5arriving

    clientDHCP discoversrc : 0.0.0.0, 68

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    107/200

    ,dest.: 255.255.255.255,67 yiaddr: 0.0.0.0transaction ID: 654

    DHCP offer

    src: 223.1.2.5, 67dest: 255.255.255.255, 68yiaddrr: 223.1.2.4transaction ID: 654

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    time

    Lifetime: 3600 secsDHCP request

    src: 0.0.0.0, 68dest:: 255.255.255.255, 67yiaddrr: 223.1.2.4transaction ID: 655Lifetime: 3600 secs

    DHCP ACK

    src: 223.1.2.5, 67dest: 255.255.255.255, 68yiaddrr: 223.1.2.4transaction ID: 655Lifetime: 3600 secs

    NAT: Network Address TranslationNAT: Network Address Translation

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    108/200

    10.0.0.1

    10.0.0.210.0.0.4

    local network(e.g., home network)

    10.0.0/24

    rest ofInternet

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    10.0.0.3

    138.76.29.7

    Datagrams with source ordestination in this network

    have 10.0.0/24 address forsource, destination (as usual)

    Alldatagrams leavinglocalnetwork have same single source

    NAT IP address: 138.76.29.7,different source port numbers

    NAT: Network Address TranslationNAT: Network Address Translation

    l l k

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    109/200

    Motivation: local network uses just one IP address asfar as outside word is concerned:

    no need to be allocated range of addresses from ISP:- just one IP address is used for all devices

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    without notifying outside world can change ISP without changing addresses of

    devices in local network

    devices inside local net not explicitly addressable,visible by outside world (a security plus).

    NAT: Network Address TranslationNAT: Network Address Translation

    Implementation: NAT router must:

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    110/200

    outgoing datagrams: replace(source IP address, port#) of every outgoing datagram to (NAT IP address,new port #). . . remote clients/servers will respond using (NAT

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected]

    IUST-Network Layer

    , .

    remember (in NAT translation table)every (sourceIP address, port #) to (NAT IP address, new port #)translation pair

    incoming datagrams: replace(NAT IP address, newport #) in dest fields of every incoming datagramwith corresponding (source IP address, port #)stored in NAT table

    NAT: Network Address TranslationNAT: Network Address Translation

    1: host 10 0 0 1NAT translation table2 N T

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    111/200

    S: 10.0.0.1, 3345D: 128.119.40.186, 80

    1: host 10.0.0.1sends datagram to128.119.40, 80

    WAN side addr LAN side addr

    138.76.29.7, 5001 10.0.0.1, 3345

    2: NAT routerchanges datagramsource addr from

    10.0.0.1, 3345 to138.76.29.7, 5001,updates table

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected]

    IUST-Network Layer

    . . .

    10.0.0.2

    10.0.0.3

    1

    10.0.0.4

    138.76.29.7 S: 128.119.40.186, 80D: 10.0.0.1, 3345 4

    S: 138.76.29.7, 5001

    D: 128.119.40.186, 802

    S: 128.119.40.186, 80D: 138.76.29.7, 5001 3

    3: Reply arrivesdest. address:138.76.29.7, 5001

    4: NAT routerchanges datagramdest addr from138.76.29.7, 5001 to 10.0.0.1, 3345

    NAT: Network Address TranslationNAT: Network Address Translation

    16 bit t b fi ld

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    112/200

    16-bit port-number field: 60,000 simultaneous connections with a single

    LAN-side address! NAT is controversial:

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected]

    IUST-Network Layer

    routers should only process up to layer 3

    violates end-to-end argument NAT possibility must be taken into account by app

    designers, eg, P2P applications

    address shortage should instead be solved byIPv6

    ChapterChapter 44 OutlineOutline

    4.1 Introduction and Network Service Models

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    113/200

    4.2 Routing Principles

    4.3 Hierarchical Routing

    4.4 The Internet (IP) Protocol

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    .

    4.5.1 Intra-AS routing: RIP and OSPF

    4.5.2 Inter-AS routing: BGP

    4.6 Whats Inside a Router?

    4.7 IPv6

    4.8 Multicast Routing

    4.9 Mobility

    Routing in the InternetRouting in the Internet

    (RC1812)(RC1812) Requirements for IP Version 4 RoutersRequirements for IP Version 4 Routers

    The Global Internet consists of Autonomous Systems

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    114/200

    G a n rn n f u n m u y m(AS) interconnected with each other: Stub AS: small corporation: one connection to other ASs

    Multihomed AS: large corporation (no transit): multipleconnections to other ASs

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    rans prov er, oo ng many s oge er

    Two-level routing: Intra-AS: administrator responsible for choice of routing

    algorithm within network

    Inter-AS: unique standard for inter-AS routing:BGP(RFC1771)

    Internet AS HierarchyInternet AS Hierarchy

    Intra-AS border (exterior gateway) routers

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    115/200

    C.b

    A.a

    B.a

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    Inter-AS (interior gateway) routers

    A B

    A.ca b

    ad

    bc

    ac

    b

    IntraIntra--AS RoutingAS Routing

    Also known as Interior Gateway Protocols (IGP)

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    116/200

    Also known as Interior Gateway Protocols (IGP)

    Most common Intra-AS routing protocols:

    RIP: Routing Information Protocol

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    : pen or es a rs

    IGRP: Interior Gateway Routing Protocol (Ciscoproprietary)

    RIPRIP ( Routing Information Protocol)( Routing Information Protocol)

    Distance vector algorithm

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    117/200

    Distance vector algorithm

    Included in BSD-UNIX Distribution in 1982

    Distance metric: # of hops (max = 15 hops) Can you guess why?

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    Distance vectors: exchanged among neighbors every30 sec via Response Message (also calledadvertisement)

    Each advertisement: list of up to 25 destination nets

    within AS

    RIP: ExampleRIP: Example

    z

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    118/200

    C

    w x y

    A D B

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    Destination Network Next Router Num. of hops to dest.

    w A 2y B 2z B 7

    x -- 1. . ....

    Routing table in D

    RIP: ExampleRIP: Example

    Dest Next hops

    w - -x - -z C 4

    Advertisementfrom A to D

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    119/200

    z C 4. ...

    w x y

    z

    A D B

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    Destination Network Next Router Num. of hops to dest.

    w A 2y B 2

    z B A 7 5x -- 1. . ....

    Routing table in D

    RIP: Link Failure and RecoveryRIP: Link Failure and Recovery

    If no advertisement heard after 180 sec -->i hb /li k d l d d d

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    120/200

    neighbor/link declared dead

    routes via neighbor invalidated

    new advertisements sent to neighbors nei hbors in turn send out new advertisements if

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    tables changed)

    link failure info quickly propagates to entire net poison reverse used to prevent ping-pong loops

    (infinite distance = 16 hops)

    RIP Table processingRIP Table processing

    RIP routing tables managed by application-level

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    121/200

    RIP routing tables managed by application levelprocess called route-d (daemon)

    advertisements sent in UDP packets, periodicallyrepeated

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    physical

    link

    network forwarding(IP) table

    Transprt(UDP)

    routed

    physical

    link

    network

    (IP)

    Transprt(UDP)

    routed

    forwarding

    table

    RIP Table example (continued)RIP Table example (continued)

    Router:giroflee.eurocom.fr

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    122/200

    Destination Gateway Flags Ref Use Interface

    -------------------- -------------------- ----- ----- ------ ---------

    127.0.0.1 127.0.0.1 UH 0 26492 lo0

    192.168.2. 192.168.2.5 U 2 13 fa0

    193.55.114. 193.55.114.6 U 3 58503 le0

    192.168.3. 192.168.3.5 U 2 25 qaa0

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    Three attached class C networks (LANs)

    Router only knows routes to attached LANs

    Default router used to go up

    Route multicast address: 224.0.0.0

    Loopback interface (for debugging)

    . . . . . . e

    default 193.55.114.129 UG 0 143454

    OSPFOSPF (Open Shortest Path First)(Open Shortest Path First)

    open: publicly available

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    123/200

    Uses Link State algorithm LS packet dissemination

    Topology map at each node

    Route computation using Dijkstras algorithm

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    OSPF advertisement carries one entry per neighborrouter

    Advertisements disseminated to entire AS (via

    flooding) Carried in OSPF messages directly over IP (rather than TCPor UDP

    OSPF advanced features (not in RIP)OSPF advanced features (not in RIP)

    Security: all OSPF messages authenticated (to

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    124/200

    Security: all OSPF messages authenticated (toprevent malicious intrusion)

    Multiple same-cost paths allowed (only one path inRIP)

    [email protected]@iust.ac.ir Network LayerNetwork Layer 44--124124

    [email protected] IUST-Network Layer

    or eac n , mu p e cos me r cs or eren

    TOS (e.g., satellite link cost set low for best effort;high for real time)

    Integrated uni- and multicast support:

    Multicast OSPF (MOSPF) uses same topology database as OSPF

    Hierarchical OSPF in large domains.

    Hierarchical OSPFHierarchical OSPF

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    125/200

    [email protected]@iust.ac.ir Network LayerNetwork Layer 44--125125

    [email protected] IUST-Network Layer

    Hierarchical OSPFHierarchical OSPF

    Two-level hierarchy: local area, backbone.

    Li k d i l i

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    126/200

    Link-state advertisements only in area

    each nodes has detailed area topology; only knowdirection (shortest path) to nets in other areas.

    [email protected]@iust.ac.ir Network LayerNetwork Layer 44--126126

    [email protected] IUST-Network Layer

    in own area, advertise to other Area Border routers.

    Backbone routers: run OSPF routing limited tobackbone.

    Boundary routers: connect to other ASs.

    InterInter--AS routing in the Internet:AS routing in the Internet: BGPBGP

    BGP

    R4

    R5

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    127/200

    AS2(OSPF

    intra-AS

    AS1(RIP intra-AS routing)

    BGP

    AS3(OSPF intra-AS

    routing)

    BGPR3

    R5

    [email protected]@iust.ac.ir Network LayerNetwork Layer 44--127127

    [email protected] IUST-Network Layer

    Figure 4.5.2-new2: BGP use for inter-domain routing

    routing)

    R1 R2

    Internet interInternet inter--AS routing: BGPAS routing: BGP

    BGP (Border Gateway Protocol): thede factost d d

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    128/200

    standard Path Vector protocol:

    similar to Distance Vector protocol each order Gatewa broadcast to nei hbors

    [email protected]@iust.ac.ir Network LayerNetwork Layer 44--128128

    [email protected] IUST-Network Layer

    (peers) entire path(i.e., sequence of ASs) to

    destination BGP routes to networks (ASs), not individual

    hosts E.g., Gateway X may send its path to dest. Z:

    Path (X,Z) = X,Y1,Y2,Y3,,Z

    Internet interInternet inter--AS routing: BGPAS routing: BGP

    Suppose:gateway X send its path to peer gateway W

    W l h ff d b X

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    129/200

    W may or may not select path offered by X

    cost, policy (dont route via competitors AS), loopprevention reasons.

    [email protected]@iust.ac.ir Network LayerNetwork Layer 44--129129

    [email protected] IUST-Network Layer

    ,

    Path (W,Z) = w, Path (X,Z) Note: X can control incoming traffic by controlling it

    route advertisements to peers:

    e.g., dont want to route traffic to Z -> dontadvertise any routes to Z

    BGP: controlling who routes to youBGP: controlling who routes to you

    A

    B

    WX

    legend: providernetwork

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    130/200

    A

    C

    W

    Y

    customer

    network

    [email protected]@iust.ac.irNetwork LayerNetwork Layer 44--130130

    [email protected] IUST-Network Layer

    A,B,C are provider networks X,W,Y are customer (of provider networks)

    X is dual-homed: attached to two networks

    X does not want to route from B via X to C .. so X will not advertise to B a route to C

    Figure 4.5- BGPnew : a simple BGP scenario

    BGP: controlling who routes to youBGP: controlling who routes to you

    B

    WX

    legend: providernetwork

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    131/200

    A

    C

    W

    Y

    customer

    network

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    A advertises to B the path AW B advertises to W the path BAW

    Should B advertise to C the path BAW? No way! B gets no revenue for routing CBAW since neither

    W nor C are Bs customers B wants to force C to route to w via A

    B wants to route onlyto/from its customers!

    BGP operationBGP operation

    Q: What does a BGP router do?

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    132/200

    Receiving and filtering route advertisements from

    directly attached neighbor(s). Route selection.

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    To route to destination X, which path )of

    several advertised) will be taken? Sending route advertisements to neighbors.

    BGP messagesBGP messages

    BGP messages exchanged using TCP.

    BGP messages:

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    133/200

    BGP messages:

    OPEN: opens TCP connection to peer andauthenticates sender

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    KEEPALIVE keeps connection alive in absence ofUPDATES; also ACKs OPEN request

    NOTIFICATION: reports errors in previous msg;also used to close connection

    Why different IntraWhy different Intra-- and Interand Inter--AS routing ?AS routing ?

    Policy: Inter-AS: admin wants control over how its traffic

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    134/200

    Inter AS: admin wants control over how its trafficrouted, who routes through its net.

    Intra-AS: single admin, so no policy decisions needed

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    hierarchical routing saves table size, reduced updatetraffic

    Performance:

    Intra-AS: can focus on performance

    Inter-AS: policy may dominate over performance

    Chapter 4 OutlineChapter 4 Outline

    4.1 Introduction and Network Service Models

    4 2 Routing Principles

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    135/200

    4.2 Routing Principles

    4.3 Hierarchical Routing4.4 The Internet (IP) Protocol

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    4.5 Routing in the Internet

    4.6 Whats Inside a Router?4.7 IPv6

    4.8 Multicast Routing4.9 Mobility

    Router Architecture OverviewRouter Architecture Overview

    Two key router functions: run routing algorithms/protocol (RIP, OSPF, BGP)

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    136/200

    g g p

    switchingdatagrams from incoming to outgoing link

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    Input Port FunctionsInput Port Functions

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    137/200

    Physical layer:

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    Decentralized switching: given datagram dest., lookup output portusing routing table in input port memory

    goal: complete input port processing at

    line speed queuing: if datagrams arrive faster than

    forwarding rate into switch fabric

    - eve rece on

    Data link layer:e.g., Ethernetsee chapter 5

    Input Port QueuingInput Port Queuing

    Fabric slower that input ports combined -> queueingmay occur at input queues

    Head-of-the-Line (HOL) blocking: queued datagram

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    138/200

    Head of the Line (HOL) blocking queued datagramat front of queue prevents others in queue frommoving forward

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    Three Types of Switching FabricsThree Types of Switching Fabrics

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    139/200

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    Switching Via MemorySwitching Via Memory

    First generation routers: packet copied by systems (single) CPU

    speed limited by memory bandwidth (2 bus

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    140/200

    p m t y m m ry an w t ( ucrossings per datagram)

    Input

    PortOutput

    Port

    Memory

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    System Bus

    Modern routers:

    input port processor performs lookup, copy intomemory

    Cisco Catalyst 8500

    Switching Via a BusSwitching Via a Bus

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    141/200

    datagram from input port memoryto output port memory via a shared

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    us

    bus contention: switching speedlimited by bus bandwidth

    1 Gbps bus, Cisco 1900: sufficientspeed for access and enterpriserouters (not regional or backbone)

    Switching Via An Interconnection NetworkSwitching Via An Interconnection Network

    overcome bus bandwidth limitations

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    142/200

    overcome bus bandwidth limitations

    Banyan networks, other interconnection netsinitially developed to connect processors in

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    mu processor

    Advanced design: fragmenting datagram into fixedlength cells, switch cells through the fabric.

    Cisco 12000: switches Gbps through theinterconnection network

    Output PortsOutput Ports

  • 8/9/2019 Cn Chp4 [Compatibility Mode]

    143/200

    [email protected]@iust.ac.ir Network LayerNetwork Layer [email protected] IUST-Network Layer

    Bufferingrequired when datagrams arrive fromfabric faster than the transmission rate

    Scheduling disciplinechooses among queueddatagrams for transmission

    Output port queuingOutput port queuing

  • 8/9/2019