Day 4
Day 4
Number system is also known as Numeral system. Most of us heard binary, Decimal,
Hexadecimal etc. Representation of any number changes, as we change the base. So
base is the number of digits or combination of digits and letters.
Commonly used number system:
Decimal – Base 10 – System uses 10 digits from 0 ,1, 2,3,4,5,6,7,8, and 9
Binary – Base 2 – Digits are either 1 or 0
HexaDecimal – Base 16 – system uses 16 digits from 0 to 9 and A,B,C,D,E, and F.
Conversion from Binary to Decimal to Hexadecimal
Nibble is 4 bit and byte is 8 bit. Following shows a decimal value of each bit location in a nibble and a byte.
Nibble 8 4 2 1
Byte 128 64 32 16 8 4 2 1
Numbers are placed in value spot; starting from right and moving left with each spot having double the value
of the previous spot.
IP network may be divided into sub networks in both IPv4 and IPv6. For this
purpose, an IP address is recognized as consisting of two parts:
- Network prefix in the higher order bit
-Remaining bit is called Host bit or rest field or Interface identifier(IPv6)
IP Address Hierarchy
• An IP address consist of 32bits. These bits are divided into 4 section referred as
Octet or byte, each containing 1 byte or 8 bits.
• 32 bit IP address is structured or hierarchical. It is structured by network and host
or by network, subnet and host.
• Designer of Internet decided to create classes of network based on network size.
For smaller number of node – they created Class C and for Large number of node
they created Class B. Class distinction between large and small is predictably called
Class B.
Class A
Designer of IP address scheme said that the first bit of the first byte in Class A network address must
always be OFF i.e 0.
0000 0000 = 0
0111 1111 = 127
So IP address range in Class A is 0-127
127 is reserved for loopback and so the Class A IP range will be 0-126
Class B
RFC state that first bit of the first byte must always be turned on but the second bit must always be
turned off.
1000 0000 = 128
1011 1111 = 191
Class B IP range 128-191
Class C
RFC define the first 2 bit of the first octet must always be turned on but the third bit must always be
turned off.
1100 0000 = 192
1101 1111 = 223
Class C IP range 192-223
Follows the similar pattern for Class D and Class E. IP range for Class D 224-239 is reserved for multicast
and Class E 240-255 are reserved for scientific/Research purpose. So we don’t need them.
Subnetting
Subnet Mask: Subnet mask is a 32bit value that allows the recipient of IP packets to
distinguish the network ID portion of the IP address from the host ID portion of the IP
address.
32-bit subnet mask composed of 1s and 0s. 1s in the subnet mask represent Network or
Subnet address and 0s represents Hosts. Default subnet mask:
Class A: Decimal - 255.0.0.0 Binary : 11111111.00000000.00000000.00000000
Class B: Decimal - 255.255.0.0 Binary: 11111111.11111111.00000000.00000000
Class C: Decimal - 255.255.255.0 Binary :11111111.11111111.11111111.00000000
Default Gateway : A gateway is a network node that serves as an access point to another
network.
Power of 2
2n Decimal 2n Decimal
21 2 211 2048 Subnetting: Subnetting means you divide
large network into smaller networks or
22 4 212 4096 logical partition of an IP network or you
23 8 213 8192 borrow bits from the host portion of the IP
address and reserve them to define
24 16 214 16384 subnet.
25 32 215 32,768
26 64 216 65,536
27 128 217 131,072
28 256
29 512
210 1024
Historical Classful Network Architecture
Private IP Address : These IP addresses are non-routable and reserved, as it is not unique
Addresses. All addresses outside private IP address range are considered public.
Bit Wise Representation
IP address - Reservation
IP address are reserved for special purpose. So they can’t be assigned to nodes.
Address Functions
Network Address of all 0s Interpreted “This Network or Segment” For e.g.
0.0.0.110 for sending broadcast messages to the
network.
Network Address of all 1s Interpreted “All Network”
Network 127.0.0.0 Reserved for loopback test. It allow to test packet
without generating network traffic
Node address of all 0s Interpreted “Network Address” For e.g. 17.16.0.0
or 10.0.0.0
Node address of all 1s Interpreted “All Nodes” on Network or Broadcast
address.
0.0.0.0 Designate default route “Any Network” or
Unspecified.
255.255.255.255 Broadcast messages to all network
169.254.0.0 APIPA [Automatic Private IP Addressing]/Link-Local
address
224.0.0.0 to 224.0.0.255 Local Subnetwork
• What is the class C address range in Decimal and binary?
• What is the valid range of a class A network address?
• What is 127.0.0.1 address used for?
• How do you find the network address from the listed IP address?
• How do you find the broadcast address from a listed IP address?
• What is the class A private IP address space?
• What is the class B private IP address space?
• What is the class C private IP address space?
• What are all the available characters that you can use in hexadecimal addressing?
Classless Inter-Domain Routing [CIDR]
• IETF (Internet Engineering Task Force) Introduce CIDR in 1993 to replace the classful
addressing system.
• CIDR is basically the method that ISP(Internet Service Provider) use to allocate a number of IP
addresses to customer either home or office. They provide addresses in certain block size.
• When you receive block of addresses from ISP for e.g. 192.168.10.32/28. This tells you what
your subnet mask is 255.255.255.240
For e.g. Class A default subnet mask is 255.0.0.0 and in binary 11111111 and CIDR format it will
be /8.
Slash notation means how many bits are turned on, so the maximum could be /32.
To determine the number of subnets, valid hosts, and broadcast addresses of subnet
for 192.168.1.0/26
How many subnet 2x = number of subnets. X is the number of masked bit
1100 0000 = 22 = 4 subnets.
How many host per subnet 2y= number of host per subnet. Y is the number of
unmarked bits. Valid host will be 2y-2 [ 1 for Network and 1 for broadcast]
26-2 is 64-2=62 Hosts per subnet
Valid Subnets = 256- subnet mask = block size
256-192=64 block size
4 subnets = 0 64 128 192
Broadcast address for each subnet will be number right before the next subnet. For e.g.
0 subnet will have a broadcast address 63 because next segment is 64
Valid Host are the number between subnet and broadcast. For e.g. If 0 is the subnet and
63 is broadcast so the valid host range is 1-62
Broadcast Address = For 0 subnet broadcast address is 127 and For 128 subnet
broadcast address is 255
Subnet 1 Subnet 2
Subnet 0 128
First Host 1 129
Last Host 126 254
Broadcast 127 255
2. 192.168.10.0/27
3. 192.168.10.0/28
4. 192.168.10.0/29
Subnetting for Class B network
Process of subnetting class B is same as class C, except that you have more host bits
and you start in 3 octet and for 4 octet add 0 to network portion and 255 to
broadcast.
For e.g. 172.16.0.0/19
11100000.00000000
Subnet (2x) = 23=8 Subnets
Host Per Subnet (2y-2)= 213-2=8190
Valid Subnet =256-224=32 Block size
Subnet 1 Subnet 2 Subnet 3 Subnet 4 …. Subnet 8
Subnet 0.0 32.0 64.0 96.0 224.0
First Host 0.1 32.1 64.1 96.1 224.1
Last Host 31.254 63.254 95.254 127.254 255.254
Broadcast 31.255 63.255 95.255 127.255 255.255
Practice for Class B
1. What is the subnet and broadcast address of the subnet in which
172.16.10.33/27 resides?
Soln: Look at the 4 octect i.e. 33
Valid Subnet = 256-224 = 32
So 32 +32 =64 and 33 falls under 32-64
Subnet: 172.16.10.32
Broadcast : 172.16.10.63
Classless routing protocol such as RIPv2, EIGRP, IS_IS, and OSPF supports route
summarization based on subnet addresses, including VLSM addressing. Classless
support summarization on an any boundary.
Classfulrouting protocol such as RIPv1, and IGRP automatically summarize routes on the
classful network boundary and do not support summarization on any other bit
boundaries.
Implement Route Summarization/Supernet
Route Summarization [How to Supernet a network]
1. Convert all IP in binary
2. Find matching bits from left to right
3. Re-write the matching numbers and add remaining 0s . This will be your New
Network ID.
4. Calculate the new subnet mask.
You can implement ip subnet zero on point-to-point serial interface only. In here, you
use /31 subnet where we only 2 IP’s which can be implemented on router directly
connected to each other via serial interface.