Top Banner

of 39

BSNL document 1.

Apr 08, 2018

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
  • 8/7/2019 BSNL document 1.

    1/40

    1

    What is a Network?

    A network consists of two or more computers that are linked in order to share resources (such asprinters and CDs), exchange files, or allow electronic communications. The computers on a

    network may be linked through cables, telephone lines, radio waves, satellites, or infrared light

    beams.

    Three basic types of networks include:

    y Local Area Network (LAN)y Wide Area Network (WAN)

    y Metropolitan area network(MAN)

    Local Area Networks

    A Local Area Network (LAN) is basically a smaller network that's confined to a relatively small

    geographic area. LAN computers are rarely more than a mile apart. Examples of common LANsare networked computers within a writing lab, school, or building.

    Within a LAN network, one computer is the file server. This means that it stores all software thatcontrols the network, and it also stores the software that can be shared among computers in the

    network. The file server is the heart of the LAN.

    The computers attached to the file server are called workstations.Workstations can be less

    powerful than the file server because they don't have to store as many files and applications asthe file server, and they are not always on and working to keep the network up and running.

    However, workstations may also have additional software stored on their hard drives.MostLANS are connected using cables.

    Metropolitan Area Networks

    AMetropolitan Area Network (MAN) connect 2 or more LANs together but does not span

    outside the boundaries of a city, town, or metropolitan area. Within this type of network is alsothe Campus Area Network (CAN), which is generally smaller than aMAN, connecting LANs

    within a limited functional area, like a college campus, military base, or industrial complex.

    Wide Area Networks

    Wide Area Networks connect larger geographic areas. Often, smallerLANs are interconnected to

    form a largeW

    AN. For instance, an officeL

    AN inL

    os Angeles may be connected to officeLANs for the same company in New York, Toronto, Paris, and London to form a WAN spanningthe whole company. The individual offices are no longer part of individual LANs, they are

    instead part of a worldwide WAN.

    The connection of this type of network is complicated.WANs are normally connected using

    multiplexers connect local and metropolitan networks to global communications networks likethe Internet.

  • 8/7/2019 BSNL document 1.

    2/40

    2

    Advantages of Network

    Following are some of the advantages of network

    y File Sharing: The major advantage of a network is that is allows file sharing and remote

    file access. A person sitting at one workstation of a network can easily see the filespresent on the other workstation, provided he is authorized to do so. It saves the timewhich is wasted in copying a file from one system to another, by using a storage device.

    In addition to that, many people can access or update the information stored ina database, making it up-to-date and accurate.

    y Resource Sharing: Resource sharing is also an important benefit of a network. Forexample, if there are four people in a family, each having their own computer, they will

    require four modems (for the Internet connection) and four printers, if they want to usethe resources at the same time. A network, on the other hand, provides a cheaper

    alternative by the provision of resource sharing. In this way, all the four computers can beinterconnected, using a network, and just one modem and printer can efficiently provide

    the services to all four members. The facility of shared folders can also be availed byfamily members.

    y Increased Storage Capacity: As there is more than one computer on a network whichcan easily share files, the issue of storage capacity gets resolved to a great extent. A

    standalone computer might fall short of storage memory, but when many computers areon a network, memory of different computers can be used in such case. One can also

    design a storage server on the network in order to have a huge storage capacity.y Increased Cost Efficiency: There are many softwares available in the market which are

    costly and take time for installation. network resolve this issue as the software can bestored or installed on a system or a server and can be used by the different workstations.

    D

    isadvantages of Network

    Following are some of the major disadvantages of network

    y Security Issues: One of the major drawbacks of network is the security issues involved.If a computer is a standalone, physical access becomes necessary for any kind of data

    theft. However, if a computer is on a network, a computer hacker can get unauthorizedaccess by using different tools. In case of big organizations, various network security

    softwares are used to prevent the theft of any confidential and classified data.y Rapid Spread of Computer Viruses: If any computer system in a network gets affected

    by computer virus, there is a possible threat of other systems getting affected too. Virusesget spread on a network easily because of the interconnectivity of workstations. Such

    spread can be dangerous if the computers have important database which can getcorrupted by the virus.

    y Expensive Set Up: The initial set up cost of a computer network can be high dependingon the number of computers to be connected. Costly devices like routers,

    switches, hubs, etc., can add up to the bills of a person trying to install a computer

  • 8/7/2019 BSNL document 1.

    3/40

    3

    network. He will also have to buy NICs (Network Interface Cards) for each of theworkstations, in case they are not inbuilt.

    y Dependency on the Main File Server: In case the main File Server of a network breaks

    down, the system becomes useless. In case of big networks, the File Server should be a

    powerful computer, which often makes it expensive.

    Network components

    Repeaters Hubs Bridges Switches Routers

    Repeaters:

    As signals travel along a network cable (or any other medium of transmission), they degrade and

    become distorted in a process that is called attenuation. If a cable is long enough, the attenuationwill finally make a signal unrecognizable by the receiver.

    A Repeater enables signals to travel longer distances over a network. Repeaters work at the OSI's

    Physical layer. A repeater regenerates the received signals and then retransmits the regenerated

    (or conditioned) signals on other segments.

    To pass data through the repeater in a usable fashion from one segment to the next, the packetsand the Logical Link Control (LLC) protocols must be the same on the each segment. This

    means that a repeater will not enable communication, for example, between an 802.3 segment(Ethernet) and an 802.5 segment (Token Ring). That is, they cannot translate an Ethernet packet

    into a Token Ring packet. In other words, repeaters do not translate anything.

  • 8/7/2019 BSNL document 1.

    4/40

    4

    Hubs

    Hubs are very dumb network devices. They allow all devices that are connected to it tocommunicate to each other. It makes no decisions about traffic direction; it doesn't inspect

    traffic quality or verify packet integrity. All network data it receives on one port will be

    immediately transmitted out all the other ports, so each computer must take its turn beforesending data. This is called half-duplex, it is very inefficient.

    Bridges:

    Like a repeater, a bridge can join segments or workgroup LANs. However, a bridge can also

    divide a network to isolate traffic or problems. For example, if the volume of traffic from one ortwo computers or a single department is flooding the network with data and slowing down entire

    operation, a bridge can isolate those computers or that department.

    In the following figure, a bridge is used to connect two segment segment 1 and segment 2.

    Bridges can be used to:

    y Expand the distance of a segment.y Provide for an increased number of computers on the network.

    y Reduce traffic bottlenecks resulting from an excessive number of attached computers.

    Bridges work at the Data LinkLayer of the OSI model. Because they work at this layer, allinformation contained in the higher levels of the OSI model is unavailable to them. Therefore,

    they do not distinguish between one protocol and another.

    Bridges simply pass all protocols along the network. Because all protocols pass across the

    bridges, it is up to the individual computers to determine which protocols they can recognize.

  • 8/7/2019 BSNL document 1.

    5/40

    5

    A bridge works on the principle that each network node has its own address. A bridge forwardsthe packets based on the address of the particular destination node.

    As traffic passes through the bridge, information about the computer addresses is then stored in

    the bridge's RAM. The bridge will then use this RAM to build a routing table based on source

    addresses.

    NIC (NetworkInterface Card):

    A NIC or Network Interface Card is a circuit board or chip, which allows the computer tocommunicate to other computers on a Network. This board when connected to a cable or other

    method of transferring data such as infrared can share resources, information and computerhardware. Local orWide area networks are generally used for large businesses as well as are

    beginning to be found in homes as home users begin to have more then one computer. Utilizingnetwork cards to connect to a network allow users to share data such as companies being able to

    have the capability of having a database that can be accessed all at the same time send and

    receive e-mail internally within the company or share hardware devices such as printers.

    Switches:

    A switch can be considered a 'smart' hub. It will actively look at the traffic it receives and based

    on the destination address it will direct that traffic only to the port needed. The switch listens toeach port at the same time without any interference. A computer plugged directly into the switch

    will not receive unnecessary traffic and can transmit to the switch whenever it needs to, thisleaves all the bandwidth available to each machine.

    The switch memorizes the MAC address of each host and which port it resides on. This is how it

    can intelligently direct traffic.

    Switches (Layer-2 Switching) are a lot smarter than hubs and operate on the second layer of the

    OSI model. What this means is that a switch won't simply receive data and transmit it throughoutevery port, but it will read the data and find out the packet's destination by checking theMAC

    address. The destinationMAC address is located always at the beginning of the packet so oncethe switch reads it, it is forwarded to the appropriate port so no other node or computer

    connected to the switch will see the packet.

    Switches use Application Specific Integrated Circuits (ASIC's) to build and maintain filter tables.Layer-2 switches are a lot faster than routers cause they dont look at the NetworkLayer (Layer-

    3) header or if you like, information. Instead all they look at is the frame's hardware address(MAC address) to determine where the frame needs to be forwarded or if it needs to be dropped.

  • 8/7/2019 BSNL document 1.

    6/40

    6

    The Three Stages

    All switches regardless of the brand and various enhancements they carry, have something in common, it's

    the three stages (sometimes 2 stages) they go through when powered up and during operation. These are asfollows:

    y Address Learning

    y Forward/Filter decisions

    y Loop Avoidance (Optional)

    Address Learning

    When a switch is powered on, theMAC filtering table is empty. When a device transmits and an interface

    receives a frame, the switch places the source address in theMAC filtering table remembering the interface

    the device on which it is located. The switch has no choice but to flood the network with this frame becauseit has no idea where the destination device is located.If a device answers and sends a frame back, then the switch will take the source address from that frame and

    place theMAC address in the database, associating this address with the interface that received the frame.

    Since the switch has two MAC addresses in the filtering table, the devices can make a point-to-pointconnection and the frames will only be forwarded between the two devices. This makes layer-2 switches

    better than hubs. As we explained early on this page, in a hub network all frames are forwarded out to allports every time. Most desktop switches these days can hold upto 8000 MAC addresses in their table, andonce the table is filled, then starting with the very firstMAC entry, the switch will start overwritting the

    entries. Even tho the number of entries might sound big .. it only takes a minute or two to fill it up, and if a

    workstation dosen't talk on the network for that amount of time, then chances are that itsM

    AC address hasbeen removed from the table and the switch will forward to all ports the packet which has as a destinationthis particular workstation.

  • 8/7/2019 BSNL document 1.

    7/40

    7

    And after the first frame has been successfully received by Node 2, Node 2 sends a reply to Node 1, checkout what happens:

    Notice how the frame is not transmitted to every node on the switch. The switch by now has already learnedthat Node 1 is on the first port, so it send it straight there without delay. From now on, any communication

    between the two will be a point-to-point connection :

  • 8/7/2019 BSNL document 1.

    8/40

    8

  • 8/7/2019 BSNL document 1.

    9/40

    9

  • 8/7/2019 BSNL document 1.

    10/40

    10

    Forward/Filter Decision

    When a frame arrives at the switch, the first step is to check the destination hardware address, which is

    compaired to the forward/filterMAC database. If the destination hardware address is known, then it willtransmit it out the correct port, but if the destination hardware address is not known, then it will broadcast the

    frame out of all ports, except the one which it received it from. If a device (computer) answers to thebroadcast, then theMAC address of that device is added to theMAC database of the switch.

    Loop Avoidance (Optional)

    It's always a good idea to have a redundant link between your switches, in case one decides to go for aholiday.When you setup redundant switches in your network to stop failures, you can create problems. Have

    a look at the picture below and I'll explain:

    The above picture shows an example of two switches which have been placed in the network to provide

    redundancy in case one fails. Both switches have their first port connected to the upper section of the

  • 8/7/2019 BSNL document 1.

    11/40

    11

    network, while their port 2 is connected to the lower section of the same network. This way, if SwitchA fails, then Switch B takes over, or vice versa.

    Things will work fine until a broadcast come along and causes alot of trouble. For the simplicity of this

    example, I am not going to show any workstations, but only the server which is going to send a broadcast

    over the network, and keep in mind that this is what happens in real life if your switch does notsupport Spanning-Tree Protocol (STP), this is why I stuck the "Optional" near the "Loop Avoidance" at thestart of this section:

    It might look a bit messy and crazy at a first glance but let me explain what is going on here.

    The Server for one reason or another decides to do a broadcast. This First Round (check arrow)broadcast issent down to the network cable and firstly reaches Port 1 on Switch A. As a result, since Switch A has Port

    2 connected to the other side of the lan, it sends the broadcast out to the lower section of the network, this

    then is sent down the wire and reaches Port 2 on Switch B which will send it out Port 1 and back onto theupper part of the network. At this point, as the arrows indicate (orange colour) the Second Round of thisbroadcast starts. The broadcast reaches Port 1 of Switch A and goes out Port 2 back down to the lower

    section of the network and back up via Port 2 of Switch B. After it comes out of Port 1 of Switch B, we getthe Third Round, and then the Fourth Round, Fifth Round and keeps on going without stopping. This is what

    we call a Broadcast Storm.

    A Broadcast Storm will repeat constantly, chewing up the valueble bandwidth on the network. This is amajor problem, so they had to solve it one way or another, and they did... with theSpanning-TreeProtocol or STP in short.What STP does, is to find the redundant links, which this case would be Port

    2 of Switch B and shut it down, thus eliminating the posibility of looping to occur.

    Lan Switch Types

    At the begining of this page we said that the switches are fast, therefor have low latency. This latency doesvary and depends on what type of switching mode the switch is operating at. You might recall seeing these

    three switching modes at the beginning: Store & Forward, Cut-Through andFragment Free.

  • 8/7/2019 BSNL document 1.

    12/40

    12

    The picture below shows how far the different switching modes check the frame:

    The fact is that switches can operate in one of the three modes. Some advance switches will allow you toactually pick the mode you would like it to operate in, while others don't give you any choice. Let's have a

    quick look at each mode:

    Store & Forward mode

    This is one of the most popular swtiching methods. In this mode, when the switch receives a frame from one

    of it's ports, it will store it in memory, check it for errors and corruption, and if it passes the test, it willforward the frame out the designated port, otherwise, if it discovers that the frame has errors or is corrupt, it

    will discard it. This method is the safest, but also has the highest latency.

    Cut-Through (Real Time)

    Cut-Through switching is the second most popular method. In this mode,the switch reads the frame until it

    learns the destinationMAC address of the frame it's receiving. Once it learns it, it will forward the framestraight out the designated port without delay. This is why we say it's -Real Time there is no delay or error

    checking done to the frame.

    Fragment Free

    The Fragment free switching method is mainly used to check for frames which have been subject to acollision. The frame's first 64 bytes are only checked before forwarding the frame out the designated port.

    Reason for this is because almost all collisions will happen within the first 64 bytes of a frame. If there is a

  • 8/7/2019 BSNL document 1.

    13/40

    13

    corruption in the first 64 bytes, it's most likely that that frame was a victim of a collision.

    Just keep one important detail in mind:When you go out to buy a switch, make sure you check the amount of

    memory it has. Alot of the cheap switches which support the Store & Forward mode have very smallamounts of memory buffer (256KB- 512KB) per port. The result of this is that you get a major decrease inperformance when you have more than 2 computers communicating via that switch cause there isn't enough

    memory to store all incoming packets (this also depends on the switching type your switch supports), andyou eventually get packets being discarded.

    Routers:

    In an environment consisting of several network segments with different protocols and architecture, a bridgemay not be adequate for ensuring fast communication among all of the segments. A complex network needs

    a device, which not only knows the address of each segment, but also can determine the best path for sending

    data and filtering broadcast traffic to the local segment. Such device is called a Router.

    Routers work at the Network layer of the OSI model meaning that the Routers can switch and route packets

    across multiple networks. They do this by exchanging protocol-specific information between separatenetworks. Routers have access to more information in packets than bridges, and use this information to

    improve packet deliveries. Routers are usually used in a complex network situation because they providebetter traffic management than bridges and do not pass broadcast traffic.

    Routers can share status and routing information with one another and use this information to bypass slow ormalfunctioning connections.

    Routers do not look at the destination node address; they only look at the network address. Routers will onlypass the information if the network address is known. This ability to control the data passing through therouter reduces the amount of traffic between networks and allows routers to use these links more efficiently

    than bridges

  • 8/7/2019 BSNL document 1.

    14/40

    14

    Cisco Router Basics

    Introduction:

    Cisco is well known for its routers and switches. Cisco has a number of different routers, amongst them are

    the popular 1600 series, 2500 series and 2600 series. The ranges start from the 600 series and go up to the

    12000 series

    Below are a few of the routers mentioned :

    Cisco 7200 SeriesCisco 800 Series

    Cisco 700 Series

    Cisco 2600 Series

    Cisco 1600 Series

  • 8/7/2019 BSNL document 1.

    15/40

    15

    All the above equipment runs special software called the Cisco Internetwork Operating System or IOS. Thisis the kernel of Cisco routers and most switches. Cisco has created what they call Cisco Fusion, which is

    supposed to make all Cisco devices run the same operating system.

    The basic components of any Cisco router are :

    1) Interfaces

    2) The Processor (CPU)

    3) Internetwork Operating System (IOS)

    4) RX Boot Image

    5) RAM

    6) NVRAM

    7) ROM

    8) Flash memory

    9) Configuration Register

    Interfaces

    These allow to use the router. The interfaces are the various serial ports or Ethernet ports which we use to

    connect the router to ourL

    AN. Cisco has given some of the interfaces: E0 (first Ethernet interface), E1(second Ethernet interface). S0 (first Serial interface), S1 (second Serial interface), BRI 0 (first B channel forBasic ISDN) and BRI 1 (second B channel forBasic ISDN).

    In the picture below see the back view of a Cisco router, clearly see the various interfaces it has:

  • 8/7/2019 BSNL document 1.

    16/40

    16

    Even it has a phone socket thats normal since we have to connect a digital phone to an ISDN line and sincethis is an ISDN router, it has this option with the router. we don't get routers with ISDN S/T and ISDN

    U interfaces together. Any ISDN line requires a Network Terminator (NT) installed at the customer'spremises and we connect our equipment after this terminator. An ISDN S/T interface doesn't have the NT

    device built in, so we need an NT device in order to use the router. On the other hand, an ISDN U interface

    has the NT device built in to the router.

    Check the picture below to see how to connect the router using the different ISDN interfaces:

    ...........

    Apart from the ISDN interfaces, we also have an Ethernet interface that connects to a device in ourLAN,

    usually a hub or a computer. If connecting to a Hub uplink port, then you set the small switch to "Hub", but ifconnecting to a PC, you need to set it to "Node". This switch will simply convert the cable from a straight

    through (hub) to a x-over (Node):

    ..............

    The Config or Console port is a Female DB9 connector which you connect, using a special cable, to your

    computers serial port and it allows you to directly configure the router.

    The Processor (CPU)

    All Cisco routers have a main processor that takes care of the main functions of the router.The CPU generates interrupts (IRQ) in order to communicate with the other electronic components in the

    router. The Cisco routers utilizeMotorola RISC processors. Usually the CPU utilization on a normal routerwouldn't exceed 20 %.

  • 8/7/2019 BSNL document 1.

    17/40

    17

    The IOS

    The IOS is the main operating system on which the router runs. The IOS is loaded upon the router's bootup.It usually is around 2 to 5MB in size, but can be a lot larger depending on the router series. The IOS is

    currently on version 12, and Cisco periodically releases minor versions every couple of months e.g 12.1 ,

    12.3 etc. to fix small bugs and also add extra functionality.

    The IOS gives the router its various capabilities and can also be updated or downloaded from the router for

    backup purposes. On the 1600 series and above, you get the IOS on a PCMCIAFlash card. This Flash cardthen plugs into a slot located at the back of the router and the router loads the IOS "image" (as they call it).

    Usually this image of the operating system is compressed so the router must decompress the image in itsmemory in order to use it.

    The IOS is one of the most critical parts of the router, without it the router is pretty much useless. Just keepin mind that it is not necessary to have a flash card (as described above with the 1600 series router) in order

    to load the IOS. You can actually configure most Cisco routers to load the image off a network tftp server or

    from another router which might hold multiple IOS images for different routers, in which case it will have alarge capacity Flash card to store these images.

    The RXBoot Image

    The RX Boot image (also known as Boot loader) is nothing more than a "cut-down" version ofthe IOS located in the router's ROM (Read OnlyMemory). If you had no Flash card to load the IOS from,

    you can configure the router to load the RX Boot image, which would give the ability to perform minormaintenance operations and bring various interfaces up or down.

    The RAM

    The RAM, or Random AccessMemory, is where the router loads the IOS and the configuration file. It worksexactly the same way as your computer's memory, where the operating system loads along with all the

    various programs. The amount of RAM a router needs is subject to the size of the IOS image andconfiguration file we have. In most cases, smaller routers (up to the 1600 series) are with 12 to 16 MB while

    the bigger routers with larger IOS images would need around 32 to 64 MB of memory. Routing tables arealso stored in the system's RAM so if we have large and complex routing tables, more RAM is needed.

    The NVRAM (Non-Volatile RAM)

    The NVRAM is a special memory place where the router holds its configuration.When we configure arouter and then save the configuration, it is stored in the NVRAM. This memory is not big at all when

    compared with the system's RAM. On a Cisco 1600 series, it is only 8 KB while on bigger routers, like the2600 series, it is 32 KB. Normally, when a router starts up, after it loads the IOS image it will look into

    the NVRAM and load the configuration file in order to configure the router. The NVRAM is not erasedwhen the router is reloaded or even switched off.

  • 8/7/2019 BSNL document 1.

    18/40

    18

    ROM (Read Only Memory)

    The ROM is used to start and maintain the router. It contains some code, like the Bootstrap and POST, whichhelps the router do some basic tests and bootup when it's powered on or reloaded. We cannot alter any of the

    code in this memory as it has been set from the factory and is Read Only.

    Flash Memory

    The Flash memory is that card I spoke about in the IOS section. All it is an EEPROM (Electrical Erasable

    Programmable Read OnlyMemory) card. It fits into a special slot normally located at the back of the routerand contains nothing more than the IOS image(s). You can write to it or delete its contents from the router's

    console. Usually it comes in sizes of 4MB for the smaller routers (1600 series) and goes up from theredepending on the router model.

    Configuration Register

    Keeping things simple, the Configuration Register determines if the router is going to boot the IOS imagefrom its Flash, tftp server or just load the RXBoot image. This register is a 16 Bit register, in other words has16 zeros or ones. A sample of it in Hex would be the following: 0x2102 and in binary is

    : 0010 0001 0000 0010.

    Types of addresses:

    Physical address Logical address

    Logical Address: An IP address of the system is called logical address. This address is the combination of

    Net ID and Host ID. This address is used by network layer to identify a particular network (source todestination) among the networks. This address can be changed by changing the host position on the network.So it is called logical address.

    An Internet Protocol address (IP address) is a numerical label assigned to each device (e.g., computer,printer) participating in a computer network that uses the Internet Protocol for communication.

    [1]An IP

    address serves two principal functions: host or network interface identification and location addressing. Itsrole has been characterized as follows: "A name indicates what we seek. An address indicates where it is. A

    route indicates how to get there."

    The designers of the Internet Protocol defined an IP address as a 32-bit number and this system, known as

    Internet Protocol Version 4 (IPv4), is still in use today. However, due to the enormous growth of the Internetand the predicted depletion of available addresses, a new addressing system (IPv6), using 128 bits for theaddress, was developed in 1995, standardized as RFC 2460 in 1998,

    [4]and is being deployed world-wide

    since the mid-2000s.

    IP addresses are binary numbers, but they are usually stored in text files and displayed in human-readablenotations, such as 172.16.254.1 (for IPv4), and 2001:db8:0:1234:0:567:8:1 (for IPv6).

  • 8/7/2019 BSNL document 1.

    19/40

    19

    The Internet Assigned Numbers Authority (IANA) manages the IP address space allocations globally anddelegates five regional Internet registries (RIRs) to allocate IP address blocks to local Internet registries

    (Internet service providers) and other entities.

    Physical address: Each system having a NIC(Network Interface Card) through which two systemsphysically connected with each other with cables. The address of the NIC is called Physical address or mac

    address. This is specified by the manufacture company of the card. This address is used by data link layer.

    The media access control(MAC address is a unique value associated with a network adapter.MAC addresses

    are also known as hardware addresses orphysical addresses. They uniquely identify an adapter on a LAN.

    MAC addresses are 12-digit hexadecimal numbers (48 bits in length). By convention, MAC addresses are

    usually written in one of the following two formats:

    MM:MM:MM:SS:SS:SS

    MM-MM-MM-SS-SS-SS

    The first half of a MAC address contains the ID number of the adapter manufacturer. These IDs are regulated

    by an Internet standards body.The second half of a MAC address represents the serial number assigned to the

    adapter by the manufacturer. In the example,

    00:A0:C9:14:C8:29. The prefix 00A0C9 indicates the manufacturer is Intel Corporation.

    IP ADDRESSING SCHEME:

    Classful IP AddressingWhen IP was first standardized in September 1981, the specification required that each system attached to an

    IP-based Internet be assigned a unique, 32-bit Internet address value. Systems that have interfaces to morethan one network require a unique IP address for each network interface. The first part of an Internet address

    identifies the network on which the host resides, while the second part identifies the particular host on thegiven network. This creates the two-level addressing hierarchy that is illustrated in Figure 3.

    FIGURE 3. Two-Level Internet Address Structure

    NETWORK NUMBER HOST NUMBER

    OR

    NETWORK PREFIX HOST NUMBER

  • 8/7/2019 BSNL document 1.

    20/40

    20

    Primary Address Classes:To provide the flexibility required to support networks of varying sizes, the Internet designers decided that

    the IP address space should be divided into three address classes-Class A, Class B, and Class C. This is oftenreferred to as classful addressing. Each class fixes the boundary between the network prefix and the host

    number at a different point within the 32-bit address.

    The formats of the fundamental address classes are illustrated in Figure 4.

    One of the fundamental features of classful IP addressing is that each address contains a self-encoding key

    that identifies the dividing point between the network prefix and the host number. For example,if the first two bits of an IP address are 1-0, the dividing point falls between the 15th and 16th bits. This

    simplified the routing system during the early years of the Internet because the original routing protocols did

    not supply a deciphering key or mask with each route to identify the length of the network prefix.

    Class A Networks (/8 Prefixes):Each Class A network address has an 8-bit network prefix, with the highest order bit set to 0 (zero) and a 7-

    bit network number, followed by a 24-bit host number. Today, Class A networks are referred to as/8s(pronounced slash eight or just eights) since they have an 8-bit network prefix. A maximum of 126 (27 -

    2) /8 networks can be defined. The calculation subtracts two because the /8 network 0.0.0.0 is reserved foruse as the default route and the /8 network 127.0.0.0 (also written 127/8 or127.0.0.0/8) is reserved for the

    loopback function. Each /8 supports a maximum of 224 -2(16,777,214) hosts per network. The hostcalculation subtracts two because the all-0s (all zeros or this network) and all-1s (all ones or broadcast)

    host numbers may not be assigned to individual hosts.

    Since the /8 address block contains 231 (2,147,483,648 ) individual addresses and the IPv4 address spacecontains a maximum of 232(4,294,967,296) addresses, the /8 address space is 50 percent of the total IPv4

    unicast address space.

  • 8/7/2019 BSNL document 1.

    21/40

    21

    Class B Networks (/16 Prefixes):Each Class B network address has a 16-bit network prefix, with the two highest order bits set to 1-0 and a 14-

    bit network number, followed by a 16-bit host number. Class B networks are now referred to as /16s sincethey have a 16-bit network prefix.

    A maximum of 16,384 (214 ) /16 networks can be defined with up to 65,534 (216-2) hosts per network.Since the entire /16 address block contains 230 (1,073,741,824) addresses, it represents 25 percent of thetotal IPv4 unicast address space.

    Class C Networks (/24 Prefixes):Each Class C network address has a 24-bit network prefix, with the three highest order bits set to 1-1-0 and a

    21-bit network number, followed by an 8-bit host number. Class C networks are now referred to as /24ssince they have a 24-bit network prefix. A maximum of 2,097,152 (221 ) /24 networks can be defined with

    up to 254 (28-2) hosts per network. Since the entire /24 address block contains 229 (536,870,912) addresses,it represents 12.5 percent (or one eighth) of the total IPv4 unicast address space.

    Other Classes:In addition to the three most popular classes, there are two additional classes. Class D addresses have their

    leading four bits set to 1-1-1-0 and are used to support IP Multicasting. Class E addresses have their leadingfour bits set to 1-1-1-1 and are reserved for experimental use.

    Dotted-Decimal Notation:

    To make Internet addresses easier for people to read and write, IP addresses are often expressed as fourdecimal numbers, each separated by a dot. This format is called dotted-decimal notation.Dotted-decimal

    notation divides the 32-bit Internet address into four 8-bit fields and specifies the value of each fieldindependently as a decimal number with the fields separated by dots. Figure 5 shows how a typical /16

    (Class B) Internet address can be expressed in dotted-decimal notation.

    10010001. 00001010. 00100010. 00000011

    145.10.34.3

    SUMMARY:

    Class Leadingbits

    Size ofnetwork

    bit field

    Size ofhost

    field

    Numberof networks

    Addressesper network

    Startaddress

    End address

    A 0 8 24 128(2) 16777216(2) 0.0.0.0 127.255.255.255

    B 10 16 16 16384(2) 65536(2) 128.0.0.0 191.255.255.255

    C 110 24 8 2097152(2) 256(2) 192.0.0.0 223.255.255.255

    D(multicast) 1110 Not

    defined

    Not

    defined

    Not defined Not defined 224.0.0.0 239.255.255.255

    E(reserved) 1111 Not

    defined

    Not

    defined

    Not defined Not defined 240.0.0.0 255.255.255.255

  • 8/7/2019 BSNL document 1.

    22/40

    22

    Unforeseen Limitations to Classful Addressing:The original Internet designers never envisioned that the Internet would grow into what it has become today.

    Many of the problems that the Internet is facing today can be traced back to the early decisions that weremade during its formative years.

    During the early days of the Internet, the seemingly unlimited address space allowed IP addresses to beallocated to an organization based on its request rather than its actual need. As a result, addresses were freely

    assigned to those who asked for them without concerns about the eventual depletion of the IP address space. The decision to standardize on a 32-bit address space meant that there were only 232 (4,294,967,296) IPv4

    addresses available. A decision to support a slightly larger address space would have exponentially increasedthe number of addresses thus eliminating the current address shortage problem.

    The classful A, B, and C octet boundaries were easy to understand and implement, but they did not fosterthe efficient allocation of a finite address space. Problems resulted from the lack of a network class that was

    designed to support medium-sized organizations. For example, a /24, which supports 254 hosts, is too smallwhile a /16,which supports 65,534 hosts, is too large. In the past, sites with several hundred hosts were

    assigned a single /16 address instead of two /24 addresses. This resulted in a premature depletion of the /16network address space. Now the only readily available addresses for medium-sized organizations are /24s,

    which have the potentially negative impact of increasing the size of the global Internets routing table.

    What is Subnet Mask?

    An IP address has two components, the network address and the host address. A subnet mask separates the IPaddress into the network and host addresses (). Subnetting further divides the host part of

    an IP address into a subnet and host address (). It is called a subnet mask becauseit is used to identify network address of an IP address by perfoming bitwise AND operation on the netmask.

    A Subnet mask is a 32-bit number that masks an IP address, and divides the IP address into network address

    and host address. Subnet Mask is made by setting network bits to all "1"s and setting host bits to all "0"s.

    Within a given network, two host addresses are reserved for special purpose. The "0" address is assigned a

    network address and "255" is assigned to a broadcast address, and they cannot be assigned to a host.

    Subnet mask for class A is 255.0.0.0

    Subnet mask for class B is 255.255.0.0

    Subnet mask for class C is 255.255.255.0

  • 8/7/2019 BSNL document 1.

    23/40

    23

    Subnetting:

    The practice of dividing a network into sub networks is called subnetting. Subnetting was introduced toovercome some of the problems that parts of the Internet were beginning to experience with the classful two-

    level addressing hierarchy, such as: Internet routing tables were beginning to grow.

    Local administrators had to request another network number from theInternet before a new network could be installed at their site.

    Subnet is a powerful concept that extends the network number one step further. Lets say a network

    administrator is given a class of IP address block. It is required to divide the hosts into different networks inorder to separate the traffic streams. By using the concept of subnet, the network administrator can decide onthe size of the subnet block according to the needs.

    A subnet mask is used to identify the subnet boundary. It uses binary ones to denote the network and subnetbits, and binary zeros to denote the host bits. For the host address 172.16.2.4 with a subnet of 172.16.2.0, the

    subnet mask is:

    11111111.11111111.11111111.00000000 (or 255.255.255.0 in decimal)

    Classless Inter-Domain Routing (CIDR)

    y By 1992, the exponential growth of the Internet was raising serious concerns among members of theIETF about the ability of the Internets routing system to scale and support future growth. These

    problems were related to: The near-term exhaustion of the Class B network address space

    The rapid growth in the size of the global Internets routing tables The eventual exhaustion of the 32-bit IPv4 address space

    y CIDR eliminates the traditional concept of Class A, Class B, and Class C network addresses.

    y CIDR supports route aggregation where a single routing table entry can represent the address spaceof thousands of traditional classful routes. This allows a single routing table entry to specify how to

    route traffic to many individual network addresses. Route aggregation helps control the amount of

    routing information in the Internets backbone routers, reduces route flapping (rapid changes inroute availability), and eases the local administrative burden of updating external routinginformation.

    y CIDR is denoted by slash(\) followed by network bits, example \8,\16,\24 ,\19

  • 8/7/2019 BSNL document 1.

    24/40

    24

    Subnet Mask CIDR Prefix Total IP's Usable IP's Number of Class C networks

    255.255.255.255 /32 1 1 1/256th

    255.255.255.254 /31 2 0 1/128th

    255.255.255.252 /30 4 2 1/64th

    255.255.255.248 /29 8 6 1/32nd

    255.255.255.240 /28 16 14 1/16th

    255.255.255.224 /27 32 30 1/8th

    255.255.255.192 /26 64 62 1/4th

    255.255.255.128 /25 128 126 1 half

    255.255.255.0 /24 256 254 1

    255.255.254.0 /23 512 510 2

    255.255.252.0 /22 1024 1022 4

    255.255.248.0 /21 2048 2046 8255.255.240.0 /20 4096 4094 16

    255.255.224.0 /19 8192 8190 32

    255.255.192.0 /18 16,384 16,382 64

    255.255.128.0 /17 32,768 32,766 128

    255.255.0.0 /16 65,536 65,534 256

    255.254.0.0 /15 131,072 131,070 512

    255.252.0.0 /14 262,144 262,142 1024

    255.248.0.0 /13 524,288 524,286 2048

    255.240.0.0 /12 1,048,576 1,048,574 4096

    255.224.0.0 /11 2,097,152 2,097,150 8192

    255.192.0.0 /10 4,194,304 4,194,302 16,384

    255.128.0.0 /9 8,388,608 8,388,606 32,768

    255.0.0.0 /8 16,777,216 16,777,214 65,536

    254.0.0.0 /7 33,554,432 33,554,430 131,072

    252.0.0.0 /6 67,108,864 67,108,862 262,144

    248.0.0.0 /5 134,217,728 134,217,726 1,048,576

    240.0.0.0 /4 268,435,456 268,435,454 2,097,152

    224.0.0.0 /3 536,870,912 536,870,910 4,194,304

    192.0.0.0 /2 1,073,741,824 1,073,741,822 8,388,608

    128.0.0.0 /1 2,147,483,648 2,147,483,646 16,777,216

    0.0.0.0 /0 4,294,967,296 4,294,967,294 33,554,432

  • 8/7/2019 BSNL document 1.

    25/40

    25

    Classful vs classless addressing:

    The classful/classless nature of a routing protocol indicates whether or not the concept of subnet is allowed.If a routing protocol is classful, it automatically assumes that no subnet exists. For example, only the

    standard network address 10.0.0.0 is passed for the routing entry 10.1.1.0/24. No subnet or subnet maskare transmitted. Then, when another router receives this routing entry, it uses the normal mask, namely /8

    or 255.0.0.0. The information of subnet is lost.On the other hand, if the routing protocol is classless, therouting entry will consist both the network and the subnet mask. In the above example, the routing entry

    includes both the network address 10.1.1.0 and the subnet mask 255.255.255.0 pair. This contains thecomplete information.

    Address Allocation for Private Internets:

    RFC 1918 requests that organizations use the private Internet address space for hosts that require IPconnectivity within their enterprise network, but do not require external connections to the global

    Internet.The IANA has reserved the following three address blocks for private Internets: 10.0.0.0 - 10.255.255.255 (10/8 prefix)

    172.16.0.0 - 172.31.255.255 (172.16/12 prefix) 192.168.0.0 - 192.168.255.255 (192.168/16 prefix)

    Any organization that elects to use addresses from these reserved blocks can do so without contacting the

    IANA or an Internet registry. Since these addresses are never injected into the global Internet routing system,the address space can simultaneously be used by many different organizations.

    The disadvantage to this addressing scheme is that it requires an organization to use a Network Address

    Translator (NAT) for global Internet access. However, the use of the private address space and a NAT makeit much easier for clients to change their ISP without renumbering or punching holes in a previously

    aggregated advertisement.

    A benefit of this addressing scheme to the Internet is that it reduces the demand for IP addresses so largeorganizations may require only a small block of the globally unique IPv4 address space.

    Routing:

    Routing refers to the process of moving packets of information across a network. Static and dynamic routingare the two types of routing algorithms used for this transfer of information. Let us understand static vs

    dynamic routing.

    The term routing encapsulates two tasks. These tasks are deciding the paths for data transferred and sending

    the packets on these paths. The routing is a process that is a function carried out at layer 3 of

    the OSI reference model. The routing algorithm decides the output line to transfer the incoming packets. The

    routing algorithms are based on the routing protocol that uses metrics to assess whether a particular path is

    the optimal path available for transfer of the data packets.

    The metrics used for evaluating the paths are bandwidth, delay and reliability. The routing algorithms use

    these protocols to determine an optimal path from the source to the destination. The routing tables maintain

    all the information related to routing.

  • 8/7/2019 BSNL document 1.

    26/40

    26

    There are various routing algorithms and depending on these routing algorithms, the information stored in

    the routing table varies. Every router has its own routing table and it fills this table with the required

    information to calculate the optimal path between the source router and the destination router. To understand

    the basic points of static vs dynamic routing, let us get to know what are routing tables.

    Routing table

    A routing table is a document stored in the router or a network computer. The routing table is stored in the

    form of a database or is simply a file stored in the router. The data entered in the routing table is referred to

    when the best possible path to transfer information across two computers in a network is to be determined.

    Classifications of routing:

    The two classifications, viz., static and dynamic routing, are based on the way in which the routing tables are

    updated every time they are used. The routers in which the data is stored and updated manually are called

    static routers. On the other hand, the routers in which the information is changed dynamically, by the routeritself, are referred to as dynamic routers.

    Let us compare the two types of routing algorithms based on the static and dynamic routing algorithm used,

    in the static vs. dynamic routing section given below.

    Static Vs. Dynamic Routing

    y Static routing manually sets up the optimal paths between the source and the destination computers.

    On the other hand, the dynamic routing uses dynamic protocols to update the routing table and to findthe optimal path between the source and the destination computers.

    y The routers that use the static routing algorithm do not have any controlling mechanism if any faultsin the routing paths. These routers do not sense the faulty computers encountered while finding the

    path between two computers or routers in a network. The dynamic routing algorithms are used in thedynamic routers and these routers can sense a faulty router in the network. Also, the dynamic router

    eliminates the faulty router and finds out another possible optimal path from the source to thedestination. If any router is down or faulty due to certain reasons, this fault is circulated in the entire

    network. Due to this quality of the dynamic routers, they are also called adaptive routers.y The static routing is suitable for very small networks and they cannot be used in large networks. As

    against this, dynamic routing is used for larger networks. The manual routing has no specific routingalgorithm. The dynamic routers are based on various routing algorithms like OSPF (Open Shortest

    Path First), IGRP (Interior Gateway Routing Protocol) and RIP (Routing Information Protocol).y The static routing is the simplest way of routing the data packets from a source to a destination in a

    network. The dynamic routing uses complex algorithms for routing the data packets.y The static routing has the advantage that it requires minimal memory. Dynamic router, however, have

    quite a few memory overheads, depending on the routing algorithms used.y The network administrator finds out the optimal path and makes the changes in the routing table in

    the case of static routing. In the dynamic routing algorithm, the algorithm and the protocol isresponsible for routing the packets and making the changes accordingly in the routing table.

  • 8/7/2019 BSNL document 1.

    27/40

    27

    Open Shortest Path First (OSPF) is a link state interior gateway protocol developed by the OSPF working group of

    the Internet Engineering Task Force (IETF). At present, OSPF version 2 (RFC 2328) is used.

    Introduction to OSPF:

    OSPF has the following features:

    Wide scope: Supports networks of various sizes and up to several hundred routers in an

    OSPF routing domain.

    Fast convergence: Transmits updates instantly after network topology changes for routing

    information synchronization in the AS.

    Loop-free: Computes routes with the shortest path first (SPF) algorithm according tocollected link states, so no route loops are generated.

    Area partition: Allows an AS to be split into different areas for ease of management and

    routing information transmitted between areas is summarized to reduce network bandwidthconsumption.

    Equal-cost multi-route: Supports multiple equal-cost routes to a destination.

    Routing hierarchy: Supports a four-level routing hierarchy that prioritizes routes into intra-area, inter-area, external Type-1, and external Type-2 routes.

    Authentication: Supports interface-based packet authentication to ensure the security ofpacket exchange.

    Multicast: Supports multicasting protocol packets on some types of links.

    Basic Concepts

    Autonomous System:

    A set of routers using the same routing protocol to exchange routing information constitute an

    Autonomous System (AS).

    OSPF route computation:

    OSPF route computation in an area is described as follows:

    Based on the network topology around itself, each router generates Link StateAdvertisements (LSA) and sends them to other routers in update packets.

    Each OSPF router collectsL

    SAs from other routers to compose aL

    SDB

    (L

    ink StateDatabase). An LSA describes the network topology around a router, so the LSDB describes theentire network topology of the AS.

    Each router transforms the LSDB to a weighted directed graph, which actually reflects thetopology architecture of the entire network. All the routers have the same graph.

    Each router uses the SPF algorithm to compute a Shortest Path Tree that shows the routes tothe nodes in the autonomous system. The router itself is the root of the tree.

  • 8/7/2019 BSNL document 1.

    28/40

  • 8/7/2019 BSNL document 1.

    29/40

    29

    The Type 9 opaque LSA is flooded into the local subnet, the Type 10 is flooded into the localarea, and the Type 11 is flooded throughout the whole AS.

    Neighbor and Adjacency:

    In OSPF, the Neighbor and Adjacency are two different concepts.

    Neighbor: Two routers that have interfaces to a common network. Neighbor relationships are

    maintained by, and usually dynamically discovered by, OSPF's hello packets. When a router starts,

    it sends a hello packet via the OSPF interface, and the router that receives the hello packet checks

    parameters carried in the packet. If parameters of the two routers match, they become neighbors.

    Adjacency: A relationship formed between selected neighboring routers for the purpose of

    exchanging routing information. Not every pair of neighboring routers become adjacent, which

    depends on network types. Only by synchronizing the LSDB via exchanging DD packets and LSAs

    can two routers become adjacent.

    OSPF Area Partition

    Area partition:

    When a large number of OSPF routers are present on a network, LSDBs may become so large that a

    great amount of storage space is occupied and CPU resources are exhausted by performing SPF

    computation.

    In addition, as the topology of a large network is prone to changes, enormous OSPF packets may be

    created, reducing bandwidth utilization. Each topology change makes all routers perform route

    calculation.

    To solve this problem, OSPF splits an AS into multiple areas, which are identified by area ID. The

    boundaries between areas are routers rather than links. A network segment (or a link) can only

    reside in one area, in other words, an OSPF interface must be specified to belong to its attached

    area, as shown in the figure below.

  • 8/7/2019 BSNL document 1.

    30/40

    30

    Figure 1 OSPF area partition

    After area partition, area border routers perform route summarization to reduce the number ofLSAs

    advertised to other areas and minimize the effect of topology changes.

    Backbone area and virtual links

    Each AS has a backbone area, which is responsible for distributing routing information betweennone-backbone areas. Routing information between non-backbone areas must be forwarded by the

    backbone area. Therefore, OSPF requires that:

    All non-backbone areas must maintain connectivity to the backbone area.

    The backbone area itself must maintain connectivity.

    In practice, due to physical limitations, the requirements may not be satisfied. In this case,

    configuring OSPF virtual links is a solution.

    A virtual link is established between two area border routers via a non-backbone area and is

    configured on both AB

    Rs to take effect. The area that provides the non-backbone area internal routefor the virtual link is a transit area.

    In the following figure, Area 2 has no direct physical link to the backbone area 0. Configuring a

    virtual link between ABRs can connect Area 2 to the backbone area.

  • 8/7/2019 BSNL document 1.

    31/40

    31

    Figure 2 Virtual link application 1

    Another application of virtual links is to provide redundant links. If the backbone area cannot

    maintain internal connectivity due to a physical link failure, configuring a virtual link can guarantee

    logical connectivity in the backbone area, as shown below.

    Figure 3 Virtual link application 2

    The virtual link between the two ABRs acts as a point-to-point connection. Therefore, you can

    configure interface parameters such as hello packet interval on the virtual link as they are

    configured on physical interfaces.

    The two ABRs on the virtual link exchange OSPF packets with each other directly, and the OSPF

    routers in between simply convey these OSPF packets as normal IP packets.

    Stub area

    The ABR in a stub area does not distribute Type-5 LSAs into the area, so the routing table size andamount of routing information in this area are reduced significantly.

    You can configure the stub area as a totally stub area, where the ABR advertises neither the

    destinations to other areas nor external routes.

    Stub area configuration is optional, and not every area is eligible to be a stub area. In general, a stub

    area resides on the border of the AS.

  • 8/7/2019 BSNL document 1.

    32/40

    32

    The ABR in a stub area generates a default route into the area.

    Note the following when configuring a (totally) stub area:

    The backbone area cannot be a (totally) stub area.

    To configure an area as a stub area, the stub command must be configured on routers in thearea.

    To configure an area as a totally stub area, the stub command must be configured on routersin the area, and the ABR of the area must be configured with the stub [ no-summary] command.

    A (totally) stub area cannot have an ASBR because AS external routes cannot be distributedinto the stub area.

    Virtual links cannot transit (totally) stub areas.

    NSSA area

    Similar to a stub area, an NSSA area imports no AS external LSA (Type-5 LSA) but can import

    Type-7 LSAs that are generated by the ASBR and distributed throughout the NSSA area. When

    traveling to the NSSA ABR, Type-7 LSAs are translated into Type-5 LSAs by the ABR for

    advertisement to other areas.

    In the following figure, the OSPF AS contains three areas: Area 1, Area 2 and Area 0. The other

    two ASs employ the RIP protocol. Area 1 is an NSSA area, and the ASBR in it translates RIP

    routes into Type-7 LSAs and advertises them throughout Area 1. When these LSAs travel to the

    NSSA ABR, the ABR translates Type-7 LSAs to Type-5 LSAs for advertisement to Area 0 and

    Area 2.

    On the left of the figure, RIP routes are translated into Type-5 LSAs by the ASBR of Area 2 and

    distributed into the OSPF AS. However, Area 1 is an NSSA area, so these Type-5 LSAs cannot

    travel to Area 1.

    Like stub areas, virtual links cannot transit NSSA areas.

    Figure 4 NSSA area

  • 8/7/2019 BSNL document 1.

    33/40

    33

    Comparsion between the areas

    Figure 5 Comparison between the areas

    Figure 5 shows the comparison of the areas:

    In a totally stub area, the ABR can distribute a Type 3 default route, while it does not

    distribute external routes and inter-area routes.

    Compared with a totally stub area, a stub area can import inter-area routes.

    Compared with a stub area, an NSSA area can import external routes through Type 7 LSAs

    advertised by the ASBR.

    Compared with an NSSA area, a totally NSSA area does not import inter-area routes.

    Router Types

    Classification of Routers

    The OSPF routers fall into four types according to their positions in the AS:

    Step1 Internal Router

    All interfaces on an internal router belong to one OSPF area.

    Step2 Area Border Router (ABR)

    An area border router belongs to more than two areas, one of which must be the backbone area. It

    connects the backbone area to a non-backbone area. The connection between an area border router

    and the backbone area can be physical or logical.

  • 8/7/2019 BSNL document 1.

    34/40

    34

    Step3 Backbone Router

    At least one interface of a backbone router must be attached to the backbone area. Therefore, all

    ABRs and internal routers in area 0 are backbone routers.

    Step4 Autonomous System Border Router (ASBR)

    A router exchanging routing information with another AS is an ASBR, which may not reside on the

    boundary of the AS. It can be an internal router or an area border router.

    Figure 6 OSPF router types

    Route types

    OSPF prioritize routes into four levels:

    Intra-area route

    Inter-area route

    Type-1 external route

    Type-2 external route

    The intra-area and inter-area routes describe the network topology of the AS, while external routes

    describe routes to destinations outside the AS.

    OSPF classifies external routes into two types: Type-1 and Type-2. A Type-1 external route is an

    IGP route, such as a RIP or static route, which has high credibility and whose cost is comparable

  • 8/7/2019 BSNL document 1.

    35/40

    35

    with the cost of an OSPF internal route. The cost from a router to the destination of the Type-1

    external route= the cost from the router to the corresponding ASBR+ the cost from the ASBR to the

    destination of the external route.

    A Type-2 external route is an EGP route, which has low credibility, so OSPF considers the cost

    from the ASBR to the destination of the Type-2 external route is much greater than the cost fromthe ASBR to an OSPF internal router. Therefore, the cost from the internal router to the destination

    of the Type-2 external route= the cost from the ASBR to the destination of the Type-2 external

    route. If two routes to the same destination have the same cost, then take the cost from the router to

    the ASBR into consideration.

    Classification of OSPF Networks

    OSPF network types

    OSPF classifies networks into four types upon the link layer protocol:

    Broadcast: When the link layer protocol is Ethernet or FDDI, OSPF considers the networktype broadcast by default. On Broadcast networks, hello packets, LSU packets, and LSAck

    packets are generally sent to multicast addresses 224.0.0.5 (reserved for OSPF routers) and224.0.0.6 (reserved for OSPF DRs), while DD packets and LSR packets are unicast.

    NBMA (Non-Broadcast Multi-Access): When the link layer protocol is Frame Relay, ATMor X.25, OSPF considers the network type as NBMA by default. Packets on these networks aresent to unicast addresses.

    P2MP (point-to-multipoint): By default, OSPF considers no link layer protocol as P2MP,which is a conversion from other network types such as NBMA in general. On P2MP

    networks, packets are sent to multicast addresses (224.0.0.5).

    P2P (point-to-point): When the link layer protocol is PPP or HDLC, OSPF considers thenetwork type as P2P. On P2P networks, packets are sent to multicast addresses (224.0.0.5).

    NBMA network configuration principle:

    Typical NBMA networks are ATM and Frame Relay networks.

    You need to perform some special configuration on NBMA interfaces. Since these interfaces cannot

    broadcast hello packets for neighbor location, you need to specify neighbors manually and

    configure whether the neighbors have the DR election right.

    An NBMA network is fully meshed, which means any two routers in the NBMA network have a

    direct virtual link for communication. If direct connections are not available between some routers,

    the type of interfaces associated should be configured as P2MP, or as P2P for interfaces with only

    one neighbor.

  • 8/7/2019 BSNL document 1.

    36/40

    36

    Differences between NBMA and P2MP networks:

    NBMA networks are fully meshed, non-broadcast and multi access. P2MP networks are notrequired to be fully meshed.

    It is required to elect the DR and BDR on NBMA networks, while DR and BDR are not

    available on P2MP networks.

    NBMA is the default network type, while P2MP is a conversion from other network types,such as NBMA in general.

    On NBMA networks, packets are unicast, and neighbors are configured manually on routers.On P2MP networks, packets are multicast.

    DR and BDR

    DR/BDR introduction:

    On broadcast or NBMA networks, any two routers exchange routing information with each other. If

    n routers are present on a network, n(n-1)/2 adjacencies are required. Any change on a router in the

    network generates traffic for routing information synchronization, consuming network resources.

    The Designated Router is defined to solve the problem. All other routers on the network send

    routing information to the DR, which is responsible for advertising link state information.

    If the DR fails to work, routers on the network have to elect another DR and synchronize

    information with the new DR. It is time-consuming and prone to routing calculation errors. The

    Backup Designated Router (BDR) is introduced to reduce the synchronization period.

    The BDR is elected along with the DR and establishes adjacencies for routing information exchange

    with all other routers. When the DR fails, the BDR will become the new DR in a very short period

    by avoiding adjacency establishment and DR reelection. Meanwhile, other routers elect another

    BDR, which requires a relatively long period but has no influence on routing calculation.

    Other routers, also known as DRothers, establish no adjacency and exchange no routing information

    with each other, thus reducing the number of adjacencies on broadcast and NBMA networks.

    In the following figure, real lines are Ethernet physical links, and dashed lines represent

    adjacencies. With the DR and BDR in the network, only seven adjacencies are enough.

    Figure 7 DR and BDR in a network

  • 8/7/2019 BSNL document 1.

    37/40

    37

    DR/BDR election:

    The DR and BDR in a network are elected by all routers rather than configured manually. The DR

    priority of an interface determines its qualification for DR/BDR election. Interfaces attached to the

    network and having priorities higher than 0 are election candidates.

    The election votes are hello packets. Each router sends the DR elected by itself in a hello packet toall the other routers. If two routers on the network declare themselves as the DR, the router with the

    higher DR priority wins. If DR priorities are the same, the router with the higher router ID wins. Inaddition, a router with the priority 0 cannot become the DR/BDR.

    Note that:

    The DR election is available on broadcast, NBMA interfaces rather than P2P, or P2MPinterfaces.

    A DR is an interface of a router and belongs to a single network segment. The routers otherinterfaces may be a BDR or DRother.

    After DR/BDR election and then a new router joins, it cannot become the DR immediatelyeven if it has the highest priority on the network.

    The DR may not be the router with the highest priority in a network, and the BDR may notbe the router with the second highest priority.

    Shortest Path First Algorithm:

    OSPF uses a shorted path first algorithm in order to build and calculate the shortest path to all known

    destinations.The shortest path is calculated with the use of the Dijkstra algorithm. The algorithm by itself isquite complicated. This is a very high level, simplified way of looking at the various steps of the algorithm:

    1. Upon initialization or due to any change in routing information, a router generates a link-stateadvertisement. This advertisement represents the collection of all link-states on that router.

    2. All routers exchange link-states by means of flooding. Each router that receives a link-state updateshould store a copy in its link-state database and then propagate the update to other routers.

    3. After the database of each router is completed, the router calculates a Shortest Path Tree to all

  • 8/7/2019 BSNL document 1.

    38/40

    38

    destinations. The router uses the Dijkstra algorithm in order to calculate the shortest path tree. Thedestinations, the associated cost and the next hop to reach those destinations form the IP routing table.

    4. In case no changes in the OSPF network occur, such as cost of a link or a network being added ordeleted, OSPF should be very quiet. Any changes that occur are communicated through link-state

    packets, and the Dijkstra algorithm is recalculated in order to find the shortest path.

    The algorithm places each router at the root of a tree and calculates the shortest path to each destinationbased on the cumulative cost required to reach that destination. Each router will have its own view of the

    topology even though all the routers will build a shortest path tree using the same link-state database. Thefollowing sections indicate what is involved in building a shortest path tree.

    OSPF Cost

    The cost (also called metric) of an interface in OSPF is an indication of the overhead required to send

    packets across a certain interface. The cost of an interface is inversely proportional to the bandwidth of that

    interface. A higher bandwidth indicates a lower cost. There is more overhead (higher cost) and time delays

    involved in crossing a 56k serial line than crossing a 10M ethernet line. The formula used to calculate thecost is:

    y cost= 10000 0000/bandwith in bps

    For example, it will cost 10 EXP8/10 EXP7 = 10 to cross a 10M Ethernet line and will cost 10

    EXP8/1544000 = 64 to cross a T1 line.

    By default, the cost of an interface is calculated based on the bandwidth; you can force the cost of aninterface with the ip ospf cost interface subconfiguration mode command.

    Time intervals in OSPF:

    The HelloInterval and RouterDeadInterval are the two timers that you can adjust to speed up network

    convergence in an OSPF network. The HelloInterval determines the interval between sending OSPF Hellomessages on an interface, while the RouterDeadInterval is the interval in which a router must receive an

    OSPF Hello message from a neighbor before it considers that neighbor to be down.

    Cisco IOS assigns a default HelloInterval and RouterDeadInterval to OSPF enabled interfaces. Depending onthe interface type, the HelloInterval will be either 10 seconds or 30 seconds. The RouterDeadInterval will be

    four times the HelloInterval (40 or 120 seconds). A Cisco OSPF-enabled device will maintain a countdown

    timer for each neighbor based on the RouterDeadInterval. Each time receives a Hello message from aneighbor; it will reset this timer to the RouterDeadInterval. If it does not receive a Hello message before thistimer expires, then the neighbor will be set to the OSPF DOWN state.

  • 8/7/2019 BSNL document 1.

    39/40

    39

    CISCO basic setup with the Command Line Interface (CLI):

    Mastering the Cisco Router CLI is essential for more complex configuration tasks and it is the most

    important knowledge you should acquire if you want to become a Cisco network administrator.

    The basic CLI modes that we will be referring below are as following:

    Router Modes

    Router>

    Router#

    Router(config)#

    Router(config-if)#

    Router(config-router)#

  • 8/7/2019 BSNL document 1.

    40/40