In: Computer Science
A host (computer) with networking capabilities is assigned a MAC
address AB1CD22EF33 and a public IP address 192.92.21.5/24. The
gate way is connected to your ISP with optic cables. The ISP public
address is 16.12.11.253/30. The MAC address of your ISP is
112233ABCDEF.
a. Explain why both a MAC and an IP address are assigned to a host
in the network.
b. Clearly differentiate between public & private Internet
address.
c. Explain the meaning of the CIDR address 196.92.21.5/24.
d. Which other public IP address are assigned to the router?
e. Explain how the host knows the IP address of the router.
f. Explain how the host will use ARP to get the MAC address of the
gateway.
g. Draw diagrams to show an IP packet is sent from layer 3 on the
host to layer 3 at the ISP.
Answer :
a) MAC address uniquely identifies a system and doesn't change because it's hard coded into the Random Access Memory (ROM) of NIC (Network Interface Card). While IP address of a host may change depending on the connection. But it is necessary to allot both MAC and IP addresses to a host because both operate on different layers of OSI Model (MAC - Data Link Layer and IP - Network Layer) and different protocols may utilize either MAC or IP or both. Ex. IPX (Internet Packet Exchange Protocol) uses MAC address of host whereas TCP/IP protocol uses IP address only.
b) As the name suggests, public IP address is globally unique and can be accessed publicly whereas private IP address are private to a user and can't be accessed by other people and not exposed on the internet. Ex. If you have many hosts in your home and you have a router which connects all your computer devices. In this case, your devices would get private addresses and your router will be allotted a public IP address by DHCP protocol. Internet Assigned Numbers Authority (IANA) is responsible for providing a range a public and private IP addresses.
c) CIDR address : 196.92.21.5/24 - CIDR stands for Classless Inter domain Routing
Here 24 means that 24 bits are present in network ID and rest (32-24) = 8 bits are present in host ID which means = 256 IP addresses can be allotted this network ID. And this address is private IP address as the 192.x.x.x addresses are not registered publicly.
d) Internet Assigned Numbers Authority (IANA) defines the range below under private IPv4 addresses:
The IP addresses excluding the above addresses can be assigned to a public router.
e) Open Command Prompt
When the command window opens type: ipconfig and hit enter.
This will show your local network information. The IP address listed as Default Gateway is your router's IP.
f) Address Resolution Protocol (ARP) maps dynamic IP address to a permanent physical machine address (or MAC address) in a LAN. It translates 32 bit IP address to 48 bit MAC address and vice versa.
A new computer is assigned a unique IP address to use for identification when it joins a LAN. When an incoming packet on a particular LAN arrives at a gateway, the gateway asks the ARP program to find a MAC address that matches the IP address. A table called the ARP cache maintains a record of each IP address and its corresponding MAC address. An ARP cache is maintained. When a packet is sent, first it sees in cache whether it's IP to MAC translation is present or not. If not present, ARP function is called.
g) As can be seen from the diagram below, The packets from network layer of host first move through the layer 2 and then layer 1 and then transmitted as bits. Similarly, at ISP , the bits are first framed in layer 2 and then converted to packets in layer 3 at ISP.