computer networking 2
computer networking 2
But in this blog, we'll mainly focus on computer networks. We'll also
study the nodes present in a network, classifications, goals, and
applications of a network.
Computer Network
A computer network is a system in which multiple computers
are connected to each other to share information and
resources. In other words, it is a network of various communicating
devices or elements connected by communication links. The
communication elements can be a computer, mobile, router, switch,
etc., and communication links can be an optical fibre cable, coaxial
fibre cable, wireless LAN, etc.
Ethernet LAN is the most commonly used LAN. The speed of a Local
Area Network also depends on the topology used. For example, a
LAN using bus topology has a speed of 10mbps to 100mbps, while in
ring topology it is around 4mbps to 16mbps. LAN's are generally
privately owned networks.
The MAN spans over a geographical area of about 50km. The best
example of MAN is the cable television network that spans over the
whole city.
1. MAN can be used for connecting the various offices of the same
organization, spread over the whole city.
2. It can be used for communication in various governmental
departments.
Following are the advantages of using MAN:
1. Peer-to-Peer Network
2. Server-Based Network
Now, we will learn about these two types of networks in detail.
Peer-to-Peer Network
The Peer-to-Peer network is also called P2P or computer-to-
computer network. 'Peers' are the nodes or computer system which
are connected to each other. In this kind of network, each node is
connected to each other node in the network.
The nodes can share printers or CDROM drives, and allow other
devices to read or write to its hard disk, allowing sharing of files,
access to its internet connection, and other resources. Files or
resources can be shared directly between the system on the network,
without the need of any central server. Such kind of network, where
we allow nodes to become a server and share things in this manner,
can be referred to as a peer-to-peer network.
Server-Based Networks
A Server-Based network can also be termed as a Client-Server
network. A server is a node that acts as a service provider for
clients. They wait for client requests and then respond to them. The
server is located elsewhere on the network, usually on a more
powerful machine. Here, the server is the central location where
users share and access network resources. It controls the level of
access that users have to share resources. In other words, a server
provides functionality and serve other programs called clients.
There is various kind of servers depending upon their use, they can
be a web server(which servers HTTP requests), Database
servers(which runs DBMS), File server(which provides files to
clients), Mail server, print server, Game server, Application server,
and so on. A server can contain web resources, host web
applications, store user and program data, etc.
1. Simplex
2. Half-Duplex
3. Full Duplex
The data transmission modes can be characterized in the following
two types based on the synchronization between the transmitter
and the receiver:
1. Synchronous
2. Asynchronous
The data transmission modes can be characterized in the following
two types based on the number of bits sent simultaneously in the
network:
1. Serial
2. Parallel
Now, let us study these various data transmission modes in the
computer network one by one.
1. Simplex
Simplex is the data transmission mode in which the data can
flow only in one direction, i.e., the communication is
unidirectional. In this mode, a sender can only send data but can
not receive it. Similarly, a receiver can only receive data but can not
send it.
This transmission mode is not so popular because we cannot perform
two-way communication between the sender and receiver in this
mode. It is mainly used in the business field as in sales that do not
require any corresponding reply. It is similar to a one-way street.
2. Half-Duplex
Half-Duplex is the data transmission mode in which the data
can flow in both directions but in one direction at a time. It is
also referred to as Semi-Duplex. In other words, each station can
both transmit and receive the data but not at the same time. When
one device is sending the other can only receive and vice-versa.
3. Full-Duplex
Full-Duplex is the data transmission mode in which the data
can flow in both directions at the same time. It is bi-directional
in nature. It is two-way communication in which both the stations
can transmit and receive the data simultaneously.
Full-Duplex mode has double bandwidth as compared to the half-
duplex. The capacity of the channel is divided between the two
directions of communication. This mode is used when
communication in both directions is required simultaneously.
1. Synchronous
The Synchronous transmission mode is a mode of
communication in which the bits are sent one after another
without any start/stop bits or gaps between them. Actually, both
the sender and receiver are paced by the same system clock. In this
way, synchronization is achieved.
1. It is very expensive.
2. Asynchronous
The Asynchronous transmission mode is a mode of
communication in which a start and the stop bit is introduced
in the message during transmission. The start and stop bits
ensure that the data is transmitted correctly from the sender to the
receiver.
Generally, the start bit is '0' and the end bit is '1'.Asynchronous here
means 'asynchronous at the byte level', but the bits are still
synchronized. The time duration between each character is the same
and synchronized.
1. Serial
The Serial data transmission mode is a mode in which the data
bits are sent serially one after the other at a time over the
transmission channel.
2. Parallel
The Parallel data transmission mode is a mode in which the
data bits are sent parallelly at a time. In other words, there is a
transmission of n-bits at the same time simultaneously.
Multiple transmission lines are used in such modes of transmission.
So, multiple data bytes can be transmitted in a single system clock.
This mode of transmission is used when a large amount of data has
to be sent in a shorter duration of time. It is mostly used for short-
distance communication.
• Transmission Rate.
• The Distance that it covers.
• Cost and Ease of Installation.
• The resistance of environmental conditions.
Topology is derived from two Greek words topo and logy, where
topo means 'place' and logy means 'study'. In computer
networks, a topology is used to explain how a network is
physically connected and the logical flow of information in the
network. A topology mainly describes how devices are connected
and interact with each other using communication links.
In computer networks, there are mainly two types of topologies,
they are:
1. Bus Topology
2. Ring Topology
3. Star Topology
4. Mesh Topology
5. Tree Topology
6. Hybrid Topology
Now let us learn these topologies one by one:
Bus Topology
Bus topology is the simplest kind of topology in which a
common bus or channel is used for communication in the
network. The bus is connected to various taps and
droplines. Taps are the connectors, while droplines are the cables
connecting the bus with the computer. In other words, there is only a
single transmission line for all nodes.
When a sender sends a message, all other computers can hear it, but
only the receiver accepts it(verifying the mac address attached with
the data frame) and others reject it. Bus technology is mainly suited
for small networks like LAN, etc.
In this topology, the bus acts as the backbone of the network, which
joins every computer and peripherals in the network. Both ends of
the shared channel have line terminators. The data is sent only in
one direction and as soon as it reaches the end, the terminator
removes the data from the communication line(to prevent signal
bounce and data flow disruption).
Ring Topology
Ring topology is a topology in which each computer is
connected to exactly two other computers to form the ring. The
message passing is unidirectional and circular in nature.
In a ring topology, if a token is free then the node can capture the
token and attach the data and destination address to the token, and
then leaves the token for communication. When this token reaches
the destination node, the data is removed by the receiver and the
token is made free to carry the next data.
1. Easy Installation.
2. Less Cabling Required.
3. Reduces chances of data collision(unidirectional).
4. Easy to troubleshoot(the faulty node does not pass the token).
5. Each node gets the same access time.
Following are the disadvantages of Ring topology:
Star Topology
Star topology is a computer network topology in which all the
nodes are connected to a centralized hub. The hub or switch acts
as a middleware between the nodes. Any node requesting for service
or providing service, first contact the hub for communication.
The central device(hub or switch) has point to point communication
link(the dedicated link between the devices which can not be
accessed by some other computer) with the devices. The central
device then broadcast or unicast the message based on the central
device used. The hub broadcasts the message, while the switch
unicasts the messages by maintaining a switch table. Broadcasting
increases unnecessary data traffic in the network.
In a star topology, hub and switch act as a server, and the other
connected devices act as clients. Only one input-output port and one
cable are required to connect a node to the central device. This
topology is better in terms of security because the data does not pass
through every node.
1. Centralized control.
2. Less Expensive.
3. Easy to troubleshoot(the faulty node does not give response).
4. Good fault tolerance due to centralized control on nodes.
5. Easy to scale(nodes can be added or removed to the network
easily).
6. If a node fails, it will not affect other nodes.
7. Easy to reconfigure and upgrade(configured using a central
device).
Following are the disadvantages of Star topology:
Mesh Topology
Mesh topology is a computer network topology in which nodes
are interconnected with each other. In other words, direct
communication takes place between the nodes in the network.
There are mainly two types of Mesh:
5. Tree Topology:
Tree topology is a computer network topology in which all the
nodes are directly or indirectly connected to the main bus
cable. Tree topology is a combination of Bus and Star topology.
In a tree topology, the whole network is divided into segments,
which can be easily managed and maintained. There is a main hub
and all the other sub-hubs are connected to each other in this
topology.
Hybrid Topology:
A Hybrid topology is a computer topology which is a
combination of two or more topologies. In practical use, they are
the most widely used.
In this topology, all topologies are interconnected according to the
needs to form a hybrid. All the good features of each topology can be
used to make an efficient hybrid topology.
1. Complex design.
2. Expensive to implement.
3. Multi-Station Access Unit(MSAL) required.
Hence, after learning the various computer network topologies, we
can conclude that some points need to be considered when selecting
a physical topology:
• Ease of Installation.
• Fault Tolerance.
• Implementation Cost.
• Cabling Required.
• Maintenance Required.
• Reliable Nature.
• Ease of Reconfiguration and upgradation.
What are Routers, Hubs, Switches, Bridges?
1. Hub
Hub is a very simple network connecting device. In Star/hierarchical
topology, a Repeater is called Hub. It is also known as a Multiport
Repeater Device.
1. It is simple to implement.
2. The implementation cost is low.
3. It does not require any special system administration
configuration. We can just plug and play it.
Following are the disadvantages of using a Hub:
3. Switch
A switch is a layer-2 network connecting device, i.e., it works on
the physical and data-link layer of the OSI model. It interprets
data in the form of data frames. A switch acts as a multiport bridge
in the network. It provides the bridging functionality with greater
efficiency.
When a data frame arrives at the Switch, it first checks for any kind
of error in the data frame. If the frame is error-free, it will search the
MAC address of the destination in the Switch table. If the address is
available in the switch table, it will forward the data frame to that
specific node, else switch will register the MAC address in the switch
table. If the destination address is not specified, it will broadcast the
data frame to each node in the network.
4. Router
A Router is a layer-3 network connecting device, i.e., it works
on the physical, data-link and network layer of the OSI
model. It interprets data in the form of data packets. It is mainly an
internetworking device, which can connect devices of different
networks(implementing the same architecture and protocols). In
other words, it can connect two physically and logically different
network devices with each other. A Router is used to connect the
networks or it routes traffic between the networks. In other words,
a Router is the Gateway of a network.
1. Static Routing: In Static Routing, the path for the data packets
is manually set. It is generally used for small networks.
2. Dynamic Routing: In Dynamic Routing, various routing
algorithms are used to find the best and shortest path for the
data packets.
Following are the advantages of using a Router:
In a network, the sender sends the data and the receiver receives the
data. But suppose a situation where the sender is sending the data at
a speed higher than the receiver is able to receive and process it,
then the data will get lost. Flow-control methods will help in
ensuring this. The flow control method will keep a check that the
senders send the data only at a speed that the receiver is able to
receive and process. So, let's get started with the blog and learn more
about flow control.
Flow Control
Flow control tells the sender how much data should be sent to the
receiver so that it is not lost. This mechanism makes the sender wait
for an acknowledgment before sending the next data. There are two
ways to control the flow of data:
Suppose if any frame sent is not received by the receiver and is lost.
So the receiver will not send any acknowledgment as it has not
received any frame. Also, the sender will not send the next frame as
it will wait for the acknowledgment for the previous frame which it
had sent. So a deadlock situation can be created here. To avoid any
such situation there is a time-out timer. The sender will wait for this
fixed amount of time for the acknowledgment and if the
acknowledgment is not received then it will send the frame again.
The propagation delay for sending the data frame and the
acknowledgment frame is the same as distance and speed will
remain the same for both frames. Hence, the total time required to
send a frame is
η=Td / (Td+2Tp)
While sending the data from the sender to the receiver there is a
high possibility that the data may get lost or corrupted. Error is a
situation when the sender's data does not match the data at the
receiver's end. When an error is detected then we need to retransmit
the data. So, there are various techniques of error control in
computer networks. In this blog, we will see all these techniques. So
let's get started.
Error Control
Error Control in the data link layer is a process of detecting and
retransmitting the data which has been lost or corrupted during the
transmission of data. Any reliable system must have a mechanism
for detecting and correcting such errors. Error detection and
correction occur at both the transport layer and the data link layer.
Here we will talk about the data link layer and check bit by bit that if
there is any error or not.
TYPES OF ERROR
Single bit Error: When there is a change in only one bit of the
sender's data then it is called a single bit error.
Example: If the sender sends 101(5) to the receiver but the receiver
receives 100(4) then it is a single bit error.
Example: If the sender sends 1011(11) to the sender but the receiver
receives 1000(8) then it is a burst error.
Error Detection
1. Vertical Redundancy Check
2. Longitudinal Redundancy Check
3. Circular Redundancy Check
4. CheckSum
Some systems may also check for the odd number of 1’s. This is
called odd parity checking. If the number of 1’s is odd then the bit to be
added is 0. If the number of 1's is even then the bit to be added is 1.
Example: We have a data 1100001. Now, this data is sent to the even
parity generator which adds a redundant bit to it by checking the
number of 1's. The even parity generator will add a 1 as it has odd
numbers of 1’s. So, the data which is going to be transmitted is
original data along with the parity bit i.e. 11000011. At the receiver
side, we have a checking function that checks if the number of 1’s is
even or not.
Limitation of VRC
Suppose in the above example, if at the transmission time two bits
are altered such that the receivers receive the data as 10000001. The
receiver will successfully accept this data. This is because the
checking function will check for an even number of 1’s and the
received data will satisfy this condition.
So, VRC fails when there is an even number of changes in the data.
Limitation of LRC
Suppose in the above example, during transmission some of the bits
get changed and the received data is 11100111 11011101 00110011
10100011. If we calculate the parity bit for this received data then it
will again come out to be 10101010 at the receiver's end.
So even if the data bits have changed this error won't be detected at
the receiver's end.
So, if two bits in one data unit are damaged and the two bits at the exact
same position in another data unit are damaged the LRC will not be able
to detect it.
Checksum
There are two processing methods involved in this. The sender
generates the checksum and sends the original data along with the
checksum. The receiver end also generates the checksum from the
received data. If the generated sum at the receiver side is all zeroes
then only the data is accepted.
At the receiver end, the received bits are divided again by the CRC
generator. If the remainder of the division is zero then the data is
accepted else rejected.
The following error control techniques can be used once the error
is detected.
1. Go-Back-N ARQ
2. Selective Repeat ARQ
Go-Back-N ARQ
In this protocol, if any frame is lost or corrupted then all the frames
since the last frame that was acknowledged are sent once again. The
sender's window size is N but the receivers window size is only one.
Have you ever wondered what is the mechanism behind the video
calls on Skype and WhatsApp? How our voice is sent over the earlier
telephone calls? These facilities are provided to us by the
various message switching techniques. Different massage
techniques are used according to our requirements like the earlier
telephone calls used circuit switching. In this blog, we will get the
answers to all the above questions as we go through this blog. So,
let's get started.
Message Switching Techniques
For transferring the message from the sender to the receiver we use
various message switching techniques. The technique we use,
depends upon the factors like kind of message we want to transfer,
quality of the message, etc. In this blog, we will see all these
techniques in detail.
1. Circuit Switching
2. Message Switching
3. Packet Switching
Circuit Switching
Circuit Switching is a switching technique method that establishes a
dedicated path between the sender and the receiver to send the data.
The example of a circuit-switch network is a telephone network.
Message Switching
In-circuit switching when the source does not have enough data to
transmit, the resources are unnecessarily kept idle. To avoid such
situation Message switching is used. Message switching is a
connectionless network in which the data from the source to
destination is sent in the form of message units. A message is a
logical unit of the information that can be of any length. The
sender and the receiver are not directly connected. There are many
intermediate nodes which ensure the delivery of the message to the
destination. The message switching was used in sending telegrams.
It has two main characteristics:
Packet Switching
Packet switching is a message switching technique in which the data
is divided into packets. These packets contain a header that contains
the information of the destination. The packets find the route with
the help of this information.
Can you connect two computers for file sharing without using a hub or router?
We can connect two computers for file sharing with the help of only
one cable. This can be done using a commonly available Ethernet
crossover cable. All you need to do is to assign both two computers
to work as a default gateway to each other. A default gateway is a
path used by the computer to send the data when it does not know a
specified path to send it to the destination. We will see how this is
done in windows as we go through this blog.
1. Connect one end of the cable to the network adapter of the first
computer and the other end of the cable to the network adapter
of the second computer.
2. We need to perform step 2 to step 13 in the first Computer.
Open the Control Panel in the first Computer.
3. Click on Network Sharing Center.
4. Click on Change Advanced Sharing Settings.
5. Now you will see an All Networks Option. Expand this by
clicking the side arrow.
6. When the All Networks Option expands it looks like this the image
attached below. In the Public Folder Sharing option, tick on the
option- Turn on sharing so anyone with network access can read
and write files in the Public folders.
1. Unicasting
2. Anycasting
3. Multicasting
4. Broadcasting
Now, we'll learn these transmission types one by one in detail.
1. Unicasting
Unicasting is the most commonly used data transmission type on the
internet. In Unicasting, the data traffic flows from a single
source node to a single destination node on the network. It is a
'one-to-one' type of data transmission between the sender and
receiver. In other words, we can say that a single station is sending
information to another station on the network. The below-
mentioned diagram best describes unicasting:
It can be best implemented in computer-to-computer or server-to-
server or client-to-server kind of communications. SMTP(Simple
Mail Transfer Protocol) protocol can be used for unicasting an email
on the internet. Similarly, FTP(File Transfer Protocol) can be used
for unicasting a particular file from one computer to another on the
network. Some other protocols like HTTP(HyperText Markup
Language), Telnet, etc. can also be used for unicasting on the
network.
2. Anycasting
Anycast is a one-to-nearest kind of transmission in which a
single source sends a message to the nearest destination(among
multiple possible destinations). It can only be implemented using
IPv6 addressing. IPv4 addressing can not be used for anycasting. In
Anycasting, a single IPv6 address is assigned to multiple devices in
the network. Anycasting is described in the below-mentioned
diagram.
Anycasting is mainly used by Routers. The Anycast address is an
address that can be assigned to a group of devices on the
network(mostly routers). In the above diagram, all the devices with
green shade have the same anycast address. But the data is received
by only one device, which is in dark green shade(because it was the
first one to receive the message).
3. Multicasting
Multicast is a kind of transmission type in which a single source
communicates a message to a group of devices. It is a kind of
one-to-multiple transmission. All the devices which are interested in
receiving the messages will have to first join the multicast group.
Multicasting is described in the below-mentioned diagram:
4. Broadcasting
Broadcasting is a transmission type in which the data traffic
flows from a single source to all the devices on the network. It
sends the information to every device at once. The same data is
received by everyone, making it efficient for wide-spreading the
message with all nodes. Broadcasting is an IPv4 specific data
transmission type. The below-mentioned diagram best describes
broadcasting.
OSI Model
OSI model is a layered framework that allows communication
between all types of the computer system. It has seven
layers. OSI model is introduced by ISO(International Organization
for Standardization) in 1984. Each layer has its own functionalities
and calls upon the services of the layer just below it. These layers are
a package of protocols that are implemented by computers to
connect in the network. In other words, the OSI model defines
and is used to understand how two computers connect with
each other in a computer network.
1. Physical Layer
2. Data-Link Layer
3. Network Layer
4. Transport Layer
5. Session Layer
6. Presentation Layer
7. Application Layer
We will learn about these layers and their functionalities one by one.
1. Physical Layer
The Physical Layer is the lowest layer of the OSI model and it
deals with data in the form of bits or signals. The type of signal
being generated depends upon the transmission medium. For
example, if we are using copper wire or LAN cable, the output signal
will be an electrical signal. Likewise, the output signal will be a light
signal for optical fibre cable, and radio signal for air as a
transmission medium.
At the sender's side, the physical layer will get the data from the
upper layer and convert it into bitstreams(0's and 1's) and send it
through a physical channel. At the receiver's side, it will convert the
bitstreams into frames to be passed to the data-link layer.
The source and destination MAC addresses are included in the data
header file by the data-link layer. At the sender's side, it receives the
data in the form of packets from the network layer and converts it
into smaller forms, called the data frame. At the receiver's side, it
converts the data frame into packets for the network layer.
At the sender side, the network layer breaks the data segments
received from the upper layer into smaller units, called data packets.
Similarly, at the receiver's side, it reassembles the data packets into
segments for the upper layer, i.e., the transport layer. Routers are
mainly used in the network layer for routing purposes. Some of the
protocols that are mostly used in this layer are OSPF(Open Shortest
Path First), BGP(Border Gateway Protocol), IS-IS(Intermediate
System to Intermediate System), etc.
4. Transport Layer
The Transport layer is the fourth layer of the OSI model. It is
mainly responsible for the process-to-process delivery of the
data. It performs flow and error control in the data for its
proper transmission. The transport layer controls the reliability of
communication through various functionalities.
At the sender's side, the transport layer receives the data from the
upper layer and performs segmentation. The source and destination
port numbers are also included in the header file of the data before
forwarding it to the network layer. At the receiver's side, the
transport layer performs the reassembly and sequencing of data. It
reads the port number of the data from the header file, and then
direct it towards the proper application.
5. Session Layer
The Session layer is the fifth layer of the OSI model. It mainly
helps in setting up, closing and managing the connection in the
network. Actually, whenever two devices get connected, a session is
created, which is terminated as soon the connection is no longer
required. The termination of the session is important to avoid the
unnecessary wastage of resources. In other words, the session layer
performs session management.
The session layer enables the devices to send and receive the data by
establishing connections and also terminates the connection after
the data transfer. It mainly performs authentication and
authorization for establishing a secure connection in the network.
6. Presentation Layer
The Presentation layer is the sixth layer of the OSI model. It
mainly performs data translation, encryption & decryption, and
compression in the network. The presentation layer deals with the
syntax and semantics of the information exchanged between two
systems.
At the sender's side, it receives the data from the application layer
and performs data encryption and compression to it. At the
receiver's side, it receives the data from the transport layer and
performs data translation, decryption, and uncompresses data.
Following are the main functionalities of a presentation layer:
7. Application Layer
The Application layer is the topmost layer of the OSI model.
This layer is mostly used by the network applications, that use
the network. It mainly acts as an interface between the user and the
network services. The Application layer provides services for
network applications with the help of protocols. Some of the most
widely used application layer protocols are HTTP, HTTPS, FTP, NFS,
DHCP, FMTP, SNMP, SMTP, Telnet, etc.
In the early days, the TCP/IP reference model has four layers, as
described below.
These layers are much similar to the layers of the OSI modl. The
Application layer in the TCP/IP model has approximately the same
functionality as the upper three layers(Application, Presentation,
and Session layer) of the OSI model. Also, the Internet layer acts as
the Network layer, and the Network Access layer acts as the lower
two layers(Physical and Data-Link layer) of the OSI model. TCP/IP
network model is named after two main protocols(TCP and IP) and is
widely used in current internet architecture. But nowadays, we
generally use a five-layer TCP/IP model, as shown below.
In the above diagram, the Physical and Data-Link layer acts as the
Network Access layer of the previously used TCP/IP model. This
TCP/IP model is currently in use. So, in this blog, we'll learn about
the five-layer TCP/IP reference model. We'll also see the key features
of this model and the functionalities of its five layers.
1. Physical Layer
2. Data-Link Layer
3. Internet Layer
4. Transport Layer
5. Application Layer
Now, we will learn about the functionalities of these layers one-by-
one in detail.
1. Physical Layer
The Physical Layer is the lowest layer of the TCP/IP model. It deals
with data in the form of bits. This layer mainly handles the host to
host communication in the network. It defines the transmission
medium and mode of communication between two devices. The
medium can be wired or wireless, and the mode can be simplex, half-
duplex, or full-duplex.
It also specifies the line configuration(point-to-point or multiport),
data rate(number of bits sent each second), and topology in the
network. There are no specific protocols that are used in this layer.
The functionality of the physical layer varies from network-to-
network.
2. Data-Link Layer
The Data-Link Layer is the second layer of the TCP/IP layer. It deals
with data in the form of data frames. It mainly performs the data
framing in which, it adds some header information to the data
packets for the successful delivery of data packets to correct
destinations. For this, it performs physical addressing of the data
packets by adding the source and the destination address to it.
The data-link layer facilitates the delivery of frames within the same
network. It also facilitates the flow and error control of the data
frames. The flow of the data can be controlled through the data rate.
Also, the errors in the data transmission and faulty data frames can
be detected and retransmitted using the checksum bits in the header
information.
3. Internet Layer
The Internet layer of the TCP/IP model is approximately the same as
the Network layer of the OSI model. It deals with data in the form of
datagrams or data packets. This layer mainly performs the logical
addressing of the data packets by adding the IP(Internet Protocol)
address to it. The IP addressing can be done either by using the
Internet Protocol Version 4(IPv4) or Internet Protocol Version
6(IPv6).
The Internet layer also performs routing of data packets using the IP
addresses. The data packets can be sent from one network to another
using the routers in this layer. This layer also performs the
sequencing of the data packets at the receiver's end. In other words,
it defines the various protocols for logical transmission of data
within the same or different network. The protocols that are used in
the Internet layer are IP(Internet Protocol), ICMP(Internet Control
Message Protocol), IGMP(Internet Group Management Protocol),
ARP(Address Resolution Protocol), RARP(Reverse Address
Resolution Protocol), etc.
4. Transport Layer
The Transport layer is the fourth layer of the TCP/IP model. It deals
with data in the form of data segments. It mainly performs
segmentation of the data received from the upper layers. It is
responsible for transporting data and setting up communication
between the application layer and the lower layers. This layer
facilitates the end-to-end communication and error-free delivery of
the data. It also facilitates flow control by specifying data rates. The
transport layer is used for process-to-process communication with
the help of the port number of the source and the destination.
5. Application Layer
The Application layer in the TCP/IP model is equivalent to the upper
three layers(Application, Physical, and Session Layer) of the OSI
model. It deals with the communication of the whole data message.
The Application layer provides an interface between the network
services and the application programs. It mainly provides services to
the end-users to work over the network. For Example, file transfer,
web browsing, etc. This layer uses all the higher-level protocols like
HTTP, HTTPS, FTP, NFS, DHCP, FMTP, SNMP, SMTP, Telnet, etc.
1. The client sends the SYN to the server: When the client
wants to connect to the server. It sets the 'SYN' flag as 1 and
sends the message to the server. The message has also some
additional information like the sequence number(any random
32 bits number), the ACK is set here to 0, the window size, and
the maximum segment size. For Example, if the window size is
2000 bits, and the maximum segment size is 200 bits then a
maximum of 10 data segments (2000/200 = 10) can be
transmitted in the connection.
2. The server replies with the SYN and the ACK to the
client: After receiving the client's synchronization request, the
server sends an acknowledge to the client by setting the ACK
flag to '1'. The acknowledgement number of the ACK is one
more than the received sequence number. For Example, if the
client has sent the SYN with sequence number = 1000, then the
server will send the ACK with acknowledgement number =
10001. Also, the server sets the SYN flag to '1' and sends it to
the client, if the server also wants to establish the connection.
The sequence number used here for the SYN will be different
from the client's SYN. The server also advertises its window
size and maximum segment size to the client. After completion
of this step, the connection is established from the client to the
server-side.
3. The client sends the ACK to the server: After receiving the
SYN from the server, the client sets the ACK flag to '1' and
sends it with an acknowledgement number 1 greater than the
server's SYN sequence number to the client. Here, the SYN flag
is kept '0'. After completion of this step, the connection is now
established from the server to the client-side also. After the
connection is being established, the minimum of the sender's
and receiver's maximum segment size is taken under
consideration for data transmission.
Below is the pictorial representation of the connection termination
using the 3-way handshake process.
Following are the three steps involved in terminating the connection
using the 3-way handshake process in TCP:
1. The client sends the FIN to the server: When the client
wants to terminate the connection. It sets the FIN flag as '1'
and sends the message to the server with a random sequence
number. Here, the ACK is set to 0.
2. The server replies with the FIN and the ACK to the
client: After receiving the client's termination request, the
server sends an acknowledge to the client by setting the ACK
flag to '1'. The acknowledgement number of the ACK is one
more than the received sequence number. For Example, if the
client has sent the FIN with sequence number = 1000, then the
server will send the ACK with acknowledgement number =
10001. Also, the server sets the FIN flag to '1' and sends it to
the client, if the server also wants to terminate the connection.
The sequence number used here for the FIN will be different
from the client's FIN. After completion of this step, the
connection is terminated from the client to the server-side.
3. The client sends the ACK to the server: After receiving the
FIN from the server, the client sets the ACK flag to '1' and sends
it with an acknowledgement number 1 greater than the server's
FIN sequence number to the client. Here, the FIN flag is kept
'0'. After completion of this step, the connection is now
terminated from the server to the client-side also.
It has rightly been said that each coin has two faces. Likewise, we
can not say that one model is the best and the other is the worst.
Both of them have some advantages and disadvantages as well. One
model can work fine for one case and worst for the other. So in
this blog, we'll take some major points which are essential in a
network connection and communication, and then evaluate which
model is better for which case.
First, we will see the various similarities between the OSI and
TCP/IP models. The similarities between them are as follows:
Following are the dissimilarities between the OSI and the TCP/IP
model:
In this blog, we will briefly learn about the TCP and UDP protocols,
and the dissimilarities between these protocols. We'll also see which
protocol can be opted to implement in which case.
Ever wondered what happens when you type a URL in the browser? It
is a commonly asked question in technical interviews. In this blog,
we will see what happens in the background, step by step when we
type any URL. So, let's get started.
HTTP/1.1 200 OK
Date: Tue, 28 Jan 2020 12:28:53 GMT
Server: Apache/2.2.14 (Win32)
Last-Modified: Wed, 22 Jul 2019 19:15:56 GMT
Content-Length: 88
Content-Type: text/html
Connection: Closed
What are Protocols and what are the key elements of protocols?
Protocols
Protocols are a fundamental aspect of digital communication as they
dictate how to format, transmit and receive data. They are a set of
rules that determines how the data will be transmitted over the
network.
Protocols use a specific model for their implementation like the OSI
(Open System Interface) Model, TCP/IP (Transmission Control
Protocol / Internet Protocol) Model, etc. There are different layers
(for instance, data, network, transport, and application layer, etc.) in
these models, where these protocols are implemented.
Levels of a Protocol
There are mainly three levels of a protocol, they are as follows:
Types of Protocols
Protocols can be broadly divided into the following two types:
1. Standard Protocols
2. Proprietary Protocols
Let's learn one by one:
Standard Protocols
A standard protocol is a mandated protocol for all devices. It
supports multiple devices and acts as a standard.
Standard protocols are not vendor-specific i.e. they are not specific
to a particular company or organization. They are developed by a
group of experts from different organizations .
These protocols are publicly available, and we need not pay for them.
Proprietary Protocols
Proprietary protocols are developed by an individual organization for
their specific devices. We have to take permission from the
organization if we want to use their protocols.
1. Syntax
2. Semantics
3. Timing
Let's learn these elements in detail.
Syntax
Syntax refers to the structure or format of data and signal levels. It
indicates how to read the data in the form of bits or fields. It also
decides the order in which the data is presented to the receiver.
Example: A protocol might expect that the size of a data packet will
be 16 bits. In which, the first 4 bits are the sender’s address, the next
4 bits are the receiver’s address, the next 4 bits are the check-sum
bits, and the last 4 bits will contain the message. So, every
communication that is following that protocol should send 16-bit
data.
Semantics
Semantics refers to the interpretation or meaning of each section of
bits or fields. It specifies which field defines what action. It defines
how a particular section of bits or pattern can be interpreted, and
what action needs to be taken. It includes control information for
coordination and error handling.
Timing
Timing refers to two characteristics:
Example: A sender can send the data at a speed of 100 Mbps, but the
receiver can consume it only at a speed of 20 Mbps, then there may
be data losses or the packets might get dropped. So, proper
synchronization must be there between a sender and a receiver.
Functions of protocols
Following are the main functionalities of a protocol:
While sending the data from the sender to the receiver the flow of
data needs to be controlled. Suppose a situation where the sender is
sending the data at a rate higher than the receiver is able to receive
and process it, then the data will get lost. The Flow-
control methods will help in ensuring that the data doesn't get lost.
The flow control method will keep a check that the senders send the
data only at a rate that the receiver is able to receive and process.
There are mainly two ways in which this can be achieved i.e.
using Stop-and-wait protocol or sliding window protocol. In this
blog, we are going to learn about the Stop-and-wait protocol. So,
let’s get started.
Situation 1
Suppose if any frame sent is not received by the receiver and is lost.
So the receiver will not send any acknowledgment as it has not
received any frame. Also, the sender will not send the next frame as
it will wait for the acknowledgment for the previous frame which it
had sent. So a deadlock situation arises here. To avoid any such
situation there is a time-out timer. The sender waits for this fixed
amount of time for the acknowledgment and if the acknowledgment
is not received then it will send the frame again.
Situation 2
Consider a situation where the receiver has received the data and
sent the acknowledgment but the ACK is lost. So, again the sender
might wait till infinite time if there is no system of time-out timer.
So, in this case also, the time-out timer will be used and the sender
will wait for a fixed amount of time for the acknowledgment and
then send the frame again if the acknowledgement is not received.
There are two types of delays while sending these frames:
Efficiency
Efficiency = Useful Time/ Total Time
η = Td / (Td+2*Tp)
η = 1/(1+2a) →(1)
where a=Tp / Td
Throughput
The number of bits that a receiver can accept in total time
duration (i.e. transmission time(Td) + 2 * propagation delay(Tp)). It
is also called effective bandwidth or bandwidth utilization.
In Stop and Wait, in the total duration, the receiver can accept only
one frame. One frame is of data size D i.e. D bits in one frame.
where a= Tp / Td
Td=D/B
B = D/Td → (3)
Throughput= η * B
FTP
File Transfer Protocol is a set of protocols that the networked
computers use to talk over the internet. In more simple terms, it is a
way to connect two computers and move files between them. FTP
allows new web pages that are created by an individual to show up
on the internet. It allows the web pages to transfer to the server so
that others can access them.
DHCP
Dynamic Host Configuration Protocol is a network management
protocol that is used to dynamically assign the IP address and other
information to each host on the network so that they can
communicate efficiently. DHCP automates and centrally manages
the assignment of IP address easing the work of network
administrator. In addition to the IP address, the DHCP also assigns
the subnet masks, default gateway and domain name
server(DNS) address and other configuration to the host and by
doing so, it makes the task of network administrator easier.
Components of DHCP
1. DHCP Server: It is typically a server or a router that holds the
network configuration information.
2. DHCP Client: It is the endpoint that gets the configuration
information from the server like any computer or mobile.
3. DHCP Relay Agent: If you have only one DHCP Server for
multiple LAN’s then the DHCP relay agent present in every
network will forward the DHCP request to the servers. This
because the DHCP packets cannot travel across the router.
Hence, the relay agent is required so that DHCP servers can
handle the request from all the networks.
4. IP address pool: It contains the list of IP address which are
available for assignment to the client.
5. Subnet Mask: It tells the host that in which network it is
currently present.
6. Lease Time: It is the amount of time for which the IP address
is available to the client. After this time the client must renew
the IP address.
7. Gateway Address: The gateway address lets the host know
where the gateway is to connect to the internet.
How do DHCP works?
DHCP works at the application layer to dynamically assign the IP
address to the client and this happens through the exchange of a
series of messages called DHCP transactions or DHCP conversation.
Advantages of DHCP
1. It is easy to implement and automatic assignment of an IP
address means an accurate IP address.
2. The manual configuration of the IP address is not required.
Hence, it saves time and workload for the network
administrators.
3. Duplicate or invalid IP assignments are not there which means
there is no IP address conflict.
4. It is a great benefit for mobile users as the new valid
configurations are automatically obtained when they change
their network.
Disadvantages of DHCP
1. As the DHCP servers have no secure mechanism for the
authentication of the client so any new client can join the
network. This posses security risks like unauthorized clients
being given IP address and IP address depletion from
unauthorized clients.
2. The DHCP server can be a single point of failure if the network
has only one DHCP server.
ARP
Address Resolution Protocol is one of the most important protocols of the network layer in the
OSI model which helps in finding the MAC(Media Access Control) address given the IP address
of the system i.e. the main duty of the ARP is to convert the 32-bit IP address(for IPv4) to 48-bit
address i.e. the MAC address.
How does ARP work?
• At the network layer when the source wants to find out the MAC address of the
destination device it first looks for the MAC address(Physical Address) in the ARP
cache or ARP table. If present there then it will use the MAC address from there for
communication. If you want to view your ARP cache(in Windows Operating System)
then open Command Prompt and type command —‘arp -a’ (without quotes). An ARP
table looks something like this.
• If the MAC address is not present in the ARP table then the source device will generate
an ARP Request message. In the request message the source puts its own MAC address,
its IP address, destination IP address and the destination MAC address is left blank since
the source is trying to find this.
• The source device will broadcast the ARP request message to the local network.
• The broadcast message is received by all the other devices in the LAN network. Now
each device will compare the IP address of the destination with its own IP address. If the
IP address of destination matches with the device's IP address then the device will send
an ARP Reply message. If the IP addresses do not match then the device will simply
drop the packet.
• The device whose IP address has matched with the destination IP address in the packet
will reply and send the ARP Reply message. This ARP Reply message contains
the MAC address of this device. The destination device updates its ARP table and stores
the MAC address of the source as it will need to contact the source soon. Now, the source
becomes destination(target) for this device and the ARP Reply message is sent.
• The ARP reply message is unicast and it is not broadcasted because the source which is
sending the ARP reply to the destination knows the MAC address of the source device.
• When the source receives the ARP reply it comes to know about the destination MAC
address and it also updates its ARP cache. Now the packets can be sent as the source
nows destination MAC address.
Sample Example
The ARP Request and Reply messages can be captured. The sample example below is the
example of an ARP Request Message which is captured. You can see that the destination MAC
address is blank i.e. 00:00:00:00:00:00.
1. Hardware type- It specifies the type of hardware used while transmitting the ARP
message. Mostly the hardware type is Ethernet.
2. Protocol type- a number is assigned to each protocol and here IPv4 is used. IPv4 is 2048
(0x0800 in Hexa).
3. Protocol size- length of IPv4 address(here 4 bytes).
4. Opcode-it specifies the nature of the ARP message. 1 for ARP request and 2 for ARP
reply,
5. Source IP Address- here 10.10.10.2
6. Destination(Target) IP Address- here 10.10.10.1
7. Source MAC Address -here 00:1a:6b:6c:0c:cc
A sample example of ARP Reply message captured. The reply message contains the MAC
address which was asked by the source. The MAC address 00:1d:09:f0:92:ab is sent in the ARP
Reply message.
Have you ever imagined how you can access the servers in America
from India? How are they connected? Our systems are connected to
the routers which in turn is connected to many other routers which
eventually are connected to the servers. So whenever we want to
access any server, the link between our computer and server is
established through these routers only. But how the routers are
selected so that the distance between our computer and the server is
minimum? This is what RIP does. It selects the shortest path
between the computer and the remote server. Now, let's get down to
the nitty and gritty of the RIP and discuss it in more detail.
RIP
It is a vector routing protocol that uses the hop count as the routing
unit for finding the most suitable path between the source and the
destination. Now, let us understand the meaning of the terms used
in the definition of RIP.
Hop Count
Hop count is the number of routers that are between the source and
the destination in a network. RIP considers the path with the
shortest number of hops as the best path to a remote network hence
placed in the routing table. RIP allows only 15 hops to reach any
network. If the packet does not reach the destination in 15 hop
counts then the destination is considered as unreachable.
Routing Table
Every RIP router maintains a routing table. These tables store the
information of all the destinations that the router knows it can
reach. Each router interchange the information of their routing table
to their nearest neighbours. The routers broadcast the routing table
information every 30 seconds to their closest neighbours.
Example: If you are the user and you want to reach google.com.
There can be many paths through which you can reach the server
of Google. In the example below, the user has three paths. RIP will
count the number of routers required to reach the destination server
from each route. Then it would select that route that has a minimum
number of paths.
The route 1 has 2 hop counts, route 2 has 3 hop counts and route 3
has 4 hop counts to reach the destination server. So, the RIP will
choose Route 1.
We can trace the route of the data packet and know about the router
that comes in its path before it reaches the destination. Open the
Command Prompt and type → “tracert google.com” (without double
quotes) to see the path the data packets would take i.e. the routers that
are between your computer and the destination server of google.
There is a total of 14 hops i.e. the data packet has to go through
these routers in order to reach google.com.
Request Timed Out means that the server doesn't respond to the
request for the information.
RIP timers
1. Update Timers: All the routers configured with RIP send their
update(a complete copy of their routing table) every 30 seconds
to the neighbouring routers.
2. Invalid Timers: If any router gets disconnected from the
network then the nearing routers wait for 180 seconds for the
update. When it doesn't hear the update until 180 seconds then
it will put it into hold-down.
3. Hold-Down Timer: Hold-downs ensure that regular update
messages do not inappropriately cause a routing loop( A
routing loop is a serious network problem in which the
data packets continue to be routed within the network in
an endless circle). The router doesn’t act on new
information(of routing table which it receives after every 30
seconds) for a certain period of time. It is 180 seconds by
default.
4. Flush Timer: RIP will wait for an additional 60
seconds(total=180+60 =240 seconds) after the route has been
declared invalid. Even now if it doesn't hear any update then it
removes the route from the routing table.
Versions of RIP
1. RIPv1(Routing Information Protocol version 1): It is also
called a classful routing protocol because it does not send the
information of the subnet mask in the routing update. The
routing update is sent as a broadcast( at 255.255.255.255) to
every station on the attached network.
2. RIPv2(Routing Information Protocol version 2): It is
a classless routing protocol because it does send the
information of the subnet mask in its routing updates. RIPv2
sends the routing table as multicast (at 224.0.0.9)to reduce the
network traffic.
3. RIPng(Routing Information Protocol next generation): It is
an extended version of RIPV2 that was made to support IPv6.
RIPng sends the routing table as multicast (at FF02::9).
Advantages of RIP
• It is easy to configure.
• that it does not require an update every time the topology of
network changes.
• Guaranteed to support almost all routers
Disadvantages of RIP
• It is only based on hop count. So, if there is a better route
available with better bandwidth then it will not select that
route.
Example: Suppose we have two routes, the first route has a
bandwidth of 100 Kbps(Kilobits per second) and is there is high
traffic in this route whereas the second route has a bandwidth
of 100 Mbps (Megabits per second) and is free. Now the RIP
will select route 1 though it has high traffic its bandwidth is much
less than the bandwidth of route 2. This is one of the biggest
disadvantages of RIP
• Bandwidth utilization in RIP is very high as it broadcasts its
updates every 30 seconds.
• RIP supports only 15 hop count so a maximum of 16 routers can
be configured in RIP.
• Here the convergence rate is slow. It means that when any link
goes down it takes a lot of time to choose alternate routes.
NIC
Network Interface Card is a hardware device that is installed on the
computer so that it can be connected to the internet. It is also
called Ethernet Card or Network Adapter. Every NIC has a 48-bit
unique serial number called a MAC address which is stored in ROM
carried on the card. Every computer must have at least one NIC if it
wants to connect to the internet.
NIC is not the only component that is required to connect to the internet.
If your device is a part of a large network and you want it to connect to
the internet then a router is also required. The NIC will connect to the
router then this router will connect to the internet.
Types of Network Interface Card:
• Wired: These NIC have input jacks made of cables(Ethernet
Cable). The motherboard has a slot for the network cards where
they are inserted. The most widely used LAN technology is
Ethernet. Ethernet-based NIC is available in hardware shops.
The speed of Ethernet-based NIC can be 10/100/1000 Mbps.
Example: TP-LINK TG-3468 Gigabit PCI Express Network Adapter
• USB: These are NICs that provide network connection over the
device plugged in the USB port. For Example, if you are a
gamer and you are tired of watching helplessly that your
gaming character dies due to Wi-Fi-induced lags. So the USB-
ethernet adapter can be a solution to your problem.
Example: TP-Link TL-UE300 USB 3.0 to RJ45 Gigabit Ethernet
Network Adapter
Example: If you are paying for 10Mbps download speed but using
a 54 Mbps NIC then NIC will not increase your speed. Now imagine
you are paying for 15 Mbps but using an 11 Mbps NIC then your
download speed will be slower and you will not get the speed of what
you are paying for.
Advantages of NIC
1. Network Interface Cards help to connect the system to the
internet and enable data flow.
2. It also helps to connect a remote computer.
Disadvantages of NIC
1. The data is not secure in NIC connection and the data can be
hacked. But, the security can be implemented through external
software and encryption to encrypt the data while sending the
data to the other computers.
When you are not connected to the internet and search for any
website then you get an error message like destination unreachable
or time limit exceeded etc. These messages are displayed through
the ICMP protocol. The IP protocol does not have any mechanism
for error reporting and sending query messages. This problem is
resolved by the ICMP protocol.
ICMP
ICMP or Internet Control Message Protocol is one of the major
protocols of the TCP/IP. ICMP is a mechanism used by the host,
routers, and gateways to send error messages back to the sender. As
the IP does not provide any mechanism for error reporting and
control, ICMP has been designed to compensate for these
deficiencies of the IP. However, it only reports the error and
doesn't correct the error.
Error Message
The error messages report the problems which may be faced by the
hosts or routers when they process the IP packet.
Query Message
The ICMP protocol can diagnose some network problems also. Query
messages help the hosts to get some specific information from a
router or another host.
IGMP
IGMP is also a protocol of the TCP/IP. Internet Group Message
Protocol is an Internet protocol that manages multicast group
membership on IP networks. Multicast routers are used to send
the packets to all the hosts that are having the membership of a
particular group. These routers receive many packets that are to be
transmitted to various groups and they just can't broadcast it as it
will increase the load on the network.
Versions of IGMP
• IGMPv1: It was the first version where the host announced
that it wants to receive the traffic of a particular multicast
group. 0.0.0.0 is defined as the group address and
the 224.0.0.1 as the destination address for the general IGMP
requests. The default interval for these requests which is sent
automatically by the routers is 60 seconds. There was no
system of leaving a multicast group. Only a timeout(delay
timer 180 seconds)removes the respective host from groups
they’re in. Suppose the host which is in a particular group
closes its system. This results in a situation where the traffic is
sent to the host even if is not accepting the traffic. When the
router discovers after some time that the host is no longer
accepting the traffic then the multicast traffic is stopped. This
problem was resolved in the next version.
• IGMPv2: The group address (0.0.0.0) and destination
address(224.0.0.1) remain unchanged. but, the default interval
for these requests which is sent automatically by the routers is
increased to 125 seconds. The most important feature added in
this version is “leave message” which a host can send if it
wants to leave a group. This allows the router to stop an
unnecessary multicast of traffic.
• IGMPv3: The group address (0.0.0.0) and destination
address(224.0.0.1) remain unchanged and the default interval
for these requests which is sent automatically by the routers is
125 seconds. The most feature added in this version was the
option to select the source of the multicast stream. This
reduces the demands on the network and ensures greater
security during transmission.
What are Proxy Servers and how do they protect computer networks?
Proxy Server
The word proxy literally means a substitute. A proxy server
substitutes the IP address of your computer with some substitute IP
address. If you can't access a website from your computer or you
want to access that website anonymously because you want your
identity to be hidden or you don't trust that website then you can use
a proxy. These proxy servers are dedicated computer systems or
software running on a computer system that acts as
an intermediary separating the end-users from the server. These
proxy servers have special popularity among countries like China
where the government has banned connection to some specific
websites.
How does a proxy server work?
Every computer on the network has a unique IP address. This IP
address is analogous to your street address which must be known by
the post office in order to deliver your parcel to your home. A proxy
server is a computer on the internet with its own IP address and the
client which is going to use this proxy server knows this IP address.
Whenever the client makes any request to any web server then its
request first goes to this proxy server. This proxy server then makes
a request to the destination server on behalf of the client. The proxy
server actually changes the IP address of the client so that the
actual IP address of the client is not revealed to the webserver. The
proxy server then collects the response from the webserver and
forwards the result to the client and the client can see the result in
its web browser.
Firewall
A firewall is a software program or a hardware device that acts as
a filter for the data entering and leaving the network. The firewall
can be analogous to the security guards who have control over who
can enter or leave a building. A firewall reduces the risk and threat
from the malicious packets that are travelling over the public
network and can hamper the security of a private network.
Types of Firewall
1. Packet-Filtering Firewalls: This is the oldest type of firewall
architecture. When a packet passes through this firewall then it
would check its source address, a destination address, port
number, and protocols without opening the packet. If the
packet is not according to the rules then the packet is dropped.
These firewalls are of low cost and are best suited for small
networks. However, these firewalls work only on the network
layer and they are vulnerable to spoofing.
2. Circuit-Level Gateway Firewalls: It works on the Session
layer of the OSI model. It checks that the TCP 3-way
handshakes are legitimate(according to the rules) or not. While
they are extremely efficient but the firewall doesn't check the
packet itself. So if any packet contains the malware and passes
the TCP handshake checks then it would pass through the
firewall and the system would be at risk.
3. Stateful Inspection Firewalls: They are also called dynamic
packet filtering firewalls. They maintain a track of all the open
connections of the network. If any new packet arrives then the
firewall checks if the new packet is of one the open connections
then it simply allows the packet to pass. But, if the new packet
is not of one of those open connections then it checks the
packets according to the rules set for new connections.
4. Application Firewall: It is also called a proxy-based firewall.
This firewall operates at the application layer and filters the
incoming traffic. When there is a proxy firewall then both the
client and the server connect through an intermediary
i.e. proxy servers. So, now when any external client wants to
connect to any internal server or vice versa, then the client will
have to open a connection with proxy instead. The proxy
firewall first establishes a connection to the source of the
traffic and then it inspects the incoming data packet. These
firewalls may check the actual content of the packet so that if
the packet contains any malware it can be rejected. The
advantage of using a proxy server is that it makes hard for the
attacker to discover a network actually is and hence provides
security.
5. Next-Generation Firewall: Most of the newly released
firewalls are advertised as a next-generation architecture. Some
of the common features of these firewalls are DataPacket
Inspection(checking the actual content of the data), SSL/SSH
Inspection(this secures you from HTTPs prone attacks),
IPS(Intrusion Prevention System-this works to automatically
stop the attack against your network). There is no proper
definition of the Next-generation Firewall so one should check
the capabilities of the firewall before buying one.
6. Software Firewall: The software firewall may include any type
of the above firewall that is installed on the local computer
instead rather than a separate piece of hardware. It provides
security as each individual network endpoint is isolated from
others. Example: Windows Firewall is a software program that
comes includes in Microsofts Windows.
7. Hardware Firewall: Hardware Firewalls are the hardware
devices which are found mostly on the routers. The hardware
Firewall provides security from the malicious traffic from the
outside networks as they are intercepted and blocked before
they reach the internal network. Example: Cisco ASA 5540
series firewall
Antivirus
Antivirus software is a cybersecurity mechanism that detects and
eliminates threats that are a risk to system security. Antivirus
usually deals with more established threats like viruses, worms, and
trojans. It was originally designed to detect, protect and eliminate
the viruses from the system, hence, the name antivirus. Some
common examples of antivirus software are Norton, McAfee,
BullGuard, etc.
What is an IP address?
IP address
The Internet Protocol(IP) address is a unique identifying number
that helps in connecting your device with the devices over the
internet or in the same network. This is a unique number for all
devices like printer, router, modems, laptop, mobile, etc. An IP
address is made of characters or
numbers. Example: 203.90.105.206. There are two versions of IP
standards that co-exist in the global world.
1. IPv4
2. IPv6
IPv4
IP version 4 is the older version of IP. It uses 32 bits to create a
single uniques address on the internet. IPv4 is limited to
4,294,967,296 addresses i.e. 2³² addresses. It consists of four
numbers each of which can contain one to three digits ranging from
0 to 255 separated by a single dot(.). Here, each number is the
decimal representation(base-10) for an 8 digit binary number(base-
2). These IP addresses pretty much guarantee that our emails will
come as go as expected, our google searches would take us to the
website which we want.
Currently, most of the devices use IPv4 but these IP addresses are
running out quickly. IPv6 solved this problem. It can accommodate
up to trillions of users.
IPv6
It is the replacement for IPv4. It uses 128 bits to create a uniques
address. This means that there can be theoretically 2¹²⁸ uniques
address i.e. 340,282,366,920,938,463,463,374,607,431,768,211,456
and this number will never run out. It consists of eight groups of
hexadecimal numbers separated by a colon. The IPV4 version used
numerical values, so, IPv6 adopted the hexadecimal numbers to
avoid any conflict. If any group contains all zeros then the notation
can be shortened by using a colon to replace the zeroes.
Static IP address
This type of IP address is one that is assigned to you by the ISP’s.
This is fixed and can't change automatically. This is generally used
by the server hosting websites, providing mails, databases, etc. The
ISP’s charge an extra amount for static IP’s.
Given an IP address, how will the router identify what is the network
ID of the network to which this IP address belongs? The router has a
routing table for this. The subnet mask helps the router in doing so.
In this blog, we will start from the basics and see how this is done by
the router. You should know about what are the various classes of
IP and how it is divided before reading this blog. So, let's get started.
Subnet(SubNetwork)
A subnet is a logical partition of an IP network into smaller
networks.
Subnetting
Dividing the network into smaller networks or subnets is called
subnetting.
So, in subnetting we will divide these 254 hosts logically into two
networks. A class C network has 24 bits for Network ID and the last 8
bits for the Host ID. We are going to borrow the left-most bit of
the host ID and declare for identifying the subnet. If the leftmost bit
of the host address is 0 then it is the 1st subnet network and if the
leftmost bit is 1 then it would be 2nd subnet network. Using one bit
we can divide it into 2 networks i.e. 2¹. If we want to divide it into
four subnet networks then we need 2 bits(2²=4 networks).
The range of IP address which is in 1st subnet network is
from 201.10.1.0 to 201.10.1.127. The range of IP address that lies in
the 2nd subnet network is from 201.10.1.128 to 201.10.1.255.
In 1st subnet network(S1), we have a total of 128 hosts. But, the first
IP address (201.10.1.0)is the network ID of the first subnet and the
last IP address(201.10.1.127) is the Direct Broadcast Address of the
first subnet. So, there are actually 126 usable hosts in the first
subnet.
Similarly, in the 2nd subnet network(S2), we have a total of 128
hosts. But, the first IP address (201.10.1.128)is the network ID of
the first subnet and the last IP address(201.10.1.255) is the Direct
Broadcast Address of the first subnet. So, there are actually 126
usable hosts in the second subnet.
Overall, there are 252 usable hosts after subnetting. So, because of
subnetting, there is a loss in the number of IP addresses.
The Network ID of the whole network is 201.10.1.0. Also, the
network ID of S1 is 201.10.1.0. Which network are we referring to
when the IP address is 201.10.1.0? It depends on where you are in
the network. If we are inside the network we are referring to the
subnet (S1)and if we are outside the network we are referring to the
entire network.
We have an internal router which is connected to the two subnet
network. Suppose a packet is arriving with a destination IP address
of 201.10.1.130 at the internal router. Now, how will the router
identify that this IP address will belong to which subnet network?
Or, given an IP address how will the router identify the what is
the network ID of the network to which this IP address belongs.
Here, by seeing the range of each subnet we can easily tell that it
belongs to subnet S2. But, how the router will find it. For this, we
have Subnet Mask.
Subnet Mask
A subnet mask is 32 bits numbers in which the series
of 1’s represents the Network ID part and the Subnet ID part
whereas the series of 0’s represents the Host ID part.
If we know the subnet mask of the network then we can find the network
of the IP address by bitwise ANDing the binary bits of the address.
Example: If a packet has arrived on the router having the IP address
as 201.10.1.130. The router knows the subnet mask(255.255.255.128)
of the network. First, convert both the address into its binary
equivalent. The network to which this IP address belongs can be
easily be found by bitwise ANDing the subnet mask and the
incoming IP address.
Using the subnet mask we have found the network ID of the IP
address and hence found that this IP address belongs to the subnet
S2 network.
The router has the subnet mask stored in the routing table. The
routing table contains the network ID, subnet mask and the
corresponding interface to which it has to forward the packet if the
network ID matches the table. In this case, the size of all the
networks is the same. This is called Fixed Length Subnet Masking.
If the result matches the network ID then it sends the packet to the
corresponding interface. If it doesn't match the first entry then it is
matched with the next entry. If it doesn't match any of the entry
then the packet has to be sent out of the network i.e. default entry.
The subnet mask for default entry is 0.0.0.0. The significance of all
zeroes is that ANDing any entry with 0 produces the result as zero.
This is all about subnet masks. Hope you learned something new
today.
What is the concept of Subnetting and Supernetting?
Subnetting
Dividing the network into smaller contiguous networks or subnets is
called subnetting.
Why subnetting?
Suppose we take a network of class A. So, in class A, we have 2²⁴
hosts. So to manage such a large number of hosts is tedious. So if we
divide this large network into the smaller network then maintaining
each network would be easy.
So, in subnetting we will divide these 254 hosts logically into two
networks. In the above class C network, we have 24 bits for Network
ID and the last 8 bits for the Host ID. We are going to borrow
the left-most bit of the host address and declare for identifying the
subnet. If the leftmost bit of the host address is 0 then it is the 1st
subnet network and if the leftmost bit is 1 then it would be 2nd
subnet network. Using 1 bit we can divide it into 2 networks i.e. 2¹.
If we want to divide it into four networks then we need 2 bits(2²=4
networks). The range of IP address which is in 1st subnet network is
from 201.10.1.0 to 201.10.1.127. The range of IP address that lies in
the 2nd subnet network is from 201.10.1.128 to 201.10.1.255.
Overall, there are 252 usable hosts after subnetting. So, because of
subnetting, there is a loss in the number of IP addresses.
This network will have two subnets as in the diagram below:
The router inside the network will have the routing table which
will be as follows:
Supernetting or Aggregation
It is the opposite of Subnetting. In this multiple smaller networks are
combined together to form a large network.
Why supernetting?
The routing table contains the entry of a subnet mask for every
network. If there are lots of small networks then the size of the
routing table increases. When the router has a big routing table then
it takes a lot of time for the router to process the routing table.
Supernetting is used to reduce the size of the IP routing table to
improve network routing efficiency.
Supernet Mask
Supernet Mask is a 32-bit number where all the fixed bits of the
network are represented by 1 and the variable part is represented by
0.
Overall, there are 252 usable hosts after subnetting. So, because of
subnetting, there is a loss in the number of IP addresses.
The bits to the left of the red line are fixed bits and the bits right of it
represent the variable bits.
The routing table at the router 2 is now reduced and contains only
one entry for all four networks. But, the router 1 needs a routing
table which should contain all the four entries because it should
know where to forward the packet next.
What are the classes of IPV4? How to identify an IP class from a given IP
address?
IPv4
IP version 4 is 32 bits long. The maximum value of a number that can
be formed by using 32 bits is 2³². So, the maximum number of IPv4
addresses is 4,294,967,296 addresses i.e. 2³² addresses. It consists of
four octets each of which can contain one to three digits ranging
from 0 to 255 separated by a single dot(.). Here, each number is the
decimal representation(base-10) for an 8 digit binary number(base-
2).
Classes of IPv4
1. Class A
2. Class B
3. Class C
4. Class D
5. Class E
The order of the bits in the first octet of the IP address decides the class
of the IP address.
Some bits of the IP address represents the network and the
remaining bits represent the host. The IP address can be further
be divided into two parts:
Network ID: It identifies which network you are on. The number of
networks in any class is given by the formula:
Number of Networks= 2^networkBits
1. Host ID in which all the bits are set to 0 is not assigned because
this represents the network ID.
2. Host ID in which are the bits are set to 1 is reserved for Direct
Broadcast Address(for sending the data from one network to
all the other hosts in another network).
Class A
The IP address belonging to Class A uses only the first octet to
identify the network and the last three octets are used to identify the
host.
10.20.15.3 = 00001010.00010100.00001111.00000011
255.0.0.0 = 11111111.00000000.00000000.00000000
10.20.15.1 = 00001010.00010100.00001111.00000001
255.0.0.0 = 11111111.00000000.00000000.00000000
netid = 00001010 = 10
Class A has:
• Network ID =2⁷-2 = 126 (Here 2 address is subtracted because
0.0.0.0 and 127.x.x.x are special address. 127.x.x.x is reserved
for localhost )
• Host ID = 2²⁴-2 = 16,777,214
The IP address belonging to Class A range from 1.a.a.a to
126.a.a.a.(where a ranges from 0 to 255)
Class B
The IP address belonging to Class B uses the first two octets to
identify the network and the last two octets are used to identify the
host.
Class C
The IP address belonging to Class C uses the first three octets to
identify the network and the last octet is used to identify the host.
Class D
The IP address belonging to Class D has the first four bits of the first
octet set as 1110. The remaining bits are the host bits.
Class E
The IP address belonging to Class E has the first four bits of the first
octet set as 1111. The remaining bits are the host bits.
IPv4
IP version 4 is the older version. It uses 32 bits to create a single
uniques address on the internet. IPv4 is limited to 4,294,967,296
addresses i.e. 2³² addresses. It consists of four numbers each of
which can contain one to three digits ranging from 0 to 255
separated by a single dot(.). Here, each number is the decimal
representation(base-10) for an 8 digit binary number(base-2). These
IP addresses pretty much guarantee that our emails will come and go
as expected, our google searches would take us to the website where
we want and so many other things that we do on the internet.
In the above IP address, four groups contain only zeros. This zero
can be replaced by a colon and can be re-written
as adba:1925::8a2e:7334.
What is DNS?
Whenever we make a search on the internet, we generally request
some services of the server. We make use of user-friendly words and
keywords to request the services, or make the search. But, we know
that the computer understands only the low-level binary data, not
the user-friendly data. We also know that each device on the
network has an IP(Internet Protocol) address through which we can
reach to that device. The IP address can be in decimal, hexadecimal,
or alphanumeric format, which is very tough for a user to remember.
So, they use the user-friendly keywords to search the devices over
the network. Thus, we need to map the user-friendly keywords with
the IP addresses to make use of it.
So, in this blog, we'll mainly learn about the Domain Name
System(DNS) in detail. We'll also see the working of the DNS, and its
two types, i.e., Authoritative, and Recursive DNS.
DNS records are distributed across the globe. All the information of
the DNS system is decentralized, so as to reduce the dependency on
a centralized source. Hence, the host computers can access the
nearest computer holding the domain system information.
We'll learn about these two addresses in detail. We'll also learn the
dissimilarities between them. Now let us see about them one by one.
The Network O.S. mainly runs on a powerful computer, that runs the
server program. It facilitates the security and capability of managing
the data, user, group, application, and other network functionalities.
The main advantage of using a network o.s. is that it facilitates the
sharing of resources and memory amongst the autonomous
computers in the network. It can also facilitate the client computers
to access the shared memory and resources administered by the
Server computer. In other words, the Network O.S. is mainly
designed to allow multiple users to share files and resources over the
network.
1. Peer-to-Peer
2. Client-Server
Now let us learn them one by one, along with their advantages and
disadvantages.
Peer-to-Peer
Peer-to-Peer Network Operating System is an operating system
in which all the nodes are functionally and operationally equal
to each other. No one is superior or inferior. They all are capable to
perform similar kinds of tasks. All the nodes have their own local
memory and resources. Using the Network O.S., they can connect
and communicate with each other. They can also share data and
resources with one another. One node can also communicate and
share data and resources with a remote node in the network by using
the authentication feature of the Network O.S. The nodes are
directly connected with each other in the network with the help of a
switch or a hub.
Client-Server
The Client-Server Networking Operating System operates with a
single server and multiple client computers in the network. The
Client O.S. runs on the client machine, while the Network Operating
System is installed on the server machine. The server machine is a
centralized hub for all the client machines. The client machines
generate a request for information or some resource and forward it
to the server machine. The server machine, in turn, replies to the
client machine by providing appropriate services to it in a secure
manner. The server machine is a very powerful computer, that is
capable of tackling large calculations and operations. It can also
have the ability to administer the whole network and its resources. It
can be multiprocessing in nature, which can process multiple client
requests at the same time. The Network O.S. enhances the reach of
client machines by providing remote access to other nodes and
resources of the network in a secure manner.
Now, let us first learn about these two terms one by one.
Domain
A domain can be seen as a logical grouping of computers or
devices on the same or different kinds of networks. Each
computer on a domain is administered by a centralized server that
manages each computer within a domain. These network domains
are uniquely identified using unique domain names that are assigned
by a domain controller. A domain controller acts as a server within a
domain for the domain hosts and provides the authentication
services, domain names, and various functionalities to them. One of
the major functionality of using a domain is secure access in which
no other computer outside the domain can access the domain
computers. The domain controller can also be used as a centralized
database for storage which can be shared by all the devices over a
particular domain.
Workgroup
A workgroup is a collection of autonomous computers that are
connected over a network and can share common files,
resources, and responsibilities with one another. It is
approximately the same as a workgroup, i.e., it can be used to sub-
divide or categorize a network. But the main difference is that it has
no centralized control over the devices in the workgroup. It can be
implemented to sub-divide a large network into workgroups for
better management.
Yes, you got it right. We can achieve this by using VPN i.e. Virtual
Private Network. In this blog, we will learn about the VPN.
The following are the topics that are going to be discussed in this
blog:
6. Private Network
7. A private network is a network which is configured such that
the devices outside the private network cannot access the
network and they can't communicate with the systems that are
present in that private network. This network has restrictions
on their access. Such a network is mostly used in business and
private organizations because they have confidential
information and they don't want to share it outside the
organization.
9. Problems
10. Suppose we have our own private network and we want to
access that network over the internet from a remote location
and send some sensitive information. How can we do that? You
can access the data or your private network using the internet
but there is one problem with this approach. The information
can be hacked by hackers even if we use some encryption
techniques. Also, your ISP(Internet Service Provider) will have
all the information about this data or information transfer.
Data Encapsulation
Data Encapsulation is the process in which some extra
information is added to the data item to add some features to
it. We use either the OSI or the TCP/IP model in our network, and
the data transmission takes place through various layers in these
models. Data encapsulation adds the protocol information to the
data so that data transmission can take place in a proper way. This
information can either be added in the header or the footer of the
data.
Data De-encapsulation
Data De-encapsulation is the reverse process of data
encapsulation. The encapsulated information is removed from
the received data to obtain the original data. This process takes
place at the receiver’s end. The data is de-encapsulated at the same
layer at the receiver’s end to the encapsulated layer at the sender’s
end. The added header and trailer information are removed from the
data in this process.
The below diagram shows how header and footer are added and
removed from the data in the process of encapsulation and de-
encapsulation respectively.
The data is encapsulated in every layer at the sender’s side and also
de-encapsulated in the same layer at the receiver’s end of the OSI or
TCP/IP model. Actually, we use different terms for the encapsulated
form of the data that is described in the below-mentioned diagram.
Now, we will learn the whole process of encapsulation and de-
encapsulation in the OSI and TCP/IP model step-by-step as
mentioned in the below picture.
Encapsulation Process (At sender’s side)
1. Step 1: The Application, Presentation, and Session layer in
the OSI model, or the Application layer in the TCP/IP
model takes the user data in the form of data streams,
encapsulates it and forwards the data to the Transport layer. It
does not necessarily add any header or footer to the data. But it
is application-specific and can add the header if needed.
2. Step 2: The Transport layer (in the OSI or TCP/IP model) takes
the data stream from the upper layers, and divide it into
multiple pieces. The Transport layer encapsulates the data by
adding the appropriate header to each piece. These data pieces
are now called as data segments. The header contains the
sequencing information so that the data segments can be
reassembled at the receiver’s end.
3. Step 3: The Network layer (in the OSI model) or the Internet
layer (in the TCP/IP model) takes the data segments from the
Transport layer and encapsulate it by adding an additional
header to the data segment. This data header contains all the
routing information for the proper delivery of the data. Here,
the encapsulated data is termed as a data packet or datagram.
4. Step 4: The Data-Link layer (in the OSI or TCP/IP model) takes
the data packet or datagram from the Network layer and
encapsulate it by adding an additional header and footer to the
data packet or datagram. The header contains all the switching
information for the proper delivery of the data to the
appropriate hardware components, and the trailer contains all
the information related to error detection and control. Here,
the encapsulated data is termed as a data frame.
5. Step 5: The Physical layer (in the OSI or TCP/IP model) takes
the data frames from the Data-Link layer and encapsulate it by
converting it to appropriate data signals or bits (corresponding
to the physical medium).
But the length of these cables is prescribed for the optimum use of
the network and its resources. The prescribed length of the cables
depends upon the type of cable used. For example, if we are using a
co-axial 10BASE5 cable then its prescribed length is around 500
meters, while the prescribed length for co-axial 10BASE2 cable is
around 180 meters.
So in this blog, we will see what happens when we use the cables
above the prescribed length in computer networks. We will also see
how using a longer length cable than prescribed length can affect the
network and its functionality.
While doing any call like WhatsApp call you might have encountered
the connection error like a weak signal or poor signal. Why does the
signal get distorted? What can be done to fix the signal attenuation
problem? In this blog, we will try to find the answer to this problem.
So, let's get started.
What is Attenuation?
In terms of your Internet connection, attenuation means
a reduction or loss in the strength of a signal. It is a natural process
that happens when we transmit the signal over distances. It is
measured in decibels(dB) per unit distance.
Lower the attenuation per unit distance higher is the efficiency of the
cable.
If the rate of attenuation increases then the mail which we are
sending or a WhatsApp call or a normal call we are making to our
friend becomes more distorted.
100BaseFX
100BaseFX is the Fast Ethernet Cable over the Optical Fiber. 100 in
the 100BaseFX refers that the data transfer rate is 100 megabits per
second i.e. 100Mbps. The word Base refers to Baseband digital
transmission. The letter F signifies that the segment type is Optical
Fiber.
1. It has two pairs of optical fibers. The first transmit frames from
hub to device and the second transmits from device to hub.
2. In most of the Fast Ethernet applications, the individual
devices are connected by twisted-pair copper
wires i.e. 100BaseTX(maximum segment length is only 100
meters) and the optical fibers are used for transmission over
longer distances(as maximum segment length is 2000 meters
of 100baseFX). So, 100baseTX to 100Base FX convertor is
required for sending the signal from the sender end over the
optical fiber. Similarly, at the receiver end, 100baseFX to
100Base TX is required.