Tuesday, September 13

Addressing the Network

Addressing is a key function of Network layer protocols that enables data communication between hosts on the same network or on different networks. Internet Protocol version 4 (IPv4) provides hierarchical addressing for packets that carry our data.

Designing, implementing and managing an effective IPv4 addressing plan ensures that our networks can operate effectively and efficiently.

These addresses are used in the data network as binary patterns. Inside the devices, digital logic is applied for their interpretation. For us in the human network, a string of 32 bits is difficult to interpret and even more difficult to remember. Therefore, we represent IPv4 addresses using dotted decimal format.

If you want to know how to convert between 8-bit binary and decimal numbers, go to counting binary.

Within the address range of each IPv4 network, we have three types of addresses:

Network address - The address by which we refer to the network
Broadcast address - A special address used to send data to all hosts in the network
Host addresses - The addresses assigned to the end devices in the network

Network Address:
The network address is a standard way to refer to a network. Within the IPv4 address range of a network, the lowest address is reserved for the network address. This address has a 0 for each host bit in the host portion of the address.

Sample:
10.0.0.0
172.16.0.0
192.168.1.0

Broadcast Address:
The IPv4 broadcast address is a special address for each network that allows communication to all the hosts in that network. To send data to all hosts in a network, a host can send a single packet that is addressed to the broadcast address of the network.
The broadcast address uses the highest address in the network range. This is the address in which the bits in the host portion are all 1s.

Sample:
10.0.0.255
172.16.0.255
192.168.1.255

Host Address:
As described previously, every end device requires a unique address to deliver a packet to that host. In IPv4 addresses, we assign the values between the network address and the broadcast address to the devices in that network.

Sample:
10.0.0.1 to 10.0.0.254
172.16.0.1 to 172.16.0.254
192.168.1.1 to 192.168.1.254

Network Prefixes
The prefix length is the number of bits in the address that gives us the network portion. For example, in 172.16.4.0 /24, the /24 is the prefix length - it tells us that the first 24 bits are the network address. This leaves the remaining 8 bits, the last octet, as the host portion.
Networks are not always assigned a /24 prefix. Depending on the number of hosts on the network, the prefix assigned may be different. Having a different prefix number changes the host range and broadcast address for each network.






Notice that the network address could remain the same, but the host range and the broadcast address are different for the different prefix lengths. In this figure you can also see that the number of hosts that can be addressed on the network changes as well.

See the figure for an example of the address assignment for the 172.16.20.0 /25 network.



In the first box, we see the representation of the network address. With a 25 bit prefix, the last 7 bits are host bits. To represent the network address, all of these host bits are '0'. This makes the last octet of the address 0. This makes the network address 172.16.20.0 /25.

In the second box, we see the calculation of the lowest host address. This is always one greater than the network address. In this case, the last of the seven host bits becomes a '1'. With the lowest bit of host address set to a 1, the lowest host address is 172.16.20.1.

The third box shows the calculation of the broadcast address of the network. Therefore, all seven host bits used in this network are all '1s'. From the calculation, we get 127 in the last octet. This gives us a broadcast address of 172.16.20.127.

The fourth box presents the calculation of the highest host address. The highest host address for a network is always one less than the broadcast. This means the lowest host bit is a '0' and all other host bits as '1s'. As seen, this makes the highest host address in this network 172.16.20.126.

In an IPv4 network, the hosts can communicate one of three different ways:

Unicast - the process of sending a packet from one host to an individual host. It is used for the normal host-to-host communication in both a client/server and a peer-to-peer network.

Broadcast - the process of sending a packet from one host to all hosts in the network. It is used for the location of special services/devices for which the address is not known or when a host needs to provide information to all the hosts on the network.

Some examples for using broadcast transmission are:
• Mapping upper layer addresses to lower layer addresses
• Requesting an address
• Exchanging routing information by routing protocols

Multicast - the process of sending a packet from one host to a selected group of hosts. It reduces traffic by allowing a host to send a single packet to a selected set of hosts.
Some examples of multicast transmission are:
• Video and audio distribution
• Routing information exchange by routing protocols
• Distribution of software
• News feeds

Private Addresses
A networks that are accessible on the Internet, there are blocks of addresses that are used in networks that require limited or no Internet access.
The private address blocks are:
• 10.0.0.0 to 10.255.255.255 (10.0.0.0 /8)
• 172.16.0.0 to 172.31.255.255 (172.16.0.0 /12)
• 192.168.0.0 to 192.168.255.255 (192.168.0.0 /16)

Network Address Translation (NAT)
With services to translate private addresses to public addresses, hosts on a privately addressed network can have access to resources across the Internet.

NAT allows the hosts in the network to "borrow" a public address for communicating to outside networks. While there are some limitations and performance issues with NAT, clients for most applications can access services over the Internet without noticeable problems.

Public Addresses
The vast majority of the addresses in the IPv4 unicast host range are public addresses. These addresses are designed to be used in the hosts that are publicly accessible from the Internet. Even within these address blocks, there are many addresses that are designated for other special purposes.

Assigning Addresses within a Network
As you have already learned, hosts are associated with an IPv4 network by a common network portion of the address. Within a network, there are different types of hosts.

Some examples of different types of hosts are:
• End devices for users
• Servers and peripherals
• Hosts that are accessible from the Internet
• Intermediary devices

Each of these different device types should be allocated to a logical block of addresses within the address range of the network.

Addresses for Servers and Peripherals
Any network resource such as a server or a printer should have a static IPv4 address, as shown in the figure. The client hosts access these resources using the IPv4 addresses of these devices. Therefore, predictable addresses for each of these servers and peripherals are necessary.

Addresses for Hosts that are Accessible from Internet
In most internetworks, only a few devices are accessible by hosts outside of the corporation. For the most part, these devices are usually servers of some type. As with all devices in a network that provide network resources, the IPv4 addresses for these devices should be static.

Addresses for Intermediary Devices
Most intermediary devices are assigned Layer 3 addresses. Either for the device management or for their operation. Devices such as hubs, switches, and wireless access points do not require IPv4 addresses to operate as intermediary devices. However, if we need to access these devices as hosts to configure, monitor, or troubleshoot network operation, they need to have addresses assigned.

Routers and Firewalls
Unlike the other intermediary devices mentioned, routers and firewall devices have an IPv4 address assigned to each interface. Each interface is in a different network and serves as the gateway for the hosts in that network. Typically, the router interface uses either the lowest or highest address in the network. This assignment should be uniform across all networks in the corporation so that network personnel will always know the gateway of the network no matter which network they are working on.


Defining the network and host portions
To define the network and host portions of an address, the devices use a separate 32-bit pattern called a subnet mask, as shown in the figure. We express the subnet mask in the same dotted decimal format as the IPv4 address. The subnet mask is created by placing a binary 1 in each bit position that represents the network portion and placing a binary 0 in each bit position that represents the host portion.

The prefix and the subnet mask are different ways of representing the same thing - the network portion of an address.

a /24 prefix is expressed as a subnet mask as 255.255.255.0 (11111111.11111111.11111111.00000000). The remaining bits (low order) of the subnet mask are zeroes, indicating the host address within the network.

The subnet mask is configured on a host in conjunction with the IPv4 address to define the network portion of that address.

For example, let's look at the host 172.16.20.35/27:

Address
172.16.20.35
10101100.00010000.00010100.00100011

subnet mask
255.255.255.224
11111111.11111111.11111111.11100000

network address
172.16.20.32
10101100.00010000.00010100.00100000

Because the high order bits of the subnet masks are contiguous 1s, there are only a limited number of subnet values within an octet. You will recall that we only need to expand an octet if the network and host division falls within that octet. Therefore, there are a limited number 8 bit patterns used in address masks.

The AND Operation
ANDing is one of three basic binary operations used in digital logic. The other two are OR and NOT. While all three are used in data networks, AND is used in determining the network address. Therefore, our discussion here will be limited to logical AND. Logical AND is the comparison of two bits that yields the following results:
1 AND 1 = 1
1 AND 0 = 0
0 AND 1 = 0
0 AND 0 = 0

An example of AND operation:


1 comment:

  1. This blog is nice and very informative. I like this blog.
    blog Please keep it up.

    ReplyDelete