Computer Networks · IP Addressing, Fragmentation & Address Resolution
42 questions, newest first
GATE CSE has asked 42 questions on IP Addressing, Fragmentation & Address Resolution (Computer Networks) from 2003 to 2026, in 27 of the 46 papers; the most recent is in GATE CSE 2026 Set 2. In the last five years it carried 2 marks per 100-mark paper on average, against 1.8 since 2003. Since 2014 the questions have been 14 MCQ, 9 NAT and 5 MSQ. 8 groups of questions here are solved the same way; “One per method” keeps the newest of each.
An ISP controls 202.16.0.0/15 and must allocate a single CIDR block able to hold 6000 addresses. Which proposed allocations are valid: A 202.16.0.0/19; B 202.17.64.0/19; C 202.16.32.0/19; D 202.17.24.0/19?
Select all that apply
Answer & solution
Official answer: A, B, C
Step through it (6 steps)
Givens and goal
An ISP controls 202.16.0.0/15 and must allocate a single CIDR block able to hold 6000 addresses. Which proposed allocations are valid: A 202.16.0.0/19; B 202.17.64.0/19; C 202.16.32.0/19; D 202.17.24.0/19?
Approach
Round the requested count up to a power of two, then check both containment in the parent network and alignment of the network address.
Step-by-step solution
1. A single CIDR allocation must have a power-of-two address count. Since 212=4096<6000≤8192=213, the smallest fitting block is /19, containing 8192 addresses. 2. A /19 boundary leaves thirteen host bits. Its mask is 255.255.224.0, so the fourth octet must be zero and the third octet must be a multiple of 32. 3. The ISP's /15 block spans second-octet values 16 and 17 with first octet 202. The candidates in A, B and C are all within that range and use aligned third octets 0, 64 and 32 respectively. 4. D uses third octet 24, which is not a multiple of 32. It is a host address inside the /19 network starting at third octet 0, not the canonical start of a distinct /19 allocation. Therefore exclude D.
Interpretation note: A request for 6000 addresses is rounded up to a CIDR block that can hold at least that many; a single /19 does not contain exactly 6000. The eligibility result is unchanged if a conventional subnet reserves two addresses, since 8190 remains sufficient.
Network-range check: A spans 202.16.0.0 through 202.16.31.255; C spans 202.16.32.0 through 202.16.63.255; B spans 202.17.64.0 through 202.17.95.255. All lie inside the parent range 202.16.0.0 through 202.17.255.255. For D, masking third octet 24 by 224 gives 0, demonstrating that 202.17.24.0/19 normalizes to 202.17.0.0/19 rather than naming an aligned block beginning at 24.
Which protocol may need to broadcast some application messages? A SMTP; B FTP; C DHCP; D HTTP.
Your answer
Answer & solution
Official answer: C
Givens and goal
Which protocol may need to broadcast some application messages? A SMTP; B FTP; C DHCP; D HTTP.
Approach
Consider what a client knows before it has an IP configuration.
Step-by-step solution
1. A newly connected DHCP client may have neither a usable IP address nor the address of a DHCP server. It cannot begin by directing all messages to a known server address. 2. It can broadcast a DHCPDISCOVER message so reachable DHCP servers can respond. Depending on the state and flags, later DHCP messages may also be broadcast. 3. SMTP transfers mail, FTP transfers files, and HTTP exchanges web requests and responses conventionally using unicast communication with an identified endpoint. They do not have the same initial address-discovery requirement. 4. Therefore C is correct. The word may matters: DHCP can also use unicast in appropriate states; the claim is not that every DHCP message is broadcast. Link-layer discovery used beneath another protocol should not be confused with that protocol’s application messages.
An IPv4 subnet has mask 255.255.240.0. Find the maximum number of conventional network-interface addresses assignable in that subnet.
Answer & solution
Official answer: 4094
Step through it (3 steps)
Givens and goal
An IPv4 subnet has mask 255.255.240.0. Find the maximum number of conventional network-interface addresses assignable in that subnet.
Approach
Count host bits and remove the two reserved endpoint addresses.
Step-by-step solution
1. The mask in binary is 11111111.11111111.11110000.00000000. It contains 8+8+4=20 leading ones, so the prefix length is /20. 2. An IPv4 address has 32 bits. The host portion therefore has 32−20=12 bits and permits 2¹²=4096 different bit patterns. 3. The all-zero host field denotes the subnet itself, while the all-one host field is the subnet-directed broadcast address. Neither is assigned to a conventional interface in this subnet. 4. Thus the usable count is 4096−2=4094. The special treatment of /31 point-to-point links is irrelevant to a /20 subnet. Reserving addresses administratively would reduce a particular deployment’s capacity, but no such reservation is specified.
A 15000-byte message travels Source→Router 1→Router 2→Destination. Router 1 has MTU 5000 bytes and Router 2 MTU 3000 bytes, each including its IPv4 header. How many fragments reach the destination? Use ordinary IPv4 fragmentation; no reassembly takes place at intermediate routers.
Answer & solution
Official answer: 7
Approach: Fragment at the first MTU, then split each existing fragment separately at the second MTU. Nonfinal IPv4 fragment payloads must be multiples of eight bytes. Using a standard 20-byte header, Router 1 can carry at most floor((5000−20)/8)×8=4976 payload bytes in a nonfinal fragment. Treating 15000 as payload gives fragment payloads 4976,4976,4976,72, so four fragments leave Router 1. At Router 2, the aligned maximum is floor((3000−20)/8)×8=2976. Each 4976-byte payload splits into 2976 and 2000 bytes, producing two fragments. The final 72-byte payload already fits and stays as one. Thus the destination receives 2+2+2+1=7 fragments. It would be wrong to divide the original payload by Router 2’s MTU as though all first-stage fragments were reassembled; IPv4 routers do not coalesce them. If the original 15000 bytes includes its header, the first-stage remainder becomes 52 instead of 72, with the same total count. The count also remains seven for ordinary legal IPv4 header lengths.
An IPv4 packet's Protocol field names the protocol carried immediately inside IPv4. Which listed protocol is not normally a possible direct value for this purpose? Options: A. ICMP; B. IGMP; C. OSPF; D. RIP.
Your answer
Answer & solution
Official answer: D
The IPv4 Protocol field identifies the next encapsulated protocol, not every protocol that may appear farther inside the payload. ICMP, IGMP, and OSPF all run directly over IP and have assigned IPv4 protocol numbers 1, 2, and 89 respectively. Therefore A, B, and C are possible.
RIP messages are carried in UDP datagrams, conventionally using UDP port 520 for RIPv2. In such a packet the IP Protocol field is 17, identifying UDP. RIP is recognized by the transport-layer port and its message format rather than by a direct RIP value in this field. Thus D is the required exclusion. OSPF and RIP are both routing protocols, but they use different encapsulation, so their shared purpose does not imply the same packet layering.
Ethernet can carry at most 1500 bytes in its data field. IPv4 uses a 20-byte header with no options. A UDP datagram has 7488 bytes of application data. After IPv4 fragmentation, how many fragments are sent, and what is the total size of the last fragment including its IPv4 header? Options: A. 5 and 1488 bytes; B. 6 and 88 bytes; C. 6 and 108 bytes; D. 6 and 116 bytes.
Your answer
Answer & solution
Official answer: D
Step through it (4 steps)
UDP adds one 8-byte header to its 7488 data bytes. The payload of the original IPv4 datagram is therefore 7496 bytes. Each fragment must fit the 1500-byte Ethernet data field, and each has its own 20-byte IPv4 header. A full fragment can consequently carry 1500−20=1480 payload bytes.
Except for the last fragment, IPv4 fragment payload lengths must be multiples of 8 because fragment offsets are in 8-byte units. Here 1480=185·8, so the full payload size is usable. Divide the original payload: 7496=5·1480+96. There are five full fragments and one final fragment, hence six in total. The last has 96 payload bytes plus a 20-byte IPv4 header, or 116 bytes.
The UDP header is part of the original payload and appears only in the first fragment, not in every fragment. Omitting it would incorrectly give 88 bytes of last payload and 108 bytes including IP; 88 alone would additionally omit the final IP header. Answer: D.
For a packet moving from an internal network to an external network through ordinary source NAT, which listed IP-header fields are modified? A Source IP; B Destination IP; C Header Checksum; D Total Length.
Select all that apply
Answer & solution
Official answer: A, C
Approach: Identify the address translated by outbound NAT, then consider which dependent header field must be repaired. 1. Outbound source NAT replaces the private/internal source address with an externally visible source address. The remote recipient needs an address to which replies can be routed. Select A. 2. The destination remains the remote host requested by the sender in this standard source-NAT scenario. Destination translation is a different function, so B is not selected. 3. IPv4's header checksum covers the IPv4 header, including the source address. Altering that address requires a checksum update so the new header validates. Select C. 4. Replacing one fixed-width address with another neither inserts nor removes bytes. Total Length therefore does not change merely because of NAT; D is false. Answer: A and C. A device performing port translation also updates relevant transport-header fields, but those are not among these choices. The checksum option identifies the intended IPv4 model.
An IPv4 datagram totals 1420 bytes including a 20-byte header. It traverses a sender-to-router link with MTU 542, then a router-to-receiver link with MTU 360. Assuming ordinary permitted fragmentation and 20-byte fragment headers, how many fragments reach the receiver?
Answer & solution
Official answer: 6
Step through it (8 steps)
Approach: MTU includes each fragment's header. Nonfinal payload boundaries must align to eight-byte units, and the intermediate router fragments existing fragments rather than reassembling the original datagram. 1. Original payload is 1420−20=1400 bytes. On the first link, raw payload capacity is 542−20=522 bytes. Round down to a multiple of 8: floor(522/8)×8=520 bytes. 2. The sender creates payloads 520,520,360, each with a 20-byte header. Their original-data starting offsets are 0,520,1040 bytes. 3. On the second link, raw capacity is 360−20=340 bytes, with aligned nonfinal capacity floor(340/8)×8=336 bytes. Each 520-byte payload splits into 336+184; the 360-byte payload splits into 336+24. 4. Six payload fragments arrive: 336,184,336,184,336,24. Their starting offsets, in eight-byte units, are 0,42,65,107,130,172. Only the last has no more-fragments flag; total payload still sums to 1400. Answer: 6. Applying ceil(1400/336)=5 directly at the second link incorrectly assumes that the router reassembles and repacks the first-link fragments. Normal IPv4 forwarding leaves reassembly to the final destination, and fragmentation presumes DF is unset.
Which IPv4 statements are intended to be true? A only the source fragments; B any router fragments a datagram exceeding its outgoing MTU; C reassembly occurs only at the destination; D every intermediate router reassembles. The printed B does not mention the Don’t Fragment bit.
Select all that apply
Answer & solution
Official answer: B, C
Our answer: B;C when DF=0; C without that qualification
Approach: State the fragmentation-permitted model separately from the literal unrestricted assertion.
1. Derivation. In ordinary IPv4 with fragmentation permitted, an intermediate router can fragment a datagram larger than its outgoing MTU, and reassembly occurs only at the final IP destination. This gives the official B, C. However B is overbroad without the DF-bit condition: when Don’t Fragment is set, the router drops an oversized datagram and normally sends an ICMP fragmentation-needed message instead of fragmenting it. Thus B is not an unconditional statement about every IPv4 datagram. A and D are false; C remains true. Preserve official B, C, and distinguish the intended DF=0 model from the literal unrestricted claim.
2. Explanation and checks. A fragment is itself an IP packet and can follow routing decisions independently, so intermediate reassembly would both require storage and assume all fragments meet at the same router. Destination-only reassembly avoids that assumption. When DF=0 an oversized fragment or datagram may be fragmented further. When DF=1, B’s asserted behavior cannot occur: the router must not fragment.
Which IP-header fields are always updated by an ordinary forwarding router in the IPv4 model? A source IP; B protocol; C TTL; D header checksum.
Select all that apply
Answer & solution
Official answer: C, D
Approach: Find the field representing the remaining hop lifetime, then account for header integrity.
1. Derivation. An IPv4 router decrements TTL before forwarding. TTL is covered by the IPv4 header checksum, which must therefore be updated. Ordinary routing need not alter the source IP address or the upper-layer protocol field. Thus C, D. The header-checksum option makes the IPv4 model implicit.
2. Explanation and checks. TTL decreases as a packet is forwarded; if it expires the packet is discarded rather than forwarded. Changing TTL changes the header over which the IPv4 checksum is defined, so the checksum must be recomputed or incrementally adjusted. The protocol value still indicates the same encapsulated transport protocol. Source address changes can occur under NAT, but NAT is not a necessary operation of every router. IPv6 is a different header format and has no IPv4-style header checksum.
Which prefix exactly covers 10.12.2.0 through 10.12.3.255 inclusive? A 10.12.2.0/23; B 10.12.2.0/24; C 10.12.0.0/22; D 10.12.2.0/22.
Your answer
Answer & solution
Official answer: A
Step through it (6 steps)
Approach: Find the common binary prefix and verify both size and alignment.
1. Derivation. The range contains two consecutive /24 blocks, third octets 2 and 3. Their common prefix fixes the first 7 bits of that octet, yielding 16+7=23 network bits and 9 host bits. The aligned base is 10.12.2.0, so the exact 512-address range is 10.12.2.0/23, option A.
2. Explanation and checks. The third octets are 00000010 and 00000011: their first seven bits agree and their final bit varies. Together with the entire final octet, that leaves nine variable bits and 29=512 addresses. A /24 contains only 256 addresses. A /22 leaves ten host bits and spans four third-octet values, too many; moreover 10.12.2.0 is not an aligned /22 network base. Both endpoints of A agree exactly with the requested range.
Count internal enterprise subnets in this topology: Internet—firewall; firewall—left router; firewall—top router; top router—right router; top router—web server; left router—Ethernet LAN 1; right router—Ethernet LAN 2. Each LAN has several hosts. Exclude the Internet-facing external link. A 3; B 12; C 6; D 8.
Your answer
Answer & solution
Official answer: C
Count the separately routed internal links/LANs: two Ethernet LANs, firewall–left router, firewall–top router, top router–right router, and top router–web server. These are six subnets. The external Internet-facing link is outside the enterprise count. Thus C under the depicted routed-interface model.
A subnet groups interfaces sharing a layer-3 link, not individual computers. Therefore each multi-host Ethernet contributes one, not its host count. The four remaining internal point-to-point/server links each contribute one, making 2+4=6.
S1: The destination MAC address of an ARP reply is a broadcast address. S2: The destination MAC address of an ARP request is a broadcast address. Which is correct? A both true; B S1 true/S2 false; C S1 false/S2 true; D both false.
Your answer
Answer & solution
Official answer: C
In ordinary Ethernet ARP address resolution, a requester broadcasts because it does not yet know the target MAC address. The target learns the requester’s MAC from that request and unicasts the reply to it. Thus S1 is false and S2 true, C. This describes the normal request/reply exchange, not gratuitous ARP or implementation-specific unicast refresh traffic.
The requester already knows the destination IP but lacks its link-layer address. It therefore sends an Ethernet broadcast asking which host owns that IP. The request includes the requester's own sender MAC/IP, so the responding target has the information needed for a unicast reply. Do not confuse the IP address being resolved with the Ethernet destination field the statements ask about.
P sends a 1400-byte TCP segment to Q through router R. MTUs are 1500 bytes on P–R and 820 bytes on R–Q; IP headers are 20 bytes, identification 0x1234, and DF=0. Select true statements: A R creates two fragments and the second IP datagram is 620 bytes; B if the second fragment is lost, R retransmits it with ID 0x1234; C if it is lost, P must resend the whole TCP segment; D the TCP destination port can be obtained from the second fragment alone.
Select all that apply
Answer & solution
Official answer: A; C
The TCP segment is the 1400-byte IP payload. The original IP datagram is 1420 bytes and fits the first MTU. The second link allows 820-20=800 payload bytes per fragment, a multiple of eight. Fragment payloads are therefore 800 and 600 bytes, giving datagram sizes 820 and 620, so A holds. IP routers do not retransmit lost fragments, so B is false. Loss prevents reassembly of the original segment and TCP at P retransmits the unacknowledged data, corresponding to C in the ordinary unchanged-segmentation model. TCP may resegment retransmitted bytes in a more general implementation; it does not repair just the missing IP fragment. The TCP header is only in the first fragment, so the second alone does not reveal the destination port and D is false.
IPv4 fragment offsets count eight-byte units. The first fragment has offset 0, payload 800, total 820 and MF=1; the second has offset 100, payload 600, total 620 and MF=0. Both retain the original identification for reassembly. The receiver needs both to reconstruct the TCP segment. Reliable delivery belongs to TCP endpoints, not an IP router's fragment-repair service. A later TCP retransmission may choose new segmentation or a new IP identification; retaining the exam answer does not justify claiming otherwise.
An ISP owns 202.61.0.0/17 and wants one aggregatable block for 1500 computers. Candidate network starts: I 202.61.84.0/21; II 202.61.104.0/21; III 202.61.64.0/21; IV 202.61.144.0/21. Which candidates are valid? A I,II; B II,III; C III,IV; D I,IV.
Your answer
Answer & solution
Official answer: B
Step through it (6 steps)
Worked explanation
Host capacity first: /22 has 1024 total addresses and cannot serve 1500 machines; /21 has 2048 total, conventionally 2046 usable, so it suffices. A /21 mask is 255.255.248.0, making its third-octet start a multiple of 8. The available /17 spans third octets 0 through 127. I fails alignment because 84 mod 8=4. II starts at 104 and ends at 111, inside the allocation. III spans 64–71, also inside. IV is aligned but spans 144–151 outside the /17. Interpreting 84.0/21 as an arbitrary address within the 80.0/21 network would silently change the listed network start; the intended assessment uses actual aligned block bases.
Derivation and answer
A/21 block provides 2048 addresses, enough for 1500 hosts, and must begin on a multiple-of 8 boundary in the third octet.104 and 64 are aligned and lie within the/17 allocation’s third-octet range 0–127.84 is not an aligned network address, and 144 lies outside the allocation. Thus II andIII, B. This treats the supplied address as the claimed network start rather than silently normalizing a host-bearing prefix.
Machines M, N, P have IPv4 addresses 100.10.5.2, 100.10.5.5, 100.10.5.6 and all use mask 255.255.255.252. Are all in one subnet (A), only M/N together (B), only N/P together (C), or all in different subnets (D)?
Your answer
Answer & solution
Official answer: C
Step through it (5 steps)
1. Two IPv4 interfaces are in the same subnet when bitwise AND of each address with the subnet mask yields the same network address. The first three octets are identical here, so only the last octet needs calculation. 2. The last mask octet 252 is binary 11111100. Thus the two low bits are host bits and each subnet spans four consecutive addresses, starting at multiples of four. 3. M has last octet 2=00000010; AND with 11111100 gives 0. Its network is 100.10.5.0/30, covering last octets 0 through 3. 4. N has 5=00000101 and P has 6=00000110. Masking either gives 4=00000100. Both belong to 100.10.5.4/30, covering 4 through 7. 5. Only N and P share a subnet, so C is correct. Comparing the first three octets alone would incorrectly assume a /24 mask; the supplied /30 mask is decisive.
In an IP-over-Ethernet network, X needs the MAC address of Y in the same subnet. Choose between sending an ARP request to the gateway IP (A), gateway MAC (B), local broadcast MAC (C), or local broadcast IP (D).
Your answer
Answer & solution
Official answer: C
1. The task is address resolution: X knows Y's IP address but needs the link-layer destination address for an Ethernet frame on the local network. 2. ARP carries the target IP address in its request. Since X does not yet know Y's MAC address, it sends the Ethernet frame to FF:FF:FF:FF:FF:FF, the broadcast MAC address, so local hosts can inspect the request. 3. Y recognizes its own IP in the request and normally replies with its MAC address. X can then cache the mapping and send ordinary unicast Ethernet frames to Y. 4. Therefore C describes the needed technique. Neither gateway option is the ordinary same-subnet procedure: a router is used for off-subnet forwarding, not required to identify this local neighbor. 5. D confuses protocol layers. An ARP request is carried directly in an Ethernet frame; it is not an IP datagram sent to a broadcast IP destination. Its broadcast delivery is at the MAC layer.
An IPv4 packet is 4500 bytes including a 20-byte IP header and 40-byte TCP header. Router MTU is 600 bytes; each fragment has a 20-byte IP header and the first offset is zero. Find the third fragment’s stored offset.
Answer & solution
Official answer: 144
Step through it (4 steps)
Method
Fragment offset is measured in eight-byte units from the original IP payload start, not from the original IP header. A full fragment may hold 580 payload bytes by MTU, but a nonfinal fragment must end on an eight-byte boundary, so round down to 576. The first occupies payload bytes 0–575, the second 576–1151, and the third starts at 1152. Their stored offsets are 0,72,144. The TCP header travels as part of the first payload, without a new TCP header in later fragments.
Solution
Each fragment has room for 600−20=580 payload bytes. Nonfinal payload lengths must be multiples of 8, so use 576 bytes per full fragment. The third fragment starts after 2*576=1152 bytes of original IP payload, giving stored offset 1152/8=144. The40-byte TCP header is part of the IP payload and is not repeated or subtracted from every fragment. Fragmentation is assumed permitted, as the question prescribes outgoing fragments.
What is the maximum number of IPv4 router addresses that can be listed in the Record Route (RR) option field of one IPv4 header?
Answer & solution
Official answer: 9.0
Our answer: 9
1. The IPv4 IHL field can specify at most 15 words of 4 bytes, giving a 60-byte maximum header. The fixed header takes 20 bytes, leaving at most 40 for options and padding.
2. The Record Route option uses three control bytes: type, length and pointer. Therefore at most 40-3=37 bytes remain for recorded addresses. Each IPv4 address needs 4 bytes.
3. The maximum integer count is floor(37/4)=9. Nine addresses occupy 36 bytes plus 3 control bytes, and one padding byte brings the header options area to 40. Ten addresses would need 43 option bytes and cannot fit.
Which protocol is NOT used to resolve one form of address to another? A: DNS. B: ARP. C: DHCP. D: RARP.
Your answer
Answer & solution
Official answer: C
DNS resolves names to addresses, ARP resolves network-layer addresses to link-layer addresses, and RARP performs the reverse mapping. DHCP leases/configures host addressing rather than acting as an address-resolution protocol. Thus C.
Think of the direction of each lookup: DNS maps a domain name to an IP address; ARP maps a local network-layer address to a hardware address; RARP requests a protocol address from a hardware-address identity. DHCP instead assigns a lease and supplies configuration such as a subnet mask and default gateway. It may use address information internally, but that does not make its primary role address resolution in the sense asked here.
A router receives a 1000-byte IP datagram, including a 20-byte IP header, and must forward it over a link of MTU 100 bytes. Find the number of fragments, assuming IPv 4 fragmentation is permitted and each fragment has a 20-byte header.
Answer & solution
Official answer: 13.0 : 13.0
Our answer: 13
Step through it (4 steps)
The original datagram contains 1000−20=980 payload bytes. Each fragment can hold 100−20=80 payload bytes, already a multiple of 8 as required for nonfinal IPv 4 fragments. Twelve fragments carry 960 bytes and a thirteenth carries 20, so 13 fragments. This assumes IPv 4 fragmentation is permitted (DF=0); otherwise the router drops rather than fragments the datagram.
The MTU bounds each entire fragment, including its own header. Thus divide the 980-byte payload by 80, not the original 1000-byte datagram by 100. Each nonfinal fragment's payload must be a multiple of 8 for IPv 4 fragment offsets, and 80 already qualifies. The last fragment has 20 payload bytes plus its 20-byte header, for 40 bytes total; the other twelve total 100 bytes each. Repeated headers make aggregate transmitted bytes 1240, which is larger than the original datagram.
Which IPv4 header field is NOT modified by a typical IP router? A checksum; B source address; C Time To Live; D length.
Your answer
Answer & solution
Official answer: B
A forwarding router decrements TTL to prevent indefinite circulation and must recompute the header checksum accordingly. If it fragments an IPv4 datagram, each fragment's total length differs from the original. Routing alone leaves the source address identifying the originating host. NAT is a separate address-rewriting function and is outside the typical-forwarding premise.
Solution: Ordinary IPv4 forwarding preserves the source address, B. A router decrements TTL and updates the header checksum; fragmentation can alter total length. Address translation is an additional NAT function, not assumed here.
UDP user data 8880 bytes, UDP header 8 bytes, IPv4 header 20 bytes, no options, Ethernet MTU1500. Find number of IPv4 fragments and final fragment offset: A6, 925; B6, 7400; C7, 1110; D7, 8880.
Your answer
Answer & solution
Official answer: C
Step through it (4 steps)
IP payload includes the 8-byte UDP header, totaling 8888 bytes. Each full fragment holds 1500−20=1480 bytes, a multiple of 8. Six hold 8880 bytes, leaving 8 bytes for a seventh. Its offset is 8880/8=1110. Thus 7 fragments and 1110, C.
Fragmentation splits the IP payload, which already includes the entire UDP header:8880+8=8888 bytes. Each fragment gets its own 20-byte IP header, leaving 1480 payload bytes within the 1500MTU.1480 is divisible by 8, so six full payloads consume 8880 bytes and an 8-byte remainder requires a seventh fragment. The final fragment begins after 8880 original-IP-payload bytes; divide by the 8-byte offset unit to get 1110. Omitting the UDP header incorrectly gives only six fragments.
For the IPv4 network containing address 200.10.11.144/27, give the fourth octet in decimal of its last assignable host address. The printed address is not necessarily the canonical network base.
Answer & solution
Official answer: 158
Step through it (4 steps)
1. A/27 mask gives blocks of 32.
2. Address144 lies in 128..159, so network address 128 and broadcast 159 leave last usable host 158. The displayed 144/27 is a host/prefix designation, not the canonical subnet-base address.
An IP packet follows the illustrated path from sender S on Ethernet LAN L1, through ISP1 and ISP2, to receiver R on Token-Ring LAN L2. Textual diagram equivalent: the drawn path traverses six forwarding router boxes (including two adjacent boxes at L1's exit), with additional LAN stations shown as non-router symbols. Links inside and between ISPs are point-to-point optical links. Starting TTL is 32. What is the maximum TTL on arrival at R?
Answer & solution
Official answer: 26
1. Set up the reasoning. Count IP forwarding routers rather than hosts, link-layer stations, or physical link segments. Each router must decrement TTL by at least one; maximum remaining TTL uses a decrement of exactly one at every forwarding step.
2. Derive the result. The drawn path crosses six router boxes between the source and receiver, including the LAN-facing router before the first ISP. Each forwarding router reduces TTL by at least 1. Ordinary link-layer traversal does not reduce it, so the maximum final TTL is 32−6=26.
3. Check the interpretation. The Ethernet and Token-Ring media do not by themselves consume TTL. Counting the six boxes on the actual path gives six decrements, so the different LAN technologies do not alter the arithmetic.
Host A sends an IPv4 datagram to host B on another network without transmission errors. Which fields may differ when it reaches B: (i) TTL; (ii) header checksum; (iii) fragment offset? A i only; B i,ii only; C ii,iii only; D i,ii,iii.
Your answer
Answer & solution
Official answer: D
Step 1: Every forwarding router decrements TTL. Since TTL is part of the IPv4 header, the router updates the header checksum even on an error-free path. Thus i and ii can differ. Step 2: A smaller outgoing MTU can require fragmentation. Later fragments carry nonzero fragment offsets even if the original unfragmented datagram had offset zero. Step 3: Therefore all three may differ, D, when considering received fragment headers before reassembly. No-error transmission rules out corruption, not ordinary forwarding changes or fragmentation. A fully reassembled abstract datagram needs separate interpretation.
Each IPv4 host has a battery-backed real-time clock with 1-second resolution and a globally unique IPv4 address. Each must generate up to 1000 unique identifiers per second. Design a 50-bit global ID; after how many seconds does a host's identifier time field wrap around?
Answer & solution
Official answer: 256
Step 1: In the conventional fixed-field construction, reserve 32 bits for the globally unique IPv4 address so different hosts cannot collide. Step 2: To distinguish up to 1000 IDs generated in the same second, reserve ceil(log₂1000)=10 counter bits, because 2⁹<1000≤2¹⁰. Step 3: This leaves 50−32−10=8 bits for the timestamp in seconds. The timestamp cycles through 2⁸=256 values, so wraparound occurs after 256 seconds. This construction assumes no clock rollback and no counter reuse within a second; global uniqueness is limited by the timestamp wrap interval.
A router with MTU 1500 bytes receives a 4404-byte IPv4 packet whose header is 20 bytes. What are the third fragment's (MF,total length,offset) fields? A (0,1444,370); B (1,1424,185); C (1,1500,370); D (0,1424,2960).
Your answer
Answer & solution
Official answer: A
Step through it (4 steps)
Step 1: Remove the original header to get 4404−20=4384 payload bytes. Each full fragment can carry 1500−20=1480 bytes; this is a multiple of eight, as required for nonfinal fragment payloads. Step 2: Two full fragments carry 2960 payload bytes, leaving 4384−2960=1424 bytes for the third fragment. Add its own 20-byte header: total length 1444. Step 3: Its starting payload offset is 2960 bytes, stored in eight-byte units as 2960/8=370. It is the last fragment, so MF=0. Therefore A, assuming fragmentation is permitted and the arriving packet is an unfragmented original.
IPv4 has MF=0, HLEN=10, total length 400 bytes and fragment offset 300. Choose position and first/last payload byte indexes. A last, 2400, 2789; B first, 2400, 2759; C last, 2400, 2759; D middle, 300, 689.
Your answer
Answer & solution
Official answer: C
Step through it (4 steps)
MF=0 indicates the last fragment; its positive offset shows it is not the sole initial fragment. The first payload byte has zero-based index 300×8=2400. HLEN10 means 40 header bytes, leaving 400−40=360 payload bytes. The last byte index is 2400+360−1=2759. Therefore C.
The fragment offset unit is 8 bytes, not 1byte, so offset 300 starts at original payload byte2400. HLEN counts 32-bit words:10 words=40 bytes of header. Subtracting that from total length 400 leaves 360payload bytes. Inclusive indexing makes the final byte2400+359=2759. MF=0 says no more fragments follow; because the offset is nonzero, this is a final fragment rather than a complete unfragmented datagram beginning at 0.
In classful IPv4 addressing, how many Class C network numbers are allowed? (A) 2^14 (B) 2^7 (C) 2^21 (D) 2^24.
Your answer
Answer & solution
Official answer: C
Class C addresses begin with the three fixed bits 110. The first 24 bits identify the classful network, leaving 24−3=21 variable network-number bits. Thus the class has 221 network numbers, C. The last eight bits identify hosts within each network; this is historical classful counting, not modern CIDR allocation.
Check: There are 32 total address bits: three class-prefix bits, 21 variable network bits, and eight host bits. The question counts networks, not usable hosts, so subtracting network/broadcast host addresses from 28 is irrelevant.
An Internet Service Provider (ISP) has the following chunk of CIDR-based IP addresses available with it: 245.248.128.0/20. The ISP wants to give half of this chunk of addresses to Organization A, and a quarter to Organization B, while retaining the remaining with itself. Which of the following is a valid allocation of addresses to A and B? (A) 245.248.136.0/21 and 245.248.128.0/22 (B) 245.248.128.0/21 and 245.248.128.0/22 (C) 245.248.132.0/22 and 245.248.132.0/21 (D) 245.248.136.0/24 and 245.248.132.0/21
Your answer
Answer & solution
Official answer: A
Step through it (14 steps)
The /20 block spans third-octet values 128–143 and has 4096 addresses. A needs 2048 addresses, a /21 aligned on a multiple of 8, and B needs 1024 addresses, a /22 aligned on a multiple of 4. Option A assigns A the range 136–143 and B the range 128–131, disjoint and within the parent block, leaving 132–135. B overlaps its blocks; C has wrong sizes and an unaligned /21; D has wrong sizes. Hence A as subnet arithmetic. The supplied 245.x address lies in reserved 240.0.0.0/4 rather than ordinary public ISP unicast space, so the scenario is hypothetical.
Check: Splitting a /20 in half adds one prefix bit, giving /21; splitting it into quarters adds two, giving /22. The allocation to A must have twice as many addresses as B, and both blocks must also satisfy their alignment boundaries.
Similar questions1 more → · asked again: GATE 2006, Q5
Purpose of IP TTL
IP Addressing, Fragmentation & Address Resolution
Tap to enlarge
Which statement best explains why an IP datagram has a Time-to-Live (TTL) header field? Options: (A) To prioritize packets; (B) To reduce delays; (C) To optimize throughput; (D) To prevent packet looping.
Your answer
Answer & solution
Answer: D (no official key was published)
Routers decrement TTL as a datagram is forwarded and discard it when the limit is exhausted. A packet caught in a routing loop therefore cannot circulate indefinitely. This bounds packet lifetime rather than prioritizing traffic, directly reducing delay or optimizing throughput: D.
If routers A and B mistakenly route a destination through each other, the same packet can alternate indefinitely without a hop/lifetime bound. TTL makes each traversal consume part of a finite budget. It does not repair the routing error itself; it limits the damage by eventually dropping the circulating datagram.
Hosts A and B have IP addresses 10.105.1.113 and 10.105.1.91, with a common netmask N. Which mask must not be used if they are to belong to the same network? Options: (A) 255.255.255.0; (B) 255.255.255.128; (C) 255.255.255.192; (D) 255.255.255.224.
Your answer
Answer & solution
Answer: D (no official key was published)
Step through it (6 steps)
The last octets are 113=01110001₂ and 91=01011011₂. A /24 mask gives the same network. A /25 mask (128) gives last-octet network 0 for both; a /26 mask (192) gives 64 for both. A /27 mask (224) gives 96 for 113 and 64 for 91, placing the hosts in different subnets. Therefore 255.255.255.224 must not be used, option D.
Network membership is determined by bitwise AND of address and mask. Since the first three octets agree, only the final octet matters. /26 partitions that octet into ranges 0–63,64–127,128–191,192–255, so both hosts are in 64–127. /27 splits it further into 64–95 and 96–127, separating 91 from 113.
A Class B network uses subnet mask 255.255.248.0. What is the maximum number of hosts per subnet?
(A) 1022 (B) 1023 (C) 2046 (D) 2047
Your answer
Answer & solution
Answer: C (no official key was published)
Step through it (3 steps)
Step 1: 255.255.248.0 has 8+8+5=21 leading one bits because 248=11111000₂. Thus 32−21=11 host bits remain. Step 2: A subnet has 211=2048 addresses; reserving the all-zero host part for the subnet address and the all-one host part for broadcast leaves 2046 usable host addresses, option C. The original Class B label does not change the host count once the subnet mask is supplied.
A class B address is divided into subnets using a 6-bit subnet number. What maximum numbers of subnets and hosts per subnet are intended? Options: (A) 62 subnets,262142 hosts (B) 64 subnets,262142 hosts (C) 62 subnets,1022 hosts (D) 64 subnets,1024 hosts
Your answer
Answer & solution
Answer: C (no official key was published)
1. Approach. A class B prefix originally leaves 16 bits. Assigning six of those to subnet IDs leaves ten for hosts. Distinguish historical reserved subnet IDs from reserved host IDs and modern subnet conventions.
2. Derivation and interpretation. A class B network leaves 16 bits after its network prefix. Borrowing 6 subnet bits leaves 10 host bits, so usable ordinary unicast hosts per subnet are 210-2=1022. Under the historical convention excluding all-zero and all-one subnet numbers, the subnet count is 26-2=62, giving C. Modern subnetting permits those two subnet numbers and gives 64 subnets with 1022 hosts each; that pair is absent from the options. C is conditional on the obsolete convention, not a modern universal maximum.
Similar questions1 more → · asked again: GATE 2010, Q15
Purpose of IPv4 TTL
IP Addressing, Fragmentation & Address Resolution
Tap to enlarge
Why does IP put a Time-to-Live (TTL) field in the datagram header? Options: (A) Ensure delivery within that time (B) Discard packets that reach the destination later than that time (C) Prevent packets looping indefinitely (D) Limit the time spent queued in intermediate routers
Your answer
Answer & solution
Answer: C (no official key was published)
1. Every forwarding router decreases TTL, and a datagram is discarded when it expires. This bounds forwarding through a routing loop rather than promising delivery within a deadline.
2. Therefore C, preventing indefinite looping.
3. Teaching check: A routing loop may keep forwarding a datagram without delivering it. Decrementing a finite counter at each router eventually destroys that datagram even if the routing error persists. TTL does not reserve network resources or provide an end-to-end latency guarantee.
C1 has IP address 203.197.2.53 and mask 255.255.128.0. C2 has 203.197.75.201 and mask 255.255.192.0. What does each infer about the other’s network? Options: (A) Both consider the other local (B) C2 considers C1 local, but C1 considers C2 remote (C) C1 considers C2 local, but C2 considers C1 remote (D) Both consider the other remote
Your answer
Answer & solution
Answer: C (no official key was published)
Step through it (4 steps)
1. C1 uses /17, so both 203.197.2.53 and 203.197.75.201 map to 203.197.0.0. C2 uses /18, mapping itself to 203.197.64.0 and C1 to 203.197.0.0.
2. Therefore C1 treats C2 as local while C2 treats C1 as remote: C.
3. Teaching check: Each machine applies its own mask to both addresses. C1’s /17 groups third octets 0–127; C2’s /18 separates 0–63 from 64–127. Because the masks differ, being “on the same subnet” need not be a symmetric belief between these misconfigured hosts.
ARP is used to find: A IP address from DNS; B default gateway IP; C IP corresponding to a MAC; D MAC corresponding to an IP.
Your answer
Answer & solution
Answer: D (no official key was published)
On an IPv4 local link, ARP resolves a known next-hop IPv4 address to the corresponding link-layer/MAC address, D. It does not perform DNS name resolution or discover the default gateway’s IP configuration.
To send a local-link Ethernet frame, the sender needs a destination MAC address. Given the next-hop IPv4 address, ARP requests who owns it and learns the corresponding MAC, D. Name-to-IP lookup is DNS; determining which gateway to use comes from routing/configuration; reverse resolution is a different function. For a remote destination, the resolved MAC normally belongs to its next-hop router.
Starting with a /16 class-B network, borrow 6 bits to obtain 26=64 subnets. The /22 mask is 255.255.252.0, D. This uses all subnet numbers; the obsolete convention excluding all-zero/all-one subnets would require a different count and is not applied.
A class-B prefix starts with 16 network bits. Six additional subnet bits give 64 patterns, leaving 10 host bits. The resulting prefix length 22 has mask 11111111.11111111.11111100.00000000, or 255.255.252.0. This uses all 64 subnet numbers under the modern convention, rather than subtracting two obsolete reserved subnet patterns.
Networks A→B→C connect host HA in A to host HC in C. Every application message has 180 bytes; TCP adds a 20-byte header. Maximum IP packet sizes including a 20-byte IP header are A:1000 bytes, B:100 bytes, C:1000 bytes. A–B is 1 Mbps and B–C is 512 Kbps. GateForum labels the second link 512 Mbps in its diagram but 512 Kbps in prose; use the common GFG/prose reading, retaining this discrepancy. Assuming correct delivery and data packets only, how many total bytes including headers reach the destination IP layer for one application message in the best case? Options: (A) 200 (B) 220 (C) 240 (D) 260
Your answer
Answer & solution
Answer: D (no official key was published)
1. Each application message contributes 180 bytes plus 20 TCP-header bytes, so the IP payload is 200 bytes. The100-byte MTU in network B leaves 80 payload bytes per fragment.
2. Three fragments carry 80,80,40 bytes with their own 20-byte IP headers, totaling 100+100+60=260 bytes delivered to the destination IP layer.80 is divisible by the IPv4 fragment-offset unit 8, so this split is valid. Routers do not reassemble merely because the following network has a larger MTU.
3. Teaching check: Only IP headers are repeated per fragment; the TCP header belongs to the original 200-byte payload and is not added to each fragment. Payload sizes 80,80,40 need three IP headers, so 200+3×20=260 bytes.
Networks A→B→C connect host HA in A to host HC in C. Every application message has 180 bytes; TCP adds a 20-byte header. Maximum IP packet sizes including a 20-byte IP header are A:1000 bytes, B:100 bytes, C:1000 bytes. A–B is 1 Mbps and B–C is 512 Kbps. GateForum labels the second link 512 Mbps in its diagram but 512 Kbps in prose; use the common GFG/prose reading, retaining this discrepancy. What is the sustained application-data rate to HC, ignoring errors, acknowledgements and other overhead? Options: (A) 325.5 Kbps (B) 354.5 Kbps (C) 409.6 Kbps (D) 512.0 Kbps
Your answer
Answer & solution
Answer: B (no official key was published)
1. Per message the bottleneck B→C link transports260 bytes, of which 180 are application data. Its sustained goodput is 512×180/260=354.4615Kbps, rounding to 354.5Kbps.
2. The1Mbps link is not the bottleneck. This uses pipelined steady-state traffic, ignoring stated overheads; it is not the reciprocal of end-to-end latency of one isolated message.
4. Teaching check: Goodput counts useful application bits, not all bits on the bottleneck. Each 260 transmitted bytes delivers 180 application bytes, giving efficiency 9/13. Multiplying 512 Kbps by that efficiency yields 354.46 Kbps; using 200 useful bytes would incorrectly include TCP overhead.
A network uses the printed subnet mask 255.255.31.0. Which pair of addresses could belong to that network? A. 172.57.88.62 and 172.56.87.233 B. 10.35.28.2 and 10.35.29.4 C. 191.203.31.87 and 191.234.31.88 [GFG; GateForum prints 191.03.31.87 as the first address.] D. 128.8.129.43 and 128.8.161.55 The printed mask is noncontiguous; apply its literal bitwise AND, not an assumed CIDR repair.
Your answer
Answer & solution
Answer: D (no official key was published)
1. Membership under the printed mask requires address 1 AND mask = address 2 AND mask. Its first two 255 octets preserve both first octets, while the final zero octet discards the host's last octet. 2. A fails because 57≠56 in octet two; C fails because 203≠234. B's first two octets match, but 28 AND 31=28 and 29 AND 31=29, so it fails too. 3. For D, 129=10000001₂ and 161=10100001₂. AND with 31=00011111₂ gives 00000001₂ for both. Both network values are 128.8.1.0. 4. Thus the literal calculation selects D. Because 00011111 is not a contiguous prefix-mask octet, this is not a valid ordinary CIDR mask; that caveat must remain explicit.
Solution: Compare the bitwise AND of each address with the printed mask. Options A and C have unequal second octets, which are fully retained. Option B retains third octets 28 and 29 under AND 31, so they differ. For D, 129 AND 31=1 and 161 AND 31=1; both addresses therefore map to 128.8.1.0. The raw mask calculation gives D. The printed 31 octet is 00011111, so this is a noncontiguous mask and cannot be expressed as a standard CIDR prefix; it must not be silently changed to 224 or another contiguous-mask octet.