These are all the programs I wrote in my Computer Networks Lab in 5th Semester.
1. Find the IP address of your computer. Try connecting to different service providers and notice the changes, if any, in the IP address of your machine.
2. Run traceroute via two or more service providers for www.kiit.ac.in and report your observations, like if some paths default to IPv6 then how can you force traceroute to use IPv4, any private IP addresses routers that do not reply to requests, etc.
5. Use nslookup to find the IP Address of `www.kiit.ac.in` and `www.facebook.com`
6. How can you perform a reverse DNS lookup to find the domain name associated with the IP address 8.8.8.8?
7. How can you use nslookup to query www.example.com using the DNS server at 8.8.8.8?
9. What are the ipconfig commands to release and renew an IP address on a Windows machine?
swap.c
Write a program in C to swap two numbers using pointer.structure.c
Write a C program to assign values to each members of the following structure. Pass the populated structure to a function using call-by address and print the value of each member of the structure.
struct info {
int roll_no;
char name[50];
float CGPA;
};
-
extractbyte.c
Write a C program to extract a byte from an integer (user input) value and store them in character variables and print the content of those variables. -
disectpkt.c
Write a C program to enter a number and store the number across the following structure and print the content of each member of the structure. Then aggregate each member of the structure to form the original number.
struct pkt {
char ch1;
char ch2[2];
char ch3;
};
lilbigendian.c
Write a C program to check whether the Host machine is Little Endian or Big Endian. Enter a number, print the content of each byte location and convert the endianess of the same.
Prog1\
Write a C program for UDP to create a socket and display if the socket is created successfully or not. Using this socket, apply bind() to associate an IP address and port number and display if the socket is bound successfully else display the error message.Prog2\
Write a C program in UDP to send a message"Hello KIIT"
from client to server. Display the message on the server side.Prog3\
Write a C program in UDP to send a message"Thank you!!!"
from server to client. Display the message on the client side.Prog4\
Write a program to pass a string from client to server. Display the lower case message in the server. Further, convert the message from lower case to upper case and display the converted message in client side.
Prog1\
Write a program to pass a string from client to server. Display the string in server side. Further, find the reverse of the string and send the same to the client and display the reversed string in client side.Prog2\
Write a program to pass an integer array from client to server and print the array in server side.Prog3\
Write a program to pass an integer array from client to server. Determine the greatest element on the server side and print it in the client side.Prog4\
Write a program to pass an integer array from client to server. On the server side, perform the sorting operation and send back the sorted array to the client. Display the sorted array on the client side.
Prog1\
Write a program in TCP to establish a connection between a client and a server. Display appropriate messages to confirm the connection establishment or error scenario.Prog2\
Write a program in TCP to pass a string “Welcome to KIIT” from client to server. Display the string in server side. Further, determine the number of vowels in the string and send the same to the client. The client will display the number of vowels present.Prog3\
Write a program in TCP to pass a string from client to server. On the server side first display the string and then check if the string is a palindrome or not.Prog4\
Write a program in TCP to pass an integer array from client to server. Display the array on the server side and then determine the sum of elements of array. The server sends back this sum to the client side which will display the same.Prog5\
Write a program in TCP to pass an integer array from client to server. On the server side determine the second largest element of the array and send back that element to the client. The client will then display that element.
Prog1\
Write a C program in UDP to pass a string from client to server. On the server side, display the string, futhur, the server will check if the string is a palindrome or not. If palindrome, then, server will send a message back to the client otherwise server will find the difference of two characters where the strings became different. This difference will be passed to the client, and displayed on the client side accordingly.Prog2\
Write a C program using UDP to pass 1D array from client to server, the server will determine total number of prime numbers and the result will be sent back to the client where it is displayed accordingly.Prog3\
WAP using TCP to pass 2 strings from client to server. on the server side, it will check if the strings are same or different. The server will print the msg. accordingly.Prog4\
WAP using TCP to pass a matrix of size of 3 x 3 from client to server. The server will display the matrix and it will find the sum of main diagonal elements and result is send back to the client, where is displayed accordingly.
Prog1\
Write the client side and server side of a connection-oriented socket where the server will behave as a chart server serving multiple chart clients. When the chart server receives a “logout” message from a particular client then it terminates the respective connection with that client.