Transcript Week-6
Computer Communication & Networks
Week # 06
Powerpoint Templates
ACKNOWLEDGMENTS
These lecture slides contain material from slides prepared
by Behrouz Forouzan for his book Data Communication
and Networking (4th/5thedition).
These lecture slides updated by Dr. Arshad Ali, Assistant
Professor ,CS Department, The University of Lahore
Week 6: Course Plan
Block coding
Overview of
Analog to digital conversion
Digital to analog conversion
Analog to analog conversion
Transmission Modes
Parallel
Serial
Circuit switched and packet switched Networks
For a code to be capable of error detection, we need to add
redundancy, i.e., extra bits to the data bits.
Block coding is normally referred to as mB/nB coding; it
replaces each m-bit group with an n-bit group, where n is
larger than m
The slash in block encoding (xB/yB) distinguishes block
encoding from multilevel encoding which is written
without a slash (i.e., mBnB)
Block coding is done in three steps: division, substitution
and combination.
The resulting bit stream prevents certain bit combinations
that when used with line encoding would result in DC
components or poor sync. quality.
Three steps of block coding
In the division step, a sequence of bits is divided into groups
of m bits
For example, in 4B/5B encoding, the original bit sequence
is divided into 4-bit groups
In the substitution step, we substitute an m-bit group for an n-bit
group
For example, in 4B/5B encoding we substitute a 4-bit code
for a 5-bit group
Finally in combination step, the n-bit groups are combined
together to form a stream
The new stream has more bits than the original bits
Block coding concept
Using block coding 4B/5B with NRZ-I line coding scheme
4B/5B coding scheme was designed to be used in combination
with NRZ-I
NRZ-I has a good signal rate, but it has a synchronization
problem
A long sequence of 0s can make the receiver clock lose
synchronization.
One solution to synchronization issue: prior to encoding with
NRZ-I, change the bit stream to avoid having a long stream of 0s
The 4B/5B scheme is the answer to achieve this goal
The block-coded stream does not have more than three
consecutive 0s
At the receiver
the NRZ-I encoded digital signal is first decoded into a stream
of bits and
then decoded to remove the redundancy
Using block coding 4B/5B with NRZ-I line coding scheme
A 4 bit data word can have 24 combinations
A 5 bit code word can have 25=32 combinations
We therefore have 32 - 16 = 16 unused groups for 4B/5B
Some of the extra/unused groups are used for control/signaling
purposes.
The 5-bit codes are selected in such a way that there are no more
than one leading 0 (left bit) and no more than two trailing 0s
(right bits)
Thus, when sent back-to-back, no pair of 5-bit codes results in
more than three consecutive 0s being transmitted
Thus, when different groups are combined to make a new
sequence, there are never more than three consecutive 0s being
transmitted
If a 5-bit group arrives that belongs to the unused portion of the
table
◦ the receiver knows that there is an error in the transmission
The 5 bit words are pre-determined in a dictionary and are
chosen in such a way so that there will be at least two
transitions per block of bits
4B/5B mapping codes
Substitution in 4B/5B block coding
ANALOG-TO-DIGITAL CONVERSION
A digital signal is superior to an analog signal because it
is more robust to noise and can easily be recovered,
corrected and amplified
Two techniques, pulse code modulation and delta
modulation.
PCM consists of three steps to digitize an analog signal
Sampling
Quantization
Binary encoding
DIGITAL-TO-ANALOG CONVERSION
Digital-to-analog conversion is the process of changing one of the
characteristics of an analog signal based on the information in digital
data
Digital data needs to be carried on an analog signal
Types of digital-to-analog conversion
Analog-to-Analog Conversion
Analog-to-analog conversion is the representation of
analog information by an analog signal
Types of analog-to-analog modulation
Amplitude Modulation
Frequency Modulation
Phase Modulation
18
TRANSMISSION MODES
The transmission of binary data across a link can be
accomplished in either parallel or serial mode
In parallel mode, multiple bits are sent with each clock
tick.
In serial mode, 1 bit is sent with each clock tick.
Parallel transmission
Use n wires to send n bits at a time; each bit has its
own wire, so all n bits of one group can be transmitted
with each clock tick between devices.
Advantage: speed (by a factor of n over serial)
Disadvantage: Cost
Serial transmission
One bit follows another which requires only one channel for
communication between devices
Advantage: reduces cost ( only one channel instead of n)
Overhead: Because communication within devices is parallel, we
need conversion devices at the interface between sender and the line
(parallel to serial) and between the line and the receiver (serial to
parallel)
Serial transmission can be asynchronous, synchronous and
Isochronous
Asynchronous transmission
In asynchronous transmission (Start/stop transmission),
signal timing is not important
for synchronization
we send 1 start bit (0) to alert the receiver to the arrival of
a new group, and
and 1 or more additional stop bits (1s) at the end of each
byte to let the receiver to know that byte is finished
There may be an uneven gap between each byte
For example, a telephone conversation is asynchronous
because both parties can talk whenever they like
Asynchronous here means “asynchronous at the byte level,
but the bits are still synchronized;
their durations are the same
Asynchronous transmission
Slower Transmission due to additional bits
Cheap and effective
Used for low speed communication (between keyboard and
computer)
it can occur at any time and at irregular intervals
Synchronous transmission
We send bits one after another without start or stop bits or gaps
It is the responsibility of the receiver to group the bits
The bits are usually sent as bytes and many bytes are grouped in a
block (called frames or packets) spaced by fixed interval
A frame is identified with a start and an end byte and there are
uneven gaps between frames
Synchronous transmission
Communication within a computer, is usually synchronous and is
governed by the microprocessor clock.
Signals along the bus, for example, can occur only at specific
points in the clock cycle.
This method is used when large amounts of data need to be
transferred quickly
since data is transferred in large blocks instead of individual
characters
Most network protocols (i.e., Ethernet, SONET, Token Ring) use
synchronous transmission
We cannot have uneven gaps between frames
Transmission of bits is fixed with equal gaps
Data must be delivered within certain time constraints.
Synchronization in entire stream of bits is needed
Used in real-time audio and video where uneven delays are not
acceptable
For example, multimedia streams require an isochronous
transport mechanism to ensure that data is delivered as fast as it
is displayed and to ensure that the audio is synchronized with
the video.
27
Switches are devices capable of creating
temporary connections between two or more
devices linked to the switch
occupy the same place in the network as hubs.
Unlike hubs, examine each packet and process it
accordingly rather than simply repeating the
signal to all ports
How to connect a set of devices to make one-to-one
communication possible?
Mesh Topology: a point-to-point connection between each
pair of devices or
Star Topology: between a central device and every other
device
Impractical and wasteful methods in context of large
networks
Too many link requiring cost-efficient infrastructure
Majority of links idle most of the time
Topologies employing multipoint connections (like a bus)
are not possible
the distances between devices and the total number of
devices increase beyond the capacities of the media and
equipment
Switching is a better solution
Switched Network is a series of interlinked nodes which
are called switches
In a switched network, some switching nodes are
connected to the end systems (like computers,
telephones), others are used only for routing
Broadcast networks
Information transmitted by any node is
received by every node in the network
Ex:: Broadcast Ethernet, wireless LANs
Need to coordinate the access to the
shared medium
MAC
Switched networks
Links are point-to-point
Ex: WANs (Telephony Network,
Internet)
Routing becomes harder
Communication Network (CN) can be classified based on the
way in which the nodes exchange information
Communication Network
Broadcast
CN
Switched
CN
Circuit-Switched
CN
Packet-Switched
CN
Datagram
Network
Virtual Circuit
Network
Circuit
switching
Packet switching
Datagram approach
Virtual circuit switched approach
Designed in 1878 in order to send telephone calls on a
dedicated channel
The channel can not be used by any other data or phone
calls
So it remains open and in use throughout the whole call
Connection between node A and M through switch IV
and III
End systems are directly connected to a switch
Three phases in circuit switching
Establish
Transfer
Disconnect
The telephone message is not broken
It is sent all together
The message arrives in the same order
as it was sent originally
Electronic signals pass through many switches before a
connection is established (In modern circuit-switched
networks)
During a call (transfer phase), switches can not be used by any
other network traffic
Hence, the resources remain dedicated to the circuit during
the entire transfer of data and the entire message follows the
same path
A circuit-switched network is excellent for data that needs a
constant link from end-to-end, for example, real-time video
Circuit switching can be analog or digital
There is a gradual shift away from circuit-switched networks
As the use of the Internet for voice and video is expanding
Example of circuit switching:
Pick up your land phone and dial your friend
At that point, the provider creates a dedicated circuit for
that session and connects you to your friend's telephone
No matter how long you keep the line open with your
friend
the circuit will remain, and
packets flowing between both telephones will always
follow the same path
Advantages
dedicated circuit to the call
no interference, no sharing
full bandwidth guaranteed for the entire duration of
the call
Guaranteed quality of service (minimal delay at
each switch)
Disadvantages
Low efficiency (reservation): the resources may remain
unused for a lot of the call
In case no data is being sent, even then the dedicated
line remains open
relatively long time is required to set up the circuit
the network may become unstable or unavailable
If crises or disaster occurs
primarily developed for voice traffic rather than data
traffic
Packets are sent as soon as they are available
the message is broken into small data packets
Packet Switched network Approaches
Datagram Network Approach
Virtual Circuit Network Approach
Datagram approach of packet switching
no need to set up a dedicated path in advance
It is up to routers to use store-and-forward transmission to send
each packet on its way to the destination on its own
Packets seek out the most efficient route to travel as circuits
become available
not necessarily the shortest route
There is no fixed path
Different packets can follow different paths
Packets may arrive out of order
It places a tight upper limit on the size of packets
This ensures that no user can monopolize any transmission
line for very long (e.g., many milliseconds)
Thus, it can handle interactive traffic
Datagram approach of packet switching
Data is sent in Packets (header and trailer contain control info,
e.g., source and destination addresses)
Per-packet routing
At each node the entire packet is received, stored, and then
forwarded (Store-and-Forward Networks)
No capacity is allocated
For example, The Internet
Datagram approach of packet switching
The store-and-forward delay of accumulating a
packet in the router’s memory before it is sent on
to the next router exceeds that of circuit switching
In a packet-switched network, there is no
resource reservation; resources are allocated
on demand
However, It reduces delay since the first packet of
a long message can be forwarded before the
second one has fully arrived
Datagram approach of packet switching
Connectionless networks: The switch (packet switch)
does not keep information about the connection state
no setup or teardown phases
Each switch has routing table based on the destination
address (in the header of the packet)
Destination address remains the same during the entire
journey of the packet
Datagram approach of packet switching
Datagram approach of packet switching
a header address with each packet which
tells it where its final destination is
describes the sequence for reassembly at the destination
in order to putting back the packets into the correct order
One packet also contains details of how many packets
should be arriving
so that the destination knows if one packet has failed to
arrive
If a packet fails to arrive, the destination sends a message
back to the source asking for retransmission of the missing
packet
Example of Packet Switching
Switch on your PC and connect to your favorite site
The site offers a number of applications you can download
Start downloading one application at a time
Each packet has to find its own route to the destination, i.e.,
your computer
using the information it carries, such as the source and
destination IP addresses
If congestion occurs in the network
the routers responsible for routing packets between networks
automatically select different paths to ensure that data is
transferred as required
Advantages
Use of Bandwidth at full potential
Devices of different speeds can communicate
Availability
no waiting for a direct connection to become
available
During a crisis or disaster
e-mails and texts can still be sent in the situation
when the public telephone network might stop
working
Disadvantages
Delay: Under heavy use
Loss of data packets or they become corrupted
reliable transfer requires protocols
Not so good for some types of data streams
e.g. real-time video streams can lose frames due to
the way packets arrive out of sequence
In Circuit and Packet Switched Network
The trade-off is between guaranteed service and
wasting resources versus not guaranteeing service
and not wasting resources
A cross between a circuit-switched network and a datagram
network
As in a circuit-switched network
It has setup and teardown phases in addition to the data
transfer phase
A virtual circuit is made before actual data is transmitted but
it is different from circuit switching in a sense that
in circuit switching the call accept signal comes only from the
final destination to the source
while in case of virtual-packet switching this call accept
signal is transmitted between each adjacent intermediate
node.
all packets follow the same path established during the
connection
In virtual-circuit packet switching
An initial setup phase is used to set up a route between the
intermediate nodes for all the packets passed during the session
between the two end nodes.
In each intermediate node, an entry is registered in a table to
indicate the route for the connection that has been set up.
Thus, packets passed through this route, can have short headers,
containing only a virtual circuit identifier (VCI), and not their
destination.
This approach is slower than Circuit Switching, since different
virtual circuits may compete over the same resources, and an
initial setup phase is needed to initiate the circuit.
Data are packetized and each packet carries an address in the
header as in datagram networks
But the address in the header has local jurisdiction which
defines what should be the next switch and the channel on
which the packet is being carried
A virtual-circuit network (ATM and X.25)
normally implemented in the data link layer
No capacity guarantees, but guarantees no reordering of
packets
circuit-switched network
implemented in the physical layer
A datagram network
Implemented in the network layer
Switched Virtual Circuit
INTERNET (in reality)
is a datagram network
BUT part of the Internet use circuit-switching (Phone links) or
virtual circuit (ATM)
The Internet works by abstracting an ATM region or a circuitswitched region as a single link