UNIT_1COMPUTER_NETWORKS - e

Networking is a process connecting computers by means of wireless or wire. The main
objective is to share information and resources from one computer to another computer.
Network Architecture:
The network architecture deals about characteristic of a computer network. The most
prominent architecture today is based on the Internet Protocol Suite.
It is a specification of a network's physical components and their functional organization
and configuration, its operational principles and procedures, as well as data formats used
in its operation.
It consists of two types of networking models
OSI networking model
TCP/IP networking model
OSI networking model Developed by (ISO) International Organization for
standardization as a framework for developing protocol standards.
The O.S.I. model (O.S.I. - Open System Interconnection) is a way of subdividing a System into smaller parts (called layers) from the point of view of
communication. [Layer is nothing but a collection of conceptually similar functions that
provide services to the layer above it and receives services from the layer below it.]
Its layers are Application, presentation, session, transport, network, data link,
physical layer
Layer 1: Physical Layer: This layer defines the means of transmitting raw bits
over a physical link connecting the network nodes. Defines the electrical and physical
specifications for devices. It covers the physical interface between the devices and the
rules by which bits are passed from one to another. This includes the layout of pins,
voltages, cable specifications, hubs, repeaters, network adapters etc.
The major functions and services performed by the Physical Layer are:


Establishment and termination of a connection
Specifies the sequence of the events by which bit streams are exchanges across
the physical medium.
Layer 2: Data Link Layer: This layer provides the functional and procedural means
to transfer raw bit stream [1and 0s] between network entities. The principal service of
the layer is error detection and control.
Functions are: 1Takes the raw bits [0 and 1] from the physical layer and transforms
into error free data frames and pass it to the network layer. 2 It provides a mechanism
to detect transmission error and recover from it.
Layer 3: Network Layer: This layer provides the functional and procedural means
of transferring variable length data sequences from a source to a destination via one
or more networks, while maintaining the quality of service requested by the Transport
Layer. Functions are It performs network routing functions, and also performs
fragmentation and reassembling, and report delivery errors. Routers operate at this
layer—sending data throughout the extended network and making the Internet
possible.
Layer 4: Transport Layer: This layer provides a mechanism for transparent transfer
of data between end users. The most popular type of transport connection is
connection oriented approach. This approach ensures that the data are delivered error-
free, with no loss or duplication and enhances quality of the service to session
entities. It controls reliability of a given link through flow control, segmentation/desegmentation, and error control.
Functions are: 1 It accepts the data and splits it into smaller units and pass it to the
network layer. 2 It checks whether all the pieces are arrived at the destination.3 It
provides connection oriented and connection-less transport service mechanism for
the exchange of data between the end systems. Oriented-> ensures that data are
delivered error-free with no loss or duplication. connection-less -> ensures loss of
data.
Layer 5: Session Layer: This layer controls the connections between computers. It
establishes, manages and terminates the connections between the local and remote
application. It provides for full-duplex, half-duplex, or simplex operation, and
establishes check-pointing, termination, and restart procedures. Services are
Recovery Provides a check pointing mechanism so that if failure occurs between the
check points the session entity retransmit all data since last checkpoint. Grouping
The flow of the data is marked to define groups of data (ex) if retail store is
transmitting a sales report, the data can be marked to indicate the end of sales to
finalize running total and to start the new count.
Layer 6: Presentation Layer: This layer defines the format of data to be exchanged
between the applications. This layer works to transform data into the form that the
application layer can accept. This layer formats and encrypts data to be sent across a
network, providing freedom from compatibility problems. It is sometimes called as a
syntax layer.
Application Layer: This layer provides a means for application programs to access
the OSI environment. It contains management functions and mechanisms to support
applications such as file transfer, electronic mail and etc.
TCP/IP networking model
This model describes a set of general design guidelines and implementations to
enable computers to communicate over a network. TCP/IP provides end-to-end
connectivity specifying how data should be formatted, addressed, transmitted, routed and
received at the destination.
Layers are: Application, transport, internet and host to network [physical and data
link]
Application Layer: Refers to the higher-level protocols used by most applications for
network communication Data coded according to application layer protocols are
encapsulated into one or (occasionally) more transport layer protocols (such as the
Transmission Control Protocol (TCP) or User Datagram Protocol (UDP)), which in turn
use lower layer protocols to effect actual data transfer. Contains number of service
Like FTP file transfer protocol to transfer data efficiently
DNS to map host names on their network address.
HTTP to fetch pages on WWW
Transport Layer: This layer include end-to-end message transfer capabilities along with
error control, segmentation, flow control, congestion control, and application addressing
(port numbers). End to end message transmission is categorized as either connectionoriented, implemented in Transmission Control Protocol (TCP), or connectionless,
implemented in User Datagram Protocol (UDP).
TCP This protocol divides the sender information into discrete message packets. Then it
delivers it to the receiver in the internet using physical connection between them. AT
THE RECEIVER SIDE it reassembles the received message packets into original data.
And also controls the data flow between the sender and the receiver.
UDP This protocol divides the sender information into discrete message packets. Then it
delivers it to the receiver in the internet without any physical connection between them.
So there is no guarantee that the receiver receives the sent by the sender.
Internet Layer: It solves the problem of sending packets across one or more networks.
Internetworking requires sending data from the source network to the destination
network. This process is called routing. Functions are
Defines an official packet format for the data to be sent—delivers the IP packets from the
source to the destination—finds the shortest path from the sender to the receiver—control
the congestion of packets in the internet.
Host to network [link layer]: This layer is responsible for establishing connection
(activating maintaining and deactivating the circuit) between the sender and receiver. It is
used to move packets between the Internet Layer interfaces of two different hosts on the
same link.
Physical links====================================================
The purpose of the physical layer is to transport raw bit stream from one system to
another through a transmission media or medium (physical path between the sender and
the receiver). This media is divided into guided and unguided transmission medium.
Guided media: provides a physical path along which the electro- magnetic wave signals
are propagated. These include twisted pair Co-axial cable Optical fiber. Unguided
media uses an antenna for transmitting through air, vacuum or water.
Twisted pair cable This is the least expensive and most commonly used transmission
medium.
Physical description: This consists of two insulated copper wires arranged in a regular
pattern that is in a heliacal form (DNA molecule) to avoid radiation, reduce the crosstalk
interference between the adjacent pairs of the cable. Used for transmitting either analog
or digital signals while the band width depends upon the thickness of the wire.
Varieties category3 capable of handling bandwidth of
16mhz category5 capable of handling bandwidth of 100mhz, category6 capable of
handling bandwidth of 250mhz and category7 capable of handling bandwidth of 700mhz.
Types shielded and unshielded. The above mentioned types comes under unshielded
disadvantages with this type is subject to electro-magnetic interference. A way to avoid
this is to employ the shielded type which provides better performance at higher data rates.
Co-axial cable: This consists of two conductors similar to the twisted pair, but
constructed differently to permit it to operate over a wide range of frequencies. It consists
of a stiff copper wire surrounded by an insulating material. The insulator is encased by a
cylindrical conductor often referred to as braided mesh. This conductor is covered by a
protective sheath. The bandwidth depends upon the cable quality, length and signal-tonoise ratio of the data signal. Widely used in television and metropolitan area network.
Varieties 50 ohms for digital transmission and 75 ohms for analog transmission or cable-
television broadcast.
Advantage: transmits fast, less interference. Dis: Needs booster or repeaters for every
few kilometers. Heavy and bulky
Optical fiber: Consists of thin glass fiber that can carry information at frequencies in the
visible light spectrum and beyond. Typically it consists of very narrow strand of glass
called core. Around the core is the concentric layer of glass called the cladding of
diameter ranging from 125 micron. The outer cladding is covered by plastic or the
protective jacket. The light gets refracted when the radius of the core is larger and there
comes the chance that the light might escape now the cladding acts as a protective layer
to the light from escaping. In-order to avoid this situation the radius of the core is reduced
to allow only one single ray to pass through it for achieving long distance transmission
without any loss of data. Light emitting diode (LED) is used as a light source due to its
operation life and longer life.
Advantage: cannot tap into the cable, any corrosion, long distance, fast transmission rate.
Disadvantage: Difficult to split, physical vibration shows as noise signal.
Channel access on links and Hybrid multiple accesses===========Most common
feature of these methods is to allow single communication channel or physical medium to
be shared by a large number of the users seeking to communicate with each other along
with their resources through the use of disjoint in time, frequency and space.
FDMA Frequency Division Multiple Access FDMA is implemented at the media
access control (MAC) layer of the data-link layer in the Open Systems Interconnection
(OSI) reference model for networking protocol stacks. FDMA is based on the frequencydivision multiplexing (FDM) technique in which each and every user is assigned a
specific frequency band on a continuous- time basis.
In-order to reduce the interference between the adjacent frequencies guard bands is used.
These guard bands acts as buffer zones. Two different frequency bands are used to allow
full-duplex communication between base and mobile stations. Both of these bands are
then divided into discrete channels that are 30 kHz wide in
bandwidth.
Example
One way to understand FDMA is to imagine different people in the same room
communicating in voices with different pitches, some high and some low; they would all
be able to talk simultaneously and (more or less) understand one another. This is similar
to the way FDMA works. FDMA is used by traditional AM and FM radio bands to allow
broadcast by individual stations.
TDMA Time division multiple access It allows several users to share the same channel
by dividing the signal into different time slots. The users transmit in rapid succession, one
after the other, each using their own time slot. This allows multiple stations to share the
same transmission medium (e.g. radio frequency channel) while using only a part of its
channel capacity. Time guards (Time bands) are inserted between the assigned time slots
to reduce the interference between the users.
TDMA is used in the digital 2G cellular systems such as Global System for Mobile
Communications (GSM), IS-136, Personal Digital Cellular (PDC) and in the Digital
Enhanced Cordless Telecommunications (DECT) standard for portable phones. It is also
used extensively in satellite systems, and combat-net radio systems.
Example Each cellular user is assigned the time slices with a given number and transmits
information only for the duration of his or her time segments using the TDMA scheme.
CDMA Code Division Multiple Access CDMA combines voice and data into a single
digital transmission at 9.6 Kbps. In this frequency hoping technique is utilized to ensure
that frequency bands assigned to the users are re-ordered in random manner. During the
time slot 1, user1 occupies frequency band 1, user2 occupies band 2, and user 3 occupies
band 3 and so on. During the time slot 2 user1 hops to frequency band 3, user2 to band 1,
and user 3 to band 2.
SDMA Spatial Division Multiple Access In this method multi-band antennas are used
to separate the radio signals from the radio station by pointing them along different
directions. The SDMA allows a station to transmit (or receive) signal (i.e., at least one
data stream) to (or from) multiple users in a same bandwidth and time simultaneously,
via a plurality of antennas. The signals get beam-formed at the base station (BS) that is
directing the signals on transmitter/receivers with multiple antennas such as 802.11n
access points. The beam-forming, which improves transmission speed, is accomplished
by detecting the signals and sending feedback to the transmitter or the BS, which can
adjust the phase and amplitude of the signals at its antennas. Thus different users are
enabled to access the channel simultaneously on the same frequency or in the same time
slot.
The SDMA technology increases the data rate and total capacity of wireless
communication systems by using radio resources (i.e., frequency bandwidths, time, etc.)
more effectively.
===============================================================
Framing
===============================================================
Framing, a function of the Data link layer, breaks the raw data or the bit stream sent
during point-to-point connection between two computers or devices into chunks or
frames (that is different blocks of information) and computes checksum for each frame to
validate the frame.
There are three different types of framing, each of which provides a way for the sender to
tell the receiver where the block of data begins and ends:
Byte-oriented framing
Bit-oriented framing
Clock-based framing
Byte-oriented framing
It is an older style of framing that was used in the terminal/mainframe environment.
Examples of byte-oriented framing include IBM's binary synchronous communication
(BISYNC) protocol.
Syn represents synchronization character etx end of the text
Soh start of the header
crc checksum
Stx start of the text
This protocol uses sentinel characters (syn) to indicate the start and end of the frames.
The data portion of the frame is provided between the special characters such as (stx and
etx) while the header is also provided with start of the header character. Main problem
with this approach is that the etx character appears along with the data in-order to over
come this problem the bisync approach places a special character called data link escape
(DLE) character in the front of the etx character. The above technique is other wise
termed as character stuffing.
Byte-counting approach this approach is used by the Digital data communications
message protocols (DDCMP) protocol. IN this approach a special count field is used to
specify the number of the bytes contained in the frame.
Disadvantage of this approach is that when the transmission error occurs it could corrupt
the count field due to this end of the frame is difficult to be detected which in turn makes
difficult to detect the start of the next frame.
Bit-oriented framing
This type of framing allows the sender to transmit a long string of bits at one time. IBM's
SDLC (Synchronous Data Link Control) and HDLC (High-level Data Link Control)
are examples of bit-oriented protocols. Most LANs use bit-oriented framing. The
beginning and end of a frame is signaled with a special bit sequence or a flag byte
(01111110) that is if five one’s are en-counted in the data it automatically assigns a zero
bit in the start and the end of the text to indicate the start and end of the data.
With this boundary between the frames is recognized by the flag pattern. Thus if the
receiver looses track of the data all is to do is that to scan for the flag bits since they
occurs only at the boundaries and not within the data.
Clock-based framing this approach is utilized in SONET: Synchronous Optical
Network. This addresses both framing and encoding problems
This provides the indication about the start and end of the data without involving bit
stuffing.
First two bytes of each frame contain a special bit pattern that
Allows determining where the frame starts
� No bit-stuffing is used
� Receiver looks for the special bit pattern every 810 bytes
Size of frame = 9x90 = 810 bytes
===============================================================
===============================================================
Error-detection and correction
============================================================
Error detection and correction or error control provides reliable transmission of
digital data over unreliable communication channels by detecting errors such as channel
noise, and reconstructing the original data.
The transmission of data is divided into two types they are
Synchronous transmission
Synchronous Transmission sends packets of characters at a particular time. Each packet
is preceded by a Start Frame which is used to tell the receiving station that a new packet
of characters is arriving. The packets also have End Frames to indicate the end of the
packet. The packet can contain up to 64,000 bits depending on the protocol.
Asynchronous transmission
The term asynchronous is usually used to describe communications in which data can be
transmitted irregularly rather than in a steady stream. For example, a telephone
conversation is asynchronous because both parties can talk whenever they like. If the
communication were synchronous, each party would be required to wait a specified interval
before speaking.
The difficulty with asynchronous communications is that the receiver must have a way to
distinguish between valid data and noise. In computer communications, this is usually
accomplished through a special start bit and stop bit at the beginning and end of each piece
of data. For this reason, asynchronous communication is sometimes called start-stop
transmission.
The general idea for achieving error detection and correction is to add some redundancy
(i.e., some extra data) to a message, which receivers can use to check consistency of the
delivered message, and to recover data determined to be erroneous.
Types of errors Single-bit ----only a single byte or the character in the data has been
changed.
Burst----If two or more bits are changed it falls in burst error.
Error detection
Detection is done by adding some redundancy bit (i.e., some extra data) to a message,
which receivers can use to check consistency of the delivered message. It is discarded as
soon as the accuracy is regained.
Detection methods
Parity check
CRC
Checksum
Single
two dimensional
[Vertical
[LONGITUDINAL
Redundancy VRC]
Redundancy LRC]
VRC: The simplest form of error detection is single parity bit. Suppose the information
[D] to be sent has d bits. The information is passed to the parity generator in the
transmitter section to select the appropriate checking scheme like [even parity or odd
parity]. In an even parity scheme the transmitter simply appends the number 1 such that
the total number of the ones in the information D of d+1bits long becomes even. And the
transmitter performs the same for odd parity scheme such that there is odd number of
ones. Receiver operation is simple as to only count the total number of the ones based on
the type of the parity scheme being selected. If the even parity scheme is followed the
receiver puts the received bits into the even parity checking function, if the count returns
even the number is accepted else rejected or send negative acknowledgement for
retransmission.
LRC: In this method the information [D] is organized or arranged in the table format that
is in rows and columns format.
1. Divide the information D into i rows and j columns.
2. A parity bit value is calculated for each and every row and columns. And create a new
row of i+j+1parity bits.
3. The resulting row and column is appended along with the data and transmitted.
4. Suppose if a single bit error occurs in the data the parity of the respective row and
column will be damaged or changed to indicate the occurrence of the error.
5. Now the receiver could easily detect the location of the error to correct it.
Example:
CRC cyclic redundancy check:
This is the most powerful redundancy checking function and widely used error detection
technique. This is otherwise called as POLYNOMIAL CODES. CRC is based on
modulo 2 arithmetic calculations [binary division].
A cyclic redundancy check (CRC) is a single-burst-error-detecting cyclic code and nonsecure hash function designed to detect accidental changes to digital data in computer
networks. It is characterized by specification of a so-called generator polynomial, which
is used as the divisor in a polynomial long division, taking the input data as the dividend,
and where the remainder becomes the resultant value to be appended to the data or the
CRC.
The term CRC may refer to the check code or to the function that calculates it, which
accepts data streams of any length as input but always outputs a fixed-length code.
STEPS
1. The data unit is divided by the divisor using a process called binary division the
remainder from this division is CRC.
2. The CRC remainder is appended along with the original data unit.
3. At the receiver section the data is divided by the same divisor to find the
remainder to be zero.
4. If it is achieved the string which reaches the receiver is error free else the data is
rejected.
CRC generator
Generator uses modulo 2 division method consists of dividend and divisor
To find out the divisor
1. Count the total number of the bits to be transmitted says it as 6.
2. It falls under the range of 2 power3.
3. Add 1 to the power3 to obtain the original value say 16[2 to power 4].
4. Set the appropriate combination to obtain the divisor.
5. Now the CRC performs the binary division
6. The divisor is subtracted from the four bits of the dividend without disturbing the
next higher bit which gives the remainder.
7. Pull down the next bit from the dividend to make the number of the bits in the
remainder equal to the divisor.
8. Repeat the process until all the bits in the dividend is used.
9. Final remainder is appended with the dividend (for example let the dividend be
110011000 and the remainder (that is CRC) is 001 after appending the remainder
which gives the appended data as 110011001).
10011000 / 101
101
111
101
100
101
100
101
01---crc
CRC checker:
Dividend (10011000) + remainder (01) =10011001
Checker at the receiver side receives the data appended with the CRC as an input.
And performs modulo 2-division.
If the remainder is zero the appended CRC that is remainder (001) is removed and the
data is accepted else the data is resent for processing.
10011001 / 101
101
111
101
100
101
101
101
00---crc
Data is accepted.
Checksum:
1. This checksum algorithm breaks the data into "words" with equal number n of
bits. Example if the data contains 8 bits it is divided into two equal segments of 4
bits each.
2. These two segments are added together and the resulting sum is then ones
complemented.
3. The complemented result is appended along with the original data as redundancy
bit called checksum field.
4. The extended data unit is transmitted across the network.
5. At the receiver section once again the data unit is divided into equal segments
added together and the final result is ones complemented.
6. If the result is zero the data is accepted else the data unit is retransmitted.
With this checksum, any transmission error that flips a single bit of the message, or
an odd number of bits, will be detected as an incorrect checksum.
=============================================================
Error correction: Error correction is handled in 2 ways they are
Error correction by retransmission
When an error is discovered in the receiver section it sends a request message to the
sender to retransmit the entire data unit.
Error correction by using error correcting codes
Error correcting codes are more sophisticated than the error detecting codes as they
require one or more redundancy bits.
Hamming code
In telecommunication, a Hamming code is a linear error-correcting code named after its
inventor, Richard Hamming. Hamming code is used to detect and correct bit errors that
can occur when computer data is moved or stored. Hamming code is named for R. W.
Hamming of Bell Labs.
Like other error-correction code, Hamming code makes use of the concept of parity and
parity bit s, which are bits that are added to data so that the validity of the data can be
checked when it is read or after it has been received in a data transmission.
Hamming codes make forward error correction (FEC) less expensive to correct errors in
the received data during data transmission at the receiving station and to increase
throughput on a data link when there is a lot of noise present.
CALCULATE THE NUMBER OF REDUNDANCY BITS
To calculate the number of the redundancy bits (r) required to correct the given
number of the data bits (m)
1. Relationship between m and r should be found.
2. Length of the resulting code must be m+r.
3. If the total number of the bits in a transmittable unit is m+r then r must be able to
indicate m+r+1 different state.
4. r bits can indicate 2 power r different states.
5. Therefore 2 power r must be equal to or greater than the m+r+1.
POSTIONING AND CALCULATING THE BITS
The redundancy bits are placed in the positions like 1, 2, 4, 8 that is power of 2 in the
11 bit data unit.
To calculate the values of r:
Represent all the bit positions in binary form (that is in the form of 0 and 1s) starting
from 0 to 11.
For example position 1 is coded as 0001 and position 2 as 0010 and etc
The combinations used to calculate the values of r are
R1 bits====1,3,5,7,9,11 [Note: Is calculated by using all bit position whose binary
representation includes 1 in the rightmost corner.]
R2 bits====2, 3,6,7,10,11 [Note: Is calculated by using all bit position whose binary
representation includes 1 in the second position.]
R4 bits====4,5,6,7 11 [Note: Is calculated by using all bit position whose binary
representation includes 1 in the third position.]
R8 bits====8, 9, 10, 11 [Note: Is calculated by using all bit position whose binary
representation includes 1 in the fourth position.]
Example
The data unit 10011100101 is to be transmitted on transmitting the seventh bit is
changed from 1 to 0. Then the receiver should calculate which bit was wrong and
correct it.
Now
The receiver takes the received data and recalculates the four redundancy or the parity
bits.
After calculating the parity values they are assembled into the binary number in the
order of
R8
R4
R2
R1
The above operation
results the bit in position 7 is in error. Once the position is identified the receiver
would reverse its value and correct the error.
Link level Flow Control============================================
Flow control
The main problem we have to deal with here is to prevent the sender from flooding the
receiver due to faster data transmission. The term flow control enables the receiver to
regulate the flow of the data from the sender so that the receiver’s buffers do not
overflow.
It is set of procedures that tell the sender how much data it can transmit before it must
wait for acknowledgement from the receiver in-order to protect the receiver from being
overwhelmed [crushed].
The receiver typically allocates a data buffer of some maximum length for transfer. When
data are received the receiver must do certain amount of processing before passing the
data to the higher level. In the absence of the flow control the receiver’s buffer over flows
when it processes the old data.
The mechanisms used to perform this flow control is
Stop-wait flow control
Sliding-window flow control
Stop-wait flow control this the simplest form of flow control is error control
mechanisms used to regulate the flow of data. In this a source entity transmits the frame.
After receiving the transmitted frame destination indicates its willingness to accept
another frame by sending back an acknowledgement (ACK) to the transmitted frame.
Now the sender must wait until the acknowledgement has been received before sending
the next frame. By this way the destination could stop the transmission of data by withholding the acknowledgement.
T
Frame 0
Ack1
Advant: Simplicity and each frame is checked and acknowledged before it is sent.
Disadva: Inefficient because it is slow and not possible in situations when the bit length
is greater than the frame length.
Sliding window flow control
Taking the disadvantage of the stop and wait into account sliding window flow control
method sets an advantage:
By allowing multiple frames to be transmitted at same time before sending an
acknowledgement.
Lets us examine its operation between two stations A and B
Both are connected via full-duplex method both stations allocates buffer space for W
frames indicated in window like structure. When are ready to transmit a 3 bit sequence
number then the maximum number of the window size is obtained by using
2 power number of bits – 1{that is 2 power 3-1=7 frames}. And now the transmitter is
going to transmit up-to 7 frames and they are numbered sequentially from 0 to 7 and this
is continued for subsequent frames. The receiver’s window indicates the total number of
the frames to be transmitted and the receiver’s window indicates the total number of the
bytes it is going to receive. And each time the frame is transmitted the window shrinks in
the transmitter side and grows when each acknowledgement it received.
The transmitter is ready to transmit the frames starting from F0 to F2 without
acknowledgement; the transmitter has shrunk its window to four frames and maintains a
copy of the frames for retransmission. Then the receiver transmits RR3 [receive ready3]
indicating that “I have received the frames starting from 0 to 2 and ready to accept
the frame starting from 3” with this acknowledgement. The transmitter proceeds to
transmit frames 3, 4, 5 and 6. Now receiver returns RR4 which acknowledges frame 3 by
the time RR4 reaches the transmitter frames 4, 5 and 6 would have reached. This leads to
availability of the duplicate frames this condition is rectified by deleting the frames in the
buffer and the process continues until all the frames have been sent to the receiver
section.
Error control
Error control is the mechanism in to detect and correct the error which occurs during
transmission of the frame from the sender to the receiver. Allow the Receiver to tell the
Sender about frames damaged or lost during transmission, and coordinates for retransmission of those frames by the Sender.
The basic idea of error control: ACK every correctly-received frame and negatively
acknowledge (NAK) every incorrectly-received frame• Sender keeps copies of unACKed Frames to re-transmit if required.
This mechanism uses Automatic Repeat reQuest (ARQ), also known as Automatic
Repeat Query, method for data transmission. ARQ uses acknowledgements (messages
sent by the receiver indicating that it has correctly received a data frame or packet) and
timeouts (specified periods of time allowed to elapse before an acknowledgment is to be
received) and NAK to achieve reliable data transmission over an unreliable service. If the
sender does not receive an acknowledgment before the timeout, it usually re-transmits the
frame/packet until the sender receives an acknowledgment or exceeds a predefined
number of re-transmissions.
Some of the main features that should be kept as mandatory are: 1.Sending device should
keep a copy of the last frame sent until it receives an acknowledgement for that frame. 2.
Sending device should be equipped with a timer.
The types of ARQ protocols include


Stop-and-wait ARQ extension of Stop-and-wait flow control
Sliding window ARQ
o Go-Back-N ARQ
o Selective Repeat ARQ
Stop-and-wait ARQ A stop-and-wait ARQ sender sends one frame at a time. After
sending each frame, the sender doesn't send any further frames until it receives an ACK
(acknowledgement) signal. After receiving a good frame, the receiver sends an ACK. If
the ACK does not reach the sender before a certain time, known as the timeout, the
sender sends the same frame again.
Damaged data frame In this mechanism when the frame is discovered by the receiver to
contain an error, it returns a Nak (negative acknowledgement) frame to the sender.
Step1The sender transmits a data frame 0.The receiver returns an Ack 1 to the sender to
indicate that frame 0 arrived undamaged and now expecting frame1.
Step2The sender transmits the next frame 1. Now the receiver encounters an error in the
data and returns a Nak frame to indicate error in the data.
Step3The sender retransmits the frame 1. This process continues until the entire data
frames are transmitted successfully.
Stop-and-wait ARQ, lost data frame
Step1The sender transmits a data frame 0.The receiver returns an Ack 1 to the sender to
indicate that frame 0 arrived undamaged and now expecting frame1.
Step2The sender transmits the next frame 1. At this time the transmitted data does not
reach the receiver.
Step3The sender is equipped with a timer that starts every time a data frame is
transmitted.
Step4The sender waits for an ack from the receiver.
Step5At this moment the sender waits until the timeout period expires and retransmits
the frame 1 to the receiver.
Stop-and-wait ARQ, lost ACK
The receiver receives the data frame transmitted from the sender and then waits for either
acknowledgement or for negative acknowledgement. The sender waits for the
acknowledgement or for negative acknowledgement frame until the timer runs out. When
the timer runs out, the sender retransmits the frame and waits for the acknowledgement.
GoBack arq
Go-Back-N ARQ is a specific instance of the Automatic Repeat-reQuest (ARQ)
Protocol, in which the sending process continues to send a number of frames specified by
a window size sequentially even without receiving an ACK packet from the receiver.
Under this mechanisms if one frame is lost or damaged all the frames sent since the last
frame acknowledgement is retransmitted. This handles totally three cases:
1.
Damaged frame
Step1The sender has sent 7 frames starting from 0 to 6 sequentially.
Step2Now the receiver transmits ack3 to indicate that it has received frames 0, 1,2
correctly.
Step3Now the sender transmits the rest of the frames starting from 3 to 6. Now the
sender discovers that frame 4 has en-counted an error so that nak4 is sent immediately
and then the subsequent frames are discarded to avoid duplication.
Step4Now the transmitter once again sends the frames starting from the 4 to 6 and the
process continues until the all the frames are transmitted successfully.
2. Lost frame:
The frames are transmitted from the sender to the receiver sequentially now the frame 4
is lost.
The frames arrived at the receiver side is frames 0,1,2,3,5,6 and expecting frame 4 to be
received and considers the frame 4 to be an error and sends a Nak4 frame at the same
time discards the frames 5 and 6.
Once the receiver receives the nak4 frame it retransmits the frames starting from 4 to 6.
3. Lost ack
In this the sender transmits the frames sequentially and sends an ack frame to indicate the
reliable transmission of the frames 0 to 2. The sender starts transmission of the frames
from 3 to 6 and now the sender waits for an ack for the transmitted frames until the timer
runs out. After that timer has elapsed its time it starts retransmission of the frames from 3
to 6.
Selective repeat ARQ
In this method only the damaged or lost frame is retransmitted
If the frame is corrupted in transmits a Nak frame to the sender and the frame is resent.
The receiver must contain a searching mechanism that allows it to find and select only the requested
Frame for retransmission. The cases are
1. Damaged frame:
The sender transmits the frames starting from 0 to 6. In that the frame 4 has been
transmitted along with an error. Now the receiver discards the frame 4 and receives the
rest of the frame while waiting for the frame 4 to be retransmitted. Now the receiver must
sort the frames it has received in a proper sequence.
Note that the above process continues for both
2. Lost frame
3. Lost ack.
Difference between Go-back and selective repeat:
Sno
Go-back
Selective repeat
1
No sorting logic
Maintains sorting logic to sort the re-ordered
frames
2
No searching mechanism
Maintains a searching mechanism to find and
select only the requested frame for
retransmission.
3
Less
Better performance
Difference between flow control and error control
Sno
flow control
error control
1
process of adjusting the flow of
data from one device to another
used to recover the
corrupted data whenever possible
2
Used to determine amount of data Identify the frames lost or damaged in
the sender can transmit before
transmission and co-ordinates for
receiving ack.
retransmission of the frames.