Routing (Part 1: How to send via the router)

If a packet is being sent to the local network (eg, "A" sending a packet to "B"), it will need B's MAC address (via ARP, as discussed above). If it is sending to another network, it will not need the destination's MAC address, just that of the router it is sending the packet to. So, for G to send a packet to F, the packet sent by G would look like this:

Source IP192.168.1.4(G)
Source MAC02:F1:A0:23:37:52(G)
Destination IP192.168.2.4(F)
Destination MAC01:33:4A:DC:7B:37(firewall)
DataHello F! My name is G

However, the packet received by F (from the firewall) would look like this:

Source IP192.168.1.4(G)
Source MAC01:33:4A:DC:7B:37(firewall)
Destination IP192.168.2.4(F)
Destination MAC05:4C:5D:CA:83:23(F)
DataHello F! My name is G

So G and F never know each others' MAC address; they don't need to. The firewall knows both, because it talks directly to both hosts.

In the same way, when your PC talks to www.google.com, it does not need to know anything about Google's physical address, only the address of your ISP's router. At a higher level, you personally don't need to know Google's IP address (eg, 64.233.183.147), only the TCP name (www.google.com). This is how TCP/IP blend together; IP deals with the "internet" side of things, whilst TCP deals with the higher levels.

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

Want to take the tutorial with you?

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

Buy my 564-page Shell Scripting Book...

From Amazon USA:

From Amazon UK:

For Kindle:

Or From other retailers

You can also find the book, and join a shell scripting community, on Facebook:


Option Two: Buy the 70-page PDF (£4.99/$9.99/€6.99)
(Free Sample)

And you can always Download my Free Shell Scripting Cheatsheet PDF