Unit 4: Routing and IP Header - Practice Quiz

CSE306 — Computer Networks 60 Questions
0 Correct 0 Wrong 60 Left
0/60

1 What is the main purpose of a routing algorithm?

Routing Algorithms Easy
A. To encrypt data in packets
B. To select a path for packets
C. To detect errors in frames
D. To assign names to websites

2 Which device commonly uses routing algorithms to forward packets between networks?

Routing Algorithms Easy
A. Router
B. Repeater
C. Modem
D. Hub

3 What does a shortest path algorithm find in a network?

Shortest Path Algorithm Easy
A. The longest-delay route
B. The largest packet size
C. The least-cost route
D. The highest port number

4 Which algorithm is commonly used to compute shortest paths in link state routing?

Shortest Path Algorithm Easy
A. Euclid's algorithm
B. Binary search algorithm
C. Huffman algorithm
D. Dijkstra's algorithm

5 In a network graph, what does an edge usually represent?

Shortest Path Algorithm Easy
A. A routing table
B. A communication link
C. A network address
D. A packet header

6 What information does a router share with its neighbors in distance vector routing?

Distance Vector Routing Easy
A. Its physical layout
B. Its complete packet history
C. Its distance vector
D. Its application data

7 Which algorithm is the basis of distance vector routing?

Distance Vector Routing Easy
A. Prim's algorithm
B. Bellman-Ford algorithm
C. Dijkstra's algorithm
D. Kruskal's algorithm

8 Which problem is commonly associated with distance vector routing?

Distance Vector Routing Easy
A. Count-to-infinity problem
B. Address exhaustion problem
C. Packet framing problem
D. Header checksum problem

9 What does each router build in link state routing?

Link State Routing Easy
A. A list of user passwords
B. A table of web addresses
C. A network topology map
D. A copy of every packet

10 How is link state information normally distributed to routers?

Link State Routing Easy
A. By encryption
B. By compression
C. By flooding
D. By fragmentation

11 Which routing protocol uses a link state approach?

Link State Routing Easy
A. ARP
B. RIP
C. OSPF
D. DHCP

12 How many bits are in an IPv4 address?

IPv4 Header Easy
A. 48 bits
B. 32 bits
C. 64 bits
D. 128 bits

13 Which IPv4 header field limits how long a packet can remain in the network?

IPv4 Header Easy
A. Version
B. Total Length
C. Header Length
D. Time to Live

14 Which IPv4 header field helps detect errors in the header?

IPv4 Header Easy
A. Header Checksum
B. Source Address
C. Identification
D. Protocol

15 How many bits are in an IPv6 address?

IPv6 Header Easy
A. 128 bits
B. 16 bits
C. 32 bits
D. 64 bits

16 Which IPv6 header field serves a purpose similar to the IPv4 Time to Live field?

IPv6 Header Easy
A. Payload Length
B. Traffic Class
C. Hop Limit
D. Flow Label

17 What is the fixed size of the basic IPv6 header?

IPv6 Header Easy
A. 20 bytes
B. 32 bytes
C. 40 bytes
D. 60 bytes

18 Which notation is normally used to write an IPv6 address?

IPv6 Addressing Easy
A. Colon-separated hexadecimal
B. Dot-separated decimal
C. Hyphen-separated binary
D. Slash-separated octal

19 What does :: represent when used in an IPv6 address?

IPv6 Addressing Easy
A. One sequence of zero groups
B. A subnet mask separator
C. A broadcast address marker
D. One sequence of one groups

20 What is the main function of Network Address Translation (NAT)?

Network Address Translation (NAT) Easy
A. Translate private and public addresses
B. Detect errors in packet headers
C. Calculate shortest network routes
D. Encrypt packets between routers

21 A network's link delays vary significantly with traffic load. Which routing approach is most suitable for selecting routes based on current conditions?

Routing Algorithms Medium
A. Link-state routing with frequently updated delay costs
B. Static routing with manually assigned hop counts
C. Flooding with no duplicate-packet suppression
D. Default routing through a single fixed gateway

22 A router has routes for 10.0.0.0/8 via A, 10.1.0.0/16 via B, 10.1.2.0/24 via C, and 0.0.0.0/0 via D. Where is a packet for 10.1.2.130 forwarded?

Routing Algorithms Medium
A. Via A using the /8 route
B. Via B using the /16 route
C. Via C using the /24 route
D. Via D using the default route

23 An undirected graph has edges A–B with cost 4, A–C with cost 1, C–B with cost 2, B–D with cost 1, and C–D with cost 5. What is the shortest route from A to D?

Shortest Path Algorithm Medium
A. via A–B–C–D
B. via A–B–D
C. via A–C–D
D. via A–C–B–D

24 During Dijkstra's algorithm, node U has tentative distance 7 and is selected next. Its edge to V has cost 3, while V currently has tentative distance 12. What value should be assigned to V?

Shortest Path Algorithm Medium
A. 15, adding U and V's distances
B. 10, using the path through U
C. 7, using U's current distance
D. 12, keeping the existing path

25 Router X reaches neighbor A with cost 2 and neighbor B with cost 5. A advertises distance 6 to destination D, while B advertises distance 2 to D. Which route should X select?

Distance Vector Routing Medium
A. Via B with total cost 7
B. Via B with total cost 5
C. Via A with total cost 8
D. Via A with total cost 6

26 Router X learned its route to network N from neighbor Y. Under poison reverse, what metric does X advertise for N back to Y?

Distance Vector Routing Medium
A. An infinite or unreachable metric
B. A metric reduced by one hop
C. The metric from X to neighbor Y
D. The original metric reported by Y

27 After a link failure, two distance-vector routers repeatedly advertise increasingly larger metrics for an unreachable destination. Which problem is occurring?

Distance Vector Routing Medium
A. The designated-router problem
B. The duplicate-LSA problem
C. The count-to-infinity problem
D. The longest-prefix problem

28 A router receives two link-state advertisements from the same origin, with sequence numbers 41 and 44. Assuming no sequence-number wraparound, which advertisement should it retain?

Link State Routing Medium
A. Sequence 44 because it is more recent
B. Sequence 41 because it is numerically lower
C. Both advertisements until their ages expire
D. Sequence 41 because it arrived first

29 Routers P and Q have received the same complete set of link-state advertisements. Why can their shortest-path trees still be different?

Link State Routing Medium
A. Each router assigns random costs to remote links
B. Each tree is rooted at its calculating router
C. Each tree excludes links not directly connected to it
D. Each router stores only routes learned from neighbors

30 An IPv4 packet has an Internet Header Length (IHL) value of 7. How many bytes are in its header?

IPv4 Header Medium
A. 56 bytes
B. 32 bytes
C. 28 bytes
D. 20 bytes

31 An IPv4 datagram has a total length of 4000 bytes, including a 20-byte header. It crosses a link with an MTU of 1500 bytes. Assuming no options, what are the fragment offset and MF flag of the third fragment?

IPv4 Header Medium
A. Offset 370 and MF 1
B. Offset 370 and MF 0
C. Offset 500 and MF 0
D. Offset 185 and MF 0

32 When an IPv4 router forwards a packet normally, which header-related action must it perform?

IPv4 Header Medium
A. Retain TTL and update the transport checksum
B. Decrement TTL and remove the identification field
C. Increment TTL and retain the header checksum
D. Decrement TTL and update the header checksum

33 A 2000-byte IPv4 datagram with the DF flag set reaches a router whose outgoing link has an MTU of 1500 bytes. What should the router do?

IPv4 Header Medium
A. Discard it and send a fragmentation-needed ICMP message
B. Forward the datagram because DF applies only to hosts
C. Remove the DF flag and fragment the datagram normally
D. Fragment the datagram and preserve the DF flag

34 Which statement correctly compares the IPv6 base header with the IPv4 header?

IPv6 Header Medium
A. IPv6 has a fixed 20-byte base header containing an IHL field
B. IPv6 has a variable base header containing a fragmentation field
C. IPv6 has a fixed 40-byte base header without a header checksum
D. IPv6 has a variable base header with a mandatory checksum

35 An IPv6 packet's Payload Length field contains 1200. If no jumbo payload option is used, what is the packet's total length?

IPv6 Header Medium
A. 1160 bytes
B. 1200 bytes
C. 1240 bytes
D. 1280 bytes

36 An IPv6 router receives a packet that is larger than the MTU of the next link. What is the expected behavior?

IPv6 Header Medium
A. The router fragments it using the IPv6 base header
B. The router fragments it using a Fragment extension header
C. The router forwards it after reducing the Payload Length field
D. The router drops it and sends an ICMPv6 Packet Too Big message

37 Using RFC 5952 canonical formatting, which is the preferred representation of 2001:0db8:0000:0000:00ab:0000:0000:0010?

IPv6 Addressing Medium
A. 2001:db8:0:0:ab:0:0:10
B. 2001:db8::ab::10
C. 2001:db8::ab:0:0:10
D. 2001:db8:0:0:ab::10

38 An organization receives the IPv6 prefix 2001:db8:5a00::/48 and assigns /64 prefixes to its LANs. How many distinct /64 LAN prefixes are available?

IPv6 Addressing Medium
A.
B.
C.
D.

39 A NAT device translates source 10.0.0.5:49152 to 203.0.113.8:62001 for a connection to 198.51.100.20:443. What destination should the server use in its reply?

Network Address Translation (NAT) Medium
A. 203.0.113.8:49152
B. 203.0.113.8:62001
C. 10.0.0.5:49152
D. 10.0.0.5:62001

40 An external host initiates a TCP connection to a NAT router's public address and an unused destination port. No static mapping or port-forwarding rule exists. What normally happens?

Network Address Translation (NAT) Medium
A. The NAT drops the connection because no mapping exists
B. The NAT forwards the connection to its default private host
C. The NAT broadcasts the connection to all private hosts
D. The NAT creates a mapping to the first available private host

41 A router has the following forwarding entries: 0.0.0.0/0 -> R1, 172.16.0.0/12 -> R2, 172.16.128.0/17 -> R3, and 172.16.192.0/18 -> R4. Which next hop is selected for destination 172.16.190.10?

Routing Algorithms Hard
A. R4, because /18 is the most specific table entry
B. R1, because the default route has the broadest coverage
C. R3, because /17 is the longest matching network prefix
D. R2, because /12 is the first matching network prefix

42 A router learns exactly four contiguous routes, 10.24.8.0/24 through 10.24.11.0/24, from the same next hop. Assuming no other routes must be included, what is the most specific single aggregate?

Routing Algorithms Hard
A. 10.24.8.0/22
B. 10.24.0.0/20
C. 10.24.8.0/23
D. 10.24.8.0/21

43 An undirected graph has edges S-A:4, S-B:2, B-A:1, A-C:5, B-C:8, B-D:10, A-D:7, and C-D:2. After Dijkstra's algorithm completes from S, which result for node C is correct?

Shortest Path Algorithm Hard
A. Distance 7 using path S-A-C
B. Distance 9 using path S-B-C
C. Distance 10 using path S-B-A-D-C
D. Distance 8 using path S-B-A-C

44 A directed graph contains S->A:2, S->B:5, and B->A:-10, with no negative cycle. What happens if standard Dijkstra's algorithm permanently settles A before processing B?

Shortest Path Algorithm Hard
A. It returns -5 for A, because relaxation reopens settled nodes
B. It detects a negative cycle when processing the edge from B
C. It returns 5 for A, because negative edges are ignored
D. It returns 2 for A, although the true distance is -5

45 Router X has link costs and . Neighbor A advertises distances (D, E) = (3, 2), while B advertises (D, E) = (7, 5). What routes does the Bellman-Ford update select?

Distance Vector Routing Hard
A. D costs 8 via B; E costs 6 with either next hop
B. D costs 7 via A; E costs 6 with either next hop
C. D costs 7 via B; E costs 3 through neighbor A
D. D costs 4 via A; E costs 5 through neighbor B

46 Routers A, B, and C can all exchange distance vectors. Before destination D fails, B reaches D through A, and C reaches D through B. Why can split horizon with poisoned reverse still fail to stop counting to infinity?

Distance Vector Routing Hard
A. It prevents triggered updates, allowing periodic updates to increase every link cost
B. It operates only with link-state metrics, so distance vectors ignore the poison
C. It blocks only two-router loops, while stale advertisements can create a three-router loop
D. It suppresses every finite metric, forcing all routers to use their default routes

47 A router reboots and originates its link-state advertisement with sequence number 1, while other routers retain its pre-reboot advertisement with sequence number 900. Under simple higher-sequence-number acceptance, what is the main failure mode?

Link State Routing Hard
A. Both advertisements are merged because they describe links from the same originating router
B. The new advertisement may be rejected until the stale instance ages out or is flushed
C. The stale advertisement is immediately replaced because sequence numbers reset after reboot
D. The new advertisement is flooded only to neighbors whose shortest paths use the router

48 During asynchronous link-state convergence, routers R1 and R2 temporarily have different link-state database snapshots. Each computes a valid shortest-path tree from its own snapshot. Which statement is correct?

Link State Routing Hard
A. A forwarding loop is impossible because every local shortest-path tree is independently acyclic
B. A forwarding loop is still possible because the next hops come from inconsistent topology views
C. Packet duplication is guaranteed because both routers flood data along every shortest path
D. Reachability is guaranteed because every accepted advertisement has a valid sequence number

49 An IPv4 datagram has a 20-byte header and a 4000-byte payload. It crosses a link with MTU 1500, and fragmentation is permitted. Which (payload bytes, fragment offset, MF) sequence is correct?

IPv4 Header Hard
A. (1480,0,1), (1480,185,1), (1040,370,0)
B. (1480,0,1), (1480,1480,1), (1040,2960,0)
C. (1500,0,1), (1500,187,1), (1000,375,0)
D. (1480,0,1), (1480,185,0), (1040,370,1)

50 An incoming IPv4 fragment has a 20-byte header, 2000 payload bytes, fragment offset 100, and MF=1. It must cross a link with MTU 620. Which offsets and MF values are produced when it is fragmented again?

IPv4 Header Hard
A. Offsets 100, 700, 1300, 1900; only the final fragment has MF=0
B. Offsets 0, 75, 150, 225; only the final fragment has MF=0
C. Offsets 100, 175, 250, 325; every resulting fragment has MF=1
D. Offsets 100, 177, 254, 331; every resulting fragment has MF=1

51 A router decrements an IPv4 packet's TTL by 1. The old header checksum is 0xB861, and no other header field changes. Ignoring an end-around carry that is not needed for these values, what is the new checksum?

IPv4 Header Hard
A. 0xB961
B. 0xB860
C. 0xB962
D. 0xB761

52 An IPv4 packet has IHL=11 and Total Length=60. Assuming the header is valid, how many bytes are occupied by options and payload?

IPv4 Header Hard
A. 44 bytes of options and 16 bytes of payload
B. 24 bytes of options and 16 bytes of payload
C. 24 bytes of options and 36 bytes of payload
D. 20 bytes of options and 20 bytes of payload

53 An IPv6 packet contains the 40-byte base header, an 8-byte Hop-by-Hop Options header, a 20-byte TCP header, and 1200 bytes of application data. What values describe the packet correctly?

IPv6 Header Hard
A. Payload Length 1220 bytes; total packet length 1260 bytes
B. Payload Length 1228 bytes; total packet length 1268 bytes
C. Payload Length 1268 bytes; total packet length 1308 bytes
D. Payload Length 1200 bytes; total packet length 1268 bytes

54 An IPv6 packet uses Hop-by-Hop Options, Routing, Fragment, and Authentication headers before TCP. Which ordering follows the standard extension-header processing order?

IPv6 Header Hard
A. IPv6, Fragment, Hop-by-Hop, Routing, Authentication, TCP
B. IPv6, Hop-by-Hop, Routing, Fragment, Authentication, TCP
C. IPv6, Routing, Hop-by-Hop, Authentication, Fragment, TCP
D. IPv6, Authentication, Fragment, Routing, Hop-by-Hop, TCP

55 Using modified EUI-64, what IPv6 address is formed from prefix 2001:db8:abcd:12::/64 and MAC address 00-1A-2B-3C-4D-5E?

IPv6 Addressing Hard
A. 2001:db8:abcd:12:201a:2bff:fe3c:4d5e
B. 2001:db8:abcd:12:21a:2bff:fe3c:4d5e
C. 2001:db8:abcd:12:1a:2bff:fe3c:4d5e
D. 2001:db8:abcd:12:21a:2bfe:ff3c:4d5e

56 What solicited-node multicast address corresponds to unicast address 2001:db8::1234:5678?

IPv6 Addressing Hard
A. ff02::1:ff00:5678
B. ff05::1:ff34:5678
C. ff02::1:ff12:3456
D. ff02::1:ff34:5678

57 An organization subdivides 2001:db8:1200::/48 into /56 prefixes. If subnet IDs are numbered from 0, which prefix represents subnet ID 173?

IPv6 Addressing Hard
A. 2001:db8:1200:ad00::/64
B. 2001:db8:1200:ad00::/56
C. 2001:db8:12ad:0000::/56
D. 2001:db8:1200:00ad::/56

58 Four internal hosts simultaneously open TCP connections using source port 50000 to the same destination IP address and destination port. A PAT device uses one public IPv4 address. What is the minimum number of distinct public source ports required for these connections?

Network Address Translation (NAT) Hard
A. One public source port
B. Three public source ports
C. Two public source ports
D. Four public source ports

59 An IPv4 NAT receives fragments of a TCP packet. Only the first fragment contains the TCP source and destination ports. How can the NAT consistently translate the later fragments?

Network Address Translation (NAT) Hard
A. Cache the first fragment's mapping and identify later fragments using addresses, protocol, and identification
B. Delay translation until the destination returns an acknowledgment containing the original port tuple
C. Read the TCP ports from every fragment because transport headers are repeated during fragmentation
D. Assign each later fragment a new public port and let the destination perform the association

60 A host sends an IPv4 packet protected by IPsec Authentication Header through a NAT that changes the source address. No NAT-aware encapsulation is used. What is the expected result?

Network Address Translation (NAT) Hard
A. Authentication fails only if the NAT also translates the transport-layer source port
B. Authentication succeeds because all IPv4 header fields are treated as mutable by AH
C. Authentication fails because the translated source address is covered by the integrity check
D. Authentication succeeds after the NAT recomputes AH using the public source address