A new teller PC arrives at a bank branch in Sylhet. The IT officer plugs in the cable, opens the network settings and types four short lines: an address, 10.40.9.25; a mask, 255.255.252.0; a gateway, 10.40.8.1; and a DNS server. He presses OK, and within a second the PC can reach the core banking server in Motijheel, two hundred kilometres away, through routers it has never heard of. Change one digit of that mask and the same PC can no longer reach the printer on the next desk.
What did those four numbers do? The mask tells the PC which addresses are on its own network; the gateway is the router it hands everything else to. That is what this chapter is about. IP addressing and subnetting is the networking topic that bank, BCS and power-sector papers ask most often, in one-mark MCQs and in long written sums.
By the end of the chapter you'll be able to say what an IP address is and why a computer needs one as well as its hardware (MAC) address, and read the parts of the IPv4 header that carry it. You'll convert addresses to binary and back, name an address's class, and pick out the special, private and public ones. You'll explain what a subnet mask and a /n prefix mean, find the network address, broadcast address and host range of any address in a minute, and design subnets for a stated number of hosts or departments.
We'll go in seven parts, from easy to hard: the address itself and the packet it travels in, binary, the old classful system, the special and private addresses, the mask and CIDR, and finally subnetting, first reading an address and then designing a network.