Computer Network Unit 1
Computer Network Unit 1
Computer Network:
A computer network is a set of computers connected together for the purpose of sharing resources. The most
common resource shared today is connection to the Internet. Other shared resources can include a printer or
a file server.
Data Communication:
When we communicate, we are sharing information. This sharing can be local or remote. Between
individuals, local communication usually occurs face to face, while remote communication takes place
over distance.
Data Communication is a process of exchanging data or information In case of computer networks this
exchange is done between two devices over a transmission medium.
This process involves a communication system which is made up of hardware and software.
The hardware part involves the sender and receiver devices and the intermediate devices through
which the data passes.
The software part involves certain rules which specify what is to be communicated, how it is to be
communicated and when. It is also called as a Protocol.
The following sections describes the fundamental characteristics that are important for the effective
working of data communication process and is followed by the components that make up a data
communications system.
Characteristics :
The effectiveness of any data communications system depends upon the following four fundamental
characteristics:
1. Delivery: The data should be delivered to the correct destination and correct user.
2. Accuracy: The communication system should deliver the data accurately, without introducing any
errors. The data may get corrupted during transmission affecting the accuracy of the delivered data.
3. Timeliness: Audio and Video data has to be delivered in a timely manner without any delay; such a data
delivery is called real time transmission of data.
4. Jitter: It is the variation in the packet arrival time. Uneven Jitter may affect the timeliness of data being
transmitted.
1. Message: The message is the information (data) to be communicated. Popular forms of information include
1
Page
PKM
BCA III SEM COMPUTER NETWORKS UNIT 1
2. Sender: The sender is the device that sends the data message. It can be a computer, workstation, telephone
handset, video camera, and so on.
3. Receiver: The receiver is the device that receives the message. It can be a computer, workstation,
telephone handset, television, and so on.
4. Transmission medium: The transmission medium is the physical path by which a message travels from
sender to receiver. Some examples of transmission media include twisted-pair wire, coaxial cable, fiber-optic
cable, and radio waves
5. Protocol: A protocol is a set of rules that govern data communications. It represents an agreement
between the communicating devices. Without a protocol, two devices may be connected but not
communicating, just as a person speaking French cannot be understood by a person who speaks only
Japanese.
Data Representation: Data is collection of raw facts which is processed to deduce information. There may
be different forms in which data may be represented. Some of the forms of data used in communications are
as follows:
1.Text : Text includes combination of alphabets in small case as well as upper case. It is stored as a pattern of
bits. Prevalent encoding system : ASCII, Unicode
2. Numbers : Numbers include combination of digits from 0 to 9. It is stored as a pattern of bits. Prevalent
encoding system : ASCII, Unicode
3. Images :
An image is worth a thousand words‖ is a very famous saying. In computers images are digitally stored.
A Pixel is the smallest element of an image. To put it in simple terms, a picture or image is a matrix of
pixel elements.
The pixels are represented in the form of bits. Depending upon the type of image (black n white or
color) each pixel would require different number of bits to represent the value of a pixel.
The size of an image depends upon the number of pixels (also called resolution) and the bit pattern
used to indicate the value of each pixel.
Example: if an image is purely black and white (two color) each pixel can be represented by a value
either 0 or 1, so an image made up of 10 x 10 pixel elements would require only 100 bits in memory to
be stored.
On the other hand an image that includes gray may require 2 bits to represent every pixel value (00 -
black, 01 – dark gray, 10 – light gray, 11 –white). So the same 10 x 10 pixel image would now require
200 bits of memory to be stored.
Commonly used Image formats : jpg, png, bmp, etc
4. Audio: Data can also be in the form of sound which can be recorded and broadcasted.
Example: What we hear on the radio is a source of data or information. Audio data is continuous, not discrete.
PKM
BCA III SEM COMPUTER NETWORKS UNIT 1
Data Flow:
Two devices communicate with each other by sending and receiving data. The data can flow between the two
devices in the following ways.
1. Simplex
2. Half Duplex
3. Full Duplex
Simplex:
Half Duplex:
In half duplex both the stations can transmit as well as receive but not at the same time.
When one device is sending other can only receive and vice-versa (as shown in figure above.)
Example: A walkie-talkie.
Full Duplex:
In Full duplex mode, both stations can transmit and receive at the same time.
Example: mobile phones
3
Page
PKM
BCA III SEM COMPUTER NETWORKS UNIT 1
NETWORKS
A network is a set of devices (often referred to as nodes) connected by communication links. A node can be a
computer, printer, or any other device capable of sending and/or receiving data generated by other nodes on
the network.
Distributed Processing : Most networks use distributed processing, in which a task is divided among multiple
computers. Instead of one single large machine being responsible for all aspects of a process, separate
computers (usually a personal computer or workstation) handle a subset.
Network Criteria: A network must be able to meet a certain number of criteria. The most important of these
are performance, reliability, and security.
Performance:
Performance can be measured in many ways, including transit time and response time. Transit time is the
amount of time required for a message to travel from one device to another. Response time is the elapsed
time between an inquiry and a response. The performance of a network depends on a number of factors,
including the number of users, the type of transmission medium, the capabilities of the connected
hardware, and the efficiency of the software.
Performance is often evaluated by two networking metrics: throughput and delay. We often need more
throughput and less delay. However, these two criteria are often contradictory. If we try to send more
data to the network, we may increase throughput but we increase the delay because of traffic congestion
in the network.
Reliability:
In addition to accuracy of delivery, network reliability is measured by the frequency of failure, the time it
takes a link to recover from a failure, and the network's robustness in a catastrophe.
Security:
Network security issues include protecting data from unauthorized access, protecting data from damage
and development, and implementing policies and procedures for recovery from breaches and data losses.
microwave or satellite links, are also possible. When you change television channels by infrared remote
Page
PKM
BCA III SEM COMPUTER NETWORKS UNIT 1
control, you are establishing a point-to-point connection between the remote control and the television's
control system.
Multipoint: A multipoint (also called multidrop) connection is one in which more than two specific devices
share a single link. In a multipoint environment, the capacity of the channel is shared, either spatiallyor
temporally. If several devices can use the link simultaneously, it is a spatially shared connection. If users
must take turns, it is a timeshared connection.
Physical Topology :The term physical topology refers to the way in which a network is laid out
physically. One or more devices connect to a link; two or more links form a topology. The topology of a
network is the geometric representation of the relationship of all the links and linking devices (usually
called nodes) to one another. There are four basic topologies possible: mesh, star, bus, and ring.
1.Mesh:
In a mesh topology, every device has a dedicated point-to-point link to every other device. The term
dedicated means that the link carries traffic only between the two devices it connects. To find the number
of physical links in a fully connected mesh network with n nodes, we first consider that each node must be
connected to every other node. Node 1 must be connected to n - I nodes, node 2 must be connected to n –
1 nodes, and finally node n must be connected to n - 1 nodes. We need n(n - 1) physical links. However, if
each physical link allows communication in both directions (duplex mode), we can divide the number of
links by 2. In other words, we can say that in a mesh topology, we need n(n -1) /2 duplex-mode links. To
accommodate that many links, every device on the network must have n – 1 input/output (VO) ports to be
connected to the other n - 1 stations.
5
Page
PKM
BCA III SEM COMPUTER NETWORKS UNIT 1
Advantages:
1. The use of dedicated links guarantees that each connection can carry its own data load, thus eliminating
the traffic problems that can occur when links must be shared by multiple devices.
2. A mesh topology is robust. If one link becomes unusable, it does not incapacitate the entire system.
Third, there is the advantage of privacy or security. When every message travels along a dedicated line,
only the intended recipient sees it. Physical boundaries prevent other users from gaining access to
messages. Finally, point-to-point links make fault identification and fault isolation easy. Traffic can be
routed to avoid links with suspected problems. This facility enables the network manager to discover the
precise location of the fault and aids in finding its cause and solution.
Disadvantages:
1. Disadvantage of a mesh are related to the amount of cabling because every device must be connected
to every other device, installation and reconnection are difficult.
2. Second, the sheer bulk of the wiring can be greater than the available space (in walls, ceilings, or floors)
can accommodate. Finally, the hardware required to connect each link (I/O ports and cable) can be
prohibitively expensive.
For these reasons a mesh topology is usually implemented in a limited fashion, for example, as a backbone
connecting the main computers of a hybrid network that can include several other topologies.
2.Star Topology:
In a star topology, each device has a dedicated point-to-point link only to a central controller, usually
called a hub. The devices are not directly linked to one another. Unlike a mesh topology, a star topology
does not allow direct traffic between devices. The controller acts as an exchange: If one device wants to
send data to another, it sends the data to the controller, which then relays the data to the other
connected device .
A star topology is less expensive than a mesh topology. In a star, each device needs only one link and one
I/O port to connect it to any number of others. This factor also makes it easy to install and reconfigure. Far
less cabling needs to be housed, and additions, moves, and deletions involve only one connection:
between that device and the hub.
Other advantages include robustness. If one link fails, only that link is affected. All other links remain
6
active. This factor also lends itself to easy fault identification and fault isolation. As long as the hub is
Page
working, it can be used to monitor link problems and bypass defective links.
PKM
BCA III SEM COMPUTER NETWORKS UNIT 1
One big disadvantage of a star topology is the dependency of the whole topology on one single point, the
hub. If the hub goes down, the whole system is dead. Although a star requires far less cable than a mesh,
each node must be linked to a central hub. For this reason, often more cabling is required in a star than in
some other topologies (such as ring or bus).
3.Bus Topology:
The preceding examples all describe point-to-point connections. A bus topology, on the other hand, is
multipoint. One long cable acts as a backbone to link all the devices in a network
Nodes are connected to the bus cable by drop lines and taps. A drop line is a connection running between
the device and the main cable. A tap is a connector that either splices into the main cable or punctures the
sheathing of a cable to create a contact with the metallic core. As a signal travels along the backbone,
some of its energy is transformed into heat. Therefore, it becomes weaker and weaker as it travels farther
and farther. For this reason there is a limit on the number of taps a bus can support and on the distance
between those taps.
Advantages of a bus topology include ease of installation. Backbone cable can be laid along the most
efficient path, then connected to the nodes by drop lines of various lengths. In this way, a bus uses less
cabling than mesh or star topologies. In a star, for example, four network devices in the same room
require four lengths of cable reaching all the way to the hub. In a bus, this redundancy is eliminated. Only
the backbone cable stretches through the entire facility. Each drop line has to reach only as far as the
nearest point on the backbone.
Disadvantages include difficult reconnection and fault isolation. A bus is usually designed to be optimally
efficient at installation. It can therefore be difficult to add new devices. Signal reflection at the taps can
cause degradation in quality. This degradation can be controlled by limiting the number and spacing of
7
devices connected to a given length of cable. Adding new devices may therefore require modification or
Page
PKM
BCA III SEM COMPUTER NETWORKS UNIT 1
replacement of the backbone. In addition, a fault or break in the bus cable stops all transmission, even
between devices on the same side of the problem. The damaged area reflects signals back in the direction
of origin, creating noise in both directions.
Bus topology was the one of the first topologies used in the design of early local area networks. Ethernet
LANs can use a bus topology, but they are less popular.
Ring Topology :
In a ring topology, each device has a dedicated point-to-point connection with only the two devices on
either side of it. A signal is passed along the ring in one direction, from device to device, until it reaches its
destination. Each device in the ring incorporates a repeater. When a device receives a signal intended for
another device, its repeater regenerates the bits and passes them along
A ring is relatively easy to install and reconfigure. Each device is linked to only its immediate neighbors (either
physically or logically). To add or delete a device requires changing only two connections. The only constraints are
media and traffic considerations (maximum ring length and number of devices). In addition, fault isolation is
simplified. Generally in a ring, a signal is circulating at all times. If one device does not receive a signal within a
specified period, it can issue an alarm. The alarm alerts the network operator to the problem and its location.
However, unidirectional traffic can be a disadvantage. In a simple ring, a break in the ring (such as a disabled station)
can disable the entire network. This weakness can be solved by using a dual ring or a switch capable of closing off
the break. Ring topology was prevalent when IBM introduced its local-area network Token Ring. Today, the need for
higher-speed LANs has made this topology less popular.
Hybrid Topology:
A network can be hybrid. For example, we can have a main star topology with each branch connecting
several stations in a bus topology as shown in Figure
8
Page
PKM
BCA III SEM COMPUTER NETWORKS UNIT 1
A LAN is generally confined to a specific location, such as floor, building or some other
small area. By being confined it is possible in most cases to use only one transmission
medium (cabling). The technology is less expensive to implement than WAN because you are
keeping all of your expenses to a small area, and generally youcan obtain higher speed. They,
are widely used to connect personal computers and workstations in company offices and
factories to share recourses.
LANs often use a transmission all the machines are attached with each other.
Traditional LANs runs at speed of 10 to 100 mbps have low delay and make very few errors.
A wide area network spans a large geographical area, often a country or continent. It multiplies
Page
multiple connected LANs; that can be separated by any geographical distance. A LAN at the corporate
PKM
BCA III SEM COMPUTER NETWORKS UNIT 1
headquarters in Indianapolis can be connected to a LAN at field office in Chicago and to another field
office LAN in St. Louis to form a single Wide Area Network.
In most WANs the network contains numerous cables or telephone lines, eachone connection a pair
of routers. If two routers that do not share a cable nevertheless and wish to communicate, they must do it
indirectly. On personal computers we are using modem to communicate indirectly with other computer.
4.Wireless Networks
Mobile computers such as notebook computers laptops are fastest growing segment of computer
industry. Users wants to connect this machine to their office LANs to see the data when they .are out from
the office, since the wired connection is not possible we have to use wireless networks.
For e.g. on Aircraft single router will maintain a radio link with some other router on ground,
changing routers as it flies along this configuration is just a traditionalLAN, except that its connection to the
outside world happens to be a radio link instead of a hardwired line.
A common form of Internet is collections of LANs connected by WA are form when distinct
networks are connected with each other through routers and hosts.
10
Page
PKM
BCA III SEM COMPUTER NETWORKS UNIT 1
Internet History
A network is a group of connected communicating devices such as computers and printers.
An internet (note the lowercase letter i) is two or more networks that can communicate with each other.
The most notable internet is called the Internet (uppercase letter I), a collaboration of more than hundreds of
thousands of interconnected networks.
Private individuals as well as various organizations such as government agencies, schools, research facilities,
corporations, and libraries in more than 100 countries use the Internet.
Yet this extraordinary communication system only came into being in 1969. In the mid-1960s, mainframe
computers in research organizations were standalone devices. Computers from different manufacturers were
unable to communicate with one another.
The Advanced Research Projects Agency (ARPA) in the Department of Defense (DoD) was interested in finding a
way to connect computers so that the researchers they funded could share their findings, thereby reducing
costs and eliminating duplication of effort.
In 1967, at an Association for Computing Machinery (ACM) meeting, ARPA presented its ideas for ARPANET, a
small network of connected computers. The idea was that each host computer would be attached to a
specialized computer, called an interface message processor (IMP).
The IMPs, in turn, would be connected to one another. Each IMP had to be able to communicate with other
IMPs as well as with its own attached host.
By 1969, ARPANET was a reality. Four nodes, at the University of California at Los Angeles (UCLA), the University
of California at Santa Barbara (UCSB), Stanford Research Institute (SRI), and the University of Utah, were
connected via the IMPs to form a network.
Software called the Network Control Protocol (NCP) provided communication between the hosts. In 1972, Vint
Cerf and Bob Kahn, both of whom were part of the core ARPANET group, collaborated on what they called the
Internetting Project.
Cerf and Kahn's landmark 1973 paper outlined the protocols to achieve end-to-end delivery of packets. This
paper on Transmission Control Protocol (TCP) included concepts such as encapsulation, the datagram, and the
functions of a gateway.
Shortly thereafter, authorities made a decision to split TCP into two protocols: Transmission Control Protocol
(TCP) and Internetworking Protocol (lP). IP would handle datagram routing while TCP would be responsible for
higher-level functions such as segmentation, reassembly, and error detection. The internetworking protocol
became known as TCPIIP.
Network Models
A network is a combination of hardware and software that sends data from one location to another. The hardware
consists of the physical equipment that carries signals from one point of the network to another. The software consists
of instruction sets that make possible the services that we expect from a network.
* Protocol Layering :
We use the concept of layers in our daily life. As an example, let us consider two friends who communicate through
postal mail .The process of sending a letter to a friend would be complex if there were no services available from the
11
post office. Below Figure shows the steps in this task. Sender, Receiver, and Carrier. In Figure we have a sender, a
receiver, and a carrier that transports the letter. There is a hierarchy of tasks.
Page
PKM
BCA III SEM COMPUTER NETWORKS UNIT 1
At the Sender Site Let us first describe, in order, the activities that take place at the sender site.
Higher layer. The sender writes the letter, inserts the letter in an envelope, writes the sender and receiver
addresses, and drops the letter in a mailbox.
Middle layer. The letter is picked up by a letter carrier and delivered to the post office.
Lower layer. The letter is sorted at the post office; a carrier transports the letter.
On the Way: The letter is then on its way to the recipient. On the way to the recipient's local post office, the
letter may actually go through a central office. In addition, it may be transported by truck, train, airplane,
boat, or a combination of these.
protocols.
PKM
BCA III SEM COMPUTER NETWORKS UNIT 1
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.
The Physical Layer: The physical layer is concerned with 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.
The Data Link Layer: The main task of the data link layer is to transform a raw transmission facility into a
line that appears free of undetected transmission errors to the network layer. It accomplishes this task by having
the sender break up the input data into data frames (typically a few hundred or a few thousand bytes) and
transmits the frames sequentially. If the service is reliable, the receiver confirms correct receipt of each frame
by sending back an acknowledgement frame.
The Network Layer: 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
13
''wired into'' the network and rarely changed. They can also be determined at the start of each conversation, for
example, a terminal session (e.g., a login to a remote machine). Finally, they can be highly dynamic, being
Page
determined anew for each packet, to reflect the current network load.
PKM
BCA III SEM COMPUTER NETWORKS UNIT 1
The Transport Layer: The basic function of the transport layer is to accept data from above, split it up into
smaller units if need be, pass these to the network layer, and ensure that the pieces all arrive correctly at the
other end. Furthermore, all this must be done efficiently and in a way that isolates the upper layers from the
inevitable changes in the hardware technology.
The Session Layer: The session layer allows users on different machines to establish sessions between them.
Sessions offer various services, including dialog control (keeping track of whose turn it is to transmit), token
management (preventing two parties from attempting the same critical operation at the same time), and
synchronization (check pointing long transmissions to allow them to continue from where they were after a
crash).
The Presentation Layer: The presentation layer is concerned with the syntax and semantics of the information
transmitted. In order to make it possible for computers with different 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 (e.g., banking records), to be defined and exchanged.
The Application Layer: 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 using
HTTP. The server then sends the page back. Other application protocols are used for file transfer, electronic
mail, and network news.
Application layer: This is the top layer of TCP/IP protocol suite. This layer includes applications or
processes that use transport layer protocols to deliver the data to destination computers.
At each layer there are certain protocol options to carry out the task designated to that particular layer. So,
application layer also has various protocols that applications use to communicate with the second layer, the
transport layer. Some of the popular application layer protocols are :
HTTP (Hypertext transfer protocol)
FTP (File transfer protocol)
SMTP (Simple mail transfer protocol)
SNMP (Simple network management protocol) etc.
14
Page
PKM
BCA III SEM COMPUTER NETWORKS UNIT 1
Transport Layer: This layer provides backbone to data flow between two hosts. This layer receives data
from the application layer above it. There are many protocols that work at this layer but the two most
commonly used protocols at transport layer are TCP and UDP.
TCP is used where a reliable connection is required while UDP is used in case of unreliable connections.
Network Layer: This layer is also known as Internet layer. The main purpose of this layer is to organize or
handle the movement of data on network. By movement of data, we generally mean routing of data over the
network. The main protocol used at this layer is IP. While ICMP (used by popular ‘ping’ command) and
IGMP are also used at this layer.
Data Link Layer: This layer is also known as network interface layer. This layer normally consists of
device drivers in the OS and the network interface card attached to the system. Both the device drivers and
the network interface card take care of the communication details with the media being used to transfer the
data over the network. In most of the cases, this media is in the form of cables. Some of the famous
protocols that are used at this layer include ARP (Address resolution protocol), PPP(Point to point protocol)
etc.
OSI (Open System Interconnection) TCP/IP (Transmission Control Protocol / Internet Protocol)
1. OSI is a generic, protocol independent standard, acting as a 1. TCP/IP model is based on standard protocols around which
communication gateway the Internet has developed. It is a communication between the
network and end user. protocol, which allows connection of
hosts over a network.
2. In OSI model the transport layer guarantees the delivery of 2. In TCP/IP model the transport layer does not guarantees
15
PKM
BCA III SEM COMPUTER NETWORKS UNIT 1
4. OSI model has a separate Presentation layer and Session 4. TCP/IP does not have a separate Presentation layer or
layer. Session layer.
5. Transport Layer is Connection Oriented. 5. Transport Layer is both Connection Oriented and Connection
less.
6. Network Layer is both Connection Oriented and Connection 6. Network Layer is Connection less.
less.
7. OSI is a reference model around which the networks are 7. TCP/IP model is, in a way implementation of the OSI model.
built. Generally, it is used as a guidance tool.
8. Network layer of OSI model provides both connection 8. The Network layer in TCP/IP model provides connectionless
oriented and connectionless service. service.
9. OSI model has a problem of fitting the protocols into the 9. TCP/IP model does not fit any protocol
model.
10. Protocols are hidden in OSI model and are easily replaced as 10. In TCP/IP replacing protocol is not easy.
the technology changes.
11. OSI model defines services, interfaces and protocols very 11. In TCP/IP, services, interfaces and protocols are not clearly
clearly and makes clear distinction between them. It is protocol separated. It is also protocol dependent.
independent.
TRANSMISSION IMPAIRMENT
Signals travel through transmission media, which are not perfect. The imperfection causes signal impairment. This
means that the signal at the beginning of the medium is not the same as the signal at the end of the medium. What is
sent is not what is received. Three causes of impairment are attenuation, distortion, and noise.
Attenuation – It means loss of energy. The strength of signal decreases with increasing distance
which causes loss of energy in overcoming resistance of medium. This is also known as attenuated
signal. Amplifiers are used to amplify the attenuated signal which gives the original signal back and
compensate for this loss.
16
Page
PKM
BCA III SEM COMPUTER NETWORKS UNIT 1
Attenuation is measured in decibels(dB). It measures the relative strengths of two signals or one signal at
two different point.
Attenuation(dB) = 10log10(P2/P1)
P1 is the power at sending end and P2 is the power at receiving end.
Some where the decibel is also define in terms of voltage instead of power.In this case because power
is proportional to the square of the voltage the formula is
Attenuation(dB) = 20log10(V2/V1)
V1 is the voltage at sending end and V2 is the voltage at receiving end.
Distortion – It means changes in the form or shape of the signal. This is generally seen in composite
signals made up with different frequencies. Each frequency component has its own propagation speed
travelling through a medium. And thats why it delay in arriving at the final destination Every
component arrive at different time which leads to distortion. Therefore, they have different phases at
receiver end from what they had at senders end.
Noise – The random or unwanted signal that mixes up with the original signal is called noise. There are
several types of noise such as induced noise, crosstalk noise, thermal noise and impulse noise which may
corrupt the signal.
Induced noise comes from sources such as motors and appliances. These devices act as sending antenna
and transmission medium act as receiving antenna. Thermal noise is movement of electrons in wire
which creates an extra signal. Crosstalk noise is when one wire affects the other wire. Impulse noise is a
signal with high energy that comes from lightning or power lines
17
Page
PKM
BCA III SEM COMPUTER NETWORKS UNIT 1
To find the theoretical bit rate limit, we need to know the ration .The signal-to-noise ratio is defined as
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:
Two theoretical formulas were developed to calculate the data rate: one by Nyquist for a noiseless
channel,another by Shannon for a noisy channel.
An ideal channel with no noise. The Nyquist Bit rate derived by Henry Nyquist gives the bit rate for a Noiseless Channel.
Nyquist Bit Rate .
The Nyquist bit rate formula defines the theoretical maximum bit rate for a noiseless channel.
Bitrate = 2 x Bandwidth x Log2 L
Where,
Bitrate is the bitrate of the channel in bits per second .
Bandwidth is the bandwidth of the channel
L is the number of signal levels.
Example
What is the maximum bit rate of a noiseless channel with a
bandwidth of 5000 Hz transmitting a signal with two signal
levels.
Solution:
The bit rate for a noiseless channel according to Nyquist Bit rate can be calculated as follows:
BitRate = 2 x Bandwidth x Log2 L
= 2 x 5000 x log2 2 =10000 bp
18
Page
PKM
BCA III SEM COMPUTER NETWORKS UNIT 1
A realistic channel that has some noise. The Shannon Capacity formulated by Claude Shannon gives the bit rate for a
Noisy Channel.The Shannon Capacity defines the theoretical maximum bit rate for a noisy channel.
Capacity=bandwidth X log2 (1 +SNR)
Where,
Capacity is the capacity of the channel in bits per second.
Bandwidth is the bandwidth of the channel
SNR is the Signal to Noise Ratio
Shannon Capacity for calculating the maximum bit rate for a noisy channel does not consider the number of levels of the
signals being transmitted as done in the Nyquist bit rate.
Example:
Calculate the bit rate for a noisy channel with SNR 300 and bandwidth of 3000Hz
Solution:
The bit rate for a noisy channel according to Shannon Capacity can be calculated as follows:
Capacity=bandwidth X log2 (1 +SNR)
= 3000 x log2 (1 + 300)
= 3000 x log2 ( 301)
= 3000 x 8.23
= 24,690bps
PERFORMANCE:
1. Bandwidth :
One characteristic that measures network performance is bandwidth. However, the term can be used in two different
contexts with two different measuring values: bandwidth in hertz and bandwidth in bits per second.
Bandwidth in Hertz
We have discussed this concept. 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. This means that this network can send 100 Mbps.
2.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
19
words, the bandwidth is a potential measurement of a link; the throughput is an actual measurement of how
Page
PKM
BCA III SEM COMPUTER NETWORKS UNIT 1
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. The bandwidth is 1000 cars per
minute; the throughput is 100 cars per minute.
Example 3.44
A network with bandwidth of 10 Mbps can pass only an average of 12,000 frames per minute
with each frame carrying an average of 10,000 bits. What is the throughput of this network?
Solution
We can calculate the throughput as
Throughput= 12,000 x 10,000 =2 Mbps 60
The throughput is almost one-fifth of the bandwidth in this case.
3.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
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 = Dist:mce
Propagation speed
The propagation speed of electromagnetic signals depends on the medium and on
the frequency of the signaL For example, in a vacuum, light is propagated with a speed
of 3 x 108 mfs. It is lower in air; it is much lower in cable.
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 arriving at the receiver.
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
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.
20
Page
PKM
BCA III SEM COMPUTER NETWORKS UNIT 1
4.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 example).
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.
PKM
BCA III SEM COMPUTER NETWORKS UNIT 1
As the figure shows, communication at the data link layer occurs between two adjacent nodes. To send data
from A to F, three partial deliveries are made.
First, the data link layer at A sends a frame to the data link layer at B (a router).
Second, the data link layer at B sends a new frame to the data link layer at E.
Finally, the data link layer at E sends a new frame to the data link layer at F.
Note that the frames that are exchanged between the three nodes have different values in the headers.
The frame from A to B has B as the destination address and A as the source address. The frame from B
to E has E as the destination address and B as the source address.
The frame from E to F has F as the destination address and E as the source address. The values of the
trailers can also be different if error checking includes the header of the frame.
Types of Errors :
Whenever bits flow from one point to another, they are subject to unpredictable changes because of
interference. This interference can change the shape of the signal.
In a single-bit error, a 0 is changed to a 1 or a 1 to a O.
In a burst error, multiple bits are changed. For example, a 11100 s burst of impulse noise on a
transmission with a data rate of 1200 bps might change all or some of the12 bits of information.
22
Page
PKM
BCA III SEM COMPUTER NETWORKS UNIT 1
BLOCK CODING
In block coding, we divide our message into blocks, each of k bits, called data words. We add r redundant bits
to each block to make the length n = k + r. The resulting n-bit blocks are called code words.
ERROR DETECTION :
Error can be detected by using block coding - If the following two conditions are met, the receiver can detect a change
in the original codeword.
1. The receiver has (or can find) a list of valid codewords.
2. The original codeword has changed to an invalid one.
Example : Let us assume that k =2 and n =3. Below table shows the list of datawords and codewords.
23
Page
PKM
BCA III SEM COMPUTER NETWORKS UNIT 1
Assume the sender encodes the dataword 01 as 011 and sends it to the receiver. Consider the following cases:
1. The receiver receives O11. It is a valid codeword. The receiver extracts the dataword 01 from it.
2. The codeword is corrupted during transmission, and 111 is received (the leftmost bit is corrupted). This is not a valid
codeword and is discarded.
3. The codeword is corrupted during transmission, and 000 is received (the right two bits are corrupted). This is a valid
codeword. The receiver incorrectly extracts the dataword 00. Two corrupted bits have made the error undetectable.
NOTE: An error-detecting code can detect only the types of errors for which it is designed; other types of errors may
remain undetected.
ERROR CORRECTION :
In error detection, the receiver needs to know only that the received codeword is invalid; in error correction the
receiver needs to find (or guess) the original codeword sent. We can say that we need more redundant bits for error
correction than for error detection. Below Figure shows the role of block coding in error correction.
Example :
1. Comparing the received codeword with the first codeword in the table (01001 versus 00000), the receiver decides
that the first codeword is not the one that was sent because there are two different bits.
2. By the same reasoning, the original codeword cannot be the third or fourth one in the table.
3. The original codeword must be the second one in the table because this is the only one that differs from the received
codeword by 1 bit. The receiver replaces 01001 with 01011 and consults the table to find the dataword 01.
Hamming Distance :
It is the idea of error controlling mechanism.The Hamming distance between two words (of the same size) is
the number of differences between the corresponding bits.
24
The Hamming distance between two words x and y can be represented as d(x, y). The Hamming distance can
easily be found if we apply the XOR operation on the two words and count the number of Is in the result.
Page
Example 10.4
Let us find the Hamming distance between two pairs of words.
1. The Hamming distance d(OOO, 011) is 2 because 000 xor 011 is 011 (two 1s).
2. The Hamming distance d(10101, 11110) is 3 because 10101 xor 11110 is 01011 (three 1s).
Example :
Find the minimum Hamming distance of the coding scheme (values of above table )
Solution:
We first find all the Hamming distances.
d(OOOOO, 01011) = 3 d(01011, 10101) =4 d(OOOOO, 10101) =3
d(OlO11, 11110) = 3 d(OOOOO, 11110) = 4 d(10101, 11110) =3
The dmin in this case is 3.
CYCLIC CODES
Cyclic codes are special linear block codes with one extra property. In a cyclic code, if a codeword is
cyclically shifted (rotated), the result is another codeword.
For example, if 1011000 is a codeword and we cyclically left-shift, then 0110001 is also a codeword. In this
case, if we call the bits in the first word a0 to a6 and the bits in the second word b0 to b6, we can shift the
bits by using the following:
In the rightmost equation, the last bit of the first word is wrapped around and becomes the first bit of the
second word.
25
Page
PKM
BCA III SEM COMPUTER NETWORKS UNIT 1
Below figure shows one possible design for the encoder and decoder i.e CRC encoder and decoder
In the encoder, the dataword has k bits (4 here); the codeword has n bits (7 here).
The size of the dataword is augmented by adding n - k (3 here- 0s) to the right-hand side of the word. The
n-bit result is fed into the generator.
The generator uses a divisor of size n - k + I (4 here), predefined and agreed upon. The generator divides
the augmented dataword by the divisor (modulo-2 division). The quotient of the division is discarded; the
remainder (r0 r1 r2) is appended to the dataword to create the codeword.
The decoder receives the possibly corrupted codeword. A copy of all n bits is fed to the checker which is a
replica of the generator. The remainder produced by the checker is a syndrome of n - k (3 here) bits, which
26
accepted as the dataword (interpreted as no error); otherwise, the 4 bits are discarded (error).
PKM
BCA III SEM COMPUTER NETWORKS UNIT 1
Encoder:
The encoder takes the dataword and augments it with n - k number . It then divides the augmented dataword by the
divisor, as shown below…..
As in decimal division, the process is done step by step. In each step, a copy of the divisor is XORed with the 4 bits of
the dividend.
The result of the XOR operation (remainder) is 3 bits (in this case), which is used for the next step after 1 extra bit is
pulled down to make it 4 bits long.
There is one important point we need to remember in this type of division. If the leftmost bit of the dividend (or the
part used in each step) is 0, the step cannot use the regular divisor; we need to use an all-0s divisor.
When there are no bits left to pull down, we have a result. The 3-bit remainder forms the check bits (r0 , r1 , r2).
They are appended to the dataword to create the codeword.
Decoder
The codeword can change during transmission. The decoder does the same division process as the
encoder. The remainder of the division is the syndrome. If the syndrome is all 0s, there is no error; the
dataword is separated from the received codeword and accepted. Otherwise, everything is discarded.
Below Figure shows two cases:
1. The lefthand figure shows the value of syndrome when no error has occurred; the syndrome is 000.
2. The right-hand part of the figure shows the case in which there is one single error. The syndrome is not
all 0s (it is 011)
27
Page
PKM
BCA III SEM COMPUTER NETWORKS UNIT 1
CHECKSUM :
Like cyclic codes, the checksum is based on the concept of redundancy. Several protocols still use the
checksum for error detection .
Internet Checksum : The checksum is used in the Internet by several protocols although not at the data link
layer. Like linear and cyclic codes, the checksum is based on the concept of redundancy. Several protocols still
use the checksum for error detection.
To make the job of the receiver easy if we send the negative (complement) of the sum, called the checksum. In
this case, we send (7, 11, 12, 0, 6, -36). The receiver can add all the numbers received (including the checksum).
Page
One's Complement:
The previous example has one major drawback. All of our data can be written as a 4-bit word (they are less than
15) except for the checksum. One solution is to use one's complement arithmetic. In this arithmetic, we can
represent unsigned numbers between 0 and 2n - 1 using only n bits. If the number has more than n bits, the extra
leftmost bits need to be added to the n rightmost bits (wrapping).
In one's complement arithmetic, a negative number can be represented by inverting all bits (changing a 0 to a 1
and a 1 to a 0). This is the same as subtracting the number from 2n - 1.
The following Figure shows the process at the sender and at the receiver.
Sender site:
1. The message is divided into 16-bit words.
2. The value of the checksum word is set to 0.
3. All words including the checksum are added using one's complement addition.
4. The sum is complemented and becomes the checksum.
5. The checksum is sent with the data.
Receiver site: The receiver uses the following steps for error detection.
PKM
BCA III SEM COMPUTER NETWORKS UNIT 1
Performance :
The traditional checksum uses a small number of bits (16) to detect errors in a message of any size
(sometimes thousands of bits). However, it is not as strong as the CRC in error-checking capability.
For example, if the value of one word is incremented and the value of another word is decremented by the
same amount, the two errors cannot be detected because the sum and checksum remain the same.
Also if the values of several words are incremented but the total change is a multiple of 65535, the sum and
the checksum does not change, which means the errors are not detected.
Fletcher and Adler have proposed some weighted checksums, in which each word is multiplied by a number
(its weight) that is related to its position in the text.
This will eliminate the first problem we mentioned. However, the tendency in the Internet, particularly in
designing new protocols, is to replace the checksum with a CRC.
30
Page
PKM