Comp 346/488: Intro to Telecommunications

Tuesdays 7:00-9:30, Lewis Towers 412

Class 2

Chapter 3 readings (7th-9th editions):
    3.1: Concepts
    3.2: Analog & Digital
    3.3: Transmission impairments
    3.4: Channel Capacity



Basics of packet switching, continued

How does having a fixed bitrate differ from having a designated bandwidth

Two problems: fairness and queuing delay / jitter
 
PACKET "switching": users send individual bufferfuls, called PACKETS. Think ~1KB, although much smaller packets are also in common use. After one user is done, someone else has an opportunity to send.
 
Consider packets: with 16 users all sharing a 1Mbps line (1 bit/microsec, 1Kb/ms), each gets 64Kbps if divided equally.
 
If.
 
There is, in fact, no guarantee of equal division, though, with packet switching. Ethernet does not guarantee this, IP does not guarantee this. (Token Ring guarantees that each active sender gets an equal share of the number of packets sent, but this means senders with smaller packets get to send less data. And besides, token ring does not scale well.)
 
The whole point of packets is that you can send more if you have to:  packet-switched LANs support BURSTY transmission.
 
Furthermore, even if there were fairness, we have great irregularity at the small scale. If soneone sends a 1.25KB (10Kb) packet, the line is tied up for 10 ms. Someone expecting 64Kbps would pile up 640 bits in that time. Yes, they can be queued, but they will certainly arrive late.
 
Some delay is inevitable. But telephony users would like to see consistent delay, not random delay whenever some other user sends off a big packet we have to wait for.
 


 3-7 layer models
layering as software engineering
    protocol graphs: ARP, video/audio system, etc
 
TCP/IP 4-5 layer model
OSI 7-layer model: problems with presentation & session layer
 
QUESTION: is it legitimate to separate the Internetwork (packet-delivery) layer from the transport layer? Is it a good idea?
 
Clearly, there are cases where commingling the LAN and IP layers makes sense: if there is no need to accomodate different low-level LAN protocols. If you are building closed systems (eg if you are The Phone Company), that might happen.

Fig 2.3, p 39 (9th edition): what layer is ATM?



Brief review of TCP/IP, from the perspective of What is a protocol:
IP: note how routing table is minimized by having entries only for networks (or else turning things over to LAN)
IP is non-interactive; as a host protocol, IP really just describes a format (well, we didn't talk about fragmentation reassembly). Routers, though, have some active steps to take with IP.
TCP: this is much more interactive; both sides have a great deal of state to maintain
 
Finish IP, TCP
 
Emphasize TCP statefulness
packet attributes: addresses, checksum (CRC), routing
LAN (Link) headers
IP header: fixed address for duration
Forwarding strategy

IP: a "compromise" layer; not needed in (dedicated-network) telephony?
 
TCP:
 
Abstract TCP responsibilities:
 
Frame Relay & ATM (using "virtual circuits"): sort of like one giant LAN, but with strange physical headers
 
Protocols: 
syntax, semantics, timing
 
 
IP protocol issues: syntax/semantics/performance
Host: basically send off, fragmenting if necessary
Router
 
TCP protocol: finite-state machine. 
TCP recognizes a number of states, eg
There are specific rules as to how TCP responds to each possible packet, in each possible state.
State diagram for 3-way handshake (9th edition: Figure 22.8 on p 710)
 
 
 
ITU v IETF standardization
ITU: Members are governments!
ISO: members include large corporations; 
standards are expensive!
 
2.1: protocols cover such things as: 

SMTP and HTTP

These are two straightforward protocols in widespread use: the Simple Mail Transport Protocol governs how email is sent to a server (possibly for forwarding), and the HyperText Transport Protocol allows clients to request URL-labeled content on web servers. Both are TCP protocols; an SMTP server generally listens at port 25 and an HTTP server at port 80. Both protocols are also ASCII-based, meaning that we can interact manually with the server. Ultimately, though, SMTP is used to send data to the server, while HTTP is used to fetch data from the server.

Manual SMTP


Telnet to port 25. In the following, what I type is in bold, and responses from telnet and not from the SMTP server are in italic.
telnet ulam2 25
Trying 147.126.65.47...
Connected to ulam2.
Escape character is '^]'.
220 ulam2.cs.luc.edu ESMTP Postfix
    EHLO valhal
250-ulam2.cs.luc.edu
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-STARTTLS
250-AUTH LOGIN PLAIN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
    mail from: pld
250 2.1.0 Ok
    rcpt to:pld@cs.luc.edu
250 2.1.5 Ok
    data
354 End data with <CR><LF>.<CR><LF>
subject:demo
here is some text
dot line
.
250 2.0.0 Ok: queued as EEDC5186BF
    quit
221 2.0.0 Bye
Connection closed by foreign host.

Note that desipte the line tagged with 354, the mail server allowed me to terminate my message by sending a line consisting of a single "." (that is, ".<cr><lf>")

Note also that there are several messages I sent: EHLO, MAIL FROM, RCPT, and then the message itself. The curent (as of the 1980's) version of SMPT supports "pipelining": sending these all on one line, provided I indicate this by starting with EHLO instead of HELO.

SMTP doesn't need timeouts for data retransmission, because TCP builds that in. However, timeouts for coping with sluggish servers (or disappearing clients) are not uncommon; if the whole process doesn't complete within an application-defined (but not protocol-defined) time limit then it may be canceled. The server, in particular, does not want a large number of "dangling" client connections around.

There's an interesting anti-spam measure based on timeouts, which is one of the measures used by Loyola's anti-spam systems: the server deliberately forces the client to wait. The theory is that spambots will give up rapidly, but real mail servers will be willing to wait.

Manual HTTP queries

Note that http is generally viewed as rather more interactive than SMTP: if you're downloading a page, you want to see the content now, or else be told that it's unavailable. By contrast, most SMTP agents notify you if failures last more than four hours, and don't give up for more than 24 hours.

Begin with "telnet xenon 80", and then type the GET line, the HOST line, and a blank line.

GET /index.html HTTP/1.1
HOST: xenon.cs.luc.edu
(blank line)
            --> returns Apache startup page
    HTTP/1.1 200 OK
    Date: Tue, 18 Mar 2008 19:47:59 GMT
    Server: Apache
    Last-Modified: Wed, 01 Mar 2006 01:04:31 GMT
    ETag: "2f3e2a-5a3-86bbc5c0"
    Accept-Ranges: bytes
    Content-Length: 1443
    Content-Type: text/html; charset=ISO-8859-1

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
            "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
        <head>
            <title>Test Page for Apache Installation</title>
        </head>

        <body>
            <p>If you can see this, it means that the installation of the
            <a href="http://www.apache.org/foundation/preFAQ.html">Apache web server</a>
            software on this system was successful. You may now add content to this
            directory and replace this page.</p>
        ....
       
           
GET /foobar.html HTTP/1.1
HOST: xenon.cs.luc.edu
(blank)
            --> returns 404

   
OPTIONS * HTTP/1.1
HOST: xenon.cs.luc.edu
(blank)
-->    HTTP/1.1 200 OK
    Date: Tue, 18 Mar 2008 19:49:39 GMT
    Server: Apache/2.2.2 (Unix)
    Allow: GET,HEAD,POST,OPTIONS,TRACE
    Content-Length: 0
    Content-Type: text/plain
   
Note codes (200, 404, etc), matching "response", and the body



OSI

The OSI model is (finally) deprecated in the 9th edition.
7 layers. In OSI, transport and network are relatively independent; TCP and IP interact more. 
OSI has 5 transport flavors; TCP/IP has 2 (TCP and UDP)  (some say TCP/IP needs more).
Presentation: 
 
Session: connection bookkeeping, BILLING, 

 
From Peterson & Davie, Computer Networks, Chapter 9:

The characteristics of many multimedia applications are such that, rather than try to squeeze too many calls into a too-narrow pipe, it would be better to “block” one call while allowing another to proceed. That is, better to have one person carrying on a conversation successfully while another hears a busy signal, than to have both callers experiencing unacceptable audio quality at the same time. We sometimes refer to such applications as having a “steep utility curve”, meaning that the utility (usefulness) of the application drops rapidly as the quality of service provided by the network degrades. Multimedia applications often have this property, whereas many traditional applications do not. Email, for example, continues to work quite well even if delays run into the hours.

This is another big difference between data networking and telecom.



Chapter 3:    Today we will learn about sin

Sine waves
Electromagnetic signals; guided media (wire/fiber) v unguided ("wireless")
transmission media can be point-to-point v multiple-access (multipoint)
time-domain: horizontal axis is time
 
frequency-domain concepts
 
Fact: physical transmission media have natural action on sine waves, due to things like "capacitance".  This action is different at different frequencies (eg high-frequency attenuation or distortion).
 
 
discussion of benefits of fourier analysis:
what if distortion is linear, but:
what if we want to understand bandpass filtering
 

How do we get Fourier series?

We will assume that the waveform data has been digitized and is available as an array of values A[n].

One way to think of the Fourier series is as a set of AVERAGING operations: the sequence A[n] is "averaged against" a sine (or cosine) wave sin(fn).

Getting a single number:
    for (n=0; n<len; n++) sum+=A[n]*sin(fn);
    avg = sum / len

Example 1: two sine waves of DIFFERENT frequency average to zero; phase does not matter

Two of the SAME frequency average to, well, maybe 1/2 (avg of sin2(x))

Assume:

g(x) = A1 sin(x) + A2 sin(2x) + A3 sin(3x) + ...(f periodic)
Average both sides with sin(x):

Avg(g(x), sin(x)) = A1 * AVG(sin(x), sin(x)) + A2 * AVG(sin(2x), sin(x)) + ...
= A1 * 1/2
From this we can readily calculate A1, and by averaging with sin(2x) get A2, etc.


Another kind of averaging: to get a new SEQUENCE / waveform /function.
Also called MOVING AVERAGES.
Things don't have to be periodic here.

Simple example: B[n] = (A[n-1] + A[n] + A[n+1])/3

We can think of this as a moving average with (1/3, 1/3, 1/3)

Any "LINEAR TRANSFORMATION" of the input signal can be expressed this way, though some may need lots and lots of coefficients and finding the coefficients might in some cases be difficult.

However, there are some shortcuts to the find-the-coefficients problem. If we know what we want in the frequency domain (cut off the higher frequency signals), then that's an easy point-by-point thing to express, in the frequency domain:

(1, 1, 1, ...., 1, 0, 0, 0, ...)
          ^cutoff

Apply this to a sequence of frequency amplitudes (a1, a2, a3, a4, a5, a6, a7, a8)
Assume the cutoff is at position 4, and multiply corresponding values.
We get
(1*a1, 1*a2, 1*a3, 1*a4, 0*a5, 0*a6, 0*a7, 0*a8)
= (a1, a2, a3, a4, 0, 0, 0, 0)

Point-by-point multiplication in the frequency domain corresponds to a moving average in the time domain, and we can calculate that in a very straightforward way (although it does involve some calculus). In this case, it turns out to be the "sinc" function (with a "c", pronounced "sink"):

sinc(x) = sin(x)/x    (sinc(0) = 1)

This kind of averaging is sometimes called "convolution". The function you are averaging against is sometimes called a "kernel", not to be confused with the OS use of that term.

Other common kernels:
Identity ("delta" function)
windowed sin(x): gives estimate of local frequency
high-pass (Identity - sinc)
echo
reverb

Associativity: passband kernel

finite v infinite
"causal" (irrelevant for wav files, important for real-time processing)

For manipulation of digital signals, these kinds of convolution-with-kernel operations are fundamendal.


Fourier.xls

I've created a simple spreadsheet, fourier.xls, that can be used to create a graph of the result of the first 10 terms of any Fourier series.
Examples:




Time domain and Frequency domain


spectrum: range of frequencies
bandwidth: width, = f_max - f_min
effective bandwidth: frequencies you actually need
DC component

major point: in Frequency-division multiplexing, each channel
is assigned a very specific "bandwidth"

Note: standard electronic circuits can extract "bands", hence the practical importance of this notion

Note that this is a different use of "bandwidth" from "data rate"

There is some relation, however: the narrower the analog band width, the less room there is for multiple frequencies and modulation, and the less data capacity.

discussion of benefits of fourier analysis:
what if distortion is linear, but:
what if we want to understand bandpass filtering




Example on pp 71-72 (9th ed) (65-66 in 7th ed) on data rate ("bandwidth" in the digital sense) versus bandwidth
Note dependence on notion of what waveform is "good enough"

Situation: transmitting a square wave assumed to be carrying data at a rate of 2 bits/cycle.

Case 1: base frequency 1 MHz, frequencies: 1MHz, 3MHz, 5MHz
analog band width: 5MHz - 1MHz = 4MHz, data rate: 2Mbps

Case 2: double those to 8MHz, 4Mbps

Case 3: decide we do not need the 5MHz component, due to a more accurate receiver. Base freq 2MHz, frequencies 2MHz, 6MHz, bandwidth: 6MHz - 2MHz = 4MHz, data rate: 4Mbps

Note that we're really not carrying data in a meaningful sense; we can't send an arbitrary sequence of 0's and 1's this way. However, that's done mostly to simplify things.

Note also the implicit dependence on bandwidth of the fact that we're decomposing into sinusoidal waves.

Voice transmission: frequency bandwidth ~ 3-4kHz
64Kbps encoding (8 bits sampled 8000 times a second)


Note: we're looking at DISCRETE frequency spectrum (periodic signals). CONTINUOUS frequency spectrum also makes mathematical sense, but is kind of technical

Note that frequency-domain notion depends on fundamental theorem of Fourier analysis that every periodic function can be expressed as sum of sines & cosines (all with period an integral multiple of original)



Bandwidth of voice: <=4 kHz

quite different meaning from digitization: 64kbps

But if we wanted to encode the digitized voice back into a voice bandwidth, we'd have to encode 16 bits per cycle (Hertz), which is a little tricky.



Amplitude modulation & bandwidth (§5.4)
Note that AM modulation (ALL modulation, in fact) requires a "bandwidth"; ie range of frequencies. This will be very important for cellular.

AM:amplitude = [1+data(t)]*sin(2*pi*f*t)
f is "carrier" high frequency; eg 100,000


If data(t) = sin(2*pi*g*t), g a much lower frequency (eg 1000)
Then sin(2*pi*f*t)*sin(2*pi*g*t) = 0.5 cos(2*pi*(f-g)*t - 9.5 cos(2*pi*(f+g)*t)

band of frequencies (f-g) to (f+g)!!




Section 3.2: it's not that technical; read it.
There's a calculation there of TV analog band width

On the other hand 3.1 is technical and there are lots of details there that we'll never use. Know what the frequency-domain view is, and spectrum, and (frequency) bandwidth versus bitrate, and know the importance of sin. That is, know that

3.2: transmission
analog transmission: needs amplifiers to overcome attenuation
digital transmission: store-and-forward (or cut-through) switches?
Switches do signal regeneration, not amplification; noise is NOT added.
BUT: we need them a lot more often.


data may need some form of encoding: analog may (eg AM modulation), or equalization. Digital: NRZ is basic (1=on, 0=off), but isn't good in real life. Table 3.1.

analog v data v (encoding | transmission)

Note analog data/analog signal is an odd case.


Signals v Transmission:

Normally these should match. Note special case of analog signal / digital transmission, which is taken to mean that the analog signal encodes a digital signal in a way that the repeater can decode and re-encode.