Comp 346/488: Intro to Telecommunications
Tuesdays 4:15-6:45, Lewis Towers 412
Class 2, Jan 24
Reading (7th -- 9th editions)
10.1, 10.2, 10.3
Chapter 1: 1.3, 1.4
Chapter 2, 2.1-2.6, especially 2.3 on TCP/IP
Chapter 3 readings (7th-9th editions):
3.1: Concepts
3.2: Analog & Digital
3.3: Transmission impairments
3.4: Channel Capacity
Helloworld note: apparently the voice is Allison Smith.
Last week I managed to forget to hang up
after a speakerphone call from the classroom to my 815-828-xxx SIP
line (while I was trying to demonstrate voicemail-to-email). I was connected for 9625 seconds (2.5 hours), costing me $1.93.
Dest
|
Direction
|
CallerID
|
Start (converted to CST)
|
Duration
|
Cost
|
18158286071
|
Inbound
|
13129157992
|
2012-01-17 18:35:36
|
9625
|
1.932
|
Sigh. luser error.
I did subsequently add the following to my sip.conf:
- rtptimeout=60
;; terminate call if 60 sec of no RTP/audio activity (not including
hold)
- rtpholdtimeout = 600 ;; terminate after 600 sec of no RTP/audio activity even if we are on hold
I can now make calls to and from the SIP phones
Demo: call from the SIP phone to the classroom phone
How can we estimate RTT? (I got ~180 ms in my office)
Now call the SIP phone from my cellphone. What is the RTT?
Call extension 2000 from the cisco phone, while watching the Asterisk "console". What happens?
Now call 2001.
I wanted to change from CALLERID(num) to P-Asserted-Identity. But if the latter is empty, nothing happens, and it is empty if I call from my own phone. So let's change it to the 773-409-4359 number.
Note: an Asterisk extension is like a script, triggered by a matching dial pattern. It might be a literal extension, but it can be other names too. The Dial command tries to connect that number to a channel, defined in sip.conf.
If the Dial command times out, we generally want to pass the call on to voice mail, but not if the Dial command completes a call!
Basics of packet switching
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
-
addressing/naming
-
space for address bits: tension between this and small packets
-
SAP: a "port", an endpoint on a machine (Service Access Point)
-
PDU: data + header as seen at a particular level (Protocol Data Unit)
-
PDU of one layer will start with header of next layer up
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?
Of course, IP telephony protocols are needed for VoIP.
TCP:
- timeout/retransmit
-
sequence numbers
-
connection / disconnection
-
port #s
Abstract TCP responsibilities:
- lost-packet recovery
-
end-to-end channel
- throughput optimization (sliding windows)
- congestion management
Frame Relay & ATM (using "virtual circuits"):
sort of like one giant LAN, but with strange physical headers
Protocols:
syntax, semantics, timing
-
examples from IP protocol
-
syntax: header format, addresses
-
semantics: router processing of packets,
-
sending host processing of packets
-
address assignment
- how we respond to lost packets
-
timing: for example, "no packets should be older than 30 sec"
IP protocol issues: syntax/semantics/performance
Host: basically send off, fragmenting if necessary
Router:
-
decide if local v nonlocal
-
either way, get physical addr for next hop
-
repackage
-
fragment if necessary
-
decrement TTL
-
update checksum
TCP protocol: finite-state machine.
TCP recognizes a number of states, eg
- You can take any signal, periodic or not, and apply the Fourier
transform to get a frequency-domain representation. This can be messy,
but is not particularly deep. Or helpful: having a signal composed of
complex sine waves of continuously varying frequency can be intractable.
Most voice signals are not periodic at larger scales: people say different words.
What is useful, though, is the
idea that over small-but-not-too-small intervals, say 10-100ms, voice
does indeed look like a set of periodic waves. At this point, the
frequency-domain view becomes very useful, because it is just a set of
discrete frequencies.
In other words, "sound is made up of vibrations".
Maybe even more importantly, most digital data signals similarly look
"almost periodic", often over much larger intervals than voice. So the
same principle applies: translation to the frequency domain is actually
useful.
When we start looking at the details of audio highpass, lowpass, and
bandpass filters (eg for audio), we'll see that they involve averaging
over a time interval. If that time interval is too large, the signal
may no longer look very periodic and we may get misleading or distorted
results. If the time interval is too small, the filter may not be
"sharp" enough. You can take any signal, periodic or not, and apply the Fourier
transform to get a frequency-domain representation. This can be messy,
but is not particularly deep. Or helpful: having a signal composed of
complex sine waves of continuously varying frequency can be intractable.
Most voice signals are not periodic at larger scales: people say different words.
What is useful, though, is the
idea that over small-but-not-too-small intervals, say 10-100ms, voice
does indeed look like a set of periodic waves. At this point, the
frequency-domain view becomes very useful, because it is just a set of
discrete frequencies.
In other words, "sound is made up of vibrations".
Maybe even more importantly, most digital data signals similarly look
"almost periodic", often over much larger intervals than voice. So the
same principle applies: translation to the frequency domain is actually
useful.
When we start looking at the details of audio highpass, lowpass, and
bandpass filters (eg for audio), we'll see that they involve averaging
over a time interval. If that time interval is too large, the signal
may no longer look very periodic and we may get misleading or distorted
results. If the time interval is too small, the filter may not be
"sharp" enough. You can take any signal, periodic or not, and apply the Fourier
transform to get a frequency-domain representation. This can be messy,
but is not particularly deep. Or helpful: having a signal composed of
complex sine waves of continuously varying frequency can be intractable.
Most voice signals are not periodic at larger scales: people say different words.
What is useful, though, is the
idea that over small-but-not-too-small intervals, say 10-100ms, voice
does indeed look like a set of periodic waves. At this point, the
frequency-domain view becomes very useful, because it is just a set of
discrete frequencies.
In other words, "sound is made up of vibrations".
Maybe even more importantly, most digital data signals similarly look
"almost periodic", often over much larger intervals than voice. So the
same principle applies: translation to the frequency domain is actually
useful.
When we start looking at the details of audio highpass, lowpass, and
bandpass filters (eg for audio), we'll see that they involve averaging
over a time interval. If that time interval is too large, the signal
may no longer look very periodic and we may get misleading or distorted
results. If the time interval is too small, the filter may not be
"sharp" enough.
CLOSED
-
LISTEN
-
SYN_SENT
-
SYN_RECD
-
ESTABLISHED
-
CLOSING
-
TIME_WAIT
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)
UDP
Let's look at tcpdump trace of phone call using wireshark
- generated with tcpdump -v -s 0 -i eth0 host cisphone
- packets 3 & 4 are an ARP update
- phone call starts at packet 5, time 9.545, with SIP/SDP INVITE
- RTP stream starts with packet 15.
- Encoding is G.711 (µlaw, 8 bits every 1/8000 sec)
- Packets have 160-byte payload (214-byte total), and are sent every 20 ms
- Check port numbers
Now look at a tcpdump trace of a call from the perspective of ulam2:
- generated with tcpdump -v -s 0 -i eth0 udp and \(port 5060 or udp[8:2] = 0x8000 \)
- the IP address 216.115.69.144 is part of flowroute.com, in Las Vegas NV
- the IP address 64.194.139.61 is part of Excel Telecommunications (excel.com) in TX
ITU v IETF standardization
ITU: Members are governments!
ISO: members include large corporations; standards are expensive!
IETF: Standards are free
2.1: protocols cover such things as:
-
encapsulation
-
segmentation-reassembly
-
connection
-
ordered delivery
-
flow control
-
error control/correction
-
addressing
-
multiplexing
-
security
-
quality/priority
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>")l
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 "-//Wl3C//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>
....l
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:
-
byte orientation,
-
other data format issues
-
encryption
-
compression (probably really needs to be application-specific)
Session: connection bookkeeping, BILLING,
-
connection-establishment part of transport
-
request/reply
-
interruption capability
-
full-duplex v one-way
-
grouping of data
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
A sine wave is described by
y = A sin(2πft)
where t is the time (eg in seconds) and f is the frequency in cycles/sec
One way to think of this is to imagine a frequency of 1000 Hz. That
means we should complete one full cycle in 1/1000 sec, which means that
when t=1/1000, we have sin(2π). This is indeed the completion of one
full cycle.
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
-
typical sine waves
-
square waves, nonperiodic signals
-
discrete v continuous
-
periodic signals
-
wavelength (v frequency)
-
phase
frequency-domain concepts
-
any periodic signal is a superposition of sine waves
-
Actually, any signal is, but you have more control of the frequencies
with periodic signals
-
construction of a square wave with sines: fourier.xls
-
discrete v continuous
-
deep question: why sin?
-
if we use sin/cos as basis, square wave has infinite bandwidth
-
if we use square waves as basis, each individual one has zero bandwidth
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 and the frequency-domain view:
what if distortion is linear, but:
-
higher-frequency sine waves transmit faster/slower
-
higher-frequency sine waves get damped more
What if we want to understand bandpass filtering?
Digitization
We'll look at this in more detail later, but for now assume we have a
waveform, and a sampling rate R (eg R = 8000 samples/sec). The sampling
interval is then 1/R sec. Given a waveform y=f(t), we use t=0, t=1/R,
t=2/R, ..., t=n/R as the sample points. We sample f(n/R), round it off
to the nearest available discrete value, and put that in the array
component A[n].
For wav files, we can specify the sampling rate; in the telephony world R=8000 is standard and for CD sound R=44000.
For telephony, we generally use 8-bit values for the A[n]'s, from +127
to -127 appropriately scaled. Because of the limited range here,
nonlinear encoding is used. Better sound quality is obtained with
16-bit encoding, which is usually linear.
Some 16-bit digitized waves:
440 Hz A: text wav (text file has frequency rounded off to 18; 8000/440 is really 18.18)
294 Hz D: text wav (text file has frequency rounded off to 27 from 27.2)