Network Programming (BIT401CO)
Client-server socket programming — TCP/UDP sockets, I/O multiplexing, broadcast/multicast, and raw sockets in C/Unix.
Unit 1: Introduction to Network Programming5 hrs
- Introduction to computer network: client/server model
- Protocol Suite (ISO/OSI, TCP/IP)
- Unix Standards (POSIX, OpenGroup, IETF)
- Network Utilities (telnet, route, ipconfig, ifconfig, ping, netstat, and ftp)
- Introduction to programming: wrapper functions, header files, libraries and ports numbers, IP address
- Iterative server, concurrent server, networked servers
Unit 2: Elementary Operating System Calls6 hrs
- System call, program, thread, process, Kernel
- fork(), exec() and its family, waitpid(), wait()
- pipe(), Fifo(), signals (SIGCHLD, SIGINT, SIGIO)
- IPC Names, creating and opening IPC channels, IPC permissions
Unit 3: TCP/UDP Transport Layer Protocols4 hrs
- TCP (Transmission Control Protocol): features, connection establishment and termination, states in communication (LISTEN, TIME_WAIT, ESTABLISHED, BLOCKED)
- UDP (User Datagram Protocol): features, uses, comparison with TCP
- TCP and UDP buffer sizes and limitations
- SCTP overview
Unit 4: Elementary Socket Calls5 hrs
- Socket address structure: for IPV4, IPV6, UNIX domain socket and generic socket address structure, value-result argument
- Byte ordering and manipulating function: htonl(), htons(), ntohl(), ntohs(), inet_addr(), inet_aton(), inet_ntoa(), inet_pton()
Unit 5: Elementary TCP-UDP Socket6 hrs
- Socket(), connect(), bind(), listen(), accept(), read(), write(), close()
- sendto(), recvfrom()
Unit 6: I/O Multiplexing4 hrs
- Introduction, I/O models: blocking I/O, non-blocking I/O, I/O multiplexing, signal driven I/O (SIGIO) and asynchronous I/O model
- Select(), poll(), shutdown()
Unit 7: Socket Options2 hrs
- Getsockopt() and setsockopt() functions
- IPV4, IPV6, TCP socket options (SO_REUSEADDR, TCP_NODELAY)
Unit 8: Name and Address Conversion2 hrs
- Domain Name System, gethostbyname(), gethostbyaddr(), uname(), getservbyname() and getservbyport()
- gethostname() functions, socket timeouts
Unit 9: Unix Domain Protocol3 hrs
- Introduction, Unix domain socket address structure
- socketpair function
- Unix domain stream client-server, UNIX domain datagram client/server
Unit 10: Daemon Processes, Inetd Superservers2 hrs
- Introduction, Syslog facility (syslog function)
- daemon_init function
- inetd daemon configuration
Unit 11: Broadcast and Multicast3 hrs
- Introduction, Broadcast and multicast addresses
- Comparison between broadcast, unicast and multicast socket options
- Unicast versus Broadcast, multicast versus broadcast on LAN
Unit 12: IP Layers and Raw Socket3 hrs
- Introduction, raw socket creation
- Input and output packet processing (ping example implementation)
Reference books
- Stevens, W. R., Unix Network Programming, Vol 1: Networking APIs - Sockets and XTI, Prentice Hall.
- Stevens, W. R., Unix Network Programming, Vol 2: Interprocess Communications, Prentice Hall.
- Comer, Douglas E., Internetworking with TCP/IP: Principles, Protocols, and Architecture, Vol 3, Prentice Hall.