You are on page 1of 63

School of Electrical, Electronics and Communication Engineering

Course Code : BECE3105 Computer Network

Computer Network

UNIT 2

Name of the Faculty: Indu Bhardwaj Program Name: B.Tech


Prerequisite/Recapitulations

• OSI model
• Communication Systems
School of Electrical, Electronics and Communication Engineering
Course Code : BEE01T2005 Analog and Digital Communication

OBJECTIVES

Name of the Faculty: Indu Bhardwaj Program Name: B.Tech


OBJECTIVES

Medium access sub layer:

• Medium Access sub layer - Channel Allocations,

• LAN protocols - ALOHA protocols - Overview of IEEE standards

• FDDI

• Data Link Layer -Framing

• Elementary Data Link Protocols,

• Sliding Window protocols,

• Error Handling
Introduction

 In the OSI model, the data link layer is a 4 th layer from the top and 2nd layer from the bottom.

 The communication channel that connects the adjacent nodes is known as links, and in order to move
the datagram from source to the destination, the datagram must be moved across an individual link.

 The main responsibility of the Data Link Layer is to transfer the datagram across an individual link.

 The Data link layer protocol defines the format of the packet exchanged across the nodes as well as
the actions such as Error detection, retransmission, flow control, and random access.

 The Data Link Layer protocols are Ethernet, token ring, FDDI and PPP.

 An important characteristic of a Data Link Layer is that datagram can be handled by different link layer
protocols on different links in a path. For example, the datagram is handled by Ethernet on the first
link, PPP on the second link.
Services provided by the Data Link Layer
Services provided by the Data Link Layer

1. Framing & Link access: 

o Data Link Layer protocols encapsulate each network frame within a Link layer frame before the
transmission across the link.

o A frame consists of a data field in which network layer datagram is inserted and a number of data
fields. It specifies the structure of the frame as well as a channel access protocol by which frame is
to be transmitted over the link.

2. Reliable delivery
• Data Link Layer provides a reliable delivery service, i.e., transmits the network layer datagram
without any error. A reliable delivery service is accomplished with transmissions and
acknowledgements.

• A data link layer mainly provides the reliable delivery service over the links as they have higher error
rates and they can be corrected locally, link at which an error occurs rather than forcing to
retransmit the data.
Services provided by the Data Link Layer

3. Flow control
A receiving node can receive the frames at a faster rate than it can process the frame. Without flow control,
the receiver's buffer can overflow, and frames can get lost. To overcome this problem, the data link layer
uses the flow control to prevent the sending node on one side of the link from overwhelming the receiving
node on another side of the link.

4. Error detection
Errors can be introduced by signal attenuation and noise. Data Link Layer protocol provides a mechanism to
detect one or more errors. This is achieved by adding error detection bits in the frame and then receiving
node can perform an error check.

5. Error correction
Error correction is similar to the Error detection, except that receiving node not only detect the errors but
also determine where the errors have occurred in the frame.

6. Half-Duplex & Full-Duplex


In a Full-Duplex mode, both the nodes can transmit the data at the same time. In a Half-Duplex mode, only
one node can transmit the data at the same time.
Sub-layers of Data Link Layer

• The IEEE has subdivided the data link layer into two sublayers:
• logical link control (LLC)
• media access control (MAC)

• IEEE has also created several physical layer standards for different LAN protocols
Sub-layers of Data Link Layer

• Responsible to ensure effective channel allocation to the stations if multiple stations are requesting
same channel.
• Media access control sublayer defines the specific access method for each LAN. For example, it defines
CSMA/CD as the media access method for Ethernet LANs and the token passing method for Token Ring
and Token Bus LANs. A part of the framing function is also handled by the MAC layer.
 
• In contrast to the LLC sublayer, the MAC sublayer contains a number of distinct modules; each defines
the access method and the framing format specific to the corresponding LAN protocol.

 
• Second sub layer called LLC(Logical Link Control)-sub layer is responsible for all other duties of the Data
Link Layer viz. Framing, accepting packets from upper layer, error control etc.
Sub-layers of Data Link Layer

Various Channel Allocation Schemes:


 
Channel Allocation schemes can be categories into two categories:-
a) Static Channel Allocation Schemes: In this category a fixed dedicated portion of the bandwidth or time or wavelength etc is
assigned to a particular station.
Following are the examples of the Static Channel Allocation schemes:-
1) Time Division Multiplexing
2) Frequency Division Multiplexing.
3) Wavelength Division Multiplexing.
4) Code Division Multiplexing.
b) Dynamic Channel Allocation Schemes:- Static channel allocation schemes can work only for a small number of the stations, In
case number of stations is large, dedicated allocation of the resources is not effective. Thus dynamic channel allocation
schemes are the only option in cases when a large number of stations are competing for the single channel.
Following are the examples of Dynamic Channel Allocation Schemes:-
1) ALOHA 2) Slotted ALOHA 3) CSMA 4)CSMA/CD.
Aloha

ALOHA Random Access Protocol

It is designed for wireless LAN (Local Area Network) but can also be used in a shared medium to transmit
data. Using this method, any station can transmit data across a network simultaneously when a data
frameset is available for transmission.
1. Pure Aloha-
 
•It allows the stations to transmit data at any time whenever they want.
•After transmitting the data packet, station waits for some time. Then, following 2 cases are possible-
 
Case-01:
 
•Transmitting station receives an acknowledgement from the receiving station.
•In this case, transmitting station assumes that the transmission is successful.
 
Case-02:
 
•Transmitting station does not receive any acknowledgement within specified time from the receiving station.
•In this case, transmitting station assumes that the transmission is unsuccessful.
 
Then,
•Transmitting station uses a Back Off Strategy and waits for some random amount of time.
•After back off time, it transmits the data packet again.
•It keeps trying until the back off limit is reached after which it aborts the transmission.
Efficiency-

Efficiency of Pure Aloha (η) = G x e-2G

where G = Number of stations willing to transmit data

Maximum Efficiency-
 
For maximum efficiency,
•We put dη / dG = 0
•Maximum value of η occurs at G = 1/2
•Substituting G = 1/2 in the above expression, we get-
 
Maximum efficiency of Pure Aloha
= 1/2 x e-2 x 1/2
= 1 / 2e
= 0.184
= 18.4%
Maximum Efficiency of Pure Aloha (η) = 18.4% The maximum efficiency of Pure Aloha is very less due to large
number of collisions.
2. Slotted Aloha-
 

•Slotted Aloha is an improvement over pure Aloha technique.


•Slotted Aloha divides the time of shared channel into discrete intervals called as time slots.
•Any station can transmit its data in any time slot.
•The only condition is that station must start its transmission from the beginning of the time slot.
•If the beginning of the slot is missed, then station has to wait until the beginning of the next time slot.
•A collision may occur if two or more stations try to transmit data at the beginning of the same time slot.
Efficiency-

Efficiency of Slotted Aloha (η) = G x e-G

where G = Number of stations willing to transmit data at the beginning of the same time slot
 
Maximum Efficiency-
 
For maximum efficiency,
•We put dη / dG = 0
•Maximum value of η occurs at G = 1
•Substituting G = 1 in the above expression, we get-
 
Maximum efficiency of Slotted Aloha
= 1 x e-1
=1/e
= 0.368
= 36.8%
Maximum Efficiency of Slotted Aloha (η) = 36.8%. The maximum efficiency of Slotted Aloha is high due to less
number of collisions.
Expression between Offered Load and Throughput for ALOHA techniques

-
1) Offered Load:- The number of frames offered to the channel per second is termed as Offered Load.
Offered load is represented as G. Obviously all frames cannot successfully transmitted through the
channel, few frames will be dropped out in first attempt due to collisions.

2) Throughput: - The number of frames successfully transmitted and reached at other end of the channel
per second is termed as Throughput. Throughput is represented as S.

3) Vulnerable Time:- Vulnerable time refers to the time during which no other station can start transmission
when a station is already transmitting the frame. Vulnerable time is an important factor in derivation of the
expression between S(Throughput) & G(Offered load).
According to Poisson distribution the probability that k frames per second will reach the destination

successfully from G frames per second is given by:-

 
P [K] = Gk e-t
------------- -----------------------------( I )
K!

Where t is vulnerable time.


Analysis for pure-Aloha:-
According to pure aloha when a frame is in the channel, second frame can not start entering in
the channel, similarly no other frame can completely enter in the channel unless first frame is
completely out from the channel. Thus the minimum time gap between two frames transmission will
be 2t, where t is the length of the frame. In case G frames are being offered per second thus
vulnerable time for the channel will be
2G.
 
Therefore the throughput S can be given as:-
S = G P[o] -----------------------(II)
Where P[o] is the probability of no other packet transmission when G packets per second are being
transmitted successfully.
 
P[o] = G0 e-2G
------------- = e-2G -----------------------------------(III)
0!
 
Putting in equation II
 
S=Ge -2G
 
The maximum value of S is 0.18 possible when G=0.5
Analysis for s-Aloha:-
According to slotted aloha collisions are possible only at the beginning of the slot, once the frame
transmission has been started and other frames will compete only after completion of current slot.
Thus only waiting time or vulnerable time is half than that of pure aloha.
 
Thus analyzing similar to above S=Ge -G
.

The maximum value of S is 0.36 possible when G=1


CSMA is a mechanism that senses the state of the shared channel to prevent or recover data packets
from a collision. It is also used to control the flow of data packets over the network so that the
packets are not get lost, and data integrity is maintained. In CSMA, when two or more data packets
are sent at the same time on a shared channel, the chances of collision occurred
It is divided into two parts, 

CSMA CA (Collision Avoidance) and 


CSMA CD (Collision Detection).
CSMA CD (Collision Detection).
Advantages of CSMA CD:
1. It is used for collision detection on a shared channel within a very short time.
2. CSMA CD is better than CSMA for collision detection.
3. CSMA CD is used to avoid any form of waste transmission.
4. When necessary, it is used to use or share the same amount of bandwidth at each station.
5. It has lower CSMA CD overhead as compared to the CSMA CA.

Disadvantage of CSMA CD137


Hello Java Program for Beginners
6. It is not suitable for long-distance networks because as the distance increases, CSMA CD'
efficiency decreases.
7. It can detect collision only up to 2500 meters, and beyond this range, it cannot detect collisions.
8. When multiple devices are added to a CSMA CD, collision detection performance is reduced
CSMA/CA
CSMA stands for Carrier Sense Multiple Access with Collision Avoidance.
It means that it is a network protocol that uses to avoid a collision rather than allowing it to occur,
and it does not deal with the recovery of packets after a collision.

It is similar to the CSMA CD protocol that operates in the media access control layer.
In CSMA CA, whenever a station sends a data frame to a channel, it checks whether it is in use.
If the shared channel is busy, the station waits until the channel enters idle mode.

Hence, we can say that it reduces the chances of collisions and makes better use of the medium to
send data packets more efficiently.
Advantage of CSMA CA
1. When the size of data packets is large, the chances of collision in CSMA CA is less.
2. It controls the data packets and sends the data when the receiver wants to send them.
3. It is used to prevent collision rather than collision detection on the shared channel.
4. CSMA CA avoids wasted transmission of data over the channel.
5. It is best suited for wireless transmission in a network.
6. It avoids unnecessary data traffic on the network with the help of the RTS/ CTS extension.
The disadvantage of CSMA CA
7. Sometime CSMA/CA takes much waiting time as usual to transmit the data packet.
8. It consumes more bandwidth by each station.
9. Its efficiency is less than a CSMA CD.
IEEE Standards

IEEE-Ethernet - Project 802 was developed by IEEE(Institution of Electrical & Electronics


Engineers) as a standard for LANs. Ethernets come under the subset 802.3 where it utilizes the
CSMA/CD standards.
 
The 802.3 standards focus on the implementation of LANs at a very low level.

The 1st of the implementation of the 802.3 project is

Thick Ethernet (or Thicknet) is called 10Base5:-

10Base2 Also known as cheapnet and thinnet.

10BaseT or Legacy Ethernet:-


Thick Ethernet (or Thicknet) is called 10Base5:-
Thicknets are used on a bus topology with a limited range of 500 meters per segment.
Each node is to be separated by its neighbor by a distance of 2.5 meters, accounting for
200 stations per segment.

Thicknets connections are limited to a maximum of 5 segments, connected via a variety


of internetworking devices.
The reasons why Thicknets are limited to 5 segments is the amount of collisions is too
high should there be more nodes on the network. A signal cannot be reliably
reconstructed after going through so many regenerations
10Base2 Also known as cheapnet and thinnet.
Thinnet is named such due to the size of the coaxial cable used, which is thinner than thicknet
Thinnets are used in small organizations where distance and the amount of nodes available on
the line is relatively small.

Connectors used in this are BNC-Connectors .


10BaseT or Legacy Ethernet:-
The 10BaseT network uses UTP cables and a hub to connect its network together. The
chief advantage of 10BaseT networks is the flexibility it offers. Nodes can be removed
and added without much hassle and the cables themselves are relatively easy to install.
lOBase-F: Fiber Ethernet
Although there are several types of optical fiber lO-Mbps Ethernet, the most common is
called 10Base-F. lOBase-F uses a star topology to connect stations to a hub. The stations
are connected to the hub using two fiber-optic cables
summary of Standard Ethernet implementations.
Framing

• Framing refers to accepting packets from Network layer and to divide into frames.

• Framing is one of the important responsibilities of the Data Link Layer protocol
•  
• The data link layer, on the other hand, needs to pack bits into frames, so that each frame is
distinguishable from another.

• Our postal system practices a type of framing. The simple act of inserting a letter into an envelope
separates one piece of information from another; the envelope serves as the delimiter. In addition,
each envelope defines the sender and receiver addresses since the postal system is a many-to-
many carrier facility.

• Although the whole message could be packed in one frame, that is not normally done. One reason
is that a frame can be very large, making flow and error control very inefficient. When a message
is carried in one very large frame, even a single-bit error would require the retransmission of the
whole message. When a message is divided into smaller frames, a single-bit error affects only that
small frame.
Parts of a Frame

A frame has the following parts −


 Frame Header − It contains the source and the
destination addresses of the frame.
 Payload field − It contains the message to be
delivered.
 Trailer − It contains the error detection and error
correction bits.
 Flag − It marks the beginning and end of the frame.
Types of Framing

Fixed-Size Framing

In fixed-size framing, there is no need for defining the boundaries of the frames; the size itself can be
used as a delimiter. An example of this type of framing is the ATM wide-area network, which uses frames
of fixed size called cells.
 
Variable-Size Framing
Here, the size of each frame to be transmitted may be different. In variable-size framing, we need a
way to define the end of the frame and the beginning of the next.
 
Following are the various techniques of the framing:-
 Character Count
 Flag bytes with byte stuffing/ Byte Stuffing/ Character Stuffing
 Special Characters/ Bit Stuffing
 Physical Layer code violation.
Techniques of Framing

1. Character Count:-

This method is rarely used and is generally required to count total number of characters that are present in
frame. This is be done by using field in header. Character count method ensures data link layer at the
receiver or destination about total number of characters that follow, and about where the frame ends.

Disadvantage: if anyhow character count is disturbed or distorted by an error occurring during


transmission, then destination or receiver might lose synchronization.
Techniques of Framing

2. Character stuffing is also known as byte stuffing or character-oriented framing

In byte stuffing, special byte that is basically known as ESC (Escape Character) that has predefined
pattern is generally added to data section of the data stream or frame when there is message or character
that has same pattern as that of flag byte.

But receiver removes this ESC and keeps data part that causes some problems or issues.
Techniques of Framing

3. Special Characters:
• Another method to deal with the problem of existence of flag bits in message is stuffing
of special works or characters at beginning and end of the frames.

• These special words are based on the concept that these otherwise carry no dictionary
meaning.

• e.g. DLE STX at beginning and DLE ETX at end of the frames. More combinations
are possible.
 
Techniques of Framing

4. Physcial Layer code violation:- This is another method of framing that is developed to deal
with the problem of noise.

In this method it is assumed that if the physical layer coding style is robust , change of one bit due
to noise will not affect the meaning a lot at least will not interpret wrongly.
 
e.g. In case if were representing 5 Volt as 1 and 2 Volt as 0 in coding style. If 1 was changed to 0
the receiver will understand it as 2 volt signal was transmitted.
 
But we are using 00 to represent 5 Volt and 11 to represent as 2 Volt. If 00 was transmitted and
one bit is changed the receiver will say I have received 01 that has no meaning perhaps there is
some error in transmission.
Error: - When information is transmitted via an electromagnetic signal, interference from external
sources would corrupt the signal. A key component of a network is reliability. But errors can affect
the reliability of the network.
Single Bit Error:- A bit in the stream that arrived at it destination is different than that which was
at its point of origin.

Multiple Bit Error:- Multiple bits are changed in such errors.


Burst Error:- A burst error is when a sequence of bits are corrupted during transmission
Error Detection Method

 Errorcorrection is only possible if errors are detected in the


code words. There exists many methods for error detection,
the most popular ones are
i) Parity Checking (VRC)
ii) L o n g i t u d i n a l r e d u n d a n c y c h e c k ( L R C )
iii) Check sum Error Detection
iii) Cyclic Redundancy Check (CRC)
Parity Checking

 Here an additional bit is appended with the existing message bits, known as the parity
bit.
 As a result of addition of this extra bit, the resultant word now will have either even
or odd parity i.e. number of 1s in the code word will be
either even or odd.
 If it is known that the parity of the received message is always going to be even or
odd as the case may be and if the received signal does not tally with the expected result,
the presence of an error is detected.

 The limitation of this method is that it can only detect odd number of errors and also it
is unable to locate the position of the error.
Parity Checking

Even / odd Parity


Parity Checking

Parity Bit
Parity Checking
Parity Checking
Parity Checking/ Vertical Redundancy Check 

Vertical Redundancy Check is also


known as Parity Check.

In this method, a redundant bit also


called parity bit is added to each
data unit.

This method includes even parity


and odd parity. Even parity means
the total number of 1s in data is to
be even and odd parity means the
total number of 1s in data is to be
odd.
Parity Checking/ Vertical Redundancy Check 

Advantages :
 VRC can detect all single bit error.
 It can also detect burst errors but only in those cases where number of bits changed is odd, i.e. 1, 3, 5, 7,
…….etc.
Disadvantages :
The major disadvantage of using this method for error detection is that it is not able to detect burst error if the
number of bits changed is even, i.e. 2, 4, 6, 8, …….etc.
Longitudinal Redundancy Check

Longitudinal Redundancy Check (LRC) is the error detection method which is used by upper layers to
detect error in data. The other name for VRC is 2-D parity check. In LRC,
Parity check bits are calculated for each row, which is equivalent to a simple parity check bit. Parity check
bits are also calculated for all columns, then both are sent along with the data. At the receiving end these
are compared with the parity bits calculated on the received data.

LRC is more effective in detecting


multiple-bit and burst-error than VRC.
VRC and LRC
S.No. Vertical Redundancy Check (VRC) Longitudinal Redundancy Check (LRC)
It stands for Longitudinal Redundancy
1. It stands for Vertical Redundancy Check. Check.
In this redundant bit called parity bit is added In this redundant row of bits is added to
2. to each data unit. the whole block.
3. VRC can detect single bit errors. LRC can detect burst errors.
4. It is also known as parity checker. It is also known as 2-D parity checker.
The advantage of using VRC is that it can
checks all single bit errors but can check odd The advantage of using LRC over VRC is
5. parity only in the case of change of odd bits. that it can check all the burst errors.
If two bits in data unit is damaged and
also in other data unit the same bits are
It is not capable of checking the burst error in damaged at same position, then it is not
6. case of change of bits is even. capable of detecting such kind of error.
Checksum

Checksum
 
In this error detection scheme, the following
procedure is applied
 Data is divided into fixed sized frames or
segments.
 The sender adds the segments using 1’s
complement arithmetic to get the sum. It then
complements the sum to get the checksum and
sends it along with the data frames.
 The receiver adds the incoming segments along
with the checksum using 1’s complement
arithmetic to get the sum and then
complements it.
 If the result is zero, the received frames are
accepted; otherwise, they are discarded.
Cyclic Redundancy Check:

 Unlike checksum scheme, which is based on addition, CRC is based on


binary division.

 In CRC, a sequence of redundant bits, called cyclic redundancy check bits,


are appended to the end of data unit so that the resulting data unit becomes
exactly divisible by a second, predetermined binary number.

 At the destination, the incoming data unit is divided by the same number.
If at this step there is no remainder, the data unit is assumed to be correct
and is therefore accepted.

 A remainder indicates that the data unit has been damaged in transit and
therefore must be rejected.
Cyclic Redundancy Check:
Cyclic Redundancy Check: Example

00=0
01=1
10 =1
11=0
School of Electrical, Electronics and Communication Engineering
Course Code : BEE01T2005 Analog and Digital
Communication

References

1. Simon Haykin, “Digital Communications”, Wiley student edition- 1988, ISBN 978-81-265-0824-2
2. Bernard Sklar, “Digital Communication”, 2nd Edition, Pearson Education,edition- 2006, ISBN-10:
0130847887.

Name of the Faculty: Indu Bhardwaj Program Name: B.Tech


School of Electrical, Electronics and Communication Engineering
Course Code : BEE01T2005 Analog and Digital Communication

Thankyou

Name of the Faculty: Indu Bhardwaj Program Name: B.Tech

You might also like