CN Unit-1
CN Unit-1
Computer Networks
(20ACS17)
What is Computer Network?
•A computer network is a group of interconnected
computers that communicate with each other to share
resources and information.
•Uses of computer networks are to facilitate
communication, enable resource sharing, provide
remote access, and collaborate.
•Computer networks are essential for businesses,
educational institutions, and individuals who rely on
technology to connect with others and access
resources.
2
Uses of Computer Network
Communication: Computer networks enable
individuals and organizations to communicate
with each other using various methods such as
email, messaging, and video conferencing, etc.
Resource sharing: Networks allow users to share
resources such as printers, scanners, and files.
Remote access: Networks enable users to
access information and resources with flexibility
and convenience.
Collaboration: Networks facilitate collaboration
by enabling users to work together on projects,
share ideas, and provide feedback in real time.
3
Cont…
E-commerce: Computer networks are used
extensively in e-commerce, enabling businesses to
sell products and services online and process
payments securely.
4
Advantages of Computer Networks
Improved communication and collaboration.
Cost savings through resource sharing.
Better data management and security.
Increased flexibility with remote access.
Enhanced productivity and efficiency
5
Types of Computer Networks
There are mainly five types of Computer Networks
6
1. Personal Area Network (PAN)
•PAN is communication between the computer
devices is centered only on an individual’s workspace.
•PAN offers network range of 1 to 100 meters from
person to device providing communication.
•Its transmission speed is very high with very easy
maintenance and very low cost.
Technology: Bluetooth, IrDA, and Zigbee.
Examples: USB, computer, phone, tablet, printer,
PDA, etc.
7
2. Local Area Network (LAN)
•LAN is the most frequently used network.
•LAN connects computers through a common
communication path, contained within a limited area, that
is, locally.
•LAN encompasses two or more computers connected
over a server.
•The two important technologies involved in this network
are Ethernet and Wi-fi.
Ranges: up to 2km & transmission speed is very high with
easy maintenance and low cost.
Examples: Networking in a home, school, library,
laboratory, college, office, etc. 8
3. Campus Area Network (CAN)
•CAN is bigger than a LAN but smaller than a MAN.
•This is usually used in places like a school or colleges.
•This network covers a limited geographical area.
•CAN technology with a range from 1km to 5km.
•Its transmission speed is very high with a moderate
maintenance cost and moderate cost.
Examples: networks covers within the campus of schools,
colleges, buildings, etc.
9
4. Metropolitan Area Network (MAN)
• MAN is larger than a LAN but smaller than a WAN.
10
5. Wide Area Network (WAN)
•WAN connects computers over a large geographical
distance through a shared communication path.
•It is not restrained to a single location but extends over
many locations.
•WAN can also be defined as a group of local area
networks that communicate with each other with a range
above 50km.
•Its transmission speed is very low.
•it comes with very high maintenance and very high cost.
11
What is Network Hardware?
•Network hardware is a set of physical or network
devices that are essential for interaction and
communication between hardware.
12
Fundamental Devices of Computer Network
Modems: A modem enables a computer to connect to
the internet via a telephone line.
– At one end converts the computer’s digital
signals into analog signals and sends them
through a telephone line.
– At the other end, it converts the analog
signals to digital signals that are
understandable for another computer.
Routers:
• A router connects two or more networks.
• The router is to connect a home or office network (
LAN) to the internet (WAN).
13
Hubs:
• A hub is device that links multiple device in network
and generally used to connect computers in a LAN.
Two types of Hubs
• Passive Hubs : used for connecting signals from diff
network cable segments.
• Active Hubs: its monitor, amplify, and regenerate
weak signals between nodes.
Bridges:
• A bridge connects two separate LAN networks.
• It scans for the receiving device before sending a
message.
14
Switches: A switch is more powerful than hub or
bridge but performs a similar role.
• It stores the MAC addresses of network devices
and transfers data packets only to those devices
that have requested.
• It reduces the amount of latency.
Network cables: Cables connect different devices
on a network.
• Today, most networks have cables over a
wireless connection as they are more secure.
16
Firewall: is Hardware or Software device between
computer and the rest of the network open to
attackers or hackers.
•
LAN can be protected from hackers by firewall
between the LAN and internet connection.
• A firewall allows authorized connections but
blocks unauthorized connections.
17
Network Topology
Network Topology is defines the structure, and
how these components are connected to each
other.
The various network topologies are:
1. Point to Point Topology
2. Mesh Topology
3. Star Topology
4. Bus Topology
5. Ring Topology
6. Tree Topology
7. Hybrid Topology
18
1. Point to Point Topology
• This topology works on the functionality of the
sender and receiver.
• It is the simplest communication between two
nodes, in which one is the sender and the other one
is the receiver.
• Its provides high bandwidth.
19
2. Mesh Topology
• In Mesh Topology, every device is connected to
another device via a particular channel.
20
Advantages of Mesh Topology
• Communication is very fast between the nodes.
• Mesh Topology is robust.
• The fault is diagnosed easily.
• Data is reliable because, data is transferred among the
devices through dedicated channels or links.
• Provides security and privacy.
Drawbacks of Mesh Topology
• Installation and configuration are difficult.
• The cost of cables is high as bulk wiring is required,
hence suitable for less number of devices.
• The cost of maintenance is high
21
3. Star Topology
22
3. Star Topology
• This hub is the central node and all other nodes are
connected to the central node.
• The Hub can be passive in nature i.e., not an intelligent
hub such as broadcasting devices, at the same time the
hub can be intelligent known as an active hub.
23
Advantages of Star Topology
• If N devices are connected to each other in a star
topology, then the number of cables required to connect
them is N. So, it is easy to set up.
• Each device requires only 1 port i.e. to connect to the
hub, therefore the total number of ports required is N.
• It is Robust. If one link fails only that link will affect and
not other than that.
• Easy to fault identification and fault isolation.
• Star topology is cost-effective as it uses inexpensive
coaxial cable.
24
Disadvantages of Star Topology
• If the concentrator (hub) on which the whole topology
relies fails, the whole system will crash down.
• The cost of installation is high.
• Performance is based on the single concentrator i.e.
hub.
25
4. Bus Topology
• Bus Topology is a network type in which every computer
and network device is connected to a single cable.
• It is bi-directional.
• It is a multi-point connection and a non-robust topology
because if the backbone fails the topology crashes.
• In Bus Topology, various MAC (Media Access Control)
protocols are followed by LAN ethernet connections like
TDMA, Pure Aloha, CDMA, Slotted Aloha, etc.
26
Advantages of Bus Topology
• If N devices are connected to each other in a bus
topology, then the number of cables required to connect
them is 1, known as backbone cable.
• Coaxial or twisted pair cables are mainly used in bus-
based networks that support up to 10 Mbps.
• The cost of the cable is less compared to other
topologies, but it is used to build small networks.
• Bus topology is familiar technology as installation and
troubleshooting techniques are well known.
• CSMA is the most common method for this type of
topology.
27
Drawbacks of Bus Topology
28
5. Ring Topology
• In Ring Topology, it forms a ring connecting
devices with exactly two neighboring devices.
• A number of repeaters are used for Ring
topology with a large number of nodes.
29
• Figure : A ring topology comprises 4 stations connected
with each forming a ring.
• The most common access method of ring topology is
token passing.
• Token passing: It is a network access method in which
a token is passed from one node to another node.
• Token: It is a frame that circulates around the network.
30
Advantages of Ring Topology
• The data transmission is high-speed.
• The possibility of collision is minimum in this type of
topology.
• Cheap to install and expand.
• It is less costly than a star topology.
31
6. Tree Topology
• This is variation of the Star topology.
• This topology has a hierarchical flow of data.
• In Tree Topology, protocols like DHCP and SAC
(Standard Automatic Configuration ) are used.
32
• Figure: This data flow from top to bottom i.e. from
the central hub to the secondary and then to the
devices or from bottom to top i.e. devices to the
secondary hub and then to the central hub.
33
Advantages of Tree Topology
• It allows more devices to be attached to a single central
hub thus it decreases the distance that is traveled by the
signal to come to the devices.
• It allows the network to get isolated and also prioritize
from different computers.
• We can add new devices to the existing network.
• Error detection and error correction are very easy in a
tree topology.
35
7. Hybrid Topology
• It means these can be individuals such as Ring or Star
topology or can be a combination of various types of
topologies seen above.
Advantages of Hybrid Topology
• This topology is very flexible.
• The size of the network can be easily expanded
by adding new devices.
Drawbacks of Hybrid Topology
• It is challenging to design the architecture of the
Hybrid Network.
• Hubs used in this topology are very expensive.
• The infrastructure cost is very high as a hybrid
network requires a lot of cabling and network
devices.
36
Network Software
• NS defined as a wide range of software that streamlines
the operations, design, monitoring, and implementation.
37
Functions of network software
User management allows administrators to add or
remove users from the network. This is particularly
useful when hiring or relieving.
38
39
1. Application layer: which refers to the applications and
services running on the network.
• It is a program that conveys network information, the
status of the network, and the network requirements for
particular resource availability and application.
40
REFERENCE(OSI) Model
•Each layer has different functions. A list of seven layers
are given below:
1. Physical Layer
2. Data-Link Layer
3. Network Layer
4. Transport Layer
5. Session Layer
6. Presentation Layer
7. Application Layer
41
42
43
1) Physical layer
45
2) Data-Link Layer
47
Functions of the Data-link layer
48
Functions of the Data-link layer
50
Network Layer
o The Data link layer is responsible for routing and
forwarding the packets.
o Routers are the layer 3 devices, they are specified in this
layer and used to provide the routing services within an
internetwork.
o The protocols used to route the network traffic are known
as Network layer protocols.
o Examples: protocols are IP and Ipv6.
51
Functions of Network Layer:
52
4) Transport Layer
53
Transport Layer
56
Functions of Transport Layer
o 1. Service-Point Addressing: Computers run several
programs simultaneously due to this reason, the
transmission of data from source to the destination not
only from one computer to another computer but also
from one process to another process.
o The transport layer adds the header that contains the
address known as service-point address or port address.
o The responsibility of the network layer is to transmit the
data from one computer to another computer and
the responsibility of the transport layer is to transmit the
message to the correct process.
57
Functions of Transport Layer
o 2. Segmentation and Reassembly: When the transport
layer receives the message from the upper layer, it
divides the message into multiple segments, and each
segment is assigned with a sequence number that
uniquely identifies each segment.
o Reassembly: When the message has arrived at the
destination, then the transport layer reassembles the
message based on their sequence numbers.
58
Functions of Transport Layer
59
Functions of Transport Layer
60
5) Session Layer
61
Functions of Session layer:
62
6) Presentation Layer
63
6) Presentation Layer
o This layer is mainly concerned with the syntax
and semantics of the information exchanged
between the two systems. It acts as a data
translator for a network.
o This layer converts the data from one
presentation format to another format.
o This layer also known as the syntax layer.
64
Functions of Presentation layer:
o Translation: is processes and its exchange the
information between two systems in the form of
character strings, numbers and so on.
65
Functions of Presentation layer:
Encryption:
– Encryption is needed to maintain privacy.
– Encryption is a process of converting the sender-
transmitted information into another form and
sends the resulting message over the network.
Compression:
o Data compression is a process of compressing
the data, i.e., it reduces the number of bits to be
transmitted.
o Data compression is very important in multimedia
such as text, audio, video.
66
7) Application Layer
67
7) Application Layer
68
Functions of Application layer:
69
Data Link Layer Design Issues
• The DLL uses the services of the physical layer to
send and receive bits over communication
channels. It has a number of functions, including:
The main functions are
Providing services to the network layer
Framing
Error Control
Flow Control
There are four methods:
1. Byte count
2. Flag bytes with byte stuffing
3. Flag bits with bit stuffing
4. Physical layer coding violation
70
Data Link Layer Design Issues
Goals of DLL:
• The DLL takes the packets from the network layer
and encapsulates them into frames for transmission.
• Each frame contains a frame header, payload field
for holding the packet, and a frame trailer,
71
Data Link Layer Design Issues
72
Bit Stuffing:
73
1. Services to the Network Layer
74
Three Types of DLL services
75
2. Framing
•The DLL encapsulates each data packet from the
network layer into frames that are then transmitted.
A Frame has three parts, namely −
Frame Header
Payload field that contains the data packet from
network layer
Trailer
76
3. Error Control
77
4. Flow Control
•The DLL regulates flow control so that fast sender does
not drown a slow receiver.
•When the sender sends frames at very high speeds, a
slow receiver may not be able to handle it.
•There will be frame losses even if the transmission is
error-free.
•The two common approaches for flow control are −
Feedback based flow control
Rate based flow control
78
Elementary Data Link Protocols
80
Frame
81
ii) Error control mechanisms deals with
– Transmission errors
– Retransmission of corrupted
– Lost frames.
82
83
84
iii) Flow control regulates speed of delivery and fast sender
does not drown a slow receiver.
• It is the technique and maintain the constant data rate on
both the sides so that no data corrupted.
85
iv) Access Control:
When two or more devices are connected to the same
communication channel, then DLL protocols are used
to determine which device has control over the link at
a given time.
86
Types of Data Link Protocols
87
1. Simplex Protocol
88
2. Stop – and – Wait Protocol
89
3. Stop – and – Wait ARQ
90
4. Go – Back – N ARQ Protocol
91
5. Selective Repeat ARQ Protocol
92
Sliding Window Protocol
•The sliding window is a technique for sending multiple
frames at a time.
•It controls the data packets between the two devices
where reliable and gradual delivery of data frames is
needed.
•In this technique, each frame has sent with the sequence
number.
•The sequence numbers are used to find the missing data
in the receiver end.
•The purpose of the sliding window technique is to avoid
duplicate data, so it uses the sequence number.
93
Sliding Window Protocol
• SWP is an error control protocol.
• how to data is transmitted?
• It has two parameter:
1. Sequence number is number is assign to each
frame.
2. Sliding window is buffers at transmitter and
reciever.
94
Types of Sliding Window Protocol
1. Go-Back-N ARQ
2. Selective Repeat ARQ
1. Go-Back-N ARQ
•N is the size of the sender window
•Reciver window size is always 1.
• in Go-Back-N ARQ protocol, multiple frames can be
sent by sender before receiving the ACK but the receiver
can buffer only one packet.
• if any frame is corrupted or lost, all subsequent frames
have to be sent again.
95
Types of Sliding Window Protocol
• If the ACK is not arrived in sender side, before the timer
expires, all the frames in the current window are
retransmitted.
• The ACK number is cumulative and it defines the
sequence number of the next frame expected to arrive.
• The sequence numbers are in modulo 2m
97
98
99
100
101
102
2. Selective Repeat ARQ
•Selective Repeat Automatic Repeat Request.
•Go-back-N ARQ protocol works well But, if there is a lot of
error in the frame, lots of bandwidth loss in sending the
frames again.
•Selective Repeat ARQ protocol, the size of the sender
window is always equal to the size of the receiver window.
•If the receiver receives a corrupt frame, It sends a
negative acknowledgment to the sender.
•The sender sends that frame only again as soon as on the
receiving negative acknowledgment.
•There is no waiting for any time-out to send that frame.
103
Example: Selective Repeat ARQ
104
Selective Repeat ARQ
105
Difference between the Go-Back-N ARQ and Selective Repeat ARQ?
If a frame is corrupted or lost in it,all In this, only the frame is sent again,
subsequent frames have to be sent which is corrupted or lost.
again.
If it has a high error rate,it wastes a lot There is a loss of low bandwidth.
of bandwidth.
It does not require sorting. In this, sorting is done to get the frames
in the correct order.