You are on page 1of 27

Computer Networks

Chapter 02

Maarten van Steen


Vrije Universiteit Amsterdam Faculty of Science Department of Computer Science Room R4.20. Tel: (020) 444 7784 steen@cs.vu.nl

00 1

Contents
01 02 03 04 05 06 07 08 Introduction Physical Layer Data Link Layer MAC Sublayer Network Layer Transport Layer Application Layer Network Security

00 2

Physical Layer
Essence: Provide the means to transmit bits from sender to receiver involves a lot on how to use (analog) signals for digital information

Theoretical background: signal transmission and Fourier analysis


Transmission media (wires and no wires) Modulation techniques (the actual encoding), multiplexing, and switching

02 1

Physical Layer/

Transmitting Signals (1/2)


Were living in a digital world, meaning that wed preferably want to send digital (i.e. two-valued) signals through wires. Wires are pretty much physical, meaning that Mother Nature will probably impose a few constraints here and there.

Observation: Signals are not entirely transmitted through a wire as you would expect:
+5

-5 distance -->

02 2

Physical Layer/2.1 Theoretical Background

Transmitting Signals (2/2)


Effect of frequency-dependent transmission delays:
+5

-5 distance -->

Effect of frequency-dependent attenuation:


+5

-5 distance -->

Overall effect including noise:


+5

-5 distance -->

02 3

Physical Layer/2.1 Theoretical Background

Fourier Analysis (1/2)


To understand whats going on, we need Fourier Analysis. A periodic function with period T (and frequency f 1 T ) g t can be written as:

Example: g t n 1 2k1 1 sin 2k 1 t (n is the k number of harmonics we take into account)

02 4

Physical Layer/2.1 Theoretical Background



n 1

n 1

gt

1 c 2

an sin 2n f t

bn cos 2n f t

Fourier Analysis (2/2)


1 0 1 1 0 0 0 1 0 rms amplitude 0.50 0.25

Time

T (a)

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Harmonic number

1 1 harmonic

0 (b)

2 harmonics

0 (c)

1 2

4 harmonics

0 (d)

1 2 3 4

8 harmonics

0 Time (e)

1 2 3 4 5 6 7 8 Harmonic number

Note: root mean squares (on the right) reect the dispersed energy at the given frequency.
02 5 Physical Layer/2.1 Theoretical Background

Bandwidth (1/2)
What does this all mean? Digital signal transmission can be thought of as being constructed as an innite number of periodic analog signals.

The quality of transmission is frequency dependent not all parts of the digital signal get through the wire as you would expect. Digital signal transmission is subject to attenuation, distortion, etc. This is partly caused by disallowing high-frequency components to pass through (bandwidth).

Example: (We are trying to transmit a single byte): With a bit rate of b bits/sec, it takes 8/b seconds to send a byte. The frequency f 1 of the rst harmonic is b/8 Hz.
Physical Layer/2.1 Theoretical Background

02 6

Bandwidth (2/3)
bps 300 600 1200 2400 4800 9600 19200 38400 T (ms) f1 26.67 37.5 13.33 75.0 6.67 150.0 3.33 300.0 1.67 600.0 0.83 1200.0 0.42 2400.0 0.21 4800.0 # har. 80 40 20 10 5 2 1 0

Assumption: We are using a simple encoding technique based on the fact that the line supports only two signal values. Observation: Most telephone carriers cut off the highest frequency at 3000 Hz we can never transmit at a higher speed than 9600 bps (and without special encoding, its much lower)

02 7

Physical Layer/2.1 Theoretical Background

Bandwidth (3/3)
Improvement: If there are four signal values available, we could encode 2 bits at a time:

00 10

0 volt 01 4 volt 11

2 volt 6 volt

The number changes in a signal per second is called the baud. Example 2: A 2400 bauds line (modem) can make a bit rate of 9600 bps provided it uses 16 (24) signal values: S 0 1 2 3 bits 0000 0001 0010 0011 S 4 5 6 7 bits 0100 0101 0110 0111 S 8 9 10 11 bits 1000 1001 1010 1011 S 12 13 14 15 bits 1100 1101 1110 1111

02 8

Physical Layer/2.1 Theoretical Background

Nyquist & Shannon


Nyquist showed that if the cut-off frequency is H Hz, the ltered signal can be reconstructed by making 2H samples. No more, no less. Consequence: maximum transmission rate = 2H log2 V bps (where V is the number of signal values) Shannon showed that a noisy channel with a signalto-noise ration S/R, has a limit with respect to the bit rate:

Example: A telephone line with H = 3000 and 10 log10 S R 30 dB, can do no better than 30 kbps, no matter how you do your encoding (excluding compression).
02 9

Physical Layer/2.1 Theoretical Background

Transmission Media Magnetic Tape


Never underestimate the bandwidth of a station wagon full of tapes hurtling down the highway

Take a standard videotape that can carry about 7 gigabytes of data.


A box of 50 50 50 cm can hold about 1000 tapes, which corresponds to 7000 gigabytes.

Sending such a box can be done within 24 hours, worldwide.

Weve got a transmission rate of 648 Mbps! Question: What is overlooked in this reasoning?
02 10 Physical Layer/2.2 Transmission Media

maximum transmission rate = H log2

S R bps

Copper Wires (1/2)


Twisted pair: Two insulated copper wires, twisted like a DNA string (reduces electrical inference). Often, twisted pairs go by the bundle. Comparable to telephone wiring at home.

(a)

(b)

Further distinction between shielded (STP) and unshielded (UTP) versions, but the shielded ones are primarily used only with IBM installations.

02 11

Physical Layer/2.2 Transmission Media

Copper Wires (2/2)


Coax cable: Exactly like the one you use for your TV Set:
Copper core Insulating material Braided outer conductor Protective plastic covering

Coax is better than twisted pair when you need more bandwidth, but is now rapidly being replaced with ber.

02 12

Physical Layer/2.2 Transmission Media

Fiber Optics (1/2)


Principle: Rather than using electrical signals, we use optical ones that are passed through optical ber. Principal working is based on the refraction property of light:
Air/silica boundary Air 1 2 3 Total internal reflection.

1 Silica

3 Light source

(a)

(b)

02 13

Physical Layer/2.2 Transmission Media

Fiber Optics (2/2)


As it turns out, attenuation is extremely well in optical ber. This means that they can be used for long distances. In addition, the bandwidth is enormous.
2.0 1.8 Attenuation (dB/km) 1.6 1.4 1.2 1.0 0.8 0.6 0.4 0.2 0 0.8 0.9 1.0 1.1 1.2 1.3 1.4 Wavelength (microns) 1.5 1.6 1.7 1.8 0.85 Band 1.30 Band 1.55 Band

02 14

Physical Layer/2.2 Transmission Media

Fiber Connections
Observation: An interface consists of a receiver (photodiode) which transforms light into electrical signals, and/or a transmitter (LED or laserdiode) Passive interface: A computer is directly connected to the optical ber Active interface: Theres an ordinary electrical repeater connected to two ber segments and the computer:
To/from computer Computer Copper wire

of tail De

interface
Direction of light propagation

Fiber Optical fiber Interface

Optical receiver (photodiode)

Signal regenerator (electrical)

Optical transmitter (LED)

02 15

Physical Layer/2.2 Transmission Media

Optical Fiber vs Copper Wire


Bandwidth: Fiber can support enormous bandwidths, exactly what we need with upcoming image-based applications (video-on-demand). Attenuation: Because the attenuation in ber is less than in copper (can you imagine why?), we dont need to boost the signal as often. In practice, ber requires an active repeater every 30 km, copper every 5 km. External inuences: Thats right, no more interference from other cables, radios, power failures, etc. Crosstalk (you hearing another conversation) is out of the question. Weight: Fiber simply doesnt weigh as much. Good for backs, bones, and the use of heavy maintenance equipment.

02 16

Physical Layer/2.2 Transmission Media

Wireless Transmission (1/3)


Wireless transmission is really great for all of us who cant sit still, or feel they have to be on-line all the time (watch it you may miss something). Its also convenient when wiring is needed where it cant be done, or isnt really worth the trouble (jungles, islands, mountains), or because its just user-unfriendly (homes). Wireless transmissions travel at the speed of light (c), uses a frequency ( f ) which has a wavelength ():

The larger the wavelength is, the longer the distance it can travel without attenuation. Also, the dispersion of higher frequencies is much lower.

02 17

Wireless Transmission (2/3)


f (Hz) 100 102 104 106 Radio 108 1010 1012 1014 1016 UV 1018 1020 1022 1024 Microwave Infrared Visible light X-ray Gamma ray

f (Hz) 104

105

106

107 Coax

108

109

Twisted pair AM Maritime radio FM radio TV Band LF MF HF VHF UHF

Note: We can encode only a few bits per Hertz in the low frequency range, but much more in the higher ranges. This means that wireless transmission will generally have a much lower bandwidth (in practice: 1-2 Mbps). Observation: Fiber optics operate in the high frequency range, which explains the transmission rates of gigabits per second.
02 18 Physical Layer/2.3 Wireless Transmission

Physical Layer/2.3 Wireless Transmission

1010 Satellite

1011

1012

1013

1014 1015 Fiber optics

1016

Terrestrial microwave

SHF

EHF

THF

Wireless Transmission (3/3)

Conclusion: the wider the range, and the shorter the wavelength, the higher the bandwidth. Example: 10 6 with = Fiber optics often work at = 1.3 0.17 10 6 leading to 30 THz bandwidth!

Frequency hopping: Use a wide band, but let the transmitter hop from frequency to frequency (hundreds of times per second). Good for avoiding continuous interference and reducing the effect of reected signals (you wont be listening to them).

Direct sequence: Simply spread the signal over a wide frequency band (and allow several signals with different encoding/modulation techniques to be transmitted simultaneously).
02 19 Physical Layer/2.3 Wireless Transmission

Wireless Transmission (4/4)


Observation: Radio transmission (VLFVHF) is extremely popular for its cheapness and range. Also, waves just go all over the place.

Ground wave

Ion

osph

ere

Earth's surface (a)

Earth's surface (b)

Observation: Microwave transmission is also popular and is good for long distances, as long as its directed. Problem is the density in the spectrum, requiring higher frequency ranges (which are hard for unguided transmissions)

02 20

Physical Layer/2.3 Wireless Transmission

df d

c 2

c 2

Communication Satellites
Observation: Satellites are attractive because they provide a relatively simple model of communication: one signal up can be broadcast to many receivers downwards. Taking Mother Nature into account (i.e., avoiding belts around the earth consisting of highly-charged particles that would destroy a satellite), there are three types of satellites:
Altitude (km) 35,000 30,000 25,000 20,000 Upper Van Allen belt 15,000 10,000 5,000 Lower Van Allen belt 0 LEO 17 50 MEO 3585 10 Type GEO Latency (ms) 270 Sats needed 3

02 21

Physical Layer/2.4 Communication Satellites

Geostationary Orbit Satellites


Feature: GEO satellites are placed at 35,800 km above the earth where their rotational speed is the same as that of the earth. The effect is that they appear to remain motionless in the sky. VSATs: Very Small Aperture Terminals simple systems that output 1 Watt at 19.2 kbps but can download as much as 512 kbps. To allow the VSATs to communicate with each other, hubs are used:
Communication satellite

1 3 2

VSAT

Hub

02 22

Physical Layer/2.4 Communication Satellites

Medium-Earth Orbit Satellites


Example: The Global Positioning System (GPS) orbit at 18,000 km. It takes about 6 hours for a satellite to circle the earth. They are not used for telecommunications.

02 23

Physical Layer/2.4 Communication Satellites

Low-Earth Orbit Satellites (1/2)


Essence: We throw in a relatively large number of low-orbit satellites which jointly cover the surface of the earth; when you are out of your current satellites spot beam, you should be in that of the next satellite (Iridium):

(a)

(b)

Note: Iridium uses 66 satellites, each having a maximum of 48 cells (i.e., spot beams), totaling 1628 cells. Observation: This approach is virtually the same as that of cellular radio, except that the cells are moving instead of the subjects.
02 24 Physical Layer/2.4 Communication Satellites

Low-Earth Orbit Satellites (2/2)


Alternative: In Globalstar, much of the complexity is handled by ground stations that pick up a connection from a satellite, and pass it on to the one closest to the receiver:
Satellite switches in space Bent-pipe satellite

Switching on the ground

(a)

(b)

Observation: This scheme avoids much of the complexity for (managing) inter-satellite communication.

02 25

Physical Layer/2.4 Communication Satellites

Where (not) to use Satellites


Bandwidth: Fiber wins, but not everyone has access to all the available bandwidth. Satellites may make it easier to transfer data anyway Mobility and remote locations: Satellites win, although it isnt clear whether simple cellular techniques may do just ne Broadcasting: Satellites win easily: broadcasting essentially comes for free Fast and reliable: Give credits to ber: satellites are pretty bad due to inherent high latency (230 ms round-trip for geostationary satellites), and too much Mother Nature (rain!)

02 26

Physical Layer/2.4 Communication Satellites

The Local Loop


Observation: When it comes the telephone system, from a networking perspective the local loop is the most interesting to look at. The general structure is as follows:
Computer ISP 2

Local loop Medium-bandwidth (analog, trunk twisted pair) (digital, fiber) Modem Codec Toll office End office

Digital line Toll office Up to 10,000 local loops Toll office Codec Modem bank

High-bandwidth trunk (digital, fiber)

ISP 1

02 27

Physical Layer/2.5 Telephone System

Modulation Techniques (1/3)


Problem: How can we encode our signals when we can effectively use only a single frequency (or better: small frequency range)? Answer: Apply modulation techniques:

Change the amplitude (strength) of the signal: changing amplitude means a binary 1, constant amplitude a binary 0.

Use two frequencies to encode your bits (these frequencies can be put on top of your base frequency). Change the phase of the wave (cf. sine and cosine) to do signal encoding.

02 28

Physical Layer/2.5 Telephone System

Modulation techniques (2/3)


0 1 0 1 1 0 0 1 0 0 1 0 0

(a)

(b)

(c)

(d)

Phase changes

02 29

Physical Layer/2.5 Telephone System

Modulation techniques (3/3)


Observation: Modulation is strongly related to not being able to set a (wide-frequency-ranges) DC signal value on the wire as direct encoding of binary signals:
+5

-5 distance -->

becomes

+5

-5 distance -->

02 30

Physical Layer/2.5 Telephone System

Increasing Transmission Rates


Observation: An important issue is to use low-baud modems for high transmission rates, by increasing the number of signal values Combine different modulation techniques
90

90

180

180

270 (b)

270 (c)

Example: V.32 uses phase-shifting combined with amplitude modulation Observation: We have to be extremely accurate in being able to detect changes in a signal value. Further improvements are made by also using compression techniques
02 31 Physical Layer/2.5 Telephone System

Digital Subscriber Lines


Observation: Traditional telephone modems are articially limited to a 3000 Hz bandwidth, used to carry voice over analog lines. If we can direct signals to a different switch that does not narrow the bandwidth, much higher transmission rates can be achieved. Snag: The actual bandwidth capacity that a copper wire can support, is dependent on the distance that a signal needs to be carried:
50

40

Mpbs

30

20

10

0 0 1000 2000 Meters 3000 4000 5000 6000

02 32

Physical Layer/2.5 Telephone System

Asymmetric DSL (1/2)


Essence: Considering that the local loop has a 1.1 MHz spectrum, we can divide the spectrum into 256 4kHz channels (like in traditional telephone systems), and divide these into several logical channels:
256 4-kHz Channels Power 0 Voice

25 Upstream Downstream

1100 kHz

Note: It is up to the provider to decide how it will arrange its channels. Different combinations are possible.

02 33

Physical Layer/2.5 Telephone System

Asymmetric DSL (2/2)

Voice switch Codec Splitter Telephone line NID

Telephone

Splitter

Computer DSLAM

To ISP Telephone company end office

ADSL modem

Ethernet Customer premises

NID DSLAM

Network Interface Device DSL Access Multiplexer

02 34

Physical Layer/2.5 Telephone System

Wireless Local Loop


Problem: Suppose you want to start an ISP but using the local loop is out of the question because it is owned by your competitor. Solution: Set up a wireless direct connection between one of your antennas and your subscribers (in a socalled sector):

Telephone Network

ISP

Note: A sector can operate at 36 Gbps downstream bandwidth and 1 Mbps upstream, to be shared by subscribers. The range is about 25 km.
02 35 Physical Layer/2.5 Telephone System

Multiplexing: FDM
Problem: Considering that the bandwidth of a channel can be huge, wouldnt it be possible to divide the channel into sub-channels? Frequency Division Multiplexing: Divide the available bandwidth into channels through frequency ltering, and apply modulation techniques per channel:
Channel 1 1

Attenuation factor

Channel 2 1

Channel 2 Channel 1 Channel 3

60 Channel 3 1

64

68

72

Frequency (kHz) (c)

300

3100

60

64

68

72

Frequency (Hz) (a)

Frequency (kHz) (b)

02 36

Physical Layer/2.5 Telephone System

Multiplexing: WDM
Wavelength Division Multiplexing: Actually the same as FDM, but used for ber optics.
Fiber 1 spectrum Power Power Fiber 2 spectrum Power Fiber 3 spectrum Power Fiber 4 spectrum Power Spectrum on the shared fiber

Fiber 1 Fiber 2 Fiber 3 Fiber 4

1 2 3 4 Combiner Long-haul shared fiber 1+2+3+4 Splitter

Filter 2 4 1 3

Observation: Light waves have their own frequency range; they are simply combined and separated using standard (de)fraction properties

02 37

Physical Layer/2.5 Telephone System

Multiplexing: TDM (1/3)


Time Division Multiplexing: Simply merge/split streams of digital data into a new stream. Data is handled in frames a xed series of consecutive bits:

sender-1 sender-2 sender-3

buffer buffer buffer

frame

receiver-1 receiver-2 receiver-3

buffer buffer buffer

Observation: This is full-digital solution in contrast to FDM and WDM

02 38

Physical Layer/2.5 Telephone System

Multiplexing: TDM (2/3)


Example: The T1 system samples at 8000 Hz, and encodes each sample as a 7-bit number (i.e. 128 different values). With some extra control bits, we merge samples into 193-bit frames, every 125 sec:

193-bit frame (125 sec)

Channel 1

Channel 2

Channel 3

Channel 4

Channel 24

1 0

Bit 1 is a framing code

7 Data bits per channel per sample

Bit 8 is for signaling

02 39

Physical Layer/2.5 Telephone System

Multiplexing: TDM (3/3)


Observation: TDM also makes it easy to offer individual senders higher bandwidth, by simply putting more data into a frame, or to combine several trunks into higher-bandwidth trunks:

sender-1 sender-2

buffer buffer

frame

4 T1 streams in 40 51 4:1 62 73 1.544 Mbps T1 6.312 Mbps T2 6 5 4 32 10 1 T2 stream out

7 T2 streams in

6 T3 streams in

7:1

6:1

44.736 Mbps T3

274.176 Mbps T4

02 40

Physical Layer/2.5 Telephone System

Observation: T1 supports a total of 193 = 1.544 Mbps

1 125

106

Switching (1/2)
Circuit switching: Make a true physical connection from sender to receiver. This is what happens in traditional telephone systems. Packet switching: (1) Split any data (i.e. message) into small packets, (2) route those packets separately from sender to receiver, and (3) assemble them again.
Physical (copper) connection set up when call is made

(a)

Switching office
Computer Packets queued for subsequent transmission

Computer (b)

02 41

Physical Layer/2.5 Telephone System

Switching (2/2)
Variation: Store-and-forward switching a message is completely received at a router, stored, and then put into an outgoing queue for further routing
Call request signal

Propagation delay

Pkt 1 Msg Pkt 2 Pkt 1 Pkt 3 Pkt 2 Msg Queuing delay Pkt 1 Pkt 3 Pkt 2 Pkt 3 Msg

Time spent hunting for an outgoing trunk Call accept signal Data

Time AB trunk A

BC trunk B (a) C

CD trunk D A B (b) C D A B (c) C D

(a) circuit-switching; (b) store-and-forward; (c) packet-switching


02 42 Physical Layer/2.5 Telephone System

Switching: Comparison

02 43

Physical Layer/2.5 Telephone System

Advanced Mobile Phone System


Cells: The whole idea is to break up an area into small regional cells, each having their own frequency range, and such that no two adjacent cells have the same frequency. Observation: The approach is pretty good for handling different densities; the problem is frequency allocation and energy emission (you cant stop a signal at a cell border)

B B G A F E G A F E D D B C C F E G A D C

(a)

(b)

02 44

Physical Layer/2.6 Mobile Telephone System

GSM (1/2)
GSM: Global System for Mobile communications, is used in Europe and is a full-blown digital cellular radio transmission system. A cell has one or more base stations, and uses a unique set of frequencies. GSM uses 124 downlink channels, and 124 uplink channels per cell, each channel multiplexed by TDM:
TDM frame 959.8 MHz
q q q

Channel 124 Base to mobile

935.4 MHz 935.2 MHz Frequency

2 1

914.8 MHz
q q q

124 Mobile to base

890.4 MHz 890.2 MHz Time

2 1

Note: this gives 8 124 992 full duplex channels. A lot of them are not used to avoid interference with neighboring cells.
02 45 Physical Layer/2.6 Mobile Telephone System

GSM (2/2)
There are also separate channels for: broadcasting cell info (so that a mobile station can see whether it has changed cells).

cell maintenance (the base station has to know whos in its cell).

call setup (incoming, and outgoing).

02 46

Physical Layer/2.6 Mobile Telephone System

CDMA (1/2)
Code Division Multiple Access allows transmissions to be interleaved, but avoids interference. Note that this means inherently no message collision. Principle: Assign a chip sequence to a station, which is just an m-bit code. Make sure that all chip sequences are pairwise orthogonal: rewrite a binary 0 as -1, and a binary 1 as +1.

for every two chip sequences S and T: 1 m m i 1 SiTi 0. send a 1 bit as your chip sequence (S), and a 0 bit as the inverse (S). just transmit your bits when a new bit time slot starts the (possibly inversed) chip sequences are just added. getting the original value means taking the inner product of the original chip sequence with the signal sent.
Physical Layer/2.6 Mobile Telephone System

02 47

A: 0 0 0 1 1 0 1 1 B: 0 0 1 0 1 1 1 0 C: 0 1 0 1 1 1 0 0 D: 0 1 0 0 0 0 1 0 (a) Six examples: 1 11 10 101 1111 1101

C B+C A+B A+B+C A+B+C+D A+B+C+D (c)

S1 q C = (1 +1 +1 +1 +1 +1 +1 +1)/8 = 1 S2 q C = (2 +0 +0 +0 +2 +2 +0 +2)/8 = 1 S3 q C = (0 +0 +2 +2 +0 2 +0 2)/8 = 0 S4 q C = ( 1 +1 +3 +3 +1 1 +1 1)/8 = 1 S5 q C = (4 +0 +2 +0 +2 +0 2 +2)/8 = 1 S6 q C = (2 2 +0 2 +0 2 4 +0)/8 = 1 (d)

Question: doesnt this look a lot like linear algebra?


02 48 Physical Layer/2.6 Mobile Telephone System

CDMA (2/2)
A: (1 1 1 +1 +1 1 +1 +1) B: (1 1 +1 1 +1 +1 +1 1) C: (1 +1 1 +1 +1 +1 1 1) D: (1 +1 1 1 1 1 +1 1) (b)

S1 = (1 +1 1 +1 +1 +1 1 1) S2 = (2 0 0 0 +2 +2 0 2) S3 = ( 0 0 2 +2 0 2 0 +2) S4 = ( 1 +1 3 +3 +1 1 1 +1) S5 = (4 0 2 0 +2 0 +2 2) S6 = ( 2 2 0 2 0 2 +4 0)

Cable Television
Switch High-bandwidth fiber trunk Fiber node Coaxial cable

Headend Tap House Fiber

(a)

House Toll office High-bandwidth fiber trunk End office Local loop

Fiber Copper twisted pair (b)

Observation: Cable requires sharing whereas the telephone system does not.
02 49 Physical Layer/2.7 Cable Television

Cable Television: Principle


Essence: Its quite simple: theres a lot of unused bandwidth that can be allocated to sending bits over the wire:
5 42 54 88 0
Upstream data

108 TV FM TV

550

750 MHz Downstream data

Upstream frequencies

Downstream frequencies

Note: Because downstream (television) starts at 54 MHz, there is limited bandwidth that can be used for upstream data.

02 50

Physical Layer/2.7 Cable Television

Cable Television Streams


Observation: The downstream data always comes from one source, which makes it easier to handle. Upstream data requires that subscribers contend for available slots:

02 51

Physical Layer/2.7 Cable Television

You might also like