Thursday, September 2, 2010

Routing Explained

Router

A router is an electronic device that interconnects two or more and selectively interchanges packets of data  between them. Each data packet contains address information that a router can use to determine if the source and destination are on the same network, or if the data packet must be transferred from one network to another. Where multiple routers are used in a large collection of interconnected networks, the routers exchange information about target system addresses, so that each router can build up a table showing the preferred paths between any two systems on the interconnected networks.
A router is a networking device whose software and hardware are customized to the tasks of routing and forwarding  information. A router has two or more network interfaces, which may be to different physical types of network (such as copper cables, fiber, or wireless) or different network standards. Each network interface is a specialized device that converts electric signals from one form to another.

Routers connect two or more logical subnets, each having a different network address. The sub-nets in the router do not necessarily map one-to-one to the physical interfaces of the router.[1] The term "layer 3 switching" is often used interchangeably with the term "routing". The term switching is generally used to refer to data forwarding between two network devices with the same network address. This is also called layer 2 switching or LAN switching.

Conceptually, a router operates in two operational planes (or sub-systems):[2]

    * Control plane: where a router builds a table (called routing table) as how a packet should be forwarded through which interface, by using either statically configured statements (called static routes) or by exchanging information with other routers in the network through a dynamical routing protocol;
    * Forwarding plane: where the router actually forwards traffic (called packets in IP) from ingress (incoming) interfaces to an egress (outgoing) interface that is appropriate for the destination address that the packet carries with it, by following rules derived from the routing table that has been built in the control plane.

History

The very first device that had fundamentally the same functionality as a router does today, i.e a packet switch, was the Interface Message Processor (IMP); IMPs were the devices that made up the ARPANET, the first packet switching network. The idea for a router (although they were called "gateways" at the time) initially came about through an international group of computer networking researchers called the International Network Working Group (INWG). Set up in 1972 as an informal group to consider the technical issues involved in connecting different networks, later that year it became a subcommittee of the International Federation for Information Processing.[5]

These devices were different from most previous packet switches in two ways. First, they connected dissimilar kinds of networks, such as serial lines and local area networks. Second, they were connectionless devices, which had no role in assuring that traffic was delivered reliably, leaving that entirely to the hosts (although this particular idea had been previously pioneered in the CYCLADES network).

The idea was explored in more detail, with the intention to produce a real prototype system, as part of two contemporaneous programs. One was the initial DARPA-initiated program, which created the TCP/IP architecture of today.[6] The other was a program at Xerox PARC to explore new networking technologies, which produced the PARC Universal Packet system, although due to corporate intellectual property concerns it received little attention outside Xerox until years later.[7]

The earliest Xerox routers came into operation sometime after early 1974. The first true IP router was developed by Virginia Strazisar at BBN, as part of that DARPA-initiated effort, during 1975-1976. By the end of 1976, three PDP-11-based routers were in service in the experimental prototype Internet.[8]

The first multiprotocol routers were independently created by staff researchers at MIT and Stanford in 1981; the Stanford router was done by William Yeager, and the MIT one by Noel Chiappa; both were also based on PDP-11s.[9][10][11][12]

As virtually all networking now uses IP at the network layer, multiprotocol routers are largely obsolete, although they were important in the early stages of the growth of computer networking, when several protocols other than TCP/IP were in widespread use. Routers that handle both IPv4 and IPv6 arguably are multiprotocol, but in a far less variable sense than a router that processed AppleTalk, DECnet, IP, and Xerox protocols.

In the original era of routing (from the mid-1970s through the 1980s), general-purpose mini-computers served as routers. Although general-purpose computers can perform routing, modern high-speed routers are highly specialized computers, generally with extra hardware added to accelerate both common routing functions, such as packet forwarding and specialised functions such as IPsec encryption.

Still, there is substantial use of Linux and Unix machines, running open source routing code, for routing research and other applications. While Cisco's operating system was independently designed, other major router operating systems, such as those from Juniper Networks and Extreme Networks, are extensively modified but still have Unix ancestry.

How to Configure a Network

In this section you will learn how to configure a network-
peer to peer,
client server,
workstation,
server,
basic data communication.

Peer to Peer network model

Before configuring a computer network, you have to decide that, which networking model you require. There are two main types of network models. Peer to peer and client-server network model. In the peer to peer network model you simply use the same Workgroup for all the computers and a unique name for each computer.

Additionally, you will have to give a unique IP address of the same class A, B, or C for all the computers in your network and its related subnet mask e.g if you decide to use class A IP address for your three computers in your Peer to Peer network then your IP address/Subnet mask settings can be as follows.

Computer Name IP Address Subnet Mask Workgroup

PC1 100.100.100.1 255.0.0.0 Officenetwork
PC2 100.100.100.2 255.0.0.0 Officenetwork
PC3 100.100.100.3 255.0.0.0 Officenetwor
Please note that the above example is for only illustration purpose so you can choose any IP address, computer name and work group name of your interest.

For doing this right click on My Computer and then click Properties then go to the Network Identification section and set these.
In a peer to peer network all computers acts as a client because there is not centralized server. Peer to peer network is used where not security is required in the network.
If a computer fails to work then all other computers work normally in peer to peer network.

Client/Server Network Model

In the client/server network model a computer plays a centralized role and is known as a server all other computers in the network are known as clients. All client computers access the server simultaneously for files, database, docs, spreadsheets, web pages and resources like hard diver, printer, fax modem, CD/DVD ROM and others. In other words, all the client computes depends on the server and if server fails to respond or crash then networking/communication between the server and the client computes stops.

If you want to configure a client-server network model then first prepare the server. Install Windows 2000 or Windows 2003 Server from the CD on the server computer and make a domain. You can create a domain by this command on the Run “DCPROMO”. You can give this command once you install the server successfully. After you give the DCPROMO command you will be asked for a unique domain name. All the client computers will use the same unique domain name for becoming the part of this domain. This command will install the active directory on the server, DNS and other required things. A step by step wizard will run and will guide you for the rest of the steps. Make sure that a network cable is plugged in the LAN card of the server when you run the DCPROMO.exe command.

When the Active directory is properly installed on the server, restart the server. You can create network users on the server computer and also name/label the network resources like computers/printers etc.

Once you install the server successfully now come to the client computers. Install Windows 2000 professional on your all client computers. Once you install the Windows 2000 professional on the clients the next step is to make this computer (client computer) a part of the network.

Configuration Steps

1. Choose a unique name for each client computer
2. Choose unique IP address for each computer and relevant.
3. Use the same domain name for all client PCs.

Network/System administrators are required to do these administrative tasks on the server and client computers. Any shared resources on the network either on the server or the clients can be access through the My Network Places in the Windows 2000 platform. There is another way to connect to the shared resources by giving this command in the run \\Computer Name\SharedDriveLetter.

Network configurations steps can be implemented by right clicking the My Computer>Properties>

For giving the IP address you will have to right click on the My Network places>properties>Local Area Connection>Properties>Internet Protocols (TCP/IP)>Properties and then give the IP address and subnet mask of the same range and class for all the computers in the network.

Router Manufacturers

The major router manufacturers include:

    * Alcatel-Lucent
    * Asus
    * Avaya
    * Belkin
    * Brocade
    * Buffalo
    * Cisco Systems
    * D-link
    * Extreme Networks
    * Fujitsu
    * Huawei
    * Juniper Networks
    * Netgear
    * TP-Link
    * UTStarcom
    * ZTE
    * ZyXEL

Router Commands Overview

In this section you will learn about the router commands, configurations, privileged mode commands, routing protocols, cisco labs and network configurations.

There are hundreds of basic and advance level commands of a router. It is not easy to remember all the commands. But some commands are frequently used and can be remembered with some practice. I have provided a list of the most commonly used commands based on their features and usage.

You will find here some basic terminology of a router.

Routing: Routing is a process of moving the data (packets) through an inter network. Routing performs the two basic tasks. Define the paths for a packet and then forward the packets on the basis of defined paths. Routing can also be defined as the communication between two or more logically and physical networks and this communication (packet transfer) is brought by a router
First of all you should remember the keyboard shortcuts of a router.

Keyboard Shortcuts
CTRL-N - show next command
CTRL-P - show previous command
SHIFT-CTRL-6 – Break.

Configuring the Router

You will be able to learn the basic commands for configuring a router.
sh running-config - details the running configuration file (RAM)
sh startup-config - displays the configuration stored in NVRAM
setup - Will start the the automatic setup; the same as when you first boot the router
config t - use to execute configuration commands from the terminal
config mem - executes configuration commands stored in NVRAM; copies startup-config to running-config


config net - used to retrieve configuration info from a TFTP server
copy running-config startup-config - copies saved config in running config (RAM) to NVRAM or "write memory" for IOS under ver.11
copy startup-config running-config - copies from non-volatile (NVRAM) to current running config (RAM)
boot system flash - tells router which IOS file in flash to boot from
boot system tftp - tells router which IOS file on the tftp server to boot from
boot system rom - tell router to boot from ROM at next bootI
copy flash tftp - Copies flash to tftp server
copy tftp flash - Restores flash from tftp server
copy run tftp - Copies the current running-config to tftp server
copy tftp run - Restores the running-config from tftp server  

General Commands


Here is a list of the general commands. These are the basic level commands and most commonly used
no shutdown - (enables the interface)
reload - restarts the router
sh ver - Cisco IOS version, uptime of router, how the router started, where system was loaded from, the interfaces the POST found, and the configuration register
sh clock - shows date and time on router
sh history - shows the history of your commands
sh debug - shows all debugging that is currently enabled
no debug all - turns off all debugging
sh users - shows users connected to router
sh protocols - shows which protocols are configured
banner motd # Your customized message here # - Set/change banner
hostname - use to configure the hostname of the router
clear counters - clear interface counters  

Privileged Mode commands of a router

Learn how to work in the privileged mode of a router.
enable - get to privileged mode
disable - get to user mode
enable password - sets privileged mode password
enable secret - sets encrypted privileged mode password
Setting Passwords on router
Here you will be able to learn how to set the password on a router.
enable secret - set encrypted password for privileged access
enable password - set password for privileged access (used when there is no enable secret and when using older software)
Setting the password for console access:
(config)#line console 0
(config-line)#login
(config-line)#password
Set password for virtual terminal (telnet) access (password must be set to access router through telnet):
(config)#line vty 0 4
(config-line)#login
(config-line)#password
Set password for auxiliary (modem) access:
(config)#line aux 0
(config-line)#login
(config-line)#password   

Router Processes &Statistics

By these command you can see the statistics and different processes of the router.
sh processes - shows active processes running on router
sh process cpu - shows cpu statistics
sh mem - shows memory statistics
sh flash - describes the flash memory and displays the size of files and the amount of free flash memory
sh buffers - displays statistics for router buffer pools; shows the size of the Small, Middle, Big, Very Big, Large and Huge Buffers
sh stacks - shows reason for last reboot, monitors the stack use of processes and interrupts routines

IP Commands

Here is a list of the IP Commands
Configure IP on an interface:
int serial 0
ip address 157.89.1.3 255.255.0.0
int eth 0
ip address 2008.1.1.4 255.255.255.0

Other IP Commands:

sh ip route - view ip routing table
ip route [administrative_distance] - configure a static IP route
ip route 0.0.0.0 0.0.0.0 - sets default gateway
ip classless - use with static routing to allow packets destined for unrecognized subnets to use the best possible route
sh arp - view arp cache; shows MAC address of connected routers
ip address 2.2.2.2 255.255.255.0 secondary - configure a 2nd ip address on an interface
sh ip protocol
CDP Commands (Cisco Discovery Protocol uses layer 2 multicast over a SNAP-capable link to send data):
sh cdp neighbor - shows directly connected neighbors
sh cdp int - shows which interfaces are running CDP
sh cdp int eth 0/0 - show CDP info for specific interface
sh cdp entry - shows CDP neighbor detail
cdp timer 120 - change how often CDP info is sent (default cdp timer is 60)
cp holdtime 240 - how long to wait before removing a CDP neighbor (default CDP holdtime is 180)
sh cdp run - shows if CDP turned on
no cdp run - turns off CDP for entire router (global config)
no cdp enable - turns off CDP on specific interface

IPX Commands

Enable IPX on router:
ipx routing
Configure IPX + IPX-RIP on an int:
int ser 0
ipx network 4A

Other Commands

sh ipx route - shows IPX routing table
sh ipx int e0 - shows ipx address on int
sh ipx servers - shows SAP table
sh ipx traffic - view traffic statistics
debug ipx routing activity - debugs IPS RIP packets
debug ipx sap - debugs SAP packets 

Routing Protocols

RIP, IGPR and OSPF are the routing protocols and here is a list of the commands for the working on the routing protocols.

Configure RIP:

router rip
network 157.89.0.0
network 208.1.1.0
Other RIP Commands:
debug ip rip - view RIP debugging info

Configure IGRP:

router IGRP 200
network 157.89.0.0
network 208.1.1.0
Other IGRP Commands:
debug ip igrp events - view IGRP debugging info
debug ip igrp transactions - view IGRP debugging info

Access Lists

Here is a list of the Access list command of a router.
sh ip int ser 0 - use to view which IP access lists are applies to which int
sh ipx int ser 0 - use to view which IPX access lists are applies to which int
sh appletalk int ser 0 - use to view which AppleTalk access lists are applies to which int
View access lists:
sh access-lists
sh ip access-lists
sh ipx access-lists
sh appletalk access-lists
Apply standard IP access list to int eth 0:
access-list 1 deny 200.1.1.0 0.0.0.255
access-list 1 permit any
int eth 0
ip access-group 1 in
Apply Extended IP access list to int eth 0:
access-list 100 deny tcp host 1.1.1.1 host 2.2.2.2 eq 23
access-list 100 deny tcp 3.3.3.0 0.0.0.255 any eq 80
int eth 0
ip access-group 100 out
Apply Standard IPX access list to int eth 0:
access-list 800 deny 7a 8000
access-list 800 permit -1
int eth 0
ipx access-group 800 out
Apply Standard IPX access list to int eth 0:
access-list 900 deny sap any 3378 -1
access-list 900 permit sap any all -1
int eth 0
ipx access-group 900 out  

WAN Configurations Commands

Networking over WAN is the main functionality of a router. The most common use of a router is for the WAN connectivity. Here is a list of the commands for the different methods of the WAN connectivity.

PPP Configuration

Point to point protocol is a method for the WAN connectivity and you will find here some commands of PPP.
encapsulation pppppp authentication
ppp chap hostname
ppp pap sent-username
sh int ser 0 - use to view encapsulation on the interface

Frame-Relay Configuration

One of the methods for the WAN connectivity is the Frame Relay. Find here some basic commands for the WAN connectivity through Frame Relay.
encapsulation frame-relay ietf - use IETF when setting up a frame-relay network between a Ciscorouter and a non-Cisco router
frame-relay lmi-type ansi - LMI types are Cisco, ANSI, Q933A; Cisco is the default; LMI type is auto-sensed in IOS v11.2 and up
frame-relay map ip 3.3.3.3 100 broadcast - if inverse ARP won't work, map Other IP to Your DLCI # (local)
keep alive 10 - use to set keep alive
sh int ser 0 - use to show DLCI, LMI, and encapsulation info
sh frame-relay pvc - shows the configured DLCI's; shows PVC traffic stats
sh frame-relay map - shows route mapssh frame-relay lmi - shows LMI info

Miscellaneous Commands

In the last but not least here is a list of the some miscellaneous and useful commands
sh controller t1 - shows status of T1 lines
sh controller serial 1 - use to determine if DCE or DTE device
(config-if)#clock rate 6400 - set clock on DCE (bits per second)
(config-if)#bandwidth 64 - set bandwidth (kilobits)

No comments: