Unit 2
Unit 2
Unit 2
• When bits are transmitted over the computer network, they are subject to get corrupted due to
interference and network problems. The corrupted bits leads to spurious data being received by
the destination and are called errors.
• Error control in data link layer is the process of detecting and correcting data frames that have
been corrupted or lost during transmission.
• In case of lost or corrupted frames, the receiver does not receive the correct data-frame and the
sender is ignorant about the loss.
• Data link layer follows a technique to detect transit errors and take necessary actions, which is
retransmission of frames whenever error is detected, or frame is lost. The process is called
Automatic Repeat Request (ARQ).
Types of Errors
Errors can be of three types, namely single bit errors, multiple bit errors, and burst errors.
• Single bit error − In the received frame, only one bit has been corrupted, i.e. eitherchanged
from 0 to 1 or from 1 to 0.
•
• Multiple bits error − In the received frame, more than one bits are corrupted.
• Burst error − In the received frame, more than one consecutive bits are corrupted.
Checksum
In this error detection scheme, the following procedure is applied
• Data is divided into fixed sized frames or segments.
• The sender adds the segments using 1’s complement arithmetic to get the sum. It then
complements the sum to get the checksum and sends it along with the data frames.
• The receiver adds the incoming segments along with the checksum using 1’scomplement
arithmetic to get the sum and then complements it.
• If the result is zero, the received frames are accepted; otherwise, they are discarded.
• Feedback based Flow Control - In these protocols, the sender sends frames after it hasreceived
acknowledgments from the user. This is used in the data link layer.
• Rate based Flow Control - These protocols have built in mechanisms to restrict the rate of
transmission of data without requiring acknowledgment from the receiver. This is used in the
network layer and the transport layer.
Flow Control Techniques in Data Link Layer
Data link layer uses feedback based flow control mechanisms. There are two main techniques
Go-Back-N ARQ
The working principle of this protocol is:
• The sender has buffers called sending window.
• The sender sends multiple frames based upon the sending-window size, withoutreceiving the
acknowledgment of the previous ones.
• The receiver receives frames one by one. It keeps track of incoming frame’s sequencenumber
and sends the corresponding acknowledgment frames.
• After the sender has sent all the frames in window, it checks up to what sequence numberit has
received positive acknowledgment.
• If the sender has received positive acknowledgment for all the frames, it sends next setof frames.
• If sender receives NACK or has not receive any ACK for a particular frame, itretransmits all
the frames after which it does not receive any positive ACK.
• Asynchronous Balanced Mode (ABM) − Here, the configuration is balanced, i.e. eachstation
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 bitpattern
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 flow 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)
40
MEDIUM ACCESS SUB LAYER
Point to Point Protocol
• Point - to - Point Protocol (PPP) is a communication protocol of the data link layer that is used
to transmit multiprotocol data between two directly connected (point-to-point) computers.
• It is a byte - oriented protocol that is widely used in broadband communications having heavy
loads and high speeds.
• Since it is a data link layer protocol, data is transmitted in frames. It is also known as RFC 1661.
Services Provided by PPP
The main services provided by Point - to - Point Protocol are −
• Defining the frame format of the data to be transmitted.
• Defining the procedure of establishing link between two points and exchange of data.
• Stating the method of encapsulation of network layer data in the frame.
• Stating authentication rules of the communicating devices.
• Providing address for network communication.
• Providing connections over multiple links.
• Supporting a variety of network layer protocols by providing a range os services.
Components of PPP
Point - to - Point Protocol is a layered protocol having three components −
• Encapsulation Component − It encapsulates the datagram so that it can be transmittedover the
specified physical layer.
• Link Control Protocol (LCP) − It is responsible for establishing, configuring, testing,
maintaining and terminating links for transmission. It also imparts negotiation for set up of
options and use of features by the two endpoints of the links.
• Authentication Protocols (AP) − These protocols authenticate endpoints for use of services.
The two authentication protocols of PPP are:
o Password Authentication Protocol (PAP)
o Challenge Handshake Authentication Protocol (CHAP)
• Network Control Protocols (NCPs) − These protocols are used for negotiating the parameters
and facilities for the network layer. For every higher-layer protocol supported by PPP, one NCP
is there. Some of the NCPs of PPP are:
• Internet Protocol Control Protocol (IPCP)
• OSI Network Layer Control Protocol (OSINLCP)
• Internetwork Packet Exchange Control Protocol (IPXCP)
• DECnet Phase IV Control Protocol (DNCP)
• NetBIOS Frames Control Protocol (NBFCP)
• IPv6 Control Protocol (IPV6CP)
PPP Frame
PPP is a byte - oriented protocol where each field of the frame is composed of one or morebytes. The
fields of a PPP frame are −
• Flag − 1 byte that marks the beginning and the end of the frame. The bit pattern of theflag 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 define 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)
FDDI
Fiber Distributed Data Interface (FDDI) is a set of ANSI and ISO standards for transmission of data in
local area network (LAN) over fiber optic cables. It is applicable in large LANs that can extend up to
200 kilometers in diameter.
Features
• FDDI uses optical fiber as its physical medium.
• It operates in the physical and medium access control (MAC layer) of the Open Systems
Interconnection (OSI) network model.
• It provides high data rate of 100 Mbps and can support thousands of users.
• It is used in LANs up to 200 kilometers for long distance voice and multimedia
communication.
• It uses ring based token passing mechanism and is derived from IEEE 802.4 token busstandard.
• It contains two token rings, a primary ring for data and token transmission and asecondary
ring that provides backup if the primary ring fails.
• FDDI technology can also be used as a backbone for a wide area network (WAN).
Frame Format
The frame format of FDDI is similar to that of token bus as shown in the following diagram-
Token Bus
• Token Bus (IEEE 802.4) is a standard for implementing token ring over virtual ring in LANs.
• The physical media has a bus or a tree topology and uses coaxial cables.
• A virtual ring is created with the nodes/stations and the token is passed from one nodeto the
next in a sequence along this virtual ring.
• Each node knows the address of its preceding station and its succeeding station.
• A station can only transmit data when it has the token.
• The working principle of token bus is similar to Token Ring.
The following figure shows a situation with five stations and a five slot reservation frame. In the first
interval, only stations 1, 3, and 4 have made reservations. In the second interval, only station 1 has made
a reservation.
Polling
• Polling process is similar to the roll-call performed in class. Just like the teacher, acontroller
sends a message to each node in turn.
• In this, one acts as a primary station(controller) and the others are secondary stations.All data
exchanges must be made through the controller.
• The message sent by the controller contains the address of the node being selected forgranting
access.
• Although all nodes receive the message but the addressed one responds to it and sendsdata, if
any. If there is no data, usually a “poll reject”(NAK) message is sent back.
• Problems include high overhead of the polling messages and high dependence on thereliability
of the controller.
Pure Aloha
• It allows user to transmit whenever they have data to be sent.
• Senders wait to see if a collision occurred (after the whole message has been sent).
• If collision occurs, each station involved waits a random amount of time then tries again.
• System in which multiple users share a common channel in a way can lead to conflictsare
widely known as contention system.
• Whenever 2 frames try to copy the channel at the same time, there will be a collisionand both
will be garbled.
• If the 1st bit of the new frame overlaps with hust the last bit of a frame almost finished,both
frames will be totally destroyed and both frames will have to be retransmitted later.
• Frames are transmitted at completely arbitrary times.
• The throughput of the Pure Aloha is maximized when the frames are of uniform length.
• Formula to calculate the throughput of Pure Aloha is,
S = G * e^2G
• The throughput is maximum when G=1/2 which is 18% of the total transmitted dataframes.
Slotted Aloha
• It was invented to improve the efficiency of Pure Aloha as chances of collision in PureAloha
are very high.
• The time of the shared channel is divided into discrete intervals called slots.
• The stations can send a frame only at the beginning of the slot and only one frame issent in
each slot.
• If any station is not able to place the frame onto the channel at the beginning of the slotthen the
station has to wait until the beginning of the next time slot.
• The formula to calculate the throughput of the Slotted Aloha is
S = G * e^G
• The throughput is maximum when G=1 which is 37% of the total transmitted dataframes.
• 37% of the time slot is empty, 37% successes and 26% collision.
• Non – persistent method: If the line is idle, station sends the frame immediately. If theline is
not idle, it waits for a random amount of time and then senses the line again.
In the diagram, A starts send the first bit of its frame at t1 and since C sees the channel idle at t2, starts
sending its frame at t2. C detects A’s frame at t3 and aborts transmission. A detects C’s frame at t4 and
aborts its transmission. Transmission time for C’s frame is therefore t3-t2 and for A’s frame is t4-t1.
So, the frame transmission time (Tfr) should be at least twice the maximum propagation time (Tp). This
can be deduced when the two stations involved in collision are maximum distance apart.
Process –
The entire process of collision detection can be explained as follows:
Throughput and Efficiency – The throughput of CSMA/CD is much greater than pure orslotted
ALOHA.
• For 1-persistent method throughput is 50% when G=1.
• For non-persistent method throughput can go upto 90%.
FDMA
• Frequency Division Multiple Access (FDMA) is one of the most common analoguemultiple
access methods.
• The frequency band is divided into channels of equal bandwidth so that eachconversation is
carried on a different frequency (as shown in the figure below).
Overview
• In FDMA method, guard bands are used between the adjacent signal spectra to minimizecrosstalk
between the channels.
• A specific frequency band is given to one person, and it will be received by identifyingeach of
the frequency on the receiving end.
• It is often used in the first generation of analog mobile phone.
Advantages of FDMA
As FDMA systems use low bit rates (large symbol time) compared to average delay spread, itoffers the
following advantages −
• Reduces the bit rate information and the use of efficient numerical codes increases thecapacity.
• It reduces the cost and lowers the inter symbol interference (ISI)
• Equalization is not necessary.
• An FDMA system can be easily implemented. A system can be configured so that the
improvements in terms of speech encoder and bit rate reduction may be easily incorporated.
• Since the transmission is continuous, less number of bits are required for synchronization and
framing.
Disadvantages of FDMA
Although FDMA offers several advantages, it has a few drawbacks as well, which are listedbelow −
50
• It does not differ significantly from analog systems; improving the capacity depends onthe
signal-to-interference reduction, or a signal-to-noise ratio (SNR).
• The maximum flow rate per channel is fixed and small.
• Guard bands lead to a waste of capacity.
• Hardware implies narrowband filters, which cannot be realized in VLSI and thereforeincreases
the cost.
TDMA
• Time Division Multiple Access (TDMA) is a digital cellular telephone communication
technology.
• It facilitates many users to share the same frequency without interference.
• Its technology divides a signal into different timeslots, and increases the data carryingcapacity.
Overview
• Time Division Multiple Access (TDMA) is a complex technology, because it requiresan
accurate synchronization between the transmitter and the receiver.
• TDMA is used in digital mobile radio systems. The individual mobile stations cyclicallyassign a
frequency for the exclusive use of a time interval.
• In most of the cases, the entire system bandwidth for an interval of time is not assignedto a
station.
• However, the frequency of the system is divided into sub-bands, and TDMA is used forthe
multiple access in each sub-band. Sub-bands are known as carrier frequencies.
• The mobile system that uses this technique is referred as the multi-carrier systems.
In the following example, the frequency band has been shared by three users. Each user is assigned
definite timeslots to send and receive data. In this example, user ‘B’ sends after user ‘A,’ and user ‘C’
sends thereafter. In this way, the peak power becomes a problem and larger by the burst communication.
Advantages of TDMA
Here is a list of few notable advantages of TDMA −
• Permits flexible rates (i.e. several slots can be assigned to a user, for example, each timeinterval
translates 32Kbps, a user is assigned two 64 Kbps slots per frame).
• Can withstand gusty or variable bit rate traffic. Number of slots allocated to a user can be
changed frame by frame (for example, two slots in the frame 1, three slots in the frame 2, one
slot in the frame 3, frame 0 of the notches 4, etc.).
• No guard band required for the wideband system.
• No narrowband filter required for the wideband system.
Disadvantages of TDMA
The disadvantages of TDMA are as follow −
• High data rates of broadband systems require complex equalization.
• Due to the burst mode, a large number of additional bits are required for synchronizationand
supervision.
• Call time is needed in each slot to accommodate time to inaccuracies (due to clock
instability).
• Electronics operating at high bit rates increase energy consumption.
• Complex signal processing is required to synchronize within short slots.
CDMA
• Code Division Multiple Access (CDMA) is a sort of multiplexing that facilitates varioussignals
to occupy a single transmission channel.
• It optimizes the use of available bandwidth. The technology is commonly used in ultra-high-
frequency (UHF) cellular telephone systems.
Overview
• Code Division Multiple Access system is very different from time and frequencymultiplexing.
• In this system, a user has access to the whole bandwidth for the entire duration.
• The basic principle is that different CDMA codes are used to distinguish among thedifferent
users.
Advantages of CDMA
CDMA has a soft capacity. The greater the number of codes, the more the number of users. It has the
following advantages −
• CDMA requires a tight power control, as it suffers from near-far effect. In other words, a user
near the base station transmitting with the same power will drown the signal latter.All signals
must have more or less equal power at the receiver
• Rake receivers can be used to improve signal reception. Delayed versions of time (a chip or
later) of the signal (multipath signals) can be collected and used to make decisions at the bit
level.
• Flexible transfer may be used. Mobile base stations can switch without changingoperator. Two
base stations receive mobile signal and the mobile receives signals from the two base stations.
• Transmission Burst − reduces interference.
Disadvantages of CDMA
The disadvantages of using CDMA are as follows −
• The code length must be carefully selected. A large code length can induce delay or maycause
interference.
• Time synchronization is required.
• Gradual transfer increases the use of radio resources and may reduce capacity.
• As the sum of the power received and transmitted from a base station needs constanttight
power control. This can result in several handovers.
LLC
• The logical link control (LLC) is the upper sublayer of the data link layer of the opensystem
interconnections (OSI) reference model for data transmission.
• It acts act an interface between the network layer and the medium access control (MAC)sublayer
of the data link layer.
• The LLC sublayer is mainly used for its multiplexing property.
• It allows several network protocols to operate simultaneously within a multipointnetwork over
the same network medium.
• The Open System Interconnections (OSI) model is a 7 – layered networking frameworkthat
conceptualizes how communications should be done between heterogeneous systems.
• The data link layer is the second lowest layer. It is divided into two sublayers −
• The logical link control (LLC) sublayer
• The medium access control (MAC) sublayer
The following diagram depicts the position of the LLC sublayer -
Functions
• The primary function of LLC is to multiplex protocols over the MAC layer while
transmitting and likewise to de-multiplex the protocols while receiving.
• LLC provides hop-to-hop flow and error control.
• It allows multipoint communication over computer network.
• Frame Sequence Numbers are assigned by LLC.
• In case of acknowledged services, it tracks acknowledgements
Ethernet
• Ethernet is most widely used LAN Technology, which is defined under IEEE standards802.3.
• The reason behind its wide usability is Ethernet is easy to understand, implement,maintain and
allows low-cost network implementation.
• Also, Ethernet offers flexibility in terms of topologies which are allowed.
• Ethernet operates in two layers of the OSI model, Physical Layer, and Data Link Layer.
• For Ethernet, the protocol data unit is Frame since we mainly deal with DLL. In orderto handle
collision, the Access control mechanism used in Ethernet is CSMA/CD.
Network Devices
1. Repeater – A repeater operates at the physical layer. Its job is to regenerate the signal over the same
network before the signal becomes too weak or corrupted so as to extend the length to which the signal
can be transmitted over the same network. An important point to be noted about repeaters is that they
do not amplify the signal. When the signal becomes weak, they copy the signal bit by bit and regenerate
it at the original strength. It is a 2 port device.
2. Hub – A hub is basically a multiport repeater. A hub connects multiple wires coming fromdifferent
branches, for example, the connector in star topology which connects different stations. Hubs cannot
filter data, so data packets are sent to all connected devices. In other words, collision domain of all hosts
connected through Hub remains one. Also, they do not have intelligence to find out best path for data
packets which leads to inefficiencies and wastage.
Types of Hub
• Active Hub - These are the hubs which have their own power supply and can clean, boost and
relay the signal along with the network. It serves both as a repeater as well aswiring centre.
These are used to extend the maximum distance between nodes.
• Passive Hub - These are the hubs which collect wiring from nodes and power supply from active
hub. These hubs relay signals onto the network without cleaning and boosting them and can’t
be used to extend the distance between nodes.
3. Bridge – A bridge operates at data link layer. A bridge is a repeater, with add on the functionality
of filtering content by reading the MAC addresses of source and destination. Itis also used for
interconnecting two LANs working on the same protocol. It has a single input and single output port,
thus making it a 2 port device.
Types of Bridges
• Transparent Bridges - These are the bridge in which the stations are completely unaware of
the bridge’s existence i.e. whether or not a bridge is added or deleted from the network,
reconfiguration of the stations is unnecessary. These bridges make use of two processes i.e.
bridge forwarding and bridge learning.
• Source Routing Bridges - In these bridges, routing operation is performed by source station
and the frame specifies which route to follow. The hot can discover frame by sending a special
frame called discovery frame, which spreads through the entirenetwork using all possible paths
to destination.
4. Switch – A switch is a multiport bridge with a buffer and a design that can boost its efficiency (a
large number of ports imply less traffic) and performance. A switch is a data linklayer device. The
switch can perform error checking before forwarding data, that makes it veryefficient as it does not
forward packets that have errors and forward good packets selectively to correct port only. In other
words, switch divides collision domain of hosts, but broadcast domain remains same.
5. Routers – A router is a device like a switch that routes data packets based on their IP addresses.
Router is mainly a Network Layer device. Routers normally connect LANs and WANs together and
have a dynamically updating routing table based on which they make decisions on routing the data
packets. Router divide broadcast domains of hosts connected through it.
6. Gateway – A gateway, as the name suggests, is a passage to connect two networks togetherthat may
work upon different networking models. They basically work as the messenger agentsthat take data from
one system, interpret it, and transfer it to another system. Gateways are also called protocol converters
and can operate at any network layer. Gateways are generally more complex than switch or router.
7. Brouter – It is also known as bridging router is a device which combines features of both bridge and
router. It can work either at data link layer or at network layer. Working as router,it is capable of
routing packets across networks and working as bridge, it is capable of filteringlocal area network
traffic.
Spanning tree algorithm.
1. In a bridged LAN, spanning tree algorithm means creating a topology in which each LAN can be reached
from any other LAN through one path only.
2. There is no loop present.
3. We cannot change the physical topology of the system because of physical connections between cables
and bridges.
4. So we create a logical topology that overlays the physical one.
5. Both LANs and bridges are represented as nodes.
6. The connection of a LAN to a bridge and vice versa is represented by the connecting arcs.
7. To find the spanning tree, we need to assign a cost (metric) to each arc.
8. The process to find the spanning tree involves three steps:
Step 1: Every bridge has a built-in ID. Each bridge broadcasts this ID so that all bridges know which one
has the smallest ID. The bridge with the smallest ID is selected as the root bridge (root of the tree).
Step 2: The algorithm tries to find the shortest path (a path with the shortest cost) from the root bridge to
every other bridge or LAN. The shortest path can be found by examining the total cost from the root bridge
to the destination. The combination of the shortest paths creates the shortest tree.
Step 3: Based on the spanning tree, we mark the ports that are part of the spanning tree, the forwarding
ports, which forward a frame that the bridge receives. We also mark those ports that are not part of the
spanning tree, the blocking ports, which block the frames received by the bridge.
9. There is only one single path from any LAN to any other LAN in the spanning tree system. No loops
are created.