67
Unicast Routing Protocols (RIP, OSPF, and BGP) Chapter 11

Unicast Routing Protocols (RIP, OSPF, and BGP)RIP...(RIP, OSPF, and BGP) Chapter 11 2 Routing Protocol is combination of rules and procedures lets routers in internet inform each other

  • Upload
    others

  • View
    33

  • Download
    5

Embed Size (px)

Citation preview

Page 1: Unicast Routing Protocols (RIP, OSPF, and BGP)RIP...(RIP, OSPF, and BGP) Chapter 11 2 Routing Protocol is combination of rules and procedures lets routers in internet inform each other

Unicast Routing Protocols

(RIP, OSPF, and BGP)

Chapter 11

Page 2: Unicast Routing Protocols (RIP, OSPF, and BGP)RIP...(RIP, OSPF, and BGP) Chapter 11 2 Routing Protocol is combination of rules and procedures lets routers in internet inform each other

2

Routing Protocol is combination of rules and

procedures lets routers in internet inform each

other of route changes

Autonomous System (AS) is group of networks

and routers under authority of single administration

Intradomain routing is routing inside AS

Handled by interior routing protocol

Interdomain routing is routing between AS’s

Handled by exterior routing protocol

Routing Protocols

Page 3: Unicast Routing Protocols (RIP, OSPF, and BGP)RIP...(RIP, OSPF, and BGP) Chapter 11 2 Routing Protocol is combination of rules and procedures lets routers in internet inform each other

3

Autonomous Systems

Page 4: Unicast Routing Protocols (RIP, OSPF, and BGP)RIP...(RIP, OSPF, and BGP) Chapter 11 2 Routing Protocol is combination of rules and procedures lets routers in internet inform each other

4

Routing Protocols

Page 5: Unicast Routing Protocols (RIP, OSPF, and BGP)RIP...(RIP, OSPF, and BGP) Chapter 11 2 Routing Protocol is combination of rules and procedures lets routers in internet inform each other

5

Distance Vector Routing

Uses Bellman-Ford algorithm for creating

routing table for routers in AS

Each node shares its routing table with its

immediate neighbors periodically and when

there is a change

Page 6: Unicast Routing Protocols (RIP, OSPF, and BGP)RIP...(RIP, OSPF, and BGP) Chapter 11 2 Routing Protocol is combination of rules and procedures lets routers in internet inform each other

6

Bellman-Ford Algorithm

Page 7: Unicast Routing Protocols (RIP, OSPF, and BGP)RIP...(RIP, OSPF, and BGP) Chapter 11 2 Routing Protocol is combination of rules and procedures lets routers in internet inform each other

7

Distance Vector Routing

Page 8: Unicast Routing Protocols (RIP, OSPF, and BGP)RIP...(RIP, OSPF, and BGP) Chapter 11 2 Routing Protocol is combination of rules and procedures lets routers in internet inform each other

8

Distance Vector Routing

Net4 , 1

3

Net5 , 1

4

Net2 , 1

2

Page 9: Unicast Routing Protocols (RIP, OSPF, and BGP)RIP...(RIP, OSPF, and BGP) Chapter 11 2 Routing Protocol is combination of rules and procedures lets routers in internet inform each other

9

Count to Infinity -- Two-Node Instability

Page 10: Unicast Routing Protocols (RIP, OSPF, and BGP)RIP...(RIP, OSPF, and BGP) Chapter 11 2 Routing Protocol is combination of rules and procedures lets routers in internet inform each other

10

Defining Infinity

Define 16 as infinity

Split Horizon

If node B reaches X via A, then B does not need

to advertise to A its (B's) distance to X

Split Horizon and Poison Reverse

If node B reaches X via A, then B will advertise

to A that its (B's) distance to X is infinity

Solutions to Instability

Page 11: Unicast Routing Protocols (RIP, OSPF, and BGP)RIP...(RIP, OSPF, and BGP) Chapter 11 2 Routing Protocol is combination of rules and procedures lets routers in internet inform each other

11

Three-Node Instability

Page 12: Unicast Routing Protocols (RIP, OSPF, and BGP)RIP...(RIP, OSPF, and BGP) Chapter 11 2 Routing Protocol is combination of rules and procedures lets routers in internet inform each other

12

Intradomain routing protocol

Based on distance vector routing

Uses hop count as metric (cost)

Infinite distance defined as 16 hops

Routing Information Protocol (RIP)

Page 13: Unicast Routing Protocols (RIP, OSPF, and BGP)RIP...(RIP, OSPF, and BGP) Chapter 11 2 Routing Protocol is combination of rules and procedures lets routers in internet inform each other

13

Example of a domain using RIP

Page 14: Unicast Routing Protocols (RIP, OSPF, and BGP)RIP...(RIP, OSPF, and BGP) Chapter 11 2 Routing Protocol is combination of rules and procedures lets routers in internet inform each other

14

RIP Message Format

Command: Request (1), Response (2)

Version: 1

Family: TCP/IP (2)

Page 15: Unicast Routing Protocols (RIP, OSPF, and BGP)RIP...(RIP, OSPF, and BGP) Chapter 11 2 Routing Protocol is combination of rules and procedures lets routers in internet inform each other

Request Message

Response (Update) Message

Solicited response: sent only in answer to request

Unsolicited response: sent periodically (every 30 sec)

15

Requests and Responses

Page 16: Unicast Routing Protocols (RIP, OSPF, and BGP)RIP...(RIP, OSPF, and BGP) Chapter 11 2 Routing Protocol is combination of rules and procedures lets routers in internet inform each other

16

Update Message – Example

Update message

from R1 to R2:

Page 17: Unicast Routing Protocols (RIP, OSPF, and BGP)RIP...(RIP, OSPF, and BGP) Chapter 11 2 Routing Protocol is combination of rules and procedures lets routers in internet inform each other

17

RIP Timers

Periodic timer: How frequent to send update message

Expiration timer: How long to wait for update message

Garbage collection timer: How long to wait before purging route from table

Page 18: Unicast Routing Protocols (RIP, OSPF, and BGP)RIP...(RIP, OSPF, and BGP) Chapter 11 2 Routing Protocol is combination of rules and procedures lets routers in internet inform each other

18

RIP Version 2

Route tag: AS number

Uses all-router multicast address to send RIP messages

Supports classless addressing

Message Format

Page 19: Unicast Routing Protocols (RIP, OSPF, and BGP)RIP...(RIP, OSPF, and BGP) Chapter 11 2 Routing Protocol is combination of rules and procedures lets routers in internet inform each other

19

RIP Version 2

Supports authentication

Page 20: Unicast Routing Protocols (RIP, OSPF, and BGP)RIP...(RIP, OSPF, and BGP) Chapter 11 2 Routing Protocol is combination of rules and procedures lets routers in internet inform each other

20

RIP messages encapsulated in UDP

datagrams

UDP uses well-known port (520) for RIP

Encapsulation

IP

header

UDP

header RIP message

20 bytes 8bytes

UDP datagram

IP datagram

Page 21: Unicast Routing Protocols (RIP, OSPF, and BGP)RIP...(RIP, OSPF, and BGP) Chapter 11 2 Routing Protocol is combination of rules and procedures lets routers in internet inform each other

21

Link State Routing

Each node advertises its links state to all other

nodes (flooding)

Link state packet (LSP) carries node identity,

list of links, sequence number, and age

Each node uses same topology to create its

routing table

Each node constructs its routing table using

Dijkstra algorithm

Page 22: Unicast Routing Protocols (RIP, OSPF, and BGP)RIP...(RIP, OSPF, and BGP) Chapter 11 2 Routing Protocol is combination of rules and procedures lets routers in internet inform each other

22

Link State Routing

Page 23: Unicast Routing Protocols (RIP, OSPF, and BGP)RIP...(RIP, OSPF, and BGP) Chapter 11 2 Routing Protocol is combination of rules and procedures lets routers in internet inform each other

23

Dijkstra Algorithm: Forming Shortest Path Tree

Page 24: Unicast Routing Protocols (RIP, OSPF, and BGP)RIP...(RIP, OSPF, and BGP) Chapter 11 2 Routing Protocol is combination of rules and procedures lets routers in internet inform each other

24

Open Shortest Path First (OSPF) Protocol

Intradomain routing protocol

Based on link state routing

Metric can be based on type of service (min delay,

max throughput, …)

Divides autonomous system into areas

Page 25: Unicast Routing Protocols (RIP, OSPF, and BGP)RIP...(RIP, OSPF, and BGP) Chapter 11 2 Routing Protocol is combination of rules and procedures lets routers in internet inform each other

25

Types of Links

Page 26: Unicast Routing Protocols (RIP, OSPF, and BGP)RIP...(RIP, OSPF, and BGP) Chapter 11 2 Routing Protocol is combination of rules and procedures lets routers in internet inform each other

26

Types of Links

Page 27: Unicast Routing Protocols (RIP, OSPF, and BGP)RIP...(RIP, OSPF, and BGP) Chapter 11 2 Routing Protocol is combination of rules and procedures lets routers in internet inform each other

27

Virtual Link

When link between two routers is broken, virtual link

created using path probably goes through several routers

Page 28: Unicast Routing Protocols (RIP, OSPF, and BGP)RIP...(RIP, OSPF, and BGP) Chapter 11 2 Routing Protocol is combination of rules and procedures lets routers in internet inform each other

28

Types of OSPF Packet

Page 29: Unicast Routing Protocols (RIP, OSPF, and BGP)RIP...(RIP, OSPF, and BGP) Chapter 11 2 Routing Protocol is combination of rules and procedures lets routers in internet inform each other

29

OSPF Common Header

Type: Defines the packet type (1 to 5)

Checksum: On entire packet excluding authentication

Authentication: None (0), Password (1)

64

(Router ID)

Page 30: Unicast Routing Protocols (RIP, OSPF, and BGP)RIP...(RIP, OSPF, and BGP) Chapter 11 2 Routing Protocol is combination of rules and procedures lets routers in internet inform each other

30

Link State Update Packet

Used by router to advertise its links states

Each packet contains several different LSAs

(LSA)

Page 31: Unicast Routing Protocols (RIP, OSPF, and BGP)RIP...(RIP, OSPF, and BGP) Chapter 11 2 Routing Protocol is combination of rules and procedures lets routers in internet inform each other

31

Link State Update Packet

# of LSAs

Page 32: Unicast Routing Protocols (RIP, OSPF, and BGP)RIP...(RIP, OSPF, and BGP) Chapter 11 2 Routing Protocol is combination of rules and procedures lets routers in internet inform each other

32

LSA General Header

Link State Type Link State ID

Type 1: Router link Address of router

Type 2: Network link Address of designated router

Type 3: Summary link to network Address of network

Type 4: Summary link to AS boundary router Address of AS boundary router

Type 5: External link Address of external network

Page 33: Unicast Routing Protocols (RIP, OSPF, and BGP)RIP...(RIP, OSPF, and BGP) Chapter 11 2 Routing Protocol is combination of rules and procedures lets routers in internet inform each other

33

Router Link LSA

Announce all router links

Page 34: Unicast Routing Protocols (RIP, OSPF, and BGP)RIP...(RIP, OSPF, and BGP) Chapter 11 2 Routing Protocol is combination of rules and procedures lets routers in internet inform each other

34

Router Link LSA

Page 35: Unicast Routing Protocols (RIP, OSPF, and BGP)RIP...(RIP, OSPF, and BGP) Chapter 11 2 Routing Protocol is combination of rules and procedures lets routers in internet inform each other

35

Router Link LSA Example

Page 36: Unicast Routing Protocols (RIP, OSPF, and BGP)RIP...(RIP, OSPF, and BGP) Chapter 11 2 Routing Protocol is combination of rules and procedures lets routers in internet inform each other

36

Router Link LSA Example

Page 37: Unicast Routing Protocols (RIP, OSPF, and BGP)RIP...(RIP, OSPF, and BGP) Chapter 11 2 Routing Protocol is combination of rules and procedures lets routers in internet inform each other

37

Network Link LSA

Announce network and all routers connected to it

Distributed by designated router on behalf of

transient network

Page 38: Unicast Routing Protocols (RIP, OSPF, and BGP)RIP...(RIP, OSPF, and BGP) Chapter 11 2 Routing Protocol is combination of rules and procedures lets routers in internet inform each other

38

Network Link LSA

Page 39: Unicast Routing Protocols (RIP, OSPF, and BGP)RIP...(RIP, OSPF, and BGP) Chapter 11 2 Routing Protocol is combination of rules and procedures lets routers in internet inform each other

39

Network Link LSA Example

0

Page 40: Unicast Routing Protocols (RIP, OSPF, and BGP)RIP...(RIP, OSPF, and BGP) Chapter 11 2 Routing Protocol is combination of rules and procedures lets routers in internet inform each other

40

Network Link LSA Example

Router-link LSA

R1 has two links (N1, N2)

R2 has one link (N2)

R3 has two links (N2, N3)

Network-link LSA

N1 advertised by R1

N2 advertised by designated

router (R1, R2, or R3)

N3 advertised by R3

Page 41: Unicast Routing Protocols (RIP, OSPF, and BGP)RIP...(RIP, OSPF, and BGP) Chapter 11 2 Routing Protocol is combination of rules and procedures lets routers in internet inform each other

41

Summary Link to Network LSA

Announce networks outside the area

Flooded by area boarder router

Page 42: Unicast Routing Protocols (RIP, OSPF, and BGP)RIP...(RIP, OSPF, and BGP) Chapter 11 2 Routing Protocol is combination of rules and procedures lets routers in internet inform each other

42

Summary Link to Network LSA

Page 43: Unicast Routing Protocols (RIP, OSPF, and BGP)RIP...(RIP, OSPF, and BGP) Chapter 11 2 Routing Protocol is combination of rules and procedures lets routers in internet inform each other

43

Summary Link to AS Boundary Router LSA

Announce AS boundary router

Flooded by area boarder router

Page 44: Unicast Routing Protocols (RIP, OSPF, and BGP)RIP...(RIP, OSPF, and BGP) Chapter 11 2 Routing Protocol is combination of rules and procedures lets routers in internet inform each other

44

Summary Link to AS Boundary Router LSA

Page 45: Unicast Routing Protocols (RIP, OSPF, and BGP)RIP...(RIP, OSPF, and BGP) Chapter 11 2 Routing Protocol is combination of rules and procedures lets routers in internet inform each other

45

External Link LSA

Announce networks outside AS

Flooded by AS boundary router

Page 46: Unicast Routing Protocols (RIP, OSPF, and BGP)RIP...(RIP, OSPF, and BGP) Chapter 11 2 Routing Protocol is combination of rules and procedures lets routers in internet inform each other

46

External Link LSA

Page 47: Unicast Routing Protocols (RIP, OSPF, and BGP)RIP...(RIP, OSPF, and BGP) Chapter 11 2 Routing Protocol is combination of rules and procedures lets routers in internet inform each other

47

Hello Packet

To create neighborhood relationships

To test reachability of neighbors

Determine the selection of designated router

Page 48: Unicast Routing Protocols (RIP, OSPF, and BGP)RIP...(RIP, OSPF, and BGP) Chapter 11 2 Routing Protocol is combination of rules and procedures lets routers in internet inform each other

48

Database Description Packet

Sent by neighbors to new connected router

Contains outline (LSA header) of each link in

link-state database

Page 49: Unicast Routing Protocols (RIP, OSPF, and BGP)RIP...(RIP, OSPF, and BGP) Chapter 11 2 Routing Protocol is combination of rules and procedures lets routers in internet inform each other

49

Link State Request Packet

Sent by router needs information about specific link

Can be used by newly connected router to request

more information after receiving database

description packet

Page 50: Unicast Routing Protocols (RIP, OSPF, and BGP)RIP...(RIP, OSPF, and BGP) Chapter 11 2 Routing Protocol is combination of rules and procedures lets routers in internet inform each other

50

Link State Acknowledgment Packet

To acknowledge receipt of every link state update

packet

Page 51: Unicast Routing Protocols (RIP, OSPF, and BGP)RIP...(RIP, OSPF, and BGP) Chapter 11 2 Routing Protocol is combination of rules and procedures lets routers in internet inform each other

51

OSPF packets encapsulated in IP datagrams

Encapsulation

IP

header OSPF packet

20 bytes

IP datagram

Page 52: Unicast Routing Protocols (RIP, OSPF, and BGP)RIP...(RIP, OSPF, and BGP) Chapter 11 2 Routing Protocol is combination of rules and procedures lets routers in internet inform each other

52

Path Vector Routing

Exterior routing protocol for inter-domain or inter-AS routing

Router has list of networks can be reached

with path (list of ASs to pass)

Prevents looping using path information

Allows routing based on router policy

Optimum path is one that fits organization

needs (security, safety, reliability, …)

Page 53: Unicast Routing Protocols (RIP, OSPF, and BGP)RIP...(RIP, OSPF, and BGP) Chapter 11 2 Routing Protocol is combination of rules and procedures lets routers in internet inform each other

53

Reachability

Page 54: Unicast Routing Protocols (RIP, OSPF, and BGP)RIP...(RIP, OSPF, and BGP) Chapter 11 2 Routing Protocol is combination of rules and procedures lets routers in internet inform each other

54

Routing Tables

Page 55: Unicast Routing Protocols (RIP, OSPF, and BGP)RIP...(RIP, OSPF, and BGP) Chapter 11 2 Routing Protocol is combination of rules and procedures lets routers in internet inform each other

55

Routing Tables After Aggregation

14 14 14

Page 56: Unicast Routing Protocols (RIP, OSPF, and BGP)RIP...(RIP, OSPF, and BGP) Chapter 11 2 Routing Protocol is combination of rules and procedures lets routers in internet inform each other

56

Loop Prevention

Page 57: Unicast Routing Protocols (RIP, OSPF, and BGP)RIP...(RIP, OSPF, and BGP) Chapter 11 2 Routing Protocol is combination of rules and procedures lets routers in internet inform each other

57

Border Gateway Protocol (BGP)

Interdomain routing protocol

Uses path vector routing

Supports classless addressing (CIDR)

Path is presented as list of attributes

Page 58: Unicast Routing Protocols (RIP, OSPF, and BGP)RIP...(RIP, OSPF, and BGP) Chapter 11 2 Routing Protocol is combination of rules and procedures lets routers in internet inform each other

58

Path Attributes

AS_PATH

Defines list of ASs to reach destination

NEXT-HOP

Defines next router to which packet sent

ORIGIN

Defines source of routing information (IGP: interior,

EGP: exterior)

Page 59: Unicast Routing Protocols (RIP, OSPF, and BGP)RIP...(RIP, OSPF, and BGP) Chapter 11 2 Routing Protocol is combination of rules and procedures lets routers in internet inform each other

59

BGP Sessions

External BGP (E-BGP) session Exchange information between BGP routers

in different ASs

Internal BGP (I-BGP) session Exchange information between BGP routers

inside AS

Page 60: Unicast Routing Protocols (RIP, OSPF, and BGP)RIP...(RIP, OSPF, and BGP) Chapter 11 2 Routing Protocol is combination of rules and procedures lets routers in internet inform each other

60

Types of BGP Messages

Page 61: Unicast Routing Protocols (RIP, OSPF, and BGP)RIP...(RIP, OSPF, and BGP) Chapter 11 2 Routing Protocol is combination of rules and procedures lets routers in internet inform each other

61

BGP Packet Header

Marker: reserved for authentication

Page 62: Unicast Routing Protocols (RIP, OSPF, and BGP)RIP...(RIP, OSPF, and BGP) Chapter 11 2 Routing Protocol is combination of rules and procedures lets routers in internet inform each other

62

Open Message

To create neighborhood relationship

Neighbor responds with keepalive message

Hold time: waiting time until receiving keepalive or update message

BGP identifier: defines sending router (its IP address)

Page 63: Unicast Routing Protocols (RIP, OSPF, and BGP)RIP...(RIP, OSPF, and BGP) Chapter 11 2 Routing Protocol is combination of rules and procedures lets routers in internet inform each other

63

Update Message

To withdraw destinations advertised previously

To announce route to new destination

Page 64: Unicast Routing Protocols (RIP, OSPF, and BGP)RIP...(RIP, OSPF, and BGP) Chapter 11 2 Routing Protocol is combination of rules and procedures lets routers in internet inform each other

64

Network layer reachability information

Network to be advertised

(Length, Prefix) tuple Length: number of bits in prefix

Prefix: common part of network address

Example: IP address 153.18.7.0/24

Length: 24 Prefix: 153.18.7

Withdrawn routes

Destinations to be deleted from previously advertised list

(Length, Prefix) tuple

Update Message

Page 65: Unicast Routing Protocols (RIP, OSPF, and BGP)RIP...(RIP, OSPF, and BGP) Chapter 11 2 Routing Protocol is combination of rules and procedures lets routers in internet inform each other

65

Keepalive Message

Exchanged between peers regularly before hold

time expires

Page 66: Unicast Routing Protocols (RIP, OSPF, and BGP)RIP...(RIP, OSPF, and BGP) Chapter 11 2 Routing Protocol is combination of rules and procedures lets routers in internet inform each other

66

Notification Message

Sent by router whenever error detected or to close

connection

Error Code: Message header error (1), Open message error (2),

Update message error (3), Hold time expired (4).

Page 67: Unicast Routing Protocols (RIP, OSPF, and BGP)RIP...(RIP, OSPF, and BGP) Chapter 11 2 Routing Protocol is combination of rules and procedures lets routers in internet inform each other

67

BGP messages encapsulated in TCP segments

TCP uses well-known port (179) for BGP

Encapsulation