CS601 Notes by Zeeshan
CS601 Notes by Zeeshan
ZA ACADEMY
CS601 Notes by Zeeshan
Define :
The data link layer is responsible for the node to node delivery of the message. The main
function of this layer is to make sure data transfer is error-free from one node to another, over the
physical layer.
OR
The layer which is responsible for node-to-node communication is called data link layer.
Note :
Data link layer is the second layer of the seven-layer OSI model of computer networking.
Node:
Any point on a network is called node .
Link:
A way of connecting two or more nodes in a network is called link .
Hosts:
Two end points in a network is called hosts.
A B C D
1. framing
2. flow control
3. error control
4. congestion control
framing
The main function of data link layer is framing.
Date link layer divides data packets into small frames. Framing is a primary service of data link
layer.
In case of framing we gone talk about two processes encapsulation and de capsulation, both
combined are call framing. We know that data travel in the form of packets. Data link layer
encapsulate this Packets into multiple frames. Encapsulation means breakdown of a packet into
multiple frames which is stream of bit for transmission. Data Link Layer is also add its own
header to each off frame .When data receive data link layer de-capsulate these frames. It Takes
multiple frames and combined it in form of packet.
Flow control
Flow control is the management of data flow between sender and receiver. Flow control tells the
sender how much data should be sent to the receiver so that it is not lost.
error control
Error control is the technique of detecting and correcting blocks of data during communication.
Congestion Control
Congestion Control is a mechanism that controls the entry of data packets into the network
Broadcast link:
Broadcast links connect two or more nodes and support broadcast transmission, where one node
can transmit so that all other nodes can receive the same transmission. Ethernet is an example.
1. IP addresses:
2. Link layer addresses / physical addresses / MAC addresses
IP Addresses:
IP addresses are the unique address of any node in the network . we can not transmit a packet
directly to its destination by using only an IP address.
i. Unicast
ii. Multicast
iii. Broadcast
Unicast
Unicast is a one-to-one transmission from one point to another point in the network.
Multicast
Multicast is a method of group communication where the sender sends data to multiple receivers
or nodes present in the network simultaneously. Multicasting is a type of one-to-many and many-
to-many communication as it allows sender or senders to send data packets to multiple receivers
at once across LANs or WANs.
OR
Multicast is the communication where one host sends data to multiple hosts at once.
Broadcast : (one sender multiple receiver )
In broadcast transmission, where one node can transmit so that all other nodes that are connected
in a network can receive the same transmission. Ethernet is an example.
ARP Operation:
Caching:
Types of Error
Single bit Error: means that only one bit of given data unit is changed from 1 to 0 or 0 to 1.
Burst Error: means that two or more bits in data unit have change from 1 to 0 or from 0 to 1.
1. Data rate
2. Duration of rate
Note: higher data rate cause of more bits impacted. And more duration of noise is source of
higher number of bits going to be impacted. Because of these two things burst error is common
then single bit error.
Redundancy :
Central concept of detecting or correcting error is redundancy to be able to detect or correct error
we send some extra bits with our data. The presence of these redundant bits allowed the receiver
to detect or correct corrupted bits.
Error Detection:
Error detection is simple while error correction is complex. In error detection we are only looking
to see if error has occurred (yes or no). We are not interested in the number of corrupted bits. In
error detection single bit error is same as burst errors.
Error Correction:
Block coding
Convolution coding
Block coding:
In block coding we divide our message into blocks, each of them has ‘k’ bits, called as data word.
Here “k” means a certain number of bits. Then we add ‘r’ redundant bits to each block to make
the length n = k + r. The resulting ‘n’ bit blocks are called code word.
Note: sender sends code words to receiver and receiver checks code words.
If the following two conditions are met, the receiver can detect a change in the original code
words:
Example:
Look at 2nd code word that is ‘011’:
Let suppose:
If receiver get ‘011’ and this is valid code word, then ‘01’ is extracted and it is passed to
receiver.
If we send ‘011’ and received as ‘000’ this is invalid code word. It is corrupted code word.
This will not be processed by the receiver, and this will be discarded.
Topic 141 Hamming Distance
Hamming Distance
Hamming Distance between receiver code word and sent code word is actually number of bits
that are corrupted. If d (x,y) ≠ 0 → that means there is an error in our data.
Explanation:
Hamming distance is a metric for comparing two binary data strings. While comparing two binary
strings of equal length, Hamming distance is the number of bit positions in which the two bits are
different. The Hamming distance between two strings, x and y is denoted as d(x,y).
Example:
1. d (000, 011) ; 000 is x and 011 is y.
d (000, 011); 0 0 0 , 0 1 1
Here hamming distance is 2 because two bits are different.
Minimum Hamming distance is a smallest hamming distance between all possible pair of code
words.
Formula :
dmin = s + 1
Where s → no of detected error
dmin → minimum hamming distance
Example:
A code scheme has a hemming distance dmin=4. This code guarantees the detection. Up how to
many errors.
dmin = 4
dmin = s + 1
s = dmin - 1
s=4–1
s=3
Parity check is a simple way to add redundancy bits to the packets such that the total number of
1's is even or odd.
Important
If total number of 1s is odd then our extra parity bit is 1 to make our total number of 1 is even.
If the total number of 1s is already even then extract parity bit that we are adding to our code
word is 0.
Example :
Cyclic code
A cyclic code is a block code where the circular shift of each code word gives another word that
belongs to the code
Just for remembered ( In simple words we say that the last value is replace with the first .)
Example:
CRC
CRC is an error-detecting code commonly used in digital networks and storage devices to detect
accidental changes to raw data.
CRC codes are also known as polynomial codes since it is possible to view the bit string to be
sent as a polynomial.
Example Checksum:
Suppose the message is a list of five 4-bit numbers that we want to send to a destination. In
addition to sending these numbers, we send the sum of the numbers.
Set of numbers is (7, 11, 12, 0, 6)
Example: 7 + 11 + 12 + 0 + 6 = 36
We should to send as follow (7, 11, 12, 0, 6, 36) but here five 4–bit word that are (7, 11, 12, 0, 6)
and 36 is not 4 bit number. So for sending 36 with our data we shout convert it 4 bit number first
as following method:
In the previous example, the decimal number 36 in binary is (100100)2. To change it into a
4-bit number we add the extra leftmost bit to the right four bits as shown below
Adding first 2 and Last four
Retransmission of corrupted and lost packets is not useful for real-time multimedia
transmission
We need to correct the error or reproduce the packet immediately
Several techniques developed and are commonly called Forward Error Correction
techniques
Definition Forward error correction
Forward error correction (FEC) is a method of obtaining error control in data transmission in
which the source (transmitter) sends redundant data and the destination (receiver) recognizes
only the portion of the data that contains no apparent errors.
Example:
If we want to correct 10 bits in a packet, we need to make the minimum hamming distance
21 bits?
dmin = 2t + 1 dmin
= 2(10) + 1
dmin = 21 this is amount of redundant bits that you send with your data word.
Chunk Interleaving : ( Copy from net , Just read and explain in your wording )
In this technique, each data packet is divided into chunks. The data is then created chunk by
chunk(horizontally) but the chunks are combined into packets vertically. This is done because by
doing so, each packet sent carries a chunk from several original packets.
OR
Interleaving is a process or methodology to make a system more efficient, fast and reliable by
arranging data in a noncontiguous manner.
Frame Size
fixed Size
Size acts as a boundary.
In fix size every frame have same size
The problem with fixed size framing is that, error detection, error correction, flow control
and all these kind of functions become very difficult.
Variable Size
How to define Beginning and End of a Frame?
In variable-size framing, we need a way to define the end of the frame and the beginning of the
next.
Two approaches were used for this purpose
i. Character-Oriented Protocols:
ii. ii. Bit-Oriented Protocols:
Character (Byte) or Oriented Protocols:
The header, which normally carries the source and destination addresses and other
control information. The trailer, which carries error detection or error correction
redundant bits, are also multiples of 8 bits.
To separate one frame from the next, an 8-bit (1-byte) flag is added at the beginning and
the end of a frame. The flag, composed of protocol-dependent special characters, signals
the start or end of a frame.
Character-oriented framing was popular when only text was exchanged by the data link
layers.
Byte stuffing (or character stuffing):
In this sender's data link layer insert a special escape byte (ESC) just before each
''accidental'' flag byte in the data.
The data link layer on the receiving end removes the escape byte before the data are
given to the network layer.
This technique is called byte stuffing or character stuffing.
In this data frames contains an arbitrary number of bits and allows character codes with
an arbitrary number of bits per character
Each frame begins and ends with a special bit pattern, 01111110 (in fact, 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 bitstream. This technique is known as
stuffing
When the receiver sees five consecutive incoming 1 bits, followed by a 0 bit, it
automatically un stuffs (i.e., deletes) the 0 bit.
Flow control
Flow control is the management of data flow between sender and receiver. Flow control tells the
sender how much data should be sent to the receiver so that it is not lost.
Error Control Error Control at Data Link layer uses CRC in one of the two ways:
Connectionless
All frames are independent. Connectionless doesn't mean that no physical connection between
frames, but it means that you don't have any relationship between frames that you are sending so
you have one frame for one message and other frame for another message.
Connection-Oriented:
In this particular case as we discussed in data link layer connection oriented protocol as those
that actually establish a connection first, then they do the setup, then they do the data
transmission and then they have to do connection dare down.
DATA-LINK LAYER PROTOCOLS:
• Simple Protocol
• Stop-and-Wait Protocol
• Go-Back-N Protocol
• Selective-Repeat Protocol
• Last two protocols have almost disappeared completely
Stop-and-Wait Protocol
• In random-access or contention no station is superior to the other and none is assigned control
over the other.
•This decision depends on the state of the medium (idle or busy).
• It has three types:
❖ Aloha
❖ CSMA/CD
❖ CSMS/CA
ALOHA
• ALOHA, the earliest random access method, was developed in early 1970s.
• Designed for a radio (wireless) LAN, but it can be used on any shared medium.
• Potential collisions in this arrangement as the medium is shared between the stations
• When a station sends data, another station may attempt to do so at the same time. The data from
the two stations collide and become garbled and we will lose that data.
• To minimize the chance of collision and, therefore, increase the performance, CSMA was
developed
• The chance of collision is reduced as the station is required to sense/listen to the medium before
sending data
• ‘sense before transmit’ or ‘listen before talk’.
Behavior of Three Persistence Methods:
I-persistence:
In this method after the station find link ideal it sends immediately without waiting. This method
has got highest chance of collision.
Non-persistence:
In this method the channel has time slots. A station that has frame to send, it sense the link. If
the link is Idle it send frame immediately. If links are not idle, it waits for a random amount of
time and the sense that link again. So Collision rate in this case goes down as compared to
persistence but the efficiency goes also down
P-persistence:
In this case we have got a slot duration which is equal to or greater than the maximum
propagation time. This approach combined the advantages of both I-persistence and Non
persistence.
CSMA/CA
CONTROLLED ACCESS
Reservation
Polling
Token Passing
Polling
• Polling works with topologies in which one device is designated as a primary station and the
other devices are secondary stations.
• All data exchanges must be made through primary device even when the ultimate destination is
a secondary device.
• The primary device controls the link; the secondary devices follow its instructions.
Token Passing
• In the token-passing method, the stations in a network are organized in a logical ring
• For each station, there is a predecessor and a successor
• The predecessor is the station which is logically before the station in the ring; the successor is
the station which is after the station in the ring
• Special packet called TOKEN circulates through the ring
• Possession of TOKEN gives the station the right to send the data
• TOKEN Management is required to manage possession time, token monitoring, priority
assignment etc.
CHANNELIZATION (Channel Partition)
• Each station is allocated a time slot during which it can send data
• Each station transmits its data in its assigned time slot
Code Division Multiple Access (CDMA)
• CDMA differs from FDMA in that only one channel occupies the entire bandwidth of the link.
• CDMA differs from TDMA in that all stations can send data simultaneously; there is no
timesharing.
Ethernet
Ethernet is a family of wired computer networking technologies commonly used in local area
networks (LAN), metropolitan area networks (MAN) and wide area networks (WAN). It was
commercially introduced in 1980 and first standardized in 1983 as IEEE 802.3. Ethernet has
since been refined to support higher bit rates, a greater number of nodes, and longer link
distances.
IEEE 802 is a family of Institute of Electrical and Electronics Engineers (IEEE)
Ethernet Evolution
Standard Ethernet
Standard Ethernet The original Ethernet technology with the data rate of 10 Mbps is called
Standard Ethernet. Most implementations have moved to later evolutions. Still some features of
the Standard Ethernet that has not changed during the evolution.
• Each station on Ethernet has its own network interface card (NIC).
• Every NIC has got a unique link-layer address.
• The Ethernet address is 6 bytes (48 bits), normally written in hexadecimal notation, with a
colon between the bytes.
• For example, the following shows an Ethernet MAC address: 4A:30:10:21:10:1A.
Goals of Fast Ethernet:
Telephone Network
• The telephone network had its beginnings in the late 1800s.
• Plain Old Telephone System (POTS) was originally an analog system using analog signals to
transmit voice.
• With the advent of the computer era, the network, in the 1980s, began to carry data in addition
to voice.
• During the last decade, the telephone network has undergone many technical changes and the
network is now Digital as well as Analog.
Major Components
The telephone network is made of three major components:
Local Loops it is twisted pair cable (4 khz) (first 3 office last 4 exact local loop)
Trunks they are optical fiber cables
Switching offices
End offices
Tandem offices
Regional offices
• The telephone network in the beginning, used a circuit-switched network with dedicated links
to transfer voice communication.
• The operator connected the two parties by using a wire with two plugs inserted into the
corresponding two jacks.
• Later, the signaling system became automatic.
Path Layer is responsible for the movement of a signal from source to the destination.
Line layer is a particular type of connection it is responsible for the movement of the signal
across a physical line.
Section layer is responsible for the movement of the same signal across the physical section.
Photonic layer is equivalent to physical layer of OSI model. In this case use and encoding and
encoding here presence of light is represent 1 in binary and absence of light is a represent 0.
UPSR
BLSR
URSR stands for unidirectional path switching ring. We call it path switching ring because it has
two rings one is working ring which is clock wise and another is protection ring which is anti
clock wise. Both these Rings carry the exact same type of data. So each node which is connected
to this kind of ring receives two different data streams of same data.
BLSR stands for bi-directional line switching ring. In this case communication is bi- directional.
It means tha two rings for working line and also two rings for protection line as well. BLSR used
4 Rings totally, and as you can imagine the Rate of faliure is improve and efficiency more down.
ATM
• Asynchronous Transfer Mode (ATM) is a switched wide area network based on the cell relay
protocol designed by the ATM forum.
• The combination of ATM and SONET will allow high-speed interconnection of networks.
Introduction to Wireless
• Wireless communication is one of the fastest-growing technologies
• The demand for connecting devices without the use of cables is increasing everywhere.
• Wireless LANs can be found on college campuses, in office buildings, and in many public
areas
Architecture comparison of wired and wireless LANs
Medium in the case of wired Networks we need cables to connect our nodes. While on the
wireless network we don’t need cables.
Hosts as we know in wired network our nodes are connected with switch through a wire. So, we
can’t move easily our nodes. While in case of wireless we can easily move nodes.
Frame Types
• Management Frames
• Control Frames
• Data Frames
BLUETOOTH
Piconet in this case we can have up 8 active devices in a single time one of them is primary and
other 7 is secondary.
Scatternet multiple piconet is connected with each other is called scatternet.
BLUETOOTH devises
A Bluetooth device has a built-in short-range radio transmitter. The current data rate is 1 Mbps
without 2.4 gigahertz bandwidth. This means there is a possibility of interference between the
IEEE 802. 11 Wireless LAN's and Bluetooth LAN's