CompTIA® Network+ Exam Notes : IP Adressing

1. Networking Concepts

1.4 IP addressing

Each computer on the Internet having a unique IP address is known as a HOST. IP address is a logical address and used for routing packets over an IP network.

IP addresses are written using decimal numbers separated by decimal points. This is called dotted decimal notation of expressing IP addresses.

The different classes of IP addresses is as below:

Class Format Leading Bit Pattern Network address Range Maximum networks Maximum host/nodes
A N.H.H.H 0 to  127 16,777,214
B N.N.H.H 10 to  16,384 65,534
C N.N.N.H 110 to  20,971,52 254
D N.A. N.A. to N.A. N.A.
  • Network address of all zeros means "This network or segment.
  • Network address of all 1s means "all networks", same as hexadecimal of all Fs. broadcasts to all hosts on the local network.
  • Network number 127 is reserved for loopback tests, ie any IP in the range 127.x.x.x is reserved for the loopback or localhost, for example, is the loopback address.
  • Host(Node) address of all zeros mean "This Host (Node)".
  • Host (Node) address of all 1s mean "all Hosts (Nodes) " on the specified network.
  • The range of numbers from to is used for multicast packets. This is known as Class D address range.
  • it doesn't have network and host bits. If it's a multi-cast address then one IP would go to multiple machines because all have that IP.
  • Class E addresses are reserved for future use, or Research and Development Purposes.


The following are the advantages of subnetting:

  • The network congestion improves
  • IP addresses can be efficiently used
  • Security can be improved (Since it requires a router to switch traffic from one subnet to another, only hosts on a particular subnet can see the packets)

Classful addressing: RIPv1, IGRP are examples of classful routing protocols. It is important to know that classful routing protocols do not exchange subnet information during routing information exchanges. The summarization is always done automatically at major network boundaries.

Examples on subnetting:

Example 1:You are designing an IP addressing scheme for a corporate network. The subnet uses What are the valid host addresses available, excluding subnet zero and bradcast address.

Solution: An address where all host part bits are 0 refers to the (this) network, and an address where all bits of the host part are 1 is called a broadcast address. This refers to all hosts on the specified network simultaneously. Thus, is not a valid host address, but refers to all hosts on network

The valid host addresses - through

Example 2: What is the directed broadcast address for an IP network with default subnet mask?

Solution: This is a Class C network with default subnet mask, which is The directed broadcast should reach all Hosts on the intended network (or subnet, if subnetted). Therefore, by putting all 1s for the host potion of the IP address, we get

Example 3: You have three physical LAN segments, each with 10 Hosts. All three segments are connected to three different interfaces on your router. What is the minimum number of subnets required?

Solution: Since there are three segments, you need to have three subnets.

Example 4: You are asked to evolve a TCP/IP addressing scheme for your Organization. How many network numbers (subnet number) must you allow when you design the network for your organization? (Choose 2 best answers)

Solution: You need to assign a different network number for each subnet. Also, you need to set aside one network number for each WAN connection.

Example 5: You are given an IP address What is the default subnet mask?

Solution: The IP address belongs to Class B network.

The default subnet mask for different classes of IP networks are as given below:

Class A network:

Class B network

Class C network

Example 6: You have a router with two ports, each having distinct IP address. Both ports are connected to two distinct subnets (segments). The first subnet has 12 clients and a server. The second subnet has 14 clients and a server. What is the total number of IP addresses required?

Solution: The number of distinct IP's required are

1) One each per client computer

2) One each per server computer

3) One each per router interface.

There are 2 servers + 26 clients + 2 router interfaces. Therefore, the total number of IP addresses required are 30. Loopback address is an IP number ( that is designated for the software loopback interface of a computer. The loopback interface has no hardware associated with it, and is a logical interface only.

Example 7: What is the decimal equivalent of the binary number 1110 0011?

binary number Conversion

Solution: Calculate the decimal equivalent based on the above predefined values.

Given binary number is : 1110 0011

1*(2^7) + 1*(2^6) + 1*(2^5) + 0*(2^4) + 0*(2^3) + 0*(2^2) + 1*(2^1) + 1*(2^0) = 1*128 + 1*64 + 1*32 + 0*16 + 0*8 + 0*4 + 1*2 + 1*1

=128+64+32+0+0+0+2+1 =227

therefore decimal equivalent of 1110 0011 is 227

Note: Binary number is the sum of the digits multiplied with 2n.

Example 8: What is the binary equivalent of decimal number 52?


binary number Conversion

1. Is 52 greater than or equal to 128? => No => Put a 0 in the 128 column.

2. Is 52 greater than or equal to 64? => No => Put a 0 in the 64 column.

3. Is 52 greater than or equal to 32? => Yes => Put a 1 in the 32 column, and subtract 32 from 52. => 52 - 32 = 20.

4. Is 20 greater than or equal to 16? => Yes => Put a 1 in the 16 column, and subtract 16 from 20. => 20 - 16 = 4.

5. Is 4 greater than or equal to 8? => No => Put a 0 in the 8 column.

6. Is 4 greater than or equal to 4? => No => Put a 1 in the 4 column, and subtract 4 from 4. =>4-4=0

7. Is 0 greater than or equal to 2? => No => Put a 0 in the 2 column.

8. Is 0 greater than or equal to 1? => No => Put a 0 in the 1 column.

binary equivalent of decimal number 52

Example 9: What is the decimal equivalent of hexadecimal F8CE?

Solution: Hexadecimal numbers are numbers with the base 16. It uses 16 different digits to represent the numbers. It is denoted as h16, where h is a hexadecimal number. It may be combination and alphabets and numbers. It uses numbers from 0 to 9 and alphabets A to F(11-15). Hexadecimal number is the sum of the digits multiplied with 16n. The table below shows conversion values from binary, octal, decimal, and hexadecimal.

Decimal To Hexa Conversion

F-15 , C-12, E-14

F8CE= 15x163+8x162+12x161+14x160 = 61440+2048+192+14= 63694

Classless routing protocols: RIPv2, EIGRP, OSPF, BGPv4, and IS-IS are examples of classless routing protocols. In classless routing protocols, subnet information is exchanged during routing updates. This results in more efficient utilization of IP addresses. The summarization in classless networks is manually controlled.

VLSM: RIPv1 and IGRP are true distance-vector routing protocols and can't do much, really-except build and maintain routing tables and use a lot of bandwidth. RIPv2,OSPF, IS-IS, EIGRP, and BGP. These routing protocols support VLSM because the routing protocols send the subnet mask as part of any routing update. EIGRP, and OSPF use Autonomous System (AS) numbers.

IPv6 Addressing: IANA (Internet Assigned Numbers Authority) is the organization under the Internet Architecture Board (IAB) of the Internet Society that oversees the allocation of Internet Protocol addresses to Internet service providers (ISPs). ICANN (a non governmental organization) has now assumed responsibility for the tasks formerly performed by IANA. ISPs in turn allot IP addresses to small companies, and businesses.

The IPv6 protocol defines a set of headers, including the basic IPv6 header and the IPv6 extension headers. The following figure shows the fields that appear in the IPv6 header and the order in which the fields appear. IPv4 addresses use the last 32 bits of the IPv6 address.

IPv6 packet is 128 bits long. It will have basic packet header, and optional extension header. The next header field within an extension header points to the next header in the chain.

Ipv6 Header Format

IPv6 header contains the following things:

  • Version - This field contains the version of the IP used in the packet. It is of 4-bit in IP version 6.
  • Traffic class - This is an 8-bits field determining the packet priority. Priority values subdivide into ranges: traffic where the source provides congestion control and non-congestion control traffic.
  • Flow label - This 20 bits specifies the QoS management. Originally created for giving real-time applications special service, but currently unused.
  • Payload length - This 16 bits determines the payload length in bytes. When cleared to zero, the option is a "Jumbo payload" (hop-by-hop).
  • Next header - This 8-bits field specifies the next encapsulated protocol. The values are compatible with those specified for the IPv4 protocol field.
  • Hop limit - This is an 8-bits field newly introduced in IPv6. It replaces the time to live field of IPv4
  • Source Address - This 128 bits field determines the logical address of the host that is sending the packet.
  • Destination Address - This 128 bits field determines the logical address of the host that is receiving the packet.
  • The payload can have a size of up to 64KB in standard mode, or larger with a "jumbo payload" option.

The extension header may include the following:

  • Hop-by-Hop options
  • Destination options
  • Routing (specifies intermediate routers that the route must include forcing an administratively defined path)
  • Fragment (Used to divide packets that are too large for the maximum unit (MTU) )
  • Authentication and Encapsulating Security Payload (ESP)

IPv6 hosts supports the following:

  • Loopback address (::::1/128)
  • All-nodes multicast addresses (FF01::1 and FF02::1)
  • Link-local address (FE80::/10), autoconfigured.

The minimum MTU supported in IPv6 is 1280 octets. The recommended MTU value for IPv6 links is 1500 octets.

3 types of addresses are supported in IPv6:

1. Unicast: one-to-one with various scopes (i.e.: Global, Link, Unique Local, Compatible)

2. Anycast: one-to-nearest (allocated from unicast)

3. Multicast: one-to-many

Broadcast has disappeared as a term, but is considered one form of multicast.

In an IPv6 network, a host can auto-configure its IP address without the help of a DHCP server.

IPv6 to ipv4 transport:

4to6 refers to tunneling of IPv4 in IPv6: It is an Internet inter-operation mechanism allowing Internet Protocol version 4 (IPv4) to be used in an IPv6 only network. 4in6 uses tunneling to encapsulate IPv4 traffic over configured IPv6 tunnels as defined in RFC 2473

6to4 tunneling: It is an IPv6 transition mechanism described in RFC 3056. It enables encapsulation of IPv6 packets into IPv4 for transport across an IPv4 network. 6to4 tunneling allows for automatic IPv6-to-IPv4 address translation, and treats the underlying IPv4 network as one big non-broadcast multi-access (NBMA) network, rather than a collection of independent point-to-point links. A 6-to-4 tunnel works similarly to a manual tunnel, except that the tunnel is set up automatically. 6-to-4 tunnels use IPv6 addresses that concatenate 2002::/16 with the 32-bit IPv4 address of the edge router, creating a 48-bit prefix.

Dynamic Host Configuration Protocol version 6 (DHCP6): is a network protocol for configuring Internet Protocol version 6 (IPv6) hosts with IP addresses, IP prefixes and other configuration data required to operate in an IPv6 network.

Miredo is a Teredo tunneling client designed to allow full IPv6 connectivity to computer systems which are on the IPv4-based Internet but which have no direct native connection to an IPv6 network.

Example: The MAC address of a node is 00-0F-66-41-29-C3.

The appropriately formed IPv6 interface id using EUI-64 format

The EUI-64 format interface ID is derived from the 48-bit MAC address by inserting the hex FFFE between the organizationally unique identifier (OUI) field (the upper three bytes) and the vendor code (the lower three bytes) of the MAC address. The seventh bit in the first byte of the resulting interface ID, corresponding to the Universal/Local (U/L) bit, is set to binary 1.

IPv6 Multicast Addresses used by different routing protocols:

  • RIPv6: FF02::9
  • OSPF speaker: FF02::5
  • OSPF DR and BDR: FF02::6

Multicast Address Node Local:

  • FF01:0:0:0:0:0:0:1 or FF01::1 All Nodes Address
  • FF01:0:0:0:0:0:0:2 or FF01::2 All Routers Address

Link Local:

  • FF02:0:0:0:0:0:0:1 or FF02::1 All Nodes Address
  • FF02:0:0:0:0:0:0:2 or FF02::2 All Routers Address
  • FF02:0:0:0:0:0:0:D or FF02::D All PIM Routers

The following are true about IPv6 address format:

1. The total length of IPv6 address is 128 bits

2. The first 48 bits of the IPv6 global unicast addresses are used for global routing at the Internet Service Provider (ISP) level.

3. 16 bits (after the first 48-bit global unicast address) are used for subnetting, allowing organizations to subdivide their network

4. Multicast addresses are in the range FF00::/8.

Unicast 6to4 addresses (2002::/16): IPv6 uses 6to4 addresses to communicate between two IPv6/IPv4 nodes over the IPv4 Internet. A 6to4 address combines the prefix 2002::/16 with the 32 bits of the public IPv4 address of the node to create a 48-bit prefix - 2002:WWXX:YYZZ::/48, where WWXX:YYZZ is the colon-hexadecimal representation of w.x.y.z, a public IPv4 address. Therefore, the IPv4 address translates into a 6to4 address prefix of 2002:9D3C:5B7B::/48.

Unicast site-local addresses: IPv6 unicast site-local addresses are similar to IPv4 private addresses. The scope of a site-local address is the internetwork of an organization's site. (You can use both global addresses and site-local addresses in your network.) The prefix for site-local addresses is FEC0::/48.

Unicast unspecified address: The IPv6 unicast unspecified address is equivalent to the IPv4 unspecified address of The IPv6 unspecified address is 0:0:0:0:0:0:0:0:, or a double colon (::).

Unicast loopback address: The IPv6 unicast loopback address is equivalent to the IPv4 loopback address, The IPv6 loopback address is 0:0:0:0:0:0:0:1, or ::1

Multicast addresses from FF01:: through FF0F:: are reserved, well-known addresses. To identify all nodes for the node-local and link-local scopes, the following multicast addresses are defined:

FF01::1 (node-local scope all-nodes address)

FF02::1 (link-local scope all-nodes address)

To identify all routers for the node-local, link-local, and site-local scopes, the following multicast addresses are defined:

FF01::2 (node-local scope all-routers address)

FF02::2 (link-local scope all-routers address)

FF05::2 (site-local scope all-routers address)

Address Assignments:

DHCP: DHCP is a successor to BOOT/P protocol. DHCP allows us to dynamically assign IP addresses, subnet mask,default gateway to hosts on a network. In other words, DHCP allows us to IP configure the client computers on a network dynamically at boot time. You have to assign the IP address for your DHCP server statically. A DHCP server can't assign an IP address to itself. Similarly, some other servers which need static assignment of IP addresses are your DNS server, WINS server, and Default gateway. You must assign the IP address of the DHCP Server manually.

Multicast Domain Name Service (MDNS) is an example of a technology that can resolve computer names to their corresponding IP address on a local subnet, without the aid of a DNS server or a WINS server.

BootP and DHCP are dynamic approaches to assigning routable IP addresses to networked devices.

APIPA: Short for Automatic Private IP Addressing is a feature that allows DHCP clients to automatically self-configure an IP address and subnet mask when a DHCP server isn't available. When a DHCP client boots up, it first looks for a DHCP server in order to obtain an IP address and subnet mask. If the client is unable to find the information, it uses APIPA to automatically configure itself. The IP address range is through The client also configures itself with a default class B subnet mask of A link-local IP address is a non-routable IP address usable only on a local subnet. APIPA is an example of a technology that assigns link-local IP addresses.

Windows 98 and later versions have an Automatic Private IP Addressing (APIPA) feature that will automatically assign an Internet Protocol address to a computer on which it installed. This occurs when the TCP/IP protocol set to obtain it's IP address automatically from a Dynamic Host Configuration Protocol server, and when there is no DHCP server present or not available.

The Internet Assigned Numbers Authority (IANA) has reserved private IP addresses in the range of - for Automatic Private IP Addressing

After the network adapter has been assigned an automatic IP address, a computer can communicate with any other computers on the local network that are also configured by APIPA or have static IP address manually set to the 169.254.x.y (where x.y is the client's unique identifier) address range with a subnet mask of

Microsoft windows 7 defaults to APIPA if a client is configured to automatically obtain IP address information and that client fails to obtain IP address information from a DHCP server.

RIPng, OSPFv3, and EIGRPv6 support IPv6 addressing. Prior versions of OSPF such as OSPFv1 and OSPFv2 does not support IPv6. Similarly, RIP, RIPv2, EIGRP (prior to EIGHTv6) does not support IPv6 addressing. RIPng for IPv6 offers the same benefits as RIP-2 and IPv6 OSPF is an IETF proposed standard.

Previous   Contents   Next

Network+ Cram Notes Contents ad