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.
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 frameon the wire). - Master the Golden Keyword Rule: built-in keywords are lowercase letters + digits with zero underscores (
echorequest, neverecho_request).
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.Add
host dns_srv { ip 192.168.1.53 }right underneathhost gateway. - 2.Inside
compile { ... }, addlaptop -> dns_srv icmp echorequest id 101 seq 1. - 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/24masks,=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
echorequestandechoreply, neverecho_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 BreakdownHow one .frasm line maps straight onto Wireshark columns:
.frasm line maps straight onto Wireshark columns:laptop -> gateway icmp echorequest id 100 seq 1laptopSenderSource box (192.168.1.10, auto-MAC 00:00:00:00:00:01)->DirectionFires the frame from laptop to gatewaygatewayReceiverDestination 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 1Quick Formatting Reference (3 rules)
| Item | Valid .frasm | Avoid |
|---|---|---|
| Host IP format | host laptop { ip 192.168.1.10 } | host laptop { ip = "192.168.1.10/24" } |
| ICMP ping keywords | laptop -> gateway icmp echorequest | laptop -> gateway icmp echo_request |
| Comments | // Ping default gateway | # Ping default gateway |
icmp