Siksha Sarovar

Siksha Sarovar (sikshasarovar.com) is a free educational web application that helps students in India learn programming and prepare for academic and competitive exams. The platform offers structured coding courses (C, C++, Python, Java, HTML, CSS, PHP, Power BI, AI, Machine Learning, Data Science), complete university curriculum notes for BCA/MCA students with previous year question papers, Class 10 and Class 12 CBSE/HBSE school notes, and dedicated preparation material for SSC, UPSC, Banking, Railway and other government exams. Browsing the site is completely free and requires no account. Users may optionally sign in with Google solely to save their learning progress, quiz scores and personal preferences across devices.

Privacy Policy | Terms of Service | Contact Siksha Sarovar | About Siksha Sarovar

v4.0.9 · PWA
Siksha Sarovar logo
Siksha Sarovar
Your Learning Universe

Siksha Sarovar is a free e-learning platform for coding courses, BCA university notes and competitive exam preparation. Optional Google sign-in saves your learning progress across devices.

Initializing knowledge base…
Compiling modules 0%

Network Programming — Free Notes & Tutorial

Free Network Programming notes for BTech CS — sockets API, TCP/UDP client-server design, I/O multiplexing with select and poll, socket options, DNS, daemons and inetd, broadcasting, multicasting, raw sockets, ping, traceroute and libpcap, with all lab programs in C. 100% free. Free Network Programming course on SikshaSarovar.

This Network Programming course is part of Siksha Sarovar and is 100% free for students in India — no sign-up required to read. It contains 15 structured lessons with examples, and pairs with our free online compiler and AI tutor.

What you will learn

  • Sockets API
  • Socket
  • Bind
  • Listen
  • Accept
  • Connect
  • Fork
  • Concurrent servers
  • TCP echo client-server
  • UDP sockets
  • Select
  • Poll
  • Shutdown
  • Socket options
  • Readv/writev
  • Recvmsg/sendmsg
  • DNS
  • Getaddrinfo
  • Daemons
  • Inetd
  • Broadcasting
  • Multicasting
  • SNTP
  • Raw sockets
  • Ping
  • Traceroute
  • BPF
  • Libpcap
  • Pseudo-terminals
  • RPC

Course content (15 lessons)

  1. Course Introduction: Programming the Network, Not Just Studying It — Welcome to Network Programming Computer Networks taught you how the Internet works — layers, protocols, headers. Network Programming teaches you to write the programs at both ends…
  2. Unit 1: Protocol Foundations — OSI, Unix Standards, TCP & UDP — 1.1 Where socket programs sit in the layer cake The sockets API is the door between the application process and the kernel's transport layer. Everything above the dotted line is…
  3. Unit 1: Socket Address Structures, Value-Result Arguments & Byte Ordering — 2.1 The address structures — the API's luggage Every socket function passes addresses via structures. IPv4: IPv6 uses struct sockaddr in6 ( sin6 family = AF INET6 , 128-bit sin6…
  4. Unit 1: Elementary TCP Sockets — socket to accept, fork & Concurrent Servers — 3.1 The call ladder This diagram is the exam answer for "explain the socket functions used by a TCP client and server". 3.2 The functions, one by one int socket(int family, int…
  5. Unit 2: The TCP Echo Client–Server, Signals & Crash Scenarios — 1.1 The echo pair — the course's laboratory animal The server echoes back every line a client sends. Server child logic and client loop: Normal startup: server…
  6. Unit 2: Elementary UDP Sockets — 2.1 The UDP API — two new calls No connections: each datagram carries its destination / reveals its source. No listen, no accept, no fork needed — one socket serves every client ,…
  7. Unit 2: I/O Multiplexing — I/O Models, select, shutdown & poll — 3.1 The five I/O models (the canonical comparison) Model Wait for data Copy data to process Blocks where? :--- :--- :--- :--- Blocking I/O process blocks process blocks the whole…
  8. Unit 2: Socket Options & Advanced I/O Functions — 4.1 getsockopt / setsockopt level selects the protocol layer: SOL SOCKET (generic), IPPROTO IP (IPv4), IPPROTO IPV6 , IPPROTO ICMPV6 , IPPROTO TCP . Most options are integer flags…
  9. Unit 3: Name & Address Conversions — DNS, Resolver & IPv6 Support — 1.1 The DNS in five lines Programs use names ( www.example.com ); packets need addresses . The DNS is the distributed, hierarchical database that maps between them. Resource…
  10. Unit 3: Daemon Processes, syslog & the inetd Superserver — 2.1 What a daemon is A daemon is a long-running background process with no controlling terminal — servers (sshd, httpd, named, crond) all daemonise at startup. No terminal means…
  11. Unit 3: Broadcasting — One-to-All on the LAN & Race Conditions — 3.1 The four addressing modes Mode Delivery Support :--- :--- :--- Unicast one sender → one receiver everywhere Broadcast one → all hosts on a subnet IPv4 only (IPv6 dropped it)…
  12. Unit 3: Multicasting — Groups, Socket Options, MBone & SNTP — 4.1 Multicast addresses and group membership Broadcast disturbs everyone; multicast delivers only to hosts that joined a group . IPv4 class D: 224.0.0.0 – 239.255.255.255 — a…
  13. Unit 4: Raw Sockets — Ping, Traceroute & an ICMP Daemon — 5.1 What raw sockets are for TCP and UDP sockets only carry TCP and UDP. A raw socket ( SOCK RAW ) opens the trapdoor to the IP layer itself, enabling programs to: 1. send/receive…
  14. Unit 4: Datalink Access — BPF, DLPI, SOCK_PACKET, libpcap & the UDP Checksum — 6.1 One layer lower still Raw sockets see IP datagrams addressed to (or from) this host . Datalink access captures entire frames — anyone's — straight from the NIC (in promiscuous…
  15. Unit 4: Remote Login — Terminals, Pseudo-Terminals & RPC Transparency — 7.1 Terminal line disciplines and modes Between a terminal device and the processes reading it sits the kernel's terminal line discipline — the layer that turns raw keystrokes…

Course Introduction: Programming the Network, Not Just Studying It

Welcome to Network Programming

Computer Networks taught you how the Internet works — layers, protocols, headers. Network Programming teaches you to write the programs at both ends of the wire: clients, servers, daemons, ping, traceroute, even packet sniffers. The toolkit is the sockets API — the C interface (born in 4.2BSD UNIX, 1983) that still underlies every networked program: browsers, game servers, Node.js, Python's socket module, all of them.

The guiding textbook tradition for this paper is W. Richard Stevens' UNIX Network Programming — the lessons follow its path and its famous client/server examples.

The journey of this course

How this course is organised

Syllabus blockLessons that cover it
OSI model, Unix standards, TCP/UDP, connection establishment, buffer sizes, standard servicesUnit 1 → "Protocol Foundations"
Socket address structures, value-result arguments, byte orderingUnit 1 → "Socket Address Structures & Byte Ordering"
socket, connect, bind, listen, accept, fork/exec, concurrent servers, closeUnit 1 → "Elementary TCP Sockets"
TCP echo client/server, signal handling, server crash/reboot scenariosUnit 2 → "The TCP Echo Client–Server & Its Failure Modes"
Elementary UDP sockets, lost datagrams, no flow control, outgoing interfaceUnit 2 → "Elementary UDP Sockets"
I/O models, select, poll, shutdown, batch inputUnit 2 → "I/O Multiplexing"
getsockopt/setsockopt, socket states, all option levelsUnit 2 → "Socket Options & Advanced I/O" (first half)
Socket timeouts, recv/send flags, readv/writev, recvmsg/sendmsg, ancillary dataUnit 2 → "Socket Options & Advanced I/O" (second half)
DNS, gethostbyname, resolver, IPv6 functions, unameUnit 3 → "Name & Address Conversions"
Daemons, syslog, daemon_init, inetdUnit 3 → "Daemon Processes & the inetd Superserver"
Broadcasting, unicast vs broadcast, race conditionsUnit 3 → "Broadcasting"
Multicasting, mcast_join, MBone, SNTPUnit 3 → "Multicasting & SNTP"
Raw sockets, ping, traceroute, ICMP daemonUnit 4 → "Raw Sockets"
BPF, DLPI, SOCK_PACKET, libpcap, UDP checksumUnit 4 → "Datalink Access"
Terminal line disciplines, pseudo-terminals, rlogin, RPC transparencyUnit 4 → "Remote Login & RPC Transparency"
Lab programs (sockets in C)"Lab Practicals" lesson at the end

Prerequisites

You should knowWhy
C programming (pointers, structs, fork)the entire API is C

| TCP/IP basics: IP addresses, ports, the 3-way handshake

Continue reading: Course Introduction: Programming the Network, Not Just Studying It →

Frequently asked questions

Is the Network Programming course really free?

Yes. The entire Network Programming course on Siksha Sarovar is free to read with no account required. You can optionally sign in with Google to save your progress.

Do I get a certificate for Network Programming?

Yes — finish the lessons and pass the quiz to earn a free, verifiable certificate you can share on LinkedIn or with recruiters.

Can I run code while learning?

Yes. The built-in online compiler runs C, C++, Python, Java, PHP, JavaScript, C# and SQL directly in your browser — no installation needed.