Friday, June 22, 2012

ROUTER - A Introduction


 

  • THERE ARE 7 MAJOR INTERNAL COMPONENTS OF A ROUTER:

  • CPU.
  • RAM.
  • NVRAM.
  • FLASH.
  • ROM.
  • CONSOLE.
  • INTERFACES.

    INSIDE ROUTER MOTHERBOARD

    CISCO ROUTERS (AND SWITCHES) GENERALLY CONTAIN FOUR TYPES OF MEMORY:

  • ROM (Read-Only Memory).
  • Flash.
  • NVRAM (Non-Volatile RAM).
  • RAM (Random-Access Memory).

    ROM Contains A Bootstrap Program Called ROM Monitor (Or ROMMON). When A Router Is Powered On, The Bootstrap Runs A Hardware Diagnostic Called POST (Power-On Self Test).


    ROUTER COMPONENTS AND THEIR FUNCTIONS:


    CPU - Executes Operating System Instructions. The CPU Performs Functions Just As It Does In A Normal PC. It Executes Commands Given By The IOS Using Other Hardware Components. High-End Routers May Contain Multiple Processors Or Extra Slots To Add More Cpus Later

    RANDOM ACCESS MEMORY (RAM) - Contains The Running Copy Of Configuration File. Stores Routing Table. RAM Contents Lost When Power Is Off. RAM Is Used To Store Operational Information Such As Routing Tables, Router's Running Configuration File. RAM Also Provides Caching And Packet Buffering Capabilities. Its Contents Are Lost When You Switch Off Or Restart The Router.

    READ-ONLY MEMORY (ROM) - Holds Diagnostic Software Used When Router Is Powered Up. Stores The Router’s Bootstrap Program.

    NON-VOLATILE RAM (NVRAM) - Stores Startup Configuration. This May Include IP Addresses (Routing Protocol, Hostname Of Router). NVRAM Does Not Lose Its Information When Power Is Turned Off. This Is In Contrast To The Most Common Forms Of RAM, Such As DRAM, That Requires Continual Power To Maintain Its Information. NVRAM Is Used By The Cisco IOS As Permanent Storage For The Startup Configuration File (Startup-Config).

    All Configuration Changes Are Stored In The Running-Config File In RAM, And With Few Exceptions, Are Implemented Immediately By The IOS. To Save Those Changes In Case The Router Is Restarted Or Loses Power, The Running-Config Must Be Copied To NVRAM, Where It Is Stored As The Startup-Config File. NVRAM Retains Its Contents Even When The Router Reloads Or Is Powered Off.

    FLASH MEMORY - Contains The Operating System (Cisco IOS). Flash Memory Is Nonvolatile Computer Memory That Can Be Electrically Stored And Erased. Flash Is Used As Permanent Storage For The Operating System, Cisco IOS. In Most Models Of Cisco Routers, The IOS Is Permanently Stored In Flash Memory And Copied Into RAM During The Bootup Process, Where It Is Then Executed By The CPU. Some Older Models Of Cisco Routers Run The IOS Directly From Flash.

    Flash Consists Of Simms Or PCMCIA Cards, Which Can Be Upgraded To Increase The Amount Of Flash Memory.Flash Memory Does Not Lose Its Contents When The Router Loses Power Or Is Restarted.
    INTERFACES - There Exist Multiple Physical Interfaces That Are Used To Connect Network.The Interfaces Provide Connectivity To LAN, WAN, And Console/Aux. They Can Be RJ-45 Jacks Soldered Onto The Motherboard, Transceiver Modules, Or Card Modules. Cisco Routers, Especially The Higher-End Models, Can Be Configured In Many Different Ways. They Can Use A Combination Of Transceivers, Card Modules And Onboard Interfaces.

    EXAMPLES OF INTERFACE TYPES:
  • Serial Interfaces.
  • Ethernet Interfaces.
  • Fast Ethernet Interfaces.
  • Token Ring Interfaces.
  • ATM Interfaces.


    Interfaces Are Identified By Both The Type Of Interface, And The Interface Number (Which Always Begins At “0”). Thus, The First Ethernet Interface On A Router Would Be Identified As Ethernet0.

    Certain Router Families (Such As The 3600 Series) Are Modular, And Have Multiple “Slots” For Interfaces. Thus, Interfaces On These Routers Are Identified By Both The Module Number And The Interface Number, Formatted As: Module/Interface. Thus, The Third Fast Ethernet Interface On The First Modular Slot Would Be Identified As Fastethernet0/2.

    Lines Identify Ports That Allow Us To Connect Into, And Then Configure, Cisco Devices. The Most Common Examples Of Lines Include:
  • Console Ports.
  • Auxiliary Ports.
  • VTY (Telnet) Ports.


    Just Like Interfaces, Lines Are Identified By Both The Type Of Line, And The Line Number (Again, Always Begins At “0”). Thus, The First Console Port On A Router Would Be Identified As Console0.

    A Cisco 2600 series router is a cut above the routers populating the 2500 series because it has a faster processor and can handle many more interfaces. Figure as below shows a diagram of a Cisco 2600 modular router.





    SUMMARY



    SUMMARY OF BOOT SEQUENCE :


    1. On Power On Cisco Router First Will Perform The POST( Power On Self Test). The POST Tests The Hardware To Verify That All Components Of The Device Are Operational And Present. For Example, The POST Checks For The Different Interfaces On The Router. The POST Is Stored In And Run From ROM (Read-Only Memory).

    2. The Bootstrap Looks For And Loads The Cisco IOS Software. The Bootstrap Is A Program In ROM That Is Used To Execute Programs. The Bootstrap Program Is Responsible For Finding Where Each IOS Program Is Located And Then Loading The File. By Default, The IOS Software Is Loaded From Flash Memory In All Cisco Routers.

    3. The IOS Software Looks For A Valid Configuration File Stored In NVRAM. Which Is Called As Startup-Config.

    4. If A Startup-Config File Is In NVRAM, The Router Will Load And Run This File. The Router Is Now Operational. If A Startup-Config File Is Not In NVRAM, The Router Will Start The Setup-Mode Configuration Upon Bootup.

    5. Any Further Modification On Running Router Will Be Stored On RAM, Where You Need To Manually Execute Command Copy Running-Config Startup-Config To Make Your Current Configuration As A Startup-Config, Every Time You Boot Your Router.



  • What are the Basics of a Cisco Router?


    Definition
    A Router is a layer 3 network device that transmits data between different network segments and can use a packet header to determine the best path for the packet to travel. Routers can connect network sections that use different protocols. They also allow all users in a network to share a single connection to the Internet or a wide area network (WAN).
    Internal Router Components
    • Read-Only Memory (ROM)
      ROM stores the router’s bootstrap startup program, operating system software, and any power-on diagnostic tests programs.
    • Flash Memory
      Flash Memory is reprogrammable, erasable ROM that stores the system image(s) of the operating system. Memory content is retained when the router is switched off or restarted.
    • Random Access Memory (RAM)
      RAM stores operational information like routing tables while providing caching and packet buffering capabilities. Its contents are lost whenever the router is switched off or restarted.
    • Nonvolatile RAM (NVRAM)
      NVRAM is used to store the router’s startup configuration file. The contents of the file are maintained whenever the router is switched on, off or restarted.
    • Network Interfaces
      The router’s network interfaces are located on the motherboard or on separate interface modules. Ethernet or Token Ring interfaces can be configured to authorize connection to a LAN, while synchronous serial interfaces are configured to permit connection to WANs.
    External Router Components
    A router can be configured over any of its network interfaces. Trivial File Transfer Protocol (TFTP) servers can be used to provide configuration information to a router.
    TFTP is a simplified version of FTP.
    Router’s Startup Procedure
    Every time a router is switched on; it goes through self-test diagnosis to verify the basic operation of the CPU, network interfaces, and memory.
    The system bootstrap software then searches for a valid router operating system software (Cisco® IOS image). The Cisco® IOS image can be found in ROM, Flash memory, or a TSFT server on the network.
    Cisco® CLI Command Modes
    The Cisco® IOS software provides access to a variety of different command modes, each of which provides a different group of related commands. The Cisco® Command Line Interface (CLI) is called EXEC, and can be used in either User mode or Privileged mode. The commands available in Privileged mode are also available in User mode.
    User EXEC commands allow you to:
    • Connect to remote devices
    • Make temporary changes to terminal settings
    • Perform basic tests
    • List system information
    To access privileged mode, a password is required. Privileged EXEC commands can be used to:
    • Set operating parameters
    • Perform a detailed examination of the router’s status
    • Test and debug router operation
    • Access global and other included configuration modes
    You can also enter global configuration mode from Privileged mode, which will give you access to configuration commands that affect the entire system.

    Thursday, June 21, 2012

    Maximum Transfer Unit

    Maximum Transfer Unit refers to the size of the largest chunk of data, within a single unit, that can be transmitted under a particular protocol. For example, the maximum transfer unit for Ethernet is 1,536 eight-bit bytes. The Maximum Transfer Unit for Fibre Channel, by comparison, is 2,112 eight-bit bytes

    The Maximum Transmission Unit (MTU) is the largest size of IP datagram which may be transferred using a specific data link connection The MTU value is a design parameter of a LAN and is a mutually agreed value (i.e. both ends of a link agree to use the same specific value) for most WAN links.
    The size of MTU may vary greatly between different links (e.g. typically from 128 B up to 10 kB).The prevalent Path MTU on the Internet is now 1500 bytes, the Ethernet MTU. There are some initiatives to support larger MTUs in networks (e.g. 8 KB), in particular on research networks. But their usability is hampered by last-mile deployment of Ethernet with an MTU of 1500 and lack of robustness of Path MTU Discovery.


    Maximum Transmission Unit (MTU) and Datagram Fragmentation
    The IP implementation of all devices on an IP internet needs to be aware of the capacity of the technology used by that implementation for its immediate data link layer connection to other devices. This limit is called the maximum transmission unit (MTU) of the network. This term is also sometimes seen as the maximum transfer unit.
    If an IP layer receives a message to be sent across the internetwork, it looks at the size of the message and then computes how large the IP datagram would be after the addition of the 20 or more bytes needed for the IP header. If the total length is greater than the MTU of the underlying network, the IP layer will fragment the message into multiple IP fragments. So, if a host is connected using an Ethernet LAN to its local network, it may use an MTU of 1,500 for IP datagrams, and will fragment anything larger. Figure 88 shows an example of differing MTUs and fragmentation.
    Key Concept: The size of the largest IP datagram that can be transmitted over a physical network is called that network’s maximum transmission unit (MTU). If a datagram is passed from a network with a high MTU to one with a low MTU, it must be fragmented to fit the network with the smaller MTU.

    Since some physical networks on the path between devices may have a smaller MTU than others, it may be necessary to fragment more than once. For example, suppose the source device wants to send an IP message 12,000 bytes long. Its local connection has an MTU of 3,300 bytes. It will have to divide this message into four fragments for transmission: three that are about 3,300 bytes long and a fourth remnant about 2,100 bytes long. (I'm oversimplifying by ignoring the extra headers required; the next topic includes the full details of the fragmentation process.)

    Figure 88: IP Maximum Transmission Unit (MTU) and Fragmentation
    In this simple example, Device A is sending to Device B over a small internetwork consisting of one router and two physical links. The link from A to the router has an MTU of 3,300 bytes, but from the router to B it is only 1,300 bytes. Thus, any IP datagrams over 1,300 bytes will need to be fragmented.




    Difference Between Unicasting and Multicasting


    Unicasting vs Multicasting 
    In computer networking, unicast refers to transmitting information from one sender to a one receiver. So unicasting involves only two nodes in a network. The single receiver in unicasting is identified by a unique address. On the other hand, Multicasting refers to transmitting information in a single transmission to a group of receivers. Multicasting is commonly implemented as IP (internet Protocol) Multicasting.
    What is Unicasting?
    When it comes to computer networking, unicasting refers to transmitting information from a single sender to a single receiver. Unicasting uses session based IP delivery protocols such as Transmission Control Protocol (TCP) and User Datagram Protocol (UDP). In unicasting, each receiver or client connects to the server consuming additional bandwidth. The client has a direct relationship with the server. For example, consider a situation where you request the URL http://www.cnn.com from your computer. This request should be received only by the CNN server else the network will be filled with unwanted requests sent to other computers in the network. Therefore unicast transmission is essential to networks and is supported by Ethernet and IP networks. Some examples of unicast transmissions are http, smtp, telnet, ssh and pop3. Unicasting is used when a private or unique resource is requested by a client. But unicasting is not suitable when transmitting information to lot of clients since the sender has to make separate connections with every receiver. This will consume computing resources in the sender and will consume a large bandwidth in the network.
    What is Multicasting?
    As mentioned earlier, multicasting refers to transmitting information to a group of receivers in a single transmission. In multicasting, source is required to transmit a data packet only once. The nodes in the network such as routers make the necessary copies of the transmitted data packet, so that it could be received by multiple receivers. The intermediate routers send the packets to receivers who have registered with them indicating the interest to receive data from that particular sender. IP multicasting is one of the commonly used multicasting implementations. Furthermore, the source does not need to know the addresses of the receivers that it is going to multicast and there is no direct relationship between the sender and the receivers. Multicasting is not suitable for bulk data transferring and not generally used in a large scale on the internet since only small sections of the Internet are multicast-enabled.
    What is the difference between Unicasting and Multicasting?
    The main difference between unicasting and multicasting is on how they communicate with receiver. In unicasting, information is transmitted to a single receiver by a single sender and the receiver has a direct relationship with the sender. In multicasting, information is sent to multiple receivers in a single transmission and there is no direct relationship between the senders and receivers. Unicasting is used when a private resource is requested by a client and it is not suitable for transmitting information to lot of clients since it will consume a large bandwidth of the network. On the other hand, multicasting does not make direct connections with the receivers, hence does not consume network bandwidth as unicasting.

    Learn Wildcard Mask In 5 Minutes

    For some people, Subnet Calculation is real horror.
    After some time of learning and training, they find out that Subnetting is very easy.
    Then these people come in touch with the "Wildcard Mask Tragedy". WHAT IS THIS?

    Well, did we say Subnetting is easy?
    Wildcard Mask Calculation is EASIER!

    Lets say...

    We have network 100.0.0.0 with Subnetmask 255.255.255.240.
    We want to create an ACL for this network. THis WHOLE network should be denied something.
    For the acl, we need the proper Wildcard Mask for that Subnet.


    The Subnetmask is binary

    11111111.11111111.11111111.11110000=255.255.255.240

    For Wildcard Masks, only the ZEROS are interesting.
    So make a simple addition (watch the last oktett!)

    8+4+2+1=15

    So the wildcard mask will be

    0.0.0.15

    ---------------------------------------------

    Other example

    We have network 


    100.0.0.0 with Subnetmask 255.255.248.0

    255.255.248.0=11111111.11111111.11111000.00000000

    4+2+1.128+64+32+16+8+4+2+1

    That is Wildcard Mask

    0.0.7.255 

    EIGRP

    EIGRP Summary

    The characteristics of EIGRP follow:

     Hybrid routing protocol (distance vector that has link-state protocol characteristics).

     Use DUAL, first proposed by E. W. Dijkstra and C. S. Scholten, to perform distributed shortest-path routing while maintaining freedom from loops at every instant. Although many researchers have contributed to the development of DUAL, the most prominent work is that of J. J. Garcia-Luna-Aceves.

     Cisco Proprietary created in 1994.

     First released in IOS 9.21

     Uses IP protocol 88.

     Makes Automatic summarization on network Class boundary.

     Classless protocol (supports VLSM).

     Have the power to shut the Auto-summarization And make a configured manual Summarization.

     Default composite metric of bandwidth and delay.

     You can factor load, MTU and reliability into the metric.

     Eigrp metric is the same as IGRP*256, It uses the smallest B.W,Reliablity,Load & MTU with the Comulative delay upon the path…..The MTU doesn’t actually used in the Metric calculations, 
            But is included in the EIGRP Routing updates.

     Sends route updates to multicast address 224.0.0.10, and nei. Reply’s back with   Unicast Address.  

     Sends non-periodic, partial, and bounded updates.

     Send Hello packets every 5 sec. and Hold down timer is 15 sec. 

     For Low speed Hello is every 60 sec. with hold down time 180 sec. 

     By default, EIGRP uses no more than 50 percent of the bandwidth of a link.

     Support for authentication via MD5 Only.

     Uses DUAL for loop prevention, and generating Succ./Fesible Succ.

     Maximum paths for Load-balancing are 6  & default is 4 , maximum are 16 in IOS 12.3(2)T and later IOS releases

     By default, Equal-Metric load balancing. If Unequal-Metric load sharing is used the router will load share inversely proportional to the metrics of the paths.  

     Administrative distance is 90 for EIGRP internal routes, 170 for EIGRP external routes, and 5 for EIGRP summary routes.

     Potential routing protocol for the core of a network; used in large networks.

     For neighbor relation to be established, both routers must send and receive Hello or Ack packets from each other, they must have the same AS #, and the same Metric K values.

     Eigrp doesn’t restrict that neighbors must have the same Hello & dead interval timers, Unlike OSPF.

     Has a Maximum hop count of 255, the default is 100 in the last IOS releases.      



               The composite metric for each EIGRP route is calculated as

    EIGRP metric = IGRP metric  * 256 
        IGRP  metric = [k1*BWIGRP(min) + (k2* BWIGRP(min))/(256-LOAD) + k3*DLYIGRP(sum)]
                                  x [k5/(RELIABILITY + k4)]

    If k5 is set to zero, the [k5/(RELIABILITY+k4)] term is not used.

    Given the default values for k1 through k5, the composite metric calculation used by EIGRP reduces to the default metric:

    IGRP metric = BWIGRP(min) + DLYIGRP(sum)
    BWIGRP(min) = 107/BW(min)
    DLYIGRP(sum) = DLY(sum) /10

    Managing a Cisco Internetwork

    - Cisco Router Components -- Bootstrap, POST, ROM Monitor (all in ROM); Mini-IOS (RXBOOT, or bootloader), RAM, ROM, Flash, NVRAM, Configuration register.
    - Cisco Router Boot Sequence -- POST; Bootstrap loads the IOS; the IOS loads a configuration ("startup-config", if present in NVRAM).
    - Configuration register -- 16 bits, read 15-0 from left to right. Default is 0x2102 = 0010 0001 0000 0010 -- load IOS from flash and look for "startup-config".
    - Configuration register common values in bits (and hex):
    - 0-3 -- 0x0000-0x000F -- Boot field, as follows:
    - 00 -- ROM monitor mode -- register = 2100. You must manually boot the router with the "b" command.
    - 01 -- Boot image from ROM -- register = 2101.
    - 02-F -- Specifies a default boot filename.
    - 6 -- 0x0040 -- ignore NVRAM contents.
    - 7 -- 0x0080 -- OEM bit enabled.
    - 8 -- 0x0100 -- Break disabled.
    - 10 -- 0x0400 -- IP broadcast with all zeros.
    - 11-12 -- 0x0800-0x1000 -- console line speed.
    - 13 -- 0x2000 -- Boot default ROM software if network boot fails.
    - 14 -- 0x4000 -- IP broadcasts do not have net numbers.
    - 15 -- 0x8000 -- Enable diagnostic messages and ignore NVM contents.
    - "sh version" shows the current value of the configuration register.
    - Change the config register (run this from "config t" mode) -- "config-register 0x0101" -- Boot into ROM mode and then show the current config register value.
    - Recovering Passwords:
    - Perform a "break" while the router boots -- you should see "rommon 1 >".
    - "confreg 0x2142" -- turns on bit 6 -- ignore NVRAM contents. Note: On a Cisco 2500 router, type "o" after the break, then "o/r 0x2142".
    ! To boot from a different file, use "boot system <ios_name>", or "boot system tftp <ios_name> <ip_address>".
    - Reboot the router -- "reset" ("I" on a 2500 -- meaning "initialize").
    - Fix password and reboot -- "copy start run", "config t", "enable secret <new_pass>", "config-register 0x2102", Ctrl-Z, "copy run start", "reload".
    - Back up and Restore the Cisco IOS:
    - Check the flash and the TFTP server -- "sh flash", "ping 192.168.1.4".
    - Backup the IOS image -- "copy flash tftp".
    - Restore of Upgrade the Cisco Router IOS -- "copy tftp flash" (you may be asked to erase existing flash data). You can also erase it manually with "erase flash:".
    - Set up a Cisco router to be a TFTP server -- "config t", "tftp-server flash:."
    - Back up or Restore the Cisco Configuration -- "copy run tftp", "copy tftp run". Erase the startup config -- "erase start".
    - Cisco Discovery Protocol (CDP) -- collect hardware and protocol information about neighbor devices. "sh cdp" shows CDP values:
    - CDP timer -- how often CDP packets are transmitted to all active interfaces (default 60 seconds) -- "config t", "cdp timer 90".
    - CDP holdtime -- how long to hold packets received from neighbor devices (default 180 seconds) -- "config t", "cdp holdtime 240".
    - "sh cdp nei" (or "show cdp neighbor") shows CDP information ONLY about directly connected devices. "sh cdp neighbor detail" = "sh cdp entry *" BOTH display extended information ("sh cdp entry *" does NOT work on a 1900 switch).
    - "sh cdp traffic" shows CDP traffic summary. "sh cdp interface" shows interface CDP information.
    - CDP is enabled by default. Disable globally -- "no cdp run". To disable per interface -- "config t", "int s0", "no cdp enable".
    - "telnet 192.168.2.100" = "192.168.2.100" -- "telnet" can be skipped, it is assumed.
    - Connect via telnet to several routers simultaneously -- "telnet 192.168.1.100", "Ctrl-Shift-6 then x" (suspend), "telnet 192.168.2.100".
    - "sh sessions" shows telnet connections from your router to another device. "sh users" shows telnet sessions in your router.
    - "disconnect <ID>" disconnects a session. "clear line <ID>" disconnects a telnet session in your router.
    - Use a host table to resolve addresses -- "config t", "ip host myrouter 192.168.1.100". Then you can telnet via "telnet myrouter", or just "myrouter". Remove with "no ip host myrouter".
    - Using a DNS server for name resolution -- "config t", "ip domain-lookup", "ip name-server 192.168.1.4", "ip domain-name mydomain.com".
    - "sh hosts" displays the host table, or DNS information, if set up.
    - "ping" and "traceroute" can be used from user mode and enable mode, but not from config mode.
    - If you try to run traceroute with IPX or AppleTalk, you will get an error. Those two are not supported yet