Computer Networksकंप्यूटर नेटवर्कquestions and answersप्रश्न और उत्तर
Networking MCQs mix definitions with a little arithmetic. Knowing which layer does what, and how to count addresses in a subnet, covers most of them.
Unlimitedअसीमितfresh questionsनए प्रश्न
Answersउत्तरalways one tap awayहमेशा एक टैप दूर
1subtopicउप-टॉपिक
TCS NQT ~1
Practice questions are in English for now.अभ्यास के प्रश्न अभी अंग्रेज़ी में हैं।
How computer networks worksकंप्यूटर नेटवर्क को समझिए
Each layer serves the one above it: the transport layer (TCP/UDP) gives end-to-end delivery, the network layer (IP) routes packets, the data-link layer moves frames on one link.
TCP is connection-oriented and reliable; UDP is connectionless and faster, suited to streaming and DNS lookups.
A subnet mask splits an IP address into network and host bits; usable hosts are 2^(host bits) minus the network and broadcast addresses.
Each trick says when to use it, why it works and when it fails. Formula tricks are checked by code over their whole range.हर ट्रिक बताती है कि उसे कब इस्तेमाल करें, वह क्यों काम करती है और कब नहीं। सूत्र वाली ट्रिक्स को कोड से उनकी पूरी रेंज पर जाँचा गया है।
Formulaसूत्र✓ Checked on 23 cases✓ 23 मामलों पर जाँची गई
Usable hosts = 2^(32 − prefix) − 2
Use it when:कब इस्तेमाल करें: “How many hosts can a /27 network have?”
Host bits = 32 − prefix length.
Usable hosts = 2^(host bits) − 2 (network and broadcast addresses are reserved).
Exampleउदाहरण
/27
→ 2^5 − 2 = 30 hosts
Why it works, and when it failsयह क्यों काम करती है, और कब नहीं
Why:क्यों: Each host bit doubles the addresses; the all-zeros and all-ones host parts are the network and broadcast addresses.
Limits:सीमाएँ: /31 point-to-point links and /32 single hosts are special cases.
Solved examplesहल किए गए उदाहरण
Answers and full solutions are shown. Hide them to test yourself first.उत्तर और पूरे हल दिखाए गए हैं। पहले खुद को परखने के लिए इन्हें छिपाइए।
Example 1उदाहरण 1 · Computer Networks · Easyआसान
A socket is uniquely identified by which combination?
IP address and port number
MAC address and port number
IP address only
Port number only
Answer:उत्तर:IP address and port number
Recall socket = (IP, port) pair for each endpoint.
Both source and destination sockets use this tuple.
Example 2उदाहरण 2 · Computer Networks · Mediumमध्यम
Host X wants to send a frame to Host Y on the same Ethernet LAN. Host X knows Y's IP address but not its MAC address. Which protocol does Host X use to discover Y's MAC address?
RARP
ARP
ICMP
DHCP
Answer:उत्तर:ARP
Host X needs MAC for known IP.
It broadcasts ARP request.
Host Y replies with its MAC.
Example 3उदाहरण 3 · Computer Networks · Hardकठिन
A network administrator allocates the IPv4 block 192.168.10.0/24 for a new office. She needs to create 4 equal-sized subnets. What is the subnet mask for each subnet in dotted decimal notation?
255.255.255.192
255.255.255.224
255.255.255.240
255.255.255.248
Answer:उत्तर:255.255.255.192
Original prefix /24.
Need 4 subnets => borrow 2 bits (2^2=4).
New prefix = 26.
Convert /26 to dotted decimal: 255.255.255.192.
Example 4उदाहरण 4 · Computer Networks · Mediumमध्यम
Host X wants to send a frame to Host Y on the same Ethernet LAN. Host X knows Y's IP address but not its MAC address. Which protocol does Host X use to discover Y's MAC address?
RARP
ARP
ICMP
DHCP
Answer:उत्तर:ARP
Host X needs MAC for known IP.
It broadcasts ARP request.
Host Y replies with its MAC.
Example 5उदाहरण 5 · Computer Networks · Mediumमध्यम
Host X wants to send a frame to Host Y on the same Ethernet LAN. Host X knows Y's IP address but not its MAC address. Which protocol does Host X use to discover Y's MAC address?
RARP
ARP
ICMP
DHCP
Answer:उत्तर:ARP
Host X needs MAC for known IP.
It broadcasts ARP request.
Host Y replies with its MAC.
Example 6उदाहरण 6 · Computer Networks · Mediumमध्यम
In a routing table, what does the metric value represent?
The IP address of the next hop
The administrative distance of the route
The cost to reach the destination network
The subnet mask of the destination
Answer:उत्तर:The cost to reach the destination network
Identify the columns in a typical routing table.
Metric indicates path cost (e.g., hop count, bandwidth).
Common mistakesआम गलतियाँ
Putting routers at the data-link layer.
Forgetting to subtract 2 when counting usable hosts.
Calling UDP reliable.
Frequently asked questionsअक्सर पूछे जाने वाले प्रश्न
How many hosts does a /26 subnet have?
32 addresses, 30 usable hosts.
Is DNS TCP or UDP?
Mostly UDP on port 53; TCP is used for large responses and zone transfers.
Are the answers checked?
Yes: lint rules, a blind solve by a second AI model and a human sample review.