Computer Networks
Course Outcome
• 1. Describe the basic of Computer Network and the models.
• 2. Comprehend about the transmission.
• 3. Implement multiplexing and Ethernet.
• 4. Analyze the various types of protocol.
• 5. Define the functionalities of layers in networking
Syllabus
• MODULE 1 – DATA COMMUNICATIONS (9L) Components –Direction of
Data flow – networks – Components and Categories – typesof
Connections – Topologies –Protocols and Standards – ISO / OSI model
–Transmission Media –Coaxial Cable – Fiber Optics – Line Coding
Modems – RS232 CO-1 BTL-3 Interfacing sequences. Suggested
Readings: OSI Model
• MODULE 2 – DATA LINK LAYER (9L) Error – detection and correction –
Parity – LRC – CRC – Hamming code – low Control and Error control ‐
stop and wait – go back ‐N ARQ – selective repeat ARQ‐ sliding
window – HDLC. ‐ LAN ‐ Ethernet– FDDI ‐ SONET – Bridges. Suggested
Readings: Error Detection and Correction CO-2 BTL-3
• MODULE 3 – NETWORK LAYER (9L) Internetworks – Packet Switching and
Datagram approach – IP addressing methods –Sub netting – Routing –
Distance Vector Routing – Link State Routing – Routers. Suggested Readings:
Internetworks CO-3 BTL-3
• MODULE 4 – TRANSPORT LAYER (9L) Duties of transport layer – Multiplexing
– De-multiplexing – Sockets – User Datagram Protocol (UDP) – Transmission
Control Protocol (TCP) – Congestion Control – Quality of services (QOS) –
Integrated Services Suggested Readings: Transmission Control Protocol (TCP)
CO-4 BTL-3
• MODULE 5 – APPLICATION LAYER (9L) Domain Name Space (DNS) – SMTP –
FTP – HTTP ‐ WWW – Security – Cryptography Suggested Readings:
Cryptography CO-5 BTL-2
Books
• TEXT BOOKS 1 Sanjay Sharma(2013) , “Computer Networks”,
Publisher‐ S K Kataria and Sons, 2 Andrew S. Tanenbaum, David
J(2012). Computer Networks, Pearson Education,
• REFERENCE BOOKS 1. Harvey M. Deitel(2007), "Operating Systems",
Second Edition, Pearson Education E BOOKS 1.
[Link]
Networking‐Books‐ [Link] MOOC 1.
[Link]
communication
Error Control in Data Link Layer
• Data-link layer uses the techniques of error control simply to ensure and confirm that
all the data frames or packets, i.e. bit streams of data, are transmitted or transferred
from sender to receiver with certain accuracy.
• Using or providing error control at this data link layer is an optimization, it was never
a requirement. Error control is basically process in data link layer of detecting or
identifying and re-transmitting data frames that might be lost or corrupted during
transmission. In both of these cases, receiver or destination does not receive correct
data frame and sender or source does not even know anything about any such loss
regarding data frames.
• Therefore, in such type of cases, both sender and receiver are provided with some
essential protocols that are required to detect or identify such types of errors as loss
of data frames.
• The Data-link layer follows a technique known as re-transmission of frames to detect
or identify transit errors and also to take necessary actions that are required to
reduce or remove such errors. Each and every time an error is detected during
transmission, particular data frames are retransmitted and this process is known as
ARQ (Automatic Repeat Request).
Error Detection
• Error detection, as the name suggests, simply means detection or
identification of errors.
• These errors may occur due to noise or any other impairments during
transmission from transmitter to the receiver, in communication
system.
• It is a class of techniques for detecting garbled i.e. unclear and
distorted data or messages.
Error Correction
• Error correction, as the name suggests, simply means correction or
solving or fixing of errors.
• It simply means reconstruction and rehabilitation of original data that
is error-free. But error correction method is very costly and very hard.
Error Detection
• When data is transmitted from one device to another device, the
system does not guarantee whether the data received by the device is
identical to the data transmitted by another device.
• An Error is a situation when the message received at the receiver end
is not identical to the message transmitted.
Single-Bit Error
• The only one bit of a given data unit is changed from 1 to 0 or from 0
to 1.
Single-Bit Error does not appear more likely in Serial Data Transmission. For example, Sender sends the
data at 10 Mbps, this means that the bit lasts only for 1 ?s and for a single-bit error to occurred, a noise
must be more than 1 ?s.
Single-Bit Error mainly occurs in Parallel Data Transmission. For example, if eight wires are used to send
the eight bits of a byte, if one of the wire is noisy, then single-bit is corrupted per byte.
Burst Error
• The two or more bits are changed from 0 to 1 or from 1 to 0 is known
as Burst Error.
• The Burst Error is determined from the first corrupted bit to the last
corrupted bit.
Error Detecting Techniques
• The most popular Error Detecting Techniques are:
• Single parity check
• Two-dimensional parity check
• Checksum
• Cyclic redundancy check
Single Parity Check
• Single Parity checking is the simple mechanism and inexpensive to detect
the errors.
• In this technique, a redundant bit is also known as a parity bit which is
appended at the end of the data unit so that the number of 1s becomes
even. Therefore, the total number of transmitted bits would be 9 bits.
• If the number of 1s bits is odd, then parity bit 1 is appended and if the
number of 1s bits is even, then parity bit 0 is appended at the end of the
data unit.
• At the receiving end, the parity bit is calculated from the received data bits
and compared with the received parity bit.
• This technique generates the total number of 1s even, so it is known as
even-parity checking.
Drawbacks Of Single Parity
Checking
• It can only detect single-bit errors which are very rare.
• If two bits are interchanged, then it cannot detect the errors.
Longitudinal Redundancy Check
(LRC)/2-D Parity Check
• Longitudinal Redundancy Check (LRC) is also known as 2-D parity
check. In this method, data which the user want to send is organised
into tables of rows and columns. A block of bit is divided into table or
matrix of rows and columns.
• In order to detect an error, a redundant bit is added to the whole
block and this block is transmitted to receiver. The receiver uses this
redundant row to detect error.
• After checking the data for errors, receiver accepts the data and
discards the redundant row of bits.
Example :
If a block of 32 bits is to be transmitted, it is divided into matrix of four
rows and eight columns which as shown in the following figure :
• In this matrix of bits, a parity bit (odd or even) is calculated for each
column. It means 32 bits data plus 8 redundant bits are transmitted to
receiver. Whenever data reaches at the destination, receiver uses LRC
to detect error in data.
• Advantage :
LRC is used to detect burst errors.
Example
• Suppose 32 bit data plus LRC that was being transmitted is hit by a
burst error of length 5 and some bits are corrupted as shown in the
following figure :
The LRC received by the destination does not match with newly corrupted LRC. The destination comes to know that the
data is erroneous, so it discards the data.
Disadvantage
The main problem with LRC is that, it is not able to detect error if two
bits in a data unit are damaged and two bits in exactly the same
position in other data unit are also damaged.
Example : If data 110011 010101 is changed to 010010110100.
In this example 1st and 6th bit in one data unit is changed . Also the 1st and 6th bit in second
unit is changed.
Two-Dimensional Parity Check
• Performance can be improved by using Two-Dimensional Parity
Check which organizes the data in the form of a table.
• Parity check bits are computed for each row, which is equivalent to
the single-parity check.
• In Two-Dimensional Parity check, a block of bits is divided into rows,
and the redundant row of bits is added to the whole block.
• At the receiving end, the parity bits are compared with the parity bits
computed from the received data.
Drawbacks Of 2D Parity Check
• If two bits in one data unit are corrupted and two bits exactly the
same position in another data unit are also corrupted, then 2D Parity
checker will not be able to detect the error.
• This technique cannot be used to detect the 4-bit errors or more in
some cases.
Checksum
• A Checksum is an error detection technique based on the concept of
redundancy.
• It is divided into two parts:
• Checksum Generator
• A Checksum is generated at the sending side. Checksum generator
subdivides the data into equal segments of n bits each, and all these
segments are added together by using one's complement arithmetic. The
sum is complemented and appended to the original data, known as
checksum field. The extended data is transmitted across the network.
• Suppose L is the total sum of the data segments, then the checksum would
be ?L
The Sender follows the given steps: The Receiver follows the given steps:
The block unit is divided into k sections, and each of n bits. The block unit is divided into k sections and each
All the k sections are added together by using one's complement of n bits.
to get the sum. All the k sections are added together by using
one's complement algorithm to get the sum.
The sum is complemented and it becomes the checksum field.
The sum is complemented.
The original data and checksum field are sent across the network. If the result of the sum is zero, then the data is
accepted otherwise the data is discarded
Cyclic Redundancy Check (CRC)
• CRC is a redundancy error technique used to determine the error.
• Following are the steps used in CRC for error detection:
• In CRC technique, a string of n 0s is appended to the data unit, and this n number is
less than the number of bits in a predetermined number, known as division which is
n+1 bits.
• Secondly, the newly extended data is divided by a divisor using a process is known as
binary division. The remainder generated from this division is known as CRC
remainder.
• Thirdly, the CRC remainder replaces the appended 0s at the end of the original data.
This newly generated unit is sent to the receiver.
• The receiver receives the data followed by the CRC remainder. The receiver will treat
this whole unit as a single unit, and it is divided by the same divisor that was used to
find the CRC remainder.
• If the resultant of this division is zero which means that it has no error, and the data is
accepted.
Suppose the original data is
11100 and divisor is 1001
• CRC Generator
• A CRC generator uses a modulo-2 division. Firstly, three zeroes are
appended at the end of the data as the length of the divisor is 4 and we
know that the length of the string 0s to be appended is always one less
than the length of the divisor.
• Now, the string becomes 11100000, and the resultant string is divided by
the divisor 1001.
• The remainder generated from the binary division is known as CRC
remainder. The generated value of the CRC remainder is 111.
• CRC remainder replaces the appended string of 0s at the end of the data
unit, and the final string would be 11100111 which is sent across the
network.
CRC Checker
• The functionality of the CRC checker is similar to the CRC generator.
• When the string 11100111 is received at the receiving end, then CRC
checker performs the modulo-2 division.
• A string is divided by the same divisor, i.e., 1001.
• In this case, CRC checker generates the remainder of zero. Therefore,
the data is accepted.
Hamming Code in Computer
Network
• Hamming code is an error-correcting code used to ensure data
accuracy during transmission or storage. Hamming code detects and
corrects the errors that can occur when the data is moved or stored
from the sender to the receiver.
• This simple and effective method helps improve the reliability of
communication systems and digital storage. It adds extra bits to the
original data, allowing the system to detect and correct single-bit
errors. It is a technique developed by Richard Hamming in the 1950s.
What is Redundant Bits?
• Redundant bits are extra binary bits that are generated and added to
the information-carrying bits of data transfer to ensure that no bits
were lost during the data transfer. The number of redundant bits can
be calculated using the following formula:
• 2r ≥ m + r + 1
• where m is the number of bits in input data, and r is the number of
redundant bits.
• Suppose the number of data bits is 7, then the number of redundant
bits can be calculated using: = 24 ≥ 7 + 4 + 1 . Thus, the number of
redundant bits is 4.
Algorithm of Hamming Code
• Hamming Code is simply the use of extra parity bits to allow the
identification of an error.
• Step 1: Write the bit positions starting from 1 in binary form (1, 10,
11, 100, etc).
• Step 2: All the bit positions that are a power of 2 are marked as parity
bits (1, 2, 4, 8, etc).
• Step 3: All the other bit positions are marked as data bits.
• Step 4: Each data bit is included in a unique set of parity bits, as
determined its bit position in binary form:
• a. Parity bit 1 covers all the bits positions whose binary representation
includes a 1 in the least significant position (1, 3, 5, 7, 9, 11, etc).
• b. Parity bit 2 covers all the bits positions whose binary
representation includes a 1 in the second position from the least
significant bit (2, 3, 6, 7, 10, 11, etc).
• c. Parity bit 4 covers all the bits positions whose binary representation
includes a 1 in the third position from the least significant bit (4–7,
12–15, 20–23, etc).
• d. Parity bit 8 covers all the bits positions whose binary
representation includes a 1 in the fourth position from the least
significant bit bits (8–15, 24–31, 40–47, etc).
• e. In general, each parity bit covers all bits where the bitwise AND of
the parity position and the bit position is non-zero.
• Step 5: Since we check for even parity set a parity bit to 1 if the total
number of ones in the positions it checks is odd. Set a parity bit to 0 if
the total number of ones in the positions it checks is even.
Determining The Position of
Redundant Bits
• A redundancy bits are placed at positions that correspond to the
power of 2. As in the above example:
• The number of data bits = 7
• The number of redundant bits = 4
• The total number of bits = 7+4=>11
• The redundant bits are placed at positions corresponding to power of
2 that is 1, 2, 4, and 8
Suppose the data to be transmitted is 1011001 from
sender to receiver, the bits will be placed as follows:
1. Stop-and-Wait ARQ
• Stop-and-Wait ARQ is also known as alternating bit protocol. It is one of the
simplest flow and error control techniques or mechanisms.
• This mechanism is generally required in telecommunications to transmit
data or information between two connected devices. Receiver simply
indicates its readiness to receive data for each frame.
• In these, sender sends information or data packets to receiver. Sender then
stops and waits for ACK (Acknowledgment) from receiver.
• Further, if ACK does not arrive within given time period i.e., time-out,
sender then again resends frame and waits for ACK. But, if sender receives
ACK, then it will transmit the next data packet to receiver and then again
wait for ACK from receiver.
• This process to stop and wait continues until sender has no data frame or
packet to send.