How the examiner runs a CN lab viva
A typical computer networks lab has three kinds of experiments: C or Java programs that implement a protocol idea, such as framing, CRC, Hamming code, stop-and-wait or sliding window, distance vector and Dijkstra routing, and client-server sockets; network simulation in NS2, NS3 or Cisco Packet Tracer; and commands such as ping, tracert, ipconfig, netstat and nslookup, often with a Wireshark capture. At the practical you run one experiment and then face a five-to-ten-minute viva. Viva marks are a separate part of the practical marks under most university schemes.
- First, your experiment: 'explain your CRC output' or 'what happens in your server program after accept?'
- Then the layer: 'at which OSI layer does this work, and what is its data unit called?'
- Then a calculation: a subnet mask, the number of hosts, or the CRC remainder for a short message.
- Then a comparison: TCP versus UDP, switch versus router, distance vector versus link state.
- Port numbers and the three-way handshake come up in almost every CN viva.
Network basics, topologies and media
What is a computer network?
A computer network is a set of computers and devices connected by wired or wireless links so they can share data and resources such as files, printers and an internet connection. The college lab, where every PC reaches the server through a switch, is a local area network.
What is the difference between LAN, MAN and WAN?
A LAN covers a small area such as a building or campus and is fast and privately owned. A MAN covers a city, like a cable TV or metro Ethernet network. A WAN covers countries or the world, with leased lines and the internet as the largest example.
What are the network topologies?
Bus, where all devices share one cable; star, where each device connects to a central switch; ring, where each device connects to two neighbours in a loop; mesh, where devices have direct links to many or all others; and tree and hybrid, which combine these. Star is the most common today.
How many links does a full mesh of n devices need?
n into n minus 1 by 2 links, because every pair of devices has its own link. Five devices need 10 links. Full mesh is very reliable, since there is no single point of failure, but cabling and ports make it expensive.
What are simplex, half-duplex and full-duplex?
In simplex, data flows one way only, like a keyboard to a computer. In half-duplex, both sides can send but not at the same time, like a walkie-talkie. In full-duplex, both send at the same time, like a phone call or a modern switched Ethernet link.
What are guided and unguided media?
Guided media carry signals along a physical path: twisted-pair cable, coaxial cable and optical fibre. Unguided media send signals through air or space: radio waves, microwaves and infrared, as in Wi-Fi, mobile networks and satellite links.
Why is optical fibre better than copper cable?
Fibre carries light by total internal reflection, so it offers far higher bandwidth, much lower loss over long distances and immunity to electromagnetic interference. It is also harder to tap. Its drawbacks are higher cost and the careful installation and splicing it needs.
What is the difference between bandwidth, throughput and latency?
Bandwidth is the maximum data rate a link can carry, in bits per second. Throughput is the rate actually achieved, which is usually lower. Latency is the time a bit takes to travel from source to destination, made up of propagation, transmission, queuing and processing delays.
What are unicast, multicast and broadcast?
Unicast sends a packet to one specific receiver. Multicast sends it to a group of receivers that have joined, using class D addresses in IPv4. Broadcast sends it to every device on the network segment, as ARP requests do.
OSI and TCP/IP models
Name the seven layers of the OSI model.
From bottom to top: physical, data link, network, transport, session, presentation and application. Each layer provides services to the one above it and uses the services of the one below. The OSI model was published by ISO as a reference model.
A memory line from the bottom: Please Do Not Throw Sausage Pizza Away.
What are the data units at each layer?
Bits at the physical layer, frames at the data link layer, packets at the network layer, and segments at the transport layer for TCP, or datagrams for UDP. The upper layers simply call it data or a message.
What does the transport layer do that the network layer does not?
The network layer delivers packets from host to host using IP addresses and routing. The transport layer delivers data from process to process using port numbers, and in TCP adds reliability, ordering, flow control and congestion control.
What do the session and presentation layers do?
The session layer sets up, manages and ends sessions between applications, including checkpoints for recovery. The presentation layer handles data format: translation between encodings, compression and encryption. In the TCP/IP model both are folded into the application layer.
What is the TCP/IP model, and how does it differ from OSI?
TCP/IP has four layers: network access or link, internet, transport and application; some textbooks show five by splitting physical and data link. OSI is a seven-layer reference model; TCP/IP is the practical model the internet actually runs on, built around its protocols.
What is encapsulation?
As data moves down the layers at the sender, each layer adds its own header, and the data link layer also adds a trailer, wrapping the data from the layer above. At the receiver each layer removes its header, which is decapsulation. I could see these nested headers in the Wireshark capture.
At which layers do a hub, a switch and a router work?
A hub and a repeater work at the physical layer, a switch and a bridge at the data link layer, and a router at the network layer. A gateway can work at any layer up to the application layer, translating between different protocols.
What is the difference between a hub and a switch?
A hub repeats every incoming signal out of all other ports, so all devices share one collision domain. A switch learns MAC addresses into a table and forwards each frame only to the port of the destination, giving each port its own collision domain and better performance.
Data link layer: MAC, errors and flow control
What is a MAC address?
A MAC address is the 48-bit hardware address of a network interface, written as six pairs of hexadecimal digits. The first 24 bits identify the manufacturer, called the OUI. It is used for delivery within a local network, while the IP address is used across networks.
What is framing? Name the methods.
Framing divides the bit stream into frames so the receiver knows where each one starts and ends. Methods include character count, byte stuffing with flag bytes and escape characters, and bit stuffing, where a 0 is inserted after five consecutive 1s so the data never looks like the flag 01111110.
How does CRC work?
The sender appends zero bits equal to the degree of a generator polynomial, divides by the generator using modulo-2 division, which is XOR without carries, and replaces the zeros with the remainder. The receiver divides again; a zero remainder means no error was detected. Ethernet uses CRC-32.
What is the difference between error detection and correction?
Detection only finds that an error occurred, as parity, checksum and CRC do; the receiver then asks for retransmission. Correction finds and fixes the error at the receiver, as the Hamming code does for single-bit errors, which is useful where retransmission is costly.
How many redundant bits does a Hamming code need?
The number of redundant bits r must satisfy 2 to the power r being at least m plus r plus 1, where m is the number of data bits. For 7 data bits, r is 4, giving an 11-bit code. The parity bits sit at positions 1, 2, 4 and 8.
What is a checksum?
The sender splits the data into fixed-size words, adds them using 1's complement arithmetic and sends the complement of the sum. The receiver adds everything including the checksum; a result of all 1s, whose complement is zero, means no error was detected. IPv4, TCP and UDP use it.
How does stop-and-wait ARQ work?
The sender transmits one frame and waits for its acknowledgement before sending the next. If the timer expires without an acknowledgement, it retransmits. Frames are numbered 0 and 1 to detect duplicates. It is simple but wastes the link when propagation delay is long.
What is the difference between Go-Back-N and Selective Repeat?
Both use a sliding window. In Go-Back-N, the receiver accepts frames only in order, so after a lost frame the sender resends it and every frame after it. In Selective Repeat, the receiver buffers out-of-order frames and only the lost frame is resent, saving bandwidth at the cost of more buffering.
What is the maximum window size in Go-Back-N and Selective Repeat?
With m-bit sequence numbers, the Go-Back-N sender window can be at most 2 to the power m minus 1, with a receiver window of 1. In Selective Repeat each window can be at most half the sequence space, 2 to the power m divided by 2. For 3-bit numbers that is 4, against 7 for Go-Back-N.
What is the difference between CSMA/CD and CSMA/CA?
In CSMA with collision detection, used by classic wired Ethernet, a station senses the channel, transmits, and if it detects a collision it stops and backs off for a random time. Wireless stations cannot reliably detect collisions, so Wi-Fi uses collision avoidance, with random backoff and acknowledgements.
What is the difference between a collision domain and a broadcast domain?
A collision domain is the segment where two frames sent together collide; each switch port is its own collision domain. A broadcast domain is the set of devices that receive a broadcast frame; a router or a VLAN boundary separates broadcast domains.
What is a VLAN?
A virtual LAN logically splits one physical switch network into separate broadcast domains, for example one for staff and one for students, even if they share switches. Traffic between VLANs must pass through a router or a layer 3 switch. IEEE 802.1Q tags frames with the VLAN ID.
Network layer: IP addressing, subnetting and routing
What is an IP address?
An IP address is the logical address of a device on a network, used to route packets between networks. An IPv4 address is 32 bits, written as four decimal numbers from 0 to 255, like 192.168.1.10. It has a network part and a host part, separated by the subnet mask.
What are the classes of IPv4 addresses?
By the first octet: class A is 1 to 126, class B 128 to 191, class C 192 to 223, class D 224 to 239 for multicast, and class E 240 to 255, reserved for experiments. 127 is kept for loopback. Classful addressing has been replaced by CIDR, but examiners still ask it.
What are private IP addresses?
Ranges reserved for internal networks that are not routed on the public internet: 10.0.0.0 slash 8, 172.16.0.0 slash 12 and 192.168.0.0 slash 16, defined in RFC 1918. Devices using them reach the internet through NAT on the router.
What is a subnet mask?
A 32-bit number with 1s for the network and subnet bits and 0s for the host bits. ANDing an IP address with the mask gives the network address. 255.255.255.0, or slash 24, means the first 24 bits are the network part.
Divide 192.168.1.0 slash 24 into four subnets.
Four subnets need 2 borrowed bits, so the prefix becomes slash 26 and the mask 255.255.255.192. Each subnet has 64 addresses and 62 usable hosts: 192.168.1.0, .64, .128 and .192 are the network addresses, and .63, .127, .191 and .255 the broadcast addresses.
Usable hosts are 2 to the power host bits, minus 2 for the network and broadcast addresses.
What is CIDR?
Classless inter-domain routing writes an address with a prefix length, like 10.1.0.0 slash 16, instead of fixed classes. Networks can be any size, which saves addresses, and several routes can be summarised into one, which keeps routing tables small.
What is NAT?
Network address translation lets many devices with private addresses share one public IP address. The router replaces the private source address and port with its public address and a port, records the mapping, and reverses it for replies. Home Wi-Fi routers do exactly this.
What is ARP?
The address resolution protocol finds the MAC address for a known IP address on the local network. The host broadcasts an ARP request asking who has this IP, the owner replies with its MAC by unicast, and the result is stored in the ARP cache, which arp minus a shows.
What is ICMP, and how does ping use it?
ICMP, the internet control message protocol, carries error and diagnostic messages for IP, such as destination unreachable and time exceeded. ping sends ICMP echo request messages and waits for echo replies, reporting the round-trip time and packet loss.
How does traceroute work?
It sends packets with TTL 1, 2, 3 and so on. Each router decrements the TTL, and the router where it reaches zero discards the packet and returns an ICMP time-exceeded message, revealing itself. Windows tracert sends ICMP echo requests; Linux traceroute sends UDP probes by default.
What are the main differences between IPv4 and IPv6?
IPv6 uses 128-bit addresses written in hexadecimal groups separated by colons, against 32 bits for IPv4. It has a simpler fixed header, no broadcast, built-in stateless address autoconfiguration, and routers do not fragment packets. It was created mainly because IPv4 addresses ran out.
What is the difference between static and dynamic routing?
In static routing the administrator enters routes by hand, which suits small, stable networks. In dynamic routing, routers exchange information with protocols such as RIP or OSPF and update their tables automatically when links change.
What is the difference between distance vector and link state routing?
In distance vector, each router shares its table with neighbours and uses the Bellman-Ford algorithm; RIP is the example, and it suffers from count-to-infinity. In link state, each router floods its link information to all, builds the full map and runs Dijkstra's shortest path; OSPF is the example.
What are RIP, OSPF and BGP?
RIP is a distance vector protocol using hop count, with a maximum of 15 hops. OSPF is a link state protocol using cost, suited to large networks. Both work inside one organisation. BGP is the path vector protocol that routes between autonomous systems across the internet.
Transport layer: TCP, UDP and ports
What is the difference between TCP and UDP?
TCP is connection-oriented and reliable: it sets up a connection, numbers bytes, acknowledges and retransmits, keeps order and controls flow and congestion. UDP is connectionless with no guarantee of delivery or order, but has an 8-byte header and low delay, so it suits DNS queries, streaming and online games.
Explain the TCP three-way handshake.
The client sends a SYN with its initial sequence number. The server replies with SYN-ACK, acknowledging it and sending its own sequence number. The client replies with ACK, and the connection is established. Closing normally uses FIN and ACK from each side, four segments.
What is a port number?
A 16-bit number, from 0 to 65535, that identifies a process or service on a host. Ports 0 to 1023 are well-known ports for standard services, such as 80 for HTTP. An IP address plus a port number identifies one end of a connection, called a socket.
Name the common well-known port numbers.
FTP 20 and 21, SSH 22, Telnet 23, SMTP 25, DNS 53, DHCP 67 for the server and 68 for the client, HTTP 80, POP3 110, IMAP 143, SNMP 161 and HTTPS 443.
Say them in ascending order; it is easier to recall under pressure.
What is the difference between flow control and congestion control?
Flow control stops a fast sender from overwhelming a slow receiver; in TCP the receiver advertises its window size. Congestion control stops senders from overloading the network itself; TCP adjusts its congestion window based on losses and delays.
How does TCP congestion control work?
In slow start, the congestion window starts small and roughly doubles every round-trip time until it reaches a threshold. Then congestion avoidance increases it by about one segment per round trip. On a loss, the window is cut, multiplicatively, and the threshold reduced. This is called AIMD.
Why does DNS mainly use UDP?
A DNS query and its reply are usually small and fit in one packet each, so UDP avoids the delay of a TCP handshake. DNS uses TCP for zone transfers between servers and when a response is too large for UDP.
What are the leaky bucket and token bucket algorithms?
Both shape traffic. The leaky bucket sends packets out at a constant rate whatever the input, smoothing bursts but wasting idle capacity. The token bucket adds tokens at a fixed rate and lets a sender use saved tokens, so it allows controlled bursts.
Application layer and security basics
What is DNS, and how does name resolution work?
The domain name system translates names like www.example.com into IP addresses. The client asks a recursive resolver, which, if the answer is not cached, queries a root server, then the top-level domain server for com, then the domain's authoritative server, and returns the address to the client.
How does DHCP assign an IP address?
In four steps, called DORA: the client broadcasts a Discover, the server replies with an Offer, the client sends a Request for that address, and the server confirms with an Acknowledge. The address is leased for a fixed time, along with the subnet mask, gateway and DNS server.
What is the difference between HTTP and HTTPS?
HTTP sends web requests and responses as plain text on port 80. HTTPS runs HTTP over TLS on port 443, so traffic is encrypted, the server is authenticated by its certificate and tampering is detected. HTTP itself is stateless, so sites use cookies to keep sessions.
What is the difference between SMTP, POP3 and IMAP?
SMTP sends and relays email between servers and from the client to its server. POP3 and IMAP are used by the client to read mail. POP3 typically downloads and removes mail from the server; IMAP keeps mail on the server and syncs folders across devices.
What is FTP, and why does it use two ports?
The file transfer protocol transfers files between client and server. It uses port 21 for the control connection, which carries commands, and a separate data connection, port 20 in active mode, for the file contents. It sends passwords in plain text, so SFTP or FTPS are preferred.
What is a firewall?
A firewall monitors and filters network traffic according to rules, allowing or blocking packets by address, port, protocol or connection state. It can be hardware at the network edge or software on a host, like Windows Defender Firewall or iptables on Linux.
What is the difference between symmetric and asymmetric encryption?
Symmetric encryption uses one shared key to encrypt and decrypt, as in AES, and is fast. Asymmetric encryption uses a public key to encrypt and a private key to decrypt, as in RSA, which solves key distribution but is slower. TLS uses asymmetric methods to agree on a symmetric session key.
What is a digital signature?
The sender hashes the message and encrypts the hash with their private key. The receiver decrypts it with the sender's public key and compares it with a fresh hash of the message. A match proves the sender's identity and that the message was not altered.
What is a proxy server?
A server that sits between clients and the internet and forwards requests on their behalf. It can cache pages, filter content and hide the clients' addresses. Many college networks route student web traffic through a proxy.
Lab tools, simulators and socket programming
Which network commands did you use in the lab?
ipconfig on Windows, or ip addr on Linux, to see the IP address, mask and gateway; ping to test reachability; tracert or traceroute to see the path; netstat to list connections and listening ports; nslookup to query DNS; and arp minus a to view the ARP cache.
What is Wireshark used for?
Wireshark is a packet analyser that captures traffic on an interface and decodes each packet layer by layer. In the lab I captured a ping and saw the Ethernet, IP and ICMP headers, and filtered a web visit to see the TCP handshake and the DNS query.
What is Cisco Packet Tracer?
A network simulation tool from Cisco Networking Academy for building topologies with routers, switches and PCs, configuring them and watching packets move in simulation mode. I used it to build a star topology, assign IP addresses and configure static routing between two networks.
What are NS2 and NS3?
They are discrete-event network simulators used in research and teaching. NS2 uses C plus plus with OTcl scripts and NAM for animation; NS3 is a newer, separate simulator written in C plus plus with Python bindings. We used them to compare TCP and UDP throughput and measure packet drops.
What is a socket?
A socket is an endpoint for communication between two processes, identified by an IP address and a port number. A TCP connection is identified by the pair of sockets at both ends. In C, a socket is created with the socket system call and used like a file descriptor.
What are the steps in a TCP client-server program?
The server calls socket, bind to attach an address and port, listen, and accept, which blocks until a client connects. The client calls socket and connect. Both then use send and recv, or read and write, and finally close. In my chat program the server echoed each message back.
How is a UDP socket program different?
There is no listen, accept or connect. The server creates a datagram socket and binds it; the client creates a socket and sends directly with sendto, naming the destination each time, and both receive with recvfrom. There is no guarantee each datagram arrives.
What does the bind call do, and why does the client usually skip it?
bind attaches a socket to a specific local IP address and port, which a server needs so clients know where to connect. A client usually does not call bind, because the operating system assigns it a temporary port automatically when it connects or sends.
Common mistakes in a CN viva
- Mixing up the layers of a switch and a router. Switch: data link, MAC addresses. Router: network, IP addresses.
- Saying UDP is unreliable so it is useless. It is chosen where low delay matters more than retransmission.
- Forgetting to subtract 2 when counting usable hosts in a subnet.
- Saying ping uses TCP. It uses ICMP echo request and echo reply.
- Calling a MAC address 32 bits or an IPv6 address 64 bits. They are 48 and 128 bits.
- Reciting all seven OSI layers but not being able to place your own experiment, like CRC, in the data link layer.
- Reading your socket code line by line instead of explaining the sequence of calls.
What the ExamPilot AI examiner checks when you practise
In a CS/IT lab viva session on ExamPilot you name your CN experiment, say CRC, sliding window or a TCP chat program, and an AI examiner questions you by voice for about ten minutes: your output, the layer it belongs to, a subnetting or CRC calculation worked aloud, a comparison, and port numbers. It follows up whenever an answer is vague. You can answer in English or Hindi.
- Layer placement: whether you can put any protocol or device in the right layer with a reason.
- Worked calculations said step by step: mask, block size, hosts, broadcast address.
- Exact facts: address sizes, port numbers, handshake order.
- Comparisons that lead with the deciding difference.
- Brevity and honesty: two or three sentences, and a clean 'I am not sure' rather than a guess.
- Fluency and pace, since a clear explanation is part of the viva mark.
Start with the CS/IT lab viva mock. You get a transcript, the questions you fumbled and a tighter version of each answer to say again.
The night before the CN lab exam
- 1
Run each experiment once
Change one input, like the generator polynomial or the window size, and predict the output before you run it.
- 2
Solve two calculations by hand
Split a slash 24 into four or eight subnets with masks and broadcast addresses, and compute a CRC remainder for a short message.
- 3
Say the lists without looking
The seven OSI layers with their data units, the well-known ports, the three-way handshake and DHCP's four steps.
- 4
Run one mock viva
Ten minutes with the AI examiner shows which answers come out cleanly and which ones you only recognise on paper.
Most CN lab programs are in C or Java, so revise C programming viva questions or Java viva questions for questions on your code. The same semester often brings operating system viva questions and DBMS viva questions. For how every lab viva works, read the engineering viva questions hub.
Frequently asked questions
- What are the most important computer network viva questions?
- The OSI layers and their data units, TCP/IP versus OSI, hub versus switch versus router, MAC versus IP address, IP classes and subnetting, ARP, ICMP and ping, TCP versus UDP, the three-way handshake, well-known ports, DNS and DHCP, CRC and sliding window protocols, and distance vector versus link state routing. Before these, expect questions on your own experiment.
- Do examiners ask subnetting in a CN viva?
- Often, because it takes a minute and shows whether you understand addressing. A typical question is to split a slash 24 network into four subnets and give the mask, the number of usable hosts and the broadcast address of one subnet. Work it out aloud: bits borrowed, block size, then the ranges. A clear method matters more than speed.
- What is the difference between cn viva questions and computer network interview questions?
- A lab viva starts from your experiment and stays close to the syllabus: layers, protocols, error control and the programs you wrote. Placement interviews ask the same core, especially TCP versus UDP, what happens when you type a URL, DNS and HTTP, but expect a real-world explanation rather than a textbook definition. The answers on this page work for both.
- How long should a CN viva answer be?
- Two or three sentences, about twenty to thirty seconds, for a definition or comparison. For a calculation, talk through each step. If the examiner wants more, they ask a follow-up, and handling that well is where full marks come from. Long answers invite interruptions and often contain the mistake that the examiner then chases.
- How can I practise computer network viva questions out loud?
- Reading a list of ports is easy; recalling them while an examiner waits is not. On ExamPilot you can run a CS/IT lab viva by voice: name your CN experiment, and the AI examiner asks about it, makes you work out a subnet aloud and follows up like an external examiner, then gives a transcript to review. It is free to start, in English or Hindi.
Practise out loud
Practise your CN lab viva out loud
The AI examiner asks about your CN experiment, makes you place it in a layer and work a subnet aloud, and scores correctness, clarity and brevity.
Engineering Viva · CS / IT lab viva
Official sources
- RFC 791 — Internet Protocol
- RFC 9293 — Transmission Control Protocol
- RFC 768 — User Datagram Protocol
- RFC 1918 — Address Allocation for Private Internets
- RFC 2131 — Dynamic Host Configuration Protocol
- RFC 8200 — Internet Protocol, Version 6 (IPv6)
- IANA — Service Name and Transport Protocol Port Number Registry
