Introduction to Ethernet

Hello Adrian, good to have you with us! Glad to hear that you’re enjoying the lessons!

In order to understand what is going on, let’s take it step by step. The packet has arrived from the Internet at the SOHO router. Now we don’t know what kind of header we’ll find at layer 2, as this depends on the technology being used. If it’s ADSL, serial link, or cable modem, each of these have a different L2 technology, and therefore a different L2 header. Whatever it is, the L2 header is stripped off, and we are at Layer 3 of the OSI model. So we take a look at the IP header. It has the outside (public) address of the router as a destination address.

Now is you correctly stated, this IP address is translated using NAT, and the corresponding inside IP address replaces the destination address. Once the IP header is correctly translated, the next step is for the SOHO router to decide where to send the packet. In most cases, there is only one choice, as there is only a single routed port on the inside of such devices. (Remember that a SOHO router connects the WAN to the LAN using layer 3 routing).

So the router then has to add a L2 header with the appropriate MAC address. In order to do so, it takes a look at its ARP table to see if this destination address (the newly translated internal address) exists in its ARP table. If it does, the destination MAC is populated, the source MAC is it’s own, and the frame is sent. If it doesn’t exist in the ARP table, then it sends out an ARP request for the particular destination IP, receives the destination MAC address, populates the appropriate field in the L2 header and sends it on its way.

I hope this has been helpful!

Laz