CCN Activity Session 1 – IP Addressing and Subnets As you’ve heard in the session, IPv4 has a dotted decimal notation, which allows an easy translation to binary. Each element of the dotted decimal representation refers to an octet in the binary address, thus 184.108.40.206 in dotted decimal notation will translate into 11000001 00100000 11011000 00001001 in binary. Question Consider the following IP addresses; what are their binary notation equivalents? Which network classes do they belong to, and what might they be being used for? 192.168.0.4 11000000101010000000000000000100 – Class C 220.127.116.11 10010011101111000111101100000110 – Class B In practice, subnets are used in IP networking to help route packets between networks / sites within an organisation, and to ease administration. Types of subnet can be described using a postfix to the dotted decimal notation, for example 192.168.1.0/24 is shorthand for the upper 24 bits of the network address must always be the same for machines to talk on the subnet. In this case only the lower 8 bits would then be available for machine addresses, but the 192.168.1 portion could be used to route traffic to that physical network (say a particular floor of a building). Question The figure below (from Kurose & Ross) shows a simple set of subnets and routers. How many subnets are used in the example? What are the subnet identifiers of each? 6 subnets are in use: 18.104.22.168/24, 22.214.171.124/24, 126.96.36.199/24, 188.8.131.52/24, 184.108.40.206/24, 220.127.116.11/24 Subnet masks are used to apply subnet restrictions to binary notation IP addresses. This means that system administrators have lots of freedom in their assignment of subnet/host combinations. A subnet mask consists of binary 1s for every bit position except for the host address portion, which consists of 0s. For example, consider an organisation with many small subnets, each with less than 16 hosts. A suitable subnet mask would be 11111111 11111111 11111111 11110000 or 255.255.255.240 in dotted decimal, as this would allow up to 16 binary-addressed hosts (the lower four bits) in any subnet. Now assume the organisation has a class B address range beginning 144.123.x.x. A packet arrives for IP 18.104.22.168 – which subnet should it be routed internally? To determine this, routers take the binary representations of the subnet mask and the IP address, and perform a binary AND operation: Subnet mask: 11111111 11111111 11111111 11110000 IP address: 10010000 01111011 00011001 11110100 Subnet number: 10010000 01111011 00011001 11110000 The subnet number equates to 22.214.171.124 in dotted decimal, and it is this that is used to route the packet to the subnet (which is of course connected to an interface on one of the organisation’s routers). Activity Check that the subnet mask works by finding out which subnet address 126.96.36.199 would be routed to on the same network. Subnet mask: IP address: Subnet number: 11111111 11111111 11111111 11110000 10010000 01111011 00011001 11111000 10010000 01111011 00011001 11110000 Dotted decimal conversion: 188.8.131.52 – therefore the packets would be routed to the same subnet as the previous example. Subnets are a very powerful concept, as they can be used to give administrators very precise control of the network. For example, using the 184.108.40.206/24 subnet in the incoming firewall rules on a server, allows the administrator to specify only machines on the 149 subnet (all of which are inside the University) can access that server. Discuss The 220.127.116.11 – 18.104.22.168 address block is associated with the University of Birmingham. What does the address block tell you about our network? Either individually or in small groups discuss the implications of this, including the network class, the possible numbers of hosts, how we might split up the space available, and whether this system will be suitable for the future. The University has a class B address range. We tend to split this up into subnets in the third octet, giving us 254 addresses in each subnet. The current system will not continue to meet the University’s needs going forward. Further reading Classless Interdomain Routing (CIDR) generalises the notation of subnet addressing to a known prefix rather than the full class description traditionally used. This has resulted in much more flexible use of the unassigned address space. Find out more about CIDR as part of your free study time.