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

Chapter 5 Physical and Data Link Layer

Chapter 5 discusses the Data Link and Physical layers of network architecture, focusing on Ethernet technology and its collision management schemes, CSMA/CD and CSMA/CA. It outlines the services provided by the Data Link layer, including framing, link access, reliable delivery, and error detection methods such as parity checks, checksums, and cyclic redundancy checks (CRC). The Physical layer is described as responsible for the physical characteristics of the network, including data transmission rates, synchronization, and the physical topology of connections.

Uploaded by

ephremmulu486
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Chapter 5 Physical and Data Link Layer

Chapter 5 discusses the Data Link and Physical layers of network architecture, focusing on Ethernet technology and its collision management schemes, CSMA/CD and CSMA/CA. It outlines the services provided by the Data Link layer, including framing, link access, reliable delivery, and error detection methods such as parity checks, checksums, and cyclic redundancy checks (CRC). The Physical layer is described as responsible for the physical characteristics of the network, including data transmission rates, synchronization, and the physical topology of connections.

Uploaded by

ephremmulu486
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

Chapter 5

Data link and Physical layer

Data link layer


Ethernet: is a well-known and widely used LAN technology that employs topology. Ethernet
technology helps to share a common share a common transmission medium by all computers that
share this common channel. But if common channel for different devices there is collision of
traffic. But how to control it at ethernet standard? By using Carrier Sense Multiple Access (CSMA)
scheme based on electrical signal checks the non-appearance of other traffic before sending over
a common transmission medium (can done by hub or switch).
If no computer is sending a frame, cable does not contain signals. If no carrier is present, the
computer can transmit a frame. If a carrier is present, the computer must wait for the sender to
finish before proceeding. If more than one computer sends data across the network at one time
collision will occur. Therefore; to detects and controls collision machines use ethernet schemes
such as CSMA/CD and CSMA/CA
A. Carrier Sense Multiple Access Collusion Detection (CSMA/CD)
 CSMA/CD method or scheme is implemented and it monitor outgoing signal
 According to CSMA/CD scheme computer stops transmitting after collision is detected.

B. Carrier Sense Multiple Access Collusion Avoidance (CSMA/CA)


 Most commonly used for wireless networks

1 | P a g e : SOURCES: Top-down 6th edition by James Kurose; Andrew S. Tanenbaum, 4th and 5th
Edition Book; Data Communications and Networking fourth edition By Behrouz A; Data & Computer
Communications 8 edition by William Stallings.
Compiled by Endale M.
 It differs from CSMA/CD in that CSMA/CA first sends out a warning message letting all
computers.

Data Link layer services

1. Framing. Almost all link-layer protocols encapsulate each network-layer datagram within a
link-layer frame before transmission over the link. A frame consists of a data field, in which
the network-layer datagram is inserted, and a number of header fields.
2. Link access (addressing). A medium access control (MAC) protocol specifies the rules by
which a frame is transmitted onto the link. For point-to-point links that have a single sender at
one end of the link and a single receiver at the other end of the link, the MAC protocol is simple
(or nonexistent) the sender can send a frame whenever the link is idle.

3. Reliable delivery. When a link-layer protocol provides reliable delivery service, it guarantees
to move each network-layer datagram across the link without error. Recall that certain
transport-layer protocols (such as TCP) also provide a reliable delivery service.
4. Error detection and correction. The link-layer hardware in a receiving node can incorrectly
decide that a bit in a frame is zero when it was transmitted as a one, and vice versa. Such bit
errors are introduced by signal attenuation and electromagnetic noise. Because there is no need

2 | P a g e : SOURCES: Top-down 6th edition by James Kurose; Andrew S. Tanenbaum, 4th and 5th
Edition Book; Data Communications and Networking fourth edition By Behrouz A; Data & Computer
Communications 8 edition by William Stallings.
Compiled by Endale M.
to forward a datagram that has an error, many link-layer protocols provide a mechanism to
detect such bit errors. This is done by having the transmitting node include error-detection bits
in the frame, and having the receiving node perform an error check.

4.1.Parity checks: Perhaps the simplest form of error detection is the use of a single parity bit. In
an even parity scheme, the sender simply includes one additional bit and chooses its value such
that the total number of 1s in the d + 1 bits (the original information plus a parity bit) is even.
For odd parity schemes, the parity bit value is chosen such that there is an odd number of 1s.

 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

4.2. Check summing methods

A checksum is a value that represents the number of bits in a transmission message and is used to
detect high-level errors within data transmissions.
There are multiple cryptographic hash functions that programmers can use to generate checksum
values. A few common ones include:
SHA-0 – This hash function was the first of its kind and it was withdrawn shortly after its creation
in 1993.

3 | P a g e : SOURCES: Top-down 6th edition by James Kurose; Andrew S. Tanenbaum, 4th and 5th
Edition Book; Data Communications and Networking fourth edition By Behrouz A; Data & Computer
Communications 8 edition by William Stallings.
Compiled by Endale M.
SHA-1 – This hash function was no longer considered secure as of 2010.
 Error detection using checksum method involves the following steps
 Step-01:
At sender side,
 If m bit checksum is used, the data unit to be transmitted is divided into segments of m bits.
 All the m bit segments are added.
 The result of the sum is then complemented using 1’s complement arithmetic.
 The value so obtained is called as checksum.
 Step-02:
 The data along with the checksum value is transmitted to the receiver.
 Step-03:
 At receiver side,
 If m bit checksum is being used, the received data unit is divided into segments of m bits.
 All the m bit segments are added along with the checksum value.
 The value so obtained is complemented and the result is checked.
 Then, following two cases are possible
Then, following two cases are possible-

Case-01: Result = 0

If the result is zero,

Receiver assumes that no error occurred in the data during the transmission.
Receiver accepts the data.
Case-02: Result ≠ 0

If the result is non-zero,

 Receiver assumes that error occurred in the data during the transmission.
 Receiver discards the data and asks the sender for retransmission.

Checksum Example-
Consider the data unit to be transmitted is- 10011001111000100010010010000100

4 | P a g e : SOURCES: Top-down 6th edition by James Kurose; Andrew S. Tanenbaum, 4th and 5th
Edition Book; Data Communications and Networking fourth edition By Behrouz A; Data & Computer
Communications 8 edition by William Stallings.
Compiled by Endale M.
Consider 8-bit checksum is used.
Step-01:

At sender side, the given data unit is divided into segments of 8 bits as-

Now, all the segments are added and the result is obtained as-

 10011001 + 11100010 + 00100100 + 10000100 = 1000100011


 Since the result consists of 10 bits, so extra 2 bits are wrapped around.
 00100011 + 10 = 00100101 (8 bits)
 Now, 1’s complement is taken which is 11011010.
 Thus, checksum value = 11011010

Step-02:

 The data along with the checksum value is transmitted to the receiver.

Step-03:

 At receiver side,

 The received data unit is divided into segments of 8 bits.

 All the segments along with the checksum value are added.

 Sum of all segments + Checksum value = 00100101 + 11011010 = 11111111

 Complemented value = 00000000

 Since the result is 0, receiver assumes no error occurred in the data and therefore accepts
it.
4. Cyclic redundancy check (CRC)

 Unlike checksum scheme, which is based on addition, CRC is based on binary division.

5 | P a g e : SOURCES: Top-down 6th edition by James Kurose; Andrew S. Tanenbaum, 4th and 5th
Edition Book; Data Communications and Networking fourth edition By Behrouz A; Data & Computer
Communications 8 edition by William Stallings.
Compiled by Endale M.
 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.

The value of these polynomials is the divisor of modulo 2 division. Obtaining and checking the
check code by using the divisor consist of the following steps:

Before communication, the transmit end and receive end agree on a divisor P, that is, the value
of a polynomial. The length of P should be R+1 bits.

The transmit end first appends R zeros to the original K-bit data, which is equivalent to shifting
the original data to the left by R bits.

Then, a modulo-2 division operation (an XOR operation) is performed to divide the (K+R)-bit
number obtained after the addition of zeros by P, and cyclic calculation is performed until an
order of a remainder is less than R. The remainder is the check code. If the check code length is
less than R bits, zeros are prepended to it to ensure that the length is R bits.

6 | P a g e : SOURCES: Top-down 6th edition by James Kurose; Andrew S. Tanenbaum, 4th and 5th
Edition Book; Data Communications and Networking fourth edition By Behrouz A; Data & Computer
Communications 8 edition by William Stallings.
Compiled by Endale M.
The transmit end appends the R-bit check code to the original data and sends the data to the
receive end.

When receiving the data, the receive end divides the data by P using modulo-2 division. If there
is no remainder, no error occurs during data transmission. Otherwise, an error occurs.

The following example illustrates the CRC calculation process:

Assume that g(x) is CRC-4, which equals X4 + X + 1, and the source data M is 10110011. In
this case, the divisor P is 10011. The transmit end shifts M leftward by four bits, and divides the
resulting number by P.

The remainder is the CRC check code, which is 0100 in this example. The transmit end appends
0100 to the original data frame 10110011 to generate a new frame 101100110100, and sends the
new frame to the receive end. When receiving this frame, the receive end divides the frame by the
divisor P, and considers the frame correct if the division leaves no remainder.

7 | P a g e : SOURCES: Top-down 6th edition by James Kurose; Andrew S. Tanenbaum, 4th and 5th
Edition Book; Data Communications and Networking fourth edition By Behrouz A; Data & Computer
Communications 8 edition by William Stallings.
Compiled by Endale M.
How to Fix CRC Errors?

If few CRC error packets occur on an interface of a network device, no action is required. If CRC error packets
are continuously generated on an interface, the possible cause is that the transmission medium is faulty. For
example, the connected twisted pair or optical fiber is faulty, or the optical module on the interface does not
work properly. In this case, replace the interface, optical module, or cable, and then check whether the fault is
rectified

Data link layer protocols


1. Synchrous data link protocols:
DLC is basically a communication protocol of computer. It usually supports multipoint links
even error recovery or error correction also. It is usually used to carry SNA (Systems Network
Architecture) traffic and is present precursor to HDLC. It is also designed and developed by
IBM in 1975. It is also used to connect all of the remote devices to mainframe computers at
central locations may be in point-to-point (one-to-one) or point-to-multipoint (one-to-many)
connections. It is also used to make sure that the data units should arrive correctly and with right
flow from one network point to next network point.
2. High-Level Data Link Protocol (HDLC)
HDLC is basically a protocol that is now assumed to be an umbrella under which many Wide
Area protocols sit. It is also adopted as a part of X.25 network. It was originally created and
developed by ISO in 1979. This protocol is generally based on SDLC. It also provides best-
effort unreliable service and also reliable service. HDLC is a bit-oriented protocol that is
applicable for point-to-point and multipoint communications both.
3. Serial Line Interface Protocol (SLIP):
SLIP is generally an older protocol that is just used to add a framing byte at end of IP packet. It
is basically a data link control facility that is required for transferring IP packets usually among
Internet Service Providers (ISP) and a home user over a dial-up link. It is an encapsulation of the
TCP/IP especially designed to work with over serial ports and several router connections simply
for communication. It is some limitations like it does not provide mechanisms such as error
correction or error detection.

8 | P a g e : SOURCES: Top-down 6th edition by James Kurose; Andrew S. Tanenbaum, 4th and 5th
Edition Book; Data Communications and Networking fourth edition By Behrouz A; Data & Computer
Communications 8 edition by William Stallings.
Compiled by Endale M.
4. Link Control Protocol (LCP)
It was originally developed and created by IEEE 802.2. It is also used to provide HDLC style
services on LAN (Local Area Network). LCP is basically a PPP protocol that is used for
establishing, configuring, testing, maintenance, and ending or terminating links for transmission
of data frames.
5. Link Access Procedure (LAP)
AP protocols are basically a data link layer protocols that are required for framing and
transferring data across point-to-point links. It also includes some reliability service features.
There are basically three types of LAP i.e. LAPB (Link Access Procedure Balanced), LAPD
(Link Access Procedure D-Channel), and LAPF (Link Access Procedure Frame-Mode Bearer
Services). It is actually originated from IBM SDLC, which is being submitted by IBM to the
ISP simply for standardization.
6.Network Control Protocol (NCP)
NCP was also an older protocol that was implemented by ARPANET. It basically allows users
to have access to use computers and some of the devices at remote locations and also to transfer
files among two or more computers. It is generally a set of protocols that is forming a part of
PPP. NCP is always available for each and every higher-layer protocol that is supported by PPP.
NCP was replaced by TCP/IP in the 1980s.

Physical layer
Define physical characteristics of network. E.g. wires, connector, voltages, data rates,
Asynchronous, Synchronous Transmission. Handles bit stream or binary transmission. Used to
maintain, activate and deactivate physical link. For receiver it reassembles bits and send to upper
layer for frames. For sender it converts frames into bit stream and send on transmission medium.
Position of the physical layer: See the following figure. There is data link layer at the above of
physical layer and this physical layer give service to the upper layer which is data link layer.
Responsibility of this layer are:

9 | P a g e : SOURCES: Top-down 6th edition by James Kurose; Andrew S. Tanenbaum, 4th and 5th
Edition Book; Data Communications and Networking fourth edition By Behrouz A; Data & Computer
Communications 8 edition by William Stallings.
Compiled by Endale M.
General, physical Layer responsibilities
 Maintains the data rate (how many bits a sender can send per second).
 It performs Synchronization of bits.
 It helps in Transmission Medium decision (direction of data transfer).
 It helps in Physical Topology (Mesh, Star, Bus, Ring) decision (Topology through which we
can connect the devices with each other).
 It helps in providing Physical Medium and Interface decisions.
 It provides two types of configuration Point to Point configuration and Multi-Point
configuration.
 It provides an interface between devices (like PC’s or computers) and transmission medium.
 It has a protocol data unit in bits.
 Hubs, Ethernet, etc. device is used in this layer.
 This layer comes under the category of Hardware Layers (since the hardware layer is
responsible for all the physical connection establishment and processing too).
 It provides an important aspect called Modulation, which is the process of converting the data
into radio waves by adding the information to an electrical or optical nerve signal.
 It also provides Switching mechanism wherein data packets can be forward from one port
(sender port) to the leading destination port.

10 | P a g e : SOURCES: Top-down 6th edition by James Kurose; Andrew S. Tanenbaum, 4th and 5th
Edition Book; Data Communications and Networking fourth edition By Behrouz A; Data & Computer
Communications 8 edition by William Stallings.
Compiled by Endale M.

You might also like