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

Computer Network

The document provides an introduction to computer networks, defining them as interconnected devices that communicate via various media and protocols. It covers essential networking elements, transmission terminology, modes of transmission, and types of networks such as LAN, MAN, and WAN. Additionally, it discusses the goals and uses of computer networks in business, home, and mobile applications.

Uploaded by

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

Computer Network

The document provides an introduction to computer networks, defining them as interconnected devices that communicate via various media and protocols. It covers essential networking elements, transmission terminology, modes of transmission, and types of networks such as LAN, MAN, and WAN. Additionally, it discusses the goals and uses of computer networks in business, home, and mobile applications.

Uploaded by

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

SUBJECT: 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

• The computer network includes the following networking elements:


1. At least two computers
2. Transmission medium either wired or wireless
3. Protocols or rules that govern the communication
4. Network software such as Network Operating System

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

➢ Data transmission occurs between transmitter and receiver


over some transmission medium.
➢ Transmission media may be classified as guided or unguided.
➢ In both, communication is in the form of electromagnetic
waves.
➢ With guided media, the waves are guided along a physical
path. eg:- twisted pair, coaxial cable, and optical fiber.
➢ Unguided media, also called wireless, provide a means for
transmitting electromagnetic waves but do not guide them.
➢ eg:- are propagation through air, vacuum, and seawater.

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

➢ In simplex transmission mode, the communication between


sender and receiver occurs in only one direction.
➢ The sender can only send the data, and the receiver can only
receive the data. The receiver cannot reply to the sender.
➢ Eg:- keyboard / monitor relationship, the keyboard can only
send the input to the monitor, and the monitor can only receive
the input and display it on the screen. The monitor cannot
reply, or send any feedback, to the keyboard.
➢ The simplex mode can use the entire capacity of the channel to
send data in one direction.

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.

➢ ITU-T: International Telecommunication Union-Telecommunication


➢ ANSI: American National Standards Institute

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

➔ Wired LANs use a range of different transmission technologies.


➔ Most of them use copper wires, but some use optical fiber.
➔ LANs are restricted in size, which means that the worst-case transmission time is bounded and
known in advance. Knowing these bounds helps with the task of designing network protocols.
➔ Typically, wired LANs run at speeds of 100 Mbps to 1 Gbps, have low delay (microseconds or
nanoseconds), and make very few errors. Newer LANs can operate at up to 10 Gbps.
➔ Compared to wireless networks, wired LANs exceed them in all dimensions of performance. It
is just easier to send signals over a wire or through a fiber than through the air.
➔ The topology of many wired LANs is built from point-to-point links.
➔ IEEE 802.3, popularly called Ethernet, is, by far, the most common type of wired LAN.
➔ Each computer speaks the Ethernet protocol and connects to a box called a switch with a
point-to-point link.
➔ A switch has multiple ports, each of which can connect to one computer.
➔ The job of the switch is to relay packets between computers that are attached to it, using the
address in each packet to determine which computer to send it to.

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

BASIS OF COMPARISON LAN MAN WAN

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.

Ownership of Network Private Private or Public Private or Public


Cost Low cost of set-up. Moderate cost of set-up. It costs more to set-up a WAN
than a LAN or a MAN.
Design and maintenance Easy Difficult Difficult
Propagation Delay Short Moderate Long
Speed High (upto 1000 Mbps) Moderate (up to 100 Mbps) Low (10-20 Mbps.)

Fault Tolerance More Tolerant Less Tolerant Less Tolerant


Congestion Less More More
34
Used for College, School, Hospital. Small towns, City. Country/Continent.
INTERNETWORKS

➔ 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:

➔A point to point link that supports data flowing in only one


direction all the time: Simplex
➔A point to point link that supports data flowing in only one direction at
a time: Half duplex
➔A point to point link that supports data flowing in both directions all
the time: Full duplex

37
KERALA PSC – HSST 348/ 2005

• Which among the following is a protocol of Wireless LAN?


• (A) 802.2 (B) 802.3 (C) 802.5 (D)
802.11

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

• A network topology that combines features of linear bus and star


topology:
• (A) Mesh (B) Ring (C) Tree (D) Cube

40
UGC NET JULY 2016

• In a fully-connected mesh network with 10 computers, total


..............number of cables are required and ................ number
of ports are required for each device.

• (A) 40, 9 (B) 45, 10 (C) 45, 9 (D) 50,


10

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.

➢ If we think of the wave as something that can be shifted backward or


forward along the time axis, phase describes the amount of that shift.
➢ It indicates the status of the first cycle.
➢ Phase is measured in degrees or radians [360° is 2π rad]
➢ A phase shift of 360° corresponds to a shift of a complete period;
➢ A phase shift of 180° corresponds to a shift of one-half of a period; and
➢ A phase shift of 90° corresponds to a shift of one-quarter of a period

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

• Qn. The frequency of a wave is 10 Hz. What is its period?


• (A) The period of the wave is 100 s.
• (B) The period of the wave is 10 s.

• (C) The period of the wave is 0.01 s.


• (D) The period of the wave is 0.1 s.

• 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

• Qn. If a periodic signal is decomposed into five sine waves with


frequencies 100, 300, 500, 700, and 900 Hz, what is its bandwidth?
• Ans: Let fh be the highest frequency, fl the lowest frequency, and B
the bandwidth. Then B = fh - ft = 900 - 100 = 800 Hz

• Qn. A periodic signal has a bandwidth of 20 Hz. The highest frequency


is 60 Hz. What is the lowest frequency?
• Ans: Let fh be highest frequency,fl the lowest frequency, and B the
bandwidth. Then B = fh – fl -> 20 = 60 – fl --> fl = 60 - 20 = 40 Hz

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.

• Bandwidth in Bits per Seconds


➔ The term bandwidth can also refer to the number of bits per second that a channel, a link, or even
a network can transmit.
➔ For example, one can say the bandwidth of a Fast Ethernet network (or the links in this network) is
a maximum of 100 Mbps.

• 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.

➢ Latency = propagation time + transmission time


➢ + queuing time + processing delay

59
PROPAGATION TIME

➢ Propagation time measures the time required for a bit to


travel from the source to the destination.
➢ The propagation time is calculated by dividing the distance
by the propagation speed.
➢ Propagation time = Distance / Propagation speed
➢ The propagation speed of electromagnetic signals depends
on the medium and on the frequency of the signal.
➢ For eg., in a vacuum, light is propagated with a speed of
3x10^8 m/s. It is lower in air; it is much lower in cable.

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.

• Solution:- We can calculate the propagation and transmission time as:


• PropagatIon time = 12000 x 1000 / 2.4 x 10 ^ 8 = 50 ms
• Transmission time = (2500 x 8) / (10^9) = 0.020 ms

• 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.

• Solution:- We can calculate the propagation and transmission times as:


• PropagatIon time = 12000 x 1000 / 2.4 x 10 ^ 8 = 50 ms
• Transmission time = (5,000,000 x 8) / (10^6) = 40 s

• 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

• If a file consisting of 50,000 characters takes 40 seconds to send, then the


data rate is ........................
• (1) 1 kbps (2) 1.25 kbps (3) 2 kbps (4) 10 kbps

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 ................

• (A) 16.36 Kbps (B) 1.636 Mbps


• (C) 2.272 Mbps (D) 25.6 Kbps

• Ans: 100*24*80*8/60 bits/sec = 25600 bits/sec = 25.6 Kbps

73
UGC NET SEPT 2013

• A file is downloaded in a home computer using a 56 kbps MODEM


connected to an Internet Service Provider. If the download of file
completes in 2 minutes, what is the maximum size of data downloaded?
• (A) 112 Mbits (B) 6.72 Mbits
• (C) 67.20 Mbits (D) 672 Mbits

• Ans:- 2*60*56*10^3 = 6.72 Mbits

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

• Ans:- (15,000*8,000)/60 bps = 2 Mbps


75
UGC NET JUNE 2013

• An image is 1024∗800 pixels with 3 bytes/pixel. Assume the image is


uncompressed. How long does it take to transmit it over a 10-Mbps
Ethernet?
• (A) 196.6 seconds (B) 19.66 seconds
• (C) 1.966 seconds (D) 0.1966 seconds

• Ans:- (1024*800*3*8)/(10*10^6) = 1.9660800 sec

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

An analog signal carries 4 bits in each signal unit. If 1000 signal


units are sent per second, then baud rate and bit rate of the signal
are _______ and _______.
(A) 4000 bauds \ sec & 1000 bps
(B) 2000 bauds \ sec & 1000 bps
(C) 1000 bauds \ sec & 500 bps
(D) 1000 bauds \ sec & 4000 bps

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

The baud rate of a signal is 600 baud/second. If each signal unit


carries 6 bits, then the bit rate of a signal is ________.
(A) 3600 (B) 100 (C) 6/600 (D) None

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

What is the baud rate of the standard 10 Mbps Ethernet?


(A) 10 mega baud (B) 20 mega baud
(C) 30 mega baud (D) 40 mega baud

Ans:- (B)

30
UGC NET Dec 2013

A client-server system uses a satellite network, with the satellite at a


height of 40,000 kms. What is the best-case delay in response to a
request? (Note that the speed of light in air is 3,00,000 km/second).
(A) 133.33 m sec (B) 266.67 m sec
(C) 400.00 m sec (D) 533.33 m sec

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

How many characters per second (7 bits + 1 parity) can be


transmitted over a 3200 bps line if the transfer is asynchronous?
(Assuming 1 start bit and 1 stop bit)
(A) 300 (B) 320 (C) 360 (D) 400

32
Kerala PSC - Polytechnic CS 198/2010

A 100 km long cable transfer data at T1 data rate. The propagation


delay in the cable is 2/3rd the speed of light. How many bits can
be carried by cable?
(A) 572 (B) 672 (C) 772 (D) 872

33
Solution

Data transfer rate T1 carrier is 1.544 Mbit/s.

Propagation speed in the cable = (2/3)*3*10^8 m/s


= 200,000 km/sec, or 200 km/msec
so a 100-km cable will be filled in 500 μsecsec.

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

➔The T1 carrier (method used in North America and Japan) consists of 24


voice channels multiplexed together.
➔Each of the 24 channels, in turn, gets to insert 8 bits into the output stream.
➔A T1 frame consists of 24 × 8 = 192 bits plus one extra bit for control
purposes, yielding 193 bits every 125 μsecsec.
➔This gives a gross data rate of 1.544 Mbps, of which 8 kbps is for signaling.
➔Outside North America and Japan, the 2.048-Mbps E1 carrier is used
instead of T1. This carrier has 32 8-bit data samples packed into the basic
125-μsecsec frame.

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

A leased special high-speed connection from the local telephone


carrier for business users that transmits at 1.544 mbps is known as
________ carrier.
(A) T1 (B) T2 (C) T3 (D) T4

38
SUBJECT: SIGNAL ENCODING TECHNIQUES

FACULTY NAME: LEKSHMI S


SIGNAL ENCODING TECHNIQUES
SIGNAL ENCODING TECHNIQUES

➢ Digital Data, Digital Signals

➢ Digital Data, Analog Signals

➢ Analog Data, Digital Signals

➢ Analog Data, Analog Signals

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:

➔ Amplitude Shift Keying (ASK),


➔ Frequency Shift Keying (FSK), and
➔ Phase Shift Keying (PSK).

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.

➔ Further, each angle can have more than one amplitude.

➔ 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

• If carrier modulated by a digital bit stream, has one of the


possible phase of 0, 90, 180 and 270 degrees, then
modulation called
• (A) BPSK (B) QPSK (C) QAM
(D) MSK

• Ans:- (B)

11
UGC NET JUNE 2012

• Phase Shift Keying (PSK) Method is used to modulate digital


signal at 9600 bps using 16 levels. Find the modulation rate.
• (A) 2400 bauds (B) 1200 bauds
• (C) 4800 bauds (D) 9600 bauds

• Ans:- (A)

12
UGC NET SEPT 2013

• Which of the following is a bit rate of an 8-PSK signal having 2500 Hz


bandwidth?
• (A) 2500 bps (B) 5000 bps (C) 7500 bps (D) 20000 bps

• 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).

➔ Principal techniques in codec: pulse code modulation, delta modulation.

14
PULSE CODE MODULATION (PCM)

➔ PCM is based on the sampling theorem:

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.

➔ Each sample can then be represented by 4 bits.

➔ From approximated quantized values, it is impossible to recover original signal exactly.

➔ 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.

➔ On reception, process is reversed to reproduce the analog signal.

➔ By quantizing the PAM pulse, the original signal is now only approximated and
cannot be recovered exactly.

➔ This effect is known as quantizing error or quantizing noise.

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.

➔ A 1 is generated if the staircase function is to go up during the next interval; a 0 is generated


otherwise.

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.

➔ δ must be chosen to produce a balance between two types of errors or noise.

➔ When the analog waveform is changing very slowly, there will be quantizing noise.

➔ This noise increases as δ is increased.

➔ On the other hand, when the analog waveform is changing more rapidly than the
staircase can follow, there is slope overload noise.

➔ This noise increases as δ is decreased.

➔ 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.

➔ Principal techniques for modulation using analog data:


➔ Amplitude Modulation (AM)
➔ Frequency Modulation (FM)
➔ Phase Modulation (PM)

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

• (C) Quantization (D) Sampling

• Ans:- Sampling is done prior to quantization, and the question here is


asking to convert analog "sample" into discrete, which means
sampling is already done, so the answer should be (C) Quantization.

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

• (A) (a) and (b)


• (B) (c) and (d)
• (C) (a), (b) and (e)
• (D) None of the above

• 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

• The closeness of the recorded version to the original sound is called

• (A) Fidelity

• (B) Digitization

• (C) Sampling.

• (D) Nyquist Theorem

• 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

• The bandwidth required for the transmission of a pcm signal


increases by a factor of -------- when the number of
quantization levels is increased from 4 to 64.
• (A) 3 times (B) 6 times
• (C) 18 times (D) 24 times

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

• So, increase is 3 times

36
SUBJECT: COMPUTER NETWORK

FACULTY NAME: LEKSHMI


COMPUTER NETWORKS
– CHANNEL CAPACITY THEOREMS
TRANSMISSION IMPAIRMENTS

➢ 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

➢ The mentioned problems of attenuation are dealt with by attention to


signal strength and the use of amplifiers or repeaters.
➢ For a point-to-point link, the signal strength of the transmitter must be
strong enough to be received intelligibly, but not so strong as to
overload the circuitry of the transmitter or receiver, which would cause
distortion.
➢ Beyond a certain distance, the attenuation becomes unacceptably
great, and repeaters or amplifiers are used to boost the signal at
regular intervals.
➢ These problems are more complex for multipoint lines where the
distance from transmitter to receiver is variable.

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

➢ Thermal noise is due to thermal agitation of electrons.


➢ It is present in all electronic devices and transmission media and
is a function of temperature.
➢ It is uniformly distributed across the bandwidths typically used in
communications systems and hence called white noise.
➢ Thermal noise cannot be eliminated and therefore places an
upper bound on communications system performance.

8
THERMAL NOISE FORMULA

• The amount of thermal noise to be found in a bandwidth of 1 Hz in any device or conductor is


• N0 = kT (W/Hz)
• where
• N0 = noise power density in watts per 1 Hz of bandwidth
• k = Boltzmann’s constant = 1.38 * 10 ^ -23 (J/K)
• T = temperature, in kelvins (absolute temperature)

• 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

➢ Types of noise discussed so far have predictable and relatively constant


magnitudes. Thus it is possible to engineer a transmission system to cope with
them.
➢ Impulse noise, however, is noncontinuous, consisting of irregular pulses or
noise spikes of short duration and of relatively high amplitude.
➢ It is generated from a variety of causes, including external electromagnetic
disturbances, such as lightning, and faults and flaws in the communications
system.
➢ Impulse noise is generally only a minor annoyance for analog data with no loss of
intelligibility (say voice communication).
➢ Impulse noise is the primary source of error in digital data communication. For eg.,
a sharp spike of energy of 0.01 s duration would not destroy any voice data but
would wash out about 560 bits of digital data being transmitted at 56 kbps.

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

➢ Communications facilities are expensive and, in general, the greater the


bandwidth of a facility, the greater the cost.
➢ Furthermore, all transmission channels of any practical interest are of
limited bandwidth.
➢ The limitations arise from the physical properties of the transmission
medium or from deliberate limitations at the transmitter on the bandwidth
to prevent interference from other sources.
➢ Accordingly, we would like to make as efficient use as possible of a given
bandwidth.
➢ For digital data, this means that we would like to get as high a data rate
as possible at a particular limit of error rate for a given bandwidth.
➢ The main constraint on achieving this efficiency is noise.

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,

• L - number of signal levels used to represent data,

• BitRate - bit rate in bits per second.

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

➢ Shannon formula represents theoretical maximum that can be achieved.


➢ In practice, however, only much lower rates are achieved.
➢ One reason for this is that the formula assumes white noise (thermal
noise).
➢ Impulse noise is not accounted for, nor are attenuation or delay distortion.
➢ Even in an ideal white noise environment, present technology still cannot
achieve Shannon capacity due to encoding issues, such as coding length
and complexity.

20
KERALA PSC - POLYTECHNIC IT 18/2015

• A Noiseless 3 kHz channel transmits bits with binary


level signals. What is the maximum data rate?

• (A) 3 kbps (B) 6 kbps (C) 12 kbps


(D) 24 kbps

• Ans:- (B)

21
PRACTICE QUESTION

• Consider the noiseless channel with a bandwidth of 4000 Hz transmitting


a signal with four signal levels (for each level, we send 2 bits). Find the
maximum bit rate using Nyquist theorem ?

• Ans:- BitRate = 2 x 4000 X log2 4 = 16,000 bps

22
PRACTICE QUESTION

• We need to send 240 kbps over a noiseless channel with


a bandwidth of 20 kHz. How many signal levels do we
need?

• Solution:- We can use the Nyquist formula as shown:


• 240,000 = 2 X 20,000 X log2 L
• log2 L = 6
• L = 2 ^ 6 = 64 levels

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

• The maximum data rate of a channel of 3000-Hz


bandwidth and SNR of 30 db is
• (A) 60000 (B) 15000 (C) 30000
(D) 3000

• 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

FACULTY NAME: LEKSHMI S


MULTIPLEXING/ DEMULTIPLEXING
MULTIPLEXING
➔ Whenever the bandwidth of a medium linking two devices is greater than the bandwidth needs of the devices, the
link can be shared.

➔ 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.

➔ A common application of multiplexing is in long-haul communications.


➔Trunks on long-haul networks are high-capacity fiber, coaxial, or microwave links.
➔ These links can carry large numbers of voice and data transmissions simultaneously using multiplexing.

3
DIVIDING A LINK INTO CHANNELS

4
DIVIDING A LINK INTO CHANNELS
➔ In a multiplexed system, n lines share the bandwidth of one link.

➔ Figure shows the basic format of a multiplexed system.

➔ 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.

➔ In the figure, the word link refers to the physical path.

➔ The word channel refers to the portion of a link that carries a transmission between a given pair of lines.

➔ One link can have many (n) channels.

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.

➔ Common applications of FDM: AM and FM radio broadcasting, cable television etc.

➔ 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)

➔ FDM is an analog multiplexing technique that combines analog signals.

➔ The composite signal transmitted across the medium is analog.

➔ 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

• Five channels, each with a 100-kHz bandwidth, are to be multiplexed


together. What is the minimum bandwidth of the link if there is a need for
a guard band of 10-kHz between the channels to prevent interference?

• Solution:-

• For five channels, we need at least four guard bands. This means that the
required bandwidth is at least

• 5 x 100 + 4 x 10 = 540 kHz

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.

➔ Combining and splitting of light sources are easily handled by a prism.

➔ 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.

➔ A demultiplexer can also be made to reverse the process.

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.

➔ Instead of sharing a portion of bandwidth as in FDM, time is shared.

➔ Each connection occupies a portion of time in the link.

➔ TDM classification: synchronous and statistical.

➔ 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

➔ Multiple digital signals can be carried on a single transmission path


by interleaving portions of each signal in time.

➔ Interleaving can be at bit level or in blocks of bytes or larger.

➔ For example, the figure in previos slide has six inputs that might each
be, say, 9.6 kbps.

➔ A single line with a capacity of at least 57.6 kbps (plus overhead


capacity) could accommodate all six sources.
➔ Here, the data rate of multiplexed output line must at least equal the
sum of data rates of the input lines.

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.

➔ In byte-interleaving technique, each time slot contains one character of data.

➔ In bit-interleaving technique, each time slot contains just one bit.

➔ 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.

➔ This is, of course, also the case with FDM.

➔ In both cases, capacity is wasted to achieve simplicity of implementation.

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:-

• The multiplexer is shown below

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:-

• The multiplexer is shown below.


25
SUBJECT: COMPUTER NETWORK

FACULTY NAME: LEKSHMI S


MULTIPLEXING/ DEMULTIPLEXING
TDM - DATA RATE MANAGEMENT
➔ One problem with TDM is how to handle a disparity in the input data rates.

➔ 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.

➔ A second level of multiplexing can create an output of 160 kbps.

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.

➔ Therefore, neither of the previous two techniques can be applied.

➔ 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.

➔ This technique is called pulse stuffing/ bit padding, or bit stuffing.

➔ The idea is shown in following figure.

➔ 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.

• Each frame carries 3 bits.

• Frame rate is 100,000 frames per second because it carries 1 bit from the first channel.

• The frame duration is 1/100,000 s, or 10 µs.

• 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.

➔ Synchronization between the multiplexer and demultiplexer is a major issue.

➔ 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

➔ Synchronous TDM is not as efficient as it could be.

➔ If a source does not have data to send or has discontinuous data,


the corresponding slot in the output frame is empty.

➔ This leads to empty frames or frames which are not full.

➔ Statistical TDM can improve the efficiency by removing the


empty slots from the frame.

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.

➔ Address of receiver is to be included in each slot to show where it is to be delivered.

➔ 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

➔ In statistical TDM, the capacity of the link is normally less than


the sum of the capacities of each channel.

➔ The designers of statistical TDM define the capacity of the link


based on the statistics of the load for each channel.

➔ If on average only x percent of the input slots are filled, the


capacity of the link reflects this.

➔ Of course, during peak times, some slots need to wait.

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

• Transmission of N signals, each band limited to fm Hz by FDM, requires a


minimum band-width of

(A) fm (B) 2 fm (C) N fm (D) 2N fm

• 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

• Ans: 4000*8 bps = 32 Kbps


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.

• (c) WDM is a Digital Multiplexing Technique.

• (d) TDM is a Digital Multiplexing Technique.

• Which of the following is correct?

• (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

Mandatory functions Optional functions


➔Error control ➔Encryption/ Decryption
➔Flow control ➔Compression/ Decompression
➔Acccess control ➔Check pointing
➔Congestion control ➔Routing

➔Multiplexing/ Demultiplexing ➔...

➔Addressing

➔...

2
Error control

➢ The computer network has some responsibility like transmission of


data from one device to another device and end to end transfer of
data from a transmitting application to a receiving application
involves many steps, each subject to error.
➢ Data can be corrupted during transmission.
➢ Error must be detected and corrected for reliable communication.
➢ By using the error control process, we can be confident that the
transmitted and received data are identical.
➢ Types of error
➢(a) Single bit error: The terms single bit error means that only one
bit of the data unit was changed from 1 to 0 and 0 to 1.
3
➢ (b) Burst Error: The term burst error means that two or more bits
Error Detection and Correction

➔One mechanism for finding errors in received information uses


codes for error detection. Eg:- CRC, Checksum
➔Information that is incorrectly received can then be retransmitted
until it is received correctly.
➔More powerful codes allow for error correction, where the correct
message is recovered from the possibly incorrect bits that were
originally received. Eg:- Hamming Code
➔ Both of these mechanisms work by adding redundant information.
➔ They are used at low layers, to protect packets sent over individual
links, and high layers, to check that the right contents were received.

4
Flow control

➢When information is sent from one host to another over a single


medium, it is required that the sender and receiver should work at the
same speed.
➢That is, the sender sends at a speed on which the receiver can
process and accept the data.
➢If the sender is sending too fast the receiver may be overloaded and
data may be lost.
➢ Solution1: buffering
➢ Solution2: Feedback from receiver to sender (Acknowledgement)
➢ Techniques: Sliding window protocols (ARQ techniques)
5
Media access control

➔A media access control is a network data transfer policy that


determines how data is transmitted between two computer terminals
through a network cable.
➔The media access control policy involves sub-layers of the data link
layer (layer 2) in the OSI reference model.
➔The essence of the MAC protocol is to ensure non-collision and
eases the transfer of data packets between two computer terminals.
➔A collision takes place when two or more terminals transmit
data/information simultaneously.
➔This leads to a breakdown of communication, which can prove
costly for organizations that lean heavily on data transmission.
6
➔ Media Access Control Methods: Aloha protocols, Carrier sense
Access control

➔Network access control is a method of enhancing the security of a


private organizational network by restricting the availability of
network resources to endpoint devices that comply with the
organization’s security policy.
➔The network access control scheme comprises of two major
components such as Restricted Access and Network Boundary
Protection.

7
Congestion

➔Sometimes the problem is that the network is oversubscribed


because too many computers want to send too much traffic, and the
network cannot deliver it all.
➔ This overloading of the network is called congestion.
➔Solutions: Traffic shaping techniques – leaky bucket, token bucket,
explicit congestion notification – ICMP source quench packet,
TCP’s Additive Increase Multiplicative Decrease algorithm...

8
Multiplexing and Demultiplexing

➢ A multiplexing is a technique by which different analog and digital


streams of transmission can be simultaneously processed over a
shared link.
➢ Multiplexing divides the high capacity medium into low capacity
logical medium which is then shared by different streams.
➢ Frequency Division Multiplexing (FDM)
➢ Time Division Multiplexing (TDM)
➢ Many designs share network bandwidth dynamically, according to
the short term needs of hosts, rather than by giving each host a fixed
fraction of the bandwidth that it may or may not use.
➢This design is called statistical multiplexing, meaning sharing
9
based on the statistics of demand.
Addressing

➔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

➔ Reliability issue of finding a working path through a network.


➔There are multiple paths between a source and destination, and in a
large network, there may be some links or routers that are broken.
➔Suppose that the network is down in Germany. Packets sent from
London to Rome via Germany will not get through, but we could
instead send packets from London to Rome via Paris.
➔ The network should automatically make this routing decision.
➔ Routing Vs Switching : Routing Vs Forwarding
➔ Why routing is treated as an optional functionality ?

11
Internetworking

➔An aspect of growth is that different network technologies often


have different limitations.
➔For example, not all communication channels preserve the order of
messages sent on them, leading to solutions that number messages.
➔Another example is differences in the maximum size of a message
that the networks can transmit.
➔This leads to mechanisms for disassembling, transmitting, and then
reassembling messages.
➔ This overall topic is called internetworking.

12
Quality of service

➔It is interesting to observe that the network has more resources to


offer than simply bandwidth.
➔For uses such as carrying live video, the timeliness of delivery
matters a great deal.
➔Most networks must provide service to applications that want this
real-time delivery at the same time that they provide service to
applications that want high throughput.
➔Quality of service is the name given to mechanisms that reconcile
these competing demands.

13
Security

➔The last major design issue is to secure the network by defending it


against different kinds of threats.
➔ One such threat is that of eavesdropping on communications.
➔ Mechanisms that provide confidentiality defend against this threat,
and they are used in multiple layers.
➔ Authentication prevent someone from impersonating someone
else.
➔ It can be used to find fake banking sites from real one, or to let
cellular network check that a call is really coming from your phone
when you pay bill.
➔ Other mechanisms for integrity prevent surreptitious changes to
14
messages, such as altering ‘‘debit my account $10’’ to ‘‘debit my
Encryption and decryption

➢ Encryption and Decryption - security method in which information


is encoded in such a way that only authorized user can read it.
➢ These encryption algorithms generate ciphertext that can only be
read if decrypted.
➢ Types of encryption
(a) Symmetric Key encryption
(b) Public Key encryption

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

➔ Checkpointing is a technique that provides fault tolerance for


computing systems.
➔ It basically consists of saving a snapshot of the application's state,
so that applications can restart from that point in case of failure.

17
ISRO CS 2011

The encoding technique used to transmit the signal in giga ethernet


technology over fiber optic medium is
(A) Differential Manchester encoding
(B) Non return to zero
(C) 4B/5B encoding
(D) 8B/10B encoding

Ans:- (D)

18
Encoding Techniques

Type of LAN IEEE Speed Encoding Technique


standard
Traditional/ classic IEEE 802.3 10 Mbps Manchester Encoding
ethernet
Fast Ethernet IEEE 802.3u 100 Mbps 4B/5B encoding
Gigabit ethernet IEEE 802.3z 1000 Mbps = 1 8B/ 10B encoding
Gbps
10 - Gigabit ethernet IEEE 802.3ae 10 Gbps 64B/66B encoding

Token Ring IEEE 802.5 4 – 16 Mbps, Differential Manchester


1000 Mbps encoding

19
Kerala PSC 002/2012 – Lecturer, CS 2015

The network topology that supports bidirectional links between


each possible node is
(A) Ring (B) Star (C) Tree (D) Mesh

Ans:- D

20
Kerala PSC 111/2010 – HSST 2011

The percentage of time that a computer system is not available


for use is:
(A) down time
(B) seek time
(C) delay time
(D) access time

Ans:- (A)

21
Downtime

➢ The term downtime is used to refer to periods when a system is


unavailable.
➢ Downtime or outage duration refers to a period of time that a
system fails to provide or perform its primary function.
➢ The unavailability is the proportion of a time-span that a system
is unavailable or offline. This is usually a result of the system
failing to function because of an unplanned event, or because of
routine maintenance (a planned event).
➢ The term is commonly applied to networks and servers. The
common reasons for unplanned outages are system failures
(such as a crash) or communications failures (commonly known
22
as network outage).
Kerala PSC 12 / 2014

MAN refers to:


(A) Mega Area (B) Metropolitan Area
Network
(C) Mini Area Network (D) Medium Area Network

Ans: (B)

23
Kerala PSC 12 / 2014

Which of the following is not a type of Computer Network?


(A) Local Area Network (B) Personal Area
Network
(C) Remote Area Network (D) Metropolitan Area
Network

Ans: (C)

24
Kerala PSC 70 / 2014

Which is not a network?


(A) Internet (B) Intranet (C) Telnet
(D) Extranet

Ans: (C)

25
Kerala PSC 207/2013 – Computer
Programmer, DTE 2015

In .................. topology, whole network goes down, if a


computer’s network cable is broken.
(A) Ring (B) Star
(C) Bus (D) Token ring

Ans:- (C)

26
Kerala PSC 207/2013 – Comp
Programmer, DTE 2015

ARPANET stands for:


(A) American Research Project Agency Network
(B) Asian Research Project Agency Network
(C) Ad-hoc Research Project Agency Network
(D) Advanced Research Project Agency Network

Ans:- D

27
Kerala PSC 12 / 2014

Collection of interconnected networks sometimes called:


(A) Internet (C) Mobile Network
(B) Wireless Network (D) None of these

Ans: (A)

28
Computer Networks
– Layered architectute (Part 2)
Design Issues for the Layers

Error Control – Error Detection and Correction


Routing, internetworking

Addressing or naming

Scalability

Statistical Multiplexing

Flow Control

Congestion Control

Media Access Control


Real time service - Quality of service


Security – confidentiality, authentication, integrity


2
Why layering ?

1. Divide and conquer approach of design


2. Abstraction
3. Encapsulation
4. Easy debugging/ testing

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

1. A layer should be created where a different abstraction is needed.


2. Each layer should perform a well-defined function.
3. The function of each layer should be chosen with an eye toward
defining internationally standardized protocols.
4. The layer boundaries should be chosen to minimize the
information flow across the interfaces.
5. The number of layers should be large enough that distinct
functions need not be thrown together in the same layer out of
necessity and small enough that the architecture does not become
unwieldy.

15
Functionality of Computer Network

Mandatory functions Optional functions


➔Error control ➔ Routing
➔Flow control ➔Internetworking – ordering,
➔Acccess fragmentation ans reassesmbly
control
➔Congestion
➔ Quality of service
control
➔Multiplexing/
➔ Security - Encryption/ Decryption
Demultiplexing
➔Compression/ Decompression
➔Addressing
➔Check pointing
...

...

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

Bit synchronization: The physical layer provides the synchronization


of the bits by providing a clock. This clock controls both sender and
receiver thus providing synchronization at bit level.
Bit rate control: The Physical layer also defines the transmission rate
i.e. the number of bits sent per second.
Physical topologies: Physical layer specifies the way in which the
different, devices/nodes are arranged in a network i.e. bus, star or mesh
topolgy.
Transmission mode: Physical layer also defines the way in which the
data flows between the two connected devices. The various
transmission modes possible are: Simplex, half-duplex and full-duplex.

20
Note:-

* Hub, Repeater, Modem, Cables are Physical Layer devices.


* Network Layer, Data Link Layer and Physical Layer are also
known as Lower Layers or Hardware Layers.
* Physical Layer PDU – bits
* Signal Encoding/ Decoding done at - Physical Layer

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:-

* Packet in Data Link layer is referred as Frame – (PDU of layer2).


* Data Link layer is handled by the NIC (Network Interface Card)
and device drivers of host machines.
* Switch & Bridge are Data Link Layer devices.
* DLL addressing – MAC address
* Popular Protocols - ARQ SWP, CSMA/ CD

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:

* Network layer PDU - Packet.


* Network layer devices – Layer 3 switch / Router.
* Network layer protocols – IP, ICMP, IGMP, DHCP, Routing
Protocols: RIP, OSPF
* Network layer functions – Routing, Logical Addressing,
Congestion Control, Fragmenttion and Reassembly, QoS
* In broadcast networks, the routing problem is simple, so network
layer is often thin or even nonexistent.

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

Connection Oriented Service:


➔ It is a three-phase process which include: Connection Establishment Phase,
Data Transfer Phase and Termination / disconnection Phase
➔ In this type of transmission, the receiving device sends an acknowledgement,
back to the source after a packet or group of packet is received.
➔ This type of transmission is reliable and secure.
Connection less service:
➔ It is a one-phase process and includes Data Transfer.
➔ In this type of transmission, receiver does not acknowledge receipt of a packet.
➔ This approach allows for much faster communication between devices.
➔ Connection-oriented service is more reliable than connectionless Service.

28
Note:

* Data in the Transport Layer is called as Segments (TPDU).


* Transport Layer is called as Heart of OSI model, and is the thick
layer packed with maximum functionalities.
* Transport Layer protocols – TCP, UDP
* Transport Layer functionalities: Providing end-to-end or process-
to-process communication, Segmentation and Reassembly, Service
Point Addressing or port address, ordering, reliable communication,
end-to-end flow control, error control, congestion control etc

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

Suppose a file of 10,000 characters is to be sent over a line at


2400 bps. Assume that the data is sent in frames. Each frame
consists of 1000 characters and an overhead of 48 bits per frame.
Using synchronous transmission, the total overhead time is
______.
(A) 0.05 second (B) 0.1 second
(C) 0.2 second (D) 2.0 second

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

Decryption and encryption of data are responsibility of which of the


following layer?

(A) Physical layer


(B) Data link layer
(C) Presentation layer
(D) Session layer

14
UGC NET Dec 2013

Encryption and Decryption is the responsibility of _______ Layer.


(A) Physical (B) Network (C) Application (D) Data link

15
UGC NET June 2015

Which of the following is not associated with the session layer?


(A) Dialog control
(B) Token management
(C) Semantics of the information transmitted
(D) Synchronization

16
UGC NET June 2014

Match the following:


List – I List - II
a. Physical Layer i. Allow users to network access
b. Datalink Layer ii. Move packets from one destination to other
c. Network Layer iii. Process to process message delivery
d. Transport Layer iv. Transmission of bit stream
e. Application Layer v. Formation of frames

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

Match the following :


a. Data link layer i. Flow control
b. Network layer ii. Node to node delivery
c. Transport layer iii. Mail services
d. Application layer iv. Routing

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

Match the following:


List – I List – II
a. Session layer i. User interface
b. Application layer ii. Semantics of the information transmitted
c. Presentation layer iii. Flow control
d. Transport layer iv. Manage dialogue control
Codes :
a b c d
(A) iv i ii iii
(B) i iv ii iii
(C) iv i iii ii
(D) iv ii i iii

19
UGC NET NOV 2017

Match the following:


List - I
(a) Data link layer
(b) Network layer
(c) Transport layer
(d) Presentation layer
List - II
(i) Encryption
(ii) Connection control
(iii) Routing
(iv) Framing
Codes:
(a) (b) (c) (d)
(1) (iv) (iii) (i) (ii)
(2) (iii) (iv) (ii) (i)
(3) (iv) (ii) (iii) (i)
(4) (iv) (iii) (ii) (i)

20
UGC NET JAN 2017

Match the following Layers and Protocols for a user browsing in


internet :
a. Application of layer i. TCP
b. Transport layer ii. IP
c. Network layer iii. PPP
d. Datalink layer iv. HTTP
Codes:
a b c d
(1) iv i ii iii
(2) iii ii i iv
(3) ii iii iv i
(4) iii i iv ii

21
UGC NET Dec 2012

Match the following:


List – I List – II
a. Application layer 1. TCP
b. Transport layer 2. HDLC
c. Network layer 3. HTTP
d. Data link layer 4. BGP
Codes:
abcd
(A) 2143
(B) 3412
(C) 3142
(D) 2413

22
UGC NET Dec 2012

The design issue of Datalink layer in OSI Reference Model is

(A) Framing
(B) Representation of bits
(C) Synchronization of bits
(D) Connection control

23
UGC NET Dec 2008

Congestion control is done by:


(A) Network layer
(B) Physical layer
(C) Presentation layer
(D) Application layer

24
UGC NET June 2012

Which layer of OSI reference model uses the ICMP (Internet


Control Message Protocol)?
(A) Transport layer (B) Data link layer
(C) Network layer (D) Application layer

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

Assume that source S and destination D are connected through two


intermediate routers labeled R. Determine how many times each
packet has to visit the network layer and the data link layer during a
transmission from S to D.
(A) Network layer – 4 times and Data link layer – 4 times
(B) Network layer – 4 times and Data link layer – 3 times
(C) Network layer – 4 times and Data link layer – 6 times
(D) Network layer – 2 times and Data link layer – 6 times

27
Solution:-

28
UGC NET June 2012

Both hosts and routers use TCP/IP protocol software. However,


routers do not use protocol from all layers. The layer for which the
protocol software is not needed by a router is
(A) Layer – 5 (Application)
(B) Layer – 1 (Physical)
(C) Layer – 3 (Internet)
(D) Layer – 2 (Data Link)

29
ISRO 2015, UGC NET June 2014

Which layers of the OSI reference model are host-to-host layers?


(A) Transport, session, presentation, application
(B) Session, presentation, application
(C) Datalink, transport, presentation, application
(D) Physical, datalink, network, transport

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

What is the maximum length of CAT-5 UTP cable in Fast Ethernet


network?
(A) 100 meters (B) 200 meters
(C) 1000 meters (D) 2000 meters

32
UGC NET June 2012

The station to hub distance in which it is 2000 meters.


(A) 100 Base-Tx (B) 100 Base-Fx
(C) 100 Base-T4 (D) 100 Base-T1

33
UGC NET AUG 2016

In a fast Ethernet cabling, 100 Base-TX uses ...........cable and


maximum segment size is ............
(A) twisted pair, 100 metres (B) twisted pair, 200 metres
(C) fibre optics, 1000 metres (D) fibre optics, 2000 metres

34
NIELIT 2016 Mar Scientist C

In networking terminology UTP means


(A) Unshielded Twisted pair
(B) Ubiquitious Teflon port
(C) Uniformly Terminating port
(D) Unshielded T- connector port

35
NIELIT 2016 Dec Scientist C

Three or more devices share a link in ________ connection


(A) Unipoint
(B) Polarpoint
(C) Point to point
(D) Multipoint

36
NIELIT 2016 Dec Scientist C

Which protocol finds the MAC address from IP address?


(A) SMTP
(B) ICMP
(C) ARP
(D) RARP

37
UGC NET – Dec 2007, Dec 2008

In a broadcast network, a layer that is often thin or non-existent is :


(A) network layer
(B) transport layer
(C) presentation layer
(D) application layer

38
UGC NET – Jan 2017

In a packet switching network, if the message size is 48 bytes and


each packet contains a header of 3 bytes. If 24 packets are required
to transmit the message, the packet size is
(A) 2 bytes
(B) 1 byte
(C) 4 bytes
(D) 5 bytes

39
UGC NET June 2012

X.25 is ________ Network.


(A) Connection Oriented Network
(B) Connection Less Network
(C) Either Connection Oriented or Connection Less
(D) Neither Connection Oriented nor Connection Less

1
UGC NET June 2015

Which transmission technique guarantees that data packets will be


received by the receiver in the same order in which they were sent
by the sender?

(A) Broadcasting (B) Unicasting


(C) Packet Switching (D) Circuit Switching

2
NIELIT 2016 Mar Scientist C

Repeaters function in

(A) Physical layer


(B) Data link layer
(C) Network layer
(D) Both (A) and (B)

3
Kerala PSC 20/2013 – HSST 2013

The device that is used to forward data packets from one


network to another is called a .....................
(A) Bridge (B) Hub (C) Switch (D) Gateway

4
Bridged Ethernet

Without bridging, 12 stations contend for access to the medium; with


bridging only 3 stations contend for access to the medium.

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

Which among the following devices interconnects networks


and operate at the application layer?
(A) bridge (B) hub (C) router (D) gateway

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.

Gateways Application A gateway, as the name suggests, is a passage to connect two


8 Layer network together that may work upon different networking
(all layers) models / protocol stacks / technologies.
Points to remember

Repeaters do not amplify the signal. When the signal becomes weak, they copy the signal bit by bit
and regenerate it at the original strength. It is a 2 port device.

Hubs cannot filter data, so data packets are sent to all connected devices. In other words, collision
domain of all hosts connected through Hub remains one.

Bridge is used for interconnecting LANs segments of same protocol (or dividing a larger LAN into
smaller segments). It typically has 2 ports, i.e. a single input and single output port, somestimes 4
ports bridge connecting 4 LAN segments.

A layer 2 switch is an N-port bridge, where N is the number of stations on the LAN.

Switch/Bridge can selectively forward the frames using the MAC address to correct outgoing port. In
other words, they divides collision domain of hosts, but broadcast domain remains same.

Store and forward switch can perform error checking before forwarding data, that makes it very
efficient as it does not forward packets that have errors. Cut throgh switching is a faster forwarding
option.

Router divide broadcast domains of hosts connected through it. They basically works as the
messenger agents that take data from one system, interpret it, and transfer it to another system.

A gateway is normally a computer that operates in all layers of the network model. A gateway takes an
application message, reads it, and interprets it. This means that it can be used as a connecting device
between two internetworks that use different network models.

9
Kerala PSC 111/2010 – HSST 2012

A networking device used to connect similar types of LANs.


(A) Bridge (B) Repeater (C) Hub (D) Modem

10
Kerala PSC 20/2013 – HSST 2013

Among the following, which one is used to connect two


systems, specifically if the systems use different protocols.
(A) hub (B) bridge (C) gateway (D) repeater

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

Burst errors can be caused by impulse noise.


Another cause is fading in a mobile wireless environment


An impulse noise event or a fading event of 1 µs occurs.


At a data rate of 10 Mbps, there is an error burst of 10 bits.


At a data rate of 100 Mbps, there is an error burst of 100 bits.



Probabilities with respect to errors
in transmitted frames
The following probabilities are defined with respect to errors in transmitted frames:

➔ 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

T = n-bit frame to be transmitted


D = k-bit block of data, or message, the first k bits of T
F = (n - k)-bit FCS, the last (n - k) bits of T
P = pattern of n - k + 1 bits; this is the predetermined divisor
We would like T/P to have no remainder. It should be clear that
T = 2n - k D + F

That is, by multiplying D by 2n - k, we have in effect shifted it to the


left by (n - k) bits and padded out the result with zeroes.
Adding F yields the concatenation of D and F, which is T.
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

T = n-bit frame to be transmitted


D = k-bit block of data, or message, the first k bits of T
F = (n - k)-bit FCS, the last (n - k) bits of T
P = pattern of n - k + 1 bits; this is the predetermined divisor
We would like T/P to have no remainder. It should be clear that
T = 2n - k D + F

That is, by multiplying D by 2n - k, we have in effect shifted it to the


left by (n - k) bits and padded out the result with zeroes.
Adding F yields the concatenation of D and F, which is T.
CRC – Mathematical Formulation
We want T = 2n - k D + F to be exactly divisible by P.
Suppose that we divide 2n - k D by P:
(2n - k D) / P = Q + R/P .............................(1)
There is a quotient and a remainder.
Because division is modulo 2, the remainder is always at least one
bit shorter than the divisor.
We will use this remainder as our FCS. Then,
T=2 n-k D+R
CRC – Mathematical Formulation
Does this R satisfy our condition that T/P have no remainder?
To see that it does, Consider
T = (2n - k D + R) / P = (2n - k D ) / P + R / P
Substituting Equation (1), we have
T = Q + R/P + R/P
However, any binary number added to itself modulo 2 yields zero. Thus
T = Q + (R + R) / P = Q
There is no remainder, and therefore T is exactly divisible by P.
Thus, the FCS is easily generated: Simply divide 2 n - k D by P and use the (n -
k)-bit remainder as the FCS.
On reception, the receiver will divide T by P and will get no remainder if there
have been no errors.
CRC – Example (1/3)
CRC – Example (2/3)
CRC – Example (3/3)
CRC - Polynomials

A second way of viewing the CRC process is to express all values as
polynomials in a dummy variable X, with binary coefficients.

The coefficients correspond to the bits in the binary number.

Thus, for D = 110011, we have D(X) = X5 + X4 + X + 1, and for P = 11001, we
have P(X) = X4 + X3 + 1.

Arithmetic operations are again modulo 2.

The CRC process can now be described as:
CRC arithmatic using CRC polynomals
– Example (1/2)

Using the preceding example, for D = 1010001101, we have D(X)
= X9 + X7 + X3 + X2 + 1, and

for P = 110101, we have P(X) = X5 + X4 + X2 + 1.

We should end up with R = 01110, which corresponds to R(X)= X 3
+ X2 + X.

Figure in next slide shows the polynomial division that corresponds
to the binary division in the preceding example.
CRC arithmatic using CRC polynomals –
Example (2/2)
CRC performance


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:

(A) an error detection code


(B) an error correction code
(C) an error detection and correction code
(D) none of these

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

Given code word 1110001010 is to be transmitted with even parity


check bit. The encoded word to be transmitted for this code is
(A) 11100010101 (B) 11100010100
(C) 1110001010 (D) 111000101
UGC NET Sept 2013

If the data unit is 111111 and the divisor is 1010. In CRC


method, what is the dividend at the transmission before
division?
(A) 1111110000 (B) 1111111010
(C) 111111000 (D) 111111

18
GATE CSE 2021

Consider the cyclic redundancy check (CRC) based error detecting


scheme having the generator polynomial X 3+X+1. Suppose the
message m4m3m2m1m0=11000 is to be transmitted. Check bits
c2c1c0 are appended at the end of the message by the transmitter
using the above CRC scheme. The transmitted bit string is denoted
by m4m3m2m1m0c2c1c0. The value of the checkbit sequence
c2c1c0 is
(A) 101 (B) 110 (C) 100 (D) 111

19
Solution:-

20
NIELIT 2018

Given message M=1010001101. The CRC for this given message


using the divisor polynomial x5+x4+x2+1 is ______
(A) 01011 (B) 10101 (C) 01110 (D) 10110

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

In CRC checksum method, assume that given frame for


transmission is 1101011011 and the generator polynomial is
G(x) = x4 + x + 1. After implementing CRC encoder, the
encoded word sent from sender side is .............
(A) 11010110111110 (B) 11101101011011
(C) 110101111100111 (D) 110101111001111

23
Solution:-

Generator x 4 + x+ 1 can be written as 10011

Append remainder 1110 to the actual word.


Encoded word will be (A) 11010110111110
24
Gate IT 2005

Consider the following message M = 1010001101. The cyclic


redundancy check (CRC) for this message using the divisor
polynomial x5 + x4 + x2 + 1 is :
(A) 01110 (B) 01011 (C) 10101 (D) 10110

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

The message 11001001 is to be transmitted using the CRC


polynomial x3 + 1 to protect it from errors. The message that should
be transmitted is
(A) 110010011001 (B) 11001001
(C) 110010011001001 (D) 11001001011

27
Solution:-

Ans:- (D)

28
Kerala PSC – HSST 348/ 2005

The polynomial used by CRC – 16 standard for generating the


checksum is:
(A) x16+ x12+ x5+1 (B) x15+ x12+ x6+1
(C) x16+ x15+ x2+1 (D) x12+ x6+ x5+1

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

Let G(x) be generator polynomial used for CRC checking. The


condition that should be satisfied by G(x) to detect odd
numbered error bits, will be:
(1) (1+x) is factor of G(x) (2) (1-x) is factor of G(x)
(3) (1+x2) is factor of G(x) (4) x is factor of G(x)

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

Start and stop bits are used in serial communications for


(A) Error detection (B) Error correction
(C) Synchronization (D) Slowing down the communication
UGC NET June 2012

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.

An (n, k) block code encodes k data bits into n-bit codewords.



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

1. For given values of n and k, we would like the largest possible


value of dmin .
2. The code should be relatively easy to encode and decode,
requiring minimal memory and processing time.
3. We would like the number of extra bits, (n - k), to be small, to
reduce bandwidth.
4. We would like the number of extra bits, (n - k), to be large, to
reduce error rate.
Clearly, the last two objectives are in conflict, and tradeoffs must be
made.
UGC NET June 2013

Hamming distance between 100101000110 and 110111101101 is


(A) 3 (B) 4 (C) 5 (D) 6

14
UGC NET- July 2018

To guarantee correction of upto t errors, the minimum Hamming


distance dmin in a block code must be ______
(A) t+1 (B) t−2 (C) 2t−1 (D) 2t+1

15
NIELIT Scientist B 2020

To the detection of upto 5 errors in all cases, the minimum Hamming


distance in a block code must be ______.
(A) 5 (B) 6 (C) 10 (D) 8

16
NIELIT Scientific Assistant A – 2020 Nov

To guarantee correction of upto 5 errors in all cases, the minimum


Hamming distance in a block code must be ______.
(A) 11 (B) 6 (C) 5 (D) 2

17
UGC NET – Oct 2020

Consider a code with only four valid code words: 0000000000,


0000011111, 1111100000, and 1111111111. This code has distance 5.
If the code word arrived is 0000000111 then the original code word
must be _______
(A) 0000011111 (B) 0000000000
(C) 1111100000 (C) 1111111111

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

An error correcting code has the following code words:


00000000,00001111,01010101,10101010,11110000. What is the
maximum number of bit errors that can be corrected?
(A) 0 (B) 1 (C) 2 (D) 3

20
Solution:-

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.
The Hamming distance between two strings of equal length is the
number of positions at which the corresponding symbols are
different.
In the above problem min hamming distance is 4, So max number
of bit errors that can be CORRECTED is : floor((4-1)/2)=1
So the correct answer is option (B)

21
GATE-CS-2017 (Set 2)

Consider a binary code that consists only four valid codewords as


given below.
00000, 01011, 10101, 11110
Let minimum Hamming distance of code be p and maximum number
of erroneous bits that can be corrected by the code be q. The value of
p and q are:
(A) p = 3 and q = 1 (B) p = 3 and q = 2
(C) p = 4 and q = 1 (D) p = 4 and q = 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

Consider a simple code C for error detection and correction. Each


codeword in C consists of 2 data bits [d1,d0] followed by check bits
[c2,c1,c0]. The check bits are computed as follows: c2=d1+d0,
c1=d1 and c0=d0, where ′+′ is a modulo-2 addition.
Write down all the codewords for C.
Determine the minimum Hamming distance between any two
distinct codewords of C ?

3
Solution:-

Code words: 00000, 01101, 10110, 11011


Minimum Hamming distance = 3

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

In a binary Hamming code the number of check digits is r then


number of message digits is equal to:
(A) 2^r-1 (B) 2^r-r-1 (C) 2^r-r+1 (D) 2^r+r-1
ISRO CS 2013

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

Assume that a 12-bit Hamming codeword consisting of 8-bit data and 4


check bits is d8d7d6d5c8d4d3d2c4d1c2c1, where the data bits and the
check bits are given in the following tables:

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:-

(1) c1+d1+d2+d4+d5+d7 should be of even parity = 0 + 1 + 0 + 0 + x + 1


= x + 2, x must be 0 for even parity.
(2) c2+d1+d3+d4+d6+d7 should be even = 1 + 1 + 1 + 0 + 0 + 1 = 4 (yes)
(3) c4+d2+d3+d4+d8 should be even = 0 + 0 + 1 + 0 + 1 = 2 (yes even)
(4) c8+d5+d6+d7+d8 should be even = y + x + 0 + 1 + 1 = y + 2 (taking
x=0) , for even parity, y should be 0
Hence ans is (A), both x and y are 0.

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

Data link layer can be designed to offer various


services, which vary from protocol to protocol. Three
reasonable possibilities are:
1. Unacknowledged connectionless service
2. Acknowledged connectionless service
3. Acknowledged connection-oriented service

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

How to solve this ?

Time out timer at sender side!!

24
Problem 2: Lost Acknowledgement

But with timer running at sender


side, it will retransmit the frame
once the timer expires, but now
how the receiver will handle
duplicate frames?

Use frame Sequence no.

25
Problem 3: Delayed Acknowledgement/Data

After timeout on sender side, a long delayed


acknowledgement might be wrongly considered as
acknowledgement of some other recent packet.

Solution: Use acknowledgement number

26
Stop and Wait ARQ (Automatic Repeat Request)

Previously discussed 3 problems are resolved by Stop


and Wait ARQ (Automatic Repeat Request) that
does both error control and flow control.

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

In a data link protocol, the following character encoding is used:


A → 01000111 B → 11100011 FLAG → 01111110 ESC → 11100000
Assuming that byte stuffing is employed for the four character frame A B ESC
FLAG, transmitter sends it as:
A. 01111110 01000111 11100011 11100000 11100000 01111110
B. 01111110 01000111 11100011 11100000 11100000 01111110 01111110
C. 01111110 01000111 11100011 11100000 11100000 11100000 01111110 01111110
D. None of these

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

In bit stuffing protocol for frame synchronization, if


stuff bit pattern is 01110 then how many zero bits
stuffed by transmitter white transmitting given frame ?
Data frame: 1011101111011111110

6
Solution:-


Flag : 01110

Data Frame: 1011101111011111110

Data after bit stuffing: 1011010110110011011011010

7
GATE CSE 2014

A bit-stuffing based framing protocol uses an 8-bit


delimiter pattern of 01111110. If the output bit-string
after stuffing is 01111100101, then the input bit-string
is:
(A) 0111110100
(B) 0111110101
(C) 0111111101
(D) 0111111111

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

A channel has a capacity of 256 Mbps, maximum


packet size is 1024 bytes and RTT is 200 μsec. So sec. So
what is efficiency of sender (Assume that channel
uses stop & wait protocol?

14
Solution:-

Transmission Time, Tt=Length of frame/Bandwidth


Tt=1024 *8 / (256 * 10^ 6)=32 microsecond
Round Trip Time (2*Tp) = 200 microsecond
Efficiency = Tt/(Tt+ 2*Tp)
= 32/(32+200)=0.1379 or 13.79%

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)

A sender uses the Stop-and-Wait ARQ protocol for reliable


transmission of frames. Frames are of size 1000 bytes and the
transmission rate at the sender is 80 Kbps (1Kbps = 1000
bits/second). Size of an acknowledgement is 100 bytes and the
transmission rate at the receiver is 8 Kbps. The one-way
propagation delay is 100 milliseconds. Assuming no frame is
lost, the sender throughput is __________ bytes/second.
(A) 2500
(B) 2000
(C) 1500
(D) 500
18
Solution:-

Total time = Transmission-Time + 2* Propagation-Delay + Ack-Time.


Trans. time = (1000*8)/80*1000 = 0.1 sec
2*Prop-Delay = 2*100ms = 0.2 sec
Ack time = 100*8/8*1000 = 0.1 sec.
Total Time = 0.1 + 0.2 + 0.1 = 0.4 sec.
Throughput = L/Total Time
L = data packet to be sent = 1000 bytes
Throughput = L/Total Time
= 1000* 8 / 0.4 bps
= 2500 bytes/sec.
19
GATE-CS-2017 (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

You might also like