CN Unit5
CN Unit5
Data Link Layer – Framing – Flow control – Error control – Data-Link Layer
Protocols – HDLC – PPP - Media Access Control – Ethernet Basics – CSMA/CD –
Virtual LAN – Wireless LAN (802.11) - Physical Layer: Data and Signals -
Performance – Transmission media- Switching – Circuit Switching.
1.DATA LINK LAYER
        The Data-link layer is the second layer from the bottom in the OSI (Open System
Interconnection) network architecture model. It is responsible for the node-to-node
delivery of data. Its major role is to ensure error-free transmission of information. DLL
is also responsible to encode, decode and organize the outgoing and incoming data. This
is considered the most complex layer of the OSI model as it hides all the underlying
complexities of the hardware from the other above layers.
Logical Link Control (LLC):This sublayer of the data link layer deals with multiplexing,
the flow of data among applications and other services, and LLC is responsible for
providing error messages and acknowledgments as well.
The data link layer receives the information in the form of packets from the Network
layer, it divides packets into frames and sends those frames bit-by-bit to the underlying
physical layer.
1. Framing: The packet received from the Network layer is known as a frame in the
Data link layer. At the sender’s side, DLL receives packets from the Network layer and
divides them into small frames, then, sends each frame bit-by-bit to the physical layer.
It also attaches some special bits (for error control and addressing) at the header and
end of the frame. At the receiver’s end, DLL takes bits from the Physical layer organizes
them into the frame, and sends them to the Network layer.
2. Addressing: The data link layer encapsulates the source and destination’s MAC
address/ physical address in the header of each frame to ensure node-to-node delivery.
MAC address is the unique hardware address that is assigned to the device while
manufacturing.
3. Error Control: Data can get corrupted due to various reasons like noise, attenuation,
etc. So, it is the responsibility of the data link layer, to detect the error in the transmitted
data and correct it using error detection and correction techniques respectively. DLL
adds error detection bits into the frame’s header, so that receiver can check received
data is correct or not.
4. Flow Control: If the receiver’s receiving speed is lower than the sender’s sending
speed, then this can lead to an overflow in the receiver’s buffer and some frames may
get lost. So, it’s the responsibility of DLL to synchronize the sender’s and receiver’s
speeds and establish flow control between them.
5. Access Control: When multiple devices share the same communication channel
there is a high probability of collision, so it’s the responsibility of DLL to check which
device has control over the channel and CSMA/CD and CSMA/CA can be used to avoid
collisions and loss of frames in the channel.
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:
       1. 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.
       2. 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. This can be solved by:
          1. Character/Byte Stuffing: Used when frames consist of characters. If data
          contains ED then, a byte is stuffed into data to differentiate it from ED.
          Let ED = “$” –> if data contains ‘$’ anywhere, it can be escaped using ‘\O’
          character.
           –> if data contains ‘\O$’ then, use ‘\O\O\O$'($ is escaped using \O and \O is
           escaped using \O).
Variable frame length: The length of frames can vary depending on the data being
transmitted, which can lead to inefficiencies in transmission. To address this issue,
protocols such as HDLC and PPP use a flag sequence to mark the start and end of each
frame.
Bit stuffing: Bit stuffing is a technique used to prevent data from being interpreted as
control characters by inserting extra bits into the data stream. However, bit stuffing can
lead to issues with synchronization and increase the overhead of the transmission.
Synchronization: Synchronization is critical for ensuring that data frames are
transmitted and received correctly. However, synchronization can be challenging,
particularly in high-speed networks where frames are transmitted rapidly.
Error detection: Data Link Layer protocols use various techniques to detect errors in
the transmitted data, such as checksums and CRCs. However, these techniques are not
foolproof and can miss some types of errors.
Efficiency: Efficient use of available bandwidth is critical for ensuring that data is
transmitted quickly and reliably. However, the overhead associated with framing and
error detection can reduce the overall efficiency of the transmission.
                                   4.ERROR CONTROL
Data-link layer uses the techniques of error control simply to ensure and confirm that
all the data frames or packets, i.e. bit streams of data, are transmitted or transferred
from sender to receiver with certain accuracy. Using or providing error control at this
data link layer is an optimization, it was never a requirement. Error control is basically
process in data link layer of detecting or identifying and re-transmitting data frames
that might be lost or corrupted during transmission. In both of these cases, receiver or
destination does not receive correct data frame and sender or source does not even
know anything about any such loss regarding data frames. Therefore, in such type of
cases, both sender and receiver are provided with some essential protocols that are
required to detect or identify such types of errors as loss of data frames. The Data-link
layer follows a technique known as re-transmission of frames to detect or identify
transit errors and also to take necessary actions that are required to reduce or remove
such errors. Each and every time an error is detected during transmission, particular
data frames are retransmitted and this process is known as ARQ (Automatic Repeat
Request).
Ways of doing Error Control : There are basically two ways of doing Error control as
given below :
The main difference between Go Back ARQ and Selective Repeat ARQ is that in Go Back
ARQ, the sender has to retransmit the whole window of frame again if any of the frame
is lost but in Selective Repeat ARQ only the data frame that is lost is retransmitted.
High-level Data Link Control (HDLC) is a group of communication protocols of the data
link layer for transmitting data between network points or nodes. Since it is a data link
protocol, data is organized into frames. A frame is transmitted via the network to the
destination that verifies its successful arrival. It is a bit - oriented protocol that is
applicable for both point - to - point and multipoint communications.
Transfer Modes
HDLC supports two types of transfer modes, normal response mode and asynchronous
balanced mode.
             Normal Response Mode (NRM) − Here, two types of stations are there, a
              primary station that send commands and secondary station that can
              respond to received commands. It is used for both point - to - point and
              multipoint communications.
   Asynchronous Balanced Mode (ABM) − Here, the con iguration is balanced, i.e. each
    station can both send commands and respond to commands. It is used for only point - to
    - point communications.
    HDLC Frame
    HDLC is a bit - oriented protocol where each frame contains up to six fields. The structure
    varies according to the type of frame. The fields of a HDLC frame are −
                 Flag − It is an 8-bit sequence that marks the beginning and the end of the
                  frame. The bit pattern of the flag is 01111110.
                 Address − It contains the address of the receiver. If the frame is sent by the
                  primary station, it contains the address(es) of the secondary station(s). If it
                  is sent by the secondary station, it contains the address of the primary
                  station. The address field may be from 1 byte to several bytes.
                 Control − It is 1 or 2 bytes containing low and error control information.
                 Payload − This carries the data from the network layer. Its length may vary
                  from one network to another.
                 FCS − It is a 2 byte or 4 bytes frame check sequence for error detection. The
                  standard code used is CRC (cyclic redundancy code).
PPP Frame
PPP is a byte - oriented protocol where each field of the frame is composed of one or
more bytes. The fields of a PPP frame are −
             Flag − 1 byte that marks the beginning and the end of the frame. The bit
              pattern of the flag is 01111110.
             Address − 1 byte which is set to 11111111 in case of broadcast.
             Control − 1 byte set to a constant value of 11000000.
             Protocol − 1 or 2 bytes that de ine the type of data contained in the payload
              field.
             Payload − This carries the data from the network layer. The maximum
              length of the payload field is 1500 bytes. However, this may be negotiated
              between the endpoints of communication.
             FCS − It is a 2 byte or 4 bytes frame check sequence for error detection. The
              standard code used is CRC (cyclic redundancy code)
Byte Stuffing in PPP Frame − Byte stuf ing is used is PPP payload ield whenever the lag
sequence appears in the message, so that the receiver does not consider it as the end of
the frame. The escape byte, 01111101, is stuffed before every byte that contains the same
byte as the flag byte or the escape byte. The receiver on receiving the message removes
the escape byte before passing it onto the network layer.
A media access control is a network data transfer policy that determines how data is
transmitted between two computer terminals through a network cable. The media
access control policy involves sub-layers of the data link layer 2 in the OSI reference
model.
The essence of the MAC protocol is to ensure non-collision and eases the transfer of data
packets between two computer terminals. A collision takes place when two or more
terminals transmit data/information simultaneously. This leads to a breakdown of
communication, which can prove costly for organizations that lean heavily on data
transmission.
This network channel through which data is transmitted between terminal nodes to
avoid collision has three various ways of accomplishing this purpose. They include:
    Carrier sense multiple access with collision avoidance (CSMA/CA)
    Carrier sense multiple access with collision detection (CSMA/CD)
    Demand priority
    Token passing
10.CARRIER SENSE MULTIPLE ACCESS WITH COLLISION AVOIDANCE (CSMA/CA)
       Carrier sense multiple access with collision avoidance (CSMA/CA) is a media
access control policy that regulates how data packets are transmitted between two
computer nodes. This method avoids collision by configuring each computer terminal
to make a signal before transmission. The signal is carried out by the transmitting
computer to avoid a collision.
       Multiple access implies that many computers are attempting to transmit data.
Collision avoidance means that when a computer node transmitting data states its
intention, the other waits at a specific length of time before resending the data.
       CSMA/CA is data traffic regulation is slow and adds cost in having each computer
node signal its intention before transmitting data. It used only on Apple networks.
Demand Priority
       The demand priority is an improved version of the Carrier sense multiple access
with collision detection (CSMA/CD). This data control policy uses an ‘active hub’ in
regulating how a network is accessed. Demand priority requires that the network
terminals obtain authorization from the active hub before data can be transmitted.
Another distinct feature of this MAC control policy is that data can be transmitted
between the two network terminals at the same time without collision. In the Ethernet
media, demand priority directs that data is transmitted directly to the receiving
network terminal.
Token Passing
This media access control method uses free token passing to prevent a collision. Only a
computer that possesses a free token, which is a small data frame, is authorized to
transmit. Transmission occurs from a network terminal that has a higher priority than
one with a low priority.
Token passing flourishes in an environment where a large number of short data frames
are transmitted. This media access control policy is highly efficient in avoiding a
collision. Possession of the free token is the only key to transmitting data by a network
node. Each terminal holds this free token for a specific amount of time if the network
with the high priority does not have data to transmit, the token is passed to the
adjoining station in the network.
Media access control regulates how a network is accessed by computer terminals and
transmits from one terminal to the other without collision. This is achieved through
CSMA/CD, CSMA/CA, demand priority, or Token passing.
Virtual Local Area Networks or Virtual LANs (VLANs) are a logical group of computers
that appear to be on the same LAN irrespective of the configuration of the underlying
physical network. Network administrators partition the networks to match the
functional requirements of the VLANs so that each VLAN comprise of a subset of ports
on a single or multiple switches or bridges. This allows computers and devices in a VLAN
to communicate in the simulated environment as if it is a separate LAN.
Features of VLANs
            A VLAN forms sub-network grouping together devices on separate physical
             LANs.
            VLAN's help the network manager to segment LANs logically into different
             broadcast domains.
            VLANs function at layer 2, i.e. Data Link Layer of the OSI model.
            There may be one or more network bridges or switches to form multiple,
             independent VLANs.
            Using VLANs, network administrators can easily partition a single switched
             network into multiple networks depending upon the functional and
             security requirements of their systems.
            VLANs eliminate the requirement to run new cables or reconfiguring
             physical connections in the present network infrastructure.
            VLANs help large organizations to re-partition devices aiming improved
             traffic management.
            VLANs also provide better security management allowing partitioning of
             devices according to their security criteria and also by ensuring a higher
             degree of control connected devices.
            VLANs are more flexible than physical LANs since they are formed by logical
             connections. This aids is quicker and cheaper reconfiguration of devices
             when the logical partitioning needs to be changed.
Types of VLANs
            Protocol VLAN − Here, the traf ic is handled based on the protocol used. A
             switch or bridge segregates, forwards or discards frames the come to it
             based upon the traffics protocol.
            Port-based VLAN − This is also called static VLAN. Here, the network
             administrator assigns the ports on the switch / bridge to form a virtual
             network.
            Dynamic VLAN − Here, the network administrator simply de ines network
             membership according to device characteristics.
12.Wireless LAN (802.11)
       Wireless LANs are those Local Area Networks that use high frequency radio waves
instead of cables for connecting the devices in LAN. Users connected by WLANs can move
around within the area of network coverage. Most WLANs are based upon the standard
IEEE 802.11 or WiFi.
IEEE 802.11 Architecture
The components of an IEEE 802.11 architecture are as follows
1) Stations (STA) − Stations comprise all devices and equipments that are connected to
the wireless LAN. A station can be of two types:
             Wireless Access Pointz (WAP) − WAPs or simply access points (AP) are
              generally wireless routers that form the base stations or access.
             Client.   − Clients   are   workstations,   computers,   laptops,   printers,
             smartphones, etc.
Each station has a wireless network interface controller.
2) Basic Service Set (BSS) −A basic service set is a group of stations communicating at
physical layer level. BSS can be of two categories depending upon mode of operation:
Advantages of WLANs
             They provide clutter free homes, offices and other networked places.
             The LANs are scalable in nature, i.e. devices may be added or removed from
              the network at a greater ease than wired LANs.
              The system is portable within the network coverage and access to the
               network is not bounded by the length of the cables.
              Installation and setup is much easier than wired counterparts.
              The equipment and setup costs are reduced.
Disadvantages of WLANs
              Since radio waves are used for communications, the signals are noisier with
               more interference from nearby systems.
              Greater care is needed for encrypting information. Also, they are more
               prone to errors. So, they require greater bandwidth than the wired LANs.
              WLANs are slower than wired LANs.
Data-Link Layer
 This layer is responsible for the error-free transfer of data frames.
 It de ines the format of the data on the network.
 It provides a reliable and ef icient communication between two or more devices.
 It is mainly responsible for the unique identi ication of each device that
resides on a local network.
*List out the functions of the Data Link Layer(Apr/May 2021)(2)
Functions of the Data-link layer
 Physical Addressing: The Data link layer adds a header to the frame that contains a
destination address. The frame is transmitted to the destination address mentioned in the
header.
 Flow Control: Flow control is the main functionality of the Data-link layer. It is the
technique through which the constant data rate is maintained on both the sides so that
no data get corrupted. It ensures that the transmitting station such as a server with higher
processing speed does not exceed the receiving station, with lower processing speed.
Error Control: Error control is achieved by adding a calculated value CRC (Cyclic
Redundancy Check) that is placed to the Data link layer's trailer which is added to the
message frame before it is sent to the physical layer. If any error seems to occur, then the
receiver sends the acknowledgment for the retransmission of the corrupted frames.
 Access Control: When two or more devices are connected to the same communication
channel, then the data link layer protocols are used to determine which device has
control over the link at a given time.
Network Layer
 It is a layer 3 that manages device addressing, tracks the location of devices on the
network.
 It determines the best path to move data from source to the destination based on the
network conditions, the priority of service, and other factors.
 The Data link layer is responsible for routing and forwarding the packets.
 Routers are the layer 3 devices, they are speci ied in this layer and used to provide the
routing services within an internetwork.
 The protocols used to route the network traf ic are known as Network layer protocols.
Examples of protocols are IP and Ipv6.
Transport Layer
 The Transport layer is a Layer 4 ensures that messages are transmitted in the order in
which they are sent and there is no duplication of data.
 The main responsibility of the transport layer is to transfer the data completely.
 It receives the data from the upper layer and converts them into smaller units known
assignments.
 This layer can be termed as an end-to-end layer as it provides a point-to-point
connection between source and destination to deliver the data reliably.
Functions of Transport Layer:
 Service-point addressing: Computers run several programs simultaneously due to this
reason, the transmission of data from source to the destination not only from one computer
to another computer but also from one process to another process. The transport layer adds
the header that contains the address known as a service-point address or port address. The
responsibility of the network layer is to transmit the data from one computer to another
computer and the responsibility of the transport layer is to transmit the message to the
correct process.
 Segmentation and reassembly: When the transport layer receives the message
from the upper layer, it divides the message into multiple segments, and each
segment is assigned with a sequence number that uniquely identi ies each segment.
When the message has arrived at the destination, then the transport layer
reassembles the message based on their sequence numbers.
 Connection control: Transport layer provides two services Connection-oriented
service and connectionless service. A connectionless service treats each segment as an
individual packet, and they all travel in different routes to reach the destination. A
connection-oriented service makes a connection with the transport layer at the
destination machine before delivering the packets. In connection-oriented service, all the
packets travel in the single route.
 Flow control: The transport layer also responsible for low control but it is performed
end-to- end rather than across a single link.
 Error control: The transport layer is also responsible for Error control. Error control
is performed end-to-end rather than across the single link. The sender transport layer
ensures that message reach at the destination without any error.
Session Layer
 It is a layer 3 in the OSI model.
 The Session layer is used to establish, maintain and synchronizes the interaction
between communicating devices.
Functions of Session layer:
 Dialog control: Session layer acts as a dialog controller that creates a dialog between
two processes or we can say that it allows the communication between two processes
which can be either half-duplex or full-duplex.
 Synchronization: Session layer adds some checkpoints when transmitting the data in
a sequence. If some error occurs in the middle of the transmission of data, then the
transmission will take place again from the checkpoint. This process is known as
Synchronization and recovery.
Presentation Layer
 A Presentation layer is mainly concerned with the syntax and semantics of the
information exchanged between the two systems.
 It acts as a data translator for a network.
 This layer is a part of the operating system that converts the data from one
presentation format to another format.
 The Presentation layer is also known as the syntax layer.
Application Layer
 An application layer serves as a window for users and application processes to access
network service.
 It handles issues such as network transparency, resource allocation, etc.
 An application layer is not an application, but it performs the application layer
functions.
 This layer provides the network services to the end-users.
Functions of Application layer:
 File transfer, access, and management (FTAM): An application layer allows a user to
access the iles in a remote computer, to retrieve the iles from a computer and to manage
the iles in a remote computer.
 Mail services: An application layer provides the facility for email forwarding and
storage.
 Directory services: An application provides the distributed database sources and is
used to provide that global information about various objects.
15.TRANSMISSION MEDIA
Transmission media is a communication channel that carries the information from the
sender to the receiver. Data is transmitted through the electromagnetic signals.
 The main functionality of the transmission media is to carry the information in the form
of bits through LAN(Local Area Network).
 It is a physical path between transmitter and receiver in data communication.
 In a copper-based network, the bits in the form of electrical signals.
 In a iber based network, the bits in the form of light pulses.
1. Guided Media:
It is also referred to as Wired or Bounded transmission media. Signals being transmitted
are directed and con ined in a narrow pathway by using physical links.
Features:
 High Speed
 Secure
 Used for comparatively shorter distances
There are 3 major types of Guided Media
(ii) Microwaves –
It is a line of sight transmission i.e. the sending and receiving antennas need to be
properly aligned with each other. The distance covered by the signal is directly proportional
to the height of the antenna. Frequency Range:1GHz – 300GHz. These are majorly used for
mobile phone communication and television distribution.
(iii) Infrared –
Infrared waves are used for very short distance communication. They cannot penetrate
through obstacles. This prevents interference between systems. Frequency
Range:300GHz – 400THz. It isused in TV remotes, wireless mouse, keyboard, printer, etc.
Figure shows, there is no waiting time at each switch. The total delay is due to the time
needed to create the connection, transfer data, and disconnect the circuit. The delay
caused by the setup is the sum of four parts: the propagation time of the source computer
request (slope of the first gray box), the request signal transfer time (height of the first
gray box), the propagation time of the acknowledgment from the destination computer
(slope of the second gray box), and the signal transfer time of the acknowledgment
(height of the second gray box). The delay due to data transfer is the sum of two parts:
the propagation time (slope of the colored box) and data transfer time (height of the
colored box), which can be very long.
The third box shows the time needed to tear down the circuit. We have shown the case
in which the receiver requests disconnection, which creates the maximum delay.