Pages

Showing posts with label unit 3. Show all posts
Showing posts with label unit 3. Show all posts

Tuesday, 19 November 2024

Transition from IPv4 to IPv6

The transition from IPv4 to IPv6 is necessary because IPv4 addresses are running out. IPv6 provides a larger address space (128 bits compared to IPv4's 32 bits). However, transitioning between the two protocols is not straightforward, as they are not directly compatible. Therefore, multiple techniques are used to make this transition smooth and gradual.

Key Points:

  1. Why Transition?

    • IPv4 supports about 4.3 billion unique addresses, which is insufficient due to the growing number of devices (phones, computers, IoT).
    • IPv6 uses 128-bit addresses, providing 340 undecillion unique addresses, which is practically unlimited.
  2. Transition Techniques: The key methods used for the transition are:

    • Dual Stack: Both IPv4 and IPv6 run on the same devices, allowing communication over both protocols.
    • Tunneling: IPv6 packets are encapsulated in IPv4 packets to travel over an IPv4 network.
    • NAT64: Allows IPv6-only devices to communicate with IPv4-only devices.

Example of Dual Stack Transition:

Scenario: A company is transitioning its internal network from IPv4 to IPv6. Initially, they have a server with an IPv4 address: 192.168.1.10.

Step 1: The company configures their server to support both IPv4 and IPv6 (dual stack). The server now has two addresses:

  • IPv4 address: 192.168.1.10
  • IPv6 address: 2001:0db8:85a3::10

Step 2: During the transition, users with IPv6-capable devices can access the server using the IPv6 address (2001:0db8:85a3::10), while users with only IPv4 devices will still access the server using the IPv4 address (192.168.1.10).

Step 3: Over time, more devices in the network are upgraded to IPv6. Eventually, the company phases out IPv4, and only IPv6 is used.

Benefits:

  • Coexistence: Dual stack allows both IPv4 and IPv6 to coexist, so there is no disruption in service during the transition.
  • Gradual Migration: The company can continue using IPv4 while gradually shifting to IPv6.

IPv6 Addressing

IPv6 Addressing is the system used to assign unique identifiers to devices on an IPv6-based network. IPv6 (Internet Protocol version 6) was developed to replace IPv4 (Internet Protocol version 4) due to the limited number of available IPv4 addresses. IPv6 provides a much larger address space and is designed to address the growing need for internet-connected devices.
Key Points:
IPv6 Address Structure:
An IPv6 address is a 128-bit number, divided into eight 16-bit blocks, each represented as four hexadecimal digits (0-9, A-F).
The general format of an IPv6 address is written as 8 groups of 4 hexadecimal digits separated by colons. For example:
2001:0db8:85a3:0000:0000:8a2e:0370:7334
Example:
2001:0db8:85a3:0000:0000:8a2e:0370:7334
Abbreviating IPv6 Addresses:
Leading Zeros: In each 16-bit block, leading zeros can be omitted. For example, 0001 can be written as 1.
Consecutive Blocks of Zeros: A series of consecutive blocks of zero can be replaced with ::, but this can only be done once in an address.
Example:
Full address: 2001:0db8:0000:0000:0000:0000:0000:0020
Abbreviated: 2001:0db8::20
Types of IPv6 Addresses:
Unicast: Refers to a one-to-one communication between a single sender and a single receiver. Example: 2001:0db8::1.
Multicast: Refers to one-to-many communication, where data is sent from one sender to multiple receivers. Example: FF00::/8.
Anycast: Refers to one-to-nearest communication, where data is sent to the nearest device in a group. Example: 2001:0db8::/32.
Global and Link-Local Addresses:
Global Unicast Addresses (GUAs): These are globally routable addresses similar to public IPs in IPv4. They are assigned by an address allocation authority and can be routed across the internet. Example: 2001:0db8::/32
Link-Local Addresses: These are used for communication within a local network (link) and are not routable beyond the local network. They start with the prefix fe80::/10. Example: fe80::1
IPv6 Address Prefixes:
Subnet Prefix: Like IPv4, IPv6 networks are divided into subnets using a prefix. For example, 2001:0db8:1234::/48 specifies a subnet of IPv6 addresses.
Subnet Mask: The prefix length (after the /) indicates the size of the network. For example, /64 is the most common subnet size for IPv6 networks, indicating the first 64 bits are used for network addressing.
IPv6 Addressing Example:
Scenario: A company uses IPv6 for its internal network. The company has been allocated the block 2001:0db8:abcd::/48 by their ISP.
Global Unicast Address: An address like 2001:0db8:abcd:0001::1 can be assigned to a server, which is globally reachable.
Link-Local Address: A computer in the same network might have the address fe80::1, which is used for communication within the local network but cannot be routed across the internet.
Multicast Address: A multicast address such as FF02::1 is used to communicate with all devices on the local network.

Traffic shaping

Traffic Shaping is a technique used to control the flow of data in a network to ensure smooth, consistent, and predictable transmission of packets. It is typically applied in the network layer to prevent congestion and to optimize bandwidth usage. The goal of traffic shaping is to smooth out bursts of traffic and ensure that the network resources are used efficiently, preventing packet loss and delays.









Key Points:
  • Definition and Purpose:
  • Traffic shaping involves delaying packets to ensure that they conform to a defined traffic profile, typically by regulating the data transmission rate.
  • The main purpose of traffic shaping is to control data flow, prevent congestion, and ensure fair usage of bandwidth by all users or applications.
  • It is commonly used to smooth out bursty traffic, which might otherwise overwhelm the network, especially when the data rate exceeds the available bandwidth.
How Traffic Shaping Works:
  • Buffers and Queues: Traffic shaping uses buffers or queues to temporarily store packets that cannot be sent immediately. These packets are released gradually based on the allowed data rate.
  • Rate Limiting: Traffic shaping defines a maximum allowable transmission rate, ensuring that data is transmitted at a constant rate over time, preventing sudden traffic bursts.
  • Traffic Profiles: The traffic is usually shaped to conform to a profile, which defines how much data can be sent during certain time intervals (e.g., bytes per second).
Techniques Used:
  • Token Bucket: The Token Bucket algorithm is often used for traffic shaping. Tokens are added to a "bucket" at a fixed rate, and a packet can only be sent if there is a token available in the bucket. If no tokens are available, the packet is delayed or discarded.
  • Leaky Bucket: The Leaky Bucket algorithm ensures that data is sent at a constant rate, and any excess traffic is discarded. It smooths out traffic, preventing bursts.
  • Policing and Shaping: Traffic policing drops packets that exceed a set rate, while shaping may buffer and delay packets to conform to the allowed rate.
Example of Traffic Shaping:
  • Scenario: Traffic Shaping in a Corporate Network
  • Imagine a corporate network that connects employees to the internet and internal servers. The network is shared by multiple departments, and certain applications (like video conferencing and VoIP) require guaranteed bandwidth to function properly without delays or quality degradation.
How Traffic Shaping Works:
  • The network administrators set up traffic shaping rules that prioritize VoIP and video traffic because these applications require low latency and high reliability.
  • During peak hours, employees may also be downloading large files, which causes bursts of traffic that can cause congestion and affect the quality of real-time communications like VoIP.
  • Traffic Shaping Policy: The shaping policy ensures that large file downloads are delayed or throttled. For instance, non-essential file downloads might be limited to a maximum rate of 2 Mbps, while VoIP traffic is allowed a higher priority with 5 Mbps to maintain quality.
  • Buffering and Delaying Traffic: The network equipment (e.g., routers or traffic shaping devices) temporarily buffers the excess packets from the file downloads and releases them at a controlled rate to avoid sudden spikes.
Outcome:
  • Smooth Data Flow: The network traffic is controlled to prevent congestion, and large file downloads do not overwhelm the network, allowing critical services like VoIP to function smoothly.
  • Improved Performance: By smoothing out bursty traffic, traffic shaping ensures that all applications receive the necessary bandwidth and that latency-sensitive services (e.g., video conferencing) remain unaffected.
  • Fair Resource Allocation: All departments and users get a fair share of the available bandwidth, ensuring that no single user or service consumes all the resources.

Load shedding

Load Shedding in the network layer refers to the practice of selectively discarding packets when the network or device is overwhelmed by too much traffic. The purpose of load shedding is to prevent network congestion and ensure system stability by reducing the load, thus avoiding complete failure or a significant drop in performance.

Key Points:
Definition and Purpose:

  • Load shedding is a congestion control technique used to reduce the volume of traffic when a network or device (like a router or switch) cannot process all incoming packets due to overload.
  • It aims to maintain the overall network performance and prevent system crashes or excessive delays by prioritizing important data and discarding lower-priority traffic.
How Load Shedding Works:

  • When a network or device becomes congested, it may drop less important packets while prioritizing high-priority traffic, such as real-time communications (VoIP) or critical data.
  • Load shedding can be applied based on different policies:
  • Selective Packet Dropping: Some packets are discarded based on certain criteria (e.g., traffic type or priority).
  • Priority Queuing: Higher-priority packets are processed first, and lower-priority packets are dropped or delayed.
Techniques Used:

  • Congestion Awareness: Devices monitor the load and buffer usage to detect when they are near capacity, triggering load shedding.
  • Random Early Detection (RED): A technique where devices start dropping packets before the queue is completely full to signal congestion early.
  • Priority Scheduling: Ensures that high-priority traffic (e.g., emergency services or VoIP) is handled even during congestion.
Example of Load Shedding in the Network Layer:

  • Scenario: Load Shedding in a Router during Network Congestion
  • Imagine a router in a large corporate network that handles traffic for both internal communications and internet access. The router is designed to handle up to 1 Gbps of data, but during certain peak times, such as the start of the workday, traffic spikes to 1.5 Gbps due to increased usage from employees.
How Load Shedding Works:

  • As the router’s buffer fills up and congestion builds, it detects that it can no longer handle all the incoming packets efficiently.
  • To prevent network delays or a complete system failure, the router drops less important packets, such as non-urgent email data or large file transfers.
  • The router can apply Selective Packet Dropping where low-priority traffic (like background file transfers) is discarded, while high-priority packets (such as VoIP calls or video conferencing data) are kept and processed to ensure that real-time communications are not disrupted.
  • Random Early Detection (RED) can also be employed. The router starts dropping packets early (before the buffer is full), signaling to the source devices to slow down the transmission rate, preventing more serious congestion later.
Outcome:
  • Network Stability: The router prevents overload and ensures that essential traffic continues to flow smoothly without significant delays or packet loss.
  • Fair Resource Allocation: By shedding low-priority traffic, it ensures that the most important services (e.g., VoIP or critical business applications) are given priority during peak times.
  • Improved User Experience: Users experience minimal disruption in important services like voice calls or video conferencing, while non-critical services experience some delay or packet loss.

Traffic-Aware Routing

Let’s consider a network with four routers: A, B, C, and D, connected as follows:
Network Topology:
A ↔ B: Link with 10 ms delay (low traffic).
A ↔ C: Link with 20 ms delay (moderate traffic).
B ↔ D: Link with 15 ms delay (low traffic).
C ↔ D: Link with 30 ms delay (high traffic).

Scenario:
Router A needs to send data to Router D.Without traffic awareness, the routing algorithm might choose the A → C → D path, as it’s statically predefined or appears shortest initially.

Step-by-Step Traffic-Aware Routing Example
1. Real-Time Traffic Monitoring:
The network monitors the current traffic on each link:
A → B: Low traffic (10 ms delay).
A → C: Moderate traffic (20 ms delay).
B → D: Low traffic (15 ms delay).
C → D: High traffic (30 ms delay).

2. Dynamic Path Calculation:
The routing algorithm evaluates available paths:
Path 1: A → B → D
Total delay = 10 ms (A → B) + 15 ms (B → D) = 25 ms.
Path 2: A → C → D
Total delay = 20 ms (A → C) + 30 ms (C → D) = 50 ms.
Based on traffic conditions, the algorithm selects Path 1 (A → B → D) as it has lower total delay.

3. Traffic Redistribution:
The routing system directs data from A to D via B instead of the congested link via C.

Final Routing Decision:
Path Chosen: A → B → D
Reason: Lower delay due to less traffic.

Benefits in this Example:
Reduced Latency:
The data packet reaches D faster through the less congested path.

Efficient Resource Utilization:
Traffic on the overloaded C → D link is minimized.

Improved User Experience:
Applications dependent on low latency (e.g., video conferencing) function smoothly.

Real-Life Example:
In the Google Cloud Platform, traffic-aware routing is implemented to redirect user traffic across the least congested data centers. If one data center experiences high traffic or failures, the system dynamically reroutes traffic to another, ensuring fast and reliable service.

Monday, 18 November 2024

Approaches to Congestion Control

Congestion control refers to techniques used to prevent or alleviate network congestion, where too much data overwhelms network resources, leading to degraded performance.

1. Open-Loop Congestion Control
  • Definition: Proactive methods that prevent congestion before it occurs.
Key Features:
  • Policies are set at the start of the connection.
  • Does not rely on feedback from the network.

Examples:
  • Traffic Shaping:Controls the rate of data transmission (e.g., Leaky Bucket and Token Bucket algorithms).
  • Admission Control:Limits the number of users or data flows entering the network.
  • Resource Reservation:Allocates bandwidth and buffers in advance.
2. Closed-Loop Congestion Control
  • Definition: Reactive methods that detect and mitigate congestion after it occurs.
Key Features:
  • Relies on feedback mechanisms to adjust traffic dynamically.
Examples:
  • Backpressure:A congested node signals upstream nodes to reduce data transmission rates.
  • Choke Packets:Special packets are sent to the sender to slow down the data rate.
  • Explicit Congestion Notification (ECN):A mechanism in IP networks where routers mark packets to indicate congestion.
  • Load Shedding:Drops low-priority packets to free up resources for critical traffic.
3. End-to-End Congestion Control
  • Definition: The endpoints (sender and receiver) handle congestion control without relying on the intermediate network.
Key Features:
  • Common in TCP/IP networks.
Examples:
  • TCP Congestion Control:Includes mechanisms like Slow Start, Congestion Avoidance, Fast Retransmit, and Fast Recovery.
  • Rate Control:Adjusts the sending rate based on acknowledgment (ACK) feedback.
4. Quality of Service (QoS)-Based Approaches
  • Definition: Prioritizes traffic and manages resources to avoid congestion.
Key Features:
  • Ensures critical traffic like voice or video is less affected by congestion.
Examples:
  • Prioritization:Assigns priority levels to different types of data.
  • Bandwidth Allocation:Allocates fixed bandwidth to specific flows or applications.
Summary Table:

Network Layer in the Internet

The Network Layer in the Internet is responsible for enabling communication between devices on different networks. It is the third layer in the OSI model and the Internet Protocol Suite (TCP/IP).

Functions of the Network Layer
Logical Addressing:
  • Assigns unique IP addresses to devices.
  • Provides a global identification system for devices on the network (IPv4 or IPv6).
Routing:
  • Determines the best path for data packets to travel from the source to the destination.
  • Utilizes routing algorithms and protocols (e.g., OSPF, BGP).
Packet Forwarding:
  • Forwards data packets across routers in the network until they reach their destination.
Fragmentation and Reassembly:
  • Breaks large data packets into smaller fragments for transmission and reassembles them at the destination.
Error Handling:
  • Identifies errors in packet delivery and triggers corrective actions.
Key Protocols at the Network Layer
Internet Protocol (IP):
  • Core protocol for addressing and routing packets.
  • Versions: IPv4 (32-bit address) and IPv6 (128-bit address).
ICMP (Internet Control Message Protocol):
  • Used for error reporting and diagnostic tasks (e.g., ping, traceroute).
ARP (Address Resolution Protocol):
  • Resolves IP addresses to MAC addresses in a local network.
NAT (Network Address Translation):
  • Maps private IP addresses to public IPs for Internet communication.
Features of the Network Layer
Connectionless Communication:
  • Uses datagrams that are sent independently without establishing a prior connection.
End-to-End Delivery:
  • Ensures packets reach their intended destination.
Scalability:
  • Supports large networks with hierarchical addressing.
Example:
When you load a website, the Network Layer:
  • Assigns an IP address to your device and to the website server.
  • Routes the data packets through multiple routers across the Internet.
  • Ensures the packets are correctly delivered to the destination.

Internetworking

Internetworking refers to the process of connecting multiple computer networks together to form a larger network, enabling communication and resource sharing across diverse systems. The resulting interconnected network is known as an internetwork, which can span local, regional, or global scales.
The most prominent example of an internetwork is the Internet, which connects millions of private, public, academic, business, and government networks worldwide.
Key Components of Internetworking
Routers:
  • Devices that connect different networks and manage the flow of data between them.
  • Use routing protocols (e.g., OSPF, BGP) to determine the best paths for data transmission.
Switches:
Operate within a local network to connect devices and facilitate data forwarding.
Often used alongside routers in internetworks.

Gateways:
Devices or software systems that translate protocols between different types of networks.

Protocols:
Common sets of rules used to ensure communication between networks, such as:
  • IP (Internet Protocol): Assigns addresses and routes packets between networks.
  • TCP (Transmission Control Protocol): Ensures reliable data transfer.
  • UDP (User Datagram Protocol): Provides faster, less reliable transfer.
  • HTTP, FTP, and SMTP: Higher-level protocols for web access, file transfer, and email.
Addressing:
Each device in an internetwork must have a unique identifier (e.g., an IP address) to facilitate communication.

Network Devices:
Bridges: Connect similar networks at the data-link layer.
Hubs: Basic devices that connect multiple Ethernet devices.

Types of Internetworking

LAN-to-LAN Internetworking:
Connecting two or more Local Area Networks (LANs).
Example: A university connecting multiple campus networks.

LAN-to-WAN Internetworking:
Connecting a LAN to a Wide Area Network (WAN).
Example: A business network connecting to the Internet.

Enterprise Internetworking:
Integrating multiple internal networks within an organization for unified operation.

Global Internetworking:
Networks on a global scale, such as the Internet.

Challenges in Internetworking
Compatibility:Different networks may use different hardware, protocols, or standards.

Scalability:Maintaining performance as the network grows in size and complexity.

Security:Protecting data across interconnected networks requires robust security measures.

Address Management:Managing unique addresses for all devices in a large network (e.g., IPv4 vs. IPv6).

Benefits of Internetworking
Resource Sharing:Enables users to access shared printers, servers, and databases across networks.

Communication:Facilitates email, file transfer, video conferencing, and other forms of digital communication.

Scalability:Allows networks to grow without needing to replace infrastructure.

Cost-Effectiveness:Reduces the need for duplication of resources across networks.

Friday, 15 November 2024

Design Issues in Network Layer

The network layer or layer 3 of the OSI (Open Systems Interconnection) model is concerned delivery of data packets from the source to the destination across multiple hops or links. It is the lowest layer that is concerned with end − to − end transmission. 

The design issues can be elaborated under four heads −
  1. Store and Forward Packet Switching
  2. Services to Transport Layer
  3. Providing Connection Oriented Service
  4. Providing Connectionless Service
1. Store and Forward Packet Switching
The host sends the packet to the nearest router. This packet is stored there until it has fully arrived once the link is fully processed by verifying the checksum then it is forwarded to the next router till it reaches the destination. This mechanism is called “Store and Forward packet switching.”
2.Services to Transport Layer
Through the network/transport layer interface, the network layer transfers its patterns services to the transport layer. These services are described below. But before providing these services to the transfer layer, the following goals must be kept in mind:
  • Offering services must not depend on router technology.
  • The transport layer needs to be protected from the type, number, and topology of the available router.
  • The network addresses for the transport layer should use uniform numbering patterns, also at LAN and WAN connections.
3.Providing Connection Oriented Service
Packets are termed as “datagrams” and corresponding subnets as “datagram subnets”. When the message size that has to be transmitted is 4 times the size of the packet, then the network layer divides into 4 packets and transmits each packet to the router via. a few protocols. Each data packet has a destination address and is routed independently irrespective of the packets.
4.Providing Connectionless Service
To use a connection-oriented service, first, we establish a connection, use it, and then release it. In connection-oriented services, the data packets are delivered to the receiver in the same order in which they have been sent by the sender.

Thursday, 15 August 2024

Subnetting


 
Question: How many networks and valid hosts for the given IP 192.168.10.0/25
Given IP :11000000.10101000.00001010.00000000
Subnet   :11111111.11111111.11111111.10000000
-----------------------------------------------------------
Network ID
NID : 192.168.10.0

Broadcast ID
BID : 192.168.10.127

Valid Host ID
VHID : 192.168.10.1 to 192.168.10.126

To Find the Number of Bits in 
Network ID :24
Subnet ID :1
Host ID :7

Number of Networks = 2^n where n no of network bits
                               =2^1
                               =2

Number of Valid Hosts = 2^h - 2 where h no of host bits
                                 =2^7 - 2
                                 =128 - 2
                                 =126

N/w NO

NETWORK ID

HOST ADDRESS

BROADCAST ID

1

192.168.10.0

192.168.10.1 - 192.168.10.126

192.168.10.127

2

192.168.10.128

192.168.10.129 - 192.168.10.254

192.168.10.255

Experimental set up of subnetting using Cisco Packet Racer:

Question: How many networks and valid hosts for the given IP 172.16.0.0/19
Given IP :10101100.00010000.00000000.00000000
Subnet   :11111111.11111111.11100000.00000000
-----------------------------------------------------------
Network ID
NID : 172.16.0.0

Broadcast ID
BID : 172.16.31.255

Valid Host ID
VHID : 172.16.0.1 to 172.16.31.254

To Find the Number of Bits in 
Network ID :16
Subnet ID :3
Host ID :13

Number of Networks = 2^n
                               =2^3
                               =8

Number of Valid Hosts = 2^h - 2
                                 =2^13 - 2
                                 =8192 - 2
                                 =8190

N/w NO

NETWORK ID

HOST ADDRESS

BROADCAST ID

1

172.16.0.0

172.16.0.0 - 172.16.31.254

172.16.31.255

2

172.16.32.0

172.16.32.1 - 172.16.63.254

172.16.63.255

3

172.16.64.0

172.16.64.1 - 172.16.95.254

172.16.95.255

4

172.16.96.0

172.16.96.1 – 172.16.127.254

172.16.127.255

5

172.16.128.0

172.16.128.1 – 172.16.159.254

172.16.159.255

6

172.16.160.0

172.16.160.1 – 172.16.191.254

172.16.191.255

7

172.16.192.0

172.16.192.1 – 172.16.223.254

172.16.223.255

8

172.16.224.0

172.16.224.1 – 172.16.255.254

172.16.255.255


Practice Questions
Question #1
What is the range of assignable IP addresses for a subnet containing an IP
address of 172.16.1.10 /19?
a. 172.16.0.1 – 172.16.31.254
b. 172.16.0.1 – 172.16.63.254
c. 172.16.0.0 – 172.16.31.255
d. 172.16.0.1 – 172.16.31.255
e. 172.16.0.0 – 172.16.63.254
Answer: a
To determine the subnets, assignable IP address ranges, and directed broadcast
addresses created by the 19-bit subnet mask we perform the following steps:

Step #1: Identify the interesting octet (i.e. the octet that contains the first zero in
the binary subnet mask).In this question, we have a 19-bit subnet mask, which is written in binary as:
11111111 11111111 11100000 00000000
The interesting octet is the third octet, because the third octet (i.e. 11100000) is the first octet to contain a 0 in the binary.

Step #2: Identify the decimal value in the interesting octet of the subnet mask.
A 19-bit subnet mask can be written in dotted decimal notation as: 255.255.224.0 Since the third octet is the interesting octet, the decimal value in the interesting octet is 224.

Step #3: Determine the block size by subtracting the decimal value of the interesting octet from 256. Block Size = 256 – 224 = 32

Step #4: Determine the subnets by counting by the block size in the interesting octet, starting at 0. Placing a zero in the first interesting octet identifies the first subnet as: 172.16.0.0 /19
We then count by the block size (of 32) in the interesting octet (the third octet in
this question) to determine the remaining subnets:
172.16.32.0 /19
172.16.64.0 /19
172.16.96.0 /19
172.16.128.0 /19
172.16.160.0 /19
172.16.192.0 /19
172.16.224.0 /19

Step #5: Identify the subnet address, the directed broadcast address, and the
usable range of addresses. Looking through the subnets created by the 19-bit subnet mask reveals that the IP address of 172.16.1.10 resides in the 172.16.0.0 /19 subnet. The directed broadcast address, where all host bits are set to a 1, is 1 less than the next subnet address. The next subnet address is 172.16.32.0. So, the directed broadcast address for the 172.16.0.0 /19 subnet is 1 less than 172.16.32.0, which is:172.16.31.255 The usable IP addresses are all the IP addresses between the subnet address and the directed broadcast address. Therefore, in this example, the assignable IP address range for the 172.16.0.0 /19 network is: 172.16.0.1 – 172.16.31.254

Question #2
You are assigning IP addresses to hosts in the 192.168.4.0 /26 subnet. Which two of the following IP addresses are assignable IP addresses that reside in that subnet?
a. 192.168.4.0
b. 192.168.4.63
c. 192.168.4.62
d. 192.168.4.32
e. 192.168.4.64
Answer: c and d
To determine subnets and usable address ranges created by the 26-bit subnet
mask we perform the following steps:

Step #1: Identify the interesting octet (i.e. the octet that contains the first zero in
the binary subnet mask).In this question, we have a 26-bit subnet mask, which is written in binary as:
11111111 11111111 11111111 11000000
The interesting octet is the forth octet, because the forth octet (i.e. 11000000) is
the first octet to contain a 0 in the binary.

Step #2: Identify the decimal value in the interesting octet of the subnet mask.
A 26-bit subnet mask can be written in dotted decimal notation as:
255.255.255.192
Since the forth octet is the interesting octet, the decimal value in the interesting
octet is 192.

Step #3: Determine the block size by subtracting the decimal value of the
interesting octet from 256.
Block Size = 256 – 192 = 64

Step #4: Determine the subnets by counting by the block size in the interesting
octet, starting at 0.
Placing a zero in the first interesting octet identifies the first subnet as:
192.168.4.0 /26
We then count by the block size (of 64) in the interesting octet (the forth octet in
this question) to determine the remaining subnets:
192.168.4.64 /26
192.168.4.128 /26
192.168.4.192 /26

Step #5:
This question is asking about the 192.168.4.0 /26 subnet. From the above list of
subnets, we can determine that the assignable range of IP addresses for this subnet is 192.168.4.1 – 192.168.4.62. We can also determine that 192.168.4.0 is the network address, and 192.168.4.63 is the directed broadcast address. From the assignable range of IP addresses we have calculated, we can determine that the two assignable IP addresses given as options in this question are: 192.168.4.62 and 192.168.4.32.

Question #3
A host in your network has been assigned an IP address of 192.168.181.182 /25.
What is the subnet to which the host belongs?
a. 192.168.181.128 /25
b. 192.168.181.0 /25
c. 192.168.181.176 /25
d. 192.168.181.192 /25
e. 192.168.181.160 /25
Answer: a
To determine subnets and usable address ranges created by the 25-bit subnet
mask we perform the following steps:

Step #1: Identify the interesting octet (i.e. the octet that contains the first zero in
the binary subnet mask). In this question, we have a 25-bit subnet mask, which is written in binary as: 11111111 11111111 11111111 10000000
The interesting octet is the forth octet, because the forth octet (i.e. 10000000) is the first octet to contain a 0 in the binary.

Step #2: Identify the decimal value in the interesting octet of the subnet mask. A 25-bit subnet mask can be written in dotted decimal notation as:
255.255.255.128 Since the forth octet is the interesting octet, the decimal value in the interesting octet is 128.

Step #3: Determine the block size by subtracting the decimal value of the
interesting octet from 256. Block Size = 256 – 128 = 128

Step #4: Determine the subnets by counting by the block size in the interesting octet, starting at 0. Placing a zero in the first interesting octet identifies the first subnet as:192.168.181.0 /25 We then count by the block size (of 128) in the interesting octet (the forth octet in this question) to determine the remaining subnets, or in this case just a single additional subnet. 192.168.181.128 /25 Now that we have our two subnets identified, we can determine the subnet in which the IP address of 192.168.181.182 resides. Since the usable range of IP addresses for the 192.168.181.128 /25 network is 192.168.181.129 – 192.168.181.254 (because 192.168.181.128 is the network address, and 192.168.181.255 is the directed broadcast address), and since 192.168.181.182 is in that range, the subnet to which 192.168.181.182 /25 belongs is: 192.168.181.128 /25

Question #4
You are working with a Class B network with the private IP address of 172.16.0.0 /16. You need to maximize the number of broadcast domains, where each broadcast domain can accommodate 1000 hosts. What subnet mask should you use?
a. /22
b. /23
c. /24
d. /25
e. /26
Answer: a
In addition to testing your knowledge of subnetting, this question is also making sure you understand that a subnet is a broadcast domain. This should not be confused with a collision domain (i.e. each port on a switch is in its own collision domain). To determine how many host bits are required to support 1000 hosts, we can create a table from the following formula:
Number of Hosts = 2h – 2, where h is the number of host bits
From this formula, we can create the following table:
1 Host Bit => 0 Hosts
2 Host Bits => 2 Hosts
3 Host Bits => 6 Hosts
4 Host Bits => 14 Hosts
5 Host Bits => 30 Hosts
6 Host Bits => 62 Hosts
7 Host Bits => 126 Hosts
8 Host Bits => 254 Hosts
9 Host Bits => 510 Hosts
10 Host Bits => 1022 Hosts
This table tells us that a subnet with 10 host bits will accommodate the requirement of 1000 hosts. If we have 10 host bits, then we have a 22-bit subnet mask (i.e. 32 – 10 = 22). Also, by not using more host bits than we need, we are maximizing the number of subnets that can be created.

Question #5
What is the directed broadcast address of a subnet containing an IP address of
172.16.1.10 /19?
a. 172.16.15.255
b. 172.16.31.255
c. 172.16.255.255
d. 172.16.95.255
e. 172.16.0.255
Answer: b
To determine the subnets, assignable IP address ranges, and directed broadcast addresses created by the 19-bit subnet mask we perform the following steps:

Step #1: Identify the interesting octet (i.e. the octet that contains the first zero in
the binary subnet mask). In this question, we have a 19-bit subnet mask, which is written in binary as:
11111111 11111111 11100000 00000000 The interesting octet is the third octet, because the third octet (i.e. 11100000) is the first octet to contain a 0 in the binary. 

Step #2: Identify the decimal value in the interesting octet of the subnet mask.
A 19-bit subnet mask can be written in dotted decimal notation as: 255.255.224.0
Since the third octet is the interesting octet, the decimal value in the interesting
octet is 224.

Step #3: Determine the block size by subtracting the decimal value of the
interesting octet from 256.
Block Size = 256 – 224 = 32

Step #4: Determine the subnets by counting by the block size in the interesting
octet, starting at 0. Placing a zero in the first interesting octet identifies the first subnet as:172.16.0.0 /19 We then count by the block size (of 32) in the interesting octet (the third octet in this question) to determine the remaining subnets:
172.16.32.0 /19
172.16.64.0 /19
172.16.96.0 /19
172.16.128.0 /19
172.16.160.0 /19
172.16.192.0 /19
172.16.224.0 /19

Step #5: Identify the subnet address, the directed broadcast address, and the
usable range of addresses. Looking through the subnets created by the 19-bit subnet mask reveals that the IP address of 172.16.1.10 resides in the 172.16.0.0 /19 subnet. The directed broadcast address, where all host bits are set to a 1, is 1 less than the next subnet address.The next subnet address is 172.16.32.0. So, the directed broadcast address for the 172.16.0.0 /19 subnet is 1 less than 172.16.32.0, which is: 172.16.31.255
The usable IP addresses are all the IP addresses between the subnet address and the directed broadcast address. Therefore, in this example, the assignable IP address range for the 172.16.0.0 /19 network is:
172.16.0.1 – 172.16.31.254

Question #6
A customer is using a Class C network of 192.168.10.0 subnetted with a 28-bit
subnet mask. How many subnets can be created by using this subnet mask?
a. 32
b. 16
c. 30
d. 8
e. 14
Answer: b
The subnet in this question is a Class C network, because there is a 192 in the first octet. A class C network has a natural mask of 24 bits. However, this network has a 28-bit subnet mask. Therefore, we have 4 borrowed bits, which are network bits added to a network’s natural mask (i.e. 28 – 24 = 4).
The number of subnets can be calculated as follows:
Number of Subnets = 2s, where s is the number of borrowed bits.
Therefore, in this question, the number of created subnets is 16:
Number of Subnets = 2^4 = 16

Question #7
Given a subnet of 172.16.56.0 /21, identify which of the following IP addresses
belong to this subnet. (Select 2.)
a. 172.16.54.129
b. 172.16.62.255
c. 172.16.61.0
d. 172.16.65.255
e. 172.16.64.1
Answer: b, c
To determine subnets and usable address ranges created by the 21-bit subnet
mask we perform the following steps:

Step #1: Identify the interesting octet (i.e. the octet that contains the first zero in
the binary subnet mask).In this question, we have a 21-bit subnet mask, which is written in binary as:
11111111 11111111 11111000 00000000
The interesting octet is the third octet, because the third octet (i.e. 11111000) is
the first octet to contain a 0 in the binary subnet mask.

Step #2: Identify the decimal value in the interesting octet of the subnet mask.
A 21-bit subnet mask can be written in dotted decimal notation as: 255.255.248.0
Since the third octet is the interesting octet, the decimal value in the interesting
octet is 248.

Step #3: Determine the block size by subtracting the decimal value of the
interesting octet from 256.
Block Size = 256 – 248 = 8

Step #4: Determine the subnets by counting by the block size in the interesting
octet, starting at 0.Placing a zero in the first interesting octet identifies the first subnet as: 172.16.0.0 /21
We then count by the block size (of 8) in the interesting octet (the third octet in
this question) to determine the remaining subnets:
172.16.8.0 /21
172.16.16.0 /21
172.16.24.0 /21
172.16.32.0 /21
172.16.40.0 /21
172.16.48.0 /21
172.16.56.0 /21
172.16.64.0 /21
... SUBNETS OMITTED ...
We can stop counting after we pass the subnet we are being asked about.
Specifically, in this question, we’re being asked about 172.16.56.0 /21.
Step #5: Identify the subnet address, the directed broadcast address, and the
usable range of addresses.
The subnet address, where all host bits are set to a 0, is given:
172.16.56.0 /24
The directed broadcast address, where all host bits are set to a 1, is 1 less than
the next subnet address.
The next subnet address is 172.16.64.0. So, the directed broadcast address for
the 172.16.54.0 /21 subnet is 1 less than 172.16.64.0, which is:
172.16.63.255
The usable IP addresses are all the IP addresses between the subnet address
and the directed broadcast address. Therefore, in this example, the usable IP
address range for the 172.16.56.0 /21 network is:
172.16.56.1 – 172.16.63.254
The only IP addresses in this question that reside in this range are:
172.16.62.255
172.16.61.0
WARNING: Many CCNA R&S candidates look at IP addresses like these and
immediately assume they are not usable IP addresses, because they have a 0 or
a 255 in the forth octet. They argue that 172.16.61.0 is a subnet address and that
172.16.62.255 is a directed broadcast address.
While that would only be true of the subnet mask were 24-bits, remember that, by
definition, a subnet address has all of its host bits set to a 0, and a directed
broadcast address has all of its host bits set to a 1. In this question, we have 11
host bits (i.e. 32 – 21 = 11), not 8 host bits. So, 172.16.62.255 and 172.16.61.0
are actually usable IP addresses.

Question #8
What is the subnet address of the IP address 192.168.5.55 with a subnet mask
of 255.255.255.224?
a. 192.168.5.0 /27
b. 192.168.5.16 /27
c. 192.168.5.32 /27
d. 192.168.5.48 /27
e. 192.168.5.64 /27
Answer: c
To determine subnets and usable address ranges created by the 27-bit subnet
mask we perform the following steps:

Step #1: Identify the interesting octet (i.e. the octet that contains the first zero in
the binary subnet mask). In this question, we have a 27-bit subnet mask, which is written in binary as:11111111 11111111 11111111 11100000
The interesting octet is the forth octet, because the forth octet (i.e. 11100000) is
the first octet to contain a 0 in the binary.

Step #2: Identify the decimal value in the interesting octet of the subnet mask.
A 27-bit subnet mask can be written in dotted decimal notation as: 255.255.255.224 Since the forth octet is the interesting octet, the decimal value in the interesting octet is 224.

Step #3: Determine the block size by subtracting the decimal value of the
interesting octet from 256.
Block Size = 256 – 224 = 32

Step #4: Determine the subnets by counting by the block size in the interesting
octet, starting at 0.
Placing a zero in the first interesting octet identifies the first subnet as:
192.168.5.0 /27
We then count by the block size (of 32) in the interesting octet (the forth octet in
this question) to determine the remaining subnets:
192.168.5.32 /27
192.168.5.64 /27
192.168.5.96 /27
192.168.5.128 /27
192.168.5.160 /27
192.168.5.192 /27
192.168.5.224 /27
Now that we have all of our subnets identified, we can determine the subnet in
which the IP address of 192.168.5.55 resides.
Since the usable range of IP addresses for the 192.168.5.32 /27 network is
192.168.5.33 – 192.168.5.62 (because 192.168.5.32 is the network address, and
192.168.5.63 is the directed broadcast address), and since 192.168.5.55 is in
that range, the subnet to which 192.168.5.55 /27 belongs is:
192.168.5.32 /27

Question #9
You are working for a company that will be using the 192.168.1.0 /24 private IP
address space for IP addressing inside their organization.
They have multiple geographical locations and want to carve up the 192.168.1.0
/24 address space into subnets. Their largest subnet will need 13 hosts.
What subnet mask should you use to accommodate at least 13 hosts per subnet,
while maximizing the number of subnets that can be created?
a. 255.255.255.248
b. 255.255.255.224
c. 255.255.255.252
d. 255.255.255.192
e. 255.255.255.240
Answer: e
We can determine the maximum number of hosts allowed in a subnet by raising
the number 2 to the power of the number of host bits and then subtracting 2. So,
the formula looks like this:
Maximum Number of Hosts per Subnet = 2h – 2, where h is the number of
host bits.
Why are we subtracting two? Well, there are two IP addresses in the subnet that
cannot be assigned. These addresses are: (1) the network address, where all of
the host bits are set to a 0 and (2) the directed broadcast address, where all of
the host bits are set to a 1.
In the actual exam, if you are given scratch paper or access to a note taking
application, you might want to write out a table such as the following for your
reference:
1 Host Bit: 21 – 2 = 0
2 Host Bits: 22 – 2 = 2
3 Host Bits: 23 – 2 = 6
4 Host Bits: 24 – 2 = 14
5 Host Bits: 25 – 2 = 30
6 Host Bits: 26 – 2 = 62
7 Host Bits: 27 – 2 = 126
8 Host Bits: 28 – 2 = 254
In this question, we’re asked to determine a subnet mask that accommodates at
least 13 hosts per subnet. By looking at the reference table we created, we can
see that 4 host bits (which support 14 hosts) would work, while 3 host bits (which
supports only 6 hosts) would not be enough.
So, we need a subnet with 4 host bits, which are enough host bits to meet the
design goal, but not more than we need. Using more host bits than we need
would violate the requirement to maximize the number of subnets.
A subnet mask with 4 host bits has 28 network bits (i.e. 32 – 4 = 28), and
therefore a 28-bit subnet mask. A 28-bit subnet mask can be written as:
255.255.255.240

Question #10
A customer is using a Class C network of 192.168.10.0 subnetted with a 28-bit
subnet mask. How many assignable addresses are available in each of the
subnets?
a. 32
b. 16
c. 30
d. 8
e. 14
Answer: e
An IPv4 address contains a total of 32 bits. Since, in this question, we have 28
subnet bits, the number of host bits is 4 (i.e. 32 – 28 = 4). The number of
assignable IP addresses in a subnet can be calculated as follows:

Number of Assignable IP Addresses = 2h – 2, where h is the number of host
bits.Therefore, in this question, each subnet has 14 assignable IP addresses:
Number of Assignable IP Addresses = 2^4 – 2 = 16 – 2 = 14

Question #11
An IP address of 192.168.0.100 /27 belongs to which of the following subnets?
a. 192.168.0.92
b. 192.168.0.128
c. 192.168.0.64
d. 192.168.0.96
e. 192.168.0.32
Answer: d
To determine the subnets created by the 27-bit subnet mask we perform the
following steps:

Step #1: Identify the interesting octet (i.e. the octet that contains the first zero in
the binary subnet mask).
In this question, we have a 19-bit subnet mask, which is written in binary as:
11111111 11111111 11111111 11100000
The interesting octet is the forth octet, because the forth octet (i.e. 11100000) is
the first octet to contain a 0 in the binary.

Step #2: Identify the decimal value in the interesting octet of the subnet mask.
A 27-bit subnet mask can be written in dotted decimal notation as:
255.255.255.224
Since the forth octet is the interesting octet, the decimal value in the interesting
octet is 224.

Step #3: Determine the block size by subtracting the decimal value of the
interesting octet from 256.
Block Size = 256 – 224 = 32

Step #4: Determine the subnets by counting by the block size in the interesting
octet, starting at 0.
Placing a zero in the first interesting octet identifies the first subnet as:
192.168.0.0 /27
We then count by the block size (of 32) in the interesting octet (the forth octet in
this question) to determine the remaining subnets:
192.168.0.32 /27
192.168.0.64 /27
192.168.0.96 /27
192.168.0.128 /27
192.168.0.160 /27
192.168.0.192 /27
192.168.0.224 /27

Step #5: Identify the subnet address of the IP address 192.168.0.100 /27.Looking through the subnets created by the 27-bit subnet mask reveals that the IP address of 192.168.0.100 resides in the 192.168.0.96 subnet.

Question #12
What subnet mask should be used to subnet the 192.168.10.0 network to support the number of subnets and IP addresses per subnet shown in the following topology?
a. 255.255.255.0
b. 255.255.255.128
c. 255.255.255.192
d. 255.255.255.224
e. 255.255.255.240
Answer: c
To meet the design requirements, four subnets must be created, and each
subnet must accommodate a maximum of 50 IP addresses. We can begin by creating a listing of how many subnets are created from different numbers of borrowed bits, using the formula:
Number of Subnets Created = 2n, where n is the number of borrowed bits
1 borrowed bits => 2 subnets
2 borrowed bits => 4 subnets
3 borrowed bits => 8 subnets
4 borrowed bits => 16 subnets
5 borrowed bits => 32 subnets
6 borrowed bits => 64 subnets
7 borrowed bits => 128 subnets
From this, we can see we need at least 2 borrowed bits to accommodate 4 subnets. However, we need to make sure the subnet will accommodate 50 IP
addresses.  To determine this, we can use the formula:
Number of IP Addresses = 2h – 2, where h is the number of host bits

If we have 2 borrowed bits (i.e. the minimum number of borrowed bits required
for 4 subnets), we have 6 host bits (i.e. 8 – 2 = 6). From the above formula, we
can determine the number of IP addresses supported by 6 host bits.
Number of IP Addresses = 26 – 2 = 62
Since 6 host bits meet our requirement of at least 50 IP addresses per subnet,
we can use a 26-bit subnet mask (i.e. 2 bits added to the Class C default mask
(also known as the natural mask) of 24 bits). A 26-bit subnet mask can be written
as: 255.255.255.192

Peer-to-Peer Networks

  Peer-to-Peer (P2P) networks are a decentralized type of network architecture where each device (or node) on the network can act as both a...