Transcript Routing

Routing
Going from one network to the next
Where is routing handled?
• IP serves the functions of
– routing
– universal naming
• Identification is easiest if naming has
uniformity
• Need a function/service to map IP addresses
to MAC (e.g. ethernet) addresses
• Transport layer hands data to IP and lets IP
worry about how to carry to the right
machine
Thinking about the problem
• Consider the routing problem by identifying
three possibilities for each message
– (1) message is for itself
– (2) message is for a directly connected machine
– (3) message is for a machine on another segment
Consider
messages
from A
128.81.5.2
Router
195.1.2.8
128.81.10.1 128.81.8.2
A
(1)
(2)
195.1.2.1
C
B
(3)
195.1.2.3
D
• How does it know if it is for self?
(1)
– Knows own IP
• How does it know if on own segment?
(2)
– Compare own subnet with the subnet of the
destination address
• How does it deal with other routes?
(3)
– Often only one (DEFAULT) place to route
info, (in previous case (R))
– If more than one router available, more tricky
based on what’s behind the router
– Router addresses frequently hard coded
Where is routing in OSI?
Consider TCP/IP instead
Application
Presentation
Session
Transport(TCP)
Cooperate to
handle routing
although done
at Network (IP)
Network (IP)
Data Link
Data Link not used in TCP/IP
Physical
Consider only the Transport/Network/Physical layers
Typical path
128.81.5.2
Router
195.1.2.8
128.81.10.1 128.81.8.2
A
195.1.2.1
195.1.2.3
D
C
B
Application
Application
Transport
Transport
Network (IP)
Network (IP)
Network (IP)
Physical
Physical
Physical
When for itself?
A couple of cases exist: consider the simple case
128.81.10.1
A
Application
Info
Transport
Already There!
To: 128.81.10.1
From:128.81.10.1
Info
Network (IP)
Physical
Someone on it’s segment
128.81.10.1 128.81.8.2
A
(2)
B
A
Application
Info
Transport
To: 128.81.8.2
From:128.81.10.1
Info
Network (IP)
To:?????
From:80:3:12:2:1:0
IP
To: 128.81.8.2
From:128.81.10.1
Info
Physical
80:3:12:2:1:0
What is the MAC level address?
All packets at the physical level
must have the ethernet address.
How can A find out B’s address?
Legend
Transport
IP
MAC(ethernet)
ARP to the rescue
an IP level protocol
A sends the same request to all machines
A-128.81.10.1
B-128.81.8.2
Router -128.81.5.2
Network (IP)
Network (IP)
To: 128.81.8.2
From:128.81.10.1
What’s your
MAC address?
ARP
ARP
YES
ME!
Network (IP)
To: 128.81.8.2
From:128.81.10.1
What’s your
MAC address?
ARP
To: ff:ff:ff:ff:ff:ff
From:80:3:12:2:1:0
ARP
To: ff:ff:ff:ff:ff:ff
From:80:3:12:2:1:0
ARP
To: ff:ff:ff:ff:ff:ff
From:80:3:12:2:1:0
ARP
To: 128.81.8.2
From:128.81.10.1
To: 128.81.8.2
From:128.81.10.1
To: 128.81.8.2
From:128.81.10.1
What’s your
MAC address?
What’s your
MAC address?
What’s your
MAC address?
Physical
80:3:12:2:1:0
Physical
4:7:10:2:7f:2
NOT
ME!
Physical
c0:3:2:21:1:0
ARP to the rescue
A-128.81.10.1
Network (IP)
B responds to A
B-128.81.8.2
Network (IP)
To: 128.81.10.1
From:128.81.8.2
To: 128.81.10.1
From:128.81.8.2
4:7:10:2:7f:2
4:7:10:2:7f:2
ARP
ARP
To: 80:3:12:2:1:0
From: 4:7:10:2:7f:2
ARP
To: 128.81.10.1
From:128.81.8.2
To: 128.81.10.1
From:128.81.8.2
4:7:10:2:7f:2
4:7:10:2:7f:2
80:3:12:2:1:0
Network (IP)
YES
ME!
ARP
To: 80:3:12:2:1:0
From: 4:7:10:2:7f:2
ARP
Physical
Router -128.81.5.2
Physical
4:7:10:2:7f:2
Physical
c0:3:2:21:1:0
Someone on it’s segment CONTINUED
A
Now A know B’s Mac address!
Thanks to ARP.
Continue with the message.
B
Application
Application
128.81.10.1 128.81.8.2
A
(2)
Info
B
Info
Transport
To: 128.81.8.2
From:128.81.10.1
Info
Network (IP)
Transport
To: 128.81.8.2
Yes
From:128.81.10.1
Info
ME!
Network (IP)
To: 4:7:10:2:7f:2
From:80:3:12:2:1:0
IP
To: 4:7:10:2:7f:2
From:80:3:12:2:1:0
IP
To: 128.81.8.2
From:128.81.10.1
To: 128.81.8.2
From:128.81.10.1
Info
Physical
80:3:12:2:1:0
Info
Physical
4:7:10:2:7f:2
Someone
on
another
segment
128.81.5.2
195.1.2.8
Router
128.81.10.1
C
A
195.1.2.1
A-128.81.10.1
C-195.1.2.1
Application
Application
128.81.5.2
Info
-Router -195.1.2.8
Transport
To: 195.1.2.1
From:128.81.10.1
Not
for
ME!
To: 195.1.2.1
From:128.81.10.1
Info
Info
Network (IP)
Network (IP)
Info
Transport
To: 195.1.2.1
For
From:128.81.10.1
Info
ME!
Network (IP)
To: c0:3:2:21:1:0
From:80:3:12:2:1:0
IP
To: 4:7:10:2:7f:2
From:80:3:12:2:1:0
IP
To: ba:5:2:7:6:4
From: 40:3:7:21:1:0
IP
To: ba:5:2:7:6:4
From: 40:3:7:21:1:0
IP
To: 195.1.2.1
From:128.81.10.1
To: 195.1.2.1
From:128.81.10.1
To: 195.1.2.1
From:128.81.10.1
To: 195.1.2.1
From:128.81.10.1
Info
Info
Physical
80:3:12:2:1:0
Info
Info
Physical
c0:3:2:21:1:0
Physical
40:3:7:21:1:0
ba:5:2:7:6:4
Things to note (previous slide)
• The IP addresses were consistent across the
transmission (END-TO-END)
• The ARP process between Router<->C has not
been shown
• APR caches responses to save time later
• Router only functions at IP and below if not
intended for Router.
• If for Router instead of C, IP would be Router’s
• Router has 2 interfaces->2 protocol stacks
• Protocol stack is actually a tree structure
• Ethernet indicates if IP or ARP or … going up.