Upload
blaise-price
View
212
Download
0
Embed Size (px)
Citation preview
CS 101 – Nov. 20
Communication, continued (Ch. 15)
• Cryptography– examples
• Error detection
• Local Area Networks– Different ways to hook up machines
Encryption examples
• Caesar cipher √
• Cryptogram
• One-time Pad & Japanese Naval Codes– Dictionary table– Additive table– Destroy each page as you use it
Breaking codes
• Like solving a cryptogram
• Distribution of letters (‘e’ versus ‘q’)
• Digraphs, trigraphs
• Common words
• Eric Nave’s “Betrayal at Pearl Harbor”
Errors in transmission
• Random flipping of bits
• Prepare by using parity bit– Add 9th bit to each byte– Goal is that each byte has even # of 1’s– Receiver checks each byte
– Doesn’t solve every error!
Local Area Networks
• Sharing resources in a lab– File server– Printer
• Communication based on topology– point-to-point – star – bus (like speaking at dinner table)– ring (need token to send message)
Bus topology
• All machines share the same channel
• All continuously listening
• “Ethernet” protocol (dinner table)– don’t talk when someone else is talking– collisions
• Amplify signal with repeaters
Token ring
• Fast messaging over larger distances
• Logically arranged in loop
• Messaging: Token passed around the ring.– Am I busy?– From– To– message
Token action
• When you receive token:
• Is the message for me?– If so, read and change to ack.– If not, just pass token.
• Do I need token?– Wait until it comes back as not “busy”
Example
• 4 machines: A, B, C, D.
• A has message for C.– When A gets token, writes message for C.– B passes token.– C receives msg, sends ack message to A.– D passes token.– A receives ack, clears token. …
Example #2
• We have 4 machines A, B, C, D.• What happens when…
– Token starts at D.– A has a message for C.– C has a message for A.– B has a message for D.
…………………………………………