CS 422
Monday 8/28/00
Standards for Communication
-
ITU--International Telecommunications Union
-
EIA--Electronic Industries Association
-
IEEE--Institute of Electric and Electronic Engineers
Example of a Network Standard
RS232c
-
Also called a serial line or tty line.
-
It was used to connect terminals to computers. It's now used to connect
the mouse and keyboard.
-
Specified by the EIA--simple standard for the transmission of characters.
-
It's called serial because characters are sent one after the other.
-
Communication is "asynchronous" because the transmitter and receiver do
not co-ordinate before the transmission of a character. i.e. -- the
receiver doesn't know when a character will arrive.
VOLTS
-
+15 volts = 0
-
- 15 volts = 1
-
When line is idle, the level is always -15 volts -- i.e. 1
-
A start bit (zero) is used to tell the receiver that a character is on
its way.
-
The sender and receiver must agree on the number of bits per character
(7) or (8) and the must agree on the duration of each bit (T)
-
If there's disagreement in the format of the message, the receiver gets
a "frame error"
-
Typical speeds are 9.6Kbps, 14.4Kbps, 28.8Kbps, 56.6Kbps.
-
Serial lines are usually "full duplex" meaning that both ends can send
AND receive data. (In contrast to half duplex, which is just one
way--one end transmits and the other receives.
-
Serial lines need at least three cables
Problems With Electronic Transmission
Serial lines are:
-
Limited to about 50 feet, so they are not for long
distance because the resistance of the cable decreases the signal as it
travels.
-
Capacitance and inductance of cable distorts signal.
-
Magnetic and electrical interference also distorts
signal.
-
RS232 deals with this problem by having a voltage
threshold less than 15 volts and by taking multiple samples.
-
Direct current, like the one used by RS232 can't
be used for long distances.
-
For long distance communication it is necessary to
encode the signal in a sin wave (also called a carrier wave)
-
Some of the properties of the signal are changed
(modulated) to encode the information.
-
This technique is also used by TV and radio
Wednesday 8/30/00
Information on Lab 2
-
Snoop--A way to get packets onto the network and
to see what the raw packets are. Only the root can run this.
-
With our lab we can snoop packets on the private
network using a wrapper
-
Generate different packets in the private network
and capture them. Then save the packets into a file.
-
Write a program to decode the packets and write the
header information. Packets are stored in a file.
-
Types of ethernet packets are: IP, TCP, UDP, ARP,
ICMP
-
To run: %> analyse <packetfile>
-
function to decode packets:
While there are packets in file do
{
Read packet
If packet is ARP print ARP header
Else if packet is IP do
{
Print IP header
If Packet is TCP
Print TCP header
Else if packet is UDP
Print UDP header
Else if packet is ICMP
Print ICMP header
} // end elseif
} // end while
-
How do you know a packet is ARP or IP?
-
How do you know if the packet is TCP, UDP, ICMP?
-
Decode IP packet. IP packet is
in the ethernet packet data area.
-
How do you place a packet header in the data area
struct
ehdr{
unsigned char sdt[6];
unsigned char src[6];
unsigned short type;
unsigned char data[1];
} // end struct
e =
(struct ehdr*) buffer;
//
you can access e->type
//
to decode IP header:
struct
iphdr* ip;
i
= (struct iphdr*e)->data;
-
Use ntohl() or ntohs() to convert long and shorts
from network byte order to host byte order
Type of Modulation
-
Amplitude Modulation -- Amplitude or signal encodes
0 or 1
-
Frequency Modulation -- Data is encoded in changes
in frequency
-
Phase Shift Modulation -- Phase change in the signal
determines the data. Data is encoded in the phase shifts, thus pi/4 = 00,
pi/2 = 01, (3/2)pi = 10, pi = 11
Modems
-
A hardware device used for long distance communication.
-
A modem has a MODulator and a DEModulator -- thus
called a MODEM.
-
Modems are most common for telephone lines but other
types of modems also exist.
-
Modem types
-
Conventional--Electrical signals, 4 copper wires
-
Optical--Light/optical fibre
-
Wireless--Air/RF waves
-
Dialup--Telephone system, modulated audio tones.
-
Other functions for a dialup modem
Friday 9/1/00
Definitions
-
Propagation Delay--Time required for a signal to travel across medium
-
Bandwidth -- Max times per second that a signal can change
-
Throughput--Number of bits per second that can be transmitted. It
is related to the hardware bandwidth, thus higher bandwidth = higher throughput
Nyquist Theorem
-
Relates network bandwidth and throughput
-
D = 2B lgK
-
Where
-
D = throughput (max)
-
B = bandwidth
-
K = # of values that encode data
-
Example
For
RS232
K = 2 (because it can be +15 or -15)
So,
D = 2B lg2 ===> 2B, so 2 times the bandwidth
For
Phase Shift Encoding
Assume K=4 (4 possible shifts)
So, D = 2B lg4 ===> 4B, so 4 times the bandwidth
-
Why not just make K = infinity?
-
Nyquist theorem does not consider noise, therefore in only gets a
maximum theoretical limit
Shannon's Theorem
-
C = B lg (1 + (S/N))
-
Where
-
C = throughput (capacity) in bits/sec
-
B = hardware bandwidth
-
S = power of the signal in watts
-
N = power of the noise in watts
-
S/N = signal to noise ratio
-
If N=0 then C can grow to infinity, but N never is zero.
-
Example
Telephone system
Bandwidth: 3000hz
Typical S/N ratio = 1000
C = 3000 lg (1 + 1000) ==> 30,000bps
-
With S/N ratio = 1000, there is little hope to accomplish more than 30
Kbps
-
So, why do we have 56Kbps modems?
-
56Kbps modems have this speed only with good quality telephone lines with
larger S/N ratios and if they also use compression.
-
S/N is usually given in decibels (dB)
-
Convert S/N in dB = 10 log S/N
-
Example
S/N = 1000
S/N in decibels = 10 log 1000 ===> 30 dB
S/N = 20dB
20 = 10 log S/N ===> 100
-
Conclusion
-
Nyquist Theorem implies that we could increase throughput by finding new
ways to encode more bits per cycle
-
Shannon's Theorem implies that no amount of clever encoding can overcome
the limit of real transmission lines with noise.
Multiplexing
-
Using a signal channel to transmit separate sources of information
-
Multiplexing needs to prevent interference among signals.
-
Multiplexer--accepts data from different sources and combines them to send
them through a shared channel.
-
Demultiplexer--receives the combined data and extracts the data that corresponds
to each destination.
-
Two kinds of multiplexing:
-
Time division multiplexing (TDM)
-
Frequency division multiplexing (FDM)
End of Week 2 Notes