You are on page 1of 132

E2-E3

CONSUMER FIXED ACCESS


Ethernet, TCP/IP, IP Addressing
For internal circulation of BSNL only

WELCOME
This is a presentation for the E2-E3 Consumer
Fixed Access Module for the Topic: Ethernet
TCP IP,IP Addressing
Eligibility: Those who have got the Upgradation
from E2 to E3.
This presentation is last updated on 15-3-2011.
You can also visit the Digital library of BSNL to
see this topic.

For internal circulation of BSNL only

Outline of Presentation
Introduction

Ethernet Features
Description of CSMA/CD
MAC Frame Structure

TCP / IP Architecture
Functions of Layers
Discussion and Conclusion

For internal circulation of BSNL only

Introduction
Most commonly used medium access
technique for BUS, Star topologies is Carrier
Sense Multiple Access with Collision Detection
Ethernet is Currently most popular N/W
Architecture
Uses CSMA/ CD to regulate the traffic
Ethernet Media is passive
Power is taken from computer. No failure
unless cable cut or improper termination
For internal circulation of BSNL only

Ethernet Features
Traditional Topology - Linear (BUS)
Type of Architecture - Baseband
Access Method - CSMA / CD
Specs. - IEEE 802.3
Transfer speed - 10 /100 / 1000 Mbps

Cable Types - Thicknet, Thinnet, UTP, STP

For internal circulation of BSNL only

Description of CSMA/CD
Description of CSMA / CD

Following rule is followed


if Medium is idle - transmit
medium is busy - Listen till channel idle

If Collision detected during Transmission


-Transmit brief jamming signal to assure
stations know collision & cease Transmission
After Jaming signal wait for random amount of
Time attempt again to Transmit

For internal circulation of BSNL only

CSMA / CD Operation

For internal circulation of BSNL only

CSMA / CD functioning
Description
of CSMA/CD
For BASEBAND bus, the technique is illustrated
At time t0STN A starts session to send packet to D
At time t1 both STN B & C are ready to Transmit
STN B senses Signal on media - defers Transmission
STN C starts to transmit because unaware of As
Transmission
For internal circulation of BSNL only

Description of CSMA/CD
CSMA / CD functioning

At time t2 ,When Transmission of A reaches at STN C


Collision occurs & ceases Transmission

Effect of Collision propagates back to A after time t3


& A ceases Transmission
After random amount of time either A or C starts
retransmission
Time to detect collision is twice the end-to-end
Propagation Delay
For internal circulation of BSNL only

Broadband
collision detection
timing
Description
of CSMA/CD

For internal circulation of BSNL only

Description
of CSMA/CD
Broadband collision
detection timing

For internal circulation of BSNL only

Description
of CSMA/CD
Broadband
collision detection
timing

For internal circulation of BSNL only

Description
of CSMA/CD
CSMA
/ CD functioning
For BROADBAND BUS, delay is even longer
Figure on previous slide shows Dual Cable System
If Collision occurs, Stations cease Transmission
In Broadband Bus, Maximum Time to detect
collision is four times the end-to-end Propagation
Delay from an end of the cable to the Head-end.

For internal circulation of BSNL only

CSMA / CD
Description
offunctioning
CSMA/CD
Important Rule followed
IEEE Standard also includes that
Frame should be long enough to allow collision
detection prior to the end of Transmission
If Shorter frames are used, collision detection
does not occur
CSMA / CD exhibits same performance as the
less efficient CSMA Protocol
Simpler collision detection with UTP/STP Star
Topology approach
In Star, collision detection is based on Logic
rather than sensing voltage magnitudes
For internal circulation of BSNL only

Description of CSMA/CD
CSMA / CD functioning

For any Hub,


Any activity on more than one input-collision
Special Signal called Collision presence signal is
generated
This signal is sent till the activity is sensed
This signal is interpreted as occurrence of
Collision by every node

For internal circulation of BSNL only

MAC Frame
Format
MAC Frame
OCTECTS
Preamb
le

Length

SFD

DA

Legend
SFD- Start Frame Delimiter
DA = Destination Address

SA

LLC
Data

Pad

FCS

SA= Source Address


FCS = Frame Check Sequence

IEEE 802.3 Frame Format


For internal circulation of BSNL only

MAC Frame
Preamble
7-Octet pattern of alternating 0s & 1s
Used by receiver to establish bit synchronization

Start Frame Delimiter(SFD)


Sequence 10101011
Indicates start of the frame
Enables receiver to locate first bit of the rest of
the frame

For internal circulation of BSNL only

MAC Frame
LLC (Logical Link Control) Data
Data unit supplied by LLC

Pad
Octets added to ensure that frame is long
enough for proper CD(Collision Detection)
operation
Frame Check Sequence(FCS)
32-bit Cyclic Redundancy Check based on
all fields except the preamble, SFD & FCS

For internal circulation of BSNL only

MAC Frame
Destination Address(DA)
Specifies the station of destination
Unique physical address - 48 bit address
Group address
Global address
Source Address(SA)
Specifies station that sent frame
Length
Length of the LLC (Logical Link Control) Data field

For internal circulation of BSNL only

TCP/IP Internet Architecture

For internal circulation of BSNL only

TCP/IP Internet Architecture

For internal circulation of BSNL only

Concept of Layering

For internal circulation of BSNL only

Function of Layers
Application Layer
Highest layer in the Layer Structure
Used for Communication between Hosts
Protocols
SMTP(Simple Mail Transfer Protocol
FTP ( File Transfer Protocol)

Transport Layer
Encapsulation of Application Layer data
Protocols
Transmission Control Protocol(TCP)
User Datagram Protocol(UDP)
For internal circulation of BSNL only

Function of Layers
Transport Layer Contd .
Group of Methods & Protocols
within Layered Architecture of
Network Components responsible for
encapsulating application data blocks
into Data Units called Datagrams or
Segments
Suitable for transfer to Network
Infrastructure

For internal circulation of BSNL only

Addressing Concepts

For internal circulation of BSNL only

INTERNATE PROTOCOL (IP)

For internal circulation of BSNL only

Outline of Presentation
Internet Protocol- Introduction
Internet Protocol- Header
Header Fields
Header Length ,
Version
Type of Service,
Total Length
Identification,
Fragmentation Offset
Flags,
Time To Live
Protocol,
Checksum
Source AddressDestination Address
Option
Time Stamp option
Padding
For internal circulation of BSNL only

Internet Protocol

UNRELIABLE

CONNECTION LESS

For internal circulation of BSNL only

INTERNET PROTOCOL (IP)


The Internet Layer is responsible to connect to
two machines through Internet
In its operation, the Internet Layer is not
responsible for reliable transmission
It provides only an unreliable service, and "best
effort" delivery.
The network gives no guarantee about packets'
proper arrival

For internal circulation of BSNL only

INTERNET PROTOCOL (IP)


The function of providing reliability of service is
the duty of higher level protocols, such as the
Transmission Control Protocol (TCP) in the
Transport Layer
Integrity of packets is guaranteed in IPv4 through
checksums
Datagram consists of a header and data
Fig. identifies each field of Header

For internal circulation of BSNL only

Internet Protocol Header details

For internal circulation of BSNL only

Header Length 4 Bit field


Value represents the number of octets in the
header divided by four which makes it the
number of 4-octet groups in the header
Header length is used as a pointer to the
beginning of data
Header length is usually equal to 5 which
defines the normal, 20-octet header without
options

For internal circulation of BSNL only

Header Length 4 Bit field


When options are used, padding may be
required to make the total size of the header an
even multiple of 4-octet groups. The range of
value for the header length is 5 to 15

For internal circulation of BSNL only

Version 4 Bit field


All other values are reserved or unassigned.
Although the range of values is 0 to 15, the
value used by IP is 4.
By means of this field, different versions of the
IP could operate in the Internet

For internal circulation of BSNL only

Type of Service 8 Bit field


Specifies the precedence and priority of the IP
datagram
Bits +5, +6, and +7 make up the precedence
field, with a range of 0 to 7
Zero is the normal precedence and 7 is
reserved for network control
Most gateways presently ignore this field

For internal circulation of BSNL only

Type of Service 8 Bit field


The four bits (+1, +2, +3, and +4) define the priority field,
which has the field range of 0 to 15
Four priorities presently assigned (the remaining 12 values
are reserved) are:
value 0 (the default, normal service)
value 1 (minimize monetary cost)
value 2 (maximize reliability)
value 4 (maximize throughput)
value 8 (bit+4 equal to one, defines minimize delay
option).
These values are used by routers to select paths that
accommodate the users request
For internal circulation of BSNL only

Total Length 16 Bit field


The total length field is used to identify the
number of octets in the entire datagram
The field has 16 bits, and the range is between 0
and 65,535 octets.
Since the datagram typically is contained in an
Ethernet frame, the size usually will be less than
1,500 octets

For internal circulation of BSNL only

Identification 16 Bit field


The value of the identification field is a
sequential number assigned by the originating
host. The numbers cycle between 0 and 65,535

For internal circulation of BSNL only

Fragmentation Offset 13 Bit field


When the size of a datagram exceeds the
maximum of an intermediate network, it is
segmented by that network
Fragment offset represents the displacement (in
increments of eight octets) of this segment form
the beginning of the entire datagram.

For internal circulation of BSNL only

Fragmentation Offset 13 Bit field

This is a 13-bit field and provides an offset to


the proper location within the original datagram
of this fragmented segment
Since the value represents groups of eight
octets, the effective range of the offset is
between 0 and 8191 octets.

For internal circulation of BSNL only

Flags 2 Bits
The flag field contains two flags
Low-order bit (MF) of the flags fields is used to
denote the last fragmented datagram when set
to zero
Intermediate (not-last) datagrams have the bit
set equal to 1 to denote more datagrams are to
follow
High-order bit (DF) is set by an originating host
to prevent fragmentation of the datagram

For internal circulation of BSNL only

Flags 2 Bits

When this bit is set and the length of the


datagram exceeds that of an intermediate
network, the datagram is discarded by the
intermediate network and an error message
returned to the originating host via the ICMP

For internal circulation of BSNL only

Time to Live (TTL)8 Bit field


Count set by the originator, that the datagram can
exist in the Internet before being discarded host
via the ICMP
Datagram may loop around an Internet for a
maximum of 28 1 or 255 before being discarded
Default TTL for the IP is 64
Each gateway handling a datagram decrements
the TTL by one, the TTL can also represent a hop
count

For internal circulation of BSNL only

Protocol 8 Bit field


Protocol field is used to identify the next higher
layer protocol using the IP
For TCP value = 6
For UDP value = 17
Can identify upto 255 Protocols of Transport
Layer
Upper Layer Protocol using IP must have a
unique protocol number

For internal circulation of BSNL only

Checksum 16 Bit field


Checksum provides assurance that the header
has not been corrupted during transmission
Checksum includes all fields in the IP header,
starting with the version number and ending with
the octet immediately preceding the IP data field
Checksum represents the 16-bit, twos
complement of the sum of all 16-bit groups in the
header

For internal circulation of BSNL only

Checksum 16 Bit field


An intermediate network (node or gateway) that
changes a field in the IP header (e.g., time-tolive) must recompute the checksum before
forwarding it
Users of the IP must provide their own data
integrity, since the IP checksum is only for the
header.

For internal circulation of BSNL only

Source Address -32 Bit field

The source address field contains the network


identifier and host identifier of the originator

For internal circulation of BSNL only

Destination Address - 32 Bit field


Destination address field contains the network
and identifier & Host identifier of the destination

For internal circulation of BSNL only

Options variable field


Presence of the options field is determined
from the value of the header length field
If the header length is greater than five, at least
one option is present
Options field is variable in length
Each option declared begin with a Single Octet
that defines that format of the remainder of the
option

For internal circulation of BSNL only

Timestamp Option

Timestamp option provides the user with a


technique of recording the precise route taken
by a datagram and the time that each element
(node or gateway) handling the datagram
processed it.

For internal circulation of BSNL only

Record/Strict/Loose Source Routes

provides a routing trace of the datagram


strict source route option permits the originator
can be useful to force all traffic over a particular
path for testing
Loose source routing is similar, except only the
major IP addresses are entered in the list of IP
addresses

For internal circulation of BSNL only

Record/Strict/Loose Source Routes

Internet my take any desired intermediate path


so long as the datagram visits the IP nodes
identified

For internal circulation of BSNL only

Padding variable field


Pad field, when present, consists of 1 to 3 octets
of zero, as required, to make the total number of
octets in the header divisible by four.
(The header length is in increments of 32-bit
groups.)

For internal circulation of BSNL only

Transmission Control Protocol

For internal circulation of BSNL only

Outline of Presentation

Introduction
Transport Layer
Transport Layer Protocols
User Datagram Protocol
Transmission Control Protocol
Internet Control Message Protocol
Internet Group Management Protocol
Discussion and Conclusion

For internal circulation of BSNL only

TCP/IP PROTOCOL SUITE


TCP/IP PROTOCOL SUITE IS MADE UP OF
FIVE LAYERS

Application
Transport
Network
Datalink
Physical
For internal circulation of BSNL only

For internal circulation of BSNL only

TRANSPORT LAYER
Two protocols are provided in this layer

TCP

UDP

For internal circulation of BSNL only

Transport Layer Protocols


User Datagram Protocol (UDP)
Transmission control protocol (TCP)
selection by an applications program to use
either UDP or TCP is based on the
requirement for reliability
Some application layer protocols were
designed to operate with either UDP or TCP

For internal circulation of BSNL only

Transport Layer Protocols

Selection by the IP of either the UDP or TCP is


based on the protocol number in the IP header
Although ICMP and IGMP gain control as
transport layer functions, they function as a utility
to the network layer (IP)
TCP/IP designers used the protocols number in
the IP header to demultiplex to distinct services

For internal circulation of BSNL only

USER DATAGRAM PROTOCOL (UDP)

UDP provides application programs with a


transaction oriented, single-shot datagram type
service
Connectionless and unreliable
Simple, efficient and ideal for application programs
such as TFTP and DNS

For internal circulation of BSNL only

USER DATAGRAM PROTOCOL (UDP)


Destination port number in the UDP header is used to
direct the UDP datagram (or user datagram) to a specific
application process (queue) located at the IP address
Source port number that allows the receiving process to
know how to respond to the user datagram
No acknowledgement, flow control, message
continuation

For internal circulation of BSNL only

USER DATAGRAM Header

For internal circulation of BSNL only

Source/Destination Port Numbers 16


Bit field
Source and Destination port Nos. in conjunction
with the IP addresses define the end points of the
single-shot communication
Source port number may be equal to zero if not
used
Destination port number is only meaningful within
the context of a particular UDP datagram and IP
address

For internal circulation of BSNL only

Source/Destination Port Numbers


16 Bit field
There are some fixed, preassigned port number
used for services on the Internet
For example
Number 7 is used for the UDP echo server
Number 69 is used for Trivial File Transfer
Protocol (TFTP)
These fixed, preassigned port numbers are
referred to as well-known ports and controlled
by the IANA ( Internet Assigned Numbers
Authority)

For internal circulation of BSNL only

Length Field 16 Bit field


UDP message-length field is 16-bit field that
contains a count of the total number of octets
in the user datagram, including the header
Minimum-size length field is 8

For internal circulation of BSNL only

Checksum 16 Bit field


Usage of the UDP checksum is optional
Field must be set to zero when not used
Since the IP layer does not include the data portion
of the IP datagram in its checksum (protocols the IP
header only), UDP has its own checksum to

provide data integrity

For internal circulation of BSNL only

Transmission Control Protocol


TCP is
Connection
oriented

Reliable
TCP provides

Process to process communication

A process is identified by a Port no

For internal circulation of BSNL only

Functions of TCP
Multiplexing data from multiple applications
Testing received data for the integrity
Sequencing packets that may have arrived out of order
Acknowledging successful receipt of packets
Rate adaptive data flow control
Timing

Coordinating the re-transmission of packets


that was Damaged or lost in travel.
For internal circulation of BSNL only

TCP Segment Format


TCP segment consists of
TCP Header
data
Header portion of the TCP segment is relatively fixed
in size
Only optional field is the options field, which may
necessitate a pad field to assure that the overall
header length is a multiple of four-octet groups
Format of the TCP segment is illustrated in Figure

For internal circulation of BSNL only

TCP Segment Format

For internal circulation of BSNL only

Various Fields of TCP


Source/Destination Port Numbers
Each port number is an unsigned integer occupying
16 bits
Sequence Numbers
32 bits long and first time randomly generated by
the System
SN of the first TCP segment identifies the first octet
of the entire stream

For internal circulation of BSNL only

Various Fields of TCP


If value of Sequence Number = n
Value of 2nd TCP Segment
=n+m
m - the octet displacement within the total stream
to the beginning of the second TCP segment

For internal circulation of BSNL only

Various Fields of TCP

Acknowledgement Numbers
Second Sequence Number(SSN) is called
Expected receive sequence number (AKN) also
called the Acknowledgement number
AKN is a 32 bit field
AKN acknowledges the receipt of m 1 octets
by stating the next expected SSN of m

For internal circulation of BSNL only

Various Fields of TCP


Header length
Header length is a 4-bit field
Integer equal to the total number of octets in
the TCP header, divided by four represents the
number of 4-octet
groups in the header
Typical Value = 5
Pad Field is used to force No. of Octets in
Header equal to Multiples of Four
Three octets in the pad field, each containing
the value zero
For internal circulation of BSNL only

Various Fields of TCP


Code Bits
URG bit =1 Urgent Information
ACK bit = 1 Acknowledgment is valid
PSH bit = 1 Transmit Buffer full
RST bit = 1 Reset of TCP connection
SYN bit =1 To synchronize Sequence Nos.
FIN bit =1 To close the connection

For internal circulation of BSNL only

Various Fields of TCP


Window
Window field is a 16-bit unsigned integer
To advertise the available buffer size (in
octets) of the sender to receive data

Options
Option field permits the application program
to negotiate
Maximum TCP segment size able to receive

For internal circulation of BSNL only

Various Fields of TCP


Padding
Consists of one to three octets equal to 0
to force the length of the TCP header to be in
multiples of four octets
If options are nor used, padding is not required

For internal circulation of BSNL only

Various Fields of TCP


Checksum

Since IP does not include the


Data portion of the Datagram in
its Checksum and finds
checksum of only IP Header, TCP
has its own checksum to provide
data integrity

For internal circulation of BSNL only

Internet Control Message Protocol


ICMP is used to report the error message back
to the source
ICMP message is encapsulated in an IP
datagram
Error messages for different types of errors have
different type field value

For internal circulation of BSNL only

Internet Control Message Protocol

For internal circulation of BSNL only

ICMP Type Codes


Type Field
0
3
4
5
8
11
12
13
14
17
18

ICMP Message Type


Echo Reply
Destination Unreachable
Source Quench
Redirect ( Change Route)
Echo Request
Time exceeded for a Datagram
Parameter problem on a Datagram
Time Stamp Request
Time Stamp Response
Address Mask Request
Address Mask Response

For internal circulation of BSNL only

Flow Control
Flow control is the process of managing the rate
of data transmission between two nodes to
prevent a fast sender from outrunning a slow
receiver

For internal circulation of BSNL only

Time-To-Live Exceeded
To prevent routing loops, the IP datagram
contains a time-to-live that is set by the originator
As each gateway processes the datagram, it
decrements Time-To-Live by one
When zero is detected, the gateway sends an
ICMP error message to the originator and
discards the datagram

For internal circulation of BSNL only

INTERNET GROUP MANAGEMENT


PROTOCOL (IGMP)

Communications protocol used to manage the


membership of Internet Protocol multicast
groups
IGMP is used by IP hosts and adjacent
multicast routers to establish multicast group
memberships

For internal circulation of BSNL only

IP Addressing

For internal circulation of BSNL only

AGENDA

Introduction
Binary Form of IP Address
Dotted Decimal Notation
Classes of IP Address
Private Subnets
Subnetting
Subnet Mask
Supernetting
Logical Operations
Discussion & Conclusion

For internal circulation of BSNL only

Introduction
Each host on the internet is assigned a 32-bit
integer address called its internet address or IP
address
Clever part of internet addressing is that the
integers are carefully chosen to make routing
efficient
Every host and router on the internet has an IP
address, which encodes its network number and
host number
Combination is unique: no two machines have the
same IP address
For internal circulation of BSNL only

Introduction
Address is coded to allow a variable allocation of bits to
specify network and host
IP address scheme is to break up the binary number into
pieces and represent each piece as a decimal number

Natural size for binary pieces is 8 bits, which is the familiar


byte or octet
lets take our binary number, write it using groups of 8 bits,
and then represent each group as a decimal number
For Ex. 140.179.220.200
For internal circulation of BSNL only

Binary form of IP Address


Binary Notation

10001100.10110011.11011100.1100100

140.179.220.200
Dotted Decimal Notation

For internal circulation of BSNL only

Parts of IP Address
Every IP address consists of two parts
Network part
Host part
Class of the address and the subnet mask
determine which part belongs to the network
address and which part belongs to the host address
Dot as a separator and is called as period

For internal circulation of BSNL only

Parts of IP Address

For internal circulation of BSNL only

Various Classes of IP Address

For internal circulation of BSNL only

IP Address should be hierarchical


For a protocol to be routable, its address
structure must be hierarchical meaning that the
address must contain at least two parts
Network portion
Host portion
Host is an end station such as a computer
workstation, a router or a printer whereas a
network consists of one or more hosts

For internal circulation of BSNL only

Address Classes
Encoding provides flexibility in assigning addresses to host
and allows a mix of network sizes on an internet
In particular, the three network classes are best suited to
the following conditions
Class
Networks
Hosts
A
126
16,777,214
B
16,384
65,534
C
2,097,152
254
Class D: Reserved for IP Multicasting
Class E: Reserved for future use

For internal circulation of BSNL only

More about IP address Classes


You can determine which class any IP address is in by
examining the first 4 bits of the IP address
Class
Binary Form
Decimal Form
Class A
0xxx
1 to 126
Class B
10xx
128 to 191
Class C
110x
192 to 223
Class D
1110
224 to 239
Class E
1111
240 to 254

For internal circulation of BSNL only

More about IP address Classes


Addresses beginning with 01111111, or 127
decimal are reserved for loopback and for
internal testing on a local machine
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
For internal circulation of BSNL only

Class Determination Process


Now we can see how the Class determines,
by default, which part of the IP address
belongs to the network (N) and which part
belongs to the Host (H)
Class A
NNNNNNNN.hhhhhhhh. hhhhhhhh. hhhhhhhh

Class B - NNNNNNNN.NNNNNNNN.hhhhhhhh.hhhhhhhh
Class C- NNNNNNNN.NNNNNNNN.NNNNNNNN. hhhhhhhh
For internal circulation of BSNL only

Private Subnets
There are three IP network addresses reserved
for private networks.
The addresses are :
10.0.0.0/8
172.16.0.0/12
192.168.0.0/16
They can be used by anyone setting up internal
IP networks, such as a lab or home

For internal circulation of BSNL only

Subnetting
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

For internal circulation of BSNL only

Subnet Masking
Applying a subnet mask to an IP address
allows you to identify the network and host
parts of the address
Network bits are represented by the 1s in
the mask
Host bits are represented by the 0s
Performing a bitwise logical AND operation
between the IP address and the subnet
mask results in the Network Address or
Number
For internal circulation of BSNL only

For example
Logical AND operation 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

11111111.11111111.00000000.00000000 255.255. 0. 0 Default class B

Subnet Mask

-------------------------------------------------------------------------10001100.10110011.00000000.00000000 140.179.0.0 Network Address

For internal circulation of BSNL only

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

For internal circulation of BSNL only

More Restrictive Subnet Masks


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, the result defines the Subnet
Address (also called the Network Address
or Network Number)
There are some restrictions on the subnet
address
For internal circulation of BSNL only

More Restrictive Subnet Masks


Host addresses of all "0"s and all "1"s are
reserved for specifying the local network
(when a host does not know it's network
address) and all hosts on the network
(broadcast address), respectively
To calculate the number of subnets or hosts,
use the formula
2n 2

where n = number of bits in either field, and


2n represents 2 raised to the nth power
For internal circulation of BSNL only

More Restrictive Subnet Masks


Multiplying the number of subnets by the
number of hosts available per subnet
gives you the total number of hosts
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 on next slide please

For internal circulation of BSNL only

Example
10001100.10110011.11011100.11001000 140.179.220.200 IP Address
11111111.11111111.11100000.00000000 255.255.224.0 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 3 bit subnet mask was used

For internal circulation of BSNL only

Example
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) hosts
Each subnet can have hosts assigned to any
address between the Subnet address and the
Broadcast address
This gives a total of 49,140 hosts for the entire
class B address subnetted this way
Notice that this is less than the 65,534 hosts an
unsubnetted class B address would have.
For internal circulation of BSNL only

Example
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 to 0s
Similarly, you can calculate the Broadcast Address
for a subnet by 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
For internal circulation of BSNL only

Another Example
Say you are assigned a Class C network
number of 200.133.175.0
Utilize this network across multiple small groups
within an organization
You can do this by subnetting that network with a
subnet address
Break this network into 16 subnets of 14 hosts
each

For internal circulation of BSNL only

Second Example Contd.


This will limit us to 224 hosts 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 default Class C subnet mask
255.255.255.0

For internal circulation of BSNL only

Second Example Contd.


255.255.255.0
11111111.11111111.11111111.00000000
Extending this by 4 bits yields a mask of
255.255.255.240
11111111.11111111.11111111.11110000
This gives us 16 possible network numbers

For internal circulation of BSNL only

16 Possible combinations
Subnet Network
bits
Number

Host
Addresses

Broadcast
Address

0000

200.133.175.0

.1 thru .14

200.133.175.15

0001

200.133.175.16

.17 thru .31

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 .79

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

For internal circulation of BSNL only

16 Possible combinations
Subnet Network
bits
Number

Host
Addresses

Broadcast
Address

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

.241 thru .254

200.133.175.255

For internal circulation of BSNL only

Supernetting
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 address
blocks which contain over 16 Million host
addresses

For internal circulation of BSNL only

Supernetting
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
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
For internal circulation of BSNL only

Supernetting

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 address
255.255.252.0 (11111111.11111111.11111100.00000000) Subnet Mask
192.60.131.255 (11000000.00111100.10000011.11111111) Broadcast address

For internal circulation of BSNL only

Supernetting
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 the host portion is
10 bits long
Instead of spelling out the bits of the subnet
mask, it is simply listed as the number of 1s bits
that start the mask

For internal circulation of BSNL only

Supernetting

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

For internal circulation of BSNL only

Supernetting
If you look at the subnet mask in binary
11111111.11111111.11111100.00000000
you can easily see how this notation works

For internal circulation of BSNL only

Allowed Class A Subnet and Host IP


addresses
#bits Subnet Mask

CIDR

# Subnets #Hosts

Nets * Hosts

255.192.0.0

/10

4194302

8388604

255.224.0.0

/11

2097150

12582900

255.240.0.0

/12

14

1048574

14680036

255.255.248.0

/13

30

524286

15728580

255.255.252.0

/14

62

262142

16252804

255.255.254.0

/15

126

131070

16514820

255.255.255.0

/16

254

65534

16645636

For internal circulation of BSNL only

Allowed Class A Subnet and Host IP


addresses
#bits Subnet Mask

CIDR

# Subnets #Hosts

Nets * Hosts

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

For internal circulation of BSNL only

Allowed Class A Subnet and Host IP


addresses
#bits Subnet Mask

CIDR # Subnets #Hosts

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

12582900

22

255.255.255.252

/30

4194302

8388604

For internal circulation of BSNL only

Nets * Hosts

Allowed Class B Subnet and Host IP


addresses
#bits Subnet Mask

CIDR

# Subnets

#Hosts

Nets * Hosts

255.255.192.0

/18

16382

32764

255.255.192.0

/19

8190

49140

255.255.240.0

/20

14

4094

57316

255.255.248.0

/21

30

2046

61380

255.255.252.0

/22

62

1022

63364

255.255.254.0

/23

126

510

64260

255.255.255.0

/24

254

254

64516

For internal circulation of BSNL only

Allowed Class B Subnet and Host IP


addresses
#bits Subnet Mask

CIDR

# Subnets #Hosts

Nets *
Hosts

255.255.192.128

/25

510

126

64260

10

255.255.192.192

/26

1022

62

63264

11

255.255.240.224

/27

2046

30

61380

12

255.255.248.240

/28

4094

14

57316

13

255.255.252.248

/29

8190

49140

14

255.255.254.252

/30

16382

32764

For internal circulation of BSNL only

Allowed Class C Subnet and Host IP


addresses
#bits

Subnet Mask

CIDR

#Hosts

Nets *
Hosts

/26

#
Subnet
s
2

255.255.255.192

62

124

255.255.255.224

/27

30

180

255.255.255.240

/28

14

14

196

255.255.255.248

/29

30

180

255.255.255.252

/30

62

124

For internal circulation of BSNL only

Logical Operations
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
These operations are essential to
performing digital math operations

For internal circulation of BSNL only

Truth Tables
AND
I/P A

I/P B

O/P

For internal circulation of BSNL only

Truth Tables
OR
I/P A

I/P B

O/P

For internal circulation of BSNL only

Truth Tables
XOR
I/P A

I/P B

O/P

For internal circulation of BSNL only

Truth Tables
NOT
I/P

O/P

For internal circulation of BSNL only

For internal circulation of BSNL only

You might also like