Layers, functions, and protocols

1. Overview of the OSI and TCP/IP Models

  • OSI Model (7 Layers): (Short Code – APSTNDP)
    • Application
    • Presentation
    • Session
    • Transport
    • Network
    • Data Link
    • Physical
  • TCP/IP Model (4 Layers): (Short Code – ATIN)
    • Application
    • Transport
    • Internet
    • Network Access (Link)


2. Key Layers and Their Functions

A. Application Layer (OSI/TCP/IP)

  • Functions: User interface, data generation, and communication.
  • Protocols: HTTP, HTTPS, FTP, SMTP, POP3, IMAP, DNS, SNMP.

B. Transport Layer (OSI/TCP/IP)

  • Functions: Reliable/unreliable delivery, error detection, segmentation, and flow control.
  • Protocols: TCP (reliable), UDP (unreliable).
  • Concepts: Port numbers (e.g., HTTP – 80, HTTPS – 443).

C. Network Layer (OSI) / Internet Layer (TCP/IP)

  • Functions: Logical addressing, routing.
  • Protocols: IP (IPv4, IPv6), ICMP, ARP, RARP, IGMP.

D. Data Link Layer (OSI) / Network Access Layer (TCP/IP)

  • Functions: Framing, error correction, physical addressing (MAC).
  • Protocols: Ethernet, PPP, Frame Relay, HDLC.

E. Physical Layer (OSI)

  • Functions: Transmission of raw bits, hardware specifications.
  • Examples: Cables, switches, hubs.

3. Common Protocols and Ports

ProtocolPort(s)
FTP20, 21
SSH22
Telnet23
SMTP25
DNS53
HTTP80
HTTPS443
SNMP -Simple Network Management Protocol is a network protocol that allows user to collect and organize information about devices on IP networks161
DHCP -Dynamic Host Configuration Protocol is a client/server protocol that automatically provides an IP host with its IP address and other related configuration information such as the subnet mask and default gateway.67, 68

4. Popular Topics

  • IP Addressing:
    • IPv4 vs. IPv6.
    • Subnetting and CIDR.
  • Routing Protocols: OSPF, BGP, RIP, EIGRP.
  • Error Detection Mechanisms:
    • Checksum, CRC.
  • Flow Control Mechanisms: Stop-and-Wait, Sliding Window.

5. Practical Scenarios

  • Match protocols with their layers.
  • Identify functions performed at each layer.
  • Understand the flow of data through the layers.

6. Study Tips

Here’s a simplified version to help remember each OSI layer and its purpose:

  1. Physical Layer (The Roads)
    • Purpose: Moves raw data (1s and 0s).
    • Analogy: The roads for delivery. No roads = no data transfer.
    • Device/Role: Your device’s hardware (Wi-Fi card, cables, etc.) connects to the internet.
  2. Data Link Layer (Traffic Rules)
    • Purpose: Organizes data and avoids errors.
    • Analogy: Traffic rules ensuring smooth flow.
    • Device/Role: Your device’s network adapter ensures data is sent correctly to the right hardware address (MAC).
  3. Network Layer (GPS)
    • Purpose: Finds the best route (IP addressing).
    • Analogy: GPS guiding the delivery.
    • Device/Role: Your device’s IP address ensures data reaches the correct destination (like the restaurant’s server).
  4. Transport Layer (Delivery Box)
    • Purpose: Ensures data arrives safely or quickly (TCP/UDP).
    • Analogy: The sturdy delivery box protecting your food.
    • Device/Role: Your app uses protocols like TCP (for reliability) or UDP (for speed).
  5. Session Layer (The Conversation)
    • Purpose: Manages communication (start, maintain, end).
    • Analogy: Chat with the agent about your delivery.
    • Device/Role: Your app manages the connection with the server (starting, maintaining, and ending it).
  6. Presentation Layer (Unboxing)
    • Purpose: Converts data into readable formats.
    • Analogy: Food unboxing, beautifully arranged.
    • Device/Role: Your app translates data formats (e.g., encryption, compression) into something you can read.
  7. Application Layer (Enjoy the Meal)
    • Purpose: Interaction with apps like HTTP or browsers.
    • Analogy: Finally eating the food!
    • Device/Role: The app itself (like Zomato) interacts directly with you, the user.

Cheat Mnemonic + Function

LayerMnemonicRole in Story
PhysicalPleaseRoads to deliver bits (data).
Data LinkDoTraffic rules to avoid crashes (error-free).
NetworkNotGPS to find the best route (IP, routing).
TransportThrowPizza box for safe delivery (reliable transfer).
SessionSizzlerConversation with the agent (connection).
PresentationPizzaNicely arranged toppings (data formatting).
ApplicationAwayEating the pizza (user interacts with data).


MCQ


Which layer of the OSI model is responsible for logical addressing and routing of packets?
a) Data Link
b) Transport
c) Network
d) Application

Answer: c) Network

2. Which of the following is NOT a function of the Transport Layer?
a) Error detection and correction
b) Port addressing
c) Flow control
d) IP addressing

Answer: d) IP addressing

3. In the OSI model, which layer establishes, manages, and terminates communication sessions?
a) Presentation
b) Transport
c) Session
d) Data Link

Answer: c) Session

4. Which protocol operates at the Application Layer of the OSI model?
a) TCP
b) FTP
c) ICMP
d) ARP

Answer: b) FTP

5. Which layer is responsible for translating data between the application layer and the network format?
a) Presentation
b) Session
c) Transport
d) Physical

Answer: a) Presentation

6. What is the primary responsibility of the Data Link Layer in the OSI model?
a) Logical addressing and routing
b) Frame synchronization and error detection
c) Bit-level transmission of data
d) Encryption and decryption

Answer: b) Frame synchronization and error detection

7. Which port number is used by the HTTP protocol?
a) 25
b) 53
c) 80
d) 443

Answer: c) 80

8. ARP (Address Resolution Protocol) is used to resolve:
a) IP addresses to MAC addresses
b) Domain names to IP addresses
c) Port numbers to services
d) MAC addresses to IP addresses

Answer: a) IP addresses to MAC addresses

9. Which layer of the TCP/IP model combines the functionality of the OSI Data Link and Physical layers?
a) Application
b) Network Access
c) Internet
d) Transport

Answer: b) Network Access

10. Which layer of the OSI model handles the conversion of bits to electrical signals?
a) Data Link
b) Physical
c) Network
d) Transport

Answer: b) Physical

11. Which protocol is responsible for email retrieval?
a) SMTP
b) POP3
c) SNMP
d) ICMP

Answer: b) POP3 downloads emails from an email server to a device over a TCP/IP connection. It only downloads emails from the inbox folder, and it deletes the emails from the server after downloading.

12. Which layer is responsible for segmentation and reassembly of data?
a) Application
b) Transport
c) Network
d) Data Link

Answer: b) Transport

13. Which protocol is used for secure communication over a computer network?
a) HTTP
b) UDP
c) HTTPS
d) FTP

Answer: c) HTTPS

14. What is the primary function of ICMP (Internet Control Message Protocol)?
a) Routing data packets
b) Error reporting and diagnostics
c) Establishing end-to-end communication
d) Resolving domain names

Answer: b) is used for reporting errors and performing network diagnostics. In the error reporting process, ICMP sends messages from the receiver to the sender when data does not come though as it should.

15. What is the purpose of the DNS protocol?
a) Translate domain names to IP addresses
b) Resolve IP to MAC addresses
c) Provide secure file transfer
d) Manage remote logins

Answer: a) Translate domain names to IP addresses

16. Which layer is responsible for data encryption and compression?
a) Application
b) Presentation
c) Transport
d) Session

Answer: b) Presentation

17. Which of the following is a connectionless protocol?
a) TCP
b) HTTP
c) UDP
d) FTP

Answer: c) UDP

18. What is the maximum size of an IPv4 address?
a) 32 bits
b) 64 bits
c) 128 bits
d) 256 bits

Answer: a) 32 bits

19. Which of the following protocols is used to monitor and manage network devices?
a) FTP
b) SNMP
c) SMTP
d) DHCP

Answer: b) SNMP

20. What is the function of the DHCP protocol?
a) Translate domain names to IP addresses
b) Dynamically assign IP addresses
c) Encrypt transmitted data
d) Provide routing paths for packets

Answer: b) Dynamically assign IP addresses