1
$\begingroup$

While reading through my textbook, I discovered that if you want to access a particular web page, your web browser will find out the IP address of the web server that hosts the web page and try and connect to it. It will then transfer a copy of the web page to your computer so that you may view it.

However, my concern is... I have discovered that the IP address enables data to be sent to the device's local area network, but in order for the data to be sent to the device itself, the MAC address is needed to transfer data from the local area network to the device.

BUT, in my textbook, nowhere does it say how the computer's web browser finds out the MAC address of the web server. It says that the computer finds out the IP address of the web server by using the Domain Name System (DNS).

So, how does the computer find out the MAC address of the server?

Answers would be much appreciated.

$\endgroup$
  • 1
    $\begingroup$ I urge you to read about the OSI model. $\endgroup$ – dkaeae Aug 22 at 15:01
  • $\begingroup$ It is theoretically possible that the web server does not even have a MAC address. Each side of a connection gets to choose its own internal implementation. $\endgroup$ – MSalters Aug 22 at 23:26
5
$\begingroup$

So, how does the computer find out the MAC address of the server?

It doesn't. The MAC address only has validity inside a local area network (LAN), which, as the name says, is local. Unless the destination IP address resides in the same network as your machine, what it does is create a packet destined to the target IP address and forward it to its default route, usually your router. (To do so it must obtain the router's MAC address too using ARP—but this is a different matter.) Obtaining the server's MAC address is the task of the final hop which is in the same LAN as the server; a machine notices it is the final hop by checking if the destination IP lies in the same subnet as its own.

It is only when the destination IP is in the same local network as your machine that the MAC address needs to be obtained. (And this is done using ARP too.) In this case, your computer just happens to be the final hop in the route to the server.

$\endgroup$
0
$\begingroup$

Your computer sends a request to your router, and the router sends it to the IP address of the server. Included in the request is your router’s IP address. So the server sends the website to your router, and your router knows your computer (and the average cheap home router can handle a few dozen devices connected to it), and sends it on to your computer.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.