DriveReady
Tier 11.5 h to studyMedium confidenceHardabout 6 questions4.6% of paper

T1 - Computer networks: OSI/TCP-IP, protocols, ports

1. Why this topic matters here

Expected load: 5.99 questions, 4.6% of a ~130-question paper (technical section, tier 1, confidence Medium).

That figure is a proportional allocation of the section's budget by evidence weight, not a count of anything observed, and the 130-question structure itself is [LIKELY], not published. It ranks at tier 1 because of its estimated marks per study hour (3.19, against a paper-wide mean of 2.52). The only direct evidence is 2 items on IndiaBIX placement paper 3874. It is undated and anonymous, but the IDs of the papers on either side of it are all 2007-08 L&T ECC (construction-division) papers, and the next dated paper above that block is February 2012, so it is probably from 2007-08 [INFERRED] and it is not a PGET paper. See section 10.

2. Exactly what gets asked

Sub-pattern How it appears Roughly how often
Protocol → OSI layer "X is carried out in which layer" 2-3 questions
Port numbers "Default port of HTTPS is" 1-2 questions
Device → layer Hub/switch/router operate at which layer 1 question
TCP vs UDP connection-oriented, reliability, use case 1 question
Handshake / connection setup order of SYN, SYN-ACK, ACK 0-1 question
Subnetting arithmetic usable hosts, network address, subnet count 1-2 questions
OSI layer function terminal emulation, encryption, routing, framing 0-1 question

Also cover: the 7 OSI layers with mnemonic, the 4-layer TCP/IP model and its mapping, the full protocol-to-layer table, the port table, TCP vs UDP, the three-way handshake, IP addressing and subnetting, and switch vs router vs hub.

3. Concept notes

3.1 The OSI 7 layers

Bottom to top. Mnemonic: Please Do Not Throw Sausage Pizza Away.

# Layer Job One-line example
7 Application User-facing network services HTTP, FTP, Telnet, SMTP, DNS
6 Presentation Translation, encryption, compression SSL/TLS, JPEG, ASCII/Unicode, MPEG
5 Session Establish/maintain/tear down sessions Session checkpoints, RPC, NetBIOS
4 Transport End-to-end delivery, segmentation, flow control TCP, UDP; PDU = segment (TCP) / datagram (UDP)
3 Network Logical addressing and routing IP, ICMP, ARP (some texts), routers; PDU = packet
2 Data Link Framing, MAC addressing, error detection Ethernet, PPP, switches, MAC; PDU = frame
1 Physical Bits on the wire, voltage, cables, hubs RJ45, fibre, repeaters, hubs; PDU = bits

The two questions observed on an old (probably 2007-08) IndiaBIX paper both resolve here: Telnet is terminal emulation and lives at the Application layer, and FTP is an Application-layer protocol. If a question names a protocol by name, it is almost always Application layer.

3.2 The TCP/IP 4-layer model

TCP/IP layer Maps to OSI
Application Application + Presentation + Session
Transport Transport
Internet Network
Network Access (Link) Data Link + Physical

Learn the mapping as 3→1, 1→1, 1→1, 2→1. The exam asks OSI far more than TCP/IP, but it may ask "how many layers in TCP/IP" (4) or "which OSI layers collapse into the TCP/IP application layer" (Application, Presentation, Session).

3.3 Protocol-to-layer table (the free-marks table)

Layer Protocols
Application HTTP, HTTPS, FTP, TFTP, SMTP, POP3, IMAP, DNS, Telnet, SSH, SNMP, DHCP, NTP
Presentation SSL/TLS, JPEG, GIF, MPEG, ASCII
Session RPC, NetBIOS, PPTP, session setup
Transport TCP, UDP (and SCTP)
Network IP, ICMP, IGMP, ARP, RARP, OSPF, RIP (routing protocols)
Data Link Ethernet, PPP, HDLC, Frame Relay, MAC, ARP (per some texts)
Physical RS-232, DSL, 10BaseT, Bluetooth radio

ARP is the classic borderline — it maps IP to MAC, so it is drawn at the Network layer in most Indian exam keys, Data Link in others. If both appear, pick Network.

3.4 Ports

Port Protocol Transport
20 / 21 FTP (20 data, 21 control) TCP
22 SSH / SFTP TCP
23 Telnet TCP
25 SMTP TCP
53 DNS UDP (queries), TCP (zone transfer)
67 / 68 DHCP (server / client) UDP
69 TFTP UDP
80 HTTP TCP
110 POP3 TCP
123 NTP UDP
143 IMAP TCP
161 SNMP UDP
443 HTTPS TCP
445 SMB TCP
3306 MySQL TCP
3389 RDP TCP

Rule of thumb: file transfer, mail, web and remote login are TCP; name resolution, time, discovery and trivial transfer are UDP.

3.5 TCP vs UDP

Feature TCP UDP
Connection Connection-oriented (handshake) Connectionless
Reliability Acknowledgements, retransmission None
Ordering Guaranteed in-order Not guaranteed
Header size 20-60 bytes 8 bytes
Speed Slower Faster
Flow/congestion control Yes No
Typical use HTTP, FTP, SMTP, SSH, Telnet DNS, DHCP, TFTP, VoIP, streaming, SNMP

3.6 The three-way handshake

  1. Client → Server: SYN (seq = x)
  2. Server → Client: SYN-ACK (seq = y, ack = x+1)
  3. Client → Server: ACK (ack = y+1)

Connection now open. Teardown is four-way: FIN, ACK, FIN, ACK. If the exam says "connection establishment uses how many steps", the answer is three.

3.7 IP addressing and subnetting

An IPv4 address is 32 bits, four octets, written dotted-decimal.

Class First octet Default mask Notes
A 1-126 /8 127 is loopback
B 128-191 /16 172.16-172.31 is private
C 192-223 /24 192.168.x.x private
D 224-239 — Multicast
E 240-255 — Experimental

Private ranges: 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16. APIPA: 169.254.0.0/16.

Formulas:

  • Usable hosts = 2^(32 − prefix) − 2
  • Number of subnets = 2^(bits borrowed)
  • Block size = 256 − mask octet
  • Network address = IP AND mask; broadcast = all host bits set to 1

Example: /26 → 2^6 = 64 addresses, 64 − 2 = 62 usable. Block size = 256 − 192 = 64, so subnets start at .0, .64, .128, .192.

Runnable check of the host formula:

public class Subnet {
    public static void main(String[] args) {
        for (int prefix = 24; prefix <= 30; prefix++) {
            int hostBits = 32 - prefix;
            int total = 1 << hostBits;
            System.out.printf("/%d  total=%d  usable=%d%n", prefix, total, total - 2);
        }
    }
}

Output: /24 254, /25 126, /26 62, /27 30, /28 14, /29 6, /30 2.

3.8 Switch vs router vs hub

Device OSI layer Forwards using Collision domain Broadcast domain
Hub 1 (Physical) Broadcasts everything One shared One
Switch 2 (Data Link) MAC address table Per port One (unless VLAN)
Router 3 (Network) IP routing table Per port Separates them

Memorise: hub = Layer 1, switch = Layer 2, router = Layer 3. A Layer-3 switch routes; a basic switch does not.

4. Must-memorise block

  • OSI top-down: Application, Presentation, Session, Transport, Network, Data Link, Physical ("Please Do Not Throw Sausage Pizza Away").
  • TCP/IP layers: Application, Transport, Internet, Network Access.
  • Terminal emulation → Application (Telnet). FTP → Application.
  • PDUs: bits (1) → frame (2) → packet (3) → segment/datagram (4) → data (5-7).
  • Hub 1, switch 2, router 3.
  • Ports: 21 FTP, 22 SSH, 23 Telnet, 25 SMTP, 53 DNS, 80 HTTP, 110 POP3, 143 IMAP, 443 HTTPS, 3306 MySQL. Remember 20 = FTP data.
  • Usable hosts = 2^(32−prefix) − 2; subnets = 2^borrowed; block size = 256 − mask octet.
  • Handshake = SYN, SYN-ACK, ACK.
  • Private: 10/8, 172.16/12, 192.168/16; loopback 127.0.0.0/8; APIPA 169.254/16.
  • Class D = multicast (224-239).
  • TCP header 20-60 B, UDP header 8 B.
  • Private default ports to lock: MySQL 3306, RDP 3389, SNMP 161, TFTP 69.

5. Worked examples

Example 1 — Which OSI layer handles terminal emulation? Fast method: terminal emulation = Telnet = an application service. Application layer. Slow method: reasoning up from Physical wastes 90 seconds. Recall the protocol, name the layer, move on.

Example 2 — A service listens on port 143. What is it? Scan the port table. 143 = IMAP. If you can't recall, eliminate: 110 is POP3, 25 is SMTP, 443 is HTTPS. Answer IMAP, and note both mail-retrieval protocols are TCP.

Example 3 — Give the correct three-way handshake order. Step 1 client sends SYN. Step 2 server replies SYN-ACK. Step 3 client sends ACK. Answer: SYN → SYN-ACK → ACK. Any option starting with ACK or SYN-ACK is wrong by inspection.

Example 4 — What is the network address of 192.168.10.130/26? /26 → mask 255.255.255.192 → block size 256 − 192 = 64. Subnets begin at .0, .64, .128, .192. 130 lies in .128. Network = 192.168.10.128, broadcast = 192.168.10.191 (host bits all 1), usable range .129-.190 = 62 hosts.

Example 5 — How many usable hosts in a /27, and how many /27s fit in a /24? Hosts: 32 − 27 = 5 host bits → 2^5 = 32 addresses → 32 − 2 = 30 usable. Subnets: 27 − 24 = 3 borrowed bits → 2^3 = 8 subnets. Answer: 30 hosts, 8 subnets. The −2 is mandatory: network and broadcast addresses are not assignable.

6. Traps and gotchas

Trap Why it catches people How to avoid it
Session vs Application for terminal emulation "Session" sounds like remote login Telnet is an Application-layer protocol; the Session layer only manages dialogues
FTP ports 20 vs 21 People recall "21" only 20 = data channel, 21 = control channel
Forgetting −2 in host counts Formula half-remembered Always subtract network + broadcast
Switch placed at Layer 3 Everyday language calls it "smart" Switch = Layer 2, router = Layer 3
SSH vs Telnet ports Both are remote login SSH 22, Telnet 23
DNS assumed pure UDP Zone transfers need TCP UDP 53 queries, TCP 53 zone transfer
PDU names mixed up Four names, four layers bits/frame/packet/segment, bottom-up
Class D treated as reserved Looks like "the last class" Class D 224-239 is multicast, Class E is reserved
Assuming HTTPS is 8080 Proxy habit HTTPS = 443, HTTP = 80, 8080 is only an alternate HTTP port

7. Practice questions

  1. Which OSI layer handles terminal emulation? a) Application b) Session c) Presentation d) Transport

  2. FTP is carried out in which layer? a) Application b) Session c) Network d) Transport

  3. Routing of packets between different networks is performed at which layer? a) Network b) Data Link c) Transport d) Session

  4. What is the default port number for HTTPS? a) 80 b) 8080 c) 443 d) 22

  5. Which of the following is connection-oriented? a) UDP b) DHCP c) TCP d) TFTP

  6. The correct order of the three-way handshake is: a) SYN, ACK, SYN-ACK b) SYN, SYN-ACK, ACK c) ACK, SYN, ACK d) SYN-ACK, SYN, ACK

  7. The address 192.168.1.100/26 belongs to which subnet? a) 192.168.1.0 b) 192.168.1.32 c) 192.168.1.128 d) 192.168.1.64

  8. A hub operates at which OSI layer? a) Data Link b) Physical c) Network d) Transport

  9. DNS zone transfers are carried over: a) UDP 53 b) UDP 67 c) TCP 53 d) TCP 80

  10. Which transport protocol is connectionless and best suited to live video streaming? a) TCP b) SMTP c) FTP d) UDP

  11. The PDU at the transport layer is called a: a) Bit b) Frame c) Packet d) Segment

  12. How many usable host addresses does a /28 subnet provide? a) 16 b) 14 c) 30 d) 62

ANSWER KEY

  1. a — Telnet provides terminal emulation and is an Application-layer protocol.
  2. a — FTP is a file-transfer service, hence Application layer.
  3. a — Logical addressing and routing are Network-layer (Layer 3) functions.
  4. c — HTTPS uses TCP 443; 80 is plain HTTP and 22 is SSH.
  5. c — TCP is connection-oriented and performs the three-way handshake; UDP, DHCP and TFTP are connectionless.
  6. b — Client sends SYN, server replies SYN-ACK, client confirms with ACK.
  7. d — /26 has block size 256 − 192 = 64, so subnets start at .0, .64, .128, .192; 100 falls in .64.
  8. b — A hub repeats electrical signals with no addressing, so it is Layer 1.
  9. c — Query traffic uses UDP 53, but zone transfers require TCP 53.
  10. d — UDP is connectionless and tolerates loss, which suits streaming; TCP retransmission would add delay.
  11. d — Transport PDU is a segment for TCP and a datagram for UDP.
  12. b — 32 − 28 = 4 host bits → 2^4 = 16 addresses → 16 − 2 = 14 usable.

8. Resources

  • Networking - Technical Interview Questions and Answers — https://www.indiabix.com/technical/networking/ — interview-style Q&A with written answers - not an MCQ drill.
  • Layers of OSI Model — https://www.geeksforgeeks.org/layers-of-osi-model/ — page content not classified - read it before relying on it.
  • TCP/IP Model — https://www.geeksforgeeks.org/tcp-ip-model/ — page content not classified - read it before relying on it.
  • RFC 793: Transmission Control Protocol | RFC Editor — https://www.rfc-editor.org/rfc/rfc793 — reference article.
  • Service Name and Transport Protocol Port Number Registry — https://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xhtml — page content not classified - read it before relying on it.

9. Self-check

  1. Can you recite all 7 OSI layers top-down, in under 5 seconds, using the mnemonic?
  2. Can you name the OSI layer for HTTP, FTP, Telnet, DNS, TCP, UDP, IP, ICMP, Ethernet and MAC?
  3. Can you state all 10 port numbers in the must-memorise block without looking?
  4. Can you compute usable hosts for a /26, /27 and /28 and the subnet count when /24 is split?
  5. Can you list the three handshake messages in order and name one protocol that skips them entirely?
  6. Can you say which layer a hub, a switch and a router each operate at, in one breath?

If all six are yes, stop here.

10. Sources

Evidence status: confidence Medium. High needs a recent observed question, and none exists for any topic.

Observed on an old paper [REPORTED, OLD]. IndiaBIX placement paper 3874. It is undated and anonymous, but the IDs of the papers on either side of it are all 2007-08 L&T ECC (construction-division) papers, and the next dated paper above that block is February 2012, so it is probably from 2007-08 [INFERRED] and it is not a PGET paper. Items bearing on this topic:

  • OBS-T03 - The layer in the OSI model that handles terminal emulation is:
  • OBS-T06 - FTP is carried out in which layer?

Not evidence of the current paper. The official notice names only "analytical, verbal, and numerical ability" and "domain-specific knowledge"; nothing in it lists topics. See research/05-source-audit.md.