Skip to content
logo-loksewa-online
  • Loksewa Online Notes
  • Courses
  • Blog
  • Contact Us
  • About Us

Course Outline

Computer Engineer – PSC Technical Course

0. Course Orientation

  1. 0.1 PSC Computer Engineer: Syllabus, Papers and Study Plan

1. General Awareness

  1. 1.1 Nepal Geography and Demography
  2. 1.2 Natural Resources of Nepal
  3. 1.3 Climate, Livelihood and Lifestyle
  4. 1.4 Modern History and Personalities
  5. 1.5 Current Periodic Plan and Economy
  6. 1.6 Sustainable Development, Environment and Climate Change
  7. 1.7 International Affairs: UNO, SAARC and BIMSTEC
  8. 1.8 Constitution, Governance and Public Service
  9. 1.9 Public Policy, Management, Budgeting and Accounting
  10. 1.10 Current Affairs for Computer Engineer

2. General Reasoning

  1. 2.1 Verbal Ability and Analogies
  2. 2.2 Alphanumeric Series and Coding Decoding
  3. 2.3 Order Ranking Directions and Venn Diagram
  4. 2.4 Arithmetic Series Fraction Percentage Ratio Average
  5. 2.5 Profit Loss Time Work Calendar and Data Sufficiency
  6. 2.6 Data Interpretation and Verification
  7. 2.7 Figure Series Matrix and Pattern Completion
  8. 2.8 Mirror Water Images Cubes Dices Paper Folding

3. Computer Networks

  1. 3.1 Protocol Stack and Switching
  2. 3.2 Link Layer: Ethernet, ARP, CSMA/CD, Wireless LAN and PPP
  3. 3.3 Network Layer: IP Addressing, Routing, RIP, OSPF and IPv6
  4. 3.4 Transport Layer: UDP, TCP, Flow and Congestion Control
  5. 3.5 Application Layer: Web, FTP, Email, DNS and Socket Programming
  6. 3.6 Distributed Systems and Clusters

4. Computer Architecture Digital and Electronics

  1. 4.1 Sequential Circuits, State Table and Architecture
  2. 4.2 Von Neumann, Harvard, RISC and CISC
  3. 4.3 Data Representation, Arithmetic, Bus and Instruction Cycle
  4. 4.4 Addressing Modes, I/O, Interrupt, DMA and Memory Systems
  5. 4.5 808x Intel Microprocessor Programming and Interfacing
  6. 4.6 Digital Number Systems, Logic Gates and Combinational Circuits
  7. 4.7 Sequential Logic, Counters, Registers and IC Families
  8. 4.8 Electrical Circuits: AC, Transformers, Filters and Transients
  9. 4.9 Semiconductor Diodes, Transistors, Amplifiers and Op-Amp
  10. 4.10 Electronic Communication: Modulation, Error Control, SNR and BER

5. Programming and Data Structures

  1. 5.1 Structured Programming: Data Types, Operators and Control Structures
  2. 5.2 Functions, Procedures and Modular Programming
  3. 5.3 Object Oriented Programming: Class, Encapsulation, Inheritance and Polymorphism
  4. 5.4 Patterns, Frameworks and Object Composition
  5. 5.5 ADT, Complexity, Big O, Theta, Best, Average and Worst Case
  6. 5.6 Linear Data Structures: Stack, Queue and Linked List
  7. 5.7 Trees: BST, AVL, Red-Black, Splay and Traversals
  8. 5.8 Algorithm Design: Greedy, Divide and Conquer, Dynamic Programming and Recursion
  9. 5.9 Hashing, Graphs, Digraphs and Sorting

6. Software Engineering DBMS and Operating System

  1. 6.1 Software Lifecycle Models and Risk Driven Process
  2. 6.2 Project Planning, Control, Risk, Cost, Version, Quality and Metrics
  3. 6.3 Requirements Analysis, Specification, Review and Modeling
  4. 6.4 Software Design, Implementation, Testing and Maintenance
  5. 6.5 Formal Methods, ISO, CMM, CASE and Process Improvement
  6. 6.6 Relational Model, ER Model, SQL, Normalization and File Structure
  7. 6.7 Transaction, Concurrency, Crash Recovery, Query Optimization and Indexing
  8. 6.8 Distributed Database, Data Mining, Warehousing and Security
  9. 6.9 Processes, Threads, Synchronization, Scheduling and Deadlock
  10. 6.10 Memory Management, I/O, File System and Distributed OS Security

7. Advanced Computer Science and Emerging Technology

  1. 7.1 Artificial Intelligence Search NLP Game Learning Reasoning Planning Vision Robotics
  2. 7.2 Theory of Computation Grammar DFA NFA Regular Expression Pumping Lemma
  3. 7.3 CFG PDA Turing Machine Chomsky Hierarchy Undecidability P NP
  4. 7.4 Compiler Structure Lexical Analysis Parsing and Syntax Directed Translation
  5. 7.5 Type Checking Runtime Storage Intermediate Code and Optimization
  6. 7.6 Computer Graphics Raster Algorithms Transformations Viewing Projection Rendering
  7. 7.7 Parallel Distributed Computing High Speed Networks and Software Architecture
  8. 7.8 Cryptography Network Security E Commerce Embedded Multimedia GIS GPS

Application layer is where users see network services, but engineering exams test the protocol mechanics behind those services. For PSC Computer Engineer, you should understand how HTTP requests work, how caching reduces load, why FTP uses two connections, how email moves through SMTP and retrieval protocols, how DNS resolves names and how socket programming maps applications to transport services.

Engineering Definitions

Application layer

Standard definition: The top network layer that provides protocol services directly used by user applications and distributed processes.

Exam meaning: Browser, mail client, DNS resolver, FTP client जस्ता programs ले प्रयोग गर्ने protocol layer।

HTTP

Standard definition: Hypertext Transfer Protocol is a stateless application-layer protocol used for transferring web resources between client and server.

Exam meaning: Web page, API response, image, CSS, JS आदि request-response model मा पठाउने protocol।

FTP

Standard definition: File Transfer Protocol is an application-layer protocol for transferring files using separate control and data connections.

Exam meaning: File upload/download को लागि command connection र data connection छुट्टै राख्ने protocol।

SMTP

Standard definition: Simple Mail Transfer Protocol is an application-layer protocol used to send and relay email between mail clients and mail servers.

Exam meaning: Email पठाउने र server-to-server relay गर्ने protocol।

DNS

Standard definition: Domain Name System is a distributed hierarchical naming system that maps domain names to resource records such as IP addresses.

Exam meaning: मानिसले सम्झिने domain name लाई IP address वा अरू records मा resolve गर्ने system।

Socket

Standard definition: A socket is a software endpoint used by applications to send and receive data through transport-layer services.

Exam meaning: Application program र TCP/UDP service बीचको programming endpoint।

Concept Teaching

Application-layer protocols define the meaning and format of messages exchanged by programs. TCP or UDP only delivers bytes/datagrams; HTTP decides what GET means, DNS decides what an A record means, SMTP decides how mail is transferred, and FTP decides how file commands and data transfer are coordinated.

Application Layer Design Principles

A strong answer should explain not only protocol names but also the design pattern each protocol follows.

  • Client-server model: client initiates request, server provides service, common in HTTP, FTP, DNS recursive service and email retrieval.
  • Peer-to-peer idea: peers can act as both client and server, useful in file sharing and distributed applications.
  • Stateless protocol: server does not need to remember previous request state; HTTP is fundamentally stateless.
  • Stateful session: protocol/server remembers session context; FTP control connection is stateful.
  • Text-based protocols such as HTTP/1.1 and SMTP are easier to debug; binary protocols are often more compact.

HTTP Request-Response Model

HTTP works by exchanging structured request and response messages. The browser is usually the client; the web server returns resources or API data.

  • Request line includes method, path and protocol version, for example GET /index.html HTTP/1.1.
  • Headers carry metadata such as Host, User-Agent, Accept, Cookie, Content-Type and Cache-Control.
  • Body is optional in requests; POST and PUT often include a body.
  • Response includes status code, headers and optional body.
  • Common status codes: 200 OK, 301/302 redirect, 304 Not Modified, 400 Bad Request, 401 Unauthorized, 403 Forbidden, 404 Not Found, 500 Internal Server Error.

HTTP Methods and Semantics

Engineering answers should distinguish method meaning, safety and idempotence.

Method Primary use Safe? Idempotent?
GET Read resource Yes Yes
POST Submit/create/process data No No generally
PUT Replace resource No Yes
PATCH Partial update No Not guaranteed
DELETE Delete resource No Yes in protocol meaning
HEAD Headers only, no response body Yes Yes

Web Caching and Conditional Requests

Caching improves performance by reducing latency, server load and bandwidth consumption.

  • Browser cache stores resources locally based on headers.
  • Proxy/cache server can serve multiple clients and reduce upstream traffic.
  • Cache-Control max-age tells how long a response can be reused.
  • ETag and If-None-Match support validation; server can respond 304 Not Modified.
  • Last-Modified and If-Modified-Since are time-based validation mechanisms.
  • Exam trap: caching does not mean data is always fresh; correctness depends on validation and expiry rules.

HTTPS, TLS and Security Layering

HTTPS is HTTP over TLS. It protects confidentiality and integrity and authenticates the server using certificates.

  • TLS sits between application protocol and TCP in the common HTTPS stack.
  • Certificate proves server identity through public key infrastructure.
  • Symmetric session keys are used for efficient encrypted data transfer after handshake.
  • HTTPS does not hide the destination IP from the network path; it protects HTTP content.
  • Engineering trap: HTTPS is not a separate application protocol with different web semantics; it is secure HTTP transport using TLS.

FTP Control and Data Connections

FTP is frequently tested because it uses two TCP connections, unlike many simple request-response protocols.

  • Control connection usually uses TCP port 21 and remains open for commands.
  • Data connection is opened separately for file transfer or directory listing.
  • Active mode: server initiates data connection back to client.
  • Passive mode: client initiates data connection to server-selected port; useful behind NAT/firewalls.
  • FTP sends credentials and data in plaintext unless FTPS/SFTP alternative is used.
  • Exam trap: SFTP is SSH File Transfer Protocol, not simply secure FTP over TLS.

Email Protocol Flow

Email is not one protocol. Sending, relaying and retrieving mail use different protocols.

  • MUA: Mail User Agent such as mail app or webmail interface.
  • MSA/MTA: Mail Submission/Transfer Agent sends and relays mail using SMTP.
  • MDA/mailbox: stores mail for recipient.
  • POP3 downloads mail, often simple and offline-oriented.
  • IMAP keeps mail on server and synchronizes folders, flags and multiple devices.
  • MIME allows attachments and non-ASCII content in email messages.

DNS Hierarchy and Resolution

DNS is distributed and hierarchical. A resolver may query multiple DNS servers to convert a domain name into resource records.

  • Root server points to top-level domain server such as .com or .np.
  • TLD server points to authoritative name server for the domain.
  • Authoritative server provides final records such as A, AAAA, MX, CNAME, NS or TXT.
  • Recursive resolver performs lookup on behalf of client and caches answer.
  • TTL controls how long DNS responses can be cached.
  • Exam trap: DNS usually uses UDP port 53, but TCP 53 is used for zone transfers and large/truncated responses.

Important DNS Resource Records

PSC MCQs often test DNS record type and purpose.

Record Purpose Example meaning
A Maps name to IPv4 address example.com -> 93.184.216.34
AAAA Maps name to IPv6 address example.com -> IPv6 address
CNAME Alias from one name to another www -> canonical host name
MX Mail exchanger for domain Mail server for recipient domain
NS Authoritative name server Which server hosts DNS zone
TXT Arbitrary text policy/verification SPF, DKIM, verification records
PTR Reverse DNS lookup IP address -> domain name

Socket Programming Model

Socket programming is the API view of networking. It lets programs use TCP or UDP without manually creating IP packets.

  • TCP server sequence: socket, bind, listen, accept, read/write, close.
  • TCP client sequence: socket, connect, read/write, close.
  • UDP server sequence: socket, bind, recvfrom, sendto.
  • TCP socket is stream-oriented; UDP socket is datagram-oriented.
  • Blocking socket waits for operation completion; non-blocking or multiplexed I/O helps serve many clients.
  • select, poll or epoll/kqueue style APIs allow one process/thread to monitor multiple sockets.

Layer Mapping of Application Protocols

Always mention the transport protocol and port when relevant, but keep layer boundaries clear.

Application protocol Usual transport Common port Key point
HTTP TCP 80 Stateless web request-response
HTTPS TCP with TLS 443 Encrypted/authenticated web communication
FTP control TCP 21 Commands and responses
SMTP TCP 25/587 Mail sending and relay
POP3 TCP 110/995 Mail retrieval/download
IMAP TCP 143/993 Mail synchronization on server
DNS UDP/TCP 53 Name resolution and records

Engineering Mechanism

  • Application creates a protocol-specific message such as HTTP GET, DNS query or SMTP command.
  • Message is passed to transport layer using a socket API.
  • Transport layer uses TCP or UDP depending on application requirements.
  • Server parses request according to application protocol grammar and state.
  • Response is generated with status, record, file data, mail result or application payload.
  • Caching, authentication, encryption and session state may be handled depending on protocol design.

Diagrams / Models To Draw

  • Draw HTTP client-server request and response with method, headers and status code.
  • Draw DNS recursive resolution: client -> recursive resolver -> root -> TLD -> authoritative server.
  • Draw FTP with control connection and separate data connection.
  • Draw email flow: sender MUA -> SMTP server -> recipient mail server -> IMAP/POP3 client.
  • Draw TCP socket server lifecycle: socket, bind, listen, accept, read/write, close.
  • Draw application layer above transport layer with HTTP/FTP/SMTP/DNS examples.

Formulas, Fields and Algorithms

  • DNS common port = 53 over UDP; TCP 53 for zone transfer or large responses.
  • HTTP common port = 80; HTTPS = 443.
  • FTP control port = 21; FTP data port depends on active/passive mode.
  • SMTP common ports = 25 for relay, 587 for submission; IMAP = 143/993; POP3 = 110/995.
  • HTTP cache validation: If-None-Match compares with ETag; valid unchanged response can be 304 Not Modified.
  • TCP server call sequence = socket -> bind -> listen -> accept -> read/write -> close.
Protocol Main function High-yield exam distinction
HTTP Transfers web resources and API responses Stateless request-response protocol
HTTPS Secures HTTP using TLS Encryption and certificate-based authentication
FTP Transfers files Separate control and data connections
SMTP Sends/relays email Not used mainly for reading mailbox
POP3 Retrieves/downloads email Simple retrieval, often local storage
IMAP Synchronizes mailbox Server-side folders and multi-device access
DNS Resolves names to records Distributed hierarchical database, not just IP lookup

Exam Point

  • Write protocol flow, not just full form of abbreviations.
  • For HTTP, mention statelessness, request/response structure, methods and status codes.
  • For DNS, draw hierarchy and mention recursive resolver, authoritative server and TTL.
  • For FTP, never forget separate control and data connections.
  • For email, separate SMTP for sending from POP3/IMAP for retrieval.
  • For socket programming, list server and client call sequences correctly.

Worked Example

When a user opens https://loksewaonline.com, the browser first checks DNS cache. If needed, a recursive resolver obtains the server IP from DNS hierarchy. The browser then opens a TCP connection to port 443, performs TLS handshake, sends HTTP request, receives HTTP response and may cache static resources using Cache-Control or ETag validation.

Subjective Answer Pattern

  • Define application layer as protocol service used by applications.
  • Explain HTTP request-response model with method, headers, status code and statelessness.
  • Discuss caching and HTTPS security if web is asked.
  • Explain FTP using control and data connection.
  • Explain email as SMTP for sending and POP3/IMAP for retrieval.
  • Explain DNS hierarchy, records, recursive resolution and caching.
  • Conclude with socket programming API sequence for TCP/UDP.

Common Engineering Mistakes

  • Saying DNS is a transport-layer protocol because it uses port 53.
  • Saying HTTP is stateful because websites have login sessions; sessions are built above stateless HTTP using cookies/tokens.
  • Confusing SMTP with POP3/IMAP.
  • Forgetting FTP has separate control and data connections.
  • Treating HTTPS as unrelated to HTTP rather than HTTP over TLS.
  • Writing socket as IP address only; socket is an endpoint abstraction involving IP, port and protocol context.
  • Assuming UDP is always used by DNS; TCP is also used in specific DNS cases.

MCQ Revision

  • Which protocol is used for sending email?
  • Which protocols are used to retrieve email?
  • What DNS record maps a name to an IPv6 address?
  • Which HTTP status code means Not Modified?
  • Which FTP connection carries commands?
  • Which socket call waits for incoming TCP connections?
  • Is HTTP stateless?
  • What is the role of DNS TTL?

Final Summary

  • Application layer protocols define message meaning and service behavior.
  • HTTP is stateless request-response; HTTPS is HTTP protected by TLS.
  • FTP uses separate control and data channels.
  • Email uses SMTP for sending and POP3/IMAP for receiving/synchronization.
  • DNS is hierarchical, distributed and cached using TTL.
  • Socket programming exposes TCP/UDP communication to applications.
Previous 3.4 Transport Layer: UDP, TCP, Flow and Congestion Control Next 3.6 Distributed Systems and Clusters
Prev Post

3.4 Transport Layer: UDP,.

Next Post

3.6 Distributed Systems and.

img img
© Losewaonline.com, 2026
  • Privacy Policy
  • Terms of Use
  • Disclaimer
  • Editorial Policy
  • Cookie Policy