Computer communications
Download
Report
Transcript Computer communications
Computer Communications
Dr. Jim Martin
[email protected]
Copyright 2007 Jim Martin
1
Data Communications
Modem
routers
Internet Explorer,
FireFox
www.usatoday.com
Access Link:
Dialup, DSL,
Cable
Links
Copyright 2007 Jim Martin
2
Data Communications
1.
2.
3.
4.
How does a computer send data to
another computer?
They need a physical connection (called a link).
Data is encoded and transmitted as energy.
Energy is decoded at the destination back into data.
Each form of energy has different properties which explains why some
connections are high speed and other connections are slow
Copyright 2007 Jim Martin
3
Data Communications
Simplest approach - use varying voltages to
represent 1s and 0s
One common encoding use negative voltage for 1
and positive voltage for 0
In following figure, transmitter puts positive voltage
on line for 0 and negative voltage on line for 1
Copyright 2007 Jim Martin
4
Back to the binary number
system
Let’s say one computer transmits the
message ‘hello’ to another computer.
Each letter is mapped to a unique number in
the range of 0 to 255. The mapping is called
the ascii character set:
Decimal Character
Decimal Character
Decimal Character
48
49
50
65
66
A
B
97
98
Z
122
57
….
0
1
2
9
90
….
Copyright 2007 Jim Martin
….
a
b
z
5
Back to binary
When ‘hello’ gets sent, the following decimal
numbers are sent: 104 101 108 108 109
We have now seen the message ‘hello’ in two
formats: ascii and decimal
Remember what decimal format means:
A decimal number is a number (e.g., 104) that has a number
of digits with the value of each digit ranging from 0 to 9.
Each digit represents some number of 1’s, 10’s, 100’s , …
Example: 104 in decimal:
(1 * 100) + (0 * 10) + (4 * 1) = 104
Copyright 2007 Jim Martin
6
Back to the binary number
system
Binary numbers are a number system made up of 0's and 1's.
In base-10, the weight of each digit is based on 10EXP#digit
Digit#
The magnitude of the first 8 places in binary notation are given by 2EXPdigit#
(i.e., a base-2 number system and the digits are referred to as bits):
Bit#
Example:
7 6 5 4 3 2 1 0
128 64 32 16 8 4 2 1
The number 10 interpreted in decimal is (1 * 10) + (0 * 1) = 10 (in decimal)
The number 10 interpreted in binary is (1 * 2) + (0 * 1) = 2 (in decimal)
Example
3 2 1 0
1000 100 10 1
The number 13 in decimal is (1 * 10) + (3 * 1) = 13 (in decimal)
The number 13 in binary does not exist. Digits must by 1’s and 0’s
To convert the decimal number 13 to binary: (1 * 8) + (1 * 4) + (1 * 2) + (1 * 1) =
13
More examples of converting between binary and decimal systems:
0x00000010 = 2 in decimal
0x00000100 = 8 in decimal
0x10000010 = 130 in decimal
Copyright 2007 Jim Martin
0x11111111 = 255 in decimal
7
Data sent ‘over the wire’
The ascii message : hello
In ascii format: hello
In decimal format : 104
In binary format: 1101000
101
1100101
108
108
109
1101100 1101100 1101101
Each character requires 8 bits
hello
hello
1101101 1101100 1101100 1100101 1101000
The most significant bit of the last
character (the ‘o’) is the last bit that is
sent and the last bit that is received
The least significant bit of the first
character of the message is the first bit
that is sent and the first bit that is
received
Copyright 2007 Jim Martin
8
Data Calculations
Each ascii character is a byte.
A file that contains one million characters (letters, spaces,
punctuation) would be 1,000,000 bytes large.
If the hard drive in your computer can hold 1 Gigabyte of data,
how many files (of 1,000,000 bytes) store ?
Copyright 2007 Jim Martin
9
Data Calculations
Each ascii character is a byte.
A file that contains one million characters (letters, spaces,
punctuation) would be 1,000,000 bytes large.
If the hard drive in your computer can hold 1 Gigabyte of data,
how many files (of 1,000,000 bytes) store ?
Answer:
1000000000 / 1000000 = 1000 files
Copyright 2007 Jim Martin
10
Data Calculations
Let’s say you send a 1,000,000 byte file to another computer.
Your computer connects via some access connection to the
Internet.
How long does it take to transmit a 1,000,000 byte file over just
your access link?
Will SEND 1,000,000 byte file
Will receive 1,000,000 byte file
Internet
Access Link:
Dialup, DSL,
Cable
Copyright 2007 Jim Martin
11
Data Calculations
An access link can send 56,000 bits per second
How many bits in the file:
1,000,000 * 8 = 8,000,000 bits
How long does it take to send 8,000,000 bits over the link?
8,000,000 bits / 56,000 bits/second = 142.8 seconds
Will SEND 1,000,000 byte file
Will receive 1,000,000 byte file
Internet
Access Link:
Dialup, DSL,
Cable
Copyright 2007 Jim Martin
12
Data Calculations
How long does it take to send a 4.4 Gbyte DVD ?
Copyright 2007 Jim Martin
13
Data Calculations
How long does it take to send a 4.4 Gbyte DVD ?
(4,400,000,000 * 8) bits / 56,000 bits/second =
628,571.4 seconds
Which is
628,571.4 / 60 = 10476.2 minutes
Which is
10477.2 / 60 = 174.6 hours
Copyright 2007 Jim Martin
14