CNS Model Answers Unit 2

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 38

CNS Model answers

Unit 2

What are the services provided by DLL to network layer ? OR what are the functions of
data link layer?

The data link layer is responsible for moving frames from one node to the next node.
the functions of data link layer:
• Framing : puts packets received from NL into frames
• Physical addressing: in case of multipoint, receiver’s address is added by sender in
frame
• Flow control: if Receiver speed is less than SENDER , Sender is told to slow down
• Error control : by adding error detection & correction ( for damaged, duplicate or
lost frames)
• Access control: in case of common link between many devices, access to link can be
given to only one device at a time. So DLL in each node implements multiple access
protocols

At sender side’s DLL accepts packets from network layer, adds header & trailer and makes a
frame. Then it Sends frame to physical layer.
Header contains sender’s & receiver’s MAC ( physical address) . Trailer contains error
checking code used by receiver for checking error in a frame.
Receiver side DLL gets frame from physical layer. Checks if destination address matches
with its own MAC address , and also checks for error in the frame using trailer part. If Ok
then , removes header & trailer and passes data ( packet ) to network layer.

Describe the design issues of data link layer ( DLL)

Design issues of data link layer ( DLL):


• Framing : should it be bit oriented or byte oriented , should it be fixed size or
variable size?
• Flow control: should it be connection less or connection oriented service
• Error control : should it be error detection by receiver ( ARQ : automatic repeat
request) or error correction by receiver (FEC: forward error correction)
• Access control: various options are: random access, channelization & controlled
access.

Explain various framing approaches .


Frames can be fixed size or variable size.
Each is further classified into : Character(byte ) oriented and Bit oriented
Character(byte ) oriented
It is in Multiple of 8 bits ( bytes)
A flag (special byte) is used as delimiter i.e. which indicates the start & end of
a frame.
Flag is a special byte , which alarms the other stations that a frame is coming on the media
Header : contains the MAC address of sender & intended receiver .
Trailer : contains error detection code such as CRC , which the receiver uses to detect if there
is error in the received frame. If it detects error , then it does not send ACK to the sender &
sender has to resend the same frame again.

Bit oriented
It is not multiple of Bytes.
Flag byte 01111110 is used as delimiter.

Flag is a special byte , which alarms the other stations that a frame is coming on the media
Header : contains the MAC address of sender & intended receiver .
Trailer : contains error detection code such as CRC , which the receiver uses to detect if there
is error in the received frame. If it detects error , then it does not send ACK to the sender &
sender has to resend the same frame again.

What is FEC & ARQ?

These are the error control techniques used in DLL.

ARQ : automatic repeat request:


• In this a Receiver checks for error in the received frame & if detects error , then it
tells sender to resend that frame
• also known as Automatic Repeat Query,
• Receiver sends acknowledgements (ACK) only if it has correctly received a data
frame else it simply discards the frame& does not send ACK.
• After sending a frame sender waits for some time to receive acknowledgment. If the
sender does not receive an acknowledgment before the timeout, it re-transmits the
frame until the sender receives an acknowledgment.
• If sender does not get ACK after certain number of repeated attempts , it aborts the
operation .

Eg of code used for ARQ : parity , CRC

FEC: Forward Error Correction:


• In this a Receiver checks for errors in frames and corrects error by itself.
• Thus there are no ACK send by receiver back to the sender.
• Thus the sender need not send a frame again
• Therefore, FEC is applied in situations where retransmissions are costly or only
unidirectional channels is available.

Eg of code used for FEC : Hamming code

FEC is more complex than ARQ


Most of the DLL protocols use ARQ. Eg. LAN uses CRC

Explain parity code wrt example , application , advantage

parity code is an error detecting code,


It is not an error correcting code because it can not find particular bit having error.
A simple parity-check code is a single-bit error-detecting code in which
n = k + 1 with dmin = 2.
Where n is codeword size, k is data word size. dmin is minimum Hamming distance
i.e. it can detect only one err and can’t correct any error.

Two types : even parity & odd parity

even parity : In this a single bit ( called parity bit ) is appended to dataword to make a code
word, such that total number of 1’s in codeword including parity bit even.
Eg if data word is 1011 which has 3 1’s so parity bit is set to 1( to make number of 1’s even)
So code word is 10111

Odd parity : In this a single bit ( called parity bit ) is appended to dataword to make a code
word, such that total number of 1’s in codeword including parity bit odd.
Eg if data word is 1011 which has 3 1’s so parity bit is set to 0( to make number of 1’s odd)
So code word is 10110

Advantage :
It is the best code that adds only a single bit
It can be generated by using only a number of XOR gates

Circuit For even parity Circuit For odd parity

Disadvantage :
In a noisy transmission medium , every time a bit may change , so Sender has to send
same frame again & again ,so a successful transmission could take a long time, or
even never occur.

Syndrome is output of checker which is single bit. It is 0 , if no. of 1’s received is even.
Hence no error ,so decision logic accepts the codeword & if syndrome is 1, it discards
codeword
Parity code detects only one bit error .
To check for more number of errors The two-dimensional parity is used
It check can detect up to three errors that occur anywhere in the table .
In this parity bits are added for a group of data words . both row wise & column wise .
Arrows show error detected.

For a given data word 1000111 find codeword if even parity code is used

given data word 1000111


It has three 1’s .
To make the number of 1’ even , we need to set parity bit to 1.
So codeword is 10001111
Find if there is any error in the received codeword 1001001 . if it was sent by using even
parity code

In even parity code the number of 1’s should be even .


In given codeword 1001001has 3 1’s which is odd, So there is error in the received
codeword

Find if there is any error in the received codeword 1001001 . if it was sent by using odd
parity code
In odd parity code the number of 1’s should be odd .
In given codeword 1001001has 3 1’s which is odd, So there is NO error in the received
codeword

Explain Hamming code wrt example , application , advantage


Hamming Code is an error correcting code
Used at data link layer.
It has Dmin =3 , so It can detect up to 2 bit errors & correct upto 1 bit error
It is a technique developed by R.W. Hamming.
For a given data word ,few Redundant bits ( parity bits) are generated .then data word is
appended with the Redundant bits , which is now called as codeword. The receiver can detect
& correct 1 bit error with the help of Redundant bits in the received codeword.
The number of redundant bits can be calculated using the following formula:
2r –r -1 ≥ K
where, r = total number of redundant bits ( parity bits)
K = total number of data bits in data word.
Eg For 7 bit dataword the Redundant bits are calculated Using above formula
2r –r -1 ≥ 7
For r = 4 , the condition is satisfied
Thus, the number of redundant bits ( parity bits) = 4.
Then these redundant bits are placed in dataword at the positions of power of 2.
i.e 20=1; 21 =2; 22 =4 & 23 = 8etc

Original Hamming code was C(7,4) where code word was 7 bit & dataword was 4 bit.

Next is C (11,7) where code word was 11 bit & dataword was 7 bit
Eg :
If dataword to be transmitted is 1011001, the bits of data word will be placed as follows:

The combination of bits used to calculate redundant bits are

Parity bit 1 is calculated by bit positions which have the least significant bit set: bit 3, 5, 7, 9,
& 11. i.e. P1 = bit3 ⊕ bit5 ⊕ bit7 ⊕ bit9 ⊕ bit11
i.e. P1 is set to 1 if total no. of 1s in these bit positions is odd else set to 0.

Parity bit 2 covers all bit positions which have the second least significant bit set: bit 3, 6, 7,
10 & 11. i.e P2= bit3 ⊕ bit6 ⊕ bit7 ⊕ bit10 ⊕ bit11
i.e. P2 is set to 1 if total no. of 1s in these bit positions is odd else set to 0.

Parity bit 4 covers all bit positions which have the third least significant bit set: bits 5, 6 &7
P4= bit5 ⊕ bit6 ⊕ bit7
i.e. P4 is set to 1 if total no. of 1s in these bit positions is odd else set to 0.

Parity bit 8 covers all bit positions which have the fourth least significant bit set: bits 9,10 &
11. P8 = bit9 ⊕ bit10 ⊕ bit 11
i.e. P8 is set to 1 if total no. of 1s in these bit positions is odd else set to 0.

Example :

Part 1: Given a data word 1011001. Determining the Parity bits for generating
code word

determine P1

To find the redundant bit R1, we check for even parity. Since the total number of 1’s
in all the bit positions corresponding to R1 is an even number, the value of R1 (parity
bit’s value) is = 0
P1 = bit3 ⊕ bit5 ⊕ bit7 ⊕ bit9 ⊕ bit11
= 1 ⊕ 0⊕ 1 ⊕ 1 ⊕ 1
=0

determine P2

P2= bit3 ⊕ bit6 ⊕ bit7 ⊕ bit10 ⊕ bit11


=1⊕0⊕ 1⊕ 0⊕1
=1

determine P4

P4= bit5 ⊕ bit6 ⊕ bit7


= 0 ⊕ 0 ⊕1
= 1

determine P8

P8 = bit9 ⊕ bit10 ⊕ bit 11


= 1⊕ 0⊕1
=0

Thus, the data transferred is:

Part 2 Error detection and correction:


Suppose in the above example the 6th bit is changed from 0 to 1 during data
transmission, then it gives new parity values in the binary number:

The parity bits are calculated at receiver as follows :


P1 = bit1 ⊕ bit3 ⊕ bit5 ⊕ bit7 ⊕ bit9 ⊕ bit11
P2= bit2 ⊕ bit3 ⊕ bit6 ⊕ bit7 ⊕ bit10 ⊕ bit11
P4= bit4 ⊕ bit5 ⊕ bit6 ⊕ bit7
P8 = bit8 ⊕ bit9 ⊕ bit10 ⊕ bit 11
These parity bits are used to find Syndrome .
Syndrome = 8*P8 + 4*P4 + 2*P2 + P1
If syndrome is zero, then there is no error.
If syndrome is non zero, then there is error at position equal to syndrome.
Syndrome = 8 * 0 + 4* 1 + 2*1 + 0
=6
Thus, bit 6 has error. To correct the error, the 6th bit is changed from 1 to 0.
So correct code word is 10101001110
& corrected data word is 1011001

Advantage: Hamming code is simple to calculate by Hardware ( using only XOR gates ).
Applications : communication by modem , embedded processors , computer memory check (
ECC RAM)

For a given data word 1000111 find codeword if Hamming code is used.

Do it yourself & check answer with online Hamming code calculator.

Cyclic Redundancy Check: CRC

It can only detect errors& can’t correct errors.


Used at data link layer in ARQ protocols such as stop & wait ARQ, go back N ARQ &
selective repeat ARQ
Explanation :

At sender :

A k-bit dataword is divided by some predetermined number ( called the generator ). the
remainder of the division ( r bits) are appended to original k-bit dataword to create code word
of n bits ( where n = k+r). The sender sends this codeword to receiver.

At receiver :

The receiver then divides the incoming codeword by the same number (generator) used by
sender and, if remainder is 0, then there is no error and receiver accepts codeword & extracts
data word from it & if remainder is non zero, then there is error, so receiver discards the
received codeword.
The receiver does not send ACK. So the sender which is waiting for ACK sends the same
frame again. ( i.e. ARQ)
Example:
Sender side :

Receiver side:

Case 1: codeword received without error Case 2: codeword received with error
Advantage :it can detect all single bit errors, all double bit errors, any odd number of errors,
and most burst errors.

Some of the standard generators with applications are

For a given data word 1000 find codeword if CRC code is used, ( generator is 1011)

Do it yourself & check answer with your friends

Explain simplex flow control with the help of flow diagram & pseudo code

It error & flow control technique used by protocols at data link layer.
It is for noiseless channel where there can be no error. So it does not have error checking at
receiver
Also it is assumed that receiver is fast enough to accept all frames sent by receiver, so there is
no flow control required.
As soon as the sender’s DLL gets packets from network layer it will put it in frame & sends
to receiver . It does not wait for ACK as there is no need of it , because channel is noiseless (
i.e.no errors

Explain stop & wait flow control with the help of flow diagram

It is flow control technique used by protocols at data link layer.


It is for noiseless channel where there can be no error. So it does not have error checking at
receiver
But if sender sends frames faster than what receiver can accept , then sender has to be told to
slow down , so there is flow control required.
To do this there must be feedback from Rx to Tx in the form of acknowledgement (ACK)
This protocol is called Stop-and-Wait, since the Tx stops after sending one frame and
waits until it receives confirmation from Rx and then only sends next frame.

Requires bidirectional link so frame goes from sender to receiver & ACK goes from receiver
to sender.
Explain stop & wait ARQ flow control
It is error & flow control technique used by protocols at data link layer.
It is for noisy channel where there can be errors.
For errors to be detected by Rx, the Tx sends codewords ( i.e.datawords appended with
redundant bits ) using parity code or CRC code etc.
Sender give the sequence numbers to frames as 0,1,0,1,0 ,1 & so on.
When Tx sends a frame ,it keeps a copy of the sent frame and also starts a timer. ( It is set to
the time required for a frame to go from sender and ACK to come from receiver back to
sender ) . If timer expires and still there is no ACK from Rx, then the Tx resends theframe,(
copy is still kept )and timer is again started. This is tried for certain number of attempts
,thentransmission is aborted.
Various cases
Case 0 : successful transmission :
frame 0 sent , timer started & Rx sends acknowledgement as ACK “1” which means Rx
expects next frame with no.1

Case 1 ( frame either lost or received with errors)


frame 1 lost , Rx does not know about it , so it does not send ACK , TX waits for some time
and the it resends Frame 1
frame 1 received by Rx but Rx detects error in it. Again Rx does not send ACK, so Tx
resends frame 1 after time out.

Case 2 : ( frame received but has errors )


frame 1 received by Rx but Rx detects error in it. Again Rx does not send ACK, so Tx
resends frame 1 after time out.
Case 3 :( ACK lost )
Next frame 0 sent , Rx sends ACK1 , but ACK is lost
So frame 0 is resent by Tx, but RX discards it , because it already has received frame 0 &so
it sends ACK again with No.1

Advantage : simple algorithm


Disadvantage : link is idle for most of the time since , sender waits for ACK after sending
each frame . i.e. link utilization is poor.

Explain Go back N ARQ flow control

This is a flow & error control method used in data link layer.
It is a sliding window protocol.
Sender does not wait for ACK to come from receiver after each frame sent, rather, in this
N frames are sent without waiting for ACKs.
If any frame is lost or any ACK is lost or delayed , all the outstanding frames ( whose ACK
has not been received yet) are resent by SENDER.

Summary Points:
Principle Sends multiple frames ( max 2m) at a time then checks
for ACKs from Receiver.
Frame numbering Frames are numbered 0,1 till (2m -1 )
Sender window size SENDER window size is at the most (2m -1 )
Receiver window size Receiver window size is 1 frame.
frame receiving policy of Receiver accepts frame only if it is the expected frame.
Receiver Else it discards the frame.
Number of timers One timer is required
required
Sender Policy if sent If any frame is lost or any ACK is lost or delayed , all the
frame is lost/damaged or outstanding frames ( whose ACK has not been received)
ACK is lost are resent by SENDER.
Link utilization link utilization better than stop n wait
algorithm Complex than SAWARQ
Flow diagram

Explain selective repeat ARQ flow control

This is a flow & error control method used in data link layer.
It is a sliding window protocol.
Sender does not wait for ACK to come from receiver after each frame sent, rather, in this
N frames are sent without waiting for ACKs.
Summary points :

Principle Sends multiple frames ( max 2m) at a time then checks


for ACKs from Receiver.
Frame numbering Frames are numbered 0,1 till (2m-1)
Sender window size SENDER window size is at the most (2m-1)
Receiver window size Receiver window size is same as SENDER window
frame receiving policy of RECEIVER accepts frames even if they are out of order
Receiver
Number of timers Many timers are required; one for each frame sent.
required
Policy if sent frame is If any frame is lost or any ACK is lost or delayed or
lost/damaged or ACK is NAK for a particular frame is received only that
lost outstanding frame is resent by SENDER.
Link utilization link utilization better than Go back N ,
algorithm Algorithm most complex

Flow diagram :

Compare Go back N ARQ with selective repeat ARQ

Parameters Go back N ARQ Selective repeat ARQ


Principle Sends multiple frames ( max 2m) at Sends multiple frames ( max 2m)
a time then checks for ACKs from at a time then checks for ACKs
Receiver. from Receiver.
Frame Frames are numbered 0,1 till (2m -1 Frames are numbered 0,1 till (2m-
1
numbering ) )
Sender SENDER window size is at the SENDER window size is at the
window size most (2m -1 ) most (2m-1)
Receiver Receiver window size is 1 frame. Receiver window size is same as
window size SENDER window
frame Receiver accepts frame only if it is RECEIVER accepts frames even
receiving the expected frame. Else it discards if they are out of order
policy of the frame
Receiver
Number of One timer is required Many timers are required; one for
timers each frame sent.
required
Sender Policy If any frame is lost or any ACK is If any frame is lost or any ACK is
if sent frame lost or delayed , all the outstanding lost or delayed or NAK for a
is frames ( whose ACK has not been particular frame is received only
lost/damaged received) are resent by SENDER. that outstanding frame is resent
or ACK is lost by SENDER.
Link link utilization better than stop n link utilization better than Go
utilization wait back N ,
algorithm Complex than SAWARQ Algorithm most complex

Write a short note on PPP

Point-to-Point Protocol (PPP).


It is one of the protocol at data link layer
PPP is a byte-oriented protocol.
It is used for point-to-point communication .
Internet users who need to connect their home computers to the server of an Internet service
provider ( ISP) over landline telephone connection use PPP

Frame format:

Various Parts of frames:


Flag field. is an 8-bit pattern01111110 to indicate both the beginning and the end of a frame.
Address field.is a constant value and set to 11111111(broadcast address) . Since only two
parties it can be omitted by parties.
Control field. This field is set to the constant value 11000000 . Since PPP does not provide
error & flow control , this can also be omitted by parties.
Protocol. The protocol field defines what is being carried in the data field: either
user data or other information
Payload field. This field carries either the user data or other information
FCS field.( frame check sequence) It is CRC code used for error detection.
LCP ( link control protocol ) is for connecting , managing & disconnecting the link with
server
AP ( Authentication protocol) is used by server to for verification of user identity by
password.
NCP ( network control protocol ) : network layer can use any protocols such as IP , OSI,
Xerox, DECnet, AppleTalk etc. PPP can support all these using NCP

Write a short note on HDLC


High-level Data Link Control (HDLC)
It is one of the protocol at data link layer.
It is a bit-oriented protocol
It can be used over both point-to-point and multipoint links.
HDLC provides two common transfer modes that can be used in different configurations:
normal response mode (NRM) and asynchronous balanced mode (ABM).

Normal response mode (NRM)


Use when there is Oneprimary station and many secondary stations.( i.e. client server)A
primary station can send commands&a secondary station can only respond. Link is
multipoint.
Asynchronous balanced mode (ABM).
Each station can function as a primary and a secondary . ( i.e. peer to peer network)The link
is point-to-point,

HDLC has three types of frames:


information frames(I-frames),
supervisory frames (S-frames), and
unnumbered frames (V-frames).

I-frames are used to transport data and control information relating to data
S-frames are used only to transport control information.
V-frames arereserved for system management ,for managing the link itself.

Various Parts of frames:


Flag field. is an 8-bit pattern01111110 to indicate both the beginning and the end of a frame.
Address field. The second field of an HDLC frame contains the address of the secondary
station.
Control field. determines the type of frame and defines various functions in that type of
frame.& for error & flow control algorithms
Information field. contains the data (packet) came from network layer
FCS field.( frame check sequence) It is CRC code used for error detection.

Compare HDLC with PPP

HDLC PPP
High-level Data Link Control Point-to-Point Protocol
(HDLC)
It is one of the protocol at data link layer It is one of the protocol at data link layer
It is a bit-oriented protocol byte-oriented protocol.
It can be used over both point-to-point Originally used for point-to-point
and multipoint links. communication . but later modified for
multipoint
Can be used in LAN Internet users who need to connect their
home computers to the server of an
Internet service provider ( ISP) over
landline telephone connection
It has two modes normal response
mode (NRM) for client server and
asynchronous balanced mode (ABM)(
peer to peer).
Three types of frames Single frame type

I-frames are used to transport data and Same frame can carry various types of
control information relating to data packets for various purpose eg. Making
S-frames are used only to transport connection with server, authentication by
control information. password etc .
V-frames arereserved for system
management ,for managing the link itself.

What is multiple access protocol ?


Where link( media) is shared by multiple nodes.

ALOHA
It is a type of multiple access protocol used at data link layer.
It is a subtype of random access protocol , where any station can send its frame on the
common link at any time , without checking if any other station is already sending its frame
or not.
It has two sub types: pure & slotted
Pure ALOHA
ALOHA, the earliest random access method, was developed at the University of Hawaii
in early 1970. It was designed for a radio (wireless) LAN, but it can also be used on any
wired medium also.
where any station can send its frame on the common link at any time.
Thus there can be collision ( shown by gray boxes) as shown & the frames which are
collided , are need to be sent by senders again.

ALOHA protocol ( executed at data link layer)

After sending a frame , sender waits for time equal to round trip time ( 2 * propagation time) .
If it receives ACK within this time , the frame is successfully sent. If ACK is not received ,
next attempt is made, (only if maximum set number of attempts is not reached, else sending is
aborted). It waits for back off time before sending the frame again . The back off time is
random after every unsuccessful attempt.
The throughput for pure ALOHA isS = G × e−2G
where G is the average number of frames requested per frame-time
The maximum throughput Smax = 0.184 when G= 1/2 . i.e 184 frames in every 1000 frames.

Slotted ALOHA
where any station can send its frame on the common link in any slot which are at fixed times.
It has less chances of collision as compared to pure ALOHA , still there can be collision (
shown by gray boxes) as shown & the frames which are collided , are need to be sent by
senders again.
The throughput for Slotted ALOHA isS = G × e−G
where G is the average number of frames requested per frame-time
The maximum throughput Smax = 0.368 when G= 1 i.e. 368 frames out of 1000 frames.

Carrier Sense Multiple Access(CSMA)


It is a type of multiple access protocol used at data link layer.
Where link is shared by multiple nodes.
It is sub type of random access method.
In this the stations sense the medium (Carrier Sense) to check if some station is alredy usng
the media , before sending data on it. i.e. listen before talk .
It is improvement over ALOHA , ( In ALOHA , stations don’t check if any other stations also
sending there frames , so more collisions)
Even after taking this care (that no station should send its frame if some station is already
using the link still there will be collisions) there are still collisions ,
It can reduce collisions as compared to ALOHA but cannot eliminate it altogether.
The reason is propagation delay.
When a station A sends a frame , It takes time for the 1st bit to reach to every station and for
every station to sense it. i.e. another station C may sense the medium and find it idle ,
because 1st bit sent by station A has not yet been reached station C , so station C also sends its
frame causing collision.

persistence methods
CSMA uses persistence methods to reduce the chances of collisions
There are three types of persistence methods
• 1- persistence
• Non persistence
• P- persistence
1- persistence
• In this station senses the link continuously and as soon as it finds that link is idle , it
sends its frame immediately( i.e. with probability 1).
• This method has highest chance of collisions, because all stations may find the link to
be idle and send their frames immediately.
• Ethernet uses this method.

Non persistence
• A station finds the line idle , it sends its frame immediately as in previous method.
• But if line is busy, it does not keep on checking the link continuously ,rather it waits
for a random time before sensing the link again ( less greedy than 1persistent)

P- persistence
• Here link is divided into time slots ( slot period is equal to or greater than max
propagation time)
• P- persistence combines advantages 1 & non persistent. It reduces chance of collision
and improves efficiency.
• It uses following rule , when it finds that link is idle in any time slot
• Algo:
• 1) It may send frame with probability p
• 2) or it may refrain from sending with probability q = 1-p and waits for next time slot
,where it checks the link again
• a) if link is idle it goes to step 1
• b) if link is busy , it acts as if collision has occurred and uses back off procedure
CSMA/CD

It is Carrier Sense Multiple Access with collision detection


It is an improvement over Carrier Sense Multiple Access(CSMA)
CSMA monitors channel only before sending frame . But CSMA/CD monitors channel also
during frame transmission. &As soon as collision is detected , The transmitting stations
immediately abort the frame which are being sent , and send jamming signal to inform all
stations about collision And frame is resent by usual CSMA method.
In CSMA/CD frame transmission and collision detection is done simultaneously.
stations detect collisions by checking energy level on the channel

• Here station A starts at time t1;


• at time t2 station C also senses link and it finds the link idle( because 1st bit of station
A has not reached to station C yet).
• They both collide at some time after t2,
• the collision reaches station C at time t3, whereupon station C stops its transmission.
• Station A continues to transmit till time t4 ,after which it also receives collision
signal and so stops.
Flow diagram for CSMA/CD

CSMA/CD is used in wired LAN eg. Ethernet.

Carrier Sense Multiple Access with Collision Avoidance (CSMA/CA)

CSMA/CD is used in wired network , but can’t be used for wireless network.
In wirednetwork ,the received signal has almost same energy as the sent signal( due wires
and repeaters). So in collisions , the energy of signal is almost double , which can be easily
detected.

But in case of wireless . Much of the sent energy is lost in transmission in air & the
received signal has very less energy . So collision may add only 5 to 10%. So the difference
between normal frame energy & collision energy is very small, thus collision detection is
very difficult .

So CSMA/CD is modified in CSM/CA to avoid collisions on wireless networks because they


cannot be detected.
Collisions are avoided through the use of CSMA/CA's three strategies: the interframe space,
the contention window, and acknowledgments,
IFS( inter frame space)
• Collisions are tried to be avoided by not sending transmission even if the channel is
found free. i.e. station does not immediately sends frame when it finds link idle , but
waits for time IFS. This is so because other station may also sensed link and started
transmission after finding it idle, but has not reached this station . IFS is the time
required by 1st bit of distant station to reach this this station.
• After IFS time if the channel is still idle , station has to wait for a time called
contention period before it can send.

Contention window:
• It is amount of time divided into slots . After IFS ,a station has to wait a random no.
of slots.. The number slots in this contention window change according to binary
exponential back off .
• i.e. for first time it is 1 time slot , then it doubles each time the station cannot detect
idle link after IFS time.
ACK :
• Even with all these precautions , there may still be collisions . So ACK by receiver
and time out timer at sender can guarantee that ,the Rx receives the frame.

CSMA/CA flow chart


Binary Exponential Back-off algorithm

Binary Exponential Backoff ( BEB ) is an algorithm to determine how long entities should
backoff ( wait) before they retry for retransmission of a frame. After every unsuccessful
attempt, the maximum backoff interval is doubled.
This is used to reduce the chances of collisions in CSMA/CA

It is calculated using number of attempts K & round trip time Tp


Backoff time Tb = Tp * ( 2 K -1 )
Assuming Tp = 2ms
• For K = 1, the range is {0,1}. The station needs to generate a random number with a
value of 0 or 1. This means that Backoff time Tb is either 0 ms (0 x 2) or 2 ms (l x 2),
based on theoutcome of the random variable.
• For K = 2, the range is {0, 1, 2, 3}. This means that Tb can be 0, 2, 4, or 6 ms, based
on
the outcome of the random variable.
• For K =3, the range is {0, 1,2,3,4,5,6, 7}. This means that Tb can be 0,2,4, ... , 14 ms,
based on the outcome of the random variable.
As K increases , there are more numbers to choose from , so the chances that stations
choose same number goes on decreasing , so less chances of collisions.

Ethernet IEEE 802.3

In 1985, IEEE started a project, called Project 802, to set standards for communication
among devices from different manufacturers. Project 802 specifies functions of the
physical layer and the data link layer of major LAN protocols. One of the standard is
IEEE 802.3 ( Ethernet )
The original Ethernet was created in 1976 at Xerox, Since then, it has evolved through
four generations.( Standard , fast , gigabit, ten gigabit) .

Standard Ethernet

Frame format
• Preamble: is 56 bits of alternating 0s and 1s(101010…) ,used for giving alert to Rx
,and helping it synchronize with Tx. It is not added by MAC but by physical layer.
• SFD : ( start of frame delimiter) it is last byte(10101011) before actual MAC frame
(this also is added by physical layer.)
• DA: destination MAC address ( 6 byte)
• SA: source MAC address ( 6 byte)
• Data : max 1500 bytes and min 46 bytes ; if data is less than 46 , padding is done to
make it 46 bytes,
• CRC : it uses crc-32 for error detection.

Restriction on minimum & maximum frame size

• Minimum length of frame ( 64 bytes or 512 bits) which is required for correct
operation of CSMA/CD. So minimum data size is 64-18 =46
• Maximum length of frame is 1518 bytes,so max data size is 1518-18=1500

Categories of Standard Ethernet ( Based on type of Tx media )

1. 10base 5
• Also called thick ethernet or thicknet , because cable used is very thick
• Uses co-axial cable and used in bus topology
• Uses external transreceiver
• Max segment length 500mtr and can use 5 segments of 500mtrs connected by
repeaters .
• Works only in Half duplex mode.
2. 10base2
• Also called thin ethernet, cheapernet because cable is much thinner than 10base5
• This also uses co-axial cable, and bus topology
• Trans-receiver is inside the computer in NIC
• Cheaper than 10base5 , uses only T connectors ,but length is 185 mtr
• half duplex

3. 10 base T
• Cable used is twisted cable
• Topology is physical star.
• All stations connected to central hub via two pairs of twisted cable.(one for sending
and another for receiving)
• Collisions happen in hub
• Max length = 100mtr ( between hub and station)
• full duplex

4. 10base F
• Cable used is fiber optic
• Topology : physical star.
• Distance covered : 2Km
• Requires two FOCs per station
• full duplex
Summary
10base5 10base2 10baseT 10baseF
media Thick co axial Thin co axial UTP Fiber optic cable
Max segment 185 mtr ~ 200
500 mtr 100 mtr 2Km
length mtr
Operation Half duplex Half duplex Full duplex Full duplex
topology Bus Bus Star Star

IEEE 802.11 a/b/g/n

It is also called as WiFi /WLAN /hot spot


It is a protocol used at data link layer
It is for wireless LAN.
The standard defines two kinds of services:
1. the basic service set (BSS) and
2. the extended service set (ESS).
1. the basic service set (BSS)
is made of wireless stations (stationary or mobile ) and an optional central base station,
known as the access point (AP).
The BSS without an AP is a stand-alone network and cannot send data to other BSSs.
It is called an ad hoc architecture. In this architecture, stations can form a network
without the need of an AP.
A BSS with an AP is also called as an infrastructure network.

2. An extended service set (ESS) is made up of two or more BSSs with APs. In this
case, the BSSs are connected through a distribution system, which is usually a wired
LAN. The distribution system connects the APs in the BSSs

Communication between two stations in two different BSSs occurs via two APs to which
they part of.
Station Types
IEEE 802.11 defines three types of stations based on their mobility in a wireless LAN:
1. no-transition: a station is either stationary (not moving) or moving only inside a BSS
2. BSS –transition: A station can move from one BSS to another, but the movement is limited
to only one ESS
3. ESS-transition mobility.: A station with ESS-transition mobility can move from one ESS
to another

MAC Sublayer
IEEE 802.11 defines two MAC sublayers:
1. the distributed coordination function (DCF)
2. point coordination function (PCF).
Figure the relationship between the two MAC sublayers, the LLC sublayer, and the physical
layer.

MAC sublayer uses CSMA/CA protocol for avoiding collisions.


Frame format

FC (Frame control) : defines the type of frame and some control information.
D( duration). In all frame types, this field defines the duration of the transmission that is used
to set the value of NAV
Addresses. There are four address fields, each 6 bytes long ( they can be source station
address , destination station address, receiving AP, sending AP , BSS ID )
SC (Sequence control). defines the sequence number of the frame ( required for flow control)
Frame body. contains information based on the type and the subtype defined in the FC field.
FCS ( Frame check sequence ) :contains a CRC-32 error detection sequence. ( required for
flow control)

Frame Types
802.11 has three categories of frames:
1. Management frames,
2. control frames, and
3. data frames.
1. Management frames are used for the initial communication between stations and access
points
2. Control Frames are used for accessing the channel and acknowledging frames.
3. Data Frames are used for carrying data and control information.

Control Frames

After the channel is found idle .the source station waits for a period of time called the
distributed interframe space (DIFS); then the station sends a control frame called the request
to send (RTS).
when destination gets RTS, it waits for a period of time called the short interframe space
(SIFS), the destination station sends a control frame, called the clear to send (CTS), to the
source station. This control frame indicates that the destination station is ready to receive
data.
The source station sends data after waiting an amount of time equal to SIFS.
The destination station, after waiting an amount of time equal to SIFS, sends an
acknowledgment to show that the frame has been received

Network Allocation Vector (NAV)


It is used to prohibit other stations to send their data if one station acquires access to channel.
When a station sends an RTS frame, it includes the duration of time that it needs to
occupy the channel. other stations are allowed to check the channel for idleness only after
this duration of time.
This avoids collisions.

Addressing mechanism:

case 1 source to destination ( only two addresses)

Case 3: source to AP ( three addresses)

Case 2 : AP to destination ( three addresses)

Case 4: AP to AP ( four addresses)


Hidden and Exposed Station Problems in 802.11

Hidden station problem:


It occurs when 3 stations are as shown in figure.
Station A has station B in its range but not C. i.e. C is hidden from A
Station C has station B in its range but not A. i.e. A is hidden from C
Station B has both A & C in its range.

Suppose A is sending a frame to B. C wants to send frame to B . C is not aware of frame


sent by A since , it does not reach C. so C starts sending its frame thinking that B is free. This
causes frame sent by A & C to collide .
This is called Hidden station problem.
Solution :
When A establishes connection with B by sending RTS . The B sends CTS to A . and it
sends CTS to C also , B also sends the duration of time it will be busy with A. So C will not
send its frame to B during this time.
Exposed Station Problem
It occurs when 4 stations are as shown in figure.
Station B has both stations A & C in its range.
Station C has both stations B & D in its range.
Suppose B is currently sending its frame to A . It is heard by station C also.
Now C wants to send frame to D , but can not send because it knows that there is
transmission from B. It could send a frame to D , since D is not in range of B . This is called
Exposed Station Problem. So here C is exposed to B

Solution
When C hears an RTS from B, but not the corresponding CTS , then C can conclude that it is
(C) an exposed node and C is permitted to transmit to other neighboring nodes such as D.

IEEE 802.11 a/b/g/n

/* first write above answer of 802.11 then write following */

These are different versions of 802.11 with different implementation of physical layer
frequency-hopping spread spectrum (FHSS)
direct sequence spread spectrum (DSSS)
pulse position modulation (PPM)
frequency shift keying (FSK )
Phase shift keying (PSK )
Orthogonal frequency-division multiplexing (OFDM)

IEEE 802.15

Also called as Bluetooth


It is a standard for wireless personal-area network (PAN) operable in an area the size of a
room or a hall.
Bluetooth defines two types of networks: piconet and scatternet.
piconet

A piconet can have a maximum of seven active secondaries, an additional eight secondaries
can be in the parked state. A secondary in a parked state cannot take part in communication
until it is moved from the parked state to active state.

Scatternet
Piconets can be combined to form what is called a scatternet. A secondary station in
one piconet can be the primary in another piconet.
IEEE 802.16,
also known as WiMAX (Worldwide Interoperability for Microwave Access), is a set of
standards developed by the Institute of Electrical and Electronics Engineers (IEEE) for
wireless broadband communication. It is designed to provide high-speed wireless access over
long distances and can cover areas ranging from a few square kilometers to several tens of
kilometers.

WiMAX operates in various frequency bands, including licensed and unlicensed spectrums,
making it suitable for both fixed and mobile broadband wireless networks. It was initially
developed to provide an alternative to traditional wired broadband solutions, especially in
areas where deploying physical cables is challenging or economically unfeasible.
Two types of user stations are there −
Subscriber stations − They are stationary in some fixed location. For example, broadband
Internet for homes and offices.
Mobile stations − They receive service while they are in motion within the range of
WiMAX. For example, a WiMAX equipped vehicle.

Key features of IEEE 802.16 (WiMAX) include:

1. Range WiMAX has a longer range compared to traditional Wi-Fi networks, making it
suitable for covering large areas with a single base station.

2. Data Rates: It supports high data rates, suitable for the delivery of broadband-level
services including internet access, VoIP, and multimedia streaming.
3. Quality of Service (QoS):WiMAX provides various QoS mechanisms, enabling network
operators to prioritize different types of traffic based on their requirements. This is essential
for supporting applications with differing demands, such as voice and video.

4. Mobility: While originally designed as a fixed wireless technology, later versions of


WiMAX introduced mobility support, allowing devices to move between different base
stations while maintaining connectivity.

5. Point-to-Multipoint Topology: WiMAX employs a point-to-multipoint topology, where a


base station communicates with multiple subscriber stations simultaneously. This is
particularly useful for delivering broadband access to multiple users in a given area.

6. Security: WiMAX incorporates security mechanisms to protect data transmission,


including encryption and authentication protocols.

It's important to note that while WiMAX had significant potential and was initially positioned
as a competitor to cellular technologies like 3G and 4G, it faced challenges in terms of
adoption, deployment costs, and competition from evolving cellular technologies like LTE
and later 5G.

WiMAX is not as widely used as it was initially thought.

Difference between 802.16 & 802.11

802.16 802.11

01. Also known as WiMAX. Also known as WLAN or WiFi.

It is designed for long distance/wide


02. It is designed for limited area.
area.

It provides a coverage range of 7 km It provides a coverage range of 30 m to


03.
to 50 km. 100m.

802.16 standard is used for outdoor


04. 802.11 standard is used for indoor usage.
usage.

It operates on frequencies of 2.4 GHz, It operates on frequencies of 2.5 GHz, 3.5


05.
5 GHz. GHz, 5.8GHz.

Bandwidths varies dynamically as per Bandwidth variants are 20 MHz, 40MHz,


06.
user requirement from 1.5 to 28 MHz. 80MHz and 160 MHz.

Standard variants of 802.16 are


Standard variants of 802.11 are 802.11a,
07. 802.16a, 802.16d, 802.16e, 802.16m
11b, 11g, 11n, 11ac, 11ad etc.
etc.
It provides a data rate of 100 Mbps in It provides a data rate of 54 Mbps in 20
08.
a 20 MHz channel. MHz channel.

Large number of customers are Limited number of customers/devices are


09. connected to this as it covers a wide connected which are within the limited
area. range.

For encryption it uses Data For security it uses WEP (Wired Equivalent
10.
Encryption Standard (DES) Privacy), WPA (Wi-Fi Protected Access)

You might also like