Showing posts with label internet. Show all posts
Showing posts with label internet. Show all posts

Friday 15 May 2020

NPTEL NBA Accreditation and Teaching-Learning in Engineering (NATE) Assignment 1

Assignment 1

1 point
These two became the foci of higher education in India since 2015. 
 
 
 
 
1 point
Two activities engineers are likely to get involved more during the first few years after graduation include
 
 
 
 
1 point
Washington Accord
 
 
 
 
1 point
An Outcome is
 
 
 
 
1 point
In Outcome Based Education
 
 
 
 
1 point
The criterion “Faculty Information and Contributions” carries maximum weightage in accreditation (200 out of 1000 marks) because
 
 
 
 
1 point
Criterion 4: Performance of students is at the Program level.  Performance with respect to Criterion 4 is partly measured through two of the following
 
 
 
 
1 point
Education in its technical sense
 
 
 
 
1 point
Teaching is
 
 
 
 
1 point
These two are important features of an outcome statement
 
 
 
 

Thursday 4 July 2019

Basic Unix Commands



Knowing basic Unix commands should allow you to navigate your Unix or Linux system, confirm current system status and manage files or directories.

Getting help in Unix
man – view manual pages for Unix commands

Time and Date commands
date – show current date and time
sleep – wait for a given number of seconds
uptime – find out how long the system has been up

Unix users commands
These commands allow you to get basic information about Unix users in your environment.

id – print user identity
passwd – change user password
who – find out who is logged into the system
last – show history of logins into the system

Unix file operations
Navigating filesystem and managing files and access permissions:

ls – list files and directories
cp – copy files (work in progress)
rm – remove files and directories (work in progress)
mv – rename or move files and directories to another location
chmod – change file/directory access permissions
chown – change file/directory ownership

Text file operations in Unix
Most of important configuration in Unix is in clear text files, these commands will let you quickly inspect files or view logs:

cat – concatenate files and show contents to the standard output
more – basic pagination when viewing text files or parsing Unix commands output
less – an improved pagination tool for viewing text files (better than more command)
head – show the first 10 lines of text file (you can specify any number of lines)
tail – show the last 10 lines of text file (any number can be specified)

Unix directory management commands
Navigating filesystems and managing directories:

cd – change directory
pwd – confirm current directory
ln – make links and symlinks to files and directories
mkdir – make new directory
rmdir – remove directories in Unix

Unix system status commands
Most useful commands for reviewing hostname configuration and vital stats:

hostname – show or set server hostname
w – display system load, who's logged in and what they are doing
uname – print Unix system information

Networking commands in Unix
Most useful commands for inspecting network setup and exploring network connections and ports:

ifconfig – show and set IP addresses (found almost everywhere)
ip – show and set IP addresses (in recent Linux versions)
ping – check if remote host is reachable via ICMP ping
netstat – show network stats and routing information

Process management
Listing processes and confirming their status, and stopping processes if needed:

ps – list processes
top – show tasks and system status
kill – kill a process (stop application running)

Remote access commands
ssh is really the only way to go, but it's important to know telnet as well:

telnet – clear-text (insecure) remote access protocol
ssh – Secure SHell – encrypted remote access client

File transfers  commands
Always useful to know how to copy files between servers or just download some package from the web:

ftp – clear-text (insecure!) File Transfer Protocol client
sftp – secure (encrypted) version of FTP
scp – secure (encrypted) version of cp command
wget – download files from remote servers, HTTP/HTTPS and FTP

Basics of UNIX


Main features of unix :
1.      Multi user -  More than one user can use the machine
2.      Multitasking- More than one program can be run at a time.
3.      Portability – This means  the operating system can be easily converted to run on different browsers.
Commands
ls         
when invoked without any arguments, lists the files in the current working directory. A directory that is not the current working directory can be specified and ls will list the files there. The user also may specify any list of files and directories. In this case, all files and all contents of specified directories will be listed.
Files whose names start with "." are not listed, unless the -a flag is specified or the files are specified explicitly.
Without options, ls displays files in a bare format. This bare format however makes it difficult to establish the type, permissions, and size of the files. The most common options to reveal this information or change the list of files are:
-l    long format, displaying Unix file type, permissions, number of hard links, owner,     group, size, date, and filename
-F    appends a character revealing the nature of a file, for example, * for an executable, or / for a directory. Regular files have no suffix.
-a  lists all files in the given directory, including those whose names start with "." By default, these files are excluded from the list.
-R  recursively lists subdirectories. The command ls -R / would therefore list all files.
cd
Is a command line command used to change the current working directory in the Unix and DOS operating systems. It is also available for use in Unix shell scripts or DOS batch files. cd is frequently included built into certain shells such as the Bourne shell, tcsh, bash (where it calls the chdir() POSIX C function) and in DOS's COMMAND.COM.
A directory is a logical section of a filesystem used to hold files. Directories may also contain other directories. The cd command can be used to change into a subdirectory, move back into the parent directory, move all the way back to the root (/ in UNIX, \ in DOS) or move to any given directory.
pwd
command (print working directory) is used to print the name of current working directory from a computer's command-line interface. If the shell prompt does not already show this, the user can use this command to find their place in the directory tree. This command is found in the Unix family of operating systems and other flavors as well. The DOS equivalent is "CD" with no arguments.
It is a command which is sometimes included built into certain shells such as sh, and bash. It can be implemented easily with the POSIX C functions getcwd() and/or getwd().
Example:
$ pwd
/home/foobar
mkdir
command in the Unix operating system is used to make a new Directory. Normal usage is as straightforward as follows:
mkdir name_of_directory
Where name_of_directory is the name of the directory one wants to create. When typed as above (ie. normal usage), the new directory would be created within the current directory.
rm (short for remove)
is a Unix command used to delete files from a filesystem. Common options that rm accepts include:
-r, which processes subdirectories recursively
-i, which asks for every deletion to be confirmed
-f, which ignores non-existent files and overrides any confirmation prompts ("force")
rm is often aliased to "rm -i" so as to avoid accidental deletion of files. If a user still wishes to delete a large number of files without confirmation, they can manually cancel out the -i argument by adding the -f option.
"rm -rf" (variously, "rm -rf /", "rm -rf *", and others) is frequently used in jokes and anecdotes about Unix disasters. The "rm -rf /" variant of the command, if run by an administrator, would cause the contents of every mounted disk on the computer to be deleted.
rmdir
is a command which will remove an empty directory on a Unix-system. It cannot be capitalized. Normal usage is straightforward where one types:
rmdir name_of_directory
Where name_of_directory corresponds with the name of the directory one wishes to delete. There are options to this command such as -p which removes parent directories if they are also empty.
For example:
rmdir –p foo/bar/baz
Will first remove baz/, then bar/ and finally foo/ thus removing the entire directory tree specified in the command argument.
Often rmdir will not remove a directory if there is still files present in the directory. To force the removal of the directory even if files are present usually the -rf flag can be used. For example:
rmdir -Rf for/bar/baz
cp
is the command entered in a Unix shell to copy a file from one place to another, possibly on a different filesystem. The original file remains unchanged, and the new file may have the same or a different name.
To Copy a File to another File
cp [ -f ] [ -h ] [ -i ] [ -p ][ -- ] SourceFile TargetFile
To Copy a File to a Directory
cp [ -f ] [ -h ] [ -i ] [ -p ] [ -r | -R ] [ -- ] SourceFile ... TargetDirectory
To Copy a Directory to a Directory
cp [ -f ] [ -h ] [ -i ] [ -p ] [ -- ] { -r | -R } SourceDirectory ... TargetDirectory
-f (force) – specifies removal of the target file if it cannot be opened for write operations. The removal precedes any copying performed by the cp command.
-h – makes the cp command copy symbolic links. The default is to follow symbolic links, that is, to copy files to which symbolic links point.
-i (interactive) – prompts you with the name of a file to be overwritten. This occurs if the TargetDirectory or TargetFile parameter contains a file with the same name as a file specified in the SourceFile or SourceDirectory parameter. If you enter y or the locale's equivalent of y, the cp command continues. Any other answer prevents the cp command from overwriting the file.
-p (preserve) – duplicates the following characteristics of each SourceFile/SourceDirectory in the corresponding TargetFile and/or TargetDirectory:
Examples
To make a copy of a file in the current directory, enter:
    cp prog.c prog.bak
This copies prog.c to prog.bak. If the prog.bak file does not already exist, the cp command creates it. If it does exist, the cp command replaces it with a copy of the prog.c file.
To copy a file in your current directory into another directory, enter:
    cp jones /home/nick/clients
This copies the jones file to /home/nick/clients/jones.
To copy a file to a new file and preserve the modification date, time, and access control list associated with the source file, enter:
    cp -p smith smith.jr
This copies the smith file to the smith.jr file. Instead of creating the file with the current date and time stamp, the system gives the smith.jr file the same date and time as the smith file. The smith.jr file also inherits the smith file's access control protection.
To copy all the files in a directory to a new directory, enter:
    cp /home/janet/clients/* /home/nick/customers
This copies only the files in the clients directory to the customers directory.
To copy a directory, including all its files and subdirectories, to another directory, enter:
    cp -R /home/nick/clients /home/nick/customers
This copies the clients directory, including all its files, subdirectories, and the files in those subdirectories, to the customers/clients directory.
To copy a specific set of files to another directory, enter:
    cp jones lewis smith /home/nick/clients
This copies the jones, lewis, and smith files in your current working directory to the /home/nick/clients directory.
To use pattern-matching characters to copy files, enter:
    cp programs/*.c .
This copies the files in the programs directory that end with .c to the current directory, signified by the single . (dot). You must type a space between the c and the final dot.
find
program is a search utility, mostly found on Unix-like platforms. It searches through a directory tree of a filesystem, locating files based on some user-specified criteria. By default, find returns all files below the current working directory. Further, find allows the user to specify an action to be taken on each matched file. Thus, it is an extremely powerful program for applying actions to many files. It also supports regexp matching.
Examples
From current directory
find . -name my\*
This searches in the current directory (represented by a period) and below it, for files and directories with names starting with my. The backslash before the star is needed to avoid the shell expansion. Without the backslash, the shell would replace my* with the list of files whose names begin with my in the current directory. An alternative is to enclose the the arguments in quotes: find . -name "my*"
Files only
find . -name "my*" -type f
This limits the results of the above search to only regular files, therefore excluding directories, special files, pipes, symbolic links, etc. my* is enclosed in quotes as otherwise the shell would replace it with the list of files in the current directory starting with my
Commands
The previous examples created listings of results because, by default, find executes the '-print' action. (Note that early versions of the find command had no default action at all; therefore the resulting list of files would be discarded, to the bewilderment of naïve users.)
find . -name "my*" -type f -ls
This prints an extended file information.
Search all directories
find / -name "myfile" -type f -print
This searches every file on the computer for a file with the name myfile. It is generally not a good idea to look for data files this way. This can take a considerable amount of time, so it is best to specify the directory more precisely.
Specify a directory
find /home/brian -name "myfile" -type f -print
This searches for files named myfile in the /home/brian directory, which is the home directory for the user brian. You should always specify the directory to the deepest level you can remember.
Find any one of differently named files
find . ( -name "*jsp" -or -name "*java" ) -type f -ls
This prints extended information on any file whose name ends with either 'jsp' or 'java'. Note that the parentheses are required. Also note that the operator "or" can be abbreviated as "o". The "and" operator is assumed where no operator is given. In many shells the parentheses must be escaped with a backslash, "\(" and "\)", to prevent them from being interpreted as special shell characters.
touch
is a program on Unix and Unix-like systems used to change a file's date- and time-stamp. It can also be used to create an empty file. The command-syntax is:
touch [options] <file_name>
If the file exists, its access and modification time-stamps are set to the system's current date and time, as if the file had been changed. To touch a file simulates a change to the file. If the file does not exist, an empty file of that name is created with its access and modification time-stamps set to the system's current date and time. If no file path is specified, the current directory is assumed.
touch can be invoked with options to change its behaviour, which may vary from one Unix to another. One option makes it possible to set the file's time-stamp to something other than the current system date and time, but this action is normally restricted to the owner of the file or the system's superuser.
echo
is a command in Unix (and by extension, its descendants, such as Linux) and MS-DOS that places a string on the terminal. It is typically used in shell scripts and batch programs to output status text to the screen or a file.
$ echo This is a test.
This is a test.
$ echo "This is a test." > ./test.txt
$ cat ./test.txt
This is a test.
cat
program concatenates the contents of files, reading from a list of files and/or standard input in sequence and writing their contents in order to standard output. cat takes the list of files as arguments but also interprets the argument "-" as standard input.
 Example:          cat  filename
who                         
The Unix command who displays a list of users who are currently logged into a computer. The command accepts various options that vary by system to further specify the information that is returned, such as the length of time a particular user has been connected or what pseudo-teletype a user is connected to. The who command is related to the command w, which provides the same information but also displays additional data and statistics.
Example output         
user19    pts/35       Apr 18 08:40    (localhost)
user28    pts/27       Apr 18 09:50    (localhost)
du (abbreviated from disk usage)
is a Unix computer program to display the amount of disk space used under a particular directory or files on a file system.
du counts the disk space by walking the directory tree. As such, the amount of space on a file system shown by du may vary from that shown by df if files have been deleted but their blocks not yet freed.
In Linux, it is a part of the GNU Coreutils package.
The du utility first appeared in version 1 of AT&T UNIX.
Example
The -k flag will show the sizes in 1K blocks, rather than the default of 512 byte blocks.
$du -k /seclog
4       /seclog/lost+found
132     /seclog/backup/aix7
136     /seclog/backup
44044   /seclog/temp
439264  /seclog

Monday 1 July 2019

Data communication Networking-Physical layer

Switching is process to forward packets coming in from one port to a port leading towards the destination. When data comes on a port it is called ingress, and when data leaves a port or goes out it is called egress. A communication system may include number of switches and nodes. At broad level, switching can be divided into two major categories:
  • Connectionless: The data is forwarded on behalf of forwarding tables. No previous handshaking is required and acknowledgements are optional.
  • Connection Oriented:  Before switching data to be forwarded to destination, there is a need to pre-establish circuit along the path between both endpoints. Data is then forwarded on that circuit. After the transfer is completed, circuits can be kept for future use or can be turned down immediately.

Circuit Switching

When two nodes communicate with each other over a dedicated communication path, it is called circuit switching.There 'is a need of pre-specified route from which data will travels and no other data is permitted.In circuit switching, to transfer the data, circuit must be established so that the data transfer can take place.
Circuits can be permanent or temporary. Applications which use circuit switching may have to go through three phases:
  • Establish a circuit
  • Transfer the data
  • Disconnect the circuit
Circuit Switching
Circuit switching was designed for voice applications. Telephone is the best suitable example of circuit switching. Before a user can make a call, a virtual path between caller and callee is established over the network.

Message Switching

This technique was somewhere in middle of circuit switching and packet switching. In message switching, the whole message is treated as a data unit and is switching / transferred in its entirety.
A switch working on message switching, first receives the whole message and buffers it until there are resources available to transfer it to the next hop. If the next hop is not having enough resource to accommodate large size message, the message is stored and switch waits.
Message Switching
This technique was considered substitute to circuit switching. As in circuit switching the whole path is blocked for two entities only. Message switching is replaced by packet switching. Message switching has the following drawbacks:
  • Every switch in transit path needs enough storage to accommodate entire message.
  • Because of store-and-forward technique and waits included until resources are available, message switching is very slow.
  • Message switching was not a solution for streaming media and real-time applications.

Packet Switching

Shortcomings of message switching gave birth to an idea of packet switching. The entire message is broken down into smaller chunks called packets. The switching information is added in the header of each packet and transmitted independently.
It is easier for intermediate networking devices to store small size packets and they do not take much resources either on carrier path or in the internal memory of switches.
Packet Switching
Packet switching enhances line efficiency as packets from multiple applications can be multiplexed over the carrier. The internet uses packet switching technique. Packet switching enables the user to differentiate data streams based on priorities. Packets are stored and forwarded according to their priority to provide quality of service.

Analog Transmission-Physical Layer

To send the digital data over an analog media, it needs to be converted into analog signal.There can be two cases according to data formatting.
Bandpass:The filters are used to filter and pass frequencies of interest. A bandpass is a band of frequencies which can pass the filter.
Low-pass: Low-pass is a filter that passes low frequencies signals.
When digital data is converted into a bandpass analog signal, it is called digital-to-analog conversion. When low-pass analog signal is converted into bandpass analog signal, it is called analog-to-analog conversion.

Digital-to-Analog Conversion

When data from one computer is sent to another via some analog carrier, it is first converted into analog signals. Analog signals are modified to reflect digital data.
An analog signal is characterized by its amplitude, frequency, and phase. There are three kinds of digital-to-analog conversions:
  • Amplitude Shift Keying
    In this conversion technique, the amplitude of analog carrier signal is modified to reflect binary data.
    Amplitude Shift Keying
    When binary data represents digit 1, the amplitude is held; otherwise it is set to 0. Both frequency and phase remain same as in the original carrier signal.
  • Frequency Shift Keying
    In this conversion technique, the frequency of the analog carrier signal is modified to reflect binary data.
    Frequency Shift Keying
    This technique uses two frequencies, f1 and f2. One of them, for example f1, is chosen to represent binary digit 1 and the other one is used to represent binary digit 0. Both amplitude and phase of the carrier wave are kept intact.
  • Phase Shift Keying
    In this conversion scheme, the phase of the original carrier signal is altered to reflect the binary data.
    Phase Shift Keying
    When a new binary symbol is encountered, the phase of the signal is altered. Amplitude and frequency of the original carrier signal is kept intact.
  • Quadrature Phase Shift Keying
    QPSK alters the phase to reflect two binary digits at once. This is done in two different phases. The main stream of binary data is divided equally into two sub-streams. The serial data is converted in to parallel in both sub-streams and then each stream is converted to digital signal using NRZ technique. Later, both the digital signals are merged together.

Analog-to-Analog Conversion

Analog signals are modified to represent analog data. This conversion is also known as Analog Modulation. Analog modulation is required when bandpass is used. Analog to analog conversion can be done in three ways:
Analog Modulation
  • Amplitude Modulation
    In this modulation, the amplitude of the carrier signal is modified to reflect the analog data.
    Amplitude Modulation
    Amplitude modulation is implemented by means of a multiplier. The amplitude of modulating signal (analog data) is multiplied by the amplitude of carrier frequency, which then reflects analog data.
    The frequency and phase of carrier signal remain unchanged.
  • Frequency Modulation
    In this modulation technique, the frequency of the carrier signal is modified to reflect the change in the voltage levels of the modulating signal (analog data).
    Frequency Modulation
    The amplitude and phase of the carrier signal are not altered.
  • Phase Modulation
    In the modulation technique, the phase of carrier signal is modulated in order to reflect the change in voltage (amplitude) of analog data signal.
    Phase Modulation
    Phase modulation is practically similar to Frequency Modulation, but in Phase modulation frequency of the carrier signal is not increased. Frequency of carrier is signal is changed (made dense and sparse) to reflect voltage change in the amplitude of modulating signal.