Wednesday, October 17, 2007

WIN310W6

Last we talked about was root, cash.dns is the root file,


Type of name server, name server is a dns server, FQDN.

Hello.uk are primary, primary zone on the primary server, is the athorratative zone, only 1 primary dns, but can add as many secondary dns, different physical machine, used for backup, load balancing, save bandwidth and connection time. You can promote the secondary to the primary.

Master name serer, responsible to send updates to secondary, can be primary or a secondary, zone transfers from primary to secondary, SOA has a time time limit, and the primary is also responsible to update the second, these are replicas of the main DNS server, Now who is the master of 2 and 3 it’s the primary, there is flexibility here, 2 can be the master of 3, 3 does not have to know 1 but knows 2, 3 will query 2 for updates while 2 is getting updates from 1. OH YEAH SO 1 to 2 to 3 is 15 minutes, if this occurs every 15 minutes the 2 waits 15 then 3 waits 30,

Caching does not have a database, everytime it resolves something it caches it and resolves it for a specific time, u use it so after u don’t need to maintain and the other for quick resolution, SOA start of authority,

AD every single machine is a cheef, makes it so you can go to every location and do administration, and add a record, the record will be replicated on the other directory servers, every single DNS has control over the zone, how would they know which is the latest up date there is a counter, as the other dns respond they look at the version number and the remainder will be sent which is the updates of the server,

Resource Record, what type can we put in the DNS, pg 74, the ownerm it identifies the resources record and who it belong to, name domain the host, this I s basically the owner, there is TTL time to live the life to it, class Internet class, type of record what we doing mapping name to ip address, mail server to a server,m several types of records we can input, cantains resource data, something with the record that is associated with 32 binary, which is the ip address.

SOA – start of authority, original point of domain or zone, the information in the SOA it shows the authoritative server, this is the server hosting the particular zone of domain, you can create as many as you want to, this is is the guy that will be responsible for everything’s, serial number….every time you manage or update the dns is increases by one so because it haws increased u have to give the updates to the other zones. This is the negotiating item.
DNS PORT 53 UDP FOR THE QUERY
53 TCP FOR THE UPDATE

Name server, DNS server responsible for the zone,
A record is a recourse record, the purpose for the A record is the mapping of the assosiacted IP address. 32 integer. \

PTR – point of record, record of a reverse look up. We say what is the ip address of venus what is the name of the ip, its called venus the planet.ca, we need when we have applications have th resovle the name through ip…..from ip address we grab the name

CNAME or an Alias – mapping of a conanical name to an established name \
Like when we go to Seneca cs = cs.senecac.on.ca

Another example- an ftp server, and the name was, ftp, ftp1.banana.ca it can change to ftp2.banana.ca but when every one is conneting they are connecting by ftp, what they are saying is to make an alias, and redirect it

MX = Mail Exchange pg 77 bottom, is in fact is the server that is willing to host your mail, you can have

10 ns1.mail.yahoo.com
20 “”””””””””
50 “””””””””””

This is the priority in which to send the mail.

SV – service locator pg 79, allow to specify server to application, an example is Active Directory, that relies on the server record, and Also
NetLogon Service, this service carries info from the desktop to the server. For example your user name password and domain name.

Two types of queries, Iterative and Recursive

What is a query, it comes form a resolver or the client looking for some assistan what does he want, please tell me the ip address of this particular host,

Iterative, gives you a refferall, the client is looking for sales.contoso.com, he goes to the dns serer, and the dns server gives him an answer to go the .com or root servers, the client himself goes to the other servers gets the answers where contoso is goes to contoso for a name of sales which is sitting within the domain, and obviously gets the ip address for sales.contoso.com, the client has done the work, who cached the information the client.

Recursive, the priouviously the client have done everything, now the the client submits the query to the local dns, asking him what the ip address of sales.contoso.com, and the client waits for the DNS to do all the chasing.

WINS and DNS are in the same business, they both so resolutions, name resolutions, dns sports car, WINS truck, DNS FULL qualified domain name, DNS does FQDN, WINS NetBios, NetBios are computer names, computer23 or 24, wins is faster, but it only works on Microsoft networks. How do they work?

In the dns point it to WINS..

Look what happens a client wants to do DNS. WINS handles 15 chars, the nature of it.

DNS creates a WINS, DNS will truncate the domain name and leave the ACCOUNTING name, dns gets is from wins, then dns puts back the family name into the Microsoft.com

Four types of response you get from the query,

Positive this is the ip address, an example can be something from the cache,

Authritative main server primary server or secondary server

Referral – Iterative nd Recursive
Negative – Answer it don’t exist

PG 87

Zone Transfer – Notify –

AXFR – FULL – launch a secondary DNS
IXFR = Incremental –

Fires a queryin the soa and looks for a response, tcp

Iterative load on client
Recursive load on some other machine

Conditional forwarding you can add more stuff in it, 2 companies for faster resolution to the specific company……microsoft.123.123.321.333

DCN386W6

TCP – get you’re their correctly provide realibility, the network can move your data through the network which is highly error prone, Routers only know IP,

Tcp is only run in client, passes data in ip and pumps it into the internet and goes through the network at high speed, at the other end there is another server.

You can write software that only uses IP, TCP cannot exist on its own, their no purpose for this.

Some are connection-oriented, and some are connectionless, IP is connection less, TCP is connection oriented, that means TCP establishes a session, to establish a session with another computer probably with a server somewhere in the world, to do this, the Cisco course calls it the three way hand shake, This is the tcp header when you log into the internet and try to create a session, your client machine will send 20 bytes of control information,

Source Port, Destination Port, a port is a number a special number,

Few internet applications HTTP, ftp, IEEE got a lot of application so they gave them a number HTTP:80, Telnet:22, FTP:20:21, these numbers are well known ports.

FTP work with TCP to give you a nice picture, TCP will provide the reliability, the

Destination Port will be 20

Source Port – Random number greater then 1000,m less than 65,000, the server knows theirs a session random 6666 SD, because other people want to log in and it will pick another random number for the other client machine.

Something can happen where they pick the same random number, what will happen in this case it will not work cause the session will be already established

This leads us to the three way handshake, when the client request, the server will send 20 bytes of information, SP DP,

Why this three way thing the client and the serer, are establishing certain factors, they are negotiating the parameters that are going to be used in the session.

Clients initiate session, servers never initiate session

the first 1000 numbers are reserved

For test one, only worry about a couple of things that are being negotiated during the three way handshake.

TCP is viewed as a streaming protocol, it streams data from one computer to the next 1 bytes of a time.

Ftp all it does rid stuff of ur data and pumps it into tcp, and tcp starts to carry the bytes 1 2 3 4 5 bytes, its carrying the bytes cause it doesn’t want to loose any, it wants reliability so it counts the bytes.

The Sequence Number ( 4 bytes long )and the Acknowledgement number (4 bytes) keep tracks of the bytes that are transmitted.

Old days the sequence number would be 1000 bytes and so on, so one of the things that is negotiated when you connect to a server, 1st version started at 1, great for the first years, when the internet what new, when you wanted to hack into someones session, you just had to predict someone was establishing a session, you can muscle in the three way handshake and interfere with the process,
What sequence number are we going to start at?
Now it is a random number something between 0 and 4b, one of the three things a three way hand shake does when you send the tcp header it will pick a random number 0 and 4billion.


So SP 6666 | DP 20| SN 2|

Also another bit called the sync bit, the server will flip SP DP, the client machine will pick an initial sequence number, the sequence number is a count of a number of bytes by the tcp program, tcp counts the number of byes, it don’t matter what internet application it is, every byes it precious, the initial sequence number where it will start counting from, lets say its at 100, and tcp receives 100 bytes from ftp, it going to send 100 bytes, because it started at 100 and sent 100 it will then be 200, the server will do error checking, Checksum, it will send back to you in the Acknowledgement, and it will say it got 200 and the next byte it wants is 201, send another 100 then the SN will be 300 and the ack will be 301.

The first thing tcp doing is both machines establish an initial sequence number, they do this by sending one header, the second thing that happens when sending the three way handshake,both macnhines must have a good approximation on how long it takes to send a packet to eachother, tcp relies on time, a great deal, tcp operation relies on understanding how long it takes to send and to get the reply back, don’t forget the internet data can get lost in here, tcp is more accurate than 4 seconds, when the tcp tries to establish a session it will record time on the systems clock, then it will send the packet and send it back,and it will know when it sent and receives stuff, but eh server must also know that’s why we have the third hand shake, the first and second establish the throughput time rate and the third packet is send, then the server machine knows how long it takes from the client to the server and server to the client, vital for tcp, tcp is a weird protocol, TCP all it wants to know how long does it take to send and receive a response.
(IP puts the data in correct order) tcp counts the bytes, makes sure the sequence and ack are consistent,

Two tings negotiated, is identifying the initial sequence number, making sure both machines know the round trip delay time, establish a session number and a time related to sending a receiving data.

Acknowledgement number, - when you send 1000 bytes the client machine will do error checking it will send 20 bytes and it will say ive received 1000 bytes the ack should be 1001, the next time 2001, the next time it will be 3001


ACK 1 bit – a positive acknowledgement, the ack means a positive ack that means your tcp has done error checking on the data you have received. No such thing as a negative ack. Tcp is the only one that does not have an negative ack. If the server does not get a positive ack it will resend the data to the client.

Window – size – is influences by the operating software that tcp it running in, first big surprised TCP works will the OS you are working with, it influences tcp, How big is the windows size, tcp receives data and it counts the bytes, it has a max bytes it automatically sends it. The max amount of bytes is the window size, its 2 bytes long, what the max value, 64k, fact the bigger the window the window size the easier to hack, Microsoft has 64k, Linux it depends like 1k,
2nd things you have to know, its not fixed its a dynamic number, during the actual transmission of data the window size will change, window can start at 1k increments, tcp is changing the window size dynamically, both tcps will send the 20 bytes with or without data increase or decrease the window says, the number or lack of errors,

CHECK SUM – CRC standard error.

Nothing about the urgent pointer, nothing about the last thing,

Fin 1 bit - the server is sending thing to you , the very last byes by the server the final bit will be turned on

First initial sequence number
2 establishment of round trip time
3rd windows size

Ethernet

What does Ethernet do and How does it work?

Its still evlolving, the IEEE and other groups, its still growing protocol, things Power Over Ethernet…..so many….back to beginning.

Created in Xerox corporations, they invents a NIC using a very simple protocol, they called it Ethernet. The reason this survived, far more technical things like Token Ring, why this dispeared it was so simple and basic it literally cant go wrong, its easy to install, a NIC has this,

Tell him next week
Ethernet also known as 802.3 operates on three basic principles, the first principal is called
Carrier Sensing – listen to the wire,

Ethernet is braod band tech, it means it takes the entire bandwidth of the cable which means only one machine can be sending data at a time, here we got four machines on the network, with one server how does it know its not being used by the network, the NIC has a volt metre, send data to nic it compares to data to be tranmitted the volt metre will test the cable to see electrical activity, if theirs zero volts then the network is free, so the nic takes the data sends it, data is not sent until until the network is free, CS,

The second attribute is something calle Multiple Access, fancy way of saying at any point in the network you can install work stations, and it will work admidately, every NIC has a unique MAC address, IEEE will give you a manufactures code number, each NIC has hardwired address the the first three bytes the company, the last three is a sequence number, all nics have different addresses, you can simply attach workstations and they are operational

The third attribute of Ethernet is Collision Detection, it’s a very simple thing, bad form of connection control,

One machine access 1 some 9, both test the line at the same time and both realize the network is idle, they do it at the same time, this results in the two machines building the thernet frame and sending it out, what happens the pulses will destroy eachother, the more machines the more collisions, Ethernet knows it happens Ethernet has a strategy, any machine, the server detects nasty pulses any machine, the NICS are constantly doing this, any machine on the network that discovers a collision sends a very special frequency like a squeal, a jamming signal, to every machine on the network. Both machines retransmit but not at the same time, this is the smart trick, when collisions happen they wait a random amount of time,

The Nic builds the Ethernet frame, the os sends data to the NIC the NIC builds the fram out of your data what does the frame look like, NIC a little bit of memory, what does the frame look like, it will take yuour data and break it up into segments, packets, how big is an Ethernet frame

All protocols segment and reassemble ur data, takes your data and breaks it into frames, the max size of the frame is 1500bytes, breaks data into units called bytes infront of the 1500 bytes its puts header information the
Source Address is the Mac Address 6 bytes long, three bytes man three ,
DA also six bytes, in theirs
2 bytes that can be confusing, is the length of the data.

The IEEE stepped in and all LAN to work together and standardized things and made a change to Ethernet its going to be Type Field.

NOVEL oracle data is a type, apple talk a type, all modern NICs have a type field.

IEEE first couple of bytes indicate length

The front 64 bit preamble 10101010101010101010101010,, used the sync transmission of the frame every frame establishes sync through preamble.

Last piece of into 4 bytes, very effiecent error checking CRC or FCS,

Some equipment such as switches actually do error checking, but there is no provision in Ethernet for handeling erros, NICS and switches do error checking but if there is an error dump the frame, there is nothing in the header for re-transmit the packet.

Ethernet is a delivery boy it relies on high layer protocols to handel any errors, designed for speed.

After reading week CS changes to CA, when u get to gig connection.


Theirs a min for data which is 46 bytes, it will pad the rest of the bytes if its smaller then 46 bytes.

OPS335W6

Lab 5 is due two weeks from tomorrow, Thursday before midnight, this is the break week its due.

Dealing with directories on unix and linux, we have a problem with size or space, this is is the old way on how to do this

A hard drive sda, you have three partitions, sda1, sda2, sda3, you could have had swap, /boot, /, 500, 300, 5g, we are looking at the sda3 5g it is the root partition is contains a file system, so he has the root directory he has /etc /usr /lib, after we format is its ext3 file system, its taking up the whole 5 gigs, take sup all the space in the container.

Mkfs –t ext3 /dev/sda3
In rescue mode you can format it,

We have a physical partitions and inside th partition we have a filing system, what happens when it gets full, In the old days you would go into fdisk /dev/sda, in fdisk you would d 3, its gone, your just deleting the partition table, not the fs out their, the new 3 now its gone, then you would put 6 gig then you would put write if you were to reboot the system you would still have the fs in their but its not using the full 6 but the 5, after that you reboot, you do the df command you see the root partition is 5g, you can now resize2fs /dev/sda3 , made for ext2/3 fs, when you resize this you are getting more space put into the filing system.

1.fdisk /dev/sda
D3
N3
6gb
W
2.reboot
Df
Resize2fs /dev/sda3

Expand your filing system to use the whole partition.
You can also resize it down, to make it smaller
1.resize2fs
Smaller
-3g

2.fdisk
Shrink partition
D3
N3
3gb

^^ this is an old method that is obsolete



Logical Volume Management Lab5
Take your home directory and make is into a logical volume,

Sda
1
2
3
Make 4 – extended partition, inside four make 5 and 6

You can take sda5 and sda6
1g 2g ----physical partitions
You can combine them into one volume group, called Seneca. 1 VOLUME GROUP
Seneca Represents 3g cause its 1 and 2, now that youhave a

VG you can make Logical Partitions,

Make 3g home , how to make this larger you can throw another drive in, sdb1 and sdb2, partition it with fdisk, you can add sdab1 into Seneca, you can –add the physical partition in the volume group and extend home 10g, this is done live.

You can use the home (logical volume) as a partition.



Going over the Lab,

First command 5 6 unused
Physical volume create
Pvcreate

Volume group create

OPS435W7 Review

OPS435 Review for Test 1

0090
1016

If you r a linux administrator, so you will have many tasks to perform and going, for instance we would be doing back ups when your doing a weekly backup what time would you choose to do the backup, middle of the night on the weekend, you use the chron deamon to schedule your job, three items to make this up chron d, it’s a utility that always runs in the background, it continuously going and looks for certain files, and if it finds any jobs ready to be executed it will process the job, the files names it looks into are called /etc/chrontab every user that allowed to use it has their own chron file,the chron deamon looks into top this how do you create one of the files, you use a command called chron tab, and is located /usr/bin/chrontab…..bin stands for binary, chron tab and chrontab file, this is the command you use to edit this file and once you have this file the crond looks into the file to get the jobs done, some of the other items associated to this is /var/spool/cron/allow, the admin is allowed to use the chrontab file, no one else is allowed to do that, but if the superuser wants to allow other people you go into the chrontab to add the users to use the file to do the jobs, theirs also another file called /var/spool/cron/deny this is your not allowed to do it, you can only use one of these files.

/etc/chrontab files contain the jobs,

The other files on the slide are used by the deamon,

How do you set up a job to be run, the information you put in the chron tab file, has to have a certain format, that’s how the deamon what you are suppose to do, this file contains 6 fields, minute, hour, date, month, day, command string, you can have the month in numerical or three letter format, small letters or capital letters or in cap followed by small, only in these three types

Day of the week, you again can specify it in numeric or text, it works like this, 0-6, 0=Sunday, some can be 0-7 which 7 can be Sunday, always use zero.

The last and 6th field is the command itself, what you want to do at that time, lets say we want to do a backup and we want it done at 2:38 on a Sunday morning, on the first 10th 20 and 30 of the month and the month is October, day of the week either Sat or Sun

38 2 10,20,30 10,OCT 6,Sun /bin/backup

Couple of special chars that are used in the chron tab file, lets say any month, how do you normal say everything, if you put a * where the month is it will be anything, another one is / its not a divider but a repeater.


Also lets say when you do any linux command stn output and stn error, you are going to be doing this 2:30 in the morning are you going ot be their no so you wouldn’t want it going on the screen, the default location, where would you like it to go, somewhere where you wanna see it immediately, stnout and stnerror goes to mail, so matter where you are you are going to get it by mail, if you want it to go somewhere else you redirect it to somewhere else, you redirect it from mail to go anywhere else. The default is mail.

• every minute of every hour of every month of every weekday
• * * * * * * who | grep ‘^evil ’

Run a script every odd hour
0 ½ * * 1-5 /home/bob/script

The chrong tab is created by the chrontab command if you execute this command
Chrontab
-e = edit
Take the contents of the file and put it in a vi buffer, by using vi you can makes changes if you don’t have it, it will open a new buffer in vi and you can enter in commands, and when you finish :wq once you do this, it will take a look at what you have done, and if any mistakes where their it will tell you line so and so and do you want to go back and edit, you say yes and you can go back and edit it. Only when u have everything correct it will accept it and save it in to the chron tab file

-r = delete or remove
-l = inside the file, list the contents of the file
-u [ username ]= only used by the super user can do anything to anything to anyone’s chron tab file

23-7/2
11 at night to 7 in the morning then
Every two after aftwareds

8 PAGES wrong, half multiple choice, 20 q for 20 marks

2nd part shell basics, it will contain, the 9 steps of the shell, all the special chars its looking for, you should know all the special chars of the shell interprets the one that we have covered also

Variables mix and matrch and do anything

Commands and utilities, do something then figure out what commands you put together to accomplish the objective,

Even a bonus, a couple,

The only difference between this, the other questions part marks, the bonus no part marks they work or not

Interpret the script run it and what you see on the screen.
For a total of 70 marks + 5 bonus marks


CUT –F 1-6 a*b* c?t

$0 – positional character, the file ur running
$? – exit status of last command
&& - if $? Is 0 then it is successful then go on
|| - other way around $? Is 1 then go on
“ $ ‘ \ “

\ = single character quote the char following me is not a special char
Echo ààà
Echo $(a) erroràà

Tr [A-Z] [a-z] | tr –d ‘.,’ > b

Tr “” “\n” < a

Tr “ “ “\n” < a |tail -2|head -1

Walk through keep track of all the variable contents, the vars will change, and if you don’t keep track you will loose what the values were, when you do walk through, in pencil and pen do all the variable contents as you go through each command and number 2 you have to know your commands, you will have to interpret the commands review commands and keep track of all the values,

OPS435W5

We use the test command in anything we do, you can test for values and different conditions and decide if its successful then if its not you can do something else, for instance if you look at you rassignment when your doing verification, and even after wards you see if its this or this, or something else, you need the test command in order to test the conditions you are looking for, looking at the

Test Command

Test command test for vgalues how this value compares to this value,

A=3 B=5
Test $a = $b

Two operators the = compares values in their ASCII values


Symbol versus text,


This is where a lot mistakes are made

$?
2 – failed
0 – not successful
1 – successful

-o equals OR

-a and

[ $a –eq $b –o $a –lt 20 –a $b –le 0 ]

The and is done first before the or
Either this is true or this is true

Another version of the test command

[[ $a –eq ]]

The difference between [[]] and []

[[]] can use wild characters * ? ‘ ‘ can use any one of these, while the single brackets cannot

Flow charting to design a program, a map to get their, tell you what to do to accomplish ur project, it takes a large program and breaks it up into small pieces,


/dev/null the garbage bin of linux

Case will try to match patterns against the constants of the variable, the case statement will test for a string in pattern 1, you will have a pattern 1 it will try to match the pattern with the contents of the variable if its true then it will execute the commands under that pattern then it will go t esac (case spelled backwards, closes case) if it doesn’t matches it will go to the next patterns.


The case is looking for a special char wich its closing parenthesis

Case $var in

2[0-6]) ____________;;

T*)
;;

*)
;;

esac
Case can you file name expansion wild chars *? []

Matching 20 – 26 if it has a match it will match and go through the commands
2nd case T*
3rd case * .


How does the case statement know that it will end after the case stement an dyou have to tell it you must add ;;
\

Cat <<++

<< special meaning a hear document, they are saying we have a document that has data in it and the hear document says to the command here is your data, it allows you to provide data to the command inside the program, it can be provide within the program itself, by using a hear document,

you also have to tell the command where the document starts and where it ends, he has a ++ but it can be any pattern that you which, but what every you use you have to tell this is the end,


cat <<++

Main Menu
1. 232
2. 2.432
3. 453
4. Please enter your selection

++

Read banana

Any command at the top it don’t have to be a cat

x|X the pipe in the case statement is an or, you can check for multiple patterns it doesn’t have to be one pattern

case Zodiac sign, u can use it in the day of the week