A charity's staff often work from cafés. The privacy officer wants the names they look up to be unreadable to anyone watching the café network.
ARP, ICMP, DHCP and DNS: the network's helpers
Before a laptop can open a web page it must be given an address, find the hardware address of its neighbours and turn the name of the site into a number. Four small protocols do these jobs: DHCP, ARP, DNS and ICMP. No background is assumed. Each was designed to trust whatever answer arrives, and several well-known attacks begin with that trust.
By the end of this unit you will be able to:
- Explain what DHCP, ARP, ICMP and DNS each do for a device on a network
- Put the four DHCP messages in order
- Explain how a name is resolved and what the common DNS record types hold
- Explain why ARP, DHCP and DNS can be given false answers, and name the control for each
- Tell apart what DNSSEC protects and what it does not
A new laptop joins the office
An illustrative example
At an accountancy office a new starter opens her laptop and joins the office network. Nobody types a number. Within two seconds the laptop has an address of its own, knows which machine leads to the internet and knows which machine turns names into addresses.
She types the name of the payroll site. The laptop looks up the site's address, works out how to hand a message to the office router, and the sign-in page appears.
Several separate exchanges took place before the page appeared. What did the laptop have to learn in each?
DHCP hands a device its address and settings
A device joining a network needs four settings: an IP address, a subnet mask, a default gateway and the address of a server that looks up names. The Dynamic Host Configuration Protocol (DHCP) supplies all four automatically. The address is lent for a set time, called a lease.
- Discover: the new device broadcasts a request to the whole local network, because it does not yet know where the DHCP server is.
- Offer: a DHCP server replies with an address it can lend.
- Request: the device asks for the address it was offered.
- Acknowledge: the server confirms, and the lease begins.
DHCP in four steps: Discover, Offer, Request, Acknowledge. The initials spell DORA. The server uses UDP port 67 and the client UDP port 68.
DHCP cannot prove that an offer comes from the real server. A rogue DHCP server is an unauthorised one that answers first and hands out a false gateway or name server, so that the victim's traffic goes where the attacker chooses. In DHCP starvation an attacker requests every spare address under invented identities, and real devices get none.
The defence is DHCP snooping, a feature of . The switch is told which ports lead to the real DHCP server and drops server messages that arrive on any other port.
ARP finds the hardware address for an IP address
Every network connection has a hardware address, also called a MAC address: a 48-bit number set by the maker. It is written as six pairs of hexadecimal digits, such as 02:00:00:00:01:01. Hexadecimal counts with the digits 0 to 9 and the letters a to f. The first half of the address identifies the maker.
A frame can be delivered only to a hardware address, yet a device usually knows only the IP address it wants. The Address Resolution Protocol (ARP) fills the gap. The device broadcasts a question to the local network: who has 10.20.30.1? The owner answers with its hardware address. The device keeps the answer for a while in its ARP cache.
has no check on who answers. In ARP poisoning, also called ARP spoofing, an attacker on the same network sends false answers that pair the gateway's IP address with the attacker's own hardware address. Victims then send their traffic to the attacker, who can read it and pass it on unnoticed.
Switches defend against this with dynamic ARP inspection, which checks ARP answers against the addresses that DHCP snooping recorded and drops those that do not match. traffic limits what a successful poisoner can read.
Reverse ARP (RARP) did the opposite job. A machine that knew only its hardware address asked a server for its IP address. DHCP has taken its place.
ICMP reports problems and answers pings
The Internet Control Message Protocol (ICMP) carries error reports and simple tests between devices. It is part of IP itself, with protocol number 1, and it has no ports. Each message has a type number.
| Type | Name | Meaning |
|---|---|---|
| 8 | Echo request | Are you there? Sent by the command |
| 0 | Echo reply | Yes. The answer to a ping |
| 3 | Destination unreachable | The could not be delivered |
| 11 | Time exceeded | The packet's time to live reached zero on the way |
| 5 | Redirect | A better router exists for that destination |
Ping sends echo requests and times the replies, which shows whether a device can be reached. Traceroute maps a path. It sends packets with a time to live of 1, then 2, then 3. Each router that discards one returns a time exceeded message and so reveals itself.
Attackers use ICMP to find live devices and to steer or flood traffic, so limit it. Blocking all of it causes faults that are hard to diagnose. The sound allows the types the organisation needs and refuses the rest.
The Internet Group Management Protocol (IGMP) sits beside ICMP. Devices use it to tell their router which multicast groups they have joined, so that traffic for a group is sent only where someone wants it.
DNS turns names into addresses
People use names such as portal.example, and networks use numbers. The Domain Name System (DNS) translates between them. It is a worldwide directory arranged as a tree. At the top is the root. Below it are the top-level domains, such as org and uk. Below those are the domains that organisations register.
No single server holds everything. An authoritative server holds the records for one part of the tree, called a zone. A device does not search the tree itself. It asks a resolver, usually run by its organisation or internet provider. The resolver asks the authoritative servers in turn and keeps each answer for a time in its cache.
How a resolver finds the address for a name
Read this figure as text
DNS is a worldwide directory arranged as a tree: the root at the top, the top-level domains below it, and the domains organisations register below those. A device does not search the tree itself; it asks a resolver, usually run by its organisation or internet provider.
- The laptop sends one question, the address of portal.example, to its resolver on UDP port 53. The resolver first checks its cache.
- If the answer is not cached, the resolver asks a root server, which refers it to the servers for the top-level domain.
- The resolver asks a top-level domain server, which refers it to the authoritative servers for the domain.
- The resolver asks the authoritative server, which holds the zone and replies with the A record, the IPv4 address. The resolver keeps the answer in its cache for a time and returns it to the laptop.
- In DNS cache poisoning an attacker gets a forged answer in before the real one. A resolver that checks DNSSEC signatures, in a chain up to the root, detects the forgery; one that does not stores the false address and gives it to everyone who asks until the entry expires. DNSSEC signs answers but does not encrypt them.
| Record | Holds |
|---|---|
| A | The for a name |
| AAAA | The for a name |
| MX | The mail server for a domain |
| NS | The authoritative name servers for a zone |
| CNAME | An alias: one name that points to another name |
| PTR | The name for an address, the reverse of an A record |
| SOA | Start of authority: marks the start of a zone and holds its settings |
| TXT | Free text attached to a name |
Lookups travel on port 53. TCP port 53 carries answers too large for UDP, and it carries the zone transfer, in which a secondary server copies a whole zone from the primary. A full zone lists every named machine an organisation has, so transfers are allowed only to known secondary servers.
DNS can be lied to, and DNSSEC signs the answers
A resolver accepts the first answer that matches its question. In DNS cache poisoning an attacker gets a forged answer in before the real one. The resolver stores the false address and gives it to everyone who asks until the entry expires. Users who type the right name arrive at the attacker's server.
Resolvers make forging harder by choosing unpredictable query numbers and source ports. The stronger answer is the DNS Security Extensions (DNSSEC). Each zone signs its records with a private key. A resolver checks the signatures with the zone's public key and checks that key against the zone above, in a chain that ends at the root.
DNSSEC proves two things: the answer came from the real zone, and it was not altered on the way. It does not encrypt. Anyone watching the network can still read which names are looked up, and DNSSEC does nothing to stop a flood aimed at a name server. needs encryption of the lookup itself: DNS over TLS on port 853, using the same encryption as secure web pages, or DNS over HTTPS inside ordinary web traffic on port 443.
Split DNS gives different answers to questions from inside and from outside an organisation, so that internal names and addresses are not published to the internet.
Common misconception
“DNSSEC keeps DNS lookups private.”
DNSSEC signs answers so that a forgery can be detected. It gives origin authentication and integrity. Questions and answers still travel in readable form.
A question, worked through
Staff at a law firm report that the firm's document portal sometimes opens a look-alike page that asks for their password. It happens only in the office. From home the portal is always genuine. The network team finds an unknown device on the office network that answers address requests from laptops and names itself as their name server. The security manager is asked which control deals with the cause.
Which control BEST addresses the cause?
Decide on your answer, then open the reasoning
- The fault appears only in the office, and an unknown device there is handing out network settings. That is a rogue DHCP server pointing laptops at a false name server.
- Rule out d: ping has no part in this. Blocking echo requests at the firewall changes nothing inside the office.
- Rule out c: zone transfers are copies of the firm's zone between its own servers. Nobody has copied the zone.
- Between a and b: DNSSEC lets a resolver detect forged answers, but these laptops are asking the attacker's resolver, which will not check. The lie is told one step earlier, when a laptop is told which resolver to use.
- DHCP snooping makes the switches drop DHCP offers from every port but the real server's. It removes the cause, so a.
Answer: A. Enable DHCP snooping on the office network switches
Choosing between good answers
- Victims on one local network are sent to the wrong gateway or the wrong name server
- suspect a rogue DHCP server or ARP poisoning. Both work only from inside that network, and both are stopped at the switch.
- Everyone who uses one resolver reaches a false site by its correct name
- suspect DNS cache poisoning. DNSSEC is the control that detects the forged answer.
- An option says DNSSEC provides confidentiality
- reject it. DNSSEC provides origin authentication and integrity only.
- A question asks which transport DNS uses
- answer UDP port 53 for lookups and TCP port 53 for zone transfers.
Try it
Watch a laptop decide that a server is on its own subnet, ask for its hardware address with ARP, and send the frame through the switch.
Loading the preview.
Check your understanding
3 questions on this unit, easiest first. Confirm an answer to see the reasoning for it, then the right answer, the other options and the rule to reuse. Your answers are kept in this browser and feed readiness and review.
These questions are drafts that no named reviewer has approved yet.
Question 1 of 3
What to remember
- DHCP lends a device its address, mask, gateway and name server in four steps: Discover, Offer, Request, Acknowledge.
- ARP finds the hardware address for an IP address on the local network. It trusts any answer, which is what allows ARP poisoning.
- ICMP carries errors and tests. Ping uses echo request and echo reply. Traceroute relies on time exceeded.
- DNS resolves names through a resolver that asks authoritative servers. Lookups use UDP 53 and zone transfers use TCP 53.
- DHCP snooping stops rogue DHCP servers, dynamic ARP inspection stops ARP poisoning, and DNSSEC detects forged DNS answers.
- DNSSEC signs. It does not encrypt.
Say it from memory
What are the four steps of DHCP, which ports does it use, and which switch feature stops a rogue DHCP server?
Discover, Offer, Request, Acknowledge, which spell DORA. The server uses UDP port 67 and the client UDP port 68. DHCP snooping makes the switch drop server messages arriving on any port other than those that lead to the real DHCP server.
What does ARP do, what is ARP poisoning, and which switch feature defends against it?
ARP finds the hardware address that belongs to an IP address on the local network. In ARP poisoning an attacker sends false answers pairing the gateway's IP address with the attacker's own hardware address, so victims send their traffic to the attacker. Dynamic ARP inspection checks ARP answers against the addresses DHCP snooping recorded and drops those that do not match.
What do ICMP types 8, 0, 3 and 11 mean, and how does traceroute use type 11?
Type 8 is echo request and type 0 is echo reply, used by ping. Type 3 is destination unreachable. Type 11 is time exceeded. Traceroute sends packets with a time to live of 1, then 2, then 3, and each router that discards one returns a time exceeded message and so reveals itself.
What do the DNS A, AAAA, MX and PTR records hold, and which port and transport carry a zone transfer?
An A record holds the IPv4 address for a name and AAAA the IPv6 address. MX holds the mail server for a domain. PTR holds the name for an address, the reverse of an A record. A zone transfer travels on TCP port 53.
What does DNSSEC prove, what does it not do, and what gives DNS lookups privacy?
DNSSEC proves that the answer came from the real zone and was not altered on the way: origin authentication and integrity. It does not encrypt, and it does not stop a flood aimed at a name server. Privacy needs DNS over TLS on TCP port 853, or DNS over HTTPS on port 443.
Sources
- RFC 2131: Dynamic Host Configuration Protocol, IETFThe DHCP messages discover, offer, request and acknowledge; the lease; UDP port 67 for the server and 68 for the client.
- Cisco Nexus 9000 Series NX-OS Security Configuration Guide, Release 7.x: Configuring DHCP, CiscoDHCP snooping stands between untrusted hosts and trusted DHCP servers, filters invalid server messages and keeps a binding database that dynamic ARP inspection uses.
- RFC 826: An Ethernet Address Resolution Protocol, IETFARP broadcasts a request for the 48-bit hardware address that goes with a protocol address, the owner replies, and the protocol has no authentication.
- IEEE RA Guidelines for Use of EUI, OUI, and CID, IEEE Registration AuthorityA 48-bit MAC address is formed from an identifier assigned to the maker followed by 24 bits the maker supplies.
- RFC 903: A Reverse Address Resolution Protocol, IETFReverse ARP let a workstation that knew only its hardware address find its protocol address from a server.
- RFC 4732: Internet Denial-of-Service Considerations, IETFARP spoofing diverts traffic on a local network, and spoofed hardware addresses can exhaust a DHCP server's pool.
- RFC 792: Internet Control Message Protocol, IETFICMP is part of IP, reports errors in datagram processing, and defines echo, echo reply, destination unreachable, redirect and time exceeded with their type numbers.
- RFC 2151: A Primer On Internet and TCP/IP Tools and Utilities, IETFPing uses ICMP echo messages; traceroute raises the time to live step by step and reads the time exceeded messages routers return.
- NIST SP 800-41 Rev. 1: Guidelines on Firewalls and Firewall Policy, NISTAttackers use ICMP for reconnaissance, blocking all of it causes diagnostic problems, and policy should permit only the types the organisation needs.
- RFC 3376: Internet Group Management Protocol, Version 3, IETFIGMP is how IPv4 systems report their multicast group memberships to neighbouring routers.
- RFC 1035: Domain Names, Implementation and Specification, IETFThe A, NS, CNAME, SOA, PTR, MX and TXT record types; port 53 on UDP and TCP; zone transfers over TCP.
- RFC 3596: DNS Extensions to Support IP Version 6, IETFThe AAAA record holds one IPv6 address.
- RFC 9499: DNS Terminology, IETFThe meanings of resolver, authoritative server, zone transfer, root zone, top-level domain and split DNS.
- RFC 5936: DNS Zone Transfer Protocol (AXFR), IETFZone transfers run over TCP and should be restricted to specific clients.
- RFC 5452: Measures for Making DNS More Resilient against Forged Answers, IETFA resolver accepts the first response that matches its query, and unpredictable query IDs and source ports make forged answers harder.
- RFC 4033: DNS Security Introduction and Requirements, IETFDNSSEC provides origin authentication and integrity through a chain of signatures from a trust anchor, and provides neither confidentiality nor protection against denial of service.
- RFC 7858: Specification for DNS over Transport Layer Security (TLS), IETFDNS over TLS on TCP port 853 keeps lookups private from anyone watching the network.
- RFC 8484: DNS Queries over HTTPS (DoH), IETFDNS over HTTPS carries lookups inside HTTPS, on the HTTPS default port 443.