18
1 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 [email protected]

1 Internet Protocol: Routing IP Datagrams D. E. Comer, “Internetworking with TCP/IP: Principles, Protocols and Architectures”, Ch. 8, Prentice Hall, 2000

Embed Size (px)

Citation preview

Page 1: 1 Internet Protocol: Routing IP Datagrams D. E. Comer, “Internetworking with TCP/IP: Principles, Protocols and Architectures”, Ch. 8, Prentice Hall, 2000

1

Internet Protocol:

Routing IP Datagrams

D. E. Comer, “Internetworking with TCP/IP: Principles, Protocols and Architectures”, Ch. 8, Prentice Hall, 2000

presented by Roozbeh [email protected]

Page 2: 1 Internet Protocol: Routing IP Datagrams D. E. Comer, “Internetworking with TCP/IP: Principles, Protocols and Architectures”, Ch. 8, Prentice Hall, 2000

2Routing IP Datagrams – by Roozbeh Farahbod, [email protected]

Routing

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

Page 3: 1 Internet Protocol: Routing IP Datagrams D. E. Comer, “Internetworking with TCP/IP: Principles, Protocols and Architectures”, Ch. 8, Prentice Hall, 2000

3Routing IP Datagrams – by Roozbeh Farahbod, [email protected]

Internet, Router, Host

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.

Page 4: 1 Internet Protocol: Routing IP Datagrams D. E. Comer, “Internetworking with TCP/IP: Principles, Protocols and Architectures”, Ch. 8, Prentice Hall, 2000

4Routing IP Datagrams – by Roozbeh Farahbod, [email protected]

Direct / Indirect Delivery

Routing can be divided in to two forms:

Direct Delivery When two machines are both attached to the same

underlying physical transmission system (i.e. a single Ethernet)

Indirect Delivery When two machines are not directly attached to the same

network and packets must go through at least one router for delivery.

Page 5: 1 Internet Protocol: Routing IP Datagrams D. E. Comer, “Internetworking with TCP/IP: Principles, Protocols and Architectures”, Ch. 8, Prentice Hall, 2000

5Routing IP Datagrams – by Roozbeh Farahbod, [email protected]

Direct Delivery

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

How does A know whether C is in the same network?

Page 6: 1 Internet Protocol: Routing IP Datagrams D. E. Comer, “Internetworking with TCP/IP: Principles, Protocols and Architectures”, Ch. 8, Prentice Hall, 2000

6Routing IP Datagrams – by Roozbeh Farahbod, [email protected]

Network Prefix

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.

Page 7: 1 Internet Protocol: Routing IP Datagrams D. E. Comer, “Internetworking with TCP/IP: Principles, Protocols and Architectures”, Ch. 8, Prentice Hall, 2000

7Routing IP Datagrams – by Roozbeh Farahbod, [email protected]

Indirect Delivery

B wants to deliver a datagram to D B checks the network prefix and

realizes that D is outside of L1. In an internet, every host can

reach a router directly. B sends the packet to R1

directly and lets R1 handle the delivery.

Page 8: 1 Internet Protocol: Routing IP Datagrams D. E. Comer, “Internetworking with TCP/IP: Principles, Protocols and Architectures”, Ch. 8, Prentice Hall, 2000

8Routing IP Datagrams – by Roozbeh Farahbod, [email protected]

Table-Driven Routing

How does B decide to send the datagram to R1 and not to R2?

How does R1 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.

IP routing tables, based on the destination address, tell the router where to send a datagram.

Page 9: 1 Internet Protocol: Routing IP Datagrams D. E. Comer, “Internetworking with TCP/IP: Principles, Protocols and Architectures”, Ch. 8, Prentice Hall, 2000

9Routing IP Datagrams – by Roozbeh Farahbod, [email protected]

Information Hiding

Do we need to keep the list of all possible destination addresses?

Taking the advantage of Network Prefix

A routing table keeps a set of pairs (Network, Path)

Page 10: 1 Internet Protocol: Routing IP Datagrams D. E. Comer, “Internetworking with TCP/IP: Principles, Protocols and Architectures”, Ch. 8, Prentice Hall, 2000

10Routing IP Datagrams – by Roozbeh Farahbod, [email protected]

Next-Hop

Do we need to keep the whole path to a destination address?

Every router only needs to know what is the next router in the path.

This next router is called the next hop.

Page 11: 1 Internet Protocol: Routing IP Datagrams D. E. Comer, “Internetworking with TCP/IP: Principles, Protocols and Architectures”, Ch. 8, Prentice Hall, 2000

11Routing IP Datagrams – by Roozbeh Farahbod, [email protected]

Next-Hop Routing

Each router in a routing table can be reached via a direct connection.

Page 12: 1 Internet Protocol: Routing IP Datagrams D. E. Comer, “Internetworking with TCP/IP: Principles, Protocols and Architectures”, Ch. 8, Prentice Hall, 2000

12Routing IP Datagrams – by Roozbeh Farahbod, [email protected]

Default Routes

Another technique used to hide information: 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

To Network Route To

40.0.0.0 Direct Delivery

Default Routing S

Routing Table for host H

Page 13: 1 Internet Protocol: Routing IP Datagrams D. E. Comer, “Internetworking with TCP/IP: Principles, Protocols and Architectures”, Ch. 8, Prentice Hall, 2000

13Routing IP Datagrams – by Roozbeh Farahbod, [email protected]

The IP Routing

RouteDatagram(Datagram, RoutingTable)

Extract destination IP address in D Extract the network prefix in N if N matches any directly connected network

deliver datagram directly to destination D over that network else if the table contains a host-specific route for D

send datagram to the next-hop specified in the table else if the table contains a route for network N

send datagram to the next-hop specified in the table else if the table contains a default route

send datagram to the default router specified else

declare a routing error!

Page 14: 1 Internet Protocol: Routing IP Datagrams D. E. Comer, “Internetworking with TCP/IP: Principles, Protocols and Architectures”, Ch. 8, Prentice Hall, 2000

14Routing IP Datagrams – by Roozbeh Farahbod, [email protected]

Routing with IP address

IP routing does not alter the original datagram except for: Decrementing the Time-To-Live Re-computing the checksum

When IP executes the routing, it selects the next-hop IP address and forwards the datagram to that using the network interface layer.

The network layer then binds the IP address to a physical addressand sends the datagram to its destination in form of frames.

Internet Layer

Network Layer

Datagram + The next-hop IP address

Page 15: 1 Internet Protocol: Routing IP Datagrams D. E. Comer, “Internetworking with TCP/IP: Principles, Protocols and Architectures”, Ch. 8, Prentice Hall, 2000

15Routing IP Datagrams – by Roozbeh Farahbod, [email protected]

Why IP Address?

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.

Page 16: 1 Internet Protocol: Routing IP Datagrams D. E. Comer, “Internetworking with TCP/IP: Principles, Protocols and Architectures”, Ch. 8, Prentice Hall, 2000

16Routing IP Datagrams – by Roozbeh Farahbod, [email protected]

Incoming Datagrams

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.

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!

Page 17: 1 Internet Protocol: Routing IP Datagrams D. E. Comer, “Internetworking with TCP/IP: Principles, Protocols and Architectures”, Ch. 8, Prentice Hall, 2000

17Routing IP Datagrams – by Roozbeh Farahbod, [email protected]

Summary

IP uses routing information to route datagrams.

Direct delivery is considered as the final step in routing.

The result of routing is the IP address of the next hop.

Physical address and physical frame vs. IP address and IP datagram

IP routing algorithm is table-driven and in most cases based on the network addresses.

Using a default route keeps the routing tables small.

Page 18: 1 Internet Protocol: Routing IP Datagrams D. E. Comer, “Internetworking with TCP/IP: Principles, Protocols and Architectures”, Ch. 8, Prentice Hall, 2000

18Routing IP Datagrams – by Roozbeh Farahbod, [email protected]

Presented for

Engineering Communication Systemsa course by

Dr. Uwe Glaesser

School of Computing ScienceSimon Fraser University

October 2002