Domain names, DNS and IP addressing – subnet masks and routing

Computer ScienceNetworks & the InternetAges 15–16

Use with my class

Type a domain name and a DNS server looks it up in a table to return the matching IP address. The program then ANDs your device's IP address with the subnet mask to get the network address, does the same for the destination, and compares them: the same network address means the two devices talk directly, a different one means the packet must travel through a router over several hops. Extra screens cover IPv6 addresses (128 bits, zero compression), NAT translating private addresses to one public address, DHCP handing out dynamic and static addresses, MAC addresses with a learning switch, and the roles of DNS, DHCP, web, mail, file and proxy servers.

Lesson: IP addresses, domain names and the DNS service; subnetting, subnet masks and the role of routers

What it shows

Devices on the Internet are identified by IP addresses, but people remember domain names, so a DNS server translates one into the other. An IPv4 address has 32 bits; a subnet mask and a bitwise AND give the network address, which decides whether a packet goes directly or through routers. Because 32 bits allow only about 4.3 billion addresses, homes use private ranges behind NAT, and IPv6 uses 128 bits. DHCP lends addresses for a lease time, while servers and printers keep static ones. A network card's 48-bit MAC address delivers frames inside the local network.

How to use

Type a domain or click a row in the DNS records table, press Look Up DNS, then choose a mask and press Send Packet. Use the tabs above the diagram for the other screens: edit an IPv6 address or click its bits, send requests from the Laptop, Phone or Tablet through NAT, press New Device Joins and +1 Hour to watch DHCP leases, press Send Frame to see the switch learn MAC addresses, and pick a request and press Go.

Parameters you can change

  • Domain to look up
  • Your device's IP address
  • Subnet mask /8 – 255.0.0.0, /16 – 255.255.0.0, /24 – 255.255.255.0, /25 – 255.255.255.128
  • Number of routers along the path 1–6 hops
  • Show the binary AND operation
  • Screen DNS, IP addresses and subnet masks, IPv6 addresses, NAT and private addresses, DHCP: dynamic and static addresses, MAC addresses and the switch, Server roles in a network

Questions to explore

  1. Using the AND result, are 192.168.1.25 and 192.168.1.200 on the same network with a /25 mask?
  2. Why may “::” appear only once in a compressed IPv6 address?
  3. How many devices can a /24 network hold compared with a /25 network?