Chapter 6 Delivery Forwarding and Routing of IP

  • Slides: 57
Download presentation
Chapter 6 Delivery Forwarding, and Routing of IP Packets Kyung Hee University 1

Chapter 6 Delivery Forwarding, and Routing of IP Packets Kyung Hee University 1

Introduction q Delivery Meaning the physical forwarding of the packets Connectionless and connection-oriented services

Introduction q Delivery Meaning the physical forwarding of the packets Connectionless and connection-oriented services Direct and indirect delivery q. Routing Related to finding the route (next hop) for a datagram Kyung Hee University 2

6. 1 Delivery q. Connection Types Connection-oriented service l l Using same path The

6. 1 Delivery q. Connection Types Connection-oriented service l l Using same path The decision about the route of a sequence of packets with the same source and destination addresses can be made only once, when the connection is established Connectionless service l Dealing with each packet independently l Packets may not travel the same path to their destination q. IP is : Connectionless protocol Kyung Hee University 3

Direct versus Indirect Delivery q. Two methods delivering a packet to its final destination

Direct versus Indirect Delivery q. Two methods delivering a packet to its final destination Direct Indirect q. Direct delivery The final destination of the packet is a host to the same physical network as the deliverer or the delivery is between the last router and the destination host Decision making whether delivery is direct or not l l Kyung Hee University Extracting the network address of the destination packet (setting the hostid part to all 0 s) Then, comparing the addresses of the network to which it is connected 4

Direct versus Indirect Delivery (cont’d) q. Direct delivery Kyung Hee University 5

Direct versus Indirect Delivery (cont’d) q. Direct delivery Kyung Hee University 5

Direct versus Indirect Delivery (cont’d) q. Indirect delivery The destination host is not on

Direct versus Indirect Delivery (cont’d) q. Indirect delivery The destination host is not on the same network as the deliverer The packet goes from router to router until finding the final destination Using ARP to find the next physical address l Kyung Hee University Mapping between the IP address of next router and the physical address of the next router 6

Direct versus Indirect Delivery (cont’d) q. Indirect delivery Kyung Hee University 7

Direct versus Indirect Delivery (cont’d) q. Indirect delivery Kyung Hee University 7

6. 3 Forwarding q Forwarding means to place the packet in its route to

6. 3 Forwarding q Forwarding means to place the packet in its route to its destination. So, it requires a host or a router a routing table. q. Routing table Used to find the route to the final destination Kyung Hee University 8

Forwarding Techniques q. Next-hop Method A technique to reduce the contents of a routing

Forwarding Techniques q. Next-hop Method A technique to reduce the contents of a routing table The routing table holds only the address of the next hop instead of holding information about the complete route The entries of a routing table must be consistent with each other Kyung Hee University 9

Forwarding Techniques (cont’d) Kyung Hee University 10

Forwarding Techniques (cont’d) Kyung Hee University 10

Forwarding Techniques (cont’d) q Network-Specific Method Having only one entry to define the address

Forwarding Techniques (cont’d) q Network-Specific Method Having only one entry to define the address of network itself Kyung Hee University 11

Forwarding Techniques (cont’d) q. Host-Specific Method Destination host addresses is given in the routing

Forwarding Techniques (cont’d) q. Host-Specific Method Destination host addresses is given in the routing table The efficiency is sacrificed for the advantages : l Giving to administrator more control over routing Ex) if the administrator wants all packets arriving for host B delivered to router R 3 instead of R 1, one single entry in the routing table of host A can explicitly define the route Kyung Hee University 12

Routing methods (cont’d) Kyung Hee University 13

Routing methods (cont’d) Kyung Hee University 13

Routing methods (cont’d) q Default Method Instead of listing all networks in the entire

Routing methods (cont’d) q Default Method Instead of listing all networks in the entire Internet, host A can just have one entry called the default (network address 0. 0) Kyung Hee University 14

Forwarding with Classful Addressing q Forwarding without Subnetting Kyung Hee University 15

Forwarding with Classful Addressing q Forwarding without Subnetting Kyung Hee University 15

Example 1 q Figure 6. 8 shows an imaginary part of the Internet. Show

Example 1 q Figure 6. 8 shows an imaginary part of the Internet. Show the routing tables for router R 1. Kyung Hee University 16

Example 1 - Solution Kyung Hee University 17

Example 1 - Solution Kyung Hee University 17

Example 2 q. Router R 1 in Figure 6. 8 receives a packet with

Example 2 q. Router R 1 in Figure 6. 8 receives a packet with destination address 192. 16. 7. 14. Show the packet is forwarded. q. Solution Kyung Hee University 18

Example 2 - Solution q. The destination address in binary is 11000000 000100000111 00001110.

Example 2 - Solution q. The destination address in binary is 11000000 000100000111 00001110. A copy of the address is shifted 28 bits to the right. The result is 00000000 00001100 or 12. The destination network is class C. The network address is extracted by masking off the leftmost 24 bits of the destination address; the result is 192. 16. 7. 0. The table for Class C is searched. The network address is found in the first row. The nexthop address 111. 15. 17. 32. and the interface m 0 are passed to ARP. Kyung Hee University 19

Example 3 q. Router R 1 in Figure 6. 8 receives a packet with

Example 3 q. Router R 1 in Figure 6. 8 receives a packet with destination address 167. 24. 160. 5. Show the packet is forwarded q Solution The destination address in binary is 10100111 00011000 10100000101. A copy of the address is shifted 28 bits to the right. The result is 00000000 00001010 or 10. The class is B. The network address can be found by masking off 16 bits of the destination address, the result is 167. 24. 0. 0. The table for Class B is searched. No matching network address is found. The packet needs to be forwarded to the default router (the network is somewhere else in the Internet). The next-hop address 111. 30. 31. 18 and the interface number m 0 are passed to ARP. Kyung Hee University 20

Forwarding with Subnetting Kyung Hee University 21

Forwarding with Subnetting Kyung Hee University 21

Example 4 q Figure 6. 11 shows a router connected to four subnets. Kyung

Example 4 q Figure 6. 11 shows a router connected to four subnets. Kyung Hee University 22

Example 5 q. The router in Figure 6. 11 receives a packet with destination

Example 5 q. The router in Figure 6. 11 receives a packet with destination address 145. 14. 32. 78. Show the packet is forwarded. q Solution The mask is /18. After applying the mask, the subnet address is 145. 14. 0. 0. The packet is delivered to ARP with the next-hop address 145. 14. 32. 78 and the outgoing interface m 0. Kyung Hee University 23

Example 6 q A host in network 145. 14. 0. 0 in Figure 6.

Example 6 q A host in network 145. 14. 0. 0 in Figure 6. 11 has a packet to send to the host with address 7. 22. 67. 91. Show the packet is routed. q Solution The router receives the packet and applies the mask (/18). The network address is 7. 22. 64. 0. The table is searched and the address is not found. The router uses the address of the default router (not shown in figure) and sends the packet to that router. Kyung Hee University 24

Forwarding with Classless Addressing q In classful addressing we can have a routing table

Forwarding with Classless Addressing q In classful addressing we can have a routing table with three columns; in classless addressing, we need at least four columns. Figure 6. 12 Kyung Hee University Simplified forwarding module in classless address 25

Example 7 q Make a routing table for router R 1 using the configuration

Example 7 q Make a routing table for router R 1 using the configuration in Figure 6. 13. Kyung Hee University 26

Example 7 - Solution q Solution Table 6. 1 shows the corresponding table Table

Example 7 - Solution q Solution Table 6. 1 shows the corresponding table Table 6. 1 Routing table for router R 1 in Figure 6. 13 Kyung Hee University 27

Example 8 q Show the forwarding process if a packet arrives at R 1

Example 8 q Show the forwarding process if a packet arrives at R 1 in Figure 6. 13 with the destination address 180. 70. 65. 140. Kyung Hee University 28

Example 8 - Solution q Solution The router performs the following steps: 1. The

Example 8 - Solution q 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 match the corresponding 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 (the destination address of the packet in this case) and the interface number m 0 are passed to ARP for further processing. Kyung Hee University 29

Example 9 q Show the forwarding process if a packet arrives at R 1

Example 9 q Show the forwarding process if a packet arrives at R 1 in Figure 6. 13 with the destination address 201. 4. 22. 35. Kyung Hee University 30

Example 9 - Solution q Solution The router performs the following steps: 1. The

Example 9 - Solution q 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 (row 1). 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. The destination address of the package and the interface number m 3 are passed to ARP. Kyung Hee University 31

Example 10 q Show the forwarding process if a packet arrives at R 1

Example 10 q Show the forwarding process if a packet arrives at R 1 in Figure 6. 13 with the destination address 18. 24. 32. 78. q Solution This time all masks are applied to the destination address, but no matching network address is found. When it reaches the end of the table, the module gives the next-hop address 180. 70. 65. 200 and interface number m 2 to ARP. This is probably an outgoing package that needs to be sent, via the default router, to some place else in the Internet. Kyung Hee University 32

Example 11 q Now let us give a different type of example. Can we

Example 11 q Now let us give a different type of example. Can we find the configuration of a router, if we know only its routing table? The routing table for router R 1 is given in Table 6. 2. Can we draw its topology? q Table 6. 2 Routing table for Example 11 Kyung Hee University 33

Example 11 - Solution Kyung Hee University 34

Example 11 - Solution Kyung Hee University 34

Address Aggregation q Figure 6. 15 Kyung Hee University Address aggregation 35

Address Aggregation q Figure 6. 15 Kyung Hee University Address aggregation 35

Longest Mask Matching q The routing table is sorted from the longest mask to

Longest Mask Matching q The routing table is sorted from the longest mask to the shortest mask. Kyung Hee University 36

Hierarchical Routing q To solve the problem of gigantic routing tables, creating a sense

Hierarchical Routing q To solve the problem of gigantic routing tables, creating a sense of the routing tables q Routing table can decrease in size Kyung Hee University 37

Example 12 As an example of hierarchical routing, let us consider Figure 6. 17.

Example 12 As an example of hierarchical routing, let us consider Figure 6. 17. A regional ISP is granted 16, 384 addresses starting from 120. 14. 64. 0. The regional ISP has decided to divide this block into four subblocks, each with 4096 addresses. Three of these subblocks are assigned to three local ISPs, the second subblock is reserved for future use. Note that the mask for each block is /20 because the original block with mask /18 is divided into 4 blocks. Kyung Hee University 38

Example 12 Kyung Hee University 39

Example 12 Kyung Hee University 39

6. 3 Routing - Static versus Dynamic Routing q. Static routing table Containing information

6. 3 Routing - Static versus Dynamic Routing q. Static routing table Containing information entered manually Cannot update automatically when there is a change in the internet Used in small internet that does not change very much, or in an experimental internet for troubleshooting q. Dynamic routing table is updated periodically using one of the dynamic routing protocols such RIP, OSPF, or BGP (see Chap. 14) Updating the routing table corresponding to shutdown of a router or breaking of a link Kyung Hee University 40

Routing Module Kyung Hee University 41

Routing Module Kyung Hee University 41

Routing Table q. Routing table In classless addressing, routing table has a minimum of

Routing Table q. Routing table In classless addressing, routing table has a minimum of four columns. - Some routers have even more columns Flags U (up) : The router is up and running. G (gateway) : The destination is in another network. H : Host-specific address. D : Added by redirection. M : Modified by redirection. Kyung Hee University 42

Routing Table (cont’d) Flags l l l U (Up) : indicating the router’s running

Routing Table (cont’d) Flags l l l U (Up) : indicating the router’s running G (Gateway) : meaning that the destination is another network H (Host-specific) : indicating that the entry in the destination is a host-specific address D (Added by redirection) : indicating that routing information for this destination has been added to the host routing table by a redirection message from ICMP M (Modified by redirection) : indicating that routing information for this destination has been modified by a redirection message from ICMP Reference count : giving the number of users that are using this route at any moment Use : showing the number of packets transmitted through this router for the corresponding destination Interface : showing the name of the interface Kyung Hee University 43

Example 13 q. One utility that can be used to find the contents of

Example 13 q. One utility that can be used to find the contents of a routing table for a host or router is netstat in UNIX or LINUX. The following shows the listing of the contents of the default server. We have used two options, r and n. The option r indicates that we are interested in the routing table and the option n indicates that we are looking for numeric addresses. Note that this is a routing table for a host, not a router. Although we discussed the routing table for a router throughout the chapter, a host also needs a routing table. Kyung Hee University 44

Example 13 (cont’d) $ netstat -rn Kernel IP routing table Destination Gateway 153. 18.

Example 13 (cont’d) $ netstat -rn Kernel IP routing table Destination Gateway 153. 18. 16. 0 0. 0 127. 0. 0. 0 153. 18. 31. Mask Flags Iface 255. 240. 0 U eth 0 255. 0. 0. 0 U lo 254 0. 0 UG eth 0. Loopback interface Kyung Hee University 45

Example 13 (cont’d) More information about the IP address and physical address of the

Example 13 (cont’d) More information about the IP address and physical address of the server can be found using the ifconfig command on the given interface (eth 0). $ ifconfig eth 0 Link encap: Ethernet HWaddr 00: B 0: DF: 09: 5 D inet addr: 153. 18. 17. 11 Mask: 255. 240. 0 Bcast: 153. 18. 31. 255 . . From the above information, we can deduce the configuration of the server as shown in Figure 6. 19. Kyung Hee University 46

Example 13 (cont’d) Ifconfig command gives us the IP address and the physical address

Example 13 (cont’d) Ifconfig command gives us the IP address and the physical address (hardware) address of the interface Kyung Hee University 47

6. 4 Structure of a Router Kyung Hee University 48

6. 4 Structure of a Router Kyung Hee University 48

Components q Input port q Output port Kyung Hee University 49

Components q Input port q Output port Kyung Hee University 49

Components (cont’d) q Routing Processor performing the functions of the network layer destination address

Components (cont’d) q Routing Processor performing the functions of the network layer destination address is used to find the address of the next hop and output port number : table lookup Kyung Hee University 50

Switching fabrics q Crossbar switch Kyung Hee University 51

Switching fabrics q Crossbar switch Kyung Hee University 51

Switching Fabrics q Banyan switch q log 2 (n) stages with n/2 microswitches Kyung

Switching Fabrics q Banyan switch q log 2 (n) stages with n/2 microswitches Kyung Hee University 52

Switching Fabrics (cont’d) q Examples of routing in a banyan switch Kyung Hee University

Switching Fabrics (cont’d) q Examples of routing in a banyan switch Kyung Hee University 53

Switching Fabrics (cont’d) q Possibility of internal collision even when two packets are not

Switching Fabrics (cont’d) q Possibility of internal collision even when two packets are not heading for the same output port in banyan switch solving the problem by sorting the arriving packets based on their destination port Trap module: preventing duplicate packets (packets with the same output destination) from passing to the banyan switch simultaneously Kyung Hee University 54

Switching Fabrics (cont’d) q Batcher-banyan switch Kyung Hee University 55

Switching Fabrics (cont’d) q Batcher-banyan switch Kyung Hee University 55

Summary(1) q In a connection-oriented service, the local network layer protocol first makes a

Summary(1) q In a connection-oriented service, the local network layer protocol first makes a connection with the network layer protocol at the remote site before sending a packet. q In a connectionless service, the network layer protocol treats each packet independently, with each packet having no relationship to any other packet. The packets in a message may or may not travel the same path to their destination. The IP protocol is a connectionless protocol. q The delivery of a packet is called direct if the deliverer(host or router) and the destination are on the same network. q The delivery of a packet is called indirect if the deliverer(host or router) and the destination are on different networks. q In the next-hop method, instead of a complete list of the stops the packet must make, only the address of the next hop is listed in the routing table. q In the network-specific method, all hosts on a network share one entry in the routing table. q In the host-specific method, the full IP address of a host is given in the routing table. Kyung Hee University 56

Summary(2) q In the default method, a router is assigned to receive all packets

Summary(2) q In the default method, a router is assigned to receive all packets with no match in the routing table. q The routing table for classful forwarding can have three columns. q The routing table for classless addressing needs at least four columns. q The number of columns in a routing table is vendor dependent. q Address aggregation simplifies the forwarding process in classless addressing. q Longest mask matching is required in classless addressing. q Classless addressing requires hierarchical and geographical routing to prevent immense routing tables. q Search algorithms for classful addressing are not efficient for classless addressing. q A static routing table's entries are updated manually by an administrator. q A dynamic routing table's entries are updated automatically by a routing protocol. q A router is normally made of four components: input ports, output ports, the routing processor, and the switching fabric. Kyung Hee University 57