Presentation is loading. Please wait.

Presentation is loading. Please wait.

RIP ( Routing Information Protocol)

Similar presentations


Presentation on theme: "RIP ( Routing Information Protocol)"— Presentation transcript:

1 RIP ( Routing Information Protocol)
RFC 1058 and 1723 Included in BSD UNIX in 1982 Distance vector algorithm Distance metric: number of hops (max = 15 hops) Distance vectors: exchanged every 30 sec via RIP Response Message (also called “RIP advertisement”) 封装在UDP 报文中, 端口号为520。

2 Routing Information Protocol (RIP v1)
命令字:1 请求; 2 响应 通常把命令域设为1,然后广播整个路由表 Command (1-6) Version Address Family 32-bit IP address metric 24 more routes

3 RIP: Routing Information Protocol
Uses hop count as metric (max: 16 is infinity) Tables (vectors) “advertised” to neighbors every 30 s. Each advertisement: up to 25 entries No advertisement for 180 sec: neighbor/link declared dead routes via neighbor invalidated new advertisements sent to neighbors (Triggered updates) neighbors in turn send out new advertisements (if tables changed) link failure info quickly propagates to entire net poison reverse used to prevent ping-pong loops (infinite distance = 16 hops)

4 RIPv1 Problems Split horizon/poison reverse does not guarantee to solve count-to-infinity problem 16 = infinity => RIP for small networks only! Slow convergence Broadcasts consume non-router resources RIPv1 does not support subnet masks (VLSMs) No authentication

5 RIPv2 Provides: Uses reserved fields in RIPv1 header.
VLSM support Authentication Multicasting (地址为: ) Tags to support EGP/BGP routes. Uses reserved fields in RIPv1 header. First route entry replaced by authentication info.

6 Routing Information Protocol (RIP v2)
Command (1-6) Version 保留 路由标记 Address Family 32-bit IP address 32-bit Subnet Mask Next hop (32bit) metric 24 more routes 如果在Address Family 中的数据为FFFF,则整个报文为 认证(authentication)报文。 路由标记:可带AS 号,使RIP能够从EGP/BGP routes. 中接受信息

7 RIP problems Counting-to-infinity problem:
Simple configuration A->B->C. If C fails, B needs to update and thinks there is a route through A. A needs to update and thinks there is a route thru B. No clear solution, except to set “infinity” to be small (eg 16 in RIP) Slow convergence after topology change: Due to count to infinity problem Also information cannot propagate thru node until it recalculates routing info.

8 Properties of Distance Vector Algorithm
Bad news propagate slowly: the count-to-infinity problem

9 Properties of Distance Vector Algorithm
Good news propagate fast

10 RIP problems (contd) Black-holes: Not the optimal routing tables
If one node goes broke and advertises route of zero to several key networks, all nodes immediately point to it. Not the optimal routing tables the simplistic metric resulting in packets being sent over slow links when better paths are available Broadcasts consume non-router resources

11 The Bouncing Effect X dest cost dest cost 1 B A B 1 A 1 C 2 C 1 2 1 C

12 C Sends Routes to B dest cost dest cost B A B 1 A ~ C 2 C 1 2 1 C dest

13 B Updates Distance to A dest cost dest cost B A B 1 A 3 C 2 C 1 2 1 C

14 B Sends Routes to C dest cost dest cost B A B 1 A 3 C 2 C 1 2 1 C dest
4 B 1

15 C Sends Routes to B dest cost dest cost B A B 1 A 5 C 2 C 1 2 1 C dest
4 B 1

16 How are These Loops Caused?
Observation 1: B’s metric increases Observation 2: C picks B as next hop to A But, the implicit path from C to A includes itself!

17 Solution 1: Holddowns If metric increases, delay propagating information In our example, B delays advertising route C eventually thinks B’s route is gone, picks its own route B then selects C as next hop Adversely affects convergence

18 Other “Solutions” Split horizon Poisoned reverse
C does not advertise route to B Rule: It is never useful to send information about a route back in the direction from which it came Poisoned reverse C advertises route to B with infinite distance Rule: If two routers have routes pointing at each other,advertising reverse routes with a metric of 16 breaks the loop immediately

19 An Example Where Reverse-Poison Fails
1 1 1 1 When the link between C and D fails, C will set its distance to D as  However, A will then use B to go to D, and B will use A to go to D because there is no reverse-poison between them After such updates, A (and B) will then report new path to C for D, and C will use the path; we thus have the count-to-infinity problem again

20 Link State Protocols Key: Create a network “map” at each node.
1. Node collects the state of its connected links and forms a “Link State Packet” (LSP) 2. Flood LSP => reaches every other node in the network and everyone now has a network map. 3. Given map, run Dijkstra’s shortest path algorithm (SPF) => get paths to all destinations 4. Routing table = next-hops of these paths.

21 Dijkstra’s algorithm Net topology, link costs known to all nodes
accomplished via “link state broadcast” all nodes have same info computes least-cost paths from one node (‘source or root”) to all other nodes gives routing table for that node iterative: after k iterations, know least cost path to k dest.’s Notation: c(i,j): link cost from node i to j. cost infinite if not direct neighbors D(v): current value of path cost from source to dest. V p(v): predecessor node along path from source to v, that is next v N: set of nodes whose least cost path definitively known

22 Dijkstra’s Algorithm 1 Initialization: 2 N = {A} 3 for all nodes v
if v adjacent to A then D(v) = c(A,v) else D(v) = infty 7 8 Loop 9 find w not in N such that D(w) is a minimum 10 add w to N 11 update D(v) for all v adjacent to w and not in N: D(v) = min( D(v), D(w) + c(w,v) ) 13 /* new cost to v is either old cost to v or known shortest path cost to w plus cost from w to v */ 15 until all nodes in N

23 Dijkstra’s algorithm: example
Step 1 2 3 4 5 start N A AD ADE ADEB ADEBC ADEBCF D(B),p(B) 2,A D(C),p(C) 5,A 4,D 3,E D(D),p(D) 1,A D(E),p(E) infinity 2,D D(F),p(F) infinity 4,E A E D C B F 2 1 3 5

24 Dijkstra’s algorithm, discussion
Algorithm complexity: n nodes each iteration: need to check all nodes, w, not in N n*(n+1)/2 comparisons: O(n**2) more efficient implementations possible: O(nlogn)

25 OSPF (Open Shortest Path First)
RFC 2178 A Link State algorithm Link costs are configured by network administrator Link state packet disseminated to entire AS (via flooding) periodically Each router maintains an identical database describing the AS's topology Use Dijkstra’s algorithm to compute shortest path routes to all the routers

26 OSPF Advanced Features
Security: all OSPF messages authenticated (to prevent malicious intrusion), TCP connections used Multiple same-cost paths allowed (only one path in RIP) Allow each link to have different costs for different TOS (Type of Service) IP Packets E.g, high-bandwidth satellite link configured to have a low cost for non-time-critical traffic and have a high cost for delay-sensitive traffic Can compute different routes for each type of traffic Integrated unicast and multicast support: Multicast OSPF (MOSPF, RFC 1584) provides simple extensions to OSPF to provide for multicast routing Support for hierarchy within a single AS

27 Hierarchical OSPF Two-level hierarchy: local area, backbone
An AS is configured into areas, each area runs its own OSPF link-state routing algorithm One area in AS is configured to be the backbone area, job is to route traffic between other areas in the AS Four types of OSPF routers: Internal routers: in non-backbone areas and only perform intra-AS routing Area border routers: belong to both an area and the backbone, route packets to outside the area Backbone routers: perform routing within the backbone but are not area border routers Boundary routers: connect to other ASs, exchange routing information with routers in other ASs

28 Hierarchical OSPF

29 OSPF in IP Packets OSPF is a link-state routing protocol
89 - OSPF 6 - TCP 17 - UDP Frame Payload C R Frame Header IP Header Protocol Number Packet Payload OSPF is a link-state routing protocol Relies on IP packets for delivery of routing information Uses protocol number 89

30 OSPF Terminology Interfaces

31 OSPF Terminology Neighbors Interfaces

32 OSPF Terminology Neighbors Interfaces Cost = 10 Cost = 1785 Cost = 6

33 OSPF Terminology Area 1 Area 0 Neighbors Cost = 10 Cost = 1785
Interfaces Area 1 Cost = 10 Area 0 Cost = 1785 Cost = 6

34 OSPF Terminology Area 1 Area 0 Neighbors Cost = 10 Cost = 1785
Autonomous System Neighbors Interfaces Area 1 Cost = 10 Area 0 Cost = 1785 Cost = 6

35 OSPF Terminology Area 1 Area 0 Neighbors Cost = 10 Cost = 1785
Autonomous System Neighbors Interfaces Area 1 Cost = 10 Area 0 Cost = 1785 Cost = 6 Neighborship Database Lists Neighbors

36 OSPF Terminology Area 1 Area 0 Neighbors Cost = 10 Cost = 1785
Autonomous System Neighbors Interfaces Area 1 Cost = 10 Area 0 Cost = 1785 Cost = 6 Neighborship Database Lists Neighbors Topology Database Lists All Routes

37 OSPF Terminology Area 1 Area 0 Neighbors Cost = 10 Cost = 1785
Autonomous System Neighbors Interfaces Area 1 Cost = 10 Area 0 Cost = 1785 Cost = 6 Neighborship Database Lists Neighbors Topology Database Lists All Routes Routing Table Lists Best Routes

38 Broadcast Multiaccess
OSPF Topologies Broadcast Multiaccess Point-to-Point NBMA X.25 Frame Relay

39 OSPF五类报文 Type1 ,Hello分组,用来发现和维持邻站的可达性
2, Database Description, 向邻站给出自己的链路状态数据库中的所有链路状态项目的摘要信息 3,Link State Request 向对方请求发送某些链路状态项目的详细信息 4,Link State Update用Flooding向全网更新链路状态 5,Link State Acknowledgement 对链路更新分组的确认

40 Neighborship * * * * Hello * Entry must match on neighboring routers
D E C B 每两个相邻的路由器10秒钟交换Hello报文 40秒没收到Hello报文,该相邻Router不可达 Router ID Hello/dead intervals Neighbors Area-ID Router priority DR IP address BDR IP address Authentication password Stub area flag * afadjfjorqpoeru * Hello * * * Entry must match on neighboring routers

41 Neighborship (cont.) * * * * Hello
A D E C B Router ID Hello/dead intervals Neighbors Area-ID Router priority DR IP address BDR IP address Authentication password Stub area flag * afadjfjorqpoeru * Hello * * * Entry must match on neighboring routers

42 DR and BDR Hellos elect DR and BDR to represent segment
Each router then forms adjacency with DR and BDR

43 Electing the DR and BDR Hello packets exchanged via IP multicast
Router with highest OSPF priority elected

44 Exchange Process /24 E0 /24 E1 A B Down State

45 Exchange Process A B 172.16.5.1/24 E0 172.16.5.2/24 E1
Down State I am router ID and I see no one. Init State Router B Neighbors List /24, int E1

46 Exchange Process A B 172.16.5.1/24 E0 172.16.5.2/24 E1
Down State I am router ID and I see no one. Init State Router B Neighbors List /24, int E1 I am router ID , and I see

47 Exchange Process A B 172.16.5.1/24 E0 172.16.5.2/24 E1
Down State I am router ID and I see no one. Init State Router B Neighbors List /24, int E1 I am router ID , and I see Router A Neighbors List /24, int E0 Two-Way State

48 Discovering Routes DR E0 172.16.5.1 E0 172.16.5.3
Exstart State afadjfjorqpoeru I will start exchange because I have router ID Hello No, I will start exchange because I have a higher router ID. afadjfjorqpoeru Hello

49 Discovering Routes DR E0 172.16.5.1 E0 172.16.5.3
Exstart State afadjfjorqpoeru I will start exchange because I have router ID Hello No, I will start exchange because I have a higher router ID. afadjfjorqpoeru Hello Exchange State afadjfjorqpoeru Here is a summary of my link-state database. DBD DBD afadjfjorqpoeru Here is a summary of my link-state database.

50 Discovering Routes (cont.)
DR E0 E afadjfjorqpoeru afadjfjorqpoeru Thanks for the information! LSAck LSAck

51 Discovering Routes (cont.)
DR E0 E afadjfjorqpoeru afadjfjorqpoeru Thanks for the information! LSAck LSAck Loading State afadjfjorqpoeru I need the complete entry for network /24. LSR afadjfjorqpoeru Here is the entry for network /24. LSU afadjfjorqpoeru LSAck Thanks for the information!

52 Discovering Routes (cont.)
DR E0 E afadjfjorqpoeru afadjfjorqpoeru Thanks for the information! LSAck LSAck Loading State afadjfjorqpoeru I need the complete entry for network /24. LSR afadjfjorqpoeru Here is the entry for network /24. LSU afadjfjorqpoeru LSAck Thanks for the information! Full State

53 Choosing Routes Cost=6 Cost=1 Cost=10 10.1.1.0/24 10.2.2.0/24
/24 A B C Cost=6 Cost=1 Cost=10 /24 Topology Table Net Cost Out Interface To0 To0 E0 This is the best route to

54 Maintaining Routing Information
Link-State Change DR 1 x LSU B A Router A tells all OSPF DRs on

55 Maintaining Routing Information
2 Link-State Change DR LSU 1 x LSU B A Router A tells all OSPF DRs on DR tells others on

56 Maintaining Routing Information
2 Link-State Change DR LSU 1 x LSU 3 B A LSU Router A tells all OSPF DRs on DR tells others on

57 Maintaining Routing Information
2 Link-State Change DR LSU I need to update my routing table. 4 1 x LSU 3 B A LSU Router A tells all OSPF DRs on DR tells others on

58 Maintaining Routing Information (cont.)
LSA LSU Is entry in link-state database? No Add to database Send LSAck to DR Flood LSA Run SPF to calculate new routing table End 31

59 Maintaining Routing Information (cont.)
LSA LSU Is entry in link-state database? Is seq. # the same? Ignore LSA Yes Yes No 32bit 序号,序号越大,状态越新 OSPF规定,增长速率不超过每5秒 一次,600年内不会产生重复号 Add to database Send LSAck to DR Flood LSA Run SPF to calculate new routing table End 33

60 Maintaining Routing Information (cont.)
LSA LSU Is entry in link-state database? Is seq. # the same? Ignore LSA Yes Yes No No Add to database Is seq. # higher? Send LSAck to DR No Send LSU with newer information to source Flood LSA Run SPF to calculate new routing table End End 32

61 Maintaining Routing Information (cont.)
LSA LSU Is entry in link-state database? Is seq. # the same? Ignore LSA Yes Yes No No A Add to database Go to A Is seq. # higher? Yes Send LSAck to DR No Send LSU with newer information to source Flood LSA Run SPF to calculate new routing table End End 34

62 Point-to-Point Neighborship
Router dynamically detects its neighboring router using the Hello protocol No election: Adjacency is automatic as soon as the two routers can communicate OSPF packets are always sent as multicast

63 外部网关协议 不同AS为什么不能用IGP,原因: Internet规模太大,使Inter-AS路由选择非常困难 AS内部的路由协议各自定义

64 路由策略特点 仅仅影响到达目标路由的下一跳 不影响分组的目标地址,它影响用于到达目标的路径。
不允许数据流采用与AS所选择路由不同的路径发往另一个AS 仅仅影响数据流怎样到达AS,不影响AS内部路由 可以实现任何于跳与跳范式相联系的规则 检测源地址,所以它是在入站接口上进行配置 内部路由优先于外部路由。

65 BGP路由模型 在BGP接点中,BGP路由表与IP路由表是分开的。 BGP路由表用来确定如何将路由信息发送给对等路由器。
IP路由表在组织上又可分为:a. AS内部路由表。 b. 其他AS通告的路径 IP路由表用于最终的路由选择。 策略引擎 BGP 路由表 IP路由表

66 BGP运行过程 建立AS间的拓扑图。该拓扑图是通过各AS的BGP路由器交换路由信息获得的。

67 BGP Operations (Simplified)
Establish session on TCP port 179 AS1 BGP session Exchange all active routes AS2 While connection is ALIVE exchange route UPDATE messages Exchange incremental updates

68 Internet Inter-AS Routing: BGP
BGP (Border Gateway Protocol, FRC 1771): the de facto standard inter-AS routing protocol Path vector protocol: Similar to distance vector protocol Each BGP router broadcasts to neighbors (peers) entire path (i.e, sequence of ASs) to a destination AS, but not the cost to destination E.g., Gateway X may send its neighbors the path to destination Z: Path (X,Z) = X,Y1,Y2,Y3,Z BGP distributes path info among ASs, but leaves the policy for making the route selections up to the network admin

69 BGP (cont’d) Suppose: gateway X sends its path to peer W
W may or may not select path offered by X Cost, policy (don’t route via competitors AS), loop prevention reasons. If W selects path advertised by X, then Path (W,Z) = W, Path (X,Z) = W,X,Y1,Y2,Y3,Z Note: X can control incoming traffic by controlling its route advertisements to peers: E.g., don’t want to route traffic to Z  don’t advertise any routes to Z

70 BGP (cont’d) BGP messages exchanged using TCP, port 179 BGP messages:
OPEN: opens TCP connection to peer, identifies and authenticates itself, sent when a BGP gateway wants to first establish contact with a BGP peer UPDATE: advertises new path (or withdraws old path) KEEPALIVE: keeps connection alive in absence of UPDATES; also ACKs OPEN message NOTIFICATION: reports errors in previous message; also used to close connection

71 Autonomous Systems (AS)
AS = set of routers and networks under the same administration No theoretical limit to the size of the AS All parts within an AS remain connected. If two networks rely on core-AS to connect, they don’t belong to a single AS AS is identified by a 16-bit AS number At least one border router per AS. This router also collects reachability information (“external routes”) and diffuses it internally and vice versa

72 Autonomous Systems (Continued)
AS types: Stub AS => only single connection to one other AS => it carries only local traffic. Multihomed AS: Connected to multiple AS, but does not allow transit traffic Transit AS: carries transit traffic under policy restrictions Traffic types: Local = traffic originating or terminating at AS. Transit = non-local traffic

73 Many Routing Processes Can Run on a Single Router
BGP Process BGP Routing tables RIP Process RIP Routing tables BGP OSPF Process OSPF Routing tables OS kernel RIP Domain OSPF Domain Forwarding Table Manager Forwarding Table

74 The New Internet Protocol
IPv6 The New Internet Protocol

75 Outline The Protocol (new ICMP)
Addressing and Routing (provider addressing) Autoconfiguration Security Support of Real-time Communication Deployment Strategy

76 The Design of IPv6 IPv4 design was very good IPv6 should keep most of it It could only increase the size of addresses and keep every thing the same Experience brought lessons for improvement

77 IPv6 Header (40 bytes) Source Address Destination Address 31 16
31 16 Version Prio Flow Label Payload Length Next Header Hop Limit Source Address Destination Address 128 bits 40 bytes 128 bits

78 IPv4 Header (20 bytes) Source Address Destination Address 31 16
31 16 Version Hd len Tot len ToS identification DF MF Fragment offset protocol TTL Hd chksum Source Address 20 bytes 32 bits Destination Address 32 bits Options (if any)

79 the IPV6 address are four times as large as the IPV4 address,
Note that while the IPV6 address are four times as large as the IPV4 address, the header length is only twice as big.

80 Notations of IPv6 Addresses
128 bit is represented as: 8 integers (16-bit) separated by colons each integer is represented by 4 hex digits Example: FEDC:BA98:7654:3210:FEDC:BA98:7664:3210

81 Simplifications Skip leading zeros
Example:1080:0000:0000:0000:0008:0800:200C:417A is reduced to: 1080:0:0:0:8:800:200C:417A A set of consecutive nulls is replaced by :: (at most one :: inside an address) the above address is reduced to: 1080::8:800:200C:417A

82 Comparison of Headers V6: 6 fields + 2 addr
V4: 10 fields + 2 addr + options Deleted: Header length type of service identification, flags, fragment offset Header Checksum Added: Priority Flow label Renamed: length -> Payload length Protocol -> Next header time to live -> Hop Limit Redefined: Option mechanism

83 Simplifications Fixed format headers No header checksum
no options -> no need for header length options expressed as Extension headers No header checksum reduce cost of header processing, no checksum updates at each router minimal risk as encapsulation of media access protocols (e.g..., Ethernet, PPP) have checksum No segmentation hosts should use path MTU discovery otherwise use the minimum MTU (536 bytes)

84 Renaming Total Length Payload Length not include header length
max length 64Kbytes with provision for larger packets using “jumbo gram” option Protocol Type Next header, can be set to: Protocol type (UDP,TCP, etc..) Type of first extension header TTL Hop limit “Truth in advertising!”, number of hops NOT number of seconds

85 New Fields Flow label & Priority
to facilitate the handling of real time traffic

86 Options Extension Headers
Routers treats packets with options as “second class citizens” because it is slow to process, thus programmers tend not use them and options almost became obsolete.

87 Daisy Chain of Headers IPv6 Header Next Header= TCP TCP Header + Data
Routing Routing Header Next Header= TCP TCP Header + Data

88 IPv6 extension headers Hop-by-hop options Routing Fragment
Destination options Authentication Encryption Security Payload

89 Protocol & Header Types

90 Routing Header ………………………... Next Header Num addrs Next Addr Reserved
Num addrs Next Addr Reserved strict/loose bit mask (24) Address[0] ………………………... Address[Num Addrs -1] Routers will only look at the routing header if they recognize one of their addresses in the destination field of the main header

91 Fragment Header Routers do not fragment oversized packets
Sender is to fragment & Receiver is to reassemble Reserved Fragment offset Res M Next Header Identification

92 Destination Option Header
Will only be examined by the station specified in the destination address. Next Header Hdr Ext Len Options Option Type Opt Data Len Option Data

93 Hop-by-Hop Option Header
Will be examined by each router. Has same form as destination options hdr. To satisfy networking requirement of supercomputers, the Jumbo payload option is used to send very large packets (the IPv6 length field is set to zero): 194 Opt Len = 4 Jumbo Payload Length

94 ICMP…. Streamlined Removed unused functions in ICMP of v4
Incorporate IGMP of v4 Type Code Checksum Message Body

95 ICMP Error Messages 1 Destination Unreachable. Codes: 2 Packet Too Big
0 No route to destination 1 destination prohibited 3 Address unreachable 4 Port unreachable 2 Packet Too Big contain next hop MTU. used for path MTU discovery 3 Time Exceeded. Codes: 0 Hop limit exceeded 1 Fragment reassebly time exceed 4 Parameter Problem No error message in response to multicast or ICMP packets

96 Other ICMP messages 128 Echo Request 129 Echo Reply
Group Membership Query Group Membership Report Group Membership Termination Router Solicitation Router Advertisement Neighbor Solicitation Neighbor Advertisement Redirect

97 Impact on Upper Layers Upper-layer Checksums : Mandatory (even UDP)
pseudoheader transport header transport data Source Address Destination Address Next header Payload Length

98 Programming interface
Domain Name Service 32-bit address to 128-bit address Programming interface Address data structures AF_INET6, PF_INET6, in_addr6, sockaddr_in6 Name-to-address translation functions Address conversion functions

99 Points of Controversy Do we need more than 255 Hops?
allowing hop count to be very large, looping packets will be relayed many times before being discarded Should packets be larger than 64K? allowing very large packets increase the size of queues and the variability of queuing delays Can we live without checksum? Some IPv4 routers started to cut corners by not verifying checksums to gain advantage over competition. By removing checksum altogether offers all routers the same advantage.

100 Real-time Support & Flows
A proper handling of flows is required for high-quality multimedia communications in the new Internet A flow is a sequence of packets sent from a particular source to a particular (unicast or multicast) destination for which the source desires special handling by the intervening routers.

101 Real-time flows & Data Queues
The flow label & source address are used to assert which packets belong to what flows In IPv6 port numbers deep inside due to daisy chaining Even may not be visible due to encryption

102 Security If security is provided at the IP level it becomes standard service that all applications can use It is absolutely necessary to implement if we want to develop of commercial use the Internet, e.g...., to deter sniffing attacks on passwords and credit card numbers.

103 Headers Authentication header Encryption header
Guarantee that the source address is authentic & the packet has not been altered during transmission. Encryption header Guarantee that only legitimate receivers will be able to read the content of the packet

104 Transitioning the Internet
At the beginning, all IPv6-capable hosts will also be IPv4-capable so as to retain connectivity with the existing Internet. To transform IPv4 into a dual-stack IPv6-capable host, it should include: The IPv6 basic code Handling IPv6 within TCP & UDP Modify socket interface to support new addresses Handling the interface with the name service

105 The 6-Bone The Similar to the M-Bone, Initially the connectivity is achieved by tunneling IPv6 packet will be encapsulated within IPv4 packets. IPv6 domain R IPv4 only Network


Download ppt "RIP ( Routing Information Protocol)"

Similar presentations


Ads by Google