| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
This repo contains my labs and assignment submissions for the network programming course, BITS Pilani, second semester, 2021-22.
We were given two assignments, containing two questions each. We were required to do any three questions out of 4 questions. I did both of assignment 1 and first of assignment 2.
After taking permission from instructor, I was allowed to use C++ as long as I don't use any system call wrappers.
The lab submissions and their corresponding questions are present in Labs folder.
You are required to build a bash-like shell for the following requirements. Your program should not use temporary files, popen(), system() library calls. It should only use system-call wrappers from the library. It should not use sh or bash shells to execute a command.
Shell should wait for the user to enter a command. User can enter a command with multiple arguments. Program should parse these arguments and pass them to execv() call. For every command, shell should search for the file in PATH and print any error. Shell should also print the pid, status of the process before asking for another command.
Shell should create a new process group for every command. When a command is run with & at end, it is counted as background process group. Otherwise it should be run as fore- ground process group (look at tcsetpgrp()). That means any signal generated in the terminal should go only to the command running, not to the shell process. fg command should bring the background job to fore ground. bg command starts the stopped job in the background.
Shell should support any number of commands in the pipeline. e.g. ls|wc|wc|wc. Print details such as pipe fds, process pids and the steps. Redirection operators can be used in combination with pipes.
Shell should support # operator. The meaning of this: it carries same semantics as pipe but use message queue instead of pipe. The operator ## works in this way: ls ## wc , sort. output of ls should be replicated to both wc and sort using message queues
Shell should support S operator. The meaning of this: it carries same semantics as pipe but use shared memory instead of pipe. The operator SS works in this way: Using example, ls SS wc, sort. Output of ls should be replicated to both wc and sort using shared memory
Shell should support a command daemonize which takes the form daemonize <program> and converts the program into a daemon process.
Shell should support <, >, and >> redirection operators. Print details such as fd of the file, remapped fd.
In this problem let us extend Message Queues network wide for the following characteristics.
A file contains N (>1000) URLs of webpages. A programmer wants to find out the longest path common to all the given webpages. A path consists of intermediate router interface addresses through which the packet travels. Using I/O multiplexing, conceive and implement a program which finds out path for each of the URLs and the longest path common to them.
Consider the following paragraph given in section 16.5 of the textbook.
We provide this example using simultaneous connects because it is a nice example using nonblocking I/O and one whose performance impact can be measured. It is also a feature used by a popular Web application, the Netscape browser. There are pitfalls in this technique if there is any congestion in the network. Chapter 21 of TCPv1 describes TCP's slow-start and congestion avoidance algorithms in detail. When multiple connections are established from a client to a server, there is no communication between the connections at the TCP layer. That is, if one connection encounters a packet loss, the other connections to the same server are not notified, and it is highly probable that the other connections will soon encounter packet loss unless they slow down. These additional connections are sending more packets into an already congested network. This technique also increases the load at any given time on the server.
Consider the bold lines. It tells about the missing coordination among the TCP connections or clients accessing the same web server. Design a solution that can enable this coordination considering the fact that TCP doesn't tell the application immediately about the packet loss. Generally TCP tries for a few times before it concludes about packet loss. You design should be able to detect packet losses as soon as the host comes to know about it and notify the client who are accessing that server. Your program should take care of accepting requests from clients, detecting packet losses, and notifying the clients. Implement the solution designed.
| Back | FazBrowse Home | New Git URL |