Showing posts with label CCNA. Show all posts
Showing posts with label CCNA. Show all posts

Monday, July 8, 2013

Types Of Routing Explained Briefly

IP Routing
When we want to connect two or more networks using different n/w addresses then we have to use IP Routing technique. The router will be used to perform routing between the networks. A router will perform following functions for routing.
(1)   Path determination
(2)   Packet forwarding
(1) Path determination
The process of obtaining path in routing table is called path determination. There are three different methods to which router can learn path.
i) Automatic detection of directly connected n/w.
ii) Static & Default routing
iii) Dynamic routing

(2) Packet forwarding
It is a process that is by default enable in router. The router will perform packet forwarding only if route is available in the routing table.

Routing Process
(i) The pc has a packet in which destination address is not same as the local n/w address.
(ii) The pc will send an ARP request for default gateway. The router will reply to the ARP address and inform its Mac address to pc.
(iii) The pc will encapsulate data, in which source IP is pc itself, destination IP is server, source Mac is pc’s LAN interface and destination Mac is router’s LAN interface.

               S. MAC                       D. MAC
     PC1                             R1
Destination. IP     172.16.0.5
Source. IP      10.0.0.6
The router will receive the frame, store it into the buffer. When obtain packet from the frame then forward data according to the destination IP of packet. The router will obtain a route from routing table according to which next hop IP and interface is selected .
(iv) According to the next hop, the packet will encapsulated with new frame and data is send to the output queue of the interface.

Static Routing
In this routing, we have to use IP route commands through which we can specify routes for different networks. The administrator will analyze whole internetwork topology and then specify the route for each n/w that is not directly connected to the router.

Steps to perform static routing
(1) Create a list of all n/w present in internetwork.
(2) Remove the n/w address from list, which is directly connected to n/w.
(3) Specify each route for each routing n/w by using IP route command.
Router(config)#ip route <destination n/w> <mask> <next hop ip>
Next hop IP it is the IP address of neighbor router that is directly connected our router.

Static Routing Example: -
Router#conf ter
Router(config)#ip route 10.0.0.0 255.0.0.0 192.168.10.2

Advantages of static routing
(1) Fast and efficient.
(2) More control over selected path.
(3) Less overhead for router.
(4) Bandwidth of interfaces is not consumed in routing updates.

Disadvantages of static routing
(1) More overheads on administrator.
(2) Load balancing is not easily possible.
(3) In case of topology change routing table has to be change manually

Alternate command to specify static route
Static route can also specify in following syntax: - Old
Router(config)#ip route 172.16.0.0 255.255.0.0 172.25.0.2
Or
Router(config)#ip route 172.16.0.0 255.255.0.0 serial 0
  
Backup route or loading static route
If more than one path are available from our router to destination then we can specify one route as primary and other route as backup route. Administrator Distance is used to specify one route as primary and other route as backup. Router will select lower AD route to forward the traffic. By default static route has AD value of 1. With backup path, we will specify higher AD so that this route will be used if primary route is unavailable.

Protocols                                  AD
Directly Connected                     0
Static                                         1
BGP                                         20
EIGRP                                     90
IGRP                                      100
OSPF                                     110
RIP                                         120 
 Syntax: - To set backup path
Router(config)#ip route <dest. n/w> <mask> <next hop> <AD>
                                                                              Or
                                                                        <exit interface>
Example: -
Router#conf ter
Router(config)#ip route 150.10.0.0 255.255.0.0 150.20.0.5
Router(config)#ip route 150.10.0.0 25.255.0.0 160.20.1.1 8 (below 20)
Router(config)#exit

Default Routing
Default routing means a route for any n/w. these routes are specify with the help of following syntax: -
Router(config)#ip route 0.0.0.0 0.0.0.0 <next hop>
                                                                        Or
                                                            <exit interface>
This type of routing is used in below diagram

Dia 1 - Stub network :- A n/w which has only one exit interface is called stub network.

If there is one next hop then we can use default routing
  Dia 2 - Internet connectivity :- On Internet, million of n/ws are present. So we have to specify default routing on our router. Default route is also called gateway of last resort. This route will be used when no other routing protocol is used. 

Router(config)#ip route 10.0.0.0 255.0.0.0 172.16.0.5
Router(config)#ip route 0.0.0.0 0.0.0.0 200.100.100.11

To display routing table --> Router#sh ip route
To display static routes only --> Router#sh ip route static
S 192.168.10.0/28 [1/0] via 172.16.0.
To display connected n/ws only --> Router#sh ip route connected
To check all the interface of a router --> Router#sh interface brief

Dynamic Routing
In dynamic routing, we will enable a routing protocol on router. This protocol will send its routing information to the neighbor router. The neighbors will analyze the information and write new routes to the routing table. The routers will pass routing information receive from one router to other router  also. If there are more than one path available then routes are compared and best path is selected. Some examples of dynamic protocol are: - RIP, IGRP, EIGRP, OSPF

Types of Dynamic Routing Protocols
According to the working there are two types of Dynamic Routing Protocols.
(1) Distance Vector
(2) Link State
According to the type of area in which protocol is used there are again two types of protocol: -
(1) Interior Routing Protocol
(2) Exterior Routing Protocol

 Autonomous system
Autonomous system is the group of contiguous routers and n/w, which will share their  routing information directly with each other. If all routers are in single domain and they share their information directly with each other then the size of routing updates will depend on the no. of n/w present in the Internetwork. Update for each n/w may take 150 – 200 bytes information.
 For example: - if there are 1000 n/ws then size of update will be
                        200*1000 = 200000 bytes
The routing information is send periodically so it may consume a large amount of bandwidth in our network.

Protocols
Interior Routing                    Exterior Routing
RIP                                              BGP
IGRP                                           EXEIGRP
EIGRP
OSPF
  
Distance Vector Routing
The Routing, which is based on two parameters, that is distance and direction is called Distance Vector Routing. The example of Distance Vector Routing is RIP & IGRP.

Operation: -
(1) Each Router will send its directly connected information to the neighbor router. This information is send periodically to the neighbors.
(2) The neighbor will receive routing updates and process the route according to following conditions.
(i) If update of a new n/w is received then this information is stored in routing table.
(ii) If update of a route is received which is already present in routing table then route will be refresh that is route times is reset to zero.
(iii) If update is received for a route with lower metric then the route, which is already present in our routing table. The router will discard old route and write the new route in the routing table 
(iv) If update is received with higher metric then the route that is already present in routing table , in thae case the new update will discard.

3) A timer is associated with each route. The router will forward routing information on all interfaces and entire routing table is send to the neighbor. There are three types of timers associated with routes.
(i) Route update timer          
         It is the time after which the router will send periodic update to the neighbor.
(ii) Route invalid timer
         It is the time after which the route is declared invalid, if there are no updates for the route. Invalid route are not forwarded to neighbor routers but it is still used to forward the traffic.
   (iii) Route flush timer
         It is the time after which route is removed from the routing table, if there are no updates about the router .

Metric of Dynamic Routing
Metric are the measuring unit to calculate the distance of destination n/w. A protocol ma use a one or more than one at a time to calculate the distance. Different types of metric are :-
(1) Hop Count
(2) Band Width
(3) Load
(4) Reliability
(5) Delay
(6) MTU
Hop Count :-- It is the no. of Hops (Routers) a packet has to travel for a destination n/w.
Bandwidth :-- Bandwidth is the speed of link. The path with higher bandwidth is preferred to send the data.
Load :-- Load is the amount of traffic present in the interface. Paths with lower load and high.
Reliability :-- Reliability is up time of interface over a period of time.
Delay :-- Delay is the time period b/w a packet is sent and received by the destination.
MTU : -- It is the maximum size of packet that can be sent in a frame mostly MTU is set to 1500.

Problems of Distance Vector
There are two main problems of distance vector routing

(1)   Bandwidth Consumption
(2)   Routing Loops

Bandwidth Consumption
The problem of accessive bandwidth consumption is solved out with the help of autonomous system. It exchanges b/w different routers. We can also perform route summarization to reduce the traffic.

Routing Loops
It may occur b/w adjacent routers due to wrong routing information. Distance Vector routing is also called routing by Rumor. Due to this the packet may enter in the loop  condition until their TTL is expired.

Method to solve routing loops
There are five different methods to solve or reduce the problem of routing loop.

(1)   Maximum Hop Count
(2)   Flash Updates/Triggered Updates
(3)   Split Horizon
(4)   Poison Reverse
(5)   Hold Down


Maximum Hop Count :-- This method limits the maximum no. of hops a packet can travel. This method does not solve loop problem. But it reduce the loop size in the n/w. Due to this method the end to end size of a n/w is also limited.

Flash Updates/Triggered Updates :-- In this method a partial update is send to the all neighbors as soon as there is topology change. The router, which receives flash updates, will also send the flash updates to the neighbor routers.

Split Horizon :-- Split Horizon states a route that update receive from an interface can not be send back to same interface.

Poison Reverse :-- This method is the combination of split Horizon and Flash updates. It implements the rule that information received from the interface can not be sent back to the interface and in case of topology change flash updates will be send to the neighbor.

Hold Down :-- If a route changes frequently then the route is declared in Hold Down state and no updates are received until the Hold Down timer expires. 

Wednesday, May 9, 2012

IPv6 Addressing

IPv6 Addressing
          IPv4                   IPv6
1) It is 32 bit address 1) It is 128 bit address
2) It is written in decimal format 2) It is written in hexadecimal format 
3) It has four octets (each i s 8 bit)  3) It has 8 groups (each is 16 bit)
4) Octets are separated with . (dot) 4) Groups are separated with : (colon)
5) It has five classes A,B,C,D,E             5) It has no classes
6) It has N/w bits and Host bits according classes 6) It has mostly fixed N/w bits (64 bits)           
    and Host bits (64 bits)
7) It uses subnet mask
7) It does not use subnet mask. It uses prefix
                Benefits of IPV6
  1. Large no of IP address 3.7x1038
  2. Simplified header
  3. Extension header
  4. Fragmentation and security is implemented by extension header
  5. TTL/hop count is not included in check sum.
  6. Broadcast is not available
  7. Any cast is introduced
     IPv6 format
 2001:0db8:3c4d:0012:0000:0000:1234:56ab
-----------------------l-------l-------------------------------
Global prefix      Subnet          Interface ID 
    48bits               16bits                  64bits
-------------------------------l--------------------------------
To web access with IPv6
To web access with IPv6 type IPv6 in [ ] because : (colons) are used in IPv6 and after HTTP also.
Eg :- http://[2001:0db8:3c4d:0012:0000:0000:1234:56ab]

Shortened Expressions
You can remove 0 (zero) from front of group
E.g :- 2001:0db8:3c4d:0012:3a3a:4b4b:1234:56ab
          2001:db8:3c4d:12:3a3a:4b4b:1234:56ab


You can type single 0 (zero) if group has all bits 0
E.g:- 2001:3db8:3c4d:1212:0000:4b4b:1234:56a
         2001:3db8:3c4d:1212:0:4b4b:1234:56ab
You can type :: on place of if two or more continues groups has all bits 0
E.g :- 2001:3db8:3c4d:1212:0000:0000:1234:56ab
          2001:3db8:3c4d:1212::1234:56ab
If there is more than one place continues groups of 0 bits
E.g :- 2001:0000:0000:3c4d:0000:0000:0000:56ab
           2001::3c4d:0:0:0:56ab
                        Or
           2001:0:0:3c4d::56ab
Address Types
Unicast  Packets addressed to a unicast address are delivered to a single 
interface. For load Balancing, multiple interfaces can use the same address.
Global unicast address  2000::/3 These are your typical publicly routable 
addresses, and they are the same as they in IPv4.


Link-local address  FE80::/10
These are like the private addresses in IPv4 in that they are not meant to be 
routed. This gives you  the ability to throw a temporary LAN together for 
meetings or for creating a small LAN  that’s not going to be routed but still
needs to share and access files and services locally.


Unique Local address  FC00::/7
These addresses are also intended for non-routing purpose, but they are 
nearly globally unique you will ever have one of them overlap. Unique local 
addresses were designed to replace site-local addresses, so they basically do 
almost exactly what IPv4 private addresses do- allow communication 
throughout a site  while being routable to multiple local networks.


Multicast  FF00::/8
Same as in IPv4, packets addressed to a multicast address are delivered to all
interface  identified by the multicast address. Some people call them one-to-
many addresses.

Monday, May 7, 2012

IP Sub net

IP Subnet :-- In TCP/IP by default three sizes of networks are available: -
(1) Class A -224 PC -> 16777216
(2) Class B - 216 PC-> 65536
(3) Class C – 28 PC -> 256

In subneting, we will divide class A,B & C network into small size sub networks. This procedure is called subneting.Subneting is performed with the help of subnet mask. There are two types of subneting that we performed: -
  1. FLSM Fixed Length Subnet Mask
  2. VLSM Variable Length Subnet Mask 

Why to Sub?
(i) Default Class Network provide us large no. of PCs in comparison to the requirement   of PCs in the network.
(ii) It is practical never possible to create a class A or class B sized network.To reduce the broadcast of network, we have to perform LAN segmentation of routers. In each sub network, we need different network addresses.

How to Subnet?
In this formula, we will first modify our requirement according to the no. of subnet possible then we calculate new subnet mask and create IP range.

Example 1
Class = C
No. of subnet =5

Step1
No. of subnet possible is 2,4,8,16,32……
Class= C
No. of subnets= 8

Step 2
Calculate key value
2? = No. of subnets
2?  = 8
23= 8

Step 3
Calculate new subnet mask
In class C
Net id                                                                                      Host id
24+key                                                                                    8-key
24+3                                                                                        8-3
27                                                                                             5

11111111.11111111.11111111.11100000
          255.          255.          255.          224

We add this address to make subnet mask

Step 4
Range
No. of Pc/Subnet= Total Pc/ No. of Subnet
                           = 256/8 =32
 In Class C
x.x.x.0 – x.x.x.31
        (1)-         (30)
x.x.x.32- x.x.x.63
         64-          95
         96-          127
       128-           159
       160-           191
       192-           223
x.x.x.224-x.x.x.255     

The first IP of each subnet will be subnet id and last IP will be  sub network broadcast address.

Example 2
Class= C
No. of subnet= 10

Step 1
No. of subnet= 16

Step 2
24= 16

Step 3
Net id                     Host id
24+4                       8-4
11111111.11111111.11111111.11110000

Subneting method 2
Class=
No. of Pc/Sub= 8
Mask= ?
Range= ?

In this case we have to calculate the key according to the no. of per subnet according to the key value the bits of subnet mask from right hand side are set to zero then range is calculated.
 Example
Class= C
No. of Pc/Sub=5

Step 1
No. of Pc/Subnet possible 4,8,16,32,64….

New requirement
Class= C
No. of Pc/Sub= 8

Step 2
2?= No. of Pc/Sub
2?= 8
23= 8
          \ 
          \/
        key 3
11111111.11111111.11111111.11111000
         255.           255.          255.          248

No. of Subnet= Total Pc/(Pc/Sub)
                      = 256/8

Class C                                                Sub                              Pc/Sub
255.255.255.248                                 32                                8

200.100.100.0                          200.100.100.7
        .8                                 .15
                    .16                               .23
                    .24                               .31
                     .
                     .
Example 2
Class C
No. of Pc/Sub=50

Step 1
Class= C
No. of Pc/Sub= 64


Step 2
26= 64
11111111.11111111.11111111.11000000
          255.          255.          255.          192

No. of subnet= 256/64= 4
 Class C                        Sub                              Pc/Sub
255.255.255.192         4                                   64

Method 3
 No. of Pc/Sub= 50

New req.
No. of Pc/Sub= 64

No. of Subnet= 256/64= 4
Class= C
No. of Sub= 4
22= 4
24+2                                           8-2
11111111.11111111.11111111.11000000
         255.          255.          255.          192

Zero Subnet :-- According to the rules of IP Addressing the first subnet and last subnet is not useable due to routing problem. In new Cisco router a command is present in default configuration. With this command, we are able to use first and last Subnet after Subneting.
Command is
Router#config ter
Router(config)#ip subnet-zero
Router(config)#exit
 Example: - Check whether an address is valid IP, N/w address or Broadcast address. If IP is valid then calculate its N/w & Broadcast address.

200.100.100.197
255.255.255.240
28              4

200.100.100.197
200.100.100.1100    0101 --------> Valid IP

200.100.100.192
200.100.100.1100     0000 -------> Network Address
200.100.100.207
200.100.100.1100     1111 -------> Broadcast Address

Example: -
Class= B
No. of subnet= 64
                26= 64
11111111.11111111.11111111.11000000
         255.           255.          255.          192

No. of Pc/Sub= 65536/64= 1024

150.20.0.0 – 150.20.3.255
150.20.4.0 – 150.20.7.255
150.20.8.0 – 150.20.11.255

Prefix Notation of representing IP Address
IP address can be written as IP & Mask as well as IP/Prefix.
200.100.100.18
255.255.255.248
200.100.100.18/29

170.20.6.6
255.255.224.0
170.20.6.6/19
This method is representing IP address also called CIDR (Classless Inter Domain Routing) notation.

Remaining Subnet
144 – 159

160 – 175
176 – 191
192 – 207
208 – 223
224 – 239
240 – 255

Problem with FLSM
In FLSM, we have to create subnet of equal size. All N/w will be allotted constant size subnet instead of their IP addresses requirement. Due to this a N/w may be allotted more than required IP address and less than required IP addresses.


VLSM
       \25
255.255.255.128
      \26
255.255.255.192
      \27
255.255.255.224
      \28
255.255.255.240
     \29
255.255.255.248
  Sub  Pc/Sub
    2      128
  Sub  Pc/Sub
    4      64
  Sub  Pc/Sub
    8        82
  Sub  Pc/Sub
  16      16
  Sub  Pc/Sub
   32       8
    0 - 127      0 - 63     0 - 31     0 - 15       0 - 7
  128 - 255      64 - 127      32 - 63      16 - 31      8 - 15
        128 - 191      64 - 95      32 - 47      16 - 23

   192 - 255      96 - 127      48 - 63      24 - 31



     64 - 79



     80 - 95



   96 - 111




























If we are using VLSM and Dynamic Routing then routing be compatible to VLSM. This will happen only if Subnet masks are also sends in the routing updates.

Super Netting :-- Combining small N/w to create a large size N/w is called Super Network. Super netting is mostly used to define route summarizations in routing tables. It is not used for the implementation of large network.

170.10.0.0                   170.00001010.00000000.00000000
170.11.0.0                   1 70.00001011.00000000.00000000

Twitter Delicious Facebook Digg Stumbleupon Favorites More