CN Unit 3 Imp Q
CN Unit 3 Imp Q
1. Classful Addressing: In classful addressing, the IP address space is divided into five fixed classes: A, B,
C, D, and E. The first few bits of the IP address determine the class, and each class has a predefined range of
addresses.
IP Classes:
Class A:
o Range: 0.0.0.0 to 127.255.255.255
o First Octet: 1 to 127 (1st bit is 0)
o Network Bits: 8, Host Bits: 24
o Example: 10.0.0.1 (Private IP address range: 10.0.0.0/8)
Class B:
o Range: 128.0.0.0 to 191.255.255.255
o First Octet: 128 to 191 (1st 2 bits are 10)
o Network Bits: 16, Host Bits: 16
o Example: 172.16.0.1 (Private IP address range: 172.16.0.0/12)
Class C:
o Range: 192.0.0.0 to 223.255.255.255
o First Octet: 192 to 223 (1st 3 bits are 110)
o Network Bits: 24, Host Bits: 8
o Example: 192.168.1.1 (Private IP address range: 192.168.0.0/16)
Class D: Used for multicast (224.0.0.0 to 239.255.255.255)
Class E: Reserved for research (240.0.0.0 to 255.255.255.255)
Limitation:
2. Classless Addressing (CIDR - Classless Inter-Domain Routing): Classless addressing eliminates the
rigid boundaries of classful addressing by allowing flexible assignment of IP addresses based on prefix
length (subnet mask). The network portion of the address is determined by the subnet mask, which can be
any length.
Key Features:
192.168.10.0/28: This means the first 28 bits represent the network part, leaving 4 bits for hosts. The
subnet can accommodate 16 IP addresses (2^4), but only 14 usable IPs (since the first address is
reserved for the network and the last for broadcast).
Efficient Use of IP Space: No predefined classes; addresses are allocated based on actual needs.
More Flexibility: ISPs can assign IP blocks of various sizes.
VLSM (Variable-Length Subnet Masking): Allows different subnet masks for different networks
within the same IP range.
Comparison:
This method of addressing has helped optimize the use of IP addresses, especially with the shortage of IPv4
addresses.
2.Explain with the help of examples how IP packets are forwarded in the network.
IP packet forwarding is the process of transferring packets from one network to another to reach their
destination. Routers play a crucial role in forwarding packets by using routing tables and protocols to
determine the best path for each packet.
1. Packet Creation:
o When a source device (e.g., a computer) wants to send data to a destination, it creates an IP
packet. This packet contains source and destination IP addresses, data, and other header
information.
2. Source Network Check:
o The packet first checks if the destination IP is within the same local network. If it is, the
packet is directly delivered to the destination.
3. Router Involvement:
o If the destination IP is on a different network, the packet is forwarded to the default gateway
(router). The router examines the destination IP and forwards the packet based on its routing
table.
4. Routing Table Lookup:
o The router consults its routing table, which contains information about different networks
and the best path to reach them.
o The routing table has:
Destination Network
Next Hop (address of the next router)
Metric (cost associated with reaching that network, e.g., distance, time)
5. Next Hop Decision:
o Based on the routing table, the router forwards the packet to the next hop (another router or
destination network).
6. Packet Forwarding:
o Each router the packet passes through follows the same process—checking its routing table,
deciding the next hop, and forwarding the packet.
7. Arrival at Destination:
o The packet keeps getting forwarded through routers until it reaches the destination network.
o When the packet arrives at the final router, it is delivered to the appropriate device based on
its IP address.
Let’s consider a packet being sent from Computer A (IP: 192.168.1.2) in Network 1 to Computer B (IP:
10.0.0.5) in Network 2.
1. Computer A sends a packet with destination IP 10.0.0.5. The packet is forwarded to the default
gateway (Router 1) because 10.0.0.5 is not in the same network.
2. Router 1 receives the packet, checks its routing table, and sees that to reach Network 2
(10.0.0.0/24), it needs to forward the packet to Router 2.
3. Router 2 receives the packet, checks its routing table, and sees that Network 2 (10.0.0.0/24) is
directly connected. It forwards the packet to the destination Computer B.
Source: 192.168.1.2
Destination: 10.0.0.5
Default Gateway (Router 1): 192.168.1.1
Next Hop (Router 2): Based on Router 1’s routing table
Final Destination: Computer B (IP: 10.0.0.5)
Benefits of IP Forwarding:
Efficient Delivery: Ensures that packets reach their destination across different networks.
Scalability: Supports large-scale networks, enabling packets to be routed through multiple paths.
Reliability: Routing tables and dynamic protocols ensure packets find the best and most reliable
path.
In summary, IP packet forwarding is a fundamental process that allows devices in different networks to
communicate by forwarding data packets through routers and across the internet.
3.Explain the Routing Information Protocol Message format and Algorithm
Routing Information Protocol (RIP) Message Format and Algorithm
Routing Information Protocol (RIP) is a distance-vector routing protocol used in local and wide area
networks. It is one of the simplest routing protocols and employs a hop count as a routing metric.
RIP uses a standardized message format to share routing information between routers. The structure of a RIP
message consists of the following fields:
2. RIP Algorithm
RIP uses the following algorithm to determine the best path to a destination:
Distance Vector Algorithm: RIP utilizes a distance vector algorithm to determine the best route. Each router
maintains a routing table with information about the distance (in hops) to each destination network.
1. Initialization:
o Each router starts with a routing table containing the known networks and their corresponding
distances (initially set to infinity for unknown routes).
2. Periodic Updates:
o Routers periodically send RIP update messages (every 30 seconds) to their neighbors, sharing their
routing tables.
3. Distance Calculation:
o When a router receives an update from a neighbor, it checks if the new route offers a shorter path
(lower metric) to a destination. If it does, the router updates its routing table with the new distance and
next-hop information.
4. Counting to Infinity:
o If a router detects that a route has become unreachable (for example, if the hop count exceeds 16), it
sets the metric to 16, indicating that the destination is unreachable.
5. Convergence:
o The routing tables of all routers converge to a consistent state, where all routers have the same
information about the network topology.
Key Features of RIP Algorithm:
Hop Count Metric: RIP uses hop count as the primary metric, with a maximum limit of 15 hops. A
count of 16 is considered unreachable.
Triggered Updates: In addition to periodic updates, RIP can send triggered updates when there is a
change in the routing table, allowing for faster convergence.
Split Horizon and Poison Reverse: Techniques used to prevent routing loops. Split horizon
prohibits a router from advertising a route back to the router from which it learned it. Poison reverse
sends an update indicating that the route is unreachable (metric set to 16).
Summary
In conclusion, the Routing Information Protocol (RIP) uses a simple message format to exchange routing
information and a distance vector algorithm to determine the best path to destinations based on hop count.
While it is easy to configure and use, RIP is limited in terms of scalability and can be slow to converge in
larger networks.
4.Answer the following questions related to the FSMs for the Go-back-N
protocol with m = 6 bits. Assume the window size is 63. a. The sending
machine is in the blocking state with Sf=14 and Sn=21. What is the size of
the window? b. The sending machine is in the blocking state with Sf 14 and
Sn = 21. An ACK with ackNo 18 arrives. What are the next values of Sf and
Sn? What is the state of the sending machine?
To analyze the Go-Back-N (GBN) protocol with a 6-bit sequence number, let’s break down the problem step
by step.
In Go-Back-N, the size of the window can be calculated using the following formula:
Where mmm is the number of bits used for the sequence number.
Current State:
o Sf=14S_f = 14Sf=14 (first unacknowledged packet)
o Sn=21S_n = 21Sn=21 (next packet to be sent)
1. Receiving ACK:
An ACK with ackNo = 18 indicates that all packets up to packet 17 have been successfully received.
2. Update Sending Variables:
In Go-Back-N, if the ACK is for a packet that is less than SfS_fSf, it doesn't affect SfS_fSf or
SnS_nSn.
If the ACK is greater than or equal to SfS_fSf and less than SnS_nSn, SfS_fSf can be updated to the
acknowledged packet number (in this case, ackNo = 18).
Since SfS_fSf is currently 14 and the ACK is for 18, the first unacknowledged packet is now 18.
Therefore:
Sf=18S_f = 18Sf=18
The next packet to send SnS_nSn is updated to Sf+Window SizeS_f + \text{Window Size}Sf
+Window Size:
The sending machine transitions to a non-blocking state if there are packets available to be sent
within the window size. Since packets up to 17 have been acknowledged, and the next packet to send
is now 19, the sending machine will be in the non-blocking state.
Summary of Results
Link: https://chatgpt.com/share/66ff1b95-7560-800f-a31f-395e2e459168
Definition: Dense mode routing is designed for networks where multicast group members are
densely located. It operates by initially flooding the multicast traffic throughout the network and then
pruning branches without receivers.
Examples: Protocol Independent Multicast - Dense Mode (PIM-DM).
Definition: SSM allows receivers to subscribe to multicast streams from a specific source,
improving control over data flow and reducing unnecessary traffic. It provides a one-to-many
communication model where the source is known, and only those sources are allowed to send data to
the group.
Examples: Internet Group Management Protocol Version 3 (IGMPv3) supports SSM.
Definition: RPF is a technique used to determine the shortest path for multicast packet forwarding. It
relies on the principle that multicast packets should arrive at the receiver from the same interface
used to reach the source. This helps prevent loops and ensures efficient routing.
Applications: Used in protocols like PIM-DM and PIM-SM.
Definition: ASM allows multicast receivers to receive packets from any sender that is part of the
multicast group. This means multiple sources can send packets to the same multicast group address.
Examples: Traditionally used in applications like streaming media.
DVMRP (Distance Vector Multicast Routing Protocol): Uses a distance vector approach and is
suitable for small networks. It implements reverse path forwarding and supports dense mode.
MOSPF (Multicast OSPF): An extension of the OSPF protocol to support multicast routing. It
works well in OSPF areas and uses link-state information to distribute multicast group membership.
Conclusion
Multicast routing protocols can be broadly classified based on their operational modes and efficiency,
whether they are designed for dense or sparse networks, and how they handle the routing of packets from
specific sources or any source within a multicast group. Understanding these different types helps in
designing efficient multicast networks tailored to specific application needs.
Open Shortest Path First (OSPF)
Overview: Open Shortest Path First (OSPF) is a widely used interior gateway protocol (IGP) for routing
Internet Protocol (IP) packets within a single routing domain. OSPF is a link-state routing protocol that
enables routers to exchange information about their links and compute the shortest path to each network
node using Dijkstra's algorithm.
1. Link-State Protocol:
o OSPF routers maintain a database that describes the topology of the network. Each router
creates a Link State Advertisement (LSA) that is flooded throughout the area.
o Routers use this database to construct a complete map of the network and calculate the
shortest path to each destination.
2. Hierarchical Design:
o OSPF supports a hierarchical network design, which can be divided into areas. The backbone
area (Area 0) connects to other areas, improving scalability and efficiency.
o This structure helps in reducing the size of routing tables and limits the scope of route
updates.
3. Cost Metric:
o OSPF uses a cost metric to determine the best path. The cost is typically based on the
bandwidth of the links, with lower-cost paths preferred.
o Each interface can be assigned a cost, allowing for flexible routing decisions based on
network design.
4. Fast Convergence:
o OSPF converges quickly due to its use of link-state updates and efficient algorithm for path
calculation. This minimizes downtime in the event of network changes.
5. Support for Classless Routing:
o OSPF supports Classless Inter-Domain Routing (CIDR), allowing for the use of variable-
length subnet masking (VLSM) and providing efficient use of IP address space.
6. Authentication:
o OSPF can be configured to use authentication to ensure the integrity and authenticity of
routing updates. This prevents unauthorized routers from participating in the OSPF process.
7. Multipath Support:
o OSPF can load-balance traffic across multiple equal-cost paths, allowing for efficient
utilization of network resources.
1. Hello Packets:
o Used to discover neighbors and establish adjacency. They carry information about the router's
state and the parameters for OSPF communication.
2. Database Description (DBD) Packets:
o Summary of the contents of the link-state database. Used during the initial exchange of link-
state information.
3. Link State Request (LSR) Packets:
o Request specific LSAs from a neighbor.
4. Link State Update (LSU) Packets:
o Carry the actual LSAs and inform neighboring routers of topology changes.
5. Link State Acknowledgment (LSAck) Packets:
o Acknowledge the receipt of LSUs to ensure reliable communication.
Example Scenario:
In an enterprise network with multiple routers, OSPF enables efficient communication and routing. When a
new router is added or a link fails, OSPF quickly recalculates the shortest path to each destination and
updates the routing tables across the network.
Conclusion:
OSPF is a robust and efficient routing protocol that adapts to the needs of complex networks. Its features,
including hierarchical design, fast convergence, and support for classless addressing, make it a preferred
choice for many organizations. OSPF's ability to dynamically adjust to network changes ensures reliable and
optimal routing in a wide range of environments.
DHCP Process:
The DHCP process involves a series of steps that occur when a client device connects to the network:
1. DHCP Discover:
o The client broadcasts a DHCP Discover message on the network to find available DHCP
servers.
2. DHCP Offer:
o One or more DHCP servers respond with a DHCP Offer message, providing an available IP
address and configuration parameters.
3. DHCP Request:
o The client selects one of the offers and broadcasts a DHCP Request message to inform the
selected server of its acceptance of the offered IP address.
4. DHCP Acknowledgment:
o The DHCP server sends a DHCP Acknowledgment (ACK) message to the client, confirming
the IP address assignment and providing additional configuration information.
Benefits of DHCP:
1. Ease of Management:
o DHCP simplifies network administration by automating IP address assignment, reducing
manual configuration errors.
2. Scalability:
o DHCP can easily accommodate changes in network size, enabling the addition or removal of
devices without manual reconfiguration.
3. Efficient IP Address Utilization:
o With DHCP, IP addresses are reused based on demand, optimizing address allocation in
environments with many devices.
4. Centralized Configuration:
o DHCP allows centralized management of network configurations, making it easier to update
settings across multiple devices.
DHCP Components:
1. DHCP Server:
o The server is responsible for managing the IP address pool and responding to client requests.
2. DHCP Client:
o Any device that requests an IP address from the DHCP server (e.g., computers, smartphones,
printers).
3. DHCP Relay Agent:
o A network device that forwards DHCP messages between clients and servers when they are
not on the same local network segment.
Example Scenario:
In a corporate environment, when an employee connects their laptop to the network, the DHCP process
occurs seamlessly. The laptop broadcasts a Discover message, the DHCP server responds with an Offer, the
laptop requests the offer, and the server acknowledges it. The employee can then access the network without
manually configuring IP settings.
Conclusion:
DHCP is a critical protocol for managing IP address allocation in dynamic networks. Its ability to automate
configuration tasks, improve efficiency, and enhance network scalability makes it an essential component of
modern networking. By reducing manual errors and administrative overhead, DHCP simplifies the process
of connecting devices to a network, ensuring smooth operation and connectivity.