Cisco Certified Network Associate CCNA 2

Embed Size (px)

Citation preview

  • 8/9/2019 Cisco Certified Network Associate CCNA 2

    1/16

    Cisco Certified Network Associate CCNA 2.0

    (640-802)

    C. Internetwork IP addressing and Subnetting:

    1. IP addresses are written using decimal numbers separated by decimal points. This is calleddotted decimal notation of expressing IP addresses.The different classes of IP addresses are as below:Class Format Leading Bit pattern Network address Range Maximum networks Maximum hosts/nodesA N.H.H.H 0 0-126 127 16,777,214B N.N.H.H 10 128-191 16,384 65,534C N.N.N.H 110 192 -223 2,097,152 254

    - Network address of all zeros means "This network or segment".- Network address of all 1s means "all networks", same as hexadecimal of all Fs.- Network number 127 is reserved for loop-back tests.- Host (Node) address of all zeros mean "This Host (Node)".

    - Host (Node) address of all 1s mean "all Hosts (Nodes)" on the specified network.

    2. The range of numbers from 224.0.0.0 to 239.255.255.255 is used for multicast packets.This is known as Class D address range.

    3. Subnetting is nothing but creating networks within a network. Subnetting allows anorganization with a single IP address (Class A /Class B /Class C) to have multiple subnetworks,thus allowing several physical networks within the organization.

    4. How to maximize the number of subnets for a given number of hosts:Let us take a network ID of 168.8.0.0, and find the maximum number of possible subnets andthe corresponding subnet mask that can accommodate at least 500 hosts. The steps involvedare outlined below:

    I. Find the Class of the IP address, in this case it is a class B network. Class B network hasthe form N.N.H.H. Therefore, we have a total of 16 bits (two octets) for assigning to internalnetworks and hosts. The minimum number of host addresses required is 500. The last octetcorresponds to 2^8 = 256 hosts which is still less than 500 Hosts. Therefore, you have toborrow one more bit from the third octet to make it 256*2 = 512 Hosts. This leaves 7 bits inthe third octet for assigning subnet addresses. This is equal to 2^7=128 subnets.

    II. Write the 7 bits available for subnetting in third octet in the form 11111110 (last bitbeing the Host bit). The decimal equivalent of the first seven bits is2^7+2^6+2^5+2^4+2^3+2^2+2^1 = 128 + 64 +32 + 16 + 8 + 4 + 2 = 254.

    III. Therefore, the subnet mask required is 255.255.254.0.

    5. How to maximize the number of hosts for a given number of subnets:Determining the subnet mask that allows maximum number of hosts:Let us consider an IP address 196.202.56.0 with four subnets and maximize the number of

    host for the given subnets. The steps involved are as below:I. The number of subnets required are four. We need to add subnets of all ones and all

    zeros to this. This is because all zeros and all ones subnets belong to "this subnet" and "allsubnets" broadcasts and can not be used. Therefore, the total number of subnets to bereserved is 4+2 = 6.

    II. We want to implement maximum possible Hosts. Therefore, we need to minimize thenumber of subnets. This minimum number is 6 here. If we reserve 2 bits, it results in only2^2=4 subnets which is less than 6. Therefore, we have to reserve 3 bits for implementingsubnets, resulting in 2^3=8 subnets. This is now optimized for maximum number of Hosts (aswe have optimized for minimum number of subnets).

  • 8/9/2019 Cisco Certified Network Associate CCNA 2

    2/16

    III. Write the 3 bits available for subnetting in fourth octet in the form 11100000 (Five 0sbeing Host bits). The decimal equivalent is 2^7+2^6+2^5= 128 + 64 +32 = 224.

    IV. Therefore, the subnet mask required is 255.255.255.224.

    6. 127.0.0.1 is the local loop back address.

    7. In an internetwork, the number of distinct IPs' required are1. One each per client computer2. One each per server computer3. One each per router interface

    For example, your network has 2 servers, 26 clients machines, and 2 router interfaces thetotal number of IP addresses required are 30.

    8. Finding the number of Hosts and subnets available for a given subnet mask: For example,let us find the number of hosts and subnets available for an IP 156.233.42.56 with a subnetmask of 7 bits.

    a. Class B network has the form N.N.H.H, the default subnet mask is 16 bits long. There isadditional subnet mask of 7 bits long.

    b. 7 bits of subnet mask corresponds to (2^7-2)=128-2 = 126 subnets.

    c. 9 bits (16-7) of host addresses corresponds to (2^9-2)=512-2 = 510 hosts.Some times, the subnet mask is specified with the bits available in the default subnet mask. Inthis case the bits available in default subnet mask is 16. Therefore, total number of bitsavailable in the subnet mask are 16+7=23. If you are given a subnet mask of 23 bits long fora class B address, it is understood that it contains the bits from the default subnet mask aswell.Hence, 126 subnets and 510 hosts are available.

    9. The directed broadcast should reach all Hosts on the intended network (or subnet, if subnetted). For example, the directed broadcast address for an IP network 196.233.24.15 withdefault subnet mask is 196.233.24.255. This is arrived by putting all 1s for the host potion ofthe IP address.

    10. To find valid hosts given an IP address (say 156.16.3.52) and a subnet mask (sat a 12-bitsubnet). The valid hosts are determined as below:A 12-bit subnet mask gives us 255.255.255.240; 4094 subnets, each with 14 hosts. (Hostaddresses of all zeros and all 1s can't be assigned). The 156.16.3.52 is in the 48 subnetrange. The valid range is through 49 - 62. 63 is a broadcast address.Here is how you get the subnet range:

    1. Find the subnet mask. In this case, default subnet mask for Class B address is255.255.0.0. There are additional; 12 bits in the subnet mask. Now the subnet mask lookslike:11111111.11111111.11111111.11110000. This is equal to 255.255.255.240.0.2. Now, deductthe lowest value octet (Which is non zero), from 256. Here, (256-240) =16.This is the value that the subnets are incremented. Therefore, you will have hosts with valuesfrom:156.16.3.1 to 156.16.3.14 (All 0s and all 1s host addresses can not be used)

    156.16.3.17 to 156.16.3.30156.16.3.33 to 156.16.3.46156.16.3.49 to 156.16.3.62 and so on.It is important to know that subnets are incrementing here by a factor of 16.

    11. VLSM (Variable Length Subnet Masking) allows efficient use of IP addresses. Networksimplemented with VLSM can be summarized more efficiently due to manual control. With adistance vector protocol such as RIP or IGRP, only one subnet mask value can be used on anetwork, as subnet mask values are not sent in routing updates.

  • 8/9/2019 Cisco Certified Network Associate CCNA 2

    3/16

    D. Cisco IOS

    1. Cisco router boot configuration commands:

    1. boot system - This is a global command that allows you to specify the source of the IOSsoftware image to load. If you configure more than one source, attempts are made to load the

    IOS from the first command in the configuration to the last successively. If the first fails, thesecond boot command is used.2. boot system rom - Loads IOS from ROM.3. boot system flash - Loads the first file from flash memory.4. boot system tftp < tftp_address > - Loads IOS with a filename from a TFTP server.

    2. To enable the Cisco IOS to forward packets destined for obscure subnets of directlyconnected networks onto the best route, you use "ip classless" command.

    3. Internal memory components of a Cisco router:

    1. ROM (Read Only Memory): Memory containing micro-code for basic functions to start and

    maintain the router. ROM is not typically used after the IOS is loaded.2. RAM/DRAM : stores the running configuration, routing tables, and packet buffers. Somerouters, such as the 2500 series, run IOS from Flash, not RAM.3. NVRAM (Non-Volatile Ram): Memory that does not lose information when power is lost.Stores the systems configuration file and the configuration register. NVRAM uses a battery tomaintain the data when power is turned off.4. Flash Memory: Stores the compressed IOS (IOS stands for Cisco Internetwork OperatingSystem) image. Flash memory is either EEPROM or PCMCIA card. Flash memory enables youto copy multiple versions of IOS software. This allows you to load a new level of the operatingsystem in every router in your network and then, to upgrade the whole network to thatversion at an appropriate time.

    4. The Cisco router can be configured from many locations.

    1. Console port: During the initial installation, you configure the router from a console terminalconnected to the "Console port" of the router.2. Virtual Terminals (vty): A virtual terminal (vty) is typically accessed through Telnet. Arouter can be accessed through vty after it the initial installation in the network. There are fivevirtual terminals, namely, vty0, vty1, vty2, vty3, vty4.3. Auxiliary Port: you can configure a router through auxiliary port. Typically, a modem is usedto configure the modem through aux port.4. TFTP Server: Configuration information can be downloaded from a TFTP server over thenetwork.5. NMS (Network Management Station): You can also manage router configuration throughNMS such as CiscoWorks or HP OpenView.

    5. Router modes of operation:

    1. User EXEC mode (Prompt: Router>):- This is the LOWEST level of access. This allowsexamination of router status, see routing tables, and do some diagnostics. However, you

    cannot change the router configuration, view the configuration files, or control the router inany way. The prompt in this mode is "Router>".2. Privileged (enable) EXEC mode (Prompt: Router#):- This mode allows you to have all theprivileges of EXEC (user) mode plus commands that enable you to view configuration files,change the router configuration, perform troubleshooting that could potentially disrupt traffic.The default prompt for this mode is "Router#".When you are working in the privileged mode(at # prompt), you can get back to user mode by typing "disable" at the "#" prompt.

  • 8/9/2019 Cisco Certified Network Associate CCNA 2

    4/16

    3. Global Configuration mode (Prompt: Router (Config)#):- Global configuration mode allowsyou to perform tasks that affect the entire router, such as naming the router, configuration ofbanner messages, enabling routed protocols, and generally anything that affects the operationof the entire router.When you first switch on a router, you enter Setup mode. Setup mode is different fromconfiguration mode in that setup mode appears when there is no configuration file present.Upon entering setup mode, you can supply some basic configuration parameters to Cisco

    router.

    6. There are three ways a router learns how to forward a packet:

    1. Static Routes - Configured by the administrator manually. The administrator must alsoupdate the table manually every time a change to the network takes place. Static routes arecommonly used when routing from a network to a stub (a network with a single route)networkThe command isip route network mask address/interface [distance]ex: ip route 165.44.34.0 255.255.255.0 165.44.56.5Here, 165.44.34.0 is the destination network or subnet255.255.255.0 is the subnet mask

    165.44.56.5 is the default gateway2. Default Routes - The default route (gateway of last resort) is used when a route is notknown or is infeasible. The command is

    ip route 0.0.0.0 0.0.0.0 165.44.56.The default gateway is set to 165.44.56.53. Dynamic Routes - In dynamic routing, the routing tables are automatically updated.Dynamic routing uses broadcasts and multicasts to communicate with other routers.The commands to enable rip are:router ripnetwork

    7. The following are some important commands that can be used to edit and review commandhistory buffer on a Cisco router. It will be useful to practice these commands.

    A: Move to the beginning of the command line E: Move to the end of the command line F: Move forward one character, same as using "Right Arrow".

    B: Move backward one character, same as using "Left Arrow". P: Repeat Previous command, same as using "Up Arrow". N: Repeat Next (more recent) command, same as using "Down Arrow". B: Moves to beginning of previous word. F: Moves to beginning of next word.R: Creates new command prompt, followed by all the characters typed at the last one.

    8. There are five different types of passwords:

    1. ENABLE PASSWORD - A global command that restricts access to privileged exec mode. This

    is a non-encrypted password.2. ENABLE SECRET - Assigns a one-way encryptographic secret password, available inversions 10.3 and up. This secret password is used instead of the enable password when itexists.3. Virtual Terminal Password (vty password) - The virtual terminal password is used for Telnetsessions into the router. The password can be changed at any time. It can be set up when youconfigure the router from the console. There can be five distinct passwords corresponding toeach vty (vty0 to vty4) or there can be a single password for all vtys.4. Auxiliary Password - Auxiliary password is used to set password to the auxiliary port. This

  • 8/9/2019 Cisco Certified Network Associate CCNA 2

    5/16

    port is used to access a router through a modem.5. Console Password - Console password is used to set the console port password

    9. The Catalyst IOS software is very similar to a router IOS. IOS image files are stored in theFlash memory on a switch.

    Show running-config [interface / | vlan | module ]:The command displays the contents of the configuration file.Show tech-support: The command is primarily used to send switch information to Cisco TACsupport personnel.Verify flash: - This command is used to verify whether the Flash contents are

    intact, and not corrupted. The checksum of the flashfile specified is verified for correctness.

    10. By default, Cisco routers support 5 simultaneous telnet sessions. This number can beconfigured using IOS commands.

    11. Routers can make alternate route decisions based on ICMP messages, if appropriate.Routers send an ICMP message if the destination is unreachable.ICMP (Internet Message Control Protocol) messages are used for basic error reporting betweenhost to host, or host to gateway. It is not used for error reporting between Gateways. ICMP

    messages are encapsulated using the IP protocol. For example, the command ping usesICMP protocol. In the OSI Reference model, ICMPs are generally considered part of the IPlayer.

    i. CDP

    1. CDP stands for Cisco Discovery Protocol. This protocol is proprietary of Cisco. CDP runsSNAP (Sub network Access Protocol) at the Data Link Layer. Two Cisco devices running twodifferent Network layer protocol can still communicate and learn about each other.

    2. The following are true about CDP:

    1. CDP - Cisco Discovery Protocol is a Cisco proprietary Layer 2 protocol.

    2. CDP uses a multicast packet to the common destination address 01-00-0c-cc-cc.3. CDP packets are sent out with a non zero TTL after an interface is enabled and with a zeroTTL value immediately before and interface is made idle. This enables the neighboring devicesto quickly discover the state of neighbors.4. CDP packets will never be forwarded beyond the directly connected devices. To find CDPinformation on indirectly connected routers, administrators can 'telnet' to the intendeddestination device and run CDP command.

    ii. Router Commands

    1. The following are some frequently used COPY commands:

    1. COPY RUNNING-CONFIGURATION STARTUP-CONFIGURATION (alternatively, you can use anolder version of the command, WRITE MEMORY): This command saves the current

    configuration to NVRAM. Alternatively, we can issue the command using short form: COPYRUNNING STARTUP - Copies configuration from RAM to NVRAM2. COPY STARTUP RUNNING - This command merges configuration from NVRAM to RAM.3. COPY FLASH TFTP - Copies current IOS from router flash memory to TFTP server.4. COPY TFTP FLASH - Copies image file from TFTP server to flash. This is used to upgrade theIOS image file to a newer version, or if your IOS image becomes corrupt.

  • 8/9/2019 Cisco Certified Network Associate CCNA 2

    6/16

    2. SHOW command is extensively used for seeing the status and configuration information ofthe router.Some of the frequently used commands are:

    1. SHOW RUNNING-CONFIGURATION -This command displays the router's active configurationfile, passwords, system name, and interface settings, interfaces IP addresses etc.2. SHOW INTERFACE - Shows status and configuration information of the local interfaces. Thefirst line says something like TokenRing1 is up, line protocol is up. The first part TokenRing1is up describes the physical layer components such as electrical cabling and signaling are OK.The second part line protocol is up means that the router is detecting keep-alive messages.The router may be put into administratively down status, at which point the line would read,

    TokenRing1 is administratively down, line protocol is down.3. SHOW INTERFACE SERIAL 0 - Shows the serial 0 configuration.4. SHOW INTERFACES - Displays statistics for all interfaces configured on the switch.5. SHOW PROCESS - Displays a routers CPU utilization.6. SHOW CONFIG - Displays information on the startup configuration.7. SHOW VERSION - Displays information about the system hardware (RAM/ROM), softwareversion, names of configuration files, and boot-images. This command will also show thecurrent configuration register value.

    3. Show IP protocol: This command will show information on RIP timers including routingupdate timer (30sec default), hold-down timer (default 180sec). It also displays the number ofseconds due for next update (this is fraction of update timer). This command also gives thenetwork number for which IP RIP is enabled, Gateway, and the default metric.

    4. Show IP route: This command will display the IP routing table entries. In addition, itdisplays the Gateway of last resort (if one is assigned). It also displays the codes used forvarious types of routes. Some of the important codes are:C: directly connected;S: Statically connectedI: IGRPR: RIPShow IP interface: This command shows you interface-wise information such as IP addressassigned to each interface, whether the interface is up, MTU etc.

    Debug IP RIP: Debug IP RIP will turn the RIP debugging ON. This will display a continuous listof routing updates as they are sent and received. This leads to lot of overhead, which is thereason that you use "undebug ip rip" to turn-off debugging as soon as you finish with

    debugging.

    5. The banner is displayed whenever anyone logs in to your Cisco router. The syntax is"banner motd # ". MOTD stands for "Message Of The Day".# symbol signifies the start of the banner message to the router. You will be prompted for themessage to be displayed. You need to enter "#" symbol at the end of the message, signifyingthat the message has ended.

    6. Copy running-config startup-config-allows the running configuration file to be saved onto the startup configuration file on theswitch. Make sure that you use this command whenever you have made any configurationchanges to the switch. Otherwise, your configuration command are not permanently saved inthe switch memory, and lost soon after power cycling the switch.

    The command:

    Copy startup-config running-config-allows startup configuration file to be copied into the current running configuration file.Copy running-config tftp:-Copies the running configuration of a switch to a TFTP server. You will be prompted for theserver address and destination filename.

  • 8/9/2019 Cisco Certified Network Associate CCNA 2

    7/16

    Copy tftp: startup-config-This command is useful to restore the startup-config file incase the original is lost or corrupt.The command loads the startup-config file from a remote tftp server.

    IP Addressing

    Previous Next

    An IP (Internet Protocol) address is a unique identifier for a node or host

    connection on an IP network. An IP address is a 32 bit binary number usually

    represented as 4 decimal values, each representing 8 bits, in the range 0 to 255

    (known as octets) separated by decimal points. This is known as "dotted

    decimal" notation.

    Example: 140.179.220.200

    It is sometimes useful to view the values in their binary form.

    140 .179 .220 .200

    10001100.10110011.11011100.11001000

    Every IP address consists of two parts, one identifying the network and one

    identifying the node. The Class of the address and the subnet mask determine

    which part belongs to the network address and which part belongs to the node

    address.

    Address Classes

    There are 5 different address classes. You can determine which class any IP

    address is in by examining the first 4 bits of the IP address.

    Class A addresses begin with 0xxx, or1 to 126 decimal.

    Class B addresses begin with 10xx, or128 to 191 decimal.

    Class C addresses begin with 110x, or192 to 223 decimal.

    Class D addresses begin with 1110, or224 to 239 decimal.

    Class E addresses begin with 1111, or240 to 254 decimal.

    Addresses beginning with 01111111, or127 decimal, are reserved for loopback

    and for internal testing on a local machine; [You can test this: you should

    always be able to ping 127.0.0.1, which points to yourself] Class D addresses

    are reserved for multicasting; Class E addresses are reserved for future use.

    They should not be used for host addresses.

    http://www.ralphb.net/IPSubnet/intro.htmlhttp://www.ralphb.net/IPSubnet/subnet.htmlhttp://www.ralphb.net/IPSubnet/index.htmlhttp://www.ralphb.net/IPSubnet/intro.htmlhttp://www.ralphb.net/IPSubnet/subnet.html
  • 8/9/2019 Cisco Certified Network Associate CCNA 2

    8/16

    Now we can see how the Class determines, by default, which part of the IP

    address belongs to the network (N, inblue) and which part belongs to the node

    (n, inred).

    Class A --NNNNNNNN.nnnnnnnn.nnnnnnnn.nnnnnnnn

    Class B --NNNNNNNN.NNNNNNNN.nnnnnnnn.nnnnnnnn Class C --NNNNNNNN.NNNNNNNN.NNNNNNNN.nnnnnnnn

    In the example, 140.179.220.200 is a Class B address so by default the

    Network part of the address (also known as theNetwork Address) is defined by

    the first two octets (140.179.x.x) and the node part is defined by the last 2

    octets (x.x.220.200).

    In order to specify the network address for a given IP address, the node section

    is set to all "0"s. In our example, 140.179.0.0 specifies the network address for

    140.179.220.200. When the node section is set to all "1"s, it specifies abroadcast that is sent to all hosts on the network. 140.179.255.255 specifies the

    example broadcast address. Note that this is true regardless of the length of the

    node section.

    Private Subnets

    There are three IP network addresses reserved for private networks. The

    addresses are 10.0.0.0, Subnet Mask 255.0.0.0, 172.16.0.0, Subnet Mask

    255.240.0.0, and 192.168.0.0, Subnet Mask 255.255.0.0. These addresses are

    also notated 10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16; this notation will be

    explained later in this tutorial. They can be used by anyone setting up internal

    IP networks, such as a lab or home LAN behind a NAT or proxy server or a

    router. It is always safe to use these because routers on the Internet by default

    will never forward packets coming from these addresses. These addresses are

    defined in RFC 1918.

    Previous Next

    Updated January 29, 2007

    Copyright 1996-2007 byRalph Becker< [email protected] > send

    meFeedback!

    Subnetting

    Previous Next

    http://www.faqs.org/rfcs/rfc1918.htmlhttp://www.ralphb.net/IPSubnet/intro.htmlhttp://www.ralphb.net/IPSubnet/subnet.htmlhttp://www.ralphb.net/IPSubnet/index.html#Copyrighthttp://www.ralphb.net/index.htmlmailto:[email protected]://www.ralphb.net/form.htmlhttp://www.ralphb.net/IPSubnet/ipaddr.htmlhttp://www.ralphb.net/IPSubnet/restr.htmlhttp://www.ralphb.net/IPSubnet/index.htmlhttp://www.ralphb.net/IPSubnet/index.htmlhttp://www.faqs.org/rfcs/rfc1918.htmlhttp://www.ralphb.net/IPSubnet/intro.htmlhttp://www.ralphb.net/IPSubnet/subnet.htmlhttp://www.ralphb.net/IPSubnet/index.html#Copyrighthttp://www.ralphb.net/index.htmlmailto:[email protected]://www.ralphb.net/form.htmlhttp://www.ralphb.net/IPSubnet/ipaddr.htmlhttp://www.ralphb.net/IPSubnet/restr.html
  • 8/9/2019 Cisco Certified Network Associate CCNA 2

    9/16

    Subnetting an IP Network can be done for a variety of reasons, including

    organization, use of different physical media (such as Ethernet, FDDI, WAN,

    etc.), preservation of address space, and security. The most common reason is

    to control network traffic. In an Ethernet network, all nodes on a segment see

    all the packets transmitted by all the other nodes on that segment. Performance

    can be adversely affected under heavy traffic loads, due to collisions and the

    resulting retransmissions. A router is used to connect IP networks to minimize

    the amount of traffic each segment must receive.

    Subnet Masking

    Applying a subnet mask to an IP address allows you to identify the network and

    node parts of the address. The network bits are represented by the 1s in the

    mask, and the node bits are represented by the 0s. Performing a bitwise logical

    AND operation between the IP address and the subnet mask results in

    theNetwork Address or Number.For example, using our test IP address and the default Class B subnet mask, we

    get:

    10001100.10110011.11110000.11001000 140.179.240.200 Class B IP

    Address

    11111111.11111111.00000000.00000000 255.255.000.000 Default

    Class B Subnet Mask

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

    10001100.10110011.00000000.00000000 140.179.000.000 Network

    Address

    Default subnet masks:

    Class A - 255.0.0.0 - 11111111.00000000.00000000.00000000

    Class B - 255.255.0.0 - 11111111.11111111.00000000.00000000

    Class C - 255.255.255.0 - 11111111.11111111.11111111.00000000

    Previous Next

    Updated January 29, 2007Copyright 1996-2007 byRalph Becker< [email protected] > send

    meFeedback!

    More Restrictive Subnet Masks

    http://www.ralphb.net/IPSubnet/logical.htmlhttp://www.ralphb.net/IPSubnet/logical.htmlhttp://www.ralphb.net/IPSubnet/ipaddr.htmlhttp://www.ralphb.net/IPSubnet/restr.htmlhttp://www.ralphb.net/IPSubnet/index.html#Copyrighthttp://www.ralphb.net/index.htmlmailto:[email protected]://www.ralphb.net/form.htmlhttp://www.ralphb.net/IPSubnet/index.htmlhttp://www.ralphb.net/IPSubnet/logical.htmlhttp://www.ralphb.net/IPSubnet/logical.htmlhttp://www.ralphb.net/IPSubnet/ipaddr.htmlhttp://www.ralphb.net/IPSubnet/restr.htmlhttp://www.ralphb.net/IPSubnet/index.html#Copyrighthttp://www.ralphb.net/index.htmlmailto:[email protected]://www.ralphb.net/form.html
  • 8/9/2019 Cisco Certified Network Associate CCNA 2

    10/16

    Previous Next

    Additional bits can be added to the default subnet mask for a given Class to

    further subnet, or break down, a network. When a bitwise logical

    AND operation is performed between the subnet mask and IP address, theresult defines the Subnet Address (also called theNetwork Address orNetworkNumber). There are some restrictions on the subnet address. Node addresses of

    all "0"s and all "1"s are reserved for specifying the local network (when a host

    does not know its network address) and all hosts on the network (broadcast

    address), respectively. This also applies to subnets. A subnet address cannot be

    all "0"s or all "1"s. This also implies that a 1 bit subnet mask is not allowed.

    This restriction is required because older standards enforced this restriction.

    Recent standards that allow use of these subnets have superseded these

    standards, but many "legacy" devices do not support the newer standards. If

    you are operating in a controlled environment, such as a lab, you can safely usethese restricted subnets.

    To calculate the number of subnets or nodes, use the formula (2n-2) where n =

    number of bits in either field, and 2n represents 2 raised to the nth power.

    Multiplying the number of subnets by the number of nodes available per subnet

    gives you the total number of nodes available for your class and subnet mask.

    Also, note that although subnet masks with non-contiguous mask bits are

    allowed, they are not recommended.

    Example:

    10001100.10110011.11011100.11001000 140.179.220.200 IP Address

    11111111.11111111.11100000.00000000 255.255.224.000 Subnet Mask

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

    10001100.10110011.11000000.00000000 140.179.192.000 Subnet

    Address

    10001100.10110011.11011111.11111111 140.179.223.255 Broadcast

    Address

    In this example a 3 bit subnet maskwas used. There are 6 (23-2) subnets

    available with this size mask (remember that subnets with all 0's and all 1's are

    not allowed). Each subnet has 8190 (213

    -2) nodes. Each subnet can have nodesassigned to any address between the Subnet address and the Broadcast address.

    This gives a total of 49,140 nodes for the entire class B address subnetted this

    way. Notice that this is less than the 65,534 nodes an unsubnetted class B

    address would have.

    http://www.ralphb.net/IPSubnet/subnet.htmlhttp://www.ralphb.net/IPSubnet/example.htmlhttp://www.ralphb.net/IPSubnet/logical.htmlhttp://www.ralphb.net/IPSubnet/logical.htmlhttp://www.ralphb.net/IPSubnet/index.htmlhttp://www.ralphb.net/IPSubnet/subnet.htmlhttp://www.ralphb.net/IPSubnet/example.htmlhttp://www.ralphb.net/IPSubnet/logical.htmlhttp://www.ralphb.net/IPSubnet/logical.html
  • 8/9/2019 Cisco Certified Network Associate CCNA 2

    11/16

    You can calculate the Subnet Address by performing a bitwise logical

    AND operation between the IP address and the subnet mask, then setting all the

    host bits to0s. Similarly, you can calculate theBroadcast Address for a subnetby performing the same logical AND between the IP address and the subnet

    mask, then setting all the host bits to 1s. That is how these numbers are derived

    in the example above.

    Subnetting always reduces the number of possible nodes for a given network.

    There are complete subnet tables available here forClass A, Class B and Class

    C. These tables list all the possible subnet masks for each class, along with

    calculations of the number of networks, nodes and total hosts for each subnet.

    Previous Next

    Updated January 31, 2007 .Copyright 1996-2007 byRalph Becker< [email protected] > send

    meFeedback!

    An Example

    Previous Next

    Here is another, more detailed, example. Say you are assigned a Class C

    network number of 200.133.175.0 (apologies to anyone who may actually ownthis domain address). You want to utilize this network across multiple small

    groups within an organization. You can do this by subnetting that network with

    a subnet address.

    We will break this network into 14 subnets of 14 nodes each. This will limit us

    to 196 nodes on the network instead of the 254 we would have without

    subnetting, but gives us the advantages of traffic isolation and security. To

    accomplish this, we need to use a subnet mask 4 bits long.

    Recall that the default Class C subnet mask is

    255.255.255.0 (11111111.11111111.11111111.00000000 binary)

    Extending this by 4 bits yields a mask of255.255.255.240 (11111111.11111111.11111111.11110000 binary)

    This gives us 16 possible network numbers, 2 of which cannot be used:

    Subnet bits Network Number Node Addresses Broadcast Address

    0000 200.133.175.0 Reserved None

    http://www.ralphb.net/IPSubnet/logical.htmlhttp://www.ralphb.net/IPSubnet/logical.htmlhttp://www.ralphb.net/IPSubnet/logical.htmlhttp://www.ralphb.net/IPSubnet/class_a.htmlhttp://www.ralphb.net/IPSubnet/class_b.htmlhttp://www.ralphb.net/IPSubnet/class_c.htmlhttp://www.ralphb.net/IPSubnet/class_c.htmlhttp://www.ralphb.net/IPSubnet/subnet.htmlhttp://www.ralphb.net/IPSubnet/example.htmlhttp://www.ralphb.net/IPSubnet/index.html#Copyrighthttp://www.ralphb.net/index.htmlmailto:[email protected]://www.ralphb.net/form.htmlhttp://www.ralphb.net/IPSubnet/restr.htmlhttp://www.ralphb.net/IPSubnet/cidr.htmlhttp://www.ralphb.net/IPSubnet/index.htmlhttp://www.ralphb.net/IPSubnet/index.htmlhttp://www.ralphb.net/IPSubnet/logical.htmlhttp://www.ralphb.net/IPSubnet/logical.htmlhttp://www.ralphb.net/IPSubnet/logical.htmlhttp://www.ralphb.net/IPSubnet/class_a.htmlhttp://www.ralphb.net/IPSubnet/class_b.htmlhttp://www.ralphb.net/IPSubnet/class_c.htmlhttp://www.ralphb.net/IPSubnet/class_c.htmlhttp://www.ralphb.net/IPSubnet/subnet.htmlhttp://www.ralphb.net/IPSubnet/example.htmlhttp://www.ralphb.net/IPSubnet/index.html#Copyrighthttp://www.ralphb.net/index.htmlmailto:[email protected]://www.ralphb.net/form.htmlhttp://www.ralphb.net/IPSubnet/restr.htmlhttp://www.ralphb.net/IPSubnet/cidr.html
  • 8/9/2019 Cisco Certified Network Associate CCNA 2

    12/16

    0001 200.133.175.16 .17 thru .30 200.133.175.31

    0010 200.133.175.32 .33 thru .46 200.133.175.47

    0011 200.133.175.48 .49 thru .62 200.133.175.63

    0100 200.133.175.64 .65 thru .78 200.133.175.79

    0101 200.133.175.80 .81 thru .94 200.133.175.95

    0110 200.133.175.96 .97 thru .110 200.133.175.111

    0111 200.133.175.112 .113 thru .126 200.133.175.127

    1000 200.133.175.128 .129 thru .142 200.133.175.143

    1001 200.133.175.144 .145 thru .158 200.133.175.159

    1010 200.133.175.160 .161 thru .174 200.133.175.175

    1011 200.133.175.176 .177 thru .190 200.133.175.191

    1100 200.133.175.192 .193 thru .206 200.133.175.207

    1101 200.133.175.208 .209 thru .222 200.133.175.223

    1110 200.133.175.224 .225 thru .238 200.133.175.239

    1111 200.133.175.240 Reserved None

    Previous NextUpdated January 29, 2007Copyright 1996-2007 byRalph Becker< [email protected] > send

    meFeedback!

    CIDR -- Classless InterDomain Routing

    Previous Next

    Now that you understand "classful" IP Subnetting principals, you can forgetthem ;). The reason is CIDR-- Classless InterDomain Routing. CIDR was

    invented several years ago to keep the internet from running out of IP

    addresses. The "classful" system of allocating IP addresses can be very

    wasteful; anyone who could reasonably show a need for more that 254 host

    addresses was given a Class B address block of 65533 host addresses. Even

    more wasteful were companies and organizations that were allocated Class A

    http://www.ralphb.net/IPSubnet/restr.htmlhttp://www.ralphb.net/IPSubnet/cidr.htmlhttp://www.ralphb.net/IPSubnet/index.html#Copyrighthttp://www.ralphb.net/index.htmlmailto:[email protected]://www.ralphb.net/form.htmlhttp://www.ralphb.net/IPSubnet/example.htmlhttp://www.ralphb.net/IPSubnet/class_a.htmlhttp://www.ralphb.net/IPSubnet/index.htmlhttp://www.ralphb.net/IPSubnet/index.htmlhttp://www.ralphb.net/IPSubnet/restr.htmlhttp://www.ralphb.net/IPSubnet/cidr.htmlhttp://www.ralphb.net/IPSubnet/index.html#Copyrighthttp://www.ralphb.net/index.htmlmailto:[email protected]://www.ralphb.net/form.htmlhttp://www.ralphb.net/IPSubnet/example.htmlhttp://www.ralphb.net/IPSubnet/class_a.html
  • 8/9/2019 Cisco Certified Network Associate CCNA 2

    13/16

    address blocks, which contain over 16 Million host addresses! Only a tiny

    percentage of the allocated Class A and Class B address space has ever been

    actually assigned to a host computer on the Internet.

    People realized that addresses could be conserved if the class system was

    eliminated. By accurately allocating only the amount of address space that wasactually needed, the address space crisis could be avoided for many years. This

    was first proposed in 1992 as a scheme called Supernetting. Under

    supernetting, the classful subnet masks are extended so that a network address

    and subnet mask could, for example, specify multiple Class C subnets with one

    address. For example, If I needed about 1000 addresses, I could supernet 4

    Class C networks together:

    192.60.128.0 (11000000.00111100.10000000.00000000) Class C subnet

    address

    192.60.129.0 (11000000.00111100.10000001.00000000) Class C subnet

    address

    192.60.130.0 (11000000.00111100.10000010.00000000) Class C subnet

    address

    192.60.131.0 (11000000.00111100.10000011.00000000) Class C subnet

    address

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

    192.60.128.0 (11000000.00111100.10000000.00000000) Supernetted

    Subnet address

    255.255.252.0 (11111111.11111111.11111100.00000000) Subnet Mask

    192.60.131.255 (11000000.00111100.10000011.11111111) Broadcast address

    In this example, the subnet 192.60.128.0 includes all the addresses from

    192.60.128.0 to 192.60.131.255. As you can see in the binary representation of

    the subnet mask, the Network portion of the address is 22 bits long, and thehost portion is 10 bits long.

    Under CIDR, the subnet mask notation is reduced to a simplified shorthand.

    Instead of spelling out the bits of the subnet mask, it is simply listed as the

    number of 1s bits that start the mask. In the above example, instead of writing

    the address and subnet mask as

    192.60.128.0, Subnet Mask 255.255.252.0

    the network address would be written simply as:192.60.128.0/22

    which indicates starting address of the network, and number of 1s bits (22) in

    the network portion of the address. If you look at the subnet mask in binary

    (11111111.11111111.11111100.00000000), you can easily see how this

    notation works.

  • 8/9/2019 Cisco Certified Network Associate CCNA 2

    14/16

    The use of a CIDR notated address is the same as for a Classful address.

    Classful addresses can easily be written in CIDR notation (Class A = /8, Class

    B = /16, and Class C = /24)

    It is currently almost impossible for an individual or company to be allocated

    their own IP address blocks. You will simply be told to get them from yourISP. The reason for this is the ever-growing size of the internet routing table.

    Just 10 years ago, there were less than 5000 network routes in the entire

    Internet. Today, there are over 100,000. Using CIDR, the biggest ISPs are

    allocated large chunks of address space (usually with a subnet mask of /19 or

    even smaller); the ISP's customers (often other, smaller ISPs) are then allocated

    networks from the big ISP's pool. That way, all the big ISP's customers (and

    their customers, and so on) are accessible via 1 network route on the Internet.

    But I digress.

    It is expected that CIDR will keep the Internet happily in IP addresses for thenext few years at least. After that, IPv6, with 128 bit addresses, will be needed.

    Under IPv6, even sloppy address allocation would comfortably allow a billion

    unique IP addresses for every person on earth! The complete and gory details

    of CIDR are documented in RFC1519, which was released in September of

    1993.

    Previous Next

    Updated January 29, 2007

    Copyright 1996-2007 byRalph Becker< [email protected] > sendmeFeedback!

    Allowed Class A Subnet and Host IP addresses

    Previous Next

    # bits Subnet Mask CIDR # Subnets # Hosts Nets * Hosts

    2 255.192.0.0 /10 2 4194302 8388604

    3 255.224.0.0 /11 6 2097150 12582900

    4 255.240.0.0 /12 14 1048574 14680036

    5 255.248.0.0 /13 30 524286 15728580

    http://www.faqs.org/rfcs/rfc1519.htmlhttp://www.ralphb.net/IPSubnet/example.htmlhttp://www.ralphb.net/IPSubnet/class_a.htmlhttp://www.ralphb.net/IPSubnet/index.html#Copyrighthttp://www.ralphb.net/index.htmlmailto:[email protected]://www.ralphb.net/form.htmlhttp://www.ralphb.net/IPSubnet/cidr.htmlhttp://www.ralphb.net/IPSubnet/class_b.htmlhttp://www.ralphb.net/IPSubnet/index.htmlhttp://www.ralphb.net/IPSubnet/index.htmlhttp://www.faqs.org/rfcs/rfc1519.htmlhttp://www.ralphb.net/IPSubnet/example.htmlhttp://www.ralphb.net/IPSubnet/class_a.htmlhttp://www.ralphb.net/IPSubnet/index.html#Copyrighthttp://www.ralphb.net/index.htmlmailto:[email protected]://www.ralphb.net/form.htmlhttp://www.ralphb.net/IPSubnet/cidr.htmlhttp://www.ralphb.net/IPSubnet/class_b.html
  • 8/9/2019 Cisco Certified Network Associate CCNA 2

    15/16

    6 255.252.0.0 /14 62 262142 16252804

    7 255.254.0.0 /15 126 131070 16514820

    8 255.255.0.0 /16 254 65534 16645636

    9 255.255.128.0 /17 510 32766 16710660

    10 255.255.192.0 /18 1022 16382 16742404

    11 255.255.224.0 /19 2046 8190 16756740

    12 255.255.240.0 /20 4094 4094 16760836

    13 255.255.248.0 /21 8190 2046 16756740

    14 255.255.252.0 /22 16382 1022 16742404

    15 255.255.254.0 /23 32766 510 16710660

    16 255.255.255.0 /24 65534 254 16645636

    17 255.255.255.128 /25 131070 126 16514820

    18 255.255.255.192 /26 262142 62 16252804

    19 255.255.255.224 /27 524286 30 15728580

    20 255.255.255.240 /28 1048574 14 14680036

    21 255.255.255.248 /29 2097150 6 12582900

    22 255.255.255.252 /30 4194302 2 8388604

    Previous Next

    Updated January 25, 2007 .Copyright 1996-2007 byRalph Becker< [email protected] > send

    meFeedback!

    Logical Operations

    Previous Next

    This page will provide a brief review and explanation of the common logical

    bitwise operations AND, OR, XOR (Exclusive OR) and NOT. Logical

    operations are performed between two data bits (except for NOT). Bits can be

    either "1" or "0", and these operations are essential to performing digital math

    operations.

    In the "truth tables" below, the input bits are in bold, and the results are plain.

    http://www.ralphb.net/IPSubnet/cidr.htmlhttp://www.ralphb.net/IPSubnet/class_b.htmlhttp://www.ralphb.net/IPSubnet/index.html#Copyrighthttp://www.ralphb.net/index.htmlmailto:[email protected]://www.ralphb.net/form.htmlhttp://www.ralphb.net/IPSubnet/class_c.htmlhttp://www.ralphb.net/IPSubnet/refs.htmlhttp://www.ralphb.net/IPSubnet/index.htmlhttp://www.ralphb.net/IPSubnet/index.htmlhttp://www.ralphb.net/IPSubnet/cidr.htmlhttp://www.ralphb.net/IPSubnet/class_b.htmlhttp://www.ralphb.net/IPSubnet/index.html#Copyrighthttp://www.ralphb.net/index.htmlmailto:[email protected]://www.ralphb.net/form.htmlhttp://www.ralphb.net/IPSubnet/class_c.htmlhttp://www.ralphb.net/IPSubnet/refs.html
  • 8/9/2019 Cisco Certified Network Associate CCNA 2

    16/16

    AND

    The logical AND operation compares 2 bits and if they are both "1", then the

    result is "1", otherwise, the result is "0".

    0 1

    0 0 01 0 1

    OR

    The logical OR operation compares 2 bits and if either or both bits are "1", then

    the result is "1", otherwise, the result is "0".

    0 1

    0 0 1

    1 1 1

    XOR

    The logical XOR (Exclusive OR) operation compares 2 bits and if exactly one

    of them is "1" (i.e., if they are different values), then the result is "1"; otherwise

    (if the bits are the same), the result is "0".

    0 1

    0 0 1

    1 1 0

    NOT

    The logical NOT operation simply changes the value of a single bit. If it is a

    "1", the result is "0"; if it is a "0", the result is "1". Note that this operation is

    different in that instead of comparing two bits, it is acting on a single bit.

    0 1

    1 0

    Previous Next

    Updated January 25, 2007Copyright 1996-2007 byRalph Becker< [email protected] > send

    meFeedback!

    http://www.ralphb.net/IPSubnet/class_c.htmlhttp://www.ralphb.net/IPSubnet/refs.htmlhttp://www.ralphb.net/IPSubnet/index.html#Copyrighthttp://www.ralphb.net/index.htmlmailto:[email protected]://www.ralphb.net/form.htmlhttp://www.ralphb.net/IPSubnet/index.htmlhttp://www.ralphb.net/IPSubnet/class_c.htmlhttp://www.ralphb.net/IPSubnet/refs.htmlhttp://www.ralphb.net/IPSubnet/index.html#Copyrighthttp://www.ralphb.net/index.htmlmailto:[email protected]://www.ralphb.net/form.html