Implement three nodes point – to – point network with duplex links between them & Set the queue size, vary the bandwidth and find the number of packets dropped

#Create a simulator object   set  ns  [new Simulator] #Open a trace file   set  nt  [open  lab1.tr  w]   $ns  trace-all  $nt #Open a nam trace file   set …

Continue ReadingImplement three nodes point – to – point network with duplex links between them & Set the queue size, vary the bandwidth and find the number of packets dropped

C program which illustrates sending signal from one process to another by using kill API. Also check if the program have permission to send the signal or not

#include#include#include#include#include#includevoid sig_handler(int num){printf("nChild Sent a signal to parent:%dn",num);signal(SIGALRM,SIG_DFL);}int main(){int status;system("clear");printf("n--------Signal Handling Across Processes----------n");switch(fork()){case -1:perror("nFork Failed...n");exit(1);break;case 0:alarm(3);kill(getppid(),SIGALRM);//signal(SIGALRM,sig_handler);printf("nIts Child Processn");sleep(5);break;default:signal(SIGALRM,sig_handler);wait(&status);printf("nIts Parent Processn");}return 0;}

Continue ReadingC program which illustrates sending signal from one process to another by using kill API. Also check if the program have permission to send the signal or not

C Program to register signal handler for SIGTERM and when it receives the signal, the program should print some information about the origin of the signal

#include #include #include #include struct sigaction act; void sighandler(int signum, siginfo_t *info, void *ptr) { printf("Received signal %dn", signum); printf("Signal originates from process %lun", (unsigned long)info->si_pid); } int main() {…

Continue ReadingC Program to register signal handler for SIGTERM and when it receives the signal, the program should print some information about the origin of the signal

C program that accepts a valid directory names as a command line argument and lists all the files in the given directory as well as all the subsequent sub directories

#include #include #include int myfun(const char *pathname,const struct stat *statptr,int type); int main(int argc,char *argv[]) { nftw(argv[1],myfun,0,0); exit(0); } int myfun(const char *pathname,const struct stat *statptr,int type) { if(type==FTW_F) printf("nfile…

Continue ReadingC program that accepts a valid directory names as a command line argument and lists all the files in the given directory as well as all the subsequent sub directories

C program that creates a child process to read commands from the standard input

#include #include #include int main() { int pid,status; char comd[20];pid=fork(); if(pid==0) { printf("child processn"); while(strcmp(comd,"exit")!=0) { printf("[user@localhost~]$"); gets(comd); system(comd); } exit(0); } else { wait(&status); printf("parent processn"); } } ****************************************…

Continue ReadingC program that creates a child process to read commands from the standard input

Shell script that performs following string handling operations i) Calculate the length of the string ii) locate a position of a character in a string iii) extract last three characters from string

#!/bin/sh str=tanu echo “string:$str” echo “lengh of string:” z=`expr “$str”:’.*’` echo $z echo “substring is” z=`expr “$str”:’.*(…)’` echo $z echo “position of character n is” z=`expr “$str”:’[^n]*n’` echo $z *******************…

Continue ReadingShell script that performs following string handling operations i) Calculate the length of the string ii) locate a position of a character in a string iii) extract last three characters from string

Shell Program that takes the any number of arguments and print them in same order and in reverse order with suitable messages

echo "program name: $0" if [ $# -eq 0 ] then exit fi echo "no: of arguments: $#" echo "the input arguments are" num=1 for i in "$@" do echo…

Continue ReadingShell Program that takes the any number of arguments and print them in same order and in reverse order with suitable messages