Module 2
Module 2
Error Control
Framing
Flow control
Physical addressing
Access Control
I. Error Control
Types of Errors
Single bit error
In a frame, there is only one bit, anywhere though, which is corrupt.
every data unit so that the total number of 1’s in the unit becomes
even (including parity bit)
Rutvi Shah
9
VERTICAL
REDUNDANCY CHECK
1100001 Data
Checking function
1100001 | 1 Even – parity
Is total number generator
of 1s even ?
Receiver 1 VRC
Sender
Rutvi Shah
10
VERTICAL REDUNDANCY CHECK
Example :
Rutvi Shah
11
LONGITUDINAL REDUNDANCY CHECK(LRC)
and columns) calculate the parity bit for each column and
the set of this parity bit is also sending with original data.
■ From the block of parity we can check the redundancy.
Rutvi Shah
LRC Example
11100111 11011101 00111001 10101001
11100111
11011101
00111001
10101001
LRC 10101010
Rutvi Shah
LRC Example
13
Suppose the following block is sent :
10101001 00111001 11011101 11100111 10101010
(LRC)
However, it is hit by burst of length eight and some bits are corrupted
(Red bits are changed) :
10100011 10001001 11011101 11100111 10101010
(LRC)
When the receiver checks the LRC, some of the bits are not follow
even parity rule and whole block is discarded (the non matching bits
are shown in red ) :
10100011 10001001 11011101 11100111 10101010
14 Advantage :
LRC of n bits can easily detect burst error of n
bits.
Disadvantage :
If two bits in one data units are damaged and two
bits in exactly same position in another data unit
are also damaged , the LRC checker will not
detect the error.
Rutvi Shah
15 CYCLIC REDUNDANCY CHECK (CRC)
In this method , a sequence of redundant bits, called the CRC or the CRC remainder,
is appended to the end of the unit. so that the resulting data unit become exactly
divisible by a second, predetermined binary number.
At its destination , the incoming data unit is divided by the same number. If at this
step there is no remainder ,the data unit assume to be correct and is accepted,
otherwise it indicate that data unit has been damaged in transmission and therefore
must be rejected.
The redundancy bits is used by CRC are derived by dividing the data unit by a
predetermined divisor. The remainder is the CRC.
16 CRC generator and checker
N bits
N+1 bits
REMAINDER CRC
Receiver Sender
Example :-
The CRC generator at sender end :
17
111101
1101 100100 0 0 0
1101
1000
1101
1010
1101
1110
1101
0110
0000
1100
1101
Rutvi Shah
001
The CRC checker at receiver end :
18 111101
1101 100100 0 0 1
1101
1000
1101
1010
1101
1110
1101
0110
0000
1101
Rutvi Shah
1101
000
19 ERROR CORRECTION
Error correcting code is to include enough redundant information
along with each block of data sent to enable the receiver to deduce
what the transmitted character must have been.
Backward Error Correction When the receiver detects an error in the data received, it
requests back the sender to retransmit the data unit.
Forward Error Correction When the receiver detects some error in the data received,
it executes error-correcting code, which helps it to auto-recover and to correct some
kinds of errors.
Backward Error Correction, is simple and can only be efficiently used where
retransmitting is not expensive. For example, fiber optics. But in case of wireless
transmission retransmitting may cost too much.
To correct the error in data frame, the receiver must know exactly which bit in the
frame is corrupted. To locate the bit in error, redundant bits are used as parity bits for
error detection.
21
There are two types of Error Correcting techniques :
Rutvi Shah
22 HAMMING CODE
It is a technique developed by R.W. Hamming.
Hamming code can be applied to data units of any length and uses the
relationship between data and redundancy bits.
For e.g. A 7 bit ASCII code requires 4 Redundancy bits that can be added
to the end of the data unit or interspersed with the original data bits.
These bits are placed in positions 1,2,4 and 8. We refer to these bits as
r1,r2,r4 and r8.
Rutvi Shah
Positions of Redundancy Bits in Hamming Code
11 10 9 8 7 6 5 4 3 2 1
d d d r d d d r d r r
Redundancy Bits
Rutvi Shah
In the Hamming code, each r bit is the VRC bit for one combination of data
24 bits :
and so on.
The combination used to calculate each of the four values for a 7 bit data
sequence are as follows :
The basic idea is that instead of storing each character in a file as an 8-bit
ASCII value, we will instead store the more frequently occurring characters
using fewer bits and less frequently occurring characters using more bits.
7 4 5
s
e
l, p
, 4 2 3
2 ,
3 d u k
2 i, s,
, , , 2
1 1
2 2 1 b v
, ,
1 1
Huffman Coding
7 9
e
, 4 4 5
3 s
d u
l, p
, , 2 3
2 ,
2 2 k
2 i, s,
, 2
1 1
1 b v
, ,
1 1
Huffman Coding
1
6
7 9
e
, 4 4 5
3 s
d u
l, p
, , 2 3
2 ,
2 2 k
2 i, s,
, 2
1 1
1 b v
, ,
1 1
Huffman Coding
A traversal of the tree from root to leaf give the Huffman code for
that particular leaf character
In fixed-size framing, there is no need for defining the boundaries of the frames;
the size itself can be used as a delimiter.
Variable-Size Framing
character-oriented approach
bit-oriented approach.
Character-Oriented Protocols
The header, which normally carries the source and destination addresses and other
control information, and the trailer, which carries error detection or error
correction redundant bits, are also multiples of 8 bits.
To separate one frame from the next, an 8-bit (I-byte) flag is added at the
beginning and the end of a frame.
The flag, composed of protocol-dependent special characters, signals the
start or end of a frame . Any pattern used for the flag could also be part of
the information. To fix this problem, a byte-stuffing strategy was added to
character-oriented framing.
In byte stuffing (or character stuffing), a special byte is added to the data
section of the frame when there is a character with the same pattern as the
flag. The data section is stuffed with an extra byte. This byte is usually
called the escape character (ESC), which has a predefined bit pattern.
This extra stuffed bit is eventually removed from the data by the receiver.
Note that the extra bit is added after one 0 followed by five 1s regardless
of the value of the next bit.
This guarantees that the flag field sequence does not inadvertently appear
in the frame.
The datalink layer of LAN is split into two sub layers.
The IEEE 802 committee had formulated the standards for LAN.
LLC Frame Format
Destination Service Access Point (DSAP) - IEEE 802.2 header begins with a 1
byte field, which identifies the receiving upper-layer process.
Source Service Access Point (SSAP) – It is 1-byte address, which identifies the
sending upper-layer process.
Control - The Control field employs three different formats, depending on the
type of LLC frame used:
That is, sender sends at a speed on which the receiver can process and accept the
data.
If sender is sending too fast the receiver may be overloaded, swamped and data
may be lost.
Sliding Window
1. Stop and Wait
This flow control mechanism forces the sender after transmitting a data frame to
stop and wait until the acknowledgement of the data-frame sent is received.
Stop-and-wait ARQ
The following transition may occur in Stop-and-Wait ARQ:
As we learnt, stop and wait flow control mechanism wastes resources, this
protocol tries to make use of underlying resources as much as possible.
2.1 Go-Back-N ARQ
Stop and wait ARQ mechanism does not utilize the resources at their best.
When the acknowledgement is received, the sender sits idle and does nothing.
The sending-window size enables the sender to send multiple frames without
number.
When the sender sends all the frames in window, it checks up to what
If all frames are positively acknowledged, the sender sends next set of
frames. If sender finds that it has received NACK or has not receive any
ACK for a particular frame, it retransmits all the frames after which it does
not receive any positive ACK., both sender and receiver maintain a
window.
2.2 Selective Repeat ARQ
In Go-back-N ARQ, it is assumed that the receiver does not have any buffer space
for its window size and has to process each frame as it comes. This enforces the
sender to retransmit all the frames which are not acknowledged.
The sender in this case, sends only packet for which NACK is received.
V. ACCESS CONTROL
1. Random Access Protocol
In Random access or contention methods, all stations have same
superiority that is no station has more priority than another station.
Any station can send data depending on medium’s state( idle or
busy). It has two features:
PURE ALOHA
Each station sends a frame whenever it has a frame to send. Only one channel to share,
there is the possibility of collision between frames from different stations.
12.76
Slotted Aloha:
It is similar to pure aloha, except that we divide time into slots and
sending of data is allowed only at the beginning of these slots. If a
station misses out the allowed time, it must wait for the next slot.
This reduces the probability of collision.
(b) Carrier Sense Multiple Access (CSMA)
Carrier Sense Multiple Access ensures fewer collisions as the station is
required to first sense the medium (for idle or busy) before transmitting data.
If it is idle then it sends data, otherwise it waits till the channel becomes idle.
For example, if station A wants to send data, it will first sense the medium. If
it finds the channel idle, it will start sending data. However, by the time the
first bit of data is transmitted (delayed due to propagation delay) from station
A, if station B requests to send data and senses the medium it will also find it
idle and will also send data. This will result in collision of data from station A
and B.
The behavior of three persistence methods when a station finds a channel busy.
1-persistent: The node senses the channel, if idle it sends the data, otherwise it
continuously keeps on checking the medium for being idle and transmits
unconditionally(with 1 probability) as soon as the channel gets idle.
Non-Persistent: The node senses the channel, if idle it sends the data, otherwise it
checks the medium after a random amount of time (not continuously) and
transmits when found idle.
P-persistent: The node senses the medium, if idle it sends the data with p
probability. If the data is not transmitted ((1-p) probability) then it waits for some
time and checks the medium again, now if it is found idle then it send with p
probability. This repeat continues until the frame is sent. It is used in Wifi and
packet radio systems.
Flow diagram for three persistence methods
12.82
Carrier sense multiple access with collision
detection (CSMA/CD)
Stations can terminate transmission of data if collision is detected.
Stations can terminate transmission of data if collision is detected.
Flow diagram for the CSMA/CD
12.84
Energy level
Zero level- channel is idle
Normal level- station successfully captured the channel and sending its frame.
Abnormal level- collision occur and level of energy is twice the normal level.
Carrier sense multiple access with collision
avoidance(CSMA/CA)
The process of collisions detection involves sender receiving
acknowledgement signals. If there is just one signal(its own) then the data is
successfully sent but if there are two signals(its own and the one with which
it has collided) then it means a collision has occurred.
CSMA/CA avoids collision by:
Interframe space – Station waits for medium to become idle and if found idle it does
not immediately send data (to avoid collision due to propagation delay) rather it waits for
a period of time called Interframe space or IFS. After this time it again checks the
medium for being idle. The IFS duration depends on the priority of station.
Contention Window – It is the amount of time divided into slots. If the sender is ready
to send data, it chooses a random number of slots as wait time which doubles every time
medium is not found idle. In CSMA/CA, if the station finds the channel busy, it does not
restart the timer of the contention window; it stops the timer and restarts it when the
channel becomes idle.
12.88
2. Controlled Access protocol
Reservation
Polling
Token Passing
Reservation
In the reservation method, a station needs to make a reservation before sending
data.
If there are M stations, the reservation interval is divided into M slots, and each
station has one slot.
Suppose if station 1 has a frame to send, it transmits 1 bit during the slot 1. No
other station is allowed to transmit during this slot.
The stations which have reserved their slots transfer their frames in that order.
Since everyone agrees on who goes next, there will never be any collisions.
The following figure shows a situation with five stations and a five slot reservation frame.
In the first interval, only stations 1, 3, and 4 have made reservations. In the second
interval, only station 1 has made a reservation
Polling
In this, one acts as a primary station(controller) and the others are secondary
stations. All data exchanges must be made through the controller.
The message sent by the controller contains the address of the node being selected
for granting access.
Although all nodes receive the message but the addressed one responds to it and
sends data, if any. If there is no data, usually a “poll reject”(NAK) message is sent
back.
Problems include high overhead of the polling messages and high dependence on
the reliability of the controller.
Poll function
If the primary wants to receive data, it asks the secondaries if they have anything to
send.
Select Function
If the primary wants to send data, it tells the secondary to get ready to receive.
Select and poll functions
Token Passing
In token passing scheme, the stations are connected logically to each
other in form of ring and access of stations is governed by tokens.
After sending a frame, each station must wait for all N stations (including itself) to
send the token to their neighbors and the other N – 1 stations to send a frame, if
they have one.
There exists problems like duplication of token or token is lost or insertion of new
station, removal of a station, which need be tackled for correct and reliable
operation of this scheme.
Wired LANs: Ethernet
IEEE STANDARDS
13.100
HDLC frame compared with LLC and MAC frames
13.101
Ethernet evolution through four generations
Standard Ethernet
The original Ethernet was created in 1976 at Xerox’s Palo Alto Research Center (PARC).
Since then, it has gone through four generations : standard Ethernet , fast Ethernet ,
gigabit Ethernet ,10-gigabit Ethernet
Frames data received from the upper layer and passes them to the physical layer
FRAME FORMAT
802.3 MAC frame
PREAMBLE: the first field of the 802.3 frame contain 7 bytes . The pattern provides
only an alert and timing pulse.
START FRAME DELIMITER(SFD):this one byte field signals the beginning of the
frame . It alerts the receiver that the next field is the destination address.
DESTINATION ADDRESS(DA): this field 6 bytes and contain the physical address of
the destination station .
SOURCE ADDRESS(SA):this field is also 6 bytes and contain physical address of
sender .
LENGTH/TYPE : defined as type field or length field . Defines the number of bytes in
the data field
DATA : carries data encapsulated from the upper layer protocol .
CRC : error detection
FRAME LENGTH
ADDRESSING
Unicast and multicast addresses
The least significant bit of the first byte defines the type of address.
Broadcast address
Goals are:-
13.117
Fast Ethernet implementations
13.118
Encoding for Fast Ethernet implementation
13.119
Summary of Fast Ethernet implementations
13.120
GIGABIT ETHERNET
The need for an even higher data rate resulted in the design of the Gigabit Ethernet protocol
(1000 Mbps). The IEEE committee calls the standard 802.3z.
Topology
Two-wire implementation
IEEE 802.11
IEEE has defined the specifications for a wireless LAN, called IEEE
802.11, which covers the physical and data link layers.
Architecture
14.135
Extended Service Set
14.137
Station types
14.139
Distributed coordination Function
14.141
CSMA/CA and NAV
14.142
Point Coordination Function (PCF)
14.144
Frame format
Subfields in FC field
14.146
Frame types
14.148
Values of subfields in control frames
14.149
Addresses
BLUETOOTH
This station can receive messages from the primary in the first piconet
(as a secondary) and, acting as a primary, deliver them to secondaries in
the second piconet.
14.157
RADIO LAYER
The primary and secondary communicate with each other using time slots.
The length of a time slot is exactly the same as the dwell time, 625 µ s.
This means that during the time that one frequency is used, a sender sends a
frame to a secondary, or a secondary sends a frame to the primary.
Note that the communication is only between the primary and a secondary;
secondaries cannot communicate directly with one another.
FRAME FORMAT TYPES
L2CAP
The Logical Link Control and Adaptation Protocol, or L2CAP (L2 here means
LL), is roughly equivalent to the LLC sublayer in LANs.
It is used for data exchange on an ACL link; SCQ channels do not use L2CAP.
The I6-bit length field defines the size of the data, in bytes, coming from the
upper layers. Data can be up to 65,535 bytes.
The channel ID (CID) defines a unique identifier for the virtual channel created
at this level.
L2CAP data packet format
14.162