You are on page 1of 36

UNIT I FUNDAMENTALS & LINK LAYER

Building a network – Requirements - Layering and protocols - Internet Architecture – Network


Software – Performance; Link layer Services - Framing - Error Detection - Flow control

PART – A
1. What is mean by data communication? What are its characteristics?
Data communication is the exchange of data (in the form of 1s and 0s) between two devices via
some form of transmission medium (such as a wire cable).
Its characteristics are
1. Delivery
2. Accuracy
3. Timeless
2. Define Computer Network. State major categories of Computer Network.
1. A network is a connection or communication between two or more interconnected
systems.
2. A computer network consists of two or more systems that are linked in order to share
resources, exchange data files or to allow electronic communication.
Types of Network
1. Local Area Network (LAN)
2. Wide Area Network (WAN)
3. Metropolitan Area Network (MAN)
4. Storage Area Network (SAN)
3. Mention the Components of data communication?
1. Sender
2. Receiver
3. Protocol
4. Medium
5. Message
4. What are the Classes of Internet applications?
1. World wide web 2. Email 3.Online shopping network (OSN)
4. Streaming audio, video 5.File sharing 6.Instant message

5. List the difference between Packet switching and Circuit switching.


SL. Packet switching Circuit switching
NO

1. No physical connection between physical connection between sender and


sender and receiver. receiver.

2 All packets uses different path. All packets use same path.

3 No waste of bandwidth. Waste of bandwidth is possible.

4. Congestion occurs for per packet. Congestion occurs for per minute.

6. Define Multiplexing and De-Multiplexing and Different Methods of Multiplexing.


Multiplexing
Multiplexing is the process of transmitting more than one signal simultaneously on a
single path.
The different methods are,
1. Synchronous Time Division Multiplexing.(STDM)
2. Frequency Division Multiplexing.(FDM)
3. Statistical Multiplexing

De-Multiplexing
De-Multiplexing is used to perform De-Multiplexing, Which separates the signal and
send it to the appropriate destination device.
7. Difference between LAN and WAN.
SL.
LAN WAN
NO
1. It covers small area. It covers large geographical area.
2. Transmission speed is high. Transmission speed is low.
3 Easy to design and maintain. Design and maintain is not easy.
4. LAN is broadcasting in nature. WAN is point-to-point in nature.
8. Define Topology. What are the types of topology?
Topology is defined as “a geometrical arrangement of nodes or computer in a network”
Types – Bus , Mesh , Ring , Star and Tree Topology.
9. What parameters used to measure network performance?
1. Bandwidth (throughput)
2. Latency (delay)
10. Define bandwidth and latency or delay?
The bandwidth of a network is defined as the number of bits that can be transmitted
over the network in a certain period of time.
Latency is a measure of how long a single bit takes to propagate from one end of a link
to the other end. It is measured strictly in terms of time.
Latency = Propagation delay + Transmission delay + Queuing delay
11. What is jitter?
Jitter refers to the variation in the packet arrival time, that is, uneven delay in the delivery of
audio or video packets.

12. Define Socket and API?


Socket is interface between the application layers and transport layer.

API means Application programming interface. OS provides interfaces to its networking


subsystem. The interface is often called API.

13. What are the responsibilities of data link layer?


Specific responsibilities of data link layer include the following.
a) Framing
b) Physical addressing
c) Flow control
d) Error control
e) Access control

14. Define Framing and types of framing.


Framing in the data link layer separates a message from one source to a destination, or from other
messages to other destinations, by adding a sender address and a destination address
1. Variable Size Framing 2. Fixed Size Framing

I. Byte Oriented Protocol(PPP)

II. Bit Oriented Protocol (HDLC)

III. Clock-Based Framing (SONET)

15. Define Bit stuffing.


Bit stuffing is the process of adding one extra 0 Whenever they are s five consecutive 1’s in the data, so
that the receiver does not mistake the data for a flag. [01111110].
Ex: 0110111111111110010 → 011011111011111010010

16. Define error detection and correction.


Error Detection: Transmitting node set error-detection bits in the frame and having the receiving node
perform an error check.

Error Correction: Error correction in this similar to error detection, except that a receiver cannot only
detect whether errors have been introduced in the frame but can also determine exactly where in the
frame the errors have occurred.

17. Mention the types of errors.


There are 2 types of errors
a) Single bit error.
b) Burst bit error.

18. Define the Single bit error and Burst error.


a) Single bit error: The term single bit error means that only one bit of a given data unit (such as byte
character/data unit or packet) is changed from 1 to 0 or from 0 to 1.

b) Burst error: Means that 2 or more bits in the data unit have changed from 1 to 0 from 0 to 1.

19. Write short notes on CRC.


The third and most powerful of the redundancy checking techniques is the cyclic redundancy checks
(CRC) CRC is based on binary division. Here a sequence of redundant bits, called the CRC remainder is
appended to the end of data unit.

20. Write short notes on CRC generator and checker.


A CRC generator uses a modulo-2 division.
a) In the first step, the 4 bit divisor is subtracted from the first 4 bit of the dividend.
b) Each bit of the divisor is subtracted from the corresponding bit of the dividend without
disturbing the next higher bit.
CRC checker
A CRC checker functions exactly like a generator. After receiving the data appended with the CRC it
does the same modulo-2 division. If the remainder is all 0’s the CRC is dropped and the data accepted.
Otherwise, the received stream of bits is discarded and the dates are resent.

21. Define flow control and error control. Mention the categories of flow control.
Flow control refers to a set of procedures used to restrict the amount of data. The sender can send before
waiting for acknowledgment.
There are 2 methods have been developed to control flow of data across
communication links.

a) Stop and wait- send one from at a time.

b) Sliding window- send several frames at a time.

Error control is mechanism of retransmission of data by automatic repeat request (ARQ). Error control
involves both error detection and correction.

22. Define ARQ.


In Error control when an error is detected in an exchange, specified frames are retransmitted. This
process is called Automatic repeat request (ARQ).

23. Mention the function of go-back N-ARQ.


It is the popular mechanism for continuous transmission error control. In the method, if our frame is lost
or damaged, all frames sent since the last frame acknowledged are retransmitted.

24. Define the term Protocol and Layering.


Protocol is a set of rules that govern data communication.
A Layer is a collection of related functions that provides services to the layer above it and receives
services from the layer below it.

25. Define the transmission medium and types.


The term transmission modes are used to define the direction of signal flow between two linked devices.
1. Simplex ---------Only one direction.
2. Half-Duplex ----- Transmit and receive, but not at the same time.
3. Full-duplex----- Transmit and receive at the same time.

PART – B
1. With a neat diagram explain in detail about the Network architecture. (Or)
Draw the ISO-OSI reference model and explain the functionalities of each layer in
detail. (Or)
Compare and contrast ISO/OSI Layer and TCP reference model.

ISO-OSI reference model

 ISO defines a common way to connect computer by the architecture called Open System
Interconnection (OSI) architecture.

 Network functionality is divided into seven layers. They are

1. Physical Layer
2. Data Link Layer
3. Network Layer
4. Transport Layer
5. Session Layer
6. Presentation Layer
7. Application Layer

The OSI 7-layer Model

Functions of the Layers


I. Physical Layer

 The physical layer coordinates the functions required to transmit a bit stream over a physical
medium.

The physical layer is concerned with the following:

1. Physical characteristics of interfaces and media

 The physical layer defines the characteristics of the interface between the devices and the
transmission medium.

2. Representation of bits
 To transmit the stream of bits, it must be encoded to signals. The physical layer defines the type
of encoding.

3. Data Rate or Transmission rate


 The number of bits sent each second – is also defined by the physical layer.

4. Synchronization of bits
 The sender and receiver must be synchronized at the bit level. Their clocks must be synchronized.

5. Line Configuration
 In a point-to-point configuration, two devices are connected together through a dedicated link. In
a multipoint configuration, a link is shared between several devices.

6. Physical Topology
 The physical topology defines how devices are connected to make a network. Devices can be
connected using a mesh, bus, star or ring topology.

7. Transmission Mode
 The physical layer also defines the direction of transmission between two devices: simplex, half-
duplex or full-duplex.

II. Data Link Layer


 It is responsible for transmitting frames from one node to next node.

The other responsibilities of this layer are

1. Framing
 Divides the stream of bits received into data units called frames.

2. Physical addressing
 If frames are to be distributed to different systems on the n/w, data link layer adds a header to the
frame to define the sender and receiver.

3. Flow control
 If the rate at which the data are absorbed by the receiver is less than the rate produced in the
sender, the Data link layer imposes a flow control mechanism.

4. Error control
 Used for detecting and retransmitting damaged or lost frames and to prevent duplication of
frames. This is achieved through a trailer added at the end of the frame.

5. Access control
 Used to determine which device has control over the link at any given time.

III. Network Layer


 This layer is responsible for the delivery of packets from source to destination.
 It is mainly required, when it is necessary to send information from one network to another.

The other responsibilities of this layer are


1. Logical addressing
 If a packet passes the n/w boundary, we need another addressing system for source and
destination called logical address.

2. Routing
 The devices which connect various networks called routers are responsible for delivering packets
to final destination.

IV. Transport Layer


 It is responsible for Process to Process delivery.
 It also ensures whether the message arrives in order or not.

The other responsibilities of this layer are

1. Port addressing
 The header in this must therefore include a address called port address. This layer gets the entire
message to the correct process on that computer.

2. Segmentation and reassembly


 The message is divided into segments and each segment is assigned a sequence number. These
numbers are arranged correctly on the arrival side by this layer.

3. Connection control
 This can either be connectionless or connection oriented.
 The connectionless treats each segment as a individual packet and delivers to the destination. The
connection-oriented makes connection on the destination side before the delivery. After the
delivery the termination will be terminated.

4. Flow and error control


 Similar to data link layer, but process to process take place.

V. Session Layer
 This layer establishes, manages and terminates connections between applications.

The other responsibilities of this layer are

1. Dialog control
 This session allows two systems to enter into a dialog either in half duplex or full duplex.

2. Synchronization

 This allows adding checkpoints into a stream of data.

VI. Presentation Layer


 It is concerned with the syntax and semantics of information exchanged between two systems.
The other responsibilities of this layer are
1. Translation
 Different computers use different encoding system, this layer is responsible for interoperability
between these different encoding methods. It will change the message into some common format.

2. Encryption and decryption-


 It means that sender transforms the original information to another form and sends the resulting
message over the n/w. and vice versa.

3. Compression
 Compression reduces the number of bits contained in the information particularly in text, audio
and video.

VII Application Layer


 This layer enables the user to access the n/w. This allows the user to log on to remote user.

The other responsibilities of this layer are


1. FTAM (file transfer, access mgmt) - Allows user to access files in a remote host.
2. Mail services - Provides email forwarding and storage.
3. Directory services - Provides database sources to access information about various sources and
objects.

2. Explain in detail about the Internet Architecture, with suitable


diagrams.

Internet Architecture

 The Internet architecture, which is also sometimes called the TCP/IP architecture.
Internet Architecture

Application layer

Transport Layer(TCP/UDP)

Internet or Network Layer

Sub network

 The Internet architecture evolved out of experiences with an earlier packet-switched network
called the ARPANET.
 Both the Internet and the ARPANET were funded by the Advanced Research Projects Agency
(ARPA), one of the R&D funding agencies of the U.S. Department of Defense.
 They are four layer,
1.Application layer

2.Transport Layer(TCP/UDP)

3.Internet or Network Layer

4.Sub network

Internet Protocol Graph

I. Application Layer
 This layer enables the user to access the n/w. This allows the user to log on to remote user.

The other responsibilities of this layer are


1. FTAM (file transfer, access mgmt) - Allows user to access files in a remote host.
2. Mail services - Provides email forwarding and storage.
3. Directory services - Provides database sources to access information about various sources and
objects.

II Transport Layer (TCP/UDP)


 The third layer contains two main protocols—the Transmission Control Protocol (TCP) and the
User Datagram Protocol (UDP).
o TCP provides a reliable byte-stream channel, and UDP provides an unreliable datagram
delivery channel.
o In the language of the Internet, TCP and UDP are sometimes called end-to-end protocols,
though it is equally correct to refer to them as transport protocols.

III. Internet or Network Layer


 This layer consists of a single protocol—the Internet Protocol (IP). This is the protocol that
supports the interconnection of multiple networking technologies into a single, logical
internetwork.

IV. Sub network


 This layer is same as physical and data link layer of OSI Model.

3. List and discuss the various requirements in designing the network.


REQUIREMENTS

To build the computer networks, it is important to recognize the underlying concepts

1. Perspective

2. Scalable Connectivity

3. Cost Effective Resource Sharing

4. Categories Of Network

5. Support For Common Services

6. Manageablity

1. PERSPECTIVE

Perspectives of network by people who develop networked application and who manage or
operate network vary. They list their requirements for network as,

i) Application programmer
ii) Network provider
iii) Network designer

1. Application programmer:

 Specify List the services.

2. Network provider:
 List the properties of a cost-effective design.

3. Network designer:

 List the characteristics of a system that is easy to administer and manage.

2. SCALABLE CONNECTIVITY

A system that is designed to grow to large size is said to scale,

i) Links
ii) Nodes
iii) Switched networks

1. Links:

A network consists of two or more computers directly connected by some physical medium .such
as a coaxial cable or an optical fiber. Such a physical medium is called as links. They are two types,

i) Point to point
ii) Multipoint

Point to point

 Point to point provides dedicated link between two devices.

Node Node
Multipoint

 More than two specific devices share a single link. The channel is shared by several devices.

Nodes

2. Nodes:

o The links are connected to the computers named nodes.

3. Switched networks:

o Computers can be indirectly connected through switched networks.

o Two types of switched networks, They are

i) Packet switched networks


 Packet switching is transmission method in which packets are transmitted over a
networking medium that maintains several paths between sender and receiver.
ii) Circuit switched networks
 In circuit switching, this path is decided upon before the data transmission starts.
The system decides on which route to follow, based on a resource-optimizing
algorithm.

3.COST EFFECTIVE RESOURCE SHARING

 Multiplexing

 De-multiplexing

Multiplexing
Multiplexing is the process of transmitting more than one signal simultaneously on a
single path.

The different methods are,


1. Synchronous Time Division Multiplexing.(STDM)
2. Frequency Division Multiplexing.(FDM)
3. Statistical Multiplexing.

1.Synchronous time division multiplexing:


Each flow gets a equal-sized time quanta to send its data over physical link.

2.Frequency division multiplexing:

Each flow is transmitted over different frequencies.

3.Statistical multiplexing:

It defines the cost effective way for multiple users to share network resource,

i) Data transmitted on demand rather than in predetermined time slot.


ii) Data transmitted as packets, the host fragments the message into several and the
receiver reassembles the packets into the original message.
iii) If more than one hosts need to send packets over a link, switches decide the order
in which packets are transmitted.

De-Multiplexing
De-Multiplexing is used to perform De-Multiplexing, Which separates the signal and
send it to the appropriate destination device.

4. CATEGORIES OF NETWORK

The four primary categories of network are:

i) LAN – Local Area Network.


ii) MAN- Metropolitan Area Network
iii) WAN-Wide Area Network
iv) SAN-Storage Area Network

1.LAN – Local Area Network:

 LAN connects networks devices over short distance.


 LAN are owned, controlled and managed by single person or organization.
 LAN allows sharing of resource in the network like printer, software etc…
 LAN topologies:bus,ring,star.
 Connectivity technology used: Ethernet, Token Ring.
 Eg: In school and College, with a building.
2.MAN- Metropolitan Area Network:

 MAN is owned by a private company or it may be service provided by public.


 MAN connects several LAN together.
 It is designed to extend over an entire city.
 Eg: Branches of a particular bank with in a city connected.

3.WAN-Wide Area Network:

 A WAN is a data communication system spanning states, countries or the whole


world.
 Private owned WAN is called enterprise network.
4.SAN-Storage Area Network:

 SAN is confined to a single room.


 Connects the various components of large computing system, such as disk arrays and
services.

5. SUPPORT FOR COMMON SERVICES

 Request / Reply

 Message stream channel

 Reliability

Request/ Reply:

 Used by the transfer and original library application.


 Guarantee the delivery of the message.
 Protect privacy and integrity of data.

Application-to-Application communication path


Message stream channel:

 Used by video on demand and video conferencing application.


 Support one way, two way traffic and support different delay properties.
 Ensure that the message arrive in the same order in which they are send.
 Ensure privacy and integrity.
 Support multicast.

Reliability:

 Failure in network are caused by physical medium or by software that manages the
hardware.
 Three general classes of failure:
i) Bit error
ii) Packet error
iii) Node and link level

6. MANAGEABLITY

When network grows, keeping the whole network running correctly and configuring new
devices can be problematic. Management tasks can be automated or can be done by unskilled
personal. Network devices can be plug_and_play.

4. Explain the different approaches of framing in detail.

Framing
 Framing in the data link layer separates a message from one source to a destination, or
from other messages to other destinations, by adding a sender address and a destination
address.

Bits flow between adaptors, frames between hosts

Types of Framing

1. Variable Size Framing 2. Fixed Size Framing


I. Byte Oriented Protocol

II. Bit Oriented Protocol (HDLC)

III. Clock-Based Framing (SONET)

I. Byte Oriented Protocol

 This is the oldest approach to framing.

 To view each frame as a collection of bytes (characters) rather than bits.

 They are Three Approaches, they are

1.Sentinel Based Approach(BISYNC)

2.Point-to-Point Protocol(PPP)

3.Byte Counting Approach(DDCMP)

1. Sentinel Based Approach (BISYNC)

 BISYNC means Binary Synchronous Communication Protocol.

BISYNC Frame Format

 Frames transmitted beginning with leftmost field.

 Beginning is marked with a special synchronize character (SYN).

 Data portion of the frame is contained between special sentinel character STX (start of
text) and ETX (end of text)

 SOH is a Start of Header

 DLE is a Data Link Escape

 CRC is the error detection technique used.

 If ETX appears in data, Escape ETX with a DLE. This is called as Character stuffing.

2. Point-to-Point Protocol(PPP)
 This uses sentinels and character stuffing.

PPP Frame Format

 Flag denotes the start and end of character 01111110.

 The Address and Control fields usually contain default values.

 The Protocol field is used for demultiplexing.

 The frame payload size can he negotiated, but it is 1500 bytes by default.

 Checksum is the error detection technique used.

3. Byte Counting Approach(DDCMP)

 DDCMP protocol is used for this approach. The frame format is

 The number of frames in the frame can be included in the header.

 Count Field specifies how many bytes are contained in the frame’s body.

 Sometime count field will be corrupted during transmission, so the receiver will
accumulate as many bytes as the COUNT field indicates. This is sometimes called a
framing error.

 The receiver will then wait until it sees the next SYN character.

II. Bit Oriented Protocol (HDLC)


 HDLC means High Level Data Control.

 In this, frames are viewed as collection of bits. High level data link protocol is used. The
format is
 HDLC denotes both the beginning and the end of a frame with the distinguished bit
sequence 01111110.

 This sequence might appear anywhere in the body of the frame, it can be avoided by bit
stuffing.

 Bit stuffing is the process of adding one extra 0 Whenever they are s five consecutive
1’s in the data, so that the receiver does not mistake the data for a flag. [01111110].

 Example

011011111111111111110010

011011111011111011111010010

III.Clock-Based Framing (SONET)


 Synchronous Optical Network Standard is used for long distance transmission of data
over optical network.

 A form of framing that ensures that all frames are the same size.

 SONET is used for digital transmission over optical fiber.

 An STS-1 frame is used in this method.

 It is arranged as nine rows of 90 bytes each, and the first 3 bytes of each row are
overhead, with the rest being available for data.

 The first 2 bytes of the frame contain a special bit pattern, and it is these bytes that
enable the receiver to determine where the frame starts.
 The receiver looks for the special bit pattern consistently, once in every 810 bytes, since
each frame is 9 x 90 = 810 bytes long.

 The STS-N frame can he thought of as consisting of N STS-1 frames, where the bytes
from these frames are interleaved; that is, a byte from the first frame is transmitted,
then a byte from the second frame is transmitted, and so on.

 Payload from these STS-1 frames can he linked together to form a larger STS-N payload,
such a link is denoted STS-Nc. One of the bit in overhead is used for this purpose.

 One of the things we are not describing due to the complexity of SONET is the detailed
use of all the other overhead bytes.

 The overhead bytes of a SONET frame are encoded using NRZ,this is the simple encoding
where 1s are high and 0s are low.

SONET frames out of phase

5.Explain in detail the error detection and error corrections.

Error Detection
 Transmitting node set error-detection bits in the frame and having the receiving node perform an
error check.
Types of errors
 There are 2 types of errors
a) Single bit error. b) Burst bit error.
a) Single bit error
The term single bit error means that only one bit of a given data unit (such as byte character/data
unit or packet) is changed from 1 to 0 or from 0 to 1.
b) Burst error
Means that 2 or more bits in the data unit have changed from 1 to 0 from 0 to 1.

Detection
 In the error checking process the errors are detected first and then errors are corrected.

Redundancy
o Error detection uses the concept of redundancy, which means adding extra bits
for detecting errors at the destination.

Detection Methods
Detection Methods

Two-Dimensional Parity Internet Checksum Cyclic Redundancy Check ( CRC)

1.Two-Dimensional Parity Check


 It is also called as the Longitudinal redundancy check (LRC).

 Block of bits is organized in a table of rows and columns.

 Calculate even parity for each data unit (row wise).

 Calculate parity for each column.

 Attach a parity bits calculated in the step 3 to the original data and send them to the receiver.
Performance
 Two-Dimensional Parity Checks increases the likelihood of detecting burst errors.
 A burst errors of more than n bit is also detected by this method.

2. Internet Checksum Algorithm

Sender

 Add up all the words that are transmitted and then transmit the result of that sum .The result is
called the checksum.
Receiver
 The receiver performs the same calculation on the received data and compares the result with the
received checksum.
 If any transmitted data, including the checksum itself, is corrupted, then the results will not
match, so the receiver knows that an error occurred.

Internet Checksum Procedure


 Uses 1’s complement addition.
 Negative member –X is X with all bits received.
 When 2 bits is added the carry on is added to the result.

Algorithm
u_short
cksum(u_short *buf, int count)
{
register u_long sum = 0;
while (count--)
{
sum += *buf++;
if (sum & 0xFFFF0000)
{
/* carry occurred,so wrap around */
sum &= 0xFFFF;
sum++;
}
}
return ˜ (sum & 0xFFFF);
}
Disadvantages
 Doesn’t detect errors efficiently in all cases.
Examples
Addition of -5(0101) and -3(0011) in 1’s complement arithmetic on 4 bit integers.
-5 1010
-3 1100
-------
Carry<- 1 0110  Result
Add carry with result
0110
1
--------
sum 0111 is -8
-------
Sum is complemented and 1000 is the checksum.

3. Cyclic Redundancy Check ( CRC)


 CRC is the most powerful redundancy checking techniques, is based in binary division.
 A sequence of redundant bits called CRC or CRC reminder is appended to the end of the data
unit. CRC reminder is derived by dividing data unit by a predetermined divisor.
 At its destination the received data unit is divided by the same number.
 If the reminder obtained after the division zero, then the data is correct and it is accepted.
Otherwise the data is rejected as it is damaged.
 Two qualities of CRC,
 It must have exactly one bit less then the divisor.
 Data string appended with CRC must be exactly divisible by the divisor.fs

CRC generator and Checker

Sender
Step1: A string of n 0s is appended to the data unit. The number of n is 1 less then the
number of bits in the predetermined divisor (n+1) bits.
Step2: The newly elongated data unit is divided by the divisor, using binary division.
The reminder is CRC.
Step3: The CRC of n bits derived in step2 replaces the appended 0s at the end of the data
unit.

Receiver
Step1: The appended data unit is arrived at the receiver.
Step2: It is divided by the same divisor. If the remainder is zero, the data is accepted, if
non zero then data is rejected.

I.The CRC generator


 The CRC generator uses modulo-2 division (repeated subtraction).
 Example : Divisor - 1001 Dividend – 1010000 -> Original Message

II.The CRC checker


 The CRC checker functions as the generator. After receiving the data, appended with CRC, it
does not same modulo 2 division.
 If the reminder is all 0’s the CRC is dropped and data are accepted otherwise the received stream
of bits is discarded and data are resent.
Polynomials
 The divisor in CRC generator is represented as an algebraic polynomial.
 A polynomial should have the following properties,
o It should not be divisible by x.
o It should be divisible by x+1.
 Standard Polynomials
o CRC-8 = x8+x2+x+1
o CRC-10 = x10+x9+x5+x4+x+1
o CRC-12 = x12+x11+x3+x2+x+1
o CRC-16 = x16+x15+x2+1
o CRC-32 = x32+x26+x23+x22+x16+x12+x11+x10+x8+x7+x5+x4+x2+x+1
Performance
 CRC detects all burst errors that affect an odd number of bits.
 CRC detects all burst errors of length less than or equal to the degree of the polynomial.
 CRC can detect burst errors of length greater than the degree of the polynomial

Error Correction
 Error correction in this similar to error detection, except that a receiver cannot only detect
whether errors have been introduced in the frame but can also determine exactly where in the
frame the errors have occurred.
 The two most common error correction methods are.
o Error Correction by Retransmission.
o Forwarded Error Correction (FEC).
6.Write in detail about Flow control mechanism.(or)
Compare Stop and wait ARQ scheme with Sliding window ARQ
scheme. (or)
Discuss in detail about Sliding window protocol in detail. (or)
Explain the techniques of Go Back N with ARQ mechanism.
Flow control
 Flow control refers to a set of procedures used to restrict the amount of data. The sender can send
before waiting for acknowledgment.

Error control
 Error control is mechanism of retransmission of data by automatic repeat request (ARQ). Error
control involves both error detection and correction.

ARQ
 In Error control when an error is detected in an exchange, specified frames are retransmitted.
This process is called Automatic repeat request (ARQ).
 Error control in the data link layer is based on ARQ, which means retransmission of data will
occur on three cases,
 Normal Operation
 Damaged or Lost Frame
 Lost Acknowledgment
 Two type of ARQ

1. Stop and wait protocol- send one from at a time.

2. Sliding window protocol- send several frames at a


time.
a. Go-Back-N ARQ
b. Selective Repeat ARQ
1. Stop and wait protocol
 In Stop-and-Wait ARQ we use sequence numbers to number the frames. The
sequence numbers are based on modul0-2 arithmetic.
Step1:
 The data frames are numbered alternatively as 0 and 1’s.
 The data frame 0 is acknowledged by acknowledged (ack) 1.
Step2:
 The sender has a control variable ‘S’ that holds the number of recently sent frame.
 The receiver has a control variable ‘R’ that holds the number of next sent frame expected by the
receiver.
Step3:
 The sending device holds a copy of the frame transmitted.
 If the ack is received, the copy is deleted.
 Otherwise the copy is used for retransmission.
Step4:
 The sender starts a timer when it sends a frame. If the acknowledgment is not received in the
specified time, the frame is retransmitted.
 If the ack is received within specified time, the next frame is sent and it timer is started.
Step5:
 The receiver sends an ack for the frames that are received correctly.
 If the frames received, are damaged or the frames are lost in transmission then the receiver does
not sends any ack. So when the timer expires, the sender understands that the receiver does not
receive the frame and it retransmits the frame.

1. Normal operation
 The frames 0 is sent successfully.
 The ack 1 is sent back by the receiver to the sender.
 The sender sends the next frame, frame 1 and waits for ack 0 and so on.
 All the frames are sent successfully and ack are received before the time expires.
2.Lost or Damaged Frame
 If the frame sent, is lost in the transmission, then the ack is not sent for that frame.
 If the frame is received with error then the frame is discarded and ack is not sent for that frame
when the timer expires the sender retransmit the lost/damaged frame.

3.Lost Acknowledgment
 If the ack is lost, then the sender waits for the specified time and assumes that the frame is not
received by the receiver successfully. So it retransmits the data frame.
 The receiver has already received the frame which is retransmitted. So the receiver discards the
second copy of the frame and it sends the ack for that frame.
Disadvantages
 The sender waits for more time till it receives the ack for each frame.
 The transmission medium is not efficiently utilized.
 The time taken for sending “n” frame is more.

2.Sliding window protocol


 In the sliding window method of flow control, the sender can transmit several frames before
an acknowledgment.
 They are two methods,
1.Go-Back-N ARQ
2.Selective Repeat ARQ

Sender
 First, the sender assigns a sequence number, denoted SeqNum, to each frame.

 The sender maintains three variables:


o The send window size, denoted SWS,gives the upper bound on the number of
outstanding (unacknowledged) frames that the sender can transmit;
o LAR denotes the sequence number of the last acknowledgment received;
o LFS denotes the sequence number of the last frame sent.
 The sender also maintains the following invariant:
LFS − LAR ≤ SWS

 When an acknowledgment arrives, the sender moves LAR to the right, thereby allowing the
sender to transmit another frame. Also, the sender associates a timer with each frame it transmits,
and it retransmits the frame should the timer expire before an ACK is received.

 The receiver maintains three variables:


o The receive window size, denoted RWS, gives the upper bound on the number of
out-of-order frames that the receiver is willing to accept;
o LAF denotes the sequence number of the largest acceptable frame;
o LFR denotes the sequence number of the last frame received.
 The receiver also maintains the following invariant:
LAF − LFR ≤ RWS

 When a frame with sequence number SeqNum arrives, the receiver takes the following action.
 If SeqNum ≤ LFR or SeqNum > LAF, then the frame is outside the receivers window and it is
discarded.
 If LFR < SeqNum ≤ LAF, then the frame is within the receivers window and it is accepted.
 Now the receiver needs to decide whether or not to send an ACK.
 Let SeqNumToAck denote the largest sequence number not yet acknowledged, such that all
frames with sequence numbers less than or equal to SeqNumToAck have been received.
 The receiver acknowledges the receipt of SeqNumToAck, even if higher-numbered packets have
been received.
 This acknowledgment is said to be cumulative. It then sets LFR = SeqNumToAckand adjusts
LAF = LFR + RWS.

1.Go-Back-N ARQ
In the Go-back-n ARQ technique of error detection and correction, the sender starts
retransmission with the last unacknowledged frame, even if the subsequent frames have arrived
correctly at the receiver.

Features of Go-Back-N ARQ


1.Sequence number:
 Sequence number of transmitted frame is maintained in the header of each frame.
2.Sender Sliding window:
 Window is a set of frames in buffer waiting for ack. This window keeps on sliding in forward
direction. The window size is fixed.
3.Receiver Sliding window:
 In the receiver side the size of the window is always one. The receiver to arrive frames in
sequence.
4.Timers:
 The sender has a timer for each transmitted frame. The receivers don’t have any timer.

Operation
1. Normal operation
 The sender frames and update the control variable ie. SF, S, SL and receiver updates variable R
shows normal operation.
2.Lost or Damaged Frame
 If any frame is lost or damaged the sender sends the next frame sequentially. The receiver
expecting a specified frame (lost frame) discards all other incoming frame. The sender timer
expires and it retransmits from the lost frame.

3.Lost Acknowledgment
 The frame is resend if the ack doesn’t reach the sender at time or lost or damaged if the previous
ack are lost but the cumulative ack reaches the sender, then there is no need for retransmission.

2.Selective Repeat ARQ

In Selective Repeat ARQ retransmits, only the specify damaged or lost frame instead of sending
multiple frames.
Features of Selective Repeat ARQ
1. Sender Sliding window:
 Window is a set of frames in buffer waiting for ack. This window keeps on sliding in forward
direction. The window size is fixed 2m/2.
2.Receiver Sliding window:
 In the receiver side the size of the window is same as the sender window size.
 After the frame is received successfully they receiver sends an ack to the sender.
 The receiver window sides to its right side if the frame is received successfully.

Operation
1. Normal operation
 Sender sends the frame in the window one by one. After the ack is received the sender window
slides to its right.
2.Lost or Damaged Frame
 If frame 2 is lost, frame 3 is sent by the sender sequentially.
 The receiver accepts frame 3 if frame 3 is in receiver window and sends and NAK 2 to sender
requesting for the retransmission of frame 2.
3.Lost Acknowledgment
 The sender sets a timer when a frame is sent. If NAK or ack is not received in the specified time
the sender retransmit the frame.
4.Negative Acknowledgment
 If the frame is damaged or lost the receiver sends on NAK to the sender so that the sender
retransmit the lost or damaged frame.

Advantages
 Fewer retransmissions.
Disadvantages
 More complexity at sender and receiver.
 No cumulative ack.

You might also like