Internet Protocol Routing IP Datagrams D E Comer

  • Slides: 18
Download presentation
Internet Protocol: Routing IP Datagrams D. E. Comer, “Internetworking with TCP/IP: Principles, Protocols and

Internet Protocol: Routing IP Datagrams D. E. Comer, “Internetworking with TCP/IP: Principles, Protocols and Architectures”, Ch. 8, Prentice Hall, 2000 presented by Roozbeh Farahbod rfarahbo@sfu. ca 1

Routing n n n Routing: The process of choosing a path over which to

Routing n n n Routing: The process of choosing a path over which to send packets. Router: A computer – in general – making this choice. Routing occurs at several levels: ¨ From node to node in a simple LAN ¨ From LAN to LAN in a WAN Routing IP Datagrams – by Roozbeh Farahbod, rfarahbo@sfu. ca 2

Internet, Router, Host n n n Internet is composed of multiple physical networks interconnected

Internet, Router, Host n n n Internet is composed of multiple physical networks interconnected by computers called routers. Routers have direct connections to two or more networks. A Host usually connects directly to one physical network. Routing IP Datagrams – by Roozbeh Farahbod, rfarahbo@sfu. ca 3

Direct / Indirect Delivery n Routing can be divided in to two forms: ¨

Direct / Indirect Delivery n Routing can be divided in to two forms: ¨ Direct n Delivery When two machines are both attached to the same underlying physical transmission system (i. e. a single Ethernet) ¨ Indirect n Delivery When two machines are not directly attached to the same network and packets must go through at least one router for delivery. Routing IP Datagrams – by Roozbeh Farahbod, rfarahbo@sfu. ca 4

Direct Delivery n Delivery from A to C: ¨A encapsulates the datagram in a

Direct Delivery n Delivery from A to C: ¨A encapsulates the datagram in a physical frame ¨ Maps the destination IP address to a physical address (MAC address) ¨ Uses the network hardware to deliver it n How does A know whether C is in the same network? Routing IP Datagrams – by Roozbeh Farahbod, rfarahbo@sfu. ca 5

Network Prefix n n IP addresses are divided into a Network Prefix and a

Network Prefix n n IP addresses are divided into a Network Prefix and a Host Suffix By checking the network prefix of the destination IP address, sender will know if it is directly connected to the destination machine or not. Routing IP Datagrams – by Roozbeh Farahbod, rfarahbo@sfu. ca 6

Indirect Delivery n B wants to deliver a datagram to D ¨B checks the

Indirect Delivery n B wants to deliver a datagram to D ¨B checks the network prefix and realizes that D is outside of L 1. ¨ In an internet, every host can reach a router directly. ¨ B sends the packet to R 1 directly and lets R 1 handle the delivery. Routing IP Datagrams – by Roozbeh Farahbod, rfarahbo@sfu. ca 7

Table-Driven Routing n n n How does B decide to send the datagram to

Table-Driven Routing n n n How does B decide to send the datagram to R 1 and not to R 2? How does R 1 know where to send the datagram? The usual IP routing algorithm employs an Internet Routing Table or IP Routing Table. Both hosts and routers have IP routing tables, based on the destination address, tell the router where to send a datagram. Routing IP Datagrams – by Roozbeh Farahbod, rfarahbo@sfu. ca 8

Information Hiding n Do we need to keep the list of all possible destination

Information Hiding n Do we need to keep the list of all possible destination addresses? n Taking the advantage of Network Prefix n A routing table keeps a set of pairs (Network, Path) Routing IP Datagrams – by Roozbeh Farahbod, rfarahbo@sfu. ca 9

Next-Hop n Do we need to keep the whole path to a destination address?

Next-Hop n Do we need to keep the whole path to a destination address? n Every router only needs to know what is the next router in the path. n This next router is called the next hop. Routing IP Datagrams – by Roozbeh Farahbod, rfarahbo@sfu. ca 10

Next-Hop Routing n Each router in a routing table can be reached via a

Next-Hop Routing n Each router in a routing table can be reached via a direct connection. Routing IP Datagrams – by Roozbeh Farahbod, rfarahbo@sfu. ca 11

Default Routes n Another technique used to hide information: ¨ n If the destination

Default Routes n Another technique used to hide information: ¨ n If the destination network was not in the routing table, use the default route Example: ¨ For hosts like H that attach to a single network, only one row in the routing table required Routing Table for host H To Network Route To 40. 0 Direct Delivery Default Routing IP Datagrams – by Roozbeh Farahbod, rfarahbo@sfu. ca S 12

The IP Routing Route. Datagram(Datagram, Routing. Table) n n n Extract destination IP address

The IP Routing Route. Datagram(Datagram, Routing. Table) n n n Extract destination IP address in D Extract the network prefix in N if N matches any directly connected network ¨ n else if the table contains a host-specific route for D ¨ n send datagram to the next-hop specified in the table else if the table contains a default route ¨ n send datagram to the next-hop specified in the table else if the table contains a route for network N ¨ n deliver datagram directly to destination D over that network send datagram to the default router specified else ¨ declare a routing error! Routing IP Datagrams – by Roozbeh Farahbod, rfarahbo@sfu. ca 13

Routing with IP address n IP routing does not alter the original datagram except

Routing with IP address n IP routing does not alter the original datagram except for: ¨ ¨ Decrementing the Time-To-Live Re-computing the checksum n When IP executes the routing, it selects the next-hop IP address and forwards the datagram to that using the network interface layer. n The network layer then binds the IP address to a physical address and sends the datagram to its destination in form of frames. Internet Layer Datagram + The next-hop IP address Network Layer Routing IP Datagrams – by Roozbeh Farahbod, rfarahbo@sfu. ca 14

Why IP Address? n n Converting IP addresses every time routing occurs? Inefficient! Why

Why IP Address? n n Converting IP addresses every time routing occurs? Inefficient! Why not using physical addresses in routing tables? Routing table provides a clean interface between IP software that routes and high-level software that manipulates routes. ¨ The whole point of IP is to hide the details of the underlying network. ¨ Routing IP Datagrams – by Roozbeh Farahbod, rfarahbo@sfu. ca 15

Incoming Datagrams n When a router receives a datagram: If the destination IP is

Incoming Datagrams n When a router receives a datagram: If the destination IP is the router’s IP (for each of its network connections), it passes the datagram to higher levels. ¨ Otherwise, it routes the datagram. ¨ n n Hosts are forbidden from forwarding datagrams that are accidentaly routed to them. Reasons: ¨ ¨ Something has gone wrong! It will cause unnecessary network traffic Simple errors can cause chaos. Routers report errors, while hosts not! Routing IP Datagrams – by Roozbeh Farahbod, rfarahbo@sfu. ca 16

Summary n IP uses routing information to route datagrams. n Direct delivery is considered

Summary n IP uses routing information to route datagrams. n Direct delivery is considered as the final step in routing. n The result of routing is the IP address of the next hop. n Physical address and physical frame vs. IP address and IP datagram n IP routing algorithm is table-driven and in most cases based on the network addresses. n Using a default route keeps the routing tables small. Routing IP Datagrams – by Roozbeh Farahbod, rfarahbo@sfu. ca 17

Presented for Engineering Communication Systems a course by Dr. Uwe Glaesser School of Computing

Presented for Engineering Communication Systems a course by Dr. Uwe Glaesser School of Computing Science Simon Fraser University October 2002 Routing IP Datagrams – by Roozbeh Farahbod, rfarahbo@sfu. ca 18