1 / 57

Network Layer II (routing)

Network Layer II (routing). Routing Styles: Static vs. Dynamic Routing Routing Protocols/Algorithms Routing Table Routing Information Protocol (RIP) & Distance Vector Routing (DVR) Open Shortest Path First (OSPF) & Link State Routing (LSR) Dijkstra’s “Shortest Path” Algorithm

Download Presentation

Network Layer II (routing)

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Network Layer II (routing) • Routing Styles: • Static vs. Dynamic Routing • Routing Protocols/Algorithms • Routing Table • Routing Information Protocol (RIP) & Distance Vector Routing (DVR) • Open Shortest Path First (OSPF) & Link State Routing (LSR) • Dijkstra’s “Shortest Path” Algorithm • Border Gateway Protocol (BGP) and Path Vector Routing (PVR)

  2. Routing Protocol & Routing Algorithm • A Routing Protocol is a combination of rules and procedures that lets routers in an internet inform each other of changes. It allows routers to share whatever they know about the internet or their neighbourhood. • A Routing Algorithm is that part of network layer software responsible for deciding which output line and incoming packet should be transmitted on.

  3. Routing • Routing requires a host or a router to have a routing table. • Usually when a host has a packet to send or when a router has received a packet to be forwarded, it looks at this table to find the route to the final destination. • However, this simple solution is impossible in today’s Internet world because the number of entries in the routing table makes the table lookups inefficient. • Need to make the size of table manageable and handles issues such security at the same time. The key question is how to design the routing table. • Next-hop routing, Network-specific routing, host specific routing • Static versus Dynamic Routing • Routing Protocols: RIP, OSPF, BGP • Routing Algorithms: DVR, LSR, PVR

  4. Next-hop routing Next-hop routing holds only the information that leads to the next hop instead of complete route.

  5. Host-specific & Network-specific routing The destination host address is given in the routing table; to have greater control over routing. Instead of having an entry for every host connected to the same network, only one entry is needed to defined the address of the network itself. All host connected to the same network as one single entity.

  6. Default routing R1 is used to route packets to hosts connected to N2. However, R2 is used to as default to route other packets to the rest of Internet without listing all the networks involved Only one default routing is allowed with network address 0.0.0.0

  7. General Routing Table Flags U The router is up and running. G The destination is in another network. H Host-specific address. D Added by redirection. M Modified by redirection.

  8. Routing table • Generally, a routing table needs a minimum of 4 columns: mask, destination network address, next hop address and interface. • When a packet arrives, the router applies the mask to the destination address it receives (one-by-one until a match is found) in order to find the corresponding destination network address. • So, the mask serves as essential tool to match destination address in routing table and the address it receives. • If found, the packet is sent out from the corresponding interface in the table. If not found, the packet is delivered to the default interface which carries the packet to default router.

  9. Configuration for routing example MaskDest. Next HopI. 255.0.0.0 111.0.0.0 -- m0 255.255.255.224 193.14.5.160 - m2 255.255.255.224 193.14.5.192 - m1 255.255.255.255 194.17.21.16 111.20.18.14 m0 255.255.255.0 192.16.7.0 111.15.17.32 m0 255.255.255.0 194.17.21.0 111.20.18.14 m0 0.0.0.0 0.0.0.0 111.30.31.18 m0 Standard delivery Host-specific Network-specific Default

  10. Example 1 Router R1 receives 500 packets for destination 192.16.7.14; the algorithm applies the masks row by row to the destination address until a match (with the value in the second column of Dest. in table) is found: Rule of thumb: Apply the individual mask (from Routing table) to the received destination address (row-by-row) and see if its matches any of the DEST address stated in its routing table. If match is found, then stop Solution Direct delivery 192.16.7.14 & 255.0.0.0 192.0.0.0 no match to 111.0.0.0 192.16.7.14 & 255.255.255.224 192.16.7.0no match to 193.14.5.160 192.16.7.14 & 255.255.255.224 192.16.7.0no match to 193.14.5.192 Host-specific 192.16.7.14 & 255.255.255.255192.16.7.14no match to 194.17.21.16 Network-specific 192.16.7.14 & 255.255.255.0192.16.7.0 match to 192.16.7.0

  11. Example 2 Router R1 receives 100 packets for destination 193.14.5.176; the algorithm applies the masks row by row to the destination address until a match is found: Solution Direct delivery 193.14.5.176 & 255.0.0.0 193.0.0.0 no match 193.14.5.176 & 255.255.255.224193.14.5.160 match

  12. Example 3 Router R1 receives 20 packets for destination 200.34.12.34; the algorithm applies the masks row by row to the destination address until a match is found: Solution 200.34.12.34 & 255.0.0.0 200.0.0.0 no match 200.34.12.34 & 255.255.255.224200.34.12.32 no match 200.34.12.34 & 255.255.255.224200.34.12.32 no match 200.34.12.34 & 255.255.255.255200.34.12.34 no match 200.34.12.34 & 255.255.255.0  200.34.12.0 no match 200.34.12.34 & 255.255.255.0 200.34.12.0 no match Default 200.34.12.34 & 0.0.0.0 0.0.0.0. match

  13. Solution MaskDestinationNext HopI. 255.255.0.0 134.18.0.0 -- m0 255.255.0.0 129.8.0.0 222.13.16.40 m1 255.255.255.0 220.3.6.0 222.13.16.40 m1 0.0.0.0 0.0.0.0 134.18.5.2 m0 Example 4 Make the routing table for router R1 in figure below

  14. Subnet maskDestination Next HopI. 255.255.255.0 200.8.4.0 ---- m2 255.255.255.0 80.4.5.0 201.4.10.3 m1 or 200.8.4.12 or m2 255.255.255.0 80.4.6.0 201.4.10.3 m1 or 200.4.8.12 or m2 0.0.0.0 0.0.0.0 m0 Example 5 Make the routing table for router R1 in figure below Solution

  15. Routing Tables in IP with CIDR(Classless InterDomain Routing) For each entry in the routing table: MaskedAddress := EntryMask (bitAND) IPDatagramDestinationAddress; if (MaskedAddress == EntryDestination) Mark the entry; Choose the marked entry with the longest Mask prefix.

  16. m3 Make a routing table for router R1, using the configuration in Figure below Example 7a Solution Routing table for router R1 in Figure above The table is sorted from the longest mask to the shortest mask.

  17. Show the forwarding process if a packet arrives at R1 with the destination address 180.70.65.140. Example 7b Solution The router performs the following steps: 1. The first mask (/26) is applied to the destination address. The result is 180.70.65.128, which does not matchthecorresponding network address. 2. The second mask (/25) is applied to the destination address. The result is 180.70.65.128, which matches the corresponding network address. The next-hop address and the interface number m0 are passed on for further processing.

  18. Show the forwarding process if a packet arrives at R1 with the destination address 201.4.22.35. Example 7c Solution The router performs the following steps: 1. The first mask (/26) is applied to the destination address. The result is 201.4.22.0, which does not match the corresponding network address. 2. The second mask (/25) is applied to the destination address. The result is 201.4.22.0, which does not match the corresponding network address (row 2). 3. The third mask (/24) is applied to the destination address. The result is 201.4.22.0, which matches the corresponding network address..

  19. Show the forwarding process if a packet arrives at R1 with the destination address 18.24.32.78. Example 7d Solution This time all masks are applied, one by one, to the destination address, but no matching network address is found. When it reaches the end of the table, the module gives the default next-hop address 180.70.65.200 (because it could not find the match) . This is probably an outgoing package that needs to be sent, via the default router, to someplace else in the Internet.

  20. Routing/routers • An internet is a combination of networks connected by routers. • When a packet goes from a source to a destination, it will pass through many routers until it reaches the router attached to destination network. • A router consults a routing table when a packet is ready to be forwarded. The routing table specifies the optimum path for the packet and can be either static of dynamic. Dynamic routing is more popular. • Static table does not change frequently. Dynamic table is updated automatically when there is a change somewhere in the network; i.e when a route is down or a better route has been created. • Routing protocolsis a combination of rules/procedures that lets routers in the internet inform one another when changes occur; mostly based on sharing/combining information between routers at different networks.

  21. Routing Protocol: Interior Vs Exterior

  22. Routing Architecture in the Internet Fact: Nobody owns the whole Internet. However, parts of the Internet are owned and administered by commercial and public organisations (such as ISPs, universities, governmental offices, research institutes, companies etc.). • Idea: • Divide the Internet in Autonomous Systems (AS) that are independently administered by individual organisations. • Let each administrative authority use its own routing protocol within the AS. • Let’s use one routing protocol to exchange routing information among AS.

  23. Routing Architecture in the Internet An AS is a group of networks and routers under the authority of a single administrator.

  24. Static versus Dynamic Routing A static routing table contains information entered manually Usually remained unchanged. A dynamic routing table is updated periodically or whenever necessarily using one of the dynamic routing protocols such as RIP, OSPF, or BGP.

  25. Routing Protocols: Interior vs Exterior • Routing inside an AS is referred to as interior routing whereas routing between ASs is referred to as exterior routing. • Each AS can choose one or more interior routing protocols inside an AS. • Only one exterior routing protocol is usually chosen to handle routing between ASs. • To know the next ’path’ (or router) a packet should be pass-on, the decision is based on some optimisation rule/protocol, e.g. using different assignment of the cost (metric) for each passing through a network for different routing Protocol above.

  26. Interior Routing Protocol 1: Routing Information Protocol (RIP)

  27. Distance Vector Routing (DVR) • 3 keys to understand how this algorithm works: • Sharing knowledge about the entire AS. Each router shares whatever it has. • Sharing only with immediate neighbours. • Sharing at regular intervals. e.g. every 30 sec. • Problems: Tedious comparing/updating process, slow response to infinite loop problem, huge list to be maintained!!

  28. Initialization of tables in distance vector routing (DVR)

  29. Updating in distance vector routing example: C to A From A From C A to A via C: ACA = AC+ CA = 2+2 A to B via C: ACB = AC + CB = 2+4 A to D via C: ACD = AC + CD = 2+ inf. A to E via C: ACD = AC + CE = 2+4 A to C via C: ACC = AC + CC = 2+0

  30. Final Distance vector routing tables

  31. Example-1 Distance Vectors below that are received at node-B in a network. Given the estimated distance to its neighbours: node-A, node-D and node-F are 6, 9, and 11 hops, respectively. Find the new distance vector at B. (Note: The new vector must include the next hop and the estimated cost). 31

  32. Choose the minimum value A 6 B 9 D 11 F

  33. A 6 B 9 D 11 F Solution 33

  34. Routing Information Protocol (RIP) • RIP is based on distance vector routing • RIP treats all network equals; the cost of passing thru a network is the same: one hop count per network. • Each router/node maintains a table of minimum number of hop-count. • Path costs are based on number of hops. • In distance vector routing, each router periodically shares its knowledge about the entire internet with its neighbour. • Each router keeps a routing table that has one entry for each destination network of which the router is aware. • The entry consists of Destination Network Address/id, Hop-Count and Next-Router.

  35. Example of Initial routing tables (RIP) in a small autonomous system

  36. Example of Final routing tables

  37. Example of a domain using RIP

  38. Interior Routing Protocol 2: Open Shortest Path First Protocol (OSPF)

  39. Open Shortest Path First (OSPF) • OSPF uses link state routing to update the routing table in an area; (OSPF divides an AS into different areas). • Unlike RIP, OSPF treats the entire network with different philosophy; depending on the types, cost (metric) and condition of each link: to define the ‘state’ of a link. • OSPF allows the administrator to (only) assign a cost for passing through a network based on the type of service required. e.g. minimum delay, maximum throughput. (but not stating exact path) • Each router should have the exact topology of the AS network (a picture of entire AS network)at every moment. The topology is a graph consisting of nodes and edges. • Each router needs to advertise to the neighbourhood of every other routers involved in an Area. (flood)

  40. Open Shortest Path First (OSPF) Areas in an Autonomous System (AS>Areas) OSPF divides an AS into areas. An area is a collection of network, hosts and routers all contained within an AS. Routers inside an area flood the area with routing info. At the border of an Area, special routers called Area Border routers summarize the info. about the area and send it to other area. Among the areas inside an AS is a special area called the Backbone connecting all areas through Backbone routers and serves as a primary area to the outside (other ASs) via the AS Boundary router.

  41. Link State Routing (LSR) • Like RIP, in link state routing, each router also shares its knowledge about its neighbourhood with every routers in the area. • However, in LSR, the link-state packet (LSP) defines the best known network topology (of an area) is sent to every routers (of other area) after it is constructed locally. Whereas RIP slowly converge to final routing list based information received from immediate neighbours. • 3 keys to understand how this algorithm works: • Sharing knowledge about the neighbourhood. Each router sends the state of its neighbourhood to every other router in the area. • Sharing with every other routers. Thru process of flooding. each router sends the state of its neighbourhood thru all its output ports and each neighbour sends to every other neighbours and so on until all routers received same full information eventually. (DO NOT SEND UPDATE FREQUENTLY) • Sharing when there is a change. Each router share its state of its neighbour only when there is a change; contrasting DVR results in lower traffic.

  42. Link State Routing (LSR) • LSR differs from DVR in the following: • Can use different cost/metric instead of just hop-counts • Routing update is only performed when there is a change in topology or after a long period (every 30 minutes) • Each router has an ‘overall map’ or knowledge of the entire network topology within the AS or an area of the AS • Because the network-topology is known in advanced, routers can work out which is the best route to choose between two nodes if there is more than two alternative routes/paths – by shortest path algorithm. • This solve the problem of infinity-loop as all routers will be informed instantly by LSA and paths are recalculated immediately. • From the received LSPs and knowledge of entire topology, a router can then calculate the shortest path between itself and each network. • Usually works better for large networks. 47

  43. In OSPF, all routers have the same Link State database. • Every router in an area receives the router link and network link LSAs and form a link state database. • Every router in the same area has the same link state database. • A link state database is a tabular representation of the topology of the internet inside an area. It shows the relationship between each router and its neighbors including the metrics used. • To calculate its next-route in the routing table, each router applies the Dijkstra algorithm to its state database, to find the shortest path between 2 points on a network, using a graph (nodes and edges). • The algorithm divides the nodes into two sets: tentative and permanent. It chooses nodes, makes them tentative, examines them, and if they pass the criteria, makes permanent.

  44. Shortest Path Search Dijkstra’s Algorithm • 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 neighbour 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 a. Find the node with the smallest cumulative cost and make it permanent. • b. If a node can be reached from more than one direction • i. Select the direction with the shortest cumulative cost. • 6. Repeat steps 3 to 5 until every node becomes permanent.

  45. Dijkstra algorithm

  46. Shortest Path Search The cost can relates to delay Start search and compare with tentative label Mark permanent when shortest node found Once permanent never changed Tentative node can always be search and relabelled Tentative label change The steps used in computing the shortest path from A to D. The arrows indicate the working node – permanent label. The label on each node can be TENTATIVE or PERMANENT

  47. Example of formation of shortest path tree

  48. 8 5 2 2 0 0 5 0 4 4 2 Example of an internet Graphical representation of an internet

  49. 8 5 2 2 0 0 5 0 4 4 2 Shortest path calculation

  50. 8 5 2 2 0 0 5 0 4 4 2 Shortest path calculation 14

More Related