You are on page 1of 86

Subnetting,Supernetting, VLSM & CIDR

WHAT - IP Address
Unique32or128bitBinary,usedto
identifyasystemonaNetworkorInternet.

NetworkPortion Host
Portion
CLASSFULL ADDRESSING

IPaddressspaceisdividedintofiveclasses:A,
B,C,D,andE.
Network and Host IDs

EachIPaddressisdividedintotwoparts
Networkpart,definedbynetid identifiesanetwork
Hostpart,definedbyhostid identifiesahostwithinanetwork
Class A Address
0NET HOST HOST HOST

Network Bits = 7
No.of Networks = 27 1 = 127
Host Bits = 24
No.of Host/NW = 224 2 = 16 Million
Range :
0.0.0.0 to 127.255.255.255
Class B Address
10 NET NET HOST HOST

Network Bits = 14
No.of Networks = 214 1 = 16,383
Host Bits = 16
No.of Host/NW = 216 2 = 65,234
Range :
128.0.0.0 to 191.255.255.255
Class C Address
110 NET NET NET HOST

Network Bits = 21
No.of Networks = 221 1 = 2 Million
Host Bits = 8
No.of Host/NW = 28 2 = 254
Range :
192.0.0.0 to 223.255.255.255
Special Purpose IP Addresses

Private IP Address
Default NW Address
Broadcast Address
Loopback Address
Private IP Addresses

Private addresses are not recognized globally


Private address often used together with NAT techniques
Other Special Addresses

There are several addresses within each class


that are reserved for such special purposes as
broadcast.
Direct Broadcast

Direct broadcast sends a message to all the hosts within a specific network.
Direct broadcast address consists of network id followed by all 1s.
Limited Broadcast

Limited broadcast sends a message to all the hosts within THIS network.
Limited broadcast address consists of all 1s.
This Host on This network

The network address that consists of all 0s indicates this host on this network.
Used at the bootstrap time when host does not know its IP address.
This address is used as a source address in limited broadcast message to determine its IP
address.
Can only be used as a source address.
Specific Host on This
network
The network address that consists of all 0s for netid and specific value for
hostid is destined to a specific host on THIS network
Used a host to send a message to another host on same network.
This address can only be used as destination
Usually class A addresses
Loopback Address

IP address with first byte value of 127 is used for the loopback address.
Packets with such destination address never leave the machine
Loopback can be used only as destination address
Loopback is class A address which reduces the number of class A
addresses by 1 block

Loopback address can be used for


Testing IP software,
Sending a message between
client and server programs located
on the same machine, etc
SUBNETTING
&
NETMASKS
SUBNETTING

WHAT

Subnetting is dividing a network into several smaller parts


(subnets), each having its own sub-network address.
Traditional Internet uses two-level address hierarchy: netids
and hostids
Subnetting provides another, third, level of hierarchy.

NetworkPortion Subnet Host


Portion Portion
SUBNETTING

WHY

More EFFICIENT & STRUCTURED utilization


of IP Address

9In subnets we use Subnet Mask or NetMask


SUBNET MASK OR NETMASK

WHAT
A Bit stream of Contiguous ONES & ZEROS

WHY
Its used to determine network part of the address
for a given IP address.
SUBNET MASK OR NETMASK

TYPES

Natural / Default Network Mask

Custom / Subnet Mask


Creating Subnets Using Masks
WEEXTENDTHENETWORKPORTIONINTOHOST
Maskisa32bitnumberthatconsistsof
Consecutive1sindicatingbitsthatbelongtothenetworkpartofaddressfollowed
by
Consecutive0sindicatingbitsthatdonotbelongtonetworkpartoftheaddress

Bit-wise AND operation


between the IP address and mask
results in the network part of the
address
Subnet Masks

Subnet masks operate the same way as default masks.


Unlike default classful masks, subnet masks are required to
identifying the subnetwork.
SUPERNETTING
SUPERNETTING

Supernetting is combining several small networks (e.g. of class


C) into a big one to create a large range of addresses.
Supernetting

In supernetting, the first address of the supernet and the


supernet mask define the range of addresses.

CIDR notation is applicable to


suppernetting as well.
For example:
201.12.192.3/21
Shows that address belongs to
supernet of class C networks with
mask
255.255.248.0
Since 248 = 11111000, 8 class C
networks were combined together
to create a supernet.
VLSM
Variable Length Subnet Mask
VLSM - Purpose

ToincreaseusabilityofSubnets

Usingclassicalsubnettingthesubnetsareof
samesize
UsingVLSMthesubnetscanbeofVARIABLE
SIZE
VLSM

Eg:aClassC,NWneedtobedividedinto
110,45,50Hosts?

AvailableOptions1:
NaturalNWMask ClassCis255.255.255.0

Whichwillprovidenothinbut254hostsunder1NW
VLSM
Eg:aClassC,NWneedtobedividedinto 110,45,50
Hosts?
AvailableOptions2:
TheSubnetMaskoftheform255.255.255.X
X (in Binary) X Noof Subnets NoofHosts
10000000 128 2 128
11000000 192 4 64
11100000 224 8 32
11110000 240 16 16
11111000 248 32 8
11111100 252 64 4
VLSM -option

Eg:aClassC,NWneedtobedividedinto110,45,50Hosts?
>HierarchicalSubnetting
ARP ARPCache
Package
Encapsulation of ARP
packet
HardwareType ProtocolType

Hardware Protocol Operation


Length Length
SenderHardwareaddress

SenderProtocoladdress

TargetHardwareaddress

TargetProtocoladdress
ARP PacketFormat

HardwareType ProtocolType

Hardware ProtocolLength Operation


Length
SenderHardwareaddress

SenderProtocoladdress

TargetHardwareaddress

TargetProtocoladdress
Proxy ARP
ARP Package
ARP Package

CacheTable
Queues
OutputModule
InputModule
CacheControlModule
ARP Cache Table

STATE H/W Protcol H/W Protcol I/F Q Attempt TO H/W Protcl


Type Type Length Length Num Num Addr Addr

Res

Pen

Free
ICMP

InternetControl
MessageProtocol
Why ICMP
WhatitDoes

LackofError I ErrorReporting
Control
IPDeficiencies
C
Lackof
Assistance M QueryMessages
Mechanisms
P
ICMP

TYPES OF MESSAGES
MESSAGE FORMAT
ERROR REPORTING MSG
QUERY MSG

ICMP PACKAGE
ICMP Encapsulation
ICMP Encapsulation

ARPReply/Request
ICMP

TYPES OF MESSAGES
MESSAGE FORMAT
ERROR REPORTING MSG
QUERY MSG

ICMP PACKAGE
ICMP

TYPES OF MESSAGES
ICMPMESSAGETYPES
ICMP

MESSAGE FORMAT
ERROR REPORTING MSG
QUERY MSG
General format of ICMP messages
Category Type Message
Error 3 DestinationUnreachable
Reporting 4 SourceQuench
Messages
11 TimeExceed
12 ParameterProblem
5 Redirection
Query 8/0 EchoReq /Rep
Messages 13/14 TimestampReq /Rep
ICMP

MESSAGE FORMAT
ERROR REPORTING MSG
QUERY MSG
ErrorReportingMessages

ICMPalwaysreportserrormessagestotheoriginalsource

1.NoICMPerrormessageforadatagramcarryinganICMPerror
message.
2.NoICMPerrormessageforafragmenteddatagramthatisnot
thefirstfragment.
3.NoICMPerrormessageforadatagramhavingamulticast
address.
4.NoICMPerrormessageforadatagramwithaspecialaddress
suchas127.0.0.0or0.0.0.0.
ErrorreportingmessageTypes
DestinationUnreachable
CODE0:NetworkUnreachable
CODE1:Hostunreachable
CODE2:ProtocolUnreachable
CODE3: PortUnreachable
CODE4:Fragmentationisrequired,butDF(donotFrag)isenabled
CODE5:Sourceroutingenabled,butcouldntaccomplish
CODE6: DestN/Wisunknown
CODE7: DestHostisunknown
CODE8: SourceHostIsolated
CODE9:DestN/WisadministrativelyProhibited
CODE10:DestHostisadministrativelyProhibited
CODE11:NetworkUnreachableforaspecifiedtypeofservice
CODE12:HostUnreachableforaspecifiedtypeofservice
CODE13:Communicationadministrativelyprohibited
(administrativefilteringpreventspacketfrombeingforwarded)
CODE14:Hostprecedenceviolation(permissiondeniedforthecombinationof
hostornetworkandport)
CODE15:Precedencecutoffineffect
(precedenceofdatagramisbelowthelevelsetbythenetwork
administrators)
CODE11:NetworkUnreachableforaspecifiedtypeofservice
CODE12:HostUnreachableforaspecifiedtypeofservice
CODE13:Communicationadministrativelyprohibited
(administrativefilteringpreventspacketfrombeingforwarded)
CODE14:Hostprecedenceviolation(permissiondeniedforthecombinationof
hostornetworkandport)
CODE15:Precedencecutoffineffect
(precedenceofdatagramisbelowthelevelsetbythenetwork
administrators)
ErrorreportingmessageTypes
SourceQuench
SourceQuench

Asourcequenchmessageinformsthesource
thatadatagramhasbeendiscardeddueto
congestioninarouterorthedestinationhost.
Thesourcemustslowdownthesendingof
datagramsuntilthecongestionisrelieved.

Onesourcequenchmessageissentforeach
datagramthatisdiscardedduetocongestion.
ErrorreportingmessageTypes
TimeExceeded
TimeExceeded

Whenever a router decrements a datagram


with a timetolive value to zero, it discards
the datagram and sends a timeexceeded
message to the original source.

When the final destination does not receive all


of the fragments in a set time, it discards the
received fragments and sends a time
exceeded message to the original source.
ErrorreportingmessageTypes
Parameterproblemmessage

Code0:ErroronHeader(Valueofpointer
pointstothebytewithproblem)
Code1:Optionsmissing
ErrorreportingmessageTypes
RedirectionMessage
RedirectionConcept
QuerymessageTypes
EchoRequestReplyMessage
EchoRequestReply

An echorequest message can be sent by a host or router.


An echoreply message is sent by the host or router
which receives an echorequest message.

Echorequest and echoreply messages can be used by


network managers to check the operation of the IP
protocol.

Echorequest and echoreply messages can test the


reachability of a host. This is usually done by invoking the
ping command.
TimestampRequestReply
Message
TimestampRequestReply
Message

Timestamprequestandtimestampreplymessages
canbeusedtocalculatetheroundtriptimebetween
asourceandadestinationmachineeveniftheir
clocksarenotsynchronized.

Thetimestamprequestandtimestampreply
messagescanbeusedtosynchronizetwoclocksin
twomachinesiftheexactonewaytimedurationis
known.
Checksum
In ICMP the checksum is calculated over the entire
message (header and data).
Lets have an example of checksum calculation for a simple echo
request message. We randomly chose the identifier to be 1 and the
sequence number to be 9. The message is divided into 16bit (2
byte) words. The words are added together and the sum is
complemented. Now the sender can put this value in the checksum
field.
DEBUGGINGTOOLS

Ping
Traceroute
PING

The ping program to test the server fhda.edu. The result


is shown below

$ ping fhda.edu
PING fhda.edu (153.18.8.1) 56 (84) bytes of data.
64 bytes from tiptoe.fhda.edu (153.18.8.1): icmp_seq=0 ttl=62 time=1.91 ms
64 bytes from tiptoe.fhda.edu (153.18.8.1): icmp_seq=1 ttl=62 time=2.04 ms
64 bytes from tiptoe.fhda.edu (153.18.8.1): icmp_seq=2 ttl=62 time=1.90 ms
64 bytes from tiptoe.fhda.edu (153.18.8.1): icmp_seq=3 ttl=62 time=1.97 ms
64 bytes from tiptoe.fhda.edu (153.18.8.1): icmp_seq=4 ttl=62 time=1.93 ms
PING

64 bytes from tiptoe.fhda.edu (153.18.8.1): icmp_seq=5 ttl=62 time=2.00 ms


64 bytes from tiptoe.fhda.edu (153.18.8.1): icmp_seq=6 ttl=62 time=1.94 ms
64 bytes from tiptoe.fhda.edu (153.18.8.1): icmp_seq=7 ttl=62 time=1.94 ms
64 bytes from tiptoe.fhda.edu (153.18.8.1): icmp_seq=8 ttl=62 time=1.97 ms
64 bytes from tiptoe.fhda.edu (153.18.8.1): icmp_seq=9 ttl=62 time=1.89 ms
64 bytes from tiptoe.fhda.edu (153.18.8.1): icmp_seq=10 ttl=62 time=1.98
ms

--- fhda.edu ping statistics ---


11 packets transmitted, 11 received, 0% packet loss, time 10103ms
rtt min/avg/max = 1.899/1.955/2.041 ms
Traceroute

We use the traceroute program to find the route from the


computer voyager.deanza.edu to the server fhda.edu :

$ traceroute fhda.edu
traceroute to fhda.edu (153.18.8.1), 30 hops max, 38 byte packets
1 Dcore.fhda.edu (153.18.31.254) 0.995 ms 0.899 ms 0.878 ms
2 Dbackup.fhda.edu (153.18.251.4) 1.039 ms 1.064 ms 1.083 ms
3 tiptoe.fhda.edu (153.18.8.1) 1.797 ms 1.642 ms 1.757 ms
ICMPPACKAGE
SLIP&POINTTOPOINTPROTOCOL
SerialLineIPProtocol

SLIP - SLIP is a standard protocol for point-to-


point serial connections, using TCP/IP.
SLIP was a predecessor of PPP.

PROBLEM WITH SLIP PROTOCOL


No Error detection.
It supports only IP.
It is not possible to dynamically assign the address during the set up.
Slip does not provide any Authentication.
It is not approved internet standard.
POINTTOPOINTPROTOCOL

PPP provides routertorouter and hosttonetwork


connections over synchronous and asynchronous
circuits.

9 SERVICESPROVIDEDBYPPP:
ThePPPprotocolcanoperateoverafullduplexpointtopoint
transmissionlinkaswellasoverasynchronouslinks.
ThePPPwasanimprovementovertheSLIP.
PPP TRANSITIONSTATES

1.DEAD:Itmeansthatthelinkisnotbeingused.
2.ESTBLISHING:Whenoneoftheendmachinestarts
thecommunication,theconnectiongoesintothe
establishingstate.
3.AUTHENATICATING:Theusersendstheauthenticate
requestpacket&includestheusername&password.
4.NETWORKING:Theexchangeofusercontrolanddata
packetscanstarted.
5.TERMINATING:Theuserssendstheterminatethe
link.Withthereceptionoftheterminate.
PPP STACK

PPPisadatalinkprotocol.Butitusesstackofother
protocolsinordertoestablishthelink,toauthenticate
theusersandtocarrythenetworklayerdata.

1.LinkControlProtocol(LCP).
2.AuthenticatingProtocols.
3.NetworkControlProtocols(NCP).
PPPStack
PPP STACK
FLAG:ThePPPframealwaysbegins&EndswiththeBoundary 01111110

ADDRESS:SincePPPisusedforapointtopointconnection,itusesthe
broadcastaddressusedinmostLANtoavoidadatalinkaddressinthe
protocol.

CONTROL:Thisfieldusesthevalue11000000toshowthattheframedoesnot
containanysequencenumbersandItsIndependent

PROTOCOL:Itdefineswhattypeofdataisbeingcarriedinthedatafield

DATAFIELD:Itcarriestheuserdataorotherinformation.

FCS:TheFrameCheckSequenceissimplya2or4byteCRCusedforerror
detection

You might also like