Chapter 1: Two Blocks & a Ping (host + compile)

Write a clean 4-packet ICMP capture from scratch: name the boxes on the LAN, draw -> arrows, and skip manual checksums forever.

Labs completed0/7
The Situation · 5 min

Somebody swears "the network is down." Build a clean 4-frame ping trace (laptop -> gateway and laptop -> dns_srv) to sanity-check Wireshark filters.

What You'll Pull Off Here

  • Declare endpoints with host name { ip ... } using plain IPv4 or IPv6 literals.
  • Emit Ethernet frames top-to-bottom inside compile { ... } (1 line = 1 frame on the wire).
  • Master the Golden Keyword Rule: built-in keywords are lowercase letters + digits with zero underscores (echorequest, never echo_request).
Interactive Lab Check

Lab 1: Add dns_srv & Ping It Back

Declare a third box host dns_srv { ip 192.168.1.53 }, then send laptop -> dns_srv icmp echorequest and dns_srv -> laptop icmp echoreply so your capture has 4 ICMP frames.

  1. 1.Add host dns_srv { ip 192.168.1.53 } right underneath host gateway.
  2. 2.Inside compile { ... }, add laptop -> dns_srv icmp echorequest id 101 seq 1.
  3. 3.Add dns_srv -> laptop icmp echoreply id 101 seq 1, then click Check Exercise.

1. host — Who Lives on This Wire?

Every .frasm script starts by naming your boxes with host. Give each endpoint a nickname (laptop, dns_srv, fw-dmz-01) and drop ip <address> inside curly braces { ... }.

Too lazy to invent MAC addresses? Leave mac out and FrameAssembly deals out deterministic MACs in declaration order (00:00:00:00:00:01, 00:00:00:00:00:02, ...) so your diffs never churn.

  • Plain host IPs only (ip 192.168.1.10) — leave /24 masks, = signs, and commas at the door.
  • Leave snarky notes for future-you with // comments (# and ; will get yelled at).
  • Built-in keywords never use underscores: write echorequest and echoreply, never echo_request.

2. compile — One Line, One Ethernet Frame

Open compile { ... } underneath your hosts. Each statement fires one complete Ethernet II + IP + ICMP frame into your .pcap, calculating header lengths and RFC 1071 checksums automatically.

Word-by-Word Syntax Breakdown
How one .frasm line maps straight onto Wireshark columns:
laptop -> gateway icmp echorequest id 100 seq 1
laptopSenderSource box (192.168.1.10, auto-MAC 00:00:00:00:00:01)
->DirectionFires the frame from laptop to gateway
gatewayReceiverDestination box (192.168.1.1, auto-MAC 00:00:00:00:00:02)
icmp echorequestProtocol & TypeICMPv4 Echo Request (Type 8, Code 0)
id 100 seq 1Optional TweaksSets ping identifier 100 and sequence number 1
Quick Formatting Reference (3 rules)
ItemValid .frasmAvoid
Host IP formathost laptop { ip 192.168.1.10 }host laptop { ip = "192.168.1.10/24" }
ICMP ping keywordslaptop -> gateway icmp echorequestlaptop -> gateway icmp echo_request
Comments// Ping default gateway# Ping default gateway
first_ping_check.frasmLoading WASM…
Wireshark filter: icmp
Open in Playground
0 B · 0.000 ms
Compiling capture in WebAssembly…
Learn .frasm — Labs, Guides & 81 Protocols | FrameAssembly