NS Unit 1 notes_5fddd0c4737f6c19f0ca3e38e31e9c56
NS Unit 1 notes_5fddd0c4737f6c19f0ca3e38e31e9c56
Overview of Networks and its Attributes – Network Models – OSI, TCP/IP, Addressing
– Physical Layer – Overview of Data and Signals-Introduction to Data link layer-Error
Detection and Correction
Data Communications
• Data communications are the exchange of data between two devices via some form of
transmission medium such as a wire cable.
• Delivery. The system must deliver data to the correct destination. Data must be received by the
receiver device.
• Accuracy. The system must deliver the data accurately. Data that have been altered (changed
during transmission) in transmission and left uncorrected are unusable.
• Timeliness. The system must deliver data in exact time. Data delivered late are useless.
In the case of video and audio, timely delivery means delivering data as they are produced, in the
same order that they are produced, and without (any delay) significant delay. This kind of
deliveryiscalledreal-timetransmission.
• Jitter. Jitter refers tothevariation in thepacket arrivaltime. It istheuneven delay in the delivery of
audio and video packets.
For example, let us assume that video packets are sent every 30 ms. If some of the packets
arrive with 30-ms delay and others with 40-ms delay, an uneven quality in the video occurs.
1
Components Required
b) Sender:
The sender is the device that sends the data message. It can be a computer, workstation,
telephone handset, video camera, and so on.
c) Receiver:
The receiver is the device that receives the message. It can be a computer, workstation,
telephone handset, television, and so on.
d) 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.
e) Protocol. A protocol is a set of rules that govern data communications. It represents an agreement
between the communicating devices (Between sender and Receiver). Withoutaprotocol,twodevices
may be connected but not communicating, just as a person speaking French cannot be
understood by a person who speaks only Japanese.
Data Representation:
Information today (available) comes in different forms such as text, numbers, images, audio,
and Video.
A) Text:
Text is represented as a bit pattern, a sequence of bits (0s or 1s).
What is bit pattern? All data inside a computer is transmitted as a series of electrical signals
that are either on or off. Therefore, in order for a computer to be able to process any kind of data,
including text, images and sound, they must be converted into binary form. Different sets of bit
patterns have been designed to represent text symbols. Each set is called a code, and the process of
representing symbols is called coding.
2
B) Numbers:
Numbers are also represented by bit patterns. The number is directly converted to a binary number
to simplify mathematical operations. ie: Conversion of decimal to binary.
C) Images:
Images are also represented by bit patterns.
Representing image by bit pattern: Images also need to be converted into binary in order
for a computer to process them so that they can be seen on our screen. Digital images are made up of
pixels. Each pixel in an image is made up of binary numbers. If we say that 1 is black (or on) and 0 is
white(oroff), thena simple black and white picture can be created using binary.
D) Audio:
Audio refers to the recording or broadcasting of sound or music. It is continuous, not discrete.
E) Video:
Video refers to the broadcasting of a picture or movie. Video can either be produced as a
continuous entity (e.g., by a TV camera), or it can be a combination of images, which is a discrete entity
and can be arranged to convey the idea of motion.
Data Flow
Communication between two devices can be simplex, half-duplex, or full-duplex and is shown in
Fig1.2.
a) Simplex:
In simplex mode, the communication is unidirectional, as on a one-way street. Only one of the two
devices on a link can transmit; the other can only receive (see Figure 1.2a). Keyboards and
traditional monitors are examples of simplex devices. In Simplex mode, the
communicationisunidirectional,i.e.,thedataflowinonedirection.
• A device can only send the data but cannot receive it or it can receive the data but cannot send the
data.
• This transmission mode is not very popular as mainly communications require the two-way
exchange of data. The simplex mode is used in thebusiness field as in sales that do not require any
corresponding reply.
• The radio station is a simplex channel as it transmits the signal to the listeners but never allows
them to transmit back.
3
b) Half-Duplex:
In half-duplex mode, each station can both transmit and receive, but not at the same time. When one
device is sending, the other can only receive, and vice versa (see Figure 1.2b). Messages flow in both
the directions, but not at the same time.
• Theentirebandwidthofthe communication channelisutilized inonedirection at a time.
• In half-duplex mode, it is possible to perform the error detection, and if any error occurs, then the
receiver requests the sender to retransmit the data. Walkie- talkies are half-duplex
systems.
c) Full-Duplex:
In full-duplex mode (also called duplex), both stations can transmit and receive
simultaneously (at the same time), (see Figure 1.2c).
Example of full-duplex communication is the telephone network.
When two people are communicating by a telephone line, both can talk and listen at the same time.
NETWORKS
Q1. Present the evolution and the types of Networks. (13 marks)[Nov/dec
2021]
What is a Network?
A network is the interconnection of a set of devices capable of communication. A device can be a
host (called as end system) such as a large computer, desktop, laptop, workstation, cellular
phone, or security system.
4
Network Criteria
Anetworkmustbeabletomeetacertainnumberofcriteria. Themostimportantof these are
performance, reliability, and security.
A) 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.
B) Reliability
In addition to accuracy ofdelivery, network reliabilityis measured bythe frequencyoffailure,the
timeittakesalinktorecoverfromafailure,andthe network’s robustness in a catastrophe.
C) Security
Networksecurityissuesincludeprotectingdatafromunauthorizedaccess, protecting data from
damage and development, and implementing policies and procedures for recovery from data
losses.
Multipoint: A multipoint (also called multidrop) connection is one in which more than two
specific devices share a single link (see Figure1.3 below). In a multipoint environment,the
capacity of the channel is shared, either spatially or 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.
5
Physical Topology (Network Topology)
The term physical topology refers to the way in which a network is laid out physically. Two or
more devices connect to a link; two or more links form a topology.
Thetopologyofanetworkisthegeometricrepresentationoftherelationshipofall the links and
linking devices (usually called nodes) to one another.
There are four basic Topologies: mesh, star, bus, and ring.
A. Mesh Topology:
Inameshtopology, everydevicehasadedicated point-to-pointlinktoeveryother device as shown
in Fig 1.4. A fully connected mesh network with n nodes has n (n -
1) /2 physicalchannels.
Advantages:
• 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.
• A mesh topology is robust. If one link becomes unusable, it does not incapacitate the entire
system.
• Privacy orsecurity.
• Point-to-point links make fault identification and fault isolation easy.
Disadvantages:
• Every device must be connected to every other device. Installation and reconnection aredifficult.
• More number of wire connections make it greater than the available space (in walls, ceilings, or
floors) which can accommodate.
• Thehardwarerequiredtoconnecteachlink(I/Oportsandcable)canbe expensive.
One practical example of a mesh topology is the connection of telephone regional offices
inwhicheachregionalofficeneedstobeconnectedtoeveryotherregional office.
B. Star Topology:
In a star topology, each device has a dedicated point-to-point link only to a central controller,
usuallycalled ahub.Thedevicesarenotdirectlyconnectedtooneanother. Unlike a mesh topology, A
star topology does not allow direct traffic between devices. Thecontrolleractsasanexchange:Ifone
device wants to send data to another, it sends the data to the controller, which then relays the data to
theotherconnecteddevice(see Figure1.5).
6
Fig1.5: Star topology
Advantages:
• Less expensive than a mesh topology.
• Easy to install and reconfigure.
• Less cables are required, and additions, and deletions involve only one connection: between that
device and the hub.
• ItisRobust.Ifonelinkfails,onlythatlinkisaffected.Allotherlinksremain active.
Disadvantages:
• The topology depends on one single point, the hub. If the hub goes down, the whole system is
dead.
• A star requires far less cable than a mesh; each node must be linked to a central hub. The star topology
is used in local-area networks (LANs). High- speed LANs also use a star topology with a central
hub.
C. Bus Topology:
Advantages:
• Ease of installation.
• Less cabling
7
Disadvantages:
• Difficult reconfiguration and fault isolation.
• Difficult to add new devices.
• Signal reflection at top can cause degradation in quality.
• If any fault in backbone occurs, then it can stop all transmission.
Ethernet LANs can use a bus topology, but they are less popular now.
D. 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
along them (see Figure1.7).
Advantages:
• Easy toinstall.
• Easy toreconfigure.
• Fault identification is easy.
Disadvantages:
• Unidirectional traffic.
• Break in a single ring can break entire network.
Ring topologies are found in some office buildings or school campuses. Today high- speed LANs
made this topology less popular.
E. Tree Topology
Tree topology is shown in Fig 1.8.
• It has a root node and all other nodes are connected to it forming a hierarchy.
• It is also called hierarchical topology.
• It should at least have three levels to the hierarchy.
• Tree topology is ideal if workstations are located in groups.
• They are used in Wide Area Network.
8
Fig 1.8: Tree Topology
F. Hybrid Topology
• Hybrid Topology (see Fig 1.9) is a combination of one or more basic topologies.
• For example if one department in an office uses ring topology, the other departments uses star
and bus topology, then connecting these topologies will result in Hybrid Topology.
• Hybrid Topology inherits the advantages and disadvantages of the topologies included.
9
Local Area Network
10
Fig 1.11 Wide Area Network
A) Point-to-Point WAN
A point-to-point WAN (see Fig1.12) is a network that connects two communicating devices through
a transmission media (cable or air).
B) Switched WAN
A switched WAN is a network with more than two ends (see Fig1.13). A switched WAN is a
combination of several point-to-point WANs that are connected by switches.
• A metropolitan area network is a network that covers a larger geographic area by interconnecting a
11
different LAN to form a larger network.
• It generally covers towns and cities (50 km)
• In MAN, various LANs are connected to each other through a telephone exchange line.
• Communication medium used for MAN are optical fibers, cables etc.
• It has a higher range than Local Area Network (LAN).It is adequate for distributed
computingapplications.
When two or more networks are connected, they make an internetwork or internet. As an
example, assumethat an organization has two offices, one on the east coast and theotheronthewest
coast.EachofficehasaLANthatallowsallemployeesintheoffice to communicate with each other.
Switching
An internet is a switched network in which a switch connects at least two links
together. A switch needs to forward data from a network to another network when required. The
two most common types of switched networks are circuit-switched and packet-switched
networks.
A) Circuit-Switched Network
The four telephones at each side are connected to a switch. The switch connects a telephone set
at one side to a telephone set at the other side. The thick line connecting two switches is a high-
capacity communication line that can handle four voice communications at the same time;
the capacity can be shared between all pairs of telephone sets.
12
B) Packet-Switched Network
• In other words, instead of the continuous communication between two telephone sets
when they are being used, we see the exchange of individual data packets between
the two computers.
• This allows us to make the switches function for both storing and forwarding because
a packet is an independent entity that can be stored and sent later.
• A router in a packet-switched network has a queue that can store and forward the
packet.
OVERVIEW OF INTERNET
The Internet
An internet (lower case i) is two or more networks that can communicate with each
other. The most notable internet is called the Internet (uppercase I), and is
composed of thousands of interconnected networks. Figure1.17 shows a conceptual
view of the Internet.
It shows the Internet as several backbones, provider networks, and customer networks.
At the top level, the backbones are large networks owned by some communication
companies such as Sprint, Verizon (MCI), AT&T, and NTT. The backbone networks are connected
throughsomecomplexswitchingsystems,calledpeeringpoints.
At the second level, there are smaller networks, called provider networks that use the
services of the backbones for a fee. The provider networks are connected to backbones and
sometimes to other provider networks.
The customer networks are networks at the edge of the Internet that actually use the
services provided by the Internet.
• The Internet today is an internetwork that allows any user to become part of it. The
user, however, needs to be physically connected to an ISP. The physical connection is
13
done through a point-to-point WAN.
Fig1.17: Internet
Since most telephone networks have already connected themselves to the Internet, one option for
residences and small businesses to connect to the Internet is to change the voice line between the
residence or business and the telephone center to a point-to- point WAN. This can be done in two
ways.
• Dial-up service. The first solution is to add to the telephone line a modem that
converts data to voice. The software installed on the computer dials the ISP and
imitates making a telephone connection.
• DSL Service.
The DSL service allows the line to be used simultaneously for voice and data
communication.
Q1. What are the key benefits of layered network?(2 marks)[NOV/DEC 2019]
When communication is simple, we need only one simple protocol; when the
communication is complex, we may need to divide the task between different layers,
in which case we need a protocol a teach layer, or protocol layering. Dividing the task
between different layers is called Protocol layering.
Need of layering:
It provides a more modular design. i.e, If we want to add new service, it require only
modifying the functionality at the respective layers and refusing the functions provided
at all other layers.
Scenarios
Two simple scenarios are available to understand the need for protocol layering.
First Scenario
In the first scenario, communication is simple that it can occur in only one layer.
Assume Maria and Ann are neighbors with a lot of common ideas. Communication
between Maria and Ann takes place in one layer, face to face, in the same language, as
shown in Figure1.18.
First, Maria and Ann know that they should greet each other when they meet. Second,
they know that they should confine their vocabulary to the level of their friendship.
Third, each party knows that she should refrain (not talking) from speaking when the
other party is speaking.
Fourth, each party knows that the conversation should be a dialog.
15
Fifth, they should exchange some nice words when they leave
Second Scenario
In the second scenario, we assume that Ann is offered a higher-level position in her
company, but needs to move to another branch located in a city very far from Maria.
The two friends still want to continue their communication and exchange ideas
because they have come up with an innovative project to start a new business when
they both retire. They decide to continue their conversation using regular mail
through the post office.
They do not want their ideas to be revealed by other people if the letters are
intercepted. They agree on an encryption/decryption technique. The sender of the
letter encrypts it to make it unreadable by an intruder; the receiver of the letter
decrypts it to get the original letter.
Let us assume that Maria sends the first letter to Ann. Maria talks to the machine at
the third layer as though the machine is Ann and is listening to her. The third layer
machine listens to what Maria says and creates the plaintext (a letter in English),
which is passed to the second layer machine. The second layer machine takes the
plaintext, encrypts it, and creates the ciphertext, which is passed to the first layer
machine.
The first layer machine, takes the ciphertext, puts it in an envelope, adds the sender
and receiver addresses, and mails it. Protocol layering enables us to divide a complex
task into several smaller and simpler tasks. For example, in the Figure 1.19, we could
have used only one machine to do the job of all three machines. However, if Maria and
Ann decide that the encryption/decryption done by the machine is not enough to
protect their secrecy, they would have to change the whole machine. In the present
situation, they need to change only the second layer machine; the other two can
remain the same. This is referred to as modularity.
16
Principles of Protocol Layering
First Principle
If we want bidirectional communication, we need to make each layer so that it is able
to perform two opposite tasks, one in each direction. For example, the third layer task
is to listen (in one direction) and talk (in the other direction). The second layer needs
to be able to encrypt and decrypt. The first layer needs to send and receive mail.
Second Principle
The second principle that we need to follow in protocol layering is that the two objects
under each layer at both sites should be identical. For example, the object under layer
3 at both sites should be a plaintext letter. The object under layer 2 at both sites
should be a cipher text letter. The object under layer 1 at both sites should be a piece
of mail.
Logical Connections
We have layer-to-layer communication. Maria and Ann can think that there is a logical
(imaginary) connection at each layer through which they can send the object created
from that layer.
Q1. Draw the OSI network architecture and explain the functionalities of every
layer in detail. (13 MARKS) [NOV/DEC 2015]
Q2. Draw the block diagram and explain the functionalities of different OSI layers.
(13 MARKS) [NOV/DEC 2019]
Q3. Data Link Control (DLC) and Media Access Control (MAC) are part of which
layer in OSI model? What is their role? (13 MARKS) [NOV/DEC 2020]
Q4. Discuss the layering principles of OSI mode of communication networks.
(13 MARKS) [NOV/DEC 2021]
17
ISO defines a common way to connect computer by the architecture called Open System
Interconnection(OSI) architecture. Network functionality is divided into seven layers.
B. Transport Layer
Layer4, transport layer, ensures end-to-end reliable data transmission on a single link.
18
Fig 1.22 A Data exchange using the OSI model
1. PHYSICAL LAYER
The physical layer coordinates the functions required to transmit a bit stream over a physical
medium.
⚫ Physical characteristics of interfaces and media - The physical layer defines the
characteristics of the interface between the devices and the transmission medium.
⚫ Representation of bits - To transmit the stream of bits, it must be encoded to signals.
The physical layer defines the type of encoding.
⚫ Data Rate or Transmission rate - The number of bits sent each second – is also
defined by the physical layer.
⚫ Synchronization of bits - The sender and receiver must be synchronized at thebit
level. Their clocks must be synchronized.
⚫ Line Configuration - In a point-to-point configuration, two devices are connected
together through a dedicated link. In a multipoint configuration, a link is shared
between several devices.
⚫ Physical Topology - The physical topology defines how devices are connectedto
make a network. Devices can be connected using a mesh, bus, star or ring topology.
19
⚫ Transmission Mode - The physical layer also defines the direction of transmission
between two devices: simplex, half-duplex or full-duplex.
⚫ Framing - Divides the stream of bits received into data units called frames.
⚫ Physical addressing – If frames are to be distributed to different systems on the n/w,
data link layer adds a header to the frame to define the sender and receiver.
⚫ Flow control- If the rate at which the data are absorbed by the receiver is less than
the rate produced in the sender ,the data link layer imposes a flow control mechanism.
⚫ Error control- Used for detecting and retransmitting damaged or lost frames andto
prevent duplication of frames. This is achieved through a trailer added at the end of
the frame.
⚫ Access control -Used to determine which device has control over the link at any given
time.
3. NETWORK LAYER
This layer is responsible for the delivery of packets from source to destination.
20
4. TRANSPORT LAYER
It is responsible for Process to Process delivery. It also ensures whether the message arrives in
order or not.
• Port addressing - The header in this must therefore include an address called port
address. This layer gets the entire message to the correct process on that computer.
• Segmentation and reassembly - The message is divided into segments and each
segment is assigned a sequence number. These numbers are arranged correctly on
the arrival side by this layer.
• Connection control - This can either be connectionless or connection-oriented. The
connectionless treats each segment as an individual packet and delivers to the
destination. The connection-oriented makes connection on the destination side
before the delivery. After the delivery the termination will be terminated.
• Flow and error control - Similar to data link layer, but process to process take place.
5. SESSIONLAYER
6. PRESENTATION LAYER
21
Fig 1.28 Presentation Layer
7. APPLICATION LAYER
⚫ FTAM (file transfer, access, mgmt.) - Allows user to access files in a remote host.
⚫ Mail services - Provides email forwarding and storage.
⚫ Directory services - Provides database sources to access information about various sources and
objects.
22
TCP/IP PROTOCOL SUITE / TCP/IP REFERENCE MODEL [INTERNET
ARCHITECTURE]
Q1. Explain TCP/IP Model with neat sketch.
• The host-to-network layer is equivalent to the combination of the physical and data
link layers. The internet layer is equivalent to the network layer, and the application
layer is roughly doing the job of the session, presentation, and application layers with
the transport layer in TCPIIP taking care of part of the duties of the session layer. So,
the TCP/IP protocol suite is made of five layers:
physical, data link, network, transport, and application.
• The first four layers provide physical standards, network interfaces, internetworking,
and transport functions that correspond to the first four layers of the OSI model.
• The three topmost layers in the OSI model, however, are represented in TCPIIP by a
single layer called the application layer.
23
Fig 1.31 Flow of data between layers
Physical Layer
The physical layer is responsible for carrying individual bits in a frame across the link.
Although the physical layer is the lowest level in the TCP/IP protocol suite, the
communication between two devices at the physical layer is still a logical
communication because there is another, hidden layer, the transmission media, under
the physical layer.
• Two devices are connected by a transmission medium (cable or air).
• So, the bits received in a frame from the data-link layer are transformed and sent
through the transmission media, but the logical unit between two physical layers in
two devices is a bit.
• There are several protocols that transform a bit to a signal.
24
Data-link Layer
o An internet is made up of several links (LANs and WANs) connected by routers. There
may be several overlapping sets of links that a datagram can travel from the host to the
destination.
o The routers are responsible for choosing the best links. However, when the next link to
travel is determined by the router, the data-link layer is responsible for taking the
datagram and moving it across the link. The link can be a wired LAN with a link-layer
switch, a wireless LAN, a wired WAN, or a wireless WAN. It supports all the standard and
proprietary protocols.
o Any protocol that can take the datagram and carry it through the link suffices for the
network layer. The data-link layer takes a datagram and encapsulates it in a packet called
a frame. Each link-layer protocol may provide a different service. Some link-layer
protocols provide complete error detection and correction, some provide only error
correction.
Network Layer
• The network layer is responsible for creating a connection between the source computer
and the destination computer. The communication at the network layer is host-to-host.
• The network layer in the Internet includes the main protocol, Internet Protocol (IP), that
defines the format of the packet, called a datagram at the network layer. IP also defines
the format and the structure of addresses used in this layer. IP is also responsible for
routing a packet from its source to its destination, which is achieved by each router
forwarding the datagram to the next router in its path.
• At the network layer (or, more accurately, the internetwork layer), TCP/IP supports the
Internetworking Protocol. IP, in turn, uses four supporting protocols: ARP, RARP, ICMP,
and IGMP.
Transport Layer
• Traditionally the transport layer was represented in TCP/IP by two protocols: TCP and
UDP. IP is a host-to-host protocol, meaning that it can deliver a packet from one physical
device to another.
• UDP and TCP are transport level protocols responsible for delivery of a message from a
process (running program) to another process.
• The main protocol, Transmission Control Protocol (TCP), is a connection-oriented
protocol that first establishes a logical connection between transport layers at two hosts
before transferring data.
• TCP provides flow control, error control and congestion control to reduce the loss of
segments due to congestion in the network.
• The other common protocol, User Datagram Protocol (UDP), is a connectionless protocol
that transmits user datagrams without first creating a logical connection. In UDP, each
25
user datagram is an independent entity without being related to the
• previous or the next one. UDP is a simple protocol that does not provide flow, error, or
congestion control.
• A new protocol, Stream Control Transmission Protocol (SCTP) is designed to respond to
new applications that are emerging in the multimedia
Application Layer
• The application layer in TCP/IP is equivalent to the combined session, presentation, and
application layers in the OSI model. Many protocols are defined at this layer.
• Communication at the application layer is between two processes. The application layer
in the Internet includes many predefined protocols.
• The Hypertext Transfer Protocol (HTTP) is a vehicle for accessing the World Wide Web
(WWW).
• The Simple Mail Transfer Protocol (SMTP) is the main protocol used in electronic mail
(e-mail) service.
• The File Transfer Protocol (FTP) is used for transferring files from one host to another.
The Terminal Network (TELNET) and Secure Shell (SSH) are used for accessing a site
remotely.
26
Fig 1.32 OSI Verses TCP/IP
2. The transport layer takes the message as the payload, the load that the transport layer
should take care of. It adds the transport layer header to the payload, which contains
27
the identifiers of the source and destination application programs that want to
communicate plus some more information that is needed for the end-toend delivery
of the message, such as information needed for flow, error control, or congestion
control. The result is the transport-layer packet, which is called the segment (in TCP)
and the user datagram (in UDP). The transport layer then passes the packet to the
network layer.
3. The network layer takes the transport-layer packet as data or payload and adds its
own header to the payload. The header contains the addresses of the source and
destination hosts and some more information used for error checking of the header,
fragmentation information, and so on. The result is the network-layer packet, called a
datagram. The network layer then passes the packet to the data-link layer.
4. The data-link layer takes the network-layer packet as data or payload and adds its own
header, which contains the link-layer addresses of the host or the next hop (the
router). The result is the link-layer packet, which is called a frame. The frame is passed
to the physical layer for transmission.
3. The data-link layer of the next link encapsulates the datagram in a frame and
passes it to the physical layer for transmission.
Addressing
28
At the application layer, we normally use names to define the site that provides services,
such as someorg.com, or the e-mail address, such as [email protected]. At the
transport layer, addresses are called port numbers, and these define the application-layer
programs at the source and destination. Port numbers are local addresses that distinguish
between several programs running at the same time. At the network-layer, the addresses
are global, with the whole Internet as the scope. A network-layer address uniquely defines
the connection of a device to the Internet. The link-layer addresses, sometimes called MAC
addresses, are locally defined addresses, each of which defines a specific host or router in
a network (LAN or WAN).
PHYSICAL LAYER:
29
Physical Layer
30
Analog and Digital signal
1.7.1 ANALOG SIGNAL :
An analog signal has infinitely many levels of intensity over a period of time. As the wave
moves from value A to value B, it passes through and includes an infinite number of values
along its path as it can be seen in the figure below. A simple analog signal is a sine wave
that cannot be further decomposed into simpler signals.
Analog signal
A sine wave can be represented by three parameters: the peak amplitude, the
frequency, and the phase. These three parameters fully describe a sine wave.
Peak Amplitude
The peak amplitude of a signal is the absolute value of its highest intensity, proportional
to the energy it carries. For electric signals, peak amplitude is normally measured in volts.
Figure below shows two signals and their peak amplitudes.
Phase
The term phase, or phase shift, describes the position of the waveform relative to time.
31
Phase describes the amount of that shift. It indicates the status of the first cycle.
Composite Signals:
A composite signal is made of many simple sine waves. The bandwidth of a composite
signal is the difference between the highest and the lowest frequencies contained in that
signal.
Composite signal
32
1.7.2 DIGITAL SIGNALS:
Apart from analog signal, information can also be represented by a digital signal.
Digital signal
Bit Rate
The bit rate is the number of bits sent in 1s, expressed in bits per second (bps).
Bit Length
The bit length is the distance one bit occupies on the transmission medium.
Baseband Transmission
Baseband transmission means sending a digital signal over a channel without changing
the digital signal to an analog signal. Figure below shows baseband transmission.
Baseband transmission
’’
Broadband Transmission
TRANSMISSION IMPAIRMENT
34
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. Three causes of impairment are
attenuation, distortion, and noise.
a. Attenuation
Attenuation means a loss of energy. When a signal, simple or composite, travels
through a medium, it loses some of its energy in overcoming the resistance of the
medium. Some of the electrical energy in the signal is converted to heat. To
compensate for this loss, amplifiers are used to amplify the signal. The Figure
shows the effect of attenuation and amplification.
b. Distortion
Distortion means that the signal changes its form or shape. Distortion can occur in
a composite signal made of different frequencies. Each signal component has its
own propagation speed through a medium. Differences in delay may create a
difference in phase if the delay is not exactly the same as the period duration. The
shape of the composite signal is therefore not the same. The Figure shows the
effect of distortion on a composite signal.
35
Effect of distortion on signal
c. Noise
Noise is another cause of impairment. Several types of noise, such as thermal
noise, induced noise, crosstalk, and impulse noise, may corrupt the signal. Thermal
noise is the random motion of electrons in a wire which creates an extra signal not
originally sent by the transmitter. Induced noise comes from sources such as
motors and appliances.
PERFORMANCE
A. 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. It
Bandwidth in Hertz
B. Throughput
The throughput is a measure of how fast we can actually send data through a network.
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 ofthe link may handle only 200 kbps. This means that we cannot send more than
200 kbps through this link.
C.Latency(delay)
The latency or delay defines how long it takes for an entire message to completely
arrive at the destination fromthe time the first bit is sent out from the source. Latency
is made of four components: propagation time, transmission time, queuing time and
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.
Transmission Time
There is a time between the first bit leaving the sender and the last bit arriving at the
receiver. The first bit leavesearlier and arrives earlier; the last bit leaves later and arrives
later. The transmission time of a message depends on the size of the message and the
bandwidth of the channel.
D.Bandwidth-delay product
The bandwidth-delay product defines the number of bits that can fill the
link. Bandwidth and delay are twoperformance metrics of a link.
Case 1: Let us assume that we have a link with a bandwidth of 1 bps (unrealistic, but good
for demonstration purposes). We also assume that the delay of the link is 5 s (also
unrealistic). We want to see what the bandwidth- delay product means in this case.
Looking at the figure, we can say that this product 1 x 5 is the maximum numberof bits
that can fill the link. There can be no more than 5 bits at any time on the link.
Fig. Filling the link with bits for case 1
Case 2. Now assume we have a bandwidth of 5 bps. Figure shows that there can be
maximum 5 x 5 =25 bits on the line. The reason is that, at each second, there are 5 bits on
the line; the duration of each bit is 0.20 s. The abovetwo cases show that 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 beforesending 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; we need to fill up
the 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.
D. Jitter
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 thesecond is 45 ms, and for the third
is 40 ms, then the real-time application that uses the packets endures jitter.
The data-link layer at Alice’s computer communicates with the data-link layer at
routerR2. The data-link layer at router R2 communicates with the data-link layer at
router R4, and s on. Finally, the data-link layer at router R7 communicates with the data-
linklayer at Bob’s computer. Only one data-link layer is involved at the source or the
destination, but two data link layers are involved at each router. The reason is that Alice’s
and Bob’s computers are each connected to a single network, but each router takes input
from one network and sends output to another network.
• Communication at the data-link layer is node-to-node.A data unit from one point
in the Internet needs to pass through many networks (LANs and WANs) to reach
another point. Theses LANs and WANs are connected by routers. It is customary
to refer to the two end hosts and the routers as nodes and the networks in between
as links.
• Figure1.50 shows a simple representation of links and nodes when the path of the
data unit is only six nodes. The first node is the source host; the last node is the
destination host. The other four nodes are four routers. The first, the third, and
the fifth links represent the three LANs; the second and the fourth links represent
the two WANs.
B. Services
The data-link layer is located between the physical and the network layers. The data
link layer provides services to the network layer; it receives services from the physical
layer.
A. Framing
• The first service provided by the data-link layer is framing.
• The data-link layer at each node needs to encapsulate the datagram (packet received
from the network layer) in a frame before sending it to the next node.
• The node also needs to de capsulate the datagram from the frame received on the logical
channel.
• A packet at the data-link layer is normally called a frame
B. Flow Control
Controlling the flow of frames at the sender side to avoid overflow and loss of data at
the receiver side is called flow control.
If the rate of produced frames is higher than the rate of consumed frames, frames at the
receiving end need to be buffered while waiting to be consumed.
C. Error Control
• In a point-to-point link, the link is dedicated to the two devices; in a broadcast link, the
link is shared between several pairs of devices.
• For example, when two friends use the traditional home phones to chat, they are using a
Point-to-point link; when the same two friends use their cellular phones, they are using a
broadcast link.
Figure shows, IP addresses and link-layer addresses in a small internet. In the diagram,
three links and two routers. There are only two hosts: Alice (source) and Bob
(destination). For each host, we have shown two addresses, the IP addresses (N) and the
link-layer addresses (L).
A router has as many pairs of addresses as the number of links the router is connected to.
Three frames are shown, one in each link. Each frame carries the same datagram with the
same source and destination addresses (N1 and N8), but the link-layer addresses of the
frame change from link to link.
In link 1, the link-layer addresses are L1 and L2. In link 2, they are L4 and L5. In link 3,
they are L7 and L8.
The IP addresses and the link-layer addresses are not in the same order. For IP addresses,
the source address comes before the destination address; for link-layer addresses, the
destination address comes before the source.
Example
The unicast link-layer addresses in the most common LAN, Ethernet, are 48 bits (six bytes) that are
presented as 12 hexadecimal digits separated by colons; for example, the following is a link-layer
address of a computer.
A3:34:45:11:92:F1
B. Multicast Address
Some link-layer protocols define multicast addresses. Multicasting means one-to- many
communications.
Example
The multicast link-layer addresses in the most common LAN, Ethernet, are 48 bits (six bytes) that are
presented as 12 hexadecimal digits separated by colons. The second digit, needstobeanevennumberin
hexadecimal.Thefollowingshowsamulticastaddress:
A2:34:45:11:92:F1
C. Broadcast Address
Some link-layer protocols define a broadcast address. Broadcasting means one-to-all communication. A
frame with a destination broadcast address is sent to all entities in the link.
Example
The broadcast link-layer addresses in the most common LAN, Ethernet, are 48 bits, all 1s, that are
presented as 12 hexadecimal digits separated by colons.
The following shows a broadcast address:
The ARP protocol is one of the protocols defined in the network layer, as shown in Figure. It belongs to
the network layer. It maps an IP address to a logical-link address.
Fig1.53 ARP
• If a host or a router needs to find the link-layer address of another host or router in its network, it sends
an ARP request packet. The packet includes the link-layer and IP addresses of the sender and the IP
address of the receiver. Because the sender does not know the link-layer address of the receiver, the
query is broadcast over the link using the link-layer broadcast address.
• Every host or router on the network receives and processes the ARP request packet, but only the
intended recipient recognizes its IP address and sends back an AR response packet.
• The response packet contains the recipient’s IP and link-layer addresses. The packet is unicast directly
to the node that sent the request packet.
• In Figure, the system on the left (A) has a packet that needs to be delivered to another system (B) with IP
address N2. System A needs to pass the packet to its data-link layer for the actual delivery, but it does not
know the physical address of the recipient. It uses the services of ARP by asking the ARP protocol to send
a broadcast ARP request packet to ask for the physical address of a system with an IP address of N2. This
packet is received by every system on the physical network, but only system B will answer it, as shown
in Figure above.
• System B sends an ARP reply packet that includes its physical address. Now system A can send all the
packets it has for this destination using the physical address it received.
Packet Format
• Figure 1.55 shows the format of an ARP packet.
• The hardware type field defines the type of the link-layer protocol; Ethernet is given the type 1. The
protocol type field defines the network-layer protocol: IPv4 protocol is (0800)16.
• The source hardware and source protocol addresses are variable-length fields defining the link-layer and
network-layer addresses of the sender. The destination hardware address and destination protocol
address fields define the receiver link layer and network-layer addresses.
• An ARP packet is encapsulated directly into a data-link frame. The frame needs to have a field to show
that the payload belongs to the ARP and not to the network- layer datagram.
Example
Q1. Explain any two error detection mechanisms in detail. (13 marks)[MAY/JUNE
2016]
Q2. Obtain the 4 bit CRC for the data sequence 10011011100 using the polynomial
X4+X2+1
Q3. Enumerate any one method for error detection and any one method for
correction. . (13 marks)[NOV/DEC 2021]
Types of Errors
• Whenever bits flow from one point to another, they are subject to unpredictable
changes because of interference.
• The term single-bit error means that only 1 bit of a given data unit (such as a byte,
character, or packet) is changed from 1 to 0 or from 0 to 1.
• The term burst error means that 2 or more bits in the data unit have changed from 1 to
0 or from 0 to 1. Figure shows the effect of a single-bit and a burst error on a data unit.
• A burst error is more likely to occur than a single-bit error because the duration of the
noise signal is normally longer than the duration of 1 bit, which means that when noise
affects data, it affects a set of bits.
• The central concept in detecting or correcting errors is redundancy. To be able to detect
or correct errors, we need to send some extra bits with our data. These redundant bits
are added by the sender and removed by the receiver. Their presence allows the receiver
to detect or correct corrupted bits.
• In error detection, we are only looking to see if any error has occurred. The answer is a
simple yes or no. We are not even interested in the number of corrupted bits. A single-bit
error is the same for us as a burst error.
• In error correction, we need to know the exact number of bits that are corrupted and,
more importantly, their location in the message.
• Redundancy is achieved through various coding schemes. We can divide coding schemes
into two broad categories: block coding and convolution coding.
BLOCK CODING
• In block coding, we divide our message into blocks, each of k bits, called datawords. We
add r redundant bits to each block to make the length n = k + r. The resulting n-bit
blocks are called codewords.
• Figure shows the role of block coding in error detection. The sender creates codewords
out of datawords by using a generator that applies the rules and procedures of
encoding.
• Each codeword sent to the receiver may change during transmission. If the received
codeword is the same as one of the valid codewords, the word is accepted; the
corresponding dataword is extracted for use. If the received codeword is not valid, it is
discarded.
• However, if the codeword is corrupted during transmission but the received word still
matches a valid codeword, the error remains undetected.
Example: Even Parity
Let us assume that k = 2 and n = 3. Table shows the list of datawords and codewords.
Assume the sender encodes the dataword 01 as 011 and sends it to the receiver. Consider
the
following cases:
1. The receiver receives 011. 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.
Hamming Distance
• The Hamming distance between two words (of the same size) is the number of
differences between the corresponding bits.
• For example, if the codeword 00000 is sent and 01101 is received, 3 bits are in error
and the Hamming distance between the two is d(00000, 01101) = 3.
• The Hamming distance can easily be found if we apply the XOR operation on the two
words and count the number of 1s in the result.
Example
Let us find the Hamming distance between two pairs of words.
1. The Hamming distance d(000, 011) is 2 because (000 ⊕ 011) is 011 (two 1s).
2. The Hamming distance d(10101, 11110) is 3 because (10101 ⊕ 11110) is 01011
(three 1s).
Parity-Check Code
▪ Perhaps the most familiar error-detecting code is the parity-check code. This code is a
linear block code. In this code, a k-bit data word is changed to an n-bit codeword where
n = k + 1. The extra bit, called the parity bit, is selected to make the total number of 1s in
the codeword even.
▪ The minimum Hamming distance for this category is dmin = 2, which means that the
code is a single-bit error-detecting code.
Figure shows a possible structure of an encoder (at the sender) and a decoder (at the
receiver).
The encoder uses a generator that takes a copy of a 4-bit dataword (a0, a1, a2, and a3)
and generates a parity bit r0.
R0 = a3 + a2 + a1 + a0 (modulo-2)
• If the number of 1s is even, the result is 0; if the number of 1s is odd, the result is 1. In
both cases, the total number of 1s in the codeword is even.
• The sender sends the codeword, which may be corrupted during transmission. The
receiver receives a 5-bit word. The checker at the receiver does the same thing as the
generator in the sender with one exception: The addition is done over all 5 bits. The
result which is called the syndrome, is just 1 bit. The syndrome is 0 when the number of
1s in the received codeword is even; otherwise, it is 1.
S0 =b3 + b2 + b1 + b0 + q0 (modulo-2)
The syndrome is passed to the decision logic analyzer. If the syndrome is 0, there is no
detectable error in the received codeword; the data portion of the received code word is
accepted as the dataword; if the syndrome is 1, the data portion of the received
codeword is discarded.
Parity check bits are calculated for each row, which is equivalent to a simple parity checkbit.Paritycheck
bitsarealsocalculatedforallcolumns,thenbotharesent along withthedata. At the receivingend these
arecompared with theparitybits calculated on the received data.
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.
CRC is the subset of cyclic codes which is used in networks such as LANs and WANs.
DECODER
Example 2
Polynomials
A better way to understand cyclic codes and how they can be analyzed is to represent
them as polynomials.
The degree of a polynomial is the highest power in the polynomial. For example, the
degree of the polynomial x6 + x + 1 is 6.
Adding and Subtracting Polynomials
• Adding and subtracting polynomials in mathematics are done by adding or subtracting
the coefficients of terms with the same power. In our case, the coefficients are only 0 and
1, and adding is in modulo-2.
• Addition and subtraction are the same. Adding or subtracting is done by combining terms
and deleting pairs of identical terms.
• For example, adding x5 + x4 + x2 and x6 + x4 + x2 gives just x6 + x5. The terms x4 and x2
are deleted. However, note that if we add, for example, three polynomials and we get x2
three times, we delete a pair of them and keep the third.
Shifting
Shifting to the left means adding extra 0s as rightmost bits; shifting to the right means
deleting some rightmost bits.
Shifting to the left is accomplished by multiplying each term of the polynomial by xm,
where m is the number of shifted bits; shifting to the right is accomplished by dividing
each term of the polynomial by xm.
Check Sum
Procedure to calculate Traditional check sum
Traditionally, the Internet has used a 16-bit checksum. The sender and the receiver
follow the steps depicted in Table
Example1
Example 2
Fletcher Checksum
Adler Checksum
Hamming Code
Hamming code is a set of error-correction codes that can be used to detect and correct
the errors that can occur when the data is moved or stored from the sender to the
receiver. It is technique developed by R.W. Hamming for error correction.
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
number 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
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 are even or odd. Parity bits are used for error detection. There are two
types of parity bits:
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.
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 –
• The Hamming Code is simply the use of extra parity bits to allow the
identification of an error.
• Write the bit positions starting from 1 in binary form (1, 10, 11, 100, etc).
• All the bit positions that are a power of 2 are marked as parity bits (1, 2, 4, 8,
etc).
• All the other bit positions are marked as data bits.
• Each data bit is included in a unique set of parity bits, as determined its bit
position in binary form.
• 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).
• 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).
• 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).
• 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).
• In general each parity bit covers all bits where the bitwise AND of the parity
position and the bit position is non-zero.
• Since we check for even parity set a parity bit to 1 if the total number of ones in
the positions it checks is odd.
• Set a parity bit to 0 if the total number of ones in the positions it checks is even.
These redundancy bits are placed at the positions which correspond to the power of 2.
As in the above example:
Suppose the data to be transmitted is 1011001, the bits will be placed as follows:
1. R1 bit is calculated using parity check at all the bits positions whose binary representation
includes a 1 in the least significant position.
R1: bits 1, 3, 5, 7, 9, 11
To find the redundant bit R1, we check for even parity. Since the total number of 1’s in all the bit positions
correspondingtoR1isanevennumberthevalueofR1(parity bit’s value) = 0
2. R2 bit is calculated using parity check at all the bits positions whose binary representation
includes a 1in the second position from the least significant bit.
R2: bits 2,3,6,7,10,11
To find the redundant bit R2, we check for even parity. Since the total number of 1’s in all the bit positions
correspondingtoR2isan odd numberthevalueofR2(parity bit’s value)=1
3. R4 bit is calculated using parity check at all the bits positions whose binary representation
includes a 1 in the third position from the least significant bit.
R4: bits 4, 5, 6, 7
To find the redundant bit R4, we check for even parity. Since the total number of 1’s in all the bit positions
correspondingtoR4isanodd numberthevalueofR4(parity bit’s value) = 1
R8 bit is calculated using parity check at all the bits positions whose binary representation
includes a 1 in the fourth position from the least significant bit.
R8: bit 8,9,10,11
To find the redundant bit R8, we check for even parity. Since the total number of 1’s in all the bit positions
correspondingtoR8isanevennumberthevalueofR8(parity bit’s value)=0.
Thus, the data transferred is:
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, the
bit 6 contains an error. To correct the error the 6th bit is changed from 1 to 0.
The data-link layer is divided into two sublayers. Data link control (DLC) and Media
access control (MAC) layer.
Data link control functions include framing and flow and error control.
Framing
• Framing in the data-link layer separates a message from one source to a destination by
adding a sender address and a destination address. The destination address defines where
the packet is to go; the sender address helps the recipient acknowledge the receipt.
• Although the whole message could be packed in one frame, that is not normally done. One
reason is that a frame can be very large, making flow and error control very inefficient.
When a message is carried in one very large frame, even a single-bit error would require the
retransmission of the whole frame. When a message is divided into smaller frames, a single-
bit error affects only that small frame.
• Frames can be of fixed or variable size. In fixed-size framing, there is no need for defining
the boundaries of the frames; the size itself can be used as a delimiter. An example of this
type of framing is the ATM WAN, which uses frames of fixed size called cells.
• In variable-size framing, we need a way to define the end of one frame and the beginning
of the next. Two approaches were used for this purpose: a character- oriented approach and
a bit-oriented approach.
Character-Oriented Framing
• In character-oriented (or byte-oriented) framing, data to be carried are 8-bit characters from
a coding system such as ASCII. The header, which normally carries the source and
destination addresses and other control information, and the trailer, which carries error
detection redundant bits, are also multiples of 8 bits. To separate one frame from the next,
an 8-bit (1-byte) flag is added at the beginning and the end of a frame.
• The flag, composed of protocol-dependent special characters, signals the start or end of a
frame.
• Character-oriented framing was popular when only text was exchanged by the data- link
layers. The flag could be selected to be any character not used for text communication.
Now, however, we send other types of information such as graphs, audio, and video; any
character used for the flag could also be part of the information. If this happens, the receiver,
when it encounters this pattern in the middle of the data, thinks it has reached the end of the
frame.
• To fix this problem, a byte-stuffing strategy was added to character-oriented framing. In byte
stuffing (or character stuffing), a special byte is added to the data section of the frame when
there is a character with the same pattern as the flag. The data section is stuffed with an extra
byte. This byte is usually called the escape character (ESC) and has a predefined bit pattern.
• Whenever the receiver encounters the ESC character, it removes it from the data section
and treats the next character as data, not as a delimiting flag.
• Byte stuffing is the process of adding one extra byte whenever there is a flag or escape
character in the text.
Flow Control
• The figure shows that the data-link layer at the sending node tries to push frames toward
the data-link layer at the receiving node. If the receiving node cannot process and deliver
the packet to its network at the same rate that the frames arrive, it becomes overwhelmed
with frames. Flow control in this case can be feedback from the receiving node to the
sending node to stop or slow down pushing frames.
• Although flow control can be implemented in several ways, one of the solutions is normally
to use two buffers; one at the sending data-link layer and the other at the receiving data-
link layer. A buffer is a set of memory locations that can hold packets at the sender and
receiver. The flow control communication can occur by sending
signals from the consumer to the producer. When the buffer of the receiving data-link layer
is full, it informs the sending data-link layer to stop pushing frames.
Error Control
Error control at the data-link layer is normally very simple and implemented using one of
the following two methods. In both methods, a CRC is added to the frame header by the
sender and checked by the receiver.
❑ In the first method, if the frame is corrupted, it is silently discarded; if it is not corrupted,
the packet is delivered to the network layer. This method is used mostly in wired LANs such
as Ethernet.
❑ In the second method, if the frame is corrupted, it is silently discarded; if it is not
corrupted, an acknowledgment is sent (for the purpose of both flow and error control) to
the sender.
In the above flow diagram Frame a is sent and acknowledged. Frame 1 is lost and resent
after the time-out. The resent frame 1 is acknowledged and the timer stops. Frame a is sent
and acknowledged, but the acknowledgment is lost. The sender has no idea if the frame or
the acknowledgment is lost, so after the time-out, it resends frame 0, which is
acknowledged.
Sequence Numbers
Frames from a sending station are numbered sequentially. If the header of the frame allows
m bits for the sequence number, the sequence numbers range from 0 to 2m - 1. For example,
if m is 4, the only sequence numbers are 0 through 15 inclusive. So the sequence numbers
are
0, 1,2,3,4,5,6, 7,8,9, 10, 11, 12, 13, 14, 15,0, 1,2,3,4,5,6,7,8,9,10, 11, ...
In other words, the sequence numbers are modulo-2m
.
Sliding Window
The sender and receiver need to deal with only part of the possible sequence numbers. The
range which is the concern of the sender is called the send sliding window; the range that
is the concern of the receiver is called the receive sliding window.
The send window can slide one or more slots when a valid acknowledgment arrives.
The receive window is an abstract concept defining an imaginary box of size 1 with one
single variable Rn• The window slides when a correct frame has arrived; sliding occurs one
slot at a time.
Acknowledgment
The receiver sends a positive acknowledgment if a frame has arrived safe and sound and in
order. If a frame is damaged or is received out of order, the receiver is silent and will discard
all subsequent frames until it receives the one it is expecting. The silence of the receiver
causes the timer of the unacknowledged frame at the sender site to expire. This, in turn,
causes the sender to go back and resend all frames, beginning with the one with the expired
timer.
Resending a Frame
When the timer expires, the sender resends all outstanding frames. For example, suppose
the sender has already sent frame 6, but the timer for frame 3 expires. This means that frame
3 has not been acknowledged; the sender goes back and sends frames 3, 4,5, and 6 again.
That is why the protocol is called Go-Back-N ARQ.
Flow diagram Frame lost
Acknowledgement lost
Go-Back-N ARQ simplifies the process at the receiver site. The receiver keeps track of only
one variable, and there is no need to buffer out-of-order frames; they are simply discarded.
However, this protocol is very inefficient for a noisy link. In a noisy link a
frame has a higher probability of damage, which means the resending of multiple frames.
• This resending uses up the bandwidth and slows down the transmission. For noisy links,
there is another mechanism that does not resend N frames when just one frame is damaged;
only the damaged frame is resent. This mechanism is called Selective RepeatARQ.
Windows
The Selective Repeat Protocol also uses two windows: a send window and a receive
window.
The send window maximum size can be 2 m- I . For example, if m = 4, the sequence numbers
go from 0 to 15, but the size of the window is just 8. The receive window is the same size
as the send window.
Sent window
Receive window