CMPT 471 Networking II Course Information 1© Janice Regan, 2013.

Slides:



Advertisements
Similar presentations
CMPT 471 Networking II Linux Primer 1© Janice Regan, 2013.
Advertisements

Learning Unix/Linux Bioinformatics Orientation 2008 Eric Bishop.
Jump to first page Unix Commands Monica Stoica Jump to first page Introduction to Unix n Unix was born in 1969 at Bell Laboratories, a research subdivision.
1 Introduction to UNIX Ke Liu
NETW-240 Shells Last Update Copyright Kenneth M. Chipps Ph.D. 1.
©Colin Jamison 2004 Introduction to Linux Colin Jamison.
© Janice Regan, CMPT 102, Sept CMPT 102 Introduction to Scientific Computer Programming Preparation for working in the CSIL Basic LINUX operations.
Introducing the Command Line CMSC 121 Introduction to UNIX Much of the material in these slides was taken from Dan Hood’s CMSC 121 Lecture Notes.
Linux+ Guide to Linux Certification, Second Edition
More Shell Basics CS465 - Unix. Unix shells User’s default shell - specified in /etc/passwd file To show which shell you are currently using: $ echo $SHELL.
Lecture 02CS311 – Operating Systems 1 1 CS311 – Lecture 02 Outline UNIX/Linux features – Redirection – pipes – Terminating a command – Running program.
CMPE 151: Network Administration Spring Class Description Focus: system and network administration. Sequence of exercises. E.g., installing/configuring.
Linux Commands LINUX COMMANDS.
L INUX C OMMAND L INE I NTERFACE G UNAANBAN.G
CS 141 Labs are mandatory. Attendance will be taken in each lab. Make account on moodle. Projects will be submitted via moodle.
CMPT 300: Operating Systems
Unix Primer. Unix Shell The shell is a command programming language that provides an interface to the UNIX operating system. The shell is a “regular”
Lesson 7-Creating and Changing Directories. Overview Using directories to create order. Managing files in directories. Using pathnames to manage files.
Linux in More Detail Shirley Moore CPS5401 August 29,
Lesson 1. PC vs. Multi-user System  Personal Computer – each user gets his/her own processor (or multicore processor).  Multi-user system – The processor,
Unix Basics Chapter 4.
The UNIX Shell. The Shell Program that constantly runs at terminal after a user has logged in. Prompts the user and waits for user input. Interprets command.
LIN Unix Lecture 3 Hana Filip. LIN UNIX Resources UNIX Tutorials UNIX help for.
Linux+ Guide to Linux Certification, Second Edition
Introduction to Linux Azzam Mourad COEN 346.
Chapter 4 UNIX Common Shells Commands By C. Shing ITEC Dept Radford University.
The Shell Chapter 7. Overview The Command Line Standard IO Redirection Pipes Running a Program in the Background Killing (a process!)
System Administration Introduction to Unix Session 2 – Fri 02 Nov 2007 Reference:  chapter 1, The Unix Programming Environment, Kernighan & Pike, ISBN.
Session 2 Wharton Summer Tech Camp Basic Unix. Agenda Cover basic UNIX commands and useful functions.
Lesson 9-Setting and Using Permissions. Overview Describing file permissions. Using execute permissions with a file. Changing file permissions using mnemonics.
1 Operating Systems and Using Linux Topics What is an Operating System? Linux Overview Frequently Used Linux Commands Some content in this lecture added.
Unix/Linux cs3353. The Shell The shell is a program that acts as the interface between the user and the kernel. –The shell is fully programmable and will.
Lesson 2-Touring Essential Programs. Overview Development of UNIX and Linux. Commands to execute utilities. Communicating instructions to the shell. Navigating.
BIF713 Basic Unix/Linux Commands Getting Help with Commands.
Welcome to CS323 Operating System lab 1 TA: Nouf Al-Harbi NoufNaief.net.
Agenda Basic Unix Commands (Chapters 2 & 3) Miscellaneous Commands: whereis, which, whoami, finger, passwd, cal, date Working with Files: cat, more, less.
Linux+ Guide to Linux Certification, Third Edition
Linux+ Guide to Linux Certification, Third Edition
Introduction to Programming Using C An Introduction to Operating Systems.
Getting Started UNIX InKwan Yu Topics Unix Commands Unix System calls C function calls.
Λειτουργικά Συστήματα – Lab2 Γιάννης Πετράκης. Directory Navigation and Control  The Unix file system is set up like a tree branching out from the root.
Agenda Basic Unix Commands (Chapters 2 & 3) Miscellaneous Commands: which, passwd, date, ps / kill Working with Files: file, touch, cat, more, less, grep,
Lesson 3-Touring Utilities and System Features. Overview Employing fundamental utilities. Linux terminal sessions. Managing input and output. Using special.
CSE 374 Programming Concepts & Tools Hal Perkins Fall 2015 Lecture 2a – A Unix Command Sampler (Courtesy of David Notkin, CSE 303)
Linux Commands C151 Multi-User Operating Systems.
1 Lecture 2 Working with Files and Directories COP 3353 Introduction to UNIX.
 Last lesson, the Windows Operating System was discussed along with the Windows command shell  Unix is a computer operating system, that similarly manages.
1 CS3695 – Network Vulnerability Assessment & Risk Mitigation – Introduction to Unix & Linux.
Agenda The Bourne Shell – Part I Redirection ( >, >>,
Linux Tutorial Lesson Two *Getting Help in Linux *Data movement and manipulation *Relative and Absolute path *Processes Note: see chapter 1,2,3 from Linux.
Learning Unix/Linux Based on slides from: Eric Bishop.
INTRODUCTION TO SHELL SCRIPTING By Byamukama Frank
UNIX Basics Matt Hayward October 18, 2016 LS560 – Information Technology for information professionals.
Linux Commands Help HANDS ON TRAINING Author: Muhammad Laique
Andy Wang Object Oriented Programming in C++ COP 3330
Lecture 2 Working with Files and Directories
Some Linux Commands.
C151 Multi-User Operating Systems
Shell Script Assignment 1.
Tutorial of Unix Command & shell scriptS 5027
Basic UNIX OLC Training.
Introduction to UNIX.
Tutorial of Unix Command & shell scriptS 5027
Web Programming Essentials:
Tutorial of Unix Command & shell scriptS 5027
Andy Wang Object Oriented Programming in C++ COP 3330
CSE 303 Concepts and Tools for Software Development
Linux Commands LINUX COMMANDS.
LPI Linux Certification
Presentation transcript:

CMPT 471 Networking II Course Information 1© Janice Regan, 2013

CMPT 471: Networking II  Wed. 17:30-20:20  Suggested Textbook:  Internetworking with TCP/IP Vol. 1: Principles, Protocols, and Architecture (5/e) Douglas Comer, Prentice-Hall, 2006  Additional References:  Internetworking with TCP/IP Vol. II: Design, Implementation, and Internals (3/e) Douglas Comer, Prentice-Hall, 1999:  Routing in the Internet (2/e) Christian Huitema, Prentice Hall PTR, 2000: Excellent book on Internet routing protocols. © Janice Regan,

CMPT 471: Networking II  Additional References:  Unix Network Programming, the sockets networking API v1 3rd edition Stevens, Fenner, and Rudoff, Addison Wesly, 2004  Building Internet Firewalls (2/e) Zwicky, E. Cooper, S., Chapman, D., O'Reilly & Associates, 2000  IPv6 The New Internet Protocol (2/e) Huitema, C., Prentice Hall PTR, 1998  The DHCP Handbook 2nd edition Droms and Lemon, Sams, 2002  Unix Power Tools 3rd edition Powers, Peek, O'Reilly and Loukides, O'Reilly, © Janice Regan,

Class web-site  All the information discussed today and more can always be found on the class web- site  To find the class web site go to  Course Central is also a useful link to abundant information useful to students taking a computing science course © Janice Regan,

Communications © Janice Regan,

CMPT 471 Website 6 © Janice Regan, 2013

My availability © Janice Regan,

8

9 Grading Scheme

Exams © Janice Regan,

Assignments  Five assignments  Each assignment is worth 7% of your course grade  Assignments may be completed in groups of 1 to 3 students  Problems similar to the assignments will appear on the midterm and the final.  Help is available by , during office hours  Complete solutions will be posted for most questions  Only a selection of problems will be graded  Part of the grading may be based on LAB quizzes © Janice Regan,

Final  One 3 hour final examination  30%-40% short answer problems  60%-70% longer problems that utilize several important concepts and require integration of those concepts.  A sample exam, including solutions, will be posted two weeks before the final exam © Janice Regan,

Quizzes  Examples quiz problems from previous semesters with detailed solutions are already posted on the class website  Quizzes and solutions will also be posted to help you review and keep up.  Each quiz is expected to take about minutes to answer.  Answers should consist of a short concise paragraph of 30 sentences, about 1 page, explaining a concept or method, or solving the problem.  Keep in mind that most posted solutions are more extensive than expected quiz answers. © Janice Regan,

© Janice Regan,

Important Dates © Janice Regan,

Important Dates © Janice Regan,

Assignments  At least two weeks before the due date the assignment will be posted on the website\  Assignments may be completed individually or in groups of 1-3 students  Assignments will be lab exercises illustrating the operation of protocols and problems on material covered in class  Complete solutions to most questions will be posted  Information of proper preparation of assignments and lab problems is available on the class website. © Janice Regan,

Grading Information  Assignments should be:  submitted electronically using the course management system  Bonus points (5%) are available for submitting assignments more than 48 hours early  No late assignments will be accepted  Unofficial grades will be available in the course management system © Janice Regan,

© Janice Regan,

Readings and Notes © Janice Regan,

Academic Honesty © Janice Regan,

Academic Honesty © Janice Regan, Read the policy

Getting Started: 1  You will be required to complete many parts of your assignments using the CSIL networking laboratory  A virtual networking laboratory is now available and is accessible remotely (from Windows and Linux machines)  You will have root access on most of the virtual machines of the networking lab (except routers)  You will be running tasks that should not be run (except by a network administrator) outside the networking lab  You will be informed when the network is ready to use © Janice Regan,

Operating System  In the CSIL labs you will be using computers that run the LINUX operating system  Prepare for your first assignment  In the first week of class familiarize yourself with Linux and writing simple scripts.  You will receive instructions on how to use the virtual networking lab next week, after this you can familiarize yourself with Using ethereal the packet capture software Accessing and using the virtual lab © Janice Regan,

CMPT 471 Networking II Linux Primer Getting Ready to use the Network Lab 25© Janice Regan, 2013

Shell Scripts  A shell script is an executable file containing a series of shell commands. When the shell script is executed the commands in the file are executed in sequence by the shell.  A shell script records a series of command line actions and easily executes them again and again  Assures repeatability of experiments and processes  Allows long series of commands to be easily tested and debugged  There are different shell scripting languages such as  csh (C shell), tcsh  sh (Bourne shell), bash (Bourne again shell)  Perl …… © Janice Regan,

Selecting a Shell Script Language  On the command line type  the name of the shell followed by return to enter the shell.  exit followed by return to leave the shell.  To determine which default shell you are presently using echo $SHELL finger youruserid (your default shell)  The present shell will be indicated by the prompt  To indicate which shell to use inside a shell script  in the first line of your script file#! /bin/csh  To indicate which shell to use when executing a shell script called scriptname  bash scriptname arguments or csh scriptname arguments © Janice Regan,

Executing a Shell Script  Your script file must be executable, you will need to change the permissions to make it executable (discuss how later in this lecture)  Executing a shell script called scriptname  bash scriptname arguments  csh scriptname arguments  source scriptname arguments ./scriptname arguments © Janice Regan,

Using Variables in a script  You can define and use your own variables within a shell script.  VariableName=23 (no spaces around =)  Sets the value of VariableName to 23  echo $VariableName  Echo’s (prints the value of VariableName) to the output line.  VariableName2=$VariableName  Sets the value of VariableName2 to be the value of VariableName1 © Janice Regan,

Printing from a Shell Script  To print to the standard output either use echo or run a shell command that produces output  echo “This is a string” prints the string in the brackets  echo $variablename (also used on command line ) prints the value of the variable with name variablename  echo “The value of variablename is; $variablename” Prints the string ‘The value of variablename is; ” followed by the value of variablename  ls Prints a list of all files in the present directory © Janice Regan,

Command Line Arguments  Passing command line variables into a shell  source scriptname argument1 … argumentn  Inside the script the command line argument values will each have a descriptor, the first argument’s value will be $0, the second argument’s value will be $1 and so on.  The descriptors can be used to represent the command line variables within the script  echo `Second command line variable: $1`  Prints the string “Second command line variable: “ followed by the value of the second command line variable © Janice Regan,

Using Basic Unix Commands  Any basic Unix command can be run from the command line, or from within a shell script  To work with shell scripts you must first be familiar with basic Unix commands  Commands are used to move around within the file system, to create and operate on files, to interact with the operating system © Janice Regan,

Some basic commands  Remember UNIX is case sensitive  yppasswd username (username is optional)  Executed from your command line  Will ask you to input your old password and your new passwd twice  You can only change your own passwd unless you are root  man commandname or info commandname  Tell me how to use the command with name commandname  su  Become the root user (superuser, substitute user)  You will need to be root to complete many of your assignments. Do so with care..  whoami Tell me my username © Janice Regan,

Directories  Directory creation, navigation, removal  mkdir directorynamemake directory directoryname  rmdir directorynameremove empty directory  cd directorypathgo to directory directorypath  ls directorypathlist files in directory directorypath  cdreturn to your home directory  lslist files in this directory  pwdshow path to and name of current directory  cd..Move to the parent directory of this directory (one layer further up the directory tree © Janice Regan,

Directory structure Dir1 Dir5Dir6Dir7 © Janice Regan,  In myhome  cd Dir2 (goes to Dir2 )  cd Dir2/Dir5 (goes to Dir5 )  In Dir5  cd.. (goes to Dir3)  cd../.. Or cd (goes to myhome)  cd../Dir6 (goes to Dir6)  Anywhere cd will take you to myhome (your home directory)  cd / takes you to the root directory myhome Dir2Dir3Dir4

Root file structure © Janice Regan,

Files  To make a file open it using your favorite text editor  mv filepath1 filepath2  Moves (renames) a file or directory  mv a b file previously named a is now named b  mv a../a file a is moved from the present directory to the parent directory of the present directory  rm filepathremoves (deletes) a file  rm a deletes file a from the current directory  rm../a removes file a from the parent of the present directory  grep pattern filepaths  Find all occurrences of pattern in requested files © Janice Regan,

Files  more filename or less filename  Displays contents of file filename one page (screen) at a time  cp filename1 filename2  Make a copy of filename1 with name filename2  cat filename1 filename2 filename3  Will print the contents of each file in sequence Contents of filename1 Contents of filename2 Contents of filename3 © Janice Regan,

Wildcards  Wildcards are used to represent multiple possibilities  * matches any number of characters  ? Matches a single character  Examples  ls a? List all files in the current directory beginning with a and having a name of length 2 characters.  grep mystring */*file Find all occurences of the string “mystring” in all files whose names end with the string “file”. The files ending with string “file” must be in a subdirectory of the present directory  rm [a-c]* Remove all files with filenames beginning with a b or c from the current directory © Janice Regan,

Redirection  Redirect input and/or output  > filename redirect standard output from screen to file. cat file1 file2 file3 > f4 A new file f4 is opened and the contents of file1, file2 and file 3 are successively added to the file f4. If f4 exists it will be overwritten.  < filename take input from file filename a.out < datafile (a.out is the default output file for a compiled executable)  >> filename redirect standard output from screen to file. Appends output to an existing file cat file1 file2 file3 >> f4 The contents of file1 then file2 then file3 will be successively appended to the current contents of f4 © Janice Regan,

Piping  Piping allows you to send the output of one process to become the input of another process without using io to store it in an intermediate file  ls a* | more List the files in the current directory whose names start with a, one page at a time © Janice Regan,

File Permissions  Can use ls –l to find present permission for files  drwxrwxrwxfor directory  -rwxrwxrwxfor file u g o  3 sets of permissions  User (u) group (g) other(o)  Each set allows or disallows read write & or execute  rwx (allow all)  rw- (read write allowed)  r - - (read only)  Order of sets is ugo © Janice Regan,

Setting File Permissions: 1  Permissions can be reset by using chmod  chmod can specify permission in two ways  Numeric values read(4) write(2) execute(1). Sum desired values to give one digit permission value for each set Read write and execute 7, Write 2, Read and Execute 5  Adding or removing particular permissions Add execution permissions for user chmod u+x filename Remove write permissions for other chmod o+w filename Add read permissions for everyone chmod a+r filename © Janice Regan,

File Permissions Examples  chmod u-x filename  (remove owners execute permission)  chmod a+w filename  (make the file readable for all users)  chmod 644 filename  (make the file readable for all users but writeable only by the owner)  chown newowner filename  (you must own the file or be root)  chgroup newgroup filename © Janice Regan,

Processes  Command &  Run command as a background process  cntrlZ  Suspend (temporarily stop) foreground process  bg Move suspended process to background  fg Move background process or suspended process to the foreground  cntrlC  Terminate the foreground process © Janice Regan,

Processes  ps or ps -l  List information about all current processes  kill pidnumber  Kill background process with PID pidnumber  (use ps to find the pidnumber of the process) ps -l F S UID PID PPID C PRI NI ADDR SZ WCHAN TTY TIME CMD 8 S ? 273 ? pts/38 0:01 csh 8 S ? 296 ? pts/38 0:00 bash  To assure a process will die use kill -9 pidnumber © Janice Regan,