CS 403 - Module 1
CS 403 - Module 1
1
NORTH CENTRAL MINDANAO COLLEGE
Maranding, Lala, Lanao del Norte
Topic
Rationale
Discussion
The Open Systems Interconnection (OSI) reference model has served as the most basic elements of computer
networking since the inception in 1984. The OSI Reference Model is based on a proposal developed by the
International Standards Organization (ISO). The original objective of the OSI model was to provide a set of
design standards for equipment manufacturers so they could communicate with each other. The OSI model
defines a hierarchical architecture that logically partitions the functions required to support system-to-system
communication.
The Open Systems Interconnect model, or OSI model, divides up jobs that have to happen for a smooth
network experience. The model allows network engineers to develop and improve individual layers
1
www.ncmc.edu.ph
CS 403 COURSE MODULE MODULE NO.1
regardless of what's going on with the others.
To put this into perspective, the main function of a web browser (such as Internet Explorer) is to show web
pages. It does this by decoding HTML so that you can see the web page an author meant you to see. The web
browser itself doesn't care about what the voltage levels are on the Ethernet cable connecting your PC to the
router it uses, it just relies on them to be correct
Layers of communication
When you do something on a network (for example, send an email from London to New York) think of these
layers as being stacked on top of each other with you at the top on layer-7. At the other end in New York
there is another stack of the same layers with your friend on top of that respective stack. Once sent by you the
data goes through all the layers, from the application layer down to the physical layer, then across wires to
your friend's physical layer where it goes back up the stack again.
In fact there are lots more little stacks of layers in between you in London and your friend in New York
which your data has to go up, then down again. This happens when the routers in each ISP between you and
your friend need to look at the data to see where it should go to; the data will go from the physical layer
(layer-1) back up to the network layer (layer-3) where it will be examined, then sent back down to the
physical layer to continue its journey.
Want to see how it works?
If you want to get an idea of this in action open up a command line (Windows Key+R, type "cmd") and type
"tracert bbc.co.uk" to watch the journey unfold. You'll see that when you call up the BBC web page, the data
packets take a journey which can go all over the world (even if you're right next door to the server--that's the
network layer!)
You'll also see that the BBC website lives at 212.58.244.69 which is the IP address of the server (IPv4). This
could be a different IP as the BBC uses lots of servers to serve its websites, but luckily you don't usually have
to remember the IP address and just need to type the friendlier domain name "bbc.co.uk" and the IP address
is worked out behind the scenes using a service called Domain Name Services (the application layer!).
The OSI model is used for all kinds of networks, not just the internet, and network engineers love to mix-
and-match each layer. You might be developing a network for managing high-speed trains so it'll probably
have some pretty clever applications (layer-7) for running the timetable, controlling the stability and
everything else a high-speed train needs. As Ethernet is cheap to use you employ that for the physical
connections (layer-1) that run through-out the train connecting the various applications to each other.
Likewise as Ethernet doesn't carry data well over very long distances you would probably use optical fibre
for the physical connections (layer-1) between stations. As everything works within the same OSI model you
are able to mix and match various technologies for each layer.
Almost all of the protocols for each of the layers are set by standards groups during annual conferences
where they try to improve existing protocols or invent new ones. By using standardised protocols at each
layer you could ask a manufacturer to build a box that uses 802.3 (Ethernet covering layers I to 3) while you
work on your application, knowing exactly how the box will function.
The OSI model is one of those important things that sits behind everything on any network and provides a
structure that allowed the internet to function. Without the OSI model it would be have been nearly impossible to
connect networks together and we wouldn't have the internet (or World Wide Web) as we know it today.
2
www.ncmc.edu.ph
CS 403 COURSE MODULE MODULE NO.1
There are seven layers of the 051 model working from top to bottom.
Application (Layer-7): The 'top' layer. This is the stuff you see when using the Internet (i.e. webpages). It
knows the difference between what an email should look like and what a web page should look like.
Presentation (Layer-6): This layer encrypts and decrypts anything that is encoded. So, for example, you can
log into your online bank securely. The data bits being sent down the line will look jumbled until the right
software at the right place decodes them on the application layer.
Session (Layer-5): The session layer establishes connections between computers. If you visit a webpage, the
session layer makes sure you're connected to the server until everything is transferred. So for example if
you're in a chat room, the session layer keeps the room open.
Transport (Layer-4): This is the first layer that doesn't care what the actual data is. The transport layer just
packages bits into nice bundles called 'data packets'. These packets are mostly used so that the computers can
tell if something gets lost along the way.
Network (Layer-3): The network layer performs all the routing functions, making sure that packets from the
transport layer aren't just wandering around the wires, but that they actually have somewhere to go (much like
the sorting office in the postal system).
Data Link (Layer-2): The data link layer is primarily the switches within the network. These put most bits
into frames for easier routing by the network layer and work out how the physical layer is connected (i.e.
which computer is connected to which port).
Physical (Layer-1): The 'bottom' layer. The physical layer is the actual infrastructure that underpins
everything above. This covers the physical fibre, copper cables, volts, zeros and ones that make up the nuts
3
www.ncmc.edu.ph
CS 403 COURSE MODULE MODULE NO.1
Linux is the most popular server OS. Linux is a clone of UNIX. Knowing one is as good as knowing the other.
Sometimes, commands are also referred as "programs" since whenever you run a command, it's the
corresponding program code, written for the command, which is being executed.
If you want to see the list of files on your UNIX or Linux system, use the 'ls' command.
Note:
You can use 'ls -R' to shows all the files not only in directories but also subdirectories
4
www.ncmc.edu.ph
CS 403 COURSE MODULE MODULE NO.1
NOTE: The command is case-sensitive. If you enter, "ls - r" you will get an error.
'ls -al' gives detailed information of the files. The command provides information in a columnar format. The
columns contain the following information:
5
www.ncmc.edu.ph
CS 403 COURSE MODULE MODULE NO.1
6th Column Date and Time
Hidden items in UNIX/Linux begin with - at the start, of the file or directory.
Any Directory/file starting with a '.' will not be seen unless you request for it. To view hidden files, use the
command.
ls -a
The 'cat' server command is used to display text files. It can also be used for copying, combining and creating
6
www.ncmc.edu.ph
CS 403 COURSE MODULE MODULE NO.1
cat filename
As soon as you insert this command and hit enter, the files are concatenated, but you do not see a result. This
is because Bash Shell (Terminal) is silent type. Shell Commands will never give you a confirmation
message like "OK" or "Command Successfully Executed". It will only show a message when something goes
wrong or when an error has occurred.
cat sample
7
www.ncmc.edu.ph
CS 403 COURSE MODULE MODULE NO.1
Note: Only text files can be displayed and combined using this command.
Deleting Files
The 'rm' command removes files from the system without confirmation.
rm filename
mv filename new_file_location
Suppose we want to move the file "sample2" to location /home/guru99/Documents. Executing the command
mv sample2 /home/guru99/Documents
mv command needs super user permission. Currently, we are executing the command as a standard user.
Hence we get the above error. To overcome the error use command.
sudo command_you_want_to_execute
8
www.ncmc.edu.ph
CS 403 COURSE MODULE MODULE NO.1
Sudo program allows regular users to run programs with the security privileges of the superuser or root.
Sudo command will ask for password authentication. Though, you do not need to know the root password.
You can supply your own password. After authentication, the system will invoke the requested command.
Sudo maintains a log of each command run. System administrators can trackback the person responsible for
undesirable changes in the system.
mv filename newfilename
NOTE: By default, the password you entered for sudo is retained for 15 minutes per terminal. This eliminates
the need of entering the password time and again.
You only need root/sudo privileges, only if the command involves files or directories not owned by the user or
group running the commands
Directory Manipulations
9
www.ncmc.edu.ph
CS 403 COURSE MODULE MODULE NO.1
Creating Directories
Directories can be created on a Linux operating system using the following command
mkdir directoryname
This command will create a subdirectory in your present working directory, which is usually your "Home
Directory".
For example,
mkdir mydirectory
If you want to create a directory in a different location other than 'Home directory', you could use the
following command -
mkdir
For example:
mkdir /tmp/MUSIC
Removing Directories
10
www.ncmc.edu.ph
CS 403 COURSE MODULE MODULE NO.1
rmdir directoryname
Example
rmdir mydirectory
Tip: Ensure that there is no file / sub-directory under the directory that you want to delete. Delete the
files/sub-directory first before deleting the parent directory.
Renaming Directory
The 'mv' (move) command (covered earlier) can also be used for renaming directories. Use the below-given
format:
mv directoryname newdirectoryname
Man stands for manual which is a reference book of a Linux operating system. It is similar to HELP file found
in popular software.
To get help on any command that you do not understand, you can type
11
www.ncmc.edu.ph
CS 403 COURSE MODULE MODULE NO.1
man
The terminal would open the manual page for that command.
For an example, if we type man man and hit enter; terminal would give us information on man command
History command shows all the commands that you have used in the past for the current terminal session. This
can help you refer to the old commands you have entered and re-used them in your operations again.
12
www.ncmc.edu.ph
CS 403 COURSE MODULE MODULE NO.1
This command clears all the clutter on the terminal and gives you a clean window to work on, just like when
you launch the terminal.
Many times you would have to type in long commands on the Terminal. Well, it can be annoying at times, and
if you want to avoid such a situation then copy, pasting the commands can come to rescue.
For copying, the text from a source, you would use Ctrl + c, but for pasting it on the Terminal, you need to
use Ctrl + Shift + p. You can also try Shift + Insert or select Edit>Paste on the menu
NOTE: With Linux upgrades, these shortcuts keep changing. You can set your preferred shortcuts via
13
www.ncmc.edu.ph
CS 403 COURSE MODULE MODULE NO.1
Printing in Unix/Linux
Let's try out some easy unix command list which can print files in a format you want. What more, your
original file does not get affected at all by the formatting that you do. Let us learn about these commands and
their use.
'pr' command
This command helps in formatting the file for printing on the terminal. There are many options available with
this command which help in making desired format changes on file. The most used 'pr' options are listed
below.
Option Function
14
www.ncmc.edu.ph
CS 403 COURSE MODULE Let us try some of the options and study their effects.
MODULE NO.1
We want its content to be arranged in three columns. The syntax for the same would be:
pr -x Filename
The '-x' option with the 'pr' command divides the data into x columns.
Assigning a header
pr -h "Header" Filename
15
www.ncmc.edu.ph
CS 403 COURSE MODULE MODULE NO.1
As shown above, we have arranged the file in 3 columns and assigned a header
pr -n Filename
This command denotes all the lines in the file with numbers.
These are some of the 'pr' command options that you can use to modify the file format.
Printing a file
Once you are done with the formatting, and it is time for you to get a hard copy of the file, you need to use
the following command:
lp Filename
16
www.ncmc.edu.ph
CS 403 COURSE MODULE MODULE NO.1
or
lpr Filename
In case you want to print multiple copies of the file, you can use the number modifier.
In case you have multiple printers configured, you can specify a particular printer using the Printer modifier
Installing Software
In windows, the installation of a program is done by running the setup.exe file. The installation bundle
contains the program as well various dependent components required to run the program correctly.
In Linux/UNIX, installation files are distributed as packages. But the package contains only the program itself.
17
www.ncmc.edu.ph
CS 403 COURSE MODULE MODULE NO.1
Any dependent components will have to be installed separately which are usually available as packages
themselves.
You can use the apt commands to install or remove a package. Let's update all the installed packages in our
system using command -
The easy and popular way to install programs on Ubuntu is by using the Software center as most of the
software packages are available on it and it is far more secure than the files downloaded from the internet.
18
www.ncmc.edu.ph
CS 403 COURSE MODULE MODULE NO.1
For sending mails through a terminal, you will need to install packages 'mailutils'.
Once done, you can then use the following syntax for sending an email.
Press Cntrl+D you are finished writing the mail. The mail will be sent to the mentioned address.
Exercise
Assessment
19
www.ncmc.edu.ph
CS 403 COURSE MODULE MODULE NO.1
Reflection
Why OSI model and the Linux commands are very important?
Resources
Barker, D. (2020). The OSI network model explained: " Database and Network Journal, vol 42.
gale.
Barker, D. (n.d.). The OSI network model explained.
Severance, C. (n.d.). Introduction to Networking.
Prepared By
Judielyn L. Cualbar
CECS Faculty
20
www.ncmc.edu.ph
CS 403 COURSE MODULE MODULE NO.1
21
www.ncmc.edu.ph