Unit - 2 CN
Unit - 2 CN
Error is a situation when the sender's data does not match the data at
the receiver's end. When an error is detected then we need
to retransmit the data. So, there are various techniques of error control
in computer networks. In this blog, we will see all these techniques.
What causes errors?
Noise:
External factors like electromagnetic interference or electrical noise can disrupt the
signal during transmission, causing bits to flip.
Interference:
Signals from other sources can interfere with the intended signal, leading to errors.
Hardware malfunctions:
Faulty network equipment or cables can also introduce errors.
Network congestion:
Overloaded networks can cause packets to be dropped or delayed, leading to errors
at the receiving end.
Types of errors:
Single-bit error: A single bit in the transmitted data is flipped (e.g., a 0 becomes a 1 or
vice versa).
Multiple-bit error: More than one bit in the transmitted data is flipped.
Burst error: A sequence of consecutive bits is corrupted.
Consequences of errors:
Data corruption: Received data may be incorrect or unusable, leading to application
errors or system crashes.
Network performance degradation: Retransmission of corrupted data can slow down
network speeds.
Error detection and correction:
Error detection:
Techniques like checksums, CRCs, and parity checks are used to identify the
presence of errors.
Error correction:
Techniques like ARQ (Automatic Repeat Request) and FEC (Forward Error
Correction) are used to correct detected errors
.
2.write crc? with example
A Cyclic Redundancy Check (CRC) is an error-detecting code used to verify the
integrity of digital data, most commonly in digital networks and storage devices
. The process involves treating binary data as a polynomial and performing a modulo-2
division, which uses the XOR operation instead of subtraction. The remainder of this
division, the CRC, is appended to the original data and sent to the receiver
1. Define a generator polynomial: Both the sender and receiver must agree on a
predefined divisor, or generator polynomial, to use for the calculation. This polynomial is
represented in binary format. The number of CRC bits generated will be one less than the
number of bits in the divisor.
2. Append zeros: The sender appends a number of zeros equal to the highest degree of the
generator polynomial to the end of the original data.
3. Perform binary division: The modified data is divided by the generator polynomial
using modulo-2 binary division.
4. Append the remainder: The remainder from this division is the CRC checksum. The
sender replaces the appended zeros with this CRC checksum to form the final transmitted
data.
1. Divide the received data: The receiver performs the same modulo-2 division on the
entire received data (the original data + the appended CRC) using the same generator
polynomial.
2. Check the remainder:
o If the remainder is zero, the data is considered error-free.
o If the remainder is not zero, the receiver knows an error occurred during
transmission.
CRC example
Assume we want to transmit the message 110101, and our agreed-upon generator polynomial is
Data: 110101
Modified data: 110101000
Step 3: Perform modulo-2 division
Divide the modified data 110101000 by the divisor 1101 using the XOR operation.
100101
_______
1101|110101000
-1101
-----
000001000
- 0000
-------
1000
- 1101
-------
1010
- 1101
-------
1110
- 1101
-------
110
The remainder is 110, which is the CRC checksum.
Step 4: Transmit the data
The sender replaces the appended zeros with the CRC checksum.
rr
𝑟
) needed for a given number of data bits (
dd
𝑑
) is determined by the formula
d=4d equals 4
𝑑=4
), we can find
rr
o If
r=3r equals 3
𝑟=3
23≥4+3+1⇒8≥8
D3,D5,D6,D7cap D sub 3 comma cap D sub 5 comma cap D sub 6 comma cap D sub 7
𝐷3,𝐷5,𝐷6,𝐷7
) to the remaining positions.
Bit
1 2 3 4 5 6 7
Position
P1cap P sub 1
𝑃1
P1,D3,D5,D7cap P sub 1 comma cap D sub 3 comma cap D sub 5 comma cap D
sub 7
𝑃1,𝐷3,𝐷5,𝐷7
o Known values:
𝑃1,1,0,1
𝑃1=0
P2cap P sub 2
𝑃2
P2,D3,D6,D7cap P sub 2 comma cap D sub 3 comma cap D sub 6 comma cap D
sub 7
𝑃2,𝐷3,𝐷6,𝐷7
o Known values:
𝑃2,1,1,1
𝑃2=1
to make it even.
P4cap P sub 4
𝑃4
P4,D5,D6,D7cap P sub 4 comma cap D sub 5 comma cap D sub 6 comma cap D
sub 7
𝑃4,𝐷5,𝐷6,𝐷7
o Known values:
𝑃4,0,1,1
𝑃4=0
P1cap P sub 1
𝑃1
(positions 1, 3, 5, 7):
oReceived bits: 0, 1, 1, 1
oNumber of 1s: 3. This is an odd number, which is an error.
oSyndrome bit 1: 1
Check parity for
P2cap P sub 2
𝑃2
(positions 2, 3, 6, 7):
oReceived bits: 1, 1, 1, 1
oNumber of 1s: 4. This is an even number, which is correct.
oSyndrome bit 2: 0
Check parity for
P4cap P sub 4
𝑃4
(positions 4, 5, 6, 7):
o Received bits: 0, 1, 1, 1
o Number of 1s: 3. This is an odd number, which is an error.
o Syndrome bit 4: 1
Step 2: Determine the error location
The calculated parity bits form a "syndrome" in reverse order (
1⋅22+0⋅21+1⋅20=4+0+1=51 center dot 2 squared plus 0 center dot 2 to the first power
plus 1 center dot 2 to the 0 power equals 4 plus 0 plus 1 equals 5
1⋅22+0⋅21+1⋅20=4+0+1=5
The syndrome value of 5 indicates that the error occurred at the 5th bit position.
Step 3: Correct the error
To correct the error, the receiver simply flips the bit at the identified position.
field
1. I-frame : I-frame stands for Information frames. This frame is generally
used for transporting user data from network layer. These frames actually
carry actual data or information of upper layer and some control information.
This frame carries data along with both send sequence number and an
acknowledgment number. It can also be used to piggyback
acknowledgement information in case of ABM (Asynchronous Balanced
Mode). The first bit of this frame of control field is 0.
2. S-frame : S-frame stands for Supervisory frames. These frames are
basically required and essential for error control and flow control. They also
provide control information. It contains or includes only an Acknowledgment
number. First two bit of this frame of control field is 10. S-frame does not
have any information fields. This frame contains send and receive sequence
numbers.
Example -
Receive Ready (RR)
Receive Not Ready (RNR)
Reject on frame N(R) (REJ)
Selective reject on N(R) (SREJ), etc.
3. U-frame : U-frame stands for Unnumbered frames. These frames are also
required in various functions like link setup and disconnections. These
frames basically support control purposes and are not sequenced. First, two-
bit of this frame of control field is 11. Some U-frame contains an information
field depending on the type. These frames are also used for different
miscellaneous purposes along with link management. U-frame is required for
managing link itself. This frame does not include any type of
acknowledgment information i.e. in turn it includes or is contained in
sequence number. These frames are generally reserved for system
management.
Example -
Set Normal Response Mode (SNRM)
Set Asynchronous Response Mode (SARM)
Set Asynchronous Balanced Mode (SABM)
Unnumbered Polling (UP)
Unnumbered Acknowledge (UA), etc.
The Sliding Window protocol is a data link layer and TCP protocol that allows
a sender to transmit multiple data frames to a receiver before needing an
acknowledgment for each one, improving efficiency over the simpler stop-and-
wait protocol. It uses an "imaginary window" to manage which frames have
been sent and which are awaiting acknowledgment, and it relies on sequence
numbers to order frames and detect lost or duplicate packets at the receiver.
How it Works
1. 1. Sender and Receiver Windows:
Both the sender and receiver maintain an "imaginary box" or window.
The sender's window holds frames that have been sent but not yet acknowledged.
The receiver's window holds frames that have been received but not yet
acknowledged or are awaiting further frames to be considered in sequence.
2. 2. Sequence Numbers:
Each data frame is assigned a unique sequence number. This allows the receiver to:
Order frames: correctly, even if they arrive out of sequence.
Identify missing frames .
Detect duplicate frames .
3. 3. Window Sliding:
The sender can send a number of frames up to its window size.
Once an acknowledgment (ACK) for a frame arrives, the sender's window "slides" to
the next position, allowing it to send a new frame.
The receiver only accepts frames that are within its current window.
4. 4. Reliable Delivery:
The protocol ensures reliable delivery by requiring acknowledgments and using
sequence numbers to manage the flow and prevent data loss or duplication.
Key Advantages
Increased Efficiency:
By sending multiple frames at once, the protocol keeps the communication channel
busy, leading to higher throughput and faster data transmission compared to single-
frame protocols like stop-and-wait.
Reliable Data Transfer:
It provides reliable, in-order delivery of data frames by using sequence numbers and
acknowledgments to handle lost or damaged packets.
Full-Duplex Communication:
The mechanism supports full-duplex transmission, allowing data to be sent and
received concurrently.
Types of Sliding Window Protocols
The general concept of a sliding window has variations, most notably the two
main error control methods:
Go-Back-N ARQ:
If a frame is lost, the receiver rejects all subsequent frames, and the sender must
retransmit the lost frame and all following frames.
Selective Repeat ARQ:
If a frame is lost, the receiver can still accept subsequent frames if they are within its
window. The sender only retransmits the specific lost frame(s).
8.Explain about ppp transition phase? Authentication and multiplexing
protocol?
Point-to-Point Protocol (PPP) was generally invented by Internet Engineering
Task Force (IETF) simply to create and develop a data link protocol for point
to point lines that can be helpful in solving many of the problems that are
present in SLIP. PPP can operate on different DTE/DCE (Data Terminal
Equipment/Data Circuit-Terminating Equipment) physical interfaces along
with asynchronous serial, synchronous serial, ISDN, etc. It can also operate
on various network layer protocols such as IPX, AppleTalk, whereas on the
other hand, SLIP only operates on TCP/IP-based protocols. All of the point-
to-point links that utilize PPP protocol needs to be able to support full-duplex
communication. PPP Phase Diagram : PPP connection generally goes
through different phases that can be seen in Transition Phase Diagram as
shown below :
1. Dead - In this phase, link basically starts and stops. Carrier Detection is
an event that is used to indicate that physical layer is ready, and now the
PPP will proceed towards establishment phase. Disconnection from
modem line must bring back the line or connection to this phase. LCP
automation is usually in the initial or starting phase during this phase.
2. Establish - Link then proceeds towards this phase after the presence of
peer is being detected. When one of nodes starts communication, then
connection goes into this phase. By the exchange of LCP Frames or
packets, all of configuration parameters are negotiated. If somehow
negotiation meets at a point, link is developed and then system goes
either into authentication protocol or network layer protocol. The end of
this phase simply indicates open state of LCP.
3. Authenticate - In PPP, authentication is optional. Peer authentication can
be requested by one or both of the endpoints. PPP enters authentication
phase if Password Authentication Protocol (PAP) or Challenge-
Handshake Authentication Protocol (CHAP) is configured.
4. Network - PPP basically sends or transmits NCP packets to choose and
configure one or more network-layer protocols such as IP, IPX, etc. once
LCP state is being open and link or connection is established. This is
especially required to configure the appropriate network layer. In this
phase, Each of Network control protocols might be opened and closed at
any time and negotiation for these protocols also takes place. At network
layer, PPP also supports various protocols due to which PPP specifies
that two of nodes establish or develop a network layer agreement before
data is exchanged at network layer.
5. Open - Usually transferring of data takes place in this phase. Once
endpoints want to end the connection, connection is then transferred to
terminate phase, till then connection remains in this phase.
6. Terminate - Connection can be terminated at any point of time as per the
request of either of the endpoints. LCP is basically required to close or
terminate link through the exchange of terminate packets.
Primary To determine if data has been corrupted. To detect errors and reconstruct the original, error-free
Goal data.
Complexity Simpler to implement and computationally less More complex due to advanced coding schemes and
intensive. higher computational requirements.
Overhead Generally requires less additional data Requires more redundant data to not only detect but also
(redundancy). pinpoint the location of errors.
Latency Lower, as it only requires a consistency check. Higher, because it needs to decode and correct the data.
Action on An error is flagged. The typical action is to The receiver automatically corrects the error on its own
Error request that the sender re-transmits the data using the redundant information, without needing a
(a process known as Automatic Repeat retransmission (a process known as Forward Error
Request or ARQ). Correction or FEC).
Common Used in scenarios where retransmission is Used in one-way communication or environments where
Uses feasible, such as network protocols like TCP. retransmission is difficult or impractical, such as satellite
communication, real-time video streaming, or data stored
on CDs and DVDs.
Examples Parity checks, checksums, and Cyclic Hamming codes, Reed-Solomon codes, and Turbo
Redundancy Checks (CRC). codes.