0% found this document useful (0 votes)
9 views

UNIT-4 Introduction of Data Link Layer

This document discusses the data link layer in computer networks. It introduces the data link layer and its services like framing, error detection, and flow control. It describes different framing techniques, error detection methods like parity checks, checksums and cyclic redundancy checks. It also explains flow control approaches and protocols like stop and wait.

Uploaded by

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

UNIT-4 Introduction of Data Link Layer

This document discusses the data link layer in computer networks. It introduces the data link layer and its services like framing, error detection, and flow control. It describes different framing techniques, error detection methods like parity checks, checksums and cyclic redundancy checks. It also explains flow control approaches and protocols like stop and wait.

Uploaded by

jnike9890
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 32

UNIT-4

Introduction of Data Link Layer


INTRODUCTION
• Host and routers are as nodes.
• Communication channels that connect adjacent nodes along
communication path, its called links.
• Wired links
• Wireless links
• LANs
• In this layer, Packet is form of frame from encapsulate datagram.
• This layer has responsibility of transferring datagram from one node to
physically adjacent node over a link.
Link Layer Services
• Framing
• Encapsulate datagram into frame.
• Adding header and trailer.
• Link Access
• “MAC” addresses used in frame headers to identify source and destination. It is different from IP address.
• Reliable Delivery
• If this layer protocol provides reliable delivery service, it guarantees to move each network-layer datagram
across the link without error.
• A link-layer reliable delivery service can be achieved with acknowledgments and retransmissions.
• Flow Control
• Pacing between adjacent sending and receiving nodes.
• Error Detection & Correction
• Errors caused by signal attenuation and noise.
• Receiver detects presence of errors.
• Sender send signal for retransmission or drops frame.
• Receiver identifies and corrects bit error(s) without resorting to retransmission.
Error Detection in Computer Networks
• 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.
• 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.
Error Detection in Computer Networks
• 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.
1.Parity Check
2.Checksum
3.Cyclic Redundancy Check (CRC)
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
Disadvantages
• 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.
Parity Check
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.
Checksum
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.

Cyclic Redundancy Check (CRC)
FRAMING
• In computer networks, the data is transferred from one device to another
user using various technologies and protocols. The data has to go through
many layers and each layer performs its own function on the data one of
the functions is converting the data into frames. The data can be
intercepted by unwanted individuals which will lead to security risks and
issues. There are various mechanisms that we use to protect the data in
computer networks one of them being framing.
• A frame typically includes a series of symbols or bits that provide frame
synchronization advantages. In the bits and symbols sequence it gets, it
displays the beginning and end of the payload data. at the moment a frame
is broadcast when a receiver is connected to the system. Until it discovers a
new frame coordination sequence, it stays away from the information.
FRAMING
• Parts of Frame
• A frame generally has the following parts:
• Frame Header: It contains the source and destination address of the
frame.
• Payload Field: It will contain the message which is needed to be
delivered.
• Trailer: It contains the error correction and error detection bits.
• Flag: It marks the beginning and the end of the frame.
Types of framing
• There are two types of framing:
1. Fixed-size: The frame is of fixed size and there is no need to provide boundaries
to the frame, the length of the frame itself acts as a delimiter.
• Drawback: It suffers from internal fragmentation if the data size is less than the
frame size
• Solution: Padding
• 2. Variable size: In this, there is a need to define the end of the frame as well as
the beginning of the next frame to distinguish. This can be done in two ways:
• Length field – We can introduce a length field in the frame to indicate the length
of the frame. Used in Ethernet(802.3). The problem with this is that sometimes
the length field might get corrupted.
• End Delimiter (ED) – We can introduce an ED(pattern) to indicate the end of the
frame. Used in Token Ring. The problem with this is that ED can occur in the data.
Approaches of Framing
• Bit Stuffing
• n a bit-oriented protocol, the data to send is a series of bits.
• In order to distinguish frames, most protocols use a bit pattern of
8-bit length (01111110) as flag at the beginning and end of each
frame.
• Here also cause the problem of appearance of flag in the data part to
deal with this an extra bit added.
• This method is called bit stuffing.
• If a 0 and five successive 1 bits are encountered, an extra 0 is added.
• The receiver node removes the extra-added zero.
Bit Stuffing
Byte Stuffing
• Problem of resynchronization by having each frame start and end with special bytes.
• A flag byte is used to separate the frame as both the starting and ending delimiter.
• This technique is called byte stuffing or character stuffing.
• In this way, if the receiver ever loses synchronization, it can just search for the flag byte to
find the end of the current frame.
• Two consecutive flag bytes indicate the end of one frame and start of the next one.
• To solve this problem, is to have the sender's data link layer insert a special escape byte
(ESC) just before each "accidental" flag byte in the data.
• The data link layer on the receiving end removes the escape byte before the data are
given to the network layer.

Byte Stuffing
Flow Control in Data Link Layer
• Flow control is design issue at Data Link Layer. It is a technique that
generally observes the proper flow of data from sender to receiver. It is
very essential because it is possible for sender to transmit data or
information at very fast rate and hence receiver can receive this
information and process it.
• Flow control is actually set of procedures that explains sender about how
much data or frames it can transfer or transmit before data overwhelms
receiver. The receiving device also contains only limited amount of speed
and memory to store data. This is why receiving device should be able to
tell or inform the sender about stopping the transmission or transferring of
data on temporary basis before it reaches limit. It also needs buffer, large
block of memory for just storing data or frames until they are processed.
Flow Control in Data Link Layer
• Approaches to Flow Control : Flow Control is classified into two categories:
• Feedback – based Flow Control : In this control technique, sender simply
transmits data or information or frame to receiver, then receiver transmits
data back to sender and also allows sender to transmit more amount of
data or tell sender about how receiver is processing or doing. This simply
means that sender transmits data or frames after it has received
acknowledgements from user.
• Rate – based Flow Control : In this control technique, usually when sender
sends or transfer data at faster speed to receiver and receiver is not being
able to receive data at the speed, then mechanism known as built-in
mechanism in protocol will just limit or restricts overall rate at which data
or information is being transferred or transmitted by sender without any
feedback or acknowledgement from receiver.
Stop and Wait Protocol
• Techniques of Flow Control in Data Link Layer : There are basically two types of techniques being developed to
control the flow of data
• This method is the easiest and simplest form of flow control. In this method, basically message or data is broken
down into various multiple frames, and then receiver indicates its readiness to receive frame of data. When
acknowledgement is received, then only sender will send or transfer the next frame. This process is continued
until sender transmits EOT (End of Transmission) frame. In this method, only one of frames can be in
transmission at a time. It leads to inefficiency i.e. less productivity if propagation delay is very much longer than
the transmission delay and Ultimately In this method sender sent single frame and receiver take one frame at
a time and sent acknowledgement(which is next frame number only) for new frame.
• Advantages –
• This method is very easiest and simple and each of the frames is checked and acknowledged well.
• This method is also very accurate.
• Disadvantages –
• This method is fairly slow.
• In this, only one packet or frame can be sent at a time.
• It is very inefficient and makes the transmission process very slow.
Stop and Wait Protocol
Sliding Window Protocol
• The sliding window is a technique for sending multiple frames at a time. It controls the
data packets between the two devices where reliable and gradual delivery of data frames
is needed. It is also used in TCP (Transmission Control Protocol).
• In this technique, each frame has sent from the sequence number. The sequence
numbers are used to find the missing data in the receiver end. The purpose of the sliding
window technique is to avoid duplicate data, so it uses the sequence number.
• Go-Back-N ARQ
• Go-Back-N ARQ protocol is also known as Go-Back-N Automatic Repeat Request. It is a
data link layer protocol that uses a sliding window method. In this, if any frame is
corrupted or lost, all subsequent frames have to be sent again.
• The size of the sender window is N in this protocol. For example, Go-Back-8, the size of
the sender window, will be 8. The receiver window size is always 1.
• If the receiver receives a corrupted frame, it cancels it. The receiver does not accept a
corrupted frame. When the timer expires, the sender sends the correct frame again.
Sliding Window Protocol
Internet Protocol
• Here, IP stands for internet protocol. It is a protocol defined in the TCP/IP
model used for sending the packets from source to destination. The main
task of IP is to deliver the packets from source to the destination based on
the IP addresses available in the packet headers. IP defines the packet
structure that hides the data which is to be delivered as well as the
addressing method that labels the datagram with a source and destination
information.
• An IP protocol provides the connectionless service, which is accompanied
by two transport protocols, i.e., TCP/IP and UDP/IP, so internet protocol is
also known as TCP/IP or UDP/IP.
• The first version of IP (Internet Protocol) was IPv4. After IPv4, IPv6 came
into the market, which has been increasingly used on the public internet
since 2006.
History of Internet Protocol

• The development of the protocol gets started in 1974 by Bob Kahn and
Vint Cerf. It is used in conjunction with the Transmission Control Protocol
(TCP), so they together named the TCP/IP.
• The first major version of the internet protocol was IPv4, which was version
4. This protocol was officially declared in RFC 791 by the Internet
Engineering Task Force (IETF) in 1981.
• After IPv4, the second major version of the internet protocol was IPv6,
which was version 6. It was officially declared by the IETF in 1998. The main
reason behind the development of IPv6 was to replace IPv4. There is a big
difference between IPv4 and IPv6 is that IPv4 uses 32 bits for addressing,
while IPv6 uses 128 bits for addressing.
Function of Internet protocol
• The main function of the internet protocol is to provide addressing to
the hosts, encapsulating the data into a packet structure, and routing
the data from source to the destination across one or
more IP networks. In order to achieve these
functionalities, internet protocol provides two major things which are
given below.
• An internet protocol defines two things:
• Format of IP packet
• IP Addressing system
What is an IP packet?

Before an IP packet is sent over the network, two major components are added in an IP packet, i.e., header and
a payload.
What is an IP packet?

• Source IP address: The source is the one who is sending the data.
• Destination IP address: The destination is a host that receives the data from
the sender.
• Header length
• Packet length
• TTL (Time to Live): The number of hops occurs before the packet gets
discarded.
• Transport protocol: The transport protocol used by the internet protocol,
either it can be TCP or UDP.
• There is a total of 14 fields exist in the IP header, and one of them is
optional.
• Payload: Payload is the data that is to be transported.
How does the IP routing perform?
• IP routing is a process of determining the path for data so that it can travel
from the source to the destination. As we know that the data is divided
into multiple packets, and each packet will pass through a web of the
router until it reaches the final destination. The path that the data packet
follows is determined by the routing algorithm. The routing algorithm
considers various factors like the size of the packet and its header to
determine the efficient route for the data from the source to the
destination. When the data packet reaches some router, then the source
address and destination address are used with a routing table to determine
the next hop's address. This process goes on until it reaches the
destination. The data is divided into multiple packets so all the packets will
travel individually to reach the destination.
What is IP Addressing?

• IPv4 addresses are divided into two categories:


• Public address
• The public address is also known as an external address as they are grouped under the
WAN addresses. We can also define the public address as a way to communicate outside
the network. This address is used to access the internet. The public address available on
our computer provides the remote access to our computer. With the help of a public
address, we can set up the home server to access the internet. This address is generally
assigned by the ISP (Internet Service Provider).
• Key points related to public address are:
• The scope of the public address is global, which means that we can communicate outside
the network.
• This address is assigned by the ISP (Internet Service Provider).
• It is not available at free of cost.
• We can get the Public IP by typing on Google "What is my IP".
• Private address
• A private address is also known as an internal address, as it is grouped under the LAN addresses. It is used to
communicate within the network. These addresses are not routed on the internet so that no traffic can come
from the internet to this private address. The address space for the private address is allocated
using InterNIC to create our own network. The private addresses are assigned to mainly those computers,
printers, smartphones, which are kept inside the home or the computers that are kept within the organization.
For example, a private address is assigned to the printer, which is kept inside our home, so that our family
member can take out the print from the printer.

• If the computer is assigned with a private address, then the devices available within the local network can view
the computer through the private ip address. However, the devices available outside the local network cannot
view the computer through the private IP address, but they can access the computer if they know the router's
public address. To access the computer directly, NAT (Network Address Translator) is to be used.
• Key points related to private address are:
• Its scope is local, as we can communicate within the network only.
• It is generally used for creating a local area network.
• It is available at free of cost.
• We can get to know the private IP address by simply typing the "ipconfig" on the command prompt.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy