10/8/2015CST 415 - Computer Networks1 IP Routing CST 415.

25
07/04/22 CST 415 - Computer Networks 1 IP Routing CST 415

Transcript of 10/8/2015CST 415 - Computer Networks1 IP Routing CST 415.

Page 1: 10/8/2015CST 415 - Computer Networks1 IP Routing CST 415.

04/21/23 CST 415 - Computer Networks 1

IP Routing

CST 415

Page 2: 10/8/2015CST 415 - Computer Networks1 IP Routing CST 415.

04/21/23 CST 415 - Computer Networks 2

Topics• Problem Definition

• Packet Delivery

• Table Driven Routing

• Next Hop Routing

• Default and Host Specific Routes

• Routing Algorithm

Page 3: 10/8/2015CST 415 - Computer Networks1 IP Routing CST 415.

04/21/23 CST 415 - Computer Networks 3

Question…ARP resolves IP addresses to physical

addresses.

How can a packet be addressed to go to a destination that is not on the same network segment?

How can a packet be addressed to go to a destination that is on a “very distant” network?

Page 4: 10/8/2015CST 415 - Computer Networks1 IP Routing CST 415.

04/21/23 CST 415 - Computer Networks 4

Problem Definition• The Internet is an abstraction away from the

physical network.

• The IP layer sits on top the MAC/Physical layers.

• Packets are routed between IP peers.

• It is these IP peers that make up the Internet.

Page 5: 10/8/2015CST 415 - Computer Networks1 IP Routing CST 415.

04/21/23 CST 415 - Computer Networks 5

Problem Definition• Packets need to be routed from the

originating host to a router (for Internet based delivery).

• The router needs to move the packet across to a separate network, possibly of a different technology and conforming to different policies.

• Networks need to internally route packets using a homogeneous technology.

Page 6: 10/8/2015CST 415 - Computer Networks1 IP Routing CST 415.

04/21/23 CST 415 - Computer Networks 6

Problem Definition – The PlayersFrom host to router:

Typically static route tables. These tables may be updated dynamically via ICMP.

ICMP – Internet Control Messaging Protocol.

ICMP allows routers to talk back to host computers for reporting packet transmission problems.

Page 7: 10/8/2015CST 415 - Computer Networks1 IP Routing CST 415.

04/21/23 CST 415 - Computer Networks 7

Problem Definition – The PlayersFrom “subnet” router to “subnet” router:

Routing tables dynamically updated “at the whim” of the subnet connection controlling router.

EGP – Exterior Gateway ProtocolBGP – Boundary Gateway Protocol.

BGP allows a primary subnet router to negotiate services with other primary subnet routers. BGP allows a router to “hide” the details of it’s network.

When we trace a route to a network, but the host cannot be resolved, it is BGP that is protecting the identity of it’s internal networks and nodes.

Page 8: 10/8/2015CST 415 - Computer Networks1 IP Routing CST 415.

04/21/23 CST 415 - Computer Networks 8

Problem Definition – The PlayersFrom “internal subnet” router to “internal subnet”

router (host computers need not apply):Routing tables dynamically updated based on the routing

protocol supported by the internal network.

IGP – Interior Gateway ProtocolRIP – Routing Information Protocol.OSPF – Open Shortest Path First Protocol.

Internal networks will speak either RIP or OSPF. They will not typically speak both. In either case, routing information is exchanged using these protocols.

Page 9: 10/8/2015CST 415 - Computer Networks1 IP Routing CST 415.

04/21/23 CST 415 - Computer Networks 9

Packet Delivery

Internet Protocol – Defines unreliable, connectionless delivery of packets.– Unreliable – send it and forget it.

– Connectionless – the route of the packet will be defined “on-the-fly” by the network itself (e.g. routers between the source and destination).

Page 10: 10/8/2015CST 415 - Computer Networks1 IP Routing CST 415.

04/21/23 CST 415 - Computer Networks 10

Packet DeliveryThe physical machines that make up the

Internet IP web fall into two categories – Hosts and Routers.

• Hosts and Routers both must be capable of originating an IP packet.

• Routers must implement forwarding algorithms.

• Hosts are not required to forward packets.

Page 11: 10/8/2015CST 415 - Computer Networks1 IP Routing CST 415.

04/21/23 CST 415 - Computer Networks 11

Packet DeliveryTwo types of packet delivery need to be

considered:1. Direct Delivery – The packet is delivered

directly to a peer machine located on the same physical network.

2. Indirect Delivery – The packet is delivered to an intermediary (router).

– The intermediary is responsible for passing the packet along to the packets destination.

– The intermediary will deliver the packet either directly or indirectly.

Page 12: 10/8/2015CST 415 - Computer Networks1 IP Routing CST 415.

04/21/23 CST 415 - Computer Networks 12

Operations involved in IP routing.

Page 13: 10/8/2015CST 415 - Computer Networks1 IP Routing CST 415.

04/21/23 CST 415 - Computer Networks 13

Packet Delivery• The MAC layer will pass the IP packet up to the

IP layer (based on the packet type field in the MAC header.

• The IP layer looks at the IP address and determines the destination of the packet.

– The network address of the IP address is inspected.

– If the network address is the same as the network address of the router, the packet is delivered directly.

– If the network address is different than the address of the router, the packet is delivered indirectly.

Page 14: 10/8/2015CST 415 - Computer Networks1 IP Routing CST 415.

04/21/23 CST 415 - Computer Networks 14

Packet DeliveryQuestion of the day:

How does a router know where to send a packet given any particular IP address?

Page 15: 10/8/2015CST 415 - Computer Networks1 IP Routing CST 415.

04/21/23 CST 415 - Computer Networks 15

Table Driven Routing

• The router contains a table of network address associations (n,r)– n : IP address of the destination network

– r : IP address of the next router

• When a packet arrives at the router, this table is consulted.

• The packet is sent along to the next router based on the table look-up.

Page 16: 10/8/2015CST 415 - Computer Networks1 IP Routing CST 415.

04/21/23 CST 415 - Computer Networks 16

Next Hop Routing

• In the IP routing table, keep the associations of network address and router.

• Only keep router associations for routers that can be reached across a single network connection.

Page 17: 10/8/2015CST 415 - Computer Networks1 IP Routing CST 415.

04/21/23 CST 415 - Computer Networks 17

Page 18: 10/8/2015CST 415 - Computer Networks1 IP Routing CST 415.

04/21/23 CST 415 - Computer Networks 18

Next Hop Routing

• Only the network address is maintained in the routing table.

• All traffic destined for a specific network will take the same path.

• Only the final router along the path can determine if a host actually exist.

• “To” and “From” paths may not be the same.

Page 19: 10/8/2015CST 415 - Computer Networks1 IP Routing CST 415.

04/21/23 CST 415 - Computer Networks 19

Default Routes

• Each network is assigned a default router.

• IP packets destined for networks not in the routing table will be sent to this router.

Page 20: 10/8/2015CST 415 - Computer Networks1 IP Routing CST 415.

04/21/23 CST 415 - Computer Networks 20

Host Specific Routes

• Allow administrative ability to pre-determine a specific route between two host machines.

Page 21: 10/8/2015CST 415 - Computer Networks1 IP Routing CST 415.

04/21/23 CST 415 - Computer Networks 21

Routing Algorithm• The ultimate source and ultimate destination IP

addresses are never altered.• However, the IP layer selects a new IP address for

packet delivery based on the network the packet is ultimately destined for.

• To send the packet along without changing the ultimate addresses in the packet (see IP packet format)– IP sends the packet to the MAC layer along with

the “next hop” destination IP.– The MAC layer forms the physical packet using

the “next hop” IP address to look up the physical address.

Page 22: 10/8/2015CST 415 - Computer Networks1 IP Routing CST 415.

04/21/23 CST 415 - Computer Networks 22

Routing Algorithm

Page 23: 10/8/2015CST 415 - Computer Networks1 IP Routing CST 415.

04/21/23 CST 415 - Computer Networks 23

Routing Algorithm(1) The router receives the IP packet from the Link Layer. (2) The router validates the IP header. Note that IP reassembly is not done, except on IP

fragments to be queued for local delivery in step (4).

(3) The router performs most of the processing of any IP options. Some IP options require additional processing after the routing decision has been made.

(4) The router examines the destination IP address of the IP datagram to determine how it should continue to process the IP datagram. There are three possibilities:

o The IP datagram is destined for the router, and should be queued for local delivery, doing reassembly if needed.

o The IP datagram is not destined for the router, and should be queued for forwarding.

o The IP datagram should be queued for forwarding, but (a copy) must also be queued for local delivery.

Page 24: 10/8/2015CST 415 - Computer Networks1 IP Routing CST 415.

04/21/23 CST 415 - Computer Networks 24

Routing Algorithm(5) The forwarder determines the next hop IP address for the packet, usually by

looking up the packet's destination in the router's routing table. This procedure also decides which network interface should be used to send the packet.

(6) The forwarder verifies that forwarding the packet is permitted. The source and destination addresses should be valid. If the router supports administrative constraints on forwarding, those constraints must be satisfied.

(7) The forwarder decrements (by at least one) and checks the packet's TTL.

(8) The forwarder performs any IP option processing that could not be completed in step 3.

(9) The forwarder performs any necessary IP fragmentation. Since this step occurs after outbound interface selection (step 5), all fragments of the same datagram will be transmitted out the same interface.

Page 25: 10/8/2015CST 415 - Computer Networks1 IP Routing CST 415.

04/21/23 CST 415 - Computer Networks 25

Routing Algorithm

(10) The forwarder determines the Link Layer address of the packet's next hop. The mechanisms for doing this are Link Layer- dependent.

(11) The forwarder encapsulates the IP datagram (or each of the fragments thereof) in an appropriate Link Layer frame and queues it for output on the interface selected in step 5.

(12) The forwarder sends an ICMP redirect if necessary.