Professional Documents
Culture Documents
• The simple answer is deliver the IP packet inside an Ethernet frame to the next hop along the way.
• The next hop may very well be the final destination.
• To better explain this, lets use a couple of examples.
00-0C-04-
38-44-AA
Same network
• What would the Destination MAC address be for IP packets sent
within the same LAN, network?
– The Destination MAC address would be that of the device that we
are sending the IP packet to.
– The device’s Destination MAC address would be associated with
the Destination IP address.
Rick Graziani graziani@cabrillo.edu 10
Destination MAC
Address
00-0D-17-
8A-F1-32
Different network
• What would the Destination MAC address for IP packets sent outside
the LAN, on a different network?
– The destination MAC address will be the MAC address
associated with the IP Address of the Default Gateway.
– The host must know the IP address of the Default Gateway to
communicate with devices outside its own network.
Rick Graziani graziani@cabrillo.edu 11
Router’s IP
Address
Same network?
Same network?
Hints:
• How does a host know what network it is on?
• What do all devices in the same network have in common?
Same network?
So, here is the big question:
• How do does the sending host know if the Source IP Address and
Destination IP Address are on the same network?
Hints:
• How does a host know what network it is on?
– Does an AND operation on its host IP address and subnet mask.
• What do all devices in the same network have in common?
– They all have the same subnet mask (and of course a host IP
address in the same network).
Rick Graziani graziani@cabrillo.edu 15
Destination MAC Address?
Same network?
Same network?
AND AND
Same network
• Since they are on the same network, the Destination MAC Address
will be the MAC Address of the host with the Destination IP Address.
• Where does the sending host look for this information?
00-0C-04- 00-0C-04-
38-44-AA 17-91-CC
D e s t i n
to MAC Address mappings.
172.16.10.25 00-0C-04-38-44-AA
• Every device that participates in
Ethernet and IP will have such a table,
including hosts and routers.
00-0C-04-
17-91-CC
No Match
• What if the Destination IP Address is
not in the ARP Table?
D •
• e s t i n
How does it get in there?
The host must issue an ARP Request.
00-0C-
00-0C-
04-38- 04-17-
91-CC
D e s t i n
44-AA IP Packet no
putlonger
on hold
on hold
H o s t S t e
1 7 2 . 1 6 . 1
? 2 5 5 . 2
00-0C-04-
17-91-CC 172.16.10.10 172.16.20.12 5 5
M A C 0 0
Here we have an example of Host Stevens at IP address 172.16.10.10
wanting to send an IP packet to Host Perlman at IP address 172.16.20.12
Rick Graziani graziani@cabrillo.edu 24
Review: Destination MAC Address?
Same network?
Hints:
• How does a host know what network it is on?
• What do all devices in the same network have in common?
Same network?
So, here is the big question:
• How do does the sending host know if the Source IP Address and
Destination IP Address are on the same network?
Hints:
• How does a host know what network it is on?
– Does an AND operation on its host IP address and subnet mask.
• What do all devices in the same network have in common?
– They all have the same subnet mask (and of course a host IP
address in the same network).
Rick Graziani graziani@cabrillo.edu 27
Review: Destination MAC Address?
Same network?
Same network?
AND AND
Different networks
00-0C-
03-0D-
17-8A- 04-17-
91-CC
D e s t i n
F1-32 IP Packet no
putlonger
on hold
on hold
172.16.10.1 03-0D-17-8A-F1-32
D e s t i n a t i o n Stevens at 172.16.10.10,
looking for the MAC address
of the 172.16.10.25
(Destination IP Address).
“Hey everyone! I have this IP
Address and I need the host
this belongs to, to send me
their MAC address.”
R P T a A
ARP
I P Request from
A d d r e s s M A 172.
1 Ethernet
7 2 . 1 Header
6 . 1 0 ?0 . 30 - 0
Ethernet Ethernet Frame
1 7 2 . 1 6 . 1 0 0 . 10 9- 0 op field – ARP request = 1
ARP reply = 2
Destination
Rick Graziani graziani@cabrillo.edu Source
RARP request = 3
RARP reply = 4 Type 36
ARP Reply from
D e s t i n a t i o n 172.16.10.25, back to the
requester 172.16.10.10.
“Hey sender of ARP Request!
Here is my MAC address that
you wanted for that IP
address.”
00-0C-04-
38-44-AA R 00-0C-04-
17-91-CC 172.16.10.10 A 172.16.10.25 P T a
I P A d d r e s
ARP Reply from 172.16.10.25
Ethernet Header Ethernet Data – 28 byte ARP request/reply
s M A
1 7 2 . 1 6 . 1 0 0 . 30 - 0
Ethernet Ethernet Frame ARP Sender’s Sender’s Target’s Target’s
Destination Source Type headers Ethernet IP Address Ethernet IP Address
Address Address , i.e. op Address Address
(MAC) (MAC) field (MAC) (MAC)
1 7 2 . 1 6 . 1 0 0 . 10 9- 0
00-0C- 00-0C- 0x806 op = 2 00-0C- 172.16.10.25 00-0C- 172.16.10.10
04-17- 04-38- 04-38- 04-17-
91-CC 44-AA 44-AA 91-CC
R A P T a
I P A d d r e s
00-0C-04-
38-44-AA
00-0C-04-
17-91-CC 172.16.10.10 172.16.10.25 s M A
1 7 2 . 1 6 . 1 0 0 . 30 - 0
1 7 2 . 1 6 . 1 0 0 . 10 9- 0
Rick Graziani graziani@cabrillo.edu 38
ARP Request: Different Networks (Default
Gateway)
R A P T
ARP Request from 172.16.10.10
Ethernet Header Ethernet Data – 28 byte ARP request/reply
Ethernet Ethernet Frame ARP Sender’s Sender’s Target’s Target’s
Destination Source Type headers Ethernet IP Address Ethernet IP Address
Address
(MAC)
FF-FF-
I P A d d r e s
Address
(MAC)
00-0C- 0x806
, i.e. op
field
op = 1
Address
(MAC)
00-0C- 172.16.10.10
Address
(MAC) s M A
172.16.10.1
?
1 7 2 . 1 6 . 1 0 0 . 30 - 0
FF-FF- 04-17- 04-17-
FF-FF 91-CC 91-CC
1 7 2 . 1 6 . 1 0 0 . 10 9- 0
op field – ARP request = 1
ARP reply = 2
RARP request = 3
Rick Graziani graziani@cabrillo.edu RARP reply = 4 40
D e f a u l t G a t e w
ARP Reply from Router A at
M A C A d d r 172.16.10.1, back to the
sender, Host Stevens
Default Gateway: 172.16.10.1 “Hey sender of ARP Request!
Here is my MAC address that
you wanted for that IP
address.”
03-0D-17-
8A-F1-32
00-0C-04-
17-91-CC
R 172.16.10.10 A
172.16.20.12 P T
I P A d d r e s
ARP Reply from 172.16.10.1
Ethernet Header
Ethernet Ethernet Frame
Ethernet Data – 28 byte ARP request/reply
ARP Sender’s Sender’s Target’s
s M
Target’s
1 7 2 . 1 6 . 1 0 0 . 30 -
Destination Source Type headers Ethernet IP Address Ethernet IP Address
Address Address , i.e. op Address Address
(MAC) (MAC) field (MAC) (MAC)
00-0C- 03-0D- 0x806 op = 2 03-0D- 172.16.10.1 00-0C- 172.16.10.10
1 7 2 . 1 6 . 1 0 0 . 10 9
04-17- 17-8A- 17-8A- 04-17-
91-CC F1-32 F1-32 91-CC
M A C• A d d r
172.16.10.1 03-0D-17-8A-F1-32 its ARP Table.
Host Stevens now has all it
needs to encapsulate the IP
packet into the Ethernet frame
Default Gateway: 172.16.10.1
and send that packet to Router
A.
• It is now up to Router A to
forward the packet onward.
03-0D-17- 00-0C-04-
R A P T
172.16.10.10 172.16.20.12
I P A d d r e s s M
8A-F1-32 17-91-CC
1 7 2 . 1 6 . 1 0 0 . 30 -
1 7 2 . 1 6 . 1 0
Rick Graziani graziani@cabrillo.edu 0 . 10 9 42
Does the receiver of the ARP Request need to do its
own ARP Request?
192.168.1.10/24 192.168.1.100/24
ARP Table has ARP Table
192.168.1.100 entry, so initially empty,
no ARP Request needed does ARP
Request before
Echo Request Echo Reply
Echo Reply
Destination IP Source IP
000001 102 192.168.1.100 192.168.1.10 ICMP Echo Request
This is dependent on the operating system. With most host operating systems, the
receiver (target) of the ARP Request will add the IP address of the sender of this ARP
Request to its ARP Table. However, some devices will not do record the sender of the
ARP Request’s IP and MAC address and will need to do an ARP Request of its own.
Rick Graziani graziani@cabrillo.edu 44
For more information…