Networking - MCQ Practice Questions
Computer networks MCQs — OSI, TCP/IP, routing & protocols.
168 questions | 100% Free
Which routing protocol uses the Bellman-Ford algorithm to calculate the best path to a destination network?
Understanding:
We need to identify which routing protocol relies on the Bellman-Ford algorithm for path calculation.
Step 1: Evaluate each protocol
RIP (Routing Information Protocol) is a distance-vector protocol that uses the Bellman-Ford algorithm to compute shortest paths. Each router shares its entire routing table with its neighbours at regular intervals.
Step 2: Eliminate incorrect options
OSPF uses Dijkstra's Shortest Path First (SPF) algorithm. EIGRP uses the Diffusing Update Algorithm (DUAL). BGP uses a path-vector algorithm based on policy attributes.
Answer:
RIP uses the Bellman-Ford algorithm to determine the best path to a destination.
Quick Tip:
A common trap is confusing RIP (Bellman-Ford) with OSPF (Dijkstra). Remember: Distance-Vector = Bellman-Ford; Link-State = Dijkstra.
What is the maximum hop count supported by RIPv2 before a route is considered unreachable?
Understanding:
We need to determine the maximum valid hop count in RIPv2.
Step 1: Recall RIP hop count limits
In RIPv2, the maximum hop count allowed for a reachable route is 15. A hop count of 16 is used to signify that the destination is unreachable (infinity metric).
Step 2: Distinguish from other protocols
A metric value of 255 is used in other contexts (e.g., OSPF administrative distance). 32 and other values are not standard RIP limits.
Answer:
The maximum valid hop count in RIPv2 is 15; a hop count of 16 means the route is unreachable.
Quick Tip:
This is why RIP is unsuitable for large networks — its scalability is severely limited by the 15-hop maximum.
In OSPF, which type of packet is used to discover and maintain neighbour relationships?
Understanding:
We need to identify the OSPF packet type responsible for neighbour discovery and maintenance.
Step 1: Review OSPF packet types
OSPF defines five packet types: Hello, DBD (Database Description), LSR (Link State Request), LSU (Link State Update), and LSAck (Link State Acknowledgement).
Step 2: Identify the function of each
The Hello packet is specifically used to discover OSPF neighbours, establish adjacencies, and maintain those relationships by being sent at regular intervals (Hello interval). DBD packets exchange database summaries, LSR requests specific link state records, and LSU carries actual link state advertisements.
Answer:
The Hello packet is used in OSPF to discover and maintain neighbour relationships.
Quick Tip:
Remember the acronym HD-LLA for the five OSPF packet types: Hello, DBD, LSR, LSU, LSAck.
Which of the following routing protocols is classified as a Path Vector protocol?
Understanding:
We need to identify which routing protocol belongs to the path-vector category.
Step 1: Classify routing protocol types
Routing protocols are broadly classified into three types based on their operation:
Step 2: Identify BGP
BGP (Border Gateway Protocol) is the standard exterior gateway protocol of the internet and is the only widely used path-vector protocol. It makes routing decisions based on path, network policies, and rule sets.
Answer:
BGP is the routing protocol classified as a path-vector protocol.
Quick Tip:
BGP is used between Autonomous Systems (inter-domain routing), while OSPF and EIGRP are used within an Autonomous System (intra-domain routing).
What is the default administrative distance of OSPF in Cisco routers?
Understanding:
We need to recall the default administrative distance (AD) assigned to OSPF on Cisco routers.
Step 1: Recall administrative distance values
Administrative distance is a value used by routers to rate the trustworthiness of routing information sources. Lower AD = more trusted. Standard Cisco AD values:
Step 2: Identify OSPF's AD
OSPF has a default administrative distance of 110 on Cisco routers.
Answer:
The default administrative distance of OSPF on Cisco routers is 110.
Quick Tip:
Memorize the sequence: EIGRP (90) < OSPF (110) < RIP (120). If all three know a route, EIGRP wins by default.
Which OSPF network type requires a Designated Router (DR) and Backup Designated Router (BDR) election?
Understanding:
We need to identify which OSPF network type triggers a DR/BDR election.
Step 1: Understand DR/BDR purpose
In networks where multiple routers share the same segment (multi-access networks), OSPF elects a Designated Router (DR) and a Backup Designated Router (BDR) to reduce the number of adjacencies and LSA flooding. Without DR/BDR, every router would form a full mesh of adjacencies.
Step 2: Evaluate each network type
Answer:
DR and BDR elections occur on Broadcast Multi-Access networks in OSPF.
Quick Tip:
On a broadcast segment with N routers, without DR/BDR there would be 2N(N−1) adjacencies. DR/BDR reduces this to N−1 adjacencies to the DR.
EIGRP uses the concept of a 'Feasible Successor'. What does a Feasible Successor represent?
Understanding:
We need to define the role of a Feasible Successor in EIGRP's DUAL algorithm.
Step 1: Understand EIGRP terminology
In EIGRP, the best path to a destination is called the Successor, and it is installed in the routing table. The Feasible Successor is an alternative backup path that is pre-computed and stored in the topology table, ready for immediate use if the Successor fails.
Step 2: The Feasibility Condition
A route qualifies as a Feasible Successor if its Reported Distance (RD) — the metric advertised by the neighbour — is less than the Feasible Distance (FD) of the current Successor path. This condition guarantees the backup path is loop-free.
Step 3: Benefit
Because the Feasible Successor is already in the topology table, EIGRP can switch to it instantly without running DUAL again, making convergence very fast.
Answer:
A Feasible Successor is a pre-computed, loop-free backup path stored in the topology table that satisfies the Feasibility Condition.
Quick Tip:
The key inequality to remember: RD of FS<FD of Successor. If this holds, the path is a valid Feasible Successor.
Which of the following best describes a 'link-state' routing protocol compared to a 'distance-vector' protocol?
Understanding:
We need to identify the defining characteristic of a link-state routing protocol.
Step 1: Distance-Vector characteristics
Distance-vector protocols (e.g., RIP) share their routing tables (distance and direction to each destination) only with directly connected neighbours. Updates propagate hop by hop, which can lead to slow convergence and routing loops.
Step 2: Link-State characteristics
Link-state protocols (e.g., OSPF, IS-IS) flood Link State Advertisements (LSAs) throughout the network so every router builds an identical topology database (LSDB). Each router then independently runs the Shortest Path First (SPF/Dijkstra) algorithm on this database to compute the best paths.
Step 3: Eliminating wrong options
Sharing the full routing table periodically describes distance-vector behaviour. Using only hop count describes RIP specifically. Hop-by-hop propagation also describes distance-vector protocols.
Answer:
A link-state protocol builds a full network topology map and runs SPF to determine the best paths.
Quick Tip:
Link-state protocols converge faster and scale better than distance-vector protocols, but they consume more CPU and memory due to SPF calculations and the topology database.
In BGP, what is the purpose of the AS_PATH attribute?
Understanding:
We need to identify the function of the BGP AS_PATH attribute.
Step 1: BGP path attributes overview
BGP selects routes based on a series of attributes. Key attributes include LOCAL_PREF, AS_PATH, MED (Multi-Exit Discriminator), NEXT_HOP, and ORIGIN.
Step 2: AS_PATH function
The AS_PATH attribute is a well-known mandatory BGP attribute that lists every Autonomous System (AS) number through which the routing update has passed. When a router advertises a prefix to a neighbour in a different AS, it prepends its own AS number to the AS_PATH.
Step 3: Dual role of AS_PATH
AS_PATH serves two purposes: (1) Loop prevention — if a router sees its own AS number in the AS_PATH, it discards the route. (2) Path selection — shorter AS_PATH is preferred during BGP best-path selection.
Answer:
The AS_PATH attribute records the sequence of Autonomous Systems a BGP route advertisement has traversed.
Quick Tip:
BGP AS_PATH prepending is a common traffic-engineering technique where an AS artificially lengthens its AS_PATH to make a route less preferred by external peers.
Which routing protocol uses multicast address 224.0.0.5 to send Hello packets to all OSPF routers on a segment?
Understanding:
We need to identify which routing protocol uses the multicast address 224.0.0.5 for Hello packets.
Step 1: Recall multicast addresses used by routing protocols
Different protocols use specific multicast addresses to limit traffic to only relevant routers:
Step 2: Confirm OSPF's use
OSPF routers send Hello packets to the multicast address 224.0.0.5, which represents all OSPF-enabled routers on the local segment. This is used for neighbour discovery and adjacency maintenance.
Answer:
OSPF uses the multicast address 224.0.0.5 to send Hello packets to all OSPF routers on a segment.
Quick Tip:
A quick memory trick: OSPF = 224.0.0.5 (All OSPF), 224.0.0.6 (DR/BDR); RIPv2 = 224.0.0.9; EIGRP = 224.0.0.10.
Which well-known port number does DNS use for standard query and response communication?
Understanding:
We need to identify the standard port used by the DNS protocol for name resolution queries and responses.
Step 1: Recall DNS port assignment
DNS (Domain Name System) is assigned port 53 by IANA. It uses both UDP port 53 for standard queries (responses under 512 bytes) and TCP port 53 for zone transfers or large responses.
Step 2: Eliminate other options
Port 67 is used by DHCP (server side). Port 110 is used by POP3 for email retrieval. Port 443 is used by HTTPS for secure web traffic.
Answer:
DNS uses port 53 for both UDP and TCP communications.
Quick Tip:
Remember the pair — DHCP uses ports 67 (server) and 68 (client), while DNS uses port 53. These are frequently confused in exams.
In the DNS hierarchy, which type of server is responsible for maintaining authoritative records for a specific domain such as 'example.com'?
Understanding:
We need to identify which DNS server holds and serves the definitive records for a given domain.
Step 1: Understand the DNS resolution hierarchy
The DNS resolution process involves multiple server types:
Step 2: Identify the correct server
The Authoritative Name Server is the final source of truth for a domain's DNS records. It provides definitive answers without needing to query further.
Answer:
The Authoritative Name Server maintains and serves the definitive DNS records for a specific domain.
Quick Tip:
A response with the 'AA' (Authoritative Answer) flag set in the DNS response header indicates the reply came directly from an Authoritative Name Server.
Which DNS record type is used to map an IPv6 address to a hostname?
Understanding:
We need to identify the DNS record type responsible for mapping a domain name to an IPv6 address.
Step 1: Review common DNS record types
Step 2: Match to IPv6
IPv6 addresses are 128-bit and require the AAAA record type for forward DNS resolution (hostname to IPv6 address).
Answer:
The AAAA record is used to map a hostname to an IPv6 address.
Quick Tip:
For reverse lookup of IPv6 addresses, DNS uses the ip6.arpa domain with PTR records, similar to in-addr.arpa used for IPv4 reverse lookups.
A DHCP client sends an initial broadcast message to discover available DHCP servers on the network. What is the destination IP address of this message?
Understanding:
We need to identify the destination IP address used by a DHCP client during the initial DHCP Discover phase.
Step 1: Recall the DHCP DORA process
DHCP address assignment follows four steps: Discover, Offer, Request, and Acknowledge (DORA).
Step 2: Analyse the DHCP Discover message
At the Discover stage, the client has no IP address yet. It uses:
The broadcast address 255.255.255.255 ensures all devices on the local network, including any DHCP server, receive the message.
Step 3: Eliminate other options
Answer:
The DHCP Discover message is sent to the limited broadcast address.
Quick Tip:
The source IP in a DHCP Discover is 0.0.0.0 while the destination is 255.255.255.255 — both are commonly tested as tricky paired facts.
Which DHCP message is sent by the client after receiving multiple DHCP Offer messages to formally request an IP address from a chosen server?
Understanding:
We need to identify the specific DHCP message type that a client uses to formally select and request an offered IP address.
Step 1: Review the DORA process
The four messages in standard DHCP IP address assignment are:
Step 2: Identify the correct message
After receiving one or more Offer messages, the client sends a DHCP Request broadcast. This message does two things: it informs the chosen server that its offer is accepted, and it notifies other servers that their offers are declined.
Step 3: Eliminate other options
Answer:
The client sends a DHCP Request message to formally accept a server's offer.
Quick Tip:
The DHCP Request is still a broadcast even though the client has chosen a specific server — this is intentional so other servers know to retract their offers.
What is the purpose of a DNS PTR record?
Understanding:
We need to identify the function of a DNS PTR (Pointer) record in the Domain Name System.
Step 1: Define PTR records
A PTR (Pointer) record is used for reverse DNS lookups. While an A record resolves a domain name to an IP address (forward lookup), a PTR record does the opposite — it resolves an IP address back to a domain name.
Step 2: Understand the reverse lookup zone
PTR records are stored in special reverse lookup zones:
Step 3: Eliminate other options
Answer:
A PTR record maps an IP address to a domain name, enabling reverse DNS lookups.
Quick Tip:
PTR records are commonly used in email anti-spam checks. Mail servers verify that the sending IP resolves back to a legitimate domain using a PTR lookup.
A DHCP server is configured with a lease time of 8 hours. At what point in the lease period will the client first attempt to renew its IP address by sending a unicast DHCP Request to the server?
Understanding:
We need to determine when a DHCP client first attempts lease renewal, given a total lease time of 8 hours.
Formula:
DHCP defines two timers for lease renewal:
Step 1: Calculate T1 (first renewal attempt)
The client sends a unicast DHCP Request to the original server at T1:
Step 2: Calculate T2 (rebinding attempt)
If T1 renewal fails, the client broadcasts a DHCP Request at T2 to any available server:
Step 3: Identify the first renewal attempt
The first renewal attempt occurs at T1 = 4 hours (50% of the lease), using a unicast message directly to the leasing DHCP server.
Answer:
The client first attempts to renew its lease after 4 hours, which is 50% of the 8-hour lease time.
Quick Tip:
Remember T1 = 50% and T2 = 87.5% of lease time. T1 uses unicast to the original server; T2 uses broadcast to any server. Both are commonly tested in CCNA-level exams.
Which DNS record type is used to define the authoritative name servers for a domain zone?
Understanding:
We need to identify the DNS record type that specifies which name servers are authoritative for a particular domain zone.
Step 1: Define the NS record
An NS (Name Server) record delegates a DNS zone to a set of authoritative name servers. It specifies the hostnames of the DNS servers responsible for a domain. For example, the NS records for 'example.com' would list ns1.example.com and ns2.example.com.
Step 2: Distinguish from related record types
Step 3: Confirm the answer
While SOA references the primary name server, NS records explicitly list all authoritative name servers for the zone and are used by other DNS servers to delegate queries.
Answer:
The NS record identifies the authoritative name servers responsible for a DNS zone.
Quick Tip:
Every zone must have at least one NS record. The SOA record and NS records are always the first records present in any properly configured DNS zone file.
A network administrator needs to configure a DHCP relay agent. Which DHCP message field is modified by the relay agent to inform the DHCP server about the originating subnet of the client?
Understanding:
We need to identify which field in the DHCP packet a relay agent modifies to communicate the client's originating subnet to the DHCP server.
Step 1: Understand DHCP relay operation
When a DHCP client on one subnet needs to reach a DHCP server on a different subnet, a DHCP relay agent (typically a router) forwards the broadcast DHCP message as a unicast packet to the DHCP server.
Step 2: Identify the relevant DHCP packet fields
The DHCP message contains several address fields:
Step 3: Confirm the answer
The relay agent inserts its own IP address into the giaddr field. The DHCP server reads this field to identify the client's subnet and select an appropriate address pool for the lease offer.
Answer:
The relay agent sets the giaddr (Gateway IP Address) field to indicate the client's originating subnet to the DHCP server.
Quick Tip:
If giaddr is non-zero in a DHCP packet received by a server, the server knows the request was relayed and uses giaddr to pick the correct address pool — this is critical for multi-subnet DHCP deployments.
Which DNS record type is used to configure email routing by specifying the mail server responsible for accepting email messages for a domain?
Understanding:
We need to identify the DNS record type that directs email traffic to the correct mail server for a domain.
Step 1: Define MX records
An MX (Mail Exchanger) record specifies the hostname of the mail server responsible for accepting email on behalf of a domain. MX records include a priority value — lower values indicate higher preference.
Step 2: Understand MX priority
When multiple MX records exist, the sending mail server attempts delivery to the host with the lowest priority number first. For example:
Step 3: Eliminate other options
Answer:
The MX (Mail Exchanger) record specifies the mail server responsible for receiving email for a domain.
Quick Tip:
MX records must point to a hostname (A or AAAA record), never directly to an IP address. Pointing an MX record directly to an IP is invalid per RFC 2181 and is a common misconfiguration trap in exams.