You are on page 1of 368

NETWORKING

What is a Networking ?

 Networking is connecting
computers together so that you
can exchange information
between them
Computer network
connects two or more
autonomous
computers.

The computers can


be geographically
located anywhere.
LAN, MAN & WAN
Network in small geographical Area (Room,
Building or a Campus) is called LAN (Local
Area Network)

Network in a City is call MAN (Metropolitan


Area Network)

Network spread geographically (Country or


across Globe) is called WAN (Wide Area
Network)
Advantages Of Networking


Availability of data any time, anywhere
irrespective of the physical origin of the
data

 Resource sharing minimizes resource


requirements.

 Ease of management
Common Terms

SERVER

CLIENT
Who is a Server ?

 Any computer that servers


something to other computers
in the network is called a
SERVER.
Examples----
 A Windows 2003 server serving IP addresses
to other computers in the network is called a
DHCP SERVER

 A Windows XP computer with a printer


attached to it & allowed other computers in the
network to print to it is called a PRINT
SERVER
Who is a CLIENT ?

 Any computer in a network that


takes some kind of service from
another computer (server) is
called a CLIENT
OSI Layers
 OSI Layers introduced by ISO

 ISO- International Standards


Organization
OSI – Open System
Interconnect
OSI Layers .. Advantages
 Makes easy to understand the process
of networking.

 Helps in defining the role of a product


in a network & its specifications.

 Standard specifications provide


compatibility between products from
different manufacturers.
OSI Layers
 Seven Layer Model
 1. Physical
 2. Data Link
 3. Network
 4. Transport
 5. Session
 6. Presentation
 7. Application
Physical Layer

 Deals With the Physical Connection


Between the computers.

 Provides specifications for building a


physical infrastructure of a network ……
TOPOLOGY
Introduction

 Physical and Logical Topologies


 Physical Topologies

• Bus
• Ring
• Star
• Extended Star
• Mesh
• Hybrid
Network Topology
The network
topology defines
the way in which
computers, printers,
and other devices
are connected. A
network topology
describes the layout
of the wire and
devices as well as
the paths used by
data transmissions.
Bus Topology
Commonly
referred to as a
linear bus, all the
devices on a bus
topology are
connected by one
single cable.
Star & Tree Topology
The star topology is the most
commonly used architecture in
Ethernet LANs.
When installed, the star topology
resembles spokes in a bicycle
wheel.
Larger networks use the extended
star topology also called tree
topology. When used with network
devices that filter frames or
packets, like bridges, switches,
and routers, this topology
significantly reduces the traffic on
the wires by sending packets only
to the wires of the destination
host.
Ring Topology
A frame travels around the ring,
stopping at each node. If a node
wants to transmit data, it adds the
data as well as the destination
address to the frame.
The frame then continues around the
ring until it finds the destination
node, which takes the data out of the
frame.
− Single ring – All the devices on the
network share a single cable
Dual ring – The dual ring topology
allows data to be sent in both
directions.
Mesh Topology
The mesh topology
connects all devices
(nodes) to each other
for redundancy and
fault tolerance.
It is used in WANs to
interconnect LANs and
for mission critical
networks like those
used by banks and
financial institutions.
Implementing the mesh
topology is expensive
and difficult.
Network Components
Physical Media
Interconnecting Devices
Computers
Networking Software
Applications
PHYSICAL MEDIA
Physical Media

Physical Media
Physical Media
Copper
Coaxial Cable - Thick or Thin
Unshielded Twisted Pair - CAT 3,4,5,5e&6
Optical Fiber
Multimode
Singlemode
Wireless
Short Range
Medium Range (Line of Sight)
Satellite
Copper Media: Coaxial Cable
Coaxial cable is a copper-
cored cable surrounded
by a heavy shielding and
is used to connect
computers in a network.
Outer conductor shields
the inner conductor from
picking up stray signal Category Impedance Use
from the air.
RG-59 75 Ω Cable TV
High bandwidth but lossy
channel. Thin
RG-58 50 Ω
Ethernet
Repeater is used to Thick
regenerate the weakened RG-11 50 Ω
Ethernet
signals.
Copper Media: Twisted Pair
Twisted-pair is a type of
cabling that is used for
telephone communications
and most modern Ethernet
networks.
A pair of wires forms a
circuit that can transmit
data. The pairs are twisted to
provide protection against
crosstalk, the noise
generated by adjacent pairs.
There are two basic types,
shielded twisted-pair (STP)
and unshielded twisted-pair
(UTP).
Shielded Twisted Pair (STP)
Unshielded Twisted Pair (UTP)
Unshielded Twisted Pair (UTP)
Consists of 4 pairs (8 wires) of
insulated copper wires typically
about 1 mm thick.
The wires are twisted together in a
helical form.
Twisting reduces the interference
between pairs of wires.
High bandwidth and High attenuation
channel.
Flexible and cheap cable.
Category rating based on number of
twists per inch and the material used
CAT 3, CAT 4, CAT 5, Enhanced CAT
5 and now CAT 6.
Categories of UTP

UTP comes in several categories that are based


on the number of twists in the wires, the
diameter of the wires and the material used in
the wires.

Category 3 is the wiring used primarily for


telephone connections.

Category 5e and Category 6 are currently the


most common Ethernet cables used.
Categories of UTP: CAT 3
Bandwidth 16 Mhz
11.5 dB Attenuation
100 ohms Impedance
Used in voice applications and 10baseT
(10Mbps) Ethernet
Categories of UTP: CAT 4
20 MHz Bandwidth
7.5 dB Attenuation
100 ohms Impedance
Used in 10baseT (10Mbps) Ethernet
Categories of UTP: CAT 5
100 MHz Bandwidth
24.0 dB Attenuation
100 ohms Impedance
Used for high-speed data transmission
Used in 10BaseT (10 Mbps) Ethernet & Fast
Ethernet (100 Mbps)
Categories of UTP: CAT 5e
150 MHz Bandwidth
24.0 dB Attenuation
100 ohms Impedance
Transmits high-speed data
Used in Fast Ethernet (100 Mbps), Gigabit
Ethernet (1000 Mbps) & 155 Mbps ATM
Categories of UTP: CAT 6
250 MHz Bandwidth
19.8 dB Attenuation
100 ohms Impedance
Transmits high-speed data
Used in Gigabit Ethernet (1000 Mbps) & 10
Gig Ethernet (10000 Mbps)
Fiber Media

Optical fibers use


light to send
information through
the optical medium.
It uses the principal
of total internal
reflection.
Modulated light
transmissions are
used to transmit the
signal.
Total Internal Reflection
Fiber Media
Light travels through the optical media by
the way of total internal reflection.
Modulation scheme used is intensity
modulation.
Two types of Fiber media :
Multimode
Singlemode
Multimode Fiber can support less bandwidth
than Singlemode Fiber.
Singlemode Fiber has a very small core and
carry only one beam of light. It can support
Gbps data rates over > 100 Km without using
repeaters.
Single and Multimode Fiber

Single-mode fiber
Carries light
pulses along single
path
Uses Laser Light
Source

Multimode fiber
Many pulses of
light generated by
LED travel at
different angles
Fiber Media
The bandwidth of the fiber is limited due to
the dispersion effect.
Distance Bandwidth product of a fiber is
almost a constant.
Fiber optic cables consist of multiple fibers
packed inside protective covering.
62.5/125 µm (850/1310 nm) multimode fiber
50/125 µm (850/1310 nm) multimode fiber
10 µm (1310 nm) single-mode fiber
Physical Media

Fiber-Optic Cable
Contains one or several
glass fibers at its core
Surrounding the fibers is
a layer called cladding
Fiber Optic Cable
FO Cable may have 1 to
over 1000 fibers
Wireless Media
Very useful in difficult
terrain where cable
laying is not possible.
Provides mobility to
communication
nodes.
Right of way and
cable laying costs
can be reduced.
Susceptible to rain,
atmospheric
variations and
Objects in
transmission path.
Wireless Media
Indoor : 10 – 50m : BlueTooth, WLAN
Short range Outdoor : 50 – 200m: WLAN
Mid Range Outdoor : 200m – 5 Km : GSM,
CDMA, WLAN Point-to-Point, Wi-Max
 Long Range Outdoor : 5 Km – 100 Km :
Microwave Point-to-Point
Long Distance Communication : Across
Continents : Satellite Communication
Frequency Bands
Propagatio
Band Range Application
n
VLF 3–30 KHz Ground Long-range radio navigation
Radio beacons and
LF 30–300 KHz Ground
navigational locators
MF 300 KHz–3 MHz Sky AM radio
Citizens band (CB),
HF 3–30 MHz Sky
ship/aircraft communication
Sky and VHF TV,
VHF 30–300 MHz
line-of-sight FM radio
Line-of- UHF TV, cellular phones,
UHF 300 MHz–3 GHz
sight paging, satellite
Line-of-
SHF 3–30 GHz Satellite communication
sight
Line-of-
EHF 30–300 GHz Long-range radio navigation
sight
Wireless LAN

PC

Access Point

Internet Switch
Router

PC

Access Point
Terrestrial Microwave
Microwaves do not
follow the curvature of
earth
Line-of-Sight
transmission
Height allows the signal
to travel farther
Two frequencies for
two way
communication
Repeater is used to
increase the distance
Hop-by-Hop
Satellite Communication
Physical vs. Logical
Topology
 The actual layout of a network and its media
is its Physical Topology
 The way in which the data access the
medium and transmits packets is the Logical
Topology
 A glance at a network is not always
revealing. Cables emerging from a Hub does
not make it necessarily a Star Topology – it
may actually be a bus or a ring
Physical vs. Logical Topology
 Your choice of Logical Topology will affect
the Physical Topology – and vice versa

 Design carefully – it may be difficult to


change part way through the installation

 Your choice will determine cable installation,


network devices, network connections,
protocols (and where you will drill holes in
the building !)
Factors
 Cost

 Scalability

 Bandwidth Capacity
 Ease of Installation

 Ease of fault finding and maintenance


Bus Topology
Bus Topology
 Network maintained by a single cable
 Cable segment must end with a
terminator
 Uses thin coaxial cable (backbones
will be thick coaxial cable)
 Extra stations can be added in a
daisy chain manner
Bus Topology
 Standard is IEEE 802.3
 Thin Ethernet (10Base2) has a maximum
segment length of 200m
 Max no. of connections is 30 devices

 Four repeaters may be used to a total


cable length of 1000m
 Max no. of nodes is 150
Bus Topology
 Thick Ethernet (10Base5) used
for backbones
 Limited to 500m
 Max of 100 nodes per segment
 Total of four repeaters , 2500m,
with a total of 488 nodes
Bus Topology

Advantages Disadvantages
 Inexpensive to
 No longer recommended
install  Backbone breaks, whole
 Easy to add stations
network down
 Limited no of devices can
 Use less cable than
be attached
other topologies  Difficult to isolate problems
 Works well for small
 Sharing same cable slows
networks response rates
Ring Topology
Ring Topology
 No beginning or end (a ring in fact !!)
 All devices of equality of access to media
 Single ring – data travels in one direction only, guess what a
double ring allows !?
 Each device has to wait its turn to transmit
 Most common type is Token Ring (IEEE 802.5)
 A token contains the data, reaches the destination, data
extracted, acknowledgement of receipt sent back to
transmitting device, removed, empty token passed on for
another device to use
Ring Topology
Advantages
 Data packets travel
Disadvantages
at great speed  Requires more cable
 No collisions
than a bus
 Easier to fault find
 A break in the ring
 No terminators will bring it down
required  Not as common as the
bus – less devices
available
Star Topology
Star Topology

 Like the spokes of a wheel (without the


symmetry)
 Centre point is a Hub
 Segments meet at the Hub
 Each device needs its own cable to the Hub
 Predominant type of topology
 Easy to maintain and expand
Star Topology
 Advantages  Disadvantages
 Easy to add devices as the  A star network requires more
network expands cable than a ring or bus
 One cable failure does not network
bring down the entire  Failure of the central hub can
network (resilience) bring down the entire
 Hub provides centralised network
management  Costs are higher (installation
 Easy to find device and and equipment) than for most
cable problems bus networks
 Can be upgraded to faster
speeds
 Lots of support as it is the
most used
Extended Star Topology

A Star
Network
which has
been
expanded to
include an
additional
hub or hubs.
Hybrid Topology
Hybrid Topology

 Old networks are updated and replaced,


leaving older segments (legacy)
 Hybrid Topology – combines two or more
different physical topologies
 Commonly Star-Bus or Star-Ring
 Star-Ring uses a MAU (Multistation
Access Unit (see later slide)
 Now All Computers Physically
Connected……………………
NEXT?
Data Link Layer

 Deals With How computers


Transmit data on the media i.e.
cable.
Types of Logical Topology
 Previous slides showed Physical
Topologies
 Only two Logical Topologies (Bus or Ring)

 Physical Bus or Ring easy to conceptualise

 Physical Star could be either a Bus or


Ring in logical terms
 Confused ? See next slides
Logical Bus

•Modern Ethernet networks are Star Topologies (physically)


•The Hub is at the centre, and defines a Star Topology
•The Hub itself uses a Logical Bus Topology internally, to
transmit data to all segments
Logical Bus
Advantages
 A single node failure
does not bring the Disadvantages
network down  Collisions can occur
 Most widely easily
implemented topology  Only one device can
 Network can be added access the network
to or changed without media at a time
affecting other
stations
Logical Ring
 Data in a Star Topology can transmit data
in a Ring
 The MAU (Multistation Access Unit) looks
like an ordinary Hub, but data is passed
internally using a logical ring
 It is superior to a Logical Bus Hub – see
later slide
Logical Ring
Logical Ring
Advantages
 The amount of data
Disadvantages
that can be carried 
in a single message A broken ring will
is greater than on a stop all transmissions
logical bus  A device must wait
 There are no for an empty token
collisions to be able to
transmit
Data Link Layer
 CSMA – Carrier Sense Multiple Access
 It is the method by which computers send or
receive data using a single media.
 Collision- When two computers send data at
the same time the on the cable .. The data
collision happens.
 To deal with data collision two methods are
used
Data Link Layer
 CSMA / CD – Collision Detection
 In this method when collision happens
both the computers sending data stop
transmission.
 A time is calculated internally in both
the computers, after that time a
computer starts transmission again.
 Collisions keep happening
Data Link Layer
 CSMA /CA – Collision Avoidance
 In this method care is taken so that
there will be no collisions.
 Normally token based access to media
is given.
 Collisions do not happen
Data Link Layer

A C

HUB / Switch

D
B
Data Link Layer

 Now we have connected our


computers as in the figure.
 We have given names to the
computers like A,B,C,D
 Now Computer A wants to send some
data to computer D ……. The process
will be
Data Link Layer
 1. The computer A will first check the
media for any signal (CSMA /CD as we
are using Ethernet )
 2. If computer A finds any signal on the
media it will wait for some amount of
time & will again check the media
 3. If no signal is on the media
Computer A Transmits Data on the
media.
Data Link Layer
 The Big question……………………

As the data travels on the media how the


computer D will come to know that the
data on the media is meant for it?
Data Link Layer
 The data on the media is like a letter in
a envelope.
 You require to have TO & FROM fields
on the envelop for proper delivery.
 So what computers will use in their TO
& FROM fields ……? Computer
Names…?
Data link Layer

 NO……….. Computers always use


numbers for their internal working.

 Then what……………………….?
Data Link Layer
 A number that will identify each
computer uniquely….

 The part of the Data Link Layer which


deals with how computer access the
media & how the computers will be
identified ….. is called MAC ( Media
Access Control) Sub layer
Data Link Layer

 Thus this Number is called …………..

MAC Address
Data Link Layer

 This address is also called ………….

Physical Address
Hardware Address
Data Link Layer

 Where in the computer this address is


given…….. ?

 Do we have to give it & can we change


it….?
Data Link Layer

 MAC :- Media Access Control Address

 The MAC Address is on the LAN card of the


Computer
 Given by manufacturer to LAN Card.
 Unique for each LAN Card.
 Cannot be changed by user.
 It is 48 bits Hexadecimal Number.
Data Link Layer
 Each computer adds MAC address to
data packet & sends it over the
network. Then each computer over the
network checks whether the MAC
address matches its address. If yes
then only accepts the packet else
rejects it.
MAC Sub layer
 How computer A will come to know the
MAC Address of Computer D?
 Computers, in windows environment,
when start, announce their name &
workgroup or domain.
 A master browser receives these
announcements & creates a list of all
the computers in a network.
MAC sub layer
 Thus a computer A, can get the names of the
computers in his network, from master
browser.
 But to communicate with computer D,
computer A is required to know the MAC
address of computer D & not just the name.
 Thus computer A sends out a broadcast
packet on the network asking MAC address
of computer D
MAC sub layer
 To differentiate between a normal packet & a
broadcast packet, a specific Mac address is
treated as a broadcast address.

 The broadcast MAC address is


FF-FF-FF-FF-FF-FF

 Every computer in the network accepts a


broadcast packet, reads it & only computer whose
parameters match with those specified in the data
field, will send a reply.
Data Link Layer
Computer A sends a Broadcast Packet
Identifying
Destination FF-FF-FF MAC Who is Parameter
MAC Address FF-FF-FF Address Computer Normally the
Of A D? C Computer Name

A Source MAC Address


HUB / Switch

D
B
Data Link Layer
Broadcast Packet Reaches to all Computers
Identifying
Destination FF-FF-FF MAC Who is Parameter
MAC Address FF-FF-FF Address Computer Normally the
Of A D? C Computer Name

A Source MAC Address


HUB / Switch

D
B
Data Link Layer
Only Computer D Sends a Reply
Identifying
Destination MAC MAC I AM Parameter
MAC Address Address Address D Normally the
Of A Of D C Computer Name

A Source MAC Address


HUB / Switch

D
B
Data Link Layer

 How to find out MAC address of your computer


……….
 On Windows 95/98 machines …
 Go to start --- Run --- type “winipcfg”
 On Windows 2000 / XP
 Go to Start --- Run --- type CMD – press Enter
 On the command prompt ….. Type

ipconfig /all
Data Link Layer

 Now by using Mac address Computer


A & Computer D are communicating
with each other…………….
 ……….. But if computer A is a P4/512
MB RAM & Computer B is Pentium 100
with 32 MB RAM ……… ?
Data Link Layer
 The part of the data link layer which
deals with the actual communication
between the computers is called ……
……………… Logical Link Control
Logical Link Control
 The logical Link Control (LLC) sub
layer does two things….

 Flow Control

 Error control
Logical Link Control
 Flow Control
 This Controls the amount of data that is transferred
between the computers at a time during the
communication.
 Two Methods
 Static – Data is sent at a fix rate through out the
communication.
 Dynamic – Data is sent at a varying rate depending
on status of both the computers.
Logical Link Control
 Error Control

 This Checks for any errors in the data during


transmission of the data over the media.
 Cyclic Redundancy Check ( CRC) method is
used by both transmitting & receiving computer
to check for any errors in the data.
Networking

 The data at the physical Layer is in the


form of ……….. BITS

 The data at the Data Link Layer is


organized in the form of ……..
FRAMES
Let’s Consider this
example.

B
A Pune Office Network

D E F
C

Mumbai Office Network H


G
Networking
 To find out Mac address of a computer in a
network , computers use broadcast.

 The broadcast is a data packet which every


computer in the network has to receive.

 More the number of the broadcasts in a


network , less is the speed of the network.
Example ……
 Considering the figure, if computer A
wants to send data to computer D,
which are in the same LAN segment,
Computer A will send a MAC Address
broadcast packet on the network asking
D its MAC address.
 As it is a broadcast packet, on receiving
from computer A, switch will replicate
that packet to all its remaining ports.
Example…..
 As Pune office switch is connected to
the Mumbai office switch, it will also
receive that broadcast packet & will
replicate that packet to all its remaining
ports.
 This same process will happen when
computer E wants to send data to
Computer G, which are on the same
segment.
Example…..
 Thus broadcasts in Mumbai office affect
the working of computers in Pune office
& vice versa.
 Normally the computers in Mumbai
office work with computers in their LAN
segment, only sometimes when
required they access Pune office
computers & vice versa
Example…..
 To increase the performance of both the LAN
segments, we have to stop broadcasts from
Pune office reaching the Mumbai office & vice
versa.
 To help us to accomplish this task the next
OSI Layer helps us by providing another
addressing scheme.
 This addressing also helps a faster delivery of
packets to the receiving computer.
OSI Layers

 The Name of the third OSI Layer is….


………………………. Network Layer
Network Layer

 This
OSI layer provides an addressing
scheme called IP Addressing.

 The name is based on IP Protocol.

What is a protocol ?
What is a Protocol
 A protocol is a set of rules or procedure of
carrying out a particular task.
 As an example of the, we can consider human
behaviour. A person behaves differently when
he is with his friends than when he is with
family members.
 He follows the protocols defined for both the
situations.
 A true life example would be finding MAC
address of another computer.
Network Layer….. IP
Address

 The IP Address is a 32 Bit number.

 It is in Binary.
IP Address

 An IP Address looks like this

 1100000010101000011001000000101
0

 Can You Remember it …….?


IP Address

Computer’s use binary


numbers, but for us to work
with it, is difficult.
IP Address
 So we convert the binary value to
decimal & use it.
 But again converting a 32 bit binary
number to a decimal number will
generate a very large number
which is again difficult for us.
 Let’s Check on Calculator
IP Address
 Thus to make it easier for us ,It is
divided into 4 Groups of 8 Bits ….
Called Octet.
 Each octet is separated by a dot.
 So now the earlier IP Address will look
like …………

11000000.10101000.01100100.00001010
IP Address
 How to convert from Binary to Decimal ?
As each octet is of 8 bits we have to calculate the
value for the 8 bit binary numbers only.
8 7 6 5 4 3 2 1
27 26 2 5 24 23 22 21 20

128 64 32 16 8 4 2 1
Above are the decimal values of the corresponding
binary bits.
Converting from Binary to
Decimal
 Let’s Convert our earlier binary IP
address to decimal.
octet 1 octet 2 octet 3 octet 4
11000000.10101000.01100100.0000101
0
Consider The first octet……
11000000
Write the corresponding decimal value
for the bits where there is 1.
Converting from Binary to
Decimal
 Thus we have…….

1 1 0 0 0 0 0 0
128+64+0+0+0+0+0+0 = 192

Calculate similarly for other


octets.
Converting from Binary to
Decimal
 So our IP address in Binary

11000000.10101000.01100100.0000101
0

 When converted to Decimal will be


192 . 168 .100 .10
Converting from Binary to
Decimal
 Consider the octet again……
 when we write as below…

00000000
 Then the decimal value for it is also 0
 When we write as below….

11111111
 Then the decimal value for it is
 128+64+32+16+8+4+2+1 = 255
IP Address

 Thusfor any octet the decimal value


can be from 0 to 255.

 The octet value can not be more than


255.
IP Address
 The IP addresses are divided into 5
Classes.
 Class A
 Class B

 Class C

 Class D

 Class E
IP Address
 How the class of an IP Address is
decided…..?

 Consider following IP Address


 192.168.100.10
 The class of an IP Address is
decided by the value of its first octet,
as shown by the red colour in the
above example.
IP Address
 Let’s see how classes are defined……
 Class A 1 – 127
 Class B 128 – 191
 Class C 192 – 223
 Class D 224 – 239
 Class E 240 - Onwards
IP Address
 Thus ….

 192.168.100.10 is a Class C address.

 24.16.200.72 is a Class A address.

 187.19.129.136 is a Class B address.


IP Address
 Use of Classes…….
 Class A Used For
 Class B Computer
Addressing
 Class C in Networking.

 Class D Used For Multicast


Addressing
 Class E Used for future development
IP Address
 An IP address is used to identify two
things.

The network
&
The Computer in that network
IP Address ……
 Thus any IP address is made of two
addresses ……

 192.168.100 .10
 Thus 192.168.100.0 is the network address
 & 0.0.0.10 will be the address of the
computer ( Host Address) in that network.
IP Address ……

 Howwe can separate network


address & host address ….?

 For that we use subnet mask.


 With any IP address you have to
specify the subnet mask.
IP Address …… Subnet
mask
 How to calculate the subnet mask
.. ?
 To calculate subnet mask, you have
to first decide, that out of 32 bits
how many bits you want to use for
network addressing.
 You can not use all the 32 bits for
network addressing or for host
addressing.
IP Address …… Subnet
mask
 Suppose you decided to use 24 bits for
network addressing………..

……………… to calculate your subnet


mask make all the bits that will used for
network addressing 1 & remaining
bits that will be used for host
addressing 0.
IP Address …… Subnet
mask
 Consider an example…..
 Our IP Address is 192.168.100.10
 We have decided to use 24 bits for
network addressing.
So our subnet mask will be……
11111111.11111111.11111111.00000000
In Decimal it would be…
255 . 255 .255 .0
IP Address …… Subnet
mask
 Let’s see how by using subnet mask we can
separate network address & host address from an
complete IP address.
 Before that ….. A small revision.

 Consider the AND Gate…..

A B C
INPUT A 0 0 0
1 0 0
0 1 0
INPUT B OUTPUT C 1 1 1
IP Address …… Subnet
mask
 Nowconsider our earlier IP address &
subnet mask……….
& we apply AND gate Logic

11000000.10101000.01100100.000010
10
11111111.11111111.11111111.00000000

11000000.10101000.01100100.000000
IP Address …… Subnet
mask
 To avoid compatibility issues for each
IP address class a default subnet mask
is specified.
 Class Address Range Default Subnet Mask
 A 1 – 127 255.0.0.0
 B 128 – 191 255.255.0.0
 C 192 – 223 255.255.255.0
IP Address …… Subnet
mask
 Thus ….
 In Class A there are only 8 bits used for
network addressing & 24 bits are used
for Host addressing.
 Hence Class A gives you less number of
networks i.e. 126 networks but it can
have 16777216 number of computers in
a single network.
IP Address …… Subnet
mask
 Similarlyas you move from Class A to
Class B or Class C the number of
networks that are available increases
but the number of host within a single
network decreases.
 Class C network can have only 255
Computers.
IP Address ……
NOT Allowed…….
A 192.168.100.10 C
192.168.100.10

HUB / Switch

D
B
IP Address ……

 All the computers which you want


to be in the same network should
have the same network Address, in
their IP Address.
IP Address ……

A C
172.16.10.100 172.10.129.175

HUB / Switch

D 172.10.157.220
B 172.16.100.95
IP Address…….
 In the previous figure ….

 Computers A & B are in the same


network. As their network address is
same i.e. 172.16.0.0
 Computers C & D are in the same
network. As their network address is
same i.e. 172.10.0.0.
IP Address……

 Computers A & B can not communicate


with Computers C & D…. Even though
they are connected physically.
 If you want to make them communicate
you will require to connect a device
called router between the two networks.
IP Address ………

A C
172.16.10.100 172.16.129.175

HUB / Switch

D 172.16.157.220
B 172.16.100.95
IP Address ……
 Ifcomputer A wants to send data to
computer D, it requires to know the IP
Address of computer D.

 As was the case in data link layer,


broadcast method is used by the
Computer A.
IP Address …. Broadcast
 Which is the Broadcast IP Address ?
 Now consider 192.168.100.10 IP Address….
With subnet mask 255.255.255.0 ……The
network Address in this is 192.168.100.0……
The broadcast address for this network can be
calculated by making all host bits 1.

 i.e. 192.168.100.11111111

 So it comes to …. 192.168.100.255
IP Address …… Broadcast
 Thus Computer A will send a packet
with 192.168.100.255 in the destination
address field & 172.16.10.100
( Computer A IP address ) in the source
address field.
This packet will be received by all
computers in the network but only
computer D will reply to it.
Let’s Consider earlier
example.
192.168.101.0
B
A Pune Office Network

D E F
C

Mumbai Office Network H


G
192.168.100.0
IP Address …..

 But …. In previous example if we keep


the same network address at both the
offices …….. Then
Let’s Consider earlier
example.
192.168.100.0
B
A Pune Office Network

D E F
C

Mumbai Office Network H


G
192.168.100.0
IP Address …..

 So again IP address broadcasts from


PUNE office will reach the MUMBAI
office & vice versa

 To
avoid this we give separate network
address to LAN at both the locations.
IP address …..

 Whatif we want to keep the network


address same & still want to stop
broadcasts from Pune office from
reaching to Mumbai Office & vice versa
IP Address …. Subnet

 SUBNETTING is the answer


IP Address ….. Subnet
 Consider this example….
 So you have 5 Different LAN segments
connected to each other.
 You want to have 10.0.0.0 as your
network address for all the locations.
 But the 5 network segment should
work independently.
 What we can do ….?
IP Address ….. Subnet
 Default setting will be…..
10.0.0.0 / 255.0.0.0
10.0.0.0 / 255.0.0.0

10.0.0.0 / 255.0.0.0

10.0.0.0 / 255.0.0.0 10.0.0.0 / 255.0.0.0


 To make them separate we have to
use sub netting ….. i.e. we change our
default subnet mask ….. We take
some additional bits from the host area
& make them work as network address
bits.
IP Address ….. Subnet
 Sub net setting will be…..
10.2.0.0 / 255.255.0.0
10.1.0.0 / 255.255.0.0

10.3.0.0 / 255.255.0.0

10.4.0.0 / 255.255.0.0 10.5.0.0 / 255.255.0.0


IP Address ….. Subnet

 In this example in our IP address only 8 bits


are used for network addressing.
 24 Bits are used for host addressing.

 What we did was we took first 8 bits from the


host bits & treated them as network bits.
 So our new subnet mask became

 11111111.11111111.00000000.00000000

 i.e. 255.255.0.0
IP Address ….. Subnet

 So with this new subnet mask , our IP


address 10.0.0.0 / 255.255.0.0
 Now gives us 255 networks…….

10.1.0.0
10.2.0.0 till
10.255.0/0
IP Address ….. Subnet
 Sub net setting will be…..
10.2.0.0 / 255.255.0.0
10.1.0.0 / 255.255.0.0

10.3.0.0 / 255.255.0.0

10.4.0.0 / 255.255.0.0 10.5.0.0 / 255.255.0.0


IP Address ….. Subnet

 Let’s Check the above example


with a class C network Address
…..
IP Address ….. Subnet
 Default setting will be…..
192.168.100.0 / 255.255.255.0
192.168.100.0 / 255.255.255.0

192.168.100.0 / 255.255.255.0

192.168.100.0 / 255.255.255.0 192.168.100.0 / 255.255.255.0


IP Address …. Subnet
 Herewe have to divide our network
address 192.168.100.0 in to 5 subnets.

 Herewe can not change 192.168.100


value.

 Sofrom last 8 host bits we have to take


some bits for the network addressing.
IP Address …. Subnet
 How many bits should we take…..?
 The formula is
 2n – 2 = Number of networks
available.
 Where n = number of bits.
 So.. If we take 3 Bits…

 23 -2 = 6
 So we get 6 networks ….. & we require
5
IP Address …. Subnet
 So we have decided to take 3 bits from
the 8 hosts bits.
 Let’s calculate our new subnet mask…

 Our old subnet mask is 255.255.255.0

 We have to add 3 additional bits to it.

 So.. It will be 255.255.255.11100000

 i.e. 255.255.255.224
IP Address …
 Now let’s see which network we get….
 To get the first network address
subtract your new sub net mask value
from 256

 i.e.
256 -224 = 32
 Thus your first network address will
be ….. 192.168.100.32
IP Address …. Subnet
 Listof the networks you get…..
 192.168.100.32

 192.168.100.64

 192.168.100.96

 192.168.100.128

 192.168.100.160

 192.168.100.192
IP Address ….. Subnet
 List
Of Networks & their host
addresses.

 Network 1
 Network Address 192.168.100.32
 First Host address 192.168.100.33
 Last Node address 192.168.100.62
 Broadcast address 192.168.100.63
IP Address ….. Subnet
 Network 2
 Network Address 192.168.100.64
 First Host address 192.168.100.65
 Last Node address 192.168.100.94
 Broadcast address 192.168.100.95
IP Address ….. Subnet
 Network 3
 Network Address 192.168.100.96
 First Host address 192.168.100.97
 Last Node address 192.168.100.126
 Broadcast address 192.168.100.127
IP Address ….. Subnet
 Network 4
 Network Address 192.168.100.128
 First Host address 192.168.100.129
 Last Node address 192.168.100.158
 Broadcast address 192.168.100.159
IP Address ….. Subnet
 Network 5
 Network Address 192.168.100.160
 First Host address 192.168.100.161
 Last Node address 192.168.100.190
 Broadcast address 192.168.100.191
 Network 6
 Network Address 192.168.100.192
 First Host address 192.168.100.193
 Last Node address 192.168.100.222
 Broadcast address 192.168.100.223
IP Address ….. Subnet

 Home Work……

 …….. Consider that in place of


five networks we require 12
networks….
Practical …….

 UnderstandingPacket formation using


Network monitor.

 Capturing A network Packet.

 Understanding various fields in a


packet.
Practical …….

 Understanding how to assign IP address to


computers.

 Checking sub netting by actual IP address


assignment.

 Understanding DHCP Server & its


configuration
Network Layer …. Routers

 Toconnect to different IP
Networks we require a device
called …………
………………… ROUTER
Router
 How Router work……. ?

NET C NET D
NET B

NET E
NET A
Router……

 Routers accepts packets from one


network , finds a proper path to reach
the destination, send that packet over
that path, in case of any problem to the
earlier path finds an alternative path.
 Let’s See HOW………….?
Router
 First let’s understand the basic working….
Router2 Router3

NET C NET D
NET B

Router4

Router1

NET E
NET A
Router……
A router has its operating system.
 When you turn a router on its operating
system starts.
 A router’ operating system is stored in a
ROM.
 You have to configure a router before
you start using the router.
 A router has a small amount of RAM.
Router…….

 When a router starts, its operating


system starts. The router first checks to
which networks it is directly connected.
 It makes an entry of that in a table,
which it creates in its RAM.
 This table is called …. Routing Table.
Router
 Consider the following Figure….
Router2 Router3

NET C NET D
NET B

Router4

Router1

NET E
NET A
Router…….
 Routing Table of router1

 Connected Networks Hop Count


 Net A 1
 Net B 1
Router……
 Hop Count :
 it is a number which states that in
how many steps a router will reach
the specified network. This number
helps router when multiple paths to
the same network exists. Router
takes the path with minimum hop
count number.
Router…..
 Similarly all the other routers will build
their routing table.
 Table of router 2

 Connected Networks Hop Count


 Net B 1
 Net C 1
Router……
 Table of router 3

 Connected Networks Hop Count


 Net C 1
 Net D 1
Router…..
 Table of router 4

 Connected Networks Hop Count


 Net D 1
 Net E 1
Router…..

 When router build their own table, they


start exchanging their tables with each
other.
Router…..
 Two Protocols are used for this task

 Distance Vector

 Link State
Router……
 Distance Vector
 In distance vector the routers send
updated table every 30 to 90 seconds.
 A router sends its entire routing table to
its neighbor.
 New routes to other networks that are
learned from other routers are entered
in a routers routing table.
Router
 Router 1 sends its table ….
Router2 Router3

NET C NET D
NET B

Router4
Hi… I am connected to Net A &
Router1 Net B with Hop Count 1

NET E
NET A
Router
 Routing table of Router 2 after it receives router 1
routing table ….
Router2 Router3

NET C NET D
NET B

Router4
Network Hop Network Hop
Router1 B 1 B 1
C 1 C 1
A 2
NET E
NET A
OLD NEW
Router
 Consider the following Figure….
Router2 Router3

NET C NET D
NET B

Router4

Router1 Hi.. I am router 2 …. I am


connected to Net B &
Net C with Hop Count 1
… Also Net A with a Hop NET E
NET A
Count 2
Router
 Consider the following Figure….
Router2 Router3

NET C NET D
NET B

Router4
Ha … I can Also
Router1 reach Net B in
same hop count
…& to Net A I
can reach faster NET E
NET A
than U ..
So I don’t need
u
Router
 Consider the following Figure….
Router2 Router3

NET C NET D
NET B

Router4
Hey …. But
Router1 router 2 says he
can reach to
NET C in 1 hop
count … right NET E
NET A
now I can not
reach their
Router
 Consider the following Figure….
Router2 Router3

NET C NET D
NET B

Router4

Router1 So…. I will


add it to my
routing table. NET E
NET A
Router
 Routing table of Router 1 after it receives router 2
routing table ….
Router2 Router3

NET C NET D
NET B

Router4
Network Hop Network Hop
Router1 A 1 A 1
B 1 B 1
C 2
NET E
NET A
OLD NEW
Router
 Consider the following Figure….
Router2 Router3

NET C NET D
NET B

Router4
Hi.. I am router 3 …. I am
Router1 connected to Net C &
Net D with Hop Count 1
… Also Net B with a Hop
Count 2 & NET A With NET E
NET A
Hop Count 3
Router
 Consider the following Figure….
Router2 Router3

NET C NET D
NET B

Router4
Hey… router
Router1 3 says he can
reach NET A ,
NET B & NET NET E
NET A
C
Router
 Consider the following Figure….
Router2 Router3

NET C NET D
NET B

Router4
I need to
Router1 remember it
in my routing
table. NET E
NET A
Router……

 This is how the routers exchange information


with each other.

 Each router updates its routing table when it


receives routing tables of other routers.

 It takes time for routers to know about each


other.
Routers……

 The time, taken by the routers to fully


update …. i.e. when all the routers
know about all the networks, ……is
called

……… CONVERGENCE
Routers…..
 Final Routing tables of all the
routers
Router 1 NET A 1 Router 2
NET A 2 R1
NET B 1 NET B 1
NET C 2 R2 NET C 1
NET D 3 R2 NET D 2 R3
NET E 4 R2 NET E 3 R3
Router 3
NET A 3 R2 Router 4
NET A 4 R3
NET B 2 R2 NET B 3 R3
NET C 1 NET C 2 R3
NET D 1 NET D 1
NET E 2 R4 NET E 1
Routers…..

Let’ssee How routers


use their routing tables
Router
 Consider the following Figure….
Router2 Router3

NET C NET D
NET B

Router4

Router1
NET E
NET A
Comp
Comp
E5
A1
Router
 Computer A1 Creates data Packets to send to
Computer E5 ….
Router2 Router3

NET C NET D
NET B

Router4

Router1
NET E
NET A
Comp
Comp
E5
A1
Router
 As Computer A1 Finds That Packets to send Is meant
for The Computer Outside The network ….
Router2 Router3

NET C NET D
NET B

Router4
It Sends that packet to
Router1
the default
NET E
NET A Gateway i.e. Router1 Comp
Comp
E5
A1
Routers…..
 IP Address of Router1 Should be
specified in the default gateway field
either by Administrator or it should be
given by the DHCP Server.
 A Computer can not communicate with
any other computer outside it’s network
if it does not know the IP Address of the
Default Gateway i.e. Router.
Router
 Computer A1 Creates data Packets to send to
Computer E5 Gives it to Router 1….
Router2 Router3

NET C NET D
NET B

Hi… Just received a Router4

Router1
packet.
Computer A1 wants to
NET E
NET A send it to Computer E5.
SO I have to Send it to Comp
Comp
Network E E5
A1
Router
 Computer A1 Creates data Packets to send to
Computer E5 ….
Router2 Router3

NET C NET D
NET B

Router4

Router1 Let me check my


routing table. NET E
NET A
Looking at it will tell Comp
Comp me how I can reach E5
A1 to NET E
Router
 Computer A1 Creates data Packets to send to
Computer E5 ….
Router2 Router3

NET C NET D
NET B

Router4
NET A 1
Router1 NET B 1
NET C 2 R2 NET E
NET A
NET D 3 R2 Comp
Comp NET E 4 R2
This is my routing table.
E5
A1
Router
 Computer A1 Creates data Packets to send to
Computer E5 ….
Router2 Router3

NET C NET D
NET B

Router4

Router1 So…. I will have to


send it to ROUTER 2 NET E
NET A
Comp
Comp
E5
A1
Router
 Computer A1 Creates data Packets to send to
Computer E5 ….
Router2 Router3

NET C NET D
NET B

Router4

Router1 Hi… Received A


Packet… Router1 NET E
NET A
wants to send it to Comp
Comp NET E.. Let me check E5
A1 my routing table.
Router
 Computer A1 Creates data Packets to send to
Computer E5 ….
Router2 Router3

NET C NET D
NET B

Router4

Router1 NET A 2 R1
NET B 1 NET E
NET A NET C 1
NET D 2 R3 Comp
Comp
NET E 3 R3 E5
A1
Router
 Computer A1 Creates data Packets to send to
Computer E5 ….
Router2 Router3

NET C NET D
NET B

Router4

Router1 So… I will need to


send it to ROUTER 3 NET E
NET A
Comp
Comp
E5
A1
Router
 Computer A1 Creates data Packets to send to
Computer E5 ….
Router2 Router3

NET C NET D
NET B

Router4

Router1 Hi… Received A


Packet… Router2 NET E
NET A
wants to send it to Comp
Comp NET E.. Let me check E5
A1 my routing table.
Router
 Computer A1 Creates data Packets to send to
Computer E5 ….
Router2 Router3

NET C NET D
NET B

Router4

Router1 NET A 3 R2
NET B 2 R2 NET E
NET A NET C 1
NET D 1 Comp
Comp
NET E 2 R4 E5
A1
Router
 Computer A1 Creates data Packets to send to
Computer E5 ….
Router2 Router3

NET C NET D
NET B

Router4

Router1 So… I will need to


send it to ROUTER 4 NET E
NET A
Comp
Comp
E5
A1
Router
 Computer A1 Creates data Packets to send to
Computer E5 ….
Router2 Router3

NET C NET D
NET B

Router4

Router1 Hi… Received A


Packet… Router3 NET E
NET A
wants to send it to Comp
Comp NET E.. E5
A1
Router
 Computer A1 Creates data Packets to send to
Computer E5 ….
Router2 Router3

NET C NET D
NET B

Router4

Router1 Oh… I am in the


network E only. If I send NET E
NET A this packet on my Comp
Comp Ethernet Port it will reach
the NET E
E5
A1
Router
 Computer A1 Creates data Packets to send to
Computer E5 ….
Router2 Router3

NET C NET D
NET B

Router4
Whom I have to
Router1 send this packet..?
NET A
Computer 5 in the NET E
network E … Let me Comp
Comp
find out it’s MAC E5
A1
Address
Router
 Computer A1 Creates data Packets to send to
Computer E5 ….
Router2 Router3

NET C NET D
NET B

Router4

Router1 Hi…. E5.. can you


tell me your MAC NET E
NET A
Address..? Comp
Comp
E5
A1
Router
 Computer A1 Creates data Packets to send to
Computer E5 ….
Router2 Router3

NET C NET D
NET B

Router4

Router1 Hi…. Router 4 …this is


my MAC Address….. NET E
NET A
Comp
Comp 00-A6-BD-0A-F3-D2
E5
A1
Router
 Computer A1 Creates data Packets to send to
Computer E5 ….
Router2 Router3

NET C NET D
NET B

Router4

Router1
Hi…. Computer A1… NET E
NET A
Received the packet Comp
Comp
From You….. E5
A1
Routers…. The real life
Leased Line Modem
192.168.100.0 /255.255.255.0
Router1

192.168.100.254 10.1.1.1
192.168.100.1 Leased Line Modem
255.255.255.0
192.168.100.254
Router 2

172.16.1.10
255.255.0.0 10.1.1.2
172.16.255.254
172.16.255.254
Routers…..

 Problem with this type of routing…


….
Router
 Consider the following Figure….
Router2 Router3

NET C NET D
NET B

Router4

Router1
NET E
NET A
Comp
Comp
E5
A1
Routers…..
 Final Routing tables of all the
routers
Router 1 NET A 1 Router 2
NET A 2 R1
NET B 1 NET B 1
NET C 2 R2 NET C 1
NET D 3 R2 NET D 2 R3
NET E 4 R2 NET E 3 R3
Router 3
NET A 3 R2 Router 4
NET A 4 R3
NET B 2 R2 NET B 3 R3
NET C 1 NET C 2 R3
NET D 1 NET D 1
NET E 2 R4 NET E 1
Router
 Now if Router 4 Fails…. It means no one can reach
NET E ……..
Router2 Router3

NET C NET D
NET B

Router4

Router1
NET E
NET A
Comp
Comp
E5
A1
Routers…….
 Now Router 3 Waits for some time to receive
routing table from Router 4 .

 But as Router 4 is down it will not send the


routing table.

 After some time Router 3 starts searching for


another router who can reach NET E
Router
 Router 2 Advertisement ….
Router2 Router3

NET C NET D
NET B

Router4
Hi.. I am router 2 …. I am
Router1 connected to Net B &
Net C with Hop Count 1
… Also Net A with a Hop
Count 2 & NET E With NET E
NET A
Hop Count 3 & NET D
with Hop count 2
Routers…….

 Now Router 3 receives the routing


table of Router2, which says it can
reach NET E with a hop count of 3.

 Inreal Router 2 can reach NET E


through Router 3 only, but it does not
mention that in its routing table.
Routers…….
 So now Router 3 updates its routing table as
Follows.

 NET A 3 R2
 NET B 2 R2
 NET C 1
 NET D 1
 NET E 2 R4 BAD
 NET E 4 R2
Routers…….

 Now Router 3 sends its routing table to


Router2, which says it can reach NET
E with a hop count of 4.
Routers…….
 Now Router 2 looks at its routing table.

Router 3 earlier said he can


 NET A 2 R1 reach NET E in 2 hop
counts… so I put 3 in my hop
 NET B 1 count … But now he says ..
He can reach NET E in 4
 NET C 1 hop counts … so I need to
change my hop count to 5.
 NET D 2 R3
 NET E 3 R3
Router
 Next Router 2 Advertisement ….
Router2 Router3

NET C NET D
NET B

Router4
Hi.. I am router 2 …. I am
Router1 connected to Net B &
Net C with Hop Count 1
… Also Net A with a Hop
Count 2 & NET E With NET E
NET A
Hop Count 5
Routers…….

 Now Router 3 receives the routing


table of Router2, which says it can
reach NET E with a hop count of 5.
Routers…….
 So now Router 3 updates its routing table as
Follows.

 NET A 3 R2
 NET B 2 R2
 NET C 1
 NET D 1
 NET E 2 R4 BAD
 NET E 6 R2
Routers …..
 Inreal both router 2 & router 3 can not
reach NET E.
 But due to problem in advertising
method, they think that they can reach
NET E through each other.
 So on receiving other routers routing
table they increase their hop count.
Routers….

 Thus each time the hop count for NET


E in both the routers, Router2 &
Router3 , keeps on increasing……
…… It increases
up to infinity.
Thus this problem is called …..
COUNT TO INFINITY
Count to infinity
solutions….

 Whatis the solution for this


problem?
Count to infinity
solutions….
 1.Maximum Hop Count.
Distance vector supports a maximum
of 15 hop counts.

When hop count reaches a value of


16 for any network, then the network
is considered to be unreachable.
Count to infinity
solutions….

 Butstill the earlier problem will be


their only thing now routers will
increase their hop count till it
reaches a value of 16.
Count to infinity
solutions….
 2. SPLIT HORIZON :

 Inthis method the routers follow


a rule, that the information
received from a router will not
be sent back to that router.
Count to infinity
solutions….
 Earlier case ….
Router2 Router3

NET C NET D
NET B

Router4
Hi.. I am router 2 …. I am
Router1 connected to Net B &
Net C with Hop Count 1
… Also Net A with a Hop
Count 2 & NET E With NET E
NET A
Hop Count 3 & NET D
with Hop count 2
Count to infinity
solutions….
 With SPLIT HORIZON ….
Router2 Router3

NET C NET D
NET B

Router4
Hi.. I am router 2 …. I am
Router1 connected to Net B &
Net C with Hop Count 1
… Also Net A with a Hop
Count 2 NET E
NET A
Count to infinity
solutions….
 SPLIT HORIZON :

 Thusin case of failure of Router 4,


Router 3 will not receive any false
connection announcement for NET E
from any other router.

 So
after certain time Router 3 will
mark NET E as unreachable.
Count to infinity
solutions….
 3. ROUTE POISONING:

 In
this method, when a router
comes to know that it can not
reach a network it marks the
entry of that network with a hop
count of 16 ….i.e. Unreachable.
Count to infinity
solutions….
 ROUTE POISIONING ….
Router2 Router3

NET C NET D
NET B

Router4
Hi.. I am router 4 ….
Router1 My link to NET E is
down… so now I can
not reach NET E NET E
NET A
Count to infinity
solutions….
 ROUTE POISIONING (Practically) ….
Router2 Router3

NET C NET D
NET B

Router4
Router 4
Router1 NET A 4 R3
NET B 3 R3
NET C 2 R3
NET E
NET A NET D 1
NET E 16
Routers……
 LINK-STATE ROUTING
 This is a more complex method used
by the routers for routing packets.

 Routersusing this method first try to


understand the complete network & the
connections between these networks.
Routers……
 LINK-STATE ROUTING
 A Router creates a Link-state packet
or Hallo packet, to inform other routers
about the networks to which it is
connected. It also sends information
about its links such as whether an
ISDN Link or a Leased Line. The
bandwidth of the link etc.& also its
routing table.
Routers……
 LINK STATE ROUTING

 Routers exchange their Hello Packets


with one another, which gives them a
complete idea about the entire network.

 Initiallyeach router sends these


packets on directly connected links.
Routers……
 LINK STATE ROUTING
 On receiving the hello packets from
other routers, a router builds a
database of networks it can reach &
links that connect these networks.
 Then a method called Shortest Path
First (SPF) is used by the router to
decide the path for a network.
Routers……
 LINK STATE ROUTING

 Thebest paths may not be simply


shortest but the most efficient.
Link State Routing….
 Example …. 2 MBPS Links

Router2 Router3

NET C NET D
NET B

Router4

Router1

64 KBPS Link
NET E
NET A
Routers……
 LINK STATE ROUTING

 Considering the earlier figure , Router 2


can reach NET E by using two paths….
….. 1. directly using 56KBPS line…..
2.Through Router 3 & Router 4
Routers……
 LINK STATE ROUTING
 So Router 2 in its hello packet will mention
both the paths.
 Network Hop count Link
 B 1 2 MBPS
 C 1 2 MBPS
 D 2 2 MBPS
 E 1 56 KBPS
 E 3 2 MBPS
Routers……
 LINK STATE ROUTING

 Thus…. Router 2 may send the large packets


through Router 3 & Router 4 as that path is
fast, even though the hop count is more.

 On the other hand distance vector routing will


always take 56 KBPS path as the hop count is
less, though the speed of transmission suffers.
That All for the Network
Layer…
 Summary :
 IP Address Defined.

 IP Address Class.

 Use of subnet Mask

 Sub netting.

 Routers
Switches……
 Layer 3 Switches :

 Theseswitches use IP Address in their


working.

 As the IP Address is defined in the


third OSI Layer i.e. Network Layer….
These are called Layer 3 Switches
Switches…….
 Layer 3 192.168.100.57
192.168.100.10

192.168.100.26
192.168.100.120
Switches…….
192.168.100.57
 Layer 3 Switch receives a data packet
192.168.100.10

Destination Address Source Address

192.168.100.120 192.168.100.10 DATA

192.168.100.26 192.168.100.120
Switches…….
192.168.100.57
 Layer 3
192.168.100.10

The Address
192.168.100.120 is
My port no.10……
So I have to send this
packet to port no. 10
192.168.100.26 192.168.100.120
Switches…….
192.168.100.57
 Layer 3 Switch receives a data packet
192.168.100.10

Destination Address Source Address

192.168.100.120 192.168.100.10 DATA

192.168.100.26 192.168.100.120
Bridges….

 Bridgeis a device, that keeps frames


on the local segment local & filters
frames that belong to other LAN
segments.
Bridges….
 Bridge in a network…
Comp C Comp D

Segment 1
Segment 2

Bridge

Segment 3

Comp A Comp B Comp E


Comp F
Bridges…..

 Bridge
Functions at the Data Link
Layer of the OSI Model.

 Bridgesuse MAC Addressing to filter


the frames.
Bridges….

 Bridges
Increase usable bandwidth of a
Network.

 Bridges work independently of all upper


layer protocols.
How Bridges work ….
Comp A Sends Comp C Comp D

Segment 1 Data to Comp C


Segment B

Bridge

Segment C

Comp A Comp B Comp E


Comp F
How Bridges work ….
 Bridge receives data …
Comp C Comp D

A C Data
Segment 2

Bridge

Segment 3

Comp A Comp B Comp E


Comp F
Segment 1
BUT .. It does not know on which segment Comp c is?
How Bridges work ….
 So…..
Comp C Comp D

A C Data
Segment 2

Bridge

Segment 3

Comp A Comp B Comp E


Comp F

Segment 1
Thus sends data on all segments
How Bridges work ….
 But Makes an entry …
Comp C Comp D

A C Data
Segment 2

Bridge

segment Comp Segment 3


1 A

Comp A Comp B Comp E


Comp F

Segment 1
How Bridges work ….
 Similarly .. Slowly .. It creates
Segment 1 Comp C Comp D

Segment 2
Segment 3
Bridge
Comp A Comp B

Segment Comp Segment Comp Segment Comp


1 A 2 C 3 E
1 B 2 D 3 F Comp F
Comp E
How Bridges work ….
 So…..Next Time
Comp C Comp D

A C Data
Segment 2
Segment 1
Bridge

Segment 3

Comp A Comp B Comp E


Comp F

It will send data only on the segment on which the destination computer is
How Bridges work ….
 So…..if
Comp C Comp D

A B Data
Segment 2

Bridge

Segment 3

Comp A Comp B Comp E


Comp F

Segment 1
OSI Layers …… Layer 4

 TRANSPORT LAYER
Transport Layer …..
 Transportlayer works between the OSI
lower layers & OSI upper layers.

 TransportLayer allows the upper layer


processes not to care about the
network connections, speed of the
connections, amount of data that can
be transmitted, & whether the data is
received by the destination device
Transport Layer …..
 Transport Layer takes messages from the
upper layer processes.

 Breaks these messages into segments, gives


number to each segment, such that lower layer
processes can handle them.

 Passes these segments to lower layers for


transmission.
Transport Layer …..
 Similarly
receives segments from lower
layer processes.

 Organizes segments into messages.

 Passesmessages to upper layer


processes.
Transport Layer …..

 The transport layer is responsible for reliable


delivery of transmission.

 Reliable does not mean that all the data will


always reach the destination.

 However it confirms whether the data was


delivered or not.
Transport Layer …..
 Incase if data is not delivered to the
destination or delivered in damaged
condition, the transport layer
retransmits the data or else informs the
upper layer process.
The upper layer process then
takes necessary action or informs user
with some options.
Transport Layer …..
SERVER
 Consider Following ….. MAIL / WEB /FTP
192.168.10.54
Application :
Internet Explorer

192.168.10.1
Switch
Application :
Application : Outlook Express
FTP Client

192.168.10.125
192.168.10.12
Transport Layer …..
 The packets from each client will be …
Destination Source IP Destination Source MAC
IP Address Address MAC Address Address

192.168.10.1 192.168.10.12 00-FA-8C-9A-A7-BA 00-FA-8C-9A-A7-BA DATA

192.168.10.1 192.168.10.125 00-FA-8C-9A-A7-BA 00-FA-8C-9A-A7-BA DATA

192.168.10.1 192.168.10.54 00-FA-8C-9A-A7-BA 00-F4-8C-BA-80-7A DATA


Transport Layer …..

 How the destination computer


will come to know that which
user wants which data…………
…..?
Transport Layer …..
 Tosolve this problem the transport
layer uses … an identification number ..
Called … PORT or Connection
Identifier.

 Eachservice running on a computer is


assigned a port number.
Transport Layer …..
 Some Ports assigned to some common
services….
Service Name Port Number
1. Web service 80
2. FTP Service 20,21
3. SMTP Service 25
4. POP3 Service 110
5. Telnet Service 23
Transport Layer …..
Destination Port
 So … Source Port
Destination Source IP Destination Source MAC
IP Address Address MAC Address Address

1
2 5
192.168.10.1 192.168.10.12 00-FA-8C-9A-A7-BA 00-FA-8C-9A-A7-BA DATA
0 2
7

1 1
192.168.10.1 192.168.10.125 1 9
8 00-FA-8C-9A-A7-BA 00-FA-8C-9A-A7-BA DATA
0 5

1
8 6
192.168.10.1 192.168.10.54 00-FA-8C-9A-A7-BA 00-F4-8C-BA-80-7A DATA
0 4
9
Transport Layer …..
 Thus when a computer wants to access
a service running on another computer,
transport layer first opens a port on it,
then when it creates a packet, it
mentions the port number of the service
which it wants to access, in the
destination port field & the port number
opened on it in the source port field.
Transport Layer …..
 Thereare TWO Protocols at the
Transport Layer

 1. TCP – Transmission Control Protocol

 2. UDP – User Datagram Protocol


Transport Layer …..
 TCP : –
 Before it starts sending the data, the sender
computers TCP protocol contacts the
destination computers TCP protocol in order
to establish a connection.

 This connection is called Virtual Circuit.

 This type of communication is called


Connection-Oriented.
Transport Layer …..

ThusTCP protocol is called a


connection-oriented Protocol
Transport Layer …..
 TCP : –
 Before it starts sending the data, the sender
computers TCP protocol contacts the destination
computers TCP protocol, & they decide that
during communication, for each segment they
receive they will send an acknowledgement to
the other computer.

 The sender computer will retransmit a segment ,


incase it does not receive an acknowledgement
for that segment from the receiving computer.
Transport Layer …..
 TCP :–
 This type of communication takes care
that the data received by the
destination is complete & in proper
condition.

 This is called reliable data transfer.


Transport Layer …..

Thus TCP protocol is called a


Reliable Protocol.
Transport Layer….
 TCP Protocol also supports FLOW
CONTROL.

 Flow control is the process of controlling


the rate at which a computer sends data.

 Flow control is a method by which the sending


and the receiver computer decide , how much
data will be send during transmission, at any
time.
Transport Layer….

 Flow control is needed because data is


discarded when congestion occurs. A
sender of data might be sending the
data faster than the receiver can
receive the data, so the receiver
discards the data.
Transport Layer….

 Also,the sender might be sending the


data faster than the intermediate
switching devices (switches and
routers) can forward the data, also
causing discards.
Transport Layer….

 Toprovide all these features the sender


device and the receiver computers
need to transmit a lot of communication
messages between them along with the
data.
Transport Layer….

 Thismakes the TCP Protocol


transmissions very slow , but
reliable.
Transport Layer….

 The other protocol which works at


the transport layer …. Is USER
DATAGRAM PROTOCOL (UDP)
Transport Layer …..

 The UDP Protocol provides less


features as compared to the TCP
Protocol , however this makes UDP
more faster than TCP, but less
reliable.
Transport Layer …..

 TCP and UDP Functional Comparison

 Function (TCP) (UDP)


Data transfer Continuous
Message
stream of
(Datagram)
Transport Layer …..
 TCP and UDP Functional Comparison

 Function (TCP) (UDP)


Multiplexing Receiving Receiving
hosts decide hosts decide
the correct the correct
application for application for
which the data which the data
is destined, is destined,
based on port based on port
number number
Transport Layer …..
 TCP and UDP Functional Comparison

 Function (TCP) (UDP)


Reliable Acknowledgment Not a Feature
transfer of data using the Of UDP
sequence and
acknowledgment
fields in the TCP
header
Transport Layer …..

 TCP and UDP Functional Comparison

Function (TCP) (UDP)


Flow control Process used Not
to protect buffer a
space and routing Feature of
devices UDP
Transport Layer …..

 TCP and UDP Functional Comparison

Function (TCP) (UDP)


Connections Process used UDP
to initialize port is
numbers and Connectionless
other TCP header
Fields
Transport Layer …..

 TCP and UDP Functional Comparison

 Function (TCP) (UDP)


Data transfer Continuous
Message
stream of
(Datagram)
OSI LAYERS ….. LAYER 5

SESSION LAYER
SESSION
L A Y E R………

o The session layer defines how to start,


control, and end conversations (called
sessions). This includes the control and
management of multiple bidirectional
messages so that the application can be
notified if only some of a series of
messages are completed.
SESSION
L A Y E R………

o This allows the presentation layer to


have a seamless view of an incoming
stream of data. The presentation layer
can be presented with data if all flows
occur in some cases..
SESSION
L A Y E R………

o For example, an automated teller


machine transaction in which you
withdraw cash from your checking
account should not debit your account,
and then fail, before handing you the
cash, recording the transaction even
though you did not receive money.
SESSION
L A Y E R………

o The session layer creates ways to imply


which flows are part of the same
session and which flows must complete
before any are considered complete.
OSI LAYERS ….. LAYER 6

PRESENTATION
LAYER
PRESENTATION
L A Y E R………

o This layer’s main purpose is defining


data formats, such as ASCII text,
EBCDIC text, binary, BCD, and JPEG.
PRESENTA
TION LAYE
R………

o For example, FTP enables you to


choose binary or ASCII transfer. If binary
is selected, the sender and receiver do
not modify the contents of the file. If
ASCII is chosen, the sender translates
the text from the sender’s character set
to a standard ASCII and sends the data.
The receiver translates back from the
standard ASCII to the character set used
on the receiving computer.
PRESENTA
TION LAYE
R………

o Encryption is also defined by OSI as a


presentation layer service.
PRESENTA
TION LAYE
R………

o What is ENCRYPTION…. …
….. ?????
PRESENTA
TION LAYE
R………

o Encryption is a method by which the


sender computer & receiving computer
convert the actual data format in a
predefined format, so that the data can
be understood by only the two
computers.
PRESENTA
TION LAYE
R………

o Why ENCRYPTION is
required …. …….. ?????
PRESENTA
TION LAYE
R………

o When we have to tell some private


information to some other person, in
front of the others, we use some kind of
code language or signals.
o Similarly when a computer has to send
data over a public network like internet,
we prefer to send that data in a coded
format.
PRESENTA
TION LAYE
R………

o Before the computers start


sending the data, they decide
in which format the data will
be coded. This format is
called as encryption
algorithm.
PRESENTA
TION LAYE
R………

o The computers use a Digital key to


encrypt or to lock the data.

o This digital key is nothing but a 56 bit


or 128 bit number which is used to
encrypt the data using a series of
complex steps.
PRESENTA
TION LAYE
R………

o In early days of the encryption a single key


method was used.

o In this method both the sender computer & the


receiver computer should use the same key to
lock the data & to open it.

o But…. The problem…..


PRESENTA
TION LAYE
R………

o Suppose you want to send a small


suitcase with some valuable things
to your friend in another city.
o You have to send it by some
transport.
o Now if you send it unlocked, during
transportation anyone can open it &
steal the valuables inside.
PRESENTA
TION LAYE
R………

o So you decide to lock the suitcase &


send it.
o But when your friend receives it,
even he will not be able to open the
suitcase as he does not have key for
it.
o So you have to send him the key
also, if you send it along with the
suitcase again anyone can open it.
PRESENTA
TION LAYE
R………

o If you send either before sending the


suitcase or after you send the
suitcase , anyone who knows about
it can use that key.

o Thus this method does not provide a


total security of the data.
PRESENTA
TION LAYE
R………

o The method that is used


mostly today is called …..
Public & private Key Method
PRESENTA
TION LAYE
R………

o In this method every


computer generates two keys
…….
1. Private Key
2. Public Key
PRESENTA
TION LAYE
R………

o The Public Key can be used


to lock (i.e. encrypt) the data,
however once it is locked it
can not be opened by the
same Public key.
PRESENTA
TION LAYE
R………

o This data, locked by a public


key, can be unlocked only by
the Private Key.
PRESENTA
TION LAYE
R………

o Thus when computers, at the start of


the data transfer, decide that they
will encrypt the data, each computer
gives his public key to the other
computer.
o During transmission if someone gets
this key, it will be of no use to him as
this key can only lock the data.
PRESENTA
TION LAYE
R………

o When a computer sends data to


other computer, it uses that
computers public key to lock the
data.
o This data can now be opened
only by the receiving computer
as the private key is with that
computer only.
PRESENTA
TION LAYE
R………

o Hence anyone who traps the


data in-between, will not
understand it or will not be
able to open it.
PRESENTA
TION LAYE
R………

o Example………….
o You go to bank to gat a locker.
o The bank has two keys for the
locker… a public key & a private
key.
o The bank gives the public key to
the customer who has taken that
locker
PRESENTA
TION LAYE
R………

o Bank will keep the private key with


them.

o When the customer wants to open


the locker, his key alone can not
open the locker.

o The key with the bank can open the


locker.
PRESENTA
TION LAYE
R………

o This way the bank knows that the


person who has come to open the
locker is an authorized person.

o Once the locker is open, the bank


employee will leave the place.

o Now the customer will have a


privacy to use his locker.
PRESENTA
TION LAYE
R………

o When he finishes his work,


he can lock the locker with
his key.

o The bank key is not required


to lock the locker.
PRESENTA
TION LAYE
R………
o Hence public key & private key
method is the preferred method
in data transmission.
o The computers exchange their
public keys with each other in
the form of certificates.
o This certificate contains other
information along with the public
key of the computer.
PRESENTA
TION LAYE
R………

o The other information in the


certificate is date till this key is valid,
the name of the computer who
issued this certificate etc.

o These keys are changed on a regular


basis, to provide security.
PRESENTA
TION LAYE
R………

o There are some other


methods of data security
also……….. Like
Message Digest
Digital Signatures
OSI
LAYERS ………

o The Last Layer ……….

Application Layer
APPLICATION
L A Y E R………

o An application that communicates with


other computers is implementing OSI
application layer concepts.

o The application layer refers to


communications services to
applications.
APPLICATION
L A Y E R………

o For example, a word processor that


lacks communications capabilities would
not implement code for communications,
and word processor programmers would
not be concerned about OSI Layer 7.
o However, if an option for transferring a
file were added, then the word processor
would need to implement OSI Layer 7
APPLICATION
L A Y E R………

o Examples of Network Applications are


….
o Microsoft Exchange Server
o Web Server
o Internet Explorer
o Outlook Express
o Microsoft outlook
o Telnet …….. ETC.
Interactions Between the
Same Layers on Different
Computers
Layer N must interact with Layer N on
another computer to successfully
implement its functions.

For example, the transport layer (Layer


4) can send data, but if another computer
does not acknowledge that the data was
received, the sender will not know when
to perform error recovery.
Interactions Between the
Same Layers on Different
Computers
Likewise, the sending computer encodes
a destination network layer address i.e.
IP address (Layer 3) in the network layer
header. If the intervening routers do not
cooperate by performing their network
layer tasks, the packet will not be
delivered to the true destination
Interactions Between the
Same Layers on Different
Computers
 To interact with the same layer on another
computer, each layer defines a header and, in
some cases, a trailer.

 Headers and trailers are additional data bits,


created by the sending computer’s software or
hardware, that are placed before or after the data
given to Layer N by Layer N+1.i.e. from lower
layers to their upper layers.
Interactions Between the
Same Layers on Different
Computers
 The information needed for this layer to
communicate with the same layer process on
the other computer is encoded in the header and
trailer.

 The receiving computer’s Layer N software or


hardware interprets the headers and trailers
created by the sending computer’s Layer N,
learning how Layer N’s processing is being
handled, in this case.
Interactions Between the
Same Layers on Different
Computers

 Same-Layer Interactions on Different


Computers
Interactions Between the
Same Layers on Different
Computers
The application layer on Host A
communicates with the application layer
on Host B. Likewise, the transport,
session, and presentation layers on Host
A and Host B also communicate.
The bottom three layers of the OSI
model have to do with delivery of the
data
Interactions Between the
Same Layers on Different
Computers

Router 1 is involved in that process.

Host A’s network, physical, and data link


layers communicate with Router 1;
likewise, Router 1 communicates with
Host B’s physical, data link, and network
layers.
Interactions Between the
Same Layers on Different
Computers
Interactions Between the
Same Layers on Different
Computers

The data is created by some application on


Host A. For example, an e-mail message is
typed by the user.
Each layer creates a header and passes the
data down to the next layer.
 Passing the data down to the next layer
implies that the lower layer needs to perform
some services for the higher layer.
Interactions Between the
Same Layers on Different
Computers

 To perform these services, the lower layer


adds some information in a header or trailer.

 For example, the transport layer hands off its


data and header; the network layer adds a
header with the correct destination network
layer address so that the packet can be
delivered to the other computer.
Interactions Between the
Same Layers on Different
Computers

From each layer’s perspective, the bits after


that layer’s header are considered to be
data.

For instance, Layer 4 considers the Layer 5,


6, and 7 headers, along with the original
user data, to be one large data field.
Interactions Between the
Same Layers on Different
Computers

 Consider the receipt of data by the host on


the right side of Figure.

 Step 1 The physical layer (Layer 1) ensures


bit synchronization and places the received
binary pattern into a buffer.
 It notifies the data link layer that a frame has
been received after decoding the incoming
signal into a bit stream.
Interactions Between the
Same Layers on Different
Computers
 Consider the receipt of data by the host on the
right side of Figure.

 Step 2 The data link layer examines the frame


check sequence (FCS) in the trailer to
determine whether errors occurred in
transmission (error detection).
 If an error has occurred, the frame is discarded.
Interactions Between the
Same Layers on Different
Computers

The data link addresses (e.g. MAC) are


examined so that Host B can decide
whether to process the data further.

If the data is addressed to host B, the data


between the Layer 2 header and trailer is
given to the Layer 3 software.
Interactions Between the
Same Layers on Different
Computers

Step 3 The network layer (Layer 3)


destination address is examined.

If the address is Host B’s address,


processing continues (logical addressing)
and the data after the Layer 3 header is
given to the transport layer (Layer 4)
software.
Interactions Between the
Same Layers on Different
Computers

Step 4 If error recovery was an option chosen


for the transport layer (Layer 4), the counters
identifying this piece of data are encoded in the
Layer 4 header along with acknowledgment
information (error recovery).
 After error recovery and reordering of the
incoming data, the data is given to the session
layer.
Interactions Between the
Same Layers on Different
Computers
Step 5 The session layer (Layer 5) can be
used to ensure that a series of messages is
completed.

 For example, this data could be meaningless


if the next four exchanges are not completed.

 The Layer 5 header could include fields


signifying that this is a middle flow in a chain,
not an ending flow.
Interactions Between the
Same Layers on Different
Computers

After the session layer ensures that all


flows are completed, it passes the
data after the Layer 5 header to the
Layer 6 software.
Interactions Between the
Same Layers on Different
Computers
Step 6 The presentation layer (Layer 6)
defines and manipulates data formats.
 For example, if the data is binary instead of
character data, the header denotes that fact.
 The receiver does not attempt to convert the
data using the default ASCII character set of
Host B.
 Typically, this type of header is included only
for initialization flows, not with every
message being transmitted (data formats).
Interactions Between the
Same Layers on Different
Computers

After the data formats have been


converted, the data (after the Layer 6
header) is then passed to the
application layer (Layer 7)
Interactions Between the
Same Layers on Different
Computers

Step 7 The application layer (Layer 7)


processes the final header and then
can examine the true end-user data.

This header signifies agreement to


operating parameters by the
applications on Host A and Host B.
Interactions Between the
Same Layers on Different
Computers
The headers are used to signal the
values for all parameters; therefore,
the header typically is sent and
received at application initialization
time only.
 For example, for file transfer, the size of the
file to be transferred and the file formats
used would be communicated (application
parameters).
Networking………………….

o That’s All ……… For Networking.

You might also like