A Single Network

If A wants to talk to B, well, they're on the same LAN (Local Area Network), so A addresses the packet directly to B:

Simple 192.168.1.0/24 network with two hosts A (192.168.1.1) and B (192.168.1.2)

So "A" can send a packet to "B" like this:

Source IP192.168.1.1(A)
Destination IP192.168.1.2(B)
DataHello B! This is the Data

Unfortunately, it's not as simple as that. The IP address identifies the machines at a software (logical) level, but the physical (MAC) layer isn't the same as the logical (IP) layer.
  • The IP layer needs to be able to route from Alaska to Zebediela. It works at a relatively high level.
  • The MAC layer only needs to talk to machines on the local network (LAN). It works at a low level.

Source IP192.168.1.1(A)
Source MAC01:C0:F2:69:31:21(A)
Destination IP192.168.1.2(B)
Destination MAC03:A0:B3:27:A2:2E(B)
DataHello B! This is the Data

So how does A find out what B's MAC address is?

Networking Tutorial
Share on Twitter Share on Facebook Share on LinkedIn Share on Identi.ca Share on StumbleUpon

Get the Book:

My Shell Scripting Book:
    Shell Scripting, Expert Recipes for Linux, Bash and more
is available online and from all good booksellers.

Buy my 600-page Shell Scripting Book...
DefectiveByDesign.org
From Amazon USA:

From Amazon UK:

For Kindle:

DefectiveByDesign.org
Or from other retailers

Facebook:

You can also join a Shell Scripting community on Facebook:



Get the Tutorial as a PDF:

Shell Scripting Tutorial
Buy the 72-page PDF (£4.99 / $9.99 / €6.99) of this tutorial
(Free Sample)

Get the Tutorial on Kindle:

For Kindle from Amazon USA:
For Kindle from Amazon UK:

And you can always Download my Free Shell Scripting Cheatsheet PDF

DefectiveByDesign.org