0% found this document useful (0 votes)
11 views23 pages

UNIT - 2 - Sem Answers

The document discusses data link layer design issues, including services provided to the network layer, framing methods, error control, and flow control. It details various framing techniques such as byte count, byte stuffing, bit stuffing, and physical layer coding violations, as well as error detection and correction mechanisms like parity checks and cyclic redundancy checks. Additionally, it explains protocols for noisy channels, including Stop-and-Wait ARQ and Go-Back-N ARQ, emphasizing their roles in ensuring reliable data transmission.
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)
11 views23 pages

UNIT - 2 - Sem Answers

The document discusses data link layer design issues, including services provided to the network layer, framing methods, error control, and flow control. It details various framing techniques such as byte count, byte stuffing, bit stuffing, and physical layer coding violations, as well as error detection and correction mechanisms like parity checks and cyclic redundancy checks. Additionally, it explains protocols for noisy channels, including Stop-and-Wait ARQ and Go-Back-N ARQ, emphasizing their roles in ensuring reliable data transmission.
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/ 23

UNIT_2

1. Briefly discuss about data link layer design issues.


A. Design issues of Data layer:
• Providing services to the network layer
• Framing
• Error Control
• Flow Control
Services Provided to the Network Layer
• The function of the data link layer is to provide services to the network layer.
• The principal service is transferring data from the network layer on the source
machine to the network layer on the destination machine.
• On the source machine is an entity, call it a process, in the network layer that
hands some bits to the data link layer for transmission to the destination.
• The job of the data link layer is to transmit the bits to the destination machine
so they can be handed over to the network layer there.
• The data link layer can be designed to offer various services like
1. Unacknowledged connectionless service.
2. Acknowledged connectionless service.
3. Acknowledged connection-oriented service.

Framing
• The data link layer encapsulates each data packet from the network layer into
frames that are then transmitted.
A frame has three parts, namely –
• Frame Header
• Payload field that contains the data packet from network layer
• Trailer
• The usual approach is for the data link layer to break up the bit stream into
discrete frames, compute a short token called a checksum for each frame, and
include the checksum in the frame when it is transmitted.
• When a frame arrives at the destination, the checksum is recomputed. If the
newly computed checksum is different from the one contained in the frame, the
data link layer knows that an error has occurred and takes steps to deal with it
(e.g., discarding the bad frame and possibly also sending back an error report).
• Breaking up the bit stream into frames is in four methods:
1. Byte count.
2. Flag bytes with byte stuffing.
3. Flag bits with bit stuffing.
4. Physical layer coding violations.
1. Byte count.
• This method is rarely used and is generally required to count total number of
bytes that are present in frame. This is be done by using field in header. Byte
count method ensures data link layer at the receiver or destination about total
number of bytes that follow, and about where the frame ends.
• There is disadvantage also of using this method i.e., if anyhow character count
is disturbed or distorted by an error occurring during transmission, then
destination or receiver might lose synchronization. The destination or receiver
might also be not able to locate or identify beginning of next frame.
2. Flag bytes with byte stuffing.
• The second framing method gets around the problem of resynchronization after
an error by having each frame start and end with special bytes.
• Often the same byte, called a flag byte, is used as both the starting and ending
delimiter.
• Two consecutive flag bytes indicate the end of one frame and the start of the
next.
• Thus, if the receiver ever loses synchronization it can just search for two flag
bytes to find the end of the current frame and the start of the next frame
• However, there is a still a problem we have to solve. It may happen that the flag
byte occurs in the data, especially when binary data such as photographs or
songs are being transmitted.
• One way 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 bytes before giving
the data to the network layer. This technique is called byte stuffing.
• Of course, the next question is: what happens if an escape byte occurs in the
middle of MKK the data? The answer is that it, too, is stuffed with an escape byte.

3. Flag bits with bit stuffing.


• Framing can be also be done at the bit level, so frames can contain an arbitrary
number of bits made up of units of any size. It was developed for the once very
popular HDLC (Highlevel Data Link Control) protocol.
• Each frame begins and ends with a special bit pattern, 01111110 or 0x7E in
hexadecimal.
• This pattern is a flag byte. Whenever the sender’s data link layer encounters five
consecutive 1s in the data, it automatically stuffs a 0 bit into the outgoing bit
stream.
• Bit stuffing is very essential part of transmission process in network and
communication protocol. It is also required in USB.

4. Physical layer coding violations.


• Encoding violation is method that is used only for network in which encoding
on physical medium includes some sort of redundancy i.e., use of more than one
graphical or visual structure to simply encode or represent one variable of data.

Error Control
The issues it caters to with respect to error control are –
• Dealing with transmission errors
• Sending acknowledgement frames in reliable connections
• Retransmitting lost frames
• Identifying duplicate frames and deleting them
• Controlling access to shared channels in case of broadcasting

Flow Control
• The data link layer regulates flow control so that a fast sender does not drown a
slow receiver. When the sender sends frames at very high speeds, a slow
receiver may not be able to handle it. There will be frame losses even if the
transmission is error-free.
The two common approaches for flow control are –
• Feedback based flow control - the receiver sends back information to the
sender giving it permission to send more data, or at least telling the sender how
the receiver is doing.
• Rate based flow control - the protocol has a built-in mechanism that limits the
rate at which senders may transmit data, without using feedback from the
receiver.
2. Explain about the services provided by the Data link layer.
A. Framing
• The data link layer encapsulates each data packet from the network layer into
frames that are then transmitted.
A frame has three parts, namely –
• Frame Header
• Payload field that contains the data packet from network layer
• Trailer

• The usual approach is for the data link layer to break up the bit stream into
discrete frames, compute a short token called a checksum for each frame, and
include the checksum in the frame when it is transmitted.
• When a frame arrives at the destination, the checksum is recomputed. If the
newly computed checksum is different from the one contained in the frame, the
data link layer knows that an error has occurred and takes steps to deal with it
(e.g., discarding the bad frame and possibly also sending back an error report).
• Breaking up the bit stream into frames is in four methods:
1. Byte count.
2. Flag bytes with byte stuffing.
3. Flag bits with bit stuffing.
4. Physical layer coding violations.
1. Byte count.
• This method is rarely used and is generally required to count total number of
bytes that are present in frame. This is be done by using field in header. Byte
count method ensures data link layer at the receiver or destination about total
number of bytes that follow, and about where the frame ends.
• There is disadvantage also of using this method i.e., if anyhow character count
is disturbed or distorted by an error occurring during transmission, then
destination or receiver might lose synchronization. The destination or receiver
might also be not able to locate or identify beginning of next frame.
2. Flag bytes with byte stuffing.
• The second framing method gets around the problem of resynchronization after
an error by having each frame start and end with special bytes.
• Often the same byte, called a flag byte, is used as both the starting and ending
delimiter.
• Two consecutive flag bytes indicate the end of one frame and the start of the
next.
• Thus, if the receiver ever loses synchronization it can just search for two flag
bytes to find the end of the current frame and the start of the next frame
• However, there is a still a problem we have to solve. It may happen that the flag
byte occurs in the data, especially when binary data such as photographs or
songs are being transmitted.
• One way 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 bytes before giving
the data to the network layer. This technique is called byte stuffing.
• Of course, the next question is: what happens if an escape byte occurs in the
middle of MKK the data? The answer is that it, too, is stuffed with an escape byte.
3. Flag bits with bit stuffing.
• Framing can be also be done at the bit level, so frames can contain an
arbitrary number of bits made up of units of any size. It was developed for the
once very popular HDLC (Highlevel Data Link Control) protocol.
• Each frame begins and ends with a special bit pattern, 01111110 or 0x7E in
hexadecimal.
• This pattern is a flag byte. Whenever the sender’s data link layer encounters
five consecutive 1s in the data, it automatically stuffs a 0 bit into the outgoing
bit stream.
• Bit stuffing is very essential part of transmission process in network and
communication protocol. It is also required in USB.

4. Physical layer coding violations.

• Encoding violation is method that is used only for network in which encoding
on physical medium includes some sort of redundancy i.e., use of more than one
graphical or visual structure to simply encode or represent one variable of data.

2. Error Control
The issues it caters to with respect to error control are –
• Dealing with transmission errors
• Sending acknowledgement frames in reliable connections
• Retransmitting lost frames
• Identifying duplicate frames and deleting them
• Controlling access to shared channels in case of broadcasting.
Flow Control
• The data link layer regulates flow control so that a fast sender does not drown a
slow receiver. When the sender sends frames at very high speeds, a slow
receiver may not be able to handle it. There will be frame losses even if the
transmission is error-free.
The two common approaches for flow control are –
• Feedback based flow control - the receiver sends back information to the
sender giving it permission to send more data, or at least telling the sender how
the receiver is doing.
• Rate based flow control - the protocol has a built-in mechanism that limits the
rate at which senders may transmit data, without using feedback from the
receiver.

3. Explain the various error detection and correction


Mechanisms used in computer network.
A. Error
• A condition when the receiver’s information does not match with the sender’s
information. During transmission, digital signals suffer from noise that can
introduce errors in the binary bits travelling from sender to receiver. That means
a 0 bit may change to 1 or a 1 bit may change to 0.
• Network designers have developed two basic strategies for dealing with errors.
• Error Detecting and Correcting Codes.
• Error Detecting and Correcting Codes.
• we use error-detecting codes which are additional data added to a given
digital message to help us detect if any error has occurred during transmission
of the message.
• Basic approach used for error detection is the use of redundancy bits, where
additional bits are added to facilitate detection of errors.
Some popular techniques for error detection are:
1. Simple Parity check
2. Two-dimensional Parity check
3. Checksum
4. Cyclic redundancy check
1. Simple Parity
check Blocks of data from the source are subjected to a check bit or parity bit
generator form, where a parity of:
• 1 is added to the block if it contains odd number of 1’s, and
• 0 is added if it contains even number of 1’s
• This scheme makes the total number of 1’s even, that is why it is called even
parity checking.
2. Two-dimensional Parity check
• 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.

4. Checksum
• In checksum error detection scheme, the data is divided into k segments each
of m bits.
• In 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.
• 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.

4.Cyclic redundancy check (CRC)


• Unlike 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 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.
4. Explain Cyclic Redundancy Check? Suppose we want to transmit
the message 11001001 and protect it from errors using the CRC
polynomial x3 + 1. Use polynomial long division to determine the
message that should be transmitted.
A. Cyclic redundancy check (CRC)
• Unlike 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 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.
5. Explain the various protocols for noisy channel.
A. Stop – and – Wait ARQ
• Stop – and – wait Automatic Repeat Request (Stop – and – Wait ARQ) is a
variation of the above protocol with added error control mechanisms,
appropriate for noisy channels.
• The sender keeps a copy of the sent frame. It then waits for a finite time to
receive a positive acknowledgement from receiver.
• If the timer expires or a negative acknowledgement is received, the frame is
retransmitted.
• If a positive acknowledgement is received then the next frame is sent.
Sliding window protocols
Go – Back – N ARQ
• Go – Back – N ARQ provides for sending multiple frames before receiving the
acknowledgement for the first frame. It uses the concept of sliding window, and
so is also called sliding window protocol. The frames are sequentially numbered
and a finite number of frames are sent. If the acknowledgement of a frame is not
received within the time period, all frames starting from that frame are
retransmitted.
• In the Go-Back-N Protocol, the sequence numbers are modulo 2m, where m is
the size of the sequence number field in bits.
• The sequence numbers range from 0 to .
• For example, if m is 4, the only sequence numbers are 0 through 15 inclusive.
Receiver window:
variable Rn (receive window, next frame expected) .
• The sequence numbers to the left of the window belong to the frames already
received and acknowledged; the sequence numbers to the right of this window
define the frames that cannot be received. Any received frame with a sequence
number in these two regions is discarded. Only a frame with a sequence
number matching the value of Rn is accepted and acknowledged.
• The receive window also slides, but only one slot at a time. When a correct
frame is received (and a frame is received only one at a time), the window
slides.( see below figure for receiving window)
Selective Repeat ARQ
• This protocol also provides for sending multiple frames before receiving the
acknowledgement for the first frame. However, here only the erroneous or lost
frames are retransmitted, while the good frames are received and buffered.
6. Describe in detail sliding window protocol using Go back n ARQ.
A. Sliding window protocols
Go – Back – N ARQ
• Go – Back – N ARQ provides for sending multiple frames before receiving the
acknowledgement for the first frame. It uses the concept of sliding window, and
so is also called sliding window protocol. The frames are sequentially numbered
and a finite number of frames are sent. If the acknowledgement of a frame is not
received within the time period, all frames starting from that frame are
retransmitted.
• In the Go-Back-N Protocol, the sequence numbers are modulo 2m, where m is
the size of the sequence number field in bits.
• The sequence numbers range from 0 to .
• For example, if m is 4, the only sequence numbers are 0 through 15 inclusive.
• The sender window at any time divides the possible sequence numbers into
four regions.
• The first region, from the far left to the left wall of the window, defines the
sequence numbers belonging to frames that are already acknowledged. The
sender does not worry about these frames and keeps no copies of them.
• The second region, colored in Figure (a), defines the range of sequence
numbers belonging to the frames that are sent and have an unknown status.
The sender needs to wait to find out if these frames have been received or were
lost. We call these outstanding frames.
• The third range, white in the figure, defines the range of sequence numbers for
frames that can be sent; however, the corresponding data packets have not yet
been received from the network layer.
• Finally, the fourth region defines sequence numbers that cannot be used until
the window slides.
• The send window is an abstract concept defining an imaginary box of size 2m
– 1 with three variables: Sf, Sn, and Ssize.
• The variable Sf defines the sequence number of the first (oldest) outstanding
frame.
• The variable Sn holds the sequence number that will be assigned to the next
frame to be sent.
• Finally, the variable Ssize defines the size of the window. Figure (b) shows
how a send window can slide one or more slots to the right when an
acknowledgment arrives from the other end. The acknowledgments in this
protocol are cumulative, meaning that more than one frame can be
acknowledged by an ACK frame.
• In Figure, frames 0, I, and 2 are acknowledged, so the window has slide to the
right three slots.
• Note that the value of Sf is 3 because frame 3 is now the first outstanding
frame.
• The send window can slide one or more slots when a valid acknowledgment
arrives.
7. Explain MAC sub layer protocol and Functions.
A. • Network links can be divided into two categories: those using point-to-point
connections and those using broadcast channels.
• In any broadcast network, the key issue is how to determine who gets to use
the channel when there is competition for it
– To make this point, consider a conference call in which six people, on six
different telephones, are all connected so that each one can hear and talk to all
the others. It is very likely that when one of them stops speaking, two or more
will start talking at once, leading to chaos. In a face-to-face meeting, chaos is
avoided by external means. For example, at a meeting, people raise their hands
to request permission to speak.
• The protocols used to determine who goes next on a multiaccess channel
belong to a sublayer of the data link layer called the MAC (Medium Access
Control) sublayer.
1. Carrier Sense Multiple Access (CSMA) Protocols
Carrier Sense Multiple Access (CSMA) is a network protocol for carrier
transmission that operates in the Medium Access Control (MAC) layer. It senses
or listens whether the shared channel for transmission is busy or not, and
transmits if the channel is not busy. Using CMSA protocols, more than one users
or nodes send and receive data through a shared medium that may be a single
cable or optical fiber connecting multiple nodes, or a portion of the wireless
spectrum.

2. Flow Control: While flow control is generally associated with the transport
layer (e.g., TCP), the MAC sub-layer can also implement mechanisms for
controlling the flow of data between devices. For example, it may pause or slow
down transmission if the receiving device is overwhelmed.

3. Addressing: The MAC sub-layer is responsible for addressing frames at the


Data Link Layer. It uses MAC addresses, which are unique identifiers assigned
to network interfaces. These addresses allow devices to identify the source and
destination of the frames.
• MAC addresses are 48 bits in length (e.g., 00:14:22:01:23:45).
• They are globally unique and are usually burned into the hardware of network
interface cards (NICs).
4. Error Detection and Correction: The MAC sub-layer provides
mechanisms for detecting errors in transmitted frames, usually by adding a
Frame Check Sequence (FCS) in the trailer. The most common error-detection
method is Cyclic Redundancy Check (CRC). If the receiver detects errors, it can
request retransmission of the corrupted frame.
8. Explain about 4 different types of Collision free protocol.
A. Collision – free protocols resolves collision in the contention period
and so the possibilities of collisions are eliminated.
Types of Collision – free Protocols
• Bit – map Protocol
• Binary Countdown
Bit – map Protocol:
• In bit map protocol, the contention period is divided into N slots,
where N is the total number of stations sharing the channel. If a
station has a frame to send, it sets the corresponding bit in the slot.
So, before transmission, each station knows whether the other
stations want to transmit. Collisions are avoided by mutual
agreement among the contending stations on who gets the channel.

Binary Countdown
• This protocol overcomes the overhead of 1 bit per station of the bit – map
protocol. Here, binary addresses of equal lengths are assigned to each station. For
example, if there are 6 stations, they may be assigned the binary addresses 001,
010, 011, 100, 101 and 110. All stations wanting to communicate broadcast their
addresses. The station with higher address gets the higher priority for
transmitting.
9. Identify the working principle of Bluetooth and develop a neat
sketch to depict its Protocol Stack.
A. • Bluetooth is a low cost, low power, short range wireless technology
for data and audio communication.
• Bluetooth was first proposed by ‘Ericsson’ in 1994.
• Bluetooth operates at 2.4GHz of the Radio Frequency spectrum
and uses the Frequency Hopping Spread Spectrum (FHSS) technique
for communication.
• Literally it supports a data rate of up to 1Mbps to 24Mbps (and a
range of approximately 30 to 100 feet (Depending on the Bluetooth
version – v1.2 supports datarate up to 1Mbps, v2.0 + EDR ‘Enhanced
Data Rate’ supports datarate up to 3Mbps, v3.0 + HS ‘High Speed’
and v4.0 supports datarate up to 24Mbps)) for data communication.
• Bluetooth communication has two essential parts; a physical link
part and a protocol part.
• The physical link is responsible for the physical transmission of
data between devices supporting Bluetooth communication and
protocol part is responsible for defining the rules of communication.
• The physical link works on the Wireless principle making use of
Radio Frequency waves for communication.
• Bluetooth enabled devices essentially contain a Bluetooth wireless
radio for the transmission and reception of data.
• The rules governing the Bluetooth communication is implemented
in the ‘Bluetooth protocol stack’.
• The Bluetooth communication IC holds the stack. Each Bluetooth
device will have a 48 bit unique identification number.
• Bluetooth communication follows packet based data transfer.
Bluetooth supports point-to-point (device to device) and point-to-
multipoint (device to multiple device broadcasting) wireless
communication.
• The point-to-point communication follows the master slave
relationship. A Bluetooth device can function as either master or
slave.
• When a network is formed with one Bluetooth device as master
and more than one device as slaves, it is called a Piconet. A Piconet
supports a maximum of seven slave devices.
• Bluetooth is the favourite choice for short range data
communication in handheld embedded devices like cell phones
• Bluetooth Low Energy (BLE)/Bluetooth Smart is a latest addition
to the Bluetooth technology. BLE allows devices to use much less
power compared to the standard Bluetooth connections, while
offering most of the connectivity of Bluetooth and maintaining a
similar communication range.
• Bluetooth 4.2 specification enables IoT support through Low-
power IP connectivity

• The Bluetooth standard specifies the minimum requirements that a Bluetooth


device must support for a specific usage scenario.
• The Generic Access Profile (GAP) defines the requirements for detecting a
Bluetooth device and establishing a connection with it.
All other specific usage profiles are based on GAP.
Serial Port Profile (SPP) for serial data communication,
File Transfer Profile (FTP) for file transfer between devices,
Human Interface Device (HID) for supporting human interface devices like
keyboard and mouse are examples for Bluetooth profiles.
• BLE implements various application specific profiles for communicating with
low power Bluetooth peripherals like fitness devices, Blood Pressure and heart
rate monitors etc.
The specifications for Bluetooth communication is defined and licensed by the
standards body ‘Bluetooth Special Interest Group (SIG)’.

10. Explain about Ethernet in Computer Networks.


A. • Ethernet is the most widely used LAN technology, which is defined under
IEEE standards 802.3.
The reason behind its wide usability is Ethernet is easy to understand,
implement, maintain, and allows low-cost network implementation.
• Two kinds of Ethernet exist:
classic Ethernet and switched Ethernet
• Classic Ethernet is the original form and ran at rates from 3 to 10 Mbps.
• Switched Ethernet is what Ethernet has become and runs at 100, 1000, and
10,000 Mbps, in forms called fast Ethernet, gigabit Ethernet, and 10 gigabit
Ethernet. In practice, only switched Ethernet is used nowadays.
These data rates are defined for operation over optical fibres and twisted-pair
cables:
Fast Ethernet
Fast Ethernet refers to an Ethernet network that can transfer data at a rate of 100
Mbit/s.
ii) Gigabit Ethernet
Gigabit Ethernet delivers a data rate of 1,000 Mbit/s (1 Gbit/s).
iii) 10 Gigabit Ethernet
10 Gigabit Ethernet is the recent generation and delivers a data rate of 10 Gbit/s
(10,000 Mbit/s). It is generally used for backbones in high-end applications requiring
high data rates.
Advantages of Ethernet:
• Speed: When compared to a wireless connection, Ethernet provides significantly more
speed. Because Ethernet is a one-to-one connection, this is the case. As a result, speeds
of up to 10 Gigabits per second (Gbps) or even 100 Gigabits per second (Gbps) are
possible.
• Efficiency: An Ethernet cable, such as Cat6, consumes less electricity, even less than a
wifi connection. As a result, these Ethernet cables are thought to be the most energy
efficient.
• Good data transfer quality: Because it is resistant to noise, the information
transferred is of high quality.

Baud rate = 2* Bit rate

You might also like