Ch06 Routing

download Ch06 Routing

of 35

description

data network

Transcript of Ch06 Routing

  • McGraw-Hill The McGraw-Hill Companies, Inc., 2000

    6-1

    Chapter 6

    Delivery and Routing of IP Packets

  • McGraw-Hill The McGraw-Hill Companies, Inc., 2000

    6-2

    The network layer protocol first makes a connection between the source and destination hosts, then starts transmission of data. After the transmission of data is over, the network layer tears down the connection.

    The network layer protocol treats each packet independently, with each packet having no relationship to any other packet.

    Connection-Oriented Services

    Connectionless Services

  • McGraw-Hill The McGraw-Hill Companies, Inc., 2000

    6-3

    Direct delivery

    Hosts are on the same (physical) network (no routing involved)

  • McGraw-Hill The McGraw-Hill Companies, Inc., 2000

    6-4

    Indirect delivery

    Hosts are not on the samenetwork (routing necessary)

  • McGraw-Hill The McGraw-Hill Companies, Inc., 2000

    6-5

    Routing Methods:

    ! Next-Hop Routing! Network-Specific Routing! Host-Specific Routing! Default Routing

  • McGraw-Hill The McGraw-Hill Companies, Inc., 2000

    6-6

    Next-hop routing

    Only the next router is specified in the RT for each destination host

  • McGraw-Hill The McGraw-Hill Companies, Inc., 2000

    6-7

    Routing is the relaying (forwarding) of packets generated by a source station, across the network in order to deliver them to their destination station. When a routing node gets a packet, it should know which neighboring node to for-ward the packet.

    All routing strategies optimize some kind of performance criteria. This can be a minimal number of intermediate links along the path (minimum hop criteria), or a minimum cost criteria, which minimizes the total cost along the route (cost could be delay associated with each link, the inverse of the link's bit rate, etc.) Note that the minimal cost criteria is a generaliza- tion of the minimum hop, i.e. if we assign a cost = 1 to each link we get the minimum hop criteria.

    The optimal routes from a set of source stations to corresponding destination stations are defined through routing tables (RT). Each node has a routing ta-ble which tells how a node can forward a package with a specified destinationtion.

    (The following seven slides explain the essence of the next-hop routing)

  • McGraw-Hill The McGraw-Hill Companies, Inc., 2000

    6-8

    Suppose that the costs associated with the internode links are as shown. (The minimal cost routes are shown on the next slide).

    A

    B C

    D

    E

    F

    G

    1 2

    3

    5

    46

    3

    2

    15

    7

    1

    4

  • McGraw-Hill The McGraw-Hill Companies, Inc., 2000

    6-9

    1 2

    3

    5

    46

    1 2

    3

    5

    46

    Dest. Nextnode node

    1 2 3 4 5 6

    -26266

    RT at node 1

    Dest. Nextnode node

    1 2 3 4 5 6

    1-4441

    RT at node 2

    A

    B C

    D

    E

    F

    G

    1 2

    3

    5

    46

    3

    2

    15

    7

    1

    4

  • McGraw-Hill The McGraw-Hill Companies, Inc., 2000

    6-10

    A

    B C

    D

    E

    F

    G

    1 2

    3

    5

    46

    3

    2

    15

    7

    1

    4

    1 2

    3

    5

    46

    1 2

    3

    5

    46

    Dest. Nextnode node

    1 2 3 4 5 6

    11555-

    RT at node 6

    Dest. Nextnode node

    1 2 3 4 5 6

    223-55

    RT at node 4

  • McGraw-Hill The McGraw-Hill Companies, Inc., 2000

    6-11

    A

    B C

    D

    E

    F

    G

    1 2

    3

    5

    46

    3

    2

    15

    7

    1

    4

    1 2

    3

    5

    46

    1 2

    3

    5

    46

    Dest. Nextnode node

    1 2 3 4 5 6

    6434-6

    RT at node 5

    Dest. Nextnode node

    1 2 3 4 5 6

    54-455

    RT at node 3

  • McGraw-Hill The McGraw-Hill Companies, Inc., 2000

    6-12

    1 2

    3

    5

    46

    Dest. Nextnode node

    1 2 3 4 5 6

    -26266

    RT at node 1

    "An optimal policy has the property that whatever the initial state and the initial decision are, the remaining decisions must constitute an optimal policy with regard the state resulting from the first decision"

    Is it suffitient to give in RT the address of the next node only instead of the entire route? For example, the first diagram contains five optimal routes emanating from the node "1": Source: 1, destination: 2, optimal route: 1,2 Source: 1, destination: 3, optimal route: 1,6,5,3 Source: 1, destination: 4, optimal route: 1,2,4 Source: 1, destination: 5, optimal route: 1,6,5 Source: 1, destination: 6, optimal route: 1,6

    What justifies this?

    This is possible because of the principle of optimality (stated by Richard Bellman in 1950s):

  • McGraw-Hill The McGraw-Hill Companies, Inc., 2000

    6-13

    This can be applied to the optimal routes:

    If the route a-x-b is optimal, then the remaining route x-b is optimal too, i.e. we would obtain exactly the same optimal route x-b if we started only from x. Therefore, the node a doesn't have to worry about the entire path, its is enough that it routes the packet to the optimal neighboring node x. This saves a lot of memory, because each node need to store only the optimal route to the next (neighboring) node.

    a

    b

    First link ofthe optimalroute a-x-b

    Remaining part of the optimal

    route a-x-b

    x

  • McGraw-Hill The McGraw-Hill Companies, Inc., 2000

    6-14

    Network-specific routingOnly one entry exists in RT for all hosts connected to the same physical network

    (the most common method)

    Imagine 1000 hosts connected to the same network

  • McGraw-Hill The McGraw-Hill Companies, Inc., 2000

    6-15Host-specific routingLess efficiency, but the administrator has more control over routing.

    Example: administrator wants to rout specifically the packets for B via routerR1 instead of R3, then the RT for A needs an entry: Host B " R1.This entry should precede the entry N3 " R3

  • McGraw-Hill The McGraw-Hill Companies, Inc., 2000

    6-16

    Default routingAnything not

    specified above

  • McGraw-Hill The McGraw-Hill Companies, Inc., 2000

    6-17

    A static routing table contains information entered manually.

    A dynamic routing table is updated periodically using one of the dynamicrouting protocols such as RIP, OSPF, or

    BGP.

    Static vs. Dynamic Routing

    Used in small internetworks that do not change very often

    Used in large internetworks that change very often. Automatic updates of RT makes the network manageable and scalable.

  • McGraw-Hill The McGraw-Hill Companies, Inc., 2000

    6-18

    Routing module and routing table

    Receiving the packet from the link layer and its basic processing (see chapter 8)

    Packet has DA (besides SA), which is not necessarily equal to the next-hop address(see next slide)

  • McGraw-Hill The McGraw-Hill Companies, Inc., 2000

    6-19

    HostA

    RouterR

    RouterS

    HostB

    SA=A, DA=B, payloadIP datagram:

    Next hop: Router R

    SA=A, DA=B, payloadIP datagram:

    Next hop: Router S

    SA=A, DA=B, payloadIP datagram:

    Next hop: direct delivery

    IP datagram stays basically the same all the way (exception: TTL)

  • McGraw-Hill The McGraw-Hill Companies, Inc., 2000

    6-20Routing Table

    U The router is up and running. G The destination is in another network (Gateway).H Host-specific address. D Added by redirection (see chapter 9).M Modified by redirection (see chapter 9).

    Number of users that connected to this destination via this router

    Number of packets transmitted to this destination via this router

    Interface name (like eth0, fddi0), identifies the port

  • McGraw-Hill The McGraw-Hill Companies, Inc., 2000

    6-21Routing Table (cont.)Routing table of a host can be displayed by commands:

    route PRINT (Windows)netstat nr (UNIX)

    Windows has a specific way of displaying the routing table: 1st line shows the default router, the 2nd line is loopback route, the 3rd line defines the range of addresses on the local network segment, the line with 224.0.0.0 is for multicast addresses, the line with 255.255.255.255 is for broadcast.

  • McGraw-Hill The McGraw-Hill Companies, Inc., 2000

    6-22

    Get the packet;for (each entry in RT) {

    Apply the mask to packet destination address;if (the result matches the value in destination field) {

    if (G flag present)Use the next-hop address from the RT;(indirect delivery)

    elseUse the destination address from the packet;(direct delivery)

    Send the packet to the fragmentation module;return; // Routing done

    }} // No match is foundSend an ICMP error message; return;

    Routing Module

  • McGraw-Hill The McGraw-Hill Companies, Inc., 2000

    6-23

    Configuration for routing example

  • McGraw-Hill The McGraw-Hill Companies, Inc., 2000

    6-24

    Mask Destination Next Hop I/f

    255.0.0.0 111.0.0.0 -- m0

    255.255.255.224 193.14.5.160 - m2

    255.255.255.224 193.14.5.192 - m1

    --------------------------------------------------------------------------------255.255.255.255 194.17.21.16 111.20.18.14 m0

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

    255.255.255.0 192.16.7.0 111.15.17.32 m0

    255.255.255.0 194.17.21.0 111.20.18.14 m0

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

    0.0.0.0 0.0.0.0 111.30.31.18 m0

  • McGraw-Hill The McGraw-Hill Companies, Inc., 2000

    6-25Example 1Router R1 receives 500 packets for destination 192.16.7.14; the algorithm applies the masks row by row to the destination address until a match (with the value in the second column) is found:

    Direct delivery

    192.16.7.14 & 255.0.0.0 # 192.0.0.0 no match

    192.16.7.14 & 255.255.255.224 # 192.16.7.0 no match

    192.16.7.14 & 255.255.255.224 # 192.16.7. no matchHost-specific

    192.16.7.14 & 255.255.255.255 #192.16.7.14 no match

    Network-specific

    192.16.7.14 & 255.255.255.0 #192.16.7.0 match

  • McGraw-Hill The McGraw-Hill Companies, Inc., 2000

    6-26Example 2

    Router R1 receives 100 packets for destination 193.14.5.176; thealgorithm applies the masks row by row to the destination address until a match is found:

    Direct delivery

    193.14.5.176 & 255.0.0.0 # 193.0.0.0 no match

    193.14.5.176 & 255.255.255.224 #193.14.5.160 match

  • McGraw-Hill The McGraw-Hill Companies, Inc., 2000

    6-27Example 3

    Router R1 receives 20 packets for destination 200.34.12.34; the algorithm applies the masks row by row to the destination address until a match is found:

    Direct delivery

    200.34.12.34 & 255.0.0.0 #200.0.0.0 no match

    200.34.12.34 & 255.255.255.224 #200.34.12.32 no match

    200.34.12.34 & 255.255.255.224 #200.34.12.32 no match

    Host-specific

    200.34.12.34 & 255.255.255.255 #200.34.12.34 no match

  • McGraw-Hill The McGraw-Hill Companies, Inc., 2000

    6-28Example 3 (cont.)

    Router R1 receives 20 packets for destination 200.34.12.34; the algorithm applies the masks row by row to the destination address until a match is found:

    Network-specific

    200.34.12.34 & 255.255.255.0 # 200.34.12.0 no match

    200.34.12.34 & 255.255.255.0 # 200.34.12.0 no match

    Default

    200.34.12.34 & 0.0.0.0 # 0.0.0.0. match

  • McGraw-Hill The McGraw-Hill Companies, Inc., 2000

    6-29

    Example 4Make the routing table for router R1 in this figure:

    Mask Destination Next Hop I.255.255.0.0 134.18.0.0 -- m0

    255.255.0.0 129.8.0.0 222.13.16.40 m1

    255.255.255.0 220.3.6.0 222.13.16.40 m1

    0.0.0.0 0.0.0.0 134.18.5.2 m0

  • McGraw-Hill The McGraw-Hill Companies, Inc., 2000

    6-30

    Example 5 Make the routing table for router R1 in this network:

    Mask Destination Next Hop Interface255.255.255.0 200.8.4.0 ---- m2255.255.255.0 80.4.5.0 201.4.10.3 (or 200.8.4. 12) m1 (or m2)255.255.255.0 80.4.6.0 201.4.10.3 (or 200.4.8.12 ) m1 (or m2)0.0.0.0 0.0.0.0 ????????? m0

  • McGraw-Hill The McGraw-Hill Companies, Inc., 2000

    6-31

    Example 6

    Mask Destination Next Hop Interface255.255.0.0 110.70.0.0 - m0255.255.0.0 180.14.0.0 - m2255.255.0.0 190.17.0.0 - m1255.255.0.0 130.4.0.0 190.17.6.5 m1255.255.0.0 140.6.0.0 180.14.2.5 m20.0.0.0 0.0.0.0 110.70.4.6 m0

    The routing table for router R1 is given below. Draw its topology

  • McGraw-Hill The McGraw-Hill Companies, Inc., 2000

    6-32

    Routing Table Size

    Hierarchical Routing

    Geographical Routing

    RT Search Algorithms

    Classless Addressing and CIDR(CIDR = Classless Inter Domain Routing)

    The size of RT is generally increasing(division of classes A and B into smaller blocks increase the number of RT entries.) Only the supernetting would decrease the number of entries (grouping of C blocks).

    Way to decrease the size of RTs

    Further decrease of RT size(large blocks: North America, Europe, Asia, Africa,)

    RT is divided in buckets in order to localize the table search (in classful addressing the buckets are classes, in classless addressing the buckets are different prefix lengths. First is searched the bucket with the largest prefix = /32 (the host-specific routing), then the next prefix /31 is searched, etc.

  • McGraw-Hill The McGraw-Hill Companies, Inc., 2000

    6-33

    Internet today

    ISP = Internet Service ProviderNational ISPs (backbone networks):

    SprintLink, PSINet, UUNet Technology, AGIS, Internet MCI

    NAP = Network Access PointInternet interconnection points, typically work with ATM at speeds

    DS-3 (T3) 44.736 MbpsOC-3 155.52 MbpsOC-9 466.56 MbpsOC-12 622.08 MbpsOC-48 2488.32 Mbps

    Local ISPs

  • McGraw-Hill The McGraw-Hill Companies, Inc., 2000

    6-34Hierarchical Routing

    Way to keep RTs smaller and more manageable

    X Y Z

    A AX1 Z2Y2X2 Y1 Z1X3

    YXZ

    X1 X2 X3 Y1 Y2 Z1 Z2

    R2

    R1

    R3R4

    Router R2 can see only networks X1, X2, X3

  • McGraw-Hill The McGraw-Hill Companies, Inc., 2000

    6-35

    Hierarchical Routing (cont.)

    X Y Z

    A AX1 Z2Y2X2 Y1 Z1X3

    YXZ

    X1X2 X3 Y1 Y2 Z1 Z2

    This part of the network doesnt have to be aware

    of the division in the network X