Sunteți pe pagina 1din 197

WHY DO I NEED A STANDARD ?

Many types of connection media : telephone lines, optical fibers, cables, radios, etc. Many different types of machines and operating systems Many different network applications
need for a STANDARD in communication technology:

I S O

WHAT STANDARD MEANS ?


Agreements must be at many levels ... How many volts pulse is a 0 and 1 ? How to determine the end of a message ? How to handle lost messages ? How many bits for different data types ? Integers/Strings, etc.; are ASCII chars ? How machines are identified ? How to find the way to reach a machine ? How applications speaks together through the network ?

OSI Model
The International Organization for Standardization (ISO) developed the Open Systems Interconnection (OSI) reference model in 1977 an finally 1983. It has since become the most widely accepted model for understanding network communication.

OSI Model
The OSI model attempts to define rules that apply to the following issues:
How network devices connect and communicate each other even their languages are different at the same time how it makes a connection between the each device. The methods is used for which device on a network knows when the data to be transmitted and when the data not to be transmitted . Methods to ensure that network transmissions are received correctly and by the right recipient How the physical transmission media are arranged and connected How to ensure that network devices maintain a proper rate of data flow How bits are represented on the network media The OSI model does not work or perform any particular functions in the communications process but the actual work is done by the SW and HW.

OSI Model
It also defines which tasks need to be done and which protocols will handle those tasks each of the seven layers. It divides the tasks into several subtasks. The subtasks will be fulfilled by the specific protocols at the specific layer of the OSI model. Protocol stack is also possible i.e when protocols are grouped together to complete a task Each layer of the OSI model has a different protocols are with it. When more than one protocol is need to complete a task, that time the protocols are grouped e.g TCP/IP

Protocols
The network consists of many other computing platforms running on different version, different Operating System and Application software. So that the network cannot find out which computer has which operating system and AS, So that the common languages is needed to understand each other in different computer. Thats why the common languages are made, That languages is called protocol. It is a standard ser of instructions and procedures according to communication take place. Through this protocol the computer agreed upon ways that computers exchange information. There are two types

Hardware Protocols
Hardware protocols define how hardware devices operate and work together. The 10baseT Ethernet protocol is a hardware protocol specifying exactly how two 10baseT Ethernet devices will exchange information and what they will do if it is improperly transmitted or interrupted. It determines such things as voltage levels and which pairs of wires will be used for transmission and reception. There is no program involved; it is all done with circuitry.

Software Protocol
Programs communicate with each other via software protocols. Network client computers and network servers both have protocol packages that must be loaded to allow them to talk to other computers. These packages contain the protocols the computer needs to access a certain network device or service.

How protocols work


A protocol is a set of basic steps that both parties (or computers) must perform in the right order. For instance, for one computer to send a message to another computer, the first computer must perform the following steps. Break the data into small sections called packets. Add addressing information to the packets identifying the destination computer. Deliver the data to the network card for transmission over the network. The receiving computer must perform the same steps, but in reverse order: Accept the data from the network adapter card. Remove the transmitting information that was added by the transmitting computer. Reassemble the packets of data into the original message.

contd

How protocols work


Each computer needs to perform the same steps the same way so that the data will arrive and reassemble properly. If one computer uses a protocol with different steps or even the same steps with different parameters (such as different sequencing, timing, or error correction), the two computers will not be able to communicate with each other.

Network Packets
Networks primarily send and receive the small chunks of data called packets. Network protocols at various levels of the OSI model construct, modify, and disassemble packets as they move data down the sending stack, across the network, and back up the OSI stack of the receiving computer.

Packet Structure
Packets have the following components:
A source address specifying the sending computer A destination address Instructions that tell the computer how to pass the data along Reassembly information for when the packet is part of a longer message The data to be transmitted to the remote computer Error-checking information to ensure that the data arrives intact.

Packet Structure
The components are combined into three sections:
Header: A typical header includes an alert signal to indicate that the data is being transmitted, source and destination addresses, and clock information to synchronize the transmission. Data: The actual data being sent. This can vary (depending on the network type) from 48 bytes to 4K. Trailer: The contents of the trailer (or even the existence of a trailer) varies among network types, but it typically includes a Cyclic Redundancy Check (CRC). The CRC helps the network determine whether a packet has been damaged in transmission.

CRC
Cyclical redundancy check
An error detection mechanism in which a computer performs a calculation on a data sample with a specific algorithm, and then transmits the data and the results of the calculation to another computer. The receiving computer then performs the same calculation and compares its results to those supplied by the sender. If the results match, the data has been transmitted successfully. If the results do not match, the data has been damaged in transit.

Message route
When the data is transmitting between two computer that time the data is traveling from visible screen (Application Layer) to cable (Physical Layer) there are divided into seven steps and vice-versa In receiving side.

At each layer, the data packages, called service data units, are made up of data and headers from the layers above. For this reason they are commonly referred to by different names when they are at different layers.

OSI Model Layers

Layer - 7

Application

Andhra Upper Layer or Pradesh Software Layer State Heart of OSI Transprot Not Lower Layer or Down Hardware Layer

Layer - 6
Layer - 5

Presentation
Session

Layer - 4
Layer - 3 Layer - 2

Transport
Network Data Link

Layer - 1

Physical

Passenger

Application Layer
The application layer is the topmost layer of the OSI model, and it provides services that directly support user applications, such as database access, e-mail, and file transfers. It also allows applications to communicate with applications on other computers as though they were on the same computer. When a programmer writes an application program that uses network services, this is the layer the application program will access.
Application Layer is responsible for providing Networking Services to user. It also known as Desktop Layer. Identification of Services is done using Port Numbers. Ports are nothing but Socket i.e. Entry and Exit Point to the Layer Total No. Ports Reserved Ports Open Ports 0 65535 0 1023 1024 65535

Application Application Presentation Session Transport Network Data Link Physical

Example of HTTP request


http://www.google.com

Client

Web Server

Example of HTTP request

HTTP Request Received HTTP Reply http:// www.google.com http://www.google.com Webpage

HTTP Request Listen on Port 80 Sending HTTP Reply Webpage

Client

Web Server

Example of FTP request


ftp://ftp.microsoft.com

Client

FTP Server

Example of FTP request

FTP Request Received FTP Reply ftp://ftp.microsoft.com ftp://ftp.microsoft.com

FTP Request Listen on Port 21 Sending FTP Reply

Client

FTP Server

Examples of Networking Services Service Port No.

HTTP

80

FTP
SMTP

21
25

TELNET
TFTP

23
69

How data flows from Application Layer

Application
80 21 25 53 67 69

Data

Presentation Session Transport

Network
Data Link Physical

Presentation Layer The presentation layer translates data between the formats the network requires and the formats the computer expects. The presentation layer does protocol conversion, data translation, compression and encryption, character set conversion, and the interpretation of graphics commands. The network redirector operates at this level. The network redirector is what makes the files on a file server visible to the client computer. The network redirector also makes remote printers act as though they are attached to the local computer.
Presentation Layer is responsible for converting data into standard format. Examples : ASCII, EBCDIC, JPEG, MPEG, BMP, MIDI, WAV, MP3 Following tasks are perform at Presentation layer : Encoding Decoding Encryption Decryption Compression Decompression

Application Presentation Presentation Session Transport Network Data Link Physical

How data flows from Presentation Layer

Application Presentation Session Transport

Data Data

Network
Data Link Physical

Session Layer

Application Presentation Session Session Transport Network Data Link Physical

The session layer allows applications on separate computers to share a connection called a session. This layer provides services such as name lookup and security to allow two programs to find each other and establish the communications link. The session layer also provides for data synchronization and checkpointing so that in the event of a network failure, only the data sent after the point of failure need be re-sent. This layer also controls the dialog between two processes, determining who can transmit and who can receive at what point during the communication. Session Layer is responsible establishing, maintaining and terminating session. Session ID also works at Session Layer. Examples : RPC Remote Procedure Call SQL Structured Query language NFS Network File System

How data flows from Session Layer

Application Presentation Session Transport

Data Data Data

Network
Data Link Physical

Transport Layer

Application Presentation Session Transport Transport Network Data Link Physical

The transport layer ensures that packets are delivered error free, in sequence, and with no losses or duplications. The transport layer breaks large messages from the session layer (which well look at next) into packets to be sent to the destination computer and reassembles packets into messages to be presented to the session layer. The transport layer typically sends an acknowledgment to the originator for messages received. Figure shows how the transport layer operates. Transport Layer is responsible for end-to-end connectivity. It is also known as heart of OSI Layers. Following task are performed at Transport Layer : Identifying Service Multiplexing & De-multiplexing Segmentation Sequencing & Reassembling

Flow Control
Error Correction

Identifying Service

TCP

UDP

Transmission Control Protocol Connection Oriented Acknowledgement Reliable Slower Port No. 6 e.g. HTTP, FTP, SMTP

User Datagram Protocol Connection Less No Acknowledgement Unreliable Faster Port No. 17 e.g. DNS, DHCP, TFTP

Multiplexing & De-multiplexing

Application Presentation Session


80 21 25 53 67 69

Transport
TCP - 6 UDP - 17

Network Data Link Physical

Segmentation

Hello! How are you ?

Hello! How are you ? Hello! How Are You ?

Sequencing & Reassembling

Hello! How are you ?

Hello! How How are ? you ? You Hello! Are You Hello! Hello! How How Are ? You

you Hello! How ? are Are ?

Sequencing & Reassembling

Hello! How are you ? Hello! How are you ? Hello! Are You How
1/5 2/5 3/5 4/5

5/5

Hello! How are ? you ?

You
4/5

Hello!
1/5

How
2/5

5/5

Are
3/5

Error Correction

Segment Missing Hello! How are you ? Hello! How are you ? Hello! How Are You
1/5 2/5 3/5 4/5

5/5

Hello! How are ? you ?

You
4/5

Hello!
1/5

How
2/5

5/5

Are
3/5

Flow Control - Windowing

Ack-Rec-3 Sending Ack. 3Sending window Received-4 5-window

PC-A 34can send 4 Segment Received at window a time to PC-B

How data flows from Transport Layer

Application Presentation Session Transport

Data Data Data THSegment Data

Network
Data Link Physical

Network Layer

Application Presentation Session Transport Network Network Data Link Physical

Network Layer is responsible for providing best path to data to reach destination. Logical Addressing sits on this layer. Device working on Network Layer is Router. It is divided into two parts Routed Protocols e.g. IP, IPX, Apple Talk. Routing Protocols e.g. RIP, IGRP, OSPF, EIGRP

Network Layer
The network layer makes routing decisions and forwards packets for devices that are farther away than a single link. In larger networks there may be intermediate systems between any two end systems, and the network layer makes it possible for the transport layer and layers above it to send packets without being concerned about whether the end system is immediately adjacent or several hops away. The network layer translates logical network addresses into physical machine addresses. This layer also determines the quality of service (such as the priority of the message) and the route a message will take if there are several ways a message can get to its destination. The network layer also may break large packets into smaller chunks if the packet is larger than the largest data frame the data link layer will accept. The network reassembles the chunks into packets at the receiving end.

Intermediate systems that perform only routing and relaying functions and do not provide an environment for executing user programs can implement just the first three OSI network layers. The network layer moves packets across multiple links in a network.

Network Layer

Network Layer
The network layer performs several important functions that enable data to arrive at its destination. The protocols at this layer may choose a specific route through an internetwork to avoid the excess traffic caused by sending data over networks and segments that dont need access to it. Routers and gateways operate in the network layer. The network layer serves to support communications between logically separate networks. This layer is concerned with the following: Addressing, including logical network addresses and services addresses Circuit, message, and packet switching Route discovery and route selection Connection services, including network layer flow control, network layer error control, and packet sequence control Gateway services

Routed Protocols

Segment

Hello! How are you ?

Source IP 192.168.1.1 Destination Segment IP 192.168.1.2

Hello! How are you ?

192.168.1.1

192.168.1.2

Routing Protocols

www.zoomgroup.com

How data flows from Network Layer

Application Presentation Session e.g. Router Transport

Data Data Data Segment NH Packet Segment

Network
Data Link Physical

Datalink Layer

Application Presentation Session Transport Network Data Data Link Link Physical

Datalink Layer is two Sub Layers :

divided into

LLC Logical Link Control It talks about Wan protocols e.g. PPP, HDLC, Frame-relay

MAC Media Access Control It talks about Physical Address. It is 48 bit Addressing i.e. 12 digit Hexadecimal No. It is also responsible for Error Detection Device working on Data Link Layer is Switch, Bridge, NIC.

Data Link Layer The data link layer provides for the flow of data over a
single link from one device to another. It accepts packets from the network layer and packages the information into data units called frames to be presented to the physical layer for transmission. It adds control information, such as frame type, routing, and segmentation information, to the data being sent. This layer provides for the error-free transfer of frames from one computer to another. A Cyclic Redundancy Check (CRC) added to the data frame can detect damaged frames, and the data link layer in the receiving computer can request that the information be retransmitted. The data link layer can also detect when frames are lost and request that those frames be sent again.

Data Link Layer


The data link layer recognizes frames for which the destination ID matches the computer and discards other packets. the data link layer establishes an error-free connection between two devices. Bridges, intelligent hubs, and network interface cards are devices typically associated with the data link layer.

LLC & MAC


Data Link Layer is further split into two sub-layers: Logical Link Control (LLC), which establishes and maintains links between the communicating devices
Manages the traffic over the physical medium by identifying a protocol. Assigns sequence numbers to frames and tracks acknowledgement. Manages amount of data sent to a particular device
Sliding window method Does not send ack for each frame instead sends for a group of frames Stop and wait method Data frames are sent until the time the memory of destination device is utilised completely (no ack sent)

Media Access Control (MAC), which controls the way multiple devices share the same media channel
The media access control sub-layer, provides for shared access to the network adapter and communicates directly with network interface cards. The MAC addresses are used to establish the logical link between computers on the same LAN.

Error Detection CRC Check

Hello! How are you ?

PC-A CRC No. 33333 PC-B Source MAC 00-20-18-C0-07-71 CRC No. 11114 Error 33333 11114 46323 99434 43434 99323 55434 89696 22222 32434 00000 Detected Destination MAC Packet Error Detected 00-20-18-C0-07-72
For Error Correction Contact Source Transport layer

Packet

192.168.1.1 00-20-18-C0-07-71

192.168.1.2 00-20-18-C0-07-72

Error Detection CRC Check

Packet

Source MAC 00-20-18-C0-07-71 Destination Packet MAC 00-20-18-C0-07-72

Hello! How are you ?

20202 11114 46323 99434 43434 99323 55434 89696 22222 32434 00000

192.168.1.1 00-20-18-C0-07-71

192.168.1.2 00-20-18-C0-07-72

How data flows from Data Link Layer

Application Presentation Session Transport e.g. Switch

Data Data Data Segment Packet Packet DT DH Frame

Network
Data Link Physical

Physical Layer

Application Presentation Session Transport Network Data Link Physical Physical

Physical Layer is responsible for electrical, mechanical or procedural checks. Data will be converted in Binary that is 0s & 1s. Data will be in the form of electrical pulses if it is Coaxial or Twisted Pair cable and in the form of Light if it is Fiber Optic Cable. Devices working at Physical Layer are Hubs, Repeaters, Cables, Modems etc.

Physical Layer
In case of LAN, the physical layer specifications are directly related to the data link layer protocols used by the network e.g. Ethernet (IEEE 802.3) is a data link layer protocol based on the Carrier Sense Multiple Access with Collision Detection (CSMA/CD) Media Access Control(MAC) mechanism and supports a variety of physical layer options
Co-axial cable Unshielded twisted pair cable (UTP) Fiber optic cable

Physical Layer
The physical layer requirements
Exact type of cable Type of connectors Length of cable Number of hubs and many other factors

These specific conditions are required for the protocol to function properly. If the cable segment that is too long can prevent an Ethernet system from detecting packet collisions. When the system cant detect errors it cant correct them and the data is lost.

Physical Layer
The physical layer defines the nature of the networks hardware elements such as
What medium the network uses. How the network is installed The nature of the signals used to transmit binary data over the network. What kind of network interface adapter must be installed on each computer. Kinds of hubs to use

Physical Layer
Other communication element found at physical layer is the particular type of signaling used to transmit data over the network medium For
Copper based cables Fiber optic cables Wireless media - electrical signals - pulses of light - radio freq - infrared pulses

In addition to the physical nature of the signals, the physical layer dictates the signaling scheme that the computer uses.

Signaling Scheme
The signaling scheme is the pattern of electrical charges or light pulses used to encode the binary data generated by upper layers. Ethernet systems use Manchester encoding Token Ring systems use Differential Manchester encoding

The physical layer is simply responsible for sending bits (1s and 0s) from one computer to another. The physical layer is not concerned with the meaning of the bits; instead it deals with the physical connection to the network and with transmission and reception of signals. Passive hubs, simple active hubs, terminators, couplers, cables and cabling, connectors,repeaters, multiplexers, transmitters, receivers, and transceivers are devices associated with the physical layer.

Physical Layer

Physical Layer
The following items are addressed at the physical layer: Network connection types, including multipoint and point-to-point connections Physical topologies, which are physical layouts of networks, such as bus, star, or ring Analog and digital signaling, which include several methods for encoding data in analog and digital signals Bit synchronization, which deals with synchronization between sender and receiver Baseband and broadband transmissions, which are different methods for using media bandwidth Multiplexing, which involves combining several data channels into one Termination, which prevents signals from reflecting back through the cable and causing signal and packets errors. It also indicates the last node in a network segment.

The Ethernet Frame


PREAMBLE Start of frame delimiter Destination Address Source Address Length of Data

7 Bytes. Alternating 0s and 1s to synchronize the clock 1 Bytes. 6 bits of Alternating 0s and 1s followed by two of communicating systems consecutive 1s which is a signal to the receiver that the transmission of actual frame is about to begin. 6 Bytes. Hexadecimal address of NIC on the local network to which the packet will be transmitted
6 Bytes. Hexadecimal address of NIC of the system generating the packet 2 Bytes. Specifies the length of the data field (excluding the pad) 46 to 1500 Bytes.

Data & Pad

4 Bytes. Checksum value for the entire packet

Frame check sequence (CRC)

Assembling Packets
Each layer of the OSI model adds some information to the packet. The information at each level is meant to be read by the OSI layer at the same level in the destination computer. For example, information added at the network layer of one computer will be read by the network layer of the next computer. Figure shows how information added at each layer is read by the corresponding layer on the next computer.

Protocol Stack

A protocol stack is a group of protocols arranged on top of each other as part of a communication process. Each layer of the OSI model has different protocols associated with it. When more than one protocol is needed to complete a communication process, the protocols are grouped together in a stack. Each layer in the protocol stack receives services from the layer below it and provides services to the layer above it. For two computers to communicate, the same protocol stacks must be running on each computer. Each layer of the protocol stack on one computer communicates with its equivalent, or peer, on the other computer.

The computers can have different operating systems and still be able to communicate if they are running the same protocol stacks. For example, a DOS machine running TCP/IP can communicate with a Macintosh machine running TCP/IP. This is illustrated in Fig

Protocol Stack

Physical Layer Example

Frame

Hello! How are you ?


1010101010101010
Frame

0101011010101010101010101 1010101101010101010101010 0101011010101010101010101

How data flows from Physical Layer

Application Presentation Session Transport

Data Data Data Segment Packet Frame Bits

Network
e.g. Hub Data Link Physical

Data Encapsulation & De-capsulation

A
Application
Data Data

B
Application

Presentation
Session Transport Network Data Link Physical

Data

Data

Presentation
Session TH Transport NetworkNH

Data

Data Segment Data TH Segment NHPacket Packet DH Packet DT Frame Bits

TH Data Segment
Segment NHPacket Packet DH Frame DT Bits

DH DT Data Link
Physical

Comparing OSI with TCP/IP Layers

OSI Layers Application Presentation

TCP/IP Layers

Application

Session
Transport Network Transport Internet Network Access

Data Link
Physical

TCP/IP Layers
The TCP/IP protocol reduces the number of layers and as a result puts a larger burden on the application layer. On the other hand, TCP/IP provides a model which is closer to an efficient protocol implementation for high speed networking.

The Physical Layer similar to OSI model.


The Network Access Layer similar to data link layer and some of the network layer functionality of the OSI model.

The Internet Layer (IP) routing and providing end-to-end service for the higher layers.

IP Addressing

IP Addressing is Logical Addressing It works on Network Layer (Layer 3) Two Version of Addressing Scheme

IP version 4 32 bit addressing


IP version 6 128 bit addressing

IP version 4

What is BIT ?

Bit is a value that will represent 0s or 1s (i.e. Binary)

01010101000001011011111100000001
32 bits are divided into 4 Octets known as Dotted Decimal Notation First Octet Second Octet Third Octet Forth Octet

01010101. 00000101. 10111111. 00000001

IP version 6

128-bit address is divided along 16-bit boundaries, and each 16-bit

block is converted to a 4-digit hexadecimal number and separated


by colons (Colon-Hex Notation)

FEDC:BA98:7654:3210:FEDC:BA98:7654:3210
This discussion is out of the scope of our subject it is implemented in USA and other countries

Binary to Decimal Conversion

Taking Example for First Octet : Total 8 bits, Value will be 0s and 1s i.e. 28 = 256 combination 27 26 25 24 23 22 21 20 0 0 0 0 0 0 0 0 = 0 0 0 0 0 0 0 0 1 = 1 0 0 0 0 0 0 1 0 = 2 0 0 0 0 0 0 1 1 = 3 0 0 0 0 0 1 0 0 = 4

Total IP Address Range

0.0.0.0 to 255.255.255.255

= 255

IP Address Classes

Total IP Addressing Scheme is divided into 5 Classes CLASS A CLASS B CLASS C CLASS D LAN & WAN

Multicasting & Newsgroups


CLASS E Research & Development

Priority Bits Concept

To identify the range of each class we will be using Priority Bit Concept Priority Bit is the left most bits in the First Octet CLASS A priority bit is CLASS B priority bit is CLASS C priority bit is CLASS D priority bit is 0 10 110 1110

CLASS E priority bit is

1111

CLASS A Range

For Class A range reserved first bit in first octet,the value of that bit should not change.

0xxxxxxx. xxxxxxxx. xxxxxxxx. xxxxxxxx


27 0 0 0 0 0 26 0 0 0 0 0 25 0 0 0 0 0 24 0 0 0 0 0 23 0 0 0 0 0 22 0 0 0 0 1 21 0 0 1 1 0 20 0 1 0 1 0 = = = = = 0 1 2 3 4 Class A Range

0 . 0 . 0 . 0 to 127.255.255.255
Exception 0.X.X.X and 127.X.X.X network are reserved

= 127

CLASS B Range

For Class B range reserved first two bit in first octet,the value of that bit should not change.

10xxxxxx. xxxxxxxx. xxxxxxxx. xxxxxxxx


27 1 1 1 1 1 26 0 0 0 0 0 25 0 0 0 0 0 24 0 0 0 0 0 23 0 0 0 0 0 22 0 0 0 0 1 21 0 0 1 1 0 20 0 1 0 1 0 = = = = = 128 129 130 131 132

Class B Range

128. 0 . 0 . 0 to 191.255.255.255

= 191

CLASS C Range

For Class C range reserved first three bit in first octet,the value of that bit should not change.

110xxxxx. xxxxxxxx. xxxxxxxx. xxxxxxxx


27 1 1 1 1 1 26 1 1 1 1 1 25 0 0 0 0 0 24 0 0 0 0 0 23 0 0 0 0 0 22 0 0 0 0 1 21 0 0 1 1 0 20 0 1 0 1 0 = = = = = 192 193 194 195 196

Class C Range

192. 0 . 0 . 0 to 223.255.255.255

= 223

CLASS D Range

For Class D range reserved first four bit in first octet,the value of that bit should not change.

1110xxxx. xxxxxxxx. xxxxxxxx. xxxxxxxx


27 1 1 1 1 1 26 1 1 1 1 1 25 1 1 1 1 1 24 0 0 0 0 0 23 0 0 0 0 0 22 0 0 0 0 1 21 0 0 1 1 0 20 0 1 0 1 0 = = = = = 224 225 226 227 228

Class D Range

224. 0 . 0 . 0 to 239.255.255.255

= 239

CLASS E Range

For Class E range reserved first four bit in first octet,the value of that bit should not change.

1111xxxx. xxxxxxxx. xxxxxxxx. xxxxxxxx


27 1 1 1 1 1 26 1 1 1 1 1 25 1 1 1 1 1 24 1 1 1 1 1 23 0 0 0 0 0 22 0 0 0 0 1 21 0 0 1 1 0 20 0 1 0 1 0 = = = = = 240 241 242 243 244

Class E Range

240. 0 . 0 . 0 to 255.255.255.255

1 1

= 255

Octet Format

IP address is divided into Network & Host Portion CLASS A is written as CLASS B is written as

N.H.H.H
N.N.H.H

CLASS C is written as

N.N.N.H

CLASS A No. Networks & Host

Class A Octet Format is N.H.H.H Network bits : 8 No. = = = = No. = = = Host bits : 24

of Networks 28-1 (-1 is Priority Bit for Class A) 27 128 2 (-2 is for 0 & 127 Network) 126 Networks

CLASS A

126 Networks

& of Host 16777214 Hosts/Nw 224 2 (-2 is for Network ID & Broadcast ID) 16777216 - 2 16777214 Hosts/Network

CLASS B No. Networks & Host

Class B Octet Format is N.N.H.H Network bits : 16 No. = = = Host bits : 16

of Networks 216-2 (-2 is Priority Bit for Class B) 214 16384 Networks

CLASS B

No. = = =

of Host & 216 2 (-2 is for Network ID & Broadcast ID) 65534 Hosts/Nw 65536 - 2 65534 Hosts/Network

16384 Networks

CLASS C No. Networks & Host

Class C Octet Format is N.N.N.H Network bits : 24 No. = = = Host bits : 8

of Networks 224-3 (-3 is Priority Bit for Class C) 221 2097152 Networks

CLASS C

No. = = =

of Host 28 2 (-2 is for Network ID & Broadcast ID) 254 256 - 2 254 Hosts/Network

2097152 Networks
&

Hosts/Nw

Example - Class A

Class A : N.H.H.H Network Address : 0xxxxxxx.00000000.00000000.00000000 Broadcast Address : 0xxxxxxx.11111111.11111111.11111111

Class A
10.0.0.0 10.0.0.1 10.0.0.2 10.0.0.3 Network Address

Valid IP Addresses 10.255.255.254 10.255.255.255

Broadcast Address

Example - Class B Class B : N.N.H.H Network Address :

10xxxxxx.xxxxxxxx.00000000.00000000 Broadcast Address : 10xxxxxx.xxxxxxxx.11111111.11111111

Class B
172.16.0.0 172.16.0.1 172.16.0.2 172.16.0.3 Network Address

Valid IP Addresses 172.16.255.254 172.16.255.255

Broadcast Address

Example - Class C

Class C : N.N.N.H Network Address : 110xxxxx.xxxxxxxx.xxxxxxxx.00000000 Broadcast Address : 110xxxxx.xxxxxxxx.xxxxxxxx.11111111

Class C
192.168.1.0 192.168.1.1 192.168.1.2 192.168.1.3 Network Address

Valid IP Addresses 192.168.1.254 192.168.1.255

Broadcast Address

Private IP Address

There are certain addresses in each class of IP address that are reserved for LAN. These addresses are called private addresses. They can be used for: home & office networks, ATM machines, networks not connected to Internet.
Class A

10.0.0.0 to 10.255.255.255
Class B

172.16.0.0 to 172.31.255.255
Class C

192.168.0.0 to 192.168.255.255

Network & Broadcast Address

The first address is in each class is known as network address and the last address is known as broadcast address. The network address is represented with all bits as ZERO in the host portion of the address The broadcast address is represented with all bits as ONES in the host portion of the address (Another network) Valid IP Addresses lie between the Network Address and the Broadcast Address. Only Valid IP Addresses are assigned to hosts/clients

Subnet Mask

Subnet mask is 32 bit identifier views by the devices to differentiate NW bits and host bits of given class IP address. In subnet mask NW nits are represented with binary ones and host bits are represented with binary zero Subnet Mask differentiates Network portion and Host Portion Subnet Mask is been given for host Identification of Network ID Represent all Network Bit Values with 1 Represent all Host Bit Values with 0 In a same network means in a same class IP address there is no problem so the source machine will check whether it is in same network. The sender machine is searching it is in same domain.

Subnet Mask - Examples

Class A : N.H.H.H 11111111.00000000.00000000.00000000 Default Subnet Mask for Class A is 255.0.0.0 Class B : N.N.H.H 11111111.11111111.00000000.00000000 Default Subnet Mask for Class B is 255.255.0.0 Class C : N.N.N.H 11111111.11111111.11111111.00000000 Default Subnet Mask for Class C is 255.255.255.0

How Subnet Mask Works ?

How the system finds N/W address and Broad cost address IP Address Subnet Mask : : 192.168.1.1 255.255.255.0

192.168.1.1 = 11000000.10101000.00000001.00000001 255.255.255.0 = 11111111.11111111.11111111.00000000 AND TABLE ======================================= A B 192.168.1.0 = 11000000.10101000.00000001.00000000 0 0 =======================================

0 1 Above Calculations is done with the Help of AND Table. 1 0 The output of an AND table is only 1 if both its inputs are 1. 1 1 For all other possible inputs the output is 0.

C 0 0 0 1

IP Subnetting

In our MCEME there are four faculties and each faculty has a own domain but these domain is coming under our CS Dept domain. Therefore the nw is increasing but the host will decrease in each subnet. Subnet is used to do not waste the IP address in internet. It is Designed by IETF (Internet Engineering Task Force) Dividing a Single Network into Multiple Networks. Converting Host bits to Network Bits i.e. Converting 0s into 1s

Main Aim of Subnetting

Problem with the previous Scenario is :-

Instead of 20 machine Broadcasting, you doing broadcasting for 254 machine, Loss of bandwidth.
More Wasting of IP addresses (Approximately 1000) Security There are two types Subnetting is also called as FLSM (Fixed Length Subnet Masking) Subnetting is also called as VLSM (Variable Length Subnet masking) Subnetting can be done in three ways. Requirement of Network Requirement of Host Cisco / Notation

Scenario

MCEME is having 100 PC


Which Class IP addresses you will using in the network ? Answer : Class C.

In MCEME we have Five Departments with 20 Pcs each


MCEME 192.168.1.0/24

FEL, CS FEL, CE FEME AE

192.168.1.1

to 192.168.1.20

192.168.1.21 to 192.168.1.40 192.168.1.41 to 192.168.1.60

FIET
FAE

192.168.1.61 to 192.168.1.80
192.168.1.81 to 192.168.1.100

Scenario (continued)

Administrator Requirement Inter-department communication should not be possible ?


Solution. Allocate a different Network to each Department i.e. FELCS 192.168.1.1 to 192.168.1.20

FEL CE
FEEM AED FIET FAE

192.168.2.1
192.168.3.1 192.168.4.1 192.168.5.1

to 192.168.2.20
to 192.168.3.20 to 192.168.4.20 to 192.168.5.20

In the above Scenario inter-department communication is not possible.

Power table

POWER TABLE 21 = 2 22 = 4 23 = 8 24 = 16 25 = 32 26 = 64 29 = 512 210 = 1024 211 = 2048 212 = 4096 213 = 8192 214 = 16384 217 = 131072 218 = 262144 219 = 524288 220 = 1048576 221 = 2097152 222 = 4194304 225 = 33554432 226 = 67108864 227 = 134217728 228 = 268435456 229 = 536870912 230 = 1073741824

27 = 128
28 = 256

215 = 32768
216 = 65536

223 = 8388608
224 = 16777216

231 = 2147483648
232 = 4294967296

Subnetting Formula IP Address is 192.168.1.0 Subnet Mask is 255.255.255.0 This is a Class C Address so : N.N.N.H (24 Bits are NW & 8 are Host) 110xxxxx.xxxxxxxx.xxxxxxxx.xxxxxxxx First we have to deicide how many subnet domain are required Eg : 6 subnet domain are required.

How will you find out that how many bites are reduced in host address? There are some formula
2n

2> = requirement

n = number of bits is to be borrowed from host portion to nw portion.


2n

2> = 6

Subnetting Formula

Now assuming two bits reducing it is sufficient or not?


22 2 = 6 42 =6 2=6 (this is not tally means this is not sufficient) 23 2>= 6 8 2 >= 6 6=6 (this is not tally means this is not sufficient) n=3

Example 1 6 subnet are required

IP Address is 192.168.1.0 Subnet Mask is 255.255.255.0 This is a Class C Address so : N.N.N.H (24 Bits are NW & 8 are Host) 110xxxxx.xxxxxxxx.xxxxxxxx.xxxxxxxx 192. 168. 1. 0 11000000.10111000.00000001.00000000 23 2>= 6 8 2 >= 6 6=6 (this is not tally means this is not sufficient) n=3

Example 1 6 subnet are required

Therefore we have to reduce 3 bits from host bits (only from right to left when we are reducing the host bit based on subnet) 110xxxxx.xxxxxxxx.xxxxxxxx.xxxxxxxx 192. 168. 1. 0 11000000.10111000.00000001. 00000000

Network address 192.168.1 (24 Bit)

Host address 00000000 (8 Bit)

Network address 192.168.1 (24 Bit)

Subnet 0 0 0 (3 bit)

Host 0 0 0 0 0 (5Bit)

Network address 192.168.1 (27 Bit)

Host 0 0 0 0 0 (5Bit)

Network 192.168.1 192.168.1 192.168.1 192.168.1

Subnet 0 0 0 0 0 1 0 1 0 0 1 1

Host 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

Host = 192.168.1.0 = This is not valid = 192.168.1.32 = 192.168.1.64 = 192.168.1.96 is used 6 sub net

192.168.1
192.168.1 192.168.1 192.168.1

1 0 0
1 0 1 1 1 0 1 1 1

0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

= 192.168.1.128
= 192.168.1.160 = 192.168.1.192 = 192.168.1.224 this is also not valid

192.168.1.0 = 192.168.1.0 This is first domain so this is not valid 192.168.1.1 192.168.1.2 to Valid subnet 192.168.1.30 192.168.1.31 this is broad cost address. 192.168.1.32 = 192.168.1.32 This is first domain so this is not valid 192.168.1.33 192.168.1.34 to Valid subnet 192.168.1.62 192.168.1.63 this is broad cost address. Remaining is also same procedure When we change the subnet therefore the subnet mask is also change because the nw bits are 27 and host bits are 5. Now we have to change the subnet mask as per our configuration. So this is called customized subnet masking.

This is defualt 192.168.1.1 11000000.10101000.00000001.00000001 This is class C address so 24 bits are nw and 8 bits are host The rules is Nw bits are one and host bits are zero in subnet mask. 255.255.255.0 11111111.11111111.11111111.00000000 Customized subnet mask 192.168.1.0 11000000.10101000.00000001.00000000 Subnet Mask here we took 3 bits from host bits so that now the nw bits are 27 and host bits are 5

11111111.11111111.11111111.11100000 255 . 255 . 255. 224 IP Address is 192.168.1.0 Subnet Mask is 255.255.255.224 This is same for all of 6 subnets.

Example 1

Class C : 192.168.1.0 110xxxxx.xxxxxxxx.xxxxxxxx.xxxxxxxx No. of Subnet = 2n 2 = 22 2 = 42 = 2 Subnet

No. = = = =

of Host 2h 2 (-2 is for Network ID & Broadcast ID) 26 2 64 2 62 Hosts/Subnet

HELP

Example 2 (Continued)

Customize Subnet = 2 Host Bits to Network Bits If you Mask convert 255. 255. 192 2 Subnet &255. 62 Hosts/Subnet 11111111. 11111111. 11111111. 11000000 Customize Subnet Mask 255.255.255.192

Range of Networks Subnet Network ID Broadcast ID Range 192.168.1.64 to 192.168.1.127 192.168.1.0 192.168.1.63 x 192.168.1.128 to 192.168.1.191 192.168.1.64 192.168.1.127 192.168.1.128 192.168.1.192 192.168.1.191 192.168.1.255

Valid Subnets

Example 3 (Continued)

Customize Subnet = 5 Host Bits to Network Bits If you Mask convert 255. 255. 248 30 Subnet 255. & 6 Hosts/Subnet 11111111. 11111111. 11111111. 11111000 Customize Subnet Mask 255.255.255.248

Range of Networks Subnet Network ID Broadcast ID Range 192.168.1.8 to 192.168.1.15 192.168.1.0 192.168.1.7 x 192.168.1.16 to 192.168.1.23 192.168.1.8 192.168.1.15 192.168.1.24 to 192.168.1.31 192.168.1.16 192.168.1.23 192.168.1.32 to 192.168.1.39 192.168.1.24 192.168.1.31 Valid Subnets 192.168.1.240 to 192.168.1.247 192.168.1.240 192.168.1.247 192.168.1.248 192.168.1.255 x

Example 4

Class C : N.N.N.H 110xxxxx.xxxxxxxx.xxxxxxxx.xxxxxxxx Class C : 192.168.1.0 No. = = = = No. = = = = of Subnet 2n 2 26 2 64 2 62 Subnet of Host 2h 2 (-2 is for Network ID & Broadcast ID) 22 2 42 2 Hosts/Subnet

HELP

Example 4 (Continued)

Customize Subnet = 6 Host Bits to Network Bits If you Mask convert 255. 255. 252 62 Subnet 255. & 2 Hosts/Subnet 11111111. 11111111. 11111111. 11111100 Customize Subnet Mask 255.255.255.252

Range of Networks Subnet Network ID Broadcast ID Range 192.168.1.4 to 192.168.1.7 192.168.1.0 192.168.1.3 x 192.168.1.8 to 192.168.1.11 192.168.1.4 192.168.1.7 192.168.1.12 to 192.168.1.15 192.168.1.8 192.168.1.11 192.168.1.16 to 192.168.1.19 192.168.1.12 192.168.1.15 Valid Subnets 192.168.1.248 to 192.168.1.251 192.168.1.248 192.168.1.251 192.168.1.252 192.168.1.255 x

Example 5

Class C : N.N.N.H 110xxxxx.xxxxxxxx.xxxxxxxx.xxxxxxxx Class C : 192.168.1.0 No. = = = = of Subnet 2n 2 27 2 128 2 126 Subnet

No. of Host = 2h 2 (-2 is for Network ID & Broadcast ID) = 21 2 = 2 2 = 0 Hosts/Subnet In this case, You are not getting any host when you convert 7 host bit to network bit.
HELP

Example 6

Class C : N.N.N.H 110xxxxx.xxxxxxxx.xxxxxxxx.xxxxxxxx Class C : 192.168.1.0 No. = = = = of Subnet 2n 2 28 2 256 2 254 Subnet

No. of Host = 2h 2 (-2 is for Network ID & Broadcast ID) = 20 2 = 0 2 = -2 Hosts/Subnet In this case, You are not getting any host when you convert 8 host bit to network bit.
HELP

Requirement of Hosts is 40 ? Example 1 Class C : N.N.N.H 110xxxxx.xxxxxxxx.xxxxxxxx.xxxxxxxx Class C : 192.168.1.0 No. of Host = 2h 2 Req. of Host = 26 2 40 (-2 is for Network ID & Broadcast ID) = 64 2 = 62 Hosts/Subnet No. of Subnet = = = = 2n 2 (-2 is for First & Last Subnet Range) 22 2 42 2 Subnet

HELP

Example 2 (Continued)

Customize Subnet Mask = 255. 255. 11111111. 11111111.

255. 11111111.

252 11111100

Range of Networks Network ID 192.168.1.0 192.168.1.4 192.168.1.8 192.168.1.12

Broadcast ID 192.168.1.3 192.168.1.7 192.168.1.11 192.168.1.15

Valid Subnets

192.168.1.248 192.168.1.252

192.168.1.251 192.168.1.255

Cisco / Notation Example 1 Class C : N.N.N.H 110xxxxx.xxxxxxxx.xxxxxxxx.xxxxxxxx Class C : 192.168.1.0/29

Extra Network Bits = 29 24 = 5


Put n value = 5 No. = = = = No. = = = = of Subnet 2n 2 25 2 (-2 is for First & Last Subnet Range) 32 2 30 Subnet of Host 2h 2 (-2 is for Network ID & Broadcast ID) 23 2 82 6 Hosts/Subnet
HELP

Example 1 (Continued)

Customize Subnet = 5 Host Bits to Network Bits If you Mask convert 255. 255. 248 30 Subnet 255. & 6 Hosts/Subnet 11111111. 11111111. 11111111. 11111000 Customize Subnet Mask 255.255.255.248

Range of Networks Subnet Network ID Broadcast ID Range 192.168.1.8 to 192.168.1.15 192.168.1.0 192.168.1.7 x 192.168.1.16 to 192.168.1.23 192.168.1.8 192.168.1.15 192.168.1.24 to 192.168.1.31 192.168.1.16 192.168.1.23 192.168.1.32 to 192.168.1.39 192.168.1.24 192.168.1.31 Valid Subnets 192.168.1.240 to 192.168.1.247 192.168.1.240 192.168.1.247 192.168.1.248 192.168.1.255 x

Cisco / Notation Example 2 Class C : N.N.N.H 110xxxxx.xxxxxxxx.xxxxxxxx.xxxxxxxx Class C : 192.168.1.0/28

Extra Network Bits = 28 24 = 4


Put n value = 4 No. = = = = No. = = = = of Subnet 2n 2 24 2 (-2 is for First & Last Subnet Range) 16 2 14 Subnet of Host 2h 2 (-2 is for Network ID & Broadcast ID) 24 2 16 2 14 Hosts/Subnet
HELP

Example 2 (Continued)

Customize Subnet = 4 Host Bits to Network Bits If you Mask convert 255. 255. 255. 240 14 Subnet & 14 Hosts/Subnet 11111111. 11111111. 11111111. 11110000 Customize Subnet Mask 255.255.255.240

Range of Networks Subnet Network ID Broadcast ID Range 192.168.1.16 to 192.168.1.31 192.168.1.0 192.168.1.15 x 192.168.1.32 to 192.168.1.47 192.168.1.16 192.168.1.31 192.168.1.48 to 192.168.1.63 192.168.1.32 192.168.1.47 192.168.1.64 to 192.168.1.80 192.168.1.48 192.168.1.63 Valid Subnets 192.168.1.224 to 192.168.1.239 192.168.1.224 192.168.1.239 192.168.1.240 192.168.1.255 x

Requirement of Networks is 2 ? Example 1 Class B : N.N.H.H 10xxxxxx.xxxxxxxx.xxxxxxxx.xxxxxxxx Class B : 172.16.0.0 No. = = = = No. = = = = of Subnet 2n 2 Req. of Subnet 22 2 2 (-2 is for First & Last Subnet Range) 42 2 Subnet of Host 2h 2 (-2 is for Network ID & Broadcast ID) 214 2 16384 2 16382 Hosts/Subnet

HELP

Example 1 (Continued)

Customize Subnet = 2 Host Bits to Network Bits If you Mask convert 255. 255. 192. Hosts/Subnet 0 2 Subnet & 16382 11111111. 11111111. 11000000. 00000000 Customize Subnet Mask 255.255.192.0

Range of Networks Subnet Network ID Broadcast ID Range 172.16.64.0 to 172.16.127.255 172.16.0.0 172.16.63.255 x 172.16.128.0 to 172.16.191.255 172.16.64.0 172.16.127.255 172.16.128.0 172.16.192.0 172.16.191.255 192.168.1.255

Valid Subnets

Requirement of Hosts is 126 ? Example 2 Class B : N.N.H.H 10xxxxxx.xxxxxxxx.xxxxxxxx.xxxxxxxx Class B : 172.16.0.0 No. of Host = 2h 2 Req. of Host = 27 2 126 (-2 is for Network ID & Broadcast ID) = 128 2 = 126 Hosts/Subnet No. of Subnet = = = = 2n 29 512 510 2 (-2 is for First & Last Subnet Range) 2 2 Subnet

HELP

Example 2 (Continued)

Customize Subnet = 9 Host Bits to Network Bits If you Mask convert 255. 255. 255. 128 510 Subnet & 126 Hosts/Subnet 11111111. 11111111. 11111111. 10000000 Customize Subnet Mask 255.255.255.128

Range of Networks Subnet Network ID Broadcast ID Range 172.16.0.128 to 172.16.0.255 172.16.0.0 172.16.0.127 x 172.16.1.0 to 172.16.1.127 172.16.0.128 172.16.0.255 172.16.1.128 to 172.16.1.255 172.16.1.0 172.16.1.127 172.16.2.0 to 172.16.2.127 172.16.1.128 172.16.1.255 Valid Subnets 172.16.255.0 to 172.16.255.127 172.16.255.127 172.16.255.255 x

172.16.255.0 172.16.255.128

Cisco / Notation Example 3 Class B : N.N.H.H 10xxxxxx.xxxxxxxx.xxxxxxxx.xxxxxxxx Class B : 172.16.0.0/22

Extra Network Bits = 22 16 = 6


Put n value = 6 No. = = = = No. = = = = of Subnet 2n 2 26 2 (-2 is for First & Last Subnet Range) 64 2 62 Subnet of Host 2h 2 (-2 is for Network ID & Broadcast ID) 210 2 1024 2 1022 Hosts/Subnet
HELP

Example 3 (Continued)

Customize Subnet = 6 Host Bits to Network Bits If you Mask convert 255. 255. 0 62 Subnet & 252. 1022 Hosts/Subnet 11111111. 11111111. 11111100. 00000000 Customize Subnet Mask 255.255.252.0

Range of Networks Subnet Network ID Broadcast ID Range 172.16.4.0 to 172.16.7.255 172.16.0.0 172.16.3.255 x 172.16.8.0 to 172.16.11.255 172.16.4.0 172.16.7.255 172.16.12.0 to 172.16.15.255 172.16.8.0 172.16.11.255 172.16.16.0 to 172.16.19.255 172.16.12.0 172.16.15.255 Valid Subnets 172.16.248.0 to 172.16.251.255 172.16.251.255 172.16.255.255 x

172.16.248.0 172.16.252.0

Requirement of Networks is 500 ? Example 1 Class A : N.H.H.H 0xxxxxxx.xxxxxxxx.xxxxxxxx.xxxxxxxx Class A : 10.0.0.0 No. = = = = No. = = = = of Subnet 2n 2 Req. of Subnet 29 2 500 (-2 is for First & Last Subnet Range) 512 2 510 Subnet of Host 2h 2 (-2 is for Network ID & Broadcast ID) 215 2 32768 2 32766 Hosts/Subnet

HELP

Example 1 (Continued)

Customize Subnet = 9 Host Bits to Network Bits If you Mask convert 255. 255. 0 510 Subnet & 128. 32766 Hosts/Subnet 11111111. 11111111. 10000000. 00000000 Customize Subnet Mask 255.255.128.0

Range of Networks Subnet Network ID Broadcast ID Range 10.0.128.0 to 10.0.255.255 10.0.0.0 10.0.127.255 10.1.0.0 to 10.1.127.255 10.0.128.0 10.0.255.255 10.1.128.0 to 10.1.255.255 10.1.0.0 10.1.127.255 10.2.0.0 to 10.2.127.255 10.1.128.0 10.1.255.255

Valid Subnets 10.255.0.0 to 10.255.127.255 10.255.127.255 10.255.255.255 x

10.255.0.0 10.255.128.0

Requirement of Hosts is 260000 ? Example 2 Class A : N.H.H.H 0xxxxxxx.xxxxxxxx.xxxxxxxx.xxxxxxxx Class A : 10.0.0.0 No. of Host = 2h 2 Req. of Host = = = 218 2 260000 (-2 is for Network ID & Broadcast ID) 262144 2 262142 Hosts/Subnet

No. of Subnet = = = = 2n 2 (-2 is for First & Last Subnet Range) 26 2 64 2 62 Subnet

HELP

Example 2 (Continued)

Customize Subnet = 6 Host Bits to Network Bits If you Mask convert 255. 252. 0. 0 62 Subnet & 262142 Hosts/Subnet 11111111. 11111100. 00000000. 00000000 Customize Subnet Mask 255.252.0.0

Range of Networks Subnet Network ID Broadcast ID Range 10.4.0.0 to 10.3.255.255 10.0.0.0 10.3.255.255 10.8.0.0 to 10.7.255.255 10.4.0.0 10.7.255.255 10.12.0.0 to 10.15.255.255 10.8.0.0 10.11.255.255 10.16.0.0 to 10.19.255.255 10.12.0.0 10.15.255.255

Valid Subnets 10.248.0.0 to 10.251.255.255 10.251.255.255 10.255.255.255

10.248.0.0 10.252.0.0

Cisco / Notation Example 3 Class A : N.H.H.H 0xxxxxxx.xxxxxxxx.xxxxxxxx.xxxxxxxx Class B : 10.0.0.0/20

Extra Network Bits = 20 8 = 12


Put n value = 12 No. = = = = No. = = = = of Subnet 2n 2 212 2 (-2 is for First & Last Subnet Range) 4096 2 4094 Subnet of Host 2h 2 (-2 is for Network ID & Broadcast ID) 212 2 4096 2 4094 Hosts/Subnet
HELP

Example 3 (Continued)

Customize Subnet Mask = 12 Host Bits to Network Bits If you convert 255. 255. Subnet & 240. 0 4094 4094 Hosts/Subnet 11111111. 11111111. 11110000. 00000000 Customize Subnet Mask 255.255.240.0

Range of Networks Subnet Network ID Broadcast ID Range 10.0.16.0 to 10.31.255.255 10.0.0.0 10.0.15.255 10.0.32.0 to 10.47.255.255 10.0.16.0 10.0.31.255 10.0.48.0 to 10.63.255.255 10.0.32.0 10.0.47.255 10.0.64.0 to 10.79.255.255 10.0.48.0 10.0.63.255

Valid Subnets 10.255.224.0 to 10.255.239.255 10.255.239.255 10.255.255.255 x

10.255.224.0 10.255.240.0

VLSM

Subnetting a subnet is called as Variable Length Subnet Mask VLSMs provide the capability to include more than one subnet mask within a major network

Scenario

ZOOM Technologies is having 100 PC


ZOOM Technologies 192.168.1.0/24 MCSE CISCO FIREWALL SOLARIS TRAINING Administrator wants inter-department communication should not be possible ? What is best the solution ? Answer : You will go for FLSM i.e. Subnetting

Scenario (continued) Now we are also having sub departments ZOOM Technologies MCSE CISCO Ccna Ccnp FIREWALL ISA Checkpoint Net SQ Clavister Cisco PIX SOLARIS Linux Unix Solaris TRAINING

Scenario (continued) Now we are also having sub departments ZOOM Technologies MCSE CISCO Ccna Ccnp FIREWALL ISA Checkpoint Net SQ Clavister Cisco PIX SOLARIS Linux Unix Solaris TRAINING

Scenario (continued)

Administrator does not want inter-department communication in the sub departments ? Answer : You will use the subnet range to further divide it into smaller ranges, this time its Subnetting of a Subnet i.e. VLSM.

Calculation of FLSM

Class C : N.N.N.H 110xxxxx.xxxxxxxx.xxxxxxxx.xxxxxxxx Class C : 192.168.1.0 No. = = = = No. = = = = of Subnet 2n 2 Req. of Subnet 23 2 5 (-2 is for First & Last Subnet Range) 82 6 Subnet of Host 2h 2 (-2 is for Network ID & Broadcast ID) 25 2 32 2 30 Hosts/Subnet

HELP

FLSM

(Continued)

Customize Subnet = 3 Host Bits to Network Bits If you Mask convert 255. 255. 224 6 Subnet &255. 30 Hosts/Subnet 11111111. 11111111. 11111111. 11100000 Customize Subnet Mask 255.255.255.224

Range of Networks Subnet Network ID Broadcast ID Range 192.168.1.32 to 192.168.1.63. 192.168.1.0 192.168.1.31 x 192.168.1.64 to 192.168.1.95 192.168.1.63 192.168.1.32 192.168.1.96 to 192.168.1.127 192.168.1.95 192.168.1.64 192.168.1.128 to 192.168.1.159 192.168.1.127 192.168.1.96 192.168.1.160 to 192.168.1.191 Valid Subnets 192.168.1.159 192.168.1.128 192.168.1.192 to 192.168.1.223 192.168.1.191 192.168.1.160 192.168.1.223 192.168.1.192 192.168.1.255 192.168.1.224

Assigning of the Ranges

ZOOM Technologies MCSE CISCO Ccna Ccnp FIREWALL ISA Checkpoint Net SQ Clavister Cisco PIX SOLARIS Linux Unix Solaris TRAINING

192.168.1.32 1.63/27 192.168.1.64 1.95/27

192.168.1.96 1.127/27

192.168.1.128 1.159/27

192.168.1.160 1.191/27

Calculation of VLSM for CISCO Dept.

Class C : N.N.N.H 110xxxxx.xxxxxxxx.xxxxxxxx.xxxxxxxx Class C : 192.168.1.64 No. = = = = No. = = = = of Subnet 2n Req. of Subnet 21 2 2 2 Subnet of Host 2h 2 (-2 is for Network ID & Broadcast ID) 24 2 16 2 14 Hosts/Subnet

HELP

VLSM

(Continued)

CustomizeIf Subnet Mask = you convert 1 more Host Bit to Network Bit 255. 255. 240 2 Subnet &255. 14 Hosts/Subnet 11111111. 11111111. 11111111. 11110000 Customize Subnet Mask 255.255.255.240

Range of Networks Subnet Network ID Broadcast ID Range 192.168.1.64 to 192.168.1.79 192.168.1.64 192.168.1.79 192.168.1.80 to 192.168.1.95 Valid Subnets 192.168.1.80 192.168.1.95

Assigning of the Ranges

ZOOM Technologies MCSE CISCO Ccna Ccnp FIREWALL ISA Checkpoint Net SQ Clavister Cisco PIX SOLARIS Linux Unix Solaris TRAINING

192.168.1.32 1.63/27 192.168.1.64 1.95/27 192.168.1.64 1.79/28 192.168.1.80 1.95/28 192.168.1.96 1.127/27

192.168.1.128 1.159/27

192.168.1.160 1.191/27

Calculation of VLSM for Firewall Dept.

Class C : N.N.N.H 110xxxxx.xxxxxxxx.xxxxxxxx.xxxxxxxx Class C : 192.168.1.96 No. = = = = No. = = = = of Subnet 2n Req. of Subnet 23 5 8 8 Subnet of Host 2h 2 (-2 is for Network ID & Broadcast ID) 22 2 42 2 Hosts/Subnet

HELP

VLSM

(Continued)

CustomizeIf Subnet Mask = you convert 3 more Host Bit to Network Bit 255. 255. 255. 252 8 Subnet & 2 Hosts/Subnet 11111111. 11111111. 11111111. 11111100 Customize Subnet Mask 255.255.255.252

Range of Networks Subnet Range Network ID Broadcast ID 192.168.1.96 to 192.168.1.99 192.168.1.96 192.168.1.99 192.168.1.100 to 192.168.1.103 192.168.1.100 192.168.1.104 192.168.1.103 to 192.168.1.107 192.168.1.104 192.168.1.108 192.168.1.107 to 192.168.1.111 192.168.1.108 192.168.1.112 192.168.1.111 to 192.168.1.115 Valid Subnets 192.168.1.112 192.168.1.116 192.168.1.115 to 192.168.1.119 192.168.1.116 192.168.1.120 192.168.1.119 to 192.168.1.123 192.168.1.120 192.168.1.124 192.168.1.123 to 192.168.1.127 192.168.1.124 192.168.1.127

Assigning of the Ranges

ZOOM Technologies MCSE CISCO Ccna Ccnp FIREWALL ISA Checkpoint Net SQ Clavister Cisco PIX SOLARIS Linux Unix Solaris TRAINING

192.168.1.32 1.63/27 192.168.1.64 1.95/27 192.168.1.64 1.79/28 192.168.1.80 1.95/28 192.168.1.96 1.127/27 192.168.1.96 1.99/30 192.168.1.100 1.103/30 192.168.1.104 1.107/30 192.168.1.108 1.111/30 192.168.1.112 1.115/30 192.168.1.128 1.159/27

192.168.1.160 1.191/27

Calculation of VLSM for Solaris Dept.

Class C : N.N.N.H 110xxxxx.xxxxxxxx.xxxxxxxx.xxxxxxxx Class C : 192.168.1.128 No. = = = = No. = = = = of Subnet 2n Req. of Subnet 22 3 4 4 Subnet of Host 2h 2 (-2 is for Network ID & Broadcast ID) 23 2 82 6 Hosts/Subnet

HELP

VLSM

(Continued)

CustomizeIf Subnet Mask = you convert 2 more Host Bit to Network Bit 255. 255. 255. 248 4 Subnet & 6 Hosts/Subnet 11111111. 11111111. 11111111. 11111000 Customize Subnet Mask 255.255.255.248

Range of Networks Subnet Range Network ID Broadcast ID 192.168.1.128 to 192.168.1.135 192.168.1.128 192.168.1.135 192.168.1.136 to 192.168.1.143 192.168.1.136 192.168.1.144 192.168.1.143 to 192.168.1.151 Valid Subnets 192.168.1.144 192.168.1.152 192.168.1.151 to 192.168.1.159 192.168.1.152 192.168.1.159

Assigning of the Ranges

ZOOM Technologies MCSE CISCO Ccna Ccnp FIREWALL ISA Checkpoint Net SQ Clavister Cisco PIX SOLARIS Linux Unix Solaris TRAINING

192.168.1.32 1.63/27 192.168.1.64 1.95/27 192.168.1.64 1.79/28 192.168.1.80 1.95/28 192.168.1.96 1.127/27 192.168.1.96 1.99/30 192.168.1.100 1.103/30 192.168.1.104 1.107/30 192.168.1.108 1.111/30 192.168.1.112 1.115/30 192.168.1.128 1.159/27 192.168.1.128 1.135/29 192.168.1.136 1.143/29 192.168.1.144 1.51/29 192.168.1.160 1.191/27

VSNL ROUTER

192.168.1.0/24

1.32/27 1.64/27 1.128/27

1.160/27 1.144/29

1.64/28 1.96/27

1.136/29

1.79/28

1.128/29

1.96/30

1.112/30

1.100/30 1.104/30

1.108/30

CIDR Classless Inter Domain Routing

It is reverse (inverse) of Subnetting Combining of Multiple Networks to Single

Networks
Converting Network Bits to Hosts Bits i.e. Converting 1s into 0s Generally design for Class C networks Easier Summarization It is also known as Supernetting

VSNL ROUTER

192.168.1.0/24

1.32/27 1.64/27 1.128/27

1.160/27 1.144/29

1.64/28 1.96/27

1.136/29

1.79/28

1.128/29

1.96/30

1.112/30

1.100/30 1.104/30

1.108/30

Requirement of Hosts is 1000 ? Example 1 Class C : N.N.N.H 110xxxxx.xxxxxxxx.xxxxxxxx.xxxxxxxx Class C : 192.168.0.0 No. of Host = 2h 2 Req. of Host = 210 2 1000 (-2 is for Network ID & Broadcast ID) = 1024 2 = 1022 Hosts/Subnet

HELP

Example 1 (Continued)

Customize Subnet Mask = 255. 255. 11111111. 11111111.

252. 11111100.

0 00000000

Range of Networks Network ID 192.168.0.0 192.168.4.0 192.168.8.0 192.168.12.0

Broadcast ID 192.168.3.255 192.168.7.255 192.168.11.255 192.168.15.255 Valid Subnets

192.168.248.0 192.168.252.0

192.168.251.255 192.168.255.255

Requirement of Hosts is 12000 ? Example 2 Class C : N.N.N.H 110xxxxx.xxxxxxxx.xxxxxxxx.xxxxxxxx Class C : 192.168.0.0 No. of Host = 2h 2 Req. of Host = 214 2 12000 (-2 is for Network ID & Broadcast ID) = 16384 2 = 16382 Hosts/Subnet

HELP

Example 2 (Continued)

Customize Subnet Mask = 255. 255. 11111111. 11111111.

192. 11000000.

0 00000000

Range of Networks Network ID 192.168.0.0 192.168.64.0 192.168.128.0 192.168.192.0

Broadcast ID 192.168.63.255 192.168.127.255 192.168.191.255 192.168.255.255

Example 1 (Continued)

Customize Subnet Mask = 255. 255. 11111111. 11111111.

252. 11111100.

0 00000000

Range of Networks Network ID 192.168.0.0 192.168.4.0 192.168.8.0 192.168.12.0

Broadcast ID 192.168.3.255 192.168.7.255 192.168.11.255 192.168.15.255 Valid Subnets

192.168.248.0 192.168.252.0

192.168.251.255 192.168.255.255

157

Routing Network Diagram

Head Office HYD

10.0.0.1/8 S0 S1 10.0.0.2/8

Branch Office CHE E0 192.168.2.150/24

E0 192.168.1.150/24

LAN - 192.168.1.0/24

LAN - 192.168.2.0/24
158

Rules of Routing

Head Office Ethernet interface should be in the Office side. Show Diagram

same

network as your Head office LAN and similarly on Branch

Head Office Serial S0 and Branch Office Serial S1 should be in same network. Show Diagram Head Office LAN and Branch Office LAN should be in different Network. Show Diagram All interfaces of Router should be in different network. Show Diagram

159

Types of Routing

Static Routing

Default Routing

Dynamic Routing

160

Static Routing

It is configured by Administrator manually.

Mandatory need of Destination Network ID


It is Secure & fast Used for Small organization which have network of Routers. Administrative distance for Static Router is 0 and 1. It is the trustworthiness of the routing information. Lesser Administrative distance higher the preference.
161

10-15

Static Routing Network Diagram

10.0.0.1/8 S0 HYD E0 192.168.1.150/24 S1 10.0.0.2/8 CHE E0 192.168.2.150/24

LAN - 192.168.1.0/24

LAN - 192.168.2.0/24

162

163

Routing Network Diagram

Head Office HYD

10.0.0.1/8 S0 S1 10.0.0.2/8

Branch Office CHE E0 192.168.2.150/24

E0 192.168.1.150/24

LAN - 192.168.1.0/24

LAN - 192.168.2.0/24
164

Routing Network Diagram

Head Office HYD

10.0.0.1/8 S0 S1 10.0.0.2/8

Branch Office CHE E0 192.168.2.150/24

E0 192.168.1.150/24

LAN - 192.168.1.0/24

LAN - 192.168.2.0/24
165

Routing Network Diagram

Head Office HYD

10.0.0.1/8 S0 S1 10.0.0.2/8

Branch Office CHE E0 192.168.2.150/24

E0 192.168.1.150/24

LAN - 192.168.1.0/24

LAN - 192.168.2.0/24
166

Routing Network Diagram

Head Office HYD

10.0.0.1/8 S0 S1 10.0.0.2/8

Branch Office 11.0.0.1/8 S0 CHE E0 192.168.2.150/24

E0 192.168.1.150/24

LAN - 192.168.1.0/24

LAN - 192.168.2.0/24
167

Microsoft Windows 2000 [Version 5.00.2195] (C) Copyright 1985-2000 Microsoft Corp. C:\> telnet 192.168.1.150 Connecting ..... ================================ Welcome to Hyderabad Router ================================ User Access Verification password : **** Hyderabad> enable password : **** Hyderabad# configure terminal Enter configuration commands, one per line. End with CNTL/Z. Hyderabad(config)# interface serial 0 Hyderabad(config-if)# ip address 10.0.0.1 255.0.0.0 Hyderabad(config-if)# no shut Hyderabad(config-if)# clockrate 64000 Hyderabad(config-if)# encapsulation hdlc Hyderabad(config-if)# exit Hyderabad(config)# exit Hyderabad# Diagram
168

Microsoft Windows 2000 [Version 5.00.2195] (C) Copyright 1985-2000 Microsoft Corp. C:\> telnet 192.168.1.150 Connecting ..... ================================ Welcome to Hyderabad Router ================================ User Access Verification password : **** Hyderabad> enable password : **** Hyderabad# configure terminal Enter configuration commands, one per line. End with CNTL/Z. Hyderabad(config)# interface serial 0 Hyderabad(config-if)# ip address 10.0.0.1 255.0.0.0 Hyderabad(config-if)# no shut Hyderabad(config-if)# clockrate 64000 Hyderabad(config-if)# encapsulation hdlc Hyderabad(config-if)# exit Hyderabad(config)# exit Hyderabad# Diagram
169

Hyderabad# show ip route Default gateway is not set


Host Gateway Last Use Total Uses Interface ICMP redirect cache is empty Hyderabad# configure terminal Enter configuration commands, one per line. End with CNTL/Z. Hyderabad(config)# ip routing Hyderabad(config)# ^Z Hyderabad# show ip route Enabling Routing Router(config)#ip Codes: C - connected, S - static, I routing - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP i- IS-IS, L1-IS-IS level-1, L2-IS-IS level-2,*- candidate default U - per-user static route, o - ODR

Gateway of last resort is not set C 192.168.1.0/24 is directly connected, Ethernet0 C 10.0.0.0/8 is directly connected, Serial0 Hyderabad#

Diagram 170

Hyderabad# configure terminal Enter configuration commands, one per line. End with CNTL/Z. Hyderabad(config)# ip route 192.168.2.0 255.255.255.0 10.0.0.2 Hyderabad(config)# ^Z Hyderabad# show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP Configuring Static Route D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area Router(config)# ip routetype <Destination Network N1 - OSPF NSSA external 1, N2 - OSPF NSSAID> external type 2 E1 - OSPF external <Destination type 1, E2 - Subnet OSPF external Mask> type 2, E - EGP i- IS-IS, L1-IS-IS level-1, L2-IS-IS level-2,*- candidate default <Next-hop IPODR address > U - per-user static route, o -

Or GatewayRouter(config)# of last resort not set ip is route <Destination Network ID> <Destination Subnet Mask> C 192.168.1.0/24 is directly connected, Ethernet0 <Exit interface type><interface number> S 192.168.2.0/24 [1/0] via 10.0.0.2 C 10.0.0.0/8 is directly connected, Serial0 Hyderabad# S for Static Routing 1 is nothing but Administrative Distance

Diagram 171

Microsoft Windows 2000 [Version 5.00.2195] (C) Copyright 1985-2000 Microsoft Corp. C:\> telnet 192.168.2.150 Connecting ..... ================================ Welcome to Chennai Router ================================ User Access Verification password : **** Chennai> enable password : **** Chennai# configure terminal Enter configuration commands, one per line. End with CNTL/Z. Chennai(config)# interface serial 1 Chennai(config-if)# ip address 10.0.0.2 255.0.0.0 Chennai(config-if)# no shut Chennai(config-if)# encapsulation hdlc Chennai(config-if)# exit Chennai(config)# exit Chennai# Chennai# Diagram
172

Microsoft Windows 2000 [Version 5.00.2195] (C) Copyright 1985-2000 Microsoft Corp. C:\> telnet 192.168.2.150 Connecting ..... ================================ Welcome to Chennai Router ================================ User Access Verification password : **** Chennai> enable password : **** Chennai# configure terminal Enter configuration commands, one per line. End with CNTL/Z. Chennai(config)# interface serial 1 Chennai(config-if)# ip address 10.0.0.2 255.0.0.0 Chennai(config-if)# no shut Chennai(config-if)# encapsulation hdlc Chennai(config-if)# exit Chennai(config)# exit Chennai# Chennai# Diagram
173

Chennai# show ip route Default gateway is not set


Host Gateway Last Use Total Uses Interface ICMP redirect cache is empty Chennai# configure terminal Enter configuration commands, one per line. End with CNTL/Z. Chennai(config)# ip routing Chennai(config)# ^Z Chennai# show ip route Enabling Routing Router(config)#ip Codes: C - connected, S - static, I routing - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP i- IS-IS, L1-IS-IS level-1, L2-IS-IS level-2,*- candidate default U - per-user static route, o - ODR

Gateway of last resort is not set C 192.168.2.0/24 is directly connected, Ethernet0 C 10.0.0.0/8 is directly connected, Serial1 Chennai#

Diagram 174

Chennai# configure terminal Enter configuration commands, one per line. End with CNTL/Z. Chennai(config)# ip route 192.168.1.0 255.255.255.0 S1 Chennai(config)# ^Z Chennai# show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP Configuring Static Route D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area Router(config)# ip routetype <Destination Network N1 - OSPF NSSA external 1, N2 - OSPF NSSAID> external type 2 E1 - OSPF external <Destination type 1, E2 - Subnet OSPF external Mask> type 2, E - EGP i- IS-IS, L1-IS-IS level-1, L2-IS-IS level-2,*- candidate default <Next-hop IPODR address > U - per-user static route, o -

Or GatewayRouter(config)# of last resort not set ip is route <Destination Network ID> <Destination Subnet Mask> C 192.168.2.0/24 is directly connected, Ethernet0 <Exit interface type><interface number> S 192.168.1.0 is directly connected, Serial1 C 10.0.0.0/8 is directly connected, Serial1 Chennai# If is directly connected S for Static Routing Administrative Distance is 0

Diagram 175

Hyderabad# configure terminal Enter configuration commands, one per line. End with CNTL/Z. Hyderabad(config)# ip route 192.168.2.0 255.255.255.0 10.0.0.2 Hyderabad(config)# ^Z Hyderabad# show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP i- IS-IS, L1-IS-IS level-1, L2-IS-IS level-2,*- candidate default U - per-user static route, o - ODR

Gateway of last resort is not set C 192.168.1.0/24 is directly connected, Ethernet0 S 192.168.2.0/24 [1/0] via 10.0.0.2 C 10.0.0.0/8 is directly connected, Serial0 Hyderabad# ping 192.168.2.1 Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.2.1, timeout is 2 seconds:

!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 40/43/44 ms

Hyderabad#

Diagram 176

Chennai# configure terminal Enter configuration commands, one per line. End with CNTL/Z. Chennai(config)# ip route 192.168.1.0 255.255.255.0 S1 Chennai(config)# ^Z Chennai# show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP i- IS-IS, L1-IS-IS level-1, L2-IS-IS level-2,*- candidate default U - per-user static route, o - ODR

Gateway of last resort is not set C 192.168.2.0/24 is directly connected, Ethernet0 S 192.168.1.0 is directly connected, Serial1 C 10.0.0.0/8 is directly connected, Serial1 Chennai# ping 192.168.1.1 Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.1, timeout is 2 seconds:

!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 40/43/44 ms

Chennai#

Diagram 177

Static Routing Network Diagram

10.0.0.1/8 S0 HYD E0 192.168.1.150/24 S1 10.0.0.2/8 CHE E0 192.168.2.150/24

LAN - 192.168.1.0/24

LAN - 192.168.2.0/24

178

179

OSPF - Network Diagram

AREA 1 10.0.0.1/8
S0

11.0.0.1/8 S0

AREA 2

HYD

E0 192.168.1.150/24

S1 10.0.0.2/8

CHE

S1 BAN 11.0.0.2/8 E0 E0 192.168.2.150/24 192.168.3.150/24

AREA 0

LAN - 192.168.1.0/24

LAN - 192.168.2.0/24

LAN - 192.168.3.0/24

180

181

Microsoft Windows 2000 [Version 5.00.2195] (C) Copyright 1985-2000 Microsoft Corp. C:\> telnet 192.168.1.150 Connecting ..... ================================ Welcome to Hyderabad Router ================================ User Access Verification password : **** Hyderabad> enable Directly Connected Networks on HYDERABAD Router password : **** Hyderabad# configure terminal 192.168.1.0 Enter configuration commands, one per line. End with CNTL/Z. 10.0.0.0 Hyderabad(config)# interface serial 0 Hyderabad(config-if)# ip address 10.0.0.1 255.0.0.0 Hyderabad(config-if)# no shut Hyderabad(config-if)# clockrate 64000 Hyderabad(config-if)# encapsulation hdlc Hyderabad(config-if)# exit Hyderabad(config)#
182

Hyderabad(config)# no ip routing Hyderabad(config)# ip routing Hyderabad(config)# router ospf 1 Hyderabad(config-router)# network 192.168.1.0 0.0.0.255 area 1 Hyderabad(config-router)# network 10.0.0.0 0.255.255.255 area 1 Hyderabad(config-router)# Configuring OSPF Router(config)# router ospf <pid> Router(config-router)# network <Network ID> <wildcard mask> area <area id>

183

Hyderabad(config)# no ip routing Hyderabad(config)# ip routing Hyderabad(config)# router ospf 1 Hyderabad(config-router)# network 192.168.1.0 0.0.0.255 area 1 Hyderabad(config-router)# network 10.0.0.0 0.255.255.255 area 1 Hyderabad(config-router)# ^Z Hyderabad# show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP i- IS-IS, L1-IS-IS level-1, L2-IS-IS level-2,*- candidate default U - per-user static route, o - ODR

Gateway of last resort is not set C 10.0.0.0/8 is directly connected, Serial0 O IA 11.0.0.0/8 [110/128] via 10.0.0.2, 00:01:03, Serial0 C 192.168.1.0/24 is directly connected, Ethernet0 O IA O 192.168.2.0/24 via 00:01:03, Serial0 IA for OSPF [110/74] of10.0.0.2, OSPF 110 isMetric nothing but Distance O IA Inter 192.168.3.0/24 [110/138] via 10.0.0.2, 00:00:13, Serial0 Area routesAdministrative Cost Hyderabad#
184

Hyderabad# show ip ospf database


OSPF Router with ID (192.168.1.150) (Process ID 1)

Router Link States (Area 1)

Link ID 192.168.1.150 192.168.2.150

ADV Router 192.168.1.150 192.168.2.150

Age 272 273

Seq# Checksum Link 0x80000003 0xA163 3 0x80000002 0xBACC 2

Summary Net Link States (Area 1) Link ID 11.0.0.0 192.168.2.0 192.168.3.0 ADV Router 192.168.2.150 192.168.2.150 192.168.2.150 Age 273 273 208 Seq# 0x80000001 0x80000001 0x80000001 Checksum 0xDA15 0x8441 0xFB88

Hyderabad# show ip ospf neighbor Neighbor ID 192.168.2.150 Hyderabad# Pri 1 State FULL/ Dead Time 00:00:32 Address 10.0.0.2

185

Microsoft Windows 2000 [Version 5.00.2195] (C) Copyright 1985-2000 Microsoft Corp. C:\> telnet 192.168.2.150 Connecting ..... ================================ Welcome to Chennai Router ================================ User Access Verification password : **** Directly Connected Networks on Chennai> enable CHENNAI Router password : **** Chennai# configure terminal192.168.2.0 Enter configuration commands, one per line. End with CNTL/Z. 10.0.0.0 Chennai(config)# interface serial 1 11.0.0.0 Chennai(config-if)# ip address 10.0.0.2 255.0.0.0 Chennai(config-if)# no shut Chennai(config-if)# encapsulation hdlc Chennai(config-if)# interface serial 0 Chennai(config-if)# ip address 11.0.0.1 255.0.0.0 Chennai(config-if)# no shut Chennai(config-if)# encapsulation hdlc
186

Chennai(config)# no ip routing Chennai(config)# ip routing Chennai(config)# router ospf 2 Chennai(config-router)# network 192.168.2.0 0.0.0.255 area 0 Chennai(config-router)# network 10.0.0.0 0.255.255.255 area 1 Chennai(config-router)# network 11.0.0.0 0.255.255.255 area 2 Configuring OSPF Chennai(config-router)# Router(config)# router ospf <pid> Router(config-router)# network <Network ID> <wildcard mask> area <area id>

187

Chennai(config)# no ip routing Chennai(config)# ip routing Chennai(config)# router ospf 2 Chennai(config-router)# network 192.168.2.0 0.0.0.255 area 0 Chennai(config-router)# network 10.0.0.0 0.255.255.255 area 1 Chennai(config-router)# network 11.0.0.0 0.255.255.255 area 2 Chennai(config-router)# ^Z Chennai# show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP i- IS-IS, L1-IS-IS level-1, L2-IS-IS level-2,*- candidate default U - per-user static route, o - ODR

Gateway of last resort is not set

C 10.0.0.0/8 is directly connected, Serial1 C 11.0.0.0/8 is directly connected, Serial0 O 192.168.1.0/24 [110/74] via 10.0.0.1, 00:01:04, Serial1 C 192.168.2.0/24 is directly connected, Ethernet0 O 192.168.3.0/24 [110/74] via 11.0.0.2, Metric of but OSPF 00:00:09, Serial0 110 is nothing O for OSPF routes Administrative Distance Chennai# Cost 188

Chennai# show ip ospf database


OSPF Router with ID (192.168.2.150) (Process ID 2)

Router Link States (Area 0) Link ID 192.168.2.150 ADV Router 192.168.2.150 Age 472 Seq# Checksum Link 0x80000002 0xEFC7 1

Summary Net Link States (Area 0)


Link ID 10.0.0.0 11.0.0.0 192.168.1.0 192.168.3.0 ADV Router 192.168.2.150 192.168.2.150 192.168.2.150 192.168.2.150 Age 462 472 452 396 Seq# 0x80000001 0x80000001 0x80000001 0x80000001 Checksum 0xE709 0xDA15 0x1274 0xFB88

Router Link States (Area 1) Link ID 192.168.1.150 192.168.2.150 --MoreADV Router 192.168.1.150 192.168.2.150 Age 463 462 Seq# Checksum Link 0x80000003 0xA163 3 0x80000002 0xBACC 2
189

Summary Net Link States (Area 1) Link ID 11.0.0.0 192.168.2.0 192.168.3.0 ADV Router 192.168.2.150 192.168.2.150 192.168.2.150 Age 462 465 400 Seq# 0x80000001 0x80000001 0x80000001 Checksum 0xDA15 0x8441 0xFB88

Router Link States (Area 2)

Link ID 192.168.2.150 192.168.3.150

ADV Router 192.168.2.150 192.168.3.150

Age 415 416

Seq# Checksum Link 0x80000003 0xDAA8 2 0x80000003 0xD328 3

Summary Net Link States (Area 2)

Link ID 10.0.0.0 192.168.1.0 192.168.2.0

ADV Router 192.168.2.150 192.168.2.150 192.168.2.150

Age 465 455 475

Seq# 0x80000001 0x80000001 0x80000001

Checksum 0xE709 0x1274 0x8441

Chennai# show ip ospf Neighbor ID Pri 192.168.3.150 1 192.168.1.150 1 Chennai#

neighbor State FULL/ FULL/ -

Dead Time 00:00:35 00:00:32

Address 11.0.0.2 10.0.0.1


190

Microsoft Windows 2000 [Version 5.00.2195] (C) Copyright 1985-2000 Microsoft Corp. C:\> telnet 192.168.3.150 Connecting ..... ================================ Welcome to Banglore Router ================================ User Access Verification password : **** Directly Connected Networks on Banglore Banglore> enable Router password : **** Banglore# configure terminal 192.168.3.0 Enter configuration commands, one per line. End with CNTL/Z. 11.0.0.0 Banglore(config)# interface serial 1 Banglore(config-if)# ip address 11.0.0.2 255.0.0.0 Banglore(config-if)# no shut Banglore(config-if)# clockrate 64000 Banglore(config-if)# encapsulation hdlc Banglore(config-if)# exit Banglore(config)#
191

Banglore(config)# no ip routing Banglore(config)# ip routing Banglore(config)# router ospf 1 Banglore(config-router)# network 192.168.3.0 0.0.0.255 area 2 Banglore(config-router)# network 11.0.0.0 0.255.255.255 area 2 Banglore(config-router)# Configuring OSPF Router(config)# router ospf <pid> Router(config-router)# network <Network ID> <wildcard mask> area <area id>

192

Banglore(config)# no ip routing Banglore(config)# ip routing Banglore(config)# router ospf 1 Banglore(config-router)# network 192.168.3.0 0.0.0.255 area 0 Banglore(config-router)# network 11.0.0.0 0.255.255.255 area 0 Banglore(config-router)# ^Z Banglore# show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP i- IS-IS, L1-IS-IS level-1, L2-IS-IS level-2,*- candidate default U - per-user static route, o - ODR

Gateway of last resort is not set O IA 10.0.0.0/8 [110/128] via 11.0.0.1, 00:02:26, Serial1 C 11.0.0.0/8 is directly connected, Serial1 O IA O 192.168.1.0/24 via 11.0.0.1, 00:02:26, Serial1 IA for OSPF [110/138] of but OSPF 110 isMetric nothing O IA Inter 192.168.2.0/24 [110/74] via 11.0.0.1, 00:02:26, Serial1 Distance Area routesAdministrative Cost C 192.168.3.0/24 is directly connected, Ethernet0 Banglore#
193

Banglore# show ip ospf database


OSPF Router with ID (192.168.3.150) (Process ID 1)

Router Link States (Area 2)

Link ID 192.168.2.150 192.168.3.150

ADV Router 192.168.2.150 192.168.3.150

Age 935 934

Seq# Checksum Link 0x80000003 0xDAA8 2 0x80000003 0xD328 3

Summary Net Link States (Area 2) Link ID 10.0.0.0 192.168.1.0 192.168.2.0 ADV Router 192.168.2.150 192.168.2.150 192.168.2.150 Age 985 975 995 Seq# 0x80000001 0x80000001 0x80000001 Checksum 0xE709 0x1274 0x8441

Banglore# show ip ospf neighbor Neighbor ID 192.168.2.150 Banglore# Pri 1 State FULL/ Dead Time 00:00:36 Address 11.0.0.1

194

Hyderabad# ping 192.168.3.1 Type escape sequence to abort.


Sending 5, 100-byte ICMP Echos to 192.168.3.1, timeout is 2 seconds:

!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 40/43/44 ms

Hyderabad# ping 192.168.2.1 Type escape sequence to abort.


Sending 5, 100-byte ICMP Echos to 192.168.2.1, timeout is 2 seconds:

!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 40/43/44 ms

Hyderabad#

195

Chennai# ping 192.168.1.1 Type escape sequence to abort.


Sending 5, 100-byte ICMP Echos to 192.168.1.1, timeout is 2 seconds:

!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 40/43/44 ms

Chennai# ping 192.168.3.1 Type escape sequence to abort.


Sending 5, 100-byte ICMP Echos to 192.168.3.1, timeout is 2 seconds:

!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 40/43/44 ms

Chennai#

196

Banglore# ping 192.168.1.1 Type escape sequence to abort.


Sending 5, 100-byte ICMP Echos to 192.168.1.1, timeout is 2 seconds:

!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 40/43/44 ms

Banglore# ping 192.168.2.1 Type escape sequence to abort.


Sending 5, 100-byte ICMP Echos to 192.168.2.1, timeout is 2 seconds:

!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 40/43/44 ms

Banglore#

197

S-ar putea să vă placă și