Upload
letitia-oconnor
View
216
Download
2
Embed Size (px)
Citation preview
1
Network LayerNetwork LayerLecture 13Lecture 13
Imran AhmedImran AhmedUniversity of Management & TechnologyUniversity of Management & Technology
2
Agenda
• Introduction & Network layer functions
• Routing principles
• Hierarchical routing
• The Internet protocol (IP)
• Routing in the Internet
3
RIP ( Routing Information Protocol)
• Distance vector algorithm.• Distance metric: # of hops (max = 15 hops).• Distance vectors: exchanged among neighbors every 30 sec via Response Message (also
called advertisement).• RIP uses UDP port 520 & the broadcast IP address (255.255.255.255) to advertise every route in its
table once every 30 sec.• Each advertisement: list of up to 25 destination nets within AS.• RIP ver1 is considered as a classful protocol.• RIPv1 is specified in RFC 1058.
DC
BA
u vw
x
yz
destination hops u 1 v 2 w 2 x 3 y 3 z 2
4
RIP: Link Failure and Recovery
If no advertisement heard after 180 sec --> neighbor/link declared dead– routes via neighbor invalidated– new advertisements sent to neighbors– 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)
5
RIP Table processing
• RIP routing tables managed by application-level process called route-d (daemon)
• Advertisements sent in UDP packets, periodically repeated
physical
link
network forwarding (IP) table
Transprt (UDP)
routed
physical
link
network (IP)
Transprt (UDP)
routed
forwardingtable
6
rta rtb
rtd rtc
Network 10.1.1.0/24
rtd, 2 hops
rta, 1 hop rtc, 3 hops
rtb, 4 hops
How RIP routers use the hop count
7
RIP Example
• In the previous slide; there are four routers A, B, C & D. (that all are running RIP)– Router A advertises its directly connected
Ethernet network to router D with a hop count of 1.
– Router D receives this route and realizes that from router D’s perspective, it is two hops away, then router D advertises this network to router C with a hop count of 2.
– Router C in turn, advertises it to B and router B advertises it back to router A.
8
RIP Example• When the route arrives back at router A, it believes that
router B also has a connection to the same network.• It has no way of knowing that router B is only advertising
router A’s own route fourth-hand.• So, router A must make a choice of which route to use. To
make this choice, it compares the only metric it has, and determines that its directly connected route with a hop count of one is shorter than the route it receives from router B.
• At the same time, however, router A also sends an identical broadcast towards router B, which forwards it to router C, and then to router D which forwards it to router A, exactly like the first route.
• As routers B, C & D receive both routes, they compare the hop count and choose the shortest path.
9
RIPv1 Packet FormatIP header UDP header RIP Message
Command Version Set to 00...0
32-bit address
Unused (Set to 00...0)
address family Set to 00.00
Unused (Set to 00...0)
metric (1-16)
one
rout
e en
try(2
0 by
tes)
Up to 24 more routes (each 20 bytes)
32 bits
One RIP message can have up to 25 route entries
1: request2: response
2: for IP
Address of destination
Cost (measured in hops)
1: RIPv1
10
RIP’s Implementation of DV
• RIP needs to deal with some of the shortcomings of Distance-Vector protocols:– Count-to-Infinity– Split Horizon & Poison Reverse– Triggered Updates– Timers
11
RIP’s Implementation of DV• Count-to-Infinity:
– This limits the diameter of the routing domain to 15, and also makes counting to infinity a little faster.
• Split Horizon:– If it is activated, a router omits sending routes back to the router it
learned them from.– This helps in avoiding a process of mutual deception, where two
routers tell each other that they can reach destination X via each other.
• Split Horizon with Poison Reverse:– If split horizon is activated with poison reverse, then a router
behaves in the same way as in plain split horizon, but instead of not sending information back, it sends a route update with a metric of 16 (unreachable) to the router, it got the route from.
12
RIP’s Implementation of DV• Triggered Updates:
– It means that an incoming update message triggers the router to make its own update.
– RIP does its updates by sending out its distance-vectors to all its neighbors.
• Flash Updates:– On a Cisco box, a router that cold-starts broadcasts a
request packet to all its neighbors. Every neighbor responds by immediately unicasting a reply containing its distance-vector.
– This functionality together with the normal triggered update functionality is called a flash update.
13
RIP’s Timers
• There are two sets of timers in RIP:– The RFC way– The Cisco way
14
RIP’s Timers – According to RFC
• Update – the time between each update (default is 30 sec.).
• Time-out – if no updates are received, wait this long after the last successful update before marking the route for deletion (default is 180 sec.).
• Garbage-collection – when a route has been marked for deletion, its metric is set to 16, and after this amount of time, it is removed from memory (default is 120 sec.).
15
RIP’s Timers – According to Cisco
• Update – the time between each update (default is 30 sec.).
• Invalid – if no updates are received, wait this long after the last successful update before marking the route invalid (default is 180 sec.).
• Holddown – when a route has become invalid, don’t accept updates about this route for this period of time (default is 180 sec.).
• Flush – if a route has been invalid for this time, flush (remove) it from memory (default is 240 sec.).
16
RIP Problems
• RIP takes a long time to stabilize– Even for a small network, it takes several
minutes until the routing tables have settled after a change.
• RIP has all the problems of distance vector algorithms, e.g., routing loops etc.
• The maximum hop count in RIP is 15.
17
RIPv2
• RIPv2 is an extends RIPv1:– Subnet masks are carried in the route
information.– Authentication of routing messages.– Route information carries next-hop address.– Uses IP multicasting.
• Extensions of RIPv2 are carried in unused fields of RIPv1 messages.
18
RIPv2 Packet FormatIP header UDP header RIPv2 Message
Command Version Set to 00.00
IP address
Subnet Mask
address family route tag
Next-Hop IP address
metric (1-16)
one
rout
e en
try(2
0 by
tes)
Up to 24 more routes (each 20 bytes)
32 bits
Used to provide a method of separating "internal" RIP routes (routes for networks within the RIP routing domain) from "external" RIP routes
Identifies a better next-hop address on the same subnet than the advertising router, if one exists (otherwise 0….0)
2: RIPv2
Subnet mask for IP address
19
RIP Security
• Issue: Sending bogus routing updates to a router.– RIPv1: No protection.
– RIPv2: Simple authentication scheme.
IP header UDP header RIPv2 Message
Command Version Set to 00.00
Password (Bytes 0 - 3)
Password (Bytes 4 - 7)
0xffff Authentication Type
Password (Bytes 8- 11)
Password (Bytes 12 - 15) Auth
etic
atio
n
Up to 24 more routes (each 20 bytes)
32 bits
2: plaintext password