Data Communication Essentials Excerpted from Joe Conron’s data communications course A Communications Model • Source – generates data to be transmitted • Transmitter – Converts data into.

Download Report

Transcript Data Communication Essentials Excerpted from Joe Conron’s data communications course A Communications Model • Source – generates data to be transmitted • Transmitter – Converts data into.

Data Communication
Essentials
Excerpted from Joe Conron’s data
communications course
A Communications Model
• Source
– generates data to be transmitted
• Transmitter
– Converts data into transmittable signals
• Transmission System
– Carries data
• Receiver
– Converts received signal into data
• Destination
– Takes incoming data
Simplified Communications Model Diagram
Key Communications Tasks
•
•
•
•
•
•
•
•
•
•
Transmission System Utilization
Interfacing
Signal Generation
Synchronization
Error detection and correction
Addressing and routing
Recovery
Message formatting
Security
Network Management
Networking
• Point to point communication not usually
practical
– Devices are too far apart
– Large set of devices would need impractical
number of connections
• Solution is a communications network
Simplified Network Model
The Network Core
• mesh of interconnected
routers
• the fundamental
question: how is data
transferred through net?
– circuit switching:
dedicated circuit per call:
telephone net
– packet-switching: data
sent thru net in discrete
“chunks”
Network Core: Circuit Switching
End-end resources
reserved for “call”
• link bandwidth, switch
capacity
• dedicated resources: no
sharing
• circuit-like (guaranteed)
performance
• call setup required
Circuit Switching: FDM and TDM
Example:
FDM
4 users
frequency
time
TDM
frequency
time
Network Core: Packet Switching
each end-end data stream resource contention:
divided into packets
• aggregate resource
• user A, B packets share
network resources
• each packet uses full link
bandwidth
• resources used as needed
demand can exceed
amount available
• congestion: packets
queue, wait for link use
• store and forward:
packets move one hop
at a time
– Node receives complete
packet before forwarding
Packet Switching: Statistical Multiplexing
10 Mb/s
Ethernet
A
B
statistical multiplexing
C
1.5 Mb/s
queue of packets
waiting for output
link
D
E
Sequence of A & B packets does not have fixed
pattern  statistical multiplexing.
In TDM each host gets same slot in revolving TDM
frame.
Packet switching versus circuit
switching
Is packet switching a “slam dunk winner?”
• Great for bursty data
– resource sharing
– simpler, no call setup
• Excessive congestion: packet delay and loss
– protocols needed for reliable data transfer,
congestion control
• Q: How to provide circuit-like behavior?
– bandwidth guarantees needed for audio/video apps
– still an unsolved problem (chapter 6)
Local Area Networks
• Smaller scope
– Building or small campus
• Usually owned by same organization as
attached devices
• Data rates much higher
• Usually broadcast systems
Protocols
• Used for communications between entities in a
system
• Must speak the same language
• Entities
– User applications
– e-mail facilities
– terminals
• Systems
– Computer
– Terminal
– Remote sensor
Key Elements of a Protocol
• Syntax
– Data formats
– Signal levels
• Semantics
– Control information
– Error handling
• Timing
– Speed matching
– Sequencing
What’s a protocol?
human protocols:
network protocols:
• “what’s the time?”
• “I have a question”
• introductions
• machines rather than
humans
• all communication activity in
Internet governed by
protocols
… specific msgs sent
… specific actions taken
when msgs received, or
other events
protocols define format, order of
msgs sent and received among
network entities, and actions
taken on msg transmission,
receipt
What’s a protocol?
a human protocol and a computer network protocol:
Hi
TCP connection
req.
Hi
TCP connection
reply.
Got the
time?
2:00
Get http://gaia.cs.umass.edu/index.htm
time
<file>
In Summary, a protocol is ....
• An agreement about communication between
two or more entities
• It specifies
– Format of messages
– Meaning of messages
– Rules for exchange
– Procedures for handling problems
Protocol Specification
• As designers, we can specify a protocol using
– Event-Time Diagrams
– Transition Diagrams
• We can implement a protocol with a Finite State
Machine (FSM)
• Internet Protocols are formalized by RFCs which
are administered by IETF
• You can find any RFC here
Event -Time Diagrams
• Define causal ordering
• Define indication/request/response actions
06/11/2015
20
Transition Diagram
• Illustrates
– States
– Input (the Event that causes transition)
– Transitions (to new states)
Protocol “Layers”
Networks are
complex!
• many “pieces”:
– hosts
– routers
– links of various
media
– applications
– protocols
– hardware, software
Question:
Is there any hope of
organizing structure
of network?
Or at least our
discussion of
networks?
Why layering?
Dealing with complex systems:
• explicit structure allows identification,
relationship of complex system’s pieces
– layered reference model for discussion
• modularization eases maintenance, updating
of system
– change of implementation of layer’s service
transparent to rest of system
– e.g., change in gate procedure doesn’t affect rest
of system
• Can layering sometimes be undesirable?
Internet protocol stack
• application: supporting network
applications
– FTP, SMTP, HTTP
• transport: process-process data
transfer
– TCP, UDP
• network: routing of datagrams from
source to destination
application
transport
network
link
– IP, routing protocols
• link: data transfer between
neighboring network elements
– PPP, Ethernet
• physical: bits “on the wire”
physical
source
message
segment
M
Ht
M
datagram Hn Ht
M
frame Hl Hn Ht
M
Encapsulation
application
transport
network
link
physical
link
physical
switch
destination
M
Ht
M
Hn Ht
Hl Hn Ht
M
M
application
transport
network
link
physical
Hn Ht
Hl Hn Ht
M
M
network
link
physical
Hn Ht
M
router
OSI
• Open Systems Interconnection
• Developed by the International
Organization for Standardization (ISO)
• Seven layers
• A theoretical system delivered too late!
• TCP/IP is the de facto standard
How do loss and delay occur?
packets queue in router buffers
• packet arrival rate to link exceeds output link capacity
• packets queue, wait for turn
packet being transmitted (delay)
A
B
packets queueing (delay)
free (available) buffers: arriving packets
dropped (loss) if no free buffers
Four sources of packet delay
• 1. nodal processing:
• 2. queueing
– check bit errors
– determine output link
– time waiting at output link
for transmission
– depends on congestion
level of router
transmission
A
propagation
B
nodal
processing
queueing
Delay in packet-switched
networks
3. Transmission delay:
4. Propagation delay:
• R=link bandwidth (bps)
• L=packet length (bits)
• time to send bits into
link = L/R
• d = length of physical link
• s = propagation speed in
medium (~2x108 m/sec)
• propagation delay = d/s
transmission
A
Note: s and R are very
different quantities!
propagation
B
nodal
processing
queueing
Data Communication and
Networks
Lecture 2
Data Transmission and
Encoding Concepts
September 14, 2006
Simplified Data
Communications Model
S(t) = A sin(2ft + Φ)
Terminology (1)
• Transmitter
• Receiver
• Medium
– Guided medium
• e.g. twisted pair, optical fiber
– Unguided medium
• e.g. air, water, vacuum
Terminology (2)
• Direct link
– No intermediate devices
• Point-to-point
– Direct link
– Only 2 devices share link
• Multi-point
– More than two devices share the link
Terminology (3)
• Simplex
– One direction
• e.g. Television
• Half duplex
– Either direction, but only one way at a time
• e.g. police radio
• Full duplex
– Both directions at the same time
• e.g. telephone
Analog and Digital Data
Transmission
• Data
– Entities that convey meaning
• Signals
– Electric or electromagnetic representations of
data
• Transmission
– Communication of data by propagation and
processing of signals
Data
• Analog
– Continuous values within some interval
– e.g. sound, video
• Digital
– Discrete values
– e.g. text, integers
Signals
• Means by which data are propagated
• Analog
– Continuously variable
– Various media
• wire, fiber optic, space
– Speech bandwidth 100Hz to 7kHz
– Telephone bandwidth 300Hz to 3400Hz
– Video bandwidth 4MHz
• Digital
– Use two DC components
Data and Signals
• Usually use digital signals for digital data
and analog signals for analog data
• Can use analog signal to carry digital data
– Modem
• Can use digital signal to carry analog data
– Compact Disc audio
Analog Transmission
• Analog signal transmitted without regard to
content
• May be analog or digital data
• Attenuated over distance
• Use amplifiers to boost signal
• Also amplifies noise
Digital Transmission
• Concerned with content
• Integrity endangered by noise, attenuation
etc.
• Repeaters used
• Repeater receives signal
• Extracts bit pattern
• Retransmits
• Attenuation is overcome
• Noise is not amplified
Advantages & Disadvantages
of Digital
• Cheaper
• Less susceptible to noise
• Greater attenuation
– Pulses become rounded and smaller
– Leads to loss of information
Attenuation of Digital Signals
Interpreting Signals
• Need to know
– Timing of bits - when they start and end
– Signal levels
• Factors affecting successful interpreting of
signals
– Signal to noise ratio
– Data rate
– Bandwidth
Encoding Schemes
•
•
•
•
•
•
•
•
Nonreturn to Zero-Level (NRZ-L)
Nonreturn to Zero Inverted (NRZI)
Bipolar -AMI
Pseudoternary
Manchester
Differential Manchester
B8ZS
HDB3
Nonreturn to Zero-Level (NRZL)
• Two different voltages for 0 and 1 bits
• Voltage constant during bit interval
– no transition I.e. no return to zero voltage
• e.g. Absence of voltage for zero, constant
positive voltage for one
• More often, negative voltage for one value
and positive for the other
• This is NRZ-L
Nonreturn to Zero Inverted
• Nonreturn to zero inverted on ones
• Constant voltage pulse for duration of bit
• Data encoded as presence or absence of
signal transition at beginning of bit time
• Transition (low to high or high to low)
denotes a binary 1
• No transition denotes binary 0
• An example of differential encoding
NRZ
Differential Encoding
• Data represented by changes rather than
levels
• More reliable detection of transition rather
than level
• However: in complex transmission layouts
it is easy to lose sense of polarity
Biphase
• Manchester
–
–
–
–
–
Transition in middle of each bit period
Transition serves as clock and data
Low to high represents one
High to low represents zero
Used by IEEE 802.3
• Differential Manchester
–
–
–
–
Midbit transition is clocking only
Transition at start of a bit period represents zero
No transition at start of a bit period represents one
Note: this is a differential encoding scheme
Biphase Pros and Cons
• Con
– At least one transition per bit time and
possibly two
– Maximum modulation rate is twice NRZ
– Requires more bandwidth
• Pros
– Synchronization on mid bit transition (self
clocking)
Asynchronous
• Data transmitted one character at a time
– 5 to 8 bits
• Timing only needs maintaining within each
character
• Resync with each character
Asynchronous (diagram)
Asynchronous - Behavior
• In a steady stream, interval between
characters is uniform (length of stop
element)
• In idle state, receiver looks for transition 1
to 0
• Then samples next seven intervals (char
length)
• Then looks for next 1 to 0 for next char
• Overhead of 2 or 3 bits per char (~20%)
• Good for data with large gaps (keyboard)
Synchronous - Bit Level
• Block of data transmitted without start or
stop bits
• Clocks must be synchronized
• Can use separate clock line
– Good over short distances
– Subject to impairments
• Embed clock signal in data
– Manchester encoding
– Carrier frequency (analog)
Synchronous - Block Level
• Need to indicate start and end of block
• Use preamble and postamble
– e.g. series of SYN (hex 16) characters
– e.g. block of 11111111 patterns ending in
11111110
• More efficient (lower overhead) than async
Synchronous (diagram)
Synchronous Bit Error Detection
• Which kinds of errors can we handle if we
have synchronous bit transfer?
• Reference to bit transmission protocol in
distcomp.ppt
Data Link Layer
Excerpted from Joe Conron’s
notes
Link Layer Services
• Framing, link access:
– encapsulate datagram into frame, adding header,
trailer
– channel access if shared medium
– “MAC” addresses used in frame headers to
identify source, dest
• different from IP address!
Encoding Information Frames
Typical Fields in a Frame
Start Destination Source
Frame
Address Address
Delimiter
Frame
Control
Data
Check
sum
Error Detection
• Additional bits added by transmitter for
error detection code
• Parity
– Value of parity bit is such that character
has even (even parity) or odd (odd parity)
number of ones
– Even number of bit errors goes undetected
– Checksum can be a simple XOR operation
of bits to be checked
Parity Checking
Single Bit Parity:
Detect single bit errors
Two Dimensional Bit Parity:
Detect and correct single bit errors
0
0
Internet checksum
Goal: detect “errors” (e.g., flipped bits) in
transmitted segment (note: used at transport
layer only)
Receiver:
Sender:
• treat segment contents
as sequence of 16-bit
integers
• checksum: addition (1’s
complement sum) of
segment contents
• sender puts checksum
value into UDP
checksum field
• compute checksum of received
segment
• check if computed checksum
equals checksum field value:
– NO - error detected
– YES - no error detected.
But maybe errors
nonetheless? More later ….
Multiple Access protocols
• single shared broadcast channel
• two or more simultaneous transmissions by
nodes: interference
– collision if node receives two or more signals at
the same time
multiple access protocol
• distributed algorithm that determines how
nodes share channel, i.e., determine when
node can transmit
• communication about channel sharing must
use channel itself!
Ideal Multiple Access Protocol
Broadcast channel of rate R bps
1. When one node wants to transmit, it can send at
rate R.
2. When M nodes want to transmit, each can send
at average rate R/M
3. Fully decentralized:
– no special node to coordinate transmissions
– no synchronization of clocks, slots
4. Simple
MAC Protocols: a taxonomy
Three broad classes:
• Channel Partitioning
– divide channel into smaller “pieces” (time slots,
frequency, code)
– allocate piece to node for exclusive use
• Random Access
– channel not divided, allow collisions
– “recover” from collisions
• “Taking turns”
– Nodes take turns, but nodes with more to send
can take longer turns
Channel Partitioning MAC protocols:
TDMA
TDMA: time division multiple access
• access to channel in "rounds"
• each station gets fixed length slot (length =
pkt trans time) in each round
• unused slots go idle
• example: 6-station LAN, 1,3,4 have pkt, slots
2,5,6 idle
Channel Partitioning MAC protocols:
FDMA
FDMA: frequency division multiple access
frequency bands
• channel spectrum divided into frequency bands
• each station assigned fixed frequency band
• unused transmission time in frequency bands go
idle
• example: 6-station LAN, 1,3,4 have pkt,
frequency bands 2,5,6 idle
Random Access Protocols
• When node has packet to send
– transmit at full channel data rate R.
– no a priori coordination among nodes
• two or more transmitting nodes ➜ “collision”,
• random access MAC protocol specifies:
– how to detect collisions
– how to recover from collisions (e.g., via delayed
retransmissions)
• Examples of random access MAC protocols:
– slotted ALOHA
– ALOHA
CSMA (Carrier Sense Multiple
Access)
CSMA: listen before transmit:
If channel sensed idle: transmit entire frame
• If channel sensed busy, defer transmission
• Human analogy: don’t interrupt others!
CSMA collisions
spatial layout of nodes
collisions can still occur:
propagation delay means
two nodes may not hear
each other’s transmission
collision:
entire packet transmission
time wasted
note:
role of distance & propagation
delay in determining collision
probability
CSMA/CD (Collision Detection)
CSMA/CD: carrier sensing, deferral as in
CSMA
– collisions detected within short time
– colliding transmissions aborted, reducing
channel wastage
• collision detection:
– easy in wired LANs: measure signal strengths,
compare transmitted, received signals
– difficult in wireless LANs: receiver shut off
while transmitting
CSMA/CD collision detection
Ethernet uses CSMA/CD
• No slots
• adapter doesn’t transmit
if it senses that some
other adapter is
transmitting, that is,
carrier sense
• transmitting adapter
aborts when it senses
that another adapter is
transmitting, that is,
collision detection
• Before attempting a
retransmission,
adapter waits a
random time, that is,
random access
Ethernet CSMA/CD algorithm
1. Adaptor receives
4. If adapter detects
datagram from net layer
another transmission
& creates frame
while transmitting,
aborts and sends jam
2. If adapter senses
signal
channel idle, it starts to
transmit frame. If it
5. After aborting, adapter
senses channel busy,
enters exponential
waits until channel idle
backoff: after the mth
and then transmits
collision, adapter
chooses a K at random
3. If adapter transmits
from
entire frame without
{0,1,2,…,2m-1}. Adapter
detecting another
Ethernet’s CSMA/CD (more)
Jam Signal: make sure all Exponential Backoff:
other transmitters are
• Goal: adapt
aware of collision; 48
retransmission attempts
bits
to estimated current
Bit time: .1 microsec for 10
load
Mbps Ethernet ;
– heavy load: random wait
will be longer
for K=1023, wait time is
about 50 msec
• first collision: choose K
from {0,1}; delay is K·
See/interact with Java
applet on AWL Web site:
512 bit transmission
highly recommended !
times
• after second collision:
choose K from
{0,1,2,3}…
CSMA/CD efficiency
(probabilistic)
• Tprop = max prop between 2 nodes in LAN
• ttrans = time to transmit max-size frame
efficiency
1
1  5t prop / ttrans
• Efficiency goes to 1 as tprop goes to 0
• Goes to 1 as ttrans goes to infinity
References to Performance
• Simon Lam; "A Carrier Sense Multiple
Access Protocol for Local Networks",
Computer Networks, Vol 4, pp 21-32,
1980.
• D. Bertsekas and R. Gallagher, Data
Networks, 2nd Ed., Prentice Hall, 1991
• Possible paper project: show an elegant
derivation and compare to performance of
Lelann algorithm.
“Taking Turns” MAC protocols
channel partitioning MAC protocols:
– share channel efficiently and fairly at high load
– inefficient at low load: delay in channel
access, 1/N bandwidth allocated even if only
1 active node!
Random access MAC protocols
– efficient at low load: single node can fully
utilize channel
– high load: collision overhead
“taking turns” protocols
look for best of both worlds!
“Taking Turns” MAC protocols
Polling:
• master node
“invites” slave
nodes to transmit
in turn
• concerns:
– polling overhead
– latency
– single point of
failure (master)
Token passing:
• control token passed
from one node to next
sequentially.
• token message
• concerns:
– token overhead
– latency
– single point of failure
(token)
Summary of MAC protocols
• What do you do with a shared media?
– Channel Partitioning, by time, frequency or
code
• Time Division, Frequency Division
– Achieving real time guarantees distnotes.pdf
Wireless Networks
Chapter 6: Wireless and Mobile Networks
Background:
• # wireless (mobile) phone subscribers now
exceeds # wired phone subscribers!
• computer nets: laptops, palmtops, PDAs,
Internet-enabled phone promise anytime
untethered Internet access
• two important (but different) challenges
– communication over wireless link
– handling mobile user who changes point of
attachment to network
Elements of a wireless network
network
infrastructure
base station
• typically connected
to wired network
• relay - responsible
for sending
packets between
wired network and
wireless host(s) in
its “area”
– e.g., cell towers
802.11 access
points
Elements of a wireless network
network
infrastructure
wireless link
• typically used to
connect mobile(s)
to base station
• also used as
backbone link
• multiple access
protocol
coordinates link
access
• various data rates,
transmission
distance
Characteristics of selected wireless link
standards
54 Mbps
5-11 Mbps
802.11{a,g}
802.11b
.11 p-to-p link
1 Mbps
802.15
3G
UMTS/WCDMA, CDMA2000
384 Kbps
2G
IS-95 CDMA, GSM
56 Kbps
Indoor
Outdoor
Mid range
outdoor
Long range
outdoor
10 – 30m
50 – 200m
200m – 4Km
5Km – 20Km
Elements of a wireless network
network
infrastructure
infrastructure mode
• base station
connects mobiles
into wired network
• handoff: mobile
changes base
station providing
connection into
wired network
Elements of a wireless network
Ad hoc mode
• no base stations
• nodes can only
transmit to other
nodes within link
coverage
• nodes organize
themselves into a
network: route
among themselves
IEEE 802.11 MAC Protocol: CSMA/CA
802.11 sender
1 if sense channel idle for DIFS then
sender
transmit entire frame (no CD)
DIFS
2 if sense channel busy then
start random backoff time
timer counts down while channel idle
transmit when timer expires
if no ACK, increase random backoff
interval, repeat 2
802.11 receiver
- if frame received OK
return ACK after SIFS (ACK needed
receiver
data
SIFS
ACK
Avoiding collisions (more)
idea: allow sender to “reserve” channel rather than
random access of data frames: avoid collisions of
long data frames
• sender first transmits small request-to-send (RTS)
packets to BS using CSMA
– RTSs may still collide with each other (but they’re
short)
• BS broadcasts clear-to-send CTS in response to RTS
• RTS heard by all nodes
Avoid data frame collisions completely
– sender transmits data frame
using small reservation packets!
– other stations defer transmissions
Collision Avoidance: RTS-CTS
exchange
A
AP
B
reservation collision
DATA (A)
time
defer
How do you contact a mobile friend:
Consider friend frequently
changing addresses, how do
• you
search
phone
findall
her?
books?
• call her parents?
• expect her to let you
know where he/she
is?
I wonder where
Alice moved to?
Basic idea:
SIM card vs. phone number
• When Alice turns on
her phone, she
registers her SIM card
to local operator who
records location.
• On Bob’s call, Bob’s
operator maps phone
number to SIM.
• Second mapping from
SIM to location.
I know her phone
number
Long Distance Mobility: approach
• Let routing handle it: routers advertise
permanent address of mobile-nodes-inresidence via routing table exchange.
– routing tables indicate where each mobile
located
– no changes to end-systems
• Let end-systems handle it:
– indirect routing: communication from
correspondent to mobile goes through home
agent, then forwarded to remote
– direct routing: correspondent gets foreign
address of mobile, sends directly to mobile
Mobility: registration
visited network
home network
2
1
wide area
network
foreign agent contacts home
agent home: “this mobile is
resident in my network”
mobile contacts
foreign agent on
entering visited
network
End result:
• Foreign agent knows about mobile
• Home agent knows location of mobile
Mobility via Indirect Routing
foreign agent
receives packets,
forwards to mobile
home agent intercepts
packets, forwards to
foreign agent
home
network
visited
network
3
wide area
network
correspondent
addresses packets
using home address
of mobile
1
2
4
mobile replies
directly to
correspondent
Indirect Routing: moving between
networks
• suppose mobile user moves to another
network
– registers with new foreign agent
– new foreign agent registers with home agent
– home agent update care-of-address for
mobile
– packets continue to be forwarded to mobile
(but with new care-of-address)
• mobility, changing foreign networks
transparent: ongoing connections can be
maintained!
Reliable Transmission
rdt3.0: stop-and-wait operation
sender
receiver
first packet bit transmitted, t = 0
last packet bit transmitted, t = L / R
first packet bit arrives
last packet bit arrives, send ACK
RTT
ACK arrives, send next
packet, t = RTT + L / R
U
sender
=
L/R
RTT + L / R
=
.008
30.008
= 0.00027
microsec
onds
Pipelined protocols
Pipelining: sender allows multiple, “in-flight”,
yet-to-be-acknowledged pkts
– range of sequence numbers must be increased
– buffering at sender and/or receiver
• Two generic forms of pipelined protocols: goBack-N, selective repeat
Pipelining (by factor of 3)
sender
receiver
first packet bit transmitted, t = 0
last bit transmitted, t = L / R
first packet bit arrives
last packet bit arrives, send ACK
last bit of 2nd packet arrives, send ACK
last bit of 3rd packet arrives, send ACK
RTT
ACK arrives, send next
packet, t = RTT + L / R
Increase utilization
by a factor of 3!
U
sender
=
3*L/R
RTT + L / R
=
.024
30.008
= 0.0008
microsecon
ds
Go-Back-N
Sender:
• k-bit seq # in pkt header
• “window” of up to N, consecutive unack’ed pkts allowed
• ACK(n): ACKs all pkts up to, including seq # n “cumulative ACK”
– may receive duplicate ACKs (see receiver)
• timer for each in-flight pkt
• timeout(n): retransmit pkt n and all higher seq # pkts in
Selective Repeat
• receiver individually acknowledges all
correctly received pkts
– buffers pkts, as needed, for eventual in-order
delivery to upper layer
• sender only resends pkts for which ACK not
received
– sender timer for each unACKed pkt
• sender window
– N consecutive seq #’s
– again limits seq #s of sent, unACKed pkts
Selective repeat: sender, receiver
windows
Look at global negative
acknowledgment scheme
• Negative acknowledgment protocol along
with token passing in distcomp.ppt.
Network Layer: circuit
switching vs. packet
switching
Switching Networks
• Long distance transmission is typically
done over a network of switched nodes
• Nodes not concerned with content of data
• End devices are stations
– Computer, terminal, phone, etc.
• A collection of nodes and connections is a
communications network
• Data routed by being switched from node
to node
Technology
• Two different switching technologies
– Circuit switching
– Packet switching
Simple Switched Network
Circuit Switching
• Dedicated communication path between
two stations (during conversation)
• Three phases
– Establish
– Transfer
– Disconnect
• Must have switching capacity and channel
capacity to establish connection
• Must have intelligence to work out routing
Circuit Switching - Issues
• Circuit switching is inefficient (designed for
voice)
– Resources dedicated to a particular call
– Much of the time a data connection is idle
– Data rate is fixed
• Both ends must operate at the same rate
• Set up (connection) takes time
• Once connected, transfer is transparent
Packet Switching
Basic Operation
• Data transmitted in small packets
– Typically 1000 octets
– Longer messages split into series of packets
– Each packet contains a portion of user data
plus some control info
• Control info
– Routing (addressing) info
• Packets are received, stored briefly
(buffered) and passed on to the next node
– Store and forward
Use of Packets
Network layer
• transport segment
from sending to
receiving host
• on sending side
encapsulates
segments into
datagrams
• on rcving side,
delivers segments to
transport layer
• network layer
protocols in every
host, router
application
transport
network
data link
physical
network
data link
physical
network
data link
physical
network
data link
physical
network
data link
physical
network
data link
physical
network
data link
physical
network
data link
physical
network
data link
physical
application
transport
network
data link
physical
Key Network-Layer Functions
• forwarding: move
packets from
router’s input to
appropriate router
output
analogy:
• routing: process of
planning trip from
source to dest
• forwarding: process
• routing: determine
of
getting
through
route taken by
single interchange
packets from source
to dest.
Interplay between routing and forwarding
routing algorithm
local forwarding table
header value output link
0100
0101
0111
1001
3
2
2
1
value in arriving
packet’s header
0111
1
3 2
Many different interconnection
topologies
• Pointer to interconnection.ppt
Virtual circuit vs. datagram
networks
(Shasha students: read on your own)
Network layer connection and
connection-less service
• Datagram network provides network-layer
connectionless service
• VC network provides network-layer
connection service
• Analogous to the transport-layer services,
but:
– Service: host-to-host
– No choice: network provides one or the other
– Implementation: in the core
Virtual circuits
“source-to-dest path behaves much like
telephone circuit”
– performance-wise
– network actions along source-to-dest path
• call setup, teardown for each call before data can flow
• each packet carries VC identifier (not destination host
address)
• every router on source-dest path maintains “state” for
each passing connection
• link, router resources (bandwidth, buffers) may be
allocated to VC
VC implementation
A VC consists of:
1. Path from source to destination
2. VC numbers, one number for each link along
path
3. Entries in forwarding tables in routers along
path
• Packet belonging to VC carries a VC
number.
• VC number must be changed on each
link.
ForwardingVCtable
number
22
12
1
Forwarding table in
northwest router:
Incoming interface
1
2
3
1
…
2
32
3
interface
number
Incoming VC #
12
63
7
97
…
Outgoing interface
2
1
2
3
…
Outgoing VC #
22
18
17
87
…
Routers maintain connection state information!
Virtual circuits: signaling protocols
• used to setup, maintain teardown VC
• used in ATM, frame-relay, X.25
• not used in today’s Internet
application
transport 5. Data flow begins
network 4. Call connected
data link 1. Initiate call
physical
6. Receive data application
3. Accept call
2. incoming call
transport
network
data link
physical
Datagram networks
• no call setup at network layer
• routers: no state about end-to-end
connections
– no network-level concept of “connection”
• packets forwarded using destination host
address
– packets between same source-dest pair may take
application
different paths
application
transport
network
data link
physical
1. Send data
transport
network
2. Receive data
data link
physical
Datagram or VC network: why?
Internet
ATM
• data exchange among
• evolved from telephony
computers
• human conversation:
– “elastic” service, no
– strict timing,
strict timing req.
reliability
• “smart” end systems
requirements
(computers)
– need for guaranteed
– can adapt, perform
service
control, error recovery • “dumb” end systems
– simple inside network,
– telephones
complexity at “edge”
– complexity inside
• many link types
network
– different
The Internet Network layer
Host, router network layer functions:
Transport layer: TCP, UDP
Network
layer
IP protocol
•addressing conventions
•datagram format
•packet handling conventions
Routing protocols
•path selection
•RIP, OSPF, BGP
forwarding
table
ICMP protocol
•error reporting
•router “signaling”
Link layer
physical layer
Routing
Routing Strategies
•
•
•
•
Fixed
Flooding
Random
Adaptive
Fixed Routing
• Single permanent route for each source to
destination pair
• Determine routes using a least cost
algorithm
• Route fixed, at least until a change in
network topology
Fixed Routing
Tables
Flooding
• No network info required
• Packet sent by node to every neighbor
• Incoming packets retransmitted on every link
except incoming link
• Eventually a number of copies will arrive at
destination
• Each packet is uniquely numbered so duplicates
can be discarded
• Nodes can remember packets already
forwarded to keep network load in bounds
• Can include a hop count in packets
Flooding
Example
Properties of Flooding
• All possible routes are tried
– Very robust
• At least one packet will have taken
minimum hop count route
– Can be used to set up virtual circuit
• All nodes are visited
– Useful to distribute information (e.g. routing)
Random Routing
• Node selects one outgoing path for
retransmission of incoming packet
• Selection can be random or round robin
• Can select outgoing path based on
probability calculation
• No network info needed
• Route is typically not least cost nor
minimum hop
Adaptive Routing
• Used by almost all packet switching networks
• Routing decisions change as conditions on the
network change
– Failure
– Congestion
• Requires info about network
• Decisions more complex
• Tradeoff between quality of network info and
overhead
• Reacting too quickly can cause oscillation
(bathtub)
Routing Algorithm classification
Global or decentralized
information?
Global:
• all routers have
complete topology, link
cost info
• “link state” algorithms
Decentralized:
• router knows physicallyconnected neighbors,
link costs to neighbors
• iterative process of
computation, exchange
of info with neighbors
Static or dynamic?
Static:
• routes change
slowly over time
Dynamic:
• routes change more
quickly
– periodic update
– in response to link
cost changes
A Link-State Routing Algorithm
Dijkstra’s algorithm
• net topology, link costs known
to all nodes
– accomplished via “link state
broadcast”
– all nodes have same info
• computes least cost paths
from one node (‘source”) to all
other nodes
– gives forwarding table for
that node
• iterative: after k iterations,
know least cost path to k
dest.’s
Notation:
• c(x,y): link cost from node x to
y; = ∞ if not direct neighbors
• D(v): current value of cost of
path from source to dest. v
• p(v): predecessor node along
path from source to v
• N': set of nodes whose least
cost path definitively known
Dijsktra’s Algorithm
1 Initialization:
2 N' = {u}
3 for all nodes v
4
if v adjacent to u
5
then D(v) = c(u,v)
6
else D(v) = ∞
7
8 Loop
9 find w not in N' such that D(w) is a minimum
10 add w to N'
11 update D(v) for all v adjacent to w and not in N' :
12
D(v) = min( D(v), D(w) + c(w,v) )
13 /* new cost to v is either old cost to v or known
14 shortest path cost to w plus cost from w to v */
15 until all nodes in N'
Distance vector algorithm
Basic idea:
• Each node periodically sends its own distance
vector estimate to neighbors
• When node a node x receives new DV estimate
from neighbor, it updates its own DV using B-F
equation:
Dx(y) ← minv{c(x,v) + Dv(y)}
for each node y ∊ N
• Under minor, natural conditions, the estimate
Dx(y) converge the actual least cost dx(y)
Distance Vector Algorithm Properties
Iterative,
asynchronous: each
local iteration caused
by:
• local link cost change
• DV update message
from neighbor
Distributed:
• each node notifies
neighbors only when its
DV changes
– neighbors then notify
their neighbors if
Each node:
wait for (change in local link
cost of msg from neighbor)
recompute estimates
if DV to any dest has
changed, notify neighbors
Hierarchical OSPF
Hierarchical OSPF
• Two-level hierarchy: local area, backbone.
– Link-state advertisements only in area
– each nodes has detailed area topology; only
know direction (shortest path) to nets in other
areas.
• Area border routers: “summarize” distances to
nets in own area, advertise to other Area Border
routers.
• Backbone routers: run OSPF routing limited to
backbone.
• Boundary routers: connect to other AS’s.
Internet inter-AS routing: BGP
• BGP (Border Gateway Protocol): the de
facto standard
• BGP provides each AS a means to:
1. Obtain subnet reachability information from
neighboring ASs.
2. Propagate the reachability information to all
routers internal to the AS.
3. Determine “good” routes to subnets based on
reachability information and policy.
• Allows a subnet to advertise its existence
to rest of the Internet: “I am here”
Why different Intra- and Inter-AS routing ?
Policy:
• Inter-AS: admin wants control over how its traffic
routed, who routes through its net.
• Intra-AS: single admin, so no policy decisions
needed
Scale:
• hierarchical routing saves table size, reduced
update traffic
Performance:
• Intra-AS: can focus on performance
• Inter-AS: policy may dominate over performance