ANONYMOUS wrote:
> Hello, I was just reviewing lecture 7 (and internet sources) and was a little confused about what seems to be the shared purpose/role of private IPs and mac addresses. From what I understand, public IP's are globally unique to allow for accurate sending of packets to correct destinations. And the role of private IP's seems to be used to address different devices on the same network e.g. home router (not necessarily globally unique but assigned uniquely to each device on the network). But I thought the mac addresses role was the same, too address devices uniquely on the same network (LAN).
Yes (there's a lot of overlap, here, with what we discussed in Tutorial 4)
It's very likely that your home router will support private addresses of the form 192.168.x.y (a widely used default), and that your neighbour's router will use exactly the same range, unless either of you have reconfigured them.
> Continuing from this, if a wanted to send a file from my phone to my computer on my home network, it would send a ARP request attached with the private IP of the computer. The home router gets this ARP request and sends it out to the devices on the network. The computer gets the ARP requests and sends back its mac address (through the router to the sender), so that then the sender can then send the file. Why point is, why not just send the file with the private IP, why do you need the mac in the first place if the private IP uniquely addresses the computer in the first place. Thanks and sorry for the large question.
There's many ways to configure your home network/router, even to use ad-hoc networking not requiring the router but, in general, all of the devices in your home will always communicate *through* the router, and not with each other directly. When each device boots, or arrives within range of your router, it will use DHCP to receive a dynamically allocated (private) IP address from the router. (Unless the router is configured with some static MAC<->IP mappings) that IP given out by the router may change from day-to-day, so other devices will need the assistance of the router to find the destination device's *current* private IP address.
Hope this helps,