Monday, 19 March 2018

What is IP address?

What is IP address?
An Internet Protocol address (IP address) is a numerical label assigned to each device connected to a computer network that uses the Internet Protocol for communication.

IPv4 is a 32-bit address. It is divided into 4 Octet. Each octet is 8 bits. Bits are represented by 0's and 1's

Example: 192.168.1.1
The binary version of it is: 11000000.10101000.00000001.00000001

Total Range of IPv4 Address:

First octet
Second octet
Third octet
Fourth octet
Starting range
00000000
00000000
00000000
00000000
Ending Range
11111111
11111111
11111111
11111111

Converting the above table of binaries into decimal we get the following

First octet
Second octet
Third octet
Fourth octet
Starting range
0
0
0
0
Ending Range
255
255
255
255

So the Range of IPv4 address is 0.0.0.0 to 255.255.255.255


The different classes of IPv4 Address
  • Class A
  • Class B
  • Class C
  • Class D
  • Class E:
Priority Bit:
This is used for IP address classification. The Leftmost bit from the First octet is used for priority bits

Class A
0
Class B
10
Class C
110
Class D
1110
Class E
1111

Class A: For CLASS A the first bit of the first octet is reserved as the priority bit
0XXXXXXX
2^7
2^6
2^5
2^4
2^3
2^2
2^1
2^0
Decimal Value
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
0
0
0
0
0
0
1
0
2
0
0
0
0
0
0
1
1
3


0
1
1
1
1
1
1
1
127

The range starts from 0.0.0.0
The ends with 127.255.255.255

Class B: For CLASS B the first 2 bits of the first octet are reserved as the priority bit
10XXXXXX
2^7
2^6
2^5
2^4
2^3
2^2
2^1
2^0
Decimal Value
1
0
0
0
0
0
0
0
128
1
0
0
0
0
0
0
1
129
1
0
0
0
0
0
1
0
130
1
0
0
0
0
0
1
1
131


1
0
1
1
1
1
1
1
191

The range starts from 128.0.0.0
The ends with 191.255.255.255

Class C: For CLASS C the first 3 bits of the first octet is reserved as the priority bit
110XXXXX
2^7
2^6
2^5
2^4
2^3
2^2
2^1
2^0
Decimal Value
1
1
0
0
0
0
0
0
192
1
1
0
0
0
0
0
1
193
1
1
0
0
0
0
1
0
194
1
1
0
0
0
0
1
1
194


















1
1
0
1
1
1
1
1
223

The range starts from 192.0.0.0
The ends with 223.255.255.255

Class D: For CLASS D the first 4 bits of the first octet are reserved as the priority bit
1110XXXX
2^7
2^6
2^5
2^4
2^3
2^2
2^1
2^0
Decimal Value
1
1
1
0
0
0
0
0
224
1
1
1
0
0
0
0
1
225
1
1
1
0
0
0
1
0
226
1
1
1
0
0
0
1
1
227


















1
1
1
0
1
1
1
1
239

The range starts from 224.0.0.0
The ends with 239.255.255.255

Class E: For CLASS E the first 4 bits of the first octet are reserved as the priority bit
1111XXXX
2^7
2^6
2^5
2^4
2^3
2^2
2^1
2^0
Decimal Value
1
1
1
1
0
0
0
0
240
1
1
1
1
0
0
0
1
241
1
1
1
1
0
0
1
0
242
1
1
1
1
0
0
1
1
243


















1
1
1
1
1
1
1
1
255

The range starts from 240.0.0.0
The ends with 255.255.255.255




CLASS
IP address range
Class A
0.0.0.0 - 127.255.255.255
Class B
128.0.0.0 - 191.255.255.255
Class C
192.0.0.0 -223.255.255.255
Class D
224.0.0.0 - 239.255.255.255
Class E
240.0.0.0 - 255.255.255.255



Octal Format:

Class A : N.H.H.H
Class B : N.N.H.H
Class C : N.N.N.H

N = Refers to the Network Portion
H = Refers to the Host portion

Network address:  IP address with all bits as ZERO in the host portion.
Broadcast address: IP address with all bits as ONES in the host portion. 

Valid IP Addresses lie between the Network Address and the Broadcast Address. 

Calculate the Number of Networks for each Class:

The priority bit that was mentioned above will be used

Class A Octet Format is  N.H.H.H
Network bits : 8                      
No. of Networks          
                        =       2^(no of network bits– Priority bit)
                        =          2^(8-1)
                        =          2^7
                        =          128 – 2 (-2 is for 0 & 127 Network)
                        =          126 Networks

Class B Octet Format is  N.N.H.H

Network bits : 16                    
No. of Networks          
                        =          2^(no of network bits– Priority bit)
                        =          2^(16-2)
                        =          2^14
                        =          16384 Networks

Class C Octet Format is  N.N.N.H
           
Network bits : 24
No. of Networks        
                        =          2^(no of network bits– Priority bit)
                        =          2^(24-3)
                        =          2^21
                        =          2097152 Networks

Calculate the Number of Host for each Class:




Class A Octet Format is  N.H.H.H

Host bits : 24
No. of Networks          
                        =       2^(no of host bits) -2     
                        =          2^(24) – 2
                        =          16777216 - 2
                        =          16777214 Hosts/Network


Class B Octet Format is  N.N.H.H

Host bits : 16              
No. of Networks          
                        =          2^(no of host bits) -2  
                        =          2^(16) – 2
                        =          65536 - 2
                        =          65534 Hosts/Network


Class C Octet Format is  N.N.N.H
           
Host bits : 8
No. of Host      
                        =          2^(no of host bits) -2              
                        =          2(8) – 2
                        =          256 - 2
                        =          254 Hosts/Network


Thursday, 15 February 2018

CCNA - Static Route configuration

LAB: To demonstrate the understanding of Static route configuration

Topology:

FIG: Initial Lab setup

Configuration

Router1: ConfigurationRouter>enable
Router#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#hostname Router-1
//CONFIGURE FASTETHERNET INTERFACE
Router-1(config)#interface fastEthernet 0/0
Router-1(config-if)#ip address 192.168.1.1 255.255.255.0
Router-1(config-if)#no shutdown
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
Router-1(config-if)#exit
//CONFIGURE SERIAL INTERFACE
Router-1(config)#interface serial 0/0
Router-1(config-if)#ip address 10.0.0.2 255.0.0.0
Router-1(config-if)#no shutdown
%LINK-5-CHANGED: Interface Serial0/0, changed state to down
Router-1(config-if)#clock rate 64000
Router-1(config-if)#exit

Router2: Configuration

Router>enable
Router#configure terminal
Router(config)#hostname Router-2
//CONFIGURE SERIAL INTERFACE
Router-2(config)#interface serial 0/0
Router-2(config-if)#ip address 10.0.0.3 255.0.0.0
Router-2(config-if)#no shutdown
Router-2(config-if)#exit
Router-2(config)#interface serial 0/1
Router-2(config-if)#ip address 11.0.0.2 255.0.0.0
Router-2(config-if)#no shutdown
Router-2(config-if)#clock rate 64000
Router-2(config-if)#exit
Router-2(config)#exit
Router-2#


Router3: Configuration

Router>enable
Router#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#hostname Router-3
//CONFIGURE FASTETHERNET INTERFACE
Router-3(config)#interface fastEthernet 0/0
Router-3(config-if)#ip address 192.168.2.1 255.255.255.0
Router-3(config-if)#no shutdown
Router-3(config-if)#exit
//CONFIGURE SERIAL INTERFACE
Router-3(config)#interface serial 0/1
Router-3(config-if)#ip address 11.0.0.3 255.0.0.0
Router-3(config-if)#no shutdown
Router-3(config-if)#exit
Router-3(config)#exit


Configuring Static Route on all 3 routers: 

Router-1(config)#ip route 11.0.0.0 255.0.0.0 10.0.0.3
Router-1(config)#ip route 192.168.2.0 255.255.255.0 10.0.0.3
Router-1(config)#exit

Router-2(config)#ip route 192.168.1.0 255.255.255.0 10.0.0.2
Router-2(config)#ip route 192.168.2.0 255.255.255.0 11.0.0.3
Router-2(config)#exit

Router-3(config)#ip route 10.0.0.0 255.0.0.0 11.0.0.2
Router-3(config)#ip route 192.168.1.0 255.255.255.0 11.0.0.2
Router-3(config)#exit

Verification: 

Check the routing table on all the three routers 

Router-1#show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
       i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
       * - candidate default, U - per-user static route, o - ODR
       P - periodic downloaded static route

Gateway of last resort is not set

C    10.0.0.0/8 is directly connected, Serial0/0
S    11.0.0.0/8 [1/0] via 10.0.0.3
C    192.168.1.0/24 is directly connected, FastEthernet0/0
S    192.168.2.0/24 [1/0] via 10.0.0.3
Router-1#

Router-2#show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
       i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
       * - candidate default, U - per-user static route, o - ODR
       P - periodic downloaded static route

Gateway of last resort is not set

C    10.0.0.0/8 is directly connected, Serial0/0
C    11.0.0.0/8 is directly connected, Serial0/1
S    192.168.1.0/24 [1/0] via 10.0.0.2
S    192.168.2.0/24 [1/0] via 11.0.0.3
Router-2#


Router-3#show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
       i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
       * - candidate default, U - per-user static route, o - ODR
       P - periodic downloaded static route

Gateway of last resort is not set

S    10.0.0.0/8 [1/0] via 11.0.0.2
C    11.0.0.0/8 is directly connected, Serial0/1
S    192.168.1.0/24 [1/0] via 11.0.0.2
C    192.168.2.0/24 is directly connected, FastEthernet0/0
Router-3#

Ping from COMPUTER 1 to COMPUTER 2


PING computer 1 to compuer 2- Verification of static route


CCNA 200-301 Ebooks download

CCNA 200-301 Official Cert Guide - Volume 1 - Download CCNA 200-301 Official Cert Guide - Volume 2 - Download CCNA 200-301 Portable G...