Sunday, September 30, 2007

OPS435 W4L2

OPS435

Chinese year doesn’t start on January 1, calendar based on the lunar, ours on the solar, instead of making it difficult u can assume January 1st to December 31st, each year has an animal assigned to the year, that’s number two, the year they enter the proper animal number three you gotta tell the user what day of the week their born in number four how many days in the 21st century they have seen it starts January 1st 2001, they can give you it two ways

Age.bash and give you the birthday
They can also give you without a document,
Age.bash
The very first thing in your assignment is to find out the user entered data in the command line or not, if they didn’t enter data on the command, then you ask the user for the data, so you the data form the command line ro from the keyboard, depending on what, you must check it first, the messages on the script should be a standard error not a standard output, number 2 is, because no loops you don’t have to put it in a loop, stage 2 has to be in a loop, you must stay in the loop till the data is correct then you can come out in the loop and take the data, but stage 1 no loop, see if the data entered is eight chars long, if its not display message on sheet, check if they gave you a valid date, compare it with the cal command, check if its not a future date, and if it is you tell em what they entered.


The rest of it!

Calculate years and age in full months in instance if one of you

September 19 1990, today he is sixteen , must be a full year before your 17, same thing happens with months that’s why you must figure out months, for instance if you go from may 12 jun 12 full month, may 12 june 11 not a full month, that’s what he means by full months

No exit or clear command in the program, do not use the –p option with the read command,

Read –p message variable, what he is saying don’t use the –p option with the read command in this project, an example of what he wants exactly on the screen.

A couple of other things about the assignment, comments through out,


Another command we might use,
When you do calculations (()) heres a warning when you use the (()) not only does arthimetic expression, also checks to see if ur doing decimal or octal, if it does the octal will do octal calucations or decimal, the moment it sees a number with a zero its an octal number 07 + 09 u will get an error, octal 0-7 deciam l 0-9, the numbers ur using cannot start with a zero that way it sees its decimal so it will do decimal calculation.

Another command to do this (calculations)

Expr only does decimals if you say 7 + 09

Expr 7 + 09
With this command u must have it exactly the way it should be, lets say you want to multiply contents of variable A by 20 $a + 20 that will fail , + is a special char and go into correct directory and replace it with all the names, how do you prevent the shell from interpreting this you put a \ in front and it will work, and all the other operators apply to this command as well, this command does a lot as well, but only the arithmetic part of this command.

Cal 02 1971 | grep

Cal 02 1971 | grep –w 2

Test command checks things, coming week lots of stuff on

Conditional parameters

Date +%S time frame

The moment you hit the key board

January 1st 2001 until today

Cal –j how many days

Today is 2007 09 28

Lets say we have 2000 10 29

DCN386 W4L2

DCN386

The more protocols you know the more money you make, 100’s Data Communication Protocols,

How do they figure out to do this that is why we got a hand out, the little hand out is talking about protocols in general its offereing you a template a frame work where we can understand protocols, we have a short list of 8-9 things theses what protocols do, lets say their 10 protocol questions you can use this to help you understand protocols, all protocols have rules, more then rules, all protocols, segment and reassemble data, lets say questions 1
How ip work?
Tell him how ip segment data
How tcp do?
How tcp segments data
What does Segments and reassemble?
Break it and put it apart

All data breaks into data, packets, frames, segments

Why do they do this?

These Error Control, think of two computers ….one computer has a file fu.txt you want to move it to one computer to the next, you can write a program put it in one file in giant message and send it, it would be stupid, why? Because of errors, take it and break it down into little Ethernet Segments data, if your sending it through the network card it will take the data and send frames and the maximum size is 1500 bytes, when data is receive at the destination each little segment must be put back together again, segmentation and reassembling, understand how much data is it sending, think why did they make the frame side so small, the likely hood of problems is good do they deliberately send, we are going to look at IP

IP was created in such a way it can send big frames up to 64000 thousand bytes, weird, lets move on

All protocols , the 100’s of datacom protocols they rely on the ability to work with other protocols for example TCP/IP that is two different protocols but must be used together on the internet, whwne a protocol uses another proctocol you would say the protocols is encapsulating the other protocol

It means on protocol is relying on a higher level protocol to operate this is an important thought, the osi model gives a briallant glimps of this protocol of encapsulation, briefly run over this

Computer 1 and Computer 2….connect them up.

Applications as tools that software uses, that start the process of moving data, lets say we \got together created using C++ our new brand new e-mail program, state ur e-mail can work with all the other programs its possible for a guy to send it on Mac to OS, how does this work, it works because e-mail programs use a appliucation layer standard X-400, X-500, email directory service 500, if we wrote an email called ERog our mail program will interact directly with the application program and we would put a little piece ofd data and infront of it indicate its an x400 identifying a piece of data, so far no encapsulation happened, e-mail programs going to pass it to the presentation, has code conversion, UNICODE, UNICODE most important standard in our futures imergins standarnd that will be used by all software producat over the world, some people that know Unicode will be valuable Unicode, now we use ASCII you can have 256 chars, UNICODE allows every language UNICODE will allow different languages, ASCII to Unicode conversions, we pass is down to the, presentation encapsulated the application layer, what happens next what is a sessions, your bank card, as soon as you put it in the bank machine you are initiating a session, first thing will send a signal to the banks head office, says some guy wants to start a session, now you get a session #, everything you do is recorded, they send it using lower layer protocols, they subtract 100 from your account and the machine will spit the money, what happens, you don’t get ur 100 bucks go into the branch talk to manager and u tell them your problem, the assistant manage will check the session layer software and see that u wanted 100 but u didn’t get it , sessions are kinda important, the point is session layer encapsulates to presentation layer which encapsulates the application layer, then passes it to the transport layer, there are transport layer software, TCP and VTAM, the purpose of the transport layer to organise the end to end transmission, and there is realiability, it provides reliability, think reliability, the point is it will encapsulate sessions layer stuff and infront of it will put TCP control information, then is passed down to the network layer software will encapsulate the TCP layer, give me an example of a network layer protocol, the INTERNET PROTOCOL, IP takes the entire tcp unit and encapsulate that unit and puts its own control information in the front, IP can take a packet of into and route it anywhere in the world, IP does not know how to get out of a computer, once its out it will bounce from router to router, doesn’t have the smarts to get out of your computer, so it passes down to the next layer IP packet, Ethernet does one thing allows data to escape from your computer and passes it would to the NIC card and NIC gets it out of the computer, it takes the entire ip packet and encapsulates it by putting Ethernet control information infront of the whole thing, the whole packet will make it to router, remember doing the lab connecting Ethernet between one workstation to the next , to encapsulate the ip PACKET AND PUT IT OT THE NETWORK, Encapsulation. All protocols work with other procotocols work with other called encapsulation, they use
CONNECTION Control what does this mean?

The Bank Network, Bank branch 2 bank machines, two look for 100 bucks and both type it and both his enter exactly the same time, because bank running SDP Synchrouns Data LINK SDLC uses a system called Pully so theirs no collision, does Ethernet have Connection Control, it has sort of connection, not that good, Ethernet connection control technique to examine the line if theirs no data then send it, but they can do it simultaneously, Ethernet connection control strategy is identify when collision happen and offer a solution to do this, Banking Networks never want mix ups, their to important so they use a different connection control

When you tell him about the protocols?

How serverl protocols handel connection control

All protocols think about wether or not to worry about delievery, SDLC will never have this problem it’s a datalinkprotocol, how every Network Protocols have to woorrry about delievery,


You run ip and ip breaks data into segments because all protocols into segments, send the little pieces into the internet, some pieces will go many different ways, how does IP put it together again to put it together, its going to remote them buffer

When you talk about a Network Layer Protocol?
Hwo does it gurentee ordered delivery, what is flow control

Flow control any attempt made by a datacom protocol that it is

When you buy routers, commercial routers you buy them and should be away how many packets persecond the router can handel,
Two routers, that can handel 5000 packets persecond, what we are going to buy three commercial router and buy 5000 packets persecond what if both router one and router two send 5000 packets persecond to router three, what ip solution to flow control?

Ip like Ethernet has sort of a strategy, it is to dump the packets period, IP is connetion less protocol, no flow control strategy then dumping packets, unreliable but we use it NO FLOW CONTROL HERE,

Error Control, Checking and Hendeling Error, we talking about CRC, most protocols almost all use this to test for Errors, this can happen it 2 3 4 layers, CRC is the most advanced way,

Other protocols will rather die then dump data, when looking at this how do they handel errors

Addressing, You send an e-mail out of computer, several,

Ip where does it look like where does it comfrom?

The only protocol with multiplexing is TCP and we will talk about this next week, remind TCP is a multiplexing protocol.



How does IP work??

What is IPs jjob?
All protocols have a job, IP has one job, to take tcp data and move it through a packet switch network at the highest speed possible, IP’s only job, TCP data, and pump it through a packet switch network

What is this packet switch?

Packets with network layer protocol, ip is one, IP is a packet switching protocol, Now if you met IP at a party it will introduce itself, Fast and Totally unreliable, for a protocol to be reliablt it has to do things like flow control and error checking, doesn’t do this cause it slows things down, it dumps packets, it does that because it wants to be fast, how does it work, header information,
IP has 20 bytes of control information in its header, when you want to understanding a protocol by examining control information in the header field cause that how it works

Lets look at the pieces of information

Version, its 4 bits long, 0100, identical, soon ull get an email from your isp[, and it will be ip version six, 0110, the version of ip…..

Header Length, 4 bits, for test one no options, don’t worry about these first two….

Type of Service, 8 bits, how old is ip, routers ignored TOS all of a sudden its become important, what changed on the net, VoIp, to make this possible routers have to allow priority to voice packets, as apose to data packets. QOS in TOS, the 8 bits allow routers to proritize different packets,

The way they work, data comes through the serial port, routers will temporarly store packets in memory, the first packet in will be the first packet sent it, now theirs a higher type of service value and will be send out first

Test 1, TOS can provide priority function, Routers use to more important data.

Total Length, Segmentation And Reassembly, 2 bytes, max size 64k big packet size, big segment size, most ip packets are smaller,

All protocols fragment data, IP can break it to 64k it still has to reassemble the data, because it makes an attempt at ordered delivery.
1.2
Routers hate big frames, ip builds big fram sends it out to router, ip the same software, also runs in routers, ip and router however will take the big frame and break it into pieces, break it into three pieces, heres the problem, only the first piece have the control into, takes three pieces and copies the header information, the receive computer has to know how to put them together, how it generates a random number 64k,

Identification Field , 16 bits, if a router breaks it into three, each piece will have the same identification, so a computer that receives packets knows these three packets thoug be joined together, but how to join em together, it doesn’t know the order, but it does routers, the put a value in each packets header called

Fragment Offset like a sequence number but not quite, it offsets, 0-1500, 1500-1500,1500-3000, computer puts it in memory, the first packet offset of 0 memory location 0, the 1500 packet third offset of 15000, place it in memory by offset value,

Router analyzes how it broke it up and the fragment offset, to put it all together in the, have a default value

MTU Maximum Transmission unit, mtu 1500 bytes, its default value, why do you think CISCO made it 1500, cisco realized all data will be broken up to 1500 bytes by Ethernet,

Flags, 3 bits only 2 used, one of the bits are intresting the middle bit if its zero that means, that 0 first 0 second 1 third last fragment.

Time to Live, The internet is a network of 100s 10000000000s routers they understand Source address and Destination address, how about if you put one that didn’t exist, a value is places in here 8bit from 0 to 255, default is used is 32 anywhere in the world default.

Protocol Field what higher level protocol is handeling , Two protocols UDP TCP , Network Layer, UDP data Ip knows by looking in the code3 to deliover the data to UDP,

Header Checksum, hold fashion name for CRC, error checking thing, does error checking not handling, this is all ip does as far as IP,

All left elobrate addressing scheme it offers, a Source Address and Destination Address and each 4 bytes long, each address, made by an network identifier and a machine

Network ID and Host ID

Subnetting an IP address,