- your computer has a default gateway set
- can figure out packet is not destined for the local network
- will use the MAC address of the default gateway
- default gateway receives the layer-2 frame
- will see that the MAC address matches it's own
- will un-encapsulate the data link frame and
- pass the data part up to the network layer
- at the network layer, layer 3
- will see that the destination IP address does not match it's own
- this is a packet that is supposed to be routed
- will look in it's routing table for the closest match
- which interface to send the packet out on
- will create a new data link frame addressed to the next hop
- data portion of this frame sent out the appropriate interface
- process will continue at each router along the way
- your computer wants to send some data to a computer on network 3
- your computer will create an IP packet addressed to 200.0.3.2
- your computer will send out an ARP request for the default gateway's MAC address
- on receiving the MAC address, your computer will send out the IP packet
- encapsulated within a data link frame that is addressed to the MAC address of router a's interface on network 1
- router a will receive this frame
- send the data portion up to the network layer
- at the network layer, router a will see that the packet is not addressed to router a
- router a will look in it's routing table to find out where to send the packet
- routing table will show that network 3 is reachable via network 2
- routing table will also show the IP address for the next hop is 200.0.2.2
- router a will send out an ARP request onto network 2 asking for router b's MAC address
- on receiving MAC, router a will send the IP packet
- encapsulated in a data link frame addressed to router b's MAC address
- router b receives this frame it will do the same thing that router a did
- will send the IP packet up to the network layer
- see that the packet is not addressed to router b
- will then look up in it's routing table for the closest match and see that it is directly connected to network 3
- here isn't a next hop router to send it to.
- will send out an ARP request to learn the MAC address for 200.0.3.2
- when MAC is received, router b will send out the IP packet
- encapsulated within a data link frame that is addressed to the MAC address of the destination computer
- destination computer will see that the data link frame is addressed to it
- will pass the IP packet to the network layer.
- at the network layer, the IP address will also match that of the computer
- the data from the IP packet will be passed up to the transport layer
No comments:
Post a Comment
Note: only a member of this blog may post a comment.