CS 403-Week 1 Module
CS 403-Week 1 Module
COLLEGE
Maranding, Lala, Lanao del Norte
Introduction
This module discusses the computer networks, the OSI model and its seven layers and the basic commands in Linux.
You will also know why the receiver will receive data from the sender.
Rationale
Give at least one scenario that apply the seven layers of OSI model.
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
1
Crafted by Mr. Arvin Narvaza
COURSE MODULE MODULE WEEK NO.1
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 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.
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!).
2
Crafted by Mr. Arvin Narvaza
COURSE MODULE MODULE WEEK NO.1
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.
There are seven layers of the 051 model working from top to bottom.
3
Crafted by Mr. Arvin Narvaza
COURSE MODULE MODULE WEEK NO.1
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).
4
Crafted by Mr. Arvin Narvaza
COURSE MODULE MODULE WEEK NO.1
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 and bolts of any network.
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.
Note:
5
Crafted by Mr. Arvin Narvaza
COURSE MODULE MODULE WEEK NO.1
You can use 'ls -R' to shows all the files not only in directories but also
subdirectories
6
Crafted by Mr. Arvin Narvaza
COURSE MODULE MODULE WEEK NO.1
NOTE: The command is case-sensitive. If you enter, "ls - r" you will get an error.
Any Directory/file starting with a '.' will not be seen unless you request for it. To
view hidden files, use the command.
ls -a
8
Crafted by Mr. Arvin Narvaza
COURSE MODULE MODULE WEEK NO.1
cat filename
9
Crafted by Mr. Arvin Narvaza
COURSE MODULE MODULE WEEK NO.1
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
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
10
Crafted by Mr. Arvin Narvaza
COURSE MODULE MODULE WEEK NO.1
mv filename new_file_location
mv sample2 /home/guru99/Documents
sudo command_you_want_to_execute
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.
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
Creating Directories
12
Crafted by Mr. Arvin Narvaza
COURSE MODULE MODULE WEEK NO.1
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
To remove a directory, use the command -
rmdir directoryname
13
Crafted by Mr. Arvin Narvaza
COURSE MODULE MODULE WEEK NO.1
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
To get help on any command that you do not understand, you can type
man
14
Crafted by Mr. Arvin Narvaza
COURSE MODULE MODULE WEEK NO.1
The terminal would open the manual page for that command.
15
Crafted by Mr. Arvin Narvaza
COURSE MODULE MODULE WEEK NO.1
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
16
Crafted by Mr. Arvin Narvaza
COURSE MODULE MODULE WEEK NO.1
NOTE: With Linux upgrades, these shortcuts keep changing. You can set your
preferred shortcuts via Terminal> Edit> Keyboard Shortcuts.
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
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.
18
Crafted by Mr. Arvin Narvaza
COURSE MODULE MODULE WEEK NO.1
Assigning a header
The syntax is:
pr -h "Header" Filename
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.
19
Crafted by Mr. Arvin Narvaza
COURSE MODULE MODULE WEEK NO.1
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
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
20
Crafted by Mr. Arvin Narvaza
COURSE MODULE MODULE WEEK NO.1
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.
You can use the apt commands to install or remove a package. Let's update all
the installed packages in our system using command -
21
Crafted by Mr. Arvin Narvaza
COURSE MODULE MODULE WEEK NO.1
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.
22
Crafted by Mr. Arvin Narvaza
COURSE MODULE MODULE WEEK 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.
Summary
You can format and print a file directly from the terminal. The formatting you
do on the files does not affect the file contents
In Unix/Linux, software is installed in the form of packages. A package
contains the program itself. Any dependent component needs to be
downloaded separately.
You can also send e-mails from terminal using the 'mail' network
commands. It is very useful linux commands.
Exercise
Assessment
Answer this short quiz and submit your answer on or before August 25, 2020.
1. Why do engineers use a “model” to organize their approach to solving a large and
23
Crafted by Mr. Arvin Narvaza
COURSE MODULE MODULE WEEK NO.1
complex problem?
a) Because it allows them to build something small and test it
in a wind tunnel
b) Because talking about a model delays the actual start of the
hard work
c) Because they can break a problem down into a set of smaller
problems that can be solved independently
d) Because it helps in developing marketing materials
2. Which is the top layer of the network model used by TCP/IP networks?
a) Application
b) Transport
c) Internetwork
d) Link
3. Which of the layers concerns itself with getting a packet of data across a single physical
connection?
a) Application
b) Transport
c) Internetwork
d) Link
4. What does CSMA/CD stand for?
a) Carrier Sense Multiple Access with Collision Detection
b) Collision Sense Media Access with Continuous Direction
c) Correlated Space Media Allocation with Constant Division
d) Constant State Multiple Address Channel Divison
5. What does URL stand for?
a) Universal Routing Linkage
b) Uniform Retransmission Logic
c) Uniform Resource Locator
d) Unified Recovery List
Reflection
Why OSI model and the Linux commands are very important?
24
Crafted by Mr. Arvin Narvaza