6  Services

DHCP, DNS and HTTP are ordinary packets. That is why they can be firewalled.

6.1 The Concept First

NetSim runs services as real packet exchanges:

  • DHCP: dhclient sends DISCOVER, receives OFFER, sends REQUEST and receives ACK. The client installs the address, default route and nameserver.
  • DNS: an A-record server answers dig over UDP/53. Hostname resolution is wired into ping, traceroute, nc and curl.
  • HTTP: a configurable web server answers curl over the simulated TCP handshake.
  • TCP/UDP: nc tests ports, nc -l listens, ss and conntrack -L show state.

All service traffic animates on the wire. Block UDP/67 and DHCP dies. Block UDP/53 and DNS dies. Block TCP/80 and the web dies.

6.2 Understanding Through a Postal Service

DHCP is the address assignment desk. DNS is the directory. HTTP is the parcel.

Each has a protocol, a server and a failure mode.

6.3 Discovering Services with Your AI Partner

Exploration 1: Trace DHCP

Ask the AI to label the four packets.

dhclient runs on pc2 against a DHCP server. List the four packets, the
direction, the transport and what the client installs after the ACK.

A good answer names DISCOVER, OFFER, REQUEST and ACK.

Exploration 2: Break DNS

Ask what happens when UDP/53 is blocked.

A firewall drops udp/53 between pc2 and the DNS server. Explain what
happens to dig, ping by name and curl by name. What still works by IP?

The failure is specific, not “the network is down”.

Exploration 3: Test the Web

Ask how to read a curl failure.

curl http://web.lan/ fails. List the checks in order: DNS, route, TCP
connect, firewall and server. Explain what each result would tell you.

A structured diagnosis beats guessing.

6.4 From Concept to Practice

A service record:

Service Client Server Port Evidence
DHCP pc2 dhcp UDP/67 ip addr, lease
DNS pc2 dns UDP/53 dig
HTTP pc2 web TCP/80 curl -v
Test pc2 target TCP nc

6.5 Build Task

Run dhclient, then dig, then curl. Capture the packets and the state each step installs.

6.6 Classroom Connection

Services teach dependency. A web request depends on DNS, routing and TCP. The failure points are the lesson.

6.7 Practice Exercises

Exercise 6.1 (Level 1). Name the four DHCP packets. Exercise 6.2 (Level 2). Resolve a name with dig. Exercise 6.3 (Level 3). Fetch a page with curl. Exercise 6.4 (Level 4). Block DNS and explain the failures. Exercise 6.5 (Level 5). Diagnose a curl failure in order.

6.8 Chapter Summary

  • Services are packet exchanges.
  • DHCP assigns address, route and nameserver.
  • DNS resolves names over UDP/53.
  • HTTP runs over TCP.
  • Service traffic can be firewalled.

6.9 Reflection

Before moving on, ensure you:

6.10 Your Learning Journal

  1. Which service was easiest to break?
  2. What did the client install?
  3. Where did the failure appear first?

6.11 Next Steps

The services work. The next chapter uses the bundled labs and auto-grader.