1.05k likes | 2.72k Views
Chapter 21 . Unicast and Multicast Routing: Routing Protocols. 21.1 Unicast Routing 21.2 Unicast Routing Protocols 21.3 Multicast Routing 21.4 Multicast Routing Protocols. Routing Protocols. A router consults a routing table when a packet is ready to be forwarded
E N D
Chapter 21. Unicast and MulticastRouting:Routing Protocols 21.1 Unicast Routing 21.2 Unicast Routing Protocols 21.3 Multicast Routing 21.4 Multicast Routing Protocols Computer Networks
Routing Protocols • A router consults a routing table when a packet is ready to be forwarded • The routing table specifies the optimum path for the packet: static or dynamic • Internet needs dynamic routing tables to be updated as soon as there is a change • Routing protocols is a combination of rules and procedures for dynamic routing tables • The routing protocols also include procedures for combining information received from other routers • Unicast routing and multicasting routing Computer Networks
Unicasting • In unicast routing, the router forwards the received packet through only one of its ports. Computer Networks
Metric • Metric: a cost assigned for passing through a network • Total metric is equal to the sum of the metrics of networks that comprise the route • Router chooses the route with shortest (smallest) metric • RIP (Routing Information Protocol): hop count • OSPF (Open Shortest Path First): allows administrator to assign a cost based on the type of service required • BGP (Border Gateway Protocol): criterion is the policy Interior and exterior routing • AS (autonomous system): A group of networks and routers under the authority of a single administration • Interior: inside an AS • Exterior: between ASs Computer Networks
Unicast routing protocols Computer Networks
Interior and exterior routing • R1, R2, R3, and R4 use a interior and an exterior routing protocol. • The other routes use only interior routing protocols Computer Networks
Routing Information Protocol (RIP) • Simple protocol based on distance vector routing • Distance vector routing • Sharing knowledge about the entire autonomous systems • Sharing only with neighbors • Sharing at regular intervals • Distance vector routing table Computer Networks
RIP Updating Algorithm • Receive: a response RIP message 1. Add one hop to the hop count for each advertised destination. 2. Repeat the following steps for each advertised destination: 1. If (destination not in the routing table) 1. Add the advertised information to the table. 2. Else 1. If (next-hop field is the same) 1. Replace entry in the table with the advertised one. 2. Else 1. If (advertised hop count smaller than one in the table) 1. Replace entry in the routing table. 3. Return. Computer Networks
Example of updating a routing table Computer Networks
Initializing the routing table Computer Networks
Updatingthe routing table: final Computer Networks
Open Shortest Path First (OSPF) • Popular interior routing protocol based on link state routing • To handle routing efficiently and in a timely manner, OSPF divides an autonomous system into area • Area is a collection of network, hosts, and routers all contained within AS • AS can also be divided into many areas • Area border gateway, backbone router, virtual link Computer Networks
Link state routing • Sharing knowledge about the neighborhood • Sharing with every other router • Sharing when there is a change Types of links Computer Networks
Point-to-point link • To connect two routers without any other host or router in between Transient link • A network with several routers attached to it Computer Networks
Stub link • Stub link is a network that is connected to only one router Virtual link • Virtual link created for broken link by administrator Computer Networks
Graphical representation of an internet Computer Networks
Link state advertisement • To share information about their neighbors, each entity distributes LSAs • Depending on the type of entity, five different LSAs can be defined Computer Networks
Router link/network link • Router link: links of a true router • Network link: links of a network Computer Networks
Summary link to network/AS boundary router Computer Networks
External link • A link state database is a tabular representation of the topology of the internet inside an area • In OSPF, all router have the same link state database Link state database Computer Networks
Dijkstra Algorithm • To calculate the shortest path, each router applies the Dijkstra algorithm to its link state database 1. Start with the local node (router): the root of the tree. 2. Assign a cost of 0 to this node and make it the first permanent node. 3. Examine each neighbor node of the node that was the last permanent node. 4. Assign a cumulative cost to each node and make it tentative. 5. Among the list of tentative nodes 1. Find the node with the smallest cumulative cost and make it permanent. 2. If a node can be reached from more than one direction 1. Select the direction with the shortest cumulative cost. 6. Repeat steps 3 to 5 until every node becomes permanent. Computer Networks
Shortest-path calculation Computer Networks
Link state routing table • Table shows the cost of reaching each network in the area • To find the cost of reaching networks outside of the area, the routers use the summary link to network, the summary link to boundary router, and the external link advertisements Computer Networks
BGP • Interautonomous system routing protocol based on path vector routing • Distance vector is not good because there are occasions in which the route with smallest hop count is not the preferred route • Link state routing is not good because an internet is usually too big for this routing method Path vector routing • Each entry in the routing table contains the destination network, the next router, and the path to reach the destination • The path is usually defined as an ordered list of autonomous systems that a packet should travel through to reach the destination Computer Networks
Path vector routing table Computer Networks
Path vector messages • The router updates its routing table and modifies the message before sending it to the next neighbor • The modification consists of adding its AS number to the path and replacing the next router entry with its own identification Computer Networks
Path vector routing • Loop prevention : able to avoid the instability of distance vector routing • Policy routing: if one of Ass listed in the path is the against its policy, the router can ignore that path and the destination • Path attributes • Well-know attribute • Well-known mandatory attribute: • ORIGIN (source of the routing information) • NEXT_HOP (the next router) • Well-known discretionary attribute • Optional attribute • Optional transitive attribute • Optional nontransitive attribute Computer Networks
Types of BGP messages • Open: to open a connection with a neighbor • Update: to withdraw destinations that have been advertised previosuly, announce a route to a new destination, or do both • Keep-alive: to tell each other regularly that they are alive • Notification: to send whenever an error condition is detected or a router wants to close the connection Computer Networks
Multicasting • In multicast routing, the router may forward the received packet through several of its ports. • Broadcasting is a special case of multicasting Computer Networks
IGMP message types • IGMP is not multicasting routing protocol; it is a group management protocol. It helps a multicast router create and update a list of loyal members related to each router interface. Computer Networks
IGMP message format Computer Networks
IGMP operation • A multicast router of each group has the deputy of distributing the multicast packets destined for that group • Joining a group, leaving a group, and monitoring memberships Computer Networks
Joining a group • A host or a router can join a group • In IGMP, a membership report is sent twice, one after the other. • If the first one is lost or damaged, the second one replaces it Computer Networks
Leaving a group • The multicast router is responsible for monitoring all the hosts or routers in a LAN to see if they want to continue their membership in a group Monitoring membership Computer Networks
General query message • The router periodically (by default, every 125 s) send a general query message • The general query message does not define a particular group • IGMP uses a delayed-response strategy to prevent unnecessary traffic Computer Networks
Example • Imagine there are three hosts in a network, as shown in Figure below. A query message was received at time 0; the random delay time (in tenths of seconds) for each group is shown next to the group address. Computer Networks
Solution • The events occur in this sequence: • Time 12. The timer for 228.42.0.0 in host A expires and a membership report is sent, which is received by the router and every host including host B which cancels its timer for 228.42.0.0. • Time 30. The timer for 225.14.0.0 in host A expires and a membership report is sent, which is received by the router and every host including host C which cancels its timer for 225.14.0.0. • Time 50. The timer for 251.71.0.0 in host B expires and a membership report is sent, which is received by the router and every host. • Time 70. The timer for 230.43.0.0 in host C expires and a membership report is sent, which is received by the router and every host including host A which cancels its timer for 230.43.0.0. Computer Networks
Multicast tree • Objectives of multicasting: • Every member of the group should receive one, and only one, copy of the multicast packet. Nonmember must not receive a copy • There must be no loops in routing • The path traveled from source to each destination must be optimal • In a source-based tree approach, the combination of source and group determines the tree (DVMRP, MOSPF, PIM-DM) • In the group-shared tree approach, the group determines the tree (CBT, PIM-SM) Computer Networks
Logical tunneling • Logical tunnel is established by encapsulating the multicast packet inside a unicast packet Computer Networks
MBONE • To enable multicasting, we make a multicasting backbone (MBONE) out of isolated routers, using of the concept of tunneling Computer Networks
Multicast routing protocols Computer Networks
DVMRP • Formation of shortest-path tree: strategy based on distance vector routing • Reverse path forwarding: the router forwards only the packets that have traveled the shortest path from the source to the router; all other copies are discarded. RPF prevents the formation of loops. Computer Networks
RPF versus RPB • RPB creates a shortest-path broadcast tree from the source to each destination. It guarantees that each destination receives one and only one copy of the packet. Computer Networks
RPF, RPB, and RPM • RPM adds pruning and grafting to RPB to create a multicast shortest-path tree that supports dynamic membership changes. Computer Networks
MOSPF • MOSPF protocol is an extension of the OSPF protocol that uses multicast link state routing to create source-based trees • Use a different approach from DVMRP • Using a least-cost tree (using a metric) instead of a shortest-path tree • Making the tree all at once instead of gradually Computer Networks
Problems on the MOSPF tree • Tree based on Dijkstra’s algorithm has some problems • It uses unicast addresses (which are unique for each host) • Link state update packet to associate the unicast address of a host with the group address or addresses the host is sponsoring (group membership LSA) 2) The membership may change frequently • New link state packets to be sent upon a change in the membership • Make the router calculate the least-cost trees on demand (when it receive the first multicast packet) • Dijkstra’s algorithm is very complex • Make the router calculate the least-cost trees on demand (when it receive the first multicast packet) • Save the tree in cache memory for the same source-group pair Computer Networks
Core-Based Tree (CBT) • CBT is a group-shared protocol that uses a core as the root of the tree • AS is divided into regions, and core (rendezvous router) is chosen for each region • Each router sends a unicast join message to rendezvous router • When the rendezvous router has received all join messages from every member of the group, the tree is formed Computer Networks
Sending Multicast Packets • The source sends the multicast packet to the core router. The core router decapsulates the packet and forwards it to all interested hosts. Each router that receives the multicast packet, in turn, forwards it to all interested ports Computer Networks
Protocol Independent Multicast (PIM) • PIM-DM (Dense Mode) and PIM-SM (Sparse Mode) • PIM-DM is used when each router is involved in multicasting • PIM-DM is a source-based routing • PIM-DM uses RPF and pruning and grafting strategies to handle multicasting. However, it is independent of the underlying unicast protocol. • PIM-SM is used when each router is involved in multicasting with slight possibility • PIM-SM is a group-shared routing protocol that has a rendezvous point as the source of the tree • PIM-SM is similar to CBT but uses a simpler procedure. Computer Networks