Computer Network
Computer Network
FACULTY NAME:LEKSHMI S
COMPUTER NETWORKS – INTRODUCTION
COMPUTER NETWORK
➢ An interconnection of multiple devices, also known as hosts, that are
connected using multiple paths for the purpose of sending/receiving data
➢ The connecting media could be any guided or unguided media.
➢ Computer networks can also include multiple devices/mediums which help in
the communication between two different devices; these are known as Network
devices and include things such as routers, switches, hubs, and bridges.
➢ Open system: A system which is connected to the network and is ready for
communication.
➢ Closed system: A system which is not connected to the network and can’t be
communicated with.
3
NETWORKING ELEMENTS
4
BASIC NETWORK
5
PROTOCOL
➢ A protocol is the set of rules or algorithms which define the way how two
entities can communicate across the network and there exists different
protocol defined at each layer of the OSI model.
➢ Few of such protocols are TCP, IP, UDP, ARP, DHCP, FTP ...
6
TRANSMISSION TERMINOLOGY
7
TRANSMISSION TERMINOLOGY
➢ The term direct link is used to refer to the transmission path between
two devices in which signals propagate directly from transmitter to
receiver with no intermediate devices, other than amplifiers or repeaters
used to increase signal strength.
➢ Note that this term can apply to both guided and unguided media.
➢ A guided transmission medium is point to point if it provides a direct link
between two devices and those are the only two devices sharing the
medium.
➢ In a multipoint guided configuration, more than two devices share the
same medium.
8
TRANSMISSION TERMINOLOGY
• Point-to-point links:
➔ Point-to-point links connect individual pairs of machines.
➔ To go from the source to the destination on a network made up of point-to-point links, short messages, called packets in
certain contexts, may have to first visit one or more intermediate machines.
➔ Often multiple routes, of different lengths, are possible, so finding good ones is important decision here.
➔ Point-to-point transmission with exactly one sender and exactly one receiver is also called unicasting.
• Broadcast links:
➔ On a broadcast network, the communication channel is shared by all the machines on the network; packets sent by any
machine are received by all the others (broadcasting).
➔ Some broadcast systems also support transmission to a subset of the machines, which known as multicasting.
➔ An address field within each packet specifies the intended recipient.
➔ Upon receiving a packet, a machine checks the address field.
➔ If the packet is intended for the receiving machine, that machine processes the packet; if the packet is intended for some
other machine, it is just ignored.
➔ A wireless network is a common example of a broadcast link
9
TRANSMISSION MODE
➢ The transmission mode defines the direction of signal flow between two
connected devices.
➢ There are three modes of transmission:
• Simplex
• half duplex
• full duplex
10
SIMPLEX
11
HALF DUPLEX
➢ The communication between sender and receiver occurs in both
directions in half duplex transmission, but only one at a time.
➢ The sender and receiver can both send and receive the information, but
only one is allowed to send at any given time.
➢ For eg, in walkie-talkies, the speakers at both ends can speak, but they
have to speak one by one. They cannot speak simultaneously.
➢ Here, the entire capacity of a channel is taken over by whichever of the
two devices is transmitting at the time.
12
FULL DUPLEX
➢ In full duplex transmission mode, the communication between sender and
receiver can occur simultaneously.
➢ The sender and receiver can both transmit and receive at same time.
➢ For eg, in a telephone conversation, two people communicate, and both are
free to speak and listen at the same time.
➢ The full duplex transmission mode offers the best performance among the
three, on account of the fact that it maximises the amount of bandwidth
available.
➢ In full-duplex mode, signals going in one direction share the capacity of the link,
with signals going in the other direction.
13
COMPARISON
14
NOTE:
➢ The definitions just given for transmission modes are the ones in
common use in the United States (ANSI definitions).
➢ As per ITU-T definitions, the term simplex is used to correspond to half
duplex as defined previously, and duplex is used to correspond to full
duplex as just defined.
15
NETWORK DEVICES
16
NETWORK TOPOLOGY
➢ The layout arrangement of the different devices in a network.
➢ Common examples: Bus, Star, Mesh, Ring, and Daisy chain.
17
GOALS OF COMPUTER NETWORKS
➢ Resource Sharing – Ex. A group of office workers can share a common printer,
fax, modem, scanner, etc.
➢ High Reliability – If there are alternate sources of supply, all files could be
replicated on two or more machines. If one of them is not available, due to
hardware failure, the other copies could be used.
➢ Inter-process Communication – Network users, located geographically apart,
may converse in an interactive session through the network. In order to permit
this, the network must provide almost error-free communications.
➢ Flexible access – Files can be accessed from any computer in the network. The
project can be begun on one computer and finished on another.
➢ Other goals include Distribution of processing functions, Centralized
management, and allocation of network resources, Compatibility of dissimilar
equipment and software, Good network performance, Scalability, Saving money,
Access to remote information, Person to person communication, etc.
18
USES OF COMPUTER NETWORKS
• 1. Business Applications
facilitates resource sharing – sharing of physical resources like printers, tape
➔ It
backup systems, etc and information sharing
➔ VPNs (Virtual Private Networks) - to join the individual networks at different sites
into one extended network.
➔ Client-servermodel of communication – client and server processes on the client
machine and server machine communicate each other by message passing
➔ E-commerce – electronic business model, where companies provide catalogs of
their goods and services online and take orders online.
➔ A computer network can provide a powerful communication medium among
employees – email communication, IP telephony or Voice over IP (VoIP), video
conference, Desktop sharing, online document sharing, telemedicine
19
USES OF COMPUTER NETWORKS
• 2. Home applications
➔ Internet access provides home users with connectivity outside of the home.
➔ As with companies, home users can access information, communicate with other
people, and buy products and services with e-commerce.
➔ Online personalized newspaper reading, Online digital library – ebook, journals
➔ Peer-to-peer communication model – eg: BitTorrent
➔ Social networks – Facebook, twitter
➔ Collaborative content creation networks – wiki
➔ Entertainment – IPTV, game playing
➔ Ubiquitous computing - computing embedded into everyday life: smart home
monitor, smoke detectors
➔ RFID tags - passive (i.e., have no battery) chips affixed to books, passports, pets,
credit cards, and other items in the home and out. - Internet of things
20
USES OF COMPUTER NETWORKS
• 3. Mobile users
➔ Mobile computers - laptop and handheld computers
➔ Wireless onnectivity - Cellular networks, Wireless hotspots based on the 802.11
standard; fixed wireless and mobile wireless networks.
➔ Short Message Service (SMS), Smart phones
➔ GPS (Global Positioning System) receivers in mobile phones to know their locations;
location dependent services
➔ M-commerce
➔ Sensor networks - made up of nodes that gather and wirelessly relay information they
sense about the state of the physical world.
➔ Wearable computers - Smart watches, implanted devices like pacemakers and insulin
pumps.
21
CLASSIFICATION OF INTERCONNECTED PROCESSORS BY SCALE
22
PERSONAL AREA NETWORKS - PAN
➔ PANs let devices communicate over the range of a person.
➔ A common example is a wireless network that connects a computer with its
peripherals - monitor, keyboard, mouse, and printer.
➔ Short-range
wireless network called Bluetooth are used to connect these
components without wires.
➔ A completelydifferent kind of PAN is formed when an embedded medical device
such as a pacemaker, insulin pump, or hearing aid talks to a user-operated remote
control.
➔ PANs can also be built with other technologies that communicate over short ranges,
such as RFID on smartcards.
23
BLUETOOTH PAN CONFIGURATION
24
LAN, MAN, WAN
25
LOCAL AREA NETWORK - LAN
➔ A LAN is a privately owned network that operates within and nearby a single building like a
home, office or factory.
➔ LANs are widely used to connect personal computers and consumer electronics to let them
share resources (e.g., printers) and exchange information.
➔ When LANs are used by companies, they are called enterprise networks.
➔ Wireless LANs are very popular these days, especially in homes, older office buildings,
cafeterias, and other places where it is too much trouble to install cables.
➔ In these systems, every computer has a radio modem and an antenna that it uses to
communicate with other computers.
➔ The device, called an AP (Access Point), wireless router, or base station, relays packets
between the wireless computers and also between them and the Internet.
➔ However, if other computers are close enough, they can communicate directly with one another
in a peer-to-peer configuration.
➔ There is a standard for wireless LANs called IEEE 802.11, popularly known as WiFi, which has
become very widespread.
26
WIRED LANS
27
WIRELESS AND WIRED LANS
– 802.11 LAN AND SWITCHED ETHERNET
28
METROPOLITAN AREA NETWORK - MAN
➔ A MANcovers a city. The best-known example of MANs are the cable television
networks available in many cities.
➔ When the Internet began attracting a mass audience, the cable TV network
operators began to realize that with some changes to the system, they could provide
two-way Internet service in unused parts of the spectrum.
➔ Atthat point, the cable TV system began to morph from simply a way to distribute
television to a metropolitan area network, where both television signals and Internet
being fed into the centralized cable headend for subsequent distribution to people’s
homes.
➔ Cable television is not the only MAN, though. Recent developments in high-speed
wireless Internet access have resulted in another MAN, which has been
standardized as IEEE 802.16 and is popularly known as WiMAX.
29
A METROPOLITAN AREA NETWORK BASED ON CABLE TV
30
WIDE AREA NETWORK - WAN
➔ A WAN (Wide Area Network) spans a large geographical area, often a country or continent.
➔ Example: a company with branch offices in different cities.
➔ Each of these offices contains computers (hosts) intended for running user (i.e., application) programs.
➔ The rest of the network that connects these hosts is then called the communication subnet, or just
subnet for short.
➔ The job of the subnet is to carry messages from host to host.
➔ Mainly, the subnet consists of two distinct components: transmission lines and switching elements.
➔ Transmission lines move bits between machines. They can be made of copper wire, optical fiber, or
even radio links.
➔ Switching elements (switches), are specialized computers that connect two or more transmission lines.
➔ When data arrive on an incoming line, the switching element must choose an outgoing line on which to
forward them.
➔ These switching computers have been called by various names in the past; the name router is now most
commonly used.
31
WAN THAT CONNECTS THREE BRANCH OFFICES IN AUSTRALIA
32
WANS WITH WIRELESS TECHNOLOGIES
➔ In satellite systems, each computer on the ground has an antenna through which it can send data
to and receive data from to a satellite in orbit.
➔ All computers can hear the output from the satellite, and in some cases they can also hear the
upward transmissions of their fellow computers to the satellite as well.
➔ Satellite networks are inherently broadcast and are most useful when the broadcast property is
important.
➔ The cellular telephone network is another example of a WAN that uses wireless technology.
➔ The first generation cellular network was analog and for voice only.
➔ The second generation was digital and for voice only.
➔ The third generation is digital and is for both voice and data.
➔ Each cellular base station covers a distance much larger than a wireless LAN.
➔ The base stations are connected to each other by a backbone network that is usually wired.
➔ The data rates of cellular networks are often on the order of 1 Mbps, much smaller than a wireless
LAN that can range up to on the order of 100 Mbps.
33
LAN, MAN, WAN – COMPARISON CHART
Expands to Local Area Network Metropolitan Area Network Wide Area Network
Meaning A network that connects a It covers relatively large It spans large locality and
group of computers in a region such as cities, towns. connects countries together.
small geographical area. Example Internet.
Area covered Limited to between 100- Usually stretch up to an area Larger coverage area - range
1000 meters coverage. of 100 KM. up to 100,000 KM and in some
cases, stretches globally or
over international borders.
➔ Many networks exist in the world, often with different hardware and software.
➔ People connected to one network often want to communicate with people attached to a
different one.
➔ The fulfillment of this desire requires that different, and frequently incompatible, networks be
connected.
➔ A collection of interconnected networks is called an internetwork or internet.
➔ These terms will be used in a generic sense, in contrast to the worldwide Internet, which is
one specific internet
➔ The Internet uses ISP networks to connect enterprise networks, home networks, and many
other networks.
➔ Now how two different networks can be connected?
➔ The general name for a machine that makes a connection between two or more networks and
provides the necessary translation, both in terms of hardware and software, is a gateway.
➔ Gateways are distinguished by the layer at which they operate in the protocol hierarchy
35
KERALA PSC 111/2010 – HSST 2012
•
• A point to point link that supports data flowing in only one direction at a
time
• (A) Simplex link (B) Half Duplex link
• (C) Full Duplex link (D) Leased Line
•
36
NOTE:
37
KERALA PSC – HSST 348/ 2005
38
IEEE 802 SPECIFICATIONS
IEEE Specification
standard
802.1 Internet working (OSI model & network management)
802.1 Defines Spanning Tree protocol
802.1D protocol architecture for MAC bridges
802.2 LLC (Logical Link Control)
802.3 CSMA / CD Ethernet
802.4 Token bus LAN
802.5 Token ring LAN
802.6 DQDB (Distributed Queue Dual Bus)- designed for MAN
802.7 Broadband Technical Advisory Group.
802.8 Fiber Optic Technical Advisory Group.
802.9 Integrated voice / data network
802.10 Network security
802.11 Wireless LAN standard – implemented in Wireless Fidelity (Wi – Fi)
(CSMA/CA – access control)
802.12 Demand priority access LAN – 100 base VG (Voice Grade)
(Round robin / priority) access control)
802.13 Unused
802.14 Define cable modem standard
39 802.15 Define Wireless PAN (WPAN)– used in Bluetooth, Zig-Bee
KERALA PSC 111/2010 – HSST 2012
40
UGC NET JULY 2016
41
ELECTROMAGNETIC SIGNAL
➢ Electromagnetic waves are formed when an electric field comes in contact with a
magnetic field. They are hence known as ‘electromagnetic’ waves.
➢ The electric field and magnetic field of an electromagnetic wave are perpendicular (at
right angles) to each other. They are also perpendicular to the direction of the EM wave.
➢ As a function of time, an electromagnetic signal can be either analog or digital.
➢ An analog signal is one in which the signal intensity varies in a smooth fashion over
time. In other words, there are no breaks or discontinuities in the signal.
➢ A digital signal is one in which the signal intensity maintains a constant level for some
period of time and then abruptly changes to another constant level.
➢ The continuous signal might represent speech, and the discrete signal might represent
binary 1s and 0s.
42
ANALOG AND DIGITAL SIGNAL
43
PERIODIC VS APERIODIC SIGNALS
➢ A periodic signal completes a pattern within a measurable time frame, called a
period, and repeats that pattern over subsequent identical periods.
➢ The completion of one full pattern is called a cycle.
➢ A nonperiodic (aperiodic) signal changes without exhibiting a pattern or cycle
that repeats over time.
➢ Mathematically, a signal s(t) is defined to be periodic if and only if
➢ s(t + T) = s(t) -∞ < t < +∞
➢ where the constant T is the period of the signal (T is the smallest value that
satisfies the equation). Otherwise, a signal is aperiodic.
44
EXAMPLES OF PERIODIC SIGNALS
45
SINE WAVE
➢ The sine wave is the fundamental periodic signal.
➢ A general sine wave can be represented by three parameters: peak amplitude (A),
frequency (f ), and phase (Φ).
➢ The peak amplitude is the maximu m value or strength of the signal over time;
typically, this value is measured in volts.
➢ The frequency is the rate [in cycles per second, or Hertz (Hz)] at which the signal
repeats.
➢ An equivalent parameter is the period (T) of a signal, which is the amount of time it
takes for one repetition; therefore,
• T = 1/f
➔ Bandwidth is the difference between the upper and lower frequencies in a continuous
band of frequencies.
46
PHASE
➢ The term phase describes the position of the waveform relative to time 0.
47
THREE SINE WAVES WITH THE SAME AMPLITUDE AND
FREQUENCY, BUT DIFFERENT PHASES
48
OBSERVATIONS
• 1. A sine wave with a phase of 0° starts at time 0 with a zero amplitude. The amplitude is increasing.
• 2. A sine wave with a phase of 90° starts at time 0 with a peak amplitude. The amplitude is decreasing.
• 3. A sine wave with a phase of 180° starts at time 0 with a zero amplitude. The amplitude is decreasing.
• Another way to look at the phase is in terms of shift or offset. We can say that:
• 1. A sine wave with a phase of 0° is not shifted.
• 2. A sine wave with a phase of 90° is shifted to the left by 1/4 cycle. However, note that the signal does
not really exist before time 0.
• 3. A sine wave with a phase of 180° is shifted to the left by 1/2 cycle. However, note that the signal does
not really exist before time 0.
49
WAVELENGTH
➢ Wavelength is another characteristic of a signal traveling through a
transmission medium.
➢ Wavelength is the distance a signal can travel in one period.
➢ Wavelength binds the period or the frequency of a simple sine wave to
the propagation speed of the medium.
➢ While the frequency of a signal is independent of the medium, the
wavelength depends on both the frequency and the medium.
➢ Wavelength is a property of any type of signal.
50
WAVELENGTH CALCULATION
➢ Wavelength can be calculated if one is given the propagation speed (c=3x10^8
m/s, the speed of light can be taken default) and the period of the signal.
➢ If we represent wavelength by λ, propagation speed by v, and frequency by f,
and period by T, we get
➢ λ = vT or λf = v
➢ The propagation speed of electromagnetic signals depends on the medium and
on the frequency of the signal.
➢ For eg, in vacuum, light is propagated with a speed of 3 x 10^8 m/s. That speed
is lower in air and even lower in cable.
➢ The wavelength is normally measured in micrometers (microns) instead of
meters.
51
PRACTICE PROBLEMS
• Ans:- (D)
• Qn. What is the velocity of a wave whose wavelength is 2 m and whose frequency is 5
Hz?
• (A) 20 m/s (B) 2.5 m/s (C) 0.4 m/s
(D) 10 m/s
• Ans:- (D)
52
PRACTICE PROBLEMS
53
UGC NET DEC 2014
•
•
• The period of a signal is 10 ms. What is its frequency in Hertz?
• (A) 10 (B) 100 (C) 1000 (D) 10000
•
54
UGC NET JUNE 2012
•
• If the period of a signal is 1000 ms, then what is its frequency in
kilohertz?
• (A) 10^–3 KHz (B) 10^–2 KHz
• (C) 10^–1 KHz (D) 1 KHz
55
NETWORK PERFORMANCE - TERMINOLOGIES
● Bandwidth
● Throughput
● Latency (Delay)
● Jitter
56
BANDWIDTH
• The term can be used in two different contexts with two different measuring values:
• Bandwidth in Hertz
➔ Bandwidth in hertz is the range of frequencies contained in a composite signal or the range of
frequencies a channel can pass.
➔ For example, we can say the bandwidth of a subscriber telephone line is 4 kHz.
• Relationship
➔ Basically, an increase in bandwidth in hertz means an increase in bandwidth in bits per second.
57
THROUGHPUT
➢ The throughput is a measure of how fast we can actually send data through a network.
➢ Although, at first glance, bandwidth in bits per second and throughput seem the same, they
are different.
➢ A link may have a bandwidth of B bps, but we can only send T bps through this link with T
always less than B.
➢ In other words, the bandwidth is a potential measurement of a link; the throughput is an
actual measurement of how fast we can send data.
➢ For example, we may have a link with a bandwidth of 1 Mbps, but the devices connected to
the end of the link may handle only 200 kbps. This means that we cannot send more than
200 kbps through this link.
➢ Imagine a highway designed to transmit 1000 cars per minute from one point to another.
However, if there is congestion on the road, this figure may be reduced to 100 cars per
minute. Bandwidth is 1000 cars per minute; throughput is 100 cars per minute.
58
LATENCY (DELAY)
➢ The latency or delay defines how long it takes for an entire message to
completely arrive at the destination from the time the first bit is sent out
from the source.
➢ We can say that latency is made of four components: propagation time,
transmission time, queuing time and processing delay.
59
PROPAGATION TIME
60
TRANSMISSION TIME
➢ In data communications we don't send just 1 bit, we send a message.
➢ The first bit may take a time equal to the propagation time to reach its
destination; the last bit also may take the same amount of time.
➢ However, there is a time between the first bit leaving the sender and the last bit
leaving the sender, called message transmission time.
➢ The first bit leaves earlier and arrives earlier; the last bit leaves later and arrives
later.
➢ The time required for transmission of a message depends on the size of the
message and the bandwidth of the channel.
➢ Transmission time = Message size / Bandwidth
61
QUEUING TIME
➢ The third component in latency is the queuing time, the time needed for
each intermediate or end device to hold the message before it can be
processed.
➢ The queuing time is not a fixed factor; it changes with the load imposed
on the network.
➢ When there is heavy traffic on the network, the queuing time increases.
➢ An intermediate device, such as a router, queues the arrived messages
and processes them one by one.
➢ If there are many messages, each message will have to wait.
62
BANDWIDTH-DELAY PRODUCT
63
BANDWIDTH-DELAY PRODUCT - CASE 1
64
BANDWIDTH-DELAY PRODUCT - CASE 2
65
BANDWIDTH-DELAY PRODUCT: OBSERVATIONS
• Case 1: The product 1 x 5 is the maximum number of bits that can fill the link. There can be no more
than 5 bits at any time on the link.
• Case 2: There can be maximum 4 x 5 = 20 bits on the line. The reason is that, at each second, there
are 4 bits on the line; the duration of each bit is 0.25 s.
➢ The product of bandwidth and delay is the number of bits that can fill the link.
➢ This measurement is important if we need to send data in bursts and wait for the acknowledgment of
each burst before sending the next one.
➢ To use the maximum capability of the link, we need to make the size of our burst 2 times the product of
bandwidth and delay ( for full-duplex channel (two directions)).
➢ The sender should send a burst of data of (2 x bandwidth x delay) bits. The sender then waits for
receiver acknowledgment for part of the burst before sending another burst.
➢ The amount 2 x bandwidth x delay is the number of bits that can be in transition at any time ( for full-
duplex channel).
66
JITTER
➢ Another performance issue that is related to delay is jitter.
➢ We can roughly say that jitter is a problem if different packets of data
encounter different delays and the application using the data at the
receiver site is time-sensitive (audio and video data, for eg.).
➢ If the delay for the first packet is 20 ms, for the second is 45 ms, and for
the third is 40 ms, then the real-time application that uses the packets
endures jitter.
67
KERALA PSC 111/2010 – HSST 2012
•
• The number of bits that can be transmitted over a network in a certain
period of time:
• (A) Latency (B) Delay
• (C) Bandwidth (D) Baud
•
68
UGC NET DEC 2014
•
• What is the propagation time if the distance between the two points is 48,000
km? Assume the propagation speed to be 2.4 × 108 metre/second in cable.
• (A) 0.5 ms (B) 20 ms (C) 50 ms (D) 200 ms
• Solution:-
• propagation speed = (48000 x 10^3) / (2.4 × 10^8) = 200 ms
•
69
PRACTICE PROBLEMS
• What are the propagation time and the transmission time for a 2.5-kbyte message (an e-
mail) if the bandwidth of the network is 1 Gbps? Assume that the distance between the
sender and the receiver is 12,000 km and that light travels at 2.4 x 10^8 mls.
• Note that in this case, because the message is short and the bandwidth is high, the
dominant factor is the propagation time, not the transmission time. The transmission
time can be ignored.
70
PRACTICE PROBLEMS
• What are the propagation time and the transmission time for a 5-Mbyte message (an
image) if the bandwidth of the network is 1 Mbps? Assume that the distance between the
sender and the receiver is 12,000 km and that light travels at 2.4 x 10 ^ 8 mls.
• Note that in this case, because the message is very long and the bandwidth is not very
high, the dominant factor is the transmission time, not the propagation time. The
propagation time can be ignored.
71
UGC NET NOV 2017
•
72
UGC NET JULY 2016
• Assume that we need to download text documents at the rate of 100 pages per
minute. A page is an average of 24 lines with 80 characters in each line and each
character requires 8 bits. Then the required bit rate of the channel is ................
73
UGC NET SEPT 2013
74
UGC NET DEC 2015
•
• A network with bandwidth of 10 Mbps can pass only an average of 15,000
frames per minute with each frame carrying an average of 8,000 bits. What is
the throughput of this network?
• (A) 2 Mbps (B) 60 Mbps (C) 120 Mbps (D) 10 Mbps
75
UGC NET JUNE 2013
76
Computer Networks
– Signal Encoding Techniques
Signal Encoding Techniques
➢
Digital Data, Digital Signals
➢
Digital Data, Analog Signals
➢
Analog Data, Digital Signals
➢
Analog Data, Analog Signals
2
Encoding and Modulation Techniques
3
Encoding and Modulation Techniques
➔
For digital signaling, a data source g(t), which may be either digital or
analog, is encoded into a digital signal x(t).
➔
The actual form of x(t) depends on the encoding technique and is
chosen to optimize use of the transmission medium.
➔
For example, the encoding may be chosen to conserve bandwidth or to
minimize errors.
➔
The basis for analog signaling is a continuous constant-frequency
signal known as the carrier signal.
➔
The frequency of the carrier signal is chosen to be compatible with the
transmission medium being used.
➔
Data may be transmitted using a carrier signal by modulation.
4
Modulation
➔
Modulation is the process of encoding source data onto a carrier
signal with frequency fc .
➔
All modulation techniques involve operation on one or more of the
three fundamental frequency domain parameters: amplitude,
frequency, and phase.
➔
The input signal m(t) may be analog or digital and is called the
modulating signal or baseband signal.
➔
The result of modulating the carrier signal is called the modulated
signal s(t).
➔
Again, the actual form of the encoding is chosen to optimize some
characteristic of the transmission.
5
Digital Data, Digital Signal
➔
A digital signal is a sequence of discrete, discontinuous voltage pulses / signal element.
➔
Binary data are transmitted by encoding each data bit into signal elements.
➔
In the simplest case, there is a one-to-one correspondence between bits and signal elements.
➔
If signal elements all have same algebraic sign, i.e., all positive or negative, then signal is unipolar.
➔
In polar signaling, one logic state is represented by a positive, and other by negative voltage level.
➔
Data signaling rate or bit rate, of signal is the rate, in bits per second, that data are transmitted.
➔
The duration or length of a bit is the amount of time it takes for the transmitter to emit the bit;
➔for a data rate R, the bit duration is 1/R.
➔
Modulation rate (baud rate), in contrast, is the rate at which the signal level is changed.
➔This will depend on the nature of the digital encoding.
➔The modulation rate is expressed in baud, which means signal elements per second.
➔
Finally, terms mark and space, for historical reasons, refer to binary digits 1 and 0, respectively.
6
Digital Signal Encoding Formats
7
Digital Signal Encoding Formats
8
Digital Signal Encoding Formats
9
Nonreturn to Zero (NRZ)
➔
The most common, and easiest, way to transmit digital signals is to
use two different voltage levels for the two binary digits.
➔
Codes that follow this strategy share the property that the voltage
level is constant during a bit interval; there is no transition (no return
to a zero voltage level).
➔
For eg., the absence of voltage can be used to represent binary 0,
with a constant positive voltage used to represent binary 1.
➔
More commonly, a negative voltage represents one binary value
and a positive voltage represents the other.
➔
This latter code, known as Nonreturn to Zero-Level (NRZ-L)
10
NRZI (Nonreturn to Zero, invert on ones)
➔
As with NRZ-L, NRZI maintains a constant voltage pulse for
the duration of a bit time.
➔
Data themselves are encoded as presence or absence of a
signal transition at the beginning of the bit time.
➔
A transition (low to high or high to low) at the beginning of a
bit time denotes a binary 1 for that bit time; no transition
indicates a binary 0.
➔
NRZI is an example of differential encoding.
11
Differential encoding
➔
In differential encoding, the information to be transmitted is represented in
terms of the changes between successive signal elements rather than the signal
elements themselves.
➔
It makes data to be transmitted to depend not only on the current signal state
(or symbol), but also on the previous one.
➔
The encoding of the current bit is determined as follows:
➔ If the current bit is a binary 0, then the current bit is encoded with the same signal as the
preceding bit;
➔ if the current bit is a binary 1, then the current bit is encoded with a different signal than
the preceding bit.
➔
One benefit of differential encoding is that it provides unambiguous signal
reception, it may be more reliable to detect a transition in the presence of noise
than to compare a value to a threshold.
12
Limitations of NRZ
➔
Main limitations of NRZ signals: presence of a dc component and
the lack of synchronization capability.
➔
Consider the situation that with a long string of 1s or 0s for NRZ-L
or a long string of 0s for NRZI, the output is a constant voltage over
a long period of time.
➔
Under these circumstances, any drift between the clocks of
transmitter and receiver will result in loss of synchronization
between the two.
13
Multilevel Binary
➔
These codes use more than two signal levels.
➔
Two eg. of this scheme are bipolar-AMI (alternate mark inversion) and pseudoternary.
➔
Bipolar AMI
➔ Here, a binary 0 is represented by no line signal, and a binary 1 is represented by a positive or
negative pulse. The binary 1 pulses must alternate in polarity.
➔
Pseudoternary
➔ In this case, it is the binary 1 that is represented by the absence of a line signal, and the binary 0 by
alternating positive and negative pulses.
➔
As the 1 signals (in Bipolar AMI and 0 signals in Pseudoternary) alternate in voltage
from positive to negative, there is no net dc component.
➔
The bandwidth of the resulting signal is considerably less than that of NRZ
➔
Although a degree of synchronization is provided with these codes, a long string of 0s
in the case of AMI or 1s in the case of pseudoternary still presents a problem.
14
Biphase
➔
There is another set of coding techniques, grouped under the term biphase,
that overcomes the limitations of NRZ codes.
➔
Manchester & differential Manchester, are common biphase coding schemes.
➔
In the Manchester code, there is a transition at the middle of each bit period.
➔ The midbit transition serves as a clocking mechanism and also as data: a low-to-high
transition represents a 1, and a high-to-low transition represents a 0.
➔
In differential Manchester, midbit transition is used only to provide clocking.
➔ The encoding of a 0 is represented by the presence of a transition at the beginning of a
bit period, and a 1 is represented by the absence of a transition at the beginning of a bit
period.
➔ Differential Manchester has the added advantage of employing differential encoding.
15
Biphase codes – Pros and cons
➔
All of the biphase techniques require at least one transition per bit time
and may have as many as two transitions.
➔
Thus, the maximum modulation rate is twice that for NRZ; this means that
the bandwidth required is correspondingly greater.
➔
On the other hand, the biphase schemes have several advantages:
➔ Synchronization: Because there is a predictable transition during each bit time, the
receiver can synchronize on that transition. For this reason, the biphase codes are
known as self-clocking codes.
➔ No dc component: Biphase codes have no dc component, yielding the benefits
described earlier.
➔ Error detection: The absence of an expected transition can be used to detect errors.
Noise on the line would have to invert both the signal before and after the expected
transition to cause an undetected error.
16
Biphase codes - applications
➔
Biphase codes are popular techniques for data transmission.
➔
The more common Manchester code has been specified for the
IEEE 802.3 (Ethernet) standard for baseband coaxial cable and
twisted-pair bus LANs.
➔
Differential Manchester has been specified for the IEEE 802.5
token ring LAN, using shielded twisted pair.
17
Digital Signal Encoding Formats - Summary
18
Digital Signal
➢
In addition to being represented by an analog signal, information
can also be represented by a digital signal.
➢
For example, a 1 can be encoded as a positive voltage and a 0 as
zero voltage (2- level signal).
➢
A digital signal can have more than two levels. In this case, we
can send more than 1 bit for each level.
➢ In general, if a signal has L levels, each level needs log2L bits.
19
Two digital signals: one with two signal levels and the
other with four signal levels
20
Bit rate, Bit length
➢
Most digital signals are nonperiodic, and thus period and frequency
are not appropriate characteristics. Another term - bit rate (instead of
frequency) - is used to describe digital signals.
➢
Bit rate: no. of bits sent in 1s, expressed in bits per second (bps).
➢
In digital signal, the term bit length is similar to the term
wavelength for analog signal (i.e. the distance one cycle occupies on
the transmission medium).
➢
Bit length: distance one bit occupies on the transmission medium.
Bit length = propagation speed x bit duration
21
Modulation Rate
➔
When signal-encoding techniques are used, a distinction needs to be made between data rate
(expressed in bits per second) and modulation rate (expressed in baud).
➔
The data rate, or bit rate, is 1/Tb , where Tb = bit duration.
➔
The modulation rate is the rate at which signal elements are generated.
➔
Consider, for example, Manchester encoding.
➔
The minimum size signal element is a pulse of one-half the duration of a bit interval.
➔
For a string of all binary 0’s or all binary 1’s, a continuous stream of such pulses is generated.
➔
Hence the maximum modulation rate for Manchester is 2/Tb .
➔
In general,
D = R / L = R / log2M
where
D = modulation rate, baud R = data rate, bps
M = number of different signal elements L = number of bits per signal element
22
A Stream of Binary Ones at 1 Mbps
23
Key Data Transmission Terms
24
UGC NET Dec 2013
Ans:- (D)
25
UGC NET June 2014
The bit rate of a signal is 3000 bps. If each signal unit carries
6 bits, the baud rate of the signal is ...............
(A) 500 baud/sec (B) 1000 baud/sec
(C) 3000 baud/sec (D) 18000 baud/sec
Ans:- (A)
26
UGC NET June 2013
Ans:- (A)
27
UGC NET Dec 2014
An analog signal has a bit rate of 6000 bps and a baud rate of
2000 baud. How many data elements are carried by each
signal element?
(A) 0.336 bits/baud (B) 3 bits/baud
(C) 120,00,000 bits/baud (D) None of the above
Ans:- (B)
28
UGC NET AUG 2016
An analog signal has a bit rate of 8000 bps and a baud rate of
1000. Then analog signal has ..............signal elements and carry
............ data elements in each signal.
(A) 256, 8 bits (B) 128, 4 bits
(C) 256, 4 bits (D) 128, 8 bits
Ans: - (A)
Each signal clearly carry 8000/1000= 8 bits which has
2^8 = 256 signal elements
29
UGC NET June 2013
Ans:- (B)
30
UGC NET Dec 2013
Solution:- The request has to go up and come down, and the response has to
go up and come down.
The total path length traversed is thus 160,000 km.
The speed of light in air and vacuum is 300,000 km/sec,
So the propagation delay is 160,000/300,000 sec = 533.33 msec.
31
UGC NET Dec 2014
32
Kerala PSC - Polytechnic CS 198/2010
33
Solution
In a T1 carrier,
1 sec -------1.544 *10^6 bits
500 μsec ------- 500 * 10^-6*1.544 *10^6 bits = sec ------- 500 * 10^-6*1.544 *10^6 bits = 772 bits on the cable
34
T-carrier
➔
The T-carrier is a member of the series of carrier systems developed
by AT&T Bell Laboratories for digital transmission of multiplexed
telephone calls.
➔
The T-carrier is a hardware specification for carrying multiple time-
division multiplexed (TDM) telecommunications channels over a
single four-wire transmission circuit.
➔
The first version, the Transmission System 1 (T1), was introduced in
1962 in the Bell System, and could transmit up to 24 telephone calls
simultaneously over a single transmission line of copper wire.
➔
Subsequent specifications carried multiples of the basic T1 (1.544
Mbit/s) data rates, such as T2 (6.312 Mbit/s) with 96 channels, T3
(44.736 Mbit/s) with 672 channels, and others.
35
T1-carrier
36
Higher-order T-carriers.
➔ Time division multiplexing allows multiple T1 carriers to be multiplexed into
higher-order carriers.
➔ Four T1 channels can be multiplexed to form one T2 channel.
➔ FourT1 streams at 1.544 Mbps should generate 6.176 Mbps, but T2 is actually
6.312 Mbps. The extra bits are used for framing and recovery purposes.
➔ T1 and T3 are widely used by customers, whereas T2 and T4 are only used
within the telephone system itself, so they are not well known.
➔ At the next level, seven T2 streams are combined bitwise to form a T3 stream.
➔ Then six T3 streams are joined to form a T4 stream.
➔ At each step a small amount of overhead is added for framing and recovery in
case the synchronization between sender and receiver is lost.
37
UGC NET June 2010
38
SUBJECT: SIGNAL ENCODING TECHNIQUES
3
DIGITAL DATA, ANALOG SIGNAL
➔ The most familiar use of this transformation is for transmitting digital data through the public telephone network.
➔ The telephone network was designed to receive, switch, and transmit analog signals in the voice-frequency range of about 300 to
3400 Hz.
➔ It is not at present suitable for handling digital signals from the subscriber locations
➔ Thus digital devices are attached to the network via a modem (modulator-demodulator), which converts digital data to analog
signals, and vice versa.
➔ For the telephone network, modems are used that produce signals in the voice-frequency range.
➔ Modulation involves operation on one or more of the three characteristics of a carrier signal: amplitude, frequency, and phase.
Accordingly, there are three basic encoding or modulation techniques for transforming digital data into analog signals:
4
MODULATION OF ANALOG SIGNALS FOR
DIGITAL DATA
5
DIFFERENTIAL PSK (DPSK)
6
QUADRATURE PSK (QPSK) OR FOUR-LEVEL PSK
➔ More efficient use of bandwidth can be achieved if each signaling element represents more than
one bit.
➔ Instead of a phase shift of 180° as in BPSK, a common encoding technique, known as QPSK,
uses phase shifts separated by multiples of π/2 (90°):
7
MULTILEVEL PSK (MPSK)
➔ The use of multiple levels can be extended beyond taking bits two at a time.
➔ It is possible to transmit bits three at a time using eight different phase angles.
➔ For eg., let us assume that this scheme is being employed with digital input with a data rate of R = 1/Tb bps.
➔ However, the encoded signal contains L = 4 bits in each signal element using M = 16 different combinations of phase (or phase
and amplitude – like in Quadrature Amplitude Modulation (QAM)).
➔ The modulation rate can seen to be R/4, because each change of signal element communicates four bits.
➔ Thus if the line signaling speed is 2400 baud, the corresponding data rate is 9600 bps.
➔ This is the reason that higher bit rates can be achieved over voice-grade lines by employing more complex modulation schemes.
8
HTET EXAM
• The term that refers to change the digital signal to an analog signal for
transmission is called
• (A) Modulation (B) Demodulation
• (C) Encapsulation (D) Bypass
• Ans:- (A)
9
UGC-NET CS 2017 NOV
• Quadrature Amplitude Modulation means changing both:
• (A) Frequency and phase of the carrier.
• (B) Frequency and Amplitude of the carrier.
• (C) Amplitude and phase of the carrier.
• (D) Amplitude and Wavelength of the carrier.
• Answer: (C)
10
UGC NET JUNE 2011
11
UGC NET JUNE 2012
• Ans:- (A)
12
UGC NET SEPT 2013
• Ans:- (C)
• Since 8 = 2^3, bit rate is 3 times of baud rate in 8 PSK
• Bit rate =3*2500=7500 bps
13
ANALOG DATA, DIGITAL SIGNAL
➔ The process of transforming analog data into digital signals can be referred as a process of
converting analog data into digital data; called digitization.
➔ Once analog data have been converted into digital data, a number of things can happen. The
three most common are as follows:
➔ Digital data can be transmitted directly using NRZ-L.
➔ Digital data can be encoded as a digital signal using a code other than NRZ-L.
➔ Digital data can be converted into analog signal, using any modulation techniques.
➔ The device used for converting analog data into digital form for transmission, and
subsequently recovering the original analog data from the digital, is known as a codec (coder-
decoder).
14
PULSE CODE MODULATION (PCM)
15
DIGITIZING ANALOG DATA
16
PULSE CODE MODULATION - EXAMPLE
17
PULSE CODE MODULATION - EXAMPLE
➔ If voice data are limited to frequencies below 4000 Hz, 8000 samples per second would be sufficient to characterize the voice signal completely.
➔ However these are analog samples, called Pulse Amplitude Modulation (PAM) samples.
➔ To convert to digital, each of these analog samples must be assigned a binary code.
➔ Figure shows an eg. in which the original signal is assumed to have a bandwidth of B.
➔ PAM samples are taken at a rate of 2B, or once every Ts = 1/(2B) seconds.
➔ Each PAM sample is approximated by being quantized into one of 16 different levels.
➔ With 256 quantizing levels (8-bit sample), the quality of recovered signal will be more.
➔ Note that this implies that a data rate of 8000 samples per second * 8 bits per sample = 64 kbps is needed for a single voice signal.
18
PCM BLOCK DIAGRAM
19
PCM BLOCK DIAGRAM
➔ PCM starts with a continuous-time, continuous-amplitude (analog) signal, from
which a digital signal is produced.
➔ The digital signal consists of blocks of n bits, where each n-bit number is the
amplitude of a PCM pulse.
➔ By quantizing the PAM pulse, the original signal is now only approximated and
cannot be recovered exactly.
20
DELTA MODULATION (DM)
➔ A variety of techniques have been used to improve the performance of PCM or to reduce its
complexity. One of the most popular alternatives to PCM is delta modulation (DM).
➔ With delta modulation, an analog input is approximated by a staircase function that moves up
or down by one quantization level (δ) at each sampling interval (Ts ).
➔ The important characteristic of this staircase function is that its behavior is binary: At each
sampling time, the function moves up or down a constant amount δ.
➔ Thus, the output of the delta modulation process can be represented as a single binary digit for
each sample.
21
EXAMPLE OF DELTA MODULATION
22
DELTA MODULATION - LOGIC
23
QUANTIZING NOISE AND SLOPE OVERLOAD NOISE
➔ There are two important parameters in a DM scheme: the size of the step assigned to
each binary digit, δ, and the sampling rate.
➔ When the analog waveform is changing very slowly, there will be quantizing noise.
➔ On the other hand, when the analog waveform is changing more rapidly than the
staircase can follow, there is slope overload noise.
➔ It should be clear that the accuracy of the scheme can be improved by increasing the
24
sampling rate.
ANALOG DATA, ANALOG SIGNAL
➔ Modulation: process of combining an input signal m(t) and a carrier at frequency fc to produce a signal s(t) whose
bandwidth is centered on fc .
➔ For digital data, when only analog transmission facilities are available, modulation is required to convert the
digital data to analog form.
➔ There are two principal reasons for analog modulation of analog signals:
➔ A higher frequency may be needed for effective transmission, particulrly for unguided transmission.
➔ Modulation permits important techniques like frequency division multiplexing.
25
AMPLITUDE MODULATION
26
FREQUENCY MODULATION
27
KVS 2013/ HTET EXAM
• The process of taking a snapshot of the waveform at regular intervals and
representing it as a binary number is known as ?
• (A) Sampling
• (B) Sequential formatting
• (C) Standard Assessment
• (D) Sound Structure
• Ans:- (A)
28
NIELIT SCIENTIST ‘B’ - CS 2017
•
• The process of converting the analog sample into discrete form
is called
• (A) Modulation (B) Multiplexing
29
NIELIT SCIENTIST ‘B’ - CS 2016
• The sequence of operation in order with which PCM is done is:
• (A) Sampling, quantizing, encoding
• (B) quantizing, sampling, encoding
• (C) quantizing, encoding, sampling,
• (D) None of the above
• Ans:- (A)
30
HTET EXAM
• The last step in Pulse Code Modulation (PCM) is
• (A) Quantization
• (B) Sampling
• (C) Encoding
• (D) Modulation
• Ans:- (C)
31
UGC NET CS 2015 DEC
• Which of the following steps is/are not required for analog to digital conversion?
• (a)Sensing (b)Conversion (c)Sampling
(d)Conditioning (e)Quantization
• Answer: (D)
• Explanation:- Analog to digital conversion required: Sampling, quantization and conversion (encoding).
b, c, e steps are included in analog to digital conversion. No permutation of option is correct. So, option
(D) is correct.
32
HTET/ KVS 2013
• (A) Fidelity
• (B) Digitization
• (C) Sampling.
• Ans:- (A)
• Fidelity refers to how accurately a copy reproduces its source.
33
UGC NET JUNE 2015
•
• Suppose a digitized voice channel is made by digitizing 8 kHz bandwidth
analog voice signal. It is required to sample the signal at twice the highest
frequency (two samples per hertz). What is the bit rate required, if it is assumed
that each sample requires 8 bits?
• (A) 32 kbps (B) 64 kbps (C) 128 kbps (D) 256 kbps
• Ans:- (C)
•
34
GATE EC
35
SOLUTION:-
• (bandwidth )pcm = n*s
• where n – number of bits in PCM code
• s – sampling rate
• n=log2L
• n1 =log2 4=2
• n2=log2 64= 6
• (BW)1 = n1*s=2s
• (BW)2 = n2*s=6s
• (BW)2 / (BW)1 = 6s/2s = 3 times
36
SUBJECT: COMPUTER NETWORK
➢ In any communications system, the signal that is received may differ from
the signal that is transmitted due to various transmission impairments.
➢ For analog signals, these impairments can degrade signal quality.
➢ For digital signals, bit errors may be introduced, such that a binary 1 is
transformed into a binary 0 or vice versa.
➢ The most significant impairments are
➢ - Attenuation and attenuation distortion
➢ - Delay distortion
➢ - Noise
3
ATTENUATION
➢ The strength of a signal falls off with distance over any transmission medium.
➢ For guided media, this reduction in strength, or attenuation, is generally
exponential and thus is typically expressed as a constant number of decibels
per unit distance.
➢ For unguided media, attenuation is a more complex function of distance and
the makeup of the atmosphere.
➢ Attenuation introduces following considerations for transmission engineer.
• - First, a received signal must have sufficient strength so that the electronic circuitry in
the receiver can detect the signal.
• - Second, the signal must maintain a level sufficiently higher than noise to be received
without error.
4
ATTENUATION
5
DELAY DISTORTION
➢ Delay distortion occurs because the velocity of propagation of a signal
through a guided medium varies with frequency.
➢ For a bandlimited signal, the velocity tends to be highest near the center
frequency and fall off toward the two edges of the band.
➢ Thus various frequency components of a signal will arrive at the receiver
at different times, resulting in phase shifts between the different
frequencies.
➢ This effect is referred to as delay distortion because the received signal
is distorted due to varying delays experienced at its constituent
frequencies.
6
NOISE
➢ For any data transmission event, the received signal will consist of the
transmitted signal, modified by the various distortions imposed by the
transmission system, plus additional unwanted signals that are inserted
somewhere between transmission and reception. The latter, undesired signals
are referred to as noise.
➢ Noise is the major limiting factor in communications system performance.
➢ Noise may be divided into four categories:
• - Thermal noise
• - Intermodulation noise
• - Crosstalk
• - Impulse noise
7
THERMAL NOISE
8
THERMAL NOISE FORMULA
• The thermal noise in watts present in a bandwidth of B Hertz can be expressed as:
• N = kTB
• Note:
• A Joule (J) is the International System (SI) unit of electrical, mechanical, and thermal energy. A Watt is the
SI unit of power, equal to one Joule per second.The kelvin (K) is the SI unit of thermodynamic
temperature. For a temperature in kelvins of T, the corresponding temperature in degrees Celsius is equal
to T – 273.15.
9
INTERMODULATION NOISE
➢ When signals at different frequencies share the same transmission
medium, the result may be intermodulation noise.
➢ The effect of intermodulation noise is to produce signals at a frequency
that is the sum or difference of the two original frequencies or multiples of
those frequencies.
➢ For eg., the mixing of signals at frequencies f1 and f2 might produce
energy at the frequency f1 + f2 . This derived signal could interfere with
an intended signal at the frequency f1 + f2.
10
CROSSTALK
➢ Crosstalk has been experienced by anyone who, while using the
telephone, has been able to hear another conversation; it is an unwanted
coupling between signal paths.
➢ It can occur by electrical coupling between nearby twisted pairs or,
rarely, coax cable lines carrying multiple signals.
➢ Crosstalk can also occur when microwave antennas pick up unwanted
signals; although highly directional antennas are used, microwave energy
does spread during propagation.
➢ Typically, crosstalk is of the same order of magnitude as, or less than,
thermal noise.
11
IMPULSE NOISE
12
CHANNEL CAPACITY
➢ We have seen that there are a variety of impairments that distort or corrupt a signal.
➢ For digital data, the question that then arises is to what extent these impairments limit the data rate
that can be achieved.
➢ The maximum rate at which data can be transmitted over a given communication path, or channel,
under given conditions, is referred to as the channel capacity.
➢ There are four concepts here that are related to one another.
• - Data rate: The rate, in bits per second (bps), at which data can be communicated
• - Bandwidth: The bandwidth of the transmitted signal as constrained by the
transmitter and the nature of the transmission medium, expressed in cycles per second, or
Hertz
• - Noise: The average level of noise over the communications path
• - Error rate: The rate at which errors occur, where an error is the reception of a 1
when a 0 was transmitted or the reception of a 0 when a 1 was transmitted
13
PROBLEM TO BE ADDRESSED
14
DATA RATE LIMITS
➢ A very important consideration in data communications is how fast we
can send data, in ‘bits per second’ over a channel.
➢ Data rate depends on three factors:
• 1. The bandwidth available
• 2. The level of the signals we use
• 3. The quality of the channel (the level of noise)
➢ Two theoretical formulas were developed to calculate the data rate:
one by Nyquist for a noiseless channel. another by Shannon for a
noisy channel.
15
NOISELESS CHANNEL: NYQUIST BIT RATE
• For a noiseless channel, the Nyquist bit rate formula defines the
theoretical maximum bit rate as
• BitRate = 2 x Bandwidth x log2 L
• where
• Bandwidth - bandwidth of the channel,
16
NYQUIST BIT RATE – EFFECT ON INCREASING SIGNAL LEVELS
(L)
➢ According to the formula, we might think that, given a specific bandwidth, we can have any
bit rate we want by increasing the number of signal levels.
➢ Although the idea is theoretically correct, practically there is a limit.
➢ When we increase the number of signal levels, we impose a burden on the receiver.
• If the number of levels in a signal is just 2, the receiver can easily distinguish between a 0 and a 1.
• If the level of a signal is 64, the receiver must be very sophisticated to distinguish between 64
different levels.
➢ Also if the data rate is increased, then the bits become “shorter” so that more bits are
affected by a given pattern of noise.
➢ Hence, increasing the levels of a signal reduces the reliability of the system.
17
NOISY CHANNEL: SHANNON CAPACITY
➢ In reality, we cannot have a noiseless channel; the channel is always noisy.
➢ In 1944, Claude Shannon introduced a formula, called the Shannon capacity, to determine
the theoretical highest data rate for a noisy channel:
➢ Capacity = Bandwidth X log2 (1 + SNR)
➢ where
➢ Bandwidth - bandwidth of the channel
➢ SNR - signal-to-noise ratio
➢ Capacity - capacity of the channel in bits per second.
➢ Note: In the Shannon formula there is no indication of the signal level, which means that
no matter how many levels we have, we cannot achieve a data rate higher than the capacity
of the channel. In other words, the formula defines a characteristic of the channel, not the
method of transmission.
18
SIGNAL-TO-NOISE RATIO (SNR)
➢ To find the theoretical bit rate limit, we need to know the ratio of the signal power to the
noise power. The signal-to-noise ratio is defined as
➢ SNR = average signal power/ average noise power
➢ We need to consider the average signal power and the average noise power because
these may change with time.
➢ SNR is the ratio of what is wanted (signal) to what is not wanted (noise).
➢ A high SNR means the signal is less corrupted by noise; a low SNR means the signal
is more corrupted by noise.
➢ Because SNR is the ratio of two powers, it is often described in decibel units,
➢ SNR in decibel (SNRdB) is defined as
➢ SNRdB = l0 log10SNR
19
SHANNON FORMULA - LIMITATIONS
20
KERALA PSC - POLYTECHNIC IT 18/2015
• Ans:- (B)
21
PRACTICE QUESTION
22
PRACTICE QUESTION
23
UGC NET DEC 2008
•
•
• The channel capacity of a band-limited Gaussian channel is given by
•
• (A) B log2 (2+S/N)
• (B) B log2 (1+S/N)
• (C) B log10(1+S/N)
• (D) B log e (1+S/N)
• Ans:- (B)
24
PRACTICE QUESTION
• Consider an extremely noisy channel in which the value of the signal-to-noise
ratio is almost zero. In other words, the noise is so strong that the signal is faint.
For this channel find the capacity C using Shannon theorem ?
• Solution:-
• C = B log2 (1 + SNR) = B log2 (l + 0) = B log2 1 = B x 0 = 0
• This means that the capacity of this channel is zero regardless of the bandwidth.
In other words, we cannot receive any data through this channel.
25
PRACTICE QUESTION
• The power of a signal is 10 mW and the power of the noise is 1 µW; what
are the values of SNR and SNRdB ?
• Solution:-
• The values of SNR and SNRdB can be calculated as follows:
• SNR = 10 mW / 1 µW = 10 000
• SNRdB = 10 log10 10,000 = 10 log10 10^4 = 40
26
PRACTICE QUESTION
• Assume that the signal-to-noise ratio in decibels, SNRdB = 36 and the channel bandwidth is 2 MHz. Find the theoretical
channel capacity ?
• Solution:-
• SNRdB = 10 log10 SNR . . .
• SNR = 10^(SNRdB /10)
• SNR = 10 ^ 3.6 = 3981
• C = B log2 (1+ SNR) = 2 * 10^6 * log2 3982 = 24 Mbps
• Note:
• For practical purposes, when the SNR is very high, we can assume that SNR + 1 is almost the same as SNR. In these cases, the
theoretical channel capacity can be simplified to
• C = B log2 (1+ SNR) = B log2 (SNR) = B log2 (10^(SNRdB /10))
• = B * (SNRdB /10) * log2 10 ~ B * SNRdB / 3
• Hence, for previous example:
• C= 2 * 10^6 * 36 / 3 =24 Mbps
27
NIELIT SCIENTIFIC ASSISTANT IT - 2017
• Ans:- (C)
28
PRACTICE QUESTION
• We have a channel with a 1-MHz bandwidth. The SNR for this channel is
63. What are the appropriate bit rate and signal level?
• Solution:-
• First, we use the Shannon formula to find the upper limit.
• C = B log2 (l + SNR) = 10^6 log2 (1 + 63) = 10^6 log2 64 = 6 Mbps
• The Shannon formula gives us 6 Mbps, the upper limit.
• Then we use the Nyquist formula to find the number of signal levels.
• 6 Mbps=2 x 1 MHz x log2 L
• L=8
29
UGC NET DEC 2013
•
• _________ is a type of transmission impairment in which the signal
looses strength due to the resistance of the transmission medium.
• (A) Attenuation (B) Distortion
• (C) Noise (D) Decibel
• Ans:- (A)
•
30
SUBJECT: COMPUTER NETWORK
➔ Multiplexing is the set of techniques that allows the simultaneous transmission of multiple signals across a single
data link.
➔ If the bandwidth of a link is greater than the bandwidth needs of the devices connected to it, the bandwidth is
wasted.
➔ An efficient system that maximizes the utilization of all resources, including bandwidth which is the most
precious resource, is needed in data communications.
3
DIVIDING A LINK INTO CHANNELS
4
DIVIDING A LINK INTO CHANNELS
➔ In a multiplexed system, n lines share the bandwidth of one link.
➔ The lines on the left direct their transmission streams to a multiplexer (MUX), which combines them into a single
stream (many-to-one).
➔ At the receiving end, that stream is fed into a demultiplexer (DEMUX), which separates the stream back into its
component transmissions (one-to-many) and directs them to their corresponding lines.
➔ The word channel refers to the portion of a link that carries a transmission between a given pair of lines.
5
CATEGORIES OF MULTIPLEXING
6
FDM AND TDM
7
FREQUENCY DIVISION MULTIPLEXING (FDM)
➔ FDM is possible when the useful bandwidth of the transmission medium exceeds the required bandwidth of signals to be transmitted.
➔ A number of signals can be carried simultaneously if each signal is modulated onto a different carrier frequency and the carrier frequencies are
sufficiently separated that the bandwidths of the signals do not significantly overlap.
➔ To prevent interference channels are separated by guard bands (unused portions of spectrum)
➔ Note, however, that the input signals may be either digital or analog.
➔ In case of digital input, input must be passed through modems to be converted to analog.
➔ Each input analog signal must then be modulated to move it to appropriate frequency band.
8
FDM MULTIPLEXING PROCESS
9
FDM DEMULTIPLEXING PROCESS
10
FDM - PRACTICE PROBLEM
• Solution:-
• For five channels, we need at least four guard bands. This means that the
required bandwidth is at least
11
WAVELENGTH DIVISION MULTIPLEXING (WDM)
➔ WDM is an analog multiplexing technique to combine optical signals.
➔ WDM is conceptually same as FDM, except that multiplexing and demulti-plexing involve optical signals
transmitted through fiber optic channels.
➔ The true potential of optical fiber is fully exploited when multiple beams of light at different frequencies are
transmitted on the same fiber.
➔ This is a form of frequency division multiplexing (FDM) but is commonly called wavelength division
multiplexing (WDM).
➔ With WDM, the light streaming through the fiber consists of many colors, or wavelengths, each carrying a
separate channel of data.
➔ One application of WDM is the SONET network in which multiple optical fiber lines are multiplexed and
demultiplexed.
12
WDM TECHNOLOGY
➔ Although WDM technology is very complex, basic idea is very simple.
➔ We want to combine multiple light sources into one single light at the multiplexer and do the
reverse at the demultiplexer.
➔ Recall from basic physics that a prism bends a beam of light based on the angle of incidence and
the frequency.
➔ Using this technique, a multiplexer can be made to combine several input beams of light, each
containing a narrow band of frequencies, into one output beam of a wider band of frequencies.
13
PRISMS IN WDM
14
TIME DIVISION MULTIPLEXING (TDM)
➔ TDM is a digital multiplexing technique for combining several low-rate channels into
one high-rate one.
➔ However, this does not mean that the sources cannot produce analog data; analog data
can be sampled, changed to digital data, and then multiplexed by using TDM.
➔ In synchronous TDM, each input connection has an allotment in the output even if it is
not sending data.
15
FDM AND TDM
16
SYNCHRONOUS TDM
➔ For example, the figure in previos slide has six inputs that might each
be, say, 9.6 kbps.
17
SYNCHRONOUS TDM SYSTEM
18
SYNCHRONOUS TDM - FRAMES
➔ The transmitted data may have a format something like (b) part of figure.
➔ The data are organized into frames. Each frame contains a cycle of time slots.
➔ In each frame, one or more slots are dedicated to each data source.
➔ Sequence of slots for one source, from frame to frame, is called a channel.
➔ The slot length equals the transmitter buffer length, typically a bit or a byte.
➔ Synchronous TDM is called synchronous not because synchronous transmission is used, but because the time slots are preassigned to sources and fixed.
➔ The time slots for each source are transmitted whether or not the source has data to send.
19
SYNCHRONOUS TDM - EXAMPLE
20
SYNCHRONOUS TDM
– RELATIONSHIP BETWEEN INPUT AND OUTPUT BIT RATE
➔ In synchronous TDM, a round of data units from each input connection is collected into a frame.
➔ If we have n connections, a frame is divided into n time slots and one slot is allocated for each unit,
one for each input line.
➔ If the duration of the input unit is T, the duration of each slot is T/n and the duration of each frame is
T (unless a frame carries some other information).
➔ The data rate of the output link must be n times the data rate of a connection to guarantee the flow of
data.
➔ In the previos eg, the data rate of the link is 3 times the data rate of a connection; likewise, the
duration of a unit on a connection is 3 times that of the time slot (duration of a unit on the link).
➔ In synchronous TDM, the data rate of the link is n times faster, and the unit duration is n times shorter.
21
SYNCHRONOUS TDM – PRACTICE PROBLEM 1
• Four 1-Mbps connections are multiplexed together with synchronous TDM. The unit of data is 1 bit. Find
• (a) the input bit duration (b) the output bit duration
• (c) the output bit rate (d) the output frame rate
• Solution:-
• (a) The input bit duration is the inverse of the bit rate: 1 / (1 Mbps) = 1 µs.
• (b) The output bit duration is one-fourth of the input bit duration, or 1/4 µs.
• (c) The output bit rate is the inverse of the output bit duration 1/4 µs, i.e. 4 Mbps. This can also be deduced from the fact that the output rate
is 4 times as fast as any input rate; so the output rate = 4 x 1 Mbps = 4 Mbps.
• (d) The frame rate is always the same as any input rate. So the frame rate is 1,000,000 frames per second. Because we are sending 4 bits in
each frame, we can verify the result of the previous question by multiplying the frame rate by the number of bits per frame.
22
SYNCHRONOUS TDM – PRACTICE PROBLEM 2
• Four l-kbps connections are multiplexed together. A unit is 1 bit. Find
• (a) the duration of 1 bit before multiplexing
• (b) the transmission rate of the outgoing link
• (c) the duration of a time slot
• (d) the duration of a frame.
• Solution:-
• (a) The duration of 1 bit before multiplexing is 1/(1 kbps), or 0.001 s i.e. 1 ms
• (b) The rate of the link is 4 times the rate of a connection, or 4 kbps.
• (c) The duration of each time slot is one-fourth of the duration of each bit before multiplexing, or (1/4) ms or 250 µs. We can also
calculate this from the data rate of the link, 4 kbps. The bit duration is the inverse of the data rate, or 1/(4 kbps) or 250 µs.
• (d) The duration of a frame is always the same as the duration of a unit before multiplexing, or 1 ms. We can also calculate this in
another way. Each frame in this case has four time slots. So the duration of a frame is 4 times 250 µs, or 1 ms.
23
SYNCHRONOUS TDM – PRACTICE PROBLEM 3
• Four channels are multiplexed using TDM. If each channel sends 100 bytes/s and we
multiplex 1 byte per channel, find the size of the frame, the duration of a frame, the frame
rate, and the bit rate for the link.
• Solution:-
24
SYNCHRONOUS TDM – PRACTICE PROBLEM 4
• A multiplexer combines four 100-kbps channels using a time slot of 2 bits. What is the frame
rate? What is the frame duration? What is the bit rate? What is the bit duration?
• Solution:-
25
SUBJECT: COMPUTER NETWORK
➔ In all previous example problems so far, it was assumed that the data rates of all
input lines were the same.
➔ However, if data rates are not the same, following three strategies, or a
combination of them, can be used.
➔ multilevel multiplexing,
➔ multiple-slot allocation, and
➔ pulse stuffing.
3
MULTILEVEL MULTIPLEXING
➔ Multilevel multiplexing is a technique used when the data rate of an input line is a multiple of others.
➔ For eg., in following figure, we have two inputs of 20 kbps and three inputs of 40 kbps.
➔ First two input lines can be multiplexed to provide a data rate equal to last three.
4
MULTIPLE-SLOT ALLOCATION
➔ Sometimes it is more efficient to allot more than one slot in a frame to a single input line.
➔ For eg., we might have an input line that has a data rate that is a multiple of another input.
➔ In following figure, input line with a 50-kbps data rate can be given two slots in output.
➔ We insert a serial-to-parallel converter in the line to make two inputs out of one.
5
PULSE STUFFING
➔ Sometimes the bit rates of sources are not multiple integers of each other.
➔ One solution is to make the highest input data rate the dominant data rate and then add dummy bits to the input lines with lower rates.
➔ Input with a data rate of 46 is pulse-stuffed to increase rate to 50 kbps. Now multiplexing can take place.
6
TDM DATA RATE MANAGEMENT – PRACTICE PROBLEM
• Two channels, one with a bit rate of 100 kbps and another with a bit rate of 200 kbps, are to be multiplexed. What is the frame
rate? What is the frame duration? What is the bit rate of the link?
• Solution:-
• We can allocate one slot to the first channel and two slots to the second channel.
• Frame rate is 100,000 frames per second because it carries 1 bit from the first channel.
• The bit rate is 100,000 frames/s x 3 bits per frame, or 300 kbps.
• Note that because each frame carries 1 bit from the first channel, the bit rate for the first channel is preserved.
• The bit rate for the second channel is also preserved because each frame carries 2 bits from the second channel.
7
FRAME SYNCHRONIZING
➔ The implementation of TDM is not as simple as that of FDM.
➔ If the multiplexer and the demultiplexer are not synchronized, a bit belonging to one
channel may be received by the wrong channel.
➔ For this reason, one or more synchronization bits are usually added to the beginning of
each frame.
➔ These bits, called framing bits, follow a pattern, frame to frame, that allows the
demultiplexer to synchronize with the incoming stream so that it can separate the time
slots accurately.
8
FRAME SYNCHRONIZING – PRACTICE PROBLEM
• We have four sources, each creating 250 characters per second. If the interleaved unit is a character and 1 synchronizing bit is added to each frame, find
• (a) the data rate of each source (b) the duration of each character in each source (c) the frame rate
• (d) the duration of each frame (e) the number of bits in each frame (f) the data rate of the link
• Solution:-
• (a) The data rate of each source is 250 x 8 = 2000 bps = 2 kbps.
• (b) Each source sends 250 characters per second; so the duration of a character is 1/250 s, or 4 ms.
• (c) Each frame has one character from each source, which means the link needs to send 250 frames per second to keep the transmission rate of each
source.
• (d) The duration of each frame is 1/250 s, or 4 ms. Note that the duration of each frame is the same as the duration of each character coming from each
source.
• (e) Each frame carries 4 characters, 1 extra synchronizing bit. Thus each frame is 4 x 8 + 1 = 33 bits.
• (f) The link sends 250 frames per second, and each frame contains 33 bits. This means that the data rate of the link is 250 x 33, or 8250 bps.
• Note that the bit rate of the link is greater than the combined bit rates of the four channels. If we add the bit rates of four channels, we get 8000 bps.
Because 250 frames are traveling per second and each contains 1 extra bit for synchronizing, we need to add 250 to the sum to get 8250 bps.
9
SYNCHRONOUS TDM – EMPTY SLOTS
10
STATISTICAL TIME-DIVISION MULTIPLEXING
➔ In synchronous TDM, each input has a reserved slot in the output frame. This can be inefficient if some input lines
have no data to send.
➔ In statistical time-division multiplexing, slots are dynamically allocated to improve bandwidth efficiency.
➔ Only when an input line has a slot's worth of data, it is given a slot in output frame.
➔ Here, number of slots in each frame is less than number of input lines.
➔ The multiplexer checks each input line in round robin fashion; it allocates a slot for an input line if line has data to
send; otherwise, it skips the line and checks next line.
➔ In the synchronous TDM, some slots are empty because the corresponding line does not have data to send.
➔ In the statistical time-division multiplexing, however, no slot is left empty as long as there are data to be sent by
any input line.
11
TDM SLOT COMPARISON
12
STATISTICAL TDM - ADDRESSING
➔ Figure in previous slide shows a major difference between slots in synchronous TDM and statistical TDM.
➔ An output slot in synchronous TDM is totally occupied by data; in statistical TDM, a slot needs to carry data as
well as the address of the destination.
➔ In synchronous TDM, there is no need for addressing; synchronization and preassigned relationships between the
inputs and outputs serve as an address.
➔ In statistical multiplexing, there is no fixed relationship between the inputs and outputs because there are no
preassigned or reserved slots.
➔ The addressing in its simplest form can be n bits to define N different output lines with n = log2N.
➔ For example, for eight different output lines, we need a 3-bit address.
13
STATISTICAL TDM - SLOT SIZE, FRAME
SYNCHRONIZATION BIT
➔ Since a slot carries both data and an address in statistical TDM, the ratio of data size to address
size must be reasonable to make transmission efficient.
➔ For example, it would be inefficient to send 1 bit per slot as data when the address is 3 bits.
➔ In statistical TDM, a block of data is usually many bytes while the address is just a few bytes.
➔ There is another difference between synchronous and statistical TDM, but this time it is at the
frame level.
➔ The frames in statistical TDM need not be synchronized, so we do not need synchronization bits.
14
STATISTICAL TDM - BANDWIDTH
15
KERALA PSC 111/2010 – HSST 2012
•
• A technique in which system resources are shared among multiple users:
• (A) Multiplexing (B) Demultiplexing
• (C) Modulation (D) Demodulation
•
16
UGC NET DEC 2008
•
• Ans:- (C)
17
UGC NET JUNE 2014
• Ten signals, each requiring 3000 Hz, are multiplexed on to a single channel
using FDM. How much minimum bandwidth is required for the multiplexed
channel? Assume that the guard bands are 300 Hz wide.
• (A) 30,000 (B) 32,700 (C) 33,000 (D) None
• Ans:- (B)
18
UGC NET JUNE 2014
•
• A terminal multiplexer has six 1200 bps terminals and ‘n’ 300 bps terminals
connected to it. If the outgoing line is 9600 bps, what is the value of n?
• (A) 4 (B) 8 (C) 16 (D) 28
• Ans:- (B)
19
UGC NET DEC 2015
•
• Four channels are multiplexed using TDM. If each channel sends 100
bytes/second and we multiplex 1 byte per channel, then the bit rate for the
link is ...............
• (A) 400 bps (B) 800 bps (C) 1600 bps (D) 3200 bps
20
SOLUTION
• Explanation:-
• The multiplexer is shown in the Figure.
• Each frame carries 1 byte from each channel; the size of each frame, therefore, is 4 bytes, or 32 bits.
Because each channel is sending 100 bytes/s and a frame carries 1 byte from each channel, the frame rate
must be 100 frames per second.
• Thus, the bit rate is 100 × 32 = 3200 bps. (option D)
21
UGC NET JULY 2016
• If link transmits 4000 frames per second and each frame has 8 bits, the
transmission rate of circuit of this TDM is ...............
• (A) 64 Kbps (B) 32 Mbps (C) 32 Kbps (D) 64 Mbps
22
UGC NET JULY 2016
• A multiplexer combines four 100-Kbps channels using a time slot of 2 bits. What is
the bit rate?
• (A) 100 Kbps (B) 200 Kbps
• (C) 400 kbps (D) 1000 Kbps
• Ans:- (C)
23
SOLUTION:-
24
UGC NET JULY 2016
• Given the following statements:
• (a) Frequency Division Multiplexing is a technique that can be applied when the bandwidth of a link is greater than combined bandwidth of
signals to be transmitted.
• (b) Wavelength Division Multiplexing (WDM) is an analog multiplexing Technique to combine optical signals.
• (A) (a), (b), (c) and (d) are true. (B) (a), (b), (c) and (d) are false.
• (C) (a), (b) and (d) are false; (c) is true. (D) (a), (b) and (d) are true; (c) is false.
• Ans:- (D)
25
Computer Networks – Introduction
Functionality of Computer Network
➔Addressing
➔...
2
Error control
4
Flow control
7
Congestion
8
Multiplexing and Demultiplexing
➔Since there are many computers on the network, every layer needs a
mechanism for identifying the senders and receivers that are
involved in a particular message.
➔This mechanism is called addressing or naming, in the low and
high layers, respectively.
➔ Physical Addressing Vs Logical Addressing
➔ MAC address, IP address, Port Number, Domain Name
10
Routing
11
Internetworking
12
Quality of service
13
Security
15
Compression/ Decompression
➔ Compression reduces the size of the document for storage or
transmission.
➔ Compressed files are smaller, download faster, and easier to
transport.
➔ Decompression or expansion restores the document to its original
size.
➔Compression tries to eliminate redundancies in the pattern of
data.
➔ For example, if a black pixel is followed by 20 white pixels, there
is no need to store all 20 white pixels. A coding mechanism can be
used so that only the count of the white pixels is stored.
➔ Once
16 such redundancies are removed, the data object requires less
Check pointing
17
ISRO CS 2011
Ans:- (D)
18
Encoding Techniques
19
Kerala PSC 002/2012 – Lecturer, CS 2015
Ans:- D
20
Kerala PSC 111/2010 – HSST 2011
Ans:- (A)
21
Downtime
Ans: (B)
23
Kerala PSC 12 / 2014
Ans: (C)
24
Kerala PSC 70 / 2014
Ans: (C)
25
Kerala PSC 207/2013 – Computer
Programmer, DTE 2015
Ans:- (C)
26
Kerala PSC 207/2013 – Comp
Programmer, DTE 2015
Ans:- D
27
Kerala PSC 12 / 2014
Ans: (A)
28
Computer Networks
– Layered architectute (Part 2)
Design Issues for the Layers
Routing, internetworking
➔
Addressing or naming
➔
Scalability
➔
Statistical Multiplexing
➔
Flow Control
➔
Congestion Control
➔
2
Why layering ?
3
Layering
➔
To reduce their design complexity, most networks are organized as a stack of
layers or levels, each one built upon the one below it.
➔
The number of layers, the name of each layer, the contents of each layer, and the
function of each layer differ from network to network.
➔
Purpose of each layer is to offer certain services to higher layers while shielding
those layers from the details of how the offered services are actually implemented.
➔
This concept is variously known as information hiding, abstract data types,
data encapsulation, and object-oriented programming.
➔
Fundamental idea - a particular piece of software (or hardware) provides a service
to its users but keeps details of its internal state and algorithms hidden from them.
➔
The peer process abstraction is crucial to all network design. Using it, the
unmanageable task of designing the complete network can be broken into several
smaller, manageable design problems, namely, the design of the individual layers.
4
Protocol Hierarchies
➔
When layer n on one machine carries on a conversation with layer n
on another machine, the rules and conventions used in this
conversation are collectively known as the layer n protocol.
➔
Basically, a protocol is an agreement between the communicating
parties on how communication is to proceed.
➔
Violating the protocol will make communication more difficult.
5
Layers, protocols, and interfaces
6
Interface
➔
Between each pair of adjacent layers is an interface. The interface defines which
primitive operations and services the lower layer makes available to the upper one.
➔
When network designers decide how many layers to include in a network and what each
one should do, one of the most important considerations is defining clean interfaces
between the layers.
➔
Doing so, in turn, requires that each layer perform a specific collection of well-
understood functions.
➔
In addition to minimizing the amount of information that must be passed between
layers, clearcut interfaces also make it simpler to replace one layer with a completely
different protocol or implementation (e.g., replacing all the telephone lines by satellite
channels) because all that is required of the new protocol or implementation is that it
offer exactly the same set of services to its upstairs neighbor as the old one did.
➔
It is common that different hosts use different implementations of the same protocol
(often written by different companies). In fact, the protocol itself can change in some
layer without the layers above and below it even noticing.
7
Network architecture, protocol stack
➔
A set of layers and protocols is called a network architecture.
➔
The specification of an architecture must contain enough
information to allow an implementer to write the program or build
the hardware for each layer so that it will correctly obey the
appropriate protocol.
➔
Neither the details of the implementation nor the specification of
the interfaces is part of the architecture because these are hidden
away inside the machines and not visible from the outside.
➔
A list of the protocols used by a certain system, one protocol per
layer, is called a protocol stack.
8
Example information flow supporting
virtual communication in layer 5
9
Inflormation flow – sender side
➔
Message M is produced by an application process at layer 5 and given to layer 4 for transmission.
➔
Layer 4 puts a header in front of message to identify the message and passes the result to layer 3.
➔
The header includes control information, such as addresses, to allow layer 4 on the destination
machine to deliver the message.
➔
Other examples of control information used in some layers are sequence numbers (in case the
lower layer does not preserve message order), sizes, and times.
➔
In many networks, no limit is placed on the size of messages transmitted in the layer 4 protocol
but there is nearly always a limit imposed by the layer 3 protocol.
➔
Consequently, layer 3 must break up the incoming messages into smaller units, packets,
prepending a layer 3 header to each packet.
➔
In this example, M is split into two parts, M 1 and M 2 , that will be transmitted separately.
➔
Layer 3 decides which of the outgoing lines to use and passes the packets to layer 2.
➔
Layer 2 adds to each piece not only a header but also a trailer, and gives the resulting unit to
layer 1 for physical transmission.
10
Inflormation flow – receiver side
➔
At the receiving machine the message moves upward, from layer to layer,
with headers being stripped off as it progresses.
➔
None of the headers for layers below n are passed up to layer n.
➔
Important thing to understand here is the relation between virtual and actual
communication and difference between protocols and interfaces.
➔
The peer processes in layer 4, for example, conceptually think of their
communication as being ‘‘horizontal,’’ using the layer 4 protocol.
➔
Each one is likely to have procedures called something like SendToOtherSide
and GetFromOtherSide, even though these procedures actually communicate
with lower layers across the 3/4 interface, and not with the other side.
➔
Lower layers of a protocol hierarchy are frequently implemented in hardware
or firmware. Nevertheless, complex algorithms are involved, even if they are
embedded in hardware.
11
Reference Models
●
Two important network architectures popularly referred:
✔ the OSI reference model and
✔ the TCP/IP reference model.
●
Although the protocols associated with the OSI model are not used
any more, the model itself is actually quite general and still valid,
and the features of each layer are very important.
●
The TCP/IP model has the opposite properties: the model itself is
not of much use but the protocols are widely used.
12
The OSI Reference Model
➢
The OSI model is based on a proposal developed by the
International Standards Organization (ISO) as a first step toward
international standardization of protocols used in the various layers.
➢
It was revised in 1995.
➢
The model is called the ISO OSI (Open Systems Interconnection)
Reference Model (OSI model for short.) because it deals with
connecting open systems—that is, systems that are open for
communication with other systems.
13
The OSI reference model – Seven Layers
14
Principles applied to arrive at seven layers
15
Functionality of Computer Network
...
16
The OSI reference model
17
Different levels of communication
18
1. Physical Layer (Layer 1)
➢
The lowest layer of the OSI reference model is the physical layer.
➢
It is responsible for the actual physical connection between the devices and transmitting
raw bits over a communication channel.
➢
The design issues have to do with making sure that when one side sends a 1 bit it is
received by the other side as a 1 bit, not as a 0 bit.
➢
Typical questions here are:
➔ what electrical signals should be used to represent a 1 and a 0,
➔ how many nanoseconds a bit lasts,
➔ whether transmission may proceed simultaneously in both directions,
➔ how the initial connection is established,
➔ how it is torn down when both sides are finished,
➔ how many pins the network connector has, and what each pin is used for.
➢
These design issues largely deal with mechanical, electrical, and timing interfaces, as
well as the physical transmission medium, which lies below the physical layer.
19
Functions of physical layer
20
Note:-
21
Data Link Layer (DLL) (Layer 2)
➢
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.
➢
When a packet arrives in a network, it is the responsibility of DLL to transmit it to the
Host using its MAC address.
➢
Data Link Layer is divided into two sub layers :
➢ Logical Link Control (LLC)
➢ Media Access Control (MAC)
➢
The packet received from Network layer is further divided into frames depending on the
frame size of NIC (Network Interface Card).
➢
DLL also encapsulates Sender and Receiver’s MAC address in the header.
➢
The Receiver’s MAC address is obtained by placing an ARP(Address Resolution
Protocol) request onto the wire asking “Who has that IP address?” and the destination host
will reply with its MAC address.
22
Data Link layer - functions
Framing: Framing is a function of the data link layer. It provides a way for a sender
to transmit a set of bits that are meaningful to the receiver. This can be accomplished
by attaching special bit patterns to the beginning and end of the frame.
Physical addressing: After creating frames, Data link layer adds physical addresses
(MAC address) of sender and/or receiver in the header of each frame.
Error control: Data link layer provides the mechanism of error control in which it
detects and retransmits damaged or lost frames.
Flow Control: The data rate must be constant on both sides else the data may get
corrupted thus , flow control coordinates that amount of data that can be sent before
receiving acknowledgement.
Access control: When a single communication channel is shared by multiple devices,
MAC sub-layer of data link layer helps to determine which device has control over
the channel at a given time.
23
Note:-
24
3. Network Layer (Layer 3)
➔
The network layer controls the operation of the subnet.
➔
A key design issue is determining how packets are routed from source to destination.
➔ Routes can be based on static tables that are ‘‘wired into’’ the network and rarely changed, or more often they can be
updated automatically to avoid failed components.
➔ They can also be determined at start of each conversation, for eg., a terminal session, such as a login to a remote machine.
➔ Finally, they can be highly dynamic, being determined anew for each packet to reflect the current network load.
➔
If too many packets present in subnet at same time, they will get in one another’s way, forming bottlenecks.
➔ Handling congestion is also a its responsibility, in conjunction with higher layers that adapt the load they place on network.
➔
More generally, the quality of service provided (delay, transit time, jitter, etc.) is also a network layer issue.
➔
When a packet has to travel from one network to another to get to its destination, many problems can arise.
➔ The addressing used by the second network may be different from that used by the first one.
➔ The second one may not accept the packet at all because it is too large.
➔ The protocols may differ, and so on.
➔ It is up to the network layer to overcome all these problems to allow heterogeneous networks to be interconnected.
25
Note:
26
4. Transport Layer (Layer 4)
➔
Transport layer provides services to application layer and takes services from network layer.
➔
The data in the transport layer is referred to as Segments.
➔
It is responsible for the End to End Delivery of the complete message.
➔
The transport layer can also provide the acknowledgement of the successful data transmission
and re-transmits the data if an error is found.
➔
At sender’s side:
➔ Transport layer receives the formatted data from the upper layers, performs Segmentation and also implements
Flow & Error control to ensure proper data transmission.
➔ It also adds Source and Destination port number in its header and forwards the segmented data
➔ Generally, the destination port number is configured, either by default or manually.
➔ For example, when a web application makes a request to a web server, it typically uses port number 80, because
this is the default port assigned to web applications. Many applications have default port assigned.
➔
At receiver’s side:
➔ Transport Layer reads the port number from its header and forwards the Data to the respective application.
➔ It also performs sequencing and reassembling of the segmented data.
27
Transport layer - Services
28
Note:
29
5. Session Layer (Layer 5)
➢
This layer is responsible for establishment, authentication, authorization,
maintenance and termination of sessions.
➢
Sessions offer various services, including
➔ Synchronization - checkpointing long transmissions to allow them to pick up from
where they left off in the event of a crash and subsequent recovery.
➔ Dialog control - keeping track of whose turn it is to transmit, and
➔ Token management - preventing two parties from attempting the same critical
operation simultaneously
Note:
* Layer 5, 6 and 7 of OSI model are integrated as a single layer in the TCP/IP model.
* These are also known as Upper Layers or Software Layers.
* Implementation of these 3 layers is done by network application itself (Not by OS)
30
6. Presentation Layer (Layer 6)
➔
Unlike the lower layers, which are mostly concerned with moving
bits around, the presentation layer is concerned with the syntax and
semantics of the information transmitted.
➔
In order to make it possible for computers with different internal
data representations to communicate, the data structures to be
exchanged can be defined in an abstract way, along with a standard
encoding to be used ‘‘on the wire.’’
➔
The presentation layer manages these abstract data structures
and allows higher-level data structures to be defined and exchanged.
31
Presentation Layer functions
Translation:
➔ Presentation layer is also called the Translation layer.
➔ The data from the application layer is extracted here and manipulated as per the required
format to transmit over the network.
➔ For example, ASCII to EBCDIC.
Encryption/ Decryption:
➔ Data encryption translates the data into another form or code.
➔ The encrypted data is known as the cipher text and the decrypted data is known as plain text.
➔ A key value is used for encrypting as well as decrypting data.
Compression:
➔ Reduces the number of bits that need to be transmitted on the network.
➔ Lossy and Lossless compression
32
7. Application Layer (Layer 7)
➔
At the very top of OSI Reference Model stack of layers, we find
Application layer which is implemented by network applications.
➔
These applications produce the data, which has to be transferred
over the network.
➔
This layer serves as a window for application services to access the
network and for displaying the received information to the user.
➔
Ex: Web application, mail application, file transfer application etc
➔
Application Layer is also called as Desktop Layer.
33
Application layer protocols
➔
The application layer contains a variety of protocols that are
commonly needed by users.
➔
One widely used application protocol is HTTP (HyperText
Transfer Protocol), which is the basis for the World Wide Web.
➔
When a browser wants a Web page, it sends the name of the page it
wants to the server hosting the page using HTTP.
➔
The server then sends the page back.
➔
Other application protocols are used for file transfer, electronic
mail, and network news.
34
UGC NET Sept 2013
35
TCP/IP Reference Model
✔
It is the reference model used in the grandparent of all wide area computer
networks, the ARPANET, and its successor, the worldwide Internet.
➔ ARPANET was a research network sponsored by DoD (U.S. Department of Defense).
➔ It eventually connected hundreds of universities and government installations, using
leased telephone lines.
➔ When satellite and radio networks were added later, the existing protocols had trouble
interworking with them, so a new reference architecture was needed.
✔
Thus, from nearly the beginning, the ability to connect multiple networks in a
seamless way was one of the major design goals.
✔
This architecture later became known as the TCP/IP Reference Model, after its
two primary protocols.
✔
It was first described by Cerf and Kahn (1974), and later refined and defined
as a standard in the Internet community (Braden, 1989).
2
The TCP/IP reference model
3
Image from William Stallings, "Data and Computer Communications"
4
Link Layer (Network access layer)
➔
Applications with divergent requirements, ranging from transferring
files to real-time speech transmission, demanded a flexible network
architecture.
➔
All these requirements led to the choice of a packet-switching network
based on a connectionless layer that runs across different networks.
➔
The lowest layer in the model, the link layer describes what links such
as serial lines and classic Ethernet must do to meet the needs of this
connectionless internet layer.
➔
It is not really a layer at all, in the normal sense of the term, but rather
an interface between hosts and transmission links.
➔
Ethernet and 802.11 are examples of link layer protocols.
5
Internet Layer
➔
Internet layer is the linchpin that holds whole architecture together.
➔
It corresponds roughly to the OSI network layer.
➔
Its job is to permit hosts to inject packets into any network and have them travel
independently to the destination (potentially on a different network).
➔They may even arrive in a completely different order than they were sent, in which
case it is the job of higher layers to rearrange them, if in-order delivery is desired.
➔
Note: ‘‘internet’’ is used here in a generic sense, even though it is present in Internet.
➔
The internet layer defines an official packet format and protocol called IP
(Internet Protocol), plus a companion protocol called ICMP (Internet Control
Message Protocol) that helps it function.
➔
The job of the internet layer is to deliver IP packets where they are supposed to go.
➔
Packet routing is clearly a major issue here, as is congestion (though IP has not
proven effective at avoiding congestion).
6
Transport Layer
➔
The layer above the internet layer in the TCP/IP model is now usually called the transport layer.
➔
It is designed to allow peer entities on the source and destination hosts to carry on a
conversation, just as in the OSI transport layer.
➔
Two end-to-end transport protocols have been defined here.
1. TCP (Transmission Control Protocol):
➔It is a reliable connection-oriented protocol that allows a byte stream originating on one machine to be
delivered without error on any other machine in the internet.
➔ It segments the incoming byte stream into discrete messages and passes each one on to internet layer.
➔ At the destination, the receiving TCP process reassembles the received messages into the output stream.
➔ TCP also handles flow control to make sure a fast sender cannot swamp a slow receiver with more messages
than it can handle.
2. UDP (User Datagram Protocol):
➔ It is an unreliable, connectionless protocol for applications that do not want TCP’s sequencing or flow
control and wish to provide their own.
➔It is also widely used for one-shot, client-server-type request-reply queries and applications in which
prompt delivery is more important than accurate delivery, such as transmitting speech or video.
7
Application Layer
➔
The TCP/IP model does not have session or presentation layers.
➔
No need for them was perceived. Instead, applications simply include any session
and presentation functions that they require.
➔
Experience with the OSI model has proven this view correct: these layers are of
little use to most applications.
➔
On top of the transport layer is the application layer.
➔
It contains all the higher-level protocols. The early ones included virtual terminal
(TELNET), file transfer (FTP), and electronic mail (SMTP).
➔
Many other protocols have been added to these over the years. Some important
ones that we may study, include the
➔ Domain Name System (DNS), for mapping host names onto their network addresses,
➔ HTTP, the protocol for fetching pages on the World Wide Web,and
➔ RTP, the protocol for delivering real-time media such as voice or movies.
8
The TCP/IP model with some important protocols
9
OSI Vs TCP/IP reference models
➔
The OSI and TCP/IP reference models have much in common.
➔
Both are based on concept of a stack of independent protocols.
➔
Also, the functionality of the layers is roughly similar.
➔
For example, in both models the layers up through and including
the transport layer are there to provide an end-to-end, network-
independent transport service to processes wishing to communicate.
➔
These layers form the transport provider.
➔
Again in both models, the layers above transport are application-
oriented users of the transport service.
10
OSI Vs TCP/IP – Difference 1
➔
Three concepts are central to the OSI model:
1. Services. 2. Interfaces. 3. Protocols.
➔
OSI model makes the distinction between these three concepts explicit.
➔ Each layer performs some services for the layer above it. The service definition tells what the layer does, it
defines the layer’s semantics.
➔A layer’s interface tells the processes above it how to access it. It specifies what the parameters are and
what results to expect.
➔ Finally, the peer protocols used in a layer are the layer’s own business. It can use any protocols it wants to,
as long as it gets the job done (i.e., provides the offered services). It can also change them at will without
affecting software in higher layers.
➔
The TCP/IP model did not originally clearly distinguish between services, interfaces, and
protocols, although people have tried to retrofit it after the fact to make it more OSI-like.
➔ As a consequence, the protocols in the OSI model are better hidden than in the TCP/IP model and can be
replaced relatively easily as the technology changes.
➔ Being able to make such changes transparently is one of the main purposes of having layered protocols in
the first place.
11
OSI Vs TCP/IP – Difference 2
➔
The OSI reference model was devised before the corresponding
protocols were invented.
➔
This ordering meant that the model was not biased toward one
particular set of protocols, a fact that made it quite general.
➔
With TCP/IP the reverse was true: the protocols came first, and
the model was really just a description of the existing protocols.
➔ There was no problem with protocols fitting the model. They fit perfectly.
➔ The only trouble was that the model did not fit any other protocol stacks.
➔ Thus, it was not especially useful for describing other, non-TCP/IP network.
12
OSI Vs TCP/IP – Difference 3, 4
➔
An obvious difference between the two models is the number of layers: the
OSI model has seven layers and the TCP/IP model has four.
➔
Both have (inter)network, transport, and application layers, but the other
layers are different.
➔
Another difference is about connectionless Vs connection-oriented service.
➔
The OSI model supports both connectionless and connection oriented
communication in the network layer, but only connection-oriented
communication in the transport layer, where it counts (because the transport
service is visible to the users).
➔
The TCP/IP model supports only one mode in the network layer
(connectionless) but both in the transport layer, giving the users a choice.
➔
This choice is especially important for simple request-response protocols
13
UGC NET June 2012
14
UGC NET Dec 2013
15
UGC NET June 2015
16
UGC NET June 2014
Codes:
a b c d e
(A) iv v ii iii i
(B) v iv i ii iii
(C) i iii ii v iv
(D) i ii iv iii v
17
UGC NET June 2013
Codes:
abcd
(A) ii i iv iii
(B) ii iv i iii
(C) ii i iii iv
(D) ii iv iii i
18
UGC NET AUG 2016
19
UGC NET NOV 2017
20
UGC NET JAN 2017
21
UGC NET Dec 2012
22
UGC NET Dec 2012
(A) Framing
(B) Representation of bits
(C) Synchronization of bits
(D) Connection control
23
UGC NET Dec 2008
24
UGC NET June 2012
25
NIELIT 2017 Scientific Assistant A
Which layer connects the network support layers and user support
layers ?
(A) transport layer
(B) network layer
(C) data link layer
(D) session layer
26
GATE CS 2013
27
Solution:-
28
UGC NET June 2012
29
ISRO 2015, UGC NET June 2014
30
Kerala PSC - Polytechnic CS 198/2010,
GATE CS 2008, UGC NET JAN 2017
The maximum size of the data that the application layer can pass on
the TCP layer below is of :
(A) any size
(B) 1500 bytes
(C) 2^16 bytes – size of TCP header- size of IP header
(D) 2^6 K bytes
31
UGC NET Sept 2013
32
UGC NET June 2012
33
UGC NET AUG 2016
34
NIELIT 2016 Mar Scientist C
35
NIELIT 2016 Dec Scientist C
36
NIELIT 2016 Dec Scientist C
37
UGC NET – Dec 2007, Dec 2008
38
UGC NET – Jan 2017
39
UGC NET June 2012
1
UGC NET June 2015
2
NIELIT 2016 Mar Scientist C
Repeaters function in
3
Kerala PSC 20/2013 – HSST 2013
4
Bridged Ethernet
5
Switched Ethernet
A layer 2 switch is an N-port bridge, where N is the number of stations on the LAN
6
Kerala PSC – HSST 348/ 2005
7
Network devices
Network Operating Functionality
Device Layer
Repeater Physical Its job is to regenerate the signal over the same network before
Layer the signal becomes too weak or corrupted so as to extend the
length to which the signal can be transmitted over the same
network.
Hub Physical A hub is basically a multiport repeater. A hub connects multiple
Layer wires coming from different branches, for example, the connector
in star topology which connects different stations.
Bridge Data link A bridge operates at data link layer. A bridge is a repeater, with
Layer add on functionality of filtering content by reading the MAC
addresses of source and destination.
Switch Data link A switch is a multi port bridge with a buffer and a design that can
Layer boost its efficiency (large number of ports imply less traffic) and
performance.
Router Network A router is a device like a switch that routes data packets based
Layer on their IP addresses. 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.
9
Kerala PSC 111/2010 – HSST 2012
10
Kerala PSC 20/2013 – HSST 2013
11
Gateway
➔
Gateway is a network node that interconnects networks with different
network protocol technologies by performing the required protocol
conversions (Gateways, also called protocol converters)
➔
A gateway may contain devices such as protocol translators, rate
converters, signal translators etc as necessary to provide system
interoperability.
➔
Gateways, can operate at any layer of the network model.
➔
The activities of a gateway are more complex than that of the router or
switch as it communicates using more than one protocol.
➔
In the network for an enterprise, a computer server acting as a gateway
node is often also acting as a proxy server and a firewall server.
12
Types of errors
➔
In digital transmission systems, an error occurs when a bit is altered between
transmission and reception; that is, a binary 1 is transmitted and a binary 0 is received,
or a binary 0 is transmitted and a binary 1 is received.
➔
Two general types of errors can occur: single-bit errors and burst errors.
➔
A single-bit error is an isolated error condition that alters one bit but does not affect
nearby bits.
➔
A burst error of length B is a contiguous sequence of B bits in which the first and last
bits and any number of intermediate bits are received in error.
➔
IEEE Std 100 and ITU-T Recommendation, both define an error burst as follows:
➔
“A group of bits in which two successive erroneous bits are always separated by less
than a given number x of correct bits. The last erroneous bit in the burst and the first
erroneous bit in the following burst are accordingly separated by x correct bits or more”
➔ Thus, in an error burst, there is a cluster of bits in which a number of errors occur, although not
necessarily all of the bits in the cluster suffer an error.
➔ Burst errors are more common and more difficult to deal with
➔ The effects of burst errors are greater at higher data rates.
Burst error - example
➔ Pb : Probability that a bit is received in error; also known as the bit error rate (BER)
➔ P1 : Probability that a frame arrives with no bit errors
➔ P2 : Probability that, with an error-detecting algorithm in use, a frame arrives with one or more undetected errors
➔ P3 : Probability that, with an error-detecting algorithm in use, a frame arrives with one or more detected bit errors
but no undetected bit errors
Assuming that Pb is a constant and independent for each bit, we have
➔
➔ P1 = (1 – Pb) ^ F
➔ P2 = 1 – P1
where F is the number of bits per frame.
➔
➔
The probability that a frame arrives with no bit errors decreases when the probability of a single bit
error increases.
➔
Also, the probability that a frame arrives with no bit errors decreases with increasing frame length;
the longer the frame, the more bits it has and the higher the probability that one of these is in error.
Error Detection - Process
Error Detection - Process
➔
For a given frame of bits, additional bits that constitute an error-detecting code are added
by the transmitter. This code is calculated as a function of the other transmitted bits.
➔
Typically, for a data block of k bits, the error-detecting algorithm yields an error-
detecting code of (n - k) bits, where (n - k) < k.
➔
The error-detecting code, also referred to as the check bits, is appended to the data
block to produce a frame of n bits, which is then transmitted.
➔
The receiver separates the incoming frame into the k bits of data and (n - k) bits of the
error-detecting code.
➔
The receiver performs the same error-detecting calculation on the data bits and
compares this value with the value of the incoming error-detecting code.
➔
A detected error occurs if and only if there is a mismatch.
➔
Thus P3 is the probability that a frame contains errors and that the error-detecting
scheme will detect that fact.
➔
P2 is known as the residual error rate and is the probability that an error will be
undetected despite the use of an error-detecting scheme.
Parity Check
➔
The simplest error-detecting scheme is to append a parity bit to
the end of a block of data.
➔
A typical example is character transmission, in which a parity bit is
attached to each 7-bit IRA character.
➔
The value of this bit is selected so that the character has an even
number of 1s (even parity) or an odd number of 1s (odd parity).
➔
The use of the parity bit is not foolproof, as noise impulses are often
long enough to destroy more than one bit, particularly at high data
rates.
Parity Check - example
➔
If the transmitter is transmitting an IRA character G (1110001)
and using odd parity, it will append a 1 and transmit 11110001.
➔
The receiver examines the received character and, if the total
number of 1s is odd, assumes that no error has occurred.
➔
If one bit (or any odd number of bits) is erroneously inverted
during transmission (for example, 11100001), then the receiver will
detect an error.
➔
Note, however, that if two (or any even number) of bits are
inverted due to error, an undetected error occurs.
Cyclic Redundancy Check (CRC)
➔
One of the most common, and one of the most powerful, error-
detecting codes is the cyclic redundancy check (CRC), which can be
described as follows.
➔
Given a k-bit block of bits, or message, the transmitter generates
an (n – k) - bit sequence, known as a frame check sequence (FCS),
such that the resulting frame, consisting of n bits, is exactly
divisible by some predetermined number.
➔
The receiver then divides the incoming frame by that number and, if
there is no remainder, assumes there was no error.
➔
To clarify this concept, the procedure is explained in three
equivalent ways: modulo 2 arithmetic, polynomials, and digital logic.
Modulo 2 Arithmetic
➔
Modulo 2 arithmetic uses binary addition with no carries, which
is just the exclusive-OR (XOR) operation.
➔
Binary subtraction with no carries is also interpreted as the XOR
operation:
➔
For example
CRC – Mathematical Formulation
➔
It can be shown that all of the following errors are not divisible by
a suitably chosen P(X) and hence are detectable:
➔All single-bit errors, if P(X) has more than one nonzero term.
➔All double-bit errors, as long as P(X) is a special type of polynomial, called
a primitive polynomial, with maximum exponent L, and frame length < 2 L – 1.
➔All Burst error of length less than or equal to degree of the polynomial,
affecting an odd number of bits.
➔Any odd number of errors, as long as P(X) contains a factor (X + 1)
➔Burst errors of length greater than the degree of polynomials are detected
with high probability.
Widely used CRC Polynomials
Widely used CRC Polynomials
➔
The CRC-12 system is used for transmission of streams of 6-bit
characters and generates a 12-bit FCS.
➔
Both CRC-16 and CRC-CCITT are popular for 8-bit characters, in
the United States and Europe, resp, and both result in a 16-bit FCS.
➔
CRC-32 is used in IEEE 802 LAN standards; particularly
Ethernet and Token Ring
Kerala PSC – HSST 348/ 2005
CRC is:
15
UGC NET Dec 2004
Making sure that all the data packets of a message are delivered to
the destination is _________ control.
(A) Error
(B) Loss
(C) Sequence
(D) Duplication
16
UGC NET June 2013
18
GATE CSE 2021
19
Solution:-
20
NIELIT 2018
21
Solution:-
Solution:-
Degree of generator polynomial is 5.
Hence, 5 zeroes is appended before
division.
M = 1010001101
Divisor polynomial:
1.x5 +1.x4+0.x3+1.x2+0.x2+1.x0
Divisor polynomial bit= 110101
append 5 zeroes :
M = 101000110100000
22
UGC NET AUG 2016
23
Solution:-
25
Solution:-
Answer: (A)
Explanation:
M = 1010001101
Divisor polynomial: 1.x5 +1.x4+0.x3+1.x2+0.x2+1.x0
Divisor polynomial bit= 110101
Bits to be appended to message= (divisor polynomial bits – 1) = 5
Append 5 zeros to message bits, modified message:
101000110100000
26
UGC NET Dec 2013
27
Solution:-
Ans:- (D)
28
Kerala PSC – HSST 348/ 2005
29
Solution:-
Ans:- (C)
30
GATE-CS-2009
Let G(x) be the generator polynomial used for CRC checking. What
is the condition that should be satisfied by G(x) to detect odd number
of bits in error?
(A) G(x) contains more than two terms
(B) G(x) does not divide 1+x^k, for any k not exceeding the frame
length
(C) 1+x is a factor of G(x)
(D) G(x) has an odd number of terms.
31
UGC NET JAN 2017
32
ISRO 2018
________ can detect burst error of length less than or equal to degree
of the polynomial that affect odd number of bits.
(A) Hamming Code (B) CRC
(C) VRC (D) None of the above
UGC NET Dec 2011/ Dec 2013
Check sum used along with each packet computes the sum of
the data, where data is treated as a sequence of
(A) Integer (B) Character (C) Real numbers (D) Bits
35
Error Correction – why?
➔
Error detection is a useful technique, found in data link control protocols, such as
HDLC, and in transport protocols, such as TCP.
➔
However, correction of errors using an error-detecting code, requires that block of
data be retransmitted.
For wireless applications this approach is inadequate for two reasons.
➔
➔ 1. The bit error rate on a wireless link can be quite high, which would result in a large number of
retransmissions.
➔ 2.In some cases, especially satellite links, the propagation delay is very long compared to the
transmission time of a single frame. The result is a very inefficient system.
➔
The common approach to retransmission is to retransmit the frame in error plus all
subsequent frames. With a long data link, an error in a single frame necessitates
retransmitting many frames.
➔
Instead, it would be desirable to enable the receiver to correct errors in an incoming
transmission on the basis of the bits in that transmission.
Error Correction – why?
➔
Error detection is a useful technique, found in data link control protocols, such as
HDLC, and in transport protocols, such as TCP.
➔
However, correction of errors using an error-detecting code, requires that block of
data be retransmitted.
For wireless applications this approach is inadequate for two reasons.
➔
➔ 1. The bit error rate on a wireless link can be quite high, which would result in a large number of
retransmissions.
➔ 2.In some cases, especially satellite links, the propagation delay is very long compared to the
transmission time of a single frame. The result is a very inefficient system.
➔
The common approach to retransmission is to retransmit the frame in error plus all
subsequent frames. With a long data link, an error in a single frame necessitates
retransmitting many frames.
➔
Instead, it would be desirable to enable the receiver to correct errors in an incoming
transmission on the basis of the bits in that transmission.
Error Correction Process
Error Correction Process
➔
On the transmission end, each k-bit block of data is mapped into an n-bit block (n > k) called a codeword,
using an FEC (forward error correction) encoder.
The codeword is then transmitted.
➔
During transmission, the signal is subject to impairments, which may produce bit errors in the signal.
➔
➔
At the receiver, the incoming signal is demodulated to produce a bit string that is similar to the original
codeword but may contain errors.
This block is passed through an FEC decoder, with one of four possible outcomes:
➔
➔ 1. If there are no bit errors, the input to the FEC decoder is identical to the original codeword, and the decoder produces the
original data block as output.
➔ 2. For certain error patterns, it is possible for the decoder to detect and correct those errors. Thus, even though the incoming
data block differs from the transmitted codeword, the FEC decoder is able to map this block into the original data block.
➔ 3. For certain error patterns, the decoder can detect but not correct the errors. In this case, the decode simply reports an
uncorrectable error.
➔ 4. For certain, typically rare, error patterns, the decoder does not detect that any errors have occurred and maps the incoming
n-bit data block into a k-bit block that differs from the original k-bit block.
In essence, error correction works by adding redundancy to the transmitted message.
➔
➔
The redundancy makes it possible for the receiver to deduce what the original message was, even in the face
of a certain level of error rate.
Block code technique for error correction
Suppose we wish to transmit blocks of data of length k bits.
➔
Instead of transmitting each block as k bits, we map each k-bit sequence into a unique n-bit codeword.
➔
➔
Typically, each valid codeword reproduces the original k data bits and adds to them (n - k) check bits to
form the n-bit codeword.
➔Thus the design of a block code is equivalent to the design of a function of the form vc = f(vd), where vd
is a vector of k data bits and vc is a vector of n codeword bits.
With an (n, k) block code, there are 2k valid codewords out of a total of 2n possible codewords.
➔
➔
The ratio of redundant bits to data bits, (n - k)/k, is called the redundancy of the code, and the ratio of
data bits to total bits, k/n, is called the code rate (or rate).
➔
The code rate is a measure of how much additional bandwidth is required to carry data at the same data
rate as without the code.
➔
For example, a code rate of 1/2 requires double the transmission capacity of an uncoded system to
maintain the same data rate. For example, if the data rate input to the encoder is 1 Mbps, then the output
from the encoder must be at a rate of 2 Mbps to keep up.
Hamming distance
➔
The Hamming distance d(v1, v2) between two n-bit binary
sequences v1 and v2 is the number of bits in which v1 and v2
disagree.
➔
For eg., if v1 = 011011, v2 = 110001 then d(v1, v2) = 3
➔
For a code consisting of the codewords w1, w2, ..., ws, where s
= 2n, the minimum distance dmin of the code is defined as:
Block Code Principles – Example (1/6)
For k = 2 and n = 5, we can make the following assignment:
Block Code Principles – Example (2/6)
➔
Suppose that a codeword block is received with the bit pattern 00100.
➔
This is not a valid codeword, and so the receiver has detected an error.
➔
Can the error be corrected?
➔
We cannot be sure which data block was sent because 1, 2, 3, 4, or even all 5 of the bits that
were transmitted may have been corrupted by noise.
➔
However, notice that it would require only a single bit change to transform the valid codeword
00000 into 00100.
➔
It would take two bit changes to transform 00111 to 00100, three bit changes to transform
11110 to 00100, and it would take four bit changes to transform 11001 into 00100.
➔
Thus, we can deduce that the most likely codeword that was sent was 00000 and that therefore
the desired data block is 00.
➔
This is error correction. In terms of Hamming distances, we have
d(00000, 00100) = 1; d(00111, 00100) = 2;
d(11001, 00100) = 4; d(11110, 00100) = 3.
Block Code Principles – Example (3/6)
➔
Rule: if an invalid codeword is received, then the valid codeword
that is closest to it (minimum distance) is selected.
➔
This will only work if there is a unique valid codeword at a
minimum distance from each invalid codeword.
➔
For our eg., it is not true that for every invalid codeword there is
one and only one valid codeword at a minimum distance.
➔
There are 25 = 32 possible codewords of which 4 are valid, leaving
28 invalid codewords.
➔
For the invalid codewords, we have the observation as given in next
slide:
Block Code Principles – Example (4/6)
Block Code Principles – Example (5/6)
➔
There are eight cases in which an invalid codeword is at a
distance 2 from two different valid codewords.
➔
Thus, if one such invalid codeword is received, an error in 2 bits
could have caused it and the receiver has no way to choose between
the two alternatives. An error is detected but cannot be
corrected.
➔
However, in every case in which a single bit error occurs, the
resulting codeword is of distance 1 from only one valid codeword
and the decision can be made.
➔
This code is therefore capable of correcting all single-bit errors
but cannot correct double bit errors.
Block Code Principles – Example (6/6)
➔
Look at the pairwise distances between valid codewords:
d(00000, 00111) = 3; d(00111, 11001) = 4;
d(00000, 11001) = 3; d(00000, 11110) = 4;
d(00111, 11110) = 3; d(11001, 11110) = 3;
➔
The minimum distance between valid codewords is 3.
➔
Therefore, a single bit error will result in an invalid codeword that is
a distance 1 from the original valid codeword but a distance at least 2
from all other valid codewords.
➔
As a result, the code can always correct a single-bit error.
➔
Note that the code also will always detect a double-bit error.
Block Codes - Observations
➔For a given positive integer t, if a code satisfies dmin ≥ (2t + 1), then the
code can correct all bit errors up to and including errors of t bits.
➔ Another way of putting the relationship between d min and t is to say that
the maximum number of guaranteed correctable errors per codeword
satisfies: t = floor [(dmin – 1) / 2]
➔
Furthermore, if we are concerned only with error detection and not
error correction, then the maximum number of errors, t, that can be
detected satisfies: t = dmin - 1
➔ If dmin errors occur, this could change one valid codeword into another.
➔ Any number of errors less than dmin can not result in another valid
codeword.
Block code design considerations
14
UGC NET- July 2018
15
NIELIT Scientist B 2020
16
NIELIT Scientific Assistant A – 2020 Nov
17
UGC NET – Oct 2020
18
Solution:-
If the code word arrived is 0000000111 then it will try to match with
the closest valid code which is 0000011111 with 2 bit error
This proves if min hamming distance is d (here it i 5) then it can
correct max upto (d-1)/2 bit error
for rest valid codewords no of bits in error are more
Hence Option A is right answer.
19
GATE IT 2007
20
Solution:-
21
GATE-CS-2017 (Set 2)
1
Solution:-
➔
We need to find minimum hamming distance:
00000, 01011, 10101, 11110
➔
For two binary strings, hamming distance is number of ones in XOR of
the two strings.
➔
Hamming distance of first and second is 3, so is for first and third.
Hamming distance of first and fourth is 4.
➔
Hamming distance of second and third is 4, and second and fourth is 3.
➔
Hamming distance of third and fourth is 3.
➔
Thus a code with minimum Hamming distance d between its codewords
can detect at most d-1 errors and can correct ⌊(d-1)/2⌋ errors.(d-1)/2 ⌋ errors. errors.
➔
Here d = 3. So number of errors that can be corrected is 1.
2
ISI 2017 – CS
3
Solution:-
4
Hamming code
➔
Hamming codes can detect up to two-bit errors or correct one-bit
errors without detection of uncorrected errors.
➔
Hamming codes achieve the highest possible rate for codes with their
block length and minimum distance 3.
➔
Richard W. Hamming invented Hamming codes in 1950 as a way of
automatically correcting errors introduced by punched card readers.
➔
In his original paper, Hamming specifically focused on Hamming(7,4)
code which adds three parity bits to four bits of data, which can be
elaborated.
➔
For each integer r ≥ 2 (r : number of check bits or redundant bits) there is
a code with block length n = 2^r − 1 and message length k = 2^r − r − 1.
➔
Hence the rate of Hamming codes is R = k / n = 1 − [r / (2^r − 1)], which
is the highest possible for codes with minimum distance of three.
Hamming code : Redundant bits
➔
Redundant bits are extra binary bits that are generated and added to the
information-carrying bits of data transfer to ensure that no bits were lost
during the data transfer.
➔
The no. of redundant bits can be calculated using the following formula:
2^r ≥ m + r + 1
where, r = redundant bit, m = data bit
➔
Suppose the number of data bits is 7, then the number of redundant bits
can be calculated using:
=> 2^4 ≥ 7 + 4 + 1
Thus, the number of redundant bits= 4
Hamming code : Parity bits
➔
A parity bit is a bit appended to a data of binary bits to ensure that the total number
of 1’s in the data is even or odd.
➔
Parity bits are used for error detection. There are two types of parity bits:
Even parity bit:
➔ In the case of even parity, for a given set of bits, the number of 1’s are counted.
➔ If that count is odd, the parity bit value is set to 1, making the total count of occurrences of 1’s
an even number.
➔ If the total number of 1’s in a given set of bits is already even, the parity bit’s value is 0.
Odd Parity bit:
➔ In the case of odd parity, for a given set of bits, the number of 1’s are counted.
➔ If that count is even, the parity bit value is set to 1, making the total count of occurrences of
1’s an odd number.
➔ If the total number of 1’s in a given set of bits is already odd, the parity bit’s value is 0.
General Algorithm of Hamming code
1. Write the bit positions starting from 1 in binary form (1, 10, 11, 100, etc).
2. All the bit positions that are a power of 2 are marked as parity bits (1, 2, 4, 8, etc).
3. All the other bit positions are marked as data bits.
4. Redundant bits are calculated from parity bits as:
a. Parity bit 1 covers all the bits positions whose binary representation includes a 1 in the least significant
position (1, 3, 5, 7, 9, 11, etc).
b. Parity bit 2 covers all the bits positions whose binary representation includes a 1 in the second position from
the least significant bit (2, 3, 6, 7, 10, 11, etc).
c. Parity bit 4 covers all the bits positions whose binary representation includes a 1 in the third position from
the least significant bit (4–7, 12–15, 20–23, etc).
d. Parity bit 8 covers all the bits positions whose binary representation includes a 1 in the fourth position from
the least significant bit bits (8–15, 24–31, 40–47, etc).
e. In general, each parity bit covers all bits where bitwise AND of parity position and bit position is non-zero.
5. In even parity, set a parity bit to 1 if total number of ones in the positions it checks is odd.
6. Set a parity bit to 0 if the total number of ones in the positions it checks is even.
Redundant bits calculation
Determining the position of redundant bits
➔
These redundancy bits are placed at the positions which correspond to the power of 2.
➔
As in the above example:
➔The number of data bits = 7
➔The number of redundant bits = 4
➔The total number of bits = 11
➔Redundant bits are placed at positions corresponding to power of 2 - 1, 2, 4, 8 etc
Suppose the data to be transmitted is 1011001,
the bits will be placed as follows:
Determining the Parity bits –
R1: bits 1, 3, 5, 7, 9, 11 with even parity
Since the total number of 1’s in all the bit positions corresponding to R1
is an even number the value of R1 (parity bit’s value) = 0.
R2: bits 2,3,6,7,10,11 with even partity
Since the total number of 1’s in all the bit positions corresponding to R2
is odd the value of R2(parity bit’s value)=1.
R4: bits 4, 5, 6, 7 with even parity
Since the total number of 1’s in all the bit positions corresponding to R4
is odd the value of R4(parity bit’s value) = 1.
R8: bit 8,9,10,11 with even parity
Since the total number of 1’s in all the bit positions corresponding to
R8 is an even number the value of R8(parity bit’s value)=0.
Thus, the data transferred is:
Error detection and correction
➔
Suppose in the above example the 6th bit is changed from 0 to 1 during data
transmission, then it gives new parity values in the binary number:
➔
The bits give the binary number as 0110 whose decimal representation is 6.
➔
Thus, bit 6 contains an error. To correct the error 6th bit is changed from 1 to 0.
UGC NET June 2015
How many check bits are required for 16 bit data word to detect 2
bit errors and single bit correction using hamming code?
(A) 5 (B) 6 (C) 7 (D) 8
Solution:-
For each integer r ≥ 2 there is a code with block length n=2^r-1 and
message length k=2^r-r-1; where r is the number of check (redundant)
bits.
In the given question message length = 16 bits (data word)
If check bits, r = 4, maximum message length k=2^4-4-1 = 11
If check bits, r = 5, maximum message length k=2^5-5-1 = 26
Now in the given question message length is 16 bits, where 12 ≤ 16 ≤ 26
Thus no. of check bits = 5 (OR)
The no. of check (redundant) bits can be calculated using the following
formula:
2^r ≥ m + r + 1 where, r = redundant bit, m = data bit
UGC NET Dec 2010
Encoding of data bits 0011 into 7-bit even Parity Hamming Code is
(A) 0011110 (B) 0101110 (C) 0010110 (D) 0011100
Solution:-
bit pattern is D7(0) D6(0) D5(1) P4 D3(1) P2 P1
P1 (check even parity at 1,3,5,7 bit) = 0
P2 (check even parity at 2,3,6,7 bit) = 1
P4 (check even parity at 4,5,6,7 bit) = 1
so final code is 0011110. (option A)
21
GATE CSE 2021 - Set 1
Which one of the following choices gives the correct values of x and y?
(A) x is 0 and y is 0 (B) x is 0 and y is 1
(C) x is 1 and y is 0 (D) x is 1 and y is 1
22
Solution:-
23
Computer Networks – DLL design issues
Data Link Layer (DLL)
●
The data link layer uses the services of the physical layer to send and
receive bits over communication channels.
●
It has a number of functions, including:
1. Providing a well-defined service interface to the network layer.
2. Dealing with transmission errors.
3. Regulating flow of data so that slow receivers are not swamped by fast senders.
●
To accomplish these goals, the data link layer takes the packets it gets from
the network layer and encapsulates them into frames for transmission.
●
Each frame contains a frame header, a payload field for holding the
packet, and a frame trailer.
●
Frame management forms the heart of what the data link layer does.
2
Relationship between packets and frames
3
(a) Virtual communication (b) Actual communication
4
Services Provided to the Network Layer
5
1. Unacknowledged connectionless service
●
Unacknowledged connectionless service consists of having the
source machine send independent frames to the destination machine
without having the destination machine acknowledge them.
●
Ethernet is a good eg. of a DLL that provides this class of service.
●
No logical connection established beforehand or released afterward.
●
If a frame is lost due to noise on the line, no attempt is made to
detect the loss or recover from it in the data link layer.
●
This class of service is appropriate when the error rate is very low,
so recovery is left to higher layers.
●
It is also appropriate for real-time traffic, such as voice, in which
late data are worse than bad data.
6
2. Acknowledged connectionless service
●
The next step up in terms of reliability is acknowledged connectionless service.
●
Here, there are still no logical connections used, but each frame sent is individually acknowledged.
●
In this way, the sender knows whether a frame has arrived correctly or been lost.
●
If it has not arrived within a specified time interval, it can be sent again.
●
This service is useful over unreliable channels, such as wireless systems.
●
802.11 (WiFi) is a good example of this class of service.
●
It is perhaps worth emphasizing that providing acks in the DLL is just an optimization, never a requirement.
●
The network layer can always send a packet and wait for it to be acknowledged by its peer on remote machine.
– If the acknowledgement is not forthcoming before the timer expires, the sender can just send the entire message again.
– The trouble with this strategy is that it can be inefficient.
– Links usually have a strict maximum frame length imposed by the hardware, and known propagation delays.
– The network layer does not know these parameters.
– It might send a large packet that is broken up into, say, 10 frames, of which 2 are lost on average.
– It would then take a very long time for the packet to get through.
– Instead, if individual frames are acknowledged and retransmitted, then errors can be corrected more directly and more
quickly.
●
On reliable channels, such as fiber, the overhead of a heavyweight data link protocol may be unnecessary, but
on (inherently unreliable) wireless channels it is well worth the cost.
7
3. Acknowledged connection-oriented service
●
Here, the source and destination machines establish a connection before any data
transfer.
●
Each frame sent over connection is numbered, and DLL guarantees that each frame
sent is indeed received, exactly once and that all frames are received in the right order.
●
Connection-oriented service thus provides a reliable bit stream to network layer.
●
It is appropriate over long, unreliable links such as a satellite channel or a long-
distance telephone circuit.
●
With acknowledged connectionless service, it is conceivable that lost acks could
cause a frame to be sent and received several times, wasting bandwidth.
●
When connection-oriented service is used, transfers go through three distinct phases.
– In the first phase, the connection is established by having both sides initialize variables and
counters needed to keep track of which frames have been received and which ones have not.
– In the second phase, one or more frames are actually transmitted.
– In the third and final phase, the connection is released, freeing up the variables, buffers, and
other resources used to maintain the connection.
8
Framing
●
To provide service to the network layer, the data link layer must use the service provided to it by
the physical layer.
●
What the physical layer does is accept a raw bit stream and attempt to deliver it to the destination.
●
If the channel is noisy, as it is for most wireless and some wired links, the physical layer will add
some redundancy to its signals to reduce the bit error rate to a tolerable level.
●
However, the bit stream received by the data link layer is not guaranteed to be error free.
●
Some bits may have different values and the number of bits received may be less than, equal to, or
more than the number of bits transmitted.
●
It is up to the data link layer to detect and, if necessary, correct errors.
●
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 ( or CRC remainder) 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).
9
Framing Techniques
●
Breaking up the bit stream into frames is more difficult than
it at first appears.
●
A good design must make it easy for a receiver to find the
start of new frames while using little of the channel
bandwidth.
●
Four such methods proposed in literature are:
1. Byte count.
2. Flag bytes with byte stuffing.
3. Flag bits with bit stuffing.
4. Physical layer coding violations.
10
1. Byte count
●
The first framing method uses a field in the header to specify the number of bytes in the frame.
●
When the data link layer at the destination sees the byte count, it knows how many bytes
follow and hence where the end of the frame is.
●
This technique is shown in the next slide for four small example frames of sizes 5, 5, 8, and 8
bytes, respectively.
●
The trouble with this algorithm is that the count can be garbled by a transmission error.
●
For example, if the byte count of 5 in the second frame of next slide becomes a 7 due to a
single bit flip, the destination will get out of synchronization.
●
It will then be unable to locate the correct start of the next frame.
●
Even if the checksum is incorrect so the destination knows that the frame is bad, it still has no
way of telling where the next frame starts.
●
Sending a frame back to the source asking for a retransmission does not help either, since the
destination does not know how many bytes to skip over to get to the start of the
retransmission.
●
For this reason, the byte count method is rarely used by itself.
11
A byte stream. (a) Without errors. (b) With one error
12
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.
●
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.
●
Thus, a framing flag byte can be distinguished from one in data by absence or presence of an escape byte before it.
●
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 the data?
●
The answer is that, it too, is stuffed with an escape byte. At the receiver, the first escape byte is removed, leaving the
data byte that follows it (which might be another escape byte or the flag byte).
●
We can still search for a frame boundary by looking for two flag bytes in a row, without bothering to undo escapes.
●
The byte-stuffing scheme used in PPP (Point-to-Point Protocol)
13
(a) A frame delimited by flag bytes
(b) Four eg. of byte sequences before and after byte stuffing
14
3. Flag bits with bit stuffing
●
The third method of delimiting the bit stream gets around a disadvantage of byte stuffing, which is that
it is tied to the use of 8-bit bytes.
●
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 (High-level Data Link Control) protocol.
●
Each frame begins and ends with a special bit pattern, 01111110 or 0x7E in hexadecimal.
●
Whenever the sender’s DLL encounters five consecutive 1s in the data, it automatically stuffs a 0 bit
into the outgoing bit stream.
●
USB (Universal Serial Bus) also uses bit stuffing.
●
When the receiver sees five consecutive incoming 1 bits, followed by a 0 bit, it automatically destuffs
(i.e., deletes) the 0 bit.
●
If the user data contain the flag pattern, 01111110, this flag is transmitted as 011111010 but stored in
the receiver’s memory as 01111110.
●
With bit stuffing, boundary between two frames can be unambiguously recognized by the flag pattern.
●
Thus, if the receiver loses track of where it is, all it has to do is scan the input for flag sequences, since
they can only occur at frame boundaries and never within the data.
15
Bit stuffing. (a) The original data. (b) The data as
they appear on the line. (c) The data as they are
stored in the receiver’s memory after destuffing.
16
4. Physical layer coding violations.
●
With both bit and byte stuffing, a side effect is that the length of a frame now depends on the
contents of the data it carries.
●
For instance, if there are no flag bytes in the data, 100 bytes might be carried in a frame of roughly
100 bytes. If, however, the data consists solely of flag bytes, each flag byte will be escaped and the
frame will become roughly 200 bytes long.
●
With bit stuffing, the increase would be roughly 12.5% as 1 bit is added to every byte.
●
The last method of framing is to use a shortcut from the physical layer.
●
The encoding of bits as signals often includes redundancy to help the receiver.
●
This redundancy means that some signals will not occur in regular data.
●
For eg. in 4B/5B line code 4 data bits are mapped to 5 signal bits to ensure sufficient bit transitions.
●
This means that 16 out of the 32 signal possibilities are not used.
●
We can use some reserved signals to indicate the start and end of frames.
●
In effect, we are using ‘‘coding violations’’ to delimit frames.
●
The beauty of this scheme is that, because they are reserved signals, it is easy to find the start and
end of frames and there is no need to stuff the data.
17
Framing in Ethernet and 802.11
●
Many data link protocols use a combination of these
methods for safety.
●
One method used in Ethernet and 802.11 is to have a
frame begin with a well-defined pattern called a preamble.
●
This pattern might be quite long (72 bits typical for 802.11)
to allow the receiver to prepare for an incoming packet.
●
The preamble is then followed by a length (i.e., count)
field in the header that is used to locate the end of frame.
18
Error Control – positive and negative ack
●
Having solved the problem of marking the start and end of each frame, we come to the next
problem: how to make sure all frames are eventually delivered to the network layer at the
destination and in the proper order.
●
Assume for the moment that the receiver can tell whether a frame that it receives contains
correct or faulty information (say using some codes that are used to detect and correct
transmission errors).
●
For unacknowledged connectionless service it might be fine if the sender just kept outputting
frames without regard to whether they were arriving properly.
●
But for reliable, connection-oriented service it would not be fine at all.
●
The usual way to ensure reliable delivery is to provide the sender with some feedback about
what is happening at the other end of the line.
●
Typically, the protocol calls for the receiver to send back special control frames bearing
positive or negative acknowledgements about the incoming frames.
●
If sender receives a positive ack about a frame, it knows the frame has arrived safely, where
a negative ack means that something has gone wrong and frame must be transmitted again.
19
Error Control – timer and sequence number
●
Another issue comes from the possibility that hardware troubles may cause a frame to vanish completely.
●
In this case, the receiver will not react at all, since it has no reason to react.
●
Similarly, if the acknowledgement frame is lost, the sender will not know how to proceed.
●
It should be clear that a protocol in which the sender transmits a frame and then waits for an ack, will hang
forever if a frame is ever lost due to, for example, malfunctioning hardware or a faulty communication channel.
●
This possibility is dealt with by introducing timers into the data link layer.
●
When the sender transmits a frame, it generally also starts a timer.
●
The timer is set to expire after an interval long enough for the frame to reach the destination, be processed
there, and have the acknowledgement propagate back to the sender.
●
Normally, the frame will be correctly received and the acknowledgement will get back before the timer runs out,
in which case the timer will be canceled.
●
However, if either the frame or the ack is lost, the timer will go off, alerting the sender to a potential problem.
●
The obvious solution is to just transmit the frame again.
●
However, when frames may be transmitted multiple times there is a danger that the receiver will accept the
same frame two or more times and pass it to the network layer more than once.
●
To prevent this from happening, it is generally necessary to assign sequence numbers to outgoing frames, so
that the receiver can distinguish retransmissions from originals.
20
Flow Control
●
Another important design issue in the DLL (and higher layers as well) is what to do with a
sender that systematically wants to transmit frames faster than the receiver can accept them.
●
This situation can occur when the sender is running on a fast, powerful computer and the
receiver is running on a slow, low-end machine.
●
A common situation is when a smart phone requests a Web page from a far more powerful
server, which then blasts the data at the poor helpless phone until it is completely swamped.
●
Even if the transmission is error free, the receiver may be unable to handle the frames as fast
as they arrive and will lose some. Clearly, something has to be done to prevent this situation.
●
Two approaches are commonly used. In the first one, 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.
●
In the second one, 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.
●
Feedback-based schemes are seen at both the link layer and higher layers; where rate-
based schemes are only seen as part of the transport layer.
21
A Simplex Stop-and-Wait Protocol for an Error-Free Channel
●
The communication channel is assumed to be error free, and the data traffic is simplex.
●
Here, it will tackle the problem of preventing the sender from flooding the receiver with
frames faster than the latter is able to process them.
●
One solution is to build the receiver to be powerful enough to process a continuous
stream of back-to-back frames – by having sufficient buffering and processing abilities
●
A more general solution to this problem is to let receiver provide feedback to the sender.
●
After having passed a packet to its network layer, the receiver sends a little dummy
frame (i.e., acknowledgement) back to the sender which, in effect, gives the sender
permission to transmit the next frame. (till that sender waits)
●
Protocols in which the sender sends one frame and then waits for an acknowledgement
before proceeding are called stop-and-wait.
●
This protocol entails a strict alternation of flow: first the sender sends a frame, then the
receiver sends ack frame, then the sender sends another frame, then the receiver sends
another ack, and so on.
22
Simple Stop and Wait
Sender:
Rule 1) Send one data packet at a time.
Rule 2) Send next packet only after
receiving acknowledgement for previous.
Receiver:
Rule 1) Send acknowledgement after
receiving and consuming of data packet.
23
Problem 1: Lost Data
24
Problem 2: Lost Acknowledgement
25
Problem 3: Delayed Acknowledgement/Data
26
Stop and Wait ARQ (Automatic Repeat Request)
27
Working of A Simplex Stop-and-Wait Protocol
for a Noisy Channel (Stop and Wait ARQ)
28
A Simplex Stop-and-Wait Protocol for a Noisy Channel
●
After transmitting a frame, the sender starts the timer running.
●
If it was already running, it will be reset to allow another full timer interval.
●
The interval should be chosen to allow enough time for the frame to get to the receiver, for the receiver to process it in
the worst case, and for the acknowledgement frame to propagate back to the sender.
●
When the interval elapsed it is safe to assume that either transmitted frame or its ack has been lost, and to send duplicate.
●
If the timeout interval is set too short, the sender will transmit unnecessary frames.
●
While these extra frames will not affect the correctness of the protocol, they will hurt performance.
●
After transmitting a frame and starting the timer, the sender waits for something exciting to happen.
●
Only three possibilities exist: an ack frame arrives undamaged, a damaged ack frame staggers in, or the timer expires.
●
If a valid acknowledgement comes in, the sender fetches the next packet from its network layer and puts it in the buffer,
overwriting the previous packet. It also advances the sequence number.
●
If a damaged frame arrives or timer expires, neither buffer nor sequence no. is changed so that a duplicate can be sent.
●
In all cases, the contents of the buffer (either the next packet or a duplicate) are then sent.
●
When a valid frame arrives at the receiver, its sequence number is checked to see if it is a duplicate.
●
If not, it is accepted, passed to the network layer, and an acknowledgement is generated.
●
Duplicates and damaged frames are not passed to the network layer, but they do cause the last correctly received frame to
be acknowledged to signal the sender to advance to the next frame or retransmit a damaged frame.
29
Computer Networks – DLL design issues
Practice question
2
Solution
●
Answer would be C.
●
First octet represents Start and Last Octet represent Stop.
●
And both ESC and FLAG will follow a Escape character so as
to not get misinterpreted during communication.
01111110[START] 01000111[A] 11100011[B] 11100000[ESC]
11100000[ESC] 11100000[ESC] 01111110[FLAG] 01111110[STOP]
3
Practice question
Flag: 01111110
Data: 1000111111100111110100011111111111000011111
bit stuff the given data?
4
Solution
●
Flag: 01111110
●
Data: 1000111111100111110100011111111111000011111
●
whenever we encounter 011111(5 ones after a 0) we would
insert 0 in the data after 0111110
●
Note that the last zero above(bold one) is not part of original
data stream.
●
100011111011001111100100011111011111010000111110
5
Practice question
6
Solution:-
●
Flag : 01110
●
Data Frame: 1011101111011111110
●
Data after bit stuffing: 1011010110110011011011010
7
GATE CSE 2014
8
Working of A Simplex Stop-and-Wait Protocol
for a Noisy Channel (Stop and Wait ARQ)
9
Characteristics of Stop and Wait ARQ
●
It is typically used in Connection-oriented communication.
●
It offers error and flow control.
●
It is used in Data Link and Transport Layers.
●
It uses link between sender and receiver as half duplex link.
●
Throughput = 1 Data frame per RTT
●
If Bandwidth*Delay product is very high, then stop and wait protocol is
not so useful.
●
The sender has to keep waiting for acknowledgements before sending the
processed next packet.
●
It is a special category of SWP where its window size is 1
●
Irrespective of number of packets sender is having stop and wait protocol
requires only 2 sequence numbers 0 and 1
10
Useful Terms
●
Frame Transmission Delay (Tt) – Time to transmit the packet
from host to the outgoing link. If B (bps) is the Bandwidth of the
link and L (bits) is the frame length to transmit, then Tt = L/B sec
●
Propagation Delay (Tp): Amount of time taken by a packet to
make a physical journey from one node to another node.
●
Tp = (Distance between nodes) / (Velocity of propagation)
●
RoundTripTime (RTT) = 2* Propagation Delay
●
TimeOut (TO) = 2* RTT
●
Time To Live (TTL) = 2* TimeOut.
(In current network, Maximum TTL is 180 seconds)
11
Efficiency and Throughput
●
Efficiency – It is defined as the ratio of total useful time to the total cycle time of a packet.
●
For Stop and Wait Protocol,
✔
Total cycle time = Tt(data) + Tp(data) + Tqueue + Tproc + Tt(ack) + Tp(ack)
= Tt(data) + Tp(data) + Tp(ack) [neglecting other delays]
= Tt + 2*Tp
✔
Efficiency = Useful Time / Total Cycle Time
= Tt/(Tt + 2*Tp) (For Stop and Wait)
= 1/(1+2a) [ Using a = Tp/Tt ]
✔
Effective Bandwidth(EB) or Throughput – Number of bits sent per second.
✔
EB = Data Size(L) / Total Cycle time(Tt + 2*Tp)
Multiplying and dividing by Bandwidth (B),
= (1/(1+2a)) * B [ Using a = Tp/Tt ]
= Efficiency * Bandwidth
12
Piggybacking
●
In the previous protocols, data frames were transmitted in one direction only.
●
In most practical situations, there is a need to transmit data in both directions.
●
One way of achieving full-duplex data transmission is to run two instances of one of the previous protocols, each using
a separate link for simplex data traffic (in different directions).
●
Each link is then comprised of a ‘‘forward’’ channel (for data) and a ‘‘reverse’’ channel (for acks).
●
In both cases the capacity of the reverse channel is almost entirely wasted.
●
A better idea is to use the same link for data and ack in both directions.
●
Although interleaving data and control frames on the same link is a big improvement over having two separate physical
links, yet another improvement is possible.
●
When a data frame arrives, instead of immediately sending a separate control frame, the receiver restrains itself and waits
until the network layer passes it the next packet.
●
The acknowledgement is attached to the outgoing data frame (using the ack field in the frame header).
●
In effect, the acknowledgement gets a free ride on the next outgoing data frame.
●
The technique of temporarily delaying outgoing acknowledgements so that they can be hooked onto the next outgoing
data frame is known as piggybacking.
●
However, piggybacking introduces a complication not present with separate acknowledgements.
●
How long should the data link layer wait for a packet onto which to piggyback the acknowledgement?
●
If the data link layer waits longer than the sender’s timeout period, the frame will be retransmitted, defeating the whole
purpose of having acknowledgements – instead acks should be send idependently during such long waiting.
13
Practice question
14
Solution:-
15
Practice question
Given:
Bandwidth, B= 64 kbps satellite channel
Frame length L= 512 B
Round Trip Time (RTT) = 64 ms
What is the maximum throughput for window size of
1 (stop and wait ARQ) ?
16
Solution:-
●
Transmission Time, Tt=Length of frame/Bandwidth
●
Tt=512*8/(64*10^3)=64 msec
●
Round Trip Time (2*Tp) = 64 msec
●
Throughput=Efficiency * Bandwidth
●
Efficiency= Tt/(Tt+ 2*Tp)
●
Therefore, Efficency=64/(64+64)=0.5
●
Thus, Throughput=0.5*64 kbps=32 kbps.
17
GATE-CS-2016 (Set 1)
The values of parameters for the Stop-and – Wait ARQ protocol are as
given below.
Bit rate of the transmission channel = 1Mbps
Propagation delay from sender to receiver = 0.75 ms
Time to process a frame = 0.25ms
Number of bytes in the information frame = 1980
Number of bytes in the acknowledge frame = 20
Number of overhead bytes in the information frame = 20
Assume that there are no transmission errors. Then the transmission
efficiency ( expressed in percentage) of the Stop-and – Wait ARQ
protocol for the above parameters is ______( correct to 2 decimal place) .
20
Solution:-
Given,
Number of bytes in the information frame = 1980
Number of bytes in the acknowledge frame = 20
Number of overhead bytes in the information frame = 20
Therefore, useful Data = Total Data – Overhead = 1980 – 20 = 1960
Tt(Data) = (1960*8) / 10^6 = 15.68 millisecond
Tt(ACK) = 20*8 / 10^6 = 0.16 millisecond
Two way round trip time = 2 * Tp = 2*0.75 = 1.5 millisecond
T(process) = 0.25(for info) + 0.25(for ack) = 0.5 millisecond
Efficiency = Useful Time / (Tt(info) + + Tt(ACK) + 2* Tp + Tprocess )
= 15.68 / (15.84 + 0.16 + 2*0.75 + 0.5 )
= 0.8711111
= 87%
21