0% found this document useful (0 votes)
2 views61 pages

Module-3&4

The document provides an overview of network cabling, its importance, types, and benefits, emphasizing its role as the backbone of network infrastructure. It details various types of cables such as coaxial, fiber optic, STP, and UTP, along with the functions of network devices like NICs, hubs, switches, and routers. Additionally, it covers framing in the data link layer, including frame structure, types of framing, and data link control mechanisms like flow control and error detection.

Uploaded by

sandhyashankar20
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views61 pages

Module-3&4

The document provides an overview of network cabling, its importance, types, and benefits, emphasizing its role as the backbone of network infrastructure. It details various types of cables such as coaxial, fiber optic, STP, and UTP, along with the functions of network devices like NICs, hubs, switches, and routers. Additionally, it covers framing in the data link layer, including frame structure, types of framing, and data link control mechanisms like flow control and error detection.

Uploaded by

sandhyashankar20
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Unit-3 Physical Layer

Network Cabling
A network cable is a type of cable that connects devices to an Ethernet or other type of
network. It’s an essential part of any IT infrastructure, whether at home or in a business.
Because so many things rely on networks today, from computers to smart TVs and
everything in between, your network cables must be working properly. A quick look at
some basic specs about this piece of technology can help you understand why it’s so
necessary for networking purposes:

Network Cabling Definition


Network cabling is the physical infrastructure that connects computers and other
devices to a network. It can be installed by your IT department or an outside contractor,
but regardless of who does the installation, it’s essential to ensure that network cabling
is installed correctly.
A poorly designed network can cause data loss or downtime. To prevent these issues
from affecting you and your business, we’ll explain what network cabling is and why it’s
so important to have it installed correctly.

Why is network cabling important?


Network cabling is the backbone of your network. It is the conduit that allows your
network hardware to communicate with each other, and it’s also the medium that carries
data from one device to another. In short, the infrastructure allows you to connect your
network devices so they can share information or resources such as a printer or internet
access.
Network cabling is a crucial part of any network. It’s how the computers and devices
that are connected to the network communicate with each other. Without network
cables, it would be impossible for any device on your network to send or receive data.
That’s why it’s important to understand what kind of cable you’ll need for your network
and why you should invest in high-quality cabling when building or upgrading your
business’s network.

Types of Network Cabling


To understand network cabling and its importance, you should know the different types
of network cables that are available. The following are the four main types of network
cables:
Coaxial Cable
This type of cable is commonly used in older buildings. It uses a copper core
surrounded by an insulating material, then a metal sheath. The metal sheath gives it
strength while keeping out outside elements such as water or dirt. It is straightforward to
install and is often used in home networks. This type of cable is not recommended for
use in commercial buildings because it can only transmit signals over short distances.

Fiber Optic Cable


This type of cable was developed as a replacement for coaxial because it can carry
more data over longer distances with less loss than coaxial cables. Fiber optic cables
consist of two thin pieces (sometimes called fibers) made from plastic or glass that
transmit information through pulses of light instead of electricity, like other types of
cables do. They have several advantages, including faster transfer rates, greater
bandwidth capacity, immunity from electromagnetic interference, longer distances
between nodes (100 meters compared to 10 meters on UTP), resistance against
corrosion and fire damage if sealed adequately at each endpoint within a conduit
leading outside building walls which may contain one or more fiber optic pair(s).

Shielded Twisted Pair (STP) Cable


Shielded twisted pair (STP) cable is a single-pair wire consisting of four pairs: two pairs
for transmitting signals and two for receiving them. This type of cable is commonly used
in telephone systems and computer networks because it can withstand interference
from power lines, radio waves, and other sources that could otherwise disrupt regular
operation by introducing noise into signals being transmitted over long distances via
copper wire connections between servers or desktop computers located within buildings

Unshielded Twisted Pair (UTP) Cable


Unshielded twisted pair (UTP) is most commonly used in telephone lines because it is
cheaper and easier to install than other cabling systems, such as fiber optic cable or
coaxial cable. UTP is also used in computer networks because it can be run through
walls and ceilings without needing additional tools or special equipment. This cabling
system relies on copper wires that are twisted around each other to reduce interference
from external sources that could disrupt data transmission over long distances via
copper wire connections between servers.
Network Cabling Benefits
Network cabling is the backbone of your business. It allows you to connect all your
computers and devices to share files and information with the world.
But it isn’t just about connecting—cable networking offers many other benefits. Here are
some of the best:

Improved network performance


Network cabling helps improve a network’s performance by providing increased
bandwidth and better signal quality, ultimately allowing you to transmit data faster. You’ll
find that with improved signal quality, you can stream media more quickly, download
files in less time and even engage in video conferencing without experiencing static or
interference from other networks.

Increased security
Many people forget about network security when it comes to cabling their offices or
homes, but it’s an essential part of any home or office network setup. Suppose you want
to protect your computer network from outside threats such as viruses or hackers. In
that case, installing proper cabling can help prevent them from gaining access to your
system through unprotected cables such as USB ports or wireless routers.

Lower costs
Installing proper cabling systems will reduce costs by allowing companies who have
poor infrastructure (weak signals) no longer need expensive equipment like repeaters
which cost thousands of dollars each month just because they don’t have enough
bandwidth available within their walls so they must add additional hardware devices
called “repeaters” onto their existing systems which increases overall operational costs
significantly over time due solely on one factor: inadequate planning during initial
construction/installation stages before plopping down thousands upon thousands more
dollars annually afterward just because we didn’t think ahead properly…

Increased productivity
A more robust and faster network will allow employees to get their work done more
efficiently. This will lead to a more productive workforce and increase your business’s
overall productivity. The more efficiently your employees can complete their daily tasks,
the less time they will spend on them and have available to focus on new projects or
other areas that need attention.
Network Interface Card (NIC)
Network Interface Card (NIC) is a hardware component that is present on
the computer. It is used to connect different networking devices such as
computers and servers to share data over the connected network. It provides
functionality such as support for I/O interrupt, Direct Memory Access (DMA)
interfaces, partitioning, and data transmission.

NIC is important for us to establish a wired or wireless connection over the


network.

Network Interface Card is also known as Network Interface Controller,


Network Adapter, Ethernet card, Connection card, and LAN (Local
Area Network) Adapter.

Functions of the Network Interface Card


A list of functions of the Network Interface Card is given below -

1. NIC is used to convert data into a digital signal.


2. In the OSI model, NIC uses the physical layer to transmit signals and the
network layer to transmit data packets.
3. NIC offers both wired (using cables) and wireless (using Wi-Fi) data
communication techniques.
4. NIC is a middleware between a computer/server and a data network.
5. NIC operates on both physical as well as the data link layer of the OSI model.

Components of Network Interface Card


Network Interface Card contains the following essential components -

1. Memory

Memory is one of the most important components of the NIC. It is used to


store the data during communication.

2. Connectors

connectors are used to connect the cables to the Ethernet port.

3. Processor
Processor is used for converting the data message into a suitable form of
communication.

4. Jumpers

Jumpers are the small device that is used to control the communication
operations without the need of any software. It is also used to determine
settings for the interrupt request line, I/O address, upper memory block, and
type of transceiver.

5. Routers

To provide wireless connectivity, routers are used.

6. MAC address

MAC address is also referred to as a physical network address. It is a


unique address that is present to the network interface card where ethernet
packets are communicated with the computer.
Network Devices (Hub, Repeater,
Bridge, Switch, Router, Gateways)
Network devices or networking hardware are the physical devices that are
used for establishing connections and facilating interaction between different
devices in a computer network.

Hub
Hubs work in the physical layer of the OSI model. A hub is a device for
connecting multiple Ethernet devices and making them act as a single network
segment. It has multiple inputs and output ports in which a signal introduced at
the input of any port appears at the output of every port except the original
incoming port.

A hub can be used with both digital and analog data. Hubs do not perform
packet filtering or addressing function, they send the data packets to all the
connected devices.

Repeater

A repeater operates at the physical layer of the OSI model.

 A Repeater connects two segments of a network cable.


 Sometimes it regenerates the signals to proper amplitudes and sends
them to the other segment.
 If the signal becomes weak, it can copy the signal bit by bit and
regenerate it at the original strength.
 It is a 2-port device.

Bridge

A bridge operates at the data link layer of the OSI model. It can read only the
outmost hardware address of the packet but cannot read the IP address. It reads
the outmost section of the data packet to tell where the message is going. It
reduces the traffic on other network segments. It does not send all the packets.
So, a bridge can be programmed to reject packets from a particular network.
Switch
Switches may operate at one or more layers of the OSI model. They may
operate in the data link layer and network layer; a device that operates
simultaneously at more than one of these layers is known as a multilayer switch.

A Switch can check the errors before forwarding the data, which makes it more
efficient and improves its performance. A switch is the better version of a hub. It
is a multi-port bridge device.

Router

Routers are small physical devices that operate at the network layer to join
multiple networks together.

 A router is a device like a switch that routes data packets based on their
IP addresses.

 Routers normally connect LANs and WANs and have a dynamically


updating routing table based on which they make decisions on routing the
data packets.

 A Router divides the broadcast domains of hosts connected through it.

 Routers perform the traffic directing functions on the Internet. A data


packet is typically forwarded from one router to another through the
networks that constitute the internetwork until it reaches its destination
code.
 Routers may also be used to connect two or more logical groups of
computer devices known as subnets, each with a different subnetwork
address. The subnet addresses recorded in a router do not necessarily
map directly to the physical interface connections.
Two types of routers −
 Static routers – Static routers are configured manually and route data
packets based on the information in a router table.
 Dynamic routers – Dynamic routers use adaptive routing which is a
process where a router can forward data by a different route.

Gateway

A gateway is an internetworking capable of joining together two networks


that use different base protocols.

A network gateway can be implemented completely in software, hardware, or a


combination of both, depending on the types of protocols they support.

A network gateway can operate at any level of the OSI model. A broadband
router typically serves as the network gateway, although ordinary computers
can also be configured to perform equivalent functions.

 A gateway is a router or proxy server that routes between networks.


 A gateway belongs to the same subnet to which the PC belongs.
Unit-4
Framing in Data Link Layer
In the physical layer, data transmission involves synchronised transmission of
bits from the source to the destination. The data link layer packs these bits into
frames.
Data-link layer takes the packets from the Network Layer and encapsulates
them into frames. If the frame size becomes too large, then the packet may be
divided into small sized frames. Smaller sized frames makes flow control and
error control more efficient.

Then, it sends each frame bit-by-bit on the hardware. At receiver's end, data link
layer picks up signals from hardware and assembles them into frames.

Parts of a Frame

A frame has the following parts −

 Frame Header − It contains the source and the destination addresses of


the frame.
 Payload field − It contains the message to be delivered.
 Trailer − It contains the error detection and error correction bits.
 Flag − It marks the beginning and end of the frame.
Types of Framing

Framing can be of two types, fixed sized framing and variable sized framing.

Fixed-sized Framing

Here the size of the frame is fixed and so the frame length acts as delimiter of
the frame. Consequently, it does not require additional boundary bits to identify
the start and end of the frame.

Variable – Sized Framing

Here, the size of each frame to be transmitted may be different. So additional


mechanisms are kept to mark the end of one frame and the beginning of the
next frame.

It is used in local area networks.

Two ways to define frame delimiters in variable sized framing are −

 Length Field − Here, a length field is used that determines the size of
the frame. It is used in Ethernet (IEEE 802.3).
 End Delimiter − Here, a pattern is used as a delimiter to determine the
size of frame. It is used in Token Rings.

Data Link Controls


Data Link Control is the service provided by the Data Link Layer to provide
reliable data transfer over the physical medium. For example, In the half-
duplex transmission mode, one device can only transmit the data at a time.
If both the devices at the end of the links transmit the data simultaneously,
they will collide and leads to the loss of the information. The Data link layer
provides the coordination among the devices so that no collision occurs.

The Data link layer provides three functions:

o Line discipline
o Flow Control
o Error Control

Line Discipline
o Line Discipline is a functionality of the Data link layer that provides the
coordination among the link systems. It determines which device can send,
and when it can send the data.

Flow Control
o It is a set of procedures that tells the sender how much data it can transmit
before the data overwhelms the receiver.
o The receiving device has limited speed and limited memory to store the data.
Therefore, the receiving device must be able to inform the sending device to
stop the transmission temporarily before the limits are reached.
o It requires a buffer, a block of memory for storing the information until they
are processed.
Two methods have been developed to control the flow of data:

o Stop-and-wait
o Sliding window

Stop-and-wait

o In the Stop-and-wait method, the sender waits for an acknowledgement after


every frame it sends.
o When acknowledgement is received, then only next frame is sent. The
process of alternately sending and waiting of a frame continues until the
sender transmits the EOT (End of transmission) frame.

Advantage of Stop-and-wait

The Stop-and-wait method is simple as each frame is checked and


acknowledged before the next frame is sent.

Sliding Window

o The Sliding Window is a method of flow control in which a sender can


transmit the several frames before getting an acknowledgement.
o In Sliding Window Control, multiple frames can be sent one after the
another due to which capacity of the communication channel can be
utilized efficiently.
o A single ACK acknowledge multiple frames.
o Sliding Window refers to imaginary boxes at both the sender and
receiver end.
o The window can hold the frames at either end, and it provides the
upper limit on the number of frames that can be transmitted before
the acknowledgement.
o Frames can be acknowledged even when the window is not completely
filled.
o The window has a specific size in which they are numbered as modulo-
n means that they are numbered from 0 to n-1. For example, if n = 8,
the frames are numbered from 0,1,2,3,4,5,6,7,0,1,2,3,4,5,6,7
o The size of the window is represented as n-1. Therefore, maximum n-1
frames can be sent before acknowledgement.
o When the receiver sends the ACK, it includes the number of the next
frame that it wants to receive. For example, to acknowledge the string
of frames ending with frame number 4, the receiver will send the ACK
containing the number 5. When the sender sees the ACK with the
number 5, it got to know that the frames from 0 through 4 have been
received.

Error detection schemes

Error is a condition when the receiver’s information does not match the
sender’s. Digital signals suffer from noise during transmission 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

Error Detection Methods


To detect errors, a common technique is to introduce redundancy bits that
provide additional information. Various techniques for error detection include:
 Simple Parity Check
 Two-Dimensional Parity Check
 Checksum
 Cyclic Redundancy Check (CRC)
Simple Parity Check
Simple-bit parity is a simple error detection method that involves adding an
extra bit to a data transmission. It works as:
 1 is added to the block if it contains an odd number of 1’s, and
 0 is added if it contains an even number of 1’s
This scheme makes the total number of 1’s even, that is why it is called even
parity checking.
Advantages of Simple Parity Check
 Simple parity check can detect all single bit error.
 Simple parity check can detect an odd number of errors.
 Implementation: Simple Parity Check is easy to implement in both
hardware and software.
 Minimal Extra Data: Only one additional bit (the parity bit) is added per
data unit (e.g., per byte).
 Fast Error Detection: The process of calculating and checking the parity
bit is quick, which allows for rapid error detection without significant delay
in data processing or communication.
 Single-Bit Error Detection: It can effectively detect single-bit errors
within a data unit, providing a basic level of error detection for relatively
low-error environments.
Disadvantages of Simple Parity Check
 Single Parity check is not able to detect even no. of bit error.
 For example, the Data to be transmitted is 101010. Codeword
transmitted to the receiver is 1010101 (we have used even parity).
Let’s assume that during transmission, two of the bits of code word flipped
to 1111101.
On receiving the code word, the receiver finds the no. of ones to be even
and hence no error, which is a wrong assumption.

Two-Dimensional Parity Check


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.

Advantages of Two-Dimensional Parity Check


 Two-Dimensional Parity Check can detect and correct all single bit error.
 Two-Dimensional Parity Check can detect two or three bit error that occur
any where in the matrix.
Disadvantages of Two-Dimensional Parity Check
 Two-Dimensional Parity Check can not correct two or three bit error. It
can only detect two or three bit error.
 If we have a error in the parity bit then this scheme will not work.
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.

Cyclic Redundancy Check (CRC)


 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.

CRC Working
We have given dataword of length m and divisor of length n+1.
Step 1: Append n zero’s to the original message
Step 2: Perform modulo 2 division
Step 3: Remainder of division = CRC
Step 4: Code word = Data + CRC
Note:
 CRC must be n bits
 Length of Code word = m+n bits

Example - The data bit to be sent is [100100], and the


polynomial equation is [x3+x2+1].
Data bit - 100100
Divisor (k) - 1101 (Using the given polynomial)
Appending Zeros - (k-1) > (4-1) > 3
Dividend - 100100000
Sender Side:

Now appending the remainder [001] to the data bit and


sharing the new data with the receiver.
New Data Bit - [100100001]
Receiver Side:
The Obtained remainder is [000], i.e., zero, which
according to the CRC method, concludes that the data is
error-free.

Advantages of Error Detection


 Increased Data Reliability: Error detection ensures that the data
transmitted over the network is reliable, accurate, and free from errors.
This ensures that the recipient receives the same data that was
transmitted by the sender.
 Improved Network Performance: Error detection mechanisms can help
to identify and isolate network issues that are causing errors. This can
help to improve the overall performance of the network and reduce
downtime.
 Enhanced Data Security: Error detection can also help to ensure that
the data transmitted over the network is secure and has not been
tampered with.
Disadvantages of Error Detection
 Overhead: Error detection requires additional resources and processing
power, which can lead to increased overhead on the network. This can
result in slower network performance and increased latency.
 False Positives: Error detection mechanisms can sometimes generate
false positives, which can result in unnecessary retransmission of data.
This can further increase the overhead on the network.
 Limited Error Correction: Error detection can only identify errors but
cannot correct them. This means that the recipient must rely on the
sender to retransmit the data, which can lead to further delays and
increased network overhead.

ERROR CORRECTION
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.

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:

 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.

 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.

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:

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
an even number. So, the value of R1 (parity bit’s value) = 0.

 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

 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
odd so the value of R4(parity bit’s value) = 1

 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:

The parity bits are checked against the data bits on the receiver side
to validate that none of them have been changed.

Suppose that data bit 6 was flipped. In that case, parity 2 and 4 would
not be correct. The decoder would see that means that data 6 was in
error and correct it.

Suppose parity bit 2 was in error. Since none of the other parity bits
would be wrong, it would know that only the parity was wrong and
ignore it.

Error Detection and Correction

Suppose in the above example the 6th bit is changed from 0 to 1 during
data transmission, then it gives new parity values in the binary
number:
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.

Stop and Wait Protocol


Stop-and-wait ARQ, commonly known as the alternating bit protocol, refers to a
communication technique used to transmit data between two linked devices. It makes
sure that packets are received in the right order, and that data is not lost as a result of
dropped packets.

What is the Stop and Wait Protocol?


We must first grasp the error control mechanism in order to comprehend the stop and
wait protocol. The error control technique is used to ensure that the received data is
identical to that sent by the sender. The two types of error control mechanisms are
Sliding Window and Stop and Wait ARQ. The sliding window is further separated into
the Go Back N and Selective Repeat categories. People choose the error control
method, stop and wait or sliding window, based on the usage.

Stop and Wait Protocol


In this case, stop and wait means that the sender provides the recipient’s desired data.
The sender pauses after transferring the data and waits for the receiver to acknowledge
his transmission. The stop and wait protocol, which is a flow control protocol, uses the
data link layer’s flow control functionality.

It is a DDL (data-link layer) protocol that is used to send data through channels with no
background noise. It offers unidirectional data transfer, which means that only one of
the two operations, data sending or receiving, can occur concurrently. Although it offers
a flow-control system, there is no error control mechanism.

The concept behind using this frame is that after sending one frame, the sender will wait
for an acknowledgement before sending another one.

Primitives of Stop and Wait Protocol

Sender’s Side
Rule 1: The sender sends one data packet at a time.

Rule 2: The sender only sends the subsequent packet after getting the preceding
packet’s acknowledgement.

Therefore, the concept behind the stop and wait protocol on the sender’s end is
relatively straightforward: Send one packet at a time and refrain from sending any
additional packets until you have received an acknowledgement.

Receiver’s Side
Rule 1: Receive the data packet, then consume it.

Rule 2: The receiver provides the sender with an acknowledgement after consuming
the data packet.

As a result, the stop and wait protocol’s basic tenet on the receiver’s end is similarly
extremely straightforward: Ingest the packet, and after it has been consumed, send the
acknowledgement. This is a mechanism for flow control.
Working of Stop and Wait Protocol

The stop and wait protocol’s operation is depicted in the above figure. The sender
sends the packet, referred to as a data packet if there is a sender and a receiver. After
receiving a data packet, the receiver sends an acknowledgement. Without receiving
acknowledgement for the first packet, the sender won’t send the second packet. The
sender sends the subsequent packet after receiving the acknowledgement.

This procedure keeps going until all of the packets have been sent. The stop and wait
protocol’s main benefit is simplicity, but there are some drawbacks as well. For
instance, if 1000 data packets need to be delivered, they cannot all be sent at once
since this protocol only sends one packet at a time.
Disadvantages of Stop and Wait Protocol

1. Problems arise because of lost data

Let’s say the sender sends the data, but it gets lost in transit. The receiver is patiently
awaiting the data packet. The receiver does not send an acknowledgement because it
does not receive the data. The sender won’t send the subsequent packet because it has
not received any acknowledgement. The lost data is the root cause of this issue.

In this instance, there are two problems:

 The sender waits an endless length of time for a response.


 The receiver waits indefinitely for data.
2. Problems arise as a result of the lost acknowledgement

Let’s say the data was sent by the sender and was also received by the recipient. The
receiver transmits the acknowledgement after receiving the packet. In this instance,
there is no chance for the sender to get the acknowledgement because the
acknowledgement is lost in a network. Additionally, there is no chance for a sender to
send the subsequent packet because, according to the stop and wait protocol, this
cannot happen until the previous packet’s acknowledgement has been received.

One issue arises in this situation:

 The sender waits an endless time for an acknowledgement.


3. Problem resulting from delayed data or acknowledgement

Let’s say the data was sent by the sender and was also received by the recipient. The
acknowledgement is then sent by the recipient, but it is not received until the timeout
period has passed on the sender’s end. Due to the acknowledgement being received
after this, it can be mistaken for acknowledging the receipt of another data packet.
Sliding Window Protocol

Sliding Window Protocol is actually a theoretical concept in which we have


only talked about what should be the sender window size (1+2a) in order to
increase the efficiency of stop and wait arq. Now we will talk about the
practical implementations in which we take care of what should be the size of
receiver window. Practically it is implemented in two protocols namely :
1. Go Back N (GBN)
2. Selective Repeat (SR)
In this article, we will explain you about the first protocol which is GBN in
terms of three main characteristic features and in the next part we will be
discussing SR as well as comparison of both these protocols

Go-Back-N ARQ
Before understanding the working of Go-Back-N ARQ, we first look at the
sliding window protocol. As we know that the sliding window protocol is
different from the stop-and-wait protocol. In the stop-and-wait protocol, the
sender can send only one frame at a time and cannot send the next frame
without receiving the acknowledgment of the previously sent frame,
whereas, in the case of sliding window protocol, the multiple frames can be
sent at a time. The variations of sliding window protocol are Go-Back-N ARQ
and Selective Repeat ARQ. Let's understand 'what is Go-Back-N ARQ'.

What is Go-Back-N ARQ?

Go Back N ARQ which stands for Go Back N Automatic Repeat


Request (ARQ) is a data link layer protocol that is used for data
flow control purposes. It is a sliding window protocol in which
multiple frames are sent from sender to receiver at once
In Go-Back-N ARQ, N is the sender's window size. Suppose we say that Go-
Back-3, which means that the three frames can be sent at a time before
expecting the acknowledgment from the receiver.
It uses the principle of protocol pipelining in which the multiple frames can
be sent before receiving the acknowledgment of the first frame. If we have
five frames and the concept is Go-Back-3, which means that the three
frames can be sent, i.e., frame no 1, frame no 2, frame no 3 can be sent
before expecting the acknowledgment of frame no 1.

In Go-Back-N ARQ, the frames are numbered sequentially as Go-Back-N ARQ


sends the multiple frames at a time that requires the numbering approach to
distinguish the frame from another frame, and these numbers are known as
the sequential numbers.

The number of frames that can be sent at a time totally depends on the size
of the sender's window. So, we can say that 'N' is the number of frames that
can be sent at a time before receiving the acknowledgment from the
receiver.

If the acknowledgment of a frame is not received within an agreed-upon time


period, then all the frames available in the current window will be
retransmitted. Suppose we have sent the frame no 5, but we didn't receive
the acknowledgment of frame no 5, and the current window is holding three
frames, then these three frames will be retransmitted.

The sequence number of the outbound frames depends upon the size of the
sender's window. Suppose the sender's window size is 2, and we have ten
frames to send, then the sequence numbers will not be 1,2,3,4,5,6,7,8,9,10.
Let's understand through an example.

Working of Go-Back-N ARQ


Suppose there are a sender and a receiver, and let's assume that there are
11 frames to be sent. These frames are represented as
0,1,2,3,4,5,6,7,8,9,10, and these are the sequence numbers of the frames.
Mainly, the sequence number is decided by the sender's window size. But,
for the better understanding, we took the running sequence numbers, i.e.,
0,1,2,3,4,5,6,7,8,9,10. Let's consider the window size as 4, which means that
the four frames can be sent at a time before expecting the acknowledgment
of the first frame.

Step 1: Firstly, the sender will send the first four frames to the receiver, i.e.,
0,1,2,3, and now the sender is expected to receive the acknowledgment of
the 0th frame.
Let's assume that the receiver has sent the acknowledgment for the 0 frame,
and the receiver has successfully received it.

The sender will then send the next frame, i.e., 4, and the window slides
containing four frames (1,2,3,4).
The receiver will then send the acknowledgment for the frame no 1. After
receiving the acknowledgment, the sender will send the next frame, i.e.,
frame no 5, and the window will slide having four frames (2,3,4,5).

Now, let's assume that the receiver is not acknowledging the frame no 2,
either the frame is lost, or the acknowledgment is lost. Instead of sending
the frame no 6, the sender Go-Back to 2, which is the first frame of the
current window, retransmits all the frames in the current window, i.e.,
2,3,4,5.

ADVERTISEMENT
Important points related to Go-Back-N ARQ:

o In Go-Back-N, N determines the sender's window size, and the size of


the receiver's window is always 1.
o It does not consider the corrupted frames and simply discards them.
o It does not accept the frames which are out of order and discards
them.
o If the sender does not receive the acknowledgment, it leads to the
retransmission of all the current window frames.
Selective Repeat ARQ?
The selective repeat ARQ is one of the Sliding Window Protocol
strategies that is used where reliable in-order delivery of the data packets
is required. The selective repeat ARQ is used for noisy channels or links
and it manages the flow and error control between the sender and the
receiver. In the selective repeat ARQ, we only resend the data frames
that are damaged or lost.

If any frame is lost or damaged then the receiver sends a negative


acknowledgment (NACK) to the sender and if the frame is correctly
received, it sends back an acknowledgment (ACK). As we only resend
the selected damaged frames we name this technique the Selective
Repeat ARQ technique. The ACK and the NACK have the sequence
number of the frame that helps the sender identify the lost frame.

What is Selective Repeat ARQ?


The selective repeat ARQ is one of the Sliding Window Protocol
strategies that is used where reliable in-order delivery of the data packets
is required. The selective repeat ARQ is used for noisy channels or links
and it manages the flow and error control between the sender and the
receiver.

In the selective repeat ARQ, we only resend the data frames that are
damaged or lost. On the other hand, the correct frames are received at
the receiver's end and are buffered for future usage. As we only resend
the selected damaged frames we name this technique the Selective
Repeat ARQ technique.

In the Selective Repeat ARQ protocol, ARQ stands for Automatic


Repeat Request. ARQ is an error-control strategy that ensures that a
sequence of information is delivered in order and without any errors or
duplications despite transmission errors and losses.
Requirements for Error Control:

 It helps us to detect if there is any kind of error in the transmission


of data.
 Error detection also introduces the concept of ACK and NACK
which helps to detect the proper delivery of data frames.
 It also helps the sender to detect the damaged or lost data frames so
that the sender can re-transmit the frame.

In selective repeat ARQ, the sender sets a timer for each frame so
whenever the timer is over and the sender has not received any
acknowledgment for the frame, then the sender knows that the particular
frame is either lost or damaged. So, the sender sends back the lost or
damaged frame once the timer is out.

Now, as we can see the sender needs to wait for the timer to expire
before retransmission. So, we use negative acknowledgment or NACK.
As the receiver receives frames from the sender, it keeps track of the
sequence number of the frame buffers it into the memory, and sends an
ACK from the frame. The ack or acknowledgment lets the sender know
that the particular frame is correctly received by the receiver.

Now, if any frame is lost or damaged then the receiver sends a NACK to
the sender. When the sender gets NACK then it retransmits the lost
frame only. The receiver does not discard all the subsequent frames
following a lost frame, it just sends back A NACK and stores the rest of
the frames in its memory buffer. In this way, the sender does not need to
wait for the timer to expire. Hence, the performance of the selective
repeat ARQ increases.

The ACK and the NACK have the sequence number of the frame that
helps the sender identify the lost frame.
As the receiver may receive the frames in a different order, the receiver
has the capability of sorting the frames present in the memory buffer
using the sequence numbers. On the other hand, the sender must be
capable enough to search for the lost frame for which the NACK has
been received. So searching at the sender's end and sorting at the
receiver's are two minor drawbacks of the selective repeat ARQ.

Note: The sliding window protocol is a data link layer protocol that is
useful in the sequential and reliable delivery of the data frames. Using
the sliding window protocol, the sender can send multiple frames at a
time.

The other two sliding window protocol strategies are:

 1-bit or Stop & Wait ARQ, and


 Go-Back-N ARQ.

Let us learn the workings of the selective repeat ARQ using an example
in the next section.

Working of Selective Repeat Protocol


Before learning about the working of the selective repeat ARQ, we
should be familiar with the window size of the sender and receiver as the
selective repeat ARQ is a type of sliding window protocol only.

In the selective repeat ARQ, both the sender and the receiver have
windows of the same size. The window on the sender's side covers the
sequence of data packets that are sent (or to be sent). On the other hand,
the window on the receiver's side covers the sequence of data packets
that are received (or to be received).

The overall working of the selective repeat ARQ is simple. Initially, the
sender sends several frames according to the window size. The receiver
on the other end receives the frames and sends the ACK for the correct
frames and NACK for lost or damaged frames. The sender re-transmits
the frames for which the NACK was sent by the receiver. After
receiving all the frames, the receiver sorts the frame according to the
sequence number for further usage.

Now, let us take an example to visualize the working of selective repeat


ARQ or how the data packet is transmitted using the selective repeat
ARQ protocol. The image below shows the transmission of frames. Let
us suppose that the window size of the sender and the receiver is 2.

The steps of data transmission can be:

1. The sender sends frames 0 and 1.


2. The receiver receives the frames and sends back ACK 0 and ACK
1.
3. Again the sender sends the frames 2 and 3.
4. The receiver only receives the frame 3. So it sends back NACK 2
which means that the 2nd frame is lost and needs to be re-
transmitted.
5. So, the sender sends back frame 2 and this process is continued till
all the frames have been received by the receiver.

Medium Access Control Sublayer (MAC


sublayer)

The medium access control (MAC) is a sublayer of the data link layer of
the open system interconnections (OSI) reference model for data
transmission. It is responsible for flow control and multiplexing for transmission
medium. It controls the transmission of data packets via remotely shared
channels. It sends data over the network interface card.

MAC Layer in the OSI Model

The Open System Interconnections (OSI) model is a layered networking


framework that conceptualizes how communications should be done between
heterogeneous systems. The data link layer is the second lowest layer. It is
divided into two sublayers −

 The logical link control (LLC) sublayer


 The medium access control (MAC) sublayer

The following diagram depicts the position of the MAC layer −


Functions of MAC Layer
 It provides an abstraction of the physical layer to the LLC and upper layers
of the OSI network.
 It is responsible for encapsulating frames so that they are suitable for
transmission via the physical medium.
 It resolves the addressing of source station as well as the destination
station, or groups of destination stations.
 It performs multiple access resolutions when more than one data frame is
to be transmitted. It determines the channel access methods for
transmission.
 It also performs collision resolution and initiating retransmission in case of
collisions.
 It generates the frame check sequences and thus contributes to
protection against transmission errors.

MAC Addresses
MAC address or media access control address is a unique identifier allotted to
a network interface controller (NIC) of a device. It is used as a network
address for data transmission within a network segment like Ethernet, Wi-Fi,
and Bluetooth.
MAC address is assigned to a network adapter at the time of manufacturing. It is
hardwired or hard-coded in the network interface card (NIC). A MAC address
comprises of six groups of two hexadecimal digits, separated by hyphens,
colons, or no separators. An example of a MAC address is 00:0A:89:5B:F0:11.

Ethernet
Ethernet is a system for connecting a number of computer systems to form a local area network,
with protocols to control the passing of information and to avoid simultaneous transmission by two or
more systems.

Ethernet is the most widely used LAN technology and is defined under IEEE
standards 802.3. The reason behind its wide usability is that Ethernet is easy
to understand, implement, and maintain, and allows low-cost network
implementation. Also, Ethernet offers flexibility in terms of the topologies that
are allowed. Ethernet generally uses a bus topology.

1. Ethernet operates in two layers of the OSI model, the physical layer
and the data link layer. For Ethernet, the protocol data unit is a frame
since we mainly deal with DLLs.

2. In order to handle collisions, the Access control mechanism used


in Ethernet is CSMA/CD.
Although Ethernet has been largely replaced by wireless networks, wired
networking still uses Ethernet more frequently. Wi-Fi eliminates the need for
cables by enabling users to connect their smartphones or laptops to a
network wirelessly. The 802.11ac Wi-Fi standard offers faster maximum data
transfer rates when compared to Gigabit Ethernet. However, wired
connections are more secure and less susceptible to interference than
wireless networks. This is the main justification for why so many companies
and organizations continue to use Ethernet.

Basic frame format which is required for all MAC implementation is defined
in IEEE 802.3 standard. Though several optional formats are being used to
extend the protocol’s basic capability.

1. Ethernet frame starts with Preamble and SFD, both work at the
physical layer.
2. Ethernet header contains both the Source and Destination MAC
address.
3. After that, the payload of the frame is present.
4. The last field is CRC which is used to detect the error.

Ethernet (IEEE 802.3) Frame Format:

1. PREAMBLE – Ethernet frame starts with a 7-Bytes Preamble. This is a


pattern of alternative 0’s and 1’s which indicates starting of the frame and
allow sender and receiver to establish bit synchronization. Initially, PRE
(Preamble) was introduced to allow for the loss of a few bits due to signal
delays. But today’s high-speed Ethernet doesn’t need Preamble to protect
the frame bits. PRE (Preamble) indicates the receiver that frame is
coming and allow the receiver to lock onto the data stream before the
actual frame begins.
2. Start of frame delimiter (SFD) – This is a 1-Byte field that is always set
to 10101011. SFD indicates that upcoming bits are starting the frame,
which is the destination address. Sometimes SFD is considered part of
PRE, this is the reason Preamble is described as 8 Bytes in many places.
The SFD warns station or stations that this is the last chance for
synchronization.
3. Destination Address – This is a 6-Byte field that contains the MAC
address of the machine for which data is destined.
4. Source Address – This is a 6-Byte field that contains the MAC address
of the source machine. As Source Address is always an individual
address (Unicast), the least significant bit of the first byte is always 0.
5. Length – Length is a 2-Byte field, which indicates the length of the entire
Ethernet frame. This 16-bit field can hold a length value between 0 to
65534, but length cannot be larger than 1500 Bytes because of some own
limitations of Ethernet.
6. Data – This is the place where actual data is inserted, also known
as Payload. Both IP header and data will be inserted here if Internet
Protocol is used over Ethernet. The maximum data present may be as
long as 1500 Bytes. In case data length is less than minimum length i.e.
46 bytes, then padding 0’s is added to meet the minimum possible length.
7. Cyclic Redundancy Check (CRC) – CRC is 4 Byte field. This field
contains a 32-bits hash code of data, which is generated over the
Destination Address, Source Address, Length, and Data field. If the
checksum computed by destination is not the same as sent checksum
value, data received is corrupted.

VLAN Tagging – The Ethernet frame can also include a VLAN (Virtual Local
Area Network) tag, which is a 4-byte field inserted after the source address
and before the EtherType field. This tag allows network administrators to
logically separate a physical network into multiple virtual networks, each with
its own VLAN ID.
Jumbo Frames – In addition to the standard Ethernet frame size of 1518
bytes, some network devices support Jumbo Frames, which are frames with
a payload larger than 1500 bytes. Jumbo Frames can increase network
throughput by reducing the overhead associated with transmitting a large
number of small frames.
Ether Type Field – The EtherType field in the Ethernet frame header
identifies the protocol carried in the payload of the frame. For example, a
value of 0x0800 indicates that the payload is an IP packet, while a value of
0x0806 indicates that the payload is an ARP (Address Resolution Protocol)
packet.
Multicast and Broadcast Frames – In addition to Unicast frames (which
are sent to a specific destination MAC address), Ethernet also support.
Multicast and Broadcast frames. Multicast frames are sent to a specific
group of devices that have joined a multicast group, while Broadcast frames
are sent to all devices on the network.
Collision Detection – In half-duplex Ethernet networks, collisions can occur
when two devices attempt to transmit data at the same time. To detect
collisions, Ethernet uses a Carrier Sense Multiple Access with Collision
Detection (CSMA/CD) protocol, which listens for activity on the network
before transmitting data and backs off if a collision is detected.

Multiple access protocol?


When a sender and receiver have a dedicated link to transmit data packets,
the data link control is enough to handle the channel. Suppose there is no
dedicated path to communicate or transfer the data between two devices. In
that case, multiple stations access the channel and simultaneously transmits
the data over the channel. It may create collision and cross talk. Hence, the
multiple access protocol is required to reduce the collision and avoid
crosstalk between the channels.

Following are the types of multiple access protocol that is subdivided into the
different process as:
A. Random Access Protocol
In this protocol, all the station has the equal priority to send the data over a
channel. In random access protocol, one or more stations cannot depend on
another station nor any station control another station. Depending on the
channel's state (idle or busy), each station transmits the data frame.
However, if more than one station sends the data over a channel, there may
be a collision or data conflict. Due to the collision, the data frame packets
may be lost or changed. And hence, it does not receive by the receiver end.

Following are the different methods of random-access protocols for


broadcasting frames on the channel.

o Aloha
o CSMA
o CSMA/CD
o CSMA/CA

ALOHA Random Access Protocol

It is designed for wireless LAN (Local Area Network) but can also be used in a
shared medium to transmit data. Using this method, any station can transmit
data across a network simultaneously when a data frameset is available for
transmission.

Aloha Rules
1. Any station can transmit data to a channel at any time.
2. It does not require any carrier sensing.
3. Collision and data frames may be lost during the transmission of data
through multiple stations.
4. Acknowledgment of the frames exists in Aloha. Hence, there is no collision
detection.
5. It requires retransmission of data after some random amount of time.

Pure Aloha

Whenever data is available for sending over a channel at stations, we use


Pure Aloha. In pure Aloha, when each station transmits data to a channel
without checking whether the channel is idle or not, the chances of collision
may occur, and the data frame can be lost. When any station transmits the
data frame to a channel, the pure Aloha waits for the receiver's
acknowledgment. If it does not acknowledge the receiver end within the
specified time, the station waits for a random amount of time, called the
backoff time (Tb). And the station may assume the frame has been lost or
destroyed. Therefore, it retransmits the frame until all the data are
successfully transmitted to the receiver.
As we can see in the figure above, there are four stations for accessing a
shared channel and transmitting data frames. Some frames collide because
most stations send their frames at the same time. Only two frames, frame
1.1 and frame 2.2, are successfully transmitted to the receiver end. At the
same time, other frames are lost or destroyed. Whenever two frames fall on
a shared channel simultaneously, collisions can occur, and both will suffer
damage. If the new frame's first bit enters the channel before finishing the
last bit of the second frame. Both frames are completely finished, and both
stations must retransmit the data frame.

Slotted Aloha

The slotted Aloha is designed to overcome the pure Aloha's efficiency


because pure Aloha has a very high possibility of frame hitting. In slotted
Aloha, the shared channel is divided into a fixed time interval called slots.
So that, if a station wants to send a frame to a shared channel, the frame
can only be sent at the beginning of the slot, and only one frame is allowed
to be sent to each slot. And if the stations are unable to send data to the
beginning of the slot, the station will have to wait until the beginning of the
slot for the next time. However, the possibility of a collision remains when
trying to send a frame at the beginning of two or more station time slot.
CSMA (Carrier Sense Multiple Access)

It is a carrier sense multiple access based on media access protocol to


sense the traffic on a channel (idle or busy) before transmitting the data. It
means that if the channel is idle, the station can send data to the channel.
Otherwise, it must wait until the channel becomes idle. Hence, it reduces the
chances of a collision on a transmission medium.

CSMA Access Modes

1-Persistent: In the 1-Persistent mode of CSMA that defines each node, first
sense the shared channel and if the channel is idle, it immediately sends the
data. Else it must wait and keep track of the status of the channel to be idle
and broadcast the frame unconditionally as soon as the channel is idle.

Non-Persistent: It is the access mode of CSMA that defines before


transmitting the data, each node must sense the channel, and if the channel
is inactive, it immediately sends the data. Otherwise, the station must wait
for a random time (not continuously), and when the channel is found to be
idle, it transmits the frames.

P-Persistent: It is the combination of 1-Persistent and Non-persistent


modes. The P-Persistent mode defines that each node senses the channel,
and if the channel is inactive, it sends a frame with a P probability. If the
data is not transmitted, it waits for a (q = 1-p probability) random time
and resumes the frame with the next time slot.

O- Persistent: It is an O-persistent method that defines the superiority of


the station before the transmission of the frame on the shared channel. If it
is found that the channel is inactive, each station waits for its turn to
retransmit the data.

CSMA/ CD

It is a carrier sense multiple access/ collision detection network


protocol to transmit data frames. The CSMA/CD protocol works with a
medium access control layer. Therefore, it first senses the shared channel
before broadcasting the frames, and if the channel is idle, it transmits a
frame to check whether the transmission was successful. If the frame is
successfully received, the station sends another frame. If any collision is
detected in the CSMA/CD, the station sends a jam/ stop signal to the shared
channel to terminate data transmission. After that, it waits for a random time
before sending a frame to a channel.

CSMA/ CA

It is a carrier sense multiple access/collision avoidance network


protocol for carrier transmission of data frames. It is a protocol that works
with a medium access control layer. When a data frame is sent to a channel,
it receives an acknowledgment to check whether the channel is clear. If the
station receives only a single (own) acknowledgments, that means the data
frame has been successfully transmitted to the receiver. But if it gets two
signals (its own and one more in which the collision of frames), a collision of
the frame occurs in the shared channel. Detects the collision of the frame
when a sender receives an acknowledgment signal.

Following are the methods used in the CSMA/ CA to avoid the collision:

Interframe space: In this method, the station waits for the channel to
become idle, and if it gets the channel is idle, it does not immediately send
the data. Instead of this, it waits for some time, and this time period is called
the Interframe space or IFS. However, the IFS time is often used to define
the priority of the station.

Contention window: In the Contention window, the total time is divided


into different slots. When the station/ sender is ready to transmit the data
frame, it chooses a random slot number of slots as wait time. If the channel
is still busy, it does not restart the entire process, except that it restarts the
timer only to send data packets when the channel is inactive.

Acknowledgment: In the acknowledgment method, the sender station


sends the data frame to the shared channel if the acknowledgment is not
received ahead of time.
Contention based Protocols
Pure and slotted Aloha, CSMA and CSMA/CD are Contention based
Protocols.

Contention-free access/Token Ring)

What is the Controlled Access?


In controlled access, the stations seek data from one another to
find which station has the right to send. It allows only one node to
send at a time, to avoid the collision of messages on a shared
medium. The three controlled-access methods are:
 Reservation
 Polling
 Token Passing
Token Passing
 In token passing scheme, the stations are connected
logically to each other in form of ring and access to stations
is governed by tokens.
 A token is a special bit pattern or a small message, which
circulate from one station to the next in some predefined
order.
 In Token ring, token is passed from one station to another
adjacent station in the ring whereas in case of Token bus,
each station uses the bus to send the token to the next
station in some predefined order.
 In both cases, token represents permission to send. If a
station has a frame queued for transmission when it
receives the token, it can send that frame before it passes
the token to the next station. If it has no queued frame, it
passes the token simply.
 After sending a frame, each station must wait for all N
stations (including itself) to send the token to their
neighbours and the other N – 1 stations to send a frame, if
they have one.
 There exists problems like duplication of token or token is
lost or insertion of new station, removal of a station, which
need be tackled for correct and reliable operation of this
scheme.
Advantages of Token passing
 It may now be applied with routers cabling and includes
built-in debugging features like protective relay and auto
reconfiguration.
 It provides good throughput when conditions of high load.
Disadvantages of Token passing
 Its cost is expensive.
 Topology components are more expensive than those of
other, more widely used standard.
 The hardware element of the token rings are designed to
be tricky. This implies that you should choose on
manufacture and use them exclusively.

You might also like