9/7/04

Types of Modem		IN		OUT
+Dialup			RS232		Phonetones in phonelines
+Cable			Ethernet	Cable signal
+DSL			Ethernet	Multiple bands in phoneline
	
NyQuist Theorem:
-- It relates network bandwidth and throughput
	D = 2*B* Log2(k)
	D == Throughput
	B == Hardware bandwidth (Hz)
	K == Number of values that enode data
	
Example: 
	RS232
	K is 2 because +15/-15 are used
	D = 2 * B * Log2(2) = 2B
	In RS232 the max throughput is two times the bandwidth
	
-- NyQuist theorem does not consider noise, and therefore it only gives a maximum theoretical limit.
	
Shannon's Theorem:

It relates network bandwidth and throughput but is also considers noise.
	C = B*Log2(1 + S/N)
	C - Throughput in bits/sec
	B - Hardware bandwidth
	S - Power of Signal
	N - Power of Noise
	
Example:
	Telephone System:
	B = 3000Hz (typical bandwidth used for voice)
	 
	S/N (signal to noise ratio) is appx 1000 hz
	
 	Effective capacity (throughput)
	
	C = 3000 * log2(1 + 1000) appx = 30,000 bps
	
	Result:
	- With a s/n 1000 there is little hope to accomplish more than 30 kbps. 
	- 56 kbps modems accomplish this speed by using smaller S/N ratio and compression. 
 	
	S/N is usually given in Decibels (DB).  S/N in Decibels = 10 log10(S/N) (DB)
	
	Summary:
	Nyquist Theorm gives a theoritical limit to throughput
		
	Multiplexing:
	We use multiplexing to send different sources of data in single sources of data in a signal shared computer channel.
Mux has to prevent interference between the different sources of data.
--mux takes multiple source of data and puts them in a single channel
--demux takes signal from signal channel and reconstructs the original sources 
  of data
-- Frequency Division Multiplexing (FDM)
	-- Data items from multiple sources are sent simultaneously in different places in the frequency spectrum.
 	
 
	-- Example:  Radio Stations
 
 
 	Cable TV

 

Packets, Frames, checksums, parity check

-- Why we connect computers to shared networks?

Because we can. Because the alternative would be a one to one connection that is expensive in hardware and not scalable.The number of one-to-one connections is O(N^2)

 

Instead we use a shared network

This shared network is less expensive.

The drawback that since one pair of computers can only use the network at a time, the throughput will be divided.

Example: Assume throughput 10 Mbps.
A talks to b and c talks to d
One to one net --- 	
	10 mbps a -> b
	10 mbps c - > d
	---------
	20 mbps
Shared net --- 5 mbps

Problems with shared networks
	+ It may have a lot of traffic
	+ Some applications use move bandwith than others 
		Video conferencing vs e-mail
	+ Some applications cannot wait too long to have access to the network.  Example VOIP
We should give/ensure fair access to the network.

Problem:
	A sends to b a 40 MB File, that takes appx 40 seconds to send on a 10 Mbits/s
	C and D cannot comm. For 40 seconds, while transfer takes place.

Solution:
	Divide data into small units call packets.  1500 bytes in the ethernet.
	Allow each station to send a packet before any other station sends another packet.

9/9/04

Computers in the lab:
Each computer is connected to two nets
You run the snoop wrapper to snoop packets from 10.0.0.x net.
Run commands that generate traffic in the 10.0.0.x net.
Store packets in file
Write analyzer that prints packets from file
Packet Switching: 
 
	The data that has to be transmitted from one machine to anoher is divided into packets of maximum size.  (e.g. 1500 bytes for ethernet) 
	To ensure fairness, a machines has to wait before sending another packet. 
	This prevents one machine from monopolizing the network. 
	Packets have a format that includes the destination of the packet. 
 
Example of a frame format:
RS232 frame
[SOH  |  block of data   | EOT]
RS232 transmissions consists of a sequence of chars
SOH - START OF HEADER
EOT - END OF TEXT
They are special chars to mark the beginning and end of a message
RS232 frame does not include destination since it is a point to point protocol

Problem: If the data contains special chars like SOH and EOT, the receiver, may confused and use them as start and end of transmissions.
Solution: Use an alternative representation called "byte stuffing".  Substitute special chars by an escape sequence.
 
Char in data                 Char sent
SOH                           ESC X
EOT                           ESC Y
ESC                           ESC Z
 
Data message:  [SOH|   |EOT  |    | SOH   |  EOT]
Sent Message:  [SOH|   |ESC|X|    |Esc|Y| | EOT]

The receiver translate the sent message back to the data message. 
Stuffed frame can be longer than the original frame. 

Handling of Errors
Data sent can be currupted during transmissions
	1. Bits can be lost 
	2. Bits values can change 1 -> 0, 0 -> 1 
The packets include additional information to defect errors.