Cnis 1
Cnis 1
Cnis 1
Computer networking is like having a group of friends who all have phones and can
call or text each other. In computer networking, instead of phones, we have computers
and instead of phone lines, we use cables, Wi-Fi, or other methods to connect them.
When computers are connected to a network, they can share information and
resources, like files, printers, and internet connections. This allows them to
communicate with each other quickly and easily, just like friends talking on their
phones.
A computer network consists of various kinds of nodes. Servers, networking
hardware, personal computers, and other specialized or general-purpose hosts can all
be nodes in a computer network. Hostnames and network addresses are used to
identify them. In this article, we are going to discuss computer networking in detail.
1. Network Devices
Basic hardware interconnecting network nodes, such as Network Interface Cards
(NICs), Bridges, Hubs, Switches, and Routers, are used in all networks. In addition, a
mechanism for connecting these building parts is necessary, which is usually galvanic
cable and optical cable are less popular (“optical fiber”)The following are the network
devices :
NIC (Network Interface Card): A network card, often known as a network
adapter or NIC (network interface card), is computer hardware that enables
computers to communicate via a network. It offers physical access to networking
media and, in many cases, MAC addresses serve as a low-level addressing scheme.
Each network interface card has a distinct identifier. This is stored on a chip that is
attached to the card.
Repeater: A repeater is an electrical device that receives a signal, cleans it of
unwanted noise, regenerates it, and retransmits it at a higher power level or to the
opposite side of an obstruction, allowing the signal to travel greater distances
without degradation. In the majority of twisted pair Ethernet networks, Repeaters
are necessary for cable lengths longer than 100 meters in some systems. Repeaters
are based on physics.
Hub: A hub is a device that joins together many twisted pairs or fiber optic
Ethernet devices to give the illusion of a formation of a single network segment.
The device can be visualized as a multiport repeater. A network hub is a relatively
simple broadcast device. Any packet entering any port is regenerated
and broadcast out on all other ports, and hubs do not control any of the traffic that
passes through them. Packet collisions occur as a result of every packet being sent
out through all other ports, substantially impeding the smooth flow of
communication.
Bridges: Bridges broadcast data to all the ports but not to the one that received the
transmission. Bridges, on the other hand, learn which MAC addresses are
reachable through specific ports rather than copying messages to all ports as hubs
do. Once a port and an address are associated, the bridge will only transport traffic
from that address to that port.
Switches: A switch differs from a hub in that it only forwards frames to the ports
that are participating in the communication, rather than all of the ports that are
connected. The collision domain is broken by a switch, yet the switch depicts itself
as a broadcast domain. Frame-forwarding decisions are made by switches based on
MAC addresses.
Routers: Routers are networking devices that use headers and forwarding tables to
find the optimal way to forward data packets between networks. A router is a
computer networking device that links two or more computer networks and
selectively exchanges data packets between them. A router can use address
information in each data packet to determine if the source and destination are on
the same network or if the data packet has to be transported between networks.
When numerous routers are deployed in a wide collection of interconnected
networks, the routers share target system addresses so that each router can develop
a table displaying the preferred pathways between any two systems on the
associated networks.
Gateways: To provide system compatibility, a gateway may contain devices such
as protocol translators, impedance-matching devices, rate converters, fault
isolators, or signal translators. It also necessitates the development of
administrative procedures that are acceptable to both networks. By completing the
necessary protocol conversions, a protocol translation/mapping gateway joins
networks that use distinct network protocol technologies.
Leased
Bluetooth, Ethernet FDDI, CDDi.
Technology Ethernet Line,
IrDA,Zigbee & Wifi ATM
Dial-Up
Above 50
Range 1-100 m Upto 2km 1 – 5 km 5-50 km
km
Transmission Very
Very High High Average Low
Speed High
Parameters PAN LAN CAN MAN WAN
Private or Private or
Ownership Private Private Private
Public Public
Very
Maintenance Very Easy Easy Moderate Difficult
Difficult
Very
Cost Very Low Low Moderate High
High
OSI stands for Open Systems Interconnection, where open stands to say non-
proprietary. It is a 7-layer architecture with each layer having specific functionality to
perform. All these 7 layers work collaboratively to transmit the data from one person
to another across the globe. The OSI reference model was developed by ISO –
‘International Organization for Standardization„, in the year 1984.
The OSI model provides a theoretical foundation for understanding network
communication. However, it is usually not directly implemented in its entirety in
real-world networking hardware or software. Instead, specific
protocols and technologies are often designed based on the principles outlined in
the OSI model to facilitate efficient data transmission and networking operations.
Helps in
identifying the
Application
client and Message SMTP
Layer
synchronizing
7 communication.
Establishes
Connection,
Maintenance, Message (or
Session Layer Ensures encrypted Gateway
Authentication message)
and Ensures
5 security.
Take Service
from Network
Transport Layer and
Segment Firewall
Layer provide it to the
Application
4 Layer.
Transmission of
data from one
Network Layer host to another, Packet Router
located in
3
different
Information
Form (Data
Layer No Layer Name Responsibility Unit) Device or Protocol
networks.
Node to Node
Data Link
Delivery of Frame Switch, Bridge
Layer
2 Message.
Establishing
Physical
Hub, Repeater, Modem,
Physical Layer Connections Bits
Cables
between
1 Devices.
In the above figure, it shows how a data gram approach is used to deliver four packets
from station A to station D.
Similarities:
The delay between data units in circuit switching is The delay between data units in
uniform. packet switching is not uniform.
Congestion can occur during the connection Congestion can occur during the data
establishment phase because there might be a case transfer phase, a large number of
where a request is being made for a channel but the packets comes in no time.
channel is already occupied.
Circuit switching is not convenient for handling Packet switching is suitable for
bilateral traffic. handling bilateral traffic.
Circuit Switching does not support store and Packet Switching supports store and
forward transmission forward transmission
Circuit Switching Packet Switching
In-circuit switching each packet follows the same In packet switching packets can
route. follow any route.
Circuit switching requires simple protocols for Packet switching requires complex
delivery. protocols for delivery.
Error is a condition when the receiver‟s information does not match the sender‟s
information. During transmission, digital signals suffer from noise that can introduce
errors in the binary bits traveling from sender to receiver. That means a 0 bit may
change to 1 or a 1 bit may change to 0.
Data (Implemented either at the Data link layer or Transport Layer of the OSI Model)
may get scrambled by noise or get corrupted whenever a message is transmitted. To
prevent such errors, error-detection codes are added as extra data to digital messages.
This helps in detecting any errors that may have occurred during message
transmission.
Types of Errors
Single-Bit Error
A single-bit error refers to a type of data transmission error that occurs when one bit
(i.e., a single binary digit) of a transmitted data unit is altered during transmission,
resulting in an incorrect or corrupted data unit.
Single-Bit Error
Multiple-Bit Error
A multiple-bit error is an error type that arises when more than one bit in a data
transmission is affected. Although multiple-bit errors are relatively rare when
compared to single-bit errors, they can still occur, particularly in high-noise or high-
interference digital environments.
Multiple-Bit Error
Burst Error
When several consecutive bits are flipped mistakenly in digital transmission, it creates
a burst error. This error causes a sequence of consecutive incorrect values.
Burst Error
Two-dimensional Parity check bits are calculated for each row, which is equivalent
to a simple parity check bit. Parity check bits are also calculated for all columns, then
both are sent along with the data. At the receiving end, these are compared with the
parity bits calculated on the received data.
Checksum
Checksum error detection is a method used to identify errors in transmitted data. The
process involves dividing the data into equally sized segments and using a 1‟s
complement to calculate the sum of these segments. The calculated sum is then sent
along with the data to the receiver. At the receiver‟s end, the same process is repeated
and if all zeroes are obtained in the sum, it means that the data is correct.
Checksum – Operation at Sender’s Side
Firstly, the data is divided into k segments each of m bits.
On the sender‟s end, the segments are added using 1‟s complement arithmetic to
get the sum. The sum is complemented to get the checksum.
The checksum segment is sent along with the data segments.
Checksum – Operation at Receiver’s Side
At the receiver‟s end, all received segments are added using 1‟s complement
arithmetic to get the sum. The sum is complemented.
If the result is zero, the received data is accepted; otherwise discarded.
Disadvantages
If one or more bits of a segment are damaged and the corresponding bit or bits of
opposite value in a second segment are also damaged.
Unlike the checksum scheme, which is based on addition, CRC is based on binary
division.
In CRC, a sequence of redundant bits, called cyclic redundancy check bits, are
appended to the end of the data unit so that the resulting data unit becomes exactly
divisible by a second, predetermined binary number.
At the destination, the incoming data unit is divided by the same number. If at this
step there is no remainder, the data unit is assumed to be correct and is therefore
accepted.
A remainder indicates that the data unit has been damaged in transit and therefore
must be rejected.
Hamming Code in Computer Network
Hamming code is a set of error-correction codes that can be used to detect and correct
the errors that can occur when the data is moved or stored from the sender to the
receiver. It is a technique developed by R.W. Hamming for error correction.
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:
2^r ≥ m + r + 1
Suppose the number of data bits is 7, then the number of redundant bits can be
calculated using: = 2^4 ≥ 7 + 4 + 1 .Thus, the number of redundant bits= 4
Types of Parity bits
A parity bit is a bit appended to a data of binary bits to ensure that the total number of
1‟s in the data is even or odd. Parity bits are used for error detection. There are two
types of parity bits:
1. Even parity bit: In the case of even parity, for a given set of bits, the number of
1‟s are counted. If that count is odd, the parity bit value is set to 1, making the total
count of occurrences of 1‟s an even number. If the total number of 1‟s in a given
set of bits is already even, the parity bit‟s value is 0.
2. Odd Parity bit: In the case of odd parity, for a given set of bits, the number of 1‟s
are counted. If that count is even, the parity bit value is set to 1, making the total
count of occurrences of 1‟s an odd number. If the total number of 1‟s in a given set
of bits is already odd, the parity bit‟s value is 0.
Algorithm of Hamming Code
Hamming Code is simply the use of extra parity bits to allow the identification of an
error.
Write the bit positions starting from 1 in binary form (1, 10, 11, 100, etc).
All the bit positions that are a power of 2 are marked as parity bits (1, 2, 4, 8, etc).
All the other bit positions are marked as data bits.
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.
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- 1, 2, 4, and
8
Suppose the data to be transmitted is 1011001 from sender to receiver, the bits will
be placed as follows:
Determining the Parity bits According to Even Parity
R1 bit is calculated using parity check at all the bits positions whose binary
representation includes a 1 in the least significant position. R1: bits 1, 3, 5, 7, 9,
11
To find the redundant bit R1, we check for even parity. Since the total number of
1‟s in all the bit positions corresponding to R1 is a odd number the value of R1
(parity bit‟s value) = 1
R2 bit is calculated using parity check at all the bits positions whose binary
representation includes a 1 in the second position from the least significant bit. R2:
bits 2,3,6,7,10,11
To find the redundant bit R2, we check for even parity. Since the total number of
1‟s in all the bit positions corresponding to R2 is odd the value of R2(parity bit‟s
value)=1
R4 bit is calculated using parity check at all the bits positions whose binary
representation includes a 1 in the third position from the least significant bit. R4:
bits 4, 5, 6, 7
1. To find the redundant bit R4, we check for even parity. Since the total number of
1‟s in all the bit positions corresponding to R4 is an even the value of R4(parity
bit‟s value) = 0
2. R8 bit is calculated using parity check at all the bits positions whose binary
representation includes a 1 in the fourth position from the least significant bit. R8:
bit 8,9,10,11
To find the redundant bit R8, we check for even parity. Since the total number of
1‟s in all the bit positions corresponding to R8 is an even number the value of
R8(parity bit‟s value)=0. Thus, the data transferred is:
For all the parity bits we will check the number of 1‟s in their respective bit positions.
For R1: bits 1, 3, 5, 7, 9, 11. We can see that the number of 1‟s in these bit
positions are 4 and that‟s even so we get a 0 for this.
For R2: bits 2,3,6,7,10,11 . We can see that the number of 1‟s in these bit positions
are 5 and that‟s odd so we get a 1 for this.
For R4: bits 4, 5, 6, 7 . We can see that the number of 1‟s in these bit positions are
3 and that‟s odd so we get a 1 for this.
For R8: bit 8,9,10,11 . We can see that the number of 1‟s in these bit positions are
2 and that‟s even so we get a 0 for this.
The bits give the binary number 0110 whose decimal representation is 6. Thus, bit
6 contains an error. To correct the error the 6th bit is changed from 1 to 0.
Features of Hamming Code
Error Detection and Correction: Hamming code is designed to detect and correct
single-bit errors that may occur during the transmission of data. This ensures that the
recipient receives the same data that was transmitted by the sender.
Redundancy: Hamming code uses redundant bits to add additional information to the
data being transmitted. This redundancy allows the recipient to detect and correct
errors that may have occurred during transmission.
Efficiency: Hamming code is a relatively simple and efficient error-correction
technique that does not require a lot of computational resources. This makes it ideal
for use in low-power and low-bandwidth communication networks.
Widely Used: Hamming code is a widely used error-correction technique and is used
in a variety of applications, including telecommunications, computer networks, and
data storage systems.
Single Error Correction: Hamming code is capable of correcting a single-bit error,
which makes it ideal for use in applications where errors are likely to occur due to
external factors such as electromagnetic interference.
Limited Multiple Error Correction: Hamming code can only correct a limited
number of multiple errors. In applications where multiple errors are likely to occur,
more advanced error-correction techniques may be required.
Types of FEC
Block codes and convolutional codes are two structurally different types of
codes that are often used nowadays.
Block codes
A block code encoder divides the information sequence "u" into message blocks
of "k" information bits (symbols) and converts each message "u" into an n-bit
code (symbols). The coding rate is defined as "R = k/n". The redundant bits
(symbols), n-k, give the code the ability to deal with channel noise.
The minimum distance, dmin, between two closest codewords, which specifies the
minimum amount of data changes required to turn one valid codeword into
another, is an essential parameter of a block code. This parameter determines a
code's ability to detect and rectify errors.
Usually, an FEC code can detect and correct up to (dmin - 1)/2 mistakes per
codeword.
Convolutional codes
To provide reliable transmission across a noisy channel and redundant bits, n-k,
further redundancy is added by raising the memory order "m" of the code.