0% found this document useful (0 votes)
71 views3 pages

UNIX Network Programming Course Outline

Uploaded by

Chitti Chitti
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
71 views3 pages

UNIX Network Programming Course Outline

Uploaded by

Chitti Chitti
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

CSE 197

UNIX NETWORK PROGRAMMING


(Common to CSE & IT)

Course Code :13CT1130 L T P C


4 0 0 3
Course Outcomes:
At the end of the Course, a student will be able to
CO 1 Identify interfaces and frameworks for developing network
applications.
CO 2 Develop programs for data communication using socket
functions.
CO 3 Explain functioning of TCP echo server.
CO 4 Write UDP Client Server programs using socket functions.
CO 5 Describe inter-process communication and Remote Login
mechanisms.
UNIT-I (10 Lectures)
INTRODUCTION TO NETWORK PROGRAMMING:
OSI model, Unix standards, TCP and UDP, TCP connection
establishment and termination, Buffer sizes and limitations, Standard
Internet services, Protocol usage by common internet applications.
UNIT-II (14 Lectures)
SOCKETS:
Address structures, Value – result arguments, Byte ordering and
manipulation functions and related functions. Elementary TCP sockets
– socket, connect, bind, listen, accept, fork and exec functions,
concurrent servers, close function and related functions.

G V P College of Engineering (Autonomous) 2014


198 CSE

UNIT-III (10 Lectures)


TCP CLIENT SERVER EXAMPLE:
Introduction, TCP Echo server and client functions, Normal startup
and Termination, Signal handling, Server process termination,
Crashing and Rebooting of server host, Shutdown of server host.
I/O MULTIPLEXING: I/O Models, select function, Batch input,
shutdown function, poll function, TCP Echo server.
UNIT-IV (13 Lectures)
ELEMENTARY UDP SOCKETS:
Introduction, recvfrom and sendto functions, UDP Echo server and
client functions, Lost datagrams, , Lack of flow control with UDP,
determining outgoing interface with UDP, TCP and UDP echo server
using select.
ELEMENTARY NAME AND ADDRESS CONVERSIONS:
DNS, gethostbyname function, Resolver option, gethostbyname2
function and IPV6 support, uname function, getserverbyname and
getservbyport functions, other networking information.
UNIT-V (14 Lectures)
IPC:
Introduction, File and record locking, Pipes, FIFOs, streams and
messages, Message queues, Semaphores, Shared memory.
REMOTE LOGIN:
Terminal line disciplines, Pseudo-Terminals, Terminal modes, Control
Terminals, RPC Transparency Issues.
TEXT BOOKS:
1. [Link] Stevens, “UNIX Network Programming, Sockets
API”, Volume I, 3rd Edition, PHI , 2010.
2. [Link] Stevens, “UNIX Network Programming, Volume
II”, 1st Edition, PHI, 2009.

G V P College of Engineering (Autonomous) 2014


CSE 199

REFERENCES:
1. T Chan, “UNIX Systems Programming using C++”,
1st Edition, PHI, 2010.
2. Graham Glass, King abls, “UNIX for Programmers and
Users”, 3rd Edition, Pearson Education, 2010.
3. M. J. Rochkind, “Advanced UNIX Programming”, 2 nd
Edition, Pearson Education, 2008.

pqr

G V P College of Engineering (Autonomous) 2014

Common questions

Powered by AI

I/O multiplexing improves network application performance by allowing multiple I/O operations on a single thread without blocking . By using functions like select and poll, applications can handle multiple connections simultaneously, thereby optimizing resource usage and enabling scalability. This is particularly useful in scenarios such as developing TCP echo servers where handling multiple client connections efficiently is essential. Instead of creating a new process or thread for each connection, I/O multiplexing allows monitoring multiple file descriptors to see which are ready for reading or writing, streamlining operations and enhancing performance .

Signal handling in a TCP client-server model presents challenges such as unexpected interruptions that can cause inconsistent application states or termination of processes . These are mitigated by implementing robust signal handling mechanisms to catch, ignore, or respond appropriately to signals. For instance, signals like SIGPIPE, generated when writing to a pipe with no readers, can be handled using the signal function or sigaction to prevent server termination. Proper handling includes writing logic to gracefully shut down processes, ensuring resources are released and states are consistent .

UDP poses limitations and challenges in network communications by lacking built-in acknowledgment, flow control, and error correction mechanisms . This makes it unsuitable for applications requiring reliable data transmission, as data might be lost or arrive out of order without notification. The stateless nature of UDP also leads to issues in maintaining session consistency. Developers must implement additional protocols to ensure data integrity and reliability if needed. While UDP is efficient for fast and simple transmissions like DNS, using it in scenarios necessitating reliability involves considerable complexity in developing such additional layers .

The OSI model provides a framework that standardizes network communication into seven layers, each handling specific functions such as data encapsulation, transmission, and routing . In UNIX network applications, this model helps in organizing and defining tasks such as establishing connections, data formatting, and application protocol operations. By breaking down the architecture into layers, developers can focus on specific functionalities, such as using socket APIs for communication outlined in the course , allowing for modular development and easier debugging.

IPC is vital in UNIX network programming as it allows separate processes to communicate and synchronize actions, which is essential for developing complex networked systems . Common IPC methods include pipes and FIFOs, which are used for message passing, message queues where processes can exchange messages in a structured format, semaphores for managing shared resources access, and shared memory for quick data exchange between processes. These methods enable coordination between processes, ensuring efficient execution of network applications by facilitating communication in a controlled and error-managed manner .

Remote login leverages terminal modes and control terminals to provide a seamless user experience by using pseudo-terminals to create a virtual terminal interface that mimics a local session . Terminal modes ensure that input and output behaviors are consistent with expected interactions, accommodating different protocols and handling special character sequences for tasks like password entry without echoing. Control terminals manage these connections, maintaining session integrity and user config preferences. This infrastructure ensures users experience similar operations and response times as local terminals, even when interacting remotely over network communication .

A concurrent server model using sockets handles multiple client requests simultaneously by spawning a new process or thread for each connection, unlike a sequential server model that processes one request at a time . The concurrent model increases efficiency and allows for better utilization of system resources, significantly improving response times under heavy load. However, it introduces challenges such as increased complexity in managing multiple processes or threads, higher system resource consumption, and potential issues with concurrency control, such as race conditions. These challenges can be addressed with careful resource management and synchronization techniques .

Elementary name and address conversions are crucial in network programming to translate human-readable domain names into IP addresses, which are necessary for network communication . Functions like gethostbyname perform this conversion, retrieving host information corresponding to the given host name. This function simplifies domain name resolution, which is an essential step in establishing network connections. By providing a straightforward method to obtain necessary network addressing details, these functions facilitate the setup of connections and data exchange across networks .

Socket functions are fundamental in developing programs for data communication as they enable the creation and management of connections between networked devices . Elementary TCP socket functions such as socket, connect, bind, listen, and accept facilitate establishing a reliable communication channel for data transfer. These operations allow developers to configure how data is sent and received, manage IP addresses and ports, and implement protocols for specific application requirements, effectively enabling networked applications to interact efficiently .

TCP (Transmission Control Protocol) and UDP (User Datagram Protocol) serve different purposes in Unix network programming. TCP is connection-oriented, ensuring reliability, order, and error-checking in data transmission, making it suitable for applications where data integrity is critical, such as HTTP, FTP, and TCP echo servers . UDP, on the other hand, is connectionless, with no guarantee of data delivery, order, or integrity, making it faster and more efficient for applications that can tolerate some data loss, such as DNS lookups or video streaming . These differences determine their usage depending on the criticality of data integrity versus speed and efficiency in communication.

You might also like