0% found this document useful (0 votes)
226 views5 pages

18CSC302J/ Computer Networks: List of Experiments

The document lists 15 header files that are necessary for socket programming. It provides a brief description of the purpose and functions of each header file, including stdio.h for input/output, unistd.h for POSIX functions, string.h for string manipulation, and network-related headers like sys/socket.h, netinet/in.h, and arpa/inet.h for implementing sockets, addressing, and protocol conversions. Functions from these headers are used for tasks like socket programming, packet capturing, ARP operations, error handling, and address conversions between binary and string formats.

Uploaded by

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

18CSC302J/ Computer Networks: List of Experiments

The document lists 15 header files that are necessary for socket programming. It provides a brief description of the purpose and functions of each header file, including stdio.h for input/output, unistd.h for POSIX functions, string.h for string manipulation, and network-related headers like sys/socket.h, netinet/in.h, and arpa/inet.h for implementing sockets, addressing, and protocol conversions. Functions from these headers are used for tasks like socket programming, packet capturing, ARP operations, error handling, and address conversions between binary and string formats.

Uploaded by

pranjal patel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

18CSC302J/ Computer Networks

LIST OF EXPERIMENTS

1. Study of necessary header files with respect to socket programming.

2. Study of Basic Functions of Socket Programming

3. Simple TCP/IP Client Server Communication

4. UDP Echo Client Server Communication

5. Concurrent TCP/IP Day-Time Server

6. Half Duplex Chat Using TCP/IP

7. Full Duplex Chat Using TCP/IP

8. Implementation of File Transfer Protocol

9. Remote Command Execution Using UDP

10. ARP Implementation Using UDP


18CSC302J/ Computer Networks

Sl.No Table of Contents Page No.

1 Study of header files with respect to socket programming 4

2 Study of Basic Functions of Socket Programming 6

3 Simple Tcp/Ip Client Server Communication 12

4 UDP Echo Client Server Communication 16

5 Concurrent TCP/IP Day-Time Server 20

6 Half Duplex Chat Using TCP/IP 23

7 Full Duplex Chat Using TCP/IP 27

8 Implementation Of File Transfer Protocol 32

9 Remote Command Execution Using UDP 35

10 ARP Implementation Using UDP 39


State diagram for server and client model
Ex.No:1
Date:

STUDY OF HEADER FILES WITH RESPECT TO SOCKET


PROGRAMMING

1. stdio.h:
Has standard input and output library providing simple and efficient buffered stream IO
interface.

2. unistd.h:
It is a POSIX standard for open system interface. [Portable Operating System Interface]

3. string.h:
This header file is used to perform string manipulation operations on NULL terminated
strings.(Bzero -0 the m/y)

4. stdlib.h:
This header file contains the utility functions such as string conversion routines, memory
allocation routines, random number generator, etc.

5. sys/types.h:
Defines the data type of socket address structure in unsigned long.

6. sys/socket.h:
The socket functions can be defined as taking pointers to the generic socket address structure
called sockaddr.

7. netinet/in.h:
Defines the IPv4 socket address structure commonly called Internet socket address structure
called sockaddr_in.

8. netdb.h:
Defines the structure hostent for using the system call gethostbyname to get the network host
entry.

9. time.h:
Has structures and functions to get the system date and time and to perform time
manipulation functions. We use the function ctime(), that is defined in this header file , to
calculate the current date and time.

10. sys/stat.h:
Contains the structure stat to test a descriptor to see if it is of a specified type. Also it is used
to display file or file system status.stat() updates any time related fields.when copying from 1 file
to another.

11. sys/ioctl.h:
Macros and defines used in specifying an ioctl request are located in this header file. We use
the function ioctl() that is defined in this header file. ioctl() function is used to perform ARP cache
operations.
12. pcap.h:
Has function definitions that are required for packet capturing. Some of the functions are
pcap_lookupdev(),pcap_open_live() and pcap_loop(). pcap_lookupdev() is used to initialize the
network device.The device to be sniffed is opened using the pcap_open_live(). Pcap_loop()
determines the number of packets to be sniffed.

13. net/if_arp.h:
Contains the definitions for Address Resolution Protocol. We use this to manipulate the ARP
request structure and its data members arp_pa,arp_dev and arp_ha. The arp_ha structure’s data
member sa_data[ ] has the hardware address.

14. errno.h:
It sets an error number when an error and that error can be displayed using perror function. It
has symbolic error names. The error number is never set to zero by any library function.

15. arpa/inet.h:
This is used to convert internet addresses between ASCII strings and network byte ordered
binary values (values that are stored in socket address structures). It is used for inet_aton,
inet_addr, inet_ntoa functions.

You might also like