HCIA Domain 2
HCIA Domain 2
Its main protocol is the Internet Protocol (IP), which is divided into two
versions: IPv4 and IPv6.
IPv4 (Internet Protocol version 4) is the most widely used, but the transition
to IPv6 (Internet Protocol version 6) is ongoing due to IPv4 address
exhaustion.
Packet Forwarding: Routes and forwards data packets from the source to
the destination.
Each layer adds its own header to form a Protocol Data Unit (PDU):
At the Transport Layer, a TCP header is added, and the PDU is called a
segment.
Finally, the frame is converted to bits for transmission over the physical
network.
This encapsulation process ensures that the data is correctly formatted for
transmission and reception through the network.
3. Type of Service (ToS): An 8-bit field that specifies the quality of service
(QoS) for differentiated services, used in prioritizing traffic.
4. Total Length: A 16-bit field representing the total length of the IP packet,
including both the header and data.
8. Time to Live (TTL): Specifies how many hops (routers) a packet can
pass through before being discarded. Each router reduces the TTL value
by 1. When the TTL reaches 0, the packet is discarded to prevent routing
loops.
Each router the packet passes through reduces the TTL value by 1.
The destination device uses this field to determine how to process the packet
at the network layer.
Network Part (Network ID): Identifies the specific network to which a host
belongs. Devices with the same network ID are part of the same network,
regardless of their physical location.
Host Part (Host ID): Differentiates devices within the same network.
7.2 IP Addressing
The Network ID specifies the network segment (similar to a neighbourhood
address), while the Host ID specifies the individual device within that
segment.
Devices on the same network segment share the same network ID but have
different host IDs.
7.3 Gateways
Gateway: A gateway is a network device (usually a router) that forwards
data packets between different network segments. If the source and
destination devices are on different network segments, the gateway
forwards the packets to the appropriate segment.
Class A: Network ID is 8 bits, allowing for a few large networks with many
hosts (0.0.0.0–127.255.255.255).
Classes A, B, and C are the primary classes used for unicast addresses.
Broadcast Address: A special address that targets all hosts in the network
segment (e.g., 192.168.1.255).
If there are n bits for the host part, the number of IP addresses is 2^n.
Examples:
Class A: 10.0.0.0/8
Class B: 172.16.0.0–172.31.255.255/12
Class C: 192.168.0.0–192.168.255.255/16
0.0.0.0: Represents any network; used by devices that don’t yet have an IP
address to send DHCP requests.
IPv6:
11. Subnetting
Classful Addressing Limitations:
Subnetting:
With 8 host bits, the network can accommodate 2^8 = 256 IP addresses
(including the network address and broadcast address).
Subnetting involves borrowing bits from the host part of the address to
create additional subnets.
Example:
If we take 1 bit from the host part of the Class C network (originally 24
network bits), the network part becomes 25 bits, and the host part is
reduced to 7 bits.
The new subnet mask is 255.255.255.128 (or /25). This indicates that
the network part now has 25 bits.
Each subnet has 128 addresses (2^7 = 128) because there are now 7 host bits.
12. ICMP
ICMP is a protocol used in the Network Layer of the IP suite.
It is not used for carrying user data but for providing feedback about issues
encountered in the network during packet transmission. This feedback
helps improve packet forwarding efficiency.
ICMP messages vary in format based on their Type and Code fields:
Checksum: Ensures message integrity. It verifies that the message has not
been corrupted during transmission.
2. RTB checks the routing table and realizes that a better route exists
through another router, RTA, which is on the same network segment as
Host A.
This process helps optimize routing paths and reduces unnecessary hops
in the network.
Ping is a utility that sends ICMP Echo Request messages to a target host
and waits for Echo Reply messages. It measures:
It works by:
2. The first router decrements the TTL, finds it has reached 0, and sends
an ICMP TTL Timeout message back to the source.
3. The source increments the TTL to 2 and sends another packet, and the
process repeats, revealing each hop along the path.
4. By analyzing the returned ICMP messages, the source can map out the
path to the destination and calculate the round-trip time for each hop.
Routing Devices: These are network devices, such as routers, that use
routing information to forward packets to the correct destination subnet.
IP Routing Table: Routers maintain a table (IP routing table) that stores all
the necessary routes and determines how packets are forwarded. It
includes information like the destination subnet, outbound interface, and
next-hop address.
Outbound Interface: The router’s interface through which the packet will
exit.
Next Hop: The address of the next device the packet should be
forwarded to.
5. IP Routing Basics 1
4. IP Routing Table and Route-Based Forwarding
IP Routing Table: It’s a collection of routing entries that the router uses to
forward packets. The table contains only the best or optimal routes, not all
possible routes.
5. Types of Routes
Direct Routes: Automatically generated by the router for subnets directly
connected to its interfaces. When an IP packet matches a direct route, the
router directly forwards the packet to the destination host using ARP entries
(Address Resolution Protocol) to resolve the MAC address.
Cost (Metric): When multiple routes from the same protocol exist, the
router uses the route with the lowest cost as the optimal one.
For example, a static route may have a preference value of 60, while an
OSPF route may have a preference of 10. If both routes exist for the same
destination, the router will prefer the OSPF route due to its higher
preference (lower value).
5. IP Routing Basics 2
When a router receives an IP packet, it uses the longest matching
mechanism.
This ensures that the router chooses the most specific route available for
forwarding.
When using a direct route, the router checks its ARP table to find the MAC
address corresponding to the destination IP address and forwards the
packet directly.
Not all direct routes are installed in the routing table; only those interfaces
that are physically and protocol-wise up are included.
Protocol: Indicates the protocol that discovered the route (e.g., OSPF, BGP).
Preference: The preference value for selecting among routes from different
protocols.
Cost (Metric): The cost associated with the route for selecting among
routes from the same protocol.
Next Hop: The IP address of the next device to which the packet should be
forwarded.
5. IP Routing Basics 3
any IP packets that don’t match any other routing entries.
Application Scenarios: Default routes are typically used at the egress (exit)
points of networks, such as the edge routers of an enterprise network. For
instance, an egress router in an enterprise might have a default route
pointing to the ISP, allowing the router to forward traffic destined for any
external network.
A. By Algorithm
Distance-Vector Routing Protocols: These use distance (hop count) and
direction (next hop) to determine the best route. Examples:
5. IP Routing Basics 4
B. By Application Scope
Interior Gateway Protocols (IGPs): Operate within a single AS. Examples
include RIP, OSPF, and IS-IS.
C. Floating Routes
Floating Routes: These are backup routes that only become active when
the primary route fails. They are configured with a higher preference value
(lower priority) than the primary route.
B. Route Summarization
5. IP Routing Basics 5
Overview: It is a technique where specific routes with the same prefix are
aggregated into a single summarized route. This reduces the number of
entries in the routing table and improves device resource utilization.
B. Black-Hole Routes
When summarizing routes, the router might use a Null0 interface as the
outbound interface. The Null0 interface is a logical interface that discards
packets, preventing them from being forwarded further. This is used to
prevent routing loops by acting as a "black hole" where packets are
dropped.
Ensure that the summary route covers only the intended specific routes
and does not include any unrelated routes.
By ensuring accurate summarization, you can optimize the routing table without
causing packet loss or misrouting.
5. IP Routing Basics 6
6. OSPF Basics
The information typically includes the destination network and the cost
(usually measured in hops or another metric) to reach it.
Drawbacks:
Convergence (the time it takes for routers to update their routing tables)
can be slow.
Prone to routing loops; protocols like RIP use techniques such as split
horizon and count to infinity to mitigate these problems.
Each router generates its LSAs, which include details such as:
6. OSPF Basics 1
The cost associated with the interface.
Neighbor relationships.
These LSAs are flooded throughout the network, ensuring that every
router in the network has the same view of the network topology.
Instead of just sharing distance information, BGP also includes the path
(i.e., the sequence of AS hops) to reach a destination network.
2. LSA Flooding:
The SPF algorithm calculates a loop-free tree with the router itself as
the root, ensuring the most efficient routes are identified.
6. OSPF Basics 2
Based on the SPF calculation, each router generates and updates its
routing table, installing the best routes to all networks within the
topology.
Advantages:
OSPF routers exchange link status information rather than routes, which is
crucial for building the network topology and calculating optimal paths.
OSPF routers collect and store link status information in the Link-State
Database (LSDB).
2. Areas:
6. OSPF Basics 3
3. Router ID:
It's important to ensure that each OSPF router within an area has a
unique Router ID.
4. Cost Values:
OSPF uses cost as a metric to determine the best route. The cost is
calculated based on the interface bandwidth:
DefaultCost = (100Mbit/s)/(InterfaceBandwidth)
3. Link State Request (LSR): Requests specific LSAs from a neighbor after
DD packets have been exchanged.
You can view the neighbor table using the display ospf peer command,
which shows router IDs and interface addresses of neighbours.
6. OSPF Basics 4
2. Link-State Database (LSDB):
The LSDB contains LSAs generated by the router itself and received
from neighbours.
The command display ospf lsdb allows you to query the LSDB and view
these details.
This table is separate from the overall router's routing table and
contains OSPF-specific routes.
The command display ospf routing displays the OSPF routing table,
showing routes learned through OSPF.
Routers within the same area maintain a consistent view of the topology,
while routers in different areas communicate through Area Border Routers
(ABRs).
4. OSPF Working
4.1 OSPF Router Relationships
OSPF routers form two key types of relationships:
1. Neighbor Relationship:
6. OSPF Basics 5
This is the initial step where routers recognize each other’s
presence and form a neighbor relationship.
2. Adjacency:
1. Neighbor Establishment:
If the Hello packet lists the router's ID, it moves to the 2-way state,
indicating that bidirectional communication is established.
2. Master/Slave Negotiation:
3. LSDB Exchange:
4. LSA Exchange:
6. OSPF Basics 6
Once both routers have identical LSDBs, the state changes to Full,
completing the adjacency establishment.
MTU, Priority, and other information like the retransmission interval and
authentication sequence.
1. Point-to-Point (P2P):
Only two devices are connected (e.g., PPP links). Default for
interfaces using PPP encapsulation.
Allows multiple devices but does not support broadcast (e.g., Frame
Relay networks).
4. Point-to-Multipoint (P2MP):
6. OSPF Basics 7
In multi-access (MA) networks, such as Ethernet, the number of OSPF
adjacencies can become excessive if each router forms an adjacency with
every other router. This can increase LSA flooding and overload devices.
Only the DR and BDR form adjacencies with all routers in the network
segment.
Other routers (DRothers) maintain a 2-way state with each other but do
not form full adjacencies.
Election rules:
If priorities are equal, the router with the higher router ID is elected.
The election is non-preemptive (once elected, DR/BDR do not
change unless they fail).
2. Single-Area OSPF:
Suitable for small networks. All routers reside in the same area, meaning
LSDB synchronization occurs network wide.
3. Multi-Area OSPF:
6. OSPF Basics 8
The backbone area (Area 0) connects all other areas, preventing inter-
area loops.
Advantages:
2. Area Border Router (ABR): Interfaces span multiple areas, with at least
one interface in the backbone area.
3. Backbone Router: Has at least one interface in the backbone area (Area
0).
Non-Backbone Areas: All other areas that must connect to the backbone
area.
6. OSPF Basics 9