Fon Unit 3 Qa
Fon Unit 3 Qa
What is IPv4?
IPv4 (Internet Protocol version 4) is the system used to assign unique addresses to
devices (like computers, phones, or routers) on a network. It uses a 32-bit address,
which is broken down into four numbers (called "octets"), each ranging from 0 to
255.
For example:
192.168.1.1 is an IPv4 address.
Each number (e.g., 192) is called an octet and can range from 0 to 255.
These addresses are used to identify devices on a local network or the internet.
For medium-sized
Class 128.0.0.0 to networks (e.g.,
255.255.0.0
B 191.255.255.255 universities)
For broadcasting
Class 224.0.0.0 to data to multiple
Multicast
D 239.255.255.255 devices (multicast)
Reserved for
Class 240.0.0.0 to research and
Experimental
E 255.255.255.255 future use
What is Subnetting?
Subnetting is a way of dividing a larger network into smaller, more manageable
parts, called subnets. It’s like breaking a big city into smaller neighborhoods.
Subnetting helps with:
Efficient use of IP addresses: Makes better use of available IPs.
Improved performance: Reduces network congestion by organizing devices into sub-
networks.
Better security: Isolates parts of the network, so if one part gets attacked, it doesn’t
affect the whole network.
CIDR Notation:
CIDR (Classless Inter-Domain Routing) is a shorthand way to represent an IP address
and its subnet mask. Instead of writing the full subnet mask, you write the number
of bits used for the network part.
For example:
192.168.1.0/24 means:
o The IP address is 192.168.1.0, and the network part uses the first 24 bits of
the address (which is the subnet mask 255.255.255.0).
Key Takeaways:
IPv4 Address: A unique 32-bit address used to identify devices on a network (e.g.,
192.168.1.1).
Subnet Mask: A tool used to separate the network part and host part of an IP
address (e.g., 255.255.255.0).
Subnetting: The process of dividing a larger network into smaller sub-networks (or
subnets), helping improve address usage and network organization.
CIDR Notation: A shorthand way of writing an IP address and its subnet mask (e.g.,
192.168.1.0/24).
Network Classes: IPv4 addresses are grouped into classes (A, B, C, etc.) to suit
different network sizes.
Address
32 bits (4 bytes) 128 bits (16 bytes)
Length
Written as four
Written as eight groups of four hexadecimal
Address decimal numbers
digits separated by colons (e.g.,
Format separated by dots
2001:0db8:85a3:0000:0000:8a2e:0370:7334)
(e.g., 192.168.1.1)
Dotted Decimal
Address Hexadecimal notation (e.g.,
Notation (e.g.,
Notation 2001:0db8::1)
192.168.1.1)
Manual or via
DHCP (Dynamic
Auto-configuration (Stateless Address
Configuration Host
Autoconfiguration) or DHCPv6
Configuration
Protocol)
More complex
routing due to
Routing Simplified routing with no need for NAT
network address
translation (NAT)
Security is
optional, typically
Security is built-in with mandatory IPsec
Security provided by
support
applications or via
IPsec
Performed by
Only performed by the sender (routers
Fragmentation both sender and
do not fragment)
routers
Feature IPv4 IPv6
Supports
broadcasting (e.g.,
Does not support broadcasting; uses
Broadcasting sending to all
multicast and anycast instead
devices in a
network)
Uses subnet
Subnetting masks (e.g., Uses prefix length notation (e.g., /64)
255.255.255.0)
Unicast,
Address Types Broadcast, Unicast, Multicast, Anycast
Multicast
Slower due to
network address
translation (NAT) Faster due to simplified header format
Performance
and more and no need for NAT
complex header
structure
Not compatible
with IPv6 Not directly compatible with IPv4
Backward
(requires (requires tunneling or dual-stack
Compatibility
tunneling or dual- systems)
stack systems)
Used by devices to find the MAC Used by devices to find their own
Usage address of another device on the IP address when they know only
local network using its IP address. their MAC address.
Modern Still widely used in all local Obsolete. Replaced by DHCP for
Usage networks (LANs). automatic IP address assignment.
Destination Unreachable Sent when a packet can't reach its destination (e.g., host
(Type 3) or network is unreachable).
When a device first connects to the network, it doesn't have an IP address. It sends out a
DHCP Discover message, asking, "Hey, is there a server out there that can give me an IP
address?"
DHCP Discover: A message asking the network for help to get an IP address.
Now, the laptop can use the network with its new IP address.
7. Compare distance vector routing and link-state
routing protocols.
Feature Distance Vector Routing Link-State Routing
Key Differences
o Distance Vector: Prone to slow error detection and recovery (e.g., routing
loops).
o Link-State: More robust with faster error detection and recovery due to the
complete network view.
RIP (Routing Information Protocol) is a protocol used by routers to figure out how to
send data packets to different destinations in a network. It helps routers decide the best
path for data based on the number of hops (routers) it takes to get from one router to
another. The main goal of RIP is to help routers build their routing tables and share
information about the network.
Purpose of RIP
The main job of RIP is to find the shortest path to a destination, measured in hops.
Hop Count: A hop is one router that a data packet passes through. Each router in the
path counts as one hop. RIP tries to find the route with the least number of hops.
Maximum Hop Count: RIP limits the number of hops to 15. If a destination is more
than 15 hops away, RIP will consider it unreachable.
How RIP Works
RIP is a distance-vector routing protocol, which means that each router shares its entire
routing table with neighboring routers. Here's how RIP works step-by-step:
When a router is first set up, it doesn't know anything about the network. So, it sends
out a message called a RIP Request to its neighbors to ask, "What are the best routes
you know about?"
2. Sharing Updates
Every 30 seconds, RIP routers send routing updates to their neighbors. These updates
contain a list of routes to different destinations and how many hops it takes to get there.
This helps all routers keep their routing tables updated.
RIP Update: This message includes a list of destinations and how far they are in hops.
When a router receives an update from a neighbor, it compares the routes it knows
about with the new information. If the update shows a shorter route (fewer hops) to a
destination, the router will update its table.
Example: If Router A knows that Network B is 3 hops away but Router C tells it that
Network B is only 2 hops away, Router A will update its table to use Router C as the
next hop.
4. Loop Prevention
To avoid data packets endlessly going in circles (loops) between routers, RIP uses a few
methods:
Split Horizon: A router won’t send a route back to the router it learned it from.
Route Poisoning: If a router learns that a route is down (unreachable), it marks the
hop count as 16 (meaning unreachable) and sends this information to its neighbors.
Hold-down Timers: These prevent a router from accepting a bad route too quickly
after it becomes invalid.
5. Timers in RIP
RIP uses timers to control how often it sends updates and how long it waits before
considering a route invalid:
Update Timer: RIP sends updates every 30 seconds.
Invalid Timer: If a route isn’t updated for 180 seconds, it’s considered invalid and
removed from the routing table.
Flush Timer: After a route is invalid, it is completely removed after 240 seconds.
RIP Versions
There are two versions of RIP:
RIP v1: This version is classful, meaning it doesn’t send subnet mask information,
which makes it less flexible in modern networks.
RIP v2: This version is classless, meaning it supports more flexible IP addressing,
including subnet masks, and is better suited for modern networks.
Advantages of RIP
1. Simple and Easy: RIP is easy to configure and understand, making it a good choice for
small to medium-sized networks.
2. Low Resource Use: It doesn’t need much processing power, which is good for older
or less powerful devices.
3. Widely Supported: Almost all routers support RIP, so it's compatible with a wide
variety of devices.
Limitations of RIP
1. Limited Scalability: RIP only supports 15 hops, so it’s not ideal for large networks.
2. Slow to React: If there’s a network change (like a router going down), RIP can take a
while to update its routes.
3. Potential Loops: Despite mechanisms to prevent loops, RIP can still sometimes get
stuck in a loop if the network is misconfigured.
4. Wasteful of Bandwidth: Since RIP sends updates even if nothing has changed, it can
use up unnecessary bandwidth.
Network Flat (all routers exchange full Hierarchical (divided into areas
Structure routing tables) to reduce overhead)
Summary:
RIP is simple and works well in smaller networks but is limited in scalability and has
a slow convergence time.
OSPF is more suitable for larger and more complex networks because it is scalable,
has faster convergence, supports hierarchical network designs, and provides more
efficient routing.
o Local Preference: A way to prefer one route over another within the same AS.
o Multi-Exit Discriminator (MED): Used when multiple routes exist to the same
destination and helps choose one path over another.
4. Routing Decisions:
o When a BGP router has multiple paths to the same destination, it uses these
path attributes to decide the best route. It's like choosing the best road to a
destination based on factors like distance, tolls, and road conditions.
BGP routers send updates about new routes, changes to existing routes, or removed
routes.
These updates help the other routers in the AS (or across ASes) know about changes
in the network, such as a route becoming unavailable.
7. Loop Prevention:
BGP uses AS Path to prevent routing loops. A router will reject a route if it sees its
own AS number in the AS Path (because that means the route has come back to it).
BGP also uses Route Reflectors and Confederations to make the process more
efficient, especially within large ASes.
2. Router in AS 65001 sends a BGP advertisement to its peer in AS 65002, saying: “To
reach 10.1.1.0/24, use this path (through AS 65001, then AS 65002)”.
3. If AS 65001 knows multiple ways to reach 10.1.1.0/24, it will compare attributes like
the AS Path, Local Preference, and MED to choose the best route.
4. After selecting the best route, Router in AS 65001 advertises it to other routers in the
same AS via iBGP.
5. Other routers in AS 65001 use this updated route to forward traffic to 10.1.1.0/24.
Unicast routing is a type of communication where data is sent from one source device
(like a computer or server) to one specific destination device. It's the most common and
basic way data is transferred on the internet.
3. Direct Delivery: The file takes a specific path to reach your friend's computer without
any other devices in the network receiving the file.
Why is Unicast Routing Important?
1. Most Common Communication:
o Unicast is used in almost all online activities. For example, when you visit a
website, send an email, or download a file, your computer is sending data
using unicast routing.
o Protocols like TCP/IP, HTTP, FTP all use unicast to make sure data goes
directly from one device to another.
2. Efficiency:
o With unicast, only the device you're sending data to receives it. This keeps the
communication simple and direct.
o The network resources are used efficiently because no extra devices are
involved in the transfer.
3. Control and Reliability:
o Unicast gives you more control over how data flows. For example, if you use
TCP (Transmission Control Protocol), it ensures that the data is delivered
correctly and can be retransmitted if lost.
o File transfers or web browsing rely on unicast because these require reliable
data delivery.
4. Scalability:
o Unicast can scale well for large networks. As the data travels from the source
to the destination, routers use routing tables to find the best path for the
data to follow.
o It works efficiently even as the size of the network grows. Unlike broadcast
(sending data to everyone) or multicast (sending data to a group), unicast
only sends the data to the intended device.
5. Security:
o Since the data is only sent to the intended recipient, unicast is safer than
broadcasting the same data to all devices. You can protect the communication
with firewalls or encryption to keep it secure.
6. No Network Interference:
o Since data is sent to one specific device, it doesn't create unnecessary load
on other devices in the network. Only the target device processes the data,
unlike multicast or broadcast, which can cause congestion.
Quick Summary:
Where it’s used Web browsing, email, file transfers, voice calls.
o Routers in between the source and destination use the IP address to forward
packets toward the right path, ensuring that the data reaches the correct
destination.
3. Data Delivery:
Importance of IP in Networking:
1. Global Connectivity:
o IP provides the system for global addressing. It allows devices from all over
the world to communicate with each other, enabling the internet's vast reach.
o Every device connected to the internet needs a unique IP address to ensure
communication.
2. Enables Communication:
o Without IP, devices would not know where to send data. It makes
communication between computers, websites, email servers, and other
online services possible.
3. Facilitates Routing:
o IP allows routers (devices that direct traffic on the network) to forward data
packets correctly across vast networks and between different networks.
o Routers use IP addresses to determine where the data should go and how
best to get it there, even if the data needs to cross multiple networks.
4. Scalability:
o IP is designed to support millions of devices and networks, which is crucial as
more and more devices (e.g., smartphones, IoT devices) are added to the
internet.
5. Foundational to Other Protocols:
o Many other protocols, such as TCP (Transmission Control Protocol), UDP (User
Datagram Protocol), HTTP, and DNS, build on top of IP. IP handles the
addressing and routing part, while these protocols manage how data is sent
or what actions are taken once the data arrives.
Types of IP:
1. IPv4:
o IPv4 uses a 32-bit address to identify devices (e.g., 192.168.1.1).
IP in Action:
Imagine you're sending an email:
Function Role of IP
Foundation for Other Serves as the base for other higher-layer protocols like
Protocols TCP, HTTP, DNS.
When we subnet a network, we're splitting up the host portion to create smaller
networks. This helps make better use of available IP addresses and makes the network
easier to manage.
4. Easier Management:
o By splitting a network into subnets, network administrators can manage
smaller, logical groups of devices instead of dealing with one large network.
4. Subnet Mask: This number tells the network where the network portion ends and
the host portion begins. It's written in dotted decimal format like 255.255.255.0.
Subnetting Formula
To determine the number of subnets or hosts per subnet, you can use these formulas:
Number of Subnets:
Subnets=2number of borrowed bits\text{Subnets} = 2^{\text{number of borrowed
bits}}Subnets=2number of borrowed bits
Number of Hosts per Subnet:
Hosts per Subnet=2number of host bits−2\text{Hosts per Subnet} = 2^{\text{number of
host bits}} - 2Hosts per Subnet=2number of host bits−2
(We subtract 2 for the network and broadcast addresses, which can't be assigned to
devices.)
Step 3: The new subnet mask becomes /27 (or 255.255.255.224), which gives 32 IP
addresses per subnet (30 usable).
Quick Summary of Subnetting
Term Explanation
Defines which part of the IP address is the network and which part
Subnet Mask
is the host.
Network
The first address in a subnet, used to identify the subnet itself.
Address
Broadcast The last address in a subnet, used to send messages to all devices
Address in the subnet.
This table summarizes the key improvements that IPv6 brings to address the issues and
limitations faced by IPv4, ensuring a more scalable, efficient, and secure internet
infrastructure.
ARP/RARP
ARP Request and ARP Reply RARP Request and RARP Reply
Message Type
Summary of Differences:
1. ARP maps an IP address to a MAC address, helping devices communicate at the data
link layer by resolving the physical address needed to deliver packets.
2. RARP maps a MAC address to an IP address, typically used by devices that don't
have an IP address set (like diskless workstations) to find their IP address at boot
time. However, RARP is mostly outdated and replaced by DHCP.
Destination Unreachable
Sent when a packet cannot reach its destination.
(Type 3)
Parameter Problem (Type Sent when there's a problem with the IP header (e.g.,
12) incorrect options).
2. Traceroute Example:
o You run the traceroute www.example.com command to find out the path
taken by packets to reach the website.
o Traceroute shows each router (hop) along the path, and how long each hop
takes.
o If there's a delay or failure at a specific hop, you can pinpoint where the
problem is in the network.
Feature Details
Common Diagnostic Ping (ICMP Echo Request/Reply) and Traceroute (ICMP Time
Tools Exceeded).
Step Action
The device sends out a message (called a DHCP Discover) asking the
1. Discover
network, "Hey, I need an IP address!"
The DHCP server replies with an offer of an IP address and other network
2. Offer
details like the subnet mask, gateway, and DNS.
The device chooses one offer and sends a message back to the server
3. Request
saying, "I want to use this IP address!"
4. The DHCP server confirms the IP address and gives the device permission to
Acknowledge use it, along with all the network settings.
2. DHCP Client: This is the device requesting an IP address (like your computer,
smartphone, or printer).
3. IP Address Pool: A range of available IP addresses that the server can give out to
clients. Think of this as a pool of available numbers.
4. Lease Time: The amount of time a device can keep the IP address assigned to it. After
the lease time expires, the device must renew or ask for a new IP.
Default Gateway: Tells devices how to access other networks (e.g., the
internet).
Once a device gets an IP address, it doesn’t "own" the IP forever. It gets the IP for a
limited time (called the lease time).
Lease Renewal: Before the lease expires, the device can ask the server to renew the
IP for more time.
Lease Expiration: If the device disconnects for too long, the IP address goes back into
the pool and can be given to another device.
IP addresses are given out dynamically and reused, making sure all
Efficient Use of IPs
IPs are used efficiently.
Easy Network One central server handles all the IP assignments, making network
Management management simpler.
DHCP works well for both small and large networks, handling lots
Scalability
of devices easily.
Summary:
Feature Explanation
What is
A protocol that automatically assigns IP addresses to devices on a network.
DHCP?
This information is flooded to all routers in the OSPF network so everyone has a complete
map of the network.
4. Repeat: This process repeats until all routers have been visited, and the router has
calculated the shortest path to every other router.
The result is a Shortest Path Tree (SPF Tree), which tells the router the most efficient
(lowest-cost) path to each destination.
Links with higher bandwidth (faster speeds) have a lower cost, making them more attractive
to OSPF when selecting the shortest path.
4. Cost Metric: OSPF uses link bandwidth to calculate costs, preferring faster links with
lower costs.
5. SPF Tree: The router builds a Shortest Path Tree (SPF Tree) to find the best path to all
destinations.
Summary:
Step Action
1. Link-State Exchange Routers share information about their connections and costs.
2. LSDB Creation Each router builds a network map (LSDB) based on the LSAs.
3. Dijkstra’s Algorithm OSPF runs Dijkstra’s algorithm to find the shortest paths.
5. SPF Tree and Routing OSPF creates an SPF Tree and fills the routing table with the
Table best paths.
19. What are the key features of BGP, and how does it
support inter-domain routing?
Key Features of BGP and How It Supports Inter-Domain Routing
BGP (Border Gateway Protocol) is the protocol used to exchange routing information
between different autonomous systems (ASes) on the internet. It is an inter-domain or inter-
AS routing protocol, meaning it helps routers on different networks (domains) communicate
with each other to determine the best paths for data traffic between them. Unlike interior
gateway protocols (IGPs) like OSPF or EIGRP, which work within a single domain, BGP
operates between different networks or domains.
Here’s a breakdown of the key features of BGP and how it supports inter-domain routing:
1. Inter-Domain Routing (AS-level Routing):
Autonomous Systems (ASes): The internet is made up of independent networks,
each known as an autonomous system (AS). An AS is a collection of IP networks and
routers under the control of a single organization, typically an ISP (Internet Service
Provider) or large enterprise.
Inter-domain Routing: BGP is the protocol that enables routing between these
different ASes, which is known as inter-domain routing. Each AS can control its own
routing decisions and policies, and BGP allows them to communicate with other
ASes.
4. Scalability:
Handles Large Networks: BGP is designed to scale well for large networks like the
internet, where thousands of ASes are interconnected. It can efficiently handle
thousands of routes and maintain a stable, scalable routing environment, which is
essential for inter-domain routing.
5. Path Selection and Best Path Calculation:
Multiple Paths: BGP can maintain multiple paths to the same destination. It uses a
variety of attributes to determine the best path to use for traffic forwarding. These
attributes include:
o AS Path: The number of ASes that the route has passed through.
o Next Hop: The next router to reach the destination.
o Local Preference: A value that indicates the preferred path within an AS.
o MED (Multi-Exit Discriminator): A value used to prefer one path over another
when multiple entry points to an AS exist.
o Origin: The origin of the route (e.g., IGP, EGP).
o Weight: A Cisco-specific attribute used to prioritize routes on a specific router.
Best Path Selection: When multiple routes to the same destination exist, BGP
compares these attributes to choose the best path.
6. Loop Prevention:
AS Path Attribute: BGP uses the AS path attribute to prevent routing loops. Each
time a BGP router advertises a route, it appends its own AS number to the AS path. If
a router receives a route that contains its own AS number in the AS path, it will reject
that route, preventing the possibility of a loop.
7. BGP is Connection-Oriented:
TCP-Based: BGP runs over TCP (Transmission Control Protocol), using port 179 for
communication between routers. This ensures a reliable, connection-oriented
session between BGP routers, which is essential for maintaining stability in large-
scale networks.
Session Maintenance: BGP routers exchange routing information using BGP sessions,
which are maintained over a long period, allowing for efficient and reliable routing
updates.
EBGP (External BGP): Used to exchange routing information between different ASes.
It is used for inter-domain routing across the internet.
IBGP (Internal BGP): Used to exchange routing information within the same AS.
Routers inside an AS use IBGP to share routing information without passing it outside
the AS.
Feature Explanation
BGP tracks the AS path to prevent loops and helps choose the
Path Vector Protocol
best path.
Reliable and Connection- BGP uses TCP to establish and maintain stable, reliable routing
Oriented sessions between routers.
Routing Based on BGP selects the best route using a combination of attributes such
Multiple Attributes as AS path, MED, local preference, and weight.
Routers send updates only when Routers send periodic updates with
there is a change in the network their entire routing table at regular
Updates
(triggered by changes in the intervals, even if there are no
topology). changes.
Calculates the shortest path to each Calculates the best path based on the
Path
destination using link costs (based distance (metric) advertised by
Calculation
on bandwidth, for example). neighbors (e.g., hop count in RIP).
More efficient because updates are Less efficient due to regular, periodic
Efficiency of
sent only when a change occurs, not updates even if no changes have
Updates
at regular intervals. occurred.
Feature Link-State Routing Protocols Distance-Vector Routing Protocols
Summary:
Link-State protocols like OSPF are more efficient and scalable in larger networks, as
they have a complete view of the network and converge faster.
Distance-Vector protocols like RIP are simpler, but they converge more slowly and
are better suited for smaller, stable networks.