0% found this document useful (0 votes)
60 views17 pages

IP Forwarding: Relates To Lab 3

1) IP forwarding relates to the principles of end-to-end datagram delivery in IP networks by viewing the internetwork as a collection of logical IP networks connected by routers. 2) For successful delivery, the destination IP address must correspond to a unique data link network, routers and hosts in a common network must be able to exchange datagrams, and each data link network must connect to another via a router. 3) Routers use routing tables to determine the next hop and interface to forward each datagram towards its destination network, allowing step-by-step transmission across multiple logical networks until it reaches the destination host.

Uploaded by

Frank Zappa
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
60 views17 pages

IP Forwarding: Relates To Lab 3

1) IP forwarding relates to the principles of end-to-end datagram delivery in IP networks by viewing the internetwork as a collection of logical IP networks connected by routers. 2) For successful delivery, the destination IP address must correspond to a unique data link network, routers and hosts in a common network must be able to exchange datagrams, and each data link network must connect to another via a router. 3) Routers use routing tables to determine the next hop and interface to forward each datagram towards its destination network, allowing step-by-step transmission across multiple logical networks until it reaches the destination host.

Uploaded by

Frank Zappa
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 17

IP Forwarding

Relates to Lab 3.

Covers the principles of end-to-end datagram delivery in IP networks.

1
Delivery of an IP datagram

• View at the data link layer layer:


– Internetwork is a collection of LANs or point-to-point links or switched
networks that are connected by routers
R1 R2

Point-to-point link Point-to-point link


H2

Network of
Ethernet
switches
Ethernet

IP
H1 R3 R4
Token
Ring
Ethernet LAN
2
Delivery of an IP datagram

• View at the IP layer:


– An IP network is a logical entity with a network number
– We represent an IP network as a “cloud”
– The IP delivery service takes the view of clouds, and ignores the data
link layer view
R1 R2
10.2.1.0/24 20.2.1.0/28
H2
10.1.2.0/24 20.1.0.0/16
IP

10.1.0.0/24 10.3.0.0/16
H1 R3 R4

3
Tenets of end-to-end delivery of datagrams

The following conditions must hold so that an IP datagram can


be successfully delivered

1. The
1. Thenetwork
networkprefix
prefixofofan
anIPIPdestination
destinationaddress
addressmust
must
correspondto
correspond toaaunique
uniquedata
datalink
linklayer
layer network
network (=LAN
(=LANor or
point-to-point link
point-to-point linkororswitched
switchednetwork).
network).
(Thereverse
(The reverseneed
neednot not be
betrue!)
true!)
2. Routers
2. Routersand
andhosts
hoststhatthathave
have aacommon
common network
network prefix
prefix
mustbe
must beable
ableto toexchange
exchangeIP IPdagrams
dagramsusing
usingaadata
datalink
link
protocol(e.g.,
protocol (e.g.,Ethernet,
Ethernet, PPP)
PPP)
3. Every
3. Everydata
datalink
linklayer
layernetwork
networkmustmustbebeconnected
connectedto toat
atleast
least
oneother
one otherdata
datalink
linklayer
layer network
networkvia viaaarouter.
router.

4
Routing tables
• Each router and each host keeps a routing table which tells the router
how to process an outgoing packet
• Main columns:
1. Destination address: where is the IP datagram going to?
2. Next hop: how to send the IP datagram?
3. Interface: what is the output port?
• Next hop and interface column can often be summarized as one column
• Routing tables are set so that datagrams gets closer to the its destination
Destination Next interface
Hop
10.1.0.0/24 direct eth0
10.1.2.0/24 direct eth0
Routing table of a host or router 10.2.1.0/24 R4 serial0
IP datagrams can be directly delivered 10.3.1.0/24 direct eth1
(“direct”) or is sent to a router (“R4”) 20.1.0.0/16 R4 eth0
20.2.1.0/28 R4 eth0

5
Delivery with routing tables

D e s tin a tio n N ext H op D e s tin a tio n N ext H op D e s tin a tio n N ext H op


1 0 .1 .0 .0 /2 4 R3 1 0 .1 .0 .0 /2 4 R1 1 0 .1 .0 .0 /2 4 R2
1 0 .1 .2 .0 /2 4 d ire c t 1 0 .1 .2 .0 /2 4 R1 1 0 .1 .2 .0 /2 4 R2
1 0 .2 .1 .0 /2 4 d ire c t 1 0 .2 .1 .0 /2 4 d ire c t 1 0 .2 .1 .0 /2 4 R2
1 0 .3 .1 .0 /2 4 R3 1 0 .3 .1 .0 /2 4 R4 1 0 .3 .1 .0 /2 4 R2
2 0 .2 .0 .0 /1 6 R2 2 0 .1 .0 .0 /1 6 d ire c t 2 0 .1 .0 .0 /1 6 R2
3 0 .1 .1 .0 /2 8 R2 2 0 .2 .1 .0 /2 8 d ire c t 2 0 .2 .1 .0 /2 8 d ire c t

R1 R2
1 0 .2 .1 .0 /2 4 2 0 .2 .1 .0 /2 8
H2
2 0 .2 .1 .2 /2 8
1 0 .1 .2 .0 /2 4 2 0 .1 .0 .0 /1 6

to:
20.2.1.2 1 0 .1 .0 .0 /2 4 1 0 .3 .0 .0 /1 6
H1 R3 R4

D e s tin a tio n N ext H op D e s tin a tio n N ext H op D e s tin a tio n N ext H op


1 0 .1 .0 .0 /2 4 d ire c t 1 0 .1 .0 .0 /2 4 d ire c t 1 0 .1 .0 .0 /2 4 R3
1 0 .1 .2 .0 /2 4 R3 1 0 .1 .2 .0 /2 4 d ire c t 1 0 .1 .2 .0 /2 4 R3
1 0 .2 .1 .0 /2 4 R3 1 0 .2 .1 .0 /2 4 R4 1 0 .2 .1 .0 /2 4 R2
1 0 .3 .1 .0 /2 4 R3 1 0 .3 .1 .0 /2 4 d ire c t 1 0 .3 .1 .0 /2 4 d ire c t
2 0 .1 .0 .0 /1 6 R3 2 0 .1 .0 .0 /1 6 R4 2 0 .1 .0 .0 /1 6 d ire c t
2 0 .2 .1 .0 /2 8 R3 2 0 .2 .1 .0 /2 8 R4 2 0 .2 .1 .0 /2 8 R2

6
Delivery of IP datagrams

• There are two distinct processes to delivering IP datagrams:


1. Forwarding: How to pass a packet from an input
interface to the output interface?
2. Routing: How to find and setup the routing tables?

• Forwarding must be done as fast as possible:


– on routers, is often done with support of hardware
– on PCs, is done in kernel of the operating system
• Routing is less time-critical
– On a PC, routing is done as a background process

7
Processing of an IP datagram in IP

Routing Static
UDP TCP
Protocol routing

Demultiplex

Yes

Lookup next Yes IP forwarding No Destination


routing
hop enabled? address local?
table

No
Send Input
IP module datagram Discard queue

Data Link Layer

IP router: IP forwarding enabled


Host: IP forwarding disabled 8
Processing of an IP datagram in IP

• Processing of IP datagrams is very similar on an IP router and


a host
• Main difference:
“IP forwarding” is enabled on router and disabled on host

• IP forwarding enabled
 if a datagram is received, but it is not for the local system,
the datagram will be sent to a different system
• IP forwarding disabled
 if a datagram is received, but it is not for the local system,
the datagram will be dropped

9
Processing of an IP datagram at a router

Receive an
IP datagram 1. IP header validation
2. Process options in IP header
3. Parsing the destination IP address
4. Routing table lookup
5. Decrement TTL
6. Perform fragmentation (if necessary)
7. Calculate checksum
8. Transmit to next hop
9. Send ICMP packet (if necessary)

10
Routing table lookup

• When a router or host need to


transmit an IP datagram, it
performs a routing table lookup
Destination Next hop/
address interface
• Routing table lookup: Use the
IP destination address as a key to network prefix IP address of
search the routing table. or next hop router
host IP address
• Result of the lookup is the IP or or
address of a next hop router, loopback address
and/or the name of a network or Name of a
interface default route network
interface

11
Type of routing table entries

• Network route
– Destination addresses is a network address (e.g., 10.0.2.0/24)
– Most entries are network routes

• Host route
– Destination address is an interface address (e.g., 10.0.1.2/32)
– Used to specify a separate route for certain hosts

• Default route
– Used when no network or host route matches
– The router that is listed as the next hop of the default route is the default
gateway (for Cisco: “gateway of last resort)

• Loopback address
– Routing table for the loopback address (127.0.0.1)
– The next hop lists the loopback (lo0) interface as outgoing interface

12
Routing table lookup: Longest Prefix Match

• Longest Prefix Match: Search for the 128.143.71.21


routing table entry that has the longest
= of the destination
match with the prefix
IP address
Destination address Next hop

10.0.0.0/8 R1
1. Search for a match on all 32 bits 128.143.0.0/16 R2
2. Search for a match for 31 bits 128.143.64.0/20 R3
128.143.192.0/20 R3
…..
128.143.71.0/24 R4
32. Search for a mach on 0 bits 128.143.71.55/32 R3
default R5

Host route, loopback entry The longest prefix match for


 32-bit prefix match 128.143.71.21 is for 24 bits
Default route is represented as 0.0.0.0/0 with entry 128.143.71.0/24
 0-bit prefix match
Datagram will be sent to R4
13
Route Aggregation

• Longest prefix match algorithm permits to aggregate prefixes


with identical next hop address to a single entry
• This contributes significantly to reducing the size of routing
tables of Internet routers

Destination Next Hop Destination Next Hop


10.1.0.0/24 R3 10.1.0.0/24 R3
10.1.2.0/24 direct 10.1.2.0/24 direct
10.2.1.0/24 direct 10.2.1.0/24 direct
10.3.1.0/24 R3 10.3.1.0/24 R3
20.2.0.0/16 R2 20.0.0.0/8 R2
30.1.1.0/28 R2
14
How do routing tables get updated?

• Adding an interface:
– Configuring an interface eth2 with Destination Next Hop/
10.0.2.3/24 adds a routing table interface
entry: 10.0.2.0/24 eth2

• Adding a default gateway:


– Configuring 10.0.2.1 as the Destination Next Hop/
default gateway adds the entry: interface
0.0.0.0/0 10.0.2.1
• Static configuration of network routes
or host routes
• Update of routing tables through
routing protocols

• ICMP messages

15
Routing table manipulations with ICMP

• When a router detects that an IP datagram should have gone


to a different router, the router (here R2)
• forwards the IP datagram to the correct router
• sends an ICMP redirect message to the host
• Host uses ICMP message to update its routing table

Destination Next Hop


R1 R2 10.1.0.0/24 R1

(2) IP datagram
(3) ICMP redirect
(1) IP datagram

Ethernet

Destination Next Hop


10.1.0.0/24 R2
… R1
H1
16
ICMP Router Solicitation
ICMP Router Advertisement

• After bootstrapping a host


broadcasts an ICMP router
R1 R2
solicitation.
• In response, routers send an ICMP router ICMP router
ICMP router advertisement advertisement advertisement
message
• Also, routers periodically ICMP router
solicitation
broadcast ICMP router
advertisement
Ethernet

This is sometimes called the


Router Discovery Protocol H1

17

You might also like