You are on page 1of 354

DATA

COMMUNICATION
AND NETWORKING
UTTAM K. ROY

Dept. of Information Technology,


Jadavpur University, Kolkata
Data Communication and Networking 2

Books
• Andrew S. Tanenbaum, “Computer Networks”, Prentice Hall of
India publication

• William Stallings, “Data & Computer Communications”,


Prentice Hall of India publication

• Alberto Leon Garcia & Indra Widjaja, “Communication


Networks”, Tata McGraw-Hill publication

• Krouse, “Computer Networks”, Pearson publication

• Farouzan, “Computer Networks”

• Farouzan,“TCP/IP Protocol Suit”, Tata McGraw-Hill


publication

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 3

Introduction
 Definition
 Collection of (autonomous) computers connected by some
fashion
 Example

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 4

Advantages of Computer Networks


 Resource Sharing:
 Expensive resources (Database, high-speed laser printer,
array processors) can be shared among users of different
sites as they are connected to one another.
 Example
• World Wide Web(WWW)
• File Transfer Protocol(FTP)
• Domain Name System
• Network File System
• Database
• Remote login
 Computation/Productivity speedup:
 Concurrent execution of independent tasks using cluster
 Example
• Parallel Binary search
• Parallel Matrix multiplication
• Load balancing
© Copyright 2007, U. K. Roy, IT, JU
Data Communication and Networking 5

Advantages of Computer Networks


 Reliability/Availability/Fault Tolerant:
 Entire system does not go down if a part becomes faulty
 Example
• Introduction of secondary DNS
• Distributed database
 (Inter-process)Communication:
 Processes running at different computers can communicate
 Example
• Remote Procedure Call
• Socket
 Incremental growth:
 Avoid huge initial setup cost
 Improved Control/Flexibility:
 Facility to control the system remotely
 Responsiveness:
© Copyright 2007, U. K. Roy, IT, JU
Data Communication and Networking 6

A closer look at network structure:

 network edge:
applications and
hosts
 network core:
 routers
 network of networks
 access networks,
physical media:
communication
links

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 7

The network edge:


 end systems
(hosts):
 run application programs
 e.g. Web, email
 at “edge of network”

 client/server model
 client host requests,
receives service from
always-on server
 e.g. Web browser/server;
email client/server

 peer-peer model:
 minimal (or no) use of
dedicated servers
© Copyright 2007, U. K. Roy, IT, JU
Data Communication and Networking 8

Network edge: connection-oriented service

Goal: data transfer TCP service [RFC


between end systems 793]
 handshaking: setup  reliable, in-order
(prepare for) data byte-stream data
transfer ahead of transfer
time  loss: acknowledgements
 Hello, hello back human and retransmissions
protocol  flow control:
 set up “state” in two  sender won’t overwhelm
communicating hosts
receiver
 TCP - Transmission  congestion control:
Control Protocol  senders “slow down
 Internet’s connection- sending rate” when
oriented service network congested
© Copyright 2007, U. K. Roy, IT, JU
Data Communication and Networking 9

Network edge: connectionless service

Goal: data transfer App’s using TCP:


between end systems  HTTP (Web), FTP
 same as before!
(file transfer),
 UDP - User Datagram Telnet (remote
Protocol [RFC 768]: login), SMTP
 connectionless (email)
 unreliable data transfer

 no flow control
App’s using UDP:
 no congestion control
 streaming media,
teleconferencing,
DNS, Internet
telephony

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 10

The Network Core


 mesh of interconnected
routers
 the fundamental
question: how are data
transferred through
net?
 circuit switching:
dedicated circuit per
call: telephone net
 packet-switching: data
sent thru net in discrete
“chunks”

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 11

Network Core: Circuit Switching

End-end resources
reserved for “call”
 link bandwidth,
switch capacity
 dedicated resources:
no sharing
 circuit-like
(guaranteed)
performance
 call setup required

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 12

Network Core: Circuit Switching

network resources  dividing link


(e.g., bandwidth) bandwidth into
divided into “pieces”
“pieces”  frequency division

 time division
 pieces allocated to
calls
 resource piece idle
if not used by
owning call (no
sharing)

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 13

Circuit Switching: FDM and TDM

Example:
FDM
4 users

frequency

time
TDM

frequency

time
© Copyright 2007, U. K. Roy, IT, JU
Data Communication and Networking 14

Numerical example
 How long does it take to send a file of
640,000 bits from host A to host B over
a circuit-switched network?
 All links are 1.536 Mbps
 Each link uses TDM with 24 slots/sec
 500 msec to establish end-to-end circuit

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 15

Network Core: Packet Switching


each end-end data resource contention:
stream divided into
packets  aggregate resource
demand can exceed
 user A, B packets
amount available
share network
resources  congestion: packets
queue, wait for link
 each packet uses full
use
link bandwidth
 store and forward:
 resources used as
packets move one
needed
Bandwidth division into hop at a time
“pieces”  Node receives complete
Dedicated allocation packet before forwarding

Resource reservation

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 16

Packet Switching: Statistical Multiplexing


A 100 Mb/s
A Ethernet statistical multiplexing C

1.5 Mb/s
B
queue of packets
waiting for output
link

D E

Sequence of A & B packets does not have fixed


pattern, shared on demand ➨ statistical
multiplexing.
TDM: each host gets same slot in revolving
TDM frame.
© Copyright 2007, U. K. Roy, IT, JU
Data Communication and Networking 17

Packet-switching: store-and-forward

L
R R R

 Takes L/R seconds to


transmit (push out)
packet of L bits on to Example:
link or R bps
 L = 7.5 Mbits
 Entire packet must
arrive at router before  R = 1.5 Mbps
it can be transmitted
on next link: store and  delay = 15 sec
forward
 delay = 3L/R (assuming
zero propagation
delay)

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 18

Packet switching versus circuit switching


Packet switching allows more users to
use network!
 1 Mb/s link
 each user:
 100 kb/s when
“active”
 active 10% of time
N users
 circuit-switching: 1 Mbps link
 10 users
 packet switching:
 with 35 users,
probability > 10
active less than .0004
© Copyright 2007, U. K. Roy, IT, JU
Data Communication and Networking 19

Packet switching versus circuit switching


Is packet switching a “slam dunk winner?”

 Great for bursty data


 resource sharing

 simpler, no call setup

 Excessive congestion: packet delay and loss


 protocols needed for reliable data transfer,
congestion control
 Q: How to provide circuit-like behavior?
 bandwidth guarantees needed for audio/video
apps
 still an unsolved problem

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 20

Communication Model
 Source
 generates data to be transmitted—telephones, PC etc.
 Transmitter
 Converts data into transmittable signals—MODEM, CODEC etc
 Transmission System
 Carries data

 Receiver
 Converts received signal into data
 Example
• Modem

 Destination
 Takes incoming data

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 21

Key Communication Tasks


 Transmission System Utilization
 Efficient use of shared medium
 Example
• Multiplexing—FDM, TDM, WDM
• Congestion control
 Interfacing
 Interfacing with transmission medium—electromagnetic
signal propagation
 Signal Generation
 Form and intensity such that
• Capable of being propagated
• Interpretable at receiver
 Synchronization
 Determining beginning and ending of signals and its duration

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 22

Key Communication Tasks


 Exchange Management
 Cooperation(Convention) between communicating parties
• Format and direction(simplex, duplex)
 Error detection and correction
 Signals are distorted before they reach at the destination
 Some applications can not tolerate error—FTP
 Recovery
 Next step to the error detection
 Flow Control
 Fast transmitter/slow receiver problem
 Addressing and routing
 Identifying network devices
 Determining Optimal(?) path (if multiple paths exists)
between a source and destination pair

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 23

Routing

Destinatio
n

Sourc
e

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 24

Key Communication Tasks


 Message formatting
 Agreement between two parties—binary code for characters
 Security
 Sender has to be assured that intended receiver gets data
 Receiver must be sure that the data have not been altered
in transit
 Receiver must be sure that the data come from purported
sender not from intruder
 Network Management
 Configuration
 Monitor its status
 Responds on failure and overloads

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 25

Simplified Data Communication Model

© Copyright 2007, U. K. Roy, IT, JU


Protocol
Architecture
Data Communication and Networking 27

Protocols
 High degree of cooperation is needed
between two communicating parties
 Entities
 User applications
 e-mail facilities
 Computer
 Terminal
 Remote sensor
 Used for communications between
entities in a system
 Must speak the same language

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 28

Example
a human protocol and a computer network
protocol:

Hi
TCP connection
request
Hi
TCP connection
Got the response
time? Get http://www.awl.com/kurose-ross
2:00
<file>
time

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 29

Protocols
 Key elements of a Protocol
 Syntax
• Data formats
• Signal levels
 Semantics
• Control information
• Error handling
 Timing
• Speed matching
• Sequencing
 Standardized protocol
 Needed to promote interoperability among vendor
equipment

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 30

Protocol “Layers”

Networks are
complex!
 many “pieces”: Question:
 hosts
Is there any hope of
 routers
organizing
 links of various structure of
media network?
 applications

 protocols
Or at least our
 hardware,
discussion of
software networks?

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 31

Organization of air travel

ticket (purchase) ticket (complain)

baggage (check) baggage (claim)

gates (load) gates (unload)

runway takeoff runway landing

airplane routing airplane routing


airplane routing

 a series of steps

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 32

Layering of airline functionality

ticket (purchase) ticket (complain) ticket

baggage (check) baggage (claim baggage

gates (load) gates (unload) gate

runway (takeoff) runway (land) takeoff/landing

airplane routing airplane routing airplane routing airplane routing airplane routing

departure intermediate air-traffic arrival


airport control centers airport

Layers: each layer implements a service


 via its own internal-layer actions

 relying on services provided by layer below

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 33

Why layering?

Dealing with complex systems:


 explicit structure allows identification,
relationship of complex system’s pieces
 layered reference model for discussion

 modularization eases maintenance,


updating of system
 change of implementation of layer’s service
transparent to rest of system
 e.g., change in gate procedure doesn’t
affect rest of system
 layering considered harmful?

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 34

OSI Model
 Open Systems Interconnection
 Developed by the International Organization
for Standardization (ISO) in 1977
 Seven layers
 Application
 Presentation
 Session
 Transport
 Network
 Data Link
 Physical
 A theoretical system delivered too late!
 TCP/IP is the de facto standard

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 35

OSI Model
 Physical Layer
 Physical interface between data transmission device (e.g.
computer) and transmission medium or network
 Characteristics of transmission medium
• Mechanical—connector type
• Electrical—signal levels
• Functional—function of individual cuircits
• Procedural—sequence of events,data rates etc.
 Data Link Layer
 Error detection and correction
 Flow control
 Network Access Layer
 Exchange of data between end system and network
 Destination address provision
 Routing functions across multiple networks

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 36

OSI Model
 Transport Layer
 Connection oriented and connectionless service
 Reliable delivery of data
 Sequencing/Ordering of delivery
 Avoid duplication
 Session Layer
 Dialog Discipline—full duplex or half duplex
 Recovery—check pointing mechanisms
 Presentation Later
 Format/presentation/syntax of data
 Application Layer
 Provides user interface such as file transfer (FTP), electronic
mail(SMTP), remote login(Telnet/SSH/rlogin), WWW(http)
etc.

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 37

TCP/IP Protocol Architecture


 Developed by the US Defense Advanced
Research Project Agency (DARPA) for its
packet switched network (ARPANET)
 Used by the global Internet
 No official model but a working one.
 Application layer
 Host to host or transport layer
 Internet layer
 Network access layer
 Physical layer

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 38

Internet protocol stack


 application: supporting
network applications
 FTP, SMTP, HTTP
application
 transport: process-process
data transfer transport
 TCP, UDP
 network: routing of network
datagrams from source to
destination link
 IP, routing protocols
physical
 link: data transfer between
neighboring network
elements
 PPP, Ethernet
© Copyright 2007, U. K. Roy, IT, JU
Data Communication and Networking 39

OSI v TCP/IP

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 40

TCP/IP Protocol Architecture Model

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 41

Encapsulation
source
message M application
segment Ht M transport
datagram Hn Ht M network
frame Hl Hn Ht M link
physical
link
physical

switch

destination Hn Ht M network
M application
Hl Hn Ht M link Hn Ht M
Ht M transport physical
Hn Ht M network
Hl Hn Ht M link router
physical
© Copyright 2007, U. K. Roy, IT, JU
Data
Transmission
Data Communication and Networking 43

Transmission Terminology
 Transmitter
 Receiver
 Medium
 Guided medium
• e.g. twisted pair, optical fiber
 Unguided medium
• e.g. air, water, vacuum
 Direct link
 No intermediate devices
 Point-to-point
• Only 2 devices share link
 Multi-point
• More than two devices share the link

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 44

Transmission Terminology
 Simplex
 One direction
• e.g. Television
 Half duplex
 Either direction, but only one way at a time
• e.g. police radio
 Full duplex
 Both directions at the same time
• e.g. telephone

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 45

Frequency, Spectrum and Bandwidth


 Time domain concepts
 Continuous signal
• Various in a smooth way over time
 Discrete signal
• Maintains a constant level then changes to another constant
level

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 46

Frequency, Spectrum and Bandwidth


 Time domain concepts
 Periodic signal
• Pattern repeated over time
 Aperiodic signal
• Pattern not repeated over time

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 47

Sine Wave
 Peak Amplitude (A)
 maximum strength of signal
 volts
 Frequency (f)
 Rate of change of signal
 Hertz (Hz) or cycles per second
 Period = time for one repetition (T)
 T = 1/f
 Phase (φ)
 Relative position in time

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 48

Varying Sine Waves

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 49

Wavelength
 Distance occupied by one cycle
 Distance between two points of corresponding
phase in two consecutive cycles
 λ
 Assuming signal velocity v
 λ = vT
 λf = v
 c = 3*108 ms-1 (speed of light in free space)

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 50

Frequency Domain Concepts


 Signal usually made up of many frequencies
 Components are sine and/or cosine waves
 Can be shown (Fourier analysis) that any signal
is made up of component sine and/or cosine
waves
 Can plot frequency domain functions

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 51

Addition of Frequency Components

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 52

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 53

Frequency Domain

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 54

Spectrum & Bandwidth


 Spectrum
 range of frequencies contained in signal
 Absolute bandwidth
 width of spectrum
 Effective bandwidth
 Often just bandwidth
 Narrow band of frequencies containing most of the energy
 DC Component
 Component of zero frequency

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 55

Signal with DC Component

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 56

Data Rate and Bandwidth


 Any transmission system has a limited band of
frequencies
 This limits the data rate that can be carried

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 57

Analog and Digital Data Transmission


 Data
 Entities that convey meaning
 Signals
 Electric or electromagnetic representations of data
 Transmission
 Communication of data by propagation and processing of
signals

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 58

Data

 Analog
 Continuous values within some interval
 e.g. sound, video
 Digital
 Discrete values
 e.g. text, integers

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 59

Acoustic Spectrum (Analog)

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 60

Signals
 Means by which data are propagated
 Analog
 Continuously variable
 Various media
• wire, fiber optic, space
 Speech bandwidth 100Hz to 7kHz
 Telephone bandwidth 300Hz to 3400Hz
 Video bandwidth 4MHz
 Digital
 Use two DC components

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 61

Data and Signals


 Usually use digital signals for digital data and
analog signals for analog data
 Can use analog signal to carry digital data
 Modem
 Can use digital signal to carry analog data
 Compact Disc audio

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 62

Analog Signals Carrying Analog and Digital Data

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 63

Digital Signals Carrying Analog and Digital Data

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 64

Analog Transmission
 Analog signal transmitted without regard to
content
 May be analog or digital data
 Attenuated over distance
 Use amplifiers to boost signal
 Also amplifies noise

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 65

Digital Transmission
 Concerned with content
 Integrity endangered by noise, attenuation etc.
 Repeaters used
 Repeater receives signal
 Extracts bit pattern
 Retransmits
 Attenuation is overcome
 Noise is not amplified

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 66

Advantages of Digital Transmission


 Digital technology
 Low cost LSI/VLSI technology
 Data integrity
 Longer distances over lower quality lines
 Capacity utilization
 High bandwidth links economical
 High degree of multiplexing easier with digital
techniques
 Security & Privacy
 Encryption
 Integration
 Can treat analog and digital data similarly

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 67

Transmission Impairments
 Signal received may differ from signal
transmitted
 Analog - degradation of signal quality
 Digital - bit errors
 Caused by
 Attenuation and attenuation distortion
 Delay distortion
 Noise

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 68

Attenuation
 Signal strength falls off with distance
 Depends on medium
 Exponential in nature
 Issues
 Received signal strength:
• must be enough to be detected
• must be sufficiently higher than noise to be received without
error
 Attenuation is an increasing function of frequency
• Use equalization

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 69

Delay Distortion
 Only in guided media
 Propagation velocity varies with
frequency

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 70

Noise
 Additional signals inserted between
transmitter and receiver
 Thermal (Also called white noise)
 Due to thermal agitation of electrons
 Uniformly distributed
 Intermodulation
 Signals that are the sum and difference of original
frequencies sharing a medium
 Crosstalk
 A signal from one line is picked up by another
 Impulse
 Irregular pulses or spikes
 e.g. External electromagnetic interference
 Short duration
 High amplitude
© Copyright 2007, U. K. Roy, IT, JU
Data Communication and Networking 71

Channel Capacity
 Data rate
 In bits per second
 Rate at which data can be communicated
 Bandwidth
 In cycles per second of Hertz
 Constrained by transmitter and medium
 Nyquist Bandwidth
 Establishes data rate and bandwidth for noise free channel
 Given M signal levels and B bandwidth, maximum data rate
C that can be achieved is
C = 2Blog2M
 Shannon’s Capacity
 Given signal to noise ratio SNR, maximum data rate
C = B log2(1 + SNR)
© Copyright 2007, U. K. Roy, IT, JU
Transmission Media
Data Communication and Networking 73

Overview
 Guided - wire
 Unguided - wireless
 Characteristics and quality determined by
medium and signal
 For guided, the medium is more important
 For unguided, the bandwidth produced by the
antenna is more important
 Key concerns are data rate and distance

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 74

Design Factors
 Bandwidth
 Higher bandwidth gives higher data rate
 Transmission impairments
 Attenuation
 Interference
 Number of receivers
 In guided media
 More receivers (multi-point) introduce more attenuation

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 75

Electromagnetic Spectrum

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 76

Guided Transmission Media


 Twisted Pair
 Coaxial cable
 Optical fiber

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 77

Twisted Pair

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 78

Twisted Pair - Applications


 Most common medium
 Telephone network
 Between house and local exchange (subscriber loop)
 Within buildings
 To private branch exchange (PBX)
 For local area networks (LAN)
 10Mbps or 100Mbps

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 79

Twisted Pair - Pros and Cons


 Cheap
 Easy to work with
 Low data rate
 Short range

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 80

Twisted Pair - Transmission Characteristics

 Analog
 Amplifiers every 5km to 6km
 Digital
 Use either analog or digital signals
 repeater every 2km or 3km
 Limited distance
 Limited bandwidth (1MHz)
 Limited data rate (100MHz)
 Susceptible to interference and noise

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 81

Unshielded and Shielded TP


 Unshielded Twisted Pair (UTP)
 Ordinary telephone wire
 Cheapest
 Easiest to install
 Suffers from external EM interference
 Shielded Twisted Pair (STP)
 Metal braid or sheathing that reduces interference
 More expensive
 Harder to handle (thick, heavy)

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 82

UTP Categories
 Cat 3
 up to 16MHz
 Voice grade found in most offices
 Twist length of 7.5 cm to 10 cm
 Cat 4
 up to 20 MHz
 Cat 5
 up to 100MHz
 Commonly pre-installed in new office buildings
 Twist length 0.6 cm to 0.85 cm

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 83

Near End Crosstalk


 Coupling of signal from one pair to another
 Coupling takes place when transmit signal
entering the link couples back to receiving pair
 i.e. near transmitted signal is picked up by
near receiving pair

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 84

Coaxial Cable

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 85

Coaxial Cable Applications

 Most versatile medium


 Television distribution
 Ariel to TV
 Cable TV
 Long distance telephone transmission
 Can carry 10,000 voice calls simultaneously
 Being replaced by fiber optic
 Short distance computer systems links
 Local area networks

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 86

Coaxial Cable - Transmission Characteristics

 Analog
 Amplifiers every few km
 Closer if higher frequency
 Up to 500MHz
 Digital
 Repeater every 1km
 Closer for higher data rates

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 87

Optical Fiber

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 88

Optical Fiber - Benefits


 Greater capacity
 Data rates of hundreds of Gbps
 Smaller size & weight
 Lower attenuation
 Electromagnetic isolation
 Greater repeater spacing
 10s of km at least

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 89

Optical Fiber - Applications


 Long-haul trunks
 Metropolitan trunks
 Rural exchange trunks
 Subscriber loops
 LANs

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 90

Optical Fiber - Transmission Characteristics


 Act as wave guide for 1014 to 1015 Hz
 Portions of infrared and visible spectrum
 Light Emitting Diode (LED)
 Cheaper
 Wider operating temp range
 Last longer
 Injection Laser Diode (ILD)
 More efficient
 Greater data rate
 Wavelength Division Multiplexing

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 91

Optical Fiber Transmission Modes

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 92

Wireless Transmission
 Unguided media
 Transmission and reception via antenna
 Directional
 Focused beam
 Careful alignment required
 Omnidirectional
 Signal spreads in all directions
 Can be received by many antennae

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 93

Frequencies

 2GHz to 40GHz
 Microwave
 Highly directional
 Point to point
 Satellite
 30MHz to 1GHz
 Omnidirectional
 Broadcast radio
 3 x 1011 to 2 x 1014
 Infrared
 Local

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 94

Terrestrial Microwave
 Parabolic dish
 Focused beam
 Line of sight
 Long haul telecommunications
 Higher frequencies give higher data rates

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 95

Satellite Microwave
 Satellite is relay station
 Satellite receives on one frequency, amplifies
or repeats signal and transmits on another
frequency
 Requires geo-stationary orbit
 Height of 35,784km
 Television
 Long distance telephone
 Private business networks

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 96

Broadcast Radio
 Omnidirectional
 FM radio
 UHF and VHF television
 Line of sight
 Suffers from multipath interference
 Reflections

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 97

Infrared
 Modulate noncoherent infrared light
 Line of sight (or reflection)
 Blocked by walls
 e.g. TV remote control, IRD port

© Copyright 2007, U. K. Roy, IT, JU


Data Encoding
Data Communication and Networking 99

Encoding Techniques
 Data are not generally transmitted as they are
due to:
 Framing
 Error detection and correction
 Data are converted into transmittable signals
 There are two possibilities
 Analog communication
• Analog data, analog signal
• Telephone system
• Digital data, analog signal
• Computer to computer communication using telephone line
 Digital Communication
• Digital data, digital signal
• Analog data, digital signal

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 100

Digital Data, Digital Signal


 Digital signal
 Discrete, discontinuous voltage pulses
 Each pulse is a signal element
 Binary data encoded into signal elements

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 101

Terminology
 Unipolar
 All signal elements have same sign
 Polar
 One logic state represented by positive voltage the other by
negative voltage
 Data rate
 Rate of data transmission in bits per second
 Bit duration or length of a bit
 Time taken for transmitter to emit the bit
 Modulation rate
 Rate at which the signal level changes
 Measured in baud = signal elements per second
 Mark and Space
 Binary 1 and Binary 0 respectively
© Copyright 2007, U. K. Roy, IT, JU
Data Communication and Networking 102

Interpreting Signals
 Need to know
 Timing of bits - when they start and end
 Signal levels
 Factors affecting successful interpreting of
signals
 Signal to noise ratio
 Data rate
 Bandwidth

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 103

Comparison of Encoding Schemes


 Signal Spectrum
• Lack of high frequencies reduces required bandwidth
• Lack of dc component allows ac coupling via transformer,
providing isolation
• Concentrate power in the middle of the bandwidth
 Clocking
• Synchronizing transmitter and receiver
• External clock
• Sync mechanism based on signal

 Error detection
• Can be built in to signal encoding
 Signal interference and noise immunity
• Some codes are better than others
 Cost and complexity
• Higher signal rate (& thus data rate) lead to higher costs
• Some codes require signal rate greater than data rate
© Copyright 2007, U. K. Roy, IT, JU
Data Communication and Networking 104

Encoding Schemes
 Non-Return to Zero
 Non-Return to Zero-Level (NRZ-L)
 Non-Return to Zero Inverted (NRZ-I)
 Multilevel Binary
 Bipolar -AMI
 Pseudoternary
 Biphase
 Manchester
 Differential Manchester
 Scrambling
 B8ZS
 HDB3

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 105

Non-Return to Zero Level (NRZ-L)


 Two different voltages for 0 and 1 bits
 Voltage constant during bit interval
 no transition i.e. no return to zero voltage
 e.g. Absence of voltage for zero, constant
positive voltage for one
 More often, negative voltage for one value and
positive for the other
 Example

0 1 0 0 1 1 0 0 0 1 1

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 106

Differential Encoding
 Data represented by changes rather than
levels
 More reliable detection of transition rather
than level
 In complex transmission layouts it is easy to
lose sense of polarity

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 107

Non-Return to Zero Inverted(NRZ-I)


 Non-return to zero inverted on ones
 Constant voltage pulse for duration of bit
 Data encoded as presence or absence of signal
transition at beginning of bit time
 Transition (low to high or high to low) denotes
a binary 1
 No transition denotes binary 0
 An example of differential encoding

0 1 0 0 1 1 0 0 0 1 1

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 108

NRZ pros and cons


 Pros
 Easy to engineer
 Make good use of bandwidth
 Cons
 dc component
 Lack of synchronization capability
 Lack of error detection/correction facility
 Used for magnetic recording
 Not often used for signal transmission

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 109

Multilevel Binary
 Use more than two levels
 Bipolar-AMI
 zero represented by no line signal
 one represented by positive or negative pulse alternatively
 one pulses alternate in polarity
 Pros
 No loss of sync if a long string of ones (zeros still a problem)
 No net dc component
 Lower bandwidth
 Easy error detection

0 1 0 0 1 1 0 0 0 1 1

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 110

Pseudoternary
 One represented by absence of line signal
 Zero represented by alternating positive and
negative
 No advantage or disadvantage over bipolar-
AMI
1 0 0 0 1 1 0 0 0 1 1

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 111

Bipolar-AMI and Pseudoternary

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 112

Trade Off for Multilevel Binary


 Not as efficient as NRZ
 Each signal element only represents one bit
 In a 3 level system could represent log23 = 1.58 bits
 Receiver must distinguish between three levels
(+A, -A, 0)
 Requires approx. 3dB more signal power for same
probability of bit error

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 113

Biphase
 Manchester
 Transition in middle of each bit period
 Transition serves as clock and data
 Low to high represents one
 High to low represents zero
 Used by IEEE 802.3

0 1 0 0 1 1 0 0 0 1 1

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 114

Biphase
 Differential Manchester
 Midbit transition is clocking only
 Transition at start of a bit period represents zero
 No transition at start of a bit period represents one
 Note: this is a differential encoding scheme
 Used by IEEE 802.5

0 1 0 0 1 1 0 0 0 1 1

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 115

Biphase Pros and Cons


 Pros
 Synchronization on mid bit transition (self clocking)
 No dc component
 Error detection
• Absence of expected transition
 Con
 At least one transition per bit time and possibly two
 Maximum modulation rate is twice NRZ
 Requires more bandwidth

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 116

Scrambling
 Use scrambling to replace sequences that
would produce constant voltage
 Filling sequence
 Must produce enough transitions to sync
 Must be recognized by receiver and replace with original
 Same length as original
 No dc component
 No long sequences of zero level line signal
 No reduction in data rate
 Error detection capability

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 117

B8ZS
 Bipolar With 8 Zeros Substitution
 Based on bipolar-AMI
 If octet of all zeros and last voltage pulse
preceding was positive encode as 000+-0-+
 If octet of all zeros and last voltage pulse
preceding was negative encode as 000-+0+-
 Causes two violations of AMI code
 Unlikely to occur as a result of noise
 Receiver detects and interprets as octet of all
zeros

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 118

HDB3
 High Density Bipolar 3 Zeros
 Based on bipolar-AMI
 String of four zeros replaced with one or two
pulses

Number of Bipolar pulses(ones) since


last substitution
Polarity of Odd Even
preceding pulse
- 000- +00+

+ 000+ -000-

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 119

B8ZS and HDB3

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 120

Bandwidth Comparison

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 121

Modulation Rate

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 122

Modulation Rate

Minimum 10101010… Maximum


NRZ-L 0 (all 0s or 1s) 1.0 1.0
NRZ-I 0 (all 0s) 0.5 1.0 (all 1s)
Bipolar AMI 0 (all 0s) 1.0 1.0
Pseudoternary 0 (all 1s) 1.0 1.0
Manchester 1.0 (10101…) 1.0 2.0 (all 0s or 1s)
Differential 1.0 (all 1s) 1.5 2.0 (all 0s)
manchester

© Copyright 2007, U. K. Roy, IT, JU


Data Link Layer
Data Communication and Networking 124

Introduction

Network Layer

LLC sub-layer
Data Link Layer
MAC sub-layer

Physical Layer

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 125

Data Link Layer Design Issues


 Services provided to the Network Layer
 Unacknowledged connectionless service
 Acknowledged connectionless service
 Acknowledged connection-oriented service
 Accessing of underlying medium (MAC sub-layer)
 Data Link Control(Data Link Control Sub-layer)
 Framing
 Identify beginning and ending of a frame
 Error Detection & Correction
 Identifying transmission errors and if possible correcting it
 Error Control
 What to do if frames/acknowledgements are damaged/lost?
 Flow Control
 Transmitter and Receiver must be synchronized
© Copyright 2007, U. K. Roy, IT, JU
Medium Access
Control Sub-layer
Data Communication and Networking 127

Introduction

Network Layer

LLC sub-layer
Data Link Layer
MAC sub-layer

Physical Layer

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 128

Introduction
 Channel
 Unicast—single user
 Broadcast—sometimes called multi-access/random
access channels
 Key issue in a broadcast network
 determine who gets to use the channel when there is
competition for it
 the protocols used to determine who goes next on a
multiaccess channel belong to a sublayer of the data
link layer called the MAC (Medium Access
Control) sublayer.

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 129

Channel Allocation Problem


 Two schemes exist to solve the problem of allocation
for a single broadcast channel among competitive
users:
 static channel allocation
 dynamic channel allocation

 The traditional way of allocating a single channel


 Frequency Division Multiple Access(FDMA)
• Each station is allocated its own frequency
• Uneven usage of bandwidth if number of senders is large and
continuously varying
 Time Division Multiple Access (TDMA)
• Each station is allocated its own time slot for transmission
 Statistical Time Division Multiple Access (STDMA)
© Copyright 2007, U. K. Roy, IT, JU
Data Communication and Networking 130

Problems of Static Allocation


 FDMA, TDMA are inherently inefficient
 C=channel capacity in bps
 λ=frame arrival rate in frames/sec
 1/µ=mean frame size (random/Poison distribution)
1
 Mean time delay from queueing theory
T =
µC −λ
 For FDMA
1 N
 TFDMA = = = NT
µ ( C / N ) − (λ / N ) µC −λ
 For TDMA
1 N
 TTDMA = = = NT
µ ( C / N ) − (λ / N ) µC −λ
 The mean delay for FDMA or TDMA is N times worse
© Copyright 2007, U. K. Roy, IT, JU
Data Communication and Networking 131

Dynamic Channel Allocation


 Five key assumptions:
1. station model
 N number of independent stations.
 Frame generation rate λ is proportional to ∆t.
 Blocks after a frame generation until it is transmitted
2. single channel
 Only one channel is available for all stations
3. collision assumption
 Collision can occur. Every station can detect collision
4a. continuous time
4b. slotted time
5a. carrier sense
 Sense the carrier before transmission
5b. no carrier sense
 transmit without sensing the carrier
© Copyright 2007, U. K. Roy, IT, JU
Data Communication and Networking 132

ALOHA
 Pure ALOHA
 Slotted ALOHA

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 133

Pure ALOHA
 A station transmits a frame whenever it has
one

 If collision occurs,
 detect it
 wait a random amount of time and
retransmit
© Copyright 2007, U. K. Roy, IT, JU
Data Communication and Networking 134

Efficiency of Pure ALOHA


 Frame time—time required to transmit a single
frame
 S=mean number of frame generated per frame
time (Poision)
 G=mean number of frames (old and new combined)
transmitted
 P0=probability that a frame does not suffer a
collision
 Throughput S=GP0
 Probability the k frames arekgenerated
−G
during a
G edistribution:
given frame time by Poisson
Pk =
K!
© Copyright 2007, U. K. Roy, IT, JU
Data Communication and Networking 135

Efficiency of Pure ALOHA

P0 = e − G

 Throughpu S = Ge −2G
1
 tMaximum S max = with G = 0.5
throughput
2e
 Out of 100 frames, maximum of 18 frames reach
their destination without collision
© Copyright 2007, U. K. Roy, IT, JU
Data Communication and Networking 136

Slotted ALOHA
 Time is divided into discrete intervals
 Transmission of a frame is only allowed at
the beginning of a slot
 If a frame is generated in the middle of a
slot, the station must wait for the next slot
 Throughpu S = Ge − G
t 1
 Maximum S max = with G = 1
throughput
e

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 137

Throughput of ALOHA

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 138

Throughput of ALOHA
 Probability that a frame will avoid collision is e-G
 Probability that a frame will suffer a collision is (1-e-
G
)
 Probability of a transmission requires exactly k
attempts is
 Pk= e-G (1-e-G)k-1
α α

E = kP =
Expected

number
k =1
of −G −G k −1
ke (1 − e )
transmission
k ∑
k =1
= e G

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 139

CSMA Protocols
• Protocols in which stations listen for a carrier and act
accordingly are called carrier sense protocols
• Persistent CSMA
• If the channel is busy, station waits until it becomes idle (it
continually senses the carrier for the purpose of seizing it)
• Non-Persistent CSMA
• If the channel is busy, station waits random amount of time
and repeats the algorithm
• 1-persistent CSMA
• If the channel is idle, the station transmits with a
probability of 1
• If collision occurs, it waits a random amount of time, and
starts all over again
• p-persistent
• applies to slotted channels, when the station becomes
ready to send, it senses the channel, if it is idle, it
transmits with a probability p
© Copyright 2007, U. K. Roy, IT, JU
Data Communication and Networking 140

CSMA/CD Protocol

• If collision occurs, stop transmission immediately

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 141

Collision

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 142

Collision Detection

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 143

CSMA/CD Protocol

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 144

Performance Comparison

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 145

Collision Free Protocols


 Collision adversely affect system performance,
when cable is long and frames are short and
number of stations is large
 Collision free protocols is the solution
 Bit-Map Protocol
 Binary Countdown

 Basic Assumptions
 N number of stations
 Each station has a unique address from 0 to N-1

 Which station gets the channel next?


 Reservation protocols.
© Copyright 2007, U. K. Roy, IT, JU
Data Communication and Networking 146

Bit-Map Protocol
 Basic Steps
 Contention period
 Frame transmission
 Contention slot has exactly N slots one for each
station
 Station j is allowed to transmit (either 1 or 0) during
slot j
 No other station is allowed to transmit during that
slot
 Station j sends a 1 if it has frame to transmit, 0
otherwise
 After N time slots, each station has complete
knowledge of which stations wish to transmit
© Copyright 2007, U. K. Roy, IT, JU
Data Communication and Networking 147

Bit-Map Protocol

 If a station is ready, after its bit slot, it must wait for


next bit map

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 148

Performance of Bit-Map Protocol


 Assumptions
 Duration of each contention bit slot is unity
 Duration of a data frame is d time units
 High numbered stations must wait on the average
0.5N slots
 Low numbered stations must wait on the average
1.5N slots
 mean for all stations is N slots
 For low load, the overhead per frame is N bits, and
the amount of data is d bits, for an efficiency of
d/(N+d).
 For high load, the overhead per frame is 1 bit, and
the amount of data is Nd bits, for an efficiency of
d/(d+1)
© Copyright 2007, U. K. Roy, IT, JU
Data Communication and Networking 149

Binary Countdown Protocol


 1 bit overhead per station in Bit-Map protocol
 Solution
 Use binary station address
 Basic idea
 A station with highest address will be allowed to
transmit
 All addresses are assumed to be same length
 Stations broadcast their address bits in each slot,
stating with high order bit
 The bits are then BOOLEAN ORed
 If a station sending a 0, gets 1 (this means that
there is at least one station with higher address), it
gives up

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 150

Binary Countdown Protocol

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 151

Efficiency of Binary Countdown Protocol

• The channel efficiency of this method, under low load is


d/(d+ lnN).
• The channel efficiency of this method, under high load is
Nd/(Nd+ lnN).

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 152

Problems of Binary Countdown Protocol

 Starvation may occur


 Solution proposed by Mok and Ward
 Station having virtual address will be permuted
circularly
 Example
 C, H, D, A, G, B, E, F have priorities 7, 6, 5, 4, 3, 2, 1,
0
 If D transmits, it will removed from this order and
put at the end giving a priority order C, H, A, G, B, E,
F, D

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 153

Performance Comparison
 Two basic protocols
 Contention-based
 Contention free
 Two performance measures
 Delay
 Channel efficiency
 Contention-based protocols are preferable at low
load
 Contention free protocols are preferable at high load
 Solution is Limited Contention Protocol

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 154

Symmetric Protocol
 k number of stations
 Each has a probability p of transmitting during each
slot
 Probability that some station will successfully
acquire the channel during a given slot is A=kp(1-
p)k-1
 pmax= 1/k
 Amax=(1-1/k)k-1

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 155

Symmetric Protocol

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 156

Limited Contention Protocol


 Probability of channel acquisition can be increased
by reducing competition
 Basic idea
 Divide the station into groups
 At slot 0, members of group 0 is permitted to transmit
 If one of them succeeds, it transmits
 If slot 0 is empty or there is a collision, members of
group 1 contend for slot 1, etc.
 By making appropriate division, amount of
contention can be reduced.
 Choice
 Each group has one member—contention free
protocols
 All station are in single group—ALOHA/Slotted ALOHA

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 157

Adaptive Tree Walk Protocol


 Number of members in a group a dynamically
changed
 Example
 All station are allowed to transmit at slot 0
 If there is no collision, next slot 1 will be used by all
stations again
 Otherwise, stations will be broken into two groups
each having half number of stations.
 Slot 1 will be used by members of first half etc.

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 158

Example

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 159

Improvement

• Each node at level I has a fraction 2-i of the stations below it


• if the q ready stations are uniformly distributed, the expected number of them
below a specific node at level i is just 2-iq
• the optimum level to begin searching the tree is at i=log2q
© Copyright 2007, U. K. Roy, IT, JU
Data Communication and Networking 160

Further Improvement
 G and H want to transmit
 At slot 0, collision will occur, slot 1 will be idle
 It is pointless to probe node 3 (because collision will
be the obvious result)

© Copyright 2007, U. K. Roy, IT, JU


Data Link Control
Sub-layer
Data Communication and Networking 162

Framing
 Breaks the message into number of segments called
frames
 This is done to
 reduce total transmission time
S A B D S A B D

1
Transmission
delay message 2
Total 3 1
Delay 2
TD 3 1
Total
message 2
Delay TD
3
Propagation delay

message

Time Time
 reduce amount of retransmission due to error

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 163

Optimal Number of frames?


S A B D x = number of bits in the message
h = header length
k = number of hops between source and destination
R = data rate
1 t p = propagation delay
tm p = number of packets to be deter mined
2 x 
p + h 
1
tf = 
p 

3
R
x 
 + h
2 TD t =
p 
1 f R
3
x 
tp 2 p + h 
p
tm =  
tf 3 R

T x  x 
p + h   + h 
p  + (k − 1)  p
TD =   + kt
p
R R

dTD x(k − 1)
=0 ⇒ p=
dp h
© Copyright 2007, U. K. Roy, IT, JU
Data Communication and Networking 164

Expected amount of transmission?


 x bit message
 b=bit error
 rate (1 − b)
Probability that the message will not be in error is
x

 Probability that the message will be in 1 − (1 − b) x

error is
 Probability that the message requires exactly i
transmission for successful transmission [i.e. (i-1)
unsuccessful transmission followed[1 (1 − b) x ]( i −1) (1 − b) x
by−successful
transmission] is
 Expected number of
transmission i =α
N rx = ∑ i[1 − (1 − b) ]
x ( i −1) x
(1 − b)
i =1

1
N rx =
(1 − b) x x
 Total number of bits transmitted without
framing (1 − b) x
© Copyright 2007, U. K. Roy, IT, JU
Data Communication and Networking 165

Expected amount of transmission?


 p=number of frames
1
 Expected number of N rp =
transmission (1 − b ) x/ p

 Number of bits transmitted with


framing ( x / p ) x
p =
(1 − b) x/ p
(1 − b) x/ p

number of bits transmitted without fram ing (1 − b) x / p


=ω =
number of bits transmitted with fram ing (1 − b) x
1
= x −( x / p )
(1 − b )
 x=10,000 bits
 p=10
 b=0.001 (1 out of 1000)
 ω= 8139

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 166

Framing
 four methods for framing are:
 character count
 starting and ending characters
 starting and ending flags
 physical layer coding violations

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 167

Character Count
 Assumes character oriented data transmission
 This method uses a field in the header to specify the
number of characters in the frame
 When data link layer at the destination sees this, it
knows how many characters follow

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 168

Starting and ending characters


 Gets around the problem of resynchronization
 Each frame starts with special ASCII character sequence DLE
STX and ends with the sequence DLE ETX
 DLE is Data Link Escape, STX is Start of TeXt and ETX is End of
TeXt
 If destination ever loses track of frame boundaries, all it has to
do is look for DLE STX or DLE ETX to figure out where it is

DLE STX A B D DLE ETX DLE STX D B DLE ETX

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 169

Starting and ending characters


 Problem occurs when data contains DLE STX or DLE ETX
DLE STX A DLE D DLE ETX Data sent by network layer
 Solution
 Sender’s data link layer inserts an ASCII DLE character just
before an “accidental” DLE character in the data
 This technique is called character stuffing

Data after being character stuffed


DLE STX A DLE DLE D DLE ETX
by data link layer

 Data link layer at receiving end removes the DLE character


 Thus framing DLE STX or DLE ETX can be distinguished by
absence or presence of a single DLE as DLEs in the data are
always doubled
Data passed to network layer on the
DLE STX A DLE D DLE ETX
receiving node

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 170

Starting and ending flags

Bit Stuffing

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 171

Error Detection
 The data link layer breaks the bit stream up into
discrete frames and then computes the checksum for
each frame
 when a frame arrives at the destination the checksum is
recomputed, and if it is different from the one contained
in the frame, the data link layer knows that an error has
occurred

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 172

Error Detection

 Additional bits added by transmitter for error detection

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 173

Error Detection Techniques


 Parity
 Value of parity bit is such that character has even (even
parity) or odd (odd parity) number of ones

 Even number of bit errors goes undetected

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 174

Two-dimensional parity

Detectable
Double-bit-
error
1 0 1 0 1 1
Undetec
1 1 0 1 1 0 ed
error
0 1 1 1 0 1
0 0 1 0 1 0

Detected
error

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 175

Cyclic Redundancy Check(CRC)


 For a block of d bits transmitter generates r bit
sequence
 Transmit d+r bits which is exactly divisible by some
predetermined number G
 Receiver divides frame by G
 If no remainder, no error

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 176

Cyclic Redundancy Check (CRC)


 D=d-bit data
 G=(r+1)-bit predetermined divisor
 F=r-bit FCS to be determined
 T=(d+r)-bit message to be transmitted

r
D.2 R
=Q+
G G
T = D.2 + R r

T D.2 + R R R R+R
r
= =Q+ + =Q+ =Q
G G G G G
© Copyright 2007, U. K. Roy, IT, JU
Data Communication and Networking 177

Example
D=1010001101
G=110101
R=? G 1 1 0 1 0 1|1 0 1 0 0 0 1 1 0 1 0 0 0 0
0
110101
111011
110101
1110 10
1101 01
11 11 10
11 01 01
T=101000110101110 101100
110101
110010
1 1 0 1 0 1 R
© Copyright 2007, U. K. Roy, IT, JU 01110
Data Communication and Networking 178

Example
D=101110
G=1001
R=?

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 179

Error Correcting codes


 m-bit message
 k redundant bits are added
 T=(m+k)-bit message to be transmitted
 No of possible code words with (m+k)-bit is 2m+k
 Out of 2m+k possible code words, only 2m code words are
valid
 Remaining code words are invalid
 Example
 M=2, K=2
 No. of possible codewords is 24 =16
 No. of valid code words is 4
• 0000, 0011, 1100, 1111
 No. of invalid code words is 12
0000 0100

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 180

Error Correction

•Hamming codes can correct single errors


•by arranging them into matrix we can correct burst
errors
© Copyright 2007, U. K. Roy, IT, JU
Data Communication and Networking 181

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 182

 The polynomial code (cyclic redundancy code or CRC


code) are used for error detecting

 when the polynomial code method is employed, the


sender and receiver must agree upon a generator
polynomial, G(x), in advance.

 Both high and low bits of the generator must be 1

 to compute the checksum for some frame with m bits,


corresponding to the polynomial M(x), the frame must
be longer than the generator polynomial

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 183

 The algorithm for computing the checksum is as follows:


 let r be the degree of G(x). Append r zero bits to the
low-order end of the frame, so it now contains m+r
bits and corresponds to the polynomial xrM(x)
 divide the bit string corresponding to G(x) into the
bit string corresponding to xrM(x) using modulo 2
division
 subtract the remainder (which is always r or fewer
bits) from the bit string corresponding to xrM(x)
using modulo 2 subtraction. The result is the
checksummed frame to be transmitted. Call its
polynomial T(x).

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 184

Flow Control
 Receiver may be slower than transmitter
 Transmitter must not transmit frames at a rate faster
than the receiver can receive
 Ensuring the sending entity does not overwhelm the
receiving entity
 Preventing buffer overflow
 Transmission time
 Time taken to emit all bits into medium
 Propagation time
 Time for a bit to traverse the link

propagation time
a=
transmission time

 If transmission time is normalized to 1, propagation time is `a`

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 185

Model of Frame Transmission

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 186

Stop and Wait Protocol


 Source transmits frame
 Destination receives frame and replies with
acknowledgement
 Source waits for ACK before sending next
frame
 Destination can stop flow by not sending ACK
 Works well for a few large frames

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 187

Fragmentation
 Large block of data may be split into small
frames
 Limited buffer size
 Errors detected sooner (when whole frame received)
 On error, retransmission of smaller frames is needed
 Prevents one station occupying medium for long periods
 Stop and wait becomes inadequate

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 188

Stop and Wait Link Utilization


TD=tframe+tprop+tproc+tack+tprop+tpr
1
tframe
a oc
tprop
TD≈tframe+2tprop
tproc transmission time
η=
tack ack 1 propagation time
t frame
=
2
t frame + 2t prop
1
=
t prop
1+ 2
ack 2 t frame
1 t prop
= where a =
1 + 2a t frame
© Copyright 2007, U. K. Roy, IT, JU
Data Communication and Networking 189

Stop and Wait Link Utilization

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 190

Stop and Wait Link Utilization


 tprop=271 ms (for Satellite channel)
 1 kb frame
 1 Mbps data rate
 Frame transmission time tframe=1 ms
 a=271
 η= 1/(1+2x271)=0.00184

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 191

Sliding Window Flow Control


 Allow multiple frames to be in transit at a time
 Receiver has buffer that can accommodate W
frames
 Transmitter can send up to W frames without
ACK
 Each frame is numbered
 ACK includes number of next frame expected
 Sequence number bounded by size of field (k)
 Frames are numbered modulo 2k

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 192

Sliding Window Diagram

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 193

Example Sliding Window

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 194

Sliding Window Enhancements


 Receiver can acknowledge frames without
permitting further transmission (Receive Not
Ready)
 Must send a normal acknowledge to resume
 If duplex, use piggybacking
 If no data to send, use acknowledgement frame
 If data but no acknowledgement to send, send last
acknowledgement number again, or have ACK valid flag
(TCP)

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 195

Performance?

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 196

Performance?

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 197

Performance?

1 N ≥ 1 + 2a

U =  N
1 + 2a N < 1 + 2a

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 198

Error Control
 Detection and correction of errors
 Lost frames
 Damaged frames
 Automatic repeat request
 Error detection
 Positive acknowledgment
 Retransmission after timeout
 Negative acknowledgement and retransmission

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 199

Automatic Repeat Request (ARQ)


 Stop and wait
 Go back N
 Selective reject (selective
retransmission/repeat)

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 200

Stop and Wait


 Source transmits single frame
 Wait for ACK
 If received frame damaged, discard it
 Transmitter has timeout
 If no ACK within timeout, retransmit
 If ACK damaged,transmitter will not recognize
it
 Transmitter will retransmit
 Receive gets two copies of frame
 Use ACK0 and ACK1

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 201

Stop and Wait -Diagram

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 202

Stop and Wait - Pros and Cons


 Simple
 Inefficient

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 203

Go Back N
 Based on sliding window
 If no error, ACK as usual with next frame
expected
 Use window to control number of outstanding
frames
 If error, reply with rejection
 Discard that frame and all future frames until error frame
received correctly
 Transmitter must go back and retransmit that frame and all
subsequent frames

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 204

Go Back N - Damaged Frame


 Receiver detects error in frame i
 Receiver sends rejection-i
 Transmitter gets rejection-i
 Transmitter retransmits frame i and all
subsequent

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 205

Go Back N - Lost Frame (1)


 Frame i lost
 Transmitter sends i+1
 Receiver gets frame i+1 out of sequence
 Receiver send reject i
 Transmitter goes back to frame i and
retransmits

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 206

Go Back N - Lost Frame (2)


 Frame i lost and no additional frame sent
 Receiver gets nothing and returns neither
acknowledgement nor rejection
 Transmitter times out and sends
acknowledgement frame with P bit set to 1
 Receiver interprets this as command which it
acknowledges with the number of the next
frame it expects (frame i )
 Transmitter then retransmits frame i

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 207

Go Back N – Damaged Acknowledgement


 Receiver gets frame i and send
acknowledgement (i+1) which is lost
 Acknowledgements are cumulative, so next
acknowledgement (i+n) may arrive before
transmitter times out on frame i
 If transmitter times out, it sends
acknowledgement with P bit set as before
 This can be repeated a number of times before
a reset procedure is initiated

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 208

Go Back N - Damaged Rejection

 As for lost frame (2)

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 209

Go Back N - Diagram

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 210

Maximum window size?


 Consider a piggybacking acknowledgement
scheme is used
 3-bit sequence number
 Transmitter sends frame 0 and gets RR1
 Transmitter then sends 1, 2, 3, 4, 5, 6, 7, 0
 Transmitter gets RR1
 What does it mean?
 All eight frames are received properly
 All are lost and receiver is repeating its previous RR1

 For n bit sequence number maximum window


size can be 2n-1

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 211

Selective Reject/Retransmission
 Only rejected frames are retransmitted
 Subsequent frames are accepted by the
receiver and buffered
 Minimizes retransmission
 Receiver must maintain large enough buffer
 More complex login in transmitter

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 212

Selective Reject -Diagram

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 213

Maximum window size?


 Transmitter sends frame 0 through 6
 All 7 frames are received properly.
 Receiver advances its window to accept frames
7 through 5 and sends RR7
 RR7 is lost in transit.
 Transmitter times out and retransmit frame 0
 Receiver accepts this frame as new frame

 For n bit sequence number maximum window


size can be 2n-1

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 214

Performance?
Tf
 Channel Utilization U =
Tt
 Where Tf=time to transmit a single frame
 Tt=total time that line is engaged in the
transmission of a single frame
 For error free operation using Stop-and-Wait
protocol Tf
U=
T f + 2T p
 In the presence of error equation must be modified
T
as U=
f

N r (T f + 2T p )

 Where Nr=expected number of transmission to


transmit a frame successfully

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 215

Performance?
 p=probability that a single frame is in error
 Assume ACKs and NAKs are never in error
 To transmit a frame successfully, it requires
exactly i attempts
 That means i-1 times unsuccessful (with error)
transmission followed by 1 successful (without
error) transmission
 Probability that a frame requires exactly i
transmission is pi-1(1-p) α
 Nr=E[transmission]= ∑ (1 − p)
ip i −1

i =1
1
=
1− p
© Copyright 2007, U. K. Roy, IT, JU
Data Communication and Networking 216

Performance?
1− p
 Stop-and-Wait ARQ U =
1 − 2a
1 − p N ≥ 1 + 2a
 Selective Reject ARQ U = 
 N (1 − p)
 1 + 2a N < 1 + 2a

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 217

Go-back-N?
 Nr=E[number of transmitted frame to transmit one frame
successfully]
 f(i)=total number of transmission if original frame
must be transmitted i times
 K=total number of frames retransmitted (including
the original frame) for each
α
error
N r = ∑ [(1 − K ) + Ki ] p i −1 (1 − p )
 f(i)=1+(i-1)K i =1
α α
 =(1-K)+Ki = (1 − K )∑ p (1 − p ) + K ∑ ip i −1 (1 − p )
i −1

i =1 i =1
K
= (1 − K ) +
1− p
1 − p + Kp
=
1− p

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 218

Go-back-N?
 1− p N ≥ 1 + 2 a , K = 1 + 2 a
1 + 2ap
U = 
 N (1 − p)
N < 1 + 2a, K = N
(1 + 2a )(1 − p + Np )

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 219

Performance?

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 220

Data Link Control Protocols


 Designed to satisfy wide variety of
requirements
 Point-to-point and multi-point
 Half-duplex and full-duplex
 Primary-secondary and peer
 Small and large propagation delay
 High Level Data Link (HDLC) protocol
 Advanced Data Communication Control
Procedures (ADCCP)—developed by ANSI
 Link-Access Procedure, Balanced (LAP-B)—
adopted by CCITT
 Synchronous Data Link Control (SDLC)—
adopted by IBM
© Copyright 2007, U. K. Roy, IT, JU
Data Communication and Networking 221

HDLC Protocol
 Widely used data link control protocol
• Used in PPP
 Satisfy Basic Characteristics
• Three types of stations
• Two link configurations
• Three data transfer mode

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 222

HDLC Station Types


 Primary station
 Controls operation of link
 Maintains separate logical link to each secondary station
 Frames issued are called commands
 Secondary station
 Operates under control of primary station
 Frames issued called responses
 Combined station
 May issue commands and responses

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 223

HDLC Link Configurations


 Unbalanced
 One primary and one or more secondary stations
 Supports full duplex and half duplex
 Balanced
 Two combined stations
 Supports full duplex and half duplex

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 224

HDLC Transfer Modes


 Normal Response Mode (NRM)
• Unbalanced configuration
• Host computer as primary, Terminals as secondary
• Primary initiates transfer to secondary
• Secondary may only transmit data in response to command
from primary
 Asynchronous Balanced Mode (ABM)
• Balanced configuration
• Either station may initiate transmission without receiving
permission
• Most widely used
• No polling overhead
 Asynchronous Response Mode (ARM)
• Unbalanced configuration
• Secondary may initiate transmission without permission form
primary
• Primary responsible for line
• rarely used

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 225

Frame Structure
 Uses synchronous transmission
 All transmissions in frames
 Single frame format for all data and control
exchanges

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 226

Flag Fields
 01111110
 Delimit frame at both ends
 May close one frame and open another
 Receiver hunts for flag sequence to
synchronize
 Bit stuffing used to avoid confusion with data
containing 01111110
 0 inserted after every sequence of five 1s
 If receiver detects five 1s it checks next bit
 If 0, it is deleted
 If 1 and seventh bit is 0, accept as flag
 If sixth and seventh bits are 1, sender is indicating abort

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 227

Bit Stuffing

 Example with
possible errors

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 228

Address Field
 Identifies secondary station that will send or
receive frames
 Usually 8 bits long
 May be extended to multiples of 8 bits
 LSB of each octet indicates that it is the last octet (1) or not
(0)
 All ones (11111111) is broadcast

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 229

Control Field
 Different for different frame type
 Three types of frames
 Information - data to be transmitted to user (next layer up)
• Flow and error control piggybacked on information frames
 Supervisory - ARQ when piggyback not used
 Unnumbered - supplementary link control
 First one or two bits of control filed identify
frame type
 Remaining bits explained later

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 230

Control Field Diagram

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 231

Supervisory frames

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 232

Unnumbered frames

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 233

Poll/Final Bit
 Use depends on context
 Command frame
 P bit
 1 to solicit (poll) response from peer
 Response frame
 F bit
 1 indicates response to soliciting command

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 234

Information Field
 Only in information and some unnumbered
frames
 Must contain integral number of octets
 Variable length

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 235

Frame Check Sequence Field


 FCS
 Error detection
 16 bit CRC
 Optional 32 bit CRC

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 236

HDLC Operation
 Exchange of information, supervisory and
unnumbered frames
 Three phases
 Initialization
 Data transfer
 Disconnect

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 237

Examples of Operation (1)

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 238

Examples of Operation (2)

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 239

Other DLC Protocols (LAPB,LAPD)


 Link Access Procedure, Balanced (LAPB)
 Part of X.25 (ITU-T)
 Subset of HDLC - ABM
 Point to point link between system and packet switching
network node
 Link Access Procedure, D-Channel
 ISDN (ITU-D)
 ABM
 Always 7-bit sequence numbers (no 3-bit)
 16 bit address field contains two sub-addresses
• One for device and one for user (next layer up)

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 240

Other DLC Protocols (LLC)


 Logical Link Control (LLC)
 IEEE 802
 Different frame format
 Link control split between medium access layer (MAC) and
LLC (on top of MAC)
 No primary and secondary - all stations are peers
 Two addresses needed
• Sender and receiver
 Error detection at MAC layer
• 32 bit CRC
 Destination and source access points (DSAP, SSAP)

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 241

Other DLC Protocols (Frame Relay)


 Streamlined capability over high speed packet
witched networks
 Used in place of X.25
 Uses Link Access Procedure for Frame-Mode
Bearer Services (LAPF)
 Two protocols
 Control - similar to HDLC
 Core - subset of control
 ABM
 7-bit sequence numbers
 16 bit CRC
 2, 3 or 4 octet address field
 Data link connection identifier (DLCI)
 Identifies logical connection
 More on frame relay later
© Copyright 2007, U. K. Roy, IT, JU
Data Communication and Networking 242

Other DLC Protocols (ATM)


 Asynchronous Transfer Mode
 Streamlined capability across high speed
networks
 Not HDLC based
 Frame format called “cell”
 Fixed 53 octet (424 bit)
 Details later

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 243

Required Reading
 Stallings chapter 7
 Web sites on HDLC, frame relay, Ethernet and
ATM

© Copyright 2007, U. K. Roy, IT, JU


Local Area
Networks(LANs)
Data Communication and Networking 245

IEEE Standard for LANs amd MANs


 IEEE produced several standard—collectively known
as IEEE 802
 They differ physical layer and MAC sub-layer but
compatible at LLC sub-layer
 802.1—introduction
 802.2– LLC (Logical Link Control)
 802.3—CSMA/CD (Ethernet)
 802.4—Token Bus
 802.5—Token Ring
 806.6—DQDB (Distributed Queue Dual Bus)

© Copyright 2007, U. K. Roy, IT, JU


IEEE 802.3
(Ethernet) LAN
Data Communication and Networking 247

Ethernet Cabling

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 248

Ethernet Topology

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 249

Encoding

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 250

Ethernet Frame format

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 251

Ethernet Protocol
 Preamble—7 bytes each containing 10101010
 Allow receivers clock to synchronized with the sender’s clock
 Start Delimiter—1 byte 10101011
 Destination address—2 bytes or 6 bytes
 Ordinary address—high order bit 0
 Group address—high order bit 1
 Broadcast address—all 1’s
 Source address
 Length—number of bytes present in data field
 Minimum 0 maximum 1500
 Pad—0 to 46 bytes long—used to make an Ethernet
packet at least 64 bytes long
 Checksum—32 bits

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 252

Collision detection

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 253

Binary Exponential Backoff Algorithm


 If collision occurs, wait a random(?) amount of time
 Used to reduce number of collision and reduce
waiting time
 Basic idea
 If collision occurs, pick a random number from the set {0,
1}
 If collision occurs again, pick a random number from the set
{0, 1, 2, 3}
 In general, at ith step, pick a random number from 0 to 2i

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 254

Performance
 K stations are always ready to transmit
 p—probability that each station will transmit during
each slot
 Probability that some station will acquire the channel
is A=kp(1-p)k-1
 Amax1/e as kα for p=1/k
 Probability that the contention interval has exactly j
slots is A(1-A)j α
1
Mean number of contention slot ∑ jA(1 − A) = A
j

j =0
 For optimal p (1/k), mean number of contention slots
is never more than e
 P=mean frame time P
 Channel efficiency P +2τ / A
© Copyright 2007, U. K. Roy, IT, JU
Data Communication and Networking 255

Ethernet Efficiency

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 256

Switched Ethernet LAN

© Copyright 2007, U. K. Roy, IT, JU


IEEE802.4
(Token Bus) LAN
Data Communication and Networking 258

Token Bus
 Ethernet protocol is probabilistic protocol and worst
case time waiting time is unbounded
 Solution—use ring and avoid collision
 For n stations, if each takes T time to transmit frame,
no station will have to wait more than nT time

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 259

Token Bus

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 260

Token Bus protocol


 Physically token bus is a linear or tree-shaped cable
 A logical ring (in decreasing order of their addresses)
is maintained
 Each station knows the address of the stations to its “left”
and “right”
 Initially, highest numbered station is permitted to send a
frame
 After it is done, it forwards its permission by sending a
special control frame called a Token
 Only token holder can transmit a frame
 Only one station holds the token at a time—collisions do not
occur

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 261

Token Bus Frame Format

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 262

Token Bus Frame Format


 Preamble–1 byte 10101010
 Start delimiter and end delimiter—frame boundary
 Frame control—specifies frame type
 Destination address and source address—2 ot 6
bytes each
 Data—upto 8192 bytes
 Checksum—4 bytes

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 263

Protocol and Logical ring maintenance


 Token holding time
 Priority of frames—0, 2, 4, 6(highest)
 Control frames

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 264

Protocol and Logical ring maintenance


 Joining the ring
 Periodically(?) token holder sends SOLICIT_SUCCESSOR_1
frame
 source address=sender’s address, destination
address=successor’s address
 Station inside the range can bid to enter, other stations
must wait
 If two or more stations bid to enter, collision will occur
 Broadcast a frame RESOLVE_CONTENTION and use binary
countdown algorithm to resolve the contention
 Leaving the ring
 Send SET_SUCCESSOR
 Source address=sender’s address, destination
address=successor’s address

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 265

Protocol and Logical ring maintenance


 Ring Initialization
 Special case of joining the ring
 Station notices certain period of time for either token or
frame.
 Sends a CLAIM_TOKEN and forms a ring containing itself
 If collision occurs, send RESOLVE_CONTENTION frame and
use binary countdown algorithm to resolve contention
 Station failure
 Forward the token and listens if the successor either
transmits a frame or passes the token
 If that does neither, send WHO_FOLLOWS frame
 Source address=sender’s address, destination
address=successor’s address
 Failed stations successor sees WHO_FOLLOWS frame
naming its predecessor
 It then sends SET_SUCCESSOR frame

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 266

Protocol and Logical ring maintenance


 Station failure
 Successor’s successor is also down
 Sends SOLICIT_SUCCESSOR_2 frame to see anyone alive
 Token holder goes down
 Each station sets a timer.
 When time expires, it sends a CLAIM_TOKEM frame and
follows the procedure identical as ring initialization

© Copyright 2007, U. K. Roy, IT, JU


IEEE802.5
(Token Ring) LAN
Data Communication and Networking 268

IEEE Standard 802.5: Token Ring


© Copyright 2007, U. K. Roy, IT, JU
Data Communication and Networking 269

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 270

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 271

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 272

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 273

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 275

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 276

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 277

Token Ring Frame Format

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 278

Token Ring Control Frames

© Copyright 2007, U. K. Roy, IT, JU


Wide Area
Networks(WANs)
IEEE802.6
(DQDB) LAN
Data Communication and Networking 281

© Copyright 2007, U. K. Roy, IT, JU


Network Layer
Data Communication and Networking 283

Network Layer Design Issues


 The network layer is concerned with getting packets
from all the way to the destination.
 The network layer is the lowest layer that deals with
end-to-end transmission
 the network layer provides services to the transport
layer at the network layer/transport layer interface.
 The network layer services have been designed with
the following goals in mind:
 The services should be independent of the subnet
technology
 the transport layer should be shielded from the
number, the type and the topology of the subnets
present
 the network addresses made available to the
transport layer should use a uniform numbering plan,
even across LANs and WANs.
© Copyright 2007, U. K. Roy, IT, JU
Data Communication and Networking 284

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 285

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 286

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 287

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 288

Routing Algorithms
 In most subnets packets have to take
multiple hops
 the algorithms that choose the routes and the
data structures that they use are a major
area of network layer design
 the routing algorithm that is a part of the
network layer software responsible for
deciding which output line an incoming
packet should be transmitted on
 In session routing route remains in force for
an entire user session

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 289

Routing Algorithms
 Characteristics  Decision Time and Place
required  Time
 Correctness • Packet or virtual circuit
 Simplicity basis
 Robustness
 Place
• Distributed
 Stability
• Made by each node
 Fairness • Centralized
 Optimality • Source
 Efficiency
 Routing Strategies
 Performance Criteria  Non-adaptive
 Used for selection of route • Flooding
 Minimum hop • Random
 Least cost  Adaptive

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 290

Flooding
 No network info required
 Packets are sent by source node to every
neighbor
 Incoming packets are retransmitted on every
link except incoming link
 Eventually a number of copies will arrive at
destination

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 291

Flooding Example

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 292

Properties of Flooding
 All possible routes are tried
 Very robust
 At least one packet will have taken minimum
hop count route
 Can be used to set up virtual circuit
 All nodes are visited
 Useful to distribute information (e.g. routing)

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 293

Disadvantage of Flooding
 Huge number of packets will be generated
 Solution
 Each packet is uniquely numbered so duplicates can be
discarded
 Nodes can remember packets already forwarded to keep
network load in bounds
 Can include a hop count in packets

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 294

Random Routing
 Node selects one outgoing path for
retransmission of incoming packet
 Selection can be random or round robin
 Can select outgoing path based on probability
calculation
 No network info needed
 Route is typically not least cost nor minimum
hop

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 295

Adaptive Routing
 Used by almost all packet switching networks
 Routing decisions change as conditions on the
network change
 Failure
 Congestion
 Requires info about network
 Decisions more complex
 Tradeoff between quality of network info and
overhead
 Reacting too quickly can cause oscillation
 Too slowly to be relevant

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 296

Adaptive Routing - Advantages


 Improved performance
 Aid congestion control (See chapter 12)
 Complex system
 May not realize theoretical benefits

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 297

Classification
 Based on information sources
 Local (isolated)
• Route to outgoing link with shortest queue
• Can include bias for each destination
• Rarely used - do not make use of easily available info
 Adjacent nodes
 All nodes

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 298

Isolated Adaptive Routing

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 299

ARPANET Routing Strategies(1)


 First Generation
 1969
 Distributed adaptive
 Estimated delay as performance criterion
 Bellman-Ford algorithm (appendix 10a)
 Node exchanges delay vector with neighbors
 Update routing table based on incoming info
 Doesn't consider line speed, just queue length
 Queue length not a good measurement of delay
 Responds slowly to congestion

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 300

ARPANET Routing Strategies(2)


 Second Generation
 1979
 Uses delay as performance criterion
 Delay measured directly
 Uses Dijkstra’s algorithm (appendix 10a)
 Good under light and medium loads
 Under heavy loads, little correlation between reported delays
and those experienced

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 301

ARPANET Routing Strategies(3)


 Third Generation
 1987
 Link cost calculations changed
 Measure average delay over last 10 seconds
 Normalize based on current value and previous results

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 302

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 303

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 304

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 305

1
Mean delay, T= µC −λ

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 306

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 307

Distance Vector Routing

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 308

Count to Infinity Problem

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 309

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 310

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 311

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 312

Link State Routing

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 313

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 314

Hierarchical Routing

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 315

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 316

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 317

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 318

Congestion Control
 when too many packets are present in (a part of the) subnet,
performance degrades, and the situation is called congestion
 as traffic increases too far, the routers are no longer able to
cope, and they begin losing packets
 at very high traffic the performance collapses completely, and
almost no packets are delivered
 congestion can be brought about by insufficient memory to
hold the packets, slow processors, low-bandwidth lines
 Congestion tends to feed upon itself and become worse
 congestion control has to do with making sure the subnet is
able to carry the offered traffic, flow control, in contrast
relates to point-to-point traffic between a given sender and a
receiver

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 319

Congestion

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 320

General Principles
 control theory approach divides the solutions into two
groups: open loop and closed loop
 open loop solutions tend to solve the problem by good
design, in essence, to make sure that it does not occur
in the first place
 closed loop solutions are based on the concept of
feedback loop
 closed loop handles congestion control by:
 monitoring the system to detect when and where
congestion occurs
 passing this information to place where action can
be taken
 adjusting system operations to correct the problems
 open loop manages congestion by a technique called
traffic shaping - forcing the packets to be transmitted
©at a more
Copyright 2007, predictable
U. K. Roy, IT, JU rate
Data Communication and Networking 321

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 322

Leaky Bucket Algorithm

•Traffic shaping is used to regulate the average rate of data


transmission which is implemented using the leaky bucket
algorithm and the token bucket algorithm
© Copyright 2007, U. K. Roy, IT, JU
Data Communication and Networking 323

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 324

Token Bucket Algorithm

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 325

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 326

Congestion Control in Virtual Circuit

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 327

Waiting Fair Queue

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 328

Chock Packet

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 329

IP Addressing

 IP Address Requirements
 What is an IP Address?
 Network IDs and Host IDs
 What is a Physical Segment?
 IP Addressing Rules
 Classfull IP Addressing
 Address Classes
 Class A Addresses
 Class B Addresses
 Class C Addresses
 Class D & E Addresses
 Address Class Summary

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 330

IP Addressing Requirements

 Each Device that uses TCP/IP needs at least


one!
 Computer/Host (each Network Interface Card)
 Routers (each port or connection)
 Printers
 Other Devices

 Each Device needs a Unique IP Address


 An Example:
 206.77.105.9

 Configured in TCP/IP Software

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 331

What is an IP Address?

 32-bit Binary Number (Address)


 11000000101010000111000100010011
 Divided into 4, 8-bit Octets
 11000000.10101000.01110001.00010011
 Converted to Decimal Numbers
 See: Binary Math
 192.168.113.19
 Decimal range of an Octet: 0-255

 It contains the device’s:


 Network ID and Host ID

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 332

Network ID and Host ID

 Network ID  Host ID
 Shared or Common to all  Identifies a specific device
computers on the same (Host) within a physical
physical segment
segment
 Unique on the Entire
Network
 Unique on the physical
segment
 “Area Code”
 “Phone Number”

192.176.11.201

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 333

IP Addressing
What is a Physical Segment?

 A Broadcast Domain
 The portion of the network that you can retrieve
information from by using a broadcast packet!
 Ignore Repeaters, Bridges, or Switches
 Forward Broadcasts
 Everything (all devices) --
 Out a port of a router
 Between two routers
 Routers Don’t Forward Broadcasts
 IP Addressing Rules
 All Devices on the Same Physical Segment Share a
Common Network ID
 Each Physical Segment Has a Unique Network IDs

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 334

IP Addressing
IP Addressing Rules

 Each Device (Host) Needs at Least One


Unique IP Address All Devices on the
Same Physical Segment Share a
Common Network ID (Subnet Mask)
Each Physical Segment Has a Unique
Network ID (Subnet Mask)

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 335

IP Addressing
Classfull IP Addressing

 Traditional Manner of Addressing


 Class A
 Class B
 Class C
 Address Classes Specify Which Octets of the IP
Address are the Network-ID and Which are the
Host-ID
 Address Classes Specify Network Sizes
(Number of Hosts)

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 336

IP Addressing
Address Classes

 Class A
 Network . Host . Host . Host
 Class B
 Network . Network . Host . Host
 Class C
 Network . Network . Network . Host
 Class D & E

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 337

IP Addressing
Class A Networks:
The Definition

 Per Specification:
 1st Octet is the Network ID
 2nd, 3rd, 4th Octets are the Host ID
 In Binary –
 Any address that starts with a “0” in the first bit!
 First Class A Network Address:

00000001.00000000.0000000.00000000 (Binary)

1.0.0.0 (Decimal)
 Last Class A Network Address:
 01111111.00000000.00000000.00000000 (Binary)
 127.0.0.0 (Decimal) (Loopback Address)

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 338

IP Addressing
Class A Networks:
Network IDs
 1st Octet is the Network ID
 0.0.0.0 (Invalid)
 1.0.0.0
 2.0.0.0
 3.0.0.0
 ~~~~
 127.0.0.0 (Loop back)
 2nd, 3rd, 4th Octets are the Host IDs
 An Assigned Class A Network Address:
 33.0.0.0 (Specifies the Network)
 2nd, 3rd, 4th Octets are the Host IDs
 Specified by Network Administrators

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 339

IP Addressing
Class A Networks:
The Number of Networks

 1st Octet is the Network ID


 1-126 = 126 Possible Class A Network IDs
 2nd, 3rd, 4th Octets are the Host IDs
 Each of the three Octets has a possible 256 Host IDs
 Number of Host IDs from three Octets:
 256 * 256 * 256 = 16,777,216 (minus 2) = 16,777,214
 Always Subtract 2 from the number of Host IDs
 Host IDs cannot be all 1’s (reserved for broadcast
address)
 Host IDs cannot be all 0’s (reserved for “this network
only” address)

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 340

IP Addressing
Class A Networks:
Host ID Addresses

 33.0.0.0 (An Assigned Class A Address)


 All devices would share the 33 network ID.
 The Administrator would number the IP devices:

33.0.0.1 – 33.0.0.255 (255 Addresses)
 33.0.1.0 – 33.0.1.255 (256 Addresses)
 ~~~~

33.0.255.0 -- 33.0.255.255 (256 Addresses)
 (A Total of 65,535 Addresses)
 33.1.0.0 -- 33.1.255.255 (65,536 Addresses)
 33.2.0.0 -- 33.2.255.255 (65,536 Addresses)
 ~~~~
 33.255.0.0 -- 33.255.255.254 (65,535 Addresses)
 ( Total Addresses: 16.7 Million)

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 341

IP Addressing
Class B Networks:
The Definition

 Per Specification:
 1st and 2nd Octets are the Network ID
 3rd, 4th Octets are the Host IDs
 In Binary –
 Any address that starts with a “10” in the first two
bits of the first octet!
 First Class B Network Address:
 10000000.00000000.0000000.00000000 (Binary)
 128.0.0.0 (Decimal)
 Last Class B Network Address:

10111111.11111111.00000000.00000000 (Binary)

191.255.0.0 (Decimal)

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 342

IP Addressing
Class B Networks:
Network IDs
 1st and 2nd Octets are the Network IDs

128.0.0.0
 128.1.0.0
 ~~~~
 128.255.0.0
 129.0.0.0
 129.1.0.0
 ~~~~
 191.255.0.0
 3rd, 4th Octets are the Host IDs
 An Assigned Class B Network Addresses
 153.11.0.0
 3rd, 4th Octets are the Host IDs

Specified by Network Administrators

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 343

IP Addressing
Class B Networks:
The Number of Networks

 1st and 2nd Octets are the Network IDs


 1st Octet 128 -- 191 = 64 Possible Network IDs
 2nd Octet 0 – 255 = 256 Possible Network IDs
 Total Class B Network IDs 64 * 256 = 16,384
 3rd, 4th Octets are the Host IDs
 Each of the Two Octets has a possible 256 Host IDs
 Number of Host IDs from Two Octets:
 256 * 256 = 65,536 (minus 2) = 65,534
 Always Subtract 2 from the number of Host IDs
 Host ID cannot be all 1’s (reserved for broadcast address)
 Host ID cannot be all 0’s (reserved for “this network only”
address)

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 344

IP Addressing
Class B Networks:
Host ID Addresses

 An Assigned Class B Address


 153.11.0.0

All devices would share the 153.11 Network ID.

The Administrator would number the IP devices:
 153.11.0.1 -- 153.11.0.255 (255 Addresses)
 153.11.1.0 -- 153.11.1.255 (256 Addresses)
 153.11.2.0 -- 153.11.2.255 (256 Addresses)
 ~~~~
 153.11.255.0 -- 153.11.255.254 (255 Addresses)

Total Addresses: 65,534

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 345

IP Addressing
Class C Networks:
The Definition

 Per Specification:
 1st, 2nd, 3rd Octets are the Network ID
 4th Octet is the Host ID
 In Binary –
 Any address that starts with a “110” in the first three
bits of the first octet!
 First Class C Network Address:
 11000000.00000000.0000000.00000000 (Binary)
 192.0.0.0 (Decimal)
 Last Class C Network Address:

11011111.11111111.11111111.00000000 (Binary)

223.255.255.0 (Decimal)

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 346

IP Addressing
Class C Networks:
Network IDs

 1st, 2nd, 3rd Octets are the Network IDs


 192.0.0.0 – 192.0.255. 0
 192.1.0.0 – 192.1.255.0
 ~~~~
 192.255.0.0 – 192.255.255.0
 193.0.0.0 – 193.255.255.0
 ~~~~
 223.0.0.0 – 223.255.255.0
 4th Octet is the Host IDs
 An Assigned Class C Network Address
 201.11.206.0
 4th Octet is the Host IDs
 Specified by Network Administrators

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 347

IP Addressing
Class C Networks:
The Number of Networks

 1st, 2nd, 3rd Octets are the Network IDs


 1st Octet 192 -- 223 = 31 Possible IDs
 2nd Octet 0 – 255 = 256 Possible IDs
 3nd Octet 0 – 255 = 256 Possible IDs
 Total Class C Network IDs 32 * 256 *256 = 2,097,152
 4th Octet is the Host ID
 An Octet has a possible 256 IDs
 Number of Host IDs an Octet:
 256 (minus 2) = 254
 Always Subtract 2 from the number of Host IDs
 Host ID cannot be all 1’s (reserved for broadcast address)

Host ID cannot be all 0’s (reserved for “this network only”
address)

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 348

IP Addressing
Class C Networks:
Host ID Addresses

 An Assigned Class C Address


 201.11.206.0

All devices would share the 201.11.206.0 Network
ID.

The Administrator would number the IP devices:
 201.11.206.1, 201.11.206.2, ~~~~ 201.11.206.254

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 349

IP Addressing
Class D & E

 Class D
 Used by Multicast Applications
 Shared Addresses
 224.0.0.0 – 239.255.255.255
 Class E
 Experimental
 240.0.0.0 +

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 350

IP Addressing
Address Classes:
Network IDs and Host IDs

 Class A (1st Octet 1-127)


 Network.Host.Host.Host
 Class B (1st Octet 128-191)
 Network.Network.Host.Host
 Class C (1st Octet 192-223)
 Network.Network.Network.Host

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 351

IP Addressing
Address Class Summary

 1st Networks Hosts


IDs Octet IDs /Network
 Class A 1-127 126 16,777,214
 Class B 128-191 16,384 65,534
 Class C 192-223 2,097,152 254

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 352

IP Addressing
IP Address: What is It?

 32-bit Binary Number (Address)


 11000000101010001110000100010011
 Divided into 4, 8-bit Octets
 11000000.10101000.11100001.00010011
 Converted to Decimal Numbers

See: Binary Math
 192.168.225.19
 Decimal range of an Octet: 0-255
 It contains the device’s:
 Network ID and Host ID

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 353

IP Addressing
IP Addressing Rules

 Each Device (Host) Needs at Least One


Unique IP Address
 All Devices on the Same Physical
Segment Share a Common Network ID
(Subnet Mask)
 Each Physical Segment Has a Unique
Network ID (Subnet Mask)

© Copyright 2007, U. K. Roy, IT, JU


Data Communication and Networking 354

IP Addressing
Address Classes: Network IDs and Host
IDs

 Class A (1st Octet 1-127)


 Network.Host.Host.Host
 Class B (1st Octet 128-191)
 Network.Network.Host.Host
 Class C (1st Octet 192-223)
 Network.Network.Network.Host

© Copyright 2007, U. K. Roy, IT, JU

You might also like