2.unit 1 lecture notes
2.unit 1 lecture notes
TOPIC PAGE
TOPIC
NUMBER NUMBER
1.1 Building a network 2
1.2 Requirements 5
1.3 Topologies 15
1.4 OSI Model 31
1.5 TCP/IP architecture 40
1.6 Performance 46
1.7 Link layer Services 49
1.8 Framing 53
1.9 Error Detection and Correction 57
1.10 Flow control 66
Networks:
A network is a set of devices connected by a media link. Devices often referred to as nodes
can be a computer, printer, or any other devices capable of sending/ receiving data.
Distributed processing:
Here tasks are divided among multiple computers. Each separate computer handles a subset.
Advantages:
1. Security/ Encapsulation
2. Distributed database
3. Faster problem solving
4. Security through redundancy
5. Collaborative processing
Introduction to Data Communications:
It is the exchange of data between two devices through some transmission medium.
Types:
1. Local
2. Remote
1. Local:
If the devices are restricted in a geographical area.
2. Remote:
If the devices are farther away without any geographical restriction.
Fundamental Characteristics:
1. Delivery
2. Accuracy
3. Timeliness
Components:
Data communication systems are made up of five components.
1. Message
2. Sender
3. Receiver
4. Medium
5. Protocol
A switched network consists of a series of interlinked nodes, called switches. Switches are
hardware and / or software devices capable of creating temporary connections between two
or more devices linked to the switch but not to each other.At broad level, switching can be
divided into two major categories:
Connectionless: The data is forwarded on behalf of forwarding tables. No previous
handshaking is required and acknowledgements are optional.
Connection Oriented: Before switching data to be forwarded to destination, there is a need
to pre-establish circuit along the path between both endpoints. Data is then forwarded on that
circuit. After the transfer is completed, circuits can be kept for future use or can be turned
Down immediately.
There are three methods in switching are,
1. Circuit switching
2. Packet switching
3. Message switching
Multistage switches:
It combines crossbar switches in several stages. The design of multistage switches are
depends on the number of stages and the number of switches required in each stage.
Normally the middle stage has fewer switches than the first and last stages. They provide
several options for connecting each pair of linked devices is known as multipath.
2. TIME DIVISION SWITCHES
Time division switches uses time division multiplexing to achieve switching. There are two
methods are,
1. Time slot interchange
2. TDM buds
Time slot interchange:
A time slot interchange is used to order the slots based on the desired connections. It consists
of random access memory with several memory locations. The RAM fills up the incoming
data from time slots in the order received. Slots are then sent out in an order based on the
decisions of a control unit.
Public Switched Telephone Network:
An example of a circuit switched network is the public switched telephone network. The
Switching centers are organized as five classes are,
Regional office
Sectional office
Primary office
Toll office
End office
Message Switching
This technique was somewhere in middle of circuit switching and packet switching. In
message switching, the whole message is treated as a data unit and is switching / transferred
in its entirety.
Switch working on message switching, first receives the whole message and buffers it until
there are resources available to transfer it to the next hop. If the next hop is not having
enough resource to accommodate large size message, the message is stored and switch waits.
This technique was considered substitute to circuit switching. As in circuit switching the
whole path is blocked for two entities only. Message switching is replaced by packet
switching.
Message switching has the following drawbacks:
Every switch in transit path needs enough storage to accommodate entire message. Because
of store-and-forward technique and waits included until resources are available, message
switching is very slow. Message switching was not a solution for streaming media and real-
time applications.
LANs are composed of inexpensive networking and routing equipment. It may contain local
servers serving file storage and other locally shared applications. It mostly operates on private
IP addresses and does not involve heavy routing. LAN works under its own local domain and
controlled centrally. LAN uses either Ethernet or Token-ring technology Ethernet is most
Backbone of MAN is high-capacity and high-speed fiber optics. MAN works in between
Local Area Network and Wide Area Network. MAN provides uplink for LANs to WANs or
internet.
3. Wide Area Network
As the name suggests, the Wide Area Network (WAN) covers a wide area which may span
across provinces and even a whole country. Generally, telecommunication networks are Wide
Area Network. These networks provide connectivity to MANs and LANs. Since they are
equipped with very high speed backbone, WANs use very expensive network equipment.
WAN may use advanced technologies such as Asynchronous Transfer Mode (ATM), Frame
Relay, and Synchronous Optical Network (SONET). WAN may be managed by multiple
administrations.
Topology refers to the way a network is laid out either physically or logically. Two or
more devices connect to a link two or more links form a topology. It is the geographical
representation of the relationship of all the links and linking devices to each other.
1. Bus
2. Star
3. Ring
4. Mesh
5. Tree
6. Hybrid Topology
1. Bus Topology
In case of Bus topology, all devices share single communication line or cable. Bus topology
may have problem while multiple hosts sending data at the same time. Therefore, Bus
topology either uses CSMA/CD technology or recognizes one host as Bus Master to solve the
issue. It is one of the simple forms of networking where a failure of a device does not affect
the other devices. But failure of the shared communication line can make all other devices
stop functioning.
Both ends of the shared channel have line terminator. The data is sent in only one direction
and as soon as it reaches the extreme end, the terminator removes the data from the line.
Advantages: Disadvantages:
1. Ease of installation. 1. Difficult reconfiguration and fault
isolation.
2. Less cabling.
2. Difficult to add new devices.
3. Signal reflection at top can degradation
in quality
4. If any fault in backbone can stops all
transmission.
All hosts in Star topology are connected to a central device, known as hub device, using a
point-to-point connection. That is, there exists a point to point connection between hosts and
hub. The hub device can be any of the following:
Layer-1 device such as hub or repeater
Layer-2 device such as switch or bridge
Layer-3 device such as router or gateway
Disadvantages:
1. Even it requires less cabling then mesh when compared with other topologies it still large.
In ring topology, each host machine connects to exactly two other machines, creating a
circular network structure. When one host tries to communicate or send message to a host
which is not adjacent to it, the data travels through all intermediate hosts. To connect one
more host in the existing structure, the administrator may need only one more extra cable.
Failure of any host results in failure of the whole ring. Thus, every connection in the ring is a
point of failure. There are methods which employ one more backup ring.
Advantages:
1. Easy to install.
2. Easy to reconfigure.
3. Fault identification is easy.
Disadvantages:
1. Unidirectional traffic.
2. Break in a single ring can break entire network.
4. Mesh Topology
In this type of topology, a host is connected to one or multiple hosts. This topology has hosts
in point-to-point connection with every other host or may also have hosts which are in point-
to-point connection to few hosts only.
Example:
A mesh network has 8 devices. Calculate total number of cable links and IO ports needed.
Solution:
Number of devices = 8
Number of links = n (n-1)/2
= 8(8-1)/2
= 28
Number of port/device = n-1
= 8-1 = 7
5. Tree Topology
Also known as Hierarchical Topology, this is the most common form of network topology in
use presently. This topology imitates as extended Star topology and inherits properties of bus
topology. This topology divides the network in to multiple levels/layers of network. Mainly
in LANs, a network is bifurcated into three types of network devices. The lowermost is
access-layer where computers are attached. The middle layer is known as distribution layer,
which works as mediator between upper layer and lower layer. The highest layer is known as
core layer, and is central point of the network, i.e. root of the tree from which all nodes fork.
6. Hybrid Topology
A network structure whose design contains more than one topology is said to be hybrid
topology. Hybrid topology inherits merits and demerits of all the incorporating topologies.
The above picture represents an arbitrarily hybrid topology. The combining topologies may
contain attributes of Star, Ring, Bus, and Daisy-chain topologies. Most WANs are connected
by means of Dual-Ring topology and networks connected to them are mostly Star topology
networks. Internet is the best example of largest Hybrid topology.
Because of its structure, the coax cable is capable of carrying high frequency signals than that
of twisted pair cable. The wrapped structure provides it a good shield against noise and cross
talk.
1.2 Coaxial cables
provide high bandwidth rates of up to 450 mbps.
There are three categories of coax cables namely,
RG-59 (Cable TV), RG-58 (Thin Ethernet), and RG-11 (Thick Ethernet).
RG stands for Radio Government.
Cables are connected using BNC connector and BNC-T. BNC terminator is used to terminate
the wire at the far ends.
Power Lines
Power Line communication (PLC) is Layer-1 (Physical Layer) technology which uses power
cables to transmit data signals. In PLC, modulated data is sent over the cables. The receiver
on the other end de-modulates and interprets the data. Because power lines are widely
deployed, PLC can make all powered devices controlled and monitored. PLC works in half-
duplex.
There are two types of PLC:
Narrow band PLC
Broad band PLC
Narrow band PLC provides lower data rates up to 100s of kbps, as they work at lower
frequencies (3-5000 kHz).They can be spread over several kilometres.
Broadband PLC provides higher data rates up to 100s of Mbps and works at higher
frequencies (1.8 – 250 MHz).They cannot be as much extended as Narrowband PLC.
Radio frequency is easier to generate and because of its large wavelength it can penetrate
through walls and structures alike. Radio waves can have wavelength from 1 mm – 100,000
km and have frequency ranging from 3 Hz (Extremely Low Frequency) to 300 GHz
(Extremely High Frequency). Radio frequencies are sub-divided into six bands. Radio waves
at lower frequencies can travel through walls whereas higher RF can travel in straight line
and bounce back. The power of low frequency waves decreases sharply as they cover long
distance. High frequency radio waves have more power. Lower frequencies such as VLF, LF,
MF bands can travel on the ground up to 1000 kilometers, over the earth’s surface.
ENCODING METHODS
1. Digital-to-Digital Conversion
2. Analog to digital conversion
3. Digital-to-Analog Conversion
Digital-to-Digital Conversion
This section explains how to convert digital data into digital signals. It can be done in two
ways, line coding and block coding. For all communications, line coding is necessary
whereas block coding is optional.
Line Coding The process for converting digital data into digital signal is said to be Line
Coding. Digital data is found in binary format. It is represented ( stored) internally as series
of 1s and 0s.
Uni-polar Encoding
Unipolar encoding schemes use single voltage level to represent data. In this case, to
represent binary 1, high voltage is transmitted and to represent 0, no voltage is transmitted. It
is also called Unipolar-Non-return-to-zero, because there is no rest condition i.e. it either
represents 1 or 0.
Polar Encoding
Polar encoding scheme uses multiple voltage levels to represent binary values. Polar
encodings is available in four types:
Polar Non-Return to Zero (Polar NRZ)
It uses two different voltage levels to represent binary values. Generally, positive voltage
represents 1 and negative value represents 0. It is also NRZ because there is no rest condition.
NRZ scheme has two variants: NRZ-L and NRZ-I.
Block Coding
Analog-to-Digital Conversion
Microphones create analog voice and camera creates analog videos, which are treated is
analog data. To transmit this analog data over digital signals, we need analog to digital
conversion. Analog data is a continuous stream of data in the wave form whereas digital data
is discrete. To convert analog wave into digital data, we use Pulse Code Modulation
(PCM).PCM is one of the most commonly used methods to convert analog data into digital
form. It involves three steps:
Sampling
Quantization
Encoding.
Sampling
The analog signal is sampled every T interval. Most important factor in sampling is the rate at
which analog signal is sampled. According to Nyquist Theorem, the sampling rate must be at least
two times of the highest frequency of the signal.
Quantization
When binary data represents digit 1, the amplitude is held; otherwise it is set to 0. Both frequency and
phase remain same as in the original carrier signal.
Frequency Shift Keying
This technique uses two frequencies, f1 and f2. One of them, for example f1, is chosen to represent
binary digit 1 and the other one is used to represent binary digit 0. Both amplitude and phase of the
carrier wave are kept intact.
Phase Shift Keying
In this conversion scheme, the phase of the original carrier signal is altered to reflect the binary data.
When a new binary symbol is encountered, the phase of the signal is altered.
Amplitude and frequency of the original carrier signal is kept intact.
Quadrature Phase Shift Keying
QPSK alters the phase to reflect two binary digits at once. This is done in two different phases. The
main stream of binary data is divided equally into two sub-streams. The serial
data is converted in to parallel in both sub-streams and then each stream is converted to digital signal
using NRZ technique. Later, both the digital signals are merged together.
Analog-to-Analog Conversion
Analog signals are modified to represent analog data. This conversion is also known as Analog
Modulation. Analog modulation is required when bandpass is used. Analog to analog conversion can
be done in three ways:
The amplitude and phase of the carrier signal are not altered.
Phase modulation is practically similar to Frequency Modulation, but in Phase modulation frequency
of the carrier signal is not increased. Frequency of carrier is signal is changed (made dense and
sparse) to reflect voltage change in the amplitude of modulating signal.
To reduce the complexity of getting all the functions maintained by one a new technique
called layering technology was introduced. In this, the architecture contains several layers and each
layer is responsible for certain functions. The general idea is that the services offered by underlying
hardware, and then add a sequence of layers, each providing a higher level of service. The services
provided at the higher layers are implemented in terms of the services provided by the lower layers. A
simple network has two layers of abstraction sandwiched between the application program and the
underlying hardware.
ISO / OSI MODEL:
Open System Interconnect is an open standard for all communication systems. OSI model
is established by International Standard Organization (ISO). This model has seven layers:
ISO refers International Standards Organization was established in 1947, it is a multinational body
dedicated to worldwide agreement on international standards.
OSI refers to Open System Interconnection that covers all aspects of network communication. It is a
standard of ISO.
Here open system is a model that allows any two different systems to communicate regardless of their
underlying architecture. Mainly, it is not a protocol it is just a model.
OSI MODEL
The open system interconnection model is a layered framework. It has seven separate but interrelated
layers. Each layer having unique responsibilities.
It coordinates the functions required to carry a bit stream over a physical medium. Encoding to be
transmitted, bits must be encoded into signals, electrical or optical. Data rate it defines the
transmission rate (number of bits sent per second).
Physical topology It defines how devices are connected (mesh, star, ring, bus or hybrid) Transmission
mode Defines the direction of transmission between two devices: simplex, half-duplex, or full-duplex
The physical layer coordinates the functions required to transmit a bit stream over a physical medium.
It deals with the mechanical and electrical specifications of the interface and the transmission
medium.
The functions are,
1. Physical Characteristics of Interfaces and Media:
2. Representation of Bits
3. Data Rate
4. Synchronization of Bits
5. Line Configuration
6. Physical Topology
7. Transmission Mode
DATALINK LAYER
Network Layer
When the sender is in one network and the receiver is in some other network then the
network layer has the responsibility for the source to destination delivery.
Transport Layer
Port addressing: It includes a service-point or port address so that a process from one computer
communicates to a specific process on the other computer.
Segmentation and reassembly: A message is divided into transmittable segments, each containing a
sequence number. These numbers enable the transport layer to reassemble the message correctly at the
destination and to identify which were lost / corrupted.
Connection control: Protocols can be either connectionless or connection-oriented.
Session Layer
It establishes, maintains, and synchronizes interaction among communicating systems.
Internet uses TCP/IP protocol suite, also known as Internet suite. This defines Internet
Model which contains four layered architecture. OSI Model is general communication model
but Internet Model is what the internet uses for all its communication. The internet is
independent of its underlying network architecture so is its Model.
This model has the following layers:
Application Layer: This layer defines the protocol which enables user to interact with the
network. For example, FTP, HTTP etc.
Transport Layer: This layer defines how data should flow between hosts. Major protocol at
this layer is Transmission Control Protocol (TCP). This layer ensures data delivered between
hosts is in-order and is responsible for end-to-end delivery.
Internet Layer: Internet Protocol (IP) works on this layer. This layer facilitates host
addressing and recognition. This layer defines routing.
Link Layer: This layer provides mechanism of sending and receiving actual data. Unlike its
OSI Model counterpart, this layer is independent of underlying network architecture and
hardware.T he internet architecture evolved out of experiences with an earlier packet
switched network called the ARPANET. Both the Internet and the ARPANET were funded
by the Advanced Research Projects Agency (ARPA).
The Internet and ARPANET were around before the OSI architecture, and the experience
gained from building them was a major influence on the OSI reference model. Instead of
having seven layers, a four layer model is often used in Internet.
At the lowest level are a wide variety of network protocols, denoted NET1, NET2 and so on.
The second layer consists of a single protocol the Internet Protocol IP. It supports the
interconnection of multiple networking technologies into a single, logical internetwork. The
third layer contains two main protocols the Transmission Control Protocol (TCP) and User
Datagram Protocol (UDP).
TCP provides a reliable byte stream channel, and UDP provides unreliable datagram delivery
channel. They are called as end to end protocol they can also be referred as transport
protocols. Running above the transport layer, a range of application protocols such as FTP,
TFTP, Telnet, and SMTP that enable the interoperation of popular applications.
sin.sin_family = AF_INET;
bcopy(hp->h_addr, (char *)&sin.sin_addr, hp->h_length);
sin.sin_port = htons(SERVER_PORT);
/* active open */
}
if ((bind(s, (struct sockaddr *)&sin, sizeof(sin))) < 0) {
perror("simplex-talk: bind"); exit(1);
}
listen(s, MAX_PENDING);
/* wait for connection, then receive and print text */
while(1) {
Consider a pipe, in which bandwidth is given by diameter and delay corresponds to length of the pipe.
The delay × bandwidth product specifies the number of bits in transit. It corresponds to how much the
sender should transmit before the first bit is received at the other end. If receiver signals the sender to
stop, it would still receive RTT × bandwidth of data. For example, for a cross-country fiber with 10
Gbps bandwidth, distance of 4000 km, the RTT is 40 ms and RTT × bandwidth is 400 Mb.
High-Speed Networks
The bandwidths available on today’s networks are increasing at a dramatic rate, and there is eternal
optimism that network bandwidth will continue to improve. This causes network designers to start
thinkingabout what happens in the limit or, stated another way, what is the impact on network design
of having infinite bandwidth available.
It has several functions like Data link layer is one of the OSI layers which define the packet format
exchanged between the nodes.
Framing
Link access
Flow control
Reliable delivery
Error detection
Error correction
Half duplex
Full duplex
Data link layer design issues:
The data link layer has a number of specific functions it can carry out. These functions include
Providing a well-defined service interface to the network layer
Dealing with transmission errors.
Regulating the flow of data. So, that slow receivers are not swamped by fast senders.
To achieve 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.The
relationship betwe en packets and frames is represented below:
The function of the data link layer is to provide services to the network Layer. The principal
service is transferring data from the network layer on the source machine to network layer on
the destination machine. On the source machine is an entity, call it a process in the network
layer for transmission to the destination. The job of data link layer is to transmit the bits to
the destination machine. So, they can be handed over to the network layer.
The data link layer can be designed to offer various services. The actual services offered can vary
from system to system.
The possibilities that are commonly provide are
1. Unacknowledged connectionless service.
2. Acknowledged connectionless service.
3. Acknowledged connection oriented service.
1. Unacknowledged connectionless service:
It consists of having the source machine send independent frames to the destination machine without
having the destination machine acknowledge them. No logical connection is established beforehand or
released afterward. If a frame is lost due to noise on the line, no attempt is made to detect the loss
recover from it in the data link layer. Most LANs use unacknowledged connectionless service in the
data link layer.
2. Acknowledged connectionless service:
When this service is offered, 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. If it
has not arrived within a specified time interval, it can be sent again. This service is useful over
unreliable channels like wireless systems.
The most sophisticated service the data link layer can provide to the network layer connection
oriented service. With this service, the source and destination machines establish a connection before
any data are transferred. Each frame sent over the connection is numbered and the data link layer
guarantee that each frame sent is indeed received. Also, it assures that each frame is received exactly
once and that all frames are received in the right order.
(b) Framing:
The incoming data unit from network layer is splitted into more number of small data units.
(c) Error control:
It is provided as a function in order to find the error and to resend the lost or damaged data frame.
Also error control is used to overcome the duplication problem.
(d) Flow control:
If the rate at which data are taken by the destination entity is less than sender rate then a flow control
concept is employed to stop the overwhelming or destination entity.
To transmit frames over the node it is necessary to mention start and end of each frame.
There are three techniques to solve this frame
Byte-Oriented Protocols (BISYNC, PPP, DDCMP)
Bit-Oriented Protocols (HDLC)
Clock-Based Framing (SONET)
1.8.1 Byte Oriented protocols
In this, view each frame as a collection of bytes (characters) rather than a collection of bits. Such a
byte-oriented approach is exemplified by the BISYNC (Binary Synchronous Communication)
protocol and the DDCMP (Digital Data Communication Message Protocol) Sentinel Approach the
BISYNC protocol i illustrates the sentinel approach to framing; its frame format is the beginning of a
frame is denoted by sending a special SYN (synchronization) character.
The data portion of the frame is then contained between special sentinel characters: STX (start of text)
and ETX (end of text).
The SOH (start of header) field serves much the same purpose as the STX field.
The frame format also includes a field labeled CRC (cyclic redundancy check) that is used to detect
transmission errors.
The problem with the sentinel approach is that the ETX character might appear in the data portion of
the frame.
BISYNC overcomes this problem by ―escaping‖ the ETX character by preceding it with a DLE (data-
link-escape) character whenever it appears in the body of a frame; the DLE character is also escaped
(by preceding it with an extra DLE) in the frame body. This approach is called character stuffing.
Point-to-Point Protocol (PPP)
The more recent Point-to-Point Protocol (PPP). The format of PPP frame is
Byte-Counting Approach
The number of bytes contained in a frame can he included as a field in the frame header. DDCMP
protocol is used for this approach. The frame format is COUNT Field specifies how many bytes are
contained in the frame’s body. Sometime count field will be corrupted during transmission, so the
receiver will accumulate as many bytes as the COUNT field indicates. This is sometimes called a
framing error. The receiver will then wait until it sees the next SYN character.
Synchronous Optical Network Standard is used for long distance transmission of data over optical
network.It supports multiplexing of several low speed links into one high speed links.An STS-1 frame
is used in this method.
It is arranged as nine rows of 90 bytes each, and the first 3 bytes of each row are overhead,with the
rest being available for data.The first 2 bytes of the frame contain a special bit pattern, and it is these
bytes that enable the receiver to determine where the frame starts.The receiver looks for the special bit
pattern consistently, once in every 810 bytes, since each frame is 9 x 90 = 810 bytes long
The STS-N frame can he thought of as consisting of N STS-1 frames, where the bytes from these
frames are interleaved; that is, a byte from the first frame is transmitted, then a byte from the second
frame is transmitted, and so on. Payload from these STS-1 frames can he linked together to form a
larger STS-N payload, such a link is denoted STS-Nc. One of the bits in overhead is used for this
purpose.
Data can be corrupted during transmission. For reliable communication, errors must be
detected and corrected.
Types of Errors
1. Single-bit error
2. Burst Error
1.Single-bit error
The term Single-bit error means that only one bit of a given data unit (such as byte, character,
data unit or packet) is changed from 1 to 0 or from 0 to 1.
2. Burst Error
The term Burst Error means that two or more bits in the data unit have changed from 1 to 0 or
from 0 to 1.
Redundancy One method is to send every data twice, so that receiver checks every bit of two copies
and detect error.
Drawbacks
Sends n-redundant bits for n-bit message. Many errors are undetected if both the copies are corrupted.
Instead of adding entire data, some bits are appended to each unit. This is called redundant bit
because the bits added will not give any new information. These bits are called error detecting codes.
1.Parity Check
Simple parity check Only one redundant bit, called parity bit is added to every data unit so that the
total number of 1’s in unit become even (or odd).
Two Dimensional Parity
It is based on simple parity. It performs calculation for each bit position across each byte in the frame.
This adds extra parity byte for entire frame, in addition to a parity bit for each byte.
In the sender side all the words are added and then transmit the result of sum called checksum
with the data.
The receiver performs the same calculation on the received data and compares the result with
the received checksum.
If any transmitted data, including the checksum itself, is corrupted, then the results will not
match, so the receiver knows that an error occurred. Instead of sending the checksum as such,
one’s complement of that sum will be send to the receiver. If the receiver gets the result as
zero then it will be the correct one.In this, we can represent unsigned number from 0 to 2 n
Steps
Append k-1 zeros with M(x) – P(x)
Divide P(x) by C(x)
Subtract the remainder from T(x)
Subtraction is made by making XOR operation
Eg: 100100 by 1101
ERROR CORRECTION
Error Correction can be handled in two ways
1. When an error is discovered, the receiver can have the sender to retransmit the entire data
unit.
2. A receiver can use an error correcting code, which automatically correct certain errors.
Error correcting codes are more sophisticated than error-detection codes and require more
redundancy bits.In single bit error detection only two states are sufficient.
1) Error
2) No error
Two states are not enough to detect an error but not to correct it.
Redundancy Bits
To calculate the number of redundancy bit(r) required to correct a given number of data bits
(m), we must find a relationship between m and r.
Add m bits of data with r bits. The length of the resulting code is m+r.
Data and Redundancy bits
Hamming Code
R.W. Hamming provides a practical solution for the error correction. Positioning the
Redundancy Bits For example, a seven-bit ASCII code requires four redundancy bits that can
be added to the end of the data or intersperse with the original data bits. These redundancy
bits are placed in positions 1, 2, 4 and 8. We refer these bits as r1, r2, r3 and r4
Position of redundancy bits in Hamming code
The receiver takes the transmission and recalculates four new data using the same set of bits
used by the sender plus the relevant parity (r) bit for each set.
Error detection
The Hamming distance can be found by applying the XOR operation on the two words and
Count the number of 1’s in the result. In a set of words, the minimum Hamming distance is
the smallest Hamming distance between all possible pairs. We use dmin to define the
minimum Hamming distance in a coding scheme.
It refers to a set of procedures used to restrict the amount of data flow between sending and
Receiving stations. It tells the sender how much data it can transmit before it must wait for an
Acknowledgement from the receiver.
There are two methods are used. They are,
In this method, the sender can transmit several frames before needing an acknowledgment.
The receiver acknowledges only some of the frames, using a single ACK to confirm the
receipt of multiple data frames.
The sliding window refers to imaginary boxes at both the sender and receiver. This window
Provides the upper limit on the number of frames that can be transmitted before requiring an
Acknowledgement. To identify each frame the sliding window scheme introduces the
sequence number. The frames are numbered as 0 to n-1. And the size of the window is n-1.
Here the size of the window is 7 and the frames are numbered as 0,1,2,3,4,5,6,7.
SENDER WINDOW:
At the beginning the sender’s window contains n-1 frames. As frames are sent out the left
Boundary of the window moves inward, shrinking the size of the window. Once an ACK
receives the window expands at the right side boundary to allow in a number of new frames
equal to number of frames acknowledged by that ACK.
Error control is implemented in such a way that every time an error is detected, a negative
acknowledgement is returned and the specified frame is retransmitted. This process is called
Automatic Repeat Request (ARQ).
The error control is implemented with the flow control mechanism. So there are two types in
error control. They are,
1. Stop and wait ARQ
2. Sliding window ARQ
1. STOP AND WAIT ARQ:
It is a form of stop and wait flow control, extended to include retransmission of data in case
of lost or damaged frames.
DAMAGED FRAME:
When a frame is discovered by the receiver to contain an error, it returns a NAK frame and
the sender retransmits the last frame.
WINDOW ARQ
It is used to send multiple frames per time. The number of frame is according to the window
size. The sliding window is an imaginary box which is reside on both sender and receiver
side.It has two types. They are,
1. Go-Back-n ARQ
GO-BACK-N ARQ:
In this method, if one frame is lost or damaged, all frames sent since the last frame
Acknowledged or retransmitted.
DAMAGED FRAME:
LOST FRAME:
Selective repeat ARQ re transmits only the damaged or lost frames instead of sending
multiple frames. The selective transmission increases the efficiency of transmission and is
more suitable for noisy link. The receiver should have sorting mechanism
DAMAGED FRAME:
LOST ACK