UTTAM K.

ROY
Dept. of Information Technology,
Jadavpur University, Kolkata
INTERNETWORKING
Advanced Java Programming
10/18/08 18:23
2
© Copyright 2007, U. K. Roy, IT, JU
Internetworking

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

Alberto Leon Garcia & Indra Widjaja, “Communication Networks”, Tata
McGraw-Hill publication

William Stallings, “Data & Computer Communications”, Prentice Hall
of India publication

Krouse, “Computer Networks”, Pearson publication
Books

Farouzan, “Computer Networks”

Farouzan, “TCP/IP Protocol Suit”
Advanced Java Programming
10/18/08 18:23
3
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Introduction

Definition

Collection of (autonomous) computers connected by some
fashion

Example
Advanced Java Programming
10/18/08 18:23
4
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
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
• Matrix multiplication
• Load balancing
Advanced Java Programming
10/18/08 18:23
5
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
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:
Advanced Java Programming
10/18/08 18:23
6
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Communications Model

Source

generates data to be transmitted—telephones, PC

Transmitter

Converts data into transmittable signals—Modem

Transmission System

Carries data

Receiver

Converts received signal into data

Example
• Modem

Destination

Takes incoming data
Advanced Java Programming
10/18/08 18:23
7
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Key Communications 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
Advanced Java Programming
10/18/08 18:23
8
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Key Communications 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 tasks 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
Advanced Java Programming
10/18/08 18:23
9
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Key Communications Tasks

Message formatting

Agreement between two parties—binary code for characters

Security

Sender wish 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
Advanced Java Programming
10/18/08 18:23
10
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Simplified Data Communications Model
Protocol
Architecture
Advanced Java Programming
10/18/08 18:23
12
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Protocols

High degree of cooperation is needed between
two computer systems

Used for communications between entities in a
system

Must speak the same language

Entities

User applications

e-mail facilities

terminals

Systems

Computer

Terminal

Remote sensor
Advanced Java Programming
10/18/08 18:23
13
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
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
Advanced Java Programming
10/18/08 18:23
14
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
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
Advanced Java Programming
10/18/08 18:23
15
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
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
Advanced Java Programming
10/18/08 18:23
16
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
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.
Advanced Java Programming
10/18/08 18:23
17
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
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
Advanced Java Programming
10/18/08 18:23
18
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
OSI v TCP/IP
Advanced Java Programming
10/18/08 18:23
19
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
TCP/IP Protocol Architecture Model
Data
Transmission
Advanced Java Programming
10/18/08 18:23
21
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
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
Advanced Java Programming
10/18/08 18:23
22
© Copyright 2007, U. K. Roy, IT, JU
Internetworking

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
Transmission Terminology
Advanced Java Programming
10/18/08 18:23
23
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
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

Periodic signal
• Pattern repeated over time

Aperiodic signal
• Pattern not repeated over time
Advanced Java Programming
10/18/08 18:23
24
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Continuous & Discrete Signals
Advanced Java Programming
10/18/08 18:23
25
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Periodic Signals
Advanced Java Programming
10/18/08 18:23
26
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
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
Advanced Java Programming
10/18/08 18:23
27
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Varying Sine Waves
Advanced Java Programming
10/18/08 18:23
28
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
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*10
8
ms
-1
(speed of light in free space)
Advanced Java Programming
10/18/08 18:23
29
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
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
Advanced Java Programming
10/18/08 18:23
30
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Addition of Frequency Components
Advanced Java Programming
10/18/08 18:23
31
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Frequency Domain
Advanced Java Programming
10/18/08 18:23
32
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
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
Advanced Java Programming
10/18/08 18:23
33
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Signal with DC Component
Advanced Java Programming
10/18/08 18:23
34
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Data Rate and Bandwidth

Any transmission system has a limited band of
frequencies

This limits the data rate that can be carried
Advanced Java Programming
10/18/08 18:23
35
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
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
Advanced Java Programming
10/18/08 18:23
36
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Data

Analog

Continuous values within some interval

e.g. sound, video

Digital

Discrete values

e.g. text, integers
Advanced Java Programming
10/18/08 18:23
37
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Acoustic Spectrum (Analog)
Advanced Java Programming
10/18/08 18:23
38
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
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
Advanced Java Programming
10/18/08 18:23
39
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
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
Advanced Java Programming
10/18/08 18:23
40
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Analog Signals Carrying Analog and Digital Data
Advanced Java Programming
10/18/08 18:23
41
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Digital Signals Carrying Analog and Digital Data
Advanced Java Programming
10/18/08 18:23
42
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
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
Advanced Java Programming
10/18/08 18:23
43
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
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
Advanced Java Programming
10/18/08 18:23
44
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
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
Advanced Java Programming
10/18/08 18:23
45
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
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
Advanced Java Programming
10/18/08 18:23
46
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
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
Advanced Java Programming
10/18/08 18:23
47
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Delay Distortion

Only in guided media

Propagation velocity varies with
frequency
Advanced Java Programming
10/18/08 18:23
48
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
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
Advanced Java Programming
10/18/08 18:23
49
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
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 = 2Blog
2
M

Shannon’s Capacity

Given signal to noise ratio SNR, maximum data rate
C = B log
2
(1 + SNR)
Transmission Media
Advanced Java Programming
10/18/08 18:24
51
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
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
Advanced Java Programming
10/18/08 18:24
52
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
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
Advanced Java Programming
10/18/08 18:24
53
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Electromagnetic Spectrum
Advanced Java Programming
10/18/08 18:24
54
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Guided Transmission Media

Twisted Pair

Coaxial cable

Optical fiber
Advanced Java Programming
10/18/08 18:24
55
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Twisted Pair
Advanced Java Programming
10/18/08 18:24
56
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
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
Advanced Java Programming
10/18/08 18:24
57
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Twisted Pair - Pros and Cons

Cheap

Easy to work with

Low data rate

Short range
Advanced Java Programming
10/18/08 18:24
58
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
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
Advanced Java Programming
10/18/08 18:24
59
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
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)
Advanced Java Programming
10/18/08 18:24
60
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
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
Advanced Java Programming
10/18/08 18:24
61
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
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
Advanced Java Programming
10/18/08 18:24
62
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Coaxial Cable
Advanced Java Programming
10/18/08 18:24
63
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
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
Advanced Java Programming
10/18/08 18:24
64
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
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
Advanced Java Programming
10/18/08 18:24
65
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Optical Fiber
Advanced Java Programming
10/18/08 18:24
66
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
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
Advanced Java Programming
10/18/08 18:24
67
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Optical Fiber - Applications

Long-haul trunks

Metropolitan trunks

Rural exchange trunks

Subscriber loops

LANs
Advanced Java Programming
10/18/08 18:24
68
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Optical Fiber - Transmission Characteristics

Act as wave guide for 10
14
to 10
15
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
Advanced Java Programming
10/18/08 18:24
69
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Optical Fiber Transmission Modes
Advanced Java Programming
10/18/08 18:24
70
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
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
Advanced Java Programming
10/18/08 18:24
71
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Frequencies

2GHz to 40GHz

Microwave

Highly directional

Point to point

Satellite

30MHz to 1GHz

Omnidirectional

Broadcast radio

3 x 10
11
to 2 x 10
14

Infrared

Local
Advanced Java Programming
10/18/08 18:24
72
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Terrestrial Microwave

Parabolic dish

Focused beam

Line of sight

Long haul telecommunications

Higher frequencies give higher data rates
Advanced Java Programming
10/18/08 18:24
73
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
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
Advanced Java Programming
10/18/08 18:24
74
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Broadcast Radio

Omnidirectional

FM radio

UHF and VHF television

Line of sight

Suffers from multipath interference

Reflections
Advanced Java Programming
10/18/08 18:24
75
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Infrared

Modulate noncoherent infrared light

Line of sight (or reflection)

Blocked by walls

e.g. TV remote control, IRD port
Data Encoding
Advanced Java Programming
10/18/08 18:24
77
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
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
Advanced Java Programming
10/18/08 18:24
78
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Digital Data, Digital Signal

Digital signal

Discrete, discontinuous voltage pulses

Each pulse is a signal element

Binary data encoded into signal elements
Advanced Java Programming
10/18/08 18:24
79
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
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
Advanced Java Programming
10/18/08 18:24
80
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
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
Advanced Java Programming
10/18/08 18:24
81
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
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
Advanced Java Programming
10/18/08 18:24
82
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
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
Advanced Java Programming
10/18/08 18:24
83
© Copyright 2007, U. K. Roy, IT, JU
Internetworking

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
Non-Return to Zero Level (NRZ-L)
0 1 0 0 1 1 0 0 0 1 1
Advanced Java Programming
10/18/08 18:24
84
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
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
Advanced Java Programming
10/18/08 18:24
85
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
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
Advanced Java Programming
10/18/08 18:24
86
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
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
Advanced Java Programming
10/18/08 18:24
87
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
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
Advanced Java Programming
10/18/08 18:24
88
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Pseudoternary

One represented by absence of line signal

Zero represented by alternating positive and
negative

No advantage or disadvantage over bipolar-
AMI
0 1 0 0 1 1 0 0 0 1 1
Advanced Java Programming
10/18/08 18:24
89
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Bipolar-AMI and Pseudoternary
Advanced Java Programming
10/18/08 18:24
90
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Trade Off for Multilevel Binary

Not as efficient as NRZ

Each signal element only represents one bit

In a 3 level system could represent log
2
3 = 1.58 bits

Receiver must distinguish between three levels
(+A, -A, 0)

Requires approx. 3dB more signal power for same
probability of bit error
Advanced Java Programming
10/18/08 18:24
91
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
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
Advanced Java Programming
10/18/08 18:24
92
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
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
Advanced Java Programming
10/18/08 18:24
93
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
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
Advanced Java Programming
10/18/08 18:24
94
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
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
Advanced Java Programming
10/18/08 18:24
95
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
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
Advanced Java Programming
10/18/08 18:24
96
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
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
preceding pulse
Odd Even
- 000- +00+
+ 000+ -000-
Advanced Java Programming
10/18/08 18:24
97
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
B8ZS and HDB3
Advanced Java Programming
10/18/08 18:24
98
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Bandwidth Comparison
Advanced Java Programming
10/18/08 18:24
99
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Modulation Rate
Advanced Java Programming
10/18/08 18:24
100
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
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
manchester
1.0 (all 1s) 1.5 2.0 (all 0s)
Data Link Layer
Advanced Java Programming
10/18/08 18:24
102
© Copyright 2007, U. K. Roy, IT, JU
Internetworking

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 correction

Error Control

What to do if frames/acknowledgements are damaged/lost?

Flow Control

Transmitter and Receiver must be synchronized
Data Link Layer Design Issues
Medium Access
Control Sub-layer
Advanced Java Programming
10/18/08 18:24
104
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Introduction
LLC sub-layer
MAC sub-layer
Data Link Layer
Physical Layer
Network Layer
Advanced Java Programming
10/18/08 18:24
105
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
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.
Advanced Java Programming
10/18/08 18:24
106
© Copyright 2007, U. K. Roy, IT, JU
Internetworking

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 Multiplexing Access(FDMA)
• Each station is allocated its own frequency
• Uneven usage of bandwidth if number of senders is large and
continuously varying

Time Division Multiplexing Access (TDMA)
• Each station is allocated its own time slot for transmission

Statistical Time Division Multiplexing Access (STDMA)

Combination of FDMA and TDMA
Channel Allocation Problem
Advanced Java Programming
10/18/08 18:24
107
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
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)

Mean time delay from queueing theory
) ( ) /
1
N N C / − ( λ µ λ µ − C
N

T
FDMA
= = = NT

The mean delay for FDMA or TDMA is N times worse
λ µ − C
1
T =

For FDMA

For TDMA
) ( ) /
1
N N C / − ( λ µ λ µ − C
N

T
TDMA
= = = NT
Advanced Java Programming
10/18/08 18:24
108
© Copyright 2007, U. K. Roy, IT, JU
Internetworking

Five key assumptions:
1. station model

N number of independent stations.

Frame generation rate is proportional to ∆t is ∆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
Dynamic Channel Allocation
Advanced Java Programming
10/18/08 18:24
109
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
ALOHA

Pure ALOHA

Slotted ALOHA
Advanced Java Programming
10/18/08 18:24
110
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Pure ALOHA

If collision occurs,

detect it

wait a random amount of time and retransmit

A station transmits a frame whenever it has
one
Advanced Java Programming
10/18/08 18:24
111
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
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

P
0
=probability that a frame does not suffer a
collision

Throughput S=GP
0

Probability the k frames are generated during a
given frame time by Poisson distribution:
! K
e G
P
G k
k

·
Advanced Java Programming
10/18/08 18:24
112
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Efficiency of Pure ALOHA
G
e P

·
0
G
Ge S
2 −
·

Throughpu
t
5 . 0
2
1
max
· · G with
e
S

Maximum
throughput

Out of 100 frames, maximum of 18 frames reach
their destination without collision
Advanced Java Programming
10/18/08 18:24
113
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
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
G
Ge S

·

Throughpu
t
1
1
max
· · G with
e
S

Maximum
throughput
Advanced Java Programming
10/18/08 18:24
114
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Throughput of ALOHA
Advanced Java Programming
10/18/08 18:24
115
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Throughput of ALOHA
G k G G
k k
k
e e e k kP E · − · ·
− − −
· ·
∑ ∑
1
1 1
) 1 (
α α

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

P
k
= e
-G
(1-e
-G
)
k-1

Expected number of transmission
Advanced Java Programming
10/18/08 18:24
116
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
• 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
CSMA Protocols
Advanced Java Programming
10/18/08 18:24
117
© Copyright 2007, U. K. Roy, IT, JU
Internetworking

If collision occurs, stop transmission immediately
CSMA/CD Protocol
Advanced Java Programming
10/18/08 18:24
118
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Collision
Advanced Java Programming
10/18/08 18:24
119
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Collision Detection
Advanced Java Programming
10/18/08 18:24
120
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
CSMA/CD Protocol
Advanced Java Programming
10/18/08 18:24
121
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Performance Comparison
Advanced Java Programming
10/18/08 18:24
122
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Collision Free Protocols

Collision adversely affect system performance,
when cable is long and frames 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.
Advanced Java Programming
10/18/08 18:24
123
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
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

Since every station agrees on who goes next, there
will never be collision
Advanced Java Programming
10/18/08 18:24
124
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Bit-Map Protocol

If a station is ready, after its bit slot, it must wait for
next bit map
Advanced Java Programming
10/18/08 18:24
125
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
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)

Average waiting time per frame is
N/2+Nd/2=N(d+1)/2
Advanced Java Programming
10/18/08 18:24
126
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
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
Advanced Java Programming
10/18/08 18:24
127
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Binary Countdown Protocol
Advanced Java Programming
10/18/08 18:24
128
© Copyright 2007, U. K. Roy, IT, JU
Internetworking

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).
Efficiency of Binary Countdown Protocol
Advanced Java Programming
10/18/08 18:24
129
© Copyright 2007, U. K. Roy, IT, JU
Internetworking

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, D, A, G, B, E, F, D
Problems of Binary Countdown Protocol
Advanced Java Programming
10/18/08 18:24
130
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Performance Comparison

Two basic protocols

Contention

Contention free

Two performance measures

Delay

Channel efficiency

Contention protocols are preferable at low load

Contention free protocols are preferable at high load

Solution is Limited Contention Protocol
Advanced Java Programming
10/18/08 18:24
131
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
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

p
max
= 1/k

A
max
=(1-1/k)
k-1
Advanced Java Programming
10/18/08 18:24
132
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Symmetric Protocol
Advanced Java Programming
10/18/08 18:24
133
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
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 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
Advanced Java Programming
10/18/08 18:24
134
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
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.
Advanced Java Programming
10/18/08 18:24
135
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Example
Advanced Java Programming
10/18/08 18:24
136
© Copyright 2007, U. K. Roy, IT, JU
Internetworking

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
-i
q
• the optimum level to begin searching the tree is at i=log
2
q

Improvement
Advanced Java Programming
10/18/08 18:24
137
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
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)
Data Link Control
Sub-layer
Advanced Java Programming
10/18/08 18:24
139
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Framing
message
message
message
1
2
1
3
2
1
2
3
3
Total
Delay T
D
S A B D
Time
Propagation delay
S A B D
Time
Total
Delay
T
D
Transmission
delay

Breaks the message into number of segments called
frames

This is done to

reduce total transmission time

reduce amount of retransmission due to error
Advanced Java Programming
10/18/08 18:24
140
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Optimal Number of frames?
ined m ter de be to packets of number p
delay n propagatio
p
t
rate data R
n destinatio and source between hops of number k
length header h
message the in bits of number x
·
·
·
·
·
·
R
h
p
x
f
t

,
`

.
|
+
·
R
h
p
x
p
t
f

,
`

.
|
+
·
1
S A B D
T
T
D
t
p
2
3
1
2
3
1
2
3
t
f
t
m
R
h
p
x
p
t
m

,
`

.
|
+
·
p D
kt
R
h
p
x
k
R
h
p
x
p
T +

,
`

.
|
+
− +

,
`

.
|
+
· ) 1 (
h
k x
p
dp
dT
D
) 1 (
0

· ⇒ ·
Advanced Java Programming
10/18/08 18:24
141
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Expected amount of transmission?
x
b) 1 ( −
x
b) 1 ( 1 − −
x i x
b b ) 1 ( ] ) 1 ( 1 [
) 1 (
− − −

x
rx
i
i
x i x
rx
b
N
b b i N
) 1 (
1
) 1 ( ] ) 1 ( 1 [
1
) 1 (

·
− − − ·

·
·

α

x bit message

b=bit error
rate 
Probability that the message will not be in error is

Probability that the message will be in
error is

Probability that the message requires exactly i
transmission for successful transmission [i.e. (i-1)
unsuccessful transmission followed by successful
transmission] is

Expected number of
transmission

Total number of bits transmitted without
framing
x
b
x
) 1 ( −
Advanced Java Programming
10/18/08 18:25
142
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Expected amount of transmission?
) / (
/
) 1 (
1
) 1 (
) 1 (
p x x
x
p x
b
b
b
ing fram with d transmitte bits of number
ing fram without d transmitte bits of number


·


· · ω
p x p x
b
x
b
p x
p
/ /
) 1 ( ) 1 (
) / (

·


p=number of frames

Expected number of
transmission

Number of bits transmitted with
framing
p x
rp
b
N
/
) 1 (
1

·

x=10,000 bits

p=10

b=0.001 (1 out of 1000)

ω= 8139
Advanced Java Programming
10/18/08 18:25
143
© Copyright 2007, U. K. Roy, IT, JU
Internetworking

four methods for framing are:

character count

starting and ending characters

starting and ending flags

physical layer coding violations
Framing
Advanced Java Programming
10/18/08 18:25
144
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
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
Advanced Java Programming
10/18/08 18:25
145
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
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 DLE B D ETX DLE STX D B DLE ETX
Advanced Java Programming
10/18/08 18:25
146
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Starting and ending characters

Problem occurs when data contains DLE STX or DLE ETX
DLE STX A DLE DLE D ETX Data sent by network layer
DLE STX A DLE DLE D ETX DLE
Data after being character stuffed
by data link layer
DLE STX A DLE DLE D ETX
Data passed to network layer on the
receiving node

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 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
Advanced Java Programming
10/18/08 18:25
147
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Bit Stuffing
Starting and ending flags
Advanced Java Programming
10/18/08 18:25
148
© Copyright 2007, U. K. Roy, IT, JU
Internetworking

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
Error Detection
Advanced Java Programming
10/18/08 18:25
149
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Error Detection

Additional bits added by transmitter for error detection
Advanced Java Programming
10/18/08 18:25
150
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
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
Advanced Java Programming
10/18/08 18:25
151
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Two-dimensional parity
1 0 1 0 1 1
1 1 0 1 1 0
0 1 1 1 0 1
0 0 1 0 1 0
Undetect
ed
error
Detected
error
Detectable
Double-bit-
error
Advanced Java Programming
10/18/08 18:25
152
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
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
Advanced Java Programming
10/18/08 18:25
153
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Cyclic Redundancy Check (CRC)
Q
G
R R
Q
G
R
G
R
Q
G
R D
G
T
R D T
r
r
·
+
+ · + + ·
+
·
+ ·
2 .
2 .

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
G
R
Q
G
D
r
+ ·
2 .
Advanced Java Programming
10/18/08 18:25
154
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Example
D=1010001101
G=110101
R=?
1 1 0 1 0 1|1 0 1 0 0 0 1 1 0 1 0 0 0 0 0
1 1 0 1 0 1
1 1 1 0 1 1
1 1 0 1 0 1
1 1 1 0 1 0
1 1 0 1 0 1
1 1 1 1 1 0
1 1 0 1 0 1
1 0 1 1 0 0
1 1 0 1 0 1
1 1 0 0 1 0
1 1 0 1 0 1
0 1 1 1 0
G
R
T=101000110101110
Advanced Java Programming
10/18/08 18:25
155
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
D=101110
G=1001
R=?
Example
Advanced Java Programming
10/18/08 18:25
156
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
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 2
m+k

Out of 2
m+k
possible code words, only 2
m
code words are
valid

Remaining code words are invalid

Example

M=2, K=2

No. of possible codewords is 2
4
=16

No. of valid code words is 4
• 0000, 0011, 1100, 1111

No. of invalid code words is 12
0000 0100
Advanced Java Programming
10/18/08 18:25
157
© Copyright 2007, U. K. Roy, IT, JU
Internetworking

Hamming codes can correct single errors

by arranging them into matrix we can correct burst
errors
Error Correction
Advanced Java Programming
10/18/08 18:25
158
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Advanced Java Programming
10/18/08 18:25
159
© Copyright 2007, U. K. Roy, IT, JU
Internetworking

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
Advanced Java Programming
10/18/08 18:25
160
© Copyright 2007, U. K. Roy, IT, JU
Internetworking

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 x
r
M(x)

divide the bit string corresponding to G(x) into the
bit string corresponding to x
r
M(x) using modulo 2
division

subtract the remainder (which is always r or fewer
bits) from the bit string corresponding to x
r
M(x)
using modulo 2 subtraction. The result is the
checksummed frame to be transmitted. Call its
polynomial T(x).
Advanced Java Programming
10/18/08 18:25
161
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
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
time on transmissi
time n propagatio
a ·

If transmission time is normalized to 1, propagation time is `a`
Advanced Java Programming
10/18/08 18:25
162
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Model of Frame Transmission
Advanced Java Programming
10/18/08 18:25
163
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Stop and Wait

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
Advanced Java Programming
10/18/08 18:25
164
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
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
Advanced Java Programming
10/18/08 18:25
165
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
frame
prop
frame
prop
prop frame
frame
t
t
a where
a
t
t
t t
t
time n propagatio
time on transmissi
·
+
·
+
·
+
·
·
2 1
1
2 1
1
2
η
T
D
=t
frame+
t
prop
+t
proc
+t
ack
+t
prop
+t
pr
oc
T
D
≈t
frame
+2t
prop
a
1
a
c
k
1
2
a
c
k
2
t
frame
t
prop
t
proc
t
ack
Stop and Wait Link Utilization
Advanced Java Programming
10/18/08 18:25
166
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Stop and Wait Link Utilization
Advanced Java Programming
10/18/08 18:25
167
© Copyright 2007, U. K. Roy, IT, JU
Internetworking

t
prop
=271 ms

1 kb frame

1 Mbps data rate

Frame transmission time t
frame
=1 ms

a=271

η= 1/(1+2x271)=0.00184
Stop and Wait Link Utilization
Advanced Java Programming
10/18/08 18:25
168
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Sliding Window Flow Control

Allow multiple frames to be in transit at a time

Receiver has buffer W long

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 2
k
Advanced Java Programming
10/18/08 18:25
169
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Sliding Window Diagram
Advanced Java Programming
10/18/08 18:25
170
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Example Sliding Window
Advanced Java Programming
10/18/08 18:25
171
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
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)
Advanced Java Programming
10/18/08 18:25
172
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
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
Advanced Java Programming
10/18/08 18:25
173
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Automatic Repeat Request (ARQ)

Stop and wait

Go back N

Selective reject (selective retransmission)
Advanced Java Programming
10/18/08 18:25
174
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
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
Advanced Java Programming
10/18/08 18:25
175
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Stop and Wait -Diagram
Advanced Java Programming
10/18/08 18:25
176
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Stop and Wait - Pros and Cons

Simple

Inefficient
Advanced Java Programming
10/18/08 18:25
177
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
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
Advanced Java Programming
10/18/08 18:25
178
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
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
Advanced Java Programming
10/18/08 18:25
179
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
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
Advanced Java Programming
10/18/08 18:25
180
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
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
Advanced Java Programming
10/18/08 18:25
181
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
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
Advanced Java Programming
10/18/08 18:25
182
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Go Back N - Damaged Rejection

As for lost frame (2)
Advanced Java Programming
10/18/08 18:25
183
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Go Back N - Diagram
Advanced Java Programming
10/18/08 18:25
184
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
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 2
n
-1
Advanced Java Programming
10/18/08 18:25
185
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
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
Advanced Java Programming
10/18/08 18:25
186
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Selective Reject -Diagram
Advanced Java Programming
10/18/08 18:25
187
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
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 2
n-1
Advanced Java Programming
10/18/08 18:25
188
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Performance?
Advanced Java Programming
10/18/08 18:25
189
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Performance?
Advanced Java Programming
10/18/08 18:25
190
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Performance?
¹
¹
¹
'
¹
+ <
+
+ ≥
·
a N
a
N
a N
U
2 1
2 1
2 1 1
Advanced Java Programming
10/18/08 18:25
191
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Performance?
) 2 (
p f r
f
T T N
T
U
+
·
t
f
T
T
U ·

Channel Utilization

Where T
f
=time to transmit a single frame

T
t
=total time that line is engaged in the
transmission of a single frame

For error free operation using Stop-and-Wait
protocol
p f
f
T T
T
U
2 +
·

In the presence of error equation must be modified
as

Where N
r
=expected number of transmission for a
frame
Advanced Java Programming
10/18/08 18:25
192
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Performance?
p −
·
1
1

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 p
i-1
(1-p)

N
r
=E[transmission]= ∑
·


α
1
1
) 1 (
i
i
p ip
Advanced Java Programming
10/18/08 18:25
193
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Performance?
a
p
U
2 1
1


·

Stop-and-Wait ARQ
¹
¹
¹
'
¹
+ <
+

+ ≥ −
·
a N
a
p N
a N p
U
2 1
2 1
) 1 (
2 1 1

Selective Reject ARQ
Advanced Java Programming
10/18/08 18:25
194
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Go-back-N?

N
r
=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

f(i)=1+(i-1)K

=(1-K)+Ki
p
Kp p
p
K
K
p ip K p p K
p p Ki K N
i
i
i
i
i
i
r

+ −
·

+ − ·
− + − − ·
− + − ·
∑ ∑

·

·

·

1
1
1
) 1 (
) 1 ( ) 1 ( ) 1 (
) 1 ( ] ) 1 [(
1
1
1
1
1
1
α α
α
Advanced Java Programming
10/18/08 18:25
195
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Go-back-N?
¹
¹
¹
¹
¹
'
¹
· + <
+ − +

+ · + ≥
+

·
N K a N
Np p a
p N
a K a N
ap
p
U
, 2 1
) 1 )( 2 1 (
) 1 (
2 1 , 2 1
2 1
1
Advanced Java Programming
10/18/08 18:25
196
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Performance?
Advanced Java Programming
10/18/08 18:25
197
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
High Level Data Link Control

Widely used data link control protocol

Basic Characteristics

Three types of stations

Two link configurations

Three data transfer mode
Advanced Java Programming
10/18/08 18:25
198
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
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
Advanced Java Programming
10/18/08 18:25
199
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
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
Advanced Java Programming
10/18/08 18:25
200
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
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
• Used on multi-drop lines

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
Advanced Java Programming
10/18/08 18:25
201
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Frame Structure

Uses synchronous transmission

All transmissions in frames

Single frame format for all data and control
exchanges
Advanced Java Programming
10/18/08 18:25
202
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Flag Fields

Delimit frame at both ends

01111110

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 1, sender is indicating abort
Advanced Java Programming
10/18/08 18:25
203
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Bit Stuffing

Example with
possible errors
Advanced Java Programming
10/18/08 18:25
204
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Address Field

Identifies secondary station that will send or
will receive frame

Usually 8 bits long

May be extended to multiples of 7 bits

LSB of each octet indicates that it is the last octet (1) or not
(0)

All ones (11111111) is broadcast
Advanced Java Programming
10/18/08 18:25
205
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Control Field

Different for different frame type

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
Advanced Java Programming
10/18/08 18:25
206
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Control Field Diagram
Advanced Java Programming
10/18/08 18:25
207
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Supervisory frames
Advanced Java Programming
10/18/08 18:25
208
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Unnumbered frames
Advanced Java Programming
10/18/08 18:25
209
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
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
Advanced Java Programming
10/18/08 18:25
210
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Information Field

Only in information and some unnumbered
frames

Must contain integral number of octets

Variable length
Advanced Java Programming
10/18/08 18:25
211
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Frame Check Sequence Field

FCS

Error detection

16 bit CRC

Optional 32 bit CRC
Advanced Java Programming
10/18/08 18:25
212
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
HDLC Operation

Exchange of information, supervisory and
unnumbered frames

Three phases

Initialization

Data transfer

Disconnect
Advanced Java Programming
10/18/08 18:25
213
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Examples of Operation (1)
Advanced Java Programming
10/18/08 18:25
214
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Examples of Operation (2)
Advanced Java Programming
10/18/08 18:25
215
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
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)
Advanced Java Programming
10/18/08 18:25
216
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
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)
Advanced Java Programming
10/18/08 18:25
217
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
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
Advanced Java Programming
10/18/08 18:25
218
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
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
Advanced Java Programming
10/18/08 18:25
219
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Required Reading

Stallings chapter 7

Web sites on HDLC, frame relay, Ethernet and
ATM
Local Area
Networks(LANs)
IEEE802.3
(Ethernet) LAN
Advanced Java Programming
10/18/08 18:25
222
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Ethernet Cabling
Advanced Java Programming
10/18/08 18:26
223
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Ethernet Topology
Advanced Java Programming
10/18/08 18:26
224
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Encoding
Advanced Java Programming
10/18/08 18:26
225
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Ethernet Frame format
Advanced Java Programming
10/18/08 18:26
226
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Collision detection
Advanced Java Programming
10/18/08 18:26
227
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Ethernet Efficiency
Advanced Java Programming
10/18/08 18:26
228
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Switched Ethernet LAN
IEEE802.4
(Token Bus) LAN
Advanced Java Programming
10/18/08 18:26
230
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
IEEE Standard 802.4
Token Bus
Advanced Java Programming
10/18/08 18:26
231
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Token Bus Frame Format
Advanced Java Programming
10/18/08 18:26
232
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Token Bus Control Frames
IEEE802.5
(Token Ring) LAN
Advanced Java Programming
10/18/08 18:26
234
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
IEEE Standard 802.5: Token Ring
Advanced Java Programming
10/18/08 18:26
235
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Advanced Java Programming
10/18/08 18:26
236
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Advanced Java Programming
10/18/08 18:26
238
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Advanced Java Programming
10/18/08 18:26
239
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Advanced Java Programming
10/18/08 18:26
240
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Token Ring Frame Format
Advanced Java Programming
10/18/08 18:26
241
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Token Ring Control Frames
Wide Area
Networks(WANs)
IEEE802.6
(DQDB) LAN
Advanced Java Programming
10/18/08 18:26
244
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Network Layer
Advanced Java Programming
10/18/08 18:26
246
© Copyright 2007, U. K. Roy, IT, JU
Internetworking

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.
Network Layer Design Issues
Advanced Java Programming
10/18/08 18:26
247
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Advanced Java Programming
10/18/08 18:26
248
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Advanced Java Programming
10/18/08 18:26
249
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Advanced Java Programming
10/18/08 18:26
250
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Advanced Java Programming
10/18/08 18:26
251
© Copyright 2007, U. K. Roy, IT, JU
Internetworking

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
Routing Algorithms
Advanced Java Programming
10/18/08 18:26
252
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Routing Algorithms

Characteristics
required

Correctness

Simplicity

Robustness

Stability

Fairness

Optimality

Efficiency

Performance Criteria

Used for selection of route

Minimum hop

Least cost

Decision Time and Place

Time
• Packet or virtual circuit
basis

Place
• Distributed
• Made by each node
• Centralized
• Source

Routing Strategies

Non-adaptive
• Flooding
• Random

Adaptive
Advanced Java Programming
10/18/08 18:26
253
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
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
Advanced Java Programming
10/18/08 18:26
254
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Flooding Example
Advanced Java Programming
10/18/08 18:26
255
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
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)
Advanced Java Programming
10/18/08 18:26
256
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
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
Advanced Java Programming
10/18/08 18:26
257
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
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
Advanced Java Programming
10/18/08 18:26
258
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
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
Advanced Java Programming
10/18/08 18:26
259
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Adaptive Routing - Advantages

Improved performance

Aid congestion control (See chapter 12)

Complex system

May not realize theoretical benefits
Advanced Java Programming
10/18/08 18:26
260
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
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
Advanced Java Programming
10/18/08 18:26
261
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Isolated Adaptive Routing
Advanced Java Programming
10/18/08 18:26
262
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
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
Advanced Java Programming
10/18/08 18:26
263
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
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
Advanced Java Programming
10/18/08 18:26
264
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
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
Advanced Java Programming
10/18/08 18:26
265
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Advanced Java Programming
10/18/08 18:26
266
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Advanced Java Programming
10/18/08 18:26
267
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Advanced Java Programming
10/18/08 18:26
268
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Mean delay, T=
λ µ − C
1
Advanced Java Programming
10/18/08 18:26
269
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Advanced Java Programming
10/18/08 18:26
270
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Distance Vector Routing
Advanced Java Programming
10/18/08 18:26
271
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Count to Infinity Problem
Advanced Java Programming
10/18/08 18:26
272
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Advanced Java Programming
10/18/08 18:26
273
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Advanced Java Programming
10/18/08 18:26
274
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Advanced Java Programming
10/18/08 18:26
275
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Link State Routing
Advanced Java Programming
10/18/08 18:26
276
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Advanced Java Programming
10/18/08 18:26
277
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Hierarchical Routing
Advanced Java Programming
10/18/08 18:26
278
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Advanced Java Programming
10/18/08 18:26
279
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Advanced Java Programming
10/18/08 18:26
280
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Advanced Java Programming
10/18/08 18:26
281
© Copyright 2007, U. K. Roy, IT, JU
Internetworking

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
Congestion Control
Advanced Java Programming
10/18/08 18:26
282
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Congestion
Advanced Java Programming
10/18/08 18:26
283
© Copyright 2007, U. K. Roy, IT, JU
Internetworking

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 predictable rate
General Principles
Advanced Java Programming
10/18/08 18:26
284
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Advanced Java Programming
10/18/08 18:26
285
© Copyright 2007, U. K. Roy, IT, JU
Internetworking

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
Leaky Bucket Algorithm
Advanced Java Programming
10/18/08 18:26
286
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Advanced Java Programming
10/18/08 18:26
287
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Token Bucket Algorithm
Advanced Java Programming
10/18/08 18:26
288
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Advanced Java Programming
10/18/08 18:26
289
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Congestion Control in Virtual Circuit
Advanced Java Programming
10/18/08 18:26
290
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Waiting Fair Queue
Advanced Java Programming
10/18/08 18:26
291
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Chock Packet
Advanced Java Programming
10/18/08 18:26
292
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
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
Advanced Java Programming
10/18/08 18:26
293
© Copyright 2007, U. K. Roy, IT, JU
Internetworking

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
IP Addressing Requirements
Advanced Java Programming
10/18/08 18:26
294
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
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
Advanced Java Programming
10/18/08 18:26
295
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
Network ID and Host ID

Network ID

Shared or Common to all
computers on the same
physical segment

Unique on the Entire
Network

“Area Code”

Host ID

Identifies a specific device
(Host) within a physical
segment

Unique on the physical
segment

“Phone Number”
192.176.11.201
Advanced Java Programming
10/18/08 18:26
296
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
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
Advanced Java Programming
10/18/08 18:26
297
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
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)
Advanced Java Programming
10/18/08 18:26
298
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
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)
Advanced Java Programming
10/18/08 18:26
299
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
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
Advanced Java Programming
10/18/08 18:26
300
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
IP Addressing
Class A Networks:
The Definition

Per Specification:

1
st
Octet is the Network ID

2
nd
, 3
rd
, 4
th
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)
Class A Networks:
The Definition

Per Specification:

1
st
Octet is the Network ID

2
nd
, 3
rd
, 4
th
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)
Advanced Java Programming
10/18/08 18:26
301
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
IP Addressing
Class A Networks:
Network IDs

1
st
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)

2
nd
, 3
rd
, 4
th
Octets are the Host IDs

An Assigned Class A Network Address:

33.0.0.0 (Specifies the Network)

2
nd
, 3
rd
, 4
th
Octets are the Host IDs

Specified by Network Administrators
Advanced Java Programming
10/18/08 18:26
302
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
IP Addressing
Class A Networks:
The Number of Networks

1
st
Octet is the Network ID

1-126 = 126 Possible Class A Network IDs

2
nd
, 3
rd
, 4
th
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)
Advanced Java Programming
10/18/08 18:26
303
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
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)
Advanced Java Programming
10/18/08 18:26
304
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
IP Addressing
Class B Networks:
The Definition

Per Specification:

1
st
and 2
nd
Octets are the Network ID

3
rd
, 4
th
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)
Advanced Java Programming
10/18/08 18:26
305
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
IP Addressing
Class B Networks:
Network IDs

1
st
and 2
nd
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

3
rd
, 4
th
Octets are the Host IDs

An Assigned Class B Network Addresses

153.11.0.0

3
rd
, 4
th
Octets are the Host IDs

Specified by Network Administrators
Advanced Java Programming
10/18/08 18:26
306
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
IP Addressing
Class B Networks:
The Number of Networks

1
st
and 2
nd
Octets are the Network IDs

1
st
Octet 128 -- 191 = 64 Possible Network IDs

2
nd
Octet 0 – 255 = 256 Possible Network IDs

Total Class B Network IDs 64 * 256 = 16,384

3
rd
, 4
th
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)
Advanced Java Programming
10/18/08 18:26
307
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
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
Advanced Java Programming
10/18/08 18:26
308
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
IP Addressing
Class C Networks:
The Definition

Per Specification:

1
st
, 2
nd
, 3
rd
Octets are the Network ID

4
th
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)
Advanced Java Programming
10/18/08 18:26
309
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
IP Addressing
Class C Networks:
Network IDs

1
st,
2
nd
, 3
rd
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

4
th
Octet is the Host IDs

An Assigned Class C Network Address

201.11.206.0

4
th
Octet is the Host IDs

Specified by Network Administrators
Advanced Java Programming
10/18/08 18:26
310
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
IP Addressing
Class C Networks:
The Number of Networks

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

1
st
Octet 192 -- 223 = 31 Possible IDs

2
nd
Octet 0 – 255 = 256 Possible IDs

3
nd
Octet 0 – 255 = 256 Possible IDs

Total Class C Network IDs 32 * 256 *256 = 2,097,152

4
th
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)
Advanced Java Programming
10/18/08 18:27
311
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
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


Advanced Java Programming
10/18/08 18:27
312
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
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 +
Advanced Java Programming
10/18/08 18:27
313
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
IP Addressing
Address Classes:
Network IDs and Host IDs

Class A (1
st
Octet 1-127)

Network.Host.Host.Host

Class B (1
st
Octet 128-191)

Network.Network.Host.Host

Class C (1
st
Octet 192-223)

Network.Network.Network.Host
Advanced Java Programming
10/18/08 18:27
314
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
IP Addressing
Address Class Summary

1
st
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
Advanced Java Programming
10/18/08 18:27
315
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
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
Advanced Java Programming
10/18/08 18:27
316
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
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)
Advanced Java Programming
10/18/08 18:27
317
© Copyright 2007, U. K. Roy, IT, JU
Internetworking
IP Addressing
Address Classes: Network IDs and Host
IDs

Class A (1
st
Octet 1-127)

Network.Host.Host.Host

Class B (1
st
Octet 128-191)

Network.Network.Host.Host

Class C (1
st
Octet 192-223)

Network.Network.Network.Host