⚡ TechVani: AI, Technology, Apps, Coding & Digital World
TechVaniAI • Technology • Apps • Coding • Digital World
HomeAI & TechAppsCodingFree AI ToolsStudent TechSecurityAboutContactPrivacy
TECHVANI // LEARN. BUILD. TEST.

Learn the tech. Build the idea.

Clear study notes, tested lab files and practical guides for coding, AI and digital safety.

Explore Latest →
šŸ¤– AI & TechAI news, tools & guides šŸ“± Apps & ToolsUseful apps & websites šŸ’» CodingProgramming & web development šŸŽ“ Student TechStudy & career technology šŸ” Cyber SecuritySafety & awareness

Latest Posts

Circuit Notebook theme

Exam Notes

šŸ“š BTech CSE Exam Notes

Find Semester 1-8 subjects in one place. Choose a semester and open the notes you need. This is a general study guide, not an official syllabus.

Open Exam Notes →🧪 Open Lab Files →

Exam Numericals & Study Series

Practice CPU scheduling and explore OS and DBMS topics in separate, easy-to-follow parts. New topics will appear in the hub as they are published.

Open Numericals Hub →

Start here and stay in touch

New to TechVani? Start with our free AI tools guide for students. It covers which tools to try and what to check before relying on an answer.

For step-by-step videos, visit SiteSudhar on YouTube.

Join TechVani on WhatsApp

Get new AI tools and coding guides in your WhatsApp Updates tab.

Browse Topics

Popular Posts

TechVani

Computer Networks Important Questions: 7 Worked Exam-Practice Answers

Can you explain a protocol without mixing up layers, and show every step in a numerical? This Computer Networks practice set helps you check that. It adds worked answers and marking checks to the full Computer Networks notes, rather than repeating the whole subject.

These are original exam-style questions, not previous-year questions or predictions. Your university may cover different units. Check the syllabus and your teacher's instructions first.

Pocket reference: 8 terms this set uses

  1. Prefix (subnet): a block of IP addresses; /26 means 26 network bits and 6 host bits.
  2. Next hop: the device on your own link that moves the packet closer to its destination.
  3. ARP / Neighbor Discovery: how a device finds the link-layer (MAC) address of an IPv4 or IPv6 next hop.
  4. Transmission delay: time to push a packet's bits onto the link; size divided by link rate.
  5. Propagation delay: time the signal takes to travel the link; depends on distance, not rate.
  6. Flow control: protects the receiving endpoint's buffer.
  7. Congestion control: protects the network path from overload.
  8. Longest-prefix match: when several routes match, the most specific prefix wins.

1. Switch versus router: explain the next hop

Question: A laptop sends a packet to a server outside its IPv4 subnet. Does it put the server's MAC address in the local Ethernet frame?

Worked answer: Normally, no. The laptop checks its route and sends the packet toward a gateway. On its local Ethernet link, the frame is addressed to the gateway's MAC address. ARP can resolve that local next-hop IPv4 address. The IP destination remains the remote server unless a device translates it. At the next routed link, a new frame carries the packet to the next hop.

Laptop -- local Ethernet frame --> Gateway -- new frame --> Next router
Frame destination: local next hop
IP destination: final server (without address translation)

Answer check: Mention both kinds of address and the purpose of each. "A router uses IP, a switch uses MAC" is a start, but the next-hop example shows that you understand the difference. IPv6 uses Neighbor Discovery rather than ARP.

How a packet is wrapped, in 5 seconds

Application data → your HTTP request or message
+ TCP header → segment: order, retransmission, byte stream
+ IP header → packet: source and destination IP; destination normally stays the same
+ Ethernet header → frame: MAC addresses for the local link only, replaced at each routed link

This is why question 1 has two address answers. The IP destination normally stays unchanged (without address translation); other fields such as TTL change. The frame header carries only the local next hop, so a router replaces it on each outgoing link.

2. Solve an IPv4 /26 subnet step by step

Question: Find the network, broadcast, conventional usable-host range and host count for 192.0.2.77/26.

  1. IPv4 has 32 bits. A /26 prefix leaves 6 host bits.
  2. Total addresses = 26 = 64. The mask is 255.255.255.192.
  3. Last-octet blocks start at 0, 64, 128 and 192. Since 77 lies from 64 through 127, the network is 192.0.2.64.
  4. The final address in that block is 192.0.2.127, the conventional broadcast.
  5. Conventional host range: 192.0.2.65 to 192.0.2.126. Host count = 64 - 2 = 62.

The 192.0.2.0/24 block is reserved for documentation. Do not use this example as a real public destination. The "subtract two" rule describes ordinary IPv4 subnet exercises; do not apply it blindly to /31 point-to-point links, /32 routes or IPv6.

Self-test: What block contains 192.0.2.150/26? Answer: network 192.0.2.128, broadcast 192.0.2.191, conventional hosts .129 through .190.

3. Transmission delay is not propagation delay

Question: An ideal store-and-forward path has two links. A 1,500-byte packet crosses a 6 Mb/s link and then a 3 Mb/s link. Propagation is 2 ms per link. Ignore headers, processing and queues. How long until the final bit reaches the destination?

  1. Packet size = 1,500 × 8 = 12,000 bits.
  2. First transmission = 12,000 / 6,000,000 seconds = 2 ms.
  3. Second transmission = 12,000 / 3,000,000 seconds = 4 ms.
  4. Propagation = 2 + 2 = 4 ms.
  5. Total = 2 + 4 + 4 = 10 ms.

Store-and-forward means the intermediate device receives the complete packet before transmitting it on the next link in this model. This calculation is for one packet, not a sustained stream with overlapping transmissions.

Common mistake: Adding 1,500 directly to Mb/s mixes bytes and bits. Write units at every step. Increasing link rate reduces transmission time; it does not eliminate the time a signal takes to travel.

4. TCP flow control versus congestion control

Question: Why are both needed?

Answer: Flow control stops a sender from overwhelming the receiving TCP endpoint's available buffering. Congestion control limits load in response to conditions along the network path. A receiver may have space while the network is congested, or the network may be clear while the receiver cannot accept more data.

TCP provides an ordered reliable byte stream using sequence numbers, acknowledgments and recovery from loss. It does not preserve application message boundaries. An application must define how one message ends and another begins. TCP also does not encrypt the data by itself.

Answer check: Name the resource being protected. Do not write "both prevent packet loss" as your entire comparison.

5. Does UDP mean the application cannot be reliable?

Question: Compare TCP and UDP without saying one is always faster.

Answer: TCP supplies connection state and reliable ordered stream delivery. UDP supplies datagrams without a built-in guarantee of delivery or order. An application can add acknowledgments, retransmission or other delivery rules over UDP. QUIC is an example of a transport built over UDP with additional features.

Choose according to the application's needs, not a slogan. Real-time media may prefer a late packet to be dropped, while file transfer needs complete data. Actual speed depends on the protocol implementation, network, workload and recovery behavior.

PropertyTCPUDP
DeliveryReliable, with retransmissionNo built-in guarantee
OrderOrdered byte streamIndependent datagrams
SetupConnection handshake firstNone; just send
Fits wellWeb pages, files, mail: complete data mattersLive media, DNS lookups; QUIC builds reliability on top

6. Trace DNS, transport, TLS and HTTP separately

Question: DNS resolves a website correctly, but the server returns HTTP 404. Should you change the DNS server?

Answer: Not as the first fix. Resolution succeeded and an HTTP response arrived. Check the requested path and the server's resource routing. A 404 is different from a DNS lookup failure, connection timeout or TLS certificate error.

  1. DNS obtains a record for the hostname, possibly from a cache.
  2. A common HTTPS connection uses TCP followed by TLS, then HTTP. Existing connections can be reused.
  3. HTTP/3 uses QUIC over UDP, so not every request follows the TCP sequence.
  4. HTTP returns a status, headers and body. More resources may require more requests.

Answer check: Keep the stage and symptom together. Never disable certificate checks as a general fix for a TLS error.

7. Longest-prefix matching practice

A routing table has 0.0.0.0/0 via A, 192.0.2.0/24 via B and 192.0.2.64/26 via C. Which route matches 192.0.2.90?

All three prefixes match, but /26 is the longest matching prefix, so choose C. For 192.0.2.200, the /26 does not match; choose B. For 198.51.100.8, only the default matches; choose A. This example assumes the table entries are usable and omits equal-cost and policy details.

Check every number with Python

The program below was executed before publishing. It recomputes the subnet answers from question 2, the delay answer from question 3 and the routing answers from question 7, using Python's ipaddress module and plain arithmetic. The results match the worked steps above.

import ipaddress

def subnet_summary(cidr):
    net = ipaddress.ip_network(cidr, strict=False)
    hosts = list(net.hosts())
    return net.network_address, net.broadcast_address, hosts[0], hosts[-1], len(hosts)

for cidr in ["192.0.2.77/26", "192.0.2.150/26"]:
    n, b, first, last, count = subnet_summary(cidr)
    print(f"{cidr}: network {n}, broadcast {b}")
    print(f"  conventional hosts {first} to {last}, count {count}")

packet_bits = 1500 * 8
t1 = packet_bits / 6_000_000 * 1000
t2 = packet_bits / 3_000_000 * 1000
prop = 2 + 2
print(f"delay: {t1:.0f} ms + {t2:.0f} ms transmit + {prop} ms propagation = {t1 + t2 + prop:.0f} ms")

routes = [("0.0.0.0/0", "A"), ("192.0.2.0/24", "B"), ("192.0.2.64/26", "C")]

def best_route(ip):
    addr = ipaddress.ip_address(ip)
    matches = [(ipaddress.ip_network(p).prefixlen, via)
               for p, via in routes
               if addr in ipaddress.ip_network(p)]
    return max(matches)[1]

for ip in ["192.0.2.90", "192.0.2.200", "198.51.100.8"]:
    print(f"{ip}: route via {best_route(ip)}")

Output:

192.0.2.77/26: network 192.0.2.64, broadcast 192.0.2.127
  conventional hosts 192.0.2.65 to 192.0.2.126, count 62
192.0.2.150/26: network 192.0.2.128, broadcast 192.0.2.191
  conventional hosts 192.0.2.129 to 192.0.2.190, count 62
delay: 2 ms + 4 ms transmit + 4 ms propagation = 10 ms
192.0.2.90: route via C
192.0.2.200: route via B
198.51.100.8: route via A

A note on method: the conventional host count uses net.hosts(), which excludes the network and broadcast addresses. For /31 point-to-point links, RFC 3021 changes that convention, which is why question 2 warns against applying the rule blindly.

8. A 20-minute revision routine

  • 5 minutes: explain next-hop delivery aloud and sketch the frame/IP distinction.
  • 5 minutes: solve the /26 subnet without looking at the answer.
  • 5 minutes: solve the two-link delay numerical with units.
  • 5 minutes: compare flow/congestion control and diagnose the HTTP 404 example.

For code-based exercises, use the Computer Networks Lab File. The Numericals Hub collects separate worked guides. Find your other subjects in the semester-wise Exam Notes hub.

Exam and interview quick answers

  1. Which address changes at every hop? The link-layer (MAC) addresses. The IP destination stays the same unless a device translates it.
  2. Why subtract two in an ordinary IPv4 host count? One address names the network and one is the conventional broadcast.
  3. Why doesn't a faster link remove all delay? It cuts transmission delay, but propagation delay depends on distance and signal speed.
  4. Does TCP preserve message boundaries? No. It delivers an ordered byte stream; the application must frame its own messages.
  5. Is an application on UDP always unreliable? No. UDP adds no guarantee, but the application can add acknowledgments and retransmission; QUIC does exactly this.
  6. DNS resolves but you see HTTP 404. DNS problem? No. Resolution succeeded and a response arrived; check the path and server routing.
  7. Two routes match a destination. Which wins? The longest matching prefix; /26 beats /24, which beats the default route.
  8. Why does store-and-forward matter in delay questions? Each device must receive the whole packet before forwarding, so transmission delay is paid on every link.

Sources and further reading

The questions, examples and revision routine are original. Protocol facts were checked against RFC 9293: TCP, RFC 4632: CIDR and Cloudflare's subnet explanation. Documentation-address usage is described in RFC 5737. IPv4 /31 exceptions are covered in RFC 3021. QUIC is specified in RFC 9000.

Which answer is hardest to explain without memorizing? Ask a specific question in the comments.

Comments