Sunday, 30 July 2017

The IPv6 Address Types and Prefix Length

The IPv6 Address Types


There are three basic IPv6 address types:


Unicast - A unicast address is the most common form of an IP address and is assigned to one network interface We already learn IPv4 unicast addresses.  An IPv6 unicast address uniquely identifies an interface on an IPv6-enabled device. For communication over IPv6, source IPv6 address must be a unicast address.


IPv6 unicast have five different unicast IPv6 address types: global unicast addresses, link-local addresses, site-local addresses, unique local IPv6 unicast addresses, and special addresses. These addresses will be explained in detail in later articles.


Multicast– We also learned multicast addresses and the range of multicast addresses in IPv4 addresses. The multicast addresses identify multiple network interfaces/hosts. An IPv6 multicast address is used to send a single IPv6 packet to multiple destinations.


Anycast- An IPv6 anycast address is any IPv6 unicast address that can be assigned to multiple network devices. Like a multicast address,  anycast address identifies multiple interfaces; however, while multicast packets are accepted by multiple machines, anycast packets are delivered to the nearest device having that address.


Note - Broadcast addresses are no longer exist in IPv6. However, there is an IPv6 all-nodes multicast address that essentially gives the same result.


IPv6 Prefix Length


Remember the network portion or the prefix of an IPv4 address. The dotted-decimal subnet mask or slash notation is used to identify the network. For example, an IPv4 address of 172.16.16.100 with dotted-decimal subnet mask 255.255.0.0 is equivalent to 172.16.16.0/16.


IPv6 address uses the prefix length to represent the prefix portion. The IPv6 does not use the dotted-decimal subnet mask notation. The length of the prefix is used to specify the network portion of an IPv6 address using the IPv6 address/prefix length. The range of prefix is from 0 to 128. The typical prefix length for the most network is /64. This means the network portion or prefix of the address is 64 bit long and other 64 bit will be used for host portion. The figure illustrates the prefix of IPv6 address.


IPv6 address types and prefix

Saturday, 29 July 2017

IPv6 Address Representation

IPv6 addresses are 128 bits in length and represented as eight groups of four hexadecimal digits each, each group representing 16 bits. The address can be written in either lowercase or uppercase.


Preferred Format


As we know that IPv6 address is 128 bit and in 8 groups so the preferred format for writing an IPv6 address is x:x:x:x:x:x:x:x, where each “x” containing four hexadecimal values.


Each group of In IPv6 is consisting of 16 bit and the term used for a group is a hextet.  So each “x” is a single hextet, 16 bits or four hexadecimal digits.


    X   :   X    :   X     :    X   :      X   :    X  :    X   :   X


0000:0000:0000:0000:0000:0000:0000:0000


 To   : To  :  To  : To  :  To  :  To  : To  :  To


FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF


If we convert in hextet into binary it should be 16 bit, for example, we 0000 hextet is equal to 0000000000000000 and FFFF hextet is equal to 1111111111111111. Following is the basic relationship table of binary, decimal, and hexadecimal.



























































































Decimal



Binary



Hexadecimal



0



0000



0



1



0001



1



2



0010



2



3



0011



3



4



0100



4



5



0101



5



6



0110



6



7



0111



7



8



1000



8



9



1001



9



10



1010



A



11



1011



B



12



1100



C



13



1101



D



14



1110



E



15



1111



F



 


The IPv6 address is written using all 32 hexadecimal digits. It is the ideal method for representing the IPv6 address. But there are two rules which help to reduce the number of digits needed to represent an IPv6 address. Following is the preferred format for  


Figure 2 is a review of the relationship between decimal, binary and hexadecimal. Figure 3 has examples of IPv6 addresses in the preferred format for representing the IPv6 addresses.


2001 : 0000 : 0000 : 1111 : 1234 : 0000 : 0000 : 0100


2001 : 0DA1 : B111 : 0000 : 0000 : ABCD : 0000 : 1245


FE80 : 0000 : 0000 : 0000 : 1234 : 4567 : 89AB : CDEF 


FE80 : 0000 : 0000 : 0000 : 0000 : 0000 : 0000 : 0123


FF02 : 0000 : 0000 : 0000 : 0000 : 0000 : 0000 : 0001


FE02 : 0000 : 0000 : 0000 : 0000 : 0001 : FF00 : 0200


0000 : 0000 : 0000 : 0000 : 0000 : 0000 : 0000 : 0001


0000 : 0000 : 0000 : 0000 : 0000 : 0000 : 0000 : 0000


Rule 1 – Omit Leading 0s


Omit leading 0 is the first rule which helps to reduce the notation of IPv6 address.  Following are the examples to omit any leading 0s (zeros) in any 16-bit section or hextet:



  • 01BC can be represented as 1BC

  • 07FA can be represented as 7FA

  • 0F00 can be represented as F00

  • 00A0 can be represented as A0

  • 000A can be represented as A


This rule only applies to leading 0s, NOT to trailing 0s, otherwise, the address would be ambiguous.  The table below shows the examples of omitting leading 0s from IPv6 address.






































Preferred Format


No Leading 0s



2001 : 0000 : 0000 : 1111 : 1234 : 0000 : 0000 : 0100


2001 : 0 : 0 : 1111 : 1234 : 0 : 0 : 100



Preferred Format


No Leading 0s



2001 : 0DA1 : B111 : 0000 : 0000 : ABCD : 0000 : 1245


2001 : DA1 : B111 : 0 : 0 : ABCD : 0 : 1245



Preferred Format


No Leading 0s



FE80 : 0000 : 0000 : 0000 : 1234 : 4567 : 89AB : CDEF


FE80 : 0 : 0 : 0 : 1234 : 4567 : 89AB : CDEF



Preferred Format


No Leading 0s



FE80 : 0000 : 0000 : 0000 : 0000 : 0000 : 0000 : 0123


FE80 : 0 : 0 : 0 : 0 : 0 : 0 : 123



Preferred Format


No Leading 0s



FF02 : 0000 : 0000 : 0000 : 0000 : 0000 : 0000 : 0001


FF02 : 0 : 0 : 0 : 0 : 0 : 0 : 1



Preferred Format


No Leading 0s



FE02 : 0000 : 0000 : 0000 : 0000 : 0001 : FF00 : 0200


FE02 : 0 : 0 : 0 : 0 : 1 : FF00 : 200



Preferred Format


No Leading 0s



0000 : 0000 : 0000 : 0000 : 0000 : 0000 : 0000 : 0001


0 : 0 : 0 : 0 : 0 : 0 : 0 : 1



Preferred Format


No Leading 0s



0000 : 0000 : 0000 : 0000 : 0000 : 0000 : 0000 : 0000


0 : 0 : 0 : 0 : 0 : 0 : 0 : 0



Rule 2 – Omit All 0 Segments


The second rule to reduce the notation of IPv6 addresses is that a use of double colon (::)  that can replace any single, contiguous string of one or more 16-bit segments (hextets) consisting of all 0s.


The double colon (::) can only be used once within an address, otherwise there would be more than one possible resulting address. When used with the omitting leading 0s technique, the notation of IPv6 address can often be greatly reduced. This is commonly known as the compressed format.


 






































Preferred Format


No Leading 0s


Compressed



2001 : 0000 : 0000 : 1111 : 1234 : 0000 : 0000 : 0100


2001 : 0 : 0 : 1111 : 1234 : 0 : 0 : 100


2001 :  : 1111 : 1234 : 0 : 0 : 100



Preferred Format


No Leading 0s


Compressed



2001 : 0DA1 : B111 : 0000 : 0000 : ABCD : 0000 : 1245


2001 : DA1 : B111 : 0 : 0 : ABCD : 0 : 1245


2001 : DA1 : B111 :  : ABCD : 0 : 1245



Preferred Format


No Leading 0s


Compressed



FE80 : 0000 : 0000 : 0000 : 1234 : 4567 : 89AB : CDEF


FE80 : 0 : 0 : 0 : 1234 : 4567 : 89AB : CDEF


FE80 :  : 1234 : 4567 : 89AB : CDEF



Preferred Format


No Leading 0s


Compressed



FE80 : 0000 : 0000 : 0000 : 0000 : 0000 : 0000 : 0123


FE80 : 0 : 0 : 0 : 0 : 0 : 0 : 123


FE80 :  : 123



Preferred Format


No Leading 0s


Compressed



FF02 : 0000 : 0000 : 0000 : 0000 : 0000 : 0000 : 0001


FF02 : 0 : 0 : 0 : 0 : 0 : 0 : 1


FF02 : : 1



Preferred Format


No Leading 0s


Compressed



FE02 : 0000 : 0000 : 0000 : 0000 : 0001 : FF00 : 0200


FE02 : 0 : 0 : 0 : 0 : 1 : FF00 : 200


FE02 : : 1 : FF00 : 200



Preferred Format


No Leading 0s


Compressed



0000 : 0000 : 0000 : 0000 : 0000 : 0000 : 0000 : 0001


0 : 0 : 0 : 0 : 0 : 0 : 0 : 1


: : 1



Preferred Format


No Leading 0s


Compressed



0000 : 0000 : 0000 : 0000 : 0000 : 0000 : 0000 : 0000


0 : 0 : 0 : 0 : 0 : 0 : 0 : 0


: :



 


Incorrect address:



  • 2001 : : 1111 : 1234 :  : 100


Possible expansions of ambiguous compressed addresses:



  • 2001 :  : 1111 : 1234 : 0000: 0000 : 100

  • 2001 :  : 1111 : 1234 : 0000 : 0000 : 0000 : 100

  • 2001 :  0000: 1111 : 1234 : 0000 ; 0000:0000 : 0100

  • 2001 : 0000:0000 : 1111 : 1234 :  : 100

  • 2001 : 0000 : 0000 : 0000 : 1111 : 1234 :  : 100

  • 2001 :  0000 : 0000 ; 1111 : 1234 :  : 100


 

Tuesday, 25 July 2017

IPv4 and IPv6 Coexistence

With a growing Internet population, a limited IPv4 address space, issues with NAT and an Internet of Everything, the time has come to begin the transition to IPv6. But due to the size of the Internet, it is not possible to migrate IPv4 addresses to IPv6 addresses in a synchronized manner. Because some IPv4 addresses may never change.  Therefore, IPv6 and IPv4 will coexist on the internet. The transition is estimated to take years. The IETF has created several protocols and tools to help network administrators migrate their networks to IPv6. The migration techniques can be divided into three categories. One is dual stack, where your network hardware runs IPv4 and IPv6 at the same time. Next is when you "tunnel" one protocol within another. Generally, this means taking IPv6 packets and encapsulating them in IPv4 packets. The last one is Network Address Translation-Protocol Translation (NAT-PT) also known as RFC-2766. This works just like the name says, software or a device translates IPv6 packets into IPv4 packets. Following is the detail of these methods.


 Dual Stack 


With the dual stack solution, all networking device, router, switch server and firewall in a network will be configured with both IPv4 and IPv6 connectivity capabilities. All devices must understand both IPv4 and IPv6 packets and must be allow processing of IPv4 and IPv6 data traffic simultaneously. Dual stack allows IPv4 and IPv6 to coexist on the same network segment. Dual stack devices run both IPv4 and IPv6 protocol stacks simultaneously. Figure-1 illustrates the Dual-Stack process.


dual-stack


Tunneling


As shown in Figure 2. Tunneling is a method of transporting an IPv6 packet over an IPv4 network. The IPv6 packet is encapsulated inside an IPv4 packet, similar to other types of data. By using tunneling method, you can communicate with isolated IPv6 networks without upgrading the IPv4 infrastructure between them. Tunnels can be configured between border routers or between a border router and a host; however, both tunnel endpoints must support both the IPv4 and IPv6 protocol stacks. IPv6 supports the following types of tunneling mechanisms



  • Manual

  • Generic routing encapsulation (GRE)

  • IPv4-compatible

  • 6to4

  • Intrasite Automatic Tunnel Addressing Protocol (ISATAP)



Translation 


As shown in Figure 3.Network Address Translation 64 (NAT64) allows IPv6-enabled devices to communicate with IPv4-enabled devices using a translation technique similar to NAT for IPv4. An IPv6 packet is translated to an IPv4 packet and vice versa.


NAT64 allows IPv6-only clients to communicate IPv4 servers using unicast UDP, TCP, or ICMP.  One or more public IPv4 addresses assigned to a NAT64   translator are shared among several IPv6-only clients. 


Sunday, 23 July 2017

The Need of IPv6

It’s a well-known fact that the Internet is growing at an astronomical speed due to the flexibility of its design. The devices we want to communicate with has grown from a collection of static devices to mobile devices mostly connected on the internet.


The IP version currently used in the internet and networks is IP version 4 (IPv4). IP version 4 was developed in the early ’70s to facilitate communication and information sharing between government researchers and academics in the United States. At that time, the system was closed with a limited number of access points, and therefore the developers didn’t imagine requirements such as security or quality of service. To its credit, IPv4 has continued for over 30 years and has been an important part of the Internet uprising.


The requirements of today’s networking extend far beyond support for web pages and email. The growth in network device variety and mobile communications; new services, and social networks are overwhelming IPv4 and have driven the increase of a next-generation Internet Protocol.


The depletion of IPv4 address space has been the motivating factor for moving to the next-generation internet protocol. As Africa, Asia and other countries become more connected to the Internet, there are not enough IPv4 addresses to accommodate this growth.


To help alleviate the depletion of IPv4 so many methods were adopted; including subnetting, NAT and PAT; but these methods were not able to provide the ability to scale networks for future demands.


IPv4 has a maximum of 4.3 billion addresses. Private addresses in combination with Network Address Translation (NAT) have been instrumental in slowing the depletion of IPv4 address space. However, NAT breaks many applications and has limitations that severely impede peer-to-peer communications


Internet of Everything (IOE)


The internet of everything is the concept of Cisco. The internet of Everything (IoE) is a concept that extends the Internet of Things emphasis on machine-to-machine communications to describe a more complex system that also encompasses people and processes.IPv6 fulfills these ever progressively complex requirements of hierarchical and boundless supply of IP addressing and improved mobility.


The Internet of today is totally different than from the Internet of past years.Because, today’s internet is not only email; web pages, and file transfer between different computers. The developing Internet is becoming an Internet of everything. No longer will the only devices accessing the Internet be computers, tablets, and smartphones. IoE expands on the concept of the “Internet of Things” in that it connects not just physical devices but quite literally everything by getting them all on the network.


The sensor-equipped, Internet-ready devices of tomorrow will include everything from automobiles and biomedical devices, to household appliances and natural ecosystems.


With an increasing Internet population; a limited IPv4 address space, issues with NAT and an Internet of Everything, the time has come to begin the transition to IPv6.

Special User IPv4 Addresses

There are many addresses that are used for special purposes. Just like the network address and broadcast address that cannot be assigned to hosts. There are many special addresses that can be allotted to hosts, but with limitations on how those hosts can interact within the network.


Loopback addresses (127.0.0.0 /8 or 127.0.0.1 to 127.255.255.254)


This network is reserved for loopback. Typically all IP addresses in the range of 127.0.0.1 – 127.255.255.255 are reserved for private use, but 127.0.0.1 is the loopback address in almost all cases.The IP address 127.0.0.1 is usually reserved for use on personal computer loopback testing. The IP addresses in this range are used by a host to direct traffic to itself. For example, it can be used on a host to test if the TCP/IP configuration is operational.  Network software and utilities can use 127.0.0.1 to access a local computer’s TCP/IP network resources. Messages sent to loopback IP addresses like 127.0.0.1 do not reach outside to the local area network (LAN) but instead are automatically re-routed by the computer’s own network adapter back to the receiving end of the TCP/IP stack.


Link-Local addresses (169.254.0.0 /16 or 169.254.0.1 to 169.254.255.254)


These addresses are commonly known as the Automatic Private IP Addressing (APIPA) addresses. The Link-local addresses are used to communicate two hosts, which are there on the same link when no other IP address is specified. In other words, when the system is booting up, OS tries to configure an address on its interface through various methods like – DHCP and Manual Configuration. If OS isn't able to configure an address on the interface through any of the automatic methods, then it configures an address on the interface from the link-local pool which is:-


254.0.0/16 - Link local address pool in IPv4 address space


In IPv4, every interface uses to have only one address. Because of the limitation of having one address on an interface in IPv4;  you may not have seen an address of range 169.254.0.0/16 on the interface.


TEST-NET addresses


These addresses are set aside for teaching and learning purposes. The following ranges are reserved for this purpose In RFC-5737.


192.168.2.0/24


198.51.100.0/24 


203.0.113.0/24 

Saturday, 22 July 2017

Classless Addressing

As we learn that all IP addresses have a network and host portion. In classful addressing, the network portion ends on one of the splitting dots in the address. On the other words, Classful addressing divides an IP address into the Network portion and Host portions along octet boundaries. Classful address uses a fixed subnet mask which is /8, /16 and /24, However, classless addressing uses a variable number of bits for the network and host portions of the address. The subnet mask is not fixed for classless addressing system.


The classful addressing system allocated 50% of the available IPv4 addresses to Class A networks; 25% of the IPv4 addresses to Class B; 12.5% of IPv4 addresses to Class C and the remaining 12.5 % Shared both Class D and E. One of the great problem in this system is the waste of IP address which decreases the availability of IPv4 addresses. For example, an organization that had a network with 300 hosts would need to be given a class B network with more than 65,000 addresses wasting 64,700 addresses.


To overwhelm the problem of address reduction and give more organizations access to the internet; classless addressing was introduced by IETF in 1993. In this system, there are no classes, but the addresses are still granted in blocks. In classless addressing system, when an organization or individuals, need to be connected to the Internet; it is granted a block or range of addresses.  The block or range varies based on the size of the organization or the requirement of individuals. For example; an individual may be given only two addresses and an organization may be given thousands of addresses based on the number of its requirements.


The IETF know that CIDR is only a temporary solution and that a new IP protocol must be required to overcome the problem of address reduction. In 1994, the IETF began its work to find a successor to IPv4, which ultimately became IPv6.

Friday, 21 July 2017

Classful Addressing

In 1981, classful addressing, formally adopted as part of the Internet Protocol (IP) in RFC 790, was the Internet's first major addressing scheme. The IP address was 32 bits in size, just as today, but was managed considerably differently. There were three address classes to chose from A, B, or C, corresponding to 8-bit, 16-bit, or 24-bit prefixes. No other prefix lengths were allowed, and there was no concept of nesting a group of 24-bit prefixes, for example, within a 16-bit prefix.


There are two other classes were also defined; class D addresses and class E addresses, however, neither of these two address classes were normally used. Class D is used for Multicasting and is rarely used.  Class E is an experimental address that is reserved for future use. For humans, the easiest way to distinguish between different address classes is to use the first decimal number in the IP address. The figure below all aspects of IP classes.


classful


Classful networks use the classful subnet mask according to the leading bits in the first block of the IP address. Following is the detail of first three classes:-


Class A (0.0.0.0 to 127.255.255.255)


The default subnet mask for this class is 255.0.0.0 or /8. This class is used to support extremely large network with more than 16 million hosts. High order bit of Class A addresses must be zero, so a zero creating total 128 possible class A network.


Class B (128.0.0.0 – 191.255.255.255)


The default subnet mask for this class is 255.255.0.0 or /16. This class supports the large networks up to 65,000 host addresses. The high-order bits for this class is 10 in the first octet and the remaining bits of the first 2 octets create over 16,000 networks.


Class C (192.0.0.0  – 223.255.255.255)


The default subnet mask for this class is 255.255.255.0 or /24. This class is designed to support small networks with a maximum of 254 hosts. The first three bits of the octet indicate the high order bit. The remaining bits of the first octet; 2nd octet, and 3rd octets indicate the network and the 4th octet indicate host addresses in this class. The high-order bit is 110. Class C address has over 2 million possible networks.

Tuesday, 18 July 2017

Private and Public IP Addresses

Public IP addresses


A public IP address is an IP address that is assigned to a network devices, host and servers to allow direct access to the Internet. Different type of servers like a web server, email server and any server device directly accessible from the Internet are using public IP addresses. A public IP address is globally unique, and can only be assigned to a unique device. Each and every device that's accessing the internet is using a unique IP address. Public IP addresses are required for any publicly accessible network hardware; like for your home router as well as for the servers that host websites.


Public IPv4 addresses are addresses which are globally routed between different ISPs. However, some IPv4 addresses can’t be used on the Internet. These addresses are called private addresses. These addresses are used for internal hosts on most of the organization.


Private IP addresses


In the mid-1990s private IPv4 addresses were introduced because of the reduction of IPv4 address space. Private IPv4 addresses are not unique and can be used by an internal network. These addresses are allocated to organizations for their own private network. The computers at your home, your tablets, smartphones, network printer; and the computers within organizations are generally assigned private IP addresses.


When a computer is assigned a private IP address, the local computer and devices can see can see this computer through its private IP address. But, the devices exist outside of your private network cannot directly communicate via the private IP address, however, uses router's public IP addresses, devices outside a private network can communicate. To allow direct access to a local device which is assigned a private IP address, a Network Address Translator (NAT) should be used. The range of private IP address is following for all three classes.


10.0.0.0 /8 or 10.0.0.0 to 10.255.255.255


172.16.0.0 /12 or 172.16.0.0 to 172.31.255.255


192.168.0.0 /16 or 192.168.0.0 to 192.168.255.255


It is important that the above mention blocks are not allowed on the Internet and must be discarded by Internet routers.

Thursday, 13 July 2017

IPv4 Communication - Unicast, Broadcast and Multicast

There are three types of communication process used for sending a data over networks. In all cases, the IPv4 address of the originating host is placed in the packet header as the source address. All three communication process is following:-



  • Unicast- The process of sending a data packet from one host to an individual host.

  • Broadcast- The process of sending a data packet from one host to all hosts in the network.

  • Multicast- The process of sending a packet from one host to a group of hosts, not to all hosts,  possibly in different networks


Unicast Transmission


Unicast is the term used to describe communication process between host-to-host over a network. the unicast packets used the destination device address as a destination address and can be routed through an internetwork. In unicast transmission, there is just one sender, and one receiver.


In an IPv4 network, for unicast communication, the addresses assigned to the two end devices are used as the source address and destination address.The source host encapsulates its own IPv4 address as source host address and the IPv4 address of the destination host as the destination address during the encapsulation process. Remember that the source address of any packet is always the unicast address of the originating host.


The range of IPv4 unicast addresses is from 0.0.0.0 to 223.255.255.255. but; inside this range, many addresses are reserved for special purposes. These special purpose addresses will be discussed coming articles.


Broadcast Transmission


The broadcast is the term used to describe communication where a packet is sent from one host to all other hosts over the network. In this case, there is just one sender, but the information is sent to all connected receivers.


The broadcast is used a broadcast address to send packets to all hosts in the network. With a broadcast, the packet header contains a destination IPv4 address with all ones (1s) in the host portion. This means that all hosts on that local network will receive the packet. Many network protocols used to broadcast, such as DHCP. When a host receives a packet sent to the network broadcast address, the host processes this packet as it would a packet received to its unicast address.


There are two types of a broadcast first is directed and the other is limited. A directed broadcast is sent to all hosts on a particular network. For example, a host on the 172.16.16.0/24 network sends a packet to 172.16.16.255. This address is routable, so a router would forward it to the end destination gateway if the router is configured to do so But a limited broadcast is sent to 255.255.255.255. The traffic sent to that address will be sent to all the hosts on the local network; it is not a routable address, so a router would not route it anywhere. By default, routers do not forward broadcasts.


A broadcast packet uses resources on the network and every host on the network must process the packet. So that affects the efficiency of the network and its devices. Therefore, broadcast traffic should be limited so that it does not affect the performance of the network or devices. Because routers separate broadcast domains, subdividing of networks can also improve the performance of the network.


Multicast Transmission


Multicast is the term used to describe communication where a data packet is sent from one or more host to a group of other hosts. In this case, there is may be one or more senders; and the information is distributed to a group of receivers. Multicast transmission reduces the traffic by allowing a host to send a single packet to a selected set of hosts that subscribe to a multicast group.


IPv4 has reserved the address range of 224.0.0.0 to 239.255.255.255 for multicasting. The IPv4 multicast addresses 224.0.0.0 to 224.0.0.255 are reserved for multicasting on the local network only. A router connected to the local network know that these packets are addressed to a local network multicast group and never forwards them further. A typical use of reserved local network multicast address is in routing protocols using the multicast transmission to exchange routing information. For example, 224.0.0.9 is the multicast address used by RIP version 2 to communicate with other RIP version 2 routers.


The multicast client can receive multicast data by using client program services. The client program is used to subscribe to the multicast group. Each multicast group is its own IPv4 multicast destination address. When host subscribes to a multicast group, the host processes packets addressed to this multicast address, and packets addressed to its uniquely allocated unicast address.

Wednesday, 12 July 2017

The IPv4 Prefix Length, Host and Broadcast Addresses

The Prefix Length


Expressing network addresses and host addresses with the dotted decimal subnet mask address is very difficult. So there is an alternate method of identifying a subnet mask called the prefix length. The prefix length is the number of bits set to 1 in the subnet mask. It is written in “slash notation”, which is a “/” followed by the number of bits set to 1 in the subnet mask. Therefore, count the number of bits in the subnet mask and write slash followed by the number of bits set to 1.


The table in the figure illustrates the slash notation. The first column lists various subnet masks that can be used with a host address. The second column displays the converted 32-bit binary address. The last column displays the resulting prefix length.






























































































































The Subnet Mask



32-bit address



Prefix-length



255.0.0.0



11111111.00000000.00000000.00000000



/8



255.128.0.0



11111111.10000000.00000000.00000000



/9



255.192.0.0



11111111.11000000.00000000.00000000



/10



255.224.0.0



11111111.1110000.00000000.00000000



/11



255.240.0.0



11111111.11110000.00000000.00000000



/12



255.248.0.0



11111111.11111000.00000000.00000000



/13



255.252.0.0



11111111.11111100.00000000.00000000



/14



255.254.0.0



11111111.11111110.00000000.00000000



/15



255.255.0.0



11111111.11111111.00000000.00000000



/16



255.255.128.0



11111111.11111111.10000000.00000000



/17



255.255.192.0



11111111.11111111.11000000.00000000



/18



255.255.224.0



11111111.11111111.11100000.00000000



/19



255.255.240.0



11111111.11111111.11110000.00000000



/20



255.255.248.0



11111111.11111111.11111000.00000000



/21



255.255.252.0



11111111.11111111.11111100.00000000



/22



255.255.254.0



11111111.11111111.11111110.00000000



/23



255.255.255.0



11111111.11111111.11111111.00000000



/24



255.255.255.128



11111111.11111111.11111111.00000000



/25



255.255.255.192



11111111.11111111.11111111.11000000



/26



255.255.255.224



11111111.11111111.11111111.11100000



/27



255.255.255.240



11111111.11111111.11111111.11110000



/28



255.255.255.248



11111111.11111111.11111111.11111000



/29



255.255.255.252



11111111.11111111.11111111.11111100



/30



Host Address


The host address is a unique IP addresses which is assigned to hosts and devices. The host portion always contains various 0s and 1s but never all 0s or all 1s.


First Host Address


The first available host IP address in that network which has all 0s and end with a 1 in the host portion. It is also called first usable IP address.


Example




















 Dotted Decimal Notation Binary
Network IP Address172.16.16.0/2010101100.00010000.00010000.00000000
First Usable IP address172.16.16.110101100.00010000.00010000.00000001

Last Host Address


The last available host IP address in that network which has 1s and ends with a 0 in the host portion.It is also called last usable IP address.


Example




















 Dotted Decimal Notation Binary
Network IP Address172.16.16.010101100.00010000.00010000.00000000
Last Usable IP Address172.16.31.25410101100.00010000.00011111.11111110

Broadcast Address


This is a special address that communicates with all hosts in a network. For example, when a host sends a packet to the network broadcast address, all hosts in the network will receive the packet. The broadcast address uses the highest address in the network range. The broadcast address has all 1s in the host portion.


Example




















 Dotted Decimal Notation Binary  
Network IP Address172.16.16.010101100.00010000.00010000.00000000  
Broadcast IP address172.16.31.25510101100.00010000.00011111.11111111

 

Sunday, 9 July 2017

ANDing – Determining Network Address

Inside network devices, digital logic is applied for their interpretation of the addresses. When creating an IPv4 packet, the destination network address must be extracted from the destination address. This is done by a logic called ANDing. ANDing is the basic binary operation to determine network address. There is two other process that is also used in data networking but not used for determining IP address. The other two are OR and NOT operation.  The IPv4 address is logically ANDed with its subnet mask to determine the network address to which the is associated. When ANDing between the address and the subnet mask is performed, the result gives the network address.


AND Operation


A Logic AND Gate is a type of digital logic gate that has an output which is usually at logic level “0” and only goes “HIGH” to a logic level “1” when ALL of its inputs are at logic level “1”


The output state of a “Logic AND Gate” return “LOW” when any of its inputs are at a logic level “0”. In other words for a logic AND gate, any LOW input will give a LOW output.


The logic expression given for a digital logic AND gate is that for Logical Multiplication which is denoted by a single dot or full stop symbol, ( . ) giving us the Boolean expression of  A.B = X


Logical AND is the operation of two bits that gives the following result.


0 AND 0 = 0


0 AND 1 = 0


1 AND 0 = 0


1 AND 1 = 1


So Anything ANDed with a 0 produces a 0. These characteristics of ANDing are used with the subnet mask to “mask” the host bits of an IPv4 address. Each bit of the address is ANDed with the parallel bit to the subnet mask. As we learn in previous lessons that all bits of the subnet mask that represent host bits are 0s, the host portion of the resultant network become all 0s. Remember that all 0 in the host portion of IPv4 address mean that this is the network address. As we know that all bits of subnet mask in network portion are all 1s. when each of these 1s ANDed with a parallel bit of the address, the resulting bits are identical to the original address bits.


So to identify the network address of an IPv4 host, the IPv4 address is logically ANDed, bit by bit, with the subnet mask. ANDing between the address and the subnet mask produce the network address.


Example 1: Find out what the network ID for the following IP address.
IP address:          192.168.100.150
IP subnet mask: 255.255.255.0


The binary equivalent for IP address 140.12.26.128:



  • 192 binary is 11000000

  • 168 binary is 10101000

  • 100 binary is 01100100

  • 50 binary is 00110010


So the binary for this IP address is:  11000000.10101000.01100100.00110010


Now look at the binary equivalent for the subnet mask 255.255.255.0:



  • 255 binary is 11111111

  • 255 binary is 11111111

  • 240 binary is 11111111

  • 0 binary is 00000000


So the binary for the subnet mask is 11111111. 11111111. 11111111. 00000000
Now subtract the binary IP address from the binary subnet mask
And then convert it to decimal.


Binary IP Address:         11000000.10101000.01100100.00110010
Binary subnet mask:    11111111. 11111111. 11111111.00000000
                                              ====================================
Binary Result                   11000000. 10101000.01100100.00000000
Decimal result:                    192.             168.            100.              0


So the network ID for this IP/subnet is 192.168.100.0. Lets check the network ID for 172.16.31.240 IP address which subnet mask is 255.255.248.0


Example -2


IP address:          172.16.31.240
IP subnet mask: 255.255.248.0


The binary for this IP address is:  10101100.00010000.00011111.11110000 and the binary equivalent for the subnet mask 255.255.248.0
The binary for the subnet mask is 11111111. 11111111. 11110000. 00000000
now subtract binary subnet mask from binary IP address.


Binary IP Address:          10101100.00010000.00011111.11110000
Binary subnet mask:     11111111. 11111111. 11110000.00000000
                                             ====================================
Binary Result                10101100.00010000.00010000.00000000
Decimal result:                    172.             16.            16.          0

Thursday, 6 July 2017

Network and Host Portion of IPv4 Address

Each network running with TCP/IP must have a unique network number, and every machine on the network must have a unique IP address. It is very important to know how IP addresses are constructed and what is the structure of IP addresses. The IPv4 address is a 32-bit number that uniquely identifies a network interface on a machine. An IPv4 address is typically written in decimal digits, formatted as four 8-bit fields separated by periods. Each 8-bit field represents a byte of the IPv4 address. This form of representing the bytes of an IPv4 address is often referred to as the dotted-decimal format.


The understanding binary notation is very important to understand IP address and its portions. The IPv4 address is a hierarchical address that is made up of a network portion and a host portion. When determining the network portion vs the host portion, it is important to look at the 32-bit stream of IPv4 address. Within the 32-bit stream, a portion of the bits identify the network portion, and a portion of the bits identify the host portion.


The bits within the network portion of the address must be the same for all devices that exist in the same network. The bits within the host portion of the address must be unique to identify a specific host within a network. If two hosts have the same bit-pattern in the specified network portion of the 32-bit stream, those two hosts will be located in the same network. The subnet mask is used to identify the host portion and network portion of the IP address.


The Subnet Mask


Three important parameters must be configured for an each host in a network which is following.



  • Host Unique IPv4 address– Unique IPv4 address of the host which identify the host number on the network.

  • Subnet mask- Used to identify the network portion and host portion of the IPv4 address.

  • Host Default gateway– Host default gateway used to Identifies the local gateway to reach other networks.


Understanding of the subnet mask is very important to determine the network portion and host portion of the IP address. The network address represents all the devices on the same network.


Figure 1 displays the dotted decimal address and the 32-bit subnet mask. Important to remember host portionthat Network bets must be all 1s and host bits must be all 0s in the subnet mask. As you can see in figure 2 in the subnet mask a sequence of 1 bits followed by a sequence of 0 bits. So To identify the network and host portions of an IPv4 address, the subnet mask is compared to the IPv4 address bit, from left to right as shown in Figure 2.host portion The 1s in the subnet mask identifies the network portion while the 0s in the subnet mask identify the host portion.  The process that is used to identify the network portion and host portion are called ANDing. The ANDing will be explained in text lesson.