Transcript

1

IntroductionIntroduction

Basic conceptsBasic concepts TerminologyTerminology

2

Ubiquitous ComputingUbiquitous Computing

Computers everywhere.Computers everywhere. Also means ubiquitous communicationAlso means ubiquitous communication

– Users connected anywhere/anytime.Users connected anywhere/anytime.– PC (laptop, palmtop) equivalent to cell phone.PC (laptop, palmtop) equivalent to cell phone.

Networking computers together is critical!Networking computers together is critical!

3

Computer NetworkComputer Network Provide access to local and remote resources.Provide access to local and remote resources. Collection of interconnected end systems: Collection of interconnected end systems:

– Computing devices (mainframes, workstations, Computing devices (mainframes, workstations, PCs, palm tops)PCs, palm tops)

– Peripherals (printers, scanners, terminals).Peripherals (printers, scanners, terminals). Applications: location transparency.Applications: location transparency.

4

Computer Networks (cont’d)Computer Networks (cont’d)

Components: Components: – End systems (or hosts),End systems (or hosts),– Routers/switches/bridges, and Routers/switches/bridges, and – Links (twisted pair, coaxial cable, fiber, radio, Links (twisted pair, coaxial cable, fiber, radio,

etc.).etc.).

5

Communication ModelCommunication Model

Network

Source Destination

6

ExampleExample

PTN

Source DestinationModem Modem

Source System Destination System

PTN: Public Telephone Network

7

Connecting End SystemsConnecting End Systems

Dedicated link

Multiple access / shared medium

8

Connecting End Systems (cont’d)Connecting End Systems (cont’d)

Router

Switched network

Router: switching element; a.k.a., IMPs (InterfaceMessage Processors) in ARPAnet’s terminology.

9

Shared Communication Shared Communication InfrastructureInfrastructure

Shared medium:Shared medium:– Examples: ethernet, radio.Examples: ethernet, radio.– How to acquire channel: medium access control How to acquire channel: medium access control

protocols.protocols. Switched networks:Switched networks:

– Shared infrastructure consisting of point-to-Shared infrastructure consisting of point-to-point links.point links.

– Circuit- versus packet-switching.Circuit- versus packet-switching.

10

Circuit SwitchingCircuit Switching

Establish dedicated path (circuit) between source and Establish dedicated path (circuit) between source and destination.destination.

Example: telephone network.Example: telephone network. +’s: dedicated resources(stream-oriented).+’s: dedicated resources(stream-oriented). -’s: lower resource utilization (e.g.,bursts).-’s: lower resource utilization (e.g.,bursts).

11

Packet SwitchingPacket Switching

Data split into transmission units, or Data split into transmission units, or packets.packets. Routers: store packets briefly store packets and forward Routers: store packets briefly store packets and forward

them: store-and-forward.them: store-and-forward. Efficient resource use: statistical multiplexing.Efficient resource use: statistical multiplexing. Ability to accommodate bursts.Ability to accommodate bursts.

S1 D1

S2 D2

12

(Switched) Network Topologies(Switched) Network Topologies

StarRing Tree

Irregular

13

ProtocolProtocol

Set of rules that allow peering entities to Set of rules that allow peering entities to communicate.communicate.– Example: 2 friends talking on the phone.Example: 2 friends talking on the phone.– Peering entities or peers: user application Peering entities or peers: user application

programs, file transfer services, e-mail services, programs, file transfer services, e-mail services, etc.etc.

14

Network ArchitectureNetwork Architecture

Protocol layers: reduce design complexity.Protocol layers: reduce design complexity. Main idea: each layer uses the services from Main idea: each layer uses the services from

lower layer and provide services to upper lower layer and provide services to upper layer.layer.– Higher layer shielded from the implementation Higher layer shielded from the implementation

details of lower layers.details of lower layers.– Interface between layers must be clearly Interface between layers must be clearly

defined: services provided to upper layer.defined: services provided to upper layer.

15

Example 1: ISO OSI ModelExample 1: ISO OSI Model

ISO: International Standards OrganizationISO: International Standards Organization OSI: Open Systems Interconnection.OSI: Open Systems Interconnection.

Physical

Data link

Network

Transport

Session

Presentation

Application

16

OSI ISO 7-Layer ModelOSI ISO 7-Layer Model

Physical layer: transmission of bits.Physical layer: transmission of bits. Data link layer: reliable transmission over Data link layer: reliable transmission over

physical medium; synchronization, error physical medium; synchronization, error control, flow control; media access in control, flow control; media access in shared medium.shared medium.

Network layer: routing and forwarding; Network layer: routing and forwarding; congestion control; internetworking.congestion control; internetworking.

17

OSI ISO 7-Layer Model (cont’d)OSI ISO 7-Layer Model (cont’d)

Transport layer: error, flow, and congestion Transport layer: error, flow, and congestion control end-to-end. control end-to-end.

Session layer: manages connections Session layer: manages connections (sessions) between end points.(sessions) between end points.

Presentation layer: data representation.Presentation layer: data representation. Application layer: provides users with Application layer: provides users with

access to the underlying communication access to the underlying communication infrastructure.infrastructure.

18

Example 2: TCP/IP ModelExample 2: TCP/IP Model

Model employed by the Internet.Model employed by the Internet.

Physical

Data link

Network

Transport

Session

Presentation

ApplicationApplication

Transport

Internet

NetworkAccess

Physical

TCP/IP ISO OSI

19

TCP/IP Protocol Suite:TCP/IP Protocol Suite:

Physical layer: same as OSI ISO model.Physical layer: same as OSI ISO model. Network access layer: medium access and Network access layer: medium access and

routing over single network.routing over single network. Internet layer: routing across multiple Internet layer: routing across multiple

networks, or, an internet.networks, or, an internet. Transport layer: end-to-end error, Transport layer: end-to-end error,

congestion, flow control functions.congestion, flow control functions. Application layer: same as OSI ISO model.Application layer: same as OSI ISO model.

20

The Internet: Some HistoryThe Internet: Some History

Late 1970’s/ early 1980’s: the ARPANET (funded by Late 1970’s/ early 1980’s: the ARPANET (funded by ARPA).ARPA).– Connecting university, research labs and some government Connecting university, research labs and some government

agencies.agencies.– Main applications: e-mail and file transfer.Main applications: e-mail and file transfer.

Features:Features:– Decentralized, non-regulated system.Decentralized, non-regulated system.– No centralized authority.No centralized authority.– No structure.No structure.– Network of networks.Network of networks.

21

The Internet (cont’d)The Internet (cont’d)

Early 1990’s, the Web caused the Internet Early 1990’s, the Web caused the Internet revolution: the Internet’s killer app!revolution: the Internet’s killer app!

Today:Today:– Almost 60 million hosts as of 01.99.Almost 60 million hosts as of 01.99.– Doubles every year.Doubles every year.

22

Topics for Further ReadingTopics for Further Reading

Some Internet governing entities:Some Internet governing entities:– IABIAB– IETFIETF– IRTFIRTF

The Internet’s standardization process.The Internet’s standardization process. Other network standardization bodies.Other network standardization bodies. Other networks (Bitnet, SNA, etc).Other networks (Bitnet, SNA, etc).

23

Physical Layer Physical Layer

Sending raw bits across “the wire”.Sending raw bits across “the wire”. Issues:Issues:

– What’s being transmitted.What’s being transmitted.– Transmission medium.Transmission medium.

24

Basic ConceptsBasic Concepts

Signal: electro-magnetic wave carrying Signal: electro-magnetic wave carrying information.information.

Time domain: signal as a function of time.Time domain: signal as a function of time.– Analog signal: signal’s amplitude varies Analog signal: signal’s amplitude varies

continuously over time, ie, no discontinuities.continuously over time, ie, no discontinuities.– Digital signal: data represented by sequence of Digital signal: data represented by sequence of

0’s and 1’s (e.g., square wave).0’s and 1’s (e.g., square wave).

25

Time DomainTime Domain

Periodic signals:Periodic signals:– Same signal pattern repeats over time.Same signal pattern repeats over time.– Example: sine waveExample: sine wave

» Amplitude (A)Amplitude (A)» Period (or frequency) (T = 1/f)Period (or frequency) (T = 1/f)» PhasePhase

)()(

)2sin()(

tsTts

ftAts

26

Frequency DomainFrequency Domain

Signal consists of components of different Signal consists of components of different frequencies.frequencies.

Spectrum of signal: range of frequencies Spectrum of signal: range of frequencies signal contains.signal contains.

Absolute bandwidth: width of signal’s Absolute bandwidth: width of signal’s spectrum. spectrum.

27

Example:Example:

))3(2sin(3/1)2sin()( 11 tftfts

Spectrum of Spectrum of S(f) S(f) extends from fextends from f11 to 3f to 3f11..

Bandwidth is 2fBandwidth is 2f1.1.

S(f)

f1 2 3

28

Bandwidth and Data RateBandwidth and Data Rate

Data rate: rate at which data is transmitted; Data rate: rate at which data is transmitted; unit is bits/sec or bps (applies to digital unit is bits/sec or bps (applies to digital signal).signal).– Example: 2Mbits/sec, or 2Mbps.Example: 2Mbits/sec, or 2Mbps.

Digital signal has infinite frequency Digital signal has infinite frequency components, thus infinite bandwidth.components, thus infinite bandwidth.

If data rate of signal is If data rate of signal is WW bps, good bps, good representation achieved with representation achieved with 2W2W Hz Hz bandwidth. bandwidth.

29

Baud versus Data RateBaud versus Data Rate

Baud rate: number of times per second Baud rate: number of times per second signal changes its value (voltage).signal changes its value (voltage).

Each value might “carry” more than 1 bit.Each value might “carry” more than 1 bit.– Example: 8 values of voltage (0..7); each value Example: 8 values of voltage (0..7); each value

conveys 3 bits, ie, number of bits = logconveys 3 bits, ie, number of bits = log22V.V.

Thus, bit rate = logThus, bit rate = log22V * baud rate.V * baud rate.

For 2 levels, bit rate = baud rate.For 2 levels, bit rate = baud rate.

30

Data Transmission 1Data Transmission 1 Analog and digital transmission.Analog and digital transmission.

– Example of analog data: voice and video.Example of analog data: voice and video.– Example of digital data: character stringsExample of digital data: character strings

» Use of codes to represent characters as sequence of bits Use of codes to represent characters as sequence of bits (e.g., ASCII).(e.g., ASCII).

Historically, communication infrastructure for Historically, communication infrastructure for analog transmission.analog transmission.– Digital data needed to be converted: modems Digital data needed to be converted: modems

(modulator-demodulator).(modulator-demodulator).

31

Digital TransmissionDigital Transmission

Current trend: digital transmission.Current trend: digital transmission.– Cost efficient: advances in digital circuitry Cost efficient: advances in digital circuitry

(VLSI).(VLSI). Advantages:Advantages:

– Data integrity: better noise immunity.Data integrity: better noise immunity.– Security: easier to integrate encryption Security: easier to integrate encryption

algorithms.algorithms.– Channel utilization: higher degree of Channel utilization: higher degree of

multiplexing (time-division mux’ing).multiplexing (time-division mux’ing).

32

Transmission ImpairmentsTransmission Impairments

Cause received signal to differ from Cause received signal to differ from original, transmitted signal.original, transmitted signal.– Analog data: quality degradationAnalog data: quality degradation– Digital data: bit errors.Digital data: bit errors.

Types of impairments:Types of impairments:– Attenuation.Attenuation.– Delay distortion.Delay distortion.– Noise.Noise.

33

Attenuation 1Attenuation 1

Weakening of the signal’s power as it Weakening of the signal’s power as it propagates through medium.propagates through medium.

Function of medium typeFunction of medium type– Guided medium: logarithmic with distance. Guided medium: logarithmic with distance. – Unguided medium: more complex (function of Unguided medium: more complex (function of

distance and atmospheric conditions).distance and atmospheric conditions).

34

Attenuation 2Attenuation 2

Problems and solutions:Problems and solutions:– Insufficient signal strength for receiver to Insufficient signal strength for receiver to

interpret it: use amplifiers/repeaters to interpret it: use amplifiers/repeaters to boost/regenerate signal.boost/regenerate signal.

– Error due to noise interference (level is not high Error due to noise interference (level is not high enough to be distinguished from noise): use enough to be distinguished from noise): use amplifiers/repeaters.amplifiers/repeaters.

– Attenuation increases with frequency: special Attenuation increases with frequency: special amplifiers to amplify high-frequencies.amplifiers to amplify high-frequencies.

35

Delay DistortionDelay Distortion

Speed of propagation in guided media Speed of propagation in guided media varies with frequency.varies with frequency.– Different frequency components arrive at Different frequency components arrive at

receiver at different times.receiver at different times. Solution: equalization techniques to Solution: equalization techniques to

equalize distortion for different frequencies.equalize distortion for different frequencies.

36

NoiseNoise

Noise: undesired signals inserted anywhere Noise: undesired signals inserted anywhere in the source/destination path.in the source/destination path.

Different categories: thermal (white), Different categories: thermal (white), crosstalk, impulse, etc.crosstalk, impulse, etc.

37

Decibel and Signal-to-Noise Decibel and Signal-to-Noise RatioRatio

Decibel (dB): measures relative strength of Decibel (dB): measures relative strength of 2 signals.2 signals.– Example: SExample: S11 and S and S22 with powers P with powers P11 and P and P22..

NNdBdB = 10 log = 10 log1010 (P (P11/P/P22))

Signal-to-noise ratio (S/N):Signal-to-noise ratio (S/N):– Measures signal quality.Measures signal quality.

– S/NS/NdBdB = 10 log = 10 log10 10 (signal power/noise power)(signal power/noise power)

38

Channel Capacity 1Channel Capacity 1

Rate at which data can be transmitted over Rate at which data can be transmitted over communication channel.communication channel.

Noise-free channel: Nyquist TheoremNoise-free channel: Nyquist Theorem– Limitation of data rate is signal’s bandwidth.Limitation of data rate is signal’s bandwidth.– Given channel bandwidth Given channel bandwidth WW, highest signal rate , highest signal rate

(or baud rate) is (or baud rate) is 2W2W..– From receiver’s point of view: sampling at rate From receiver’s point of view: sampling at rate

2W 2W can reconstruct signal.can reconstruct signal.

39

Channel Capacity 2Channel Capacity 2

Using data rate,Using data rate,– C = 2W logC = 2W log22V, where V is number voltage levels.V, where V is number voltage levels.

Same bandwidth, increasing number of signal Same bandwidth, increasing number of signal levels, increases data rate, but more complex levels, increases data rate, but more complex signal recognition at receiver and more noise-signal recognition at receiver and more noise-prone.prone.

This is a theoretical upper bound, since This is a theoretical upper bound, since channels are noisy.channels are noisy.

40

Channel Capacity 3Channel Capacity 3

Noisy channel: Shannon’s TheoremNoisy channel: Shannon’s Theorem– Given channel with Given channel with WW (Hz) bandwidth and (Hz) bandwidth and S/NS/N

(dB) signal-to-noise ratio, C (bps) is(dB) signal-to-noise ratio, C (bps) is» C = W logC = W log22 (1+S/N) (1+S/N)

– Theoretical upper bound since assumes only Theoretical upper bound since assumes only thermal noise (no impulse noise, etc).thermal noise (no impulse noise, etc).

41

Transmission MediaTransmission Media

Physically connect transmitter and receiver Physically connect transmitter and receiver carrying signals in the form electromagnetic carrying signals in the form electromagnetic waves.waves.

Types of media:Types of media:– Guided: waves guided along solid medium such as Guided: waves guided along solid medium such as

copper twisted pair, coaxial cable, optical fiber.copper twisted pair, coaxial cable, optical fiber.– Unguided: “wireless” transmission (atmosphere, Unguided: “wireless” transmission (atmosphere,

outer space).outer space).

42

Guided Media: Examples 1Guided Media: Examples 1

Twisted Pair:Twisted Pair:– 2 insulated copper wires arranged in regular spiral. 2 insulated copper wires arranged in regular spiral.

Typically, several of these pairs are bundled into a Typically, several of these pairs are bundled into a cable.cable.

– Cheapest and most widely used; limited in Cheapest and most widely used; limited in distance, bandwidth, and data rate.distance, bandwidth, and data rate.

– Applications: telephone system (home-local Applications: telephone system (home-local exchange connection).exchange connection).

– Unshielded and shielded twisted pair.Unshielded and shielded twisted pair.

43

Examples 2Examples 2

Coaxial CableCoaxial Cable– Hollow outer cylinder conductor surrounding Hollow outer cylinder conductor surrounding

inner wire conductor; dielectric (non-conducting) inner wire conductor; dielectric (non-conducting) material in the middle.material in the middle.

– Applications: cable TV, long-distance telephone Applications: cable TV, long-distance telephone system, LANs.system, LANs.

– +’s: Higher data rates and frequencies, better +’s: Higher data rates and frequencies, better interference and crosstalk immunity.interference and crosstalk immunity.

– -’s: Attenuation and thermal noise.-’s: Attenuation and thermal noise.

44

Examples 3Examples 3

Optical FiberOptical Fiber– Thin, flexible cable that conducts optical Thin, flexible cable that conducts optical

waves.waves.– Applications: long-distance Applications: long-distance

telecommunications, LANs.telecommunications, LANs.– +’s: greater capacity, smaller and lighter, lower +’s: greater capacity, smaller and lighter, lower

attenuation, better isolation, attenuation, better isolation,

45

Unguided, Wireless MediaUnguided, Wireless Media

Microwave: directional, LOS transmission.Microwave: directional, LOS transmission. Satellite: directional, LOS, large delay, high Satellite: directional, LOS, large delay, high

bandwidth.bandwidth. Radio: omnidirectional (broadcast), single hop Radio: omnidirectional (broadcast), single hop

(cellular), multi-hop (ad hoc net’s).(cellular), multi-hop (ad hoc net’s). Infrared: directional, LOS transmission, Infrared: directional, LOS transmission,

cannot penetrate obstacles and used outdoors.cannot penetrate obstacles and used outdoors.

Chapter 4 EE/CS 450 Fall 99 46

Data EncodingData Encoding

Transforming original signal just before Transforming original signal just before transmission.transmission.

Both analog and digital data can be encoded Both analog and digital data can be encoded into either analog or digital signals.into either analog or digital signals.

47

Digital/Analog EncodingDigital/Analog Encoding

Source Destination

Encoder Decoder

Source System Destination System

g(t) g(t)

(D/A)

Source Destination

Modulator Demodulator

Source System Destination System

g(t) g(t)

(D/A)

Digital Medium

Analog Medium

Encoding:

Modulation:

48

Encoding ConsiderationsEncoding Considerations

Digital signaling can use modern digital Digital signaling can use modern digital transmission infrastructure.transmission infrastructure.

Some media like fiber and unguided media Some media like fiber and unguided media only carry analog signals.only carry analog signals.

Analog-to-analog conversion used to shift Analog-to-analog conversion used to shift signal to use another portion of spectrum signal to use another portion of spectrum for better channel utilization (frequency for better channel utilization (frequency division mux’ing).division mux’ing).

49

Digital Transmission Digital Transmission TerminologyTerminology

Data element: bit.Data element: bit. Signaling element: encoding of data Signaling element: encoding of data

element for transmission.element for transmission. Unipolar signaling: signaling elements have Unipolar signaling: signaling elements have

same polarization (all + or all -).same polarization (all + or all -). Polar signaling: different polarization for Polar signaling: different polarization for

different elements.different elements.

50

More TerminologyMore Terminology

Data rate: rate in bps at which data is Data rate: rate in bps at which data is transmitted; for data rate of R, bit duration transmitted; for data rate of R, bit duration (time to emit 1 bit) is 1/R sec.(time to emit 1 bit) is 1/R sec.

Modulation rate = baud rate (rate at which Modulation rate = baud rate (rate at which signal levels change).signal levels change).

51

Digital Transmission: Receiver-Digital Transmission: Receiver-Side IssuesSide Issues

Clocking: determining the beginning and Clocking: determining the beginning and end of each bit.end of each bit.– Transmitting long sequences of 0’s or 1’s can Transmitting long sequences of 0’s or 1’s can

cause synchronization problems.cause synchronization problems. Signal level: determining whether the signal Signal level: determining whether the signal

represents the high (logic 1) or low (logic 0) represents the high (logic 1) or low (logic 0) levels.levels.– S/N ratio is a factor.S/N ratio is a factor.

52

Comparing Digital Encoding Comparing Digital Encoding TechniquesTechniques

Signal spectrum: high frequency means Signal spectrum: high frequency means high bandwidth required for transmission.high bandwidth required for transmission.

Clocking: transmitted signal should be self-Clocking: transmitted signal should be self-clocking.clocking.

Error detection: built in the encoding Error detection: built in the encoding scheme.scheme.

Noise immunity: low bit error rate.Noise immunity: low bit error rate.

53

Digital-to-Digital Encoding Digital-to-Digital Encoding TechniquesTechniques

Nonreturn to Zero (NRZ)Nonreturn to Zero (NRZ) Multilevel BinaryMultilevel Binary BiphaseBiphase ScramblingScrambling

54

NRZ TechniquesNRZ Techniques

Use of 2 different voltage levels.Use of 2 different voltage levels. NRZ-L: positive voltage represents one binary NRZ-L: positive voltage represents one binary

value; negative voltage, the other.value; negative voltage, the other. NRZI (Nonreturn to zero, invert on ones): NRZI (Nonreturn to zero, invert on ones):

transition (low-to-high or high-to-low) transition (low-to-high or high-to-low) represents “1”; no transition, “0”. represents “1”; no transition, “0”.

NRZI is an example of differential encoding: NRZI is an example of differential encoding: decoding based on comparing polarity of decoding based on comparing polarity of adjacent signal elements. adjacent signal elements.

55

Multilevel BinaryMultilevel Binary

Use more than 2 signal levels.Use more than 2 signal levels. Bipolar-AMI: “0”: no signal; “1”: positive and Bipolar-AMI: “0”: no signal; “1”: positive and

negative pulse; consecutive “1”s alternate in negative pulse; consecutive “1”s alternate in polarity: avoid synchronization loss.polarity: avoid synchronization loss.

Pseudoternary: opposite representation.Pseudoternary: opposite representation. Long sequence of 0’s or 1’s still a problem for Long sequence of 0’s or 1’s still a problem for

bipolar-AMI and pseudoternary respectively.bipolar-AMI and pseudoternary respectively.

56

BiphaseBiphase

Manchester: transition in the middle of bit period.Manchester: transition in the middle of bit period.– Carries data and provides clocking.Carries data and provides clocking.

– Low-to-high: “1”.Low-to-high: “1”.

– High-to-low: “0”.High-to-low: “0”.

Differential Manchester:Differential Manchester:– Mid-bit transition only provides clocking.Mid-bit transition only provides clocking.

– ““0”: transition in the beginning of bit interval.0”: transition in the beginning of bit interval.

– ““1”: no transition.1”: no transition.

57

ScramblingScrambling

Avoid long sequences of 0’s or 1’s.Avoid long sequences of 0’s or 1’s. Bipolar with 8-zeros substitution (B8ZS)Bipolar with 8-zeros substitution (B8ZS)

– Inserts transitions when transmitting 8 consecutive “0”s.Inserts transitions when transmitting 8 consecutive “0”s.

High-density bipolar-3 zeros (HDB3)High-density bipolar-3 zeros (HDB3)– Inserts pulses when transmitting 4 consecutive “0”s.Inserts pulses when transmitting 4 consecutive “0”s.

Receiver must recognize insertions and re-generate Receiver must recognize insertions and re-generate original signal.original signal.

58

Digital-to-Analog EncodingDigital-to-Analog Encoding

Transmission of digital data using analog Transmission of digital data using analog signaling.signaling.

Example: data transmission of a PTN.Example: data transmission of a PTN. PTN: voice signals ranging from 300Hz to PTN: voice signals ranging from 300Hz to

3400 Hz.3400 Hz. Modems: convert digital data to analog Modems: convert digital data to analog

signals and back.signals and back. Techniques: ASK, FSK, and PSK.Techniques: ASK, FSK, and PSK.

59

Amplitude-Shift KeyingAmplitude-Shift Keying

2 binary values represented by 2 2 binary values represented by 2 amplitudes.amplitudes.

Typically, “0” represented by absence of Typically, “0” represented by absence of carrier and “1” by presence of carrier.carrier and “1” by presence of carrier.

Prone to errors caused by amplitude Prone to errors caused by amplitude changes.changes.

60

Frequency-Shift KeyingFrequency-Shift Keying

2 binary values represented by 2 2 binary values represented by 2 frequencies.frequencies.

Frequencies Frequencies ff11 and and ff2 2 are offset fromare offset from carrier carrier

frequency by same amount in opposite frequency by same amount in opposite directionsdirections..

Less error prone than ASK.Less error prone than ASK.

"0"),2cos()(

"1"),2cos()(

2

1

tfAts

tfAts

61

Phase-Shift KeyingPhase-Shift Keying

Phase of carrier is shifted to represent data.Phase of carrier is shifted to represent data. Example: 2-phase system.Example: 2-phase system.

Phase shift of 90Phase shift of 90oo can represent more bits: can represent more bits: aka, quadrature PSK.aka, quadrature PSK.

"0"),2cos()(

"1"),2cos()(

tfAts

tfAts

c

c

62

Analog-to-Digital EncodingAnalog-to-Digital Encoding

Analog data transmitted as digital signal, or Analog data transmitted as digital signal, or digitization.digitization.

Codec: device used to encode and decode Codec: device used to encode and decode analog data into digital signal, and back.analog data into digital signal, and back.

2 main techniques: 2 main techniques: – Pulse code modulation (PCM).Pulse code modulation (PCM).– Delta modulation (DM).Delta modulation (DM).

63

Pulse Code Modulation 1Pulse Code Modulation 1

Based on Nyquist (or sampling) theorem: if Based on Nyquist (or sampling) theorem: if f(t) sampled at rate > 2*signal’s highest f(t) sampled at rate > 2*signal’s highest frequency, then samples contain all the frequency, then samples contain all the original signal’s information.original signal’s information.

Example: if voice data is limited to 4000Hz, Example: if voice data is limited to 4000Hz, 8000 samples/sec are sufficient to 8000 samples/sec are sufficient to reconstruct original signal.reconstruct original signal.

64

PCM 2PCM 2

Analog signal -> PAM -> PCM.Analog signal -> PAM -> PCM.– PAM: pulse amplitude modulation; samples of PAM: pulse amplitude modulation; samples of

original analog signal.original analog signal.– PCM: quantization of PAM pulses; amplitude PCM: quantization of PAM pulses; amplitude

of PAM pulses approximated by of PAM pulses approximated by nn-bit integer; -bit integer; each pulse carries each pulse carries nn bits. bits.

65

Delta Modulation (DM)Delta Modulation (DM)

Analog signal approximated by staircase Analog signal approximated by staircase function moving up or down by 1 function moving up or down by 1 quantization level every sampling interval.quantization level every sampling interval.

Bit stream produced based on derivative of Bit stream produced based on derivative of analog signal (and not its amplitude): “1” if analog signal (and not its amplitude): “1” if staircase goes up, “0” otherwise.staircase goes up, “0” otherwise.

Parameters: sampling rate and step size.Parameters: sampling rate and step size.

66

Analog-to-Analog EncodingAnalog-to-Analog Encoding

Combines input signal Combines input signal m(t)m(t) and carrier at f and carrier at fcc

producing producing s(t)s(t) centered at f centered at fcc..

Why modulate analog data?Why modulate analog data?– Shift signal’s frequency for effective transmission.Shift signal’s frequency for effective transmission.– Allows channel multiplexing: frequency-division Allows channel multiplexing: frequency-division

multiplexing.multiplexing. Modulation techniques: AM, FM, and PM.Modulation techniques: AM, FM, and PM.

67

Amplitude Modulation (AM)Amplitude Modulation (AM)

Carrier serves as envelope to signal being Carrier serves as envelope to signal being modulated.modulated.

Signal m(t) is being modulated by carrier Signal m(t) is being modulated by carrier cos(2cos(2 f fcct).t).

Modulation index: ratio between amplitude Modulation index: ratio between amplitude of input signal to carrier.of input signal to carrier.

)2cos()](1[)( tftmtS cAM

68

Angle ModulationAngle Modulation

FM and PM are special cases of angle FM and PM are special cases of angle modulation.modulation.

FM: carrier’s amplitude kept constant while FM: carrier’s amplitude kept constant while its frequency is varied according to message its frequency is varied according to message signal.signal.

PM: carrier’s phase varies linearly with PM: carrier’s phase varies linearly with modulating signal m(t).modulating signal m(t).

69

Spread Spectrum 1Spread Spectrum 1

Used to transmit analog or digital data using Used to transmit analog or digital data using analog signaling.analog signaling.

Spread information signal over wider Spread information signal over wider spectrum to make jamming and spectrum to make jamming and eavesdropping more difficult.eavesdropping more difficult.

Popular in wireless communicationsPopular in wireless communications

70

Spread Spectrum 2Spread Spectrum 2

2 schemes:2 schemes:– Frequency hopping: signal broadcast over Frequency hopping: signal broadcast over

random sequence of frequencies, hoping from random sequence of frequencies, hoping from one frequency to the next rapidly; receiver must one frequency to the next rapidly; receiver must do the same.do the same.

– Direct Sequence: each bit in original signal Direct Sequence: each bit in original signal represented by series of bits in the transmitted represented by series of bits in the transmitted signal.signal.

Chapter 5 EE/CS 450 Fall 99 71

Transmission ModesTransmission Modes

Assuming serial transmission, ie, one Assuming serial transmission, ie, one signaling element sent at a time.signaling element sent at a time.

Also assuming that 1 signaling element Also assuming that 1 signaling element represents 1 bit.represents 1 bit.

Source and receiver must be in sync.Source and receiver must be in sync. 2 schemes:2 schemes:

– asynchronous andasynchronous and– synchronous transmission.synchronous transmission.

72

Asynchronous Xmission 1Asynchronous Xmission 1

Avoid synchronization problem by Avoid synchronization problem by including sync information explicitly.including sync information explicitly.

Character consists of a fixed number of bits, Character consists of a fixed number of bits, depending on the code used.depending on the code used.

Synchronization happens for every Synchronization happens for every character: start (“0”) and stop (“1”) bits.character: start (“0”) and stop (“1”) bits.

Line is idle: transmits “1”. Line is idle: transmits “1”.

73

Asynchronous Xmission 2Asynchronous Xmission 2

Example: sending “ABC” in ASCIIExample: sending “ABC” in ASCII0 10000010 1 0 01000010 1 0 110000 1 1111…0 10000010 1 0 01000010 1 0 110000 1 1111…

Timing requirements are not strict.Timing requirements are not strict. But problems may occur.But problems may occur.

– Significant clock drifts + high data rate = Significant clock drifts + high data rate = reception errors.reception errors.

Also, 2 or more bits for synchronization: Also, 2 or more bits for synchronization: overhead!overhead!

74

Synchronous Xmission 1Synchronous Xmission 1

No start or stop bits.No start or stop bits. Synchronization via:Synchronization via:

– Separate clock signal provided by transmitter or Separate clock signal provided by transmitter or receiver; doesn’t work well over long distances.receiver; doesn’t work well over long distances.

– Embed clocking information in data signal Embed clocking information in data signal using appropriate encoding technique such as using appropriate encoding technique such as Manchester or Differential Manchester.Manchester or Differential Manchester.

75

Synchronous Xmission 2Synchronous Xmission 2

Need to identify start/end of data block.Need to identify start/end of data block. Block starts with preamble (8-bit flag) and Block starts with preamble (8-bit flag) and

may end with postamble.may end with postamble. Other control information may be added for Other control information may be added for

data link layer.data link layer.

8 -bitflag

8 -bitflag

Control ControlData

Chapter 6 EE/CS 450 Fall 99 76

Data Link LayerData Link Layer

So far, sending signals over transmission So far, sending signals over transmission medium.medium.

Data link layer: responsible for error-free Data link layer: responsible for error-free (reliable) communication between adjacent (reliable) communication between adjacent nodes.nodes.

Functions: framing, error control, flow Functions: framing, error control, flow control, addressing (in multipoint medium).control, addressing (in multipoint medium).

77

Flow ControlFlow Control

What is it?What is it?– Ensures that transmitter does not overrun Ensures that transmitter does not overrun

receiver: limited receiver buffer space.receiver: limited receiver buffer space.– Receiver buffers data to process before passing Receiver buffers data to process before passing

it up.it up.– If no flow control, receiver buffers may fill up If no flow control, receiver buffers may fill up

and data may get dropped.and data may get dropped.

78

Stop-and-Wait Stop-and-Wait

Simplest form of flow control.Simplest form of flow control.– Transmitter sends frame and waits.Transmitter sends frame and waits.

– Receiver receives frame and sends ACK.Receiver receives frame and sends ACK.

– Transmitter gets ACK, sends other frame, and waits, until Transmitter gets ACK, sends other frame, and waits, until no more frames to send.no more frames to send.

Good when few frames. Good when few frames. Problem: inefficient link utilization.Problem: inefficient link utilization.

– In the case of high data rates or long propagation delays.In the case of high data rates or long propagation delays.

79

Sliding Window 1Sliding Window 1

Allows multiple frames to be in transit at Allows multiple frames to be in transit at the same time.the same time.

Receiver allocates buffer space for Receiver allocates buffer space for nn frames.frames.

Transmitter is allowed to send Transmitter is allowed to send nn (window (window size) frames without receiving ACK.size) frames without receiving ACK.

Frame sequence number: labels frames.Frame sequence number: labels frames.

80

Sliding Window 2Sliding Window 2

Receiver ack’s frame by including sequence Receiver ack’s frame by including sequence number of next expected frame.number of next expected frame.

Cumulative ACK: ack’s multiple frames.Cumulative ACK: ack’s multiple frames. Example: if receiver receives frames 2,3, Example: if receiver receives frames 2,3,

and 4, it sends an ACK with sequence and 4, it sends an ACK with sequence number 5, which ack’s receipt of 2, 3, and number 5, which ack’s receipt of 2, 3, and 4.4.

81

Sliding Window 3Sliding Window 3

Sender maintains sequence numbers it’s Sender maintains sequence numbers it’s allowed to send; receiver maintains allowed to send; receiver maintains sequence number it can receive. These lists sequence number it can receive. These lists are sender and receiver windows.are sender and receiver windows.

Sequence numbers are bounded; if frame Sequence numbers are bounded; if frame reserves k-bit field for sequence numbers, reserves k-bit field for sequence numbers, then they can range from 0 … 2then they can range from 0 … 2kk -1 and are -1 and are modulo 2modulo 2kk. .

82

Sliding Window 4Sliding Window 4

Transmission window shrinks each time Transmission window shrinks each time frame is sent, and grows each time an ACK frame is sent, and grows each time an ACK is received.is received.

83

Example: 3-bit sequence number Example: 3-bit sequence number and window size 7and window size 7

A BA B0 1 2 3 4 5 6 7 0 1 2 3 4... 0 1 2 3 4 5 6 7 0 1 2 3 40 1 2 3 4 5 6 7 0 1 2 3 4... 0 1 2 3 4 5 6 7 0 1 2 3 4

01

20 1 2 3 4 5 6 7 0 1 2 3 4

0 1 2 3 4 5 6 7 0 1 2 3 4RR3

0 1 2 3 4 5 6 7 0 1 2 3 4

3456RR40 1 2 3 4 5 6 7 0 1 2 3 4

0 1 2 3 4 5 6 7 0 1 2 3 4

0 1 2 3 4 5 6 7 0 1 2 3 4

0 1 2 3 4 5 6 7 0 1 2 3 4 0 1 2 3 4 5 6 7 0 1 2 3 4

84

Sliding Window (cont’d)Sliding Window (cont’d)

RR RR nn acknowledges up to frame acknowledges up to frame n-1n-1.. There is also RNR There is also RNR nn, which ack’s up to , which ack’s up to

frame frame n-1n-1 but no longer accepts more but no longer accepts more frames.frames.

RNR shuts down the receive window and RNR shuts down the receive window and consequently the transmission window.consequently the transmission window.

Need subsequent RR to re-open window.Need subsequent RR to re-open window.

85

PiggybackingPiggybacking

When both endpoints transmit, each keeps 2 When both endpoints transmit, each keeps 2 windows, transmitter and receiver windows.windows, transmitter and receiver windows.

Each send data and need to send ACKs.Each send data and need to send ACKs. When sending data, transmitter can When sending data, transmitter can

“piggyback” the acknowledgment “piggyback” the acknowledgment information.information.

When no data, send just the ACK.When no data, send just the ACK.

86

Duplicate ACKsDuplicate ACKs

When no data, must re-send last ACK. When no data, must re-send last ACK. Duplicate ACKs: report potential errors.Duplicate ACKs: report potential errors.

87

Error DetectionError Detection

Transmission impairments lead to Transmission impairments lead to transmission errors: change of 1 or more transmission errors: change of 1 or more bits in transmitted frame.bits in transmitted frame.

Transmission errors defined using Transmission errors defined using probabilities: transmission medium probabilities: transmission medium modeled as a statistical system.modeled as a statistical system.

88

Error Probabilities 1Error Probabilities 1

Definitions:Definitions:– PPbb probability of single bit error (bit error rate); probability of single bit error (bit error rate);

constant and independent for each bit.constant and independent for each bit.

– PP11 probability frame received with no errors. probability frame received with no errors.

– PP22 probability frame received with 1 or more probability frame received with 1 or more

undetected errors.undetected errors.

– PP33 probability frame received with 1 or more probability frame received with 1 or more

detected bit errors, but no undetected ones.detected bit errors, but no undetected ones.

89

Error Probabilities 2Error Probabilities 2

If no error detection mechanism, PIf no error detection mechanism, P33 = 0. = 0.

PP11 = (1 - P = (1 - Pbb))FF and P and P22 = (1- P = (1- P11), where F is ), where F is

size of frame in bits.size of frame in bits. PP11 decreases as P decreases as Pbb increases. increases.

PP11 decreases as F increases. decreases as F increases.

90

ExampleExample

64-kbps ISDN channel’s bit error rate is less 64-kbps ISDN channel’s bit error rate is less than 10than 10-6-6. User requirement of at most 1 frame . User requirement of at most 1 frame with undetected bit error per day. Frame is with undetected bit error per day. Frame is 1000 bits.1000 bits.– In a day, 5.529 x 10In a day, 5.529 x 1066 frames transmitted. frames transmitted.– RequiredRequired frame error rate of 1/ 5.529 x 10 frame error rate of 1/ 5.529 x 1066, or P, or P22

= 0.18 x 10= 0.18 x 10-6-6..– But PBut Pbb = 10 = 10-6-6, so P, so P11 = (1-P = (1-Pbb))FF = 0.999 and P = 0.999 and P22 = 1 - = 1 -

PP11 = 10 = 10-3-3, which is >>> required P, which is >>> required P22

91

Error Detection Schemes Error Detection Schemes

Transmitter adds additional bits for error detection.Transmitter adds additional bits for error detection. Transmitter computes error detection bits as function Transmitter computes error detection bits as function

of original data.of original data. Receiver performs same calculation and compares Receiver performs same calculation and compares

results. If mismatch, then error.results. If mismatch, then error. PP33 probability error detection scheme detects error; P probability error detection scheme detects error; P22

residual error rate or probability error goes residual error rate or probability error goes undetected.undetected.

92

ParityParity

Simplest error detection scheme.Simplest error detection scheme. Append parity bit to data block.Append parity bit to data block. Example: ASCII transmissionExample: ASCII transmission

– 1 parity bit appended to each 7-bit ASCII 1 parity bit appended to each 7-bit ASCII character.character.

– Even parity: 8-bit code has even number of 1’s.Even parity: 8-bit code has even number of 1’s.– Odd parity: 8-bit code has odd number of 1’s.Odd parity: 8-bit code has odd number of 1’s.

93

Parity Check Parity Check

Example: transmitting ASCII “G” (1110001) Example: transmitting ASCII “G” (1110001) using odd parity.using odd parity.– Code transmitted is 11100011.Code transmitted is 11100011.– Receiver checks received code and if odd number Receiver checks received code and if odd number

of 1’s, assumes no error.of 1’s, assumes no error.– Suppose it receives 11000011, then detects error.Suppose it receives 11000011, then detects error.– NOTE: If more than 2 bits in error, may not be NOTE: If more than 2 bits in error, may not be

detected.detected.

94

Cyclic Redundancy CheckCyclic Redundancy Check

CRC is one of the most effective and common CRC is one of the most effective and common error detecting schemes.error detecting schemes.

Let M be Let M be mm-bit message, G (-bit message, G (r+1)r+1)-bit pattern.-bit pattern.– Transmitter appends Transmitter appends rr 0’s to M, 2 0’s to M, 2rr*M.*M.– Divide 2Divide 2rr*M by G and add remainder to 2*M by G and add remainder to 2rr*M *M

forming T (m+r bits), which is transmitted.forming T (m+r bits), which is transmitted.– Receiver computes T/G; if remainder, then error.Receiver computes T/G; if remainder, then error.

95

CRC ExampleCRC Example

Frame M 1010001101 = xFrame M 1010001101 = x99+x+x77+x+x33+x+x22+x+x00.. Pattern G 110101.Pattern G 110101. Dividing (frame*2Dividing (frame*25)5) by pattern results in by pattern results in

01110.01110. Thus T 101000110101110.Thus T 101000110101110. Receiver can detect errors unless received Receiver can detect errors unless received

message Tmessage Trr is divisible by G. is divisible by G.

96

CRCCRC

Patterns are expressed as polynomials G(x).Patterns are expressed as polynomials G(x). Example: Example:

– CRC-16 = xCRC-16 = x1616+x+x1515+x+x22+1+1– CRC-CCITT = XCRC-CCITT = X1616+x+x1212+x+x55+1+1

97

CRC-Based DetectionCRC-Based Detection

If suitably selected polynomials, CRC can If suitably selected polynomials, CRC can detect:detect:– All single-bit errors.All single-bit errors.– All double-bit errors, as long as P(X) has at least All double-bit errors, as long as P(X) has at least

three 1’s.three 1’s.– Any odd number of errors as long as P(X) Any odd number of errors as long as P(X)

contains factor (X+1).contains factor (X+1).– Any burst error whose length is <= sizeof(FCS).Any burst error whose length is <= sizeof(FCS).

98

Error ControlError Control Mechanisms to detect and correct transmission Mechanisms to detect and correct transmission

errors.errors. Consider 2 types of errors:Consider 2 types of errors:

– Lost frame: frame is sent but never arrives.Lost frame: frame is sent but never arrives.– Damaged frame: frame arrives but in error.Damaged frame: frame arrives but in error.

Error control: combination of error detection, Error control: combination of error detection, feedback (ACK or NACK) from receiver, and feedback (ACK or NACK) from receiver, and retransmission by source.retransmission by source.

Coupled with flow control feedback.Coupled with flow control feedback.

99

ARQARQ

ARQ: automatic repeat request.ARQ: automatic repeat request. Works by creating a reliable data link from Works by creating a reliable data link from

an unreliable one.an unreliable one. 3 versions:3 versions:

– Stop-and-wait ARQ.Stop-and-wait ARQ.– Go-back-N ARQ.Go-back-N ARQ.– Selective-reject ARQ.Selective-reject ARQ.

100

Stop-and-Wait ARQStop-and-Wait ARQ

Single outstanding frame at any time.Single outstanding frame at any time. Simple but inefficient.Simple but inefficient. Use of timers to trigger retransmission of data Use of timers to trigger retransmission of data

or ACKs.or ACKs. 2 types of errors:2 types of errors:

– Damaged or lost frame.Damaged or lost frame.– Damaged or lost ACK.Damaged or lost ACK.

Sequence numbers alternate between 0 and 1.Sequence numbers alternate between 0 and 1.

101

Stop-and-Wait ARQ: ExampleStop-and-Wait ARQ: Example

Sender ReceiverFrame 0

ACK1

Frame 1ACK 0

Frame 0

Timeout

Frame 0

ACK 1

Timeout

Frame 0

ACK 1 B discards duplicate.

102

Go-Back-N ARQGo-Back-N ARQ

Variation of sliding window for error control.Variation of sliding window for error control. Allows a window’s worth of frames to be in Allows a window’s worth of frames to be in

transit at any time.transit at any time. RR: ack’s receipt of frame.RR: ack’s receipt of frame. REJ: negative acknowledgment indicating the REJ: negative acknowledgment indicating the

frame in error.frame in error. Destination discards frame in error plus Destination discards frame in error plus

subsequent frames.subsequent frames.

103

Go-Back-N ARQ ExampleGo-Back-N ARQ Example

S R S Rf0

f1f2

rr3f3

f4

f5rr4

Errorf6

rej5f7

f5f6

rr6 f7

5, 6, 7rexm.

f7

f0

f1rr0

rr(P bit=1)

rr2

f2

Timeout

Discarded

104

Go-Back-N ARQ IssuesGo-Back-N ARQ Issues

For For kk-bit sequence number, maximum -bit sequence number, maximum window size is (2window size is (2kk-1).-1).– If window size is too large, ACKs may be If window size is too large, ACKs may be

ambiguous: not clear if ACK is a duplicate ambiguous: not clear if ACK is a duplicate ACK (errors occurred).ACK (errors occurred).

– Example: 3-bit sequence number and 8 -frame Example: 3-bit sequence number and 8 -frame window.window.

» Source transmits f0, gets back rr1, then sends f1--f0, Source transmits f0, gets back rr1, then sends f1--f0, and gets back another rr1. ???and gets back another rr1. ???

105

Selective-Reject ARQSelective-Reject ARQ

Only frames transmitted are the ones that Only frames transmitted are the ones that are NACK’ed (SREJ) or that timeout.are NACK’ed (SREJ) or that timeout.

More efficient than Go-Back-N regarding More efficient than Go-Back-N regarding amount of reXmissions.amount of reXmissions.

But, receiver must buffer out-of-order But, receiver must buffer out-of-order frames.frames.

More restriction on maximum window size; More restriction on maximum window size; for k-bit sequence #’s, 2for k-bit sequence #’s, 2k-1k-1 window. window.

106

Example Data Link Layer Example Data Link Layer ProtocolProtocol

High-Level Data Link Control (HDLC)High-Level Data Link Control (HDLC)– Widely-used (ISO standard).Widely-used (ISO standard).– Single frame format.Single frame format.– Synchronous transmission.Synchronous transmission.

107

HDLC: Frame FormatHDLC: Frame Format

– Flag: frame delimiters (01111110).Flag: frame delimiters (01111110).– Address field for multipoint links.Address field for multipoint links.– 16-bit or 32-bit CRC.16-bit or 32-bit CRC.– Refer to book (pages 176-185) for more details.Refer to book (pages 176-185) for more details.

8bits

8ext.

8 or16

variable 16 or32

8

flag address control data FCS flag

108

Other DLL Protocols 1Other DLL Protocols 1

LAPB: Link Access Procedure, Balanced.LAPB: Link Access Procedure, Balanced.– Part of the X.25 standard.Part of the X.25 standard.– Subset of HDLC.Subset of HDLC.– Link between user system and switch.Link between user system and switch.– Same frame format as HDLC.Same frame format as HDLC.

LAPD: Link Access Procedure, D-Channel.LAPD: Link Access Procedure, D-Channel.– Part of the ISDN standard.Part of the ISDN standard.

109

Other DLL Protocols 2Other DLL Protocols 2

LLC: Logical Link Control.LLC: Logical Link Control.– Part of the 802 protocol family for LANs.Part of the 802 protocol family for LANs.– Link control functions divided between the Link control functions divided between the

MAC layer and the LLC layer.MAC layer and the LLC layer.– LLC layer operates on top of MAC layer.LLC layer operates on top of MAC layer.

Dst.MACaddr

Src.MACaddr

FCSDst.LLCaddr

Src.LLCaddr

LLCctl. DataMAC

control

110

Other DLL Protocols 3Other DLL Protocols 3

SLIP: Serial Line IPSLIP: Serial Line IP– Dial-up protocol.Dial-up protocol.– No error control.No error control.– Not standardized.Not standardized.

PPP: Point-to-Point ProtocolPPP: Point-to-Point Protocol– Internet standard for dial-up connections.Internet standard for dial-up connections.– Provides framing similar to HDLC.Provides framing similar to HDLC.

111

MultiplexingMultiplexing

Sharing a link/channel among multiple Sharing a link/channel among multiple source-destination pairs.source-destination pairs.

Example: high-capacity long-distance Example: high-capacity long-distance trunks (fiber, microwave links) carry trunks (fiber, microwave links) carry multiple connections at the same time.multiple connections at the same time.

MU

X

...

DE

MU

X ...

112

Multiplexing TechniquesMultiplexing Techniques

3 basic types:3 basic types:– Frequency-Division Multiplexing (FDM).Frequency-Division Multiplexing (FDM).– Time-Division Multiplexing (TDM).Time-Division Multiplexing (TDM).– Statistical Time-Division Multiplexing Statistical Time-Division Multiplexing

(STDM).(STDM).

113

FDM 1FDM 1

High bandwidth medium when compared to High bandwidth medium when compared to signals to be transmitted.signals to be transmitted.

Widely used (e.g., TV, radio).Widely used (e.g., TV, radio). Various signals carried simultaneously Various signals carried simultaneously

where each one modulated onto different where each one modulated onto different carrier frequency, or carrier frequency, or channelchannel..

Channels separated by Channels separated by guard bandsguard bands (unused) to prevent interference.(unused) to prevent interference.

114

FDM 2FDM 2

Time

Frequency

1 2 N

115

TDM 1TDM 1

TDM or synchronous TDM.TDM or synchronous TDM. High data rate medium when compared to High data rate medium when compared to

signals to be transmitted.signals to be transmitted.

Time

Frequency

12

N

116

TDM 2 TDM 2

Time divided into time slots.Time divided into time slots. Frame consists of cycle of time slots.Frame consists of cycle of time slots. In each frame, 1 or more slots assigned to a In each frame, 1 or more slots assigned to a

data source.data source.

1 2 N... 1 2 ... N

frame Time

U1 U2 ... UN

117

TDM 3TDM 3

No control info at this level.No control info at this level. Flow and error control?Flow and error control?

– To be provided on a per-channel basis.To be provided on a per-channel basis.– Use DLL protocol such as HDLC.Use DLL protocol such as HDLC.

Examples: SONET (Synchronous Optical Examples: SONET (Synchronous Optical Network) for optical fiber.Network) for optical fiber.

+’s: simple, fair.+’s: simple, fair. -’s: inefficient.-’s: inefficient.

118

Statistical TDM 1Statistical TDM 1 Or asynchronous TDM.Or asynchronous TDM. Dynamically allocates time slots on demand.Dynamically allocates time slots on demand. NN input lines in statistical multiplexer, but input lines in statistical multiplexer, but

only only kk slots on TDM frame, where slots on TDM frame, where k < nk < n.. Multiplexer scans input lines collecting data Multiplexer scans input lines collecting data

until frame is filled.until frame is filled. Demultiplexer receives frame and distributes Demultiplexer receives frame and distributes

data accordingly.data accordingly.

119

STDM 2STDM 2

Data rate on mux’ed line < sum of data Data rate on mux’ed line < sum of data rates from all input lines.rates from all input lines.

Can support more devices than TDM using Can support more devices than TDM using same link.same link.

Problem: peak periods.Problem: peak periods.– Solution: multiplexers have some buffering Solution: multiplexers have some buffering

capacity to hold excess data.capacity to hold excess data.– Tradeoff data rate and buffer size (response Tradeoff data rate and buffer size (response

time).time).

120

Local Area Networks 1Local Area Networks 1

Interconnect devices over short distances.Interconnect devices over short distances.– Within same floor,Within same floor,– Building,Building,– Campus.Campus.

Characterized by low delays.Characterized by low delays.

121

LANs 2LANs 2

Typically use broadcast medium.Typically use broadcast medium.– Hosts share same communication medium.Hosts share same communication medium.– Also called multiple-access networks.Also called multiple-access networks.

LANs are characterized by:LANs are characterized by:– Topology.Topology.– Transmission medium.Transmission medium.– Medium access control mechanism.Medium access control mechanism.

122

LAN Protocol ArchitectureLAN Protocol Architecture

LAN protocol standards collectively known LAN protocol standards collectively known as IEEE 802 reference model.as IEEE 802 reference model.

Physical

Data link

Network

Transport

Session

Presentation

Application

PhysicalMACLLC

OSI

IEEE802

Upper layerprotocols

123

LAN ProtocolsLAN Protocols

MAC sublayer: performs functions that MAC sublayer: performs functions that control access to shared medium.control access to shared medium.

LLC: performs flow and error control and LLC: performs flow and error control and provides services to upper layer.provides services to upper layer.

124

802 standards 1802 standards 1

Text book page 367.Text book page 367. LLC: IEEE 802.2LLC: IEEE 802.2

– connectionless and connection oriented connectionless and connection oriented services.services.

– Reliable and unreliable.Reliable and unreliable.

125

802 standards 2802 standards 2

MAC + physical layersMAC + physical layers– 802.3802.3 802.5 802.5

» Bus/tree/star topologies.Bus/tree/star topologies. Ring topology. Ring topology.

» CSMA/CD.CSMA/CD. Token ring. Token ring.

– 802.4802.4 FDDI FDDI» Bus/tree/star topologies.Bus/tree/star topologies. Dual bus (optical).Dual bus (optical).

» Token bus.Token bus. Token ring. Token ring.

– 802.11802.11» Wireless.Wireless.

» CSMA.CSMA.

126

EncapsulationEncapsulation

Application data

header

header

header

header

TCP

IP

LLC

MAC MACtrailer

TCP segmentIP datagram

LLC PDUMAC frame

127

MAC Frame FormatMAC Frame Format

Dst.MACaddr

Src.MACaddr

CRCDst.LLCaddr

Src.LLCaddr

LLC PDUMACcontrol

MAC control: protocol information (protocol type, version #).Destination MAC address: physical address of LAN destination.Source MAC address: physical address of the LAN source.

128

LAN TopologiesLAN Topologies

Star

Central node

Ring

Bus

Tree

129

Bus TopologyBus Topology

Use of multipoint medium.Use of multipoint medium. Stations attach to bus through Stations attach to bus through taptap..

– Full-duplex communication allows data to be sent Full-duplex communication allows data to be sent to/received from bus.to/received from bus.

Transmission from any station propagates in Transmission from any station propagates in both directions and is received by all.both directions and is received by all.– At each end, At each end, terminatorterminator absorbs and removes absorbs and removes

signal from bus.signal from bus.

130

Tree TopologyTree Topology

Tree is generalization of bus.Tree is generalization of bus. Headend: start of 1 or more cables Headend: start of 1 or more cables

(branches).(branches). Transmission from one station propagates Transmission from one station propagates

to all others.to all others.

131

Issues Issues

Inherently, broadcast.Inherently, broadcast.– Frames to transmit data.Frames to transmit data.– Need for specifying the destination.Need for specifying the destination.– Addresses.Addresses.

Multi-access.Multi-access.– Need for controlling access to medium.Need for controlling access to medium.

» Avoid collisions.Avoid collisions.

» MAC protocol.MAC protocol.

132

Ring Topology 1Ring Topology 1

Stations attach to Stations attach to repeatersrepeaters.. Repeaters are linked to each other by point-Repeaters are linked to each other by point-

to-point links forming a closed loop.to-point links forming a closed loop. Links are unidirectional.Links are unidirectional. Repeaters: receive data from one link and Repeaters: receive data from one link and

repeat it on the other with no buffering.repeat it on the other with no buffering.

133

Ring 2Ring 2

Stations transmit/receive via repeater.Stations transmit/receive via repeater. Frames circulate past all stations; Frames circulate past all stations;

destination copies frame as it goes by; destination copies frame as it goes by; source removes frame.source removes frame.

Ring shared by multiple stations.Ring shared by multiple stations.– Need MAC protocol.Need MAC protocol.

» Determine when each station may insert frame.Determine when each station may insert frame.

134

Star TopologyStar Topology

Each station directly connected to central node Each station directly connected to central node via point-to-point link.via point-to-point link.

Central node’s modes of operation:Central node’s modes of operation:– Broadcast mode: node broadcasts received frame Broadcast mode: node broadcasts received frame

on all other links; logically works like bus.on all other links; logically works like bus.– Switching mode: node sends frame out only on the Switching mode: node sends frame out only on the

link to the destination.link to the destination. Central node as single-point of failure.Central node as single-point of failure.

135

Medium Access ControlMedium Access Control

Control access to shared medium.Control access to shared medium. Where and how?Where and how? Where: centralized versus decentralized.Where: centralized versus decentralized. How: synchronous versus asynchronous.How: synchronous versus asynchronous.

136

Centralized versus Distributed Centralized versus Distributed MACMAC

Centralized approaches:Centralized approaches:– Controller grants access to medium.Controller grants access to medium.– Simple, greater control: priorities, qos.Simple, greater control: priorities, qos.– But, single point of failure and performance But, single point of failure and performance

bottleneck. bottleneck. Decentralized schemes:Decentralized schemes:

– All stations collectively run MAC to decide All stations collectively run MAC to decide when to transmit.when to transmit.

137

Synchronous versus Synchronous versus AsynchronousAsynchronous

Synchronous approaches:Synchronous approaches:– Static channel allocation.Static channel allocation.– Examples: FDM, TDM.Examples: FDM, TDM.– Simple but inefficient.Simple but inefficient.

Asynchronous or dynamic: Asynchronous or dynamic: – Example: STDM.Example: STDM.– 3 categories: round-robin, reservation, and 3 categories: round-robin, reservation, and

contention.contention.

138

Round-Robin MACRound-Robin MAC

Each station is allowed to transmit; station may Each station is allowed to transmit; station may decline or transmit (bounded by some maximum decline or transmit (bounded by some maximum transmit time).transmit time).

Centralized (e.g., polling) or distributed control of Centralized (e.g., polling) or distributed control of who is next to transmit.who is next to transmit.

When done, station relinquishes and right to transmit When done, station relinquishes and right to transmit goes to next station.goes to next station.

Efficient when many stations have data to transmit Efficient when many stations have data to transmit over extended period (stream).over extended period (stream).

139

ReservationReservation

Time divided into slots.Time divided into slots. Station reserves slots in the future.Station reserves slots in the future. Multiple slots for extended transmissions.Multiple slots for extended transmissions. Suited to stream traffic.Suited to stream traffic.

140

ContentionContention

No control.No control. Stations try to acquire the medium.Stations try to acquire the medium. Distributed in nature.Distributed in nature. Perform well for bursty traffic.Perform well for bursty traffic. Can get very inefficient under heavy load.Can get very inefficient under heavy load.

NOTE: round-robin and contention are the most NOTE: round-robin and contention are the most common. common.

141

Standardized MACsStandardized MACs

TopologiesBus Ring

Round robin

Reservation

Contention

Token bus(802.4)Polling (802.11)

DQDB(802.6)

CSMA/CD(802.3)CSMA(802.11)

Token ring(802.5; FDDI)

Techniques

142

LLC for LANsLLC for LANs

Similar functions as general LLCs.Similar functions as general LLCs. But it has to interface with MAC sublayer.But it has to interface with MAC sublayer. LLC functions:LLC functions:

– Addressing: source and destination.Addressing: source and destination.» LLC address versus MAC address.LLC address versus MAC address.

– Control data exchange between 2 users.Control data exchange between 2 users.» User as higher-layer protocol in the station.User as higher-layer protocol in the station.

143

LLC ServicesLLC Services

3 different services:3 different services:– Unacknowledged connectionless (type 1).Unacknowledged connectionless (type 1).

» No error or flow control.No error or flow control.

» No delivery guarantees.No delivery guarantees.

– Connection-mode (type 2).Connection-mode (type 2).» Logical connection established.Logical connection established.

» Flow and congestion control provided.Flow and congestion control provided.

– Acknowledged connectionless (type 3).Acknowledged connectionless (type 3).» No logical connection.No logical connection.

» Flow and error control.Flow and error control.

144

LLC (802.2) ProtocolLLC (802.2) Protocol

Similar to HDLC (ISO standard).Similar to HDLC (ISO standard). LLC PDU:LLC PDU:

DSAP SSAP LLC control Information

1 byte 1 byte 1 or 2 bytes variable

145

Wireless LANsWireless LANs

Use wireless transmission media.Use wireless transmission media.– Infrared (IR): limited to indoors and single Infrared (IR): limited to indoors and single

room (IR light doesn’t penetrate walls).room (IR light doesn’t penetrate walls).– RadioRadio

» Narrowband microwave.Narrowband microwave.

» Spread Spectrum LANs.Spread Spectrum LANs.

For wireless LAN technology comparison, For wireless LAN technology comparison, see table on page 398.see table on page 398.

146

Wireless LAN ApplicationsWireless LAN Applications

Nomadic access (e.g., users roaming around Nomadic access (e.g., users roaming around campus).campus).

LAN interconnection (e.g., across LAN interconnection (e.g., across buildings).buildings).

Ad Hoc Networks (e.g., disaster relief Ad Hoc Networks (e.g., disaster relief crew).crew).

147

MAC ProtocolsMAC Protocols

Contention-basedContention-based– ALOHA and Slotted ALOHA.ALOHA and Slotted ALOHA.– CSMA.CSMA.– CSMA/CD.CSMA/CD.

Round-robin : token-based protocols.Round-robin : token-based protocols.– Token bus.Token bus.– Token ring.Token ring.

148

The ALOHA ProtocolThe ALOHA Protocol

Developed @ U of Hawaii in early 70’s.Developed @ U of Hawaii in early 70’s. Packet radio networks.Packet radio networks. ““Free for all”: whenever station has a frame to send, Free for all”: whenever station has a frame to send,

it does so.it does so.– Station listens for maximum RTT for an ACK.Station listens for maximum RTT for an ACK.

– If no ACK, re-sends frame for a number of times and then If no ACK, re-sends frame for a number of times and then gives up.gives up.

– Receivers check FCS and destination address to ACK. Receivers check FCS and destination address to ACK.

149

CollisionsCollisions

Invalid frames may be caused by channel Invalid frames may be caused by channel noise or noise or

Because other station(s) transmitted at the Because other station(s) transmitted at the same time: same time: collisioncollision..

Collision happens even when the last bit of Collision happens even when the last bit of a frame overlaps with the first bit of the a frame overlaps with the first bit of the next frame.next frame.

150

ALOHA’s Performance 1ALOHA’s Performance 1

Timet0

t0+t t0+2t t0+3t

vulnerable

151

ALOHA’s Performance 2ALOHA’s Performance 2

S = G eS = G e-2G-2G, where S is the throughput (rate , where S is the throughput (rate of successful transmissions) and G is the of successful transmissions) and G is the offered load.offered load.

S = SS = Smaxmax = 1/2e = 0.184 for G=0.5. = 1/2e = 0.184 for G=0.5.

152

Slotted AlohaSlotted Aloha

Doubles performance of ALOHA.Doubles performance of ALOHA. Frames can only be transmitted at Frames can only be transmitted at

beginning of slot: “discrete” ALOHA.beginning of slot: “discrete” ALOHA. Vulnerable period is halved.Vulnerable period is halved. S = G eS = G e-G-G.. S = SS = Smaxmax = 1/e = 0.368 for G = 1. = 1/e = 0.368 for G = 1.

153

ALOHA ProtocolsALOHA Protocols

Poor utilization.Poor utilization. Key property of LANs: propagation delay Key property of LANs: propagation delay

between stations is small compared to frame between stations is small compared to frame transmission time.transmission time.

Consequence: stations can Consequence: stations can sensesense the the medium before transmitting.medium before transmitting.

154

Carrier-Sense Multiple Access Carrier-Sense Multiple Access (CSMA) 1(CSMA) 1

Station that wants to transmit first listens to Station that wants to transmit first listens to check if another transmission is in progress check if another transmission is in progress (carrier sense).(carrier sense).

If medium is in use, station waits; else, it If medium is in use, station waits; else, it transmits.transmits.

Collisions can still occur.Collisions can still occur. Transmitter waits for ACK; if no ACKs, Transmitter waits for ACK; if no ACKs,

retransmits.retransmits.

155

CSMA 2CSMA 2

Effective when average transmission time >> Effective when average transmission time >> propagation time.propagation time.

Collisions can occur only when 2 or more Collisions can occur only when 2 or more stations begin transmitting within short time.stations begin transmitting within short time.

If station transmits and no collisions during If station transmits and no collisions during the time leading edge of frame propagates to the time leading edge of frame propagates to farthest station, then NO collisions.farthest station, then NO collisions.

156

CSMA 3CSMA 3

Maximum utilization is function of frame Maximum utilization is function of frame size and propagation time.size and propagation time.– Longer frames or shorter propagation time, Longer frames or shorter propagation time,

higher utilization.higher utilization.

157

CSMA FlavorsCSMA Flavors

1-persistent CSMA (IEEE 802.3)1-persistent CSMA (IEEE 802.3)– If medium idle, transmit; if medium busy, wait If medium idle, transmit; if medium busy, wait

until idle; then transmit with p=1.until idle; then transmit with p=1.– If collision, waits random period to re-send.If collision, waits random period to re-send.

Non-persistent CSMA: Non-persistent CSMA: after collision, node after collision, node waits a random time before retransmitting.waits a random time before retransmitting.

P-persistent: P-persistent: when channel idle detected, when channel idle detected, transmits packet in the first slot with transmits packet in the first slot with pp..

158

CSMA/CD 1CSMA/CD 1

CSMA with collision detection.CSMA with collision detection. Problem: when frames collide, medium is Problem: when frames collide, medium is

unusable for duration of both (damaged) unusable for duration of both (damaged) frames.frames.

For long frames (when compared to For long frames (when compared to propagation time), considerable waste.propagation time), considerable waste.

What if station listens while transmitting?What if station listens while transmitting?

159

CSMA/CD ProtocolCSMA/CD Protocol

1. If medium idle, transmit; otherwise 2.1. If medium idle, transmit; otherwise 2.

2. If medium busy, wait until idle, then 2. If medium busy, wait until idle, then transmit with p=1.transmit with p=1.

3. If collision detected, transmit brief 3. If collision detected, transmit brief jamming signal and abort transmission.jamming signal and abort transmission.

4. After aborting, wait random time, try again.4. After aborting, wait random time, try again.

160

CSMA/CD PerformanceCSMA/CD Performance

Wasted capacity restricted to time to detect Wasted capacity restricted to time to detect collision.collision.

Time to detect collision < 2*maximum Time to detect collision < 2*maximum propagation delay.propagation delay.

Rule in CSMA/CD protocols: frames long Rule in CSMA/CD protocols: frames long enough to allow collision detection prior to enough to allow collision detection prior to end of transmission. end of transmission.

161

IEEE 802.3 LAN Standards IEEE 802.3 LAN Standards

802.3: 10 Mbps Ethernet.802.3: 10 Mbps Ethernet. 802.3u: 100Mbps (Fast) Ethernet.802.3u: 100Mbps (Fast) Ethernet. 802.3z: 1Gbps (Gigabit) Ethernet.802.3z: 1Gbps (Gigabit) Ethernet.

162

EthernetEthernet

Most popular CSMA/CD protocol.Most popular CSMA/CD protocol. 1-persistent.1-persistent. Developed at Xerox Parc (1976).Developed at Xerox Parc (1976). Different implementations (10Mbps):Different implementations (10Mbps):

– Notation: <bps><signaling><max seg size Notation: <bps><signaling><max seg size (100’s of meters)>(100’s of meters)>

– Table page 409.Table page 409.

163

Ethernet ImplementationsEthernet Implementations

10Base5 (thick net): 10Base5 (thick net): up to 500m up to 500m segments and 100 stations; coaxial segments and 100 stations; coaxial cable(10mm); baseband (Manchester); bus.cable(10mm); baseband (Manchester); bus.

10Base2 (thin net): 10Base2 (thin net): up to 200m segments up to 200m segments and 30 stations; coaxial cable(5mm); and 30 stations; coaxial cable(5mm); baseband (Manchester); busbaseband (Manchester); bus..

10BaseT: 10BaseT: up to 100m segments; up to 100m segments; unshielded TP; baseband (Manchester); unshielded TP; baseband (Manchester); star.star.

164

Baseband and BroadbandBaseband and Broadband

Signaling techniques.Signaling techniques. Baseband: signals transmitted without Baseband: signals transmitted without

modulation; digital signals represented by modulation; digital signals represented by different voltages (e.g., using Manchester different voltages (e.g., using Manchester encoding).encoding).

Broadband: analog signaling; if digital, Broadband: analog signaling; if digital, modulation required.modulation required.

165

Ethernet (cont’d)Ethernet (cont’d)

Multiple segments can be connected using Multiple segments can be connected using repeatersrepeaters..

Repeater

166

Ethernet Frame FormatEthernet Frame Format

Preamble DA SA Type Data CRC Postamble

Type: identifies upper layer protocol (for demux’ing)Data: 0-1500 bytes (min. is 46 bytes).DA and SA: destination and source addresses. Example: 6:2b:3e:0:0:1d Broadcast: all 1’s. Multicast: first bit is 1. Promiscuous mode: stations accept all frames.

8 6 6 2 4 1

167

Ethernet TransmissionEthernet Transmission

If channel idle:If channel idle:– Send frame immediately (p=1).Send frame immediately (p=1).– Waits Waits 2t2t between back-to-back transmissions. between back-to-back transmissions.

If channel busy:If channel busy:– Wait till free, then transmit (p=1).Wait till free, then transmit (p=1).

If collision:If collision:– Jam for 512 bits (for both ends to detect collision).Jam for 512 bits (for both ends to detect collision).– Waits for 0-2t (1st try), 0-4t (2nd try),...Waits for 0-2t (1st try), 0-4t (2nd try),...

168

Token Bus 1Token Bus 1

IEEE 802.4 (1985).IEEE 802.4 (1985). Token: special-purpose frame that Token: special-purpose frame that

circulatescirculates when all stations are idle. when all stations are idle. Physically, token bus is linear or tree-Physically, token bus is linear or tree-

shaped topology; logically, it operates as shaped topology; logically, it operates as ring.ring.

1 2

345

6

token

169

Token Bus 2Token Bus 2

In CSMA/CD (802.3) starvation may occur, In CSMA/CD (802.3) starvation may occur, i.e., stations can wait forever to transmit.i.e., stations can wait forever to transmit.

In token bus, every station has a chance to In token bus, every station has a chance to transmit (token).transmit (token).

No collisions! i.,e., contention-free.No collisions! i.,e., contention-free.

170

Token Bus 3Token Bus 3

Token passes around in pre-defined order. Token passes around in pre-defined order. Once station acquires token, it can start Once station acquires token, it can start

transmitting.transmitting. When done, passes the token onto next When done, passes the token onto next

station.station.

171

Token Bus 4Token Bus 4

Limited efficient due to passing of the Limited efficient due to passing of the token.token.

Issues:Issues:– Adding/removing stations.Adding/removing stations.– Lost token problem.Lost token problem.

172

Token Ring 1Token Ring 1

IEEE 802.5 and FDDI.IEEE 802.5 and FDDI. Most commonly used MAC protocol for Most commonly used MAC protocol for

ring topologies.ring topologies. Also uses special-purpose, circulating Also uses special-purpose, circulating

frame, or token (3 bytes).frame, or token (3 bytes). Station that wants to transmit waits till Station that wants to transmit waits till

token passes by.token passes by.

173

Token Ring 2Token Ring 2

When station wants to transmit:When station wants to transmit:– Waits for token.Waits for token.– Seizes it by changing 1 bit and token becomes Seizes it by changing 1 bit and token becomes

start-of-frame sequence.start-of-frame sequence.– Station appends remainder of frame.Station appends remainder of frame.

When station seizes token and begins When station seizes token and begins transmission, there’s no token on the ring; transmission, there’s no token on the ring; so nobody else can transmit. so nobody else can transmit.

174

Token Ring 3 Token Ring 3

Transmitting station inserts new token when:Transmitting station inserts new token when:– Station completes frame transmission andStation completes frame transmission and– Leading edge of frame returns to it after a round-Leading edge of frame returns to it after a round-

trip. trip. If ring length < frame length, 1st. condition If ring length < frame length, 1st. condition

implies 2nd.implies 2nd. 2nd. condition ensures only 1 data frame at a 2nd. condition ensures only 1 data frame at a

time on the ring.time on the ring.

175

Token Ring 4Token Ring 4

Under light load, inefficiency due to waiting Under light load, inefficiency due to waiting for the token to transmit.for the token to transmit.

Under heavy load, round-robin: fair and Under heavy load, round-robin: fair and efficient.efficient.

Issues:Issues:– Token maintenance.Token maintenance.

» Token loss or duplication.Token loss or duplication.» Monitoring station can be responsible for ring Monitoring station can be responsible for ring

maintenance (removing duplicates, inserting token)maintenance (removing duplicates, inserting token)

176

Token Ring Frame FormatToken Ring Frame Format

1SD AC FC DA SA Data FCS

1 1 2 or 6 2 or 6 4

SD: starting delimiter; indicates starting of frame.AC: access control; PPPTMRRR; PPP and RRR priority and reservation; M monitor bit; T token or data frame.FC: frame control; if LLC data or control.DA and SA: destination and source addresses.FCS: frame check sequence.

SD AC FC Token frame

ED: ending delimiter; contains the error detection bit E; containsframe continuation bit I (multiple frame transmissions).FS: frame status.

1 1

ED FS

177

Token Ring RevisitedToken Ring Revisited

Single priority: priority and reservation bits = 0.Single priority: priority and reservation bits = 0. Transmitter seizes token.Transmitter seizes token.

– Sets token bit to 1.Sets token bit to 1.

– Token’s SD and AC are first 2 fields.Token’s SD and AC are first 2 fields.

– Station transmits 1 or more frames.Station transmits 1 or more frames.

– Until done or token-holding timer expires.Until done or token-holding timer expires.

– When AC of last frame returns, sets token bit to 0, appends When AC of last frame returns, sets token bit to 0, appends ED: new token. ED: new token.

178

Detecting ErrorsDetecting Errors

Frame status bits (end delimiter).Frame status bits (end delimiter).– A bit: address recognized.A bit: address recognized.– C bit: frame copied.C bit: frame copied.

» A=0, C=0: destination non-existent or not active.A=0, C=0: destination non-existent or not active.

» A=1, C=0: destination exists but frame not copied.A=1, C=0: destination exists but frame not copied.

» A=1, C=1: frame received.A=1, C=1: frame received.

179

Token Ring PriorityToken Ring Priority

Optional priority mechanism in 802.5.Optional priority mechanism in 802.5. 3 priority bits: 8 priority levels.3 priority bits: 8 priority levels. Service priority: priority of current token.Service priority: priority of current token.

– Station can only transmit frame with priority >= Station can only transmit frame with priority >= service priority.service priority.

– Reservation bits allow station to influence Reservation bits allow station to influence priority levels trying to reserve next token.priority levels trying to reserve next token.

180

Early Token ReleaseEarly Token Release

Typically, station waits for frame to come Typically, station waits for frame to come back before issuing a new token.back before issuing a new token.

Problem: low ring utilization.Problem: low ring utilization. ETR option:ETR option:

– Station may release token as soon as it Station may release token as soon as it completes transmission.completes transmission.

181

Ethernet versus Token RingEthernet versus Token Ring

Token ring:Token ring:– Efficient at heavy traffic.Efficient at heavy traffic.– Guaranteed delay.Guaranteed delay.– Fair.Fair.– Supports priorities.Supports priorities.– But, ring/token maintenance overhead.But, ring/token maintenance overhead.

» Centralized monitoring.Centralized monitoring.

Ethernet is simple!Ethernet is simple!

182

High-Speed LANsHigh-Speed LANs

FDDIFDDI 100VG-AnyLAN100VG-AnyLAN Fast EthernetFast Ethernet Gigabit EthernetGigabit Ethernet

183

FDDI 1FDDI 1

Fiber Distributed Data Interface.Fiber Distributed Data Interface. Similar to 802.5 with some changes due to Similar to 802.5 with some changes due to

higher data rates.higher data rates. 100Mbps, token ring LAN.100Mbps, token ring LAN. Also suitable for MANs.Also suitable for MANs. Fiber or TP as transmission medium.Fiber or TP as transmission medium. Up to 100 repeaters and up to 2 Km (fiber) or Up to 100 repeaters and up to 2 Km (fiber) or

100m (TP) between repeaters.100m (TP) between repeaters.

184

FDDI 2FDDI 2

2 counter-rotating fiber rings; only one used 2 counter-rotating fiber rings; only one used for transmission; the other for reliability, for transmission; the other for reliability, i.e., self-healing ring.i.e., self-healing ring.

Normal operation

Under failure Line

failure

185

FDDI 3FDDI 3

DASSAS

CON

Primaryring

SecondaryringDAS: dual attachment

SAS: single attachmentCON: concentrator

186

FDDI 4FDDI 4

Basic differences to 802.5:Basic differences to 802.5:– Station waiting for token, seizes token by Station waiting for token, seizes token by

failing to repeat it (completely removes it). failing to repeat it (completely removes it). Original 802.5 technique impractical (high data Original 802.5 technique impractical (high data rate).rate).

– Station inserts new frame.Station inserts new frame.– Early token release by default.Early token release by default.

187

FDDI 5FDDI 5

FDDI can also be implemented using FDDI can also be implemented using twisted pair (copper): CDDI.twisted pair (copper): CDDI.– Cheaper.Cheaper.– 100m.100m.

THT: token holding time.THT: token holding time. TRT: token rotation time.TRT: token rotation time.

188

100VG-ANYLAN 1100VG-ANYLAN 1

VG: voice grade; ANYLAN: support multiple frame VG: voice grade; ANYLAN: support multiple frame types.types.

802.12 (uses new MAC scheme and not CSMA/CD).802.12 (uses new MAC scheme and not CSMA/CD). Intended to be 100Mbps extension to Ethernet like Intended to be 100Mbps extension to Ethernet like

100BASE-T.100BASE-T. MAC scheme: demand priority (determines order in MAC scheme: demand priority (determines order in

which nodes share network). which nodes share network). Supports both 802.3 and 802.5 frames.Supports both 802.3 and 802.5 frames.

189

100VG-ANYLAN 2100VG-ANYLAN 2

Topology: hierarchical star.Topology: hierarchical star.

Level 1 hub

Level 2 hub

Level 2 hub

190

MAC Protocol 1MAC Protocol 1

Single-hub networkSingle-hub network– Station issues request to central hub and waits Station issues request to central hub and waits

permission to transmit.permission to transmit.– High- and low-priority requests.High- and low-priority requests.– Hub scans its ports for requests in RR order, Hub scans its ports for requests in RR order,

e.g., port 1, 2,…, n; it keeps 2 separate pointers e.g., port 1, 2,…, n; it keeps 2 separate pointers for high- and low-priority traffic.for high- and low-priority traffic.

– Services high-priority requests in order; then Services high-priority requests in order; then low-priority ones.low-priority ones.

191

MAC Protocol 2MAC Protocol 2

Hierarchical topologyHierarchical topology

1.1 1.2

1.3.1 1.3.2 1.3.3

1.4

1.5.1 1.5.2 1.5.3

1.6 1.7

192

Fast EthernetFast Ethernet

100 Mbps Ethernet.100 Mbps Ethernet. IEEE 802.3u, 1995.IEEE 802.3u, 1995. Medium alternatives: 100BASE-TX Medium alternatives: 100BASE-TX

(twisted pair) 100BASE-FX (fiber).(twisted pair) 100BASE-FX (fiber). IEEE 802.3 MAC and frame format.IEEE 802.3 MAC and frame format. 10-fold increase in speed => 10-fold 10-fold increase in speed => 10-fold

reduction in diameter (200m).reduction in diameter (200m).

193

Gigabit EthernetGigabit Ethernet

IEEE 802.3z (1996).IEEE 802.3z (1996). Currently over fiber: 1000Base-F.Currently over fiber: 1000Base-F. Modified MAC layer due to high data rates.Modified MAC layer due to high data rates.

194

Wireless LANsWireless LANs

IEEE 802.11.IEEE 802.11. Distributed access control mechanism (DCF) Distributed access control mechanism (DCF)

based on CSMA with optional centralized based on CSMA with optional centralized control (PCF).control (PCF).

Physical Layer

DCF

PCFMAClayer

Contention-freeService (polling)

ContentionService(CSMA)

195

MAC in Wireless LANsMAC in Wireless LANs

Distributed coordination function (DCF) uses Distributed coordination function (DCF) uses CSMA-based protocol (e.g., ad hoc networks).CSMA-based protocol (e.g., ad hoc networks).

CD does not make sense in wireless.CD does not make sense in wireless.– Hard for transmitter to distinguish its own Hard for transmitter to distinguish its own

transmission from incoming weak signals and transmission from incoming weak signals and noise.noise.

Point coordination function (PCF) uses polling Point coordination function (PCF) uses polling to grant stations their turn to transmit (e.g., to grant stations their turn to transmit (e.g., cellular networks).cellular networks).

196

Switched EthernetSwitched Ethernet

Point-to-point connections to multi-port hub Point-to-point connections to multi-port hub acting like switch; no collisions.acting like switch; no collisions.

More efficient under high traffic load: break More efficient under high traffic load: break large shared Ethernet into smaller segments.large shared Ethernet into smaller segments.

Hub

Switch

197

LAN InterconnectionLAN Interconnection

Extend LAN coverage.Extend LAN coverage. Interconnect different types of LAN.Interconnect different types of LAN. Connect to an internetwork.Connect to an internetwork. Reliability and security. Reliability and security.

198

Interconnection SchemesInterconnection Schemes

Hubs or repeaters: Hubs or repeaters: physical-level physical-level interconnection.interconnection.– Devices repeat/amplify signal.Devices repeat/amplify signal.

– No buffering/routing capability.No buffering/routing capability.

Bridges: Bridges: link-layer interconnection.link-layer interconnection.– Store-and-forward frames to destination LAN.Store-and-forward frames to destination LAN.

– Need to speak protocols of LANs it interconnect.Need to speak protocols of LANs it interconnect.

RoutersRouters: network-layer interconnection.: network-layer interconnection.– Interconnect different types of networks.Interconnect different types of networks.

199

Bridges 1Bridges 1

Operate at the MAC layer.Operate at the MAC layer.– Interconnect LANs of the same type, orInterconnect LANs of the same type, or– LANs that speak different MAC protocols.LANs that speak different MAC protocols.

B1 4

5 8

Frames for5->8.

Frames for1->4

LAN A

LAN B

200

Bridges 2Bridges 2

Function:Function:– Listens to all frames on LAN A and accepts Listens to all frames on LAN A and accepts

those addressed to stations on LAN B.those addressed to stations on LAN B.– Using B’s MAC protocol retransmits the Using B’s MAC protocol retransmits the

frames onto B.frames onto B.– Does the same for B-to-A traffic.Does the same for B-to-A traffic.

201

Bridges 3Bridges 3

Behave like a station; have multiple Behave like a station; have multiple interfaces, 1 per LAN.interfaces, 1 per LAN.

Use destination address to forward unicast Use destination address to forward unicast frames; if destination is on the same LAN, frames; if destination is on the same LAN, drops frame; otherwise forwards it.drops frame; otherwise forwards it.

Forward all broadcast frames.Forward all broadcast frames. Have storage and routing capability.Have storage and routing capability.

202

Bridges 4Bridges 4

No additional encapsulation.No additional encapsulation. But they may have to do header conversion But they may have to do header conversion

if interconnecting different LANs (e.g., if interconnecting different LANs (e.g., 802.3 to 802.4 frame).802.3 to 802.4 frame).

May interconnect more than 2 LANs.May interconnect more than 2 LANs. LANs may be interconnected by more than LANs may be interconnected by more than

1 bridge.1 bridge.

203

Bridge Protocol ArchitectureBridge Protocol Architecture

IEEE 802.1D specification for MAC IEEE 802.1D specification for MAC bridges.bridges.

PHYMACLLC

Station

LAN LANBridge Station

MAC

PHYPHYMAC

LLC

PHY

204

Routing with BridgesRouting with Bridges

Bridge decides to relay frame based on Bridge decides to relay frame based on destination MAC address.destination MAC address.

If only 2 LANs, decision is simple.If only 2 LANs, decision is simple. If more complex topologies, routing is If more complex topologies, routing is

needed, i.e., frame may traverse more than needed, i.e., frame may traverse more than 1 bridge.1 bridge.

205

Routing Routing

Determining where to send frame so that it Determining where to send frame so that it reaches the destination.reaches the destination.

Routing by learning: adaptive or backward Routing by learning: adaptive or backward learning.learning.

206

Note on Terminology: Repeaters Note on Terminology: Repeaters and Bridgesand Bridges

Repeaters: Repeaters: – Extend scope of LANs.Extend scope of LANs.– Serve as amplifiers.Serve as amplifiers.– No storage/routing capabilities.No storage/routing capabilities.

Bridges:Bridges:– Also extend scope of LANs.Also extend scope of LANs.– Routing/storage capabilities.Routing/storage capabilities.

207

BridgesBridges

Operate at the data link layer.Operate at the data link layer.– Only examine DLL header information.Only examine DLL header information.– Do not look at the network layer header.Do not look at the network layer header.

208

Routing with BridgesRouting with Bridges

3 algorithms:3 algorithms:– Fixed routing.Fixed routing.– Spanning tree.Spanning tree.– Source routing.Source routing.

209

Fixed RoutingFixed Routing

Fixed route for every source-destination Fixed route for every source-destination pair of LANs.pair of LANs.

Does not automatically respond to changes Does not automatically respond to changes in load/topology.in load/topology.

Statically configured routing matrix (pre-Statically configured routing matrix (pre-loaded into bridge).loaded into bridge).

If alternate routes, pick “shortest” one.If alternate routes, pick “shortest” one. RRijij: first bridge on the route from : first bridge on the route from ii to to jj. .

210

Fixed Routing: ExampleFixed Routing: Example

LAN A

LAN B LAN C

LAN D E F G

1 2 3

4 5 6 7

101

107

102

103104

105 106

Source LAN

101 102 103 107 105 106

A B C D E F G

A

B 101 102 103 104 105 106

102 101 103 107 105 106

101 103 102 104 105 106

107

102

102

104

101

101

102

105

106

103

103

103

107

107

105

105

106

106

Ex: E-> F: 107; 102; 105.

C

D

E

F

G

211

Fixed RoutingFixed Routing

Each bridge keeps Each bridge keeps column for each LAN column for each LAN it attaches.it attaches.

Table “From X” Table “From X” derived from column derived from column “x”. “x”.

Every entry that has Every entry that has the number of the the number of the bridge results in entry.bridge results in entry.

101 From A From B

Dest Next

B BC

E

FG

A AC AD -E -F AG A

D B

212

Fixed RoutingFixed Routing

Simple and minimal processing.Simple and minimal processing. Too limited for internets with dynamically Too limited for internets with dynamically

changing topology.changing topology.

213

Spanning Tree RoutingSpanning Tree Routing

Aka Aka transparent bridgestransparent bridges.. Bridge Bridge routing tablerouting table is automatically is automatically

maintained (set up and updated as topology maintained (set up and updated as topology changes).changes).

3 mechanisms:3 mechanisms:– Address learning.Address learning.– Frame forwarding.Frame forwarding.– Loop resolution. Loop resolution.

214

Address Learning 1Address Learning 1

Problem: determine where destinations are.Problem: determine where destinations are. Bridges operate in promiscuous mode, i.e., Bridges operate in promiscuous mode, i.e.,

accept all frames.accept all frames. Basic idea: look at source address of received Basic idea: look at source address of received

frame to learn where that station is (which frame to learn where that station is (which direction frame came from).direction frame came from).

Build routing table so that if frame comes Build routing table so that if frame comes from A on interface N, save [A, N]. from A on interface N, save [A, N].

215

Address Learning 2Address Learning 2

When bridges first start, all tables are When bridges first start, all tables are empty.empty.

So they flood: every frame for unknown So they flood: every frame for unknown destination, is forwarded on all interfaces destination, is forwarded on all interfaces except the one it came from.except the one it came from.

With time, bridges learn where destinations With time, bridges learn where destinations are, and no longer need to flood for known are, and no longer need to flood for known destinations.destinations.

216

Backward LearningBackward Learning

Bridges look at frame’s (MAC) source Bridges look at frame’s (MAC) source address to find which machine is accessible address to find which machine is accessible on which LAN.on which LAN.

LAN 1

LAN 2

LAN 3

LAN 4

B1

B2

If B1 sees frame from C on LAN 2, RT entry (C, LAN2).Any frame to C on LAN1 will be forwarded.But, frame to C on LAN2 will not be forwarded.

CA B

217

Address Learning 3Address Learning 3

RT entries have a time-to-live (TTL). RT entries have a time-to-live (TTL). RT entries RT entries refreshedrefreshed when frames from source when frames from source

already in the table arrive.already in the table arrive. Periodically, process running on bridge scans Periodically, process running on bridge scans

RT and purges RT and purges stalestale entries, i.e., entries older entries, i.e., entries older than TTL.than TTL.

Forwarding to unknown destinations reverts to Forwarding to unknown destinations reverts to flooding.flooding.

218

Frame ForwardingFrame Forwarding

Depends on source and destination LANs.Depends on source and destination LANs.– If destination LAN (where frame is going to) = If destination LAN (where frame is going to) =

source LAN (where frame is coming from), source LAN (where frame is coming from), discard frame.discard frame.

– If destination LAN != source LAN, forward frame.If destination LAN != source LAN, forward frame.– If destination LAN unknown, flood frame.If destination LAN unknown, flood frame.

Special purpose hardware used to perform RT Special purpose hardware used to perform RT lookup and update in few microseconds.lookup and update in few microseconds.

219

LoopsLoops

Alternate routes: loops.Alternate routes: loops. Example:Example:

– LAN A, bridge 101, LAN A, bridge 101, – LAN B, bridge 104, LAN B, bridge 104, – LAN E, bridge 107, LAN E, bridge 107, – LAN A.LAN A.

LAN A

LAN B

E

2

4 5

101

103104

1

107

220

Loop: Problems Loop: Problems

A

B

LAN 1

LAN 2

B1 B2

1. Station A sends frame to B; bridges B1 and B2 don’t know B.2. B1 copies frame onto LAN1; B2 does the same.3. B2 sees B1’s frame to unknown destination and copies it onto LAN 2.4. B1 sees B2’s frame and does the same.5. This can go on forever.

221

Loop ResolutionLoop Resolution

Goal: remove “extra” paths by removing Goal: remove “extra” paths by removing “extra” bridges.“extra” bridges.

Spanning tree:Spanning tree:– Given graph G(V,E), there exists a tree that Given graph G(V,E), there exists a tree that

spans all nodes where there is only one path spans all nodes where there is only one path between any pair of nodes, i.e., between any pair of nodes, i.e., NONO loops. loops.

– LANs are represented by nodes and bridges by LANs are represented by nodes and bridges by edges.edges.

222

Definitions 1Definitions 1

Bridge ID: Bridge ID: unique number (e.g., MAC unique number (e.g., MAC address + integer) assigned to each bridge.address + integer) assigned to each bridge.

RootRoot: bridge with smallest ID.: bridge with smallest ID. CostCost: associated with each interface; : associated with each interface;

specifies cost of transmitting frame through specifies cost of transmitting frame through that interface.that interface.

Root portRoot port: interface to minimum-cost path : interface to minimum-cost path to root.to root.

223

Definitions 2Definitions 2

Root path costRoot path cost: cost of path to root bridge.: cost of path to root bridge. Designated bridgeDesignated bridge: on any LAN, bridge : on any LAN, bridge

closest to root, i.e., the one with minimum closest to root, i.e., the one with minimum root path cost.root path cost.

224

Spanning Tree Algorithm 1 Spanning Tree Algorithm 1

1. Determine root bridge.1. Determine root bridge. 2. Determine root port on all bridges.2. Determine root port on all bridges. 3. Determine designated bridges.3. Determine designated bridges.

225

Spanning Tree Algorithm 2Spanning Tree Algorithm 2

Initially all bridges assume they are the root Initially all bridges assume they are the root and broadcast message with its ID, root path and broadcast message with its ID, root path cost.cost.

Eventually, lowest-ID bridge will be known to Eventually, lowest-ID bridge will be known to everyone and will become root.everyone and will become root.

Root bridge periodically broadcasts it’s the Root bridge periodically broadcasts it’s the root.root.

226

Spanning Tree Algorithm 3Spanning Tree Algorithm 3

Directly connected bridges update their cost Directly connected bridges update their cost to root and broadcast message on other to root and broadcast message on other LANs they are attached.LANs they are attached.

This is propagated throughout network.This is propagated throughout network. On any (non-directly connected) LAN, On any (non-directly connected) LAN,

bridge closest to root becomes designated bridge closest to root becomes designated bridge.bridge.

227

Spanning Tree: ExampleSpanning Tree: Example

B3

LAN 2

LAN 1

LAN 3 LAN 4

LAN 5

B5

B4B1

B2

10

10

10

10

5

5

5

5

1055

B3

LAN 2

LAN 1

LAN 3 LAN 4

LAN 5

B5

B4B1

B2

10

10

10

10

5

5

5

5

1055

228

Spanning Tree: ExampleSpanning Tree: Example

B1

LAN 1 LAN 2

B2

LAN 3 LAN 4

LAN 5

B4

B5B3

. Only designated bridgeson each LAN allowed toforward frames.

. Bridges continue exchanging info to react to topology changes.

229

Source Routing 1Source Routing 1

Route determined a priori by sender.Route determined a priori by sender. Route included in the frame header as Route included in the frame header as

sequence of LAN and bridge identifiers.sequence of LAN and bridge identifiers. When bridge receives frame:When bridge receives frame:

– Forward frame if bridge is on the route.Forward frame if bridge is on the route.– Discard frame otherwise.Discard frame otherwise.

230

Source Routing 2Source Routing 2

Route: sequence of bridges and LANs.Route: sequence of bridges and LANs.

LAN 3

B1

LAN 1

B3

B2 B4

LAN 2

LAN 4X

Z

X->Z: L1,B1,L3,B3,L2.X->Z: L1,B2,L4,B4,L2

231

Source Routing 4Source Routing 4

No need to maintain routing table.No need to maintain routing table.– Frame has all needed routing information.Frame has all needed routing information.

However, stations need to find route to However, stations need to find route to destination. destination.

232

Route Discovery 1Route Discovery 1

Finding all routes.Finding all routes.– If destination is unknown, source sends If destination is unknown, source sends

broadcast route discovery frame.broadcast route discovery frame.– Frame reaches every LAN. Frame reaches every LAN. – When reply comes back, intermediate bridges When reply comes back, intermediate bridges

record their id.record their id.– Source gets complete route information.Source gets complete route information.

Problem: frame explosion.Problem: frame explosion.

233

Route Discovery 2Route Discovery 2

Alternative: single Alternative: single route requestroute request frame frame forwarded according to spanning tree.forwarded according to spanning tree.

B3X

Z

B1

B4

LAN 1 LAN 3LAN 2

LAN 4

Z XSingle-routebroadcast

234

Route Discovery 3Route Discovery 3

B3X

Z

B1

B4

LAN 1 LAN 3LAN 2

LAN 4B2

L2, B3, L3, B1, L1

L2, B4, L4, B2, L1

235

Route SelectionRoute Selection

Select minimum-cost route, e.g., minimum-Select minimum-cost route, e.g., minimum-hop route.hop route.

If tie, choose the one that arrived first.If tie, choose the one that arrived first. Routes are cached with a TTL; when TTL Routes are cached with a TTL; when TTL

expires, re-discover route.expires, re-discover route.

236

RoutersRouters

Operate at the network layer, i.e., inspect Operate at the network layer, i.e., inspect the network-layer header.the network-layer header.

Usually main router functionality Usually main router functionality implemented in software.implemented in software.

Store-and-forward.Store-and-forward. Ability to interconnect heterogeneous Ability to interconnect heterogeneous

networks: address translation, link speed networks: address translation, link speed and packet size mismatch. and packet size mismatch.

237

The Network LayerThe Network Layer

Stallings chapters 8, 9, 15, 16 and Stallings chapters 8, 9, 15, 16 and Tanenbaum chapter 5. Tanenbaum chapter 5.

238

Goals Goals

Get data from source to destination.Get data from source to destination.– May require traversing many hops and May require traversing many hops and

involving intermediate routers.involving intermediate routers. In contrast with data link layer: frames from In contrast with data link layer: frames from

one end of a wire to the other.one end of a wire to the other. Network layer as lowest end-to-end Network layer as lowest end-to-end

transmission layer: multiple hops.transmission layer: multiple hops.

239

Routing and InternetworkingRouting and Internetworking

Based on knowledge of network topology, Based on knowledge of network topology, choose appropriate paths from source to choose appropriate paths from source to destination.destination.– Load balancing across routers and links.Load balancing across routers and links.– Avoid congestion.Avoid congestion.

Network interconnection: internetworking.Network interconnection: internetworking.– Source and destination in different networks.Source and destination in different networks.

240

Design IssuesDesign Issues

Services provided to transport layer.Services provided to transport layer. Design/implementation of the subnet.Design/implementation of the subnet.

Router

Router

Router

Subnet

End systemRouter

241

[Circuit- versus Packet- [Circuit- versus Packet- Switching]Switching]

Circuit SwitchingCircuit Switching– Physical circuit (physical connection) is Physical circuit (physical connection) is

establish between source and destination establish between source and destination throughout the network (involving switches and throughout the network (involving switches and links).links).

– This happens before any data can be sent. This happens before any data can be sent.

242

Circuit SwitchingCircuit Switching

243

Packet SwitchingPacket Switching

Special case of Special case of message switchingmessage switching.. No physical path establishment ahead of time.No physical path establishment ahead of time. As data moves from source to destination, As data moves from source to destination,

route is formed one hop at a time: route is formed one hop at a time: store-and-store-and-forwardforward..

On-demand resource acquisition as opposed to On-demand resource acquisition as opposed to circuit switching where resources reserved circuit switching where resources reserved statically beforehand.statically beforehand.

244

ContextContext

We are talking about packet switching We are talking about packet switching networks!networks!

245

Services Provided to Transport Services Provided to Transport Layer Layer

Network/transport layer interface: typically interface Network/transport layer interface: typically interface between carrier (netwrk service provider) and end between carrier (netwrk service provider) and end user.user.

NSP has control over protocols up to network layer.NSP has control over protocols up to network layer. Network/transport interface needs to be very well Network/transport interface needs to be very well

defined.defined. Types of service: connection-less versus connection-Types of service: connection-less versus connection-

oriented oriented

246

Connection-less serviceConnection-less service

Internet.Internet. E2E argument.E2E argument.

– Push functionality closer to users.Push functionality closer to users. Error and flow control at higher layers.Error and flow control at higher layers. No delivery or ordering guarantees.No delivery or ordering guarantees. Every packet must carry full destination Every packet must carry full destination

address (each packet independent of the address (each packet independent of the other).other).

247

Connection-orientedConnection-oriented

Telephone and ATM networks.Telephone and ATM networks. Network-layer connection:Network-layer connection:

– Logical connection between network-layer processes at Logical connection between network-layer processes at sender and receiver.sender and receiver.

– Connection ID used to identify PDUs.Connection ID used to identify PDUs.

– Connection set up (QoS, cost negotiation) and tear down.Connection set up (QoS, cost negotiation) and tear down.

– Full duplex communication.Full duplex communication.

– Reliable and ordered delivery.Reliable and ordered delivery.

248

Internet over ATMInternet over ATM

Source first establishes ATM network-layer Source first establishes ATM network-layer connection to destination; then send IP connection to destination; then send IP packets over it.packets over it.

Inefficient: duplicate functionality.Inefficient: duplicate functionality.– Example: ordered delivery guarantees at the Example: ordered delivery guarantees at the

ATM network layer and TCP packet re-ATM network layer and TCP packet re-ordering mechanism.ordering mechanism.

249

Network Layer DesignNetwork Layer Design

Connection-oriented versus connection-less Connection-oriented versus connection-less infrastructure.infrastructure.

Connection-oriented: virtual circuit Connection-oriented: virtual circuit Connection-less: datagrams.Connection-less: datagrams.

250

Virtual CircuitVirtual Circuit

Analogy to physical circuits used by Analogy to physical circuits used by telephone networks.telephone networks.

At connection establishment time, path At connection establishment time, path from source to destination is selected and from source to destination is selected and used throughout connection lifetime.used throughout connection lifetime.

When connection is over, virtual circuit When connection is over, virtual circuit terminated.terminated.

251

DatagramDatagram

No logical connection.No logical connection. Each packet (datagram) routed Each packet (datagram) routed

independently; successive packets may independently; successive packets may follow different routes.follow different routes.

More work at intermediate routers, but More work at intermediate routers, but more robust and adaptive to failures and more robust and adaptive to failures and congestion.congestion.

252

RoutersRouters

For VCs, routers keep a table with (VC For VCs, routers keep a table with (VC number, outgoing interface) entries.number, outgoing interface) entries.– Packets only need to carry VC number.Packets only need to carry VC number.

For datagrams, routing table.For datagrams, routing table.– (destination, outgoing interface) entries.(destination, outgoing interface) entries.– Each packet must carry destination address. Each packet must carry destination address.

253

Combinations of Service and Combinations of Service and Subnet StructureSubnet Structure

Datagram Virtual Circuit

Connection-less

Connection-oriented

UDPover IP

UPDover IPoverATM

TCP over IP

ATMover ATM

254

Routing Algorithms 1Routing Algorithms 1

Routing is main function of network layer.Routing is main function of network layer. Routing algorithm: decides which route a Routing algorithm: decides which route a

packet should take from source to packet should take from source to destination.destination.– For router: which interface a packet should be For router: which interface a packet should be

forwarded.forwarded.

255

Routing Algorithms 2Routing Algorithms 2

If datagram network, decision is made for If datagram network, decision is made for every packet.every packet.

If VC, decision is made only once when VC If VC, decision is made only once when VC is setup.is setup.

256

Routing MetricsRouting Metrics

Routing algorithms can use different Routing algorithms can use different metrics when building/selecting routes.metrics when building/selecting routes.– Example:Example:

» Number of hops.Number of hops.

» Delay.Delay.

» Bandwidth.Bandwidth.

257

Adaptive and Non-adaptive Adaptive and Non-adaptive RoutingRouting

Non-adaptive routing:Non-adaptive routing:– Fixed routing, static routing.Fixed routing, static routing.– Do not take current state of the network (e.g., load, Do not take current state of the network (e.g., load,

topology).topology).– Routes are computed in advance, off-line, and downloaded Routes are computed in advance, off-line, and downloaded

to routers when booted.to routers when booted.

Adaptive routing:Adaptive routing:– Routes change dynamically as function of current state of Routes change dynamically as function of current state of

network.network.– Algorithms vary on how they get routing information, Algorithms vary on how they get routing information,

metrics used, and when they change routes.metrics used, and when they change routes.

258

Optimality PrincipleOptimality Principle

General statement about optimal routes (topology, General statement about optimal routes (topology, routing algorithm independent).routing algorithm independent).

If router J is on optimal path between I and K, then If router J is on optimal path between I and K, then the optimal path from J to K also falls along the same the optimal path from J to K also falls along the same route.route.– Proof by contradiction.Proof by contradiction.

Corollary:Corollary:– Set of optimal routes from all sources to destination form a Set of optimal routes from all sources to destination form a

tree rooted at destination.tree rooted at destination.– Sink tree.Sink tree.

259

Adaptive and Non-adaptive Adaptive and Non-adaptive RoutingRouting

Non-adaptive routing:Non-adaptive routing:– Fixed routing, static routing.Fixed routing, static routing.– Do not take current state of the network (e.g., load, Do not take current state of the network (e.g., load,

topology).topology).– Routes are computed in advance, off-line, and downloaded Routes are computed in advance, off-line, and downloaded

to routers when booted.to routers when booted.

Adaptive routing:Adaptive routing:– Routes change dynamically as function of current state of Routes change dynamically as function of current state of

network.network.– Algorithms vary on how they get routing information, Algorithms vary on how they get routing information,

metrics used, and when they change routes.metrics used, and when they change routes.

260

Optimality PrincipleOptimality Principle

General statement about optimal routes (topology, General statement about optimal routes (topology, routing algorithm independent).routing algorithm independent).

If router J is on optimal path between I and K, then If router J is on optimal path between I and K, then the optimal path from J to K also falls along the same the optimal path from J to K also falls along the same route.route.– Proof by contradiction.Proof by contradiction.

Corollary:Corollary:– Set of optimal routes from all sources to destination form a Set of optimal routes from all sources to destination form a

tree rooted at destination.tree rooted at destination.– Sink tree.Sink tree.

261

Static AlgorithmsStatic Algorithms

Shortest-path routing.Shortest-path routing. Flooding.Flooding.

262

Shortest Path Routing 1Shortest Path Routing 1

Dijkstra (1959).Dijkstra (1959). Network represented by graph G(V, E), Network represented by graph G(V, E),

where V is set of nodes and E is set of links where V is set of nodes and E is set of links connecting nodes.connecting nodes.

What is “shortest”?What is “shortest”?– Different metrics.Different metrics.– Example: number of hops (static), geographic Example: number of hops (static), geographic

distance (static), delay, bandwidth (raw versus distance (static), delay, bandwidth (raw versus available), combination of a subset of these.available), combination of a subset of these.

263

Dijkstra’s Shortest Path Dijkstra’s Shortest Path

Nodes labeled with distance to source Nodes labeled with distance to source through best known path.through best known path.

At start, no known paths so all nodes At start, no known paths so all nodes labeled with infinity.labeled with infinity.

As algorithm progresses, nodes are labeled; As algorithm progresses, nodes are labeled; “tentative” labels may change, while “tentative” labels may change, while “permanent” labels don’t change.“permanent” labels don’t change.

Label made permanent when it’s known to Label made permanent when it’s known to be in the shortest path to source.be in the shortest path to source.

264

Dijkstra’s Algorithm: ExampleDijkstra’s Algorithm: Example

A

B C

DE

G

F

H

27

3

22

32

4

2

6 11

A

B C

DE

G

F

H

27

3

22

32

4

2

6 1

(2,A)

(6,A)

A

B C

DE

G

F

H

27

3

22

3

4

2

6 1

(2,A)

(6,A)

(9,B)

(4,B)

A

B C

DE F

H

27

3

2

(6,E)

4

2

6 1

(2,A)

G(5,E)

(9,B)

(4,B)

A

B C

DE F

27

3

2

(6,E)

4

2

6 1

(9,B)

(4,B)A

B C

DE F

27

3

2

(6,E)

4

2

6 1

(9,B)

(4,B)

1

H(9,G)G(5,E) G(5,E) H(8,F)

265

FloodingFlooding

Every incoming packet forwarded on every Every incoming packet forwarded on every outgoing link except the one it arrived on.outgoing link except the one it arrived on.

Problem: duplicates.Problem: duplicates. Constraining the flood:Constraining the flood:

– Hop count.Hop count.– Keep track of packets that have been flooded.Keep track of packets that have been flooded.

Robust, shortest delay (picks shortest path as Robust, shortest delay (picks shortest path as one of the paths).one of the paths).

266

Dynamic Routing Algorithms Dynamic Routing Algorithms

Distance vector routing.Distance vector routing. Link state routing.Link state routing.

267

Distance Vector Routing 1Distance Vector Routing 1

Each router keeps routing table (or routing vector) Each router keeps routing table (or routing vector) giving best known distance to each destination and giving best known distance to each destination and the corresponding outgoing interface.the corresponding outgoing interface.

Routing tables are updated by exchanging routing Routing tables are updated by exchanging routing information with neighbors.information with neighbors.

Aka, Bellman-Ford, Ford-Fulkerson.Aka, Bellman-Ford, Ford-Fulkerson. Original ARPANET routing; also used by Internet’s Original ARPANET routing; also used by Internet’s

RIP.RIP.

268

Distance Vector 2Distance Vector 2

Routing table at each router:Routing table at each router:– One entry per participating router.One entry per participating router.– Each entry contains outgoing interface and Each entry contains outgoing interface and

distance to corresponding destination.distance to corresponding destination.– Metric: number of hops, delay, queue length.Metric: number of hops, delay, queue length.– Each router knows distance to its neighbors.Each router knows distance to its neighbors.

Old ARPANET algorithm: DV where cost Old ARPANET algorithm: DV where cost metric is outgoing link queue length.metric is outgoing link queue length.

269

Routing UpdatesRouting Updates

Every T interval, routers exchange routing updates.Every T interval, routers exchange routing updates. Routing update from router X consists of a vector Routing update from router X consists of a vector

with with all destinationsall destinations and the corresponding distance and the corresponding distance from X to them. from X to them.

When router Y receives an update from X, it can When router Y receives an update from X, it can estimate its distance to router Z through X as Destimate its distance to router Z through X as Dyz yz = = DDyxyx + D + Dxzxz. .

Router Y receives update from Router Y receives update from all its neighborsall its neighbors; ; discards its RT and builds a new one.discards its RT and builds a new one.

270

Distance Vector: ExampleDistance Vector: Example

1

4

6

2 3

5

1Node Distance Next

23

3

2

1

9

9

5

1

2

1 0 -

2 2 2

3 5 3

4 1 45 6 3

6 8 3

T=T0T=T1

3 7 5

2 3 4

0 4 2

3 0 2

2 2 03 1 15 3 3

Node Distance Next

1 0 -

2 2 2

3 3 4

4 1 45 2 4

6 4 4

T=T2

7

271

ProblemsProblems

Routing loops.Routing loops. Slow convergence.Slow convergence. Counting to infinity.Counting to infinity.

272

Count-to-Infinity 1Count-to-Infinity 1

Good news propagates faster.Good news propagates faster.

A B C D E

Initially, A down:A comes up:

infinity11 2 infinity infinity (after 2 exchanges)1 2 3 infinity (after 3 exchanges)1 2 3 4 (after 4 exchanges)

infinityinfinity

infinityinfinity

infinityinfinity (after 1 exchange)

273

Count-to-Infinity 2Count-to-Infinity 2

But, bad news propagate slower!But, bad news propagate slower!

A B C D E

Initially, all up:A goes down:

1 2 3 43 2 3 4 (after 1 exchange)3 4 3 4 (after 2 exchanges)5 4 5 4 (after 3 exchanges)5 6 5 6 (after 4 exchanges)7 6 7 6 (after 5 exchanges)7 8 7 8 (after 6 exchanges)

….infinity

274

Count-to-Infinity 3Count-to-Infinity 3

Gradually routers work their way up to Gradually routers work their way up to infinity.infinity.

Number of exchanges depends on how Number of exchanges depends on how large is infinity.large is infinity.

To reduce number of exchanges, if metric is To reduce number of exchanges, if metric is number of hops, number of hops, infinity=maximum infinity=maximum path+1.path+1.

275

SolutionSolution

Routing loops:Routing loops:– Path vector: record actual path used in the DV.Path vector: record actual path used in the DV.– Previous hop tracing: records preceding router.Previous hop tracing: records preceding router.

Count-to-infinity: Count-to-infinity: – Split horizon: router reports to neighbor cost Split horizon: router reports to neighbor cost

“infinity” for destination if route to that “infinity” for destination if route to that destination is through that neighbor.destination is through that neighbor.

276

Split Horizon Split Horizon

Tries to make bad news spread faster.Tries to make bad news spread faster. A node reports infinity as distance to node X A node reports infinity as distance to node X

on link packets to X are sent on.on link packets to X are sent on. Example, in the first exchange, C tells D its Example, in the first exchange, C tells D its

distance to A but tells B its distance to A is distance to A but tells B its distance to A is infinity.infinity.– So B discovers its link to A is down and C’s So B discovers its link to A is down and C’s

distance to A is infinity; so it sets its distance to A distance to A is infinity; so it sets its distance to A to infinity.to infinity.

277

Link State Routing 1Link State Routing 1

DV routing used in the ARPANET until 1979, DV routing used in the ARPANET until 1979, when it was replaced by link state routing.when it was replaced by link state routing.

Used by the Internet’s OSPF.Used by the Internet’s OSPF.

278

Link State Routing 2Link State Routing 2

Link state routing is based on:Link state routing is based on:– Discover your neighbors and measure the Discover your neighbors and measure the

communication cost to them.communication cost to them.– Send updates about your neighbors to all other Send updates about your neighbors to all other

routers.routers.– Compute shortest path to every other router.Compute shortest path to every other router.

279

Finding NeighborsFinding Neighbors

When router is booted, its first task is to When router is booted, its first task is to find who its neighbors are.find who its neighbors are.

Special single-hop “hello” packets.Special single-hop “hello” packets. Cost metric:Cost metric:

– Number of hops: in this case, always 1.Number of hops: in this case, always 1.– Delay: “echo” packets and measure RTT/2.Delay: “echo” packets and measure RTT/2.– Load?Load?

280

Generating Link State UpdatesGenerating Link State Updates

Link state packets (LSP).Link state packets (LSP).– Sender identity.Sender identity.– Sequence number.Sequence number.– TTL.TTL.– List of (neighbor, cost). List of (neighbor, cost).

When to send updates?When to send updates?– Proactive: periodic updates; how often?Proactive: periodic updates; how often?– Reactive: whenever some significant event is detected, Reactive: whenever some significant event is detected,

e.g., link goes down.e.g., link goes down. Where to send them? Everywhere: flood. Where to send them? Everywhere: flood.

281

Processing UpdatesProcessing Updates

When LSP is received:When LSP is received:– Check sequence number.Check sequence number.– If higher than current sequence number, keep it If higher than current sequence number, keep it

and flood it; otherwise, discard it. and flood it; otherwise, discard it. – Periodically decrement TTL.Periodically decrement TTL.

» When TTL=0, purge LSP.When TTL=0, purge LSP.

282

Computing RoutesComputing Routes

Routers have global view of network.Routers have global view of network.– They receive updates from all other routers They receive updates from all other routers

with their cost to their neighbors.with their cost to their neighbors.– Build network graph.Build network graph.

Use Dijkstra’s shortest-path algorithm to Use Dijkstra’s shortest-path algorithm to compute shortest paths to all other nodes.compute shortest paths to all other nodes.

283

DV versus LSDV versus LS

DV:DV:– Node tells its neighbors what it knows about everybody.Node tells its neighbors what it knows about everybody.

– Based on other’s knowledge, node chooses best route.Based on other’s knowledge, node chooses best route.

– Distributed computation.Distributed computation.

LS:LS:– Node tells everyone what it knows about its neighbors.Node tells everyone what it knows about its neighbors.

– Every node has global view.Every node has global view.

– Compute their own routes.Compute their own routes.

284

Hierarchical RoutingHierarchical Routing

For scalability:For scalability:– As network grows, so does RT size, routing update As network grows, so does RT size, routing update

generation, processing, and propagation overhead, and generation, processing, and propagation overhead, and route computation time and resources.route computation time and resources.

Divide network into Divide network into routing regionsrouting regions..– Routers within region know how to route packets to all Routers within region know how to route packets to all

destinations within region.destinations within region.

– But don’t know how to route within other regions.But don’t know how to route within other regions.

– ““Border” routers: route within regions.Border” routers: route within regions.

285

Hierarchical Routing ExampleHierarchical Routing Example

1B

1A 1C

2A 2B

2C2D

3A 3B

4A

4B 4C

5E 5D

5C

5B

5A

Dest. Next Hops1A - -1B 1B 11C 1C 12A 1B 22B 1B 32C 1B 32D 1B 43A 1C 33B 1C 24A 1C 34B 1C 44C 1C 45A 1C 45B 1C 55C 1B 55D 1C 65E 1C 5

1A

286

Hierarchical Routing ExampleHierarchical Routing Example

1B

1A 1C

2A 2B

2C2D

3A 3B

4A

4B 4C

5E 5D

5C

5B

5A

Dest. Next Hops1A - -1B 1B 11C 1C 12 1B 23 1C 24 1C 35 1C 4

A

287

Hierarchical RoutingHierarchical Routing

Optimal paths are not guaranteed.Optimal paths are not guaranteed.– Example: 1A->5C should be via 2 and not 3.Example: 1A->5C should be via 2 and not 3.

How many hierarchical levels?How many hierarchical levels?– Example: 720 routers.Example: 720 routers.

» 1 level: each router needs 720 RT entries.1 level: each router needs 720 RT entries.

» 2 levels: 24 regions of 30 routers: each router’s RT 2 levels: 24 regions of 30 routers: each router’s RT has 30+23 entries.has 30+23 entries.

» 3 levels: 8 clusters of 9 regions with 10 routers: each 3 levels: 8 clusters of 9 regions with 10 routers: each router’s RT 10+8+7.router’s RT 10+8+7.

288

Many-to-Many RoutingMany-to-Many Routing

Support many-to-many communication.Support many-to-many communication. Example applications: multi-point data Example applications: multi-point data

distribution, multi-party teleconferencing.distribution, multi-party teleconferencing.

289

BroadcastingBroadcasting

Simplistic approach: send separate packet to Simplistic approach: send separate packet to each destination.each destination.– Simple but expensive.Simple but expensive.– Source needs to know about all destinations.Source needs to know about all destinations.

Flooding:Flooding:– May generate too many duplicates (depending May generate too many duplicates (depending

on node connectivity).on node connectivity).

290

Multidestination RoutingMultidestination Routing

Packet contains list of destinations.Packet contains list of destinations. Router checks destinations and determines Router checks destinations and determines

on which interfaces it will forward packet.on which interfaces it will forward packet.– Router generates new copy of packet for each Router generates new copy of packet for each

output line and includes in packet only the output line and includes in packet only the appropriate set of destinations.appropriate set of destinations.

– Eventually, packets will only carry 1 Eventually, packets will only carry 1 destination.destination.

291

Spanning Tree Routing Spanning Tree Routing

Use spanning tree (sink tree) rooted at Use spanning tree (sink tree) rooted at broadcast initiator.broadcast initiator.

No need for destination list.No need for destination list. Each on spanning tree forwards packets on all Each on spanning tree forwards packets on all

lines on the spanning tree (except the one the lines on the spanning tree (except the one the packet arrived on).packet arrived on).

Efficient but needs to generate the spanning Efficient but needs to generate the spanning tree and routers must have that information. tree and routers must have that information.

292

Reverse Path ForwardingReverse Path Forwarding

Routers don’t have to know spanning tree.Routers don’t have to know spanning tree. Router checks whether broadcast packet Router checks whether broadcast packet

arrived on interface used to send packets to arrived on interface used to send packets to source of broadcast.source of broadcast.– If so, it’s likely that it followed best route and If so, it’s likely that it followed best route and

thus not a duplicate; router forwards packet on thus not a duplicate; router forwards packet on all lines.all lines.

– If not, packet discarded as likely duplicate.If not, packet discarded as likely duplicate.

293

MulticastingMulticasting

Special form of broadcasting:Special form of broadcasting:– Instead of sending messages to all nodes, send Instead of sending messages to all nodes, send

messages to a group of nodes.messages to a group of nodes. Multicast group management:Multicast group management:

– Creating, deleting, joining, leaving group.Creating, deleting, joining, leaving group.– Group management protocols communicate Group management protocols communicate

group membership to appropriate routers.group membership to appropriate routers.

294

Multicast RoutingMulticast Routing

Each router computes spanning tree covering Each router computes spanning tree covering all other participating routers.all other participating routers.– Tree is pruned by removing that do not contain Tree is pruned by removing that do not contain

any group members.any group members.

1,2

1

1,22

21

1

21,2

1

1,22

2

1

1

2

1

1

1

1

12 2

2

2 2

295

Shared Tree MulticastingShared Tree Multicasting

Source-rooted tree approaches don’t scale Source-rooted tree approaches don’t scale well!well!– 1 tree per source, per group!1 tree per source, per group!

– Routers must keep state for Routers must keep state for m*nm*n trees, where trees, where mm is number is number of sources in a group and of sources in a group and nn is number of groups. is number of groups.

Core-based trees: single tree per group.Core-based trees: single tree per group.– Host unicast message to core, where message is multicast Host unicast message to core, where message is multicast

along shared tree.along shared tree.

– Routes may not be optimal for all sources.Routes may not be optimal for all sources.

– State/storage savings in routers.State/storage savings in routers.

296

Midterm Review 1Midterm Review 1

IntroductionIntroduction– Basic terminology and concepts.Basic terminology and concepts.

Physical LayerPhysical Layer– Time and frequency domains.Time and frequency domains.– Bandwidth and data rate.Bandwidth and data rate.– Analog and digital transmission.Analog and digital transmission.– Simplex, half-duplex and full-duplex Simplex, half-duplex and full-duplex

transmission.transmission.

297

Midterm Review 2Midterm Review 2

Physical Layer (cont’d)Physical Layer (cont’d)– Transmission impairments.Transmission impairments.– Decibel.Decibel.– S/N ratio.S/N ratio.– Channel capacity.Channel capacity.

» Nyquist.Nyquist.

» Shannon.Shannon.

– Types on media.Types on media.

298

Midterm Review 3Midterm Review 3

Physical Layer (cont’d)Physical Layer (cont’d)– Data encoding.Data encoding.

» Digital-to-analog.Digital-to-analog.

» Digital-to-digital.Digital-to-digital.

» Analog-to-digital.Analog-to-digital.

» Analog-to-analog.Analog-to-analog.

– Transmission modes.Transmission modes.» Synchronous.Synchronous.

» Asynchronous.Asynchronous.

299

Midterm Review 4Midterm Review 4

Data Link LayerData Link Layer– Flow control.Flow control.

» Stop-and-wait.Stop-and-wait.

» Sliding window.Sliding window.

– Error control.Error control.» Error detection schemes.Error detection schemes.

Parity.Parity. CRC.CRC.

300

Midterm Review 5Midterm Review 5 DLL (cont’d)DLL (cont’d)

– Error control (cont’d)Error control (cont’d)» ARQ.ARQ.

Stop-and-wait ARQ.Stop-and-wait ARQ. Go-back-N ARQ.Go-back-N ARQ. Selective-reject ARQ.Selective-reject ARQ.

– Example DLL protocols.Example DLL protocols.– Multiplexing.Multiplexing.

» Frequency-Division Multiplexing (FDM).Frequency-Division Multiplexing (FDM).» Time-Division Multiplexing (TDM).Time-Division Multiplexing (TDM).» Statistical Time-Division Multiplexing (STDM).Statistical Time-Division Multiplexing (STDM).

301

Midterm Review 6Midterm Review 6

LANsLANs– Protocol architecture.Protocol architecture.– 802 standards.802 standards.– Encapsulation/de-encapsulation.Encapsulation/de-encapsulation.– Frame format.Frame format.– LAN topologies.LAN topologies.

302

Midterm Review 7Midterm Review 7

MACMAC– Centralized and distributed.Centralized and distributed.– Synchronous and asynchronous.Synchronous and asynchronous.– Asynchronous MAC.Asynchronous MAC.

» Round-robin, reservation, and contention.Round-robin, reservation, and contention.

LLC for LANs.LLC for LANs.

303

Midterm Review 8Midterm Review 8

MAC protocols.MAC protocols.– Contention.Contention.

» ALOHA and Slotted ALOHA.ALOHA and Slotted ALOHA.

» CSMA.CSMA.

» CSMA/CD.CSMA/CD.

– Reservation.Reservation.» Token bus.Token bus.

» Token ring.Token ring.

304

Midterm Review 9Midterm Review 9

EthernetEthernet High-Speed LANsHigh-Speed LANs

– FDDIFDDI– Fast EthernetFast Ethernet– Gigabit EthernetGigabit Ethernet

Wireless LANsWireless LANs

305

Midterm Review 10Midterm Review 10

LAN interconnectionLAN interconnection– Interconnection schemes and devices.Interconnection schemes and devices.– Bridges.Bridges.

Routing with bridgesRouting with bridges– Fixed routing.Fixed routing.– Spanning tree.Spanning tree.– Source routing.Source routing.

RoutersRouters

306

Midterm Review 11Midterm Review 11

Network layer.Network layer.– Circuit- and packet-switching.Circuit- and packet-switching.

– Services provided by network layer.Services provided by network layer.

– Network layer structure.Network layer structure.

Routing.Routing.– Static.Static.

– Dynamic.Dynamic.

– Hierarchical routing.Hierarchical routing.

– Many-to-many routing.Many-to-many routing.

307

Congestion ControlCongestion Control

Ideal network behavior:Ideal network behavior:

Packetsdelivered

Packetssent

Maximum capacity

308

Network CongestionNetwork Congestion

What is network congestion?What is network congestion?– Too many packets in the network.Too many packets in the network.– Router queues are always full.Router queues are always full.

» Routers start dropping packets.Routers start dropping packets.

– Congestion can fuel itself.Congestion can fuel itself.» Packet drops lead to retransmissions.Packet drops lead to retransmissions.

» More traffic!More traffic!

– May result in congestion collapse!May result in congestion collapse!» Close to 0 throughput!Close to 0 throughput!

309

Infinite-Buffer RoutersInfinite-Buffer Routers

Intuition says add more memory to routers Intuition says add more memory to routers and that’ll avoid congestion.and that’ll avoid congestion.– Nagle (1987) showed that infinite buffers Nagle (1987) showed that infinite buffers

actually make congestion worse.actually make congestion worse.– More packets enqueued for long time; they time More packets enqueued for long time; they time

out and are retransmitted; but still transmitted out and are retransmitted; but still transmitted by router.by router.

– Therefore, more traffic.Therefore, more traffic.

310

Causes of CongestionCauses of Congestion

Mismatch in capacity among different parts of Mismatch in capacity among different parts of the system.the system.– Mismatch in link speeds.Mismatch in link speeds.

– Mismatch in router processing capability.Mismatch in router processing capability.» Table lookup and update.Table lookup and update.» Queue management.Queue management.

Congestion in one point of network tends to Congestion in one point of network tends to propagate backwards toward sender.propagate backwards toward sender.

R

311

Congestion versus Flow ControlCongestion versus Flow Control

Congestion control tries to ensure the Congestion control tries to ensure the network is able to carry offered traffic.network is able to carry offered traffic.– Involves hosts and intermediate routers.Involves hosts and intermediate routers.

Flow control ensures that the Flow control ensures that the communication end-points are able to keep communication end-points are able to keep up with one another.up with one another.– Involves only the end-points.Involves only the end-points.

312

Congestion and Flow ControlCongestion and Flow Control

Often mixed because tend to use same Often mixed because tend to use same feedback mechanisms.feedback mechanisms.– Example: “slow down” message received at Example: “slow down” message received at

host may be caused by receiver not being able host may be caused by receiver not being able to keep up with sender host or by network not to keep up with sender host or by network not being able to handle additional traffic.being able to handle additional traffic.

313

Congestion Control PrinciplesCongestion Control Principles

From control theory point of view:From control theory point of view:– Open and closed loop solutions.Open and closed loop solutions.

Open loop solutions:Open loop solutions:– Avoidance approach.Avoidance approach.

» Tries to make sure problem doesn’t happen.Tries to make sure problem doesn’t happen.

» Doesn’t take current network state into account.Doesn’t take current network state into account.

Closed loop solutions:Closed loop solutions:– Feedback loop.Feedback loop.

314

Closed Loop SolutionsClosed Loop Solutions

3 components:3 components:– Monitoring.Monitoring.

– Feedback generation.Feedback generation.

– Operation adjustment.Operation adjustment.

Monitoring metrics:Monitoring metrics:– Packet loss.Packet loss.

– Average queue length.Average queue length.

– Number of retransmitted packets.Number of retransmitted packets.

– Average packet delay.Average packet delay.

315

FeedbackFeedback

Send information about the problem once it’s Send information about the problem once it’s detected.detected.– Router that detects problem sends packet to traffic Router that detects problem sends packet to traffic

source(s).source(s).– Special-purpose bit in every packet that router sets Special-purpose bit in every packet that router sets

when it detects congestion above certain level to when it detects congestion above certain level to warn neighbors.warn neighbors.

– Special probe messages to detect congested areas Special probe messages to detect congested areas so they can be avoided.so they can be avoided.

Stability: avoid oscillations.Stability: avoid oscillations.

316

Congestion Control TaxonomyCongestion Control Taxonomy

Open loop algorithms:Open loop algorithms:– Act at source.Act at source.– Act at destination.Act at destination.

Closed loop algorithms:Closed loop algorithms:– Explicit feedback.Explicit feedback.– Implicit feedback.Implicit feedback.

317

Open Loop ApproachesOpen Loop Approaches

Traffic ShapingTraffic Shaping– Avoid traffic burstiness by forcing packets to be Avoid traffic burstiness by forcing packets to be

transmitted at more predictable rate.transmitted at more predictable rate.– Used in ATM networks.Used in ATM networks.– Regulates average transmission rate.Regulates average transmission rate.– In contrast to sliding window protocols which In contrast to sliding window protocols which

regulate amount of data in transit.regulate amount of data in transit.– Service agreement between user and carrier.Service agreement between user and carrier.

» Important to real-time traffic such as audio, video.Important to real-time traffic such as audio, video.

318

Leaky Bucket 1Leaky Bucket 1

1. No matter the rate water entersbucket, the outflow is constant.2. Once bucket full, water spills and lost.

Host

Network

Unregulatedflow

Regulated flow

Networkinterface

319

Leaky Bucket 2Leaky Bucket 2

Equivalent to a single-server queuing Equivalent to a single-server queuing system with constant service time.system with constant service time.

Same size packets (e.g., ATM cells): use Same size packets (e.g., ATM cells): use packets as unit.packets as unit.

Variable-sized packets: use numbr of bytes Variable-sized packets: use numbr of bytes per clock tick.per clock tick.

320

Token BucketToken Bucket

More flexible.More flexible. Allows packets to go out as fast as they come Allows packets to go out as fast as they come

in provided there are enough in provided there are enough tokenstokens.. Leaky bucket holds tokens generated every T Leaky bucket holds tokens generated every T

sec.sec. Allows hosts to save up for later.Allows hosts to save up for later.

– Hosts can accumulate up to Hosts can accumulate up to nn tokens, when tokens, when nn is is bucket size.bucket size.

321

Leaky and Token BucketLeaky and Token Bucket

Token bucket throws away tokens but never Token bucket throws away tokens but never packets.packets.

Can be used between host and network and Can be used between host and network and between routers.between routers.

Token bucket can still produce bursts.Token bucket can still produce bursts.– Insert leaky bucket after token bucket.Insert leaky bucket after token bucket.

322

Flow SpecificationsFlow Specifications

Way for user/application to specify traffic patterns Way for user/application to specify traffic patterns and desired quality of service.and desired quality of service.– Before connection established or data is sent, source Before connection established or data is sent, source

provides flow spec to network.provides flow spec to network.

– Network can accept, reject, or counter-offer.Network can accept, reject, or counter-offer.

Example: flow spec language by Partridge (1992).Example: flow spec language by Partridge (1992).– Traffic spec: maximum packet size, maximum Traffic spec: maximum packet size, maximum

transmission rate.transmission rate.

– Service desired: maximum acceptable loss rate, maximum Service desired: maximum acceptable loss rate, maximum delay and delay variation.delay and delay variation.

323

Closed Loop ApproachesClosed Loop Approaches

Virtual circuit networks:Virtual circuit networks:– Admission control:Admission control:

» Once congestion is detected, no more virtual circuits Once congestion is detected, no more virtual circuits are set up until problem is gone.are set up until problem is gone.

– Avoid congested areas.Avoid congested areas.– Resource reservation based on service Resource reservation based on service

agreement.agreement.» Resources include space (table, buffer) in routers, Resources include space (table, buffer) in routers,

link bandwidth.link bandwidth.

324

Choke Packets 1Choke Packets 1 Closed loop approach.Closed loop approach. Can be used in both VC and DG networks.Can be used in both VC and DG networks. Main idea:Main idea:

– Routers detect congestion.Routers detect congestion.» Example: routers measure utilization of its output lines; if it goes Example: routers measure utilization of its output lines; if it goes

above threshold, congestion warning.above threshold, congestion warning.

» New packet using line in warning state will be forwarded normally New packet using line in warning state will be forwarded normally (tagged for no more choke packets), but generates choke packet (tagged for no more choke packets), but generates choke packet back to source with destination.back to source with destination.

325

Choke Packets 2Choke Packets 2

Hosts receiving choke packets:Hosts receiving choke packets:– Decrease their traffic to the problematic Decrease their traffic to the problematic

destination.destination.– Ignore other choke packets for the same Ignore other choke packets for the same

destination for some period of time.destination for some period of time.– After that period, if more choke packets for same After that period, if more choke packets for same

destination, reduce traffic even more, etc.destination, reduce traffic even more, etc. Reducing traffic:Reducing traffic:

– Adjust window size, leaky bucket rate, etc.Adjust window size, leaky bucket rate, etc.

326

Hop-by-Hop Choke PacketsHop-by-Hop Choke Packets

Goal is to provide quick relief at congestion Goal is to provide quick relief at congestion point.point.

Choke packet takes effect at every hop it Choke packet takes effect at every hop it passes through.passes through.

Intermediate nodes reduce traffic on Intermediate nodes reduce traffic on corresponding output line.corresponding output line.– More buffers since input traffic stays the same More buffers since input traffic stays the same

until choke packet reaches previous hop.until choke packet reaches previous hop.

327

Fair Queuing Fair Queuing

Problem with choke packets:Problem with choke packets:– Route sends signal, but it’s up to host to react.Route sends signal, but it’s up to host to react.– Well-behaved hosts loose!Well-behaved hosts loose!

Fair queuing makes compliance attractive.Fair queuing makes compliance attractive.– Routers have multiple queues per output line.Routers have multiple queues per output line.– One queue per source.One queue per source.– Router scans queues in round robin, transmitting Router scans queues in round robin, transmitting

first packet on next queue. first packet on next queue.

328

Weighted Fair QueuingWeighted Fair Queuing

Enable different priorities.Enable different priorities. Different queues may have different Different queues may have different

priorities.priorities. Handle various types of traffic differently.Handle various types of traffic differently.

329

Load Shedding 1Load Shedding 1

If everything else fails, routers simply drop packets.If everything else fails, routers simply drop packets. Choosing packets to drop:Choosing packets to drop:

– Randomly.Randomly.

– Some packets are worth more than others.Some packets are worth more than others.» Application dependentApplication dependent

Data distribution: old packets more important than new.Data distribution: old packets more important than new. Real-time applications: new more important than old.Real-time applications: new more important than old.

– Applications need to mark packets with their priorityApplications need to mark packets with their priority

330

Load Shedding 2Load Shedding 2

Marking packets required special bits in Marking packets required special bits in packet header.packet header.

ATM cells have 1 bit in the header reserved ATM cells have 1 bit in the header reserved for this purpose.for this purpose.

When routers sense some congestion build When routers sense some congestion build up, better to start dropping packets early up, better to start dropping packets early rather than waiting until it becomes rather than waiting until it becomes completely swamped.completely swamped.

331

InternetworkingInternetworking

Interconnection of 2 or more networks Interconnection of 2 or more networks forming an internetwork, or internet.forming an internetwork, or internet.– LANs, MANs, and WANs.LANs, MANs, and WANs.

Different networks man different protocols.Different networks man different protocols.– TCP/IP, IBM’s SNA, DEC’s DECnet, ATM, TCP/IP, IBM’s SNA, DEC’s DECnet, ATM,

Novell and AppleTalk (for LANs).Novell and AppleTalk (for LANs).– Also, satellite and cellular networks.Also, satellite and cellular networks.

332

Example InternetExample Internet

B R X.25 WAN R

R

SNA WAN

802.5LAN

R802.3LAN

802.4LAN

802.3LAN

LAN-LANLAN-WAN

LAN-WAN-LAN

Gateway: device connecting 2 ormore different networks.

333

GatewaysGateways Repeaters: operate at physical layer (bits); Repeaters: operate at physical layer (bits);

amplify/regenerate signal.amplify/regenerate signal. Bridges: store-and-forward frames; data link layer Bridges: store-and-forward frames; data link layer

devices.devices. Routers: operate at network layer.Routers: operate at network layer. Transport gateways: connect networks at the Transport gateways: connect networks at the

transport layer.transport layer. Application gateways: connect 2 parts of an Application gateways: connect 2 parts of an

application at application layer.application at application layer.

334

Half-GatewaysHalf-Gateways

Gateway is split in two: each half owned Gateway is split in two: each half owned and operated by one of the network and operated by one of the network providers.providers.

Common protocol between the 2 halves.Common protocol between the 2 halves.

N2

Half-gateway

N1

335

How do networks differ?How do networks differ?

Service offered: connection-oriented versus connection-less.Service offered: connection-oriented versus connection-less. Protocols: IP, IPX, AppleTalk, DECnet.Protocols: IP, IPX, AppleTalk, DECnet. Addressing: flat (802) versus hierarchical (IP).Addressing: flat (802) versus hierarchical (IP). Maximum packet size.Maximum packet size. Quality of service.Quality of service. Error control: reliable, ordered, unordered delivery.Error control: reliable, ordered, unordered delivery. Flow control: sliding window versus rate-based.Flow control: sliding window versus rate-based. Congestion control: leaky bucket, choke packets.Congestion control: leaky bucket, choke packets. Security: privacy rules, encryption.Security: privacy rules, encryption. Parameters: different timeouts.Parameters: different timeouts.

336

Types of InternetworksTypes of Internetworks

Connection-oriented concatenation of VC Connection-oriented concatenation of VC subnets.subnets.– VC between source and router closest to destination VC between source and router closest to destination

network. network.

– Router builds V to gateway to other subnet.Router builds V to gateway to other subnet.

– Gateway keeps state about that VC.Gateway keeps state about that VC.

– Builds VC to router in the next subnet, etc.Builds VC to router in the next subnet, etc.

Every packet traverses same path.Every packet traverses same path.– Ordered delivery.Ordered delivery.

– Routers convert between packet formats.Routers convert between packet formats.

337

Connection-oriented Connection-oriented concatenationconcatenation

VC between source and router closest to VC between source and router closest to destination network. destination network.

Router builds VC to gateway to other Router builds VC to gateway to other subnet. Gateway keeps state about VC.subnet. Gateway keeps state about VC.

Gateway builds VC to router in the next Gateway builds VC to router in the next subnet, etc.subnet, etc.

Every packet traverses same path.Every packet traverses same path.– Ordered delivery.Ordered delivery.– Routers convert between packet formats.Routers convert between packet formats.

338

Connectionless InternetworkingConnectionless Internetworking

Datagram model.Datagram model.– Different packets may take different routes.Different packets may take different routes.– Separate routing decision for each packet.Separate routing decision for each packet.– No ordered delivery guarantees.No ordered delivery guarantees.

339

Datagram versus VC InternetsDatagram versus VC Internets VC:VC:

– Plus’s: resources reserved in advance, ordered Plus’s: resources reserved in advance, ordered delivery, short headers.delivery, short headers.

– Minus’s: vulnerability to failures, less adaptive, Minus’s: vulnerability to failures, less adaptive, hard if involving datagram subnet.hard if involving datagram subnet.

Datagram:Datagram:– Plus’s: more robust and adaptive, can be used over Plus’s: more robust and adaptive, can be used over

datagram subnets (many LANs, mobile networks).datagram subnets (many LANs, mobile networks).– Minus’s: Longer headers, unordered delivery.Minus’s: Longer headers, unordered delivery.

340

TunnelingTunneling

Interconnecting through a “foreign” subnet.Interconnecting through a “foreign” subnet.

G G

WAN

Ethernet 1Ethernet 2

Tunnel

IP

Ethernet frame

IP

Ethernet frameIP

IP packet insidepayload field ofWAN packet.

341

Internetwork Routing 1Internetwork Routing 1 2-level hierarchy:2-level hierarchy:

– Routing within each network: interior gateway protocol.Routing within each network: interior gateway protocol.

– Routing between networks: exterior gateway protocol.Routing between networks: exterior gateway protocol.

Within each network, different routing algorithms Within each network, different routing algorithms can be used.can be used.

Each network is autonomously managed and Each network is autonomously managed and independent of others: autonomous system (AS).independent of others: autonomous system (AS).

342

Internetwork Routing 2Internetwork Routing 2

Typically, packet starts in its LAN. Typically, packet starts in its LAN. Gateway receives it (broadcast on LAN to Gateway receives it (broadcast on LAN to “unknown” destination).“unknown” destination).

Gateway sends packet to gateway on the Gateway sends packet to gateway on the destination network using its routing table. destination network using its routing table. If it can use the packet’s native protocol, If it can use the packet’s native protocol, sends packet directly. Otherwise, tunnels it.sends packet directly. Otherwise, tunnels it.

343

Fragmentation 1Fragmentation 1

Network-specific maximum packet size.Network-specific maximum packet size.– Width of TDM slot.Width of TDM slot.– OS buffer limitations.OS buffer limitations.– Protocol (number of bits in packet length field).Protocol (number of bits in packet length field).

Maximum payloads range from 48 bytes Maximum payloads range from 48 bytes (ATM cells) to 64Kbytes (IP packets).(ATM cells) to 64Kbytes (IP packets).

344

Fragmentation 2Fragmentation 2

What happens when large packet wants to travel What happens when large packet wants to travel through network with smaller maximum packet size? through network with smaller maximum packet size? FragmentationFragmentation..

Gateways break packets into Gateways break packets into fragmentsfragments; each sent as ; each sent as separate packet.separate packet.

Gateway on the other side have to reassemble Gateway on the other side have to reassemble fragments into original packet.fragments into original packet.

2 kinds of fragmentation: transparent and non-2 kinds of fragmentation: transparent and non-transparent.transparent.

345

Transparent Fragmentation Transparent Fragmentation

Small-packet network transparent to other subsequent Small-packet network transparent to other subsequent networks.networks.

Fragments of a packet addressed to the same exit Fragments of a packet addressed to the same exit gateway, where packet is reassembled.gateway, where packet is reassembled.– OK for concatenated VC internetworking.OK for concatenated VC internetworking.

Subsequent networks are not aware fragmentation Subsequent networks are not aware fragmentation occurred.occurred.

ATM networks (through special hardware) provide ATM networks (through special hardware) provide transparent fragmentation: segmentation.transparent fragmentation: segmentation.

346

Problems with Transparent Problems with Transparent Fragmentation Fragmentation

Exit gateway must know when it received all Exit gateway must know when it received all the pieces.the pieces.– Fragment counter or “end of packet” bit.Fragment counter or “end of packet” bit.

Some performance penalty but requiring all Some performance penalty but requiring all fragments to go through same gateway.fragments to go through same gateway.

May have to repeatedly fragment and May have to repeatedly fragment and reassemble through series of small-packet reassemble through series of small-packet networks.networks.

347

Non-Transparent FragmentationNon-Transparent Fragmentation

Only reassemble at destination host.Only reassemble at destination host.– Each fragment becomes a separate packet.Each fragment becomes a separate packet.– Thus routed independently.Thus routed independently.

Problems:Problems:– Hosts must reassemble.Hosts must reassemble.– Every fragment must carry header until it Every fragment must carry header until it

reaches destination host.reaches destination host.

348

Keeping Track of Fragments 1Keeping Track of Fragments 1

Fragments must be numbered so that original Fragments must be numbered so that original data stream can be reconstructed.data stream can be reconstructed.

Tree-structured numbering scheme:Tree-structured numbering scheme:– Packet 0 generates fragments 0.0, 0.1, 0.2, …Packet 0 generates fragments 0.0, 0.1, 0.2, …– If these fragments need to be fragmented later on, then If these fragments need to be fragmented later on, then

0.0.0, 0.0.1, …, 0.1.0, 0.1.1, …0.0.0, 0.0.1, …, 0.1.0, 0.1.1, …– But, too much overhead in terms of number of fields But, too much overhead in terms of number of fields

needed.needed.– Also, if fragments are lost, retransmissions can take Also, if fragments are lost, retransmissions can take

alternate routes and get fragmented differently.alternate routes and get fragmented differently.

349

Keeping Track of Fragments 2Keeping Track of Fragments 2

Another way is to define elementary fragment Another way is to define elementary fragment size that can pass through every network.size that can pass through every network.

When packet fragmented, all pieces equal to When packet fragmented, all pieces equal to elementary fragment size, except last one elementary fragment size, except last one (may be smaller).(may be smaller).

Packet may contain several fragments.Packet may contain several fragments.

350

Keeping Track of Fragments 3Keeping Track of Fragments 3

Header contains packet number, number of first Header contains packet number, number of first fragment in the packet, and last-fragment bit.fragment in the packet, and last-fragment bit.

27 0 1 A B C D E F G H I J

27 0 0 A B C D E F G H 27 8 1 I J

Packet numberNumber offirst fragment

Last-fragment bit

(a) Original packetwith 10 data bytes.

(b) Fragments after passing through network with maximum packet size = 8 bytes.

1 byte

351

Firewalls 1Firewalls 1

Analogy: ditch around medieval castles.Analogy: ditch around medieval castles.– To enter or exit castle, must pass over single bridge.To enter or exit castle, must pass over single bridge.

Firewalls force traffic to and from company through Firewalls force traffic to and from company through single point.single point.

Firewalls typically consist of:Firewalls typically consist of:– Packet filters (one for incoming, other for outgoing Packet filters (one for incoming, other for outgoing

packets).packets).

– Application gateway.Application gateway.

352

Firewalls 2Firewalls 2

Packet filter: router Packet filter: router equipped with capability of equipped with capability of inspecting packets.inspecting packets.– Packets that meet criteria are Packets that meet criteria are

forwarded; others discarded.forwarded; others discarded.

Application gateways Application gateways operate at application level; operate at application level; e.g., mail gateway.e.g., mail gateway.

Applicationgateway

Corporate network

Outsideworld

353

The Internet Network LayerThe Internet Network Layer

The Internet as a collection on networks or The Internet as a collection on networks or autonomous systems (ASs).autonomous systems (ASs).

Hierarchical structure.Hierarchical structure.

USbackbone

Europeanbackbone

Regionalnetwork

National network

Transcontinentallinks

Transcontinentallinks

354

IP (Internet Protocol)IP (Internet Protocol)

Glues Internet together.Glues Internet together. Common network-layer protocol spoken by all Common network-layer protocol spoken by all

Internet participating networks.Internet participating networks. Best effort datagram service:Best effort datagram service:

– No reliability guarantees.No reliability guarantees.– No ordering guarantees.No ordering guarantees.

355

IPIP

Transport layer breaks data streams into Transport layer breaks data streams into datagrams; fragments transmitted over datagrams; fragments transmitted over Internet, possibly being fragmented.Internet, possibly being fragmented.

When all packet fragments arrive at When all packet fragments arrive at destination, reassembled by network layer destination, reassembled by network layer and delivered to transport layer at and delivered to transport layer at destination host.destination host.

356

IP VersionsIP Versions

IPv4: IP version 4.IPv4: IP version 4.– Current, predominant version.Current, predominant version.– 32-bit long addresses.32-bit long addresses.

IPv6: IP version 6 (aka, IPng).IPv6: IP version 6 (aka, IPng).– Evolution of IPv4.Evolution of IPv4.– Longer addresses (16-byte long).Longer addresses (16-byte long).

357

IP Datagram FormatIP Datagram Format

IP datagram consists of header and data (or IP datagram consists of header and data (or payload).payload).

Header:Header:– 20-byte fixed (mandatory) part.20-byte fixed (mandatory) part.– Variable length optional part.Variable length optional part.

358

IP HeaderIP Header

32 bits

Version Headerlength

Type of service Total length

Identification Fragment offsetD M

TTL Protocol Header checksum

Source address

Destination address

Options

U

359

IP Header Fields 1IP Header Fields 1

Version: which IP version datagram uses.Version: which IP version datagram uses. Header length: how long (in 32-bit words) is header; Header length: how long (in 32-bit words) is header;

minimum=5; maximum=15 (options=40 bytes).minimum=5; maximum=15 (options=40 bytes). Type of service: precedence (priority), 3 flags (delay, Type of service: precedence (priority), 3 flags (delay,

throughput, reliability). In practice, routers ignore throughput, reliability). In practice, routers ignore type of service.type of service.

Total length: length of total datagram, i.e., header + Total length: length of total datagram, i.e., header + data (max = 64Kbytes).data (max = 64Kbytes).

360

IP Header Fields 2IP Header Fields 2

Identification: which datagram fragment Identification: which datagram fragment belongs to.belongs to.

U: unused bit.U: unused bit. D: don’t fragment.D: don’t fragment. M: more fragments.M: more fragments. Fragment offset: position of fragment in Fragment offset: position of fragment in

datagram.datagram. TTL: datagram lifetime.TTL: datagram lifetime.

361

IP Header Fields 3IP Header Fields 3

Protocol: number of the transport protocol Protocol: number of the transport protocol that generated the datagram.that generated the datagram.

Header checksum: verifies header integrity; Header checksum: verifies header integrity; computed at each hop.computed at each hop.

Source and destination address: IP Source and destination address: IP addresses of source and destination.addresses of source and destination.

Options: way of extending the protocol. Options: way of extending the protocol.

362

AddressingAddressing

Required for packet delivery.Required for packet delivery.– Each network may use different addressing Each network may use different addressing

scheme.scheme.– Addresses must be unique.Addresses must be unique.

Flat addresses: physical addresses (e.g., Flat addresses: physical addresses (e.g., Ethernet address).Ethernet address).

Hierarchical addresses: use hierarchy Hierarchical addresses: use hierarchy scheme like postal addresses (e.g., IP).scheme like postal addresses (e.g., IP).

363

Address TypesAddress Types

Unicast: uniquely distinguishes a single Unicast: uniquely distinguishes a single node.node.

Multicast: shared by a group of nodes.Multicast: shared by a group of nodes. Broadcast: shared by all nodes.Broadcast: shared by all nodes.

364

IP AddressesIP Addresses

Every host and router on the Internet must Every host and router on the Internet must have an IP address.have an IP address.

2-level hierarchy:2-level hierarchy:– Network number.Network number.– Host number.Host number.

Notations:Notations:– Binary: Binary: 10000000 00000110 11110000 0000001110000000 00000110 11110000 00000011

– Dotted decimal: 128.6.240.3Dotted decimal: 128.6.240.3

365

IP Address Formats 1IP Address Formats 1

4 different classes:4 different classes:

0XXXXXXX

Network Host

10XXXXXX XXXXXXXX

110XXXXX XXXXXXXX XXXXXXXX

1110XXXX XXXXXXXX XXXXXXXX XXXXXXXX

Class A:128 nets.16M hosts/net.Class B:16K nets.64K hosts/net.Class C:2M nets.256 hosts/net.Class D: Multicast.

366

IP Address Formats 2IP Address Formats 2

Class A: 1~127.Class A: 1~127. Class B: 128~191.Class B: 128~191. Class C: 192~223.Class C: 192~223. Class D: 224~239.Class D: 224~239.

367

Multi-addressesMulti-addresses

A router usually has more than one IP A router usually has more than one IP address.address.

Multi-homed host: host with multiple Multi-homed host: host with multiple network interfaces each of which has network interfaces each of which has different IP address.different IP address.

80.0.0.0

236.240.128.0129.98.0.0

129.98.95.1236.240.128.3

80.0.0.8

368

Management and Scalability 1Management and Scalability 1

Network numbers assigned by single Network numbers assigned by single authority: NIC (network information authority: NIC (network information center).center).

All hosts in a network must have same All hosts in a network must have same network number.network number.

What if networks grow?What if networks grow?

369

Management and Scalability 2Management and Scalability 2

Example: company starts with 1 class C Example: company starts with 1 class C LAN, thus can connect up to 256 hosts.LAN, thus can connect up to 256 hosts.– It might grow to more than 256 hosts.It might grow to more than 256 hosts.– It might get more LANs.It might get more LANs.– For every new LAN, need new network number For every new LAN, need new network number

from NIC.from NIC.– Moving machines between LANs needs address Moving machines between LANs needs address

change.change.

370

Subnetting 1Subnetting 1

Split address space into several “internal” Split address space into several “internal” subnets.subnets.– Still act like single network to outside world.Still act like single network to outside world.

371

Subnetting 2Subnetting 2 Routing: hierarchical.Routing: hierarchical.

– (network, -) entries: distant networks hosts.(network, -) entries: distant networks hosts.– (this network, host) entries: local hosts.(this network, host) entries: local hosts.– Routers only need to keep track of other networks and Routers only need to keep track of other networks and

local hosts.local hosts. With subnetting:With subnetting:

– (network, -) entries: distant networks hosts.(network, -) entries: distant networks hosts.– (this network, subnet, -).(this network, subnet, -).– (this network, this subnet, host).(this network, this subnet, host).– Adds extra hierarchical levelAdds extra hierarchical level

372

Subnet MaskSubnet Mask

Used to compute the subnet number; i.e., gets Used to compute the subnet number; i.e., gets rid of the host number.rid of the host number.– Facilitates routing table look-up.Facilitates routing table look-up.– IP address AND subnet mask = subnet #IP address AND subnet mask = subnet #

Example:Example:

10XXXXXX XXXXXXXX SSSSSSHH HHHHHHHH

11111111 11111111 11111100 00000000Ex: 130.50.15.6 AND subnet mask = 130.50.12.0

373

Internet Control ProtocolsInternet Control Protocols

IP carries data.IP carries data. There are other network layer protocols that There are other network layer protocols that

carry control information.carry control information. Example: ICMPExample: ICMP

374

ICMPICMP

Internet Control Message Protocol.Internet Control Message Protocol. Report specific events.Report specific events.

– Generated by routers.Generated by routers.– Encapsulated in IP packets.Encapsulated in IP packets.

375

ICMP MessagesICMP Messages

Destination unreachable Packet couldn’t be deliveredTime exceeded TTL field hit 0Parameter problem Invalid header fieldSource quench Choke packetsRedirect Route problemEcho request Check if destination is upEcho reply Destination respondsTimestamp request Same as echo request + TSTimestamp reply Same as echo reply + TS

376

Mapping IP to DLL AddressMapping IP to DLL Address

Internet applications refer to hosts by their IP Internet applications refer to hosts by their IP addresses; once packet gets to destination addresses; once packet gets to destination LAN, node needs to figure out the destination LAN, node needs to figure out the destination address.address.

One solution is to have configuration file.One solution is to have configuration file.– Hard to maintain/update.Hard to maintain/update.

Address Resolution Protocol (ARP):Address Resolution Protocol (ARP):– Run by every node to map IP to DLL address Run by every node to map IP to DLL address

(RFC 826).(RFC 826).

377

ARPARP

Advantage: Advantage: – Easy to administer, less human intervention.Easy to administer, less human intervention.– Example: 2 hosts on the same Ethernet want to Example: 2 hosts on the same Ethernet want to

communicate.communicate.» Host 1 must figure out host 2’s Ethernet address.Host 1 must figure out host 2’s Ethernet address.

» Host 1 broadcasts ARP packet on Ethernet asking for Host 1 broadcasts ARP packet on Ethernet asking for the Ethernet address of host 2.the Ethernet address of host 2.

» Host 2 receives the ARP request, and replies with its Host 2 receives the ARP request, and replies with its Ethernet address.Ethernet address.

378

ARP OptimizationsARP Optimizations

Caching of ARP replies.Caching of ARP replies.– Entries may have large TTLs.Entries may have large TTLs.

When sending ARP request, piggyback its When sending ARP request, piggyback its own IP-DLL address mapping.own IP-DLL address mapping.

Every machine broadcasts its mapping at Every machine broadcasts its mapping at boot time.boot time.– No response is expected.No response is expected.– Other machines cache that information.Other machines cache that information.

379

Proxy ARPProxy ARP

What if host 1 wants to send data to host 3 What if host 1 wants to send data to host 3 on a different LAN?on a different LAN?– Router connecting the 2 LANs can be Router connecting the 2 LANs can be

configured to respond to ARP requests for the configured to respond to ARP requests for the networks it interconnects: proxy arp.networks it interconnects: proxy arp.

– Another solution is for host 1 to recognize host Another solution is for host 1 to recognize host 3 is on remote network and use default LAN 3 is on remote network and use default LAN address that handles all remote traffic; that address that handles all remote traffic; that could be the router’s Ethernet address. could be the router’s Ethernet address.

380

RARPRARP

Reverse Address Resolution Protocol.Reverse Address Resolution Protocol. Given LAN address, what’s the IP address?Given LAN address, what’s the IP address? Usually for booting diskless workstation.Usually for booting diskless workstation.

– Gets the OS image from remote file server.Gets the OS image from remote file server.– Same image for all machines.Same image for all machines.– Machine broadcasts its LAN address.Machine broadcasts its LAN address.– Remote RARP server responds with machine’s IP Remote RARP server responds with machine’s IP

address.address.

381

BOOTPBOOTP

RARP broadcasts are not forwarded by RARP broadcasts are not forwarded by routers. routers.

Need RARP server on every network.Need RARP server on every network. BOOTP uses UDP messages that are BOOTP uses UDP messages that are

forwarded by routers.forwarded by routers.– Also provides additional information such as IP Also provides additional information such as IP

address of file server holding OS image, subnet address of file server holding OS image, subnet mask, etc.mask, etc.

382

Internet RoutingInternet Routing

IGPs and EGPsIGPs and EGPs– IGPs: routing within ASs.IGPs: routing within ASs.– EGPs: routing between ASs.EGPs: routing between ASs.

383

IGPsIGPs

Original Internet IGP was RIP.Original Internet IGP was RIP.– Distance vector.Distance vector.

– OK for small ASs but not efficient as ASs got larger. OK for small ASs but not efficient as ASs got larger.

New IGP: OSPF.New IGP: OSPF.– Open Shortest Path First.Open Shortest Path First.

– Became standard in 1990.Became standard in 1990.

– Link state algorithm.Link state algorithm.

– RIP is still running but OSPF is taking over.RIP is still running but OSPF is taking over.

384

OSPF 1OSPF 1

Design requirements:Design requirements:– Open implementation.Open implementation.

– Support for various distance metrics: delay, hops, etc.Support for various distance metrics: delay, hops, etc.

– Dynamic: automatically adapt to topology changes.Dynamic: automatically adapt to topology changes.

– QoS Routing: real-time versus other traffic using IP’s type QoS Routing: real-time versus other traffic using IP’s type of service field.of service field.

– Load balancing across multiple lines.Load balancing across multiple lines.

– Security and tunneling.Security and tunneling.

385

OSPF 2OSPF 2

Abstracts collection of networks, routers and Abstracts collection of networks, routers and lines into a directed graph where edges are lines into a directed graph where edges are assigned a cost proportional to the routing assigned a cost proportional to the routing metric.metric.

It then computes shortest path.It then computes shortest path. Hierarchical routing within ASs.Hierarchical routing within ASs.

– Areas: collection of contiguous networks.Areas: collection of contiguous networks.– Area 0: AS backbone; all areas connected to it.Area 0: AS backbone; all areas connected to it.

386

OSPF 3OSPF 3

Type of service routing:Type of service routing:– Uses different graphs labeled with different Uses different graphs labeled with different

metrics.metrics. Routing updates:Routing updates:

– Adjacent routersAdjacent routers exchange routing information. exchange routing information.– Adjacent routers are on different LANs.Adjacent routers are on different LANs.– Reliable link state updates with sequence #’s.Reliable link state updates with sequence #’s.

387

EGPsEGPs

Routing protocol between ASs.Routing protocol between ASs. Take policy into account.Take policy into account.

– An AS may not be willing to carry traffic An AS may not be willing to carry traffic originating and destined to foreign ASs.originating and destined to foreign ASs.

– Example: phone companies are willing to carry Example: phone companies are willing to carry traffic for their customers but not for others.traffic for their customers but not for others.

388

Routing Policy ExamplesRouting Policy Examples

No transit traffic through certain ASs.No transit traffic through certain ASs. Traffic source restricts ASs through which Traffic source restricts ASs through which

its traffic crosses.its traffic crosses. Same for destination.Same for destination.

389

BGP 1BGP 1

Border Gateway Protocol.Border Gateway Protocol. Policies are manually configured into BGP Policies are manually configured into BGP

routers.routers. BGP abstracts networks as a collection of BGP abstracts networks as a collection of

BGP routers and the their links.BGP routers and the their links. 2 BGP routers are connected if they share a 2 BGP routers are connected if they share a

common network.common network. BGP routers communicate reliably using TCP.BGP routers communicate reliably using TCP.

390

BGP 2BGP 2

3 types of networks:3 types of networks:– Stub networks: have a single connection in the Stub networks: have a single connection in the

BGP graph; cannot carry transit traffic.BGP graph; cannot carry transit traffic.– Multi-connected networks: have multiple Multi-connected networks: have multiple

connections but refuse to carry transit traffic.connections but refuse to carry transit traffic.– Transit networks: agree to carry transit (3rd. Transit networks: agree to carry transit (3rd.

party) traffic possibly with some restriction; party) traffic possibly with some restriction; e.g., backbones. e.g., backbones.

391

BGP 3BGP 3

BGP is a distance vector protocol.BGP is a distance vector protocol. Routing table entries keep whole path to Routing table entries keep whole path to

destination + distance.destination + distance. BGP routers can discard the paths containing BGP routers can discard the paths containing

itself: avoiding loops and counting to infinity.itself: avoiding loops and counting to infinity. Routers compute distance associated to a route Routers compute distance associated to a route

taking policy into account.taking policy into account.– If policy is violated, distance = infinity.If policy is violated, distance = infinity.

392

Internet MulticastingInternet Multicasting

IP supports multicasting using class D IP supports multicasting using class D addresses.addresses.– Each class D address identifies a group of Each class D address identifies a group of

hosts.hosts.– 28 bits define over 250 million groups.28 bits define over 250 million groups.

Best-effort delivery.Best-effort delivery.

393

Group MembershipGroup Membership

Hosts (single or multiple processes) may join Hosts (single or multiple processes) may join and leave group.and leave group.

Special, multicast routers perform multicast Special, multicast routers perform multicast routing and packet forwarding.routing and packet forwarding.– Hosts belonging to multicast groups periodically Hosts belonging to multicast groups periodically

send messages to the closest multicast router.send messages to the closest multicast router.– Multicast routers and hosts use IGMP (Internet Multicast routers and hosts use IGMP (Internet

Group Management Protocol) to exchange Group Management Protocol) to exchange membership information.membership information.

394

IP Multicast RoutingIP Multicast Routing Use spanning trees.Use spanning trees. Modified distance vector protocol using Modified distance vector protocol using

unicast routing information.unicast routing information.– Build one spanning tree per source, per group.Build one spanning tree per source, per group.– Or, one shared spanning tree per group.Or, one shared spanning tree per group.– Use pruning to remove parts of the tree that don’t Use pruning to remove parts of the tree that don’t

have any multicast group members.have any multicast group members.– Use tunneling to cross regions that are not Use tunneling to cross regions that are not

multicast capable.multicast capable.

395

Mobile IP 1Mobile IP 1

Support for mobile users.Support for mobile users.– ““Last hop” mobility.Last hop” mobility.

Problem: IP addressing scheme.Problem: IP addressing scheme.– Class+network number+host number.Class+network number+host number.– If host moves and attaches itself to foreign If host moves and attaches itself to foreign

network, packets destined to it will still go to its network, packets destined to it will still go to its home network.home network.

– Assigning hosts new IP address?Assigning hosts new IP address?» Too much hassle.Too much hassle.

396

Mobile IP 2Mobile IP 2

Solution:Solution:– Home agent: runs at the home network.Home agent: runs at the home network.– Foreign agent: runs at foreign network.Foreign agent: runs at foreign network.– When mobile host connects itself to foreign When mobile host connects itself to foreign

network, registers with foreign network’s network, registers with foreign network’s foreign agent.foreign agent.

– Foreign agent assigns host Foreign agent assigns host care-of addresscare-of address, and , and informs home agent.informs home agent.

397

Mobile IP 3Mobile IP 3

Sending packets: mobile host uses its care-of Sending packets: mobile host uses its care-of address.address.

Receiving packets: Receiving packets: – When packet arrives at home network, router that gets it When packet arrives at home network, router that gets it

sends ARP request for that IP address.sends ARP request for that IP address.– Home agent replies with its own Ethernet address. It gets Home agent replies with its own Ethernet address. It gets

the packet, and tunnels it to foreign agent. Foreign agent the packet, and tunnels it to foreign agent. Foreign agent delivers packet to mobile host.delivers packet to mobile host.

– Home agent sends care-of address to sender, so future Home agent sends care-of address to sender, so future packets are sent directly to foreign network.packets are sent directly to foreign network.

398

Mobile IP 4Mobile IP 4

Locating foreign agents:Locating foreign agents:– Foreign agents periodically broadcast their address and Foreign agents periodically broadcast their address and

service provided (e.g., home, foreign, or both).service provided (e.g., home, foreign, or both).– Mobile host can announce its presence and wait for Mobile host can announce its presence and wait for

response from foreign agent.response from foreign agent.

Unregistration:Unregistration:– If host leaves without unregistering, its registration expires If host leaves without unregistering, its registration expires

after some time.after some time.

Security:Security:– Authentication issues.Authentication issues.

399

Scaling IP Addresses 1Scaling IP Addresses 1

Exponential growth of the Internet!Exponential growth of the Internet!– 32-bit address fields are getting too small.32-bit address fields are getting too small.– Early predictions: it’d take decades to achieve Early predictions: it’d take decades to achieve

100,000 network mark.100,000 network mark.– 100,000th. network was connected in 1996!100,000th. network was connected in 1996!– Internet is rapidly running out of IP addresses!Internet is rapidly running out of IP addresses!– Waste due to hierarchical address. Waste due to hierarchical address.

400

IP Address Formats IP Address Formats

4 different classes:4 different classes:

0XXXXXXX

Network Host

10XXXXXX XXXXXXXX

110XXXXX XXXXXXXX XXXXXXXX

1110XXXX XXXXXXXX XXXXXXXX XXXXXXXX

Class A:128 nets.16M hosts/net.Class B:16K nets.64K hosts/net.Class C:2M nets.256 hosts/net.Class D: Multicast.

401

Scaling IP Addresses 2 Scaling IP Addresses 2

Class A addresses: 16M hosts is usually too Class A addresses: 16M hosts is usually too much.much.

Class C addresses: 254 hosts is usually too small.Class C addresses: 254 hosts is usually too small. Class B addresses provide room for 64K hosts.Class B addresses provide room for 64K hosts.

– Organizations usually request class B addresses but Organizations usually request class B addresses but more than 50% of them only have up to 50 hosts!more than 50% of them only have up to 50 hosts!

402

Scaling IP Addresses 3Scaling IP Addresses 3

Class C addresses should have 10-bit host Class C addresses should have 10-bit host numbers instead of only 8-bit numbers.numbers instead of only 8-bit numbers.– Would allow for 1022 hosts instead of just 254.Would allow for 1022 hosts instead of just 254.– More Class C networks: network number can More Class C networks: network number can

grow up to 0.5M.grow up to 0.5M. But, could result in routing table explosion.But, could result in routing table explosion.

– Routers will have to know about many more Routers will have to know about many more networks.networks.

403

CIDR 1CIDR 1

Classless Interdomain Routing: RFC 1519.Classless Interdomain Routing: RFC 1519. No longer uses classes A, B, and C addresses.No longer uses classes A, B, and C addresses. Allocate remaining Class C addresses in Allocate remaining Class C addresses in

variable-sized blocks.variable-sized blocks.– Example: if an organization needs 2000 addresses, Example: if an organization needs 2000 addresses,

it’s given a block of 2048 addresses, or 8 it’s given a block of 2048 addresses, or 8 contiguous class C networks and not a full class B contiguous class C networks and not a full class B address.address.

404

CIDR 2CIDR 2

New allocation rules for class C addresses.New allocation rules for class C addresses. World partitioned into 4 zones and each one was World partitioned into 4 zones and each one was

given portion of class C address space (192~223).given portion of class C address space (192~223).– 192.0.0.0~195.255.255.255: Europe.192.0.0.0~195.255.255.255: Europe.

– 198.0.0.0~199.255.255.255: North America.198.0.0.0~199.255.255.255: North America.

– 200.0.0.0~201.255.255.255: Central and South America.200.0.0.0~201.255.255.255: Central and South America.

– 202.0.0.0~203.255.255: Asia and Pacific.202.0.0.0~203.255.255: Asia and Pacific.

405

CIDR 3CIDR 3

Each region is allocated ~ 32M class C Each region is allocated ~ 32M class C addresses.addresses.

Addresses 204.0.0.0~223.255.255.255 Addresses 204.0.0.0~223.255.255.255 reserved for future use.reserved for future use.

Advantages:Advantages:– Less waste.Less waste.– Routers can keep only one RT entry per region, Routers can keep only one RT entry per region,

i.e., 32M addresses compressed into one.i.e., 32M addresses compressed into one.

406

CIDR 4CIDR 4

Once packet gets to its destination region, Once packet gets to its destination region, need more detailed routing information.need more detailed routing information.

One possibility is to keep 131,072 (32M/2One possibility is to keep 131,072 (32M/288) ) entries for all “local” networks.entries for all “local” networks.– Explosion problem.Explosion problem.

Instead, use of 32-bit masks: only need to Instead, use of 32-bit masks: only need to keep start address of block.keep start address of block.

407

CIDR - Example 1CIDR - Example 1

Cambridge University has 2048 addresses from Cambridge University has 2048 addresses from 194.24.0.0~194.24.7.255 and mask 255.255.248.0.194.24.0.0~194.24.7.255 and mask 255.255.248.0.

Oxford University: 4096 addresses Oxford University: 4096 addresses 194.24.16.0~194.24.31.255 with mask 194.24.16.0~194.24.31.255 with mask 255.255.240.0.255.255.240.0.

U of Edinburgh: 1024 addresses U of Edinburgh: 1024 addresses 194.24.8.0~194.24.11.255 and mask 255.255.252.0.194.24.8.0~194.24.11.255 and mask 255.255.252.0.

408

CIDR - Example 2CIDR - Example 2

Routing tables in Europe contain base address and Routing tables in Europe contain base address and mask:mask:

AddressAddress MaskMask11000010 00011000 00000000 00000000 11111111 11111111 11111000 0000000011000010 00011000 00000000 00000000 11111111 11111111 11111000 0000000011000010 00011000 00010000 00000000 11111111 11111111 11110000 0000000011000010 00011000 00010000 00000000 11111111 11111111 11110000 0000000011000010 00011000 00001000 00000000 11111111 11111111 11111100 0000000011000010 00011000 00001000 00000000 11111111 11111111 11111100 00000000

When packet to 194.24.17.4 (When packet to 194.24.17.4 (11000010 00011000 00010001 0000010011000010 00011000 00010001 00000100) ) arrives, it’s ANDed with Cambridge U’s mask yielding arrives, it’s ANDed with Cambridge U’s mask yielding 11000010 11000010

00011000 00010000 00000000 00011000 00010000 00000000 which does not match Cambridge U’s base. which does not match Cambridge U’s base. When it’s ANDed with Oxford’s mask, it matches Oxford’s base, so When it’s ANDed with Oxford’s mask, it matches Oxford’s base, so packet sent to Oxford’s router.packet sent to Oxford’s router.

409

IP EvolutionIP Evolution

CIDR bought IPv4 a few more years.CIDR bought IPv4 a few more years. Because of its addressing limitations and to Because of its addressing limitations and to

accommodate next-generation Internet accommodate next-generation Internet applications, IP must evolve.applications, IP must evolve.

In 1990, IETF started work on IP next In 1990, IETF started work on IP next generation, or IPng.generation, or IPng.– Several proposals were considered.Several proposals were considered.– SIPP (Simple Internet Protocol Plus) was selected SIPP (Simple Internet Protocol Plus) was selected

and became IPv6.and became IPv6.

410

IPv6 1IPv6 1

RFCs 1883~1887.RFCs 1883~1887. Features:Features:

– Longer addresses (16 bytes versus only 4 in IPv4).Longer addresses (16 bytes versus only 4 in IPv4).– Header simplification (only 7 fields versus 13 Header simplification (only 7 fields versus 13

fields in IPv4): faster processing by routers.fields in IPv4): faster processing by routers.– Better option support since fields that were Better option support since fields that were

previously required are now optional.previously required are now optional.– Improved security and QoS support.Improved security and QoS support.

411

IPv6 HeaderIPv6 Header

32 bits

Version Priority Flow label

Next header Hop limitPayload length

Source address(16 bytes)

Destination address(16 bytes)

412

IPv6 Header Fields 1IPv6 Header Fields 1 Version = 6.Version = 6.

– During transition period, routers will examine this field to During transition period, routers will examine this field to decide what kind of packet it is.decide what kind of packet it is.

Priority: handling different kinds of traffic. Priority: handling different kinds of traffic. – 0~7: data that can be flow controlled, e.g., data distribution 0~7: data that can be flow controlled, e.g., data distribution

services.services.

– 8~15: real-time traffic (e.g., audio, video)8~15: real-time traffic (e.g., audio, video)

– Within each group, lower values have lower priority than Within each group, lower values have lower priority than higher values (e.g., 1 for news, 4 for ftp and 6 for telnet)higher values (e.g., 1 for news, 4 for ftp and 6 for telnet)

413

IPv6 Header Fields 2IPv6 Header Fields 2

Flow label (experimental): allows source and Flow label (experimental): allows source and destination to set up pseudo-connection.destination to set up pseudo-connection.– Try to have some kind of service guarantees.Try to have some kind of service guarantees.– Example: assign flow number to a stream of Example: assign flow number to a stream of

packets that need reserved bandwidth.packets that need reserved bandwidth.– Flow number: src+dst+flow #.Flow number: src+dst+flow #.

Payload length: length of data.Payload length: length of data.– Different from IPv4 which specified total length Different from IPv4 which specified total length

of datagram.of datagram.

414

IPv6 Header Fields 3IPv6 Header Fields 3

Next header: specifies what is present in the Next header: specifies what is present in the options field (extension headers).options field (extension headers).

Hop limit: equivalent to IPv4’s TTL.Hop limit: equivalent to IPv4’s TTL. Source and destination addresses:Source and destination addresses:

– 16-byte addresses (fixed length).16-byte addresses (fixed length).– Address space is divided by using prefixes.Address space is divided by using prefixes.

415

IPv6 versus IPv4IPv6 versus IPv4

No more IHL (header length); why?No more IHL (header length); why? No more No more protocolprotocol field: field: next headernext header field. field. No more fragmentation-related fields.No more fragmentation-related fields.

– All IPv6 hosts and routers must support 576-byte packets.All IPv6 hosts and routers must support 576-byte packets.

– Fragmentation is less likely to occur.Fragmentation is less likely to occur.

– Router sends error messages back to source when packet is Router sends error messages back to source when packet is too big so source breaks it down.too big so source breaks it down.

No more checksum: rely on more reliable networks No more checksum: rely on more reliable networks and DLL and transport checksums.and DLL and transport checksums.

416

IPv6 Addressing 1IPv6 Addressing 1

Separate prefixes for provider-based and geographic-Separate prefixes for provider-based and geographic-based addresses.based addresses.– Ability to accommodate 2 ways of address assignment: Ability to accommodate 2 ways of address assignment:

» Addresses allocated to ISP companies.Addresses allocated to ISP companies. Prefix 010.Prefix 010. Each ISP assigned portion of address space.Each ISP assigned portion of address space. First 5 bits following prefix defines registry where provider is First 5 bits following prefix defines registry where provider is

registered.registered. Remaining 15 bytes are allocated by each provider.Remaining 15 bytes are allocated by each provider. Example: 3-byte provider number.Example: 3-byte provider number.

417

IPv6 Addressing 2IPv6 Addressing 2 Geographic-based addresses:Geographic-based addresses:

– Prefix 100.Prefix 100.– Same model as current Internet.Same model as current Internet.

Multicast addresses:Multicast addresses:– Prefix 11111111.Prefix 11111111.– 4-bit flag + 4-bit scope fields + 112-bit group id.4-bit flag + 4-bit scope fields + 112-bit group id.– Flags: 1 bit defines whether group is permanent or Flags: 1 bit defines whether group is permanent or

not.not.– Scope: limit reach of multicast packet.Scope: limit reach of multicast packet.

418

IPv6 Address NotationIPv6 Address Notation

8 groups of 4 hexadecimal digits separated 8 groups of 4 hexadecimal digits separated by colons.by colons.– Example: Example:

8000:0000:0000:0000:0123:4567:89AB:CDEF8000:0000:0000:0000:0123:4567:89AB:CDEF– Optimizations:Optimizations:

» Leading zeros within group can be omitted.Leading zeros within group can be omitted.

» Groups of zeros can be replaced by pair of colons.Groups of zeros can be replaced by pair of colons. 8000::123:4567:89AB:CDEF.8000::123:4567:89AB:CDEF.

» IPv4 addresses: ::192.31.20.46.IPv4 addresses: ::192.31.20.46.

419

Extension Headers 1Extension Headers 1

Equivalent to IPv4 options.Equivalent to IPv4 options. 6 types of extension headers:6 types of extension headers:

Hop-by-hop optionsHop-by-hop options Misc. info for routersMisc. info for routers

RoutingRouting Full or partial route includedFull or partial route included

FragmentationFragmentation Management of fragmentsManagement of fragments

AuthenticationAuthentication Verification of source’s idVerification of source’s id

Encrypted payloadEncrypted payload Information about encryptionInformation about encryption

Destination optionsDestination options Information for destinationInformation for destination

420

Extension Headers 2Extension Headers 2

Fixed format and variable-sized headers.Fixed format and variable-sized headers. Variable-sized headers:Variable-sized headers:

– (type, length, value).(type, length, value).

– Type: 1 byte specifying which option this is.Type: 1 byte specifying which option this is.» First 2 bits tell option-uncapable routers what to do: skip option, First 2 bits tell option-uncapable routers what to do: skip option,

discard packet, discard packet with ICMP message, discard packet discard packet, discard packet with ICMP message, discard packet without ICMP packet for multicast addresses.without ICMP packet for multicast addresses.

– Length: how long value field (0~255 bytes).Length: how long value field (0~255 bytes).

– Value: information.Value: information.

421

Hop-by-Hop HeaderHop-by-Hop Header

Convey information all routers along path Convey information all routers along path must examine.must examine.– Jumbograms: datagrams > 64KBytes.Jumbograms: datagrams > 64KBytes.

– Next header: what option this is.Next header: what option this is.

– Length of hop-by-hop header excluding the first 8 Length of hop-by-hop header excluding the first 8 (mandatory) bytes.(mandatory) bytes.

– Defines option, in this case datagram size.Defines option, in this case datagram size.

Next Header 0 194 0

Jumbogram payload length

422

Routing HeaderRouting Header

Lists one or more routers that must be Lists one or more routers that must be visited on the way to the destination.visited on the way to the destination.– Strict source routing: full path is supplied.Strict source routing: full path is supplied.– Loose source routing: only selected routers are Loose source routing: only selected routers are

listed.listed.

423

Fragment HeaderFragment Header

Allows source to fragment datagram.Allows source to fragment datagram.– In IPv6, routers are not allowed to fragment.In IPv6, routers are not allowed to fragment.– If a router receives packet that is too big, it If a router receives packet that is too big, it

discards it and sends back a ICMP message to discards it and sends back a ICMP message to source.source.

– Source uses this option to fragment packet, and Source uses this option to fragment packet, and resend it.resend it.

– Contains datagram id, fragment number, and Contains datagram id, fragment number, and “last fragment” bit.“last fragment” bit.

424

Authentication HeaderAuthentication Header

Supports verification of sender’s identity.Supports verification of sender’s identity. Contains authentication key and Contains authentication key and

cryptographic checksum of the whole cryptographic checksum of the whole datagram.datagram.

Receiver uses key number to find secret Receiver uses key number to find secret key. Computes checksum using secret key key. Computes checksum using secret key and checks whether it matches with and checks whether it matches with received datagram.received datagram.

425

Destination OptionsDestination Options

Supports options that need only be Supports options that need only be interpreted by destination host.interpreted by destination host.

426

Network Layer in ATM Network Layer in ATM NetworksNetworks

ATM layer: connection oriented.ATM layer: connection oriented.– Provides connection-oriented service.Provides connection-oriented service.– Uses virtual circuits, or virtual channels.Uses virtual circuits, or virtual channels.– No ACKs.No ACKs.

» Intended for fiber networks.Intended for fiber networks.

» Intended for real-time traffic.Intended for real-time traffic.

– Ordering guarantees.Ordering guarantees.

427

ATM NetworksATM Networks

Virtual path: group of virtual circuits.Virtual path: group of virtual circuits.– When re-routed, all VCs are re-routed together.When re-routed, all VCs are re-routed together.

428

ATM CellsATM Cells

53 bytes!53 bytes! 2 different formats: 2 different formats:

– UNI: user-network interface.UNI: user-network interface.» Between host and ATM network (carrier).Between host and ATM network (carrier).

– NNI: network-network interface.NNI: network-network interface.» Between 2 ATM switches (ATM for routers).Between 2 ATM switches (ATM for routers).

429

Cell FormatsCell Formats

GFC VPI VCI PTI P HEC

4 bits 8 bits 16 bits 3 bits 8 bits

UNI Header:

NNI Header:

VPI VCI PTI P HEC

GFC: General flow controlVPI: Virtual path idVCI: Virtual channel id

PTI: Payload typeC: Cell loss priorityHEC: Header error control

430

Cell Fields 1Cell Fields 1

GFC: only in UNI cells.GFC: only in UNI cells.– No e2e significance.No e2e significance.– First switch overwrites it.First switch overwrites it.– Not currently used.Not currently used.

VPI: specifies virtual path (up to 256 VPs).VPI: specifies virtual path (up to 256 VPs). VCI: specifies virtual circuit (up to 64K VCI: specifies virtual circuit (up to 64K

VCs).VCs).

431

Cell Fields 2Cell Fields 2 PTI: type of payload.PTI: type of payload.

– Cell type defined by user, congestion info by Cell type defined by user, congestion info by network.network.

Payload TypePayload Type MeaningMeaning000000 User data, no congestion, cell type 0User data, no congestion, cell type 0001001 User data, no congestion, cell type 1User data, no congestion, cell type 1010010 User data, congestion, cell type 0User data, congestion, cell type 0011011 User data, congestion, cell type 1User data, congestion, cell type 1100100 Control info adjacent switchesControl info adjacent switches101101 Control info between src and dstControl info between src and dst110110 Resource management (ABR CC)Resource management (ABR CC)111111 ReservedReserved

432

Cell Field 3Cell Field 3

CLP bit may be set by host to differentiate CLP bit may be set by host to differentiate high- from low-priority traffic when high- from low-priority traffic when choosing cell to discard if congestion.choosing cell to discard if congestion.

HEC: header checksum.HEC: header checksum.

Payload: 48 bytes.Payload: 48 bytes.

433

Connection SetupConnection Setup

Permanent and switched VCs.Permanent and switched VCs.– Permanent: always present (like leased lines).Permanent: always present (like leased lines).– Switched: need to be established (like phone Switched: need to be established (like phone

calls).calls). How are switched VCs established?How are switched VCs established?

– Separate protocol called Q.2931.Separate protocol called Q.2931.

434

VC SetupVC Setup

Source Switch 1 Switch 2 DestinationSetup

Setup

SetipCall processing

Call processing

ConnectConnect

Connect

Connect ack

Connect ackConnect ack

435

VC Tear-downVC Tear-down

Release

Release

Release

Release complete

Release complete

Release complete

436

Routing and SwitchingRouting and Switching

Routing using VPs and VCs.Routing using VPs and VCs.– Route on VPIs except at the final hop.Route on VPIs except at the final hop.– Advantages:Advantages:

» Once VP established, all VCs between src-dst can Once VP established, all VCs between src-dst can follow the same path: no new routing decisions.follow the same path: no new routing decisions.

» Cell switching only needs to look at the VP (12bits) Cell switching only needs to look at the VP (12bits) instead of VP (12 bits) + VC (16 bits).instead of VP (12 bits) + VC (16 bits).

» Easier to re-route whole group of VCs.Easier to re-route whole group of VCs.

» Easier for carriers to offer private networks.Easier for carriers to offer private networks.

437

Network Layer in ATM Network Layer in ATM NetworksNetworks

[Continuation][Continuation]

438

Service Categories 1Service Categories 1

Types of traffic carried by ATM networks Types of traffic carried by ATM networks and types of services required by users.and types of services required by users.– Constant-bit rate (CBR): Constant-bit rate (CBR):

» No error or flow control.No error or flow control.

» Constant-rate, synchronous bit transmission.Constant-rate, synchronous bit transmission.

» Accommodate traffic carried by current telephone Accommodate traffic carried by current telephone system: T1 lines, voice-grade lines.system: T1 lines, voice-grade lines.

439

Service Categories 2Service Categories 2

Variable bit rate (VBR):Variable bit rate (VBR):– RT-VBR: variable bit rates and real-time RT-VBR: variable bit rates and real-time

requirements.requirements.» Example: interactive compressed video Example: interactive compressed video

(videoconferencing applications).(videoconferencing applications).» Compression schemes: base frame+differences between Compression schemes: base frame+differences between

current and base frames: transmission rate varies over current and base frames: transmission rate varies over time.time.

» Cell delay and cell delay variation must be controlled: Cell delay and cell delay variation must be controlled: image quality.image quality.

» But occasional loss is tolerable.But occasional loss is tolerable.

440

Service Categories 3Service Categories 3

Variable bit rate (VBR):Variable bit rate (VBR):– NRT-VBR: services with variable bit rates and NRT-VBR: services with variable bit rates and

non real-time requirements.non real-time requirements.» Example: multimedia e-mail (stored in disk; eliminates Example: multimedia e-mail (stored in disk; eliminates

delay variation).delay variation).

441

Service Categories 4Service Categories 4

Available bit rate (ABR): Available bit rate (ABR): – Targets bursty traffic.Targets bursty traffic.– Guarantees average demand and will try to Guarantees average demand and will try to

provide peak demand.provide peak demand.– Network provides feedback to sender: request Network provides feedback to sender: request

sender to slow down if congestion.sender to slow down if congestion.– If senders are well-behaved, low loss rate.If senders are well-behaved, low loss rate.

442

Service Categories 5Service Categories 5

Unspecified bit rate (UBR):Unspecified bit rate (UBR):– No guarantees: best effort.No guarantees: best effort.– Suited to IP traffic.Suited to IP traffic.– Potential applications: file transfer, e-mail, Potential applications: file transfer, e-mail,

news.news.

443

Quality of Service Quality of Service

Service offered by the network (carrier) to customer Service offered by the network (carrier) to customer (end user): service agreement.(end user): service agreement.

Service agreement: offered traffic, offered service, Service agreement: offered traffic, offered service, compliance requirements.compliance requirements.

If customer and carrier don’t agree: VC will not be If customer and carrier don’t agree: VC will not be set up.set up.

Different requirements for each direction.Different requirements for each direction.– E.g., VOD application: required bandwidth user->server E.g., VOD application: required bandwidth user->server

<> server->user.<> server->user.

444

Quality of Service Parameters 1Quality of Service Parameters 1

Peak cell rate PCR Max. cell transmission rateSustained cell rate SCR Average cell rateMinimum cell rate MCR Min. acceptable cell rateCell delay variation tolerance CDVT Max. acceptable cell jitterCell loss ratio CLR Fraction of lost cellsCell transfer delay CTD Time to deliverCell delay variation CDV Delivery delay variationCell error rate CER Fraction of correct cells

445

QoS Parameters 2QoS Parameters 2

PCR, SCR, MCR, and CVDT: specified by PCR, SCR, MCR, and CVDT: specified by sender.sender.

CLR, CTD, and CDV describe network CLR, CTD, and CDV describe network conditions and are measured at receiver.conditions and are measured at receiver.

446

Traffic PolicingTraffic Policing

Checking whether each cell conforms to Checking whether each cell conforms to service agreement parameters.service agreement parameters.

2 parameters:2 parameters:– Maximum allowed arrival rate (PCR).Maximum allowed arrival rate (PCR).

» Or minimum inter-arrival time.Or minimum inter-arrival time.

– Amount of acceptable variation (CDVT).Amount of acceptable variation (CDVT). Enforcing service agreement:Enforcing service agreement:

– Non-conforming cells are dropped.Non-conforming cells are dropped.

447

Congestion ControlCongestion Control

Admission control:Admission control:– Congestion avoidance strategy.Congestion avoidance strategy.– New flow specifies offered traffic and expected New flow specifies offered traffic and expected

service.service.– Before setting up VC, network checks whether Before setting up VC, network checks whether

requested resources are available without affecting requested resources are available without affecting other flows.other flows.

– If no routes satisfy request, call is rejected.If no routes satisfy request, call is rejected.– Prevent starvation by dividing users into classes.Prevent starvation by dividing users into classes.

448

Resource ReservationResource Reservation

Resources can be reserved at call setup Resources can be reserved at call setup time.time.

Reserve peak bandwidth along each hop.Reserve peak bandwidth along each hop. Reserving peak versus average bandwidth.Reserving peak versus average bandwidth.

449

Rate-Based Congestion Control 1Rate-Based Congestion Control 1

CBR and VBR: sender cannot slow down CBR and VBR: sender cannot slow down due to real-time nature of traffic.due to real-time nature of traffic.

UBR: extra cells are simply dropped.UBR: extra cells are simply dropped. ABR: network can signal congestion asking ABR: network can signal congestion asking

sender(s) to slow down.sender(s) to slow down. ACR: actual cell rate.ACR: actual cell rate.

– For each sender.For each sender.– MCR < ACR < PCRMCR < ACR < PCR

450

Rate-Based Congestion Control 2Rate-Based Congestion Control 2

Resource management (RM) cell:Resource management (RM) cell:– Transmitted after a certain number of data cells Transmitted after a certain number of data cells

traveling along same path.traveling along same path.– Carry the explicit rate (ER), which is rate at Carry the explicit rate (ER), which is rate at

which sender would currently like to transmit.which sender would currently like to transmit.– Congested switches may reduce ER.Congested switches may reduce ER.– When RM cell comes back, sender knows When RM cell comes back, sender knows

acceptable rate and adjusts ACR accordingly.acceptable rate and adjusts ACR accordingly.

451

The Transport LayerThe Transport Layer

452

The Transport LayerThe Transport Layer

End-to-end.End-to-end.– Communication from source to destination Communication from source to destination

host.host.– Only hosts run transport-level protocols.Only hosts run transport-level protocols.– Under user’s control as opposed to network Under user’s control as opposed to network

layer which is controlled/owned by carrier.layer which is controlled/owned by carrier.

453

The Transport ServiceThe Transport Service

Service provided to application layer.Service provided to application layer. Transport entity: process that implements Transport entity: process that implements

the transport protocol running on a host.the transport protocol running on a host.– At OS kernel, user-level process, or network At OS kernel, user-level process, or network

card.card.

454

The Transport LayerThe Transport Layer

TransportEntity

ApplicationLayer

Network Layer

Transportaddress

NetworkAddress

Transport/networkinterface

Application/transportinterface Transport

Entity

ApplicationLayer

Network Layer

TPDU

Source host Destination host

455

Types of Transport ServicesTypes of Transport Services

Connection-less versus connection-oriented.Connection-less versus connection-oriented. Connection-less service: no logical Connection-less service: no logical

connections, no flow or error control.connections, no flow or error control. Connection-oriented: Connection-oriented:

– Based on logical connections: connection setup, Based on logical connections: connection setup, data transfer, connection teardown.data transfer, connection teardown.

– Flow and error control.Flow and error control.

456

Transport versus NetworkTransport versus NetworkLayerLayer

Transport layer is “controlled” by user.Transport layer is “controlled” by user.– Ability to enhance network layer quality of Ability to enhance network layer quality of

service.service.– Example: transport service can be more reliable Example: transport service can be more reliable

than underlying network service.than underlying network service.– Transport layer makes standard set of Transport layer makes standard set of

primitives available to users which are primitives available to users which are independent from the network service independent from the network service primitives, which may vary considerably.primitives, which may vary considerably.

457

Quality of ServiceQuality of Service

User may specify QoS parameters at then User may specify QoS parameters at then transport layer.transport layer.– At connection setup time, user may define At connection setup time, user may define

preferred, acceptable, and minimum values for preferred, acceptable, and minimum values for various service parameters.various service parameters.

– Transport layer determines whether it’s Transport layer determines whether it’s possible to provide required service based on possible to provide required service based on available network service(s).available network service(s).

458

Transport-Layer QoS Parameters Transport-Layer QoS Parameters 11

Connection establishment delay: time to Connection establishment delay: time to establish connection.establish connection.

Connection establishment failure Connection establishment failure probability: probability connection is not probability: probability connection is not established within maximum establishment established within maximum establishment time.time.

Throughput: bytes transferred per second Throughput: bytes transferred per second measured over a time interval.measured over a time interval.

459

Transport-Layer QoS Parameters Transport-Layer QoS Parameters 22

Transit delay: time between sending a Transit delay: time between sending a message and receiving it on the other side message and receiving it on the other side (measured by the transport entities).(measured by the transport entities).

Residual error ratio: ratio of messages in error Residual error ratio: ratio of messages in error to total messages sent.to total messages sent.

Priority: way for user to indicate that some Priority: way for user to indicate that some connections are more important.connections are more important.

Resilience: probability connection is Resilience: probability connection is terminated due to congestion, etc. terminated due to congestion, etc.

460

Transport Layer QoSTransport Layer QoS

Only few transport protocols provide QoS Only few transport protocols provide QoS parameters. parameters.

Most just try to minimize residual error rate.Most just try to minimize residual error rate. QoS parameters specified by transport user QoS parameters specified by transport user

when connection is setup.when connection is setup.– Desired and minimum acceptable values can be Desired and minimum acceptable values can be

specified. specified. – Service negotiation.Service negotiation.

461

Transport Service PrimitivesTransport Service Primitives

Allow transport users (e.g., application Allow transport users (e.g., application programs) to access transport service.programs) to access transport service.

Example: connection-oriented transport service Example: connection-oriented transport service primitives.primitives.PRIMITIVEPRIMITIVE TPDU SentTPDU Sent Meaning MeaningLISTENLISTEN (none) (none) listen for connection listen for connectionCONNECTCONNECT Connection Req. try to establish connection Connection Req. try to establish connection

SENDSEND DATA DATA send data send dataRECEIVERECEIVE (none)(none) waits for data waits for dataDISCONNECTDISCONNECT Disc. Req.Disc. Req. try to release connection try to release connection

462

TPDUTPDU

Transport protocol data unit.Transport protocol data unit. Messages sent between transport entities.Messages sent between transport entities. TPDUs contained in network-layer packets, TPDUs contained in network-layer packets,

which in turn are contained in DLL frames.which in turn are contained in DLL frames.

Frameheader

Packetheader

TPDUheader TPDU payload

463

Connection Management State Connection Management State MachineMachine

Established

Idle

Activeestablishmentpending

Activedisconnectpending

Idle

Passiveestablishmentpending

Passivedisconnectpending

Connectexecuted

ConnectionAccept

SERVER CLIENTConnection req. received

Connectexecuted

Disc. req.received

s

Disconnectexecuted

Disconnectexecute

Disc. accept. received

464

Berkeley Sockets 1Berkeley Sockets 1

Set of transport-level primitives made available by Set of transport-level primitives made available by Berkeley UNIX. Berkeley UNIX.

Server side: Server side: » SOCKET: create new communication end point.SOCKET: create new communication end point.

» BIND: attach local address to socket (once server binds address, BIND: attach local address to socket (once server binds address, clients can connect to it).clients can connect to it).

» LISTEN: listen for connection.LISTEN: listen for connection.

» ACCEPT: accept new connection.ACCEPT: accept new connection.

» SEND, RECEIVE: send and receive data.SEND, RECEIVE: send and receive data.

» CLOSE: release connection.CLOSE: release connection.

465

Berkeley Sockets 2Berkeley Sockets 2

Client side:Client side:» SOCKET: create socket.SOCKET: create socket.

» CONNECT: try to establish connection.CONNECT: try to establish connection.

» SEND, RECEIVE: send and receive data.SEND, RECEIVE: send and receive data.

» CLOSE: release connection. CLOSE: release connection.

466

Transport Protocol Issues: Transport Protocol Issues: AddressingAddressing

Address of the transport-level entity.Address of the transport-level entity. TSAP: transport service access point TSAP: transport service access point

(analogous to NSAP).(analogous to NSAP).– Internet TSAP: (IP address, local port).Internet TSAP: (IP address, local port).– Internet NSAP: IP address.Internet NSAP: IP address.– There may be multiple TSAPs on one host.There may be multiple TSAPs on one host.– Typically, only one NSAP.Typically, only one NSAP.

467

Example 1Example 1

Finding the time of day from a time-of-day Finding the time of day from a time-of-day server.server.– Time-of-day server process on host 2 attaches Time-of-day server process on host 2 attaches

itself to TSAP 122 and waits for requests (e.g., itself to TSAP 122 and waits for requests (e.g., through LISTEN).through LISTEN).

– Application process (TSAP 6) on host 1 wants Application process (TSAP 6) on host 1 wants to find out the time-of-day; issues CONNECT to find out the time-of-day; issues CONNECT specifying TSAP 6 as source and TSAP 122 as specifying TSAP 6 as source and TSAP 122 as destination.destination.

468

Example 2Example 2

– Transport entity on host 1 tries to establish Transport entity on host 1 tries to establish transport connection between its TSAP 6 and transport connection between its TSAP 6 and the TSAP 122 on host 2.the TSAP 122 on host 2.

– Transport entity on host 2 contacts process on Transport entity on host 2 contacts process on TSAP 122; if it agrees, transport connection TSAP 122; if it agrees, transport connection established.established.

469

Finding Services 1Finding Services 1

Well-known TSAP.Well-known TSAP.– Time-of-day server has been using TSAP 122 forever so Time-of-day server has been using TSAP 122 forever so

every users know it.every users know it.

Initial connection protocol: special Initial connection protocol: special process process serverserver that proxies for less well-known that proxies for less well-known services.services.– Process server listens to set of ports at the same time.Process server listens to set of ports at the same time.– Users CONNECT to a TSAP, and if there are no servers, Users CONNECT to a TSAP, and if there are no servers,

process server is likely to be listening. It them spawns process server is likely to be listening. It them spawns requested server.requested server.

470

Finding Services 2Finding Services 2

Name or directory service.Name or directory service.– Name server listens to well-known TSAP.Name server listens to well-known TSAP.– User sends service name and name server User sends service name and name server

responds with service’s TSAP.responds with service’s TSAP.– New services need to register with name server.New services need to register with name server.

Finding the server’s network address.Finding the server’s network address.– Hierarchical addresses solve this problem, i.e., the Hierarchical addresses solve this problem, i.e., the

NSAP is part of the TSAP.NSAP is part of the TSAP.

471

Connection EstablishmentConnection Establishment

CONNECTION REQUEST and CONNECTION CONNECTION REQUEST and CONNECTION ACCEPTED TPDUs.ACCEPTED TPDUs.

Problem: delayed duplicates.Problem: delayed duplicates.– Duplicates can re-appear and be taken as the real Duplicates can re-appear and be taken as the real

messages.messages.

Solution: messages age and are discarded after some Solution: messages age and are discarded after some time; need to discard ack’s.time; need to discard ack’s.– Maximum hop count.Maximum hop count.

– Timestamp.Timestamp.

472

Avoiding Duplicates 1Avoiding Duplicates 1

2 identically numbered TPDUs are never 2 identically numbered TPDUs are never outstanding at the same time.outstanding at the same time.

Bounded packet lifetime.Bounded packet lifetime. Each host has its clock.Each host has its clock.

– Clock as a counter that increments itself.Clock as a counter that increments itself.– #bits(counter)>= #bits(sequence number).#bits(counter)>= #bits(sequence number).– Clocks don’t “crash”.Clocks don’t “crash”.

473

Avoiding Duplicates 2Avoiding Duplicates 2

When connection setup, low-order When connection setup, low-order kk bits of bits of clock used as initial sequence number.clock used as initial sequence number.

Each connection starts numbering its Each connection starts numbering its TPDUs with different sequence number.TPDUs with different sequence number.

Sequence number space need to be such Sequence number space need to be such that by the time sequence numbers wrap that by the time sequence numbers wrap around, old TPDUs with same sequence around, old TPDUs with same sequence numbers have aged.numbers have aged.

474

Sequence Numbers versus Time Sequence Numbers versus Time 11

Seq.#’s

Time

. Linear relation between timeand initial sequence number.

475

Sequence Numbers versus Time Sequence Numbers versus Time 22

Seq.#’s

Time

. Host crash: when it comes up, it doesn’t know where it ere in the sequence # space.

T

Forbiddenregion

. Example: T=60 sec and clock ticks once per second.. At t=30s, TPDU on connection5 gets seq.# 80.

. Host crashes and comes up.

. At t=60s, reopens connections 0~4.

. At t=70s, reopens connection 5 and at t=80s, sends TPDU 80.

. Old TPDU 80 still valid, and one would look like a duplicate.

. To prevent this, check if it’s in the “forbidden region” and delay sequence number.

476

Three-Way HandshakeThree-Way Handshake

Solves the problem of getting 2 sides to Solves the problem of getting 2 sides to agree on initial sequence number.agree on initial sequence number.

CR (seq=x)

ACK(seq=y,ACK=x)

DATA(seq=x, ACK=y)

CR: connectionrequest.

1 2

477

3-Way Handshake: Duplicates 13-Way Handshake: Duplicates 1

. Old duplicate CR.

. The ACK from host 2 triesto verify if host 1 was trying to open a new connection with seq=x.. Host 1 rejects host 2’s attempt to establish.Host 2 realizes it was a duplicateCR and aborts connection.

CR(seq=x)*

ACK(seq=y, ACK=x)

REJECT(ACK=y)

1 2

478

3-Way Handshake: Duplicates 23-Way Handshake: Duplicates 2

. Old duplicate CR and ACKto connection accepted.

CR(seq=x)*

ACK(seq=y, ACK=x)

REJECT(ACK=y)

1 2

DATA(seq=x,ACK=z)

479

Connection ReleaseConnection Release

Asymmetric release: telephone system.Asymmetric release: telephone system.– When one party hangs up, connection breaks.When one party hangs up, connection breaks.– May cause data loss.May cause data loss.

Symmetric release: Symmetric release: – Treats connection as 2 separate unidirectional Treats connection as 2 separate unidirectional

connections.connections.– Requires each to be released separately.Requires each to be released separately.

480

Symmetric ReleaseSymmetric Release

How to determine when all data has been How to determine when all data has been sent and connection could be released?sent and connection could be released?

2-army problem:2-army problem:

Blue army 1

White army

Blue army 2

. White army largerthan either blue armies.. Blue army together is larger.. If each blue army attacks, it’ll be defeated. They win if attack together.

481

2-Army Problem 12-Army Problem 1

To synchronize attack, they must use messengers that To synchronize attack, they must use messengers that need to cross valley: unreliable.need to cross valley: unreliable.

Is there a protocol that allows blue army to win? No.Is there a protocol that allows blue army to win? No.– Blue army 1 sends message to blue army 2.Blue army 1 sends message to blue army 2.

– Blue army 2 sends ACK back.Blue army 2 sends ACK back.

– Blue army 2 is not sure whether ACK was received.Blue army 2 is not sure whether ACK was received.

482

2-Army Problem 22-Army Problem 2

Use 2-way handshake.Use 2-way handshake.– Blue army 1 ACKs back but it’ll never know if Blue army 1 ACKs back but it’ll never know if

the ACK was received.the ACK was received. Applying to connection release:Applying to connection release:

– Neither side is prepared to disconnect until Neither side is prepared to disconnect until convince other side is prepared to disconnect.convince other side is prepared to disconnect.

– In practice, hosts are willing to take risks. In practice, hosts are willing to take risks.

483

Connection Release ProtocolConnection Release Protocol

DR

DR

ACK

DR: disconnectionrequest.

Send DR+start timer

Send DR+start timerRelease

connection

Send ACK Release

connection

484

Connection Release Scenarios 1 Connection Release Scenarios 1

DR

DR

ACK

DR: disconnectionrequest.

Send DR+start timer

Send DR+start timerRelease

connection

Send ACK Timeout:

Release connection

485

Connection Release Scenarios 2 Connection Release Scenarios 2

DR

DR

DR: disconnectionrequest.

Send DR+start timer

Send DR+start timerTimeout:

send DR+start timer

Release connection

DR

Send DR+start timerDR

ACK

486

The Internet Transport Protocols: The Internet Transport Protocols: TCP and UDPTCP and UDP

UDP: user datagram protocol (RFC 768).UDP: user datagram protocol (RFC 768).– Connection-less protocol.Connection-less protocol.

TCP: transmission control protocol (RFCs TCP: transmission control protocol (RFCs 793, 1122, 1323).793, 1122, 1323).– Connection-oriented protocol.Connection-oriented protocol.

487

UDPUDP

Provides connection-less, unreliable service.Provides connection-less, unreliable service.– No delivery guarantees.No delivery guarantees.– No ordering guarantees.No ordering guarantees.– No duplicate detection.No duplicate detection.

Low overhead.Low overhead.– No connection establishment/teardown.No connection establishment/teardown.

Suitable for short-lived connections.Suitable for short-lived connections.– Example: client-server applications. Example: client-server applications.

488

UDP Segment FormatUDP Segment Format

0 15 31

Source port Destination port

Length Checksum

Data

Source and destination ports: identify the end points.Length: 8-byte header+ data.Checksum: optional; if not used, set to zero.

489

UDP ChecksumUDP Checksum

Computed over a Computed over a pseudo-headerpseudo-header+ UDP + UDP header+data+padding (to even number of header+data+padding (to even number of bytes if needed).bytes if needed).

Pseudo-header:Pseudo-header:

0 31

Source IP address

Destination IP address

00000000 Protocol Segment length

490

TCPTCP

Reliable end-to-end communication.Reliable end-to-end communication. TCP transport entity:TCP transport entity:

– Runs on machine that supports TCP.Runs on machine that supports TCP.– Interfaces to the IP layer.Interfaces to the IP layer.– Manages TCP streams.Manages TCP streams.

» Accepts user data, breaks it down and sends it as Accepts user data, breaks it down and sends it as separate IP datagrams.separate IP datagrams.

» At receiver, reconstructs original byte stream from At receiver, reconstructs original byte stream from IP datagrams.IP datagrams.

491

TCP ReliabilityTCP Reliability

Reliable delivery.Reliable delivery.– ACKs.ACKs.– Timeouts and retransmissions.Timeouts and retransmissions.

Ordered delivery.Ordered delivery.

492

TCP Service Model 1TCP Service Model 1

Obtained by creating TCP end points.Obtained by creating TCP end points.– Example: UNIX sockets.Example: UNIX sockets.– TSAP address: IP address + 16-bit port TSAP address: IP address + 16-bit port

number.number.– Multiple connections can share same port pair.Multiple connections can share same port pair.– Port numbers below 1024: well-known ports Port numbers below 1024: well-known ports

reserved for standard services.reserved for standard services.» List of well-known ports in RFC 1700.List of well-known ports in RFC 1700.

493

TCP Service Model 2TCP Service Model 2

TCP connections are full-duplex and point-TCP connections are full-duplex and point-to-point.to-point.

Byte stream (not message stream).Byte stream (not message stream).– Message boundaries are not preserved e2e. Message boundaries are not preserved e2e.

A B C D

4 512-byte segments sent asseparate IP datagrams

A B C D

2048 bytes of data deliveredto application in single READ

494

TCP Byte StreamTCP Byte Stream

When application passes data to TCP, it When application passes data to TCP, it may send it immediately or buffer it.may send it immediately or buffer it.

Sometimes application wants to send data Sometimes application wants to send data immediately.immediately.– Example: interactive applications.Example: interactive applications.– Use PUSH flag to force transmission.Use PUSH flag to force transmission.

URGENT flag.URGENT flag.– Also forces TCP to transmit at once.Also forces TCP to transmit at once.

495

TCP Protocol Overview 1TCP Protocol Overview 1

TCP’s TPDU: segment.TCP’s TPDU: segment.– 20-byte header + options.20-byte header + options.– Data.Data.– TCP entity decides the size of segment.TCP entity decides the size of segment.

» 2 limits: 64KByte IP payload and MTU.2 limits: 64KByte IP payload and MTU.

» Segments that are too large are fragmented.Segments that are too large are fragmented. More overhead by addition of IP header. More overhead by addition of IP header.

496

TCP Protocol Overview 2TCP Protocol Overview 2

Sequence numbers.Sequence numbers.– Reliability, ordering, and flow control.Reliability, ordering, and flow control.– Assigned to every byte.Assigned to every byte.– 32-bit sequence numbers.32-bit sequence numbers.

497

TCP Segment HeaderTCP Segment Header

Source port Destination port

Sequence number

Acknowledgment numberHeaderlength

UA

P R S F Window size

Checksum Urgent pointerOptions (0 or more 32-bit words)

Data

498

TCP Header Fields 1TCP Header Fields 1

Source and destination ports identify Source and destination ports identify connection end points.connection end points.

Sequence number.Sequence number. Acknowledgment number specifies next byte Acknowledgment number specifies next byte

expected.expected. TCP header length: how many 32-bit words TCP header length: how many 32-bit words

are contained in header.are contained in header. 6-bit unused field.6-bit unused field.

499

TCP Header Fields 2TCP Header Fields 2

6 1-bit flags:6 1-bit flags:– URG: indicate urgent data present; URG: indicate urgent data present; urgent urgent

pointerpointer gives byte offset from current sequence gives byte offset from current sequence number where urgent data is.number where urgent data is.

– ACK: indicates whether segment contains ACK: indicates whether segment contains acknowledgment; if 0, acknowledgment; if 0, acknowledgement acknowledgement numbernumber field ignored. field ignored.

– PUSH: indicates PUSHed data so receiver PUSH: indicates PUSHed data so receiver delivers it to application immediately.delivers it to application immediately.

500

TCP Header Fields 3TCP Header Fields 3

Flags (cont’d):Flags (cont’d):– RST: used to reset connection, reject invalid RST: used to reset connection, reject invalid

segment, or refuse to open connection.segment, or refuse to open connection.– SYN: used to establish connection; connection SYN: used to establish connection; connection

request, SYN=1, ACK=0.request, SYN=1, ACK=0.– FIN: used to release connection.FIN: used to release connection.

Window size: how many bytes can be sent Window size: how many bytes can be sent starting at starting at acknowledgment numberacknowledgment number..

501

TCP Header Fields 4TCP Header Fields 4

Checksum: checksums the Checksum: checksums the header+data+pseudo-header.header+data+pseudo-header.

Options: provide way to add extra Options: provide way to add extra information.information.– Examples: Examples:

» Maximum payload host is willing to accept; can be Maximum payload host is willing to accept; can be advertised during connection setup.advertised during connection setup.

» Window scale factor that allows sender and Window scale factor that allows sender and receiver to negotiate larger window sizes.receiver to negotiate larger window sizes.

502

TCP Connection SetupTCP Connection Setup

3-way handshake.3-way handshake.

Host 1 Host 2SYN (SEQ=x)

SYN(SEQ=y,ACK=x+1)

(SEQ=x+1, ACK=y+1)

503

TCP Connection Release 1 TCP Connection Release 1

Abrupt release:Abrupt release:– Send RESET.Send RESET.– May cause data loss.May cause data loss.

504

TCP Connection Release 2 TCP Connection Release 2

Graceful release:Graceful release:– Each side of the connection released Each side of the connection released

independently.independently.» Either side send TCP segment with FIN=1.Either side send TCP segment with FIN=1.» When FIN acknowledged, that direction is shut down for data.When FIN acknowledged, that direction is shut down for data.» Connection released when both sides shut down. Connection released when both sides shut down.

– 4 segments: 1 FIN and 1 ACK for each direction; 4 segments: 1 FIN and 1 ACK for each direction; 1st. ACK+2nd. FIN combined.1st. ACK+2nd. FIN combined.

505

TCP Connection Release 3 TCP Connection Release 3

Timers to avoid 2-army problem.Timers to avoid 2-army problem.– If response to FIN not received within 2*MSL, If response to FIN not received within 2*MSL,

FIN sender releases connection.FIN sender releases connection. After connection released, TCP waits for After connection released, TCP waits for

2*MSL (e.g., 120 sec) to ensure all old 2*MSL (e.g., 120 sec) to ensure all old segments have aged.segments have aged.

506

TCP Transmission 1 TCP Transmission 1

Sender process initiates connection.Sender process initiates connection. Once connection established, TCP can start Once connection established, TCP can start

sending data.sending data. Sender writes bytes to TCP stream.Sender writes bytes to TCP stream. TCP sender breaks byte stream into TCP sender breaks byte stream into

segments.segments.– Each byte assigned sequence number.Each byte assigned sequence number.– Segment sent and timer started. Segment sent and timer started.

507

TCP Transmission 2TCP Transmission 2

If timer expires, retransmit segment.If timer expires, retransmit segment.– After retransmitting segment for maximum After retransmitting segment for maximum

number of times, assumes connection is dead and number of times, assumes connection is dead and closes it.closes it.

If user aborts connection, sending TCP flushes If user aborts connection, sending TCP flushes its buffers and sends RESET segment.its buffers and sends RESET segment.

Receiving TCP decides when to pass received Receiving TCP decides when to pass received data to upper layer.data to upper layer.

508

TCP Flow ControlTCP Flow Control

Sliding window.Sliding window.– Receiver’s Receiver’s advertised windowadvertised window..

» Size of advertised window related to receiver’s Size of advertised window related to receiver’s buffer space.buffer space.

» Sender can send data up to receiver’s advertised Sender can send data up to receiver’s advertised window.window.

509

TCP Flow Control: ExampleTCP Flow Control: Example

2K;SEQ=0

ACK=2048; WIN=2048

2K; SEQ=2048

ACK=4096; WIN=0

ACK=4096; WIN=2048

1K; SEQ=4096

App. writes 2K of data

4K

2K

0

App. reads 2K of data

2K

1K

App. does 3K write

Senderblocked

Sendermay send upto 2K

510

TCP Flow Control: Observations TCP Flow Control: Observations

TCP sender not required to transmit data as TCP sender not required to transmit data as soon as it comes in form application.soon as it comes in form application.– Example: when first 2KB of data comes in, Example: when first 2KB of data comes in,

could wait for more data since window is 4KB.could wait for more data since window is 4KB. Receiver not required to send ACKs as Receiver not required to send ACKs as

soon as possible.soon as possible.– Wait for data so ACK is piggybacked.Wait for data so ACK is piggybacked.

511

Delayed ACKsDelayed ACKs Tries to optimize ACK transmission.Tries to optimize ACK transmission. Delay ACKs and window update (500msec) Delay ACKs and window update (500msec)

hoping to piggyback on data segment.hoping to piggyback on data segment. Example: telnet to interactive editor:Example: telnet to interactive editor:

– Send 1 character at a time: 20-byte TCP header+ 1-byte Send 1 character at a time: 20-byte TCP header+ 1-byte data+20-byte IP header.data+20-byte IP header.

– Receiver ACKs immediately: 40-byte ACK.Receiver ACKs immediately: 40-byte ACK.– When editor reads character, window update: 40-byte When editor reads character, window update: 40-byte

datagram.datagram.– Then echoes character back: 41-byte datagram.Then echoes character back: 41-byte datagram.

512

Nagle’s AlgorithmNagle’s Algorithm

Tries to optimize sending of small data Tries to optimize sending of small data chunks.chunks.

Example: telnet to interactive editor). Example: telnet to interactive editor). – Send first byte and buffer the rest until Send first byte and buffer the rest until

outstanding byte is ACKed; then send all buffered outstanding byte is ACKed; then send all buffered data in one segment; buffer until next ACK. data in one segment; buffer until next ACK.

Disabled in some cases (e.g., window Disabled in some cases (e.g., window application: mouse movements).application: mouse movements).

513

Silly Window SyndromeSilly Window Syndrome

Caused by receiver sending window updates of very Caused by receiver sending window updates of very small values.small values.– Example: Example:

» Receiver application reads 1 byte at a time and receiver TCP Receiver application reads 1 byte at a time and receiver TCP sends 1-byte window update.sends 1-byte window update.

» Sender TCP has large blocks to send but can only send 1 byte at a Sender TCP has large blocks to send but can only send 1 byte at a time.time.

Solution: [Clark] prevent receiver from generating Solution: [Clark] prevent receiver from generating small window advertisements; also, sender can wait.small window advertisements; also, sender can wait.

514

Congestion ControlCongestion Control

Why do it at the transport layer?Why do it at the transport layer?– Real fix to congestion is to slow down sender.Real fix to congestion is to slow down sender.

Use law of “conservation of packets”.Use law of “conservation of packets”.– Keep number of packets in the network Keep number of packets in the network

constant.constant.– Don’t inject new packet until old one leaves.Don’t inject new packet until old one leaves.

Congestion indicator: packet loss.Congestion indicator: packet loss.

515

TCP Congestion Control 1TCP Congestion Control 1

Like, flow control, also window based.Like, flow control, also window based.– Sender keeps Sender keeps congestion window (cwin)congestion window (cwin)..– Each sender keeps 2 windows: receiver’s Each sender keeps 2 windows: receiver’s

advertised window and congestion window.advertised window and congestion window.– Number of bytes that may be sent is Number of bytes that may be sent is

min(advertised window, cwin).min(advertised window, cwin).

516

TCP Congestion Control 2TCP Congestion Control 2

Slow start [Jacobson 1988]:Slow start [Jacobson 1988]:– Connection’s congestion window starts at 1 Connection’s congestion window starts at 1

segment.segment.– If segment ACKed before time out, If segment ACKed before time out,

cwin=cwin+1.cwin=cwin+1.– As ACKs come in, current cwin is increased by As ACKs come in, current cwin is increased by

1.1.– Exponential increase. Exponential increase.

517

TCP Congestion Control 3TCP Congestion Control 3

Congestion Avoidance:Congestion Avoidance:– Third parameter: Third parameter: thresholdthreshold..– Initially set to 64KB.Initially set to 64KB.– If timeout, threshold=cwin/2 and cwin=1.If timeout, threshold=cwin/2 and cwin=1.– Re-enters slow-start until cwin=threshold.Re-enters slow-start until cwin=threshold.– Then, cwin grows linearly until it reaches Then, cwin grows linearly until it reaches

receiver’s advertised window.receiver’s advertised window.

518

TCP Congestion Control: TCP Congestion Control: ExampleExample

519

TCP Retransmission TimerTCP Retransmission Timer

When segment sent, retransmission timer When segment sent, retransmission timer starts.starts.– If segment ACKed, timer stops.If segment ACKed, timer stops.– If time out, segment retransmitted and timer If time out, segment retransmitted and timer

starts again.starts again.

520

How to set timer?How to set timer?

Based on round-trip time: time between a Based on round-trip time: time between a segment is sent and ACK comes back.segment is sent and ACK comes back.

If timer is too short, unnecessary If timer is too short, unnecessary retransmissions.retransmissions.

If timer is too long, long retransmission If timer is too long, long retransmission delay.delay.

521

Jacobson’s Algorithm 1Jacobson’s Algorithm 1

Determining the round-trip time:Determining the round-trip time:– TCP keeps TCP keeps RTTRTT variable. variable. – When segment sent, TCP measures how long it When segment sent, TCP measures how long it

takes to get ACK back (takes to get ACK back (MM).).– RTT = alpha*RTT + (1-alpha)M.RTT = alpha*RTT + (1-alpha)M.– alpha: smoothing factor; determines weight alpha: smoothing factor; determines weight

given to previous estimate.given to previous estimate.– Typically, alpha=7/8.Typically, alpha=7/8.

522

Jacobson’s Algorithm 2Jacobson’s Algorithm 2

Determining timeout value:Determining timeout value:– Measure RTT variation, or |RTT-M|.Measure RTT variation, or |RTT-M|.– Keeps smoothed value of cumulative variation Keeps smoothed value of cumulative variation

D=alpha*D+(1-alpha)|RTT-M|.D=alpha*D+(1-alpha)|RTT-M|.– Alpha may or may not be the same as value Alpha may or may not be the same as value

used to smooth RTT.used to smooth RTT.– Timeout = RTT+4*D. Timeout = RTT+4*D.

523

Karn’s AlgorithmKarn’s Algorithm

How to compute ACKs for retransmitted How to compute ACKs for retransmitted segments? segments? – Count it for first or second transmission?Count it for first or second transmission?– Karn proposed not to update RTT on any Karn proposed not to update RTT on any

retransmitted segment.retransmitted segment.– Instead RTT is doubled on each failure until Instead RTT is doubled on each failure until

segments get through.segments get through.

524

Persistence TimerPersistence Timer

Prevents deadlock if an window update Prevents deadlock if an window update packet is lost and advertised window = 0.packet is lost and advertised window = 0.

When persistence timer goes off, sender When persistence timer goes off, sender probes receiver; receiver replies with its probes receiver; receiver replies with its current advertised window.current advertised window.

If 0, persistence timer is set again. If 0, persistence timer is set again.

525

Keepalive TimerKeepalive Timer

Goes off when a connection is idle for a Goes off when a connection is idle for a long time.long time.

Causes one side to check whether the other Causes one side to check whether the other side is still alive.side is still alive.

If no answer, connection terminated. If no answer, connection terminated.

526

TIME_WAITTIME_WAIT

2*MSL.2*MSL. Makes sure all segments die after Makes sure all segments die after

connection is closed.connection is closed.

527

Wireless TCP 1Wireless TCP 1

According to layered system design According to layered system design principles, transport protocol should be principles, transport protocol should be independent of underlying technology.independent of underlying technology.

However, wireless networks invalidate this However, wireless networks invalidate this principle.principle.– Ignoring properties of wireless medium can Ignoring properties of wireless medium can

lead to poor TCP performance.lead to poor TCP performance.– Problem: TCP’s congestion control.Problem: TCP’s congestion control.

528

Wireless TCP 2Wireless TCP 2

Problem: packet loss as congestion Problem: packet loss as congestion indicator.indicator.– When retransmission timer times out, sender When retransmission timer times out, sender

slows down.slows down. Wireless links are lossy!Wireless links are lossy!

– Dealing with losses in this case should be re-Dealing with losses in this case should be re-sending lost segments asap.sending lost segments asap.

529

Indirect TCP (I-TCP)Indirect TCP (I-TCP)

[Bakne and Badrinath, 1995].[Bakne and Badrinath, 1995]. Split TCP connection in 2: one from sender to base Split TCP connection in 2: one from sender to base

station and the other from base station to receiver.station and the other from base station to receiver.– Base station serves as “repeater”: copies segments Base station serves as “repeater”: copies segments

between connections in both directions.between connections in both directions.– Connections are homogeneous; timeouts on 1st. Connections are homogeneous; timeouts on 1st.

connection, slow down sender.connection, slow down sender.– Problem: violates TCP’s e2e’ness.Problem: violates TCP’s e2e’ness.

Example: ACKs to sender mean base station received segments, not Example: ACKs to sender mean base station received segments, not necessarily receiver. necessarily receiver.

530

Snoop TCPSnoop TCP

[Balakrishnan et al., 1995].[Balakrishnan et al., 1995]. Does not break connection. Does not break connection. Modifications to base station’s network layer code.Modifications to base station’s network layer code.

– Snooping agent on base station observes and caches TCP Snooping agent on base station observes and caches TCP segments sent to mobile host and ACKs coming back.segments sent to mobile host and ACKs coming back.

– If it doesn’t see an ACK for a segment or sees duplicate If it doesn’t see an ACK for a segment or sees duplicate ACKs, it times out and retransmits.ACKs, it times out and retransmits.

– But source may time out anyway.But source may time out anyway.

531

End-To-End ArgumentEnd-To-End Argument

Design principle to help guide placement of Design principle to help guide placement of functionality in distributed systems.functionality in distributed systems.

Rationale for moving functions upward Rationale for moving functions upward closer to application.closer to application.

532

Where to place distributed Where to place distributed systems functions?systems functions?

Layered system design:Layered system design:– Different levels of abstraction for simplicity.Different levels of abstraction for simplicity.– Lower layer provides service to upper layer.Lower layer provides service to upper layer.– Very well defined interfaces.Very well defined interfaces.

Some functions can be implemented at Some functions can be implemented at different layers or even at multiple layers.different layers or even at multiple layers.

533

E2E Argument StatementE2E Argument Statement

““The function in question can completely and The function in question can completely and correctly be implemented only with the correctly be implemented only with the knowledge and help of the application at knowledge and help of the application at the endpoints. Therefore providing that the endpoints. Therefore providing that function in the communication system itself function in the communication system itself is not possible. Sometimes an incomplete is not possible. Sometimes an incomplete version of the function provided by the version of the function provided by the communication system may be useful as communication system may be useful as performance enhancementperformance enhancement.”.”

534

Functions Closer to ApplicationFunctions Closer to Application

E2E argument paper argues that functions should be E2E argument paper argues that functions should be moved closer to the application that uses them.moved closer to the application that uses them.

Rationale:Rationale:– Some functions can only be completely and correctly Some functions can only be completely and correctly

implemented with app’s knowledge.implemented with app’s knowledge.» Example: file transfer.Example: file transfer.

» If error occurs in the network, network reliability can fix it.If error occurs in the network, network reliability can fix it.

» Otherwise, only application can.Otherwise, only application can.

535

Another perspective: CostAnother perspective: Cost

Why pay for something you don’t need.Why pay for something you don’t need.» Example 1: the Internet.Example 1: the Internet.

» Example 2: trend in kernel design - take away from Example 2: trend in kernel design - take away from kernel as much functionality as possible.kernel as much functionality as possible.

Applications that don’t need certain Applications that don’t need certain functions should not have to pay for them. functions should not have to pay for them.

536

E2E Counter ArgumentE2E Counter Argument

Performance!Performance!– Example: File transferExample: File transfer

» Reliability checks at lower layers detect problems Reliability checks at lower layers detect problems earlier.earlier.

» Abort transfer and re-try without having to wait till Abort transfer and re-try without having to wait till whole file is transmitted.whole file is transmitted.

““Spread out” functionality across layers.Spread out” functionality across layers.

537

Domain Name System (DNS)Domain Name System (DNS)

Basic function: translation of names (ASCII Basic function: translation of names (ASCII strings) to network (IP) addresses and vice-strings) to network (IP) addresses and vice-versa.versa.

Example: Example: – zephyr.isi.edu <-> 128.9.160.160zephyr.isi.edu <-> 128.9.160.160

538

HistoryHistory

Original approach (ARPANET, 1970’s):Original approach (ARPANET, 1970’s):– File File hosts.txt hosts.txt listed all hosts and their IP addresses.listed all hosts and their IP addresses.– Every night every host fetches file from central Every night every host fetches file from central

repository.repository.– OK for a few hundred hosts.OK for a few hundred hosts.– Scalability?Scalability?

» File size.File size.

» Centrally managed.Centrally managed.

539

DNSDNS

Hierarchical name space.Hierarchical name space. Distributed database.Distributed database. RFCs 1034 and 1035.RFCs 1034 and 1035.

540

How is it used?How is it used?

Client-server model.Client-server model.– Client DNS (running on client hosts), or Client DNS (running on client hosts), or

resolver.resolver.– Application calls resolver with name.Application calls resolver with name.– Resolver contacts local DNS server (using Resolver contacts local DNS server (using

UDP) passing the name.UDP) passing the name.– Server returns corresponding IP address.Server returns corresponding IP address.

541

DNS Name SpaceDNS Name Space

Tree-based hierarchy.Tree-based hierarchy.

int com edu gov mil org net us ca …

usc

cs ee

ibm

eng sales

542

Name Space StructureName Space Structure

Top-level domains:Top-level domains:– Generic.Generic.– Countries.Countries.

Leaf domains: no sub-domains.Leaf domains: no sub-domains. In practice all US organizations are under a In practice all US organizations are under a

generic domain, while everything outside generic domain, while everything outside the US is under the corresponding country the US is under the corresponding country domain.domain.

543

DNS NamesDNS Names

Domain names:Domain names:– Concatenation of all domain names starting from Concatenation of all domain names starting from

its own all the way to the root separated by “.”.its own all the way to the root separated by “.”.– Refers to a tree node and all names under it.Refers to a tree node and all names under it.– Case insensitive.Case insensitive.– Components up to 63 characters.Components up to 63 characters.– Full name less than 255 characters.Full name less than 255 characters.

544

Name Space ManagementName Space Management

Domains are autonomous.Domains are autonomous.– Organizational boundaries.Organizational boundaries.– Each domain manages its own name space Each domain manages its own name space

independently of other domains.independently of other domains. Delegation:Delegation:

– When creating new domain: register with parent When creating new domain: register with parent domain.domain.

» For name uniqueness.For name uniqueness.

» For name resolution.For name resolution.

545

Resource RecordsResource Records

Entry in the DNS database.Entry in the DNS database. Several types of entries or RRs.Several types of entries or RRs. Example: RR “A” contains IP address.Example: RR “A” contains IP address. Name <-> several resource records.Name <-> several resource records. RR format: five-tuple.RR format: five-tuple.

– Name.Name.– TTL (in seconds).TTL (in seconds).– Class (usually “IN” for Internet info).Class (usually “IN” for Internet info).– Type: type of RR.Type: type of RR.– Value.Value.

546

RR Types 1RR Types 1

SOA: start of authority.SOA: start of authority.– Marks beginning of zone’s database.Marks beginning of zone’s database.– Provides general info about the zone: e-mail Provides general info about the zone: e-mail

address of admin, default TTL, etc.address of admin, default TTL, etc. A: address.A: address.

– Contains 32-bit IP address.Contains 32-bit IP address.– Single name <-> several A RRs.Single name <-> several A RRs.

MX: mail exchange.MX: mail exchange.– Name of mail server for this domain.Name of mail server for this domain.

547

RR Types 2RR Types 2

NS: name server.NS: name server.– Name of name server for this domain.Name of name server for this domain.

CNAME: canonical name.CNAME: canonical name.– Alias.Alias.

HINFO: host description.HINFO: host description.– Provides information about host, e.g., CPU type, OS, Provides information about host, e.g., CPU type, OS,

etc.etc. TXT: arbitrary string of characters.TXT: arbitrary string of characters.

– Generic description of the domain, where it is located, Generic description of the domain, where it is located, etc.etc.

548

Name ServersName Servers

Entire database in a single name server.Entire database in a single name server.– Practical?Practical?– Why?Why?

DNS database is partitioned into DNS database is partitioned into zoneszones.. Each zone contains part of the DNS tree.Each zone contains part of the DNS tree. Zone <-> name server.Zone <-> name server.

– Each zone may be served by more than 1 server.Each zone may be served by more than 1 server.– A server may serve multiple zones.A server may serve multiple zones.

Primary and secondary name servers.Primary and secondary name servers.

549

Name Resolution 1Name Resolution 1

Application wants to resolve name.Application wants to resolve name. Resolver sends query to local name server.Resolver sends query to local name server.

– Resolver configured with list of local name servers.Resolver configured with list of local name servers.

– Select servers in round-robin fashion.Select servers in round-robin fashion.

If name is local, local name server returns matching If name is local, local name server returns matching authoritativeauthoritative RRs. RRs.– AuthoritativeAuthoritative RR comes from authority managing the RR RR comes from authority managing the RR

and is always correct.and is always correct.

– CachedCached RRs may be out of date. RRs may be out of date.

550

Name Resolution 2Name Resolution 2

If information not available locally (not If information not available locally (not even cached), local NS will have to ask even cached), local NS will have to ask someone else.someone else.– It asks the server of the top-level domain of the It asks the server of the top-level domain of the

name requested.name requested.

551

Recursive ResolutionRecursive Resolution

Recursive query:Recursive query:– Each server that doesn’t have info forwards it to Each server that doesn’t have info forwards it to

someone else.someone else.– Response finds its way back.Response finds its way back.

Alternative:Alternative:– Name server not able to resolve query, sends back Name server not able to resolve query, sends back

the name of the next server to try.the name of the next server to try.– Some servers use this method.Some servers use this method.– More control for clients.More control for clients.

552

ExampleExample

Suppose resolver on flits.cs.vu.nl wants to resolve Suppose resolver on flits.cs.vu.nl wants to resolve linda.cs.yale.edu.linda.cs.yale.edu.– Local NS, cs.vu.nl, gets queried but cannot resolve it.Local NS, cs.vu.nl, gets queried but cannot resolve it.– It then contacts .edu server.It then contacts .edu server.– .edu server forwards query to yale.edu server..edu server forwards query to yale.edu server.– yale.edu contacts cs.yale.edu, which has the authoritative yale.edu contacts cs.yale.edu, which has the authoritative

RR.RR.– Response finds its way back to originator.Response finds its way back to originator.– cs.vu.nl caches this info.cs.vu.nl caches this info.

» Not authoritative (since may be out-of-date).Not authoritative (since may be out-of-date).» RR TTL determines how long RR should be cached.RR TTL determines how long RR should be cached.

553

Review 1Review 1

Network-layer congestion control.Network-layer congestion control.– What is it?What is it?

– CC versus FC.CC versus FC.

– Taxonomy: closed versus open loop.Taxonomy: closed versus open loop.

– Open loop:Open loop:» Token and leaky bucket.Token and leaky bucket.

– Closed loop:Closed loop:» Choke packets.Choke packets.

» Fair and weighted fair queuing.Fair and weighted fair queuing.

» Load shedding.Load shedding.

554

Review 2Review 2

Internetworking.Internetworking.– Gateways.Gateways.– Connectionless versus connection-oriented.Connectionless versus connection-oriented.– Tunneling.Tunneling.– Fragmentation.Fragmentation.

» Transparent.Transparent.

» Non-transparent.Non-transparent.

555

Review 3Review 3

IP.IP.– IP header.IP header.– Addressing.Addressing.– Address formats.Address formats.– Subnetting.Subnetting.

Companion protocols.Companion protocols.– ICMP, ARP, RARP, BOOTP.ICMP, ARP, RARP, BOOTP.

556

Review 4Review 4

Internet Routing.Internet Routing.– IGPs versus EGPs.IGPs versus EGPs.– RIP, OSPF, BGP.RIP, OSPF, BGP.– Internet multicast.Internet multicast.– Mobile IP.Mobile IP.

CIDR.CIDR. IPv6.IPv6.

557

Review 5Review 5

ATM network layer.ATM network layer. Transport layer.Transport layer.

– Types of transport services.Types of transport services.– Transport service primitives.Transport service primitives.– Berkeley sockets.Berkeley sockets.– TPDUs.TPDUs.– Connection management.Connection management.

» Setting up and releasing.Setting up and releasing.» Avoiding duplicates.Avoiding duplicates.» 3-way handshake.3-way handshake.» 2-army problem.2-army problem.

558

Review 6Review 6

UDP.UDP.– Type of service.Type of service.– Header.Header.

TCP.TCP.– Type of service.Type of service.– Header.Header.– Connection setup and release.Connection setup and release.– Flow control.Flow control.

559

Review 7Review 7

TCP (cont’d).TCP (cont’d).– Delayed ACKs.Delayed ACKs.– Nagle’s algorithm.Nagle’s algorithm.– Silly window syndrome.Silly window syndrome.– Congestion control.Congestion control.

Wireless TCP.Wireless TCP. E2E argument.E2E argument. The Web and HTTP.The Web and HTTP.

560

Review 8Review 8

Network security.Network security. Reliable multicast.Reliable multicast. DNS.DNS.


Top Related