+ All Categories
Home > Documents > IP Routing

IP Routing

Date post: 05-Jan-2016
Category:
Upload: misha
View: 55 times
Download: 0 times
Share this document with a friend
Description:
IP Routing. Routing - the process of choosing a path over which to send packets Router - a computer that performs routing Routing is one of the Internet Protocol’s primary functions. IP Routing. Criteria that could (ideally) be used to make routing decisions: Network characteristics - PowerPoint PPT Presentation
36
IP Routing • Routing - the process of choosing a path over which to send packets • Router - a computer that performs routing • Routing is one of the Internet Protocol’s primary functions
Transcript
Page 1: IP Routing

IP Routing

• Routing - the process of choosing a path over which to send packets

• Router - a computer that performs routing

• Routing is one of the Internet Protocol’s primary functions

Page 2: IP Routing

IP Routing

• Criteria that could (ideally) be used to make routing decisions:– Network characteristics– Network topology– Network load– Datagram length– Type of service requested in the datagram’s header

• IP routing software:– Normally does not consider most of these factors– Makes decisions based on fixed assumptions about

shortest paths

Page 3: IP Routing

Review: Internet Architecture

R2

R4 R5

Host

R1

R3

Net 1 Net 2

Page 4: IP Routing

Hosts vs. Routers

• Hosts make routing decisions

• Hosts don’t typically transfer packets from one network to another

• Routers make routing decisions

• Routers typically transfer packets from one network to another

Page 5: IP Routing

Direct vs. Indirect Delivery

• Direct delivery - transmit datagram across a single physical network to the destination

• Indirect delivery - transmit datagram across multiple physical networks (with the aid of routers) to the destination

• How does a machine know which method of delivery to use?

Page 6: IP Routing

Direct Delivery

• Map the destination IP address to a physical address

• Encapsulate the datagram in a physical frame

• Send the frame over the physical network to the destination

Page 7: IP Routing

Indirect Delivery

• Encapsulate the datagram in a frame

• Choose a router on the physical network

• Send the frame to that router

• Router forwards the datagram on towards its final destination

– How does the host choose a router?– How does the router forward the datagram?

Page 8: IP Routing

The IP Routing Table

• Routing table - each machine stores information about destination networks and how to reach them

• Using only netid portion of the IP address keeps routing tables:– Small– Relatively stable

Page 9: IP Routing

Next-Hop Routing

Page 10: IP Routing

Next-Hop Routing (cont)

• Routing table at machine M contains pairs (N,R)– N is the IP address of a destination network– R is the IP address of the “next” router (R and

M must share a physical network)

• Routing table size:– Depends on the number of networks in the internet

– Only grows when new networks are added

Page 11: IP Routing

Properties of Next-Hop Routes

• All traffic destined for a given network takes the same path

• Only the final router can determine whether a host exists or is operational

• Routes are not necessarily symmetric

Page 12: IP Routing

Default Routes

• No route in the routing table = datagrams sent to the default router

• Both simplifies routing tables and reduces their size:

20.0.0.0 40.0.0.530.0.0.0 40.0.0.510.0.0.0 40.0.0.550.0.0.0 60.0.0.7

50.0.0.0 60.0.0.7default 40.0.0.5

Page 13: IP Routing

Host-Specific Routes

• Routing tables are allowed to include per-host routes as a special case:

50.0.0.0 60.0.0.2 30.0.0.8 20.0.0.5 30.0.0.0 20.0.0.4 default 40.0.0.7

Page 14: IP Routing

The IP Routing Algorithm

Extract the destination IP address, D, from the datagram and compute the netid, N

If N matches any directly connected network address deliver the datagram directly

else if the routing table contains a host-specific address for D send the datagram to the next-hop specified in the table

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

else if the routing table contains a default router send the datagram there

else declare a routing error

Page 15: IP Routing

Why not Use Physical Addresses?

• Routing tables store the IP address of the next hop• IP addresses must be translated into physical

addresses

Page 16: IP Routing

IP Routing - Summary

• Routing is one of the Internet Protocol’s primary functions

• Routing is the process of choosing a path over which to send packets

• Questions not answered:– How does a host or router initialize its routing table?

– How are routing tables updated as the network changes?

Page 17: IP Routing

Error and Control Messages in the Internet Protocol

• Extranormal communication among routers and hosts is sometimes necessary to:– Report errors– Handle abnormal conditions– Update routing information

• The Internet Protocol defines a single mechanism for these types of messages

Page 18: IP Routing

The Internet ControlMessage Protocol (ICMP)

• Normally generated by and intended for the IP software

• Two levels of encapsulation:

Page 19: IP Routing

ICMP is for Error Reporting

• Errors are reported to a datagram’s original sender

• It is the sender’s responsibility to take appropriate action

• Exception: ICMP messages are not generated for errors that result from datagrams carrying ICMP messages

Page 20: IP Routing

ICMP Message Format

• All ICMP messages begin with the same three fields:– TYPE (1 octet) - identifies the message

– CODE (1 octet) - information about the subtype

– CHECKSUM (2 octets) - covers the ICMP message

• ICMP error messages always include the header and first 64 data bits of the datagram causing the problem

Page 21: IP Routing

The ICMP TYPE Field

Type Field ICMP Message Type------------- --------------------------0 Echo Reply3 Destination Unreachable4 Source Quench5 Redirect8 Echo Request11 Time Exceeded for Datagram12 Parameter Problem on Datagram13 Timestamp Request14 Timestamp Reply15 Information Request (obsolete)16 Information Reply (obsolete)17 Address Mask Request18 Address Mask Reply

Page 22: IP Routing

Echo Request and Reply Messages

• IDENTIFIER and SEQUENCE NUMBER– Used by the sender to match replies with

requests

Page 23: IP Routing

Destination Unreachable Messages

• Sent when a router cannot deliver or forward a datagram

Page 24: IP Routing

Destination UnreachableCODE Field

Code Value Meaning-------------- -----------0 Network Unreachable1 Host Unreachable2 Protocol Unreachable3 Port Unreachable4 Fragmentation needed and DF set5 Source Route Failed6 Destination Network unknown7 Destination Host Unknown8 Source Host Isolated9 Comm. Administratively prohibited (network)10 Comm. Administratively prohibited (host)11 Network unreachable for type of service12 Host unreachable for type of service

Page 25: IP Routing

Congestion and DatagramFlow Control

• Most routers have a limited queue in which to store arriving datagrams

• Congestion - a router is overrun with traffic– High-speed computer sends datagrams faster

than a router can retransmit them– Many computers send datagrams to the same

router at once

Page 26: IP Routing

Source Quench Message

• Congested routers send one for every datagram they drop:

Page 27: IP Routing

Source Quench Messages

• Hosts that receive source quench messages should stop sending datagrams to that router (temporarily)

• When it hasn’t received a source quench message in a while, the host can start gradually increasing its traffic again

Page 28: IP Routing

Redirect Messages

• Hosts initialize routing table at startup

• When a router detects a host using a nonoptimal route it sends the host a ICMP redirect message

R1 HR2 Net 3Net 2Net 1

Page 29: IP Routing

Redirect Messages

Code Value Meaning-------------- -----------0 Redirect datagrams for the Net (obsolete)1 Redirect datagrams for the Host2 Redirect datagrams for the Type of Service and Net3 Redirect datagrams for the Type of Service and Host

Page 30: IP Routing

Time Exceeded Messages

• Code 0 - Datagram dropped because TTL reached 0

• Code 1 - Datagram dropped because fragment reassembly time exceeded

Page 31: IP Routing

ICMP – Security Issues

• ICMP can be a source of security vulnerabilities:– Flaws in ICMP implementation can be exploited

• Recall the teardrop vulnerability in IP

– ICMP is well suited for denial-of-service attacks• Anyone notice the –f (flood) option to ping?

• According to the man page:

“This can be very hard on a network and should be used with caution.”

Page 32: IP Routing

Ping of Death

• Attacker constructs an ICMP echo request message containing 65,510 data octets and sends it to a victim host:

Page 33: IP Routing

Ping of Death (cont)

• The total size of the resulting datagram (65538 octets) is larger than the 65,536 octet limit specified by IP

• Several systems did not handle this oversized IP datagram properly– Hang

– Crash

– Reboot

• Fixed by software patches

Page 34: IP Routing

Smurf

• Attacker sends ICMP echo request messages to a broadcast address at an intermediate site– Broadcast address = a copy of the datagram is delivered to every host

connected to a specified network

– For some broadcast address, a single request could generate replies from dozens or hundreds of hosts

• The source address in each request packet is spoofed so that replies are sent to a victim machine

• Result: the victim’s machine/network is flooded by ICMP echo replies

• Many sites have reconfigured their machines so that their machines do not respond to ICMP echo requests sent to a broadcast address

Page 35: IP Routing

Smurf (cont)

Page 36: IP Routing

ICMP - Summary

• ICMP provides a mechanism for extranormal communication among routers and hosts– Echo request/reply

– Destination unreachable

– Source quench

– Redirect

– Time exceeded

• Sometimes incoming ICMP messages are blocked for security reasons


Recommended