Computer Networks 1

Download as pdf or txt
Download as pdf or txt
You are on page 1of 31

lOMoARcPSD|25763680

Computer networks part-1

Computer Networks (Jawaharlal Nehru Technological University, Hyderabad)

Studocu is not sponsored or endorsed by any college or university


Downloaded by Deepak . ([email protected])
lOMoARcPSD|25763680

DIGITAL NOTES
ON
COMPUTER NETWORKS
(R18A0518)
B.TECH III YEAR – II SEM (R18)

(2020-21)

DEPARTMENT OF INFORMATION TECHNOLOGY

MALLA REDDY COLLEGE OF ENGINEERING & TECHNOLOGY


(Autonomous Institution – UGC, Govt. of India)
Recognized under 2(f) and 12 (B) of UGC ACT 1956
(Affiliated to JNTUH, Hyderabad, Approved by AICTE - Accredited by NBA & NAAC – ‘A’ Grade - ISO 9001:2015 Certified)
Maisammaguda, Dhulapally (Post Via. Hakimpet), Secunderabad – 500100, Telangana State, India

Downloaded by Deepak . ([email protected])


lOMoARcPSD|25763680

MALLA REDDY COLLEGE OF ENGINEERING AND TECHNOLOGY


III Year B.Tech IT – II Semester
L T/P/D C
3 -/-/- 3
(R18A0518) COMPUTER NETWORKS
Objectives:

1. To introduce the fundamental of computer networks.


2. To demonstrate the framework of TCP/IP & OSI model.
3. To know the role of various protocols in Networking.
4. To learn the detailed functioning of various network layers.

UNIT - I:

Introduction: Network, Uses of Networks, Types of Networks, Reference Models: TCP/IP Model,
The OSI Model, Comparison of the OSI and TCP/IP reference model. Architecture of Internet.
Physical Layer: Guided transmission media, Wireless transmission media, Switching.

UNIT - II:

Data Link Layer - Design issues, Error Detection & Correction, Elementary Data Link Layer
Protocols, Sliding window protocols
Multiple Access Protocols - ALOHA, CSMA,CSMA/CD, CSMA/CA, Collision free protocols,
Ethernet- Physical Layer, Ethernet Mac Sub layer, Data link layer switching: Use of bridges,
learning bridges, spanning tree bridges, repeaters, hubs, bridges, switches, routers and gateways.

UNIT - III:

Network Layer: Network Layer Design issues, store and forward packet switching connection less
and connection oriented networks-routing algorithms-optimality principle, shortest path, flooding,
Distance Vector Routing, Count to Infinity Problem, Link State Routing, Path Vector Routing,
Hierarchical Routing; Congestion control algorithms, IP addresses, CIDR, Sub netting, Super
netting, IPv4, Packet Fragmentation, IPv6 Protocol, Transition from IPv4 to IPv6, ARP, RARP.

UNIT - IV:

Transport Layer: Services provided to the upper layers elements of transport protocol- addressing
connection establishment, Connection release, Error Control & Flow Control, Crash Recovery.

The Internet Transport Protocols: UDP, Introduction to TCP, The TCP Service Model, The TCP Segment
Header, The Connection Establishment, The TCP Connection Release, The TCP Sliding Window, The TCP
Congestion Control Algorithm

UNIT - V:

Application Layer- Introduction, providing services, Applications layer paradigms: Client server model,
HTTP, E-mail, WWW, TELNET, DNS; RSA algorithm.

TEXT BOOKS:

1. Data Communications and Networking - Behrouz A. Forouzan, Fifth Edition TMH, 2013.
2. Computer Networks - Andrew S Tanenbaum, 4th Edition, Pearson Education.

Downloaded by Deepak . ([email protected])


lOMoARcPSD|25763680

UNIT -I
Introduction to Computer Networks
Data Communication: When we communicate, we are sharing information.
This sharing can be local or remote. Between individuals, local communication
usually occurs face to face, while remote communication takes place over distance.

Components:
A data communications system has five components.

1. Message. The message is the information (data) to be communicated. Popular forms of


information include text, numbers, pictures, audio, and video.

2. Sender. The sender is the device that sends the data message. It can be a computer,
workstation, telephone handset, video camera, and so on.
3. Receiver. The receiver is the device that receives the message. It can be a computer,
workstation, telephone handset, television, and so on.

4. Transmission medium. The transmission medium is the physical path by which a message
travels from sender to receiver. Some examples of transmission media include twisted-pair wire,
coaxial cable, fiber-optic cable, and radio waves

5. Protocol. A protocol is a set of rules that govern data communications. It represents an


agreement between the communicating devices. Without a protocol, two devices may be
connected but not communicating, just as a person speaking French cannot be understood by a
person who speaks only Japanese.

NETWORKS

A network is a set of devices (often referred to as nodes) connected by communication links. A node
can be a computer, printer, or any other device capable of sending and/or receiving data generated by
other nodes on the network.
Distributed Processing
Most networks use distributed processing, in which a task is divided among multiple computers.
Instead of one single large machine being responsible for all aspects of a process, separate
computers (usually a personal computer or workstation) handle a subset.

Computer Networks Downloaded by Deepak . ([email protected]) Page 3


lOMoARcPSD|25763680

Network Criteria
A network must be able to meet a certain number of criteria. The most important of these are
performance, reliability, and security.
Performance:

Performance can be measured in many ways, including transit time and response time.
Reliability:
Security:
Physical Structures:
Type of Connection

A network is two or more devices connected through links. A link is a communications


pathway that transfers data from one device to another. For visualization purposes, it is simplest
to imagine any link as a line drawn between two points. For communication to occur, two
devices must be connected in some way to the same link at the same time. There are two possible
types of connections: point-to-point and multipoint.
Point-to-Point

A point-to-point connection provides a dedicated link between two devices.


Multipoint

A multipoint (also called multi drop) connection is one in which more than two specific
devices share a single link.

Computer Networks Downloaded by Deepak . ([email protected]) Page 4


lOMoARcPSD|25763680

Physical Topology

The term physical topology refers to the way in which a network is laid out physically. One or
more devices connect to a link; two or more links form a topology. The topology of a network is
the geometric representation of the relationship of all the links and linking devices (usually
called nodes) to one another. There are four basic topologies possible: mesh, star, bus, and ring

Mesh: In a mesh topology, every device has a dedicated point-to-point link to every other
device. The term dedicated means that the link carries traffic only between the two devices it
connects.
To accommodate that many links, every device on the network must have n – 1 input/output
(VO) ports to be connected to the other n - 1 stations.

Computer Networks Downloaded by Deepak . ([email protected]) Page 5


lOMoARcPSD|25763680

Advantages:

1. The use of dedicated links guarantees that each connection can carry its own data load,
thus eliminating the traffic problems that can occur when links must be shared by
multiple devices.
Disadvantages:

1. Disadvantage of a mesh are related to the amount of cabling because every device must
be connected to every other device, installation and reconnection are difficult.
Star Topology:
In a star topology, each device has a dedicated point-to-point link only to a central
controller, usually called a hub.
Other advantages include robustness. If one link fails, only that link is affected. All other links
remain active. This factor also lends itself to easy fault identification and fault isolation. As long
as the hub is working, it can be used to monitor link problems and bypass defective links.

One big disadvantage of a star topology is the dependency of the whole topology on one single
point, the hub. If the hub goes down, the whole system is dead.
Bus Topology:
The preceding examples all describe point-to-point connections. A bus topology, on the
other hand, is multipoint. One long cable acts as a backbone to link all the devices in a network

Nodes are connected to the bus cable by drop lines and taps. A drop line is a connection

Computer Networks Downloaded by Deepak . ([email protected]) Page 6


lOMoARcPSD|25763680

running between the device and the main cable.


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

Computer Networks Downloaded by Deepak . ([email protected]) Page 7


lOMoARcPSD|25763680

Uses of Computer Networks


Had it not been of high importance, nobody would have bothered connecting computers over a
network. Computer Networks with some traditional use cases at companies and for individuals
and then move on to the recent developments in the area of mobile users and home networking.
1. Business Applications
i. Resource Sharing:
ii. Server-Client model:
iii. Communication Medium:
iv. E commerce:
2. Home Applications
i. Access to remote information
ii. Person-to-person communication
iii. Interactive entertainment
iv. Electronic commerce
Types or Categories of Networks

Local Area Networks:


Local area networks, generally called LANs, are privately-owned networks within a single
building or campus of up to a few kilometers in size. They are widely used to connect personal
computers and workstations in company offices and factories to share resources (e.g., printers)
and exchange information. LANs are distinguished from other kinds of networks by three
characteristics:

(1) Their size, Their transmission technology, and Their topology.


LANs are restricted in size, which means that the worst-case transmission time is bounded and
known in advance.

want to transmit simultaneously. The arbitration mechanism may be centralized or distributed.


IEEE 802.3, popularly called Ethernet, for example, is a bus-based broadcast network with
decentralized control, usually operating at 10 Mbps to 10 Gbps. Computers on an Ethernet can
transmit whenever they want to; if two or more packets collide, each computer just waits a
Random time and tries again later.

Fig.1: Two broadcast networks . (a) Bus. (b) Ring.


Computer Networks Downloaded by Deepak . ([email protected]) Page 8
lOMoARcPSD|25763680

A second type of broadcast system is the ring. In a ring, each bit propagates around on its own,
not waiting for the rest of the packet to which it belongs. Typically, each bit circumnavigates the
entire ring in the time it takes to transmit a few bits, often before the complete packet has even
been transmitted. As with all other broadcast systems, some rule is needed for arbitrating
simultaneous accesses to the ring. Various methods, such as having the machines take turns, are
in use. IEEE 802.5 (the IBM token ring), is a ring-based LAN operating at 4 and 16 Mbps. FDDI
is another example of a ring network.
Metropolitan Area Network (MAN):
A metropolitan area network, or MAN, covers a city. The best-known example of a MAN is the
cable television network available in many cities.

A MAN is implemented by a standard called DQDB (Distributed Queue Dual Bus) or


IEEE 802.16. DQDB has two unidirectional buses (or cables) to which all the computers are
attached.
Wide Area Network (WAN):
A wide area network, or WAN, spans a large geographical area, often a country or continent. It
contains a collection of machines intended for running user (i.e., application) programs. These
machines are called as hosts..
. Of course, if ACE is the best route, all packets may be sent along it, even if each packet is
individually routed.

Fig.3.1: A stream of packets from sender to receiver.


Not all WANs are packet switched. All routers can hear the output from the satellite, and in some
cases they can also hear the upward transmissions of their fellow routers to the satellite as well.
Sometimes the routers are connected to a substantial point-to-point subnet, with only some of
them having a satellite antenna. Satellite networks are inherently broadcast and are most useful
when the broadcast property is important.

Computer Networks Downloaded by Deepak . ([email protected]) Page 9


lOMoARcPSD|25763680

1.3 THE INTERNET


The Internet has revolutionized many aspects of our daily lives. It has affected the way we do
business as well as the way we spend our leisure time. Count the ways you've used the Internet
recently. Perhaps you've sent electronic mail (e-mail) to a business associate, paid a utility bill,
read a newspaper from a distant city, or looked up a local movie schedule-all by using the
Internet. Or maybe you researched a medical topic, booked a hotel reservation, chatted with a
fellow or comparison-shopped for a car. The Internet is a communication system that has
brought a wealth of information to our fingertips and organized it for our use.
A Brief History
A network is a group of connected communicating devices such as computers and printers. An
internet (note the lowercase letter i) is two or more networks that can communicate with each
other. The most notable internet is called the Internet (uppercase letter I), a collaboration of more
than hundreds of thousands of interconnected networks. Private individuals as well as various
organizations such as government agencies, schools, research facilities, corporations, and
libraries in more than 100 countries use the Internet. Millions of people are users. Yet this
extraordinary communication system only came into being in 1969.
In the mid-1960s, mainframe computers in research organizations were standalone devices.
Computers from different manufacturers were unable to communicate with one another. The
Advanced Research Projects Agency (ARPA) in the Department of Defense (DoD) was
interested in finding a way to connect computers so that the researchers they funded could share
their findings, thereby reducing costs and eliminating duplication of effort.

In 1967, at an Association for Computing Machinery (ACM) meeting, ARPA presented its ideas
for ARPANET, a small network of connected computers. The idea was that each host computer
(not necessarily from the same manufacturer) would be attached to a specialized computer,
called an interface message processor (IMP). The IMPs, would be connected to one another.
Each IMP had to be able to communicate with other IMPs as well as with its own attached host.
By 1969, ARPANET was a reality. Four nodes, at the University of California at Los Angeles
(UCLA), the University of California at Santa Barbara (UCSB), Stanford Research Institute

(SRI), and the University of Utah, were connected via the IMPs to form a network. Software
called the Network Control Protocol (NCP) provided communication between the hosts.

In 1972, Vint Cerf and Bob Kahn, both of whom were part of the core ARPANET group,
collaborated on what they called the Internet ting Projec1. Cerf and Kahn's landmark 1973 paper
outlined the protocols to achieve end-to-end delivery of packets. This paper on Transmission

Computer Networks Downloaded by Deepak . ([email protected]) Page 10


lOMoARcPSD|25763680

Control Protocol (TCP) included concepts such as encapsulation, the datagram, and the functions
of a gateway. Shortly thereafter, authorities made a decision to split TCP into two protocols:
Transmission Control Protocol (TCP) and Internetworking Protocol (lP). IP would handle
datagram routing while TCP would be responsible for higher-level functions such as
Segmentation, reassembly, and error detection. The internetworking protocol became known
as TCPIIP.
The Internet Today
The Internet has come a long way since the 1960s. The Internet today is not a simple hierarchical
structure. It is made up of many wide- and local-area networks joined by connecting devices and
switching stations. It is difficult to give an accurate representation of the Internet because it is
continually changing-new networks are being added, existing networks are adding addresses,
and networks of defunct companies are being removed. Today most end users who want Internet
connection use the services of Internet Service Providers (lSP).

Computer Networks Downloaded by Deepak . ([email protected]) Page 11


lOMoARcPSD|25763680

International Internet Service Providers:

At the top of the hierarchy are the international service providers that connect nations
together.
National Internet Service Providers:

The national Internet service providers are backbone networks created and maintained by
specialized companies. these backbone networks are connected by complex switching stations
(normally run by a third party) called network access points (NAPs).
Regional Internet Service Providers:

Regional internet service providers or regional ISPs are smaller ISPs that are connected
to one or more national ISPs. They are at the third level of the hierarchy with a smaller data rate.
Local Internet Service Providers:
Local Internet service providers provide direct service to the end users. The local ISPs
can be connected to regional ISPs or directly to national ISPs.
Comparison of the OSI and TCP/IP Reference Models:
The OSI and TCP/IP reference models have much in common. Both are based on the
concept of a stack of independent protocols. Also, the functionality of the layers is roughly
similar. For example, in both models the layers up through and including the transport layer are
there to provide an end-to-end, network-independent transport service to processes wishing to
communicate. Three concepts are central to the OSI model:
1. Services.
2. Interfaces.
3. Protocols.

Probably the biggest contribution of the OSI model is to make the distinction between these three
concepts explicit. Each layer performs some services for the layer above it. The service
definition tells what the layer does, not how entities above it access it or how the layer works. It
defines the layer's semantics.
The TCP/IP model did not originally clearly distinguish between service, interface, and protocol,
although people have tried to retrofit it after the fact to make it more OSI-like. For example, the
only real services offered by the internet layer are SEND IP PACKET and RECEIVE IP
PACKET.

Another difference is in the area of connectionless versus connection-oriented communication.


The OSI model supports both connectionless and connection-oriented communication in the

Computer Networks Downloaded by Deepak . ([email protected]) Page 12


lOMoARcPSD|25763680

Architecture of Internet

Computer Network Architecture is defined as the physical and logical design of the software,
hardware, protocols, and media of the transmission of data. Simply we can say that how
computers are organized and how tasks are allocated to the computer.
The two types of network architectures are used:

 Peer-To-Peer network
 Client/Server network

Peer-To-Peer network
 Peer-To-Peer network is a network in which all the computers are linked together with
equal privilege and responsibilities for processing the data.
 Peer-To-Peer network is useful for small environments, usually up to 10 computers.

Advantages Of Peer-To-Peer Network:


 It is less costly as it does not contain any dedicated server.
 If one computer stops working but, other computers will not stop working.
Disadvantages Of Peer-To-Peer Network:
 In the case of Peer-To-Peer network, it does not contain the centralized system.

Therefore, it cannot back up the data as the data is different in different locations.
 It has a security issue as the device is managed itself.
Client/Server Network
 Client/Server network is a network model designed for the end users called clients, to
access the resources such as songs, video, etc. from a central computer known as Server.
 The central controller is known as a server while all other computers in the network are
called clients.

Computer Networks Downloaded by Deepak . ([email protected]) Page 13


lOMoARcPSD|25763680

Chapter-II Physical Layer

I. TRANSMISSION MEDIA

A transmission medium can be broadly defined as anything that can carry information from a
source to a destination. For example, the transmission medium for two people having a dinner
conversation is the air. The air can also be used to convey the message in a smoke signal or
semaphore. For a written message, the transmission medium might be a mail carrier, a truck, or
an airplane. In data communications the definition of the information and the transmission
medium is more specific. The transmission medium is usually free space, metallic cable or
optical cable. The information is usually a signal that is the result of conversion of data from
another form.

Transmission Media is broadly classified into the following types:

Guided Media

Guided media, which are those that provide a conduit from one device to another, include
twisted-pair cable, coaxial cable, and fiber-optic cable.

1. Twisted-Pair Cable
A twisted pair consists of two conductors (normally copper), each with its own plastic insulation,
twisted together, as shown below figure.

One of the wires is used to carry signals to the receiver, and the other is used only as a ground
reference. The receiver uses the difference between the two. In addition to the signal sent by the

Computer Networks Downloaded by Deepak . ([email protected]) Page 14


lOMoARcPSD|25763680

sender on one of the wires, interference (noise) and crosstalk may affect both wires and create
unwanted signals. If the two wires are parallel, the effect of these unwanted signals is not the
same in both wires because they are at different locations relative to the noise or crosstalk
sources (e,g., one is closer and the other is farther).
Applications

Twisted-pair cables are used in telephone lines to provide voice and data channels. The local
loop-the line that connects subscribers to the central telephone office-commonly consists of

Unshielded twisted pair cables. The DSL line that are used by the telephone companies to
provide high-data-rate connections also use the high-bandwidth capability of unshielded twisted-
pair cables. Local-area networks, such as lOBase-T and lOOBase-T, also use twisted-pair cables.

2. Coaxial Cable

Coaxial cable (or coax) carries signals of higher frequency ranges than those in twisted pair
cable, in part because the two media are constructed quite differently. Instead of having two
wires, coax has a central core conductor of solid or stranded wire (usually copper) enclosed in an
insulating sheath, which is, in turn, encased in an outer conductor of metal foil, braid, or a
combination of the two. The outer metallic wrapping serves both as a shield against noise and as
the second conductor, which completes the circuit. This outer conductor is also enclosed in an
insulating sheath, and the whole cable is protected by a plastic cover (below figure).

Applications

Coaxial cable was widely used in analog telephone networks where a single coaxial network
could carry 10,000 voice signals. Later it was used in digital telephone networks where a single
coaxial cable could carry digital data up to 600 Mbps. However, coaxial cable in telephone
networks has largely been replaced today with fiber-optic cable. Cable TV networks also
usecoaxial cables. In the traditional cable TV network, the entire network used coaxial cable.

Computer Networks Downloaded by Deepak . ([email protected]) Page 15


lOMoARcPSD|25763680

Fiber Optic Cable: A fiber-optic cable is made of glass or plastic and transmits signals in the
form of light. To understand optical fiber, we first need to explore several aspects of the nature
of light. Light travels in a straight line as long as it is moving through a single uniform If a ray of
light traveling through one substance suddenly enters another substance (of a different density),
the ray changes direction. Figure 7.10 shows how a ray of light changes direction when going
from a more dense to a less dense substance.

As the figure shows, if the angle of incidence I (the angle the ray makes with the line
perpendicular to the interface between the two substances) is less than the critical angle, the ray
refracts and moves closer to the surface. If the angle of incidence is equal to the critical angle,
the light bends along the interface. If the angle is greater than the critical angle, the ray reflects
(makes a turn) and travels again in the denser substance. Note that the critical angle is a property
of the substance, and its value differs from one substance to another.

Cable Composition
Figure 7.14 shows the composition of a typical fiber-optic cable. The outer jacket is made of
either PVC or Teflon. Inside the jacket are Kevlar strands to strengthen the cable. Kevlar is a
strong material used in the fabrication of bulletproof vests. Below the Kevlar is another plastic
coating to cushion the fiber. The fiber is at the center of the cable, and it consists of cladding and
core.

Computer Networks Downloaded by Deepak . ([email protected]) Page 16


lOMoARcPSD|25763680

Applications
Fiber-optic cable is often found in backbone networks because its wide bandwidth is cost-
effective. Today, with wavelength-division multiplexing (WDM), we can transfer data at a rate
of 1600 Gbps. The SONET network provides such a backbone. Some cable TV companies use a
combination of optical fiber and coaxial cable, thus creating a hybrid network. Optical fiber
provides the backbone structure while coaxial cable provides the connection to the user premises.

Advantages and Disadvantages of Optical Fiber

Advantages
Fiber-optic cable has several advantages over metallic cable (twisted pair or coaxial).

1. Higher bandwidth. Fiber-optic cable can support dramatically higher bandwidths (and
hence data rates) than either twisted-pair or coaxial cable. Currently, data rates and
bandwidth utilization over fiber-optic cable are limited not by the medium but by the
signal generation and reception technology available.

2. Disadvantages

1. Installation and maintenance. Fiber-optic cable is a relatively new technology. Its


installation and maintenance require expertise that is not yet available everywhere.

2. Unidirectional light propagation. Propagation of light is unidirectional. If we


need bidirectional communication, two fibers are needed.

UNGUIDED MEDIA: WIRELESS


Unguided media transport electromagnetic waves without using a physical conductor. This type
of communication is often referred to as wireless communication. Signals are normally broadcast

Computer Networks Downloaded by Deepak . ([email protected]) Page 17


lOMoARcPSD|25763680

through free space and thus are available to anyone who has a device capable of receiving them.

Unguided signals can travel from the source to destination in several ways: ground propagation,
sky propagation, and line-of-sight propagation, as shown in Figure 7.18. In ground
propagation,radio waves travel through the lowest portion of the atmosphere, hugging the earth.

These low-frequency signals emanate in all directions from the transmitting antenna and follow
the curvature of the planet. Distance depends on the amount of power in the signal: The greater
the power, the greater the distance. In sky propagation, higher-frequency radio waves radiate
upward into the ionosphere where they are reflected back to earth.
This type of transmission allows for greater distances with lower output power. In line of sight
propagation, very high frequency signals are transmitted in straight lines directly from antenna to
antenna. Antennas must be directional, facing each other, and either tall enough or close enough
together not to be affected by the curvature of the earth. Line-of-sight propagation is tricky
because radio transmissions cannot be completely focused.
1. Radio Waves
Waves ranging in frequencies between 3 kHz and 1 GHz are called radio waves. Radio waves,
for the most part, are omni directional. When an antenna transmits radio waves, they are

propagated in all directions. This means that the sending and receiving antennas do not have to
be aligned. A sending antenna sends waves that can be received by any receiving antenna.

Omni directional Antenna

Radio waves use omni directional antennas that send out signals in all directions. Based on the
wavelength, strength, and the purpose of transmission, we can have several types of antennas.
Below figure 7.20 shows an omni directional antenna.

Computer Networks Downloaded by Deepak . ([email protected]) Page 18


lOMoARcPSD|25763680

Applications
The omni directional characteristics of radio waves make them useful for multicasting, in which
there is one sender but many receivers. AM and FM radio, television, maritime radio, cordless
phones, and paging are examples of multicasting.

2. Microwaves
Electromagnetic waves having frequencies between I and 300 GHz are called microwaves.
Microwaves are unidirectional. When an antenna transmits microwave waves, they can be
narrowly focused. This means that the sending and receiving antennas need to be aligned. The
unidirectional property has an obvious advantage. A pair of antennas can be aligned without
interfering with another pair of aligned antennas. The following describes some characteristics of
microwave propagation:

1. Microwave propagation is line-of-sight. Since the towers with the mounted antennas need
to be in direct sight of each other, towers that are far apart need to be very tall. The
curvature of the earth as well as other blocking obstacles do not allow two short towers
to communicate by using microwaves. Repeaters are often needed for long distance
communication.
2. Very high-frequency microwaves cannot penetrate walls. This characteristic can be
a disadvantage if receivers are inside buildings.
Unidirectional Antenna
Microwaves need unidirectional antennas that send out signals in one direction. Two types of
antennas are used for microwave communications: the parabolic dish and the horn (see below
figure). A parabolic dish antenna is based on the geometry of a parabola: Every line parallel to
the line of symmetry (line of sight) reflects off the curve at angles such that all the lines intersect
in a common point called the focus.

Computer Networks Downloaded by Deepak . ([email protected]) Page 19


lOMoARcPSD|25763680

Computer Networks Downloaded by Deepak . ([email protected]) Page 20


lOMoARcPSD|25763680

3. Infrared

Infrared waves, with frequencies from 300 GHz to 400 THz (wavelengths from 1 mm to 770 nm), can be
used for short-range communication. Infrared waves, having high frequencies, cannot penetrate walls. This
advantageous characteristic prevents interference between one system and another; a short-range
communication system in one room cannot be affected by another system in the next room. When we use
our infrared remote control, we do not interfere with the use of the remote by our neighbors. However, this
same characteristic makes infrared signals useless for long-range communication. In addition, we cannot
use infrared waves outside a building because the sun's rays contain infrared waves that can interfere with
the communication.

Applications

The infrared band, almost 400 THz, has an excellent potential for data transmission. Such a wide
bandwidth can be used to transmit digital data with a very high data rate. The Infrared Data Association
(IrDA), an association for sponsoring the use of infrared waves, has established standards for using these
signals for communication between devices such as keyboards, mice, PCs, and printers. For example,
some manufacturers provide a special port called the IrDA port that allows a wireless keyboard to
communicate with a PC.
SWITCHING

Introduction
A Network Switch is a constituent of computer network that connects two network slices and/or two
network devices (switches or routers) together. Switch can be termed as a network bridge with multiple
ports which helps to process and route packets at data link layer of the OSI reference model. There are
some switches which have capabilities to process data at the upper layers (network layer and above).
Those switches are often termed as multilayer switches.
For data transfer, different types of switching methods are available. They are

I. Circuit Switching
 Circuit switched network consists of a set of switches connected by physical links.
 In circuit switched network, two nodes communicate with each other over a dedicated
communication path.
Computer Networks Downloaded by Deepak . ([email protected]) Page 33
lOMoARcPSD|25763680

 There is a need of pre-specified route from which data will travel and no other data is
permitted.
 Before starting communication, the nodes must make a reservation for the resources to be used
during the communication.
 In this type of switching, once a connection is established, a dedicated path exists between
both ends until the connection is terminated.

Advantages of Circuit Switching:

 The dedicated path/circuit established between sender and receiver provides a


guaranteed data rate.
 Once the circuit is established, data is transmitted without any delay as there is no waiting
time at each switch.
 Since a dedicated continuous transmission path is established, the method is suitable for long
continuous transmission.
Disadvantages of Circuit Switching:

 As the connection is dedicated it cannot be used to transmit any other data even if the
channel is free.
 It is inefficient in terms of utilization of system resources. As resources are allocated for the
entire duration of connection, these are not available to other connections.
 Dedicated channels require more bandwidth.
 Prior to actual data transfer, the time required to establish a physical link between the two
stations is too long.
II. Packet Switching
 In packet switching, messages are divided into packets of fixed or variable size.
 The size of packet is decided by the network and the governing protocol.
 Resource allocation for a packet is not done in packet switching.
 Resources are allocated on demand.
 The resource allocation is done on first-come, first-served basis.

Computer Networks Downloaded by Deepak . ([email protected]) Page 34


lOMoARcPSD|25763680

 Each switching node has a small amount of buffer space to hold packets temporarily.
 If the outgoing line is busy, the packet stays in queue until the line becomes available.
Packet switching method uses two routing methods: 1.

Datagram Packet Switching

 Datagram packet switching is normally implemented in the network layer.


 In datagram network, each packet is routed independently through the network.
 Each packet carries a header that contains the full information about the destination.
 When the switch receives the packet, the destination address in the header of the packet is
examined; the routing table is consulted to find the corresponding port through which the packet
should be forwarded.

2. Virtual Circuit Packet Switching


 Virtual circuit packet switching is normally done at the data link layer.
 Virtual circuit packet switching establishes a fixed path between a source and a
destination to transfer the packets.
 It is also called as connection oriented network.

->A source and destination have to go through three phases in a virtual circuit packet switching:
I. Setup phase
ii. Data transfer phase
iii. Connection release phase
 A logical connection is established when a sender sends a setup request to the receiver and the
receiver sends back an acknowledgement to the sender if the receiver agree.
 All packets belonging to the same source and destination travel the same path.
 The information is delivered to the receiver in the same order as transmitted by the sender.

Computer Networks Downloaded by Deepak . ([email protected]) Page 35


lOMoARcPSD|25763680

Advantages of Packet Switching:

 Efficient use of Network.


 Easily get around broken bits or packets.
 Circuit Switching charges user on the distance and duration of connection but Packet
Switching charges users only on the basis of duration of connectivity.
Disadvantages of Packet Switching:

 In Packet Switching Packets arriving in wrong order.


 Takes Transmission delay.
III. Message Switching

 In message switching, it is not necessary to establish a dedicated path between


transmitter and receiver.
 In this, each message is routed independently through the network.

 Store and forward – The intermediate nodes have the responsibility of transferring the entire
message to the next node. Hence, each node must have storage capacity. A message will only be
delivered if the next hop and the link connecting it are both available, otherwise it’ll be stored
indefinitely. A store-and-forward switch forwards a message only if sufficient resources are
available and the next hop is accepting data. This is called the store-and-forward property.

Computer Networks Downloaded by Deepak . ([email protected]) Page 36


lOMoARcPSD|25763680

UNIT-II
Chapter-I
Data Link Layer

I. Introduction

The data link layer transforms the physical layer, a raw transmission facility, to a link responsible for
node-to-node (hop-to-hop) communication. Specific responsibilities of the data link layer include
framing, addressing, flow control, error control, and media access control.

II. DATA LINK LAYER DESIGN ISSUES

The following are the data link layer design issues

1. Services Provided to the Network Layer

The network layer wants to be able to send packets to its neighbors without worrying about the
details of getting it there in one piece.

2. Framing

Group the physical layer bit stream into units called frames. Frames are nothing more than "packets"
or "messages". By convention, we use the term "frames" when discussing DLL.

3. Error Control

Sender checksums the frame and transmits checksum together with data. Receiver re-computes the
checksum and compares it with the received value.

4. Flow Control

Prevent a fast sender from overwhelming a slower receiver.

III. Error Detection & Correction

There are many reasons such as noise, cross-talk etc., which may help data to get
corrupted during transmission. The upper layers work on some generalized view of network
architecture and are not aware of actual hardware data processing. Hence, the upper layers
expect error-free transmission between the systems. Most of the applications would not
function expectedly if they receive erroneous data. Applications such as voice and video may
not be that affected and with some errors they may still function well.

Types of Errors
There may be three types of errors:
 Single bit error

In a frame, there is only one bit, anywhere though, which is corrupt.

Computer Networks Downloaded by Deepak . ([email protected]) Page 37


lOMoARcPSD|25763680

 Multiple bits error

Frame is received with more than one bits in corrupted state.


 Burst error

Frame contains more than1 consecutive bits corrupted.


Error control mechanism may involve two possible ways:
 Error detection
 Error correction

Error Detection
Errors in the received frames are detected by means of
(i)Parity Check and
(ii)Cyclic Redundancy Check (CRC).
In both cases, few extra bits are sent along with actual data to confirm that bits received at other end are
same as they were sent. If the counter-check at receiver’ end fails, the bits are considered corrupted.

(i) Parity Check


One extra bit is sent along with the original bits to make number of 1s either even in case of even parity,
or odd in case of odd parity.
The sender while creating a frame counts the number of 1s in it. For example, if even parity is used and
number of 1s is even then one bit with value 0 is added. This way number of 1s remains even. If the
number of 1s is odd, to make it even a bit with value 1 is added.

The receiver simply counts the number of 1s in a frame. If the count of 1s is even and even parity is
used, the frame is considered to be not-corrupted and is accepted. If the count of 1s is odd and odd
parity is used, the frame is still not corrupted.
If a single bit flips in transit, the receiver can detect it by counting the number of 1s. But when more
than one bits are erroneous, then it is very hard for the receiver to detect the error.
(ii) Cyclic Redundancy Check (CRC)
CRC is a different approach to detect if the received frame contains valid data. This technique
involves binary division of the data bits being sent. The divisor is generated using polynomials. The
sender performs a division operation on the bits being sent and calculates the remainder. Before
sending the actual bits, the sender adds the remainder at the end of the actual bits. Actual data bits
plus the remainder is called a codeword. The sender transmits data bits as code words.

Computer Networks Downloaded by Deepak . ([email protected]) Page 38


lOMoARcPSD|25763680

At the other end, the receiver performs division operation on code words using the same CRC
divisor. If the remainder contains all zeros the data bits are accepted, otherwise it is considered as
there some data corruption occurred in transit.

Error Correction
In the digital world, error correction can be done in two ways:
 Backward Error Correction When the receiver detects an error in the data received, it
requests back the sender to retransmit the data unit.
 Forward Error Correction When the receiver detects some error in the data received, it
executes error-correcting code, which helps it to auto-recover and to correct some kinds of
errors.
The first one, Backward Error Correction, is simple and can only be efficiently used where
retransmitting is not expensive. For example, fiber optics. But in case of wireless transmission
retransmitting may cost too much. In the latter case, Forward Error Correction is used.
IV Elementary Data Link Protocols
Protocols in the data link layer are designed so that this layer can perform its basic functions:
framing, error control and flow control. Framing is the process of dividing bit - streams from
physical layer into data frames whose size ranges from a few hundred to a few thousand bytes.

Types of Data Link Layer Protocols


Data link protocols can be broadly divided into two categories, depending on whether the
transmission channel is noiseless or noisy.

Computer Networks Downloaded by Deepak . ([email protected]) Page 39


lOMoARcPSD|25763680

Simplex Protocol

The Simplex protocol is hypothetical protocol designed for unidirectional data transmission over an
ideal channel, i.e. a channel through which transmission can never go wrong. It has distinct
procedures for sender and receiver. The sender simply sends all its data available onto the channelas
soon as they are available its buffer. The receiver is assumed to process all incoming data instantly.
It is hypothetical since it does not handle flow control or error control.

Stop – and – Wait Protocol

Stop – and – Wait protocol is for noiseless channel too. It provides unidirectional data transmission
without any error control facilities. However, it provides for flow control so that a fast sender does not
drown a slow receiver. The receiver has a finite buffer size with finite processing speed. The sender can
send a frame only when it has received indication from the receiver that it is available for further data
processing.

Stop – and – Wait ARQ

Stop – and – wait Automatic Repeat Request (Stop – and – Wait ARQ) is a variation of the above protocol
with added error control mechanisms, appropriate for noisy channels. The sender keeps a copy of the sent
frame. It then waits for a finite time to receive a positive acknowledgement from receiver. If the timer
expires or a negative acknowledgement is received, the frame is retransmitted. If a positive
acknowledgement is received then the next frame is sent.

Go – Back – N ARQ

Go – Back – N ARQ provides for sending multiple frames before receiving the acknowledgement
for the first frame. It uses the concept of sliding window, and so is also called sliding window
protocol. The frames are sequentially numbered and a finite number of frames are sent. If the
acknowledgement of a frame is not received within the time period, all frames starting from that
frame are retransmitted.

Selective Repeat ARQ

This protocol also provides for sending multiple frames before receiving the acknowledgement for
the first frame. However, here only the erroneous or lost frames are retransmitted, while the good
frames are received and buffered.

V. Sliding Window Protocols

Sliding window protocols are data link layer protocols for reliable and sequential delivery of data
frames. The sliding window is also used in Transmission Control Protocol.

In this protocol, multiple frames can be sent by a sender at a time before receiving an
acknowledgment from the receiver. The term sliding window refers to the imaginary boxes to hold
frames. Sliding window method is also known as windowing.

Working Principle
In these protocols, the sender has a buffer called the sending window and the receiver has buffer
called the receiving window.

The size of the sending window determines the sequence number of the outbound frames. If the

Computer Networks Downloaded by Deepak . ([email protected]) Page 40


lOMoARcPSD|25763680

sequence number of the frames is an n-bit field, then the range of sequence numbers that can be
assigned is 0 to 2𝑛−1. Consequently, the size of the sending window is 2𝑛−1. Thus in order to
accommodate a sending window size of 2𝑛−1, a n-bit sequence number is chosen.

The size of the receiving window is the maximum number of frames that the receiver can accept at a
time. It determines the maximum number of frames that the sender can send before receiving
acknowledgment.
Example
Suppose that we have sender window and receiver window each of size 4. So the sequence
numbering of both the windows will be 0,1,2,3,0,1,2 and so on. The following diagram shows the
positions of the windows after sending the frames and receiving acknowledgments.
Types of Sliding Window Protocols

The Sliding Window ARQ (Automatic Repeat reQuest) protocols are of two categories −

Computer Networks Downloaded by Deepak . ([email protected]) Page 41


lOMoARcPSD|25763680

 Go – Back – N ARQ
Go – Back – N ARQ provides for sending multiple frames before receiving the acknowledgment for
the first frame. It uses the concept of sliding window, and so is also called sliding window protocol.
The frames are sequentially numbered and a finite number of frames are sent. If the acknowledgment
of a frame is not received within the time period, all frames starting from that frame are
retransmitted.

 Selective Repeat ARQ

This protocol also provides for sending multiple frames before receiving the acknowledgment for
the first frame. However, here only the erroneous or lost frames are retransmitted, while the good
frames are received and buffered.

Chapter-II

Multiple Access Protocols

I. MULTIPLE ACCESS PROTOCOLS


The multiple access protocols can be broadly classified into three categories namely Random access
Protocols, Controlled access Protocols and Channelization Protocols (as given in below figure). Let
us discuss in detail about the different protocols which are classified and as shown in below figure.

1. Random Access Protocol: In this, all stations have same superiority that is no station has
more priority than another station. Any station can send data depending on medium’s state(
idle or busy). It has two features:
1. There is no fixed time for sending data
2. There is no fixed sequence of stations sending data
The Random access protocols are further subdivided as:

(a) ALOHA – It was designed for wireless LAN but is also applicable for shared medium. In this,
multiple stations can transmit data at the same time and can hence lead to collision and data being
garbled.

Computer Networks Downloaded by Deepak . ([email protected]) Page 42

You might also like