You are on page 1of 159

Computer Networks:

Introduction

Ivan Marsic
Rutgers University

Chapter 1 Introduction
Topic:
Introduction to Data
Networking

Goals
Communication Media
Protocols
Reliable Transmission
User Goals and Tunable Knobs

Visible network properties:

Delivery Correctness Fault tolerance Timeliness Cost

Customer

Tunable network parameters:

Network Communication Network Physical


Components
topology protocols architecture medium

Network
Engineer
Topology vs. Robustness
Paul Baran, 1964

Node

Link

Centralized Decentralized Distributed


(a) (b) (c)
Internet Map: Major ISPs
Fully Interconnected Network

New York City, 1888


Early Telephone Switching Offices
1924: First Mobile Telephone

The first version of a mobile radio telephone being used in 1924.


Exploiting Locality
Saul Steinberg,
A View of the World
from Ninth Avenue,

cover of
The New Yorker
March 29, 1976
Distortion of Signals

Voltage at transmitting end

Idealized voltage at receiving end

Line noise

Voltage at receiving end

threshold "0"/"1"
Packet Error Rate Approximation

PER 1 (1 BER) n 1 e n BER

PER = packet error rate


BER = bit error rate
n = packet length [in bits]
Packet Transmission (1)
Example: Sender sends a 6-bit packet 101101 to the receiver
Communication link
Physical setup:

Timeline diagram: Sender Receiver


Start of transmission
101101
Time

delay
propagation
Electro
magne
tic wav
e propag
delay
transmission

ation

101101
End of reception

Fluid flow analogy:

First drop of the fluid


enters the pipe Last drop of the fluid
exits the pipe

Fluid packet in transit


Transmission Link Capacity

1 0 1 1 0 0 1
Link 1:
1 Mbps
1s

1 0 1 1 00 1
Time
Link 2:
10 Mbps
100ns

Effect of link speed:


Link 2 can transmit 10 times more bits per unit of time
or, Link 2 can transmit the same message in a 10 times shorter period
Wireless Communication

Point source Interfering sources

Interference
pattern
Radio Signal Propagation
Ray tracing
simulation in a door
closed office
environment.

Signal intensity
map for a room
with a doorway
and a metal desk

desk
Transmission / Interference Range

Interfering
C
source
Interference
range

Transmission
D
range Interfering
source
B

A Receiver

Sender Interfering
E source

Transmitted Received signal


Threshold
signal power Threshold power from an
interfering source

Distance from sender 0 0 Distance from receiver


Layer i

Protocols send() handle()

Layer i 1

User-to-user interactions
obey social norms
Letter
(Message)
Customer interaction obeys
Person A mail acceptance and delivery Person B
procedures (Postal Services
Mail Manual)

Letter in Postal-vehicle
envelope service-transportation
(Packet) routes obey carrier-
route maps and

delivery timetables

Physical transport obeys


transportation and traffic rules
Statistical Multiplexing

City A

City B City C (a)

City D
3-Layer Protocol Stack
Protocol at layer i depends only on the protocols at i1 (not at i1!)
Layered architecture Layer function Examples
Application specific connections
Transmission Control
3: End-to-End Protocol (TCP)
Real-time Transport
Protocol (RTP)

Service interface between L2 & L3


Source-to-destination routing

2: Network Internet Protocol (IP)

Service interface between L1 & L2

Packet exchange

IEEE 802.11 WiFi


1: Link IEEE 802.3 Ethernet
PPP (modems, T1)
Layer 1 / 3-Layer Protocol Stack

Link Layer:
Protocol modules at layer 1 (bottom layer) exchange packets over the link
Layer 2 / 3-Layer Protocol Stack

Network Layer:
Protocol modules at layer 2 (middle layer) route packets from source
to destination (possibly over many links)
Layer 3 / 3-Layer Protocol Stack
Applications:
Network games
Internet telephony
Email

End-to-End Layer:
Protocol modules at layer 3 (top layer) create illusion of different link types
(tailored to application-specific needs)
Protocol Layers at Hosts/Switches
Physical setup: Intermediate
node (router)
End host A End host B

Communication link

Communication link

Protocol stack:

Application Application

3: End-to-End End-to-End :3

2: Network 2: Network Network :2

1: Link 1: Link Link :1

Physical communication Physical communication


Bit Stuffing for Transparency
ISO OSI Protocol Stack
Visit http://en.wikipedia.org/wiki/OSI_model for more details on the OSI Reference Architecture

Application
7: Application services (SIP, FTP,
HTTP, Telnet, )

Data translation (MIME)


6: Presentation Encryption (SSL)
Compression

Dialog control
5: Session Synchronization

Reliable (TCP)
4: Transport Real-time (RTP)

Source-to-destination (IP)
3: Network Routing
Address resolution

Wireless link (WiFi)


2: Data Link MAC Wired link (Ethernet)

Radio spectrum
Infrared
1: Physical Fiber
Copper
Packet Nesting Across Layers

Senders Receivers
Application data Application data
protocol stack protocol stack

Layer-3 Layer-3
Layer-3 payload Layer-3 payload
header header

Layer-2 Layer-2
Layer-2
Application
payload
data Layer-2
Application
payload
data
header header

Layer-1 Layer-1
Layer-1
Application
payloaddata Layer-1
Application
payloaddata
header header

Physical
communication
010010110110001011100100101100000101101 010010110110001011100100101100000101101
How Headers Guide Packets
Sender Endpoint Receiver Endpoint
At router, each layer examines only
2 its own header:
1. Routers Link layer protocol checks
Application that this packet is for this node Application
2. Routers Network layer protocol decides
the outgoing link based on destin. addr.

At router, each layer protocol


3 creates its own header type.
Layer 3: End-to-End Layer 3: End-to-End
Router

Layer 2: Network Layer 2: Network Layer 2: Network

Layer 1: Link Layer 1: Link Layer 1: Link

Packet:
Link Network End-end Link Network End-end
Application data Application data
layer hdr layer hdr layer hdr layer hdr layer hdr layer hdr

At receiver, each layer examines


only its own header type:
4 1. Receivers Link protocol checks Link-layer
header that this packet is for this node
At sender, each layer protocol creates its own header type.
1 Headers are nested; application data is nested deepest 2. Network protocol demultiplexes for
End-to-end protocol based on
the Network-layer header
3. Receivers End-to-end protocol
demultiplexes for receiver application
Error Detection and Correction
12 13 14 15 16 17 18 19 20 21 22 23 24
48 49 50 51 52 53 54 55 56 57 58 59 60

24 25 26 27 28 29 30 31 32 33 34 35 36

23
20 25
13 17
18 21 27 29
15 24
2 10 16 19 22 32
7 12
28 30 35
4 9 14 26 33
31
0 6
3 11 34
8
5 36
1
60 58 38 40 39
57 55 50 46 37
59 52 48 43 42 41
54
56
45 44
53 51
49 47
Interleaving
All science is either physics or stamp collecting.
Forward
interleaving:
theme illicts scenic graphics since poorest Ally.
A ll s c ie n c e i s e ith e r p h y s ic s o r s ta m p c o ll e c ti n g

detail

t h e m e i l l i c t s s c e ni c g r a p h ic s s i nc e p o o r es t All y

theme illicts scenic strictly since poorest Ally.


Inverse
interleaving:
All sctence is eitcer ihysicy ot strmp lollectins.
Packet Transmission (2)
Sender Receiver
Time

transmission Data
delay propagation
delay

ACK

processing
delay
processing
delay
Data
Transmission and Propagation
Delays

Transmission delay:

packet length L (bits )


tx
bandwidth R (bits per second)

Propagation delay:

distance d (m)
tp
velocity v (m/s)
Fluid Flow Analogy

Layer 2 Layer 2
sender receiver

Layer 1
sender

Queued Layer 1
buckets
receiver
What Contributes to RTT
Sender Receiver

Transport layer Processing delay within transport layers Transport layer

Send Receive Send Receive


data ACK ACK data

Network layer Processing delay within network layers Network layer

Send Receive Send Receive


packet packet packet packet

Processing and transmission delays


Link+Phys layer Link+Phys layer
within link/physical layers

Propagation delay (receiver sender)

Propagation delay (sender receiver)


Topic:
Reliable Transmission via
Retransmission

Stop-and-Wait
Go-Back-N
Selective Repeat
Automatic Repeat reQuest (ARQ)
Stop-and-wait ARQ
Transmit a frame and wait for acknowledgement (ACK)
If positive ACK from receiver, send next frame
If ACK does not arrive after a certain period of time (Timeout), retransmits the frame
Simple, low efficiency
Go-back-N ARQ
Transmit frames continuously, no waiting
The receiver only ACKs the highest-numbered frames received in sequence
ACK comes back after a round-trip delay
If timeout, the sender retransmits the frames that are not ACKed and N1 succeeding frames that
were transmitted during the round-trip delay (N frames transmitted during a round-trip delay)
Need buffer at sender, does not have to buffer the frames at the receiver,
Moderate efficiency and complexity. Less efficient when the round-trip delay is large and data
transmission rate is high
Selective-repeat ARQ
Transmit continuously, no waiting
The receiver ACKs all successfully received frames
The sender only retransmits (repeats) the unACKed frames when their timers expire
Most efficient, but most complex, buffer needed at both sender & receiver, needs per-frame timer
Stop-and-Wait with Errors
Sender Receiver
Packet i
Time

Send data transmission (error)


1st attempt

Set timer time

timeout
time
Timer expires Packet i (retransmission)
Resend data (error)
2nd attempt

Set new timer

Packet i (retransmission)
(error)
k-th attempt

Timer expires Packet i (retransmission)


k+1st attempt

Resend data transmission


Set new timer time

RTT ACK
Receive ACK Received
Reset timer error-free
Stop & Wait Sender Utilization
Stop & Wait sender utilization, under error-free transmission:
tx
S &W
U sender
tx 2 t p

Probability of successful transmission, with error rate pe:


psucc 1 peDATA 1 peACK
Expected sender utilization for Stop & Wait, under errors:

E S &W
U sender
t x E{N}

tx
E{T } psucc tsucc pfail tfail
total
Sliding Window Keeping the Pipe
Full

Goal: Sender should be busy sending packets


(as long as it has packets ready to send)
Sender utilization as a metric of protocol performance
Keeping the pipe full
Sliding Window ARQ
Sender Sender Receiver Receiver
window N = 4 window W = 4
0 1 2 3 4 5 6 7 8 0 1 2 3 4 5 6 7 8 9
Pkt-
Pkt-0
Pkt-
Pkt-1
0 1 2 3 4 5 6 7 8 9 Pkt-
Pkt-2 0 1 2 3 4 5 6 7 8 9
Pkt-
Pkt-3 Ack-
Ack-0
Ack-
Ack-1
Ack-
Ack-2 0 1 2 3 4 5 6 7 8 9 10
0 1 2 3 4 5 6 7 8 9 10 Ack-
Ack-3
Pkt-
Pkt-4
Pkt-
Pkt-5
0 1 2 3 4 5 6 7 8 9 10 Pkt-
Pkt-6 0 1 2 3 4 5 6 7 8 9 10
Pkt-
Pkt-7 Ack-
Ack-4
Ack-
Ack-5
Ack-
Ack-6 0 1 2 3 4 5 6 7 8 9 10 11
0 1 2 3 4 5 6 7 8 9 10 Ack-
Ack-7
Pkt-
Pkt-8
Key: Key:
Already ACKd Pkt-
Pkt-9 Received in-order & ACKd
Sent, not yet ACKd Expected, not yet received
Allowed to send Acceptable to receive
NOT allowed to send NOT acceptable
Go-back-N ARQ
Window N = 3 Sender Receiver
0 1 2 3 4 5 6 7 8 9 10 11 Pkt-0
0 1 2 3 4 5 6 7 8 9 10
Pkt-1 Next expected
seq.num.
0 1 2 3 4 5 6 7 8 9 10 11 Pkt-2 (loss)
Ack-0 0 1 2 3 4 5 6 7 8 9 10

Ack-0 discard Pkt-2


0 1 2 3 4 5 6 7 8 9 10 11 Pkt-3

1 2 3 4 5 6 7 8 9 10 11
Timeout for Pkt-1 discard Pkt-3
Ack-0
0 1 2 3 4 5 6 7 8 9 10
1 2 3 4 5 6 7 8 9 10 11 Pkt-1
s )
Pkt-2
s ion
is
1 2 3 4 5 6 7 8 9 10 11 Pkt-3 nsm 1 2 3 4 5 6 7 8 9 10
tr a Ack-1
(re
Ack-2 2 3 4 5 6 7 8 9 10

(loss) Ack-3 3 4 5 6 7 8 9 10
2 3 4 5 6 7 8 9 10 11
Pkt-4

4 5 6 7 8 9 10 11 Pkt-5
4 5 6 7 8 9 10
Ack-4
4 5 6 7 8 9 10 11 Pkt-6
Selective Repeat ARQ
Sender window N = 3 Sender Receiver window W = 3

0 1 2 3 4 5 6 7 8 9 10 11 Pkt-0 0 1 2 3 4 5 6 7 8 9 10

Pkt-1

0 1 2 3 4 5 6 7 8 9 10 11 Pkt-2 (loss) 0 1 2 3 4 5 6 7 8 9 10
Ack-0

0 1 2 3 4 5 6 7 8 9 10
Ack-2
0 1 2 3 4 5 6 7 8 9 10 11 Pkt-3 buffer Pkt-2

1 2 3 4 5 6 7 8 9 10 11
0 1 2 3 4 5 6 7 8 9 10
Ack-3
Timeout for Pkt-1
buffer Pkt-3
Pkt-1 (re
1 2 3 4 5 6 7 8 9 10 11 trans mission)

Ack-1
0 1 2 3 4 5 6 7 8 9 10

4 5 6 7 8 9 10 11 Pkt-4

4 5 6 7 8 9 10 11 Pkt-5

4 5 6 7 8 9 10 11 Pkt-6
Ack-4 0 1 2 3 4 5 6 7 8 9 10
Ack-5 0 1 2 3 4 5 6 7 8 9 10
Acknowledgements: GBN vs. SR
Sender Receiver Sender Receiver

01234567 Pkt-0 01234567 01234567 Pkt-0 01234567


Pkt-1 Pkt-1

01234567 Pkt-2 01234567 Pkt-2


Ack-0 1234567 Ack-0 01234567

Ack-1 234567 Ack-1

(loss) Ack-2 34567 (loss) Ack-2 01234567


1234567 Pkt-3 1234567 Pkt-3

34567 Pkt-4 Timeout for Pkt-1


4567 01234567
Ack-3 Ack-3
Pkt-5
34567

1234567
Pkt-1
Pkt-6

1234567
01234567
Ack-1
discard
duplicate Pkt-1
(a) Go-back-N (b) Selective Repeat
Topic:
Broadcast and Wireless Links

ALOHA
Hidden and Exposed Stations
Carrier Sensing Multiple Access
CSMA/CD, CSMA/CD
Time Transmission Cone
Sender Receiver Sender

TRANSMISSION
TRANSMISSION
Distance
Omnidirectional Simplified
transmission representation
in 3D in 2D

PROPAGATION

Receiver
RECEPTION

RECEPTION
Distance from sender
(a) Time (b)
Transmission Cone, Collision
& Vulnerable Period
Distance from the Receiver B (b)
Collision occurs if two Receiver
(or more) transmission A B C
cones overlap.

A
C
(a)

Time A A A
Receiver B Receiver B Receiver B
C C C

Distance

Bs
transmission Bs
transmission
sion
colli
As
As As
transmission
transmission transmission

sion
colli
Cs
transmission
Time Cs Time
(c) transmission (d) (e)
Parameter

Ratio of propagation delay vs. packet transmission time:

t p max d max R

tx vL
Parameter
Ratio of propagation delay vs. packet transmission time

Sender Receiver Sender Receiver


Packet transmission Packet transmission
(a)
propagation
transmission
transmission delay = 333 ns
delay = 8.192 ms
delay = 8.192 ms
Time

propagation
(b) delay =
119.3 ms

propagation constant 0.00004 propagation constant 14.6


Local area network, diameter = 100m Geosynchronous satellite
ALOHA and Slotted ALOHA
Senders State Diagram

START
HERE:
New packet
ready
ALOHA Packet Transmission

Sender A Receiver Sender B


propagation
Data delay from A
transmission
delay
propagation
receivers delay from B
ACK vulnerable
Time

Data period
(for receiving data from A)

vulnerable period
for pure ALOHA = 2 packet-time
When transmission cones of
ALOHA stations overlap?
A collides with an earlier transmission from B

Sender A Receiver Sender B


tstart(B)

tstart(A)

A transmission from B will collide with A if


B started no earlier than tx 1x relative to A
tstart(B) = tstart(A) tx + 1x
A collides with a later transmission from B

Sender A Receiver Sender B

tstart(A)

tstart(B)

tstart(A) tx + 1x = tstart(B) = tstart(A) + tx 1x A transmission from B will collide with A if


B started no later than tx 1x relative to A
tstart(B) = tstart(A) + tx 1x
ALOHA Scenario

System Output = S Key:

Fresh station
System
Receiver
Receiver Backlogged station

Transmission Attempts = G
/m

User
1 /m

User m
/m /m
User
2 System Input = m =
m
Backlogged Stations

Fresh stations transmit new packets


Backlogged stations re-transmit
collided packets

Receiver Fresh station


Receiver
Backlogged station

/m

Fresh Station

/m

Backlogged Station
Analysis of Slotted ALOHA (1)

ASSUMPTIONS FOR ANALYSIS:


All packets require 1 slot for x-mit
Poisson arrivals, arrival rate
Collision or perfect reception (no errors)
Immediate feedback (0, 1, e)
Retransmission of collisions (backlogged
stations)
No buffering or infinite set of stations
(m = ) Time Slots
i1 i i1 i2
ALOHA Model

G GP0
Channel S

Fresh Combined, fresh and Successfully


packets retransmitted packets transmitted packets
G(1 P0)

Collided packets
(to be retransmitted)
Analysis of Slotted ALOHA (2)

0 < < 1, since at most 1 packet / slot


Equilibrium: departure rate = arrival rate
Backlogged stations transmit randomly
Retransmissions + new transmissions:
Poisson process with parameter G >
( ) n
PA(t ) A(t ) n e
, n 0,1,...
n!
Analysis of Slotted ALOHA (2)

Throughput =
arrival rate probability of no collision
Slotted ALOHA throughput:

S G P0 G P A(t 1) A(t ) 0 G e G

Pure ALOHA throughput:


S G P0 G PA(t ) A(t ) 0 G e 2G
S (throughput per packet time) Efficiency of ALOHAs
Equilibrium
0.4 Slotted ALOHA: S = GeG

0.3 Arrival rate

0.2
Pure ALOHA: S = Ge2G
0.1

0 0.5 1.0 1.5 2.0 3.0


G (transmission attempts per packet time)

S-ALOHA: In equilibrium, arrival rate = departure rate:


= GeG
Max departure rate (throughput) = 1/e 0.368 @ G = 1
Unslotted (Pure) ALOHA

Assume: all packets same size, but no fixed


slots
The packet suffers no collision if no other
packet is sent within 2 packets long:
S=GP0=Ge2G
Max throughput 1/2e 0.184 @ G = 0.5
Less efficient than S-ALOHA, but simpler,
no global time synchronization

i
Hidden Stations

Range of As B B
transmissions A C A C

Range of Cs
transmissions

A is transmitting to B.
C wants to transmit and listens before talk but cannot hear A
because A is too far away
(As radio signal is too weak for C to hear,
so A and C are hidden stations to each other).
C concludes that the medium is idle and transmits,
thus interfering with Bs reception.
Exposed Stations

B D B D
A C A C

B is transmitting to A.
C wants to transmit to D, it listens before talk and hears B
so it refrains from transmitting although its transmission
would not interfere with As reception.

Therefore, C is an exposed station to B.


Note that for C to be allowed to transmit, C must know that A is not located in its transmission range
and that D is not in Bs transmission range.
Hidden station problem is much simpler to solve!
Exponential Backoff

Key idea:
increasing number of choices reduces the probability of repeated collisions

Coin Dice Roulette


two choices six choices 38 choices (American)
{0, 1} {1, 2, 3, 4, 5, 6} {0, 00, 1, 2, 3, , 36}
Wired Broadcast Media & CSMA
CSMA / CD Senders State Diagm
Analysis of CSMA/CD

Probability of a successful transmission:

m
(one transmits , others don' t ) m q 1 q
m 1
p succ
1

Channel efficiency for CSMA/CD:

tx L/ R 1
CSMA/CD
t x w L / R 2 / p succ 1 2 e R / L
CSMA/CD Collision Detection
STA 1 STA 2
Both stations are listening
t1

Time STA1 begins transmission

t2

STA2 begins
transmission

t3
STA2 detects
collision and
transmits
t4 jam signal

STA1 detects
collision before
ending transmission
t5
CSMA/CD Backoff Example
Previous CW STA1 = 2 CW STA1 = 4 CW STA1 = 8
Key:
frame
Collision (abort
transmission)
STA 1
1 0 1 0 3 2 1 0
Jam signal
=2 =4 =0 CW STA2 = 2
2 TA2 TA2
CW ST
A
CW S CW S CW STA2 = 0 Backoff slot
STA2, 1st frame STA2
STA 2 2nd frame
0 0 1 0

CW STA3 = 2 CW STA3 = 4 CW STA3 = 8

STA 3
0 2 1 0 3 2 1 0

Time
CW STA1 = 16
STA1, 1st frame
6 5 4 3 2 1 0

STA2, 2nd frame

CW STA3 = 16 CW STA3 = 0

STA3, 1st frame


2 1 0
CSMA / CA Senders State Diagm
Efficiency of CSMA protocols

Throughput per slot time


1 geg
1 2 1eg
Departure rate

Arrival rate
(a)
Equilibrium

g = (2) g (transmission attempts per slot time)

1.0
Nonpersistent
S (throughput per packet time)

CSMA/CD
Nonpersistent
0.8 = 0.01
CSMA

0.6
1-persistent CSMA
(b) 0.4
Slotted
0.2 ALOHA

Pure ALOHA

0.1 1 10 100 1000


G (transmission attempts per packet time)
Delay vs. Arrival Rate

Maximum channel
Average packet delay

transmission rate
TDMA

CSMA/CA
ALOHA

CSMA/CD

Arrival rate per station


Topic:
Internetworking

Routing & Forwarding


Internet Protocol (IPv4); Datagram Fragmentation
Link State Routing; Distance Vector Routing
Addressing; CIDR
Packet Switching / Routing

Packet switching device

Network
ports
Example Internetwork

Network 3:
C
A Ethernet
C Interfaces on
R1 A Network 2
D
B Network 2: D
Wi-Fi Interfaces on R1
Network 3
Network 1:
Interfaces on
Point- to-point
Network 1
B
R2 Interfaces on
Network 4: Network 4
Point-to-point Network 5: Ethernet R2

Interfaces on
Network 5
(a) E F (b) E F
Protocol Stack at
End-points vs. Routers

End-point protocol stack: Router protocol stack:


Layer 3: Layer 3:
End-to-End End-to-End

Layer 2: Layer 2: Routing Protocol


IP (Internet Protocol)
Network Network (OSPF, RIP, BGP, )

Layer 1: Layer 1:
Link Link
Routing Problem
Forwarding table

Interface 2
(a) Interface 1
Interface 3
Packets
Interface 4

Forwarding table

(b) Destination
ece.rutgers.edu
Output Interface
Interface 3
cs.rutgers.edu Interface 2
ts
cke Router
Pa
Network-layer Protocol:
Internet Protocol (IP)

Sender Receiver

User protocol User protocol

send() handle()

IP protocol IP protocol

Link layer protocol Link layer protocol


IPv4 Header
0 7 8 15 16 31
4-bit 4-bit
8-bit differentiated 16-bit datagram length
version header flags
services (DS) (in bytes)
number length
u
n
16-bit datagram identification u D M 13-bit fragment offset
s F F
e
d
8-bit time to live 20
8-bit user protocol 16-bit header checksum
(TTL) bytes

32-bit source IP address

32-bit destination IP address

options (if any)

data
Dotted Decimal Notation for IPv4

32-bit IPv4 address (binary representation):

10000000 00000110 00011101 10000011

dotted decimal notation:


(network-layer address)
128 . 6 . 29 . 131
associated by
a lookup table
host name (for human use):
(application-layer address) ece . rutgers . edu
Domain Name System (DNS)

visit website Internet


www.comp.org


DNS server

User Web server
DNS client
www.comp.org

Web browser passes the name www.comp.org to DNS client


DNS client sends query with www.comp.org to DNS server
DNS server responds with IP address of www.comp.org
DNS client passes the IP address to Web browser
Web browser initiates connection to the Web server using its IP address
IP Datagram Fragmentation (1)

(a)
Wi-Fi

Host D
Host A MTU = 1024 bytes
Router B

point-to-point
Router C
Ethernet

MTU = 512 bytes

MTU = 1200 bytes


IP Datagram Fragmentation (2)

JPEG image
1.5 Kbytes Host A
1,536 bytes

JPEG
Image pixels
header
Application
Router B 1,200 bytes

1,180 bytes 396 bytes IP IP payload


TCP layer
header ( 1,180 bytes )
IP
TCP TCP payload TCP TCP payload layer
header ( 1,160 bytes ) header ( 376 bytes )
508 bytes 508 bytes 224 bytes
IP 1,200 bytes 416 bytes IP IP payload IP IP payload IP IP pyld
layer
header ( 488 bytes ) header ( 488 bytes ) header 204 B
IP TCP TCP payload IP
header header ( 1,160 bytes ) header
MF-flag = 1 MF-flag = 1 MF-flag = 0
MF-flag = 0 MF-flag = 0 Offset = 0 Offset = 61 Offset = 122
Offset = 0 Offset = 0 ID = 73592 ID = 73592 ID = 73592
ID = 73592 ID = 73593
Headers of the fragment datagrams
NO FRAGMENTATION
FRAGMENTATION OCCURS HERE
Datagram Reassembly at Host D
Network Routing: Link State
Node 1 Node
B E
Step 0
7 1

Source 4 Node
node A C

Tentative
25 nodes Unconfirmed
Set of confirmed
nodes N0 (A) Node Node nodes N N0(A)
D 6 F

Step 1 Step 2 1
1 B E
B E
7 1 7 1
4 4
A C A C

N1 (A) 25 Tentative N2 (A) 25 Tentative


D F nodes D F nodes
6 6
Network Example for Routing
Protocols

Scenario 1: Scenario 2: Scenario 3:


Original network Cost c(C,D) 1 Link BD outage Link BC outage
B B B B
10 1 10 1 10 10 1

A 1 D A 1 D A 1 D A D

1 7 1 7 1 7 1 7
C C 1 C C

(a) (b) (c) (d)


Example of Link State Routing
Step Confirmed set N Tentative set Comments

0 (A, 0, ) Initially, A is the only member of Confirmed(A),


so examine As LSA.

(B, 10, B), As LSA says that B and C are reachable at costs
1 (A, 0, ) (C, 1, C) 10 and 1, respectively. Since these are currently
the lowest known costs, put on Tentative(A) list.
Move lowest-cost member (C) of Tentative(A)
2 (A, 0, ), (C, 1, C) (B, 10, B) into Confirmed set. Next, examine LSA of
newly confirmed member C.

(B, 2, C), Cost to reach B through C is 11=2, so replace


3 (A, 0, ), (C, 1, C) (D, 8, C) (B, 10, B). Cs LSA also says that D is reachable
at cost 71=8.

4 (A, 0, ), (C, 1, C), (D, 8, C) Move lowest-cost member (B) of Tentative(A)


(B, 2, C) into Confirmed, then look at Bs LSA.
5 (A, 0, ), (C, 1, C), (D, 3, C) Because D is reachable via B at cost 111=3,
(B, 2, C) replace the Tentative(A) entry for D.
6 (A, 0, ), (C, 1, C), Move lowest-cost member (D) of Tentative(A)
(B, 2, C), (D, 3, C) into Confirmed. END.
Example Link State (1)

B
As LSA
10 re-broadcast from B

As LSA A D
broadcast from node A
Node
Seq.# Neighbor B C
ID As LSA
=1 Cost 10 1 1
=A
re-broadcast from C
C
Example Link State (2)
LSA from node B (sent to A, C, D)

Node
Seq.# Neighbor A C D B
ID
=1 Cost 10 1 1
=B

1 LSA from node D (sent to B, C)


10 Node
Seq.# Neighbor B C
ID
=1 Cost 1 7
=D

A 1 D
LSA from node A
Node
Seq.# Neighbor B C
ID
=1 Cost 10 1 7
=A
1
(sent to B, C) LSA from node C
Node
Seq.# Neighbor A B D
ID
=1 Cost 1 1 7
C =C
Network Routing: Distance Vector

shortest paths (distances) from each neighbor


Neighbor 19 to the destination node
1
7

29
4 Neighbor Destin
Source
2 ation

25
Neighbor
3
8

shortest path (src dest) = Min { 7 19, 4 29, 25 8 }


= 7 19 = 26
Distance Vector Calculation

DX Y min c( X ,V ) DV (Y )
V ( X )
Example - Distance Vector
B
10 1

A 1 D

1 7
C

Routing table at node A: Initial Routing table at node A: After 1st exchange
Distance to Received Distance Vectors Distance to
A B C A B C D A B C D
From B
A 0 10 1 10 0 1 1 A 0 2 1 8
From

B B 10 0 1 1

From
A B C D
From C
C 1 1 0 7 C 1 1 0 7
Example - Distance Vector

D A ( B) min c( A, B) DB ( B), c( A, C ) DC ( B) min 10 0, 1 1 2

DA (C ) min c( A, B) DB (C ), c( A, C ) DC (C ) min 10 1, 1 0 1

DA ( D) min c( A, B) DB ( D), c( A, C ) DC ( D) min 10 1, 1 7 8

DB ( D) min c( B, A) DA ( D), c( B, C ) DC ( D) min 10 3, 1 2 3


Initial routing tables: After 1st exchange: After 2nd exchange: After 3rd exchange:

Routing table A Distance to Distance to Distance to Distance to

at node A A B C A B C D A B C D A B C D

A 0 10 1 A 0 2 1 8 A 0 2 1 3 A 0 2 1 3

From

From
From

From
B B 10 0 1 1 B 2 0 1 1 B 2 0 1 1
C C 1 1 0 7 C 1 1 0 2 C 1 1 0 2

B Distance to Distance to Distance to Distance to


Routing table

A B C D A B C D A B C D A B C D
at node B

A A 0 10 1 A 0 2 1 8 A 0 2 1 3

B 10 0 1 1 B 2 0 1 1 B 2 0 1 1 B 2 0 1 1

From
From

From
From

C C 1 1 0 7 C 1 1 0 2 C 1 1 0 2

D D 1 7 0 D 8 1 2 0 D 3 1 2 0

C Distance to Distance to Distance to Distance to


Routing table

A B C D A B C D A B C D A B C D
at node C

A A 0 10 1 A 0 2 1 8 A 0 2 1 3
B B 10 0 1 1 B 2 0 1 1 B 2 0 1 1
From

From

From
From

C 1 1 0 7 C 1 1 0 2 C 1 1 0 2 C 1 1 0 2

D D 1 7 0 D 8 1 2 0 D 3 1 2 0

D Distance to Distance to Distance to Distance to


Routing table

B C D A B C D A B C D A B C D
at node D

B B 10 0 1 1 B 2 0 1 1 B 2 0 1 1

From
From
From

From

C C 1 1 0 7 C 1 1 0 2 C 1 1 0 2
D 1 7 0 D 8 1 2 0 D 3 1 2 0 D 3 1 2 0
Example DV Routing Loops
Scenario 2:
Original network Link BD outage

B B
10 1 10

A 1 D A 1 D

1 7 1 7
C C

Routing table at node B before BD outage Routing table at node B after BD outage
Distance to Distance to
1. B detects BD outage
A B C D 2. B sets c(B, D) = A B C D

A 0 2 1 3 3. B recomputes its A 0 2 1 3
distance vector
B 2 0 1 1 4. B obtains 3 as the From
B 2 0 1 3
From

shortest distance
C 1 1 0 2 to D, via C C 1 1 0 2

D 3 1 2 0 D 3 1 2 0
Topic:
IP Addressing and CIDR

Hierarchical Structure of IP Addresses


CIDR (Classless Interdomain Routing)
Example: Road Map
Forwarding Table Scalability
NEW YORK 96 mi.

BLOOMFIELD 91 mi.

NEWARK 85 mi.
Paterson

KEARNY 89 mi.
Bloomfield
East Orange Fort Lee
Union
ELIZABETH 80 mi. Irvington
City
Newark
Allentown Elizabeth New York
PATERSON 99 mi.
Bayonne
Linden

UNION CITY 93 mi. Carteret

EAST ORANGE 88 mi. New Brunswick

LINDEN 80 mi.
Princeton

CARTERET 75 mi. Trenton NEW YORK 96 mi.

compared to
Philadelphia
OLD IPv4 Address Structure

n bits (32 n) bits


IPv4 0 31
old address Class Network part Host part
(a) structure
8 bits 24 bits
0 7 8 31

Class A 0 Network part Host part


0 1 15 16 31

Class B 1 0 Network part Host part


0 1 2 23 24 31

(b) Class C 1 1 0 Network part Host part


0 1 2 3 31

Class D 1 1 1 0 Multicast group part


0 1 2 3 31

Class E 1 1 1 1 Reserved for future use


Address Class Sizes

Number of networks of a given class


Class A 128 (first bit fixed to "0" for "Class A")

Class B 16,384 (first two bits fixed to 10" for "Class B")

Class C 2,097,152 (first three bits fixed to 110" for "Class C")

Number of IP addresses (hosts) in a network of a given class


16,777,216
Class A

Class B 65,536

Class C 256
Special IPv4 Addresses

0 31

This host 00000000 00000000 00000000 00000000


0 (length depends on IP address class) 31

A host on this network 000....000 Host identifier


0 31

Broadcast on this network 11111111 11111111 11111111 11111111


0 (length depends on IP address class) 31

Broadcast on a distant network Network id 1111.............1111


0 7 8 31
Loopback within this network 01111111 Anything
(most commonly used: 127.0.0.1)
CIDR Example (1)

(a)
A Subnet-3
C
Subnet-2
R1
B 1
2
3
D
Subnet-1
R2
1
to other networks
2 4 204.6.94.130
Subnet-4 3

Subnet-5

E F
CIDR Example (2)

Subnet-3: C
204.6.96.168/30
204.6.94.164
Organizations address subspace: A Subnet-2:

65
w.x.y.z/27

.1
204.6.94.168 204.6.96.164/30

94
6.
4.
D

20
204.6.94.169
204.6.94.166
R1 S
20 u b n
4. e
Subnet-1: Subnet-3: Subnet-5: 20 6. t-1
4. 96 :
w.x.y.z/30 w.x.y.z8/31 w.x.y.z16/30 6. .1
204.6.94.170 94 60
.1 /3
61 0
B 204.6.94.160
Subnet-2: Subnet-4:
w.x.y.z4/30 w.x.y.z12/31 204.6.94.172 204.6.94.173
R2
Subnet-4:
204.6.96.172/30 204.6.94.176
204.6.94.177
204.6.94.178
(b) (c) Subnet-5:
204.6.96.176/30 E F
CIDR Example (3)
Subnet Network prefix Binary representation Interface addresses
R2-1: 204.6.94.160
R1-2: 204.6.94.161
1 204.6.94.160/30 11001100 00000110 01011110 101000--
(unused)
b-cast: 204.6.94.163
C: 204.6.94.164
R1-3: 204.6.94.165
2 204.6.94.164/30 11001100 00000110 01011110 101001--
D: 204.6.94.166
b-cast: 204.6.94.167
A: 204.6.94.168
R1-1: 204.6.94.169
3 204.6.94.168/30 11001100 00000110 01011110 101010--
B-1: 204.6.94.170
b-cast: 204.6.94.171
R2-2: 204.6.94.172
B-2: 204.6.94.173
4 204.6.94.172/30 11001100 00000110 01011110 101011--
(unused)
b-cast: 204.6.94.175
R2-3: 204.6.94.176
E: 204.6.94.177
5 204.6.94.176/30 11001100 00000110 01011110 101100--
F: 204.6.94.178
b-cast: 204.6.94.179
CIDR-based Forwarding Tables

Router R1 Router R2 Remote router

1 1
1 2 4
2
3 3
Forwarding table: Forwarding table: Forwarding table:
Destination net prefix Out port Destination net prefix Out port Destination net prefix Out port
204.6.96.164/30 3 204.6.96.160/27 1 204.6.96.160/27 1
204.6.96.168/30 1 204.6.96.172/30 2
0.0.0.0/0 2 204.6.96.176/30 3
default route 0.0.0.0/0 4 0.0.0.0/0
Topic:
Autonomous Systems

Commercial Internet
Peering and Transit Relationships
Path Vector Routing
Autonomous Systems (ASs)
Macrospot.com Noodle.com

Tier-2
Tier-1
ISP Tier-1
ISP
ISP

Tier-3
Tier-2
ISP Tier-2
ISP ISP

Tier-3
Tier-3 Tier-3
ISP
ISP ISP

s customers
s customers
s customers
ISP Business Relationships
(a) Paid Transit (b) Peering

ISP
ISP ISP
peering
$ $ $

s
s customer s customer
customer

Figure (a) shows the pay-for-transit relationship.


In principle, a customer pays for incoming and outgoing traffic, and expects to be able to reach all other
customers or content providers on the global Internet.
Permissible amounts of traffic in both directions are regulated by the service level agreement (SLA)
between the provider and the customer.

ISP has the same relationship with ISPs and as they have to their customers.
In other words, and are s paying customers.

In (b), ISP (not shown) could peer with another same-tier ISP (not shown) and their peering relationship
would work on the same principle as for ISPs and .
ISP Business Relationship Example
Macrospot.com Noodle.com Key:
$
Transit
Peering

$ $
Tier-2
$
Tier-1 $
ISP Tier-1
$ ISP
ISP

$ $
Tier-3
$ Tier-2
ISP Tier-2
ISP ISP
$ $
$
Tier-3
Tier-3 Tier-3
ISP
ISP ISP
$
$ $

s customers
s customers
s customers
Providing Selective Transit (1)
AS AS AS

$ $ $
s s s
customers customers customers

(a)
AS AS
$ $
$

AS AS AS AS AS AS

$ $ $ $ $ $
s s s s s s
customers customers customers customers customers customers

(b) (c)

AS AS AS AS
$ $
$
$ $ $

AS AS AS AS AS AS

$ $ $ $ $ $
s s s s s s
customers customers customers customers customers customers

(d) (e)
Providing Selective Transit (1)
AS AS AS

$ $ $
s s s
customers customers customers

(a)
AS AS
$ $
$

AS AS AS AS AS AS

$ $ $ $ $ $
s s s s s s
customers customers customers customers customers customers

(b) (c)

AS AS AS AS
$ $
$
$ $ $

AS AS AS AS AS AS

$ $ $ $ $ $
s s s s s s
customers customers customers customers customers customers

(d) (e)
Providing Selective Transit (2)
AS and its customers are
AS AS AS customers of AS;
$ $
and AS and its customers
$
are customers of AS
s s s
customers customers customers

(a)
AS AS
$ $
$

AS AS AS AS AS AS

$ $ $ $ $ $
s s s s s s
customers customers customers customers customers customers

(b) (c) customers of AS


customers of AS

AS AS AS AS
$ $
$
$ $ $

AS AS AS AS AS AS

$ $ $ $ $ $
s s s s s s
customers customers customers customers customers customers

(d) (e)
Routing in Global Internet (1)
router in AS sends an Macrospot.com Noodle.com

update message
advertising the destination
prefix 128.34.10.0/24 AS

AS B AS
E J
G
C
A H I
} D F

AS

S
{A S

{AS AS

,A
AS } AS
S
{A
}
L {AS, AS {A
S
S
K O P ,A
N ,A
M S
}

Q
S

}
,A

{AS
S

AS AS AS
{A

, A

S
}

{Cust} R t}
{Cust

s customers s customers
s customers
Routing in Global Internet (2)
Macrospot.com Noodle.com

AS

AS B AS
E J
G
C
A H I
} D F

AS

AS advertises
,

S
{A S

{AS AS only its

,A
AS } AS
S customers to its
{A
} peers, so AS
L {AS, AS {A
S
S
K O ,A
P never learns that
N ,A
M S AS has links to
}

Q
S

}
AS and AS
,A

{AS
S

AS AS AS
{A

, A

S
}

{Cust} R t}
{Cust

s customers s customers
s customers
Example - Path Vector


Routing table at AS : Initial Received Path Vectors (1st exchange) 10 1

Path to 1

From
0 | 10 | 1 | 10 | 0 | 1 | 1 | 1 7

From

| | |
From
| | | 1 | 1 | 0 | 7 |

Path to

0 | 2 | , 1 | 8 | ,
Routing table at node : After 1st exchange:

From
10 | 0 | 1 | 1 |

1 | 1 | 0 | 7 |
Example - Path Vector

D ( ) min c( , ) D ( ), c( , ) D ( ) min 10 0, 1 1 2

D ( ) min c( , ) D ( ), c( , ) D ( ) min 10 1, 1 0 1

D ( ) min c( , ) D ( ), c( , ) D ( ) min 10 1, 1 7 8
Integrating IGP & EGP Tables

Learn from IGP


protocol that
destination x external
to own AS is reachable
via multiple speakers.
Use info from IGP
routing tables to
determine distance to
each of the speakers.

Hot-potato routing:
Choose the speaker at
the minimum distance
from this router.

Determine the output


port O that leads to the
chosen speaker. Enter
(x,O) in forwarding table
Example - Path Vector


Routing table at AS : Initial Received Path Vectors (1st exchange) 10 1

Path to 1

From
0 | 10 | 1 | 10 | 0 | 1 | 1 | 1 7

From

| | |
From
| | | 1 | 1 | 0 | 7 |

Path to

0 | 2 | , 1 | 8 | ,
Routing table at node : After 1st exchange:

From
10 | 0 | 1 | 1 |

1 | 1 | 0 | 7 |
Topic:
Link-Layer Technologies

Point-to-Point Protocol (PPP)


IEEE 802.3 a.k.a. Ethernet
Layer 3:

Link Layer Services


End-to-End

Layer 2:
Network

Layer 1: IEEE 802.


Link (Ethernet, Wi-Fi, )

Data-link layer: transfer datagram from one node to


adjacent node over a communication link
Framing: encapsulate datagram into a frame, adding header, trailer.
Identify what set of bits constitute a frame, that is, determining the
beginning and the end of a frame
Channel access if shared medium
MAC addresses used in frame headers to identify source & destination
different from IP addresses!
Reliable delivery between adjacent nodes
Error detection
Error recovery: forward error correction code, retransmission (ARQ)
Flow control: pacing between adjacent sending and receiving nodes
Half-duplex and full-duplex
with half duplex, either transmit or receive on a link,
but not both nodes at same time
Link Layer Sublayering
Network layer / User

Logical link control


(LLC) sublayer
Network layer / User

Link Medium access control Medium access control


layer (MAC) sublayer (MAC) sublayer
Link
layer
Physical Physical
(PHY) sublayer (PHY) sublayer

(a) (b)

bytes: 1 1 1 or 2 variable

DSAP address SSAP address LLC control Data

LLC Packet Data Unit: DSAP = Destination service access point


SSAP = Source service access point
LLC address fields

I/G DSAP value C/R SSAP value I/G = Individual/Group


C/R = Command/Response
bits: 1 7 1 7
Point-to-Point Protocol (PPP)
Visit http://en.wikipedia.org/wiki/HDLC for more details on High-Level Data Link Control (HDLC)

Internet providers premises

PPP over
fiber optic link
Customers home

Router

PPP
over dialup telephone line

PC Modem Modems Router


PPP Functions
Framing: encapsulation of network-layer datagram in data-link frame
Identify what set of bits constitute a frame, i.e., determine the start & end of a frame
Carry data of any network layer protocol (not just IP) at same time
ability to demultiplex upwards
Bit transparency: must carry any bit pattern in the data field
Error detection (no correction)
Connection liveness: detect, signal link failure to network layer
Network-layer address negotiation: endpoints can learn/configure each
others network addresses
Other characteristics of PPP:
no error correction/recovery
no flow control
out-of-order delivery acceptable
no need to support multipoint links (e.g., polling)
Point-to-point (PPP) Frame Format
bytes: 1 1 1 1 or 2 variable 2 or 4 1

01111110 11111111 00000011 01111110

Flag Address Control Protocol Data payload Checksum Flag

LCP or NCP Control Packets:


Value for LCP: C02116
Value for NCP: C02316

Flag Address Control Protocol Payload Checksum Flag

Information for
Code ID Length
the control operation

bytes: 1 1 2 variable
Point-to-point (PPP):
State Diagram
Dead
Carrier
detected /

Start
/ Drop carrier
/ Exchange
TERMINATE packets
Failed /
Terminating
Establishing Link Connection
Failed /

Options agreed on / Done /
Establishing
Authenticated /
Drop carrier

Authenticating

Connecting to NCP configured /
Network-Layer
Protocol Send & receive
frames

Open
Topic:
IEEE 802.3 a.k.a. Ethernet

Ethernet Medium Access Control (MAC) Protocol


Ethernet Evolution
Switched Ethernet
802.3 Link-Layer Frame Format
Ethernet Version Notation

Data rate Baseband/Broadband Wiring type (e.g., coaxial,


(e.g., 10 Mbps, 10 Gbps) transmission twisted pair or fiber optic)

MAC address Network port Time last frame received

00-01-03-1D-CC-F7 1 10:39

01-23-45-67-89-AB 1 10:52

A3-B0-21-A1-60-35 2 10:17
Thin-Cable Ethernet
Switched/Bridged Ethernet
Legacy Ethernet vs. Eth. Hub

Thin-Cable Ethernet

Ethernet Hub
Hub vs. Switch

OSI Layer-1
switching

Ethernet Hub

OSI Layer-2
switching

Ethernet Switch
Ethernet MAC & Link Duplexity

IEEE 802.3 MAC


(CSMA/CD)

10 Mbps PHY
100 Mbps PHY 1000 Mbps PHY 10 Gbps PHY
IEEE Std 802.3-1985
IEEE Std 802.3u IEEE Std 802.3z IEEE Std 802.3ae
802.3a, 802.3i,
10Base2*, 10Base5*, 100Base-T, 100Base-T2, 1000Base-T, 1000Base-X, 10GBase-E, 10GBase-L,
10Base-F, 10Base-FB, 100Base-T4*, 100Base-TX, 1000Base-BX10 10GBase-R, 10GBase-S,
10Base-FL, 10Base-FP, 100Base-X, 100Base-BX10, 10GBase-T, 10GBase-W,
10Base-T 100Base-FX, 100Base-LX10 10GBase-X

(*) Not capable of operating in full duplex mode


Ethernet Switch
Learning Switches

B
MAC address: Network 1
00-01-03-1D-CC-F7

01-23-45-67-89-AB
Port 1
A Switch D

Port 2
A3-B0-21-A1-60-35

49-BD-2F-54-1A-0F
Network 2

[ See the switching table in the next slide ]


Switching Table
for the Previous Example

MAC address Network port Time last frame received

00-01-03-1D-CC-F7 1 10:39

01-23-45-67-89-AB 1 10:52

A3-B0-21-A1-60-35 2 10:17
Loops in Switched LANs (1)

Network 1

Port 1 Port 1
A Switch 1 Switch 2

Port 2 Port 2

Network 2

C D
Loops in Switched LANs (2)
Network 1 Netw-1

Switch 1 Port 1 Switch 2 P1 S-1 P1 S-2 P1

C P2 C P2 C P2 C P1

Port 2 P2 P2 P2

Network 2 Packet Netw-2

(a) C (b) C

Netw-1 Netw-1

S-1 P1 S-2 P1 S-1 P1 S-2 P1

C P2

C P1 C P1 C P1

P2 P2 P2 P2

Netw-2 Netw-2

(c) C (d) C
802.1D Configuration BPDU
parameters and format
BPDU format:
Protocol Protocol BPDU Root Root path Switch Port Message Max Hello Forward
Flags
ID version ID type ID cost ID ID age age time delay

2 bytes 1 byte 1 byte 1 byte 8 bytes 4 bytes 8 bytes 2 bytes 2 bytes 2 bytes 2 bytes 2 bytes
Topic:
IEEE 802.11 a.k.a. Wi-Fi

802.11 Architecture
802.11 Medium Access Control
RTS/CTS Protocol for Hidden Stations
Components of 802.11 LANs

Ad hoc network does not have distribution system nor access point
IBSS and Infrastructure BSS
Extended Service Set (ESS)

Distribution system (e.g., Ethernet LAN)

AP1 AP2 AP3

BSS1 BSS2 BSS3

t=1 t=2
802.11 Link Layer Protocol
Architecture

IEEE 802.11 MAC

802.11b Physical sublayer

1 Mbps PHY 2 Mbps PHY 5.5 Mbps PHY 11 Mbps PHY


(DBPSK) (DQPSK) (DBPSK/CCK) (DQPSK/CCK)
802.11 Link or MAC-Layer
Frame Format
MAC header MSDU

bytes: 2 2 6 6 6 2 6 2 0 to 2304 4

FC D/I Address-1 Address-2 Address-3 SC Address-4 QC Data FCS

FC = Frame control MSDU = MAC Service Data Unit


D/I = Duration/Connection ID
SC = Sequence control
(a) QC = QoS control
FCS = Frame check sequence

bits: 2 2 4 1 1 1 1 1 1 1 1
Protocol To From
Type Type MF RT PM MD W O
version DS DS

DS = Distribution system MD = More data


MF = More fragments W = Wired equivalent privacy (WEP) bit
RT = Retry O = Order
PM = Power management

(b)
802.11 physical-layer frame: Physical protocol data unit (PPDU)

shown above
in part (a)
Physical-layer preamble Physical-layer header MAC-layer frame (payload)
144 bits 48 bits (variable)

Synchronization SFD Signal Service Length CRC


SFD = start frame delimiter
128 bits 16 bits 8 bits 8 bits 16 bits 16 bits
802.11 PHY Frame
(Long PPDU format)

Physical-layer preamble (long format) Physical-layer header

SFD (16 bits) HEC (16 bits)


Payload
Synchronization (128bits) Signal (8 bits) Length (16 bits)
(variable)
Service (8 bits)

PPDU = PLCP protocol data unit


PLCP = physical (PHY) layer convergence procedure
SFD = start frame delimiter
802.11 Address Fields

A C D
TA
SA RA DA

[Address-1] RA = Immediate recipient of the current frame (C)


[Address-2] TA = Transmitter which transmitted the current frame (B)
[Address-3] SA = Original source (A)
[Address-4] DA = Original destination (D)
802.11 Protocol Architecture

802.11 MAC

802.11 802.11 802.11a 802.11b


FHSS DSSS OFDM DSSS
802.11 Interframe Spaces (1)
CSMA / CA
Collision Avoidance

DIFS
PIFS Contention
period
SIFS
Busy Frame transmission
.....

Backoff Time
slots

Defer access Select slot using binary exponential backoff


802.11 Interframe Spaces (2)
DIFS
PIFS Contention
period
SIFS
Busy Frame transmission
.....
Backoff Time
slots

Defer access Select slot using binary exponential backoff

EIFS definition:
A station ready to transmit enters EIFS after detecting a corrupted frame

EIFS
Busy Backoff Frame transmission

detected a corrupted frame


IEEE 802.11b System Parameters

Parameter Value for 1 Mbps channel bit rate


Slot time 20 sec
SIFS 10 sec
DIFS 50 sec (DIFS = SIFS + 2 Slot time)
EIFS SIFS + PHY-preamble + PHY-header + ACK + DIFS = 364 sec

CWmin 32 (minimum contention window size)


CWmax 1024 (maximum contention window size)
PHY-preamble 144 bits (144 sec)
PHY-header 48 bits (48 sec)
MAC data header 28 bytes = 224 bits

ACK 14 bytes + PHY-preamble + PHY-header = 304 bits (304 sec)

RTS 20 bytes + PHY-preamble + PHY-header = 352 bits (352 sec)

CTS 14 bytes + PHY-preamble + PHY-header = 304 bits (304 sec)

MTU* Adjustable, up to 2304 bytes for frame body before encryption


802.11 Basic Transmission Mode

DIFS Backoff Time


Busy Data
Sender 4 3 2 1 0

SIFS
Busy Receive data ACK
Receiver
Resume
countdown
after deferral
DIFS Backoff Suspend countdown and defer access DIFS
Busy
Another station 9 8 7 6 5 6 5 4 3
802.11 Protocol State Diagram
Sender
New packet /

Idle / Wait for Idle / ACK error-free /


Sense Sense Send End
DIFS
ACK in error /
Busy / Busy / Wait for
EIFS
Timeout / 1

(a) Increase CW & attempts


1 Abort
Attempt count max-attempts /

attempts
max-attempts /
backoff == 0 / 1

Set Wait for end of Idle / Countdown


Wait for
backoff transmission DIFS
Sense backoff backoff 1

backoff 0 /
Busy /
802.11 Protocol State Diagram
Receiver

Packet error-free / Wait for Send


Receive End
SIFS ACK

Packet in error /
(b)
Wait for
EIFS
Examples of Timing Diagrams
for IEEE 802.11
1. A single station has two frames ready for
transmission on an idle channel.
2. A single station has one frame ready for
transmission on a busy channel. The
acknowledgement for the frame is corrupted
during the first transmission.
3. A single station has one frame ready for
transmission on a busy channel. The data frame is
corrupted during the first transmission.
802.11 Timing Diagrams
(a) Timing of successful frame transmissions under the DCF:

Packet arrival, DIFS


channel idle DIFS
Frame-1 Frame-2 Time
Backoff
ACK ACK
(no backoff) SIFS SIFS

(b) Frame retransmission due to ACK failure:


(retransmission)
DIFS EIFS
Busy Backoff Frame-1 Backoff Frame-1
ACK ACK
SIFS SIFS

(c) Frame retransmission due to an erroneous data frame reception:


(retransmission)
DIFS ACK Timeout
Busy Backoff Frame-1 Backoff Frame-1
ACK
SIFS
RTS/CTS for Hidden Stations
A transmits Request-to-Send N bytes to B B responds with Clear-to-Send N bytes
(a) (b)
RTS(N-bytes)

B B
A C A C

CTS(N-bytes)

C listens but cannot hear As transmission both A and C hear Bs transmission

A transmits N-bytes long data frame to B

N-bytes frame I should be


quiet for N-byte
B duration of
A C transmission

Defer(N-bytes)
(c)
RTS/CTS Transmission Mode

SIFS
DIFS Backoff Time
Busy RTS Data
Sender 4 3 2 1 0

SIFS

SIFS
Busy CTS ACK
Receiver
NAV (Data)
NAV (CTS)

DIFS Backoff NAV (RTS)


Busy
Covered Station 8 7 6 5 4

Access to medium deferred for NAV(RTS)


DIFS Backoff
Busy
Hidden Station
Access to medium deferred for NAV(CTS)
Topic:
Quality of Service (QoS)

Introduction & Prospects


Network Neutrality Debate
Network Conceptual Model

Capture: Transport: Playout:

Network
Network

signals packets packets reordered, lost,


or variably delayed
Players and Parameters
NETWORK:
SOURCE: Available capacity/bandwidth RECEIVER:
Source information rate Variable traffic load (usage) Delay/timeliness constraints
Statistical characteristics Hardware & software failures Information loss tolerance

(2) Priority treatment at router:


(1) Reserved-resources path: Reduced waiting in queue
Guaranteed delay bound (expedited forwarding)
Guaranteed loss rate Reduced packet loss if
memory space overbooked
Network Conceptual Model (2)

Network
Network

We dont know when sources will start/end their sessions; also for some types of data (video), datarate is variable

You might also like