Ch-07 (Comp) - Computer Networks
Ch-07 (Comp) - Computer Networks
Chapter 7
Computer Networks
Computer Networks
Chapter 7 – Computer Networks
Computer Networks
• A collection of computers and other devices connected together via
communication devices and communication channels for sharing information
and resources is called a computer network
• Resources may include printers, scanners, and storage devices (such as hard
disks)
• Examples of transmission media are cables and wirelessly or Wi-Fi
• Connected computers/devices in the network can be in the same room,
building, or at different locations
• A computer network can be simple or very large
• In a large computer network, usually many computer networks are connected
together
• This type of network is called a network of networks
• Internet is the most well-known example of a network of networks
Uses/Benefits of Computer Network
Communication
• People can communicate with each other around the world through computer
networks
• They can talk and share information with each other using different network
services such as email, social networking, video conferencing, groupware and
SMS service
Data Sharing
• Different users connected to the computer network can share data among them
• For example, on the Internet, a large number of users can access the same
database
Software Sharing
• In a computer network, usually, application software and other software are
installed on the central computer (i.e. server computer)
• These software can be shared over a network instead of purchasing a separate
Uses of Computer Network
Hardware Sharing
• In a computer network, hardware devices such as printers, scanners and hard
disks can be shared among different users
• For example, many users can share a single printer connected to a network
• An organization can save a lot of money by sharing different devices over a
network
• Without the facility of network, these devices have to be arranged separately
for each user
• It becomes very costly for an organization
Internet Sharing
• In a computer network (i.e. LAN), many users can access the Internet through
a single Internet connection and can use its different services
Uses of Computer Network
Data Security
• Computer network provides centralized data storage
• It means that all data is stored on the central computer. So , security features can also be
implemented on the data very easily
Saving Disk Space
• In a computer network, all computers use the same copy of application programs and data
files
• These are only stored on the hard disk(s) of the server computer
• There is no need to store application programs and data files on individual computers on
the network
• In this way, disk space on each computer is saved
Uses of Computer Network
Entertainment
• Computer network provides many sources of entertainment to the people
• For example, we can play different types of games, see movies, and listen to
music. We can also make new friends on the Internet.
Types of Network
Chapter 7 – Computer Networks
Types of Network
• Computer networks are divided into the following types based on the size and
physical area or distance covered by the network:
• Local Area Network
• Wide Area Network
• Metropolitan Area Network
• Personal Area Network (PAN)
Local Area Network (LAN)
• Local Area Network (LAN) is a type of computer network that covers a small area
• It is generally limited to a building or group of adjacent buildings
• It consists of a limited number of computers
• LAN is designed to share different resources (such as printers, scanners, storage devices,
and application programs) between computers
• Network of computers in the computer laboratory of a college and network of computers
in an office building are examples of LANs
• In LAN, nodes (computers and other devices such as printers and scanners) are connected
to each other using cables or wireless transmission medium
• Network Interface Card (NIC) is used in each computer to
connect it to a LAN
• Network card enables computer to share information with
other computers connected to the LAN
• Data transmission rate through LAN is very fast
• It is from 10 Mbps to 1 Gbps
Local Area Network (LAN)
+Resource Sharing
+ For example, many users on network can use a single printer
+ Similarly, storage media and software located in the central server can be shared
between all users on the network
+Inexpensive
+ Small businesses, firms, and educational institutes can afford and easily install the LAN
+Communication
+ Users can easily communicate with each other
+ They can also share data among them
+Centralized Data
+ All data is stored and updated on the central server through nodes
+ So it becomes very easy to take a backup of the database at regular intervals
Local Area Network (LAN)
+Internet Access Sharing
+ Multiple users can access the Internet using a single Internet connection
+ Internet connection is established at the central server
+ In this way, all users can access the Internet
+Data Security
+ Data security can be implemented very easily because users are granted data access
rights
+ Authorized users can connect to the server and can access a specific portion of the data
+Speed
+ Data transmission in a LAN is very fast
+Reliability
+ It is a very reliable network
+ Communication errors are very rare
Local Area Network (LAN)
- If the central server is infected by a virus, then important data and software
stored on the server may be corrupted and entire network may also be
affected
- All nodes depend on central device (or Hub), if it fails, then entire network will
stop working
- A trained and competent network manager is required to run LAN, so a
handsome salary has to be paid to him. Therefore, it becomes very expensive
to run the LAN
- Mostly in a LAN, one or two printers are shared among several users. In this
situation, lengthy print queues are created. So the users have to wait for a
long period of time to take print on the printer.
Wide Area Network (WAN)
• A Wide Area Network (WAN) is a type of computer network that covers a large area
such as different cities of the country or different countries and continents of the
world
• Typically, a WAN consists of many LANs connected together across a wide
geographical area
• Internet is the world’s largest WAN
• It connects many thousands of computers and LANs around the world and making it a web
• WAN is expensive than LAN but its transmission rate is slower than LAN
• In WAN, computers and other devices are often connected through telephone lines
• However, they can also be connected through microwave or satellite systems
• A modem is used in computers to establish communication between computers over
a long distance
• WANs are used in large organizations
• For example, in Pakistan, large organizations like PIA, WAPDA, ARMY, NADRA, and
Wide Area Network (WAN)
+ Covers Large Area
+ WAN covers a large geographical area so long-distance businesses can connect on the network
+ Users can access the network from any location of the country or world
+ Sharing and Communicating Messages
+ Messages can be shared and communicated all over the world
+ These messages can have text, pictures, and sounds
+ For example, users can communicate and share messages through video conference
+ Centralized Data
+ Data of an organization is stored in a single location even if the organization is spread all over
the world (or different cities of the country)
+ Everyone on the network can use the same data
+ This avoids problems where some users may have older information than others
+ Entertainment
+ WAN provides many sources of entertainment to users
+ For example, users can play different types of games, see movies, and listen to music over
Wide Area Network (WAN)
- Hardware and Software Costs
- WAN becomes expensive to install
- Devices and software that are required for installing WAN are very costly.
- Management and Staff Training Costs
- Managing WAN is complicated
- Trained and competent network managers/supervisors and technicians are required to
run the WAN
- So handsome salaries have to be paid to them
- Therefore, it becomes very expensive to run the WAN
- Training is required at all levels, including network managers/administrators
- Organization has to pay a lot of amount on the training of staff to run the network
Wide Area Network (WAN)
- Slow for Data Transmission
- Its data transmission rate is from 56 Kbps to 50 Mbps
- Security Issue
- Protection against hackers and viruses is not an easy job
- It needs a good firewall to restrict outsiders from entering and disrupting the network
- Firewall is a security system consisting of hardware and/or software to prevent unauthorized access
of a network or computer
- Viruses can also spread very quickly and easily through WAN
- Failure of Server and Communication Line
- If a server fails, entire network is affected
- Similarly, a failure in communication line may also stop the working of WAN
Metropolitan Area Network (MAN)
• A Metropolitan Area Network (MAN) is a network system that covers the area of a
city or town
• Usually, MAN consists of two or more LANs in a city or town which are connected
together
• For example, a company may design a MAN by connecting all the LANs in all its
office throughout the city
• The cable television companies, telephone companies, and Internet Service
Providers use MAN
• Mobile phones (cellular) systems often use a MAN
• MAN is larger than LAN and smaller than WAN
• It covers an area of between 5 to 50 km diameter
• A MAN uses different transmission media (wired or wireless) and devices for
communication
• In most of MANs, fiber optic cables are used as transmission media
Metropolitan Area Network (MAN)
+It covers a larger area than LAN
+It requires fewer resources as compared to WAN. This saves implementation cost
+It provides high-speed communication
+Resources can be shared among different users all over the city
+Its installation and maintenance is less expensive than WAN
+It provides higher security as compared to WAN
- It is more expensive than LAN
- It becomes difficult to manage if the network becomes large
- Network installation requires skilled technicians and network administrators. This
increases the overall installation and management costs
Personal Area Network (PAN)
• A personal area network (PAN) is a network that connects personal computers
and devices using wired and wireless technology
• Computers/devices are typically located within a range of about 30 feet
• Devices may include smartphones, digital cameras, printers, telephones,
tablets, and PDAs
• A PAN may connect devices through a router using network cables or directly
using special USB cables
• PANs also may use Bluetooth or Wi-Fi technology
LAN WAN
• It covers a small geographical area • It covers a large geographical area
• Computers are directly connected through • Computers are connected through a
physical cable or wireless connection telephone line or microwave system
• In LAN, connection is permanent using cables • In WAN, connection is not permanent
• A network card is used in each computer for • Modem or router is used in each computer
data transmission between computers for data transmission between computers
• Its data transmission speed is faster than WAN • Its data transmission speed is slower than
• Its installation and configuration cost is less LAN
than WAN • Its installation and configuration cost is
• It has less possibility of data transmission greater than LAN
errors
• It has a higher possibility of data
• In LAN, normally problems occur due to cable transmission errors
disturbance
• In WAN, normally problems occur due to
• In LAN, computers can be connected in a telephone lines, or other wireless media
limited area
• In WAN, computers can be connected
Network Architectures
Chapter 7 – Computer Networks
Network Architectures
• Network architecture is the design or layout of computers, devices, and media
in a computer network
• Computer network can be designed using different ways
• Most popular network architectures are:
• Client-server network
• Peer-to-peer (P2P) network
• Hybrid network
Client-Server Network
• A network architecture in which one or more computers act as servers and
other computers act as clients is called a client-server network
• In this network, servers are not used as clients and clients never act as servers
• Both wired and wireless networks can be configured as a client-server
network
• The server is a powerful computer
• It is also called a host computer
• It controls the whole network and provides services to the clients
• It also provides a centralized storage area for data & software and centralized
security to ensure that resources are not accessed by unauthorized users
Client-Server Network
• A client-server network may consist of two or more servers
• Each server performs only one specific task
• A server that performs only a specific task in the network is called a dedicated
server
• File Server Stores and manages files
• Print Server Manages printers and print jobs
• Database Server Stores and manages databases. It also provides access to databases
• Application Server Stores and distributes application software on the network
• Network Server Manages network activity (or network traffic)
• Web Server Stores web pages. It also receives requests from clients, processes the
requests, and sends the results of requests to clients
• Email Server Stores and handles incoming and outgoing email messages
Client-Server Network
• All computers and mobile devices other than the server(s) in the client-server
network are called clients
• They can be PCs and laptops or other mobile computers or devices
• Users run applications on the clients
• For example, users send requests to the server through clients
• Server receives requests from clients and takes proper actions on these
requests
• The results of the requests are sent to the clients
• Clients depend on the server for different resources like centralized storage,
printing, and data processing, etc.
Client-Server Network
+It provides faster responses to the clients
+It allows using less expensive computers as clients because most of the work
is done by the server
+It provides centralized security/management
+It provides the facility to easy backup of data
- More powerful computer is required to install as server
- So it becomes very costly
- The entire network may be affected if there is any problem on the server
Peer-to-Peer Network
• A network architecture in which all computers on the network have equal status and no
one has control over others is called a peer-to-peer network (or simply P2P network)
• In this network architecture, each computer or mobile device is called a peer
• Each peer can act as both a server and client at the same time
• Both wired and wireless networks can be configured as a peer-to-peer network
• In peer-to-peer network architecture, there is no central computer to control other
computers on the network
• Each computer can share data and devices (or resources) of other computers in the
network
• For example, a printer attached to any computer can be used by all computers connected to the
network
• Each computer stores its data and program files because P2P does not have a common
file server
• Peer-to-peer network is a simple and low-cost network
• It normally consists of less than 10 computers
Peer-to-Peer Network
+It is useful in small offices
+It is easy to design and to maintain
+It does not require any powerful computer
- It becomes slow under heavy use
- There is no central place for storing data and software
- In this network, data is not stored on a central computer
- So it provides less security
Hybrid Network
• Hybrid network has combined features of both client-server and peer-to-peer
networks
• It also has one or more servers
• Users can share data and software
• Similarly, each node can store its own data files and programs and has its own
peripheral devices
• Users can also share each other’s data and devices
Client – Server Network Peer – to – Peer Network
• Each computer is called either a server • Each computer is called a peer
or a client • No computer act as a server
• One or more computers act as servers • There is no dedicated server or central
• There is one or more dedicated servers computer to control other computers
that control the other computers on the on the network
network
• It consists of less than ten computers
• It may consist of many computers
• Each computer stores its data and
• Mostly data and program files are stored program files
on the dedicated server
• Data cannot be managed easily because
• Data can be managed very easily data is stored on different computers
because all data is stored on a dedicated
server • It is useful in small offices/businesses
• It is used in large organizations • Data is not stored on a central
computer. So it does not provide proper
• Data is stored on a central computer. So
data security
Network Topologies
Chapter 7 – Computer Networks
Network Topologies
• In networking, term topology is the way of connecting computers or nodes on
a network
• There are many ways in which computers can be connected together in a
computer network
• Way in which computers or other devices are connected in a network is called
network topology
• Shortly term network topology refers to the physical layout or shape of
network
• Commonly used network topologies
• Bus topology
• Star topology
• Ring topology
• Tree topology
• Mesh topology
Bus Topology
• In a Bus topology, all nodes are connected to a common communication
medium
• Usually, a central cable is used as a communication medium
• This cable is called Bus
• This cable is the backbone of the topology
• Nodes are connected to the Bus through an interface connector
• Both ends of the cable are closed with terminators
• A terminator is a special small device that absorbs data signals (or prevents
data signals)
• Bus topology is suitable for small networks
Bus Topology
Working of Bus Topology
• When a sending computer wants to send a message, it has to determine
whether the media is in use or free
• If no other device is transmitting the data, it sends a message to the destination
computer
• Address of the destination computer is also attached to the message
• This message moves from one computer to another through the bus
• Each computer connected to the network receives the message, checks the
attached address
• If the attached message matches with the address of the computer, then it
accepts the message
• Otherwise, the message moves toward the next computer
Bus Topology
+Very simple network
+Easy to install and to maintain
+Less expensive because it requires a single cable to connect devices
+When nodes are added and removed in the network, network is not affected
+If one node fails in the network, other nodes are not affected
- Entire network fails if there is any problem with the bus (central cable)
- It supports only a small number of nodes. So it is not suitable for a large
network
Star Topology
• In a star network, all nodes are directly connected to a central device, called Hub or Switch
• This central device controls all the traffic
• Usually, nodes are connected to the Hub with unshielded twisted pair (UTP) cable
• Shape of the Star network looks like a star
• Star topology is most commonly used in LAN
- This type of network depends upon the central device. If this device fails,
whole network breaks down
- It requires more cables than any other networks. So it becomes more costly.
- Increased cost also due to hub etc.
Ring Topology
• In a ring topology, each node is connected to next node and last node is connected
to first
• Thus, shape of the network is formed just like a ring
Working of Ring Topology
• In Ring topology, a token is passed around the network
• Computer that has control of the token can transmit data/message
• When a computer sends a message to another computer on the network, message
flows from one computer to the next computer
• Every computer receives a message from previous computer and retransmits it to
the next computer until the destination computer receives the message
• Destination computer sends an acknowledgment of receiving a message to the
sender computer
• Sender computer then releases the token back to the network
Ring Topology
+Less expensive to implement
+Easy to install and to maintain
+All computers have equal access to the network
+Every computer regenerates/refreshes the data signal that’s why it can travel
over a longer distance
- If one node fails (or the ring is broken at any point), the entire network stops
functioning.
- Adding or removing a computer in the network affects the whole network and
no message can be communicated at that time.
Tree Topology
• Tree topology has combined features of both bus
and star topologies
• Whole network is divided into segments
• Each segment represents a Star topology
• All segments (i.e. Star topologies) are combined
through central cable or bus
• Thus, Bus topology works as the backbone of the
Tree network
• Tree network looks like a tree structure
• In Tree topology network, usually, multiple hubs
are used
• Each hub controls the nodes directly connected to
it and exchanges data among them
• It also exchanges data to other devices connected
to the other hubs
Tree Topology
• Example cable TV network
+Its existing network can be expanded very
easily (i.e. easily scalable)
+Each segment of the network can be easily
managed and maintained
+If one segment fails, other segments are
not affected
+Errors detection and correction is easy
- More expensive because more hubs are
required to be installed in the network
- It relies on the central cable or bus. If it
breaks, the whole network is affected.
Mesh Topology
• In the Mesh topology, each node is directly connected
to every other node on the network
• This type of network involves the concept of routes
• Mesh topology is rarely used in LAN
• It is mostly used in WANs like the Internet use mesh
topology
• In Mesh topology, each node can send a message to
the destination through multiple paths
• It means that each node of the Mesh network has
several possible paths to send or to receive a message,
but in Bus, Star, and Ring topologies each node has
only one path
• Data always travels through the best-suited path
Mesh Topology
+It provides multiple routes. If one route is blocked,
then another suitable route can be used for data
communication.
+Troubleshooting of this topology is easy as compared
with other networks
• Most of what the user actually interacts with is at this layer. Web browsers and
other internet-connected applications (like Skype or Outlook) use Layer 7
application protocols.
Layer 6: Presentation Layer
• Providing services for secure efficient data transmission
• e.g. data encryption, data formatting and data compression.
Layer 5: Session Layer
• Allows two applications on different computers to establish,
use, and end a session.
• e.g. file transfer, remote login
Layer 4: Transport Layer
• Manages transmission packets
• Breaks down long messages when necessary into small packets
for transmission
• Reassembles packets in correct order to get the original message.
• Handles error recognition and recovery.
• Transport layer at receiving acknowledges packet delivery.
• Resends missing packets
Layer 3: Network Layer
• Manages addressing/routing of data within the subnet
• This layer determines how data is sent to the receiving device. It’s
responsible for packet forwarding, routing, and addressing.
• Translates logical addresses (IP address) into physical addresses
(MAC address).
Layer 2: Data Link Layer
· Packages raw bits from the Physical layer into frames
(Framing)
· Provides reliable transmission of frames
· It waits for an acknowledgment from the receiving computer.
· Retransmits frames for which acknowledgement not received
(Error control)
· Flow control
Layer 1: Physical Layer
• Transmits bits from one computer to another
• Regulates the transmission of a stream of bits over a
physical medium.
• Defines how the cable is attached to the network adapter
and what transmission technique is used to send data over
the cable. Deals with issues like
• The definition of 0 and 1, e.g. how many volts represents a 1?
• Whether the channel is simplex or duplex?
• How many pins a connector has, and what the function of each pin is?
Analog and Digital Signals
• Analog Signal
• An continuously varying electromagnetic wave that may be propagated over a variety of
media (e.g., twisted pair or coaxial cable etc.)
• Digital Signal
• A sequence of voltage pulses that may be transmitted over a wire medium, e.g., a constant
positive voltage level may represent binary 0 and a constant negative voltage level may
represent binary 1.
• Advantages of digital signal over analog signal
• Cheaper in price
• Less noise interference
• Disadvantages of digital signal over analog signal
• A higher bandwidth is required for data communication in comparison to analog
transmission of an equivalent information.
• Processing is more complex
Comparison of analog and digital signals
Serial Transmission
• When data is sent or received using serial data transmission, the data bits are
organized in a specific order, since they can only be sent one after another. The
order of the data bits is important as it dictates how the transmission is organized
when it is received. It is viewed as a reliable data transmission method because a
data bit is only sent if the previous data bit has already been received.
• Communication between two computers is example of serial transmission.
Asynchronous Serial Transmission
• Data bits can be sent at any point in time. Stop bits and start bits are used
between data bytes to synchronize the transmitter and receiver and to ensure
that the data is transmitted correctly. The time between sending and receiving
data bits is not constant, so gaps are used to provide time between transmissions.