Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 28

Data Link Layer 1

Switching and Error


Detection

Switching Technologies
Moving

of data across wide areas requires


that we be able to form a link from the
sending point to the receiving point.
Switching allows this to happen.
Switching methodolgies:

Circuit Switching.
Message Switching.
Packet Switching.

Circuit Switching 1

Circuit switching involves the creation of a physical path for data


flow between a sender and receiver.
This method is used to create the links between you and another
caller using the phone system.
The whole connection of sender to receiver is called a "circuit".
Circuit switching offers advantages associated with a physical
pathway - like reliability of transfer, because no other devices are
contending for the path.

Circuit Switching 2

Circuit Switching Pros & Cons


Advantages

Limited overhead
Very efficient switching fabrics
Highly

parallelized

Disadvantages

Requires signalling for switching (tables set-up)


Underutilization of resources in the presence of
bursty traffic and variable rate traffic

Message Switching

messages are received in


their entirety and stored
while a route to or closer to
their destination is being
determined. Once the route
has been established, then
the message is sent to either
its final destination or
another intermediate storage
and forwarding point.

Concept of Packets
A packet

is a formatted block of information


carried by a computer network.
A packet consists of three elements:

header, which marks the beginning of the packet.


Payload which contains the information to be
carried in the packet.
Trailer, which marks the end of the packet.

Packet Switching

Packet switching
involves the breaking
up of messages into
smaller components
called packets. Packets
often range in size from
about 600 bytes to over
4000 bytes depending
on the system involved.
Each packet contains
source and destination
information, and is
treated as an individual
message.

Motivation for Packet Switching


Packet

switching is used to:

optimize the use of the bandwidth available in a


network, insuring fairness in the use of a shared
medium.
minimize the transmission latency (i.e. the time it
takes for data to pass across the network) by
using appropriate routing algorithms
increase robustness of communication i.e. the
resilience of the system, especially when under
stress.

Hardware Frame
Example

from RS232
Use ASCII characters to delimit a block of data to
be sent.
In this example, we use soh and eot characters.
Disadvantage is the overhead.
Advantage is when machines crash, allows
proper recovery.

Byte Stuffing
What

if the data itself contains soh or eot


characters?
Need a method to get around the problem.
Hence byte stuffing.

Transmission Errors

Electro-magnetic interference can introduce


unwanted electrical currents into the electronic
components or wires used for communication.
Severe interference (e.g. lightning) can cause
permanent damage to network equipment.
More often, interference changes the electrical
signal without damaging the equipment. This can
cause the receiver to misinterpret one or more bits of
data.
Lost, changed, or spuriously appearing bits,
collectively called transmission errors, account for
extra complexity required in computer networks.

Parity Bits

RS-232 circuits can use a parity bit to ensure that


each character arrives intact. The sender computes
an additional bit based on the seven ASCII data bits
and transmits this as an eighth bit. The receiver
performs the same computation and verifies that the
parity bits agree. The computation is chosen so that
a one-bit alteration can be detected.

Parity can be even or odd; for even (odd) parity the


sender sets the parity bit so that the total number of
1 bits is even (odd).

Checksums (1)

Many computer networks send a checksum along


with each packet to help the receiver detect errors. To
compute a checksum, the sender treats the data as a
sequence of binary integers and computes their sum.
Each pair of characters is treated as a 16-bit integer.
If the sum overflows 16 bits, the carry bits are added
to the total.

Checksums (2)

The advantage of such checksums is the size and ease


of computation. Addition requires very little computation
and the cost of sending an additional 16-bits is negligible.
However, checksums do not detect all common errors.
A transmission error has reversed the second bit in each
of the four data items, yet the checksums are identical.

Cyclic Redundancy Checks (CRC)


It

is possible to detect more errors without


increasing the amount of additional information in
the packet using a CRC technique.
The hardware necessary to generate them is
very simple. The two necessary components are
an exclusive or (XOR) unit and a shift register.

CRC (cont.)

To compute a CRC, the shift registers are initialized to


zero, and the bits of the message are shifted in one at a
time. After an entire message has been shifted into the
unit, the shift registers contain the 16-bit CRC for the
message. The receiver uses identical hardware to
calculate a CRC to verify that it agrees with the sender's
CRC.
The 16-bit CRC used above will detect all single-bit
errors, all double-bit errors, all errors containing an odd
number of bits, and all burst errors of length 16 or less
(first and last bits are one), as well as a number of
additional errors.

Error Detection
Networks

usually handle error detection at the


frame level. The sender computes a checksum
or CRC and transmits this with each frame. The
receiver performs the same calculation and uses
the result to validate the incoming frame

You might also like