Network Programming & Admin BCS052

 





What is Network Programming & Admin ?

Network Programming & Administration is the study and practice of writing code that enables computers and applications to communicate over networks, combined with managing and maintaining those networks to ensure security, reliability, and efficiency. It blends programming skills with system administration tasks, making it a core subject for IT professionals  or students.

What is Network Programming?

Writing software that communicates across a network using protocols like TCP/IP, HTTP, or UDP.

Purpose: Enables applications (e.g., web browsers, chat apps, IoT devices) to exchange data.

Key Skills:
  • Socket programming (in C, Python, Java, etc.)
  • Understanding of client-server architecture
  • Use of APIs for network communication
  • Concepts like multithreading, synchronization, and error handling

👉 Example: Writing a Python program that sends data from one computer to another using sockets.

What is Network Administration?

Managing and maintaining computer networks (LAN, WAN, cloud-based).

Tasks Involved:

  1. Configuring routers, switches, and firewalls
  2. Monitoring network traffic and performance
  3. Ensuring security (preventing malware, unauthorized access)
  4. Troubleshooting connectivity issues
  5. Managing user accounts and permissions

👉 Example: Setting up a Linux server, configuring IP addresses, and applying firewall rules to secure the network.

Combined Scope: Network Programming & Admin 

Network Programming & Administration = Coding for communication + Managing the network environment.


Block 1: TCP/IP Protocols :   Unit-1 Unit-2 Unit-3 Unit-4                        View Block-1 PPT 

Block 2: Fundamentals of TCP/IP Programming : Unit-1 Unit-2 Unit-3     View Block-2 PPT 

Block 3: Network Administration with Linux  Unit-1 Unit-2 Unit-3 Unit-4  View Block -3 PPT 

2022 PYQ          2024 PYQ

It prepares students to:

  • Develop applications that run across networks.
  • Understand how protocols work at different layers.
  • Configure and secure networks in real-world environments.

Why It Matters

Career Relevance: Essential for roles like Network Engineer, System Administrator, Cybersecurity Analyst, IoT Developer.

Industry Use: Modern enterprises rely on programmable networks for automation, cloud services, and security.

Future Trends: Software-defined networking (SDN), IoT security, and cloud-native applications demand strong skills in both programming and administration.

 In short: Network Programming & Administration teaches you how to code for communication across networks and manage those networks securely and efficiently. It’s a bridge between software development and IT infrastructure management.

Network Programming & Administration is a combined discipline that focuses on both the development of software that communicates over networks and the management of those networks.

Network Programming

This is about writing code that enables communication between computers.

  • Uses protocols like TCP/IP, HTTP, UDP.

  • Involves socket programming (in languages like C, Java, Python).

  • Builds applications such as chat systems, web servers, IoT communication tools. 👉 Example: Writing a Python script that lets two computers exchange messages over Wi-Fi.

 Network Administration

This is about managing and maintaining the network infrastructure.

  • Configuring routers, switches, and servers.

  • Monitoring traffic and performance.

  • Ensuring security (firewalls, intrusion detection, user access control).

  • Troubleshooting connectivity issues. 👉 Example: Setting up a secure LAN in a college computer lab and ensuring students can access resources safely.

Why They’re Taught Together

  • Programming teaches you how to create applications that run across networks.

  • Administration teaches you how to set up and secure those networks.

  • Together, they prepare you for careers like Network Engineer, System Administrator, IoT Developer, Cybersecurity Analyst.

🧭 1. Origin of TCP/IP and Internet

🔹 Communication

  • Concept: Exchange of data between devices using signals or packets.

  • Analogy: Like sending letters — sender, receiver, medium (post office = network).

  • Example: A browser requests a webpage from a server using HTTP.

  • Diagram:

    Code
    [Sender] → [Medium: Internet] → [Receiver]
    

🔹 Why We Need the Internet

  • To share information globally and connect systems.

  • Fact: Over 5 billion people use the Internet (2026 data).

  • Analogy: Internet = “digital nervous system” of the world.

🔹 Need of Protocols

  • Protocols are rules for communication (like grammar in language).

  • Example: TCP/IP ensures reliable data transfer.

  • Diagram:

    Code
    Application → Transport → Internet → Network Access
    

🔹 Problems in Communication

  • Data loss, incompatibility, congestion.

  • Analogy: Like speaking different languages without a translator.

🔹 Dealing with Incompatibility

  • Standardization via TCP/IP.

  • Fact: TCP/IP became the official Internet protocol in 1983.

🔹 Brief History

  • 1969: ARPANET (first network).

  • 1983: TCP/IP adopted.

  • 1990: Tim Berners-Lee created WWW.

  • Diagram: Timeline of Internet evolution.

🔹 Architecture of Internet

  • Layers: Application, Transport, Internet, Network Access.

  • Analogy: Like a postal system — each layer has a role (addressing, delivery, packaging).

🌐 2. TCP/IP Layer and Protocols

  • TCP/IP Model: 4 layers (vs. OSI’s 7).

  1. Application  
  2. Transport
  3. Internet
  4. Network Access

  5. Example: Email uses SMTP (Application), TCP (Transport), IP (Internet).

🔹 3. Network Access Layer

  • Handles physical transmission (Ethernet, Wi-Fi).

  • Analogy: Like roads and vehicles carrying data packets.

  • Example: LAN cables, routers, switches.

🌍 4. Internet Layer

Need for IP Address

  • Unique identifier for devices.

  • Analogy: Like a home address for computers.

  • Fact: IPv4 has ~4.3 billion addresses; IPv6 has 340 undecillion!

Classes of IP Address

ClassRangeUse
A1–126Large networks
B128–191Medium networks
C192–223Small networks

Special Meanings

  • 127.0.0.1 → Loopback (self-test).

  • 255.255.255.255 → Broadcast.

Who Decides IPs

  • IANA (Internet Assigned Numbers Authority) allocates IPs globally.

Internet Protocol (IP)

  • Responsible for packet delivery.

  • Diagram:

    Code
    [Source IP] → [Router] → [Destination IP]
    

ARP & RARP

  • ARP: Finds MAC address from IP.

  • RARP: Finds IP from MAC.

  • Analogy: ARP = “phonebook lookup” for devices.

ICMP

  • Used for error messages (e.g., ping).

  • Example: ping google.com checks connectivity.

🚚 5. Transport Layer

TCP

  • Reliable, connection-oriented.

  • Analogy: Like a courier service with delivery confirmation.

  • Example: File transfer, email.

UDP

  • Fast, connectionless.

  • Analogy: Like sending postcards — no delivery guarantee.

  • Example: Streaming, gaming.

💬 6. Application Layer

Electronic Mail (SMTP, POP3, IMAP)

  • Analogy: Post office for digital letters.

  • Diagram:

    Code
    [Client] → SMTP → [Server] → POP3/IMAP → [Receiver]
    

DNS

  • Converts domain names to IPs.

  • Analogy: Phonebook of the Internet.

  • Example: www.google.com → 142.250.190.78

SNMP

  • Monitors network devices.

  • Example: Admin checks router health remotely.

TELNET

  • Remote login protocol.

  • Analogy: Like accessing another computer’s terminal.

HTTP

  • Foundation of the web.

  • Example: Browser requests → Server responds.

  • Diagram:

    Code
    [Client] → HTTP Request → [Server] → HTTP Response
    

📊 Facts & Figures

  • TCP/IP introduced in 1983.

  • IPv6 launched in 1998.

  • Over 1.2 billion websites online (2026).

  • Ping latency: <50 ms for local networks.

Would you like me to create slide-wise teaching notes (with visuals and analogies per topic) so you can directly use them in your BCA-5 class presentation?

2024 


Q1 (Compulsory)

(a) Virtual Private Network (VPN) vs FreeNX

  • VPN: Creates a secure tunnel over the Internet, encrypting traffic between client and server.

  • FreeNX: A remote desktop protocol (based on NX) that allows graphical remote sessions.

  • Comparison:

    • VPN secures all traffic; FreeNX focuses on remote desktop access.

    • VPN is protocol‑agnostic; FreeNX is application‑specific.

    • VPN is widely used for corporate security; FreeNX is lighter but less versatile.

(b) POP vs IMAP

  • POP (Post Office Protocol): Downloads emails from server to client, usually removes them from server.

  • IMAP (Internet Message Access Protocol): Keeps emails on server, allows multiple devices to access the same mailbox.

  • Analogy: POP = “taking letters out of the postbox”; IMAP = “reading letters while they stay in the postbox.”

(c) ICMP Messages

  • Definition: Internet Control Message Protocol used for error reporting and diagnostics.

  • Examples: Echo request/reply (ping), destination unreachable, time exceeded.

  • Significance: Helps in troubleshooting and maintaining network health.

(d) Limitations of Classful Addressing (IPv4)

  • Wastage of addresses (large blocks unused).

  • No flexibility in subnetting.

  • Limited scalability for modern Internet.

  • Example: A Class A network (16 million addresses) even if only 1000 are needed.

(e) Sequence Number & Padding in TCP

  • Sequence Number: Ensures ordered delivery of segments, helps in retransmission.

  • Padding: Aligns TCP header to 32‑bit boundary for efficiency.

  • Analogy: Sequence numbers = “page numbers in a book”; padding = “blank space to align text.”

(f) Structure of UDP Datagram

  • Fields: Source port, destination port, length, checksum, data.

  • Diagram:

    Code
    +-------------------+
    | Source Port       |
    +-------------------+
    | Destination Port  |
    +-------------------+
    | Length | Checksum |
    +-------------------+
    | Data             |
    +-------------------+
    

(g) ARP vs RARP

  • ARP (Address Resolution Protocol): Maps IP → MAC.

  • RARP (Reverse ARP): Maps MAC → IP.

  • Analogy: ARP = “finding house location from address”; RARP = “finding address from house location.”

(h) Subnetting & Supernetting

  • Subnetting: Dividing a network into smaller sub‑networks.

    • Example: 192.168.1.0/24 split into 192.168.1.0/26, 192.168.1.64/26, etc.

  • Supernetting: Combining multiple networks into one larger block.

    • Example: Combining 192.168.0.0/24 and 192.168.1.0/24 into 192.168.0.0/23.

Q2

(a) Distance Vector Routing

  • Each router shares its routing table with neighbors.

  • Uses Bellman‑Ford algorithm.

  • Example: Router A tells Router B “I can reach network X in 2 hops.”

  • Problem: Slow convergence, risk of routing loops.

(b) DHCP (Dynamic Host Configuration Protocol)

  • Purpose: Automatically assigns IP, subnet mask, gateway, DNS.

  • Process:

    1. Discover: Client broadcasts request.

    2. Offer: Server responds with IP offer.

    3. Request: Client requests offered IP.

    4. Ack: Server confirms assignment.

Q3

(a) TCP Three‑Way Handshake

  • Steps:

    1. SYN → Client requests connection.

    2. SYN‑ACK → Server acknowledges.

    3. ACK → Client confirms.

  • Termination: Uses FIN and ACK exchange.

  • Diagram:

    Code
    Client → SYN → Server
    Server → SYN+ACK → Client
    Client → ACK → Server
    

(b) TCP/IP vs OSI Model

  • Mapping:

    • Application (TCP/IP) ↔ Application, Presentation, Session (OSI).

    • Transport ↔ Transport.

    • Internet ↔ Network.

    • Network Access ↔ Data Link + Physical.

  • Functions not mapped: OSI’s Presentation (data format conversion) and Session (dialog control).

Q4

(a) DNS

  • Namespace: Hierarchical (root → TLD → domain → subdomain).

  • Resource Record: Maps names to IPs (A, MX, CNAME).

  • Name Server: Stores records, answers queries.

  • Message Format: Header, question, answer, authority, additional.

(b) Samba Server Configuration

  • Steps:

    1. Install Samba.

    2. Edit /etc/samba/smb.conf.

    3. Set workgroup, server string, IP (192.162.0.18).

    4. Define shared directories.

    5. Restart Samba service.

    6. Access using machine name “BCA.”

Q5

TCP Client Algorithm

  1. Create socket.

  2. Connect to server.

  3. Send list of 10 numbers.

  4. Receive smallest number.

  5. Close connection.

TCP Server Algorithm

  1. Create socket.

  2. Bind to port.

  3. Listen (max 4 clients).

  4. Accept connections.

  5. Receive list, find smallest number.

  6. Send result back.

  7. Repeat for other clients.

  8. Close connection.



2022

Here’s a complete set of answers for the December 2022 BCS‑052 exam paper, explained in a clear, student‑friendly way with examples, analogies, diagrams, and facts.

Q1 (Compulsory)

(a) Network address of 111.65.17.22

  • IP: 111.65.17.22 → Class A (since first octet = 111).

  • Default mask: 255.0.0.0.

  • Network address: 111.0.0.0.

(b) Class of IP addresses

  • 22.100.150.200 → Class A (1–126).

  • 150.100.100.200 → Class B (128–191).

(c) getsocket() vs setsocket()

  • getsocket(): Retrieves current socket options.

  • setsocket(): Sets or modifies socket options (e.g., timeout, buffer size).

  • Analogy: getsocket = “checking settings”; setsocket = “changing settings.”

(d) Socket types

  • Stream socket (TCP): Reliable, connection‑oriented, like a phone call.

  • Datagram socket (UDP): Fast, connectionless, like sending postcards.

(e) Web server function & Apache/Samba

  • Primary function: Serve web content to clients via HTTP.

  • Apache: Popular open‑source web server, cross‑platform.

  • Samba: Provides file and print services, allows Windows clients to access Linux/Unix servers.

(f) TCP 3‑way handshake

  • Steps: SYN → SYN‑ACK → ACK.

  • Diagram:

    Code
    Client → SYN → Server
    Server → SYN+ACK → Client
    Client → ACK → Server
    

(g) FTP purpose & commands

  • Purpose: Transfer files between client and server.

  • Commands:

    • put filename → upload file.

    • get filename → download file.

    • mput / mget → multiple files.

(h) Closing a socket

  • Ways: close() and shutdown().

  • Difference:

    • close() releases socket completely.

    • shutdown() partially closes (read/write separately).

(i) Use of BIND

  • BIND (Berkeley Internet Name Domain): DNS server software.

  • Components:

    • named: main daemon.

    • zone files: contain domain records.

    • resolver library: client side.

Q2

(a) DNS mapping procedure

  1. Client queries local resolver.

  2. Resolver contacts root server.

  3. Root directs to TLD server (.com).

  4. TLD directs to authoritative server (YYY.com).

  5. Authoritative server returns IP of XXX.YYY.com.

(b) Remote administration services

  • Common: SSH, Telnet, FTP, Rlogin.

  • SSH: Secure, encrypted remote login.

  • Rlogin: Remote login, but less secure.

(c) TCP header flags

  • Urgent pointer: Marks urgent data.

  • Push: Forces immediate delivery to application.

  • Acknowledgement: Confirms receipt of data.

Q3

(a) Ethernet tools

  • ipconfig: Displays IP configuration.

  • route/netstat -rn: Shows routing table.

  • lsmod: Lists loaded kernel modules.

  • ping IP: Tests connectivity.

  • dhclient: Requests IP from DHCP server.

(b) Concurrent TCP server & client (C)

  • Server:

    • Create socket, bind, listen.

    • Accept up to 4 clients concurrently (using fork/threads).

    • Receive X=5, Y=9, swap values, send back.

  • Client:

    • Create socket, connect.

    • Send X=5, Y=9.

    • Receive swapped values.

(c) UDP header format

Code
+-------------------+
| Source Port       |
+-------------------+
| Destination Port  |
+-------------------+
| Length | Checksum |
+-------------------+
| Data             |
+-------------------+
  • Source Port: Identifies sender process.

  • Checksum: Error detection.

Q4

(a) Distance vector routing

  • Each router shares routing table with neighbors.

  • Uses Bellman‑Ford algorithm.

  • Updates based on hop count.

  • Problem: slow convergence, loops.

(b) Networking problems & tools

  • Reasons: misconfiguration, hardware failure, congestion.

  • Tools:

    • Nmap (Wmap): Scans networks.

    • Traceroute: Shows path packets take.

    • Netstat: Displays connections and ports.

(c) System calls

  • send(): Send data on connected socket.

  • sendto(): Send data to specific address (UDP).

  • recvfrom(): Receive data with sender info.

Q5

(a) Integrity in network security

  • Ensures data is not altered during transmission.

  • Example: Hashing, checksums.

(b) Functions in socket programming

  • gethostbyname(): Resolves hostname to IP.

  • gethostaddress(): Gets IP address.

  • getsockname(): Returns local socket details.

  • getservbyname(): Gets port number for service.

(c) UDP client/server algorithm

  • Client:

    1. Create socket.

    2. Send number to server.

    3. Receive factorial.

    4. Close socket.

  • Server:

    1. Create socket, bind.

    2. Wait for number.

    3. Compute factorial.

    4. Send result back.

    5. Repeat.


No comments:

Post a Comment

If you have any query or doubt, please let me know. I will try my level best to resolve the same at earliest.

E-Learning Resource - Tecnia Library

  1) ICT Academy   It is a government‑industry initiative designed to bridge the gap between academia and industry by offering faculty devel...