Computer Network
A computer network is a group of computers linked to each other that enables the computer
to communicate with another computer and share their resources, data, and applications.
A computer network can be categorized by their size. A computer network is mainly of four
types:
o LAN(Local Area Network)
o PAN(Personal Area Network)
o MAN(Metropolitan Area Network)
o WAN(Wide Area Network)
NETWORK HARDWARE:
Network hardware refers to the physical tools and devices used to build, manage, and
maintain computer networks. These physical components are critical for enabling data
sharing and communication across various devices inside a network, hence facilitating the
distribution of resources, services, and information. Local area networks (LANs), wide area
networks (WANs), and even the vast internet use network hardware.
LAN(Local Area Network)
o Local Area Network is a group of computers connected to each other in a small area
such as building, office.
o LAN is used for connecting two or more personal computers through a
communication medium such as twisted pair, coaxial cable, etc.
o It is less costly as it is built with inexpensive hardware such as hubs, network
adapters, and ethernet cables.
o The data is transferred at an extremely faster rate in Local Area Network.
o Local Area Network provides higher security.
PAN(Personal Area Network)
o Personal Area Network is a network arranged within an individual person, typically
within a range of 10 meters.
o Personal Area Network is used for connecting the computer devices of personal use is
known as Personal Area Network.
o Thomas Zimmerman was the first research scientist to bring the idea of the Personal
Area Network.
o Personal Area Network covers an area of 30 feet.
o Personal computer devices that are used to develop the personal area network are the
laptop, mobile phones, media player and play stations.
There are two types of Personal Area Network:
o Wired Personal Area Network
o Wireless Personal Area Network
Wireless Personal Area Network: Wireless Personal Area Network is developed by simply
using wireless technologies such as WiFi, Bluetooth. It is a low range network.
Wired Personal Area Network: Wired Personal Area Network is created by using the USB.
Examples Of Personal Area Network:
o Body Area Network: Body Area Network is a network that moves with a
person. For example, a mobile network moves with a person. Suppose a person
establishes a network connection and then creates a connection with another device to
share the information.
o Offline Network: An offline network can be created inside the home, so it is also
known as a home network. A home network is designed to integrate the devices such
as printers, computer, television but they are not connected to the internet.
o Small Home Office: It is used to connect a variety of devices to the internet and to a
corporate network using a VPN
MAN(Metropolitan Area Network)
o A metropolitan area network is a network that covers a larger geographic area by
interconnecting a different LAN to form a larger network.
o Government agencies use MAN to connect to the citizens and private industries.
o In MAN, various LANs are connected to each other through a telephone exchange
line.
o The most widely used protocols in MAN are RS-232, Frame Relay, ATM, ISDN, OC-
3, ADSL, etc.
o It has a higher range than Local Area Network(LAN).
Uses Of Metropolitan Area Network:
o MAN is used in communication between the banks in a city.
o It can be used in an Airline Reservation.
o It can be used in a college within a city.
o It can also be used for communication in the military.
WAN(Wide Area Network)
o A Wide Area Network is a network that extends over a large geographical area such
as states or countries.
o A Wide Area Network is quite bigger network than the LAN.
o A Wide Area Network is not limited to a single location, but it spans over a large
geographical area through a telephone line, fibre optic cable or satellite links.
o The internet is one of the biggest WAN in the world.
o A Wide Area Network is widely used in the field of Business, government, and
education.
Examples Of Wide Area Network:
o Mobile Broadband: A 4G network is widely used across a region or country.
o Last mile: A telecom company is used to provide the internet services to the
customers in hundreds of cities by connecting their home with fiber.
o Private network: A bank provides a private network that connects the 44 offices.
This network is made by using the telephone leased line provided by the telecom
company.
Advantages Of Wide Area Network:
Following are the advantages of the Wide Area Network:
o Geographical area: A Wide Area Network provides a large geographical area.
Suppose if the branch of our office is in a different city then we can connect with
them through WAN. The internet provides a leased line through which we can
connect with another branch.
o Centralized data: In case of WAN network, data is centralized. Therefore, we do not
need to buy the emails, files or back up servers.
o Get updated files: Software companies work on the live server. Therefore, the
programmers get the updated files within seconds.
o Exchange messages: In a WAN network, messages are transmitted fast. The web
application like Facebook, Whatsapp, Skype allows you to communicate with friends.
o Sharing of software and resources: In WAN network, we can share the software
and other resources like a hard drive, RAM.
o Global business: We can do the business over the internet globally.
o High bandwidth: If we use the leased lines for our company then this gives the high
bandwidth. The high bandwidth increases the data transfer rate which in turn
increases the productivity of our company.
Disadvantages of Wide Area Network:
The following are the disadvantages of the Wide Area Network:
o Security issue: A WAN network has more security issues as compared to LAN and
MAN network as all the technologies are combined together that creates the security
problem.
o Needs Firewall & antivirus software: The data is transferred on the internet which
can be changed or hacked by the hackers, so the firewall needs to be used. Some
people can inject the virus in our system so antivirus is needed to protect from such a
virus.
o High Setup cost: An installation cost of the WAN network is high as it involves the
purchasing of routers, switches.
o Troubleshooting problems: It covers a large area so fixing the problem is difficult.
Internetwork
o An internetwork is defined as two or more computer network LANs or WAN or
computer network segments are connected using devices, and they are configured by
a local addressing scheme. This process is known as internetworking.
o An interconnection between public, private, commercial, industrial, or government
computer networks can also be defined as internetworking.
o An internetworking uses the internet protocol.
o The reference model used for internetworking is Open System
Interconnection(OSI).
Types Of Internetwork:
1. Extranet: An extranet is a communication network based on the internet protocol such
as Transmission Control protocol and internet protocol. It is used for information sharing.
The access to the extranet is restricted to only those users who have login credentials. An
extranet is the lowest level of internetworking. It can be categorized as MAN, WAN or other
computer networks. An extranet cannot have a single LAN, atleast it must have one
connection to the external network.
2. Intranet: An intranet is a private network based on the internet protocol such
as Transmission Control protocol and internet protocol. An intranet belongs to an
organization which is only accessible by the organization's employee or members. The main
aim of the intranet is to share the information and resources among the organization
employees. An intranet provides the facility to work in groups and for teleconferences.
Intranet advantages:
o Communication: It provides a cheap and easy communication. An employee of the
organization can communicate with another employee through email, chat.
o Time-saving: Information on the intranet is shared in real time, so it is time-saving.
o Collaboration: Collaboration is one of the most important advantage of the intranet.
The information is distributed among the employees of the organization and can only
be accessed by the authorized user.
o Platform independency: It is a neutral architecture as the computer can be connected
to another device with different architecture.
o Cost effective: People can see the data and documents by using the browser and
distributes the duplicate copies over the intranet. This leads to a reduction in the cost.
Network Software
Network software is an umbrella term used to describe a wide range of software that
streamlines the operations, design, monitoring, and implementation of computer networks.
Protocol Hierarchies:
Protocol is simply defined as a set of rules and regulations for data communication.
Rules are basically defined for each and every step and process at time of communication
among two or more computers. Networks are needed to follow these protocols to transmit
the data successfully. All protocols might be implemented using hardware, software, or
combination of both of them. The three aspects of a protocol are −
Syntax − It defines the format of data that is to be sent or received.
Semantics − It defines the meaning of each section of bits that are transferred.
Timings − It defines the time at which data is transferred as well as the speed at
which it is transferred.
A Protocol Hierarchy in a computer network is a set of rules and conventions that
govern the communication between different devices and systems. These protocols are
organised into layers, with each layer building upon the one below it to provide a set of
services and functions. The most commonly used protocol hierarchy in computer networks is
the OSI (Open Systems Interconnection) model.
The following figure illustrates a four-layer network −
The above figure represents communication between Device A and Device B. The
data stream from one device to the other is not sent directly but has to pass through a number
of layers. The layers in the same levels are called peers and have a set of protocols for
communication. Between each adjacent layer is an interface that defines the services that are
being offered by a lower layer to the next higher layer. The dotted arrows depict virtual
communication between peer layers, while the solid arrows represent the physical
communications between the adjacent layers.
Let us consider a situation where Device A wants to send a message to Device B.
Device A passes its information to the highest layer. As soon as a data stream reaches a layer,
it performs some specified functions on it and passes it to the layer below. This continues
until the data stream reaches the lowest layer. Layer 1 passes a bit stream of 0s and 1s to the
physical medium that communicates it to the Layer 1 of the receiving end. Each layer in the
receiving end performs certain functions on the data stream adhering to the protocol with its
peer and passes it to the layer above. This continues until the information reaches the highest
layer. The highest layer then conveys the message to Device B in the same format sent by
Device A.
Design Issues for the Layers
A number of design issues exist for the layer to layer approach of computer networks. Some
of the main design issues are as follows −
Reliability
Network channels and components may be unreliable, resulting in loss of bits while data
transfer. So, an important design issue is to make sure that the information transferred is not
distorted.
Scalability
Networks are continuously evolving. The sizes are continually increasing leading to
congestion. Also, when new technologies are applied to the added components, it may lead to
incompatibility issues. Hence, the design should be done so that the networks are scalable and
can accommodate such additions and alterations.
Addressing
At a particular time, innumerable messages are being transferred between large numbers of
computers. So, a naming or addressing system should exist so that each layer can identify the
sender and receivers of each message.
Error Control
Unreliable channels introduce a number of errors in the data streams that are communicated.
So, the layers need to agree upon common error detection and error correction methods so as
to protect data packets while they are transferred.
Flow Control
If the rate at which data is produced by the sender is higher than the rate at which data is
received by the receiver, there are chances of overflowing the receiver. So, a proper flow
control mechanism needs to be implemented.
Resource Allocation
Computer networks provide services in the form of network resources to the end users. The
main design issue is to allocate and deallocate resources to processes. The
allocation/deallocation should occur so that minimal interference among the hosts occurs and
there is optimal usage of the resources.
Statistical Multiplexing
It is not feasible to allocate a dedicated path for each message while it is being transferred
from the source to the destination. So, the data channel needs to be multiplexed, so as to
allocate a fraction of the bandwidth or time to each host.
Routing
There may be multiple paths from the source to the destination. Routing involves choosing an
optimal path among all possible paths, in terms of cost and time. There are several routing
algorithms that are used in network systems.
Security
A major factor of data communication is to defend it against threats like eavesdropping and
surreptitious alteration of messages. So, there should be adequate mechanisms to prevent
unauthorized access to data through authentication and cryptography.
Connection Oriented and Connectionless Services
In order to establish a connection between two or more devices, there are services in
Computer Networks. There are two services that are given by the layers to layers above them.
These services are as follows:
1. Connection-Oriented Service
2. Connectionless Services
Connection-Oriented Services
There is a sequence of operations to be followed by the users of connection-oriented service.
These are:
1. The connection is established.
2. Information is sent.
3. The connection is released.
In connection-oriented service, we have to establish a connection before starting the
communication. When the connection is established, we send the message or the information
and then we release the connection.
Connection-oriented service is more reliable than connectionless service. We can send the
message in a connection-oriented service if there is an error at the receiver's end. An example
of connection-oriented is TCP (Transmission Control Protocol) protocol.
In the above diagram, a solid line between Device A and Device B indicates that there is a
dedicated link with which the stream of data travels between them. With the help of this link,
a receiver can send an acknowledgment to the sender about the status of the packet.
Types of Connection-Oriented Service :
Service Example
Reliable Message Stream Sequence of pages, etc.
Reliable Byte Stream Song Download, etc.
Unreliable Connection VoIP (Voice Over Internet Protocol)
Advantages
Connection-Oriented Services are reliable.
There is no duplication of data packets.
There are no chances of Congestion.
These are Suitable for long connections.
Sequencing of data packets is guaranteed.
Disadvantages
This allocation of resources is mandatory before communication.
The speed of connection is slower. As much time is taken for establishing and
relinquishing the connection.
In the case of Network Congestion or router failures, there are no alternative ways to
continue with communication.
Connection Less Services
It is similar to the postal services, as it carries the full address where the message (letter) is to
be carried. Each message is routed independently from source to destination. The order of
messages sent can be different from the order received.
In connectionless the data is transferred in one direction from source to destination without
checking the destination is still there or not or if it prepared to accept the message.
Authentication is not needed in this. An example of a Connectionless service is UDP (User
Datagram Protocol) protocol.
Advantages
There are usually low overheads.
Connection-Oriented services help to broadcast or multicast messages to multiple
recipients.
In this, there is no circuit setup. Thus it takes a fraction of a minute in order to
establish a connection.
In the case of Network congestion or router failures, it has an alternative path of data
transmission.
Disadvantages
These are susceptible to congestion in the network.
It is not reliable as there is the possibility of a loss of data packets, wrong delivery of
packets or duplication is high.
In this, each data packet needs lengthy fields because these are supposed to hold all
the destination addresses and the routing information.
Let us understand the differences between the above given two services:
Connection-Oriented Services Connection Less Services
Connection-Oriented services are designed Connectionless services are based on
on the basis of the Telephone System. the Postal System.
In this type of service, a prior connection In this type of service, no prior
needs to be established. connection is needed.
These services Ensure the reliable transfer As these services are best efforts services
of data. but reliability is not guaranteed in these.
There are chances of occurrence of
There is no possibility of congestion.
congestion using these services.
In this, authentication is not
In this authentication is required before
required before transmitting the data
transmitting the data packets to the receiver.
packets to the receiver.
These services are suitable for long and These services are suitable
steady transmissions. for bursty transmissions.
In this connection is established through the
There is no such signaling concept exists.
process of signaling
In this type of service, data packets travel In this type of service, data packets travel
Connection-Oriented Services Connection Less Services
towards their destination node in a towards their destination node in
sequential manner. a random manner.
Retransmission of lost data bits is possible. In this, it is not possible.
Delay is more while transferring the
information. But after the establishment of Due to the absence of the connection
connection, these services offer fast delivery establishment phase, there is no delay.
of information.
Service Primitives
A service is formally specified by a set of primitives (operations) available to a user
process to access the service. These primitives tell the service to perform some action or
report on an action taken by a peer entity. If the protocol stack is located in the operating
system, as it often is, the primitives are normally system calls. These calls cause a trap to
kernel mode, which then turns control of the machine over to the operating system to send the
necessary packets. The set of primitives available depends on the nature of the service being
provided. The primitives for connection-oriented service are different from those of
connection-less service. There are five types of service primitives :
1. LISTEN: When a server is ready to accept an incoming connection it executes the
LISTEN primitive. It blocks waiting for an incoming connection.
2. CONNECT: It connects the server by establishing a connection. The response is
awaited.
3. RECIEVE: Then the RECIEVE call blocks the server.
4. SEND: Then the client executes SEND primitive to transmit its request followed by
the execution of RECIEVE to get the reply. Send the message.
5. DISCONNECT: This primitive is used for terminating the connection. After this
primitive one can't send any message. When the client sends the DISCONNECT
packet then the server also sends the DISCONNECT packet to acknowledge the
client. When the server package is received by client then the process is terminated.
Connection-Oriented Service Primitives
There are 5 types of primitives for Connection-Oriented Service :
LISTEN Block waiting for an incoming connection
CONNECTION Establish a connection with a waiting peer
RECEIVE Block waiting for an incoming message
SEND Sending a message to the peer
DISCONNECT Terminate a connection
Connectionless Service Primitives
There are 4 types of primitives for Connectionless Oriented Service:
UNIDATA This primitive sends a packet of data
FACILITY, Primitive for enquiring about the performance of the network, like
REPORT delivery statistics.
Relationship of Services to Protocol
In this section, we will learn about how services and protocols are related and why they are so
important to each other.
What are Services?
These are the operations that a layer can provide to the layer above it in the OSI Reference
model. It defines the operation and states a layer is ready to perform but it does not specify
anything about the implementation of these operations.
What are the Protocols?
These are a set of rules that govern the format and meaning of frames, messages or packets
that are exchanged between the server and client.
Reference Models:
The most important reference models are:
1. OSI reference model.
2. TCP/IP reference model.
ISO-OSI Model
o OSI stands for Open System Interconnection is a reference
model that describes how information from a software application in
one computer moves through a physical medium to the software
application in another computer.
o OSI consists of seven layers, and each layer performs a particular
network function.
o OSI model was developed by the International Organization for
Standardization (ISO) in 1984, and it is now considered as an
architectural model for the inter-computer communications.
o OSI model divides the whole task into seven smaller and
manageable tasks. Each layer is assigned a particular task.
o Each layer is self-contained, so that task assigned to each layer can
be performed independently.
Seven Layers of the OSI Model are as follows:
Physical Layer
Data Link Layer
Network Layer
Transport Layer
Session Layer
Presentation Layer
Application Layer
Physical layer
o The main functionality of the physical layer is to transmit the
individual bits from one node to another node.
o It is the lowest layer of the OSI model.
o It establishes, maintains and deactivates the physical connection.
o It specifies the mechanical, electrical and procedural network
interface specifications.
2) Data-Link Layer
o This layer is responsible for the error-free transfer of data frames.
o It defines the format of the data on the network.
o It provides a reliable and efficient communication between two or
more devices.
o It is mainly responsible for the unique identification of each device
that resides on a local network.
o It contains two sub-layers:
o Logical Link Control Layer
o It is responsible for transferring the packets to the
Network layer of the receiver that is receiving.
o It identifies the address of the network layer protocol
from the header.
o It also provides flow control.
o Media Access Control Layer
o A Media access control layer is a link between the
Logical Link Control layer and the network's physical
layer.
o It is used for transferring the packets over the network.
3) Network Layer
o It is a layer 3 that manages device addressing, tracks the location of
devices on the network.
o It determines the best path to move data from source to the
destination based on the network conditions, the priority of service,
and other factors.
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. Examples of protocols are IP and Ipv6.
ADVERTISEMENT
4) Transport Layer
o The Transport layer is a Layer 4 ensures that messages are
transmitted in the order in which they are sent and there is no
duplication of data.
o The main responsibility of the transport layer is to transfer the data
completely.
o It receives the data from the upper layer and converts them into
smaller units known as segments.
o This layer can be termed as an end-to-end layer as it provides a
point-to-point connection between source and destination to deliver
the data reliably.
The two protocols used in this layer are:
o Transmission Control Protocol
o It is a standard protocol that allows the systems to
communicate over the internet.
o It establishes and maintains a connection between hosts.
o When data is sent over the TCP connection, then the TCP
protocol divides the data into smaller units known as
segments. Each segment travels over the internet using
multiple routes, and they arrive in different orders at the
destination. The transmission control protocol reorders the
packets in the correct order at the receiving end.
o User Datagram Protocol
o User Datagram Protocol is a transport layer protocol.
o It is an unreliable transport protocol as in this case receiver
does not send any acknowledgment when the packet is
received, the sender does not wait for any acknowledgment.
Therefore, this makes a protocol unreliable.
5) Session Layer
o It is a layer 3 in the OSI model.
o The Session layer is used to establish, maintain and synchronizes
the interaction between communicating devices.
6) Presentation Layer
o A Presentation layer is mainly concerned with the syntax and
semantics of the information exchanged between the two systems.
o It acts as a data translator for a network.
o This layer is a part of the operating system that converts the data
from one presentation format to another format.
o The Presentation layer is also known as the syntax layer.
7) Application Layer
o An application layer serves as a window for users and application
processes to access network service.
o It handles issues such as network transparency, resource allocation,
etc.
o An application layer is not an application, but it performs the
application layer functions.
o This layer provides the network services to the end-users.
TCP/IP Reference Model
TCP/IP is transmission control protocol and internet protocol. Protocols
are a set of rules which govern every possible communication over the
internet. These protocols describe the movement of data between the
host computers or the internet and offer simple naming and addressing
schemes.
o The TCP/IP model was developed prior to the OSI model.
o The TCP/IP model is not exactly similar to the OSI model.
TCP/IP Reference model is explained in detail in another chapter.
Layers in the TCP/IP Model are as follows:
Network access layer
Internet layer
Transport layer
Application layer
Functions of TCP/IP layers:
Network Access Layer
o A network layer is the lowest layer of the TCP/IP model.
o A network layer is the combination of the Physical layer and Data
Link layer defined in the OSI reference model.
o It defines how the data should be sent physically through the
network.
o This layer is mainly responsible for the transmission of the data
between two devices on the same network.
o The functions carried out by this layer are encapsulating the IP
datagram into frames transmitted by the network and mapping of IP
addresses into physical addresses.
o The protocols used by this layer are ethernet, token ring, FDDI,
X.25, frame relay.
Internet Layer
o An internet layer is the second layer of the TCP/IP model.
o An internet layer is also known as the network layer.
o The main responsibility of the internet layer is to send the packets
from any network, and they arrive at the destination irrespective of
the route they take.
ARP Protocol
o ARP stands for Address Resolution Protocol.
o ARP is a network layer protocol which is used to find the physical
address from the IP address.
o The two terms are mainly associated with the ARP Protocol:
o ARP request: When a sender wants to know the physical
address of the device, it broadcasts the ARP request to the
network.
o ARP reply: Every device attached to the network will accept
the ARP request and process the request, but only recipient
recognize the IP address and sends back its physical address
in the form of ARP reply. The recipient adds the physical
address both to its cache memory and to the datagram
header
ICMP Protocol
o ICMP stands for Internet Control Message Protocol.
o It is a mechanism used by the hosts or routers to send notifications
regarding datagram problems back to the sender.
o A datagram travels from router-to-router until it reaches its
destination. If a router is unable to route the data because of some
unusual conditions such as disabled links, a device is on fire or
network congestion, then the ICMP protocol is used to inform the
sender that the datagram is undeliverable.
o An ICMP protocol mainly uses two terms:
o ICMP Test: ICMP Test is used to test whether the destination
is reachable or not.
o ICMP Reply: ICMP Reply is used to check whether the
destination device is responding or not.
o The core responsibility of the ICMP protocol is to report the
problems, not correct them. The responsibility of the correction lies
with the sender.
o ICMP can send the messages only to the source, but not to the
intermediate routers because the IP datagram carries the addresses
of the source and destination but not of the router that it is passed
to.
Transport Layer
The transport layer is responsible for the reliability, flow control, and
correction of data which is being sent over the network.
The two protocols used in the transport layer are User Datagram
protocol and Transmission control protocol.
o User Datagram Protocol (UDP)
o It provides connectionless service and end-to-end delivery of
transmission.
o It is an unreliable protocol as it discovers the errors but not
specify the error.
o User Datagram Protocol discovers the error, and ICMP protocol
reports the error to the sender that user datagram has been
damaged.
o UDP consists of the following fields:
Source port address: The source port address is the
address of the application program that has created the
message.
Destination port address: The destination port address is
the address of the application program that receives the
message.
Total length: It defines the total number of bytes of the user
datagram in bytes.
Checksum: The checksum is a 16-bit field used in error
detection.
o UDP does not specify which packet is lost. UDP contains only
checksum; it does not contain any ID of a data segment.
o Transmission Control Protocol (TCP)
o It provides a full transport layer services to applications.
o It creates a virtual circuit between the sender and receiver,
and it is active for the duration of the transmission.
o TCP is a reliable protocol as it detects the error and
retransmits the damaged frames. Therefore, it ensures all the
segments must be received and acknowledged before the
transmission is considered to be completed and a virtual
circuit is discarded.
o At the sending end, TCP divides the whole message into
smaller units known as segment, and each segment contains
a sequence number which is required for reordering the
frames to form an original message.
o At the receiving end, TCP collects all the segments and
reorders them based on sequence numbers.
Application Layer
o An application layer is the topmost layer in the TCP/IP model.
o It is responsible for handling high-level protocols, issues of
representation.
o This layer allows the user to interact with the application.
o When one application layer protocol wants to communicate with
another application layer, it forwards its data to the transport layer.
o There is an ambiguity occurs in the application layer. Every
application cannot be placed inside the application layer except
those who interact with the communication system. For example:
text editor cannot be considered in application layer while web
browser using HTTP protocol to interact with the network
where HTTP protocol is an application layer protocol.
examples network:
internet
Internet is defined as an Information super Highway, to access
information over the web. However, It can be defined in many
ways as follows:
Internet is a world-wide global system of interconnected
computer networks.
Internet uses the standard Internet Protocol (TCP/IP).
Every computer in internet is identified by a unique IP
address.
IP Address is a unique set of numbers (such as
110.22.33.114) which identifies a computer location.
A special computer DNS (Domain Name Server) is used to
give name to the IP Address so that user can locate a
computer by a name.
For example, a DNS server will resolve a
name http://www.tutorialspoint.com to a particular IP
address to uniquely identify the computer on which this
website is hosted.
Internet is accessible to every user all over the world.