EthernetIt is beyond the scope of this document to provide an in depth discussion of ethernet. There are several books on the subject, most of which have little of value to say. Ethernet is a transmission media and a protocol in its own right, however from a router's point of view, there isn't much to it. There are many types of ethernet, but they can all be made to operate together.
Ethernet is a physical media which transmits packets of data at a rate of 10 Mb/s (megabits per second). Each packet is preceeded by a packet header, which identifies the type of packet and contains ethernet (or MAC) addresses.
Every ethernet device has a unique 6 byte address which was placed there by the manufacturer. This address is used to direct a packet to a specific node (computer, router, whatever) on the network. A packet can also be directed to all nodes on the network, by sending it to the broadcast address, FF:FF:FF:FF:FF:FF.
ARPOne aspect of ethernet that does concern us is how computers find out each other's ethernet addresses. With the IP protocol, if we know a computer's IP address, we can ask for its ethernet address with another protocol called ARP (Address Resolution Protocol).
A router with an ethernet port must send packets to specific nodes on that network. To do that without occupying the CPU of all the other nodes on the network, it is directed with the ethernet address of the target host. But first we must learn what it is.
The router first sends out an ARP packet, requesting the ethernet address for whatever computer has the IP address we are seeking. An example is shown below. The router (22.214.171.124) is looking for the ethernet address of 126.96.36.199 (koruna). koruna replies with its ethernet address (0:60:97:bf:41:8e).
10:44:31.427095 arp who-has 188.8.131.52 tell 184.108.40.206 10:44:31.427371 arp reply 220.127.116.11 is-at 0:60:97:bf:41:8e
The router caches this information, so that it is not constantly asking this question. It is stored in memory on the router, in an ARP table:
Protocol Address Age (min) Hardware Addr Type Interface Internet 18.104.22.168 4 00c0.7b6e.53dc ARPA Ethernet0/2 Internet 22.214.171.124 - 00e0.1e89.30c2 ARPA Ethernet0/2 Internet 126.96.36.199 53 0000.0c8d.2680 ARPA Ethernet0/2 Internet 188.8.131.52 4 00c0.7b5e.9e80 ARPA Ethernet0/2