Download as pdf or txt
Download as pdf or txt
You are on page 1of 37

Gheorghe Asachi Technical University of Iasi

Faculty of Automatic Control and Computer Engineering

”Network Service Management”


- Course Notes -
Master Study Programme: Distributed Systems and WEB Technologies

Year of Study: 2022-2023

Cristian-Mihai AMARANDEI
Email: cristian-mihai.amarandei@academic.tuiasi.ro
”Network Service Management” – Course Notes

Using any one of these?

NSM Lecture 1 - Intro 2/37


”Network Service Management” – Course Notes

What about Wikipedia ?

NSM Lecture 1 - Intro 3/37


”Network Service Management” – Course Notes

Do you know what it takes to make it work?

NSM Lecture 1 - Intro 4/37


”Network Service Management” – Course Notes

After all that nonsense …


things start to move

NSM Lecture 1 - Intro 5/37


”Network Service Management” – Course Notes

you will learn about …



Linux operating system

Web servers

Database servers

File servers

Computer networks

Virtualization

How to put everything in production


and ...

NSM Lecture 1 - Intro 6/37


”Network Service Management” – Course Notes

You will learn that


… after some time and more users …

NSM Lecture 1 - Intro 7/37


”Network Service Management” – Course Notes

… what to do when
SOMETHING GOES WRONG!!!
OR

NSM Lecture 1 - Intro 8/37


”Network Service Management” – Course Notes

To sum up what you will learn …

NSM Lecture 1 - Intro 9/37


”Network Service Management” – Course Notes

Network Service Management (NSM)


- fancy name for Linux System Administration

Objectives: ●
Expected results:
– Develop a global vision on
– Knowledge on fundamental
problems related to the
Linux system and network management of network services
services; and their solutions;
– Getting used to manage – The ability to design, implement
Linux networks and and test network services;
systems. – The ability to diagnose problems
in the network services and solve
them.
NSM Lecture 1 - Intro 10/37
”Network Service Management” – Course Notes

Course structure
Lectures
– 1 h/week [Total: 14 h]
– Attendance: highly encouraged
– Details on topics ... some tips and tricks
Applications
– 2 h/week [Total: 28 h]
– Attendance: mandatory
– Hands on

learn how to deal with network services: install, deploy and troubleshoot

learn how to connect them
NSM Lecture 1 - Intro 11/37
”Network Service Management” – Course Notes

Evaluation Criteria
Final assessment - 50% ( Minimum grade 5 !)
– theoretical knowledge test (quiz on Moodle)

no information materials

Continuous assessment
– Laboratory work 50% (Minimum grade 5 !)

NSM Lecture 1 - Intro 12/37


”Network Service Management” – Course Notes

Linux
system architecture

NSM Lecture 1 - Intro 13/37


”Network Service Management” – Course Notes

Linux
system architecture

Kernel
– Interface between hardware and the operating system
– Resposable for:

Resource allocation (i.e. memory, CPU)

Contains device drivers - usually ones, which are specific to the hardware peripherals that you are using

Resource accounting

System security

Standard Library of Procedures
– a standard library of procedures, which allows the "userland" software to communicate with the kernel (often
called "libc“)

Standard Utilities and User Applications
– a set of standard Unix-like utilities: simple commands that are used in day-to-day use of the operating
system, as well as specific user applications and services

NSM Lecture 1 - Intro 14/37


”Network Service Management” – Course Notes

NSM Lecture 1 - Intro 15/37


”Network Service Management” – Course Notes

Linux file system



Linux/UNIX file system : ●
File types
– max 255 characters length – common files (text files or binary files)
– case sensitive
– no restrictions, except “ /”
– directories
– “extension” (as is known in windows) is not used – special type:
– hierarchical structure ●
physical or virtual devices; character/blok
– files are expandable (size can be increased) devices (/dev)
– files are treated like bytes flow ●
pipe – used for process
– files and directories have security rights attributes
intercommunication
– can be used by more users

socket – used for process/network
intercommunications
– hardware devices are files

links (hard or symbolic links)

NSM Lecture 1 - Intro 16/37


”Network Service Management” – Course Notes

Linux - file system structure



Unix file system – disk resident data structure;
Block 0 – boot block

4 types of informations:
Block 1 – Superbloc
– Block 0 – boot Block 2 – i-nod
Block n – i-nod
– Block 1 – Superblock Block n + 1 – data
– Block 2 ... n – i-node list Block n + m – data
– Block n+1 ... n+m – data blocks (files, directories)


Block 0 – contains the code needed to further initialize the
operating system; ●
Block 2 to n (n – disk formating constant) contains a

Block 1 or superblock – is a data structure that represents list of i-nodes (i-list or i-node list) that are used to
a file system and contains the following information: track and maintain information about each file created
– the size of the file system, the list of storage blocks on the filesystem.
– the number of free blocks. – i-node – is a data structure represents an object in the file
– the location of all free blocks. system with a unique identifier that stores all the
– the index of the next free block in the free block list. information about a file except its name and its actual data
– the size of the inode list.
– the number of free inodes in the file system.
– the index of the next free inode in the free inode list

NSM Lecture 1 - Intro 17/37


”Network Service Management” – Course Notes

Linux - file system structure

NSM Lecture 1 - Intro 18/37


”Network Service Management” – Course Notes

Linux - i-node structure



Files are identified by an i-number (an index in i-node list)

An i-node for a file contains the following information:
– Owner info (UID and GID)
– File type
– File access permissions (Read, Write, eXecute)
– length
– Access times (last file access time, last file modification time, last inode modification time)
– Number of links
– File size
– Table of disk addresses (where data is stored on the storage device)

NSM Lecture 1 - Intro 19/37


”Network Service Management” – Course Notes

Linux - file system structure



Hierarchical, tree like structure
– Root directory (/)

defined by administrator when the system was installed

the starting point of your directory structure; this is where the Linux system begins

It is the directory where all of the other directories in the file system are stored.

The root user is the only one who can write to this directory

All other file system can be found under this directory
– Files are referred by a directory path ( “/” is used as delimiter)

Within the shell - a current directory
– Access by absolute path (starting from “ /” ) or by Relative path

Each directory contains the following two files
– “.” current directory
– “..” parent directory

NSM Lecture 1 - Intro 20/37


”Network Service Management” – Course Notes

Linux - files attributes



File/directory owner ●
Directories access rights
– user; group; others
– “r” – read the directory content

Access rights
– read (“ r” )
– “w” – add/delete files or directories
– write (“w” ) – “x” – right to browse directory structure
– execute (“ x” )


Special attributes
– SUID/SGID (“ s” ) bit

change owners identity
– Sticky (“t” ) bit

Initially used to store the text segment of a program in swap after the program end it’s execution

Now used only for directories (only the owner can delete them)
– Example: /tmp - users can add/remove their own files but cannot remove the /tmp or someone else files

NSM Lecture 1 - Intro 21/37


”Network Service Management” – Course Notes

Linux - files attributes



Files/directories attributes can be viewed by running “ls” command :
$ls -ld /tmp

drwxrwxrwt 12 root root 106496 Oct 2 16:38 /tmp

Field 1 Field 2 Field 3 Field 4 Field 5 Field 6 Field 7 Field 8 Field 9 Field 10

d rwx rwx rwt 12 root root 106496 Oct 2 16:38 /tmp


Field 1: file type – First = readable “ r”
– second = writeable “w”
– “-” common file – third = executable “ x”; s/t: executable and setuid/setgid/sticky; S/T:
– “d” directory setuid/setgid or sticky, but not executable.

Field 5: specifies the number of links or directories inside this
– “b” block device,“c” character device directory (by default 2 because of “.” si ”..”)
– “l” link, “p” pipe, “s” socket ●
Field 6,7: the owner and the group that file belongs to (any
user in that group will have the permissions given in the field

Field 2,3,4: three groups of three characters 3)
– what the owner can do ●
Field 8: size in bytes
– what the group members can do ●
Field 9: date of last modification
– what other users can do ●
Field 10: name of the file/direcotry
NSM Lecture 1 - Intro 22/37
”Network Service Management” – Course Notes

Linux - standard filesystem hierarchy

NSM Lecture 1 - Intro 23/37


”Network Service Management” – Course Notes

Linux - standard filesystem hierarchy



/bin – Essential command binaries (bash, ls, pwd, rpm...).
– Commands needed during bootup that might be used by normal users (probably after bootup).

/sbin – Essential system binaries (root) (init, runlevel, fsck ...)
– The commands are not intended for normal users, although they may use them if necessary and allowed.

/sbin is not usually in the default path of normal users, but will be in root's default path.

/dev – Device files. These are special files that help the user interface with the various devices on the
system
– /dev/hda – fist IDE drive
– /dev/hdb1 – first partition on the secod IDE drive
– /dev/sda – first SCSI/SATA drive
– /dev/fd0 – floppy drive
– /dev/lp0 – first parallel port

/etc – Host-specific system configuration. The /etc hierarchy contains configuration files.
– /etc/passwd – users database
– /etc/shadow – an encrypted file; holds user passwords.

NSM Lecture 1 - Intro 24/37


”Network Service Management” – Course Notes

Linux - standard filesystem hierarchy



/usr – Secondary hierarchy; All files in /usr usually come from a Linux distribution; locally
installed programs and other stuff goes below /usr/local.
– bin – Almost all user commands. Some commands are in /bin or in /usr/local/bin
– sbin – System administration commands that are not needed on the root filesystem, e.g., most server
programs. (crond, httpd, useradd...)
– lib – Unchanging data files for programs and subsystems, including some site−wide configuration files.
The name lib comes from library; originally libraries of programming subroutines were stored in /usr/lib.
– local – local installed applications
– include – Header files included by C/C++ programs
– share – Manual pages, GNU Info documents and miscellaneous other documentation files

/lib – Essential shared libraries and kernel modules (/lib/modules)

/boot – Static files of the boot loader, kernel images

/tmp – temporary files

NSM Lecture 1 - Intro 25/37


”Network Service Management” – Course Notes

Linux - standard filesystem hierarchy



/home – user home directories

/mnt – temporary mount directory where sysadmins can mount filesystems

/var – contains data that is changed when the system is running normally.
– log – system log files
– cache - application cache data
– spool – application waiting queues
– lib – variable state information.

/proc – Kernel and process information virtual filesystem
– It does not exist on a disk, the kernel creates it in memory. It is used to provide
information about the system (originally about processes, hence the name).

NSM Lecture 1 - Intro 26/37


”Network Service Management” – Course Notes

Linux - standard filesystem hierarchy



/etc
– /etc/rc or /etc/rc.d or /etc/rc?.d

Scrips or directories with scripts running at system boot or when the runlevel is changed.
– /etc/passwd

Users database: - contains username, real name, home directory and the like.
– /etc/fstab

List of filesystem mounted at system boot or when mount –a command is used

Also contains informations about swap filesystems.
– /etc/group

Like /etc/passwd, contains informations about groups of users info instead of users.

NSM Lecture 1 - Intro 27/37


”Network Service Management” – Course Notes

Linux - standard filesystem hierarchy


– /etc/inittab – /etc/shadow

init configuration file. ●
Available on all modern Linux system
– /etc/motd ●
Older Linux version – shaddow password
package shoud be installed

Message of the day – presented at user
login. Content can be changed by the

Encrypted password are relocated from
system administrator. /etc/passwd to /etc/shaddow – only root
user is able to read this file
– /etc/mtab
– /etc/profile, /etc/csh.login,

Current mounted filesystems.
/etc/csh.cshrc
– /etc/shells ●
Files used by Bourne (bash) or C shell

All available shell’s. (csh)

chsh command allow users to change their ●
Allow system administrator to configure
login shell only with one listed in this file. system wide environment variables

NSM Lecture 1 - Intro 28/37


”Network Service Management” – Course Notes

Linux - standard filesystem hierarchy



/dev
– is the location of special or device – /dev/hda
files – /dev/sda
– /dev/dsp – /dev/random or /dev/urandom

Interface between multimedia
applications and sound card

Kernel random number generator
– /dev/fd0
– /dev/ttyS0

floppy

serial interface
– /dev/fb0 – /dev/null

Framebuffer device ●
Linux system “black hole”

NSM Lecture 1 - Intro 29/37


”Network Service Management” – Course Notes

Linux - standard filesystem hierarchy



/usr
– Secondary hierarchy for read-only user data; contains the majority of (multi-)user utilities and applications
– All distribution specific applications are installed under /usr folder.
– All local installed applications are located in /usr/local

/usr/X11R6
– This hierarchy is reserved for the X Window System, version 11 release 6, and related files
– X windows files are separated form the rest to simplify the instalation and development process and for
compatibility betweeen variuos Linux versions.
– Filesystem hirarchy under /usr/X11 is similar with /usr

/usr/bin
– Most user commands
– Some commands are in /usr/bin and other in /usr/local/bin

NSM Lecture 1 - Intro 30/37


”Network Service Management” – Course Notes

Linux - standard filesystem hierarchy



/usr/sbin
– Non-essential standard system binaries used exclusively by the system administrator.
– System administration programs that are required for system repair, system recovery, mounting /usr, or other essential
functions must be placed in /sbin instead.

/usr/lib
– Libraries for programming and packages
– Applications may use a single subdirectory under /usr/lib

/usr/local
– Tertiary hierarchy for local data, specific to this host.
– The /usr/local hierarchy is for use by the system administrator when installing software locally.
– It needs to be safe from being overwritten when the system software is updated. It may be used for programs and data
that are shareable amongst a group of hosts, but not found in /usr.
– Locally installed software must be placed within /usr/local rather than /usr unless it is being installed to replace or upgrade
software in /usr.

NSM Lecture 1 - Intro 31/37


”Network Service Management” – Course Notes

Linux - standard filesystem hierarchy



/var
– Variable files—files whose content is expected to continually change during normal operation of the system—such as
logs, spool files, and temporary e-mail files.
– Sometimes a separate partition can be used.

/var/cache
– Such data are locally generated as a result of time-consuming I/O or calculation.
– The application must be able to regenerate or restore the data.
– The cached files can be deleted without loss of data.

/var/local
– Variable data for local program that are installed in /usr/local.

/var/log
– Log files from the system and various programs/services, especially login (/var/log/wtmp, which logs all logins and
logouts into the system) and syslog (/var/log/messages, where all kernel and system program message are usually
stored).
– Files in /var/log can often grow indefinitely, and may require cleaning at regular intervals.

NSM Lecture 1 - Intro 32/37


”Network Service Management” – Course Notes

Linux - standard filesystem hierarchy



/var/run
– Run-time variable data
– Contains the process identification files (PIDs) of system services and other information about
the system that is valid until the system is next booted.

/var/spool
– Holds spool files, for instance for mail, news, and printing (lpd) and other queued work.
– Spool files store data to be processed after the job currently occupying a device is finished or the
appropriate cron job is started.

/var/tmp
– Temporary files preserved between system reboots.
– Data stored in /var/tmp is more persistent than data in /tmp

NSM Lecture 1 - Intro 33/37


”Network Service Management” – Course Notes

Linux - standard filesystem hierarchy



/proc
– Kernel and process information virtual filesystem
– Contains information about system process.
– This is a pseudo filesystem contains information about running process.
– This is a virtual filesystem with text information about system resources. For example: /proc/uptime
– /proc/1

Directory with informations about the process with PID 1. For each process there is a /proc/{PID} directory contains information about the process
with that particular PID (process identification number).
– /proc/cpuinfo

Cpu informations
– /proc/devices

List of devices configured in the kernel.
– /proc/dma

DMA channels in use
– /proc/filesystems

Displays a list of the file system types currently supported by the kernel.
– /proc/interrupts

records the number of interrupts per IRQ on the x86 architecture

NSM Lecture 1 - Intro 34/37


”Network Service Management” – Course Notes

Linux - standard filesystem hierarchy


– /proc/ioports

Provides a list of currently registered port regions used for input or output communication with a device
– /proc/kcore

Represents the physical memory of the system and is stored in the core file format

This value is given in bytes and is equal to the size of the physical memory (RAM) used plus 4 KB.

The contents of this file are designed to be examined by a debugger, such as gdb, and is not human readable.
– /proc/meminfo

it reports a large amount of valuable information about the systems RAM and swap usage
– /proc/modules

Displays a list of all modules loaded into the kernel.
– /proc/net

Provides a comprehensive look at various networking parameters and statistics. Each directory and virtual file within this directory
describes aspects of the system's network configuration.
– /proc/stat

keeps track of a variety of different statistics about the system since it was last restarted
– /proc/version

specifies the version of the Linux kernel and gcc in use.

NSM Lecture 1 - Intro 35/37


”Network Service Management” – Course Notes

Reading assignment

The Linux System Administrator's Guide
– Chapters 2,3,4

NSM Lecture 1 - Intro 36/37


”Network Service Management” – Course Notes

References
This presentation is intended for lecturing purposes only and it is based on the references listed below. Therefore, the students are encouraged to (and they should) read
thoroughly the original documents listed below in order to improve their skills.


Matthew West - The Linux System Administrator's Guide
– http://www.learnlinux.org.za/courses/build/fundamentals/index.html

The Linux System Administrators' Guide
– http://www.tldp.org/LDP/sag/sag.pdf

The Linux Network Administrator's Guide, Second Edition
– http://www.tldp.org/LDP/nag2/nag2.pdf

Securing & Optimizing Linux: The Ultimate Solution
– http://www.tldp.org/LDP/solrhe/Securing-Optimizing-Linux-The-Ultimate-Solution-v2.0.pdf

Filesystem Hierarchy Standard
– http://www.pathname.com/fhs/pub/fhs-2.3.pdf

Red Hat Enterprise Linux Documentation
– https://access.redhat.com/documentation/en/red-hat-enterprise-linux/

NSM Lecture 1 - Intro 37/37

You might also like