Internet Protocol Addressing Overview
IP version 4 (IPv4) addresses are made up of four 8-bit fields (octets)32 bits total. There are five IPv4 address classes: A, B, C, D, and E.
IPv4 addresses consist of a network ID and a host ID. The network ID identifies the numeric network name of the physical network where the hosts exist. The host ID identifies the numeric network name of the individual TCP/IP host on a network. The numeric host ID must be unique on the internal networkthat is, no two nodes on a network can have the same network ID and host ID.
NOTE
You can have two hosts with the same numeric IP hostname of 16.72.28 if one is on network 111 and another is on network 112. (The full IP addresses of these hosts would be 111.16.72.28 and 112.16.72.28. The subnet mask would be 255.0.0.0.)
A subnet mask is used to divide an entire TCP/IP address in an effort to define which part of the address is the network number and which part is the host system's numeric identifier. The bits in a subnet mask are set consecutively from left to right. For example, the subnet mask 255.128.0.0 is valid because all eight bits are set in the first two octets and the first bit of the next octet is also set (11111111.10000000.00000000.00000000). The subnet mask 255.64.0.0 is not valid because it has a "missing" bit, which is not allowed (11111111.01000000.00000000.00000000).
NOTE
Bit values are held to a specific order, from the Most Significant Bit (MSB) to the Least Significant Bit (LSB). From left to right, these designations are 128, 64, 32, 16, 8, 4, 2, and 1. Each bit that's set is noted by a "1" (showing that the bit is "on" or "enabled"), and bits are added together to give you the address. The IPv4 address 171.144.62.12 converts to a binary number of 10101011.10010000.00111110.00001100 and a hexadecimal number of AB.90.3E.0C.
CAUTION
You need to have a fairly good understanding of host IDs, network IDs, subnetting, and masks for just about any Microsoft certification exam. Any exams that introduce information about networking require you to have at least basic knowledge of TCP/IP addressing.
IP version 6 (IPv6) has been designed to overcome the current shortage of addresses under IPv4 and offers some changes to TCP/IP. Table 3.1 outlines some of the major differences between IPv4 and IPv6.
Table 3.1 Differences Between IPv4 and IPv6
Characteristic |
IPv4 |
IPv6 |
Address length in bits |
32 |
128 |
Header size in bytes |
20 to 60 |
40 |
IPSec support |
Optional |
Required |
Maximum Transmission Units (MTUs) in bytes |
576 |
1280 |
QoS support |
Yes |
Yes, with more features |
Fragmentation |
Performed by hosts and routers |
Performed by hosts only |
Header checksum |
Yes |
No |
Header options |
Yes |
No |
Link-layer address resolution messages |
Broadcast ARP frames |
Multicast Neighbor Solicitation |
Error reporting/diagnostic protocol |
ICMP (for IPv4) |
ICMPv6 |
Multicast group membership protocol |
IGMP |
Multicast Listener Discovery (MLD) |
Support for router discovery |
Optional |
Required |
Network layer broadcast |
Yes |
No |
Host configuration |
DHCP or manual |
Automatic, DHCP, or manual |
DNS record type used for name resolution |
(A) record |
AAAA record |
DNS record type used for reverse name resolution |
PTR records in IN-ADDR.ARPA domain |
PTR records in IP6.INT domain |
The original IP definitions set five classes of IP addresses, from A through E. (A, B, and C are for general-purpose use, D is used for multicasting, and E is reserved.) These classes made it possible to use one portion of the 32-bit IP address scheme for the network address and the remaining portion for nodes on the network.
In the past, some networks needed more addresses for systems than the 254 supplied by a Class C address, which was a major contribution to the shortage of IP addresses. Organizations often requested a Class B range that offered 65,534 available addresses rather than a few Class C ranges that might have suited their needs. The result was that many addresses within their allotted Class B blocks went unused.
However, Classless Inter-Domain Routing (CIDR) addressing is now used more often for IPv4 addressing schemes. It effectively "removes" the class from an address for the purpose of combining ranges, so it makes better use of the limited number of remaining available IPv4 addresses. A CIDR network address looks like this:
222.175.14.00/18
The network address is 222.175.14.00. The /18 specifies that the first 18 bits of the address are the network part of the address, which leaves the last 14 bits for the network hosts' address.
CIDR is supported by Border Gateway Protocol (BGP) and OSPF. Older gateway protocols, such as Exterior Gateway Protocol (EGP) and Routing Information Protocol version 1 (RIPv1), do not support CIDR. Because CIDR supports multiple subnet masks per subnet, it requires routers that support more advanced interior routing protocols, such as RIPv2 and OSPF.
NOTE
A, B, and C classful networks support a single subnet mask and can use RIPv1.
Subnet Masks
Implementing subnets helps control network traffic and enables network administrators to create smaller collision domains. Every node on the same physical ethernet network sees all data packets sent out on the network, which results in multiple collisions and affects network performance. Routers or gateways separate networks into subnets. Subnet masks on each node allow nodes on the same subnetwork to continue communicating with one another and with the routers or gateways they use to send their messages.
Subnet masks enables you to identify the network ID and host (node) ID of an IP address. The following example is a default Class B subnet mask:
10110110.10100101.00110111.01100010 182.165.55.98 11111111.11111111.00000000.00000000 255.255.000.000 --------------------------------------------------- 10110110.10100101.00000000.00000000 182.165.000.000 IP Address : 182.165.55.98 Address Class : B Network Address : 182.165.0.0 Subnet Address : 182.165.48.0 Subnet Mask : 255.255.240.0 Subnet bit mask : 10nnnnnn.nnnnnnnn.nnnnhhhh.hhhhhhhh Subnet Bits : 20 Host Bits : 12 Possible Number of Subnets : 16 Hosts per Subnet : 4094 Selected Subnet : 182.165.0.0/255.255.240.0 Usable Addresses : 4094 Host range : 182.165.0.1 to 182.165.15.254 Broadcast : 182.165.15.255
To subnet networks further, more bits can be added to the subnet mask for a class of addresses.
The following example is a Class B address using an additional bit subnet mask of 240. Notice that instead of having the single subnet and 65,534 hosts per subnet allowed under the default subnet mask, you can have up to 16 subnets with up to 4,094 hosts per subnet by using a subnet mask of 255.255.240.000 (Table 3.2 shows a sample IP addressing scheme):
10110110.10100101.00110111.01100010 182.165.55.98 11111111.11111111.11110000.00000000 255.255.240.000 Subnet Mask -------------------------------------------------------- IP Address : 182.165.55.98 Address Class : B Network Address : 182.165.0.0 Subnet Address : 182.165.48.0 Subnet Mask : 255.255.240.0 Subnet bit mask : 10nnnnnn.nnnnnnnn.nnnnhhhh.hhhhhhhh Subnet Bits : 20 Host Bits : 12 Possible Number of Subnets : 16 Hosts per Subnet : 4094 Selected Subnet : 182.165.0.0/255.255.240.0 Usable Addresses : 4094 Host range : 182.165.0.1 to 182.165.15.254 Broadcast : 182.165.15.255
Table 3.2 Example of an IP Addressing Scheme
Subnet |
Mask |
Subnet Size |
Host Range |
Broadcast |
182.165.0.0 |
255.255.240.0 |
4094 |
182.165.0.1 to 182.165.15.254 |
182.165.15.255 |
182.165.16.0 |
255.255.240.0 |
4094 |
182.165.16.1 to 182.165.31.254 |
182.165.31.255 |
182.165.32.0 |
255.255.240.0 |
4094 |
182.165.32.1 to 182.165.47.254 |
182.165.47.255 |
182.165.48.0 |
255.255.240.0 |
4094 |
182.165.48.1 to 182.165.63.254 |
182.165.63.255 |
182.165.64.0 |
255.255.240.0 |
4094 |
182.165.64.1 to 182.165.79.254 |
182.165.79.255 |
182.165.80.0 |
255.255.240.0 |
4094 |
182.165.80.1 to 182.165.95.254 |
182.165.95.255 |
182.165.96.0 |
255.255.240.0 |
4094 |
182.165.96.1 to 182.165.111.254 |
182.165.111.255 |
182.165.112.0 |
255.255.240.0 |
4094 |
182.165.112.1 to 182.165.127.254 |
182.165.127.255 |
182.165.128.0 |
255.255.240.0 |
4094 |
182.165.128.1 to 182.165.143.254 |
182.165.143.255 |
182.165.144.0 |
255.255.240.0 |
4094 |
182.165.144.1 to 182.165.159.254 |
182.165.159.255 |
182.165.160.0 |
255.255.240.0 |
4094 |
182.165.160.1 to 182.165.175.254 |
182.165.175.255 |
182.165.176.0 |
255.255.240.0 |
4094 |
182.165.176.1 to 182.165.191.254 |
182.165.191.255 |
182.165.192.0 |
255.255.240.0 |
4094 |
182.165.192.1 to 182.165.207.254 |
182.165.207.255 |
182.165.208.0 |
255.255.240.0 |
4094 |
182.165.208.1 to 182.165.223.254 |
182.165.223.255 |
182.165.224.0 |
255.255.240.0 |
4094 |
182.165.224.1 to 182.165.239.254 |
182.165.239.255 |
182.165.240.0 |
255.255.240.0 |
4094 |
182.165.240.1 to 182.165.255.254 |
182.165.255.255 |
When you use standard subnet masks in classful IP addressing schemes, you can plan how many hosts you can support per subnet and how many subnets are available for use. Table 3.3 shows classful IP addressing schemes and uses 255.x.0.0 as the default mask for Class A addresses, 255.255.x.0 as the default mask for Class B class addresses, and 255.255.255.x as the mask for Class C addresses. In these classes, the X is the subnet mask variable in the table's Subnet Mask column.
Table 3.3 Subnet Masking for Classful IP Addressing
Subnet Mask |
Number of Subnets in Classful Range |
Number of Class A Hosts per Subnet |
Number of Class B Hosts per Subnet |
Number of Class C Hosts per Subnet |
0 |
1 |
16,777,214 |
65,534 |
254 |
128 |
2 |
8,388,606 |
32,766 |
126 |
192 |
4 |
4,194,302 |
16,382 |
62 |
224 |
8 |
2,097,150 |
8,190 |
30 |
240 |
16 |
1,048,574 |
4,094 |
14 |
248 |
32 |
524,286 |
2,046 |
6 |
252 |
64 |
262,142 |
1,022 |
2 |
254 |
128 |
131,070 |
510 |
N/A |
255 |
256 |
65,534 |
254 |
N/A |
TCP/IP Class A Addresses
Class A addresses have an official start address of 0.0.0.0 and an official ending address of 127.255.255.255. However, the last usable client address in the range is 126.255.255.254, as the 127.x.x.x range is used for internal host loopback.
The full range of addresses that can be assigned to hosts is 1.0.0.1 to 126.255.255.254, with 126.255.255.255 as the broadcast address. The local host uses 0.0.0.0 when it has been configured to use a DHCP server but cannot reach one and cannot assign itself an address using APIPA. (This situation would be unusual.)
There are 126 Class A networks total, and each is allowed to have up to 16,777,214 hosts. Three IP network addresses are reserved for private networks as defined in Request for Comment (RFC) 1918. The Class A range is 10.0.0.0 to 10.255.255.255, with a subnet mask of 255.0.0.0.
These addresses can be used by anyone setting up internal IP networks, such as a lab or home LAN behind a Network Address Translation (NAT) server, proxy server, or router. It is always safe to use them because routers on the Internet never forward packets coming from these addresses.
TCP/IP Class B Addresses
The Class B range of IP addresses starts with address 128.0.0.0 and ends at address 191.255.255.255. IP addresses 128.0.0.1 to 191.255.255.254 are the usable range of Class B addresses for node assignment.
Three IP network addresses are reserved for private networks, as defined in RFC 1918. The Class B range is 172.16.0.0 to 172.31.255.255, with the subnet mask 255.240.0.0. These addresses can be used by anyone setting up internal IP networks, such as a lab or home LAN behind a NAT server, proxy server, or router. It is always safe to use these addresses because routers on the Internet never forward packets coming from these addresses.
TCP/IP Class C Addresses
The Class C range of IP addresses starts at address 192.0.0.0 and ends at 223.255.255.255. IP addresses 192.0.0.1 to 223.255.255.254 are the usable range of Class C addresses for node assignment.
Three IP network addresses are reserved for private networks, as defined in RFC 1918. The Class C range is 192.168.0.0 to 192.168.255.255, with the subnet mask 255.255.0.0. These addresses can be used by anyone setting up internal IP networks, such as a lab or home LAN behind a NAT server, proxy server, or router. It is always safe to use them because routers on the Internet never forward packets coming from these addresses.
TCP/IP Class D Addresses
The Class D IP addresses range from 224.0.0.0 through 239.255.255.255. Internet Assigned Numbers Authority (IANA) has set aside this range as a special class of addresses for multicast uses. ISPs are unable to allocate Class D address space to their customers because IANA is the only body through which these addresses can be allocated.
Allocation of Class D addresses is required only if you want to be a multicast source. You can still receive multicast data without needing a separate Class D address.
TCP/IP Class E Addresses
IANA has set aside Class E IP addresses from 240.0.0.0 to 254.255.255.255 as a special class of addresses for experimental and future use. The IP address 255.255.255.255 broadcasts to all hosts on the local network and, therefore, is not considered part of the Class E IP addresses.
Well-Known Ports
A number of well-known ports (01023) are used by different services on computers. For a single IP address on one system to offer all possible services to a network, each service must function on its own TCP or UDP port from that IP address.
You can find a helpful table at http://www.networksorcery.com that includes links to definitions and additional notes for some services. The following ports and associated protocols are the most important ones to remember:
20FTPdata
21FTPcontrol
22Secure Shell (SSH)
23Telnet
25SMTP
37Time Protocol (Time)
49Terminal Access Controller Access Control System (TACACS), TACACS+
53DNS
67BOOTPserver
68BOOTPclient
69TFTP
70Gopher
79Finger
80Hypertext Transfer Protocol (HTTP)
88Kerberos
109Post Office Protocol version 2 (POP2)
110Post Office Protocol version 3 (POP3)
115Simple File Transfer Protocol (SFTP)
119Network News Transfer Protocol (NNTP)
123Network Time Protocol (NTP)
137NetBIOS Name Service
138NetBIOS Datagram Service
139NetBIOS Session Service
143Internet Message Access Protocol (IMAP)
153Simple Gateway Monitoring Protocol (SGMP)
161SNMP
162SNMPtraps
179BGP
389Lightweight Directory Access Protocol (LDAP), Connectionless Lightweight X.500 Directory Access Protocol (CLDAP)
443HTTP over Secure Socket Layer/Transport Layer Security (SSL/TLS)HTTPS
464Kerberos change/set password
500ISAKMP, Internet Key Exchange (IKE)
546DHCPv6 client
547DHCPv6 server
631Internet Printing Protocol (IPP)