et3003 sem2-1314-9 network layers vi (routing protocols)

109
Network Layer Part VI Computer Networks Tutun Juhana Telecommunication Engineering School of Electrical Engineering & Informatics Institut Teknologi Bandung 9

Upload: tutun-juhana

Post on 25-Jan-2015

401 views

Category:

Technology


0 download

DESCRIPTION

Routing Protocols

TRANSCRIPT

Page 1: Et3003 sem2-1314-9 network layers vi (routing protocols)

Network Layer Part VI

Computer Networks

Tutun JuhanaTelecommunication EngineeringSchool of Electrical Engineering & InformaticsInstitut Teknologi Bandung

9

Page 2: Et3003 sem2-1314-9 network layers vi (routing protocols)

UNICAST ROUTING PROTOCOLS(RIP, OSPF, AND BGP)

Page 3: Et3003 sem2-1314-9 network layers vi (routing protocols)

3

INTRODUCTION

Page 4: Et3003 sem2-1314-9 network layers vi (routing protocols)

4

Cost or Metric

• A router is usually attached to several networks when it receives a packet, to which network should it pass the packet?

• The decision is based on optimization: Which of the available pathways is the optimum pathway? What is the definition of the term optimum?

• One approach is to assign a cost for passing through a network We call this cost a metric

• High cost can be thought of as something bad; low cost can be thought of something good

Page 5: Et3003 sem2-1314-9 network layers vi (routing protocols)

5

Static versus Dynamic Routing Tables

• A static table is one with manual entries• A dynamic table, on the other hand, is one

that is updated automatically when there is a change somewhere in the internet

Page 6: Et3003 sem2-1314-9 network layers vi (routing protocols)

6

Routing Protocol• A routing protocol is a combination of rules and

procedures that lets routers in the internet inform each other of changes

• It allows routers to share whatever they know about the internet or their neighborhood

• The routing protocols also include procedures for combining information received from other routers

• Routing protocols can be either an interior protocol or an exterior protocol– An interior protocol handles intradomain routing– an exterior protocol handles interdomain routing

Page 7: Et3003 sem2-1314-9 network layers vi (routing protocols)

7

INTRA- AND INTER-DOMAIN ROUTING

Page 8: Et3003 sem2-1314-9 network layers vi (routing protocols)

8

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

intra-domain routing

inter-domain routing

AS Numbers is assigned for each ASEx: ITB’s ASN is 4796

Page 9: Et3003 sem2-1314-9 network layers vi (routing protocols)

9

Page 10: Et3003 sem2-1314-9 network layers vi (routing protocols)

10

DISTANCE VECTOR ROUTING

Page 11: Et3003 sem2-1314-9 network layers vi (routing protocols)

11

• This method sees an AS, with all routers and networks, as a graph, a set of nodes and lines (edges) connecting the nodes– A router normally be represented by a node– A network be represented by a link connecting

two nodes• The graph theory used Bellman-Ford (also

called Ford-Fulkerson) algorithm to find the shortest path between nodes in a graph given the distance between nodes

Page 12: Et3003 sem2-1314-9 network layers vi (routing protocols)

12

Bellman-Ford Algorithm

• It looks circular• To solve the problem, we use iteration to create a shortest distance table

(vector) for each node using the following steps:1. The shortest distance and the cost between a node and itself is initialized to 0.

2. The shortest distance between a node and any other node is set to infinity. The cost between a node and any other node should be given (can be infinity if the nodes are not connected)

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

Page 13: Et3003 sem2-1314-9 network layers vi (routing protocols)

13

Page 14: Et3003 sem2-1314-9 network layers vi (routing protocols)

14

Distance Vector Routing Algorithm

Page 15: Et3003 sem2-1314-9 network layers vi (routing protocols)

15

Page 16: Et3003 sem2-1314-9 network layers vi (routing protocols)

16

Page 17: Et3003 sem2-1314-9 network layers vi (routing protocols)

17

Page 18: Et3003 sem2-1314-9 network layers vi (routing protocols)

18

Page 19: Et3003 sem2-1314-9 network layers vi (routing protocols)

19

Page 20: Et3003 sem2-1314-9 network layers vi (routing protocols)

20

Page 21: Et3003 sem2-1314-9 network layers vi (routing protocols)

21

Count to Infinity

Page 22: Et3003 sem2-1314-9 network layers vi (routing protocols)

22

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

• For a routing protocol to work properly, if a link is broken (cost becomes infinity), every other router should be aware of it immediately, but in distance vector routing, this takes some time.

• The problem is referred to as count to infinity takes several updates before the cost for a broken link is recorded as infinity by all routers.

Page 23: Et3003 sem2-1314-9 network layers vi (routing protocols)

23

• Example of count to infinityTwo-Node Loop

Page 24: Et3003 sem2-1314-9 network layers vi (routing protocols)

24

Another example

A converged network

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

Page 25: Et3003 sem2-1314-9 network layers vi (routing protocols)

25

The solutions

Page 26: Et3003 sem2-1314-9 network layers vi (routing protocols)

26

Defining Infinity• The first obvious

solution to count to infinity is to redefine infinity to a smaller number

• Most implementations of the Distance Vector Protocol define 16 as infinity – However, this means that distance vector cannot be

used in large systems The size of the network, in each direction, can not exceed 15 hops

Page 27: Et3003 sem2-1314-9 network layers vi (routing protocols)

27

Split Horizon

Split horizon helps reduce convergence time by not allowing routers to advertise networks in the direction from which those networks were learned

Page 28: Et3003 sem2-1314-9 network layers vi (routing protocols)

28

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

Page 29: Et3003 sem2-1314-9 network layers vi (routing protocols)

29

Split Horizon and Poison Reverse

Iit announces all networks. However, those networks learned in a given direction are announced with a hop count of 16, indicating that the network is unreachable It avoids the Distance Vector Protocol deleting the route because it has no news about it during a certain time duration (timer)

Page 30: Et3003 sem2-1314-9 network layers vi (routing protocols)

30

Page 31: Et3003 sem2-1314-9 network layers vi (routing protocols)

31

Three-Node Instability

Page 32: Et3003 sem2-1314-9 network layers vi (routing protocols)

32

RIPRouting Information Protocol

Page 33: Et3003 sem2-1314-9 network layers vi (routing protocols)

33

RIP implements distance vector routing directly with some considerations

Page 34: Et3003 sem2-1314-9 network layers vi (routing protocols)

34

Page 35: Et3003 sem2-1314-9 network layers vi (routing protocols)

35

RIP Message Format

Page 36: Et3003 sem2-1314-9 network layers vi (routing protocols)

36

Requests and Responses

Page 37: Et3003 sem2-1314-9 network layers vi (routing protocols)

37

Request

• A request message is sent by a router that has just come up or by a router that has some time-out entries.

Page 38: Et3003 sem2-1314-9 network layers vi (routing protocols)

38

Response

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

• It contains information about the destination specified in the corresponding request

– Unsolicited: is sent periodically• every 30 seconds or • when there is a change in the routing table

• The response is sometimes called an update packet

Page 39: Et3003 sem2-1314-9 network layers vi (routing protocols)

39

Page 40: Et3003 sem2-1314-9 network layers vi (routing protocols)

40

Timers in RIP

controls the advertising of

regular update messages

Governs the validity of a route. If the timer is reached, route is declared unreachable, but does not immediately purge, instead, it continues to advertise the route with a metricvalue of 16.

At the same time when a route declared unreachable, the garbage collection timer is set to 120 s for that route. When the count reaches zero, the route is purged from the table.

Page 41: Et3003 sem2-1314-9 network layers vi (routing protocols)

41

Page 42: Et3003 sem2-1314-9 network layers vi (routing protocols)

42

RIP Version 2

• It supports– Classless Addressing– Authentication– Multicasting uses the all-router multicast

address to send the RIP messages only to RIP routers in the network.

Page 43: Et3003 sem2-1314-9 network layers vi (routing protocols)

43

Encapsulation

Page 44: Et3003 sem2-1314-9 network layers vi (routing protocols)

44

LINK STATE ROUTING

Page 45: Et3003 sem2-1314-9 network layers vi (routing protocols)

45

Each node in the domain has the entire topology of the domain use Dijkstra algorithm tobuild a routing table

The routing table for each node is unique because the calculations are based on different interpretations of the topology

Page 46: Et3003 sem2-1314-9 network layers vi (routing protocols)

46

The whole topology can be compiled from the partial knowledge of each node (it knows the state (type, condition, and cost) of its links)

Page 47: Et3003 sem2-1314-9 network layers vi (routing protocols)

47

BUILDING ROUTING TABLES

Page 48: Et3003 sem2-1314-9 network layers vi (routing protocols)

48

Page 49: Et3003 sem2-1314-9 network layers vi (routing protocols)

49

Creation of Link State Packet (LSP)

• A link state packet (LSP) carries (among others huge information)1. The node identity

2. The list of links

3. A sequence number

4. Age

• The first two are needed to make the topology• The third facilitates flooding and distinguishes

new LSPs from old ones• The fourth prevents old LSPs from remaining in

the domain for a long time

Page 50: Et3003 sem2-1314-9 network layers vi (routing protocols)

50

• LSPs are generated on two occasions:– When there is a change in the topology of the

domain– On a periodic basis

• Much longer compared to distance vector routing in the range of 60 minutes or 2 hours based on the implementation

Page 51: Et3003 sem2-1314-9 network layers vi (routing protocols)

51

Flooding of LSPs

Page 52: Et3003 sem2-1314-9 network layers vi (routing protocols)

52

Formation of Shortest Path Tree: Dijkstra Algorithm

• After receiving all LSPs, each node will have a copy of the whole topology not sufficient to find the shortest path to every other node a shortest path tree is needed

• A shortest path tree is a tree in which the path between the root and every other node is the shortest

• What we need for each node is a shortest path tree with that node as the root

Page 53: Et3003 sem2-1314-9 network layers vi (routing protocols)

53

Dijkstra algorithm

Page 54: Et3003 sem2-1314-9 network layers vi (routing protocols)

54

Page 55: Et3003 sem2-1314-9 network layers vi (routing protocols)

55

Page 56: Et3003 sem2-1314-9 network layers vi (routing protocols)

56

Page 57: Et3003 sem2-1314-9 network layers vi (routing protocols)

57

Calculation of Routing Table from Shortest Path Tree

Page 58: Et3003 sem2-1314-9 network layers vi (routing protocols)

58

OSPFOpen Shortest Path First

Page 59: Et3003 sem2-1314-9 network layers vi (routing protocols)

59

Area

• OSPF divides an autonomous system into areas

• An area is a collection of networks, hosts, and routers all contained within an autonomous system

• All networks inside an area must be connected

Page 60: Et3003 sem2-1314-9 network layers vi (routing protocols)

60

• Routers inside an area flood the area with routing information

• At the border of an area, special routers called area border routers summarize the information about the area and send it to other areas

Page 61: Et3003 sem2-1314-9 network layers vi (routing protocols)

61

• All of the areas inside an autonomous system must be connected to a special area called the backbone area– The backbone serves as a primary area and

the other areas as secondary areas– This does not mean that the routers

within areas cannot be connected to each other

• The routers inside the backbone are called the backbone routers– backbone router can also be an

area border router• Each area has an area identification• The area identification of the

backbone is zero

Page 62: Et3003 sem2-1314-9 network layers vi (routing protocols)

62

Page 63: Et3003 sem2-1314-9 network layers vi (routing protocols)

63

If, because of some problem, the connectivity between a backbone and an

area is broken, a virtual link between routers must be created by the administration to

allow continuity of the functions of the backbone as the primary area

Page 64: Et3003 sem2-1314-9 network layers vi (routing protocols)

64

Metric

• The OSPF protocol allows the administrator to assign a cost, called the metric, to each route

• The metric can be based on a type of service (minimum delay, maximum throughput, and so on)

• As a matter of fact, a router can have multiple routing tables, each based on a different type of service

Page 65: Et3003 sem2-1314-9 network layers vi (routing protocols)

65

Types of Links

In OSPF terminology, a connection is called a link

Page 66: Et3003 sem2-1314-9 network layers vi (routing protocols)

66

Point-to-Point Link

There is no need to assign a network address to this type of link

Page 67: Et3003 sem2-1314-9 network layers vi (routing protocols)

67

Transient Link• A transient link is a network with several routers

attached to it

• It is not efficient each router needs to advertise the neighborhood to four other routers

• It is not realistic there is no single network (link) between each pair of routers (there is only one network (not router)that serves as a crossroad between all five routers)

• To show that each router is connected to every other router through one single network the network itself is represented by a node

• A network is not a machine it cannot function as a router

• So, one of the routers in the network takes this responsibility It is assigned a dual purpose it is a true router and a designated router

Page 68: Et3003 sem2-1314-9 network layers vi (routing protocols)

68

• While there is a metric from each node to the designated router, there is no metric from the designated router to any other node We can only assign a cost to a packet that is passing through the network (We cannot charge for this twice)– When a packet enters a network, we assign a cost; when a

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

Page 69: Et3003 sem2-1314-9 network layers vi (routing protocols)

69

Stub Link

• A special case of the transient network• The link is only onedirectional, from the

router to the network

Page 70: Et3003 sem2-1314-9 network layers vi (routing protocols)

70

Virtual Link

When the link between two routers is broken, the administration may create a

virtual link between them using a longer path that probably goes through several routers

Page 71: Et3003 sem2-1314-9 network layers vi (routing protocols)

71

Graphical Representation

Page 72: Et3003 sem2-1314-9 network layers vi (routing protocols)

72

OSPF Packets

Page 73: Et3003 sem2-1314-9 network layers vi (routing protocols)

73

Common Header

Page 74: Et3003 sem2-1314-9 network layers vi (routing protocols)

74

Link State Update Packet

Page 75: Et3003 sem2-1314-9 network layers vi (routing protocols)

75

Router Link LSA

Page 76: Et3003 sem2-1314-9 network layers vi (routing protocols)

76

Page 77: Et3003 sem2-1314-9 network layers vi (routing protocols)

77

Page 78: Et3003 sem2-1314-9 network layers vi (routing protocols)

78

Page 79: Et3003 sem2-1314-9 network layers vi (routing protocols)

79

Network Link LSA

Page 80: Et3003 sem2-1314-9 network layers vi (routing protocols)

80

Page 81: Et3003 sem2-1314-9 network layers vi (routing protocols)

81

Page 82: Et3003 sem2-1314-9 network layers vi (routing protocols)

82

Page 83: Et3003 sem2-1314-9 network layers vi (routing protocols)

83

Summary Link to Network LSA

The summary link to network LSA is used by the area border router to announce the existence of other networks outside the area

Page 84: Et3003 sem2-1314-9 network layers vi (routing protocols)

84

Page 85: Et3003 sem2-1314-9 network layers vi (routing protocols)

85

Summary Link to AS Boundary Router LSA

Page 86: Et3003 sem2-1314-9 network layers vi (routing protocols)

86

Page 87: Et3003 sem2-1314-9 network layers vi (routing protocols)

87

External Link LSA

Page 88: Et3003 sem2-1314-9 network layers vi (routing protocols)

88

Other Packets

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

Page 89: Et3003 sem2-1314-9 network layers vi (routing protocols)

89

Hello Message• OSPF uses the hello message to create

neighborhood relationships and to test the reachability of neighbors

Page 90: Et3003 sem2-1314-9 network layers vi (routing protocols)

90

Database Description Message

Page 91: Et3003 sem2-1314-9 network layers vi (routing protocols)

91

Link State Request Packet

Page 92: Et3003 sem2-1314-9 network layers vi (routing protocols)

92

Link State Acknowledgment Packet

Page 93: Et3003 sem2-1314-9 network layers vi (routing protocols)

93

Encapsulation

Page 94: Et3003 sem2-1314-9 network layers vi (routing protocols)

94

PATH VECTOR ROUTING

Page 95: Et3003 sem2-1314-9 network layers vi (routing protocols)

95

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

or inter-AS routing

Page 96: Et3003 sem2-1314-9 network layers vi (routing protocols)

96

Reachability

Page 97: Et3003 sem2-1314-9 network layers vi (routing protocols)

97

Routing Tables

• A path vector routing table for each router can be created if ASs share their reachability list with each other

Page 98: Et3003 sem2-1314-9 network layers vi (routing protocols)

98

Loop Prevention

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

vector routing. When a router receives a reachability information, it checks to see if its autonomous system is in the path list to any destination. If it is, looping is involved and

that network-path pair is discarded.

Page 99: Et3003 sem2-1314-9 network layers vi (routing protocols)

99

Aggregation

Page 100: Et3003 sem2-1314-9 network layers vi (routing protocols)

100

Policy Routing

When a router receives a message, it can check the path. If one of the autonomous systems listed in the path is against its policy, it can ignore that path and that

destination. It does not update its routing table with this path, and it does not send this

message to its neighbors

Page 101: Et3003 sem2-1314-9 network layers vi (routing protocols)

101

BGPBorder Gateway ProtocolAn interdomain routing protocol

Page 102: Et3003 sem2-1314-9 network layers vi (routing protocols)

102

Types of Autonomous Systems

• Stub AS• Multihomed AS• Transit AS

Page 103: Et3003 sem2-1314-9 network layers vi (routing protocols)

103

Stub AS

• A stub AS has only one connection to another AS

• The hosts in the AS can send data traffic to other Ass

• The hosts in the AS can receive data coming from hosts in other Ass

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

Page 104: Et3003 sem2-1314-9 network layers vi (routing protocols)

104

Multihomed AS

• A multihomed AS has more than one connection to other ASs, but it is still only a source or sink for data traffic

• It can receive data traffic from more than one AS

• It can send data traffic to more than one AS, but there is no transient traffic

• It does not allow data coming from one AS and going to another AS to pass through

Page 105: Et3003 sem2-1314-9 network layers vi (routing protocols)

105

Transit AS

A transit AS is a multihomed AS that also allows transient traffic. Good examples of transit ASs are national and international

ISPs (Internet backbones)

Page 106: Et3003 sem2-1314-9 network layers vi (routing protocols)

106

CIDR

BGP uses classless interdomain routing addresses. In other words, BGP uses a

prefix to define a destination address. The address and the number of bits (prefix length) are used in updating messages

Page 107: Et3003 sem2-1314-9 network layers vi (routing protocols)

107

Path Attributes• Well-known attribute

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

– one that must appear in the description of a route

2. well-known discretionary attribute– one that must be recognized by each router, but is not required

to be included in every update message

• Optional attribute– one that needs not be recognized by every router

1. optional transitive attribute– one that must be passed to the next router by the router that

has not implemented this attribute

2. optional nontransitive attribute– one that must be discarded if the receiving router has not implemented

it.

Page 108: Et3003 sem2-1314-9 network layers vi (routing protocols)

108

A session is a connection that is established between two BGP routers only for the sake of exchanging routing information.

Page 109: Et3003 sem2-1314-9 network layers vi (routing protocols)

109