Showing posts with label Network. Show all posts
Showing posts with label Network. Show all posts

Sunday 7 July 2019

How satellite Works

A satellite is an object that revolves around another object. For example, earth is a satellite of The Sun, and moon is a satellite of earth.
communication satellite is a microwave repeater station in a space that is used for telecommunication, radio and television signals. A communication satellite processes the data coming from one earth station and it converts the data into another form and send it to the second earth station.

How a Satellite Works

Two stations on earth want to communicate through radio broadcast but are too far away to use conventional means. The two stations can use a relay station for their communication. One earth station transmits the signal to the satellite.
Uplink frequency is the frequency at which ground station is communicating with satellite. The satellite transponder converts the signal and sends it down to the second earth station, and this is called Downlink frequency. The second earth station also communicates with the first one in the same way.

Advantages of Satellite

The advantages of Satellite Communications are as follows −
  • The Coverage area is very high than that of terrestrial systems.
  • The transmission cost is independent of the coverage area.
  • Higher bandwidths are possible.

Disadvantages of Satellite

The disadvantages of Satellite Communications are as follows −
  • Launching satellites into orbits is a costly process.
  • The bandwidths are gradually used up.
  • High propagation delay for satellite systems than the conventional terrestrial systems.

Satellite Communication Basics

The process of satellite communication begins at an earth station. Here an installation is designed to transmit and receive signals from a satellite in orbit around the earth. Earth stations send information to satellites in the form of high powered, high frequency (GHz range) signals.
The satellites receive and retransmit the signals back to earth where they are received by other earth stations in the coverage area of the satellite. Satellite's footprint is the area which receives a signal of useful strength from the satellite.
The transmission system from the earth station to the satellite through a channel is called the uplink. The system from the satellite to the earth station through the channel is called the downlink.

Satellite Frequency Bands

The satellite frequency bands which are commonly used for communication are the Cband, Ku-band, and Ka-band. C-band and Ku-band are the commonly used frequency spectrums by today's satellites.
It is important to note that there is an inverse relationship between frequency and wavelength i.e. when frequency increases, wavelength decreases this helps to understand the relationship between antenna diameter and transmission frequency. Larger antennas (satellite dishes) are necessary to gather the signal with increasing wavelength.

Earth Orbits

A satellite when launched into space, needs to be placed in certain orbit to provide a particular way for its revolution, so as to maintain accessibility and serve its purpose whether scientific, military or commercial. Such orbits which are assigned to satellites, with respect to earth are called as Earth Orbits. The satellites in these orbits are Earth Orbit Satellites.
The important kinds of Earth Orbits are −
  • Geo-synchronous Earth Orbit
  • Geo-stationary Earth Orbit
  • Medium Earth Orbit
  • Low Earth Orbit

Geo-synchronous Earth Orbit (GEO) Satellites

A Geo-synchronous Earth orbit Satellite is one which is placed at an altitude of 22,300 miles above the Earth. This orbit is synchronized with a side real day(i.e., 23hours 56minutes). This orbit can have inclination and eccentricity. It may not be circular. This orbit can be tilted at the poles of the earth. But it appears stationary when observed from the Earth.
The same geo-synchronous orbit, if it is circular and in the plane of equator, it is called as geo-stationary orbit. These Satellites are placed at 35,900kms (same as geosynchronous) above the Earth’s Equator and they keep on rotating with respect to earth’s direction (west to east). These satellites are considered stationary with respect to earth and hence the name implies.
Geo-Stationary Earth Orbit Satellites are used for weather forecasting, satellite TV, satellite radio and other types of global communications.
GEO
The above figure shows the difference between Geo-synchronous and Geo- Stationary orbits. The Axis of rotation indicates the movement of Earth.
The main point to note here is that every Geo-Stationary orbit is a Geo-Synchronous orbit. But every Geo-Synchronous orbit is NOT a Geo-stationary orbit.

Medium Earth Orbit (MEO) Satellites

Medium earth orbit (MEO) satellite networks will orbit at distances of about 8000 miles from earth's surface. Signals transmitted from a MEO satellite travel a shorter distance. This translates to improved signal strength at the receiving end. This shows that smaller, more lightweight receiving terminals can be used at the receiving end.
Since the signal is travelling a shorter distance to and from the satellite, there is less transmission delay. Transmission delay can be defined as the time it takes for a signal to travel up to a satellite and back down to a receiving station.
For real-time communications, the shorter the transmission delay, the better will be the communication system. As an example, if a GEO satellite requires 0.25 seconds for a round trip, then MEO satellite requires less than 0.1 seconds to complete the same trip. MEOs operates in the frequency range of 2 GHz and above.

Low Earth Orbit (LEO) Satellites

The LEO satellites are mainly classified into three categories namely, little LEOs, big LEOs, and Mega-LEOs. LEOs will orbit at a distance of 500 to 1000 miles above the earth's surface.
This relatively short distance reduces transmission delay to only 0.05 seconds. This further reduces the need for sensitive and bulky receiving equipment. Little LEOs will operate in the 800 MHz (0.8 GHz) range. Big LEOs will operate in the 2 GHz or above range, and Mega-LEOs operates in the 20-30 GHz range.
The higher frequencies associated with Mega-LEOs translates into more information carrying capacity and yields to the capability of real-time, low delay video transmission scheme.

High Altitude Long Endurance (HALE) Platforms

Experimental HALE platforms are basically highly efficient and lightweight airplanes carrying communications equipment. This will act as very low earth orbit geosynchronous satellites.
These crafts will be powered by a combination of battery and solar power or high efficiency turbine engines. HALE platforms will offer transmission delays of less than 0.001 seconds at an altitude of only 70,000 feet, and even better signal strength for very lightweight hand-held receiving devices.

Orbital Slots

Here there may arise a question that with more than 200 satellites up there in geosynchronous orbit, how do we keep them from running into each other or from attempting to use the same location in space? To answer this problem, international regulatory bodies like the International Telecommunications Union (ITU) and national government organizations like the Federal Communications Commission (FCC) designate the locations on the geosynchronous orbit where the communications satellites can be located.
These locations are specified in degrees of longitude and are called as orbital slots. The FCC and ITU have progressively reduced the required spacing down to only 2 degrees for C-band and Ku-band satellites due to the huge demand for orbital slots.

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

Basic UNIX commands


UNIX is case-sensitive.

Files

  • ls --- lists your files
    ls -l --- lists your files in 'long format', which contains lots of useful information, e.g. the exact size of the file, who owns the file and who has the right to look at it, and when it was last modified.
    ls -a --- lists all files, including the ones whose filenames begin in a dot, which you do not always want to see.
    There are many more options, for example to list files by size, by date, recursively etc.
  • more filename --- shows the first part of a file, just as much as will fit on one screen. Just hit the space bar to see more or q to quit. You can use /pattern to search for a pattern.
  • emacs filename --- is an editor that lets you create and edit a file. 
  • mv filename1 filename2 --- moves a file (i.e. gives it a different name, or moves it into a different directory (see below)
  • cp filename1 filename2 --- copies a file
  • rm filename --- removes a file. It is wise to use the option rm -i, which will ask you for confirmation before actually deleting anything. 
  • diff filename1 filename2 --- compares files, and shows where they differ
  • wc filename --- tells you how many lines, words, and characters there are in a file
  • chmod options filename --- lets you change the read, write, and execute permissions on your files. The default is that only you can look at them and change them, but you may sometimes want to change these permissions. For example, chmod o+r filename will make the file readable for everyone, and chmod o-r filename will make it unreadable for others again. Note that for someone to be able to actually look at the file the directories it is in need to be at least executable. See help protection for more details.
  • File Compression
    • gzip filename --- compresses files, so that they take up much less space. Usually text files compress to about half their original size, but it depends very much on the size of the file and the nature of the contents. There are other tools for this purpose, too (e.g. compress), but gzip usually gives the highest compression rate. Gzip produces files with the ending '.gz' appended to the original filename.
    • gunzip filename --- uncompresses files compressed by gzip.
    • gzcat filename --- lets you look at a gzipped file without actually having to gunzip it (same as gunzip -c). You can even print it directly, using gzcat filename | lpr
  • printing
    • lpr filename --- print. Use the -P option to specify the printer name if you want to use a printer other than your default printer. For example, if you want to print double-sided, use 'lpr -Pvalkyr-d', or if you're at CSLI, you may want to use 'lpr -Pcord115-d'. See 'help printers' for more information about printers and their locations.
    • lpq --- check out the printer queue, e.g. to get the number needed for removal, or to see how many other files will be printed before yours will come out
    • lprm jobnumber --- remove something from the printer queue. You can find the job number by using lpq. Theoretically you also have to specify a printer name, but this isn't necessary as long as you use your default printer in the department.
    • genscript --- converts plain text files into postscript for printing, and gives you some options for formatting. Consider making an alias like alias ecop 'genscript -2 -r \!* | lpr -h -Pvalkyr' to print two pages on one piece of paper.
    • dvips filename --- print .dvi files (i.e. files produced by LaTeX). You can use dviselect to print only selected pages. .

Directories

Directories, like folders on a Macintosh, are used to group files together in a hierarchical structure.
  • mkdir dirname --- make a new directory
  • cd dirname --- change directory. You basically 'go' to another directory, and you will see the files in that directory when you do 'ls'. You always start out in your 'home directory', and you can get back there by typing 'cd' without arguments. 'cd ..' will get you one level up from your current position. You don't have to walk along step by step - you can make big leaps or avoid walking around by specifying path names
  • pwd --- tells you where you currently are.

Finding things

  • ff --- find files anywhere on the system. This can be extremely useful if you've forgotten in which directory you put a file, but do remember the name. In fact, if you use ff -p you don't even need the full name, just the beginning. This can also be useful for finding other things on the system, e.g. documentation.
  • grep string filename(s) --- looks for the string in the files. This can be useful a lot of purposes, e.g. finding the right file among many, figuring out which is the right version of something, and even doing serious corpus work. grep comes in several varieties (grepegrep, and fgrep) and has a lot of very flexible options. Check out the man pages if this sounds good to you.

About other people

  • w --- tells you who's logged in, and what they're doing. Especially useful: the 'idle' part. This allows you to see whether they're actually sitting there typing away at their keyboards right at the moment.
  • who --- tells you who's logged on, and where they're coming from. Useful if you're looking for someone who's actually physically in the same building as you, or in some other particular location.
  • finger username --- gives you lots of information about that user, e.g. when they last read their mail and whether they're logged in. Often people put other practical information, such as phone numbers and addresses, in a file called .plan. This information is also displayed by 'finger'.
  • last -1 username --- tells you when the user last logged on and off and from where. Without any options, last will give you a list of everyone's logins.
  • talk username --- lets you have a (typed) conversation with another user
  • write username --- lets you exchange one-line messages with another user
  • elm --- lets you send e-mail messages to people around the world (and, of course, read them). It's not the only mailer you can use, but the one we recommend. 

About your (electronic) self

  • whoami --- returns your username. Sounds useless, but isn't. You may need to find out who it is who forgot to log out somewhere, and make sure *you* have logged out.
  • finger & .plan files
    of course you can finger yourself, too. That can be useful e.g. as a quick check whether you got new mail. Try to create a useful .plan file soon. Look at other people's .plan files for ideas. The file needs to be readable for everyone in order to be visible through 'finger'. Do 'chmod a+r .plan' if necessary. You should realize that this information is accessible from anywhere in the world, not just to other people on turing.
  • passwd --- lets you change your password, which you should do regularly (at least once a year). 
  • ps -u yourusername --- lists your processes. Contains lots of information about them, including the process ID, which you need if you have to kill a process. Normally, when you have been kicked out of a dialin session or have otherwise managed to get yourself disconnected abruptly, this list will contain the processes you need to kill. Those may include the shell (tcsh or whatever you're using), and anything you were running, for example emacs or elm. Be careful not to kill your current shell - the one with the number closer to the one of the ps command you're currently running. But if it happens, don't panic. Just try again :) If you're using an X-display you may have to kill some X processes before you can start them again. These will show only when you use ps -efl, because they're root processes.
  • kill PID --- kills (ends) the processes with the ID you gave. This works only for your own processes, of course. Get the ID by using ps. If the process doesn't 'die' properly, use the option -9. But attempt without that option first, because it doesn't give the process a chance to finish possibly important business before dying. You may need to kill processes for example if your modem connection was interrupted and you didn't get logged out properly, which sometimes happens.
  • quota -v --- show what your disk quota is (i.e. how much space you have to store files), how much you're actually using, and in case you've exceeded your quota (which you'll be given an automatic warning about by the system) how much time you have left to sort them out (by deleting or gzipping some, or moving them to your own computer).
  • du filename --- shows the disk usage of the files and directories in filename (without argument the current directory is used). du -s gives only a total.
  • last yourusername --- lists your last logins. Can be a useful memory aid for when you were where, how long you've been working for, and keeping track of your phonebill if you're making a non-local phonecall for dialling in.

Connecting to the outside world

  • nn --- allows you to read news. It will first let you read the news local to turing, and then the remote news. If you want to read only the local or remote news, you can use nnl or nnr, respectively. To learn more about nn type nn, then \tty{:man}, then \tty{=.*}, then \tty{Z}, then hit the space bar to step through the manual. Or look at the man page. Or check out the probably the easiest and most fun way to go.
  • rlogin hostname --- lets you connect to a remote host
  • telnet hostname --- also lets you connect to a remote host. Use rlogin whenever possible.
  • ftp hostname --- lets you download files from a remote host which is set up as an ftp-server. This is a common method for exchanging academic papers and drafts. If you need to make a paper of yours available in this way, you can (temporarily) put a copy in /user/ftp/pub/TMP. For more permanent solutions, ask Emma. The most important commands within ftp are get for getting files from the remote machine, and put for putting them there (mget and mput let you specify more than one file at once). Sounds straightforward, but be sure not to confuse the two, especially when your physical location doesn't correspond to the direction of the ftp connection you're making. ftp just overwrites files with the same filename. If you're transferring anything other than ASCII text, use binary mode.
  • lynx --- lets you browse the web from an ordinary terminal. Of course you can see only the text, not the pictures. You can type any URL as an argument to the G command. When you're doing this from any Stanford host you can leave out the . part of the URL when connecting to Stanford URLs. Type H at any time to learn more about lynx, and Q to exit.

Miscellaneous tools

  • webster word --- looks up the word in an electronic version of Webster's dictionary and returns the definition(s)
  • date --- shows the current date and time.
  • cal --- shows a calendar of the current month. Use e.g., 'cal 10 1995' to get that for October 95, or 'cal 1995' to get the whole year.
You can find out more about these commands by looking up their manpages:
man commandname --- shows you the manual page for the command

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.

Multiplexing -Physical layer

Multiplexing is a technique by which different analog and digital streams of transmission can be simultaneously processed over a shared link. Multiplexing divides the high capacity medium into low capacity logical medium which is then shared by different streams.
Communication is possible over the air (radio frequency), using a physical media (cable), and light (optical fiber). All mediums are capable of multiplexing.
When multiple senders try to send over a single medium, a device called Multiplexer divides the physical channel and allocates one to each. On the other end of communication, a De-multiplexer receives data from a single medium, identifies each, and sends to different receivers.

Frequency Division Multiplexing

When the carrier is frequency, FDM is used. FDM is an analog technology. FDM divides the spectrum or carrier bandwidth in logical channels and allocates one user to each channel. Each user can use the channel frequency independently and has exclusive access of it. All channels are divided in such a way that they do not overlap with each other. Channels are separated by guard bands. Guard band is a frequency which is not used by either channel.
Frequency Division Multiplexing

Time Division Multiplexing

TDM is applied primarily on digital signals but can be applied on analog signals as well. In TDM the shared channel is divided among its user by means of time slot. Each user can transmit data within the provided time slot only. Digital signals are divided in frames, equivalent to time slot i.e. frame of an optimal size which can be transmitted in given time slot.
TDM works in synchronized mode. Both ends, i.e. Multiplexer and De-multiplexer are timely synchronized and both switch to next channel simultaneously.
Time Division Multiplexing
When channel A transmits its frame at one end,the De-multiplexer provides media to channel A on the other end.As soon as the channel A’s time slot expires, this side switches to channel B. On the other end, the De-multiplexer works in a synchronized manner and provides media to channel B. Signals from different channels travel the path in interleaved manner.

Wavelength Division Multiplexing

Light has different wavelength (colors). In fiber optic mode, multiple optical carrier signals are multiplexed into an optical fiber by using different wavelengths. This is an analog multiplexing technique and is done conceptually in the same manner as FDM but uses light as signals.
Wavelength Division Multiplexing
Further, on each wavelength time division multiplexing can be incorporated to accommodate more data signals.

Code Division Multiplexing

Multiple data signals can be transmitted over a single frequency by using Code Division Multiplexing. FDM divides the frequency in smaller channels but CDM allows its users to full bandwidth and transmit signals all the time using a unique code. CDM uses orthogonal codes to spread signals.
Each station is assigned with a unique code, called chip. Signals travel with these codes independently, inside the whole bandwidth.The receiver knows in advance the chip code signal it has to receive.

Transmission media-Physical Layer

The transmission media is nothing but the physical media over which communication takes place in computer networks.

Magnetic Media

One of the most convenient way to transfer data from one computer to another, even before the birth of networking, was to save it on some storage media and transfer physical from one station to another. Though it may seem old-fashion way in today’s world of high speed internet, but when the size of data is huge, the magnetic media comes into play.
For example, a bank has to handle and transfer huge data of its customer, which stores a backup of it at some geographically far-away place for security reasons and to keep it from uncertain calamities. If the bank needs to store its huge backup data then its,transfer through internet is not feasible.The WAN links may not support such high speed.Even if they do; the cost too high to afford.
In these cases, data backup is stored onto magnetic tapes or magnetic discs, and then shifted physically at remote places.

Twisted Pair Cable

A twisted pair cable is made of two plastic insulated copper wires twisted together to form a single media. Out of these two wires, only one carries actual signal and another is used for ground reference. The twists between wires are helpful in reducing noise (electro-magnetic interference) and crosstalk.

There are two types of twisted pair cables:
  • Shielded Twisted Pair (STP) Cable
  • Unshielded Twisted Pair (UTP) Cable
STP cables comes with twisted wire pair covered in metal foil. This makes it more indifferent to noise and crosstalk.
UTP has seven categories, each suitable for specific use. In computer networks, Cat-5, Cat-5e, and Cat-6 cables are mostly used. UTP cables are connected by RJ45 connectors.

Coaxial Cable

Coaxial cable has two wires of copper. The core wire lies in the center and it is made of solid conductor.The core is enclosed in an insulating sheath.The second wire is wrapped around over the sheath and that too in turn encased by insulator sheath.This all is covered by plastic cover.
Coaxial Cable
Because of its structure,the coax cable is capable of carrying high frequency signals than that of twisted pair cable.The wrapped structure provides it a good shield against noise and cross talk. Coaxial cables provide high bandwidth rates of up to 450 mbps.
There are three categories of coax cables namely, RG-59 (Cable TV), RG-58 (Thin Ethernet), and RG-11 (Thick Ethernet). RG stands for Radio Government.
Cables are connected using BNC connector and BNC-T. BNC terminator is used to terminate the wire at the far ends.

Power Lines

Power Line communication (PLC) is Layer-1 (Physical Layer) technology which uses power cables to transmit data signals.In PLC, modulated data is sent over the cables. The receiver on the other end de-modulates and interprets the data.
Because power lines are widely deployed, PLC can make all powered devices controlled and monitored. PLC works in half-duplex.
There are two types of PLC:
  • Narrow band PLC
  • Broad band PLC
Narrow band PLC provides lower data rates up to 100s of kbps, as they work at lower frequencies (3-5000 kHz).They can be spread over several kilometers.
Broadband PLC provides higher data rates up to 100s of Mbps and works at higher frequencies (1.8 – 250 MHz).They cannot be as much extended as Narrowband PLC.

Fiber Optics

Fiber Optic works on the properties of light. When light ray hits at critical angle it tends to refracts at 90 degree. This property has been used in fiber optic. The core of fiber optic cable is made of high quality glass or plastic. From one end of it light is emitted, it travels through it and at the other end light detector detects light stream and converts it to electric data.
Fiber Optic provides the highest mode of speed. It comes in two modes, one is single mode fiber and second is multimode fiber. Single mode fiber can carry a single ray of light whereas multimode is capable of carrying multiple beams of light.
Fiber Optics
Fiber Optic also comes in unidirectional and bidirectional capabilities. To connect and access fiber optic special type of connectors are used. These can be Subscriber Channel (SC), Straight Tip (ST), or MT-RJ.