You are on page 1of 196

Introduction to Networking

July 2022
Overview of networking

We are living in a connected world.


Information is being produced, exchanged, and traced across
the globe in real time.
It's possible as almost everyone and everything in the digital
world is interconnected through one way or the other.
Overview of networking

A group of two or more similar things or people


interconnected with each other is called network.
Some of the examples of network in our everyday life
includes:
● Social network
● Mobile network
● Network of computers
● Airlines, railway, banks, hospitals networks
Overview of networking

A computer network is an interconnection among two or more


computers or computing devices.
Such interconnection allows computers to share data and
resources among each other.
A basic network may connect a few computers placed in a
room.
Overview of networking

The network size may vary from small to large depending on


the number of computers it connects.
A computer network can include different types of hosts (also
called nodes) like server, desktop, laptop, cellular phones.
Overview of networking
Overview of networking

Apart from computers, networks include networking devices


like switch, router, modem, etc.
Networking devices are used to connect multiple computers
in different settings.
Overview of networking

For communication, data in a network is divided into smaller


chunks called packets.
These packets are then carried over a network.
Devices in a network can be connected either through wired
media like cables or wireless media like air.
Overview of networking

In a communication network, each device that is a part of a


network and that can receive, create, store or send data to
different network routes is called a node.
In the context of data communication, a node can be a device
such as a modem, hub, bridge, switch, router, digital
telephone handset, a printer, a computer or a server.
Overview of networking

Interconnectivity of computing devices in a network allows us


to exchange information simultaneously with many parties
through email, websites, audio/video calls, etc.
Overview of networking

Network allows sharing of resources.


For example, a printer can be made available to multiple
computers through a network; a networked storage can be
accessed by multiple computers. People often connect
their devices through hotspot, thus forming a small
personal network.
Overview of networking

Types of networks
Based on the geographical area covered and data transfer
rate, computer networks are broadly categorised as:
● PAN ( Personal Area Network)
● LAN (Local Area Network)
● MAN (Metropolitan Area Network)
● WAN (Wide Area Network)
Overview of networking

A personal area network (PAN) is a computer network for


interconnecting electronic devices within an individual
person's workspace.
A PAN provides data transmission among devices such as
computers, smartphones, tablets and personal digital
assistants.
Overview of networking

PANs can be used for communication among the personal


devices themselves, or for connecting to a higher level
network and the Internet where one master device takes up
the role as gateway.
Overview of networking

A Local Area Network (LAN) is a private network that


connects computers and devices within a limited area like a
residence, an office, a building or a campus. On a small
scale,
LANs are used to connect personal computers to printers.
Overview of networking

However, LANs can also extend to a few kilometers when


used by companies, where a large number of computers
share a variety of resources like hardware (e.g. printers,
scanners, audiovisual devices etc), software (e.g. application
programs) and data.
Overview of networking

A metropolitan area network (MAN) is a network with a size


greater than LAN but smaller than a WAN.
It normally comprises networked interconnections within a city
that also offers a connection to the Internet.
Overview of networking

A wide area network (WAN) is a computer network that


covers a large geographical area comprising a region, a
country, a continent or even the whole world.
WAN includes the technologies to transmit data, image, audio
and video information over long distances and among
different LANs and MANs.
Intranet, Extranet, and Internet

The Internet
● The Internet is a public and global communication network
that provides direct connectivity to anyone over a local
area network (LAN) or Internet Service Provider (ISP).
Intranet, Extranet, and Internet

The Internet
● The Internet is a public network that is connected and
routed over gateways. End users are connected to local
access providers (LANs or ISPs), who are connected to
the Internet access providers, to network access
providers, and eventually to the Internet backbone.
Intranet, Extranet, and Internet

The Internet
● Since access to the Internet is open to all, there is a lack
of control that may result in an unruly proliferation of
information.
Intranet, Extranet, and Internet

The Intranet
● An intranet is a corporate LAN or wide area network
(WAN) that uses Internet technology and is secured
behind company’s firewalls.
Intranet, Extranet, and Internet

The Intranet
● The intranet links various servers, clients, databases, and
application programs like Enterprise Resource Planning
(ERP). Although intranets are developed on the same
TCP/IP protocol as the Internet, they operate as a private
network with limited access.
Intranet, Extranet, and Internet

The Intranet
● Only authorized employees are able to use it. Intranets
are limited to information pertinent to the company and
contain exclusive and often proprietary and sensitive
information.
Intranet, Extranet, and Internet

The Extranet
● An extranet, or “extended intranet”, uses the TCP/IP
protocol network of the Internet, to link intranets in
different locations.
● Extranet transmission is usually conducted over the
Internet, which offers little privacy or transmission security.
Intranet, Extranet, and Internet

The Extranet
● Therefore, when using an extranet, it is necessary to
improve the security of connecting portions of the Internet.
This can be done by creating tunnels of secured data
flows, using cryptography and authorization algorithm.
● The Internet with tunneling technology is known as a
virtually private network (VPN).
Comparison of
Intranet,
Extranet, and
Internet
Identifying nodes in a network

Each node in a network should be uniquely identified so that


a network device can identify the sender and receiver and
decide a routing path to transmit data.
Identifying nodes in a network

MAC address
● MAC stands for Media Access Control.
● The MAC address, also known as the physical or
hardware address, is a unique value associated with a
network adapter called a NIC.
Identifying nodes in a network

MAC address
● The MAC address is engraved on NIC at the time of
manufacturing and thus it is a permanent address and
cannot be changed under any circumstances.
● The machine on which the NIC is attached, can be
physically identified on the network using its MAC
address.
Identifying nodes in a network

MAC address
● Each MAC address is a 12-digit hexadecimal numbers (48
bits in length), of which the first six digits (24 bits) contain
the manufacturer’s ID called Organisational Unique
Identifier (OUI) and the later six digits (24 bits) represents
the serial number assigned to the card by the
manufacturer.
Identifying nodes in a network

MAC address
● A sample MAC address looks like:

FC:F8:AE: CE:7B:16
OUI Unique Serial Number
Identifying nodes in a network

IP address
● IP address, also known as Internet Protocol address, is
also a unique address that can be used to uniquely
identify each node in a network.
● The IP addresses are assigned to each node in a network
that uses the Internet Protocol for communication. Thus, if
we know a computer’s IP address, we can communicate
with that computer from anywhere in the world.
Identifying nodes in a network

IP address
● However, unlike MAC address, IP address can change if a
node is removed from one network and connected to
another network.
Identifying nodes in a network

IP address
● The initial IP Address called version 4 (IPV4 in short), is a
32 bit numeric address, written as four numbers separated
by periods, where each number is the decimal (base-10)
representation for an 8-bit binary (base-2) number and
each can take any value from 0 - 255.
● A sample IPV4 address looks like:
192:168:0:178
Identifying nodes in a network

IP address
● With more and more devices getting connected to the
Internet, it was realised that the 32-bit IP address will not
be sufficient as it offers just under 4.3 billion unique
addresses.
Identifying nodes in a network

IP address
● Thus, a 128 bits IP address, called IP version 6 (IPV6 in
short) was proposed. An IPv6 address is represented by
eight groups of hexadecimal (base-16) numbers
separated by colons. A sample IPV6 address looks like:
2001:CDBA:0000:0000:0000:0000:3257:9652
HTML

● HyperText Markup Language. It is a language which is


used to design standardised Web Pages so that the Web
contents can be read and understood from any computer.
Basic structure of every webpage is designed using
HTML.
URL

● Uniform Resource Identifier. It is a unique address or path


for each resource located on the web. It is also known as
Uniform Resource Locator (URL). Every page on the web
has a unique URL.
● Examples are:
● https://tha.edu.in/
● https://heritageit.edu/
● http://test.edu/
URL

● URL is sometimes also called web address. However, a


URL is not only the domain name. It contains other
information that completes a web address, as depicted
below:
Domain name

http://test.edu/onlinetest.htm

URL
URL

URL: http://www.bca.com/it/index.html
● http is the protocol.
● bca.com is the server name.
● index.htm is the file name.
● it directory
HTTP

● The HyperText Transfer Protocol is a set of rules which is


used to retrieve linked web pages across the web. The
more secure and advanced version is HTTPS.
Domain Name System (DNS)

● Domain Name System helps to resolve the host name to


an address.
● It uses a hierarchical naming scheme and distributed
database of IP addresses and associated names
Domain Name System Architecture

● The Domain name system comprises of Domain Names,


Domain Name Space, Name Server
Domain Names

● Domain Name is a symbolic string associated with an IP


address. There are several domain names available; some
of them are generic such as com, edu, gov, net etc, while
some country level domain names such as au, in, za, us
etc.
Domain Name Space

● The domain name space refers a hierarchy in the internet


naming structure. This hierarchy has multiple levels (from
0 to 127), with a root at the top.
Domain Name Space

In the diagram each


subtree represents a
domain.
Each domain can be
partitioned into sub
domains and these
can be further
partitioned and so on.
Name server

● Name server contains the DNS database.


● This database comprises of various names and their
corresponding IP addresses.
● Since it is not possible for a single server to maintain
entire DNS database, therefore, the information is
distributed among many DNS servers.
Zones

● Zone is collection of nodes (sub domains) under the main


domain. The server maintains a database called zone file
for every zone.
Zones
Types of name server

Following are the three categories of Name Servers that


manages the entire Domain Name System:

● Root Server
● Primary Server
● Secondary Server
Root server

● Root Server is the top level server which consists of


the entire DNS tree. It does not contain the
information about domains but delegates the authority
to the other server
Primary and secondary server

● Primary Server stores a file about its zone. It has


authority to create, maintain, and update the zone file.
● Secondary Server transfers complete information
about a zone from another server which may be
primary or secondary server. The secondary server
does not have authority to create or update a zone file.
URL revisited
Address resolution Protocol

● Address Resolution Protocol (ARP) is a protocol or


procedure that connects an ever-changing Internet
Protocol (IP) address to a fixed physical machine
address, also known as a media access control (MAC)
address, in a local-area network (LAN).
Address resolution Protocol

● This mapping procedure is important because the


lengths of the IP and MAC addresses differ, and a
translation is needed so that the systems can
recognize one another.
Address resolution Protocol

● The most used IP today is IP version 4 (IPv4). An IP


address is 32 bits long. However, MAC addresses are
48 bits long. ARP translates the 32-bit address to 48
and vice versa.
Address resolution Protocol

● There is a networking model known as the Open


Systems Interconnection (OSI) model.
Address resolution Protocol
Address resolution Protocol

● The MAC address is also known as the data link layer,


which establishes and terminates a connection
between two physically connected devices so that data
transfer can take place.
Address resolution Protocol

● The IP address is also referred to as the network layer


or the layer responsible for forwarding packets of data
through different routers.
● ARP works between these layers.
Address resolution Protocol
Address resolution Protocol
● When a new computer joins a local area network (LAN), it will receive a unique IP address to use for
identification and communication.
● Packets of data arrive at a gateway, destined for a particular host machine. The gateway, or the piece of
hardware on a network that allows data to flow from one network to another, asks the ARP program to find a
MAC address that matches the IP address. The ARP cache keeps a list of each IP address and its matching
MAC address. The ARP cache is dynamic, but users on a network can also configure a static ARP table
containing IP addresses and MAC addresses.
● ARP caches are kept on all operating systems in an IPv4 Ethernet network. Every time a device requests a
MAC address to send data to another device connected to the LAN, the device verifies its ARP cache to see if
the IP-to-MAC-address connection has already been completed. If it exists, then a new request is
unnecessary. However, if the translation has not yet been carried out, then the request for network addresses
is sent, and ARP is performed.
Address resolution Protocol
● An ARP cache size is limited by design, and addresses tend to stay in the cache for only a few minutes. It is
purged regularly to free up space. This design is also intended for privacy and security to prevent IP addresses
from being stolen or spoofed by cyberattackers. While MAC addresses are fixed, IP addresses are constantly
updated.
● In the purging process, unutilized addresses are deleted; so is any data related to unsuccessful attempts to
communicate with computers not connected to the network or that are not even powered on.
Telnet

● TELNET is an abbreviation for Telecommunication


Network. It is simply a connection protocol that allows
a user to connect to a remote server that is listening for
commands. Once the connection is established, the
user can issue commands to the server computer, and
examine the responses that are sent back.
Telnet

● In general, TELNET uses the port number 23 for its


command operations.
● Due to single operated port, TELNET can establish
only one connection at a time.
● In case of TELNET, remote login is mandatory because
issue commands could be run only after login.
Telnet

● Telnet is a network protocol that allows you to remotely


connect to a computer and establish a two-way,
collaborative text-based communication channel
between two computers.
Telnet

● Telnet creates remote sessions using the Transmission


Control Protocol/Internet Protocol (TCP/IP) networking
protocol, controlled by the user. On the web, users can
request specific files from remote computers using the
Hypertext Transfer Protocol (HTTP) and File Transfer
Protocol (FTP).
Telnet

● In contrast, Telnet allows users to log on as regular


users with the privileges allocated to the specific
applications and data on that computer.
Telnet

● Telnet is most commonly used by programmers and


anyone who needs to access certain apps or data on a
remote computer.
Telnet

● Some servers allow remote access to public data via


Telnet, allowing users to play simple games or look up
weather forecasts. Many of these features are present
because they are nostalgic or still compatible with older
systems that require specific information.
FTP

● FTP stands for File Transfer Protocol and its primarily


concern is to facilitate the transfer of files from one
point to another, along with a few management
capabilities like making and deleting directories.
FTP

● FTP uses port numbers 20 and 21 to establish a


connection and perform file transfer operations.
● FTP has two ports available, so it can establish two
connections; one is for control command and another
is for data transfer.
● Remote login is not mandatory in case of FTP.
FTP

● FTP stands for File Transfer Protocol. It is a


client/server protocol that allows you to transmit and
receive files from a host computer. FTP authentication
may be done via user names and passwords.
FTP

● FTP is used for copying files from one host to another


host location. FTP works on Port 20 and 21. Port 20 is
used for data and Port 21 is used for connection
control.
FTP

● Anonymous FTP allows users to access files,


programs, and other data through the Internet without
the need for a username and password. Users can use
"anonymous" or "guest" as their user ID and an email
address as their password on some websites.
FTP

● The first FTP client software was based on the DOS


command prompt, which provided a set of defined
commands and syntax.
● Abhay Bhushan wrote the first FTP specification,
published as RFC 114 on April 16, 1971.
● RFC 765 was eventually introduced to replace it (June
1980).
FTP

● Various graphical user interface (GUI) clients for


operating systems have been created since then,
making it easier for users to upload and download
data.
● FTP is not compatible with every system and it does
not allow simultaneous transfer of data to multiple
receivers.
HTTP

● The Hypertext Transfer Protocol (HTTP) is an


application-level protocol for distributed, collaborative,
hypermedia information systems. This is the foundation
for data communication for the World Wide Web (i.e.
internet) since 1990.
HTTP

● HTTP is a generic and stateless protocol which can be


used for other purposes as well using extensions of its
request methods, error codes, and headers.
HTTP

● Basically, HTTP is a TCP/IP based communication


protocol, that is used to deliver data (HTML files, image
files, query results, etc.) on the World Wide Web. The
default port is TCP 80, but other ports can be used as
well.
HTTP

● It provides a standardized way for computers to


communicate with each other. HTTP specification
specifies how clients' request data will be constructed
and sent to the server, and how the servers respond to
these requests.
HTTP

● There are three basic features that make HTTP a


simple but powerful protocol:
a. HTTP is connectionless
b. HTTP is media independent
c. HTTP is stateless
HTTP

HTTP is connectionless

The HTTP client, i.e., a browser initiates an HTTP


request and after a request is made, the client waits for
the response. The server processes the request and
sends a response back after which client disconnect
the connection.
HTTP

HTTP is connectionless

So client and server knows about each other during


current request and response only. Further requests
are made on new connection like client and server are
new to each other.
HTTP

HTTP is media independent

It means, any type of data can be sent by HTTP as


long as both the client and the server know how to
handle the data content. It is required for the client as
well as the server to specify the content type using
appropriate MIME-type.
HTTP

HTTP is stateless

As mentioned above, HTTP is connectionless and it is


a direct result of HTTP being a stateless protocol. The
server and client are aware of each other only during a
current request. Afterwards, both of them forget about
each other.
HTTP

HTTP is stateless

Due to this nature of the protocol, neither the client nor


the browser can retain information between different
requests across the web pages.
HTTP

● The following diagram


shows a very basic
architecture of a web
application and depicts
where HTTP sits:
HTTP

● The HTTP protocol is a request/response protocol


based on the client/server based architecture where
web browsers, robots and search engines, etc. act like
HTTP clients, and the Web server acts as a server.
HTTP

● Client
● The HTTP client sends a request to the server in the
form of a request method, URI, and protocol version,
followed by a MIME-like message containing request
modifiers, client information, and possible body content
over a TCP/IP connection.
HTTP

● Server
● The HTTP server responds with a status line, including
the message's protocol version and a success or error
code, followed by a MIME-like message containing
server information, entity meta information, and
possible entity-body content.
TCP 3-Way Handshake Process

● Transmission Control Protocol (TCP) provides a secure


and reliable connection between two devices using the
3-way handshake process.
● TCP uses the full-duplex connection to synchronize
(SYN) and acknowledge (ACK) each other on both
sides.
TCP 3-Way Handshake Process

● There are three steps for both establishing and closing


a connection. They are − SYN, SYN-ACK, and ACK.
● It will support communication between a web browser
on the client and server sides whenever a user
navigates the Internet.
3-Way Handshake
Connection Establishment
Process
● After getting the (ACK) from
the client, the connection is
established between the client
and the server.
● Now the data can be
transmitted between the client
and server sides.
3 -Way Handshake Closing
Connection Process
● First, the client requests the server to
terminate the established connection by
sending FIN.
● After receiving the client request, the
server sends back the FIN and ACK
request to the client.
● After receiving the FIN + ACK from the
server, the client confirms by sending an
ACK to the server.
Flow control

● Flow control is a system that guarantees a sender's


transmission rate is proportional to the receiver's
reception capability.
Flow control

● In data communications, flow control is used to manage


the flow of data/packets between two nodes, primarily
when the transmitting device can deliver data quicker than
the receiver can digest it.
Flow control

● Many different devices are connected to networks of any


size, and each device has its data transmission settings. A
router, for example, is designed to manage data routing,
whereas a PC on the receiving end of that data has
significantly fewer sending/receiving capabilities.
Flow control

● If the sender begins transferring data quicker than the


receiving node's ability, a conflict may arise. Flow control
is employed to address this issue. This method controls
the data flow between nodes by focusing on both nodes'
sending and receiving capabilities.
Flow control

● Xon-Xoff is a flow control protocol that synchronizes the


transmitter and receiver.
● In data link layer, flow control restricts the number of
frames the sender can send before it waits for an
acknowledgment from the receiver.
Flow control

● Flow control can be broadly classified into two categories:


a. Feedback-based Flow Control
b. Rate-based Flow Control
Flow control

● Feedback-based Flow Control − In these protocols, the


sender sends frames after it has received
acknowledgments from the user. This is used in the data
link layer.
Flow control

● Rate-based Flow Control − These protocols have built in


mechanisms to restrict the rate of transmission of data
without requiring acknowledgment from the receiver. This
is used in the network layer and the transport layer.
Congestion Control

● When a node or a link carries too much data, it causes


queuing delays, frame or data packet loss, and blocking
new connections, lowering network service quality.
● Response time slows as network throughput drops in a
congested network. When bandwidth is limited, and data
traffic exceeds capacity, congestion develops.
Congestion Control

● Congestion causes choking of the communication


medium.
● When too many packets are displayed in a method of the
subnet, the subnet's performance degrades.
Congestion Control

● Hence, a network's communication channel is called


congested if packets are traversing the path and
experience delays mainly over the path's propagation
delay.
Congestion Control

● Data packet loss due to congestion is mitigated by


aggressive network protocol retransmission, which
maintains a network congestion condition after reducing
the initial data load.
● This can result in two stable states under the same data
traffic load - one to deal with the initial load and the other
to keep the network throughput low.
Congestion Control

● Avoiding congestion collapse in modern networks requires


the use of network congestion avoidance techniques as
well as congestion control
Congestion Control

● Techniques -
a. Protocols that use algorithm feedback to reduce data packet
throughput to acceptable levels are exponential backoff protocols.
b. Prioritization strategies are used to allow only critical data streams
to be transmitted.
c. Appropriate network resource allocation in anticipation of
increased data packet throughput requirements.
Congestion Control

● Algorithms -
a. Leaky Bucket
b. Token Bucket Algorithm
Congestion Control

● Leaky Bucket − The leaky bucket algorithm discovers its


use in the context of network traffic shaping or
rate-limiting. The algorithm allows controlling the rate at
which a record is injected into a network and managing
burstiness in the data rate.
Congestion Control

● Token Bucket Algorithm − It is a control algorithm that


indicates when traffic should be sent. This order comes
based on the display of tokens in the bucket. The bucket
contains tokens. Each of the tokens defines a packet of
predetermined size. Tokens in the bucket are deleted for
the ability to share a packet.
Error Control

● Error control in data link layer is the process of detecting


and correcting data frames that have been corrupted or
lost during transmission.
Error Control

● In case of lost or corrupted frames, the receiver does not


receive the correct data-frame and sender is ignorant
about the loss.
Error Control

● Data link layer follows a technique to detect transit errors


and take necessary actions, which is retransmission of
frames whenever error is detected or frame is lost.
● The process is called Automatic Repeat Request (ARQ).
Error Control

● Phases in Error Control


a. Detection of Error
b. Acknowledgment
i. Positive ACK
ii. Negative ACK
c. Retransmission
Error Control
Error Control
● Stop and Wait ARQ
a. A timeout counter is maintained by the sender, which is started when a frame is sent.
b. If the sender receives acknowledgment of the sent frame within time, the sender is confirmed about
successful delivery of the frame. It then transmits the next frame in queue.
c. If the sender does not receive the acknowledgment within time, the sender assumes that either the frame or
its acknowledgment is lost in transit. It then retransmits the frame.
d. If the sender receives a negative acknowledgment, the sender retransmits the frame.
Error Control
● Go-Back-N ARQ
a. The sender has buffers called sending window.
b. The sender sends multiple frames based upon the sending-window size, without receiving the
acknowledgment of the previous ones.
c. The receiver receives frames one by one. It keeps track of incoming frame’s sequence number and sends the
corresponding acknowledgment frames.
d. After the sender has sent all the frames in window, it checks up to what sequence number it has received
positive acknowledgment.
e. If the sender has received positive acknowledgment for all the frames, it sends next set of frames.
f. If sender receives NACK or has not receive any ACK for a particular frame, it retransmits all the frames after
which it does not receive any positive ACK.
Error Control
● Selective Repeat ARQ
a. Both the sender and the receiver have buffers called sending window and receiving window respectively.
b. The sender sends multiple frames based upon the sending-window size, without receiving the
acknowledgment of the previous ones.
c. The receiver also receives multiple frames within the receiving window size.
d. The receiver keeps track of incoming frame’s sequence numbers, buffers the frames in memory.
e. It sends ACK for all successfully received frames and sends NACK for only frames which are missing or
damaged.
f. The sender in this case, sends only packet for which NACK is received.
IP Datagram

● The format of data that can be recognized by IP is called


an IP datagram.
● It consists of two components,
a. Header
b. Data
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.
IPV4

● It consists of four numbers each of which can contain one


to three digits ranging from 0 to 255 separated by a single
dot(.).
● Example of an IPv4 address: 63.171.234.171
IPV4

● IPv4 datagram is a variable-length packet composed of


the header(20 bytes) and data(up to 65,536 bytes).
IPV4
IPV4

● Version: It defines the version number of IP which is 4 for


this version. Its length is 4 bits.
● Header length(HLEN): It shows the size of the header. Its
length is 4 bits.
● DSCP: It stands for a differentiated services code field. It
determines how datagram should be handled. Its length is
8 bits.
IPV4

● Total length: It tells the entire length of IP datagram. Its


length is 16 bits.
● Identification: During transmission, if the data packet is
fragmented then this field is used to allocate the same
number to each fragment and so that it can be used for
reconstructing the original packet. Its length is 16 bits.
IPV4

● Flags: It is used to handle fragmentation and it identifies


the first, middle or last fragment. Its length is 3 bits.
● Fragment offset: It represents the offset of data in the
original data stream. Its length is 13 bits.
● Time to leave(TTL): It tells the number of hops a
datagram can travel before it is abandoned. At each hop,
the value of TTL is decreased by 1 and when it reaches 0,
the packet is abandoned. Its length is 8 bits.
IPV4

● Protocol: It tells which protocol is used for data


transmitting i.e. TCP, UDP, etc. TCP has protocol number
6 and UDP has protocol number 17. Its length is 8 bits.
● Header Checksum: This is used for error-detection. Its
length is 16 bits.
● Source IP address: It has the IP address of the source.
The length is 32 bits.
IPV4

● Destination IP address: It has the address of the


destination. The length is 32 bits.
● Options: It provides more functionality to IP datagram. It
contains information like routing, timing, management, etc.
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(at least in near future).
IPV6

● It consists of eight groups of hexadecimal numbers


separated by a colon(:).
● Example of an IPv6:

adba:1925:0000:0000:0000:0000:8a2e:7334
IPV6

● IPv6 datagram is a packet composed of the base


header(40 bytes) and payload(up to 65,536 bytes)
Payload has extension header (optional) and data packet.
IPV6
IPV6

● Version: It defines the version number of IP which is 6


here. Its length is 4 bits.
● Priority: It defines the priority of the packet. Its length is 4
bits.
● Flow label: It helps in controlling the flow of data. The
source device labels to the data packets so that the router
route the packet in sequence efficiently. Its length is 24
bits.
IPV6

● Payload length: It tells the entire length of the IP datagram


except for the base header. Its length is 16 bits.
● Next header: It denotes the presence of any extension
headers or if is not present then it denotes the protocol
such as TCP or UDP.
IPV6

● Hop limit: This works similarly as TTL as in IPv4. This is


used to prohibit the data to go in an infinite loop in the
system. At each hop, the value of TTL is decreased by 1
and when it reaches 0, the packet is abandoned. Its length
is 8 bits.
IPV6

● Source address: It has the IP address of the source. The


length is 128 bits.
● Destination address: It has the IP address of the
destination. The length is 128 bits.
Classful address

● The first addressing system to be implemented as part of


the Internet Protocol was Classful Addressing.
● In the year 1981, the Classful addressing network
architecture was first used on the Internet.
● The Classful addressing system was superseded by a
Classless addressing scheme with the introduction of
Classless Inter-Domain Routing (CIDR) in 1993.
Classful address

● The IP address comprises up of 32 bits and is split into


four sections separated by dots: part 1, part 2, part 3, and
part 4.
● The IP address is made up of four parts, each of which is
eight bits long (1 byte).
● Further, the 4 parts of the IP address is divided into parts:
a network ID and a Host ID.
Classful address

● Class A, Class B, Class C, Class D, and Class E are the


five varieties of Classful addresses. In IPv4, this
classification is known as Classful addressing or IP
address classes.
Classful address

● The first three classes, Class A, B, and C, are used for


"public addressing", in which communication is always
one-to-one between source and destination. It implies that
when data is transmitted from a source, it will only be sent
to a single network host.
Classful address

● The reserved categories include Class D and Class E,


with Class D being utilized for multicast and Class E being
saved for future usage exclusively.
Classful address

● In IPv4, the Network ID is the first part of Class A, B, and


C, while the Host ID is the remaining second portion.
● The Host ID always indicates the number of hosts or
nodes in a certain network, whereas the Network ID
always identifies the network in a specific place.
● In Class A, B, and C, the address space is split into a
certain number of IP address blocks. It also specifies the
maximum number of hosts in a network.
Classful address

● Network and Host part in Classful Addressing


a. The first octet or byte of an IP address is part of the
network ID (short for Net-ID), while the next three
octets or three bytes are part of the host ID in Class A.
(in short, host-ID).
Classful address

● The network ID takes up the first two octets or two bytes


in Class B, whereas the host ID takes up the remaining
two octets or two bytes.
● In Class C, the first three octets or bytes are dedicated to
the network ID, while the last octet or byte is dedicated to
the host ID.
Classless addressing

● Classless Inter-Domain Routing (CIDR) is another name


for classless addressing.
● This addressing type aids in the more efficient allocation
of IP addresses.
Classless addressing

● This technique assigns a block of IP addresses based on


specified conditions when the user demands a specific
amount of IP addresses.
● This block is known as a "CIDR block", and it contains the
necessary number of IP addresses.
Classless addressing

● When allocating a block, classless addressing is


concerned with the following three rules.
Classless addressing

● Rule 1 − The CIDR block's IP addresses must all be


contiguous.
● Rule 2 − The block size must be a power of two to be
attractive. Furthermore, the block's size is equal to the
number of IP addresses in the block.
● Rule 3 − The block's first IP address must be divisible by
the block size.
Subnetting

● Subnetting is a process of separating a single physical


network into several logical subnetworks (subnets).
● A network segment and a host segment make up an IP
address subnets formed by extracting bits from an IP
address's host component and establishing several
smaller sub-networks within a more extensive network.
Subnetting

● Subnetting enables a business to expand its network


without securing a new network number from its Internet
Service Provider (ISP). Subnetting reduces network traffic
while also hiding network complexity.
Subnetting

● Subnetting is required when a single network number


must be distributed across multiple parts of a local area
network.
● Subnets were created to alleviate the scarcity of IP
addresses on the Internet.
Subnetting

● A subnet mask is part of every IP address. The subnet


mask known as the default subnet mask is included in all
class types. The subnet mask specifies the kind and
amount of IP addresses required for a specific local
network. The default gateway is the firewall or router.
Subnetting

● The following is the default subnet mask −


a. 255.0.0.0 is the class A address.
b. 255.255.0.0 is the class B address.
c. 255.255.255.0 is the class C address.

Subnetting

● A network administrator can subnet a single Class A,


Class B, or Class C network number into smaller portions
via subnetting. Subnets can be subnetted again to create
sub-subnets.
NAT

● We generally have two types of IP address, which are as


follows −
a. Private IP address
b. Public IP address
NAT

● Private IP address normally used in the LAN (Local area


network) side of the Network.
● Public IP address provided by the ISP is configured in the
WAN side of the network.
● Public IP addresses are always paid, while the private IP
address is free.
NAT

● Private IP addresses range as follows −


a. 192.168.0.0 - 192.168.255.255 (65,536 IP addresses)
b. 172.16.0.0 - 172.31.255.255 (1,048,576 IP addresses)
c. 10.0.0.0 - 10.255.255.255 (16,777,216 IP addresses)
NAT

● Network Address Translation (NAT)


○ Step 1 − Consider you have internet provided by
Internet Service Provider ABC.
○ Step 2 − So, they will give you connection to your
Modem. That connection we used to call WAN.
○ Step 3 − This connection is always configured with a
Public IP address.
NAT

● Network Address Translation (NAT)


○ Step 4 − Then, your LAN side of the MODEM is
configured with a Private IP address.
○ Step 5 − That means your computer or laptop
connected to the network receives a Private IP
address.
○ Step 6 − As per the standard Private IP will not
communicate with Public IP address at any Point of
time.
NAT

● Network Address Translation (NAT)


○ Step 7 − To achieve this, Private IP addresses need to
be translated to Public IP addresses with help of NAT.
○ Step 8 − In simple words, Network Address translation
is used to translate Private IP address to Public IP
address to communicate LAN side of the Device to
Global Network. Network address translation can be
processed in Router or Firewall.
NAT

● Network
Address
Translation
(NAT)
IP masquerading

● IP masquerade is the name given to one type of network


address translation that allows all of the hosts on a private
network to use the Internet at the price of a single IP
address.
IP masquerading

● IP masquerading is a process where one computer acts


as an IP gateway for a network. All computers on the
network send their IP packets through the gateway, which
replaces the source IP address with its own address and
then forwards it to the internet.
IP masquerading

● Masquerading allows an entire network of internal IP


addresses to operate through one external IP address and
masquerading allows conversion from one protocol to
another (wired/wireless).
IP masquerading

● For example, if a Linux host is connected to the Internet


via PPP, Ethernet, etc., the IP Masquerade feature allows
other "internal" computers connected to this Linux box (via
PPP, Ethernet, etc.) to also reach the Internet as well.
Linux IP Masquerading allows for this functionality even
though these internal machines don't have an officially
assigned IP address.
IP masquerading

● MASQ allows a set of machines to invisibly access the


Internet via the MASQ gateway. To other machines on the
Internet, the outgoing traffic will appear to be from the IP
MASQ Linux server itself.
IP masquerading

● In addition to the added functionality, IP Masquerade


provides the foundation to create a HEAVILY secured
networking environment. With a well built firewall,
breaking the security of a well configured masquerading
system and internal LAN should be considerably difficult to
accomplish.
IP masquerading

● The machines on
network
192.168.2.x will
obtain services
through gateway
B using IP
masquerading,
when gateway B
is setup properly.
IP masquerading

● machine S6 tries to ping


S2
● its ping packages will be
wrapped in a package
for its default gateway,
gateway B, because S6
knows by its netmask
that S2 in on another
network
IP masquerading

● When gateway B
receives the packages
from S6, it converts
them to ping packages
as though they were
sent from itself and
sends them to S2.
IP masquerading

● As far as S2 can tell,


gateway B has pinged it.
● S2 receives the
packages and responds
to gateway B.
IP masquerading

● Gateway B then
converts the packages
to be addressed to S6
and sends them.
Routing

● When a device has multiple paths to reach a destination,


it always selects one path by preferring it over others.
● This selection process is termed as Routing.
● Routing is done by special network devices called routers
or it can be done by means of software processes.
● The software based routers have limited functionality and
limited scope.
Routing

● A router is always configured with some default route.


● A default route tells the router where to forward a packet
if there is no route found for specific destination.
Routing

● In case there are multiple path existing to reach the same


destination, router can make decision based on the
following information:
● Hop Count
● Bandwidth
● Metric
● Prefix-length
● Delay
Routing

● Routes can be statically configured or dynamically


learnt. One route can be configured to be preferred
over others.
Routing

● Unicast routing
● Most of the traffic on the internet and intranets known as unicast
data or unicast traffic is sent with specified destination. Routing
unicast data over the internet is called unicast routing. It is the
simplest form of routing because the destination is already
known. Hence the router just has to look up the routing table and
forward the packet to next hop.
Routing
Routing

● Unicast routing protocol


a. Distance Vector Routing Protocol
b. Link State Routing Protocol
Routing

● Distance Vector Routing Protocol


● Distance Vector is simple routing protocol which takes routing
decision on the number of hops between source and destination. A
route with less number of hops is considered as the best route.
Routing

● Link State Routing Protocol


● Link State protocol is slightly complicated protocol than Distance
Vector. It takes into account the states of links of all the routers in a
network. This technique helps routes build a common graph of the
entire network.
Routing

● Broadcast routing
● By default, the broadcast packets are not routed and forwarded
by the routers on any network. Routers create broadcast
domains. But it can be configured to forward broadcasts in some
special cases. A broadcast message is destined to all network
devices.
Routing

Broadcast routing can be done in two ways (algorithm):

● A router creates a data packet and then sends it to each host one
by one. In this case, the router creates multiple copies of single
data packet with different destination addresses. All packets are
sent as unicast but because they are sent to all, it simulates as if
router is broadcasting.
● This method consumes lots of bandwidth and router must
destination address of each node.
Routing

Broadcast routing can be done in two ways (algorithm):

● Secondly, when router receives a packet that is to be


broadcasted, it simply floods those packets out of all interfaces.
All routers are configured in the same way.
Routing
Routing

Broadcast routing can be done in two ways (algorithm):

● This method is easy on router's CPU but may cause the problem of
duplicate packets received from peer routers.
● Reverse path forwarding is a technique, in which router knows in
advance about its predecessor from where it should receive
broadcast. This technique is used to detect and discard duplicates.
Routing

● Multicast routing
● Multicast routing is special case of broadcast routing with
significance difference and challenges. In broadcast routing,
packets are sent to all nodes even if they do not want it. But in
Multicast routing, the data is sent to only nodes which wants to
receive the packets.
Routing
Routing

● Multicast routing
● The router must know that there are nodes, which wish to receive
multicast packets (or stream) then only it should forward.
Multicast routing works spanning tree protocol to avoid looping.
● Multicast routing also uses reverse path Forwarding technique, to
detect and discard duplicates and loops.
Routing

● Multicast routing protocol


● Unicast routing protocols use graphs while Multicast routing
protocols use trees, i.e. spanning tree to avoid loops. The optimal
tree is called shortest path spanning tree.
Routing

● Multicast routing protocol


a. DVMRP - Distance Vector Multicast Routing Protocol
b. MOSPF - Multicast Open Shortest Path First
c. CBT - Core Based Tree
d. PIM - Protocol independent Multicast
Routing algorithm

● Flooding
● Flooding is simplest method packet forwarding. When a packet is
received, the routers send it to all the interfaces except the one on
which it was received. This creates too much burden on the
network and lots of duplicate packets wandering in the network.
Routing algorithm

● Shortest Path
● Routing decision in networks, are mostly taken on the basis of
cost between source and destination. Hop count plays major role
here. Shortest path is a technique which uses various algorithms
to decide a path with minimum number of hops.

You might also like