Networking Fundamentals Study Guide for the CompTIA Network+

Page 4

Subnet and IP Addresses

An Internet Protocol (IP) address is a numeric identifier assigned to devices on a network that creates a logical location used for communications between devices on different networks and locations. An IPv4 address is a fixed length value consisting of 32 bits separated into four eight-bit sections, with each section containing a value between 0 and 255. IP is commonly expressed in dotted-decimal form (e.g., 202.103.0.68). An IPv6 address consists of 128 bits separated into eight 16-bit sections expressed in colon hexadecimal form (e.g., 1851:0000:3238:def1:0177:0000:0000:0125 or 1851::3238:def1:177:0:0:125).

A subnet is a logical partition of an IP into multiple unique identifiers of hosts using the IP address. Given a scenario, you will need to be able to properly configure a subnet and the IP scheme that’s appropriate for the scenario.

Public vs. Private

IP addresses, due to the limited amount of addresses available, can be either public or private depending on the assigned address. A public IP address is routable through the internet and accessible to devices outside of the network. A private IP address can only be used for internal networking and is not accessible from outside of the network, which allows for multiple entities to use the same set of private IP addresses within their own network. If every device on every network in the world had to have its own individual IP address, there would not be enough addresses to accommodate the demand. Public and private IP addresses are pre-established.

RFC 1918

RFC 1918, developed by the Internet Engineering Task Force (IETF), created a standard for private IP addressing that is used by networking devices when assigning private IP addresses to devices. RFC 1918 defines three sets of IP address ranges that are reserved for private use and are not routable over the internet. The three sets are divided into address classes as follows:

  • Class A: 10.0.0.0 to 10.255.255.255 or 10/8 prefix
  • Class B: 172.16.0.0 to 172.16.255.255 or 172.16/12 prefix
  • Class C: 192.168.0.0 to 192.168.255.255 or 192.168/16 prefix

Network Address Translation (NAT)

NAT is the protocol that allows for multiple private addresses to connect to a single public IP address to gain access to devices outside of the network, such as the internet. NAT creates a logical map of all devices on a network and their corresponding private IP addresses and uses that information to direct traffic to the appropriate device. Think of NAT as mail delivery in an apartment complex. All of the mail comes into the complex using a single address but is then delivered to the appropriate mailbox based on the designated apartment number.

21 Network Address Translation.jpg

Retrieved from: https://commons.wikimedia.org/wiki/File:CPT-NAT-1.svg License: http://creativecommons.org/licenses/by-sa/3.0/

Port Address Translation (PAT)

PAT is an extension of NAT that enables devices assigned to a specific private IP address port number to access a public IP address via that port number.

22 Port Address Translation.jpg

Retrieved from: https://commons.wikimedia.org/wiki/File:PAT.jpg License: http://creativecommons.org/licenses/by-sa/3.0/

IPv4 vs. IPv6

IPv4 is the most commonly used method of data transmission through the Internet Protocol. IPv4, however, is limited in the number of available addresses it contains. IPv6 is the latest version of IP and increases the number of available addresses exponentially. Both versions, however, use a structured hierarchical scheme to assign IP addresses to clients. This scheme consists of either two (network and host) or three (network, subnet, and host) levels. How IP addresses are assigned within IP depends on the addressing mode.

Automatic Private IP Addressing (APIPA)

APIPA is an addressing scheme that can automatically assign a private IP address to network-connected devices when a Dynamic Host Configuration Protocol (DHCP) server is unavailable. APIPA addresses cannot route outside the host network, meaning they cannot connect to external networks such as the internet. The IPv4 address allotment used by APIPA is 169.254.0.1 to 169.254.255.254 with a default Class B subnet mask of 255.255.0.0. APIPA is a Windows OS feature.

Extended Unique Identifier (EUI-64)

The EUI-64 is a 64-bit addressing mode used in IPv6 addresses that uses the hardware network address of a device to create an IPv6 address. With EUI-64, the 48-bit hardware address is split into two 24-bit segments with a 16-bit segment (ff:fe) between the two.

Multicast

A multicast address is a one-to-many communication that sends packets to devices assigned to an IP multicast group address. This allows for multiple recipients to receive a particular packet without sending it to all network-connected devices. The IPv4 multicast address range is 224.0.0.0 to 239.255.255.255, which is in the Class D address range. The multicast IPv6 address range is ff00::/8.

Unicast

A unicast address is a one-to-one communication that sends packets to a single specified host. Each host on a network receives its own unique unicast address. Unicast is used in both IPv4 and IPv6.

Anycast

Anycast is a one-to-one-of-many or one-to-nearest communication that sends a packet to the IPv6 anycast address with the shortest routing distance. One anycast address can be assigned to multiple interfaces, but only the interface closest in routing distance will receive the packet. Anycast is only available with IPv6.

Broadcast

Broadcast is a one-to-all communication that sends a packet to all network-attached devices. The IPv4 broadcast address is always the last address in a subnet. For example, the broadcast address for the Class B address 172.16.0.1 with subnet mask 255.255.0.0 would be 172.16.255.255. IPv6 does not use broadcast addressing; instead, it uses anycast addressing.

A link-local address is automatically generated to facilitate communications between devices in a LAN. Like APIPA addresses, link-local addresses are not accessible from outside of the network. In IPv4, link-local addresses are only assigned if all other methods of IP addressing fail. They have a range of 169.254.0.0 to 169.254.255.255. Link-local addresses are automatically assigned when using IPv6 and use the prefix fe80::/10.

Loopback

A loopback address sends a packet back to the sender without transmitting to other portions of the network. While the loopback range for IPv4 is 127.0.0.0 to 127.255.255.255, the 127.0.0.1 IP address, also known as the localhost, is the most commonly used and provides an internal IP address that routes back to itself. In IPv6, ::1 is the localhost loopback address.

Default Gateway

A default gateway enables packet transmission outside of the network when no other route has been specified. For example, when a laptop connected to a wireless hotspot in a coffee shop wishes to connect to a website, the laptop sending the request is not attached to the web server and does not have a specified route to the web server, so it sends it to the router running the wireless hotspot. This router, or default gateway, forwards the request to the appropriate next hop.

IPv4 Subnetting

Subnetting is the process of taking one larger network and dividing it into smaller networks. With subnetting, the first portion of the IP address, known as the prefix, indicates the network address, while the final portion, or suffix, represents the host address. In IPv4, there are two methods of separating the prefix and the host: classless and classful addressing.

Classless (Variable-Length Subnet Mask)

A classless or variable-length subnet mask (VLSM) does not have a predefined prefix length. Instead, the prefix length of the subnet is indicated in the IP address itself using Classless Inter-Domain Routing (CIDR; pronounced “cider”) notation or, more commonly, slash notation. For example, a classless address written in CIDR notation could be 12.24.76.8/8. The 8 behind the slash indicates the length of the prefix, which would be the first eight bits (or first byte) of the address, resulting in 12.0.0.0 being the network address. The last 24 bits would be the host address. Classless subnetting has replaced classful subnetting in most situations.

Classful

Classful subnetting separates IP address subnets into fixed-length prefixes based on which class the IP address falls into. You need to be able to identify the class of an IP address based on the prefix.

A—Class A addresses assign the first eight bits (byte) of an IP address to the host with the remaining bytes reserved for the host, resulting in a network.host.host.host format. Class A IP addresses range from 0.0.0.0 to 127.255.255.255.

B—Class B addresses assign the first 16 bits (two bytes) of an IP address to the host, with the remaining two bytes reserved for the host, resulting in a network.network.host.host format. The Class B address range is 128.0.0.0 to 191.255.255.255.

C—Class C addresses assign the first 24 bits (three bytes) to the network with the remaining byte reserved for the host, resulting in a network.network.network.host format. Class C addresses range from 192.0.0.0 to 223.255.255.255.

D—Class D addresses do not specify a prefix and suffix. Instead, Class D addresses are used for multicast addressing. Class D addresses range from 224.0.0.0 to 239.255.255.255.

E—Class E addresses do not specify a prefix and suffix. Class E addresses are used for scientific and research purposes. Class E addresses range from 240.0.0.0 to 255.255.255.255.

IPv6 Concepts

IPv6 was developed to enhance the inherent capabilities and standards of the Internet Protocol while also mitigating address exhaustion. While IPv4 and IPv6 do have concepts in common, IPv6 has additional concepts that are unique and standard on IPv6.

Tunneling

IPv6 tunneling is the process of encapsulating an IPv6 packet into an IPv4 address, creating a link between the two nodes. IPv6 tunneling allows for IPv6 packets to be sent and received by and between nodes that may not have IPv6 capabilities over an established IPv4 address.

Dual Stack

A dual stack is the ability of a device to assign, send, and receive both IPv4 and IPv6 addresses.

Shorthand Notation

IPv6 addresses can be 128 bits long, which can result in a very cumbersome IP address. Shorthand notation is a set of rules that allows for the reduction in length of an IPv6 address to a more manageable size. The shorthand notation rules are as follows:

  • A set of four zeros, or multiple sets of four zeros in a row, can be replaced by a double colon, or :: (this can only be done once in an address).

  • Leading zeros can be removed.

  • A set of four zeros can be reduced to a single zero.

Let’s try an example.

Write 2001:0000:3c4d:0012:0000:0db8:1234:56ab in shorthand notation.

First, replace a set of four zeros with ::, leaving 2001::3c4d:0012:0000:0db8:1234:56ab.

Then, replace the remaining set of four zeros with 0, leaving 2001::3c4d:0012:0:0db8:1234:56ab.

Finally, remove the leading zeros, leaving 2001::3c4d:12:0:db8:1234:56ab.

Router Advertisement (RA)

RA is an IPv6 function that allows routers to send periodic solicited or unsolicited messages via multicast to other network connected devices to announce availability and to share data such as prefixes, address provisioning assistance, hop limit, and maximum transmission unit (MTU).

Stateless Address Autoconfiguration (SLAAC)

SLAAC is an IPv6 function that allows a device to automatically create its own stateless unicast address from its link-local address rather than requiring manual address assignment. SLAAC sends a router solicitation (RS) message to the router, and the router returns an RA message. SLAAC takes the provided router IPv6 prefix and the indicated prefix length and combines it automatically with its EUI-64 identifier to create a unicast address.

Virtual IP (VIP)

A VIP is an IP address that does not correspond to a physical hardware device but, rather, only exists virtually. Since VIPs are not tethered to a physical device, it is able to rotate between nodes in the network as needed.

Subinterfaces

A subinterface is a virtual interface created by dividing a single interface, such as a router, into multiple logical interfaces. This creates the ability for a single device to create and run multiple IPs and subnets on the device at once.

All Study Guides for the CompTIA Network+ are now available as downloadable PDFs