...

Friday, April 2, 2010

CCNA 7

Let's review local communication. Suppose you have two hosts:Host A - 172.10.1.20/24 - 3827:3fe7:9fbc:cba3
Host B - 172.10.1.30/24 - abcf:fe74:1928:eefa

They are also configured to use a default gateway:
Router - 172.10.1.1/24 - 0a9b:1928:b1bc:c7a6

Suppose that Host A wants to communicate to Host B, the first process is that it takes both addresses (its own, and Host B's) and ANDs them with the subnet mask. In this case, if 172.16.1.20&255.255.255.0==172.16.1.30&255.255.255.0 then Host B is assumed to be local.

Now Host A sends an ARP containing:
Source IP: 172.10.1.20 (Host A)
Destination IP: 172.10.1.30 (Host B)
Source MAC: 3827:3fe7:9fbc:cba3 (Host A)
Destination MAC: ffff:ffff:ffff:ffff (Subnet Broadcast)

Host B then replies with an ARP reply containing:
Source IP: 172.10.1.30 (Host B)
Destination IP: 172.10.1.20 (Host A)
Source MAC: abcf:fe74:1928:eefa (Host B)
Destination MAC: 3827:3fe7:9fbc:cba3 (Host A)

Now that Host A knows Host B's MAC address, it can then send packets to it that looks like:
Source IP: 172.10.1.20 (Host A)
Destination IP: 172.10.1.30 (Host B)
Source MAC: 3827:3fe7:9fbc:cba3 (Host A)
Destination MAC: abcf:fe74:1928:eefa (Host B)

Now suppose Host A wants to communicate with Host C. Host C is configured as shown:
Host C - 192.168.0.100/24 - 3829:ff00:00ca:1928

Now, since 172.10.1.20&255.255.255.0!=192.168.0.100&255.255.255.0, it is assumed Host C is not on the same subnet. Therefore, Host A now ARPs for the default gateway's MAC which looks like this:
Source IP: 172.10.1.20 (Host A)
Destination IP: 172.10.1.1 (Router)
Source MAC: 3827:3fe7:9fbc:cba3 (Host A)
Destination MAC: ffff:ffff:ffff:ffff (Broadcast)

The router then replies with:
Source IP: 172.10.1.1 (Router)
Destination IP: 172.10.1.20 (Host A)
Source MAC: 0a9b:1928:b1bc:c7a6 (Router)
Destination MAC: 3827:3fe7:9fbc:cba3 (Host A)

Then the packet is sent that looks like this:
Source IP: 172.10.1.20 (Host A)
Destination IP: 192.168.0.100 (Host C)
Source MAC: 3827:3fe7:9fbc:cba3 (Host A)
Destination MAC: 0a9b:1928:b1bc:c7a6 (Router)

When the router receives the packet, it checks the packet and realizes that although the MAC is destined for itself, the IP isn't. Therefore it knows that the packet is destined to go THROUGH it. It checks its routing table and realizes that it is connected to teh 192.168.0.0 subnet. It rips off the source and destination MAC originally there and replaces it like this before forwarding it out to the 192.168.0.0 subnet:
Source IP: 172.10.1.20 (Host A)
Destination IP: 192.168.0.100 (Host C)
Source MAC: 0a9b:1928:b1bc:c7a6 (Router)
Destination MAC: 3829:ff00:00ca:1928 (Host C)

Note that the MAC address is actually just a layer 2 address. MAC only exists in Ethernet environments. Once the packet gets forwarded to other environments such as the WAN, different layer 2 addresses are used. However, the concept still applies and the same process repeats during every point-to-point transaction.

To see the routers you pass through to get to a destination, use:
tracert www.google.com

A typical output would be:
  1    1 ms     1 ms    1 ms  unknown [192.168.1.1]
  2     9 ms     8 ms     7 ms  cm1.epsilon64.maxonline.com.sg [222.164.64.1]
  3    10 ms     7 ms    11 ms  172.20.22.1
  4    22 ms    11 ms    10 ms  172.26.22.1
  5    14 ms     9 ms    11 ms  172.20.7.30
  6    13 ms     9 ms    13 ms  203.117.35.41
  7    15 ms    15 ms    12 ms  203.117.34.1
  8    14 ms    10 ms    11 ms  72.14.196.189
  9    15 ms    11 ms    15 ms  209.85.254.166
 10    19 ms    19 ms    21 ms  209.85.242.243
 11    20 ms    19 ms    17 ms  209.85.250.237
 12    24 ms    21 ms    30 ms  209.85.249.130
 13    21 ms    30 ms    20 ms  74.125.206.10
 14    16 ms    17 ms    21 ms  ni-in-f105.1e100.net [64.233.181.105]

1 comment :

  1. your MAC addresses are bigger than the real ones. For everything else, is a good post ;)

    ReplyDelete

<