NBS Notes-1
NBS Notes-1
We’ll describe OSI layers “top down” from the application layer that directly serves the end
user, down to the physical layer.
7. Application Layer
The application layer is used by end-user software such as web browsers and email clients. It
provides protocols that allow software to send and receive information and present meaningful
data to users. A few examples of application layer protocols are the Hypertext Transfer Protocol
(HTTP), File Transfer Protocol (FTP), Post Office Protocol (POP), Simple Mail Transfer Protocol
(SMTP), and Domain Name System (DNS).
6. Presentation Layer
The presentation layer prepares data for the application layer. It defines how two devices
should encode, encrypt, and compress data so it is received correctly on the other end. The
presentation layer takes any data transmitted by the application layer and prepares it for
transmission over the session layer
5. Session Layer
The session layer creates communication channels, called sessions, between devices. It is
responsible for opening sessions, ensuring they remain open and functional while data is being
transferred, and closing them when communication ends. The session layer can also set
checkpoints during a data transfer—if the session is interrupted, devices can resume data
transfer from the last checkpoint.
4. Transport Layer
The transport layer takes data transferred in the session layer and breaks it into “segments” on
the transmitting end. It is responsible for reassembling the segments on the receiving end,
turning it back into data that can be used by the session layer. The transport layer carries out
flow control, sending data at a rate that matches the connection speed of the receiving device,
and error control, checking if data was received incorrectly and if not, requesting it again.
3. Network Layer
The network layer has two main functions. One is breaking up segments into network packets,
and reassembling the packets on the receiving end. The other is routing packets by discovering
the best path across a physical network. The network layer uses network addresses (typically
Internet Protocol addresses) to route packets to a destination node.
2. Data Link Layer
The data link layer establishes and terminates a connection between two physically-connected
nodes on a network. It breaks up packets into frames and sends them from source to
destination. This layer is composed of two parts—Logical Link Control (LLC), which identifies
network protocols, performs error checking and synchronizes frames, and Media Access
Control (MAC) which uses MAC addresses to connect devices and define permissions to
transmit and receive data.
1. Physical Layer
The physical layer is responsible for the physical cable or wireless connection between network
nodes. It defines the connector, the electrical cable or wireless technology connecting the
devices, and is responsible for transmission of the raw data, which is simply a series of 0s and
1s, while taking care of bit rate control
2 : ARP, RARP
Ans:-
• Version – the version of the IP protocol. For IPv4, this field has a value of 4.
• Header length – the length of the header in 32-bit words. The minumum value is
20 bytes, and the maximum value is 60 bytes.
• Priority and Type of Service – specifies how the datagram should be handled.
The first 3 bits are the priority bits.
• Total length – the length of the entire packet (header + data). The minimum
length is 20 bytes, and the maximum is 65,535 bytes.
• Identification – used to differentiate fragmented packets from different
datagrams.
• Flags – used to control or identify fragments.
• Fragmented offset – used for fragmentation and reassembly if the packet is too
large to put in a frame.
• Time to live – limits a datagram’s lifetime. If the packet doesn’t get to its
destination before the TTL expires, it is discarded.
• Protocol – defines the protocol used in the data portion of the IP datagram. For
example, TCP is represented by the number 6 and UDP by 17.
• Header checksum – used for error-checking of the header. If a packet arrives at
a router and the router calculates a different checksum than the one specified in
this field, the packet will be discarded.
• Source IP address – the IP address of the host that sent the packet.
• Destination IP address – the IP address of the host that should receive the
packet.
• Options – used for network testing, debugging, security, and more. This field is
usually empty.
4 : What is Subnet?
Ans:-
A subnetwork or subnet is a logical subdivision of an IP network. The practice of dividing a
network into two or more networks is called subnetting.
Computers that belong to the same subnet are addressed with an identical most-significant bit-
group in their IP addresses. This results in the logical division of an IP address into two fields:
the network number or routing prefix and the rest field or host identifier. The rest field is an
identifier for a specific host or network interface.
The routing prefix may be expressed in Classless Inter-Domain Routing (CIDR) notation written
as the first address of a network, followed by a slash character (/), and ending with the bit-
length of the prefix. For example, 198.51.100.0/24 is the prefix of the Internet Protocol version
4 network starting at the given address, having 24 bits allocated for the network prefix, and the
remaining 8 bits reserved for host addressing. Addresses in the range 198.51.100.0 to
198.51.100.255 belong to this network. The IPv6 address specification 2001:db8::/32 is a large
address block with 296 addresses, having a 32-bit routing prefix.
Port Address Translation (PAT) – This is also known as NAT overload. In this, many local
(private) IP addresses can be translated to a single registered IP address. Port numbers are used
to distinguish the traffic i.e., which traffic belongs to which IP address. This is most frequently
used as it is cost-effective as thousands of users can be connected to the Internet by using only
one real global (public) IP address.
6 : What is VPN and how it's works?
Ans:-
VPN stands for "Virtual Private Network" and describes the opportunity to establish a
protected network connection when using public networks. VPNs encrypt your internet traffic
and disguise your online identity. This makes it more difficult for third parties to track your
activities online and steal data. The encryption takes place in real time.
How does a VPN work?
A VPN hides your IP address by letting the network redirect it through a specially configured
remote server run by a VPN host. This means that if you surf online with a VPN, the VPN server
becomes the source of your data. This means your Internet Service Provider (ISP) and other
third parties cannot see which websites you visit or what data you send and receive online. A
VPN works like a filter that turns all your data into "gibberish". Even if someone were to get
their hands on your data, it would be useless
in networking, tunnels are a method for transporting data across a network using protocols that
are not supported by that network. Tunneling works by encapsulating packets: wrapping packets
inside of other packets. (Packets are small pieces of data that can be re-assembled at their
destination into a larger file.)
Encapsulation in tunneling
Data traveling over a network is divided into packets. A typical packet has two parts: the
header, which indicates the packet's destination and which protocol it uses, and the
payload, which is the packet's actual contents.
Ans:-
The work of transport mode is to encrypt the message in the data packet and the
tunneling mode encrypts the whole data packet. IPSec can also be used with other
security protocols to improve the security system.
5. OpenVPN:
OpenVPN is an open source VPN that is commonly used for creating Point-to-
Point and Site-to-Site connections. It uses a traditional security protocol based on
SSL and TLS protocol.
6. Secure Shell (SSH):
Secure Shell or SSH generates the VPN tunnel through which the data transfer
occurs and also ensures that the tunnel is encrypted. SSH connections are
generated by a SSH client and data is transferred from a local port on to the
remote server through the encrypted tunnel.
9 : What is the difference between proxy and VPN?
Ans:-
S.NOVPN Proxy
VPN ensures encryption,
authentication and integrity Proxy does not ensure or
1. protection. provide any security.
Ans:-
Secure Sockets Layer (SSL) is a protocol for securing communication on the Internet. It
provides a way for enterprises to encrypt data before sending it to users, preventing third
parties from reading it while it’s in transit.
SSL works through the use of public key cryptography. Public key cryptography uses
two keys – a private key and a public key – to transmit secure data between two
systems. These keys are essential to respectively decoding and encoding secure data.
Ans:- An Internet Protocol address (IP address) is a numerical label such as 192.0.2.1 that is
connected to a computer network that uses the Internet Protocol for communication. An IP
address serves two main functions: network interface identification and location addressing.
There are 4 types of IP Addresses- Public, Private, Fixed, and Dynamic. Among them,
public and private addresses are derived from their local network location, which should
be used within the network while public IP is used offline.
Public IP address–
Private IP address–
Everything that connects to your Internet network has a private IP address. This includes
computers, smartphones, and tablets but also any Bluetooth-enabled devices such as
speakers, printers, or smart TVs. With the growing internet of things, the number of
private IP addresses you have at home is likely to increase. Your router needs a way to
identify these things separately, and most things need a way to get to know each other.
Therefore, your router generates private IP addresses that are unique identifiers for each
device that separates the network.
Static IP Address–
Static IP addresses are incompatible, given once, remain the same over the years. This
type of IP also helps you get more information about the device.
Dynamic IP address–
It means constant change. A dynamic IP address changes from time to time and is not
always the same. If you have a live cable or DSL service, you may have a strong IP
address. Internet Service Providers (provide customers with dynamic IP addresses
because they are too expensive. Instead of one permanent IP address, your IP address is
taken out of the address pool and assigned to you. After a few days, weeks, or
sometimes even months, that number is returned to the lake and given a new number.
Most ISPs will not provide a static IP address to customers who live there and when they
do, they are usually more expensive. Dynamic IP addresses are annoying, but with the
right software, you can navigate easily and for free
• Step 1 (SYN): In the first step, the client wants to establish a connection with a server, so it
sends a segment with SYN(Synchronize Sequence Number) which informs the server that the
client is likely to start communication and with what sequence number it starts segments with
• Step 2 (SYN + ACK): Server responds to the client request with SYN-ACK signal bits
set. Acknowledgement(ACK) signifies the response of the segment it received and SYN signifies
with what sequence number it is likely to start the segments with
• Step 3 (ACK): In the final part client acknowledges the response of the server and they both
establish a reliable connection with which they will start the actual data transfer
13. ROUTER VS SWITCH
Switch Router
4. Next-generation Firewalls –
These firewalls are called intelligent firewalls. These firewalls can perform
all the tasks that are performed by the other types of firewalls that we
learned previously but on top of that, it includes additional features like
application awareness and control, integrated intrusion prevention, and
cloud-delivered threat intelligence.
5. Circuit-level gateways –
A circuit-level gateway is a firewall that provides User Datagram Protocol
(UDP) and Transmission Control Protocol (TCP) connection security and
works between an Open Systems Interconnection (OSI) network model’s
transport and application layers such as the session layer.
6. Software Firewall –
The software firewall is a type of computer software that runs on our
computers. It protects our system from any external attacks such as
unauthorized access, malicious attacks, etc. by notifying us about the
danger that can occur if we open a particular mail or if we try to open a
website that is not secure.
7. Hardware Firewall –
A hardware firewall is a physical appliance that is deployed to enforce a
network boundary. All network links crossing this boundary pass-through
this firewall, which enables it to perform an inspection of both inbound and
outbound network traffic and enforce access controls and other security
policies.
8. Cloud Firewall –
These are software-based, cloud-deployed network devices. This cloud-
based firewall protects a private network from any unwanted access. Unlike
traditional firewalls, a cloud firewall filters data at the cloud level.
Working of Firewalls :
Firewalls can control and monitor the amount of incoming or outgoing traffic of
our network. The data that comes to our network is in the forms of packets(a
small unit of data), it is tough to identify whether the packet is safe for our
network or not, this gives a great chance to the hackers and intruders to bombard
our networks with various viruses, malware, spam, etc.
16. Explain IDS/IPS and its types
Intrusion detection is the process of monitoring the events occurring in your
network and analyzing them for signs of possible incidents, violations, or
imminent threats to your security policies. Intrusion prevention is the process of
performing intrusion detection and then stopping the detected incidents. These
security measures are available as intrusion detection systems (IDS) and intrusion
prevention systems (IPS), which become part of your network to detect and stop
potential incidents.
Types of IDS:-
1. Network Intrusion Detection System (NIDS):
Network intrusion detection systems (NIDS) are set up at a planned point
within the network to examine traffic from all devices on the network. It
performs an observation of passing traffic on the entire subnet and
matches the traffic that is passed on the subnets to the collection of known
attacks. Once an attack is identified or abnormal behavior is observed, the
alert can be sent to the administrator. An example of a NIDS is installing it
on the subnet where firewalls are located in order to see if someone is
trying to crack the firewall.
2. Host Intrusion Detection System (HIDS):
Host intrusion detection systems (HIDS) run on independent hosts or
devices on the network. A HIDS monitors the incoming and outgoing
packets from the device only and will alert the administrator if suspicious or
malicious activity is detected. It takes a snapshot of existing system files
and compares it with the previous snapshot. If the analytical system files
were edited or deleted, an alert is sent to the administrator to investigate.
An example of HIDS usage can be seen on mission-critical machines, which
are not expected to change their layout.
3. Protocol-based Intrusion Detection System (PIDS):
Protocol-based intrusion detection system (PIDS) comprises a system or
agent that would consistently resides at the front end of a server,
controlling and interpreting the protocol between a user/device and the
server. It is trying to secure the web server by regularly monitoring the
HTTPS protocol stream and accept the related HTTP protocol. As HTTPS is
un-encrypted and before instantly entering its web presentation layer then
this system would need to reside in this interface, between to use the
HTTPS.
4. Application Protocol-based Intrusion Detection System (APIDS):
Application Protocol-based Intrusion Detection System (APIDS) is a system
or agent that generally resides within a group of servers. It identifies the
intrusions by monitoring and interpreting the communication on
application-specific protocols. For example, this would monitor the SQL
protocol explicit to the middleware as it transacts with the database in the
web server.
5. Hybrid Intrusion Detection System :
Hybrid intrusion detection system is made by the combination of two or
more approaches of the intrusion detection system. In the hybrid intrusion
detection system, host agent or system data is combined with network
information to develop a complete view of the network system. Hybrid
intrusion detection system is more effective in comparison to the other
intrusion detection system. Prelude is an example of Hybrid IDS.
Types of IPS:-
1. Network-based intrusion prevention system (NIPS):
It monitors the entire network for suspicious traffic by analyzing protocol
activity.
Every device and server has a unique internet protocol (IP) address, which is a series of
numbers used as identifiers in communications. Every website has a domain name (e.g.
www.keyfactor.com) that sits on top of that to make it easy for internet users to visit the
websites they want. The domain name system (aka DNS) then maps the domain name
that users enter to the appropriate IP address to properly route their traffic, all of which
gets handled through DNS servers.
The biggest weakness that allows this type of attack to occur is the fact that the entire
system for routing web traffic was built more for scale than for security. The current
process is built on what’s called the User Datagram Protocol (UDP), a process that
does not require senders or recipients to verify they are ready to communicate or verify
who they are. This vulnerability allows hackers to fake identity information (which
requires no additional verification) and step into the process to start redirecting DNS
servers.