Practical, Visual, Three-Dimensional Pedagogy for Internet Protocol Packet Header Control Fields

Tell me what this is:

TCP Header in Lego(TM)
TCP Header in Lego(TM)

If you said, “Hey! That’s a TCP header diagram in Lego(TM)”, or perhaps, “Holy &^%@! That idiot made a TCP header diagram in Lego(TM)!”, then you’re exactly right!  This is another one of those wild, wacky ideas that we dreamed up in the middle of one of my SANS classes (note to the SANS staff: shorter breaks might be a good idea).  I bet my students never thought I’d actually do it.

Of course, you know I couldn’t stop with just doing the TCP header:

IP Header in Lego(TM)
IP Header in Lego(TM)

Now why am I wasting all that space on the building plate in each case?  Why so you can put them together of course:

TCP/IP in Lego(TM)
TCP/IP in Lego(TM)

The use of color here really highlights certain portions of the packet header.  For example, the source and destination addresses and ports really jump out.  But there are some other, more subtle color patterns that I worked in here.  For example, if you look closely you’ll see that I matched the color of the ACK bit with the blue in the ACK number field.  Similarly the colors of the SYN bit and the sequence number match, as do the URG bit and urgent pointer field.

Actually I wish I had a couple of more colors available.  Yes, Lego(TM) comes in dozens of colors these days, but they only make 2×8 blocks (aka one “Lego(TM) Byte”) in six colors: White, Black, Red, Yellow, Blue, and Beige.

Lego(TM) Byte, Nibble, and Bit
Lego(TM) Byte, Nibble, and Bit

So while I tried to use Beige exclusively for size fields, Red for reserved bits, Yellow for checksums, and so on, I ultimately ended up having to use these colors for other fields as well– for example, the yellow sequence number fields in the TCP header.  Maybe I should have just bought a bunch of “nibbles” (2×4 blocks) in other colors and not been so choosy about using full “Lego(TM) Bytes”.

Serious Fun

Cute idea, but is there any practical value?  After a lengthy conversation with my inner child (who is generally more mature than my outer persona), I realized that there was a fun learning game we could make out of all this.  So I labelled all the blocks.  Yes, that’s right. I. Labelled. Every. Single. Block. I even did the individual bits:

TCP Header "Bits" in Lego(TM). Labelled.
TCP Header “Bits” in Lego(TM). Labelled.

So the game becomes learning where all the fields are in the various packet headers so that you can re-create the packet diagrams from piles that look like this:

Lego(TM) blocks waiting to become TCP header diagram
Lego(TM) blocks waiting to become TCP header diagram

Now we can teach students how to decode packet headers by letting them play with Legos(TM).  And that means we can all write off our Lego(TM) collections as a business expense!  How cool is that?

Admit It.  You Can’t Wait To Do It Too!

Project Tools
Project Tools

If you’ve got a hankering to try this out for yourself, it doesn’t take a whole lot.  I way overbought on the Lego front: six green base-plates, and 20 2×8 “Lego(TM) Bytes”, 8 “Nibbles” (2×4 blocks), and 16 “Bits” in each color.  Total cost for the Lego(TM) was around US$100 delivered.

Labelling was accomplished with my P-Touch(TM) labeller.  3/8″ ribbon is precisely the right height to be placed on the side of a Lego(TM) block.  It also helps to have a razor blade type tool to help separate the P-Touch(TM) labels from their backing and apply them to the blocks.

And of course I have to give a shout-out to the late, great Richard Stevens and his biblical tome TCP/IP Illustrated: Vol 1.  If you don’t already own this book, buy it. Seriously.

Final Thoughts

Finally, to all of you who think I need a life, all I have to say is:

Labelled TTL "Lego(TM) Byte"
Labelled TTL “Lego(TM) Byte”

Baby, I’m living the dream!


44 thoughts on “Practical, Visual, Three-Dimensional Pedagogy for Internet Protocol Packet Header Control Fields”

  1. Well done. It’s hard to beat a graphic representation, especially when you get to something as technical as packet headers. Now, onto UDP!

  2. Great! Makes it so easy to get. Used to look at traces all the time and had the hardest time explaining umm, they never acked our syn ack..etc.
    Bookmarking and sharing!

  3. Bounced here from

    Great stuff! I’m going to go steal my nephew’s LEGOs and dust off the label maker, so I can have a go at this. Tactile learning is how I roll.

  4. […] Hal Pomeranz, Deer Run Associates Tell me what this is: If you said, "Hey! That's a TCP header diagram in Lego(TM)", or perhaps, "Holy &^%@! That idiot made a TCP header diagram in Lego(TM)!", then you're exactly right!  This is another one of those wild, wacky ideas that we dreamed up in the middle of one of my SANS classes (note to the S … Read More […]

  5. Geeky sweetness! But you know, bro, I think that mom’s got the massive childhood Lego(R) collection still stashed in boxes back here in the sultry East. You really should call me the next time your inner child takes control…

  6. Hal: I’m terribly afraid you’re going to do something rash like an IPv6 version. 🙂

  7. Pure genius! Love it.
    Do you mind if I use the image in some PPT (with credit associated of course)?

  8. Hey, before everybody goes berserk, we need an RFC describing the scheme and specifying the colors. Interoperability would be adversely affected by implementations using different colors for checksums, for example.

  9. And to think when I taught high speed Internet I only used Mega Blocks to display and show the layering of the OSI model… also tough to get the right color schemes!

  10. or to go a little more overboard with this, you could have 9 green boards to exactly represent the 576 byte minimum IPv4 packet (i think, they’re 32x32peg square right?), then assemble the IP & TCP headers at the top of the first board. you could (sacrilegiously) cut the first board up to allow one to still separate the 2 assembled header blocks

  11. In a similar frame of mind, here’s an interesting video using Legos to explain the issues related to Net Neutrality.

  12. […] Computer Networking 101 — studying what a TCP/IP packet looks like. Can be a little like watching paint dry. That’s why I love this: a hands-on approach to looking at the headers in both protocols:… […]

  13. Make a ping packet, send it in the mail to someone else who has implemented TCP/IP using lego and snail mail. Ping time of days :-O

  14. Love the ping idea. We need an RFC along the lines of 1149. We’d need extra protocol units (compose the packet completely out of Lego(TM) Bits rather than Bytes or Nybbles?) but that shouldn’t be hard. Who’s going to build codecs out of Mindstorms?

  15. Didn’t think of the Mindstorms codec, but that’s an excellent idea. Could go from PC to PC where the only human interaction is the postal service and packet insertion/extraction for the codec. Alternatively, if you want to ping another computer in-house, have no human interaction by making a Mindstorms robot carry the packet around 😉

    (I remember 1149 was actually implemented by some blokes in my home town ( 😀 )

  16. If you put together a kit and sell it on the internet for $20-$30, I’ll buy one!

    There is a great business idea…

Comments are closed.