Computer Alpha may be one of many hosts connected to Switch Sally.
+
Switch Sally may be one of many switches connected to Router Reggie.
+
(For Computer Alpha, Router Reggie provides the default gateway to the network beyond Router Reggie.)
+
+
+
Router Reggie is connected to at least one router, such as Router Roxy.
+
+
+
Router Roxy is connected to at least one router, such as Router Rigby.
+
+
+
Router Rigby may connect to at least one switch, such as Switch Sarah.
+
Switch Sarah may connect to at least one host, such as Computer Bravo.
+
(For Computer Bravo, Router Rigby provides the default gateway to the network beyond Router Rigby.)
+
+
+
+
Goal
+
+
+
Computer Alpha wants to send data to Computer Bravo.
+
+
+
Computer Alpha needs Computer Bravo’s MAC address to send the data.
+
Computer Alpha does not know Computer Bravo’s MAC address.
+
Computer Alpha only knows Computer Bravo’s IP address.
+
+
+
+
Steps
+
+
Computer Alpha processes the data
+
+
+
Computer Alpha encapsulates the data into IP packets.
+
+
+
Computer Alpha’s kernel processes the data.
+
Computer Alpha’s kernel segments the data into TCP segments or UDP datagrams.
+
Computer Alpha’s kernel encapsulates each TCP segment or UDP datagram into an IP packet having Computer Bravo’s IP address.
+
Computer Alpha’s kernel sends each IP packet to Computer Alpha’s NIC.
+
+
+
+
+
+
Computer Alpha sends the data to Router Reggie
+
+
+
Computer Alpha finds out whether Computer Alpha and Computer Bravo are in the same subnet.
+
+
+
Computer Alpha checks whether the following are the same:
+ Computer Alpha’s IP address, “masked” by Computer Alpha’s subnet mask and
+ Computer Bravo’s IP address, “masked” by Computer Alpha’s subnet mask.
+
+
If the network IDs are the same, Computer Alpha and Computer Bravo are in the same subnet.
+
If the network IDs are different, Computer Alpha and Computer Bravo are not in the same subnet. (In this setup, this is the case.)
+
+
+
+
+
Computer Alpha finds out Computer Alpha’s default gateway’s (Router Reggie’s subnet-facing NIC’s) MAC address.
+
Computer Alpha sends each IP packet to Computer Alpha’s default gateway (Router Reggie’s subnet-facing NIC).
+
+
+
+
Router Reggie sends the data to Router Roxy
+
+
+
Router Reggie finds out whether Router Reggie and Computer Bravo’s subnet are directly connected.
+
+
+
Router Reggie looks up its routing table to find the lowest-metric row for which the following are the same:
+ the row’s destination IP address, “masked” by the row’s subnet mask and
+ Computer Bravo’s IP address, “masked” by the row’s subnet mask.
+
+
If the row has no gateway entry, Router Reggie and Computer Bravo’s subnet are directly connected.
+
If the row has a gateway entry, Router Reggie and Computer Bravo’s subnet are not directly connected. (In this setup, this is the case.)
+
+
+
+
+
Router Reggie finds out the next hop router’s (Router Roxy’s) MAC address.
+
Router Reggie sends each IP packet to the next hop router (Router Roxy).
+
+
+
+
Router Roxy sends the data to Router Rigby
+
+
+
Router Roxy finds out whether Router Roxy and Computer Bravo’s subnet are directly connected.
+
+
+
Router Roxy looks up its routing table to find the lowest-metric row for which the following are the same:
+ the row’s destination IP address, “masked” by the row’s subnet mask and
+ Computer Bravo’s IP address, “masked” by the row’s subnet mask.
+
+
If the row has no gateway entry, Router Roxy and Computer Bravo’s subnet are directly connected.
+
If the row has a gateway entry, Router Roxy and Computer Bravo’s subnet are not directly connected. (In this setup, this is the case.)
+
+
+
+
+
Router Roxy finds out the next hop router’s (Router Rigby’s) MAC address.
+
Router Roxy sends each IP packet to the next hop router (Router Rigby).
+
+
+
+
Router Rigby sends the data to Computer Bravo
+
+
+
Router Rigby finds out whether Router Rigby and Computer Bravo’s subnet are directly connected.
+
+
+
Router Rigby looks up its routing table to find the lowest-metric row for which the following are the same:
+ the row’s destination IP address, “masked” by the row’s subnet mask and
+ Computer Bravo’s IP address, “masked” by the row’s subnet mask.
+
+
If the row has no gateway entry, Router Rigby and Computer Bravo’s subnet are directly connected. (In this setup, this is the case.)
+
If the row has a gateway entry, Router Rigby and Computer Bravo’s subnet are not directly connected.
+
+
+
+
+
Router Rigby finds out Computer Bravo’s MAC address.
+
Router Rigby sends each IP packet to Computer Bravo.
+
+
+
+
Computer Bravo processes the data
+
+
+
Computer Bravo de-encapsulates the IP packets into the data.
+
+
+
Computer Bravo’s NIC sends each IP packet to Computer Bravo’s kernel.
+
Computer Bravo’s kernel de-encapsulates each IP packet into a TCP segment or UDP datagram.
+
Computer Bravo’s kernel reassembles the TCP segments or UDP datagrams into the data.