To add to Dan's excellent summary, I like to make an analogy to
telephones. You could think of a phone number as equivalent to the IP
address and the local loop circuit ID as roughly the equivalent of a MAC
address. When you dial my phone number, that number is logically
associated with my house (or the circuit that terminates at my house).
If I move across town, I'll keep the same phone number, but my circuit
ID will change. So there needs to be a way to correlate my phone number
to which ever circuit is supposed to connect when it is dialed.
This isn't a perfect correlation, but it demonstrates the need for
logical vs. physical end-points. Data networks, as both you and Dan
mentioned, are divided up into a layered model. The Network layer
(layer-3) keeps track of logical (IP) addresses, and Ethernet (as one of
many possible data-link layer protocols) handles delivery to a specific
device (or network card). Because, unlike telephones, devices running a
TCP/IP stack are intelligent, they "know" their IP addresses. In order
to send a packet to an IP address, ultimately it must be delivered to
the unique device. ARP is the bridge between the two. Since an IP
address can be assigned to any ethernet device, it is utilized to
associate (temporarily) an IP address to a real-world computer, printer,
whatever. Once the network layer builds the TCP (or UDP or ICMP or
whatever) packet with a destination IP address, it hands it down to the
link layer. The transition requires an ARP to discover which device owns
that IP address. Once it is known, another header ( the ethernet header)
is added with the source and destination MAC address (at which point it
becomes a "frame"). When the device with the destination MAC address
receives the frame, it removes the ethernet header and sends the packet
up to the network layer which deals with the IP address, then to the
transport layer which looks at the transport protocol and port, and so
on until, at the highest level, data is presented to the application
listening on that port.
As Dan pointed out, this means we can change our link-layer protocol
without having to deal with anything up the chain. That's what makes it
possible to connect to your DSL router using ethernet, then shoot the
same TCP/IP packet to your ISP using point-to-point protocol over ATM
(PPPoA), Frame relay to the next ISP, the back to Ethernet to the web
host. Nothing above layer-2 cares about any of this. Similarly, we will
move into IPv6 globally without the layer-2 transport providers having
to do anything different (or application developers on the other end).
Kurt
Dan N wrote:
> On Wed, 11 Jun 2008 12:45:44 +0000, Klunk wrote:
>
>> Looking at the various OSI layers...
>
> The key word here is layers. Each layer takes care of its own area and
> more or less lets the other layers look after themselves.
>
> Internet protocol (IP) is hardware independent. As the name suggests, it
> is a protocol for routing data in and between networks. Not all networks
> are ethernet based, that is to say, there are different link layer
> protocols. When you route IP packets to a host on the other side of the
> world, you don't think about what hardware they are traversing, you don't
> think about MAC addresses. IP is an abstraction that saves you having to
> worry about differences in hardware.
>
> Ethernet is a link layer protocol. It has a different way of sending data
> than other link layer protocols like frame relay or PPP. Ethernet, frame
> relay and PPP are all methods of moving IP packets.
>
> When you send an IP packet over ethernet, the IP packet gets encapsulated
> inside an ethernet packet. When it reaches its destination the ethernet
> frame gets stripped off and only the original IP packet is presented to
> the network layer. A similar thing happens when you send an IP packet
> over PPP. The network layer is not concerned with how the data is sent at
> the link layer.
>
> Ethernet uses MAC addresses. MAC addresses are limited in their scope. IP
> packets can traverse multiple networks, MAC cannot. IP addresses are an
> abstraction at a layer above the link layer that overcome the limitations
> of the link layer.
>
> Over ethernet, IP addresses will have to be mapped to MAC addresses,
> because this is the level where the data is actually sent. But that IP
> packet might be sent via ethernet to the MAC address of a router, which
> will then encapsulate it with PPP which will send it off somewhere. But
> at the far end, it will be presented to the network layer simply as an IP
> packet.
>
> Dan