Beruflich Dokumente
Kultur Dokumente
Spring 2015
D. Raychaudhuri
Lecture II
Includes teaching materials from L. Peterson, J. Kurose
Todays Lecture
Recap of network architecture &
top-down design
architecture paper discussion
Switch
Switch
Link
Router
Host
Sending Datagram
node
Datagram
Frame
Frame
Adaptor
Adaptor
Host
CPU
Control status
register
Cache
Memory
I/O
bus
Bus
interface
NIC
Link Network
interface
Recv
node
Layer 3 routing
Based on IP address
Must get IP address
(DHCP or manual
assign)
Easily connect LANs
that uses different link
protocols
Scalable to large
network by subnet
routing
Broadcast limited only
in a subnet
Binary Encoding
Binary Encoding: turn the binary data (bits) into
signals to transmit on cable or optical fiber link
(physical layer stuff, but better to know)
Baseband, not modulate to high frequency
Nonreturn To Zero (NRZ): 1=high signal, 0=low
signal
May stay on high or low signal too long for a long strings
of consecutive 1s or 0s => baseline wander, clock
recovery problems.
Manchester Encoding
PPP
PPP Functions
Framing: encapsulation of network-layer datagram in
data link frame
Identify what set of bits constitute a frame, that is,
determining the beginning and the end of a frame
carry data of any network layer protocol (not just IP) at
same time
ability to demultiplex upwards
no error correction/recovery
no flow control
out of order delivery OK
no need to support multipoint links (e.g., polling)
1 or 2
protocol
01111110
11111111
00000011
flag
address
control
variable
info
2 or 4
CRC
1
01111110
Byte Stuff
data transparencyrequirement: data field
must be allowed to include flag pattern
<01111110>
Q: is received <01111110> data or flag?
learn/configure network
layer information
for IP: carry IP Control Protocol (IPCP)
msgs (protocol field: 8021) to
configure/learn IP address
Bits: 8
01111110
Beginning
sequence
16
Header
variable
body
16
CRC
8
01111110
ending
sequence
Error Detection
EDC= Error Detection and Correction bits (redundancy)
D = Data protected by error checking, may include header fields
Error detection not 100% reliable!
Parity Checking
Single Bit Parity:
Detect single
bit errors
Internet Checksum
Goal: detect errors (e.g., flipped bits) in
transmitted segment (note: used at transport layer)
Sender:
treat segment
contents as sequence
of 16-bit integers
checksum: addition
(1s complement
sum) of segment
contents, and take
the ones complement
of the result
sender puts
checksum value into
UDP checksum field
Receiver:
compute checksum
of received segment
check if computed
checksum equals
checksum field value:
NO -error detected
YES -no error
detected. But maybe
errors (internet
checksum not very
strong for error
detection, but simple)
M x 2k XOR R
Y: CRC
CRC Example
Goal: design P(X) such that it
is exactly divisible by C(X)
T(X) = M(X) Xk (add k zeros to
R remainder [
T(X )
]
C( X )
Go-back-N ARQ
Selective-repeat
Sliding Window
Reliable delivery: retransmission
Ordered delivery: preserve the order in
which the frames are transmitted
Receiver does not pass along (buffer) out-oforder frames
Sliding Window
LAR
Sender
LFS
SWS
Ack 1
1
Receiver
LFR
Error
Ack 2
Ack 2
3
RWS
10 11 12
Ack 4 Ack 5
Ack 2 Ack 3
Ack 6
Ack 2
7
10 11 12
LAF
SeqNumToAck
LFS-LAR<=SWS, LAF-LFR<=RWS
Finite Seq. # wraps around:
SWS < (MaxSeqNum+1)/2 when RWS=SWS to distinguish
between different incarnations of the same seq. #
LAN Technologies
Presentation
Applications
Session
Transport
TCP/UDP
Network
IP
Data link
Physical
LLC
MAC
Subnet
Physical
MAC protocol
Determines how nodes share channel, i.e., determine
when node can transmit
MAC Classification
Channel Partitioning
Random Access
When node has frame to send, transmit with the total channel
bandwidth
Taking turns
Hybrid
Hub
Client
Aloha Algorithm
Aloha Algorithm:
Nodes transmit immediately whenever they have a frame to
send
No synchronization among nodes
If collision, retransmit after random delay
random delay prevents the same frames from
colliding over and over again
collision window or vulnerable period:
frame sent at t0 collides with other frames sent in [t0-1,t0+1]
e GG k
k!
Slotted Aloha
Assumptions
all frames same size
time is divided into equal size
slots, time to transmit 1 frame
nodes start to transmit frames
only at beginning of slots
nodes are synchronized
if 2 or more nodes transmit in
slot, detect collision
Feedback channel about
whether packet is received or
not (half-duplex)
Operation
Performance of ALOHA
Non-persistent CSMA
To send data, a node first listens to the
channel to see if anyone else is transmitting.
If so, the node waits a random period of time
(instead of keeping sensing until the end of
the transmission) and repeats the algorithm.
Otherwise, it transmits a frame.
If a collision occurs, the node waits a random
amount of time and starts all over again.
1-persistent CSMA
Algorithm:
1. To send data, a node first listens to the channel to see if anyone else is
transmitting.
2. If so, the node waits (keeps sensing it) until the channel becomes idle.
Otherwise, it transmits a frame.
3. If a collision occurs, the node waits a random amount of time and starts
all over again.
P-persistent CSMA
2.
Detect collisions
Propagation Delay
A
Successful
transmission
period
Normalized Time
a
Y
a
1
Busy period
Idle period
1
Busy period
a: the ratio of
propagation
delay to packet
transmission
time
e Gt G kt
k!
Ge aG
S
G (1 2a ) e aG
Tx
Rx
CSMA/CA
Wireless LANs
How can a node detect collision if it cannot listen while
talking?
Collision Avoidance
Random Backoff (instead of 1-persistent)
Request-to-send (RTS)/clear-to-send (CTS)
CS no longer works well
Rules:
carrier
==> do not transmit
no carrier ==> OK to transmit
But the above rules do not always apply to wireless.
Z
Y
W
W finds that medium is free
and it transmits a packet to Z
no carrier ===>
/ OK to transmit
W
Z is transmitting
to W
Z
X
CTS
RTS
X
Y
- listen CTS
- wait long enough
for the transmitter
to send its data
Note: RTS/CTS does not solve exposed terminal problem. In the example above,
X can send RTS, but CTS from the responder will collide with Ys data.
Transmitter
Receiver
Other
Frame
RTS
ACK
CTS
352
304
s 10 s
s
8192 s
10
s
304
10 s
s
NAV (RTS)
NAV (CTS)
TDMA
Time Division Multiple Access (TDMA)
Fixed TDMA
access to channel in "rounds"
each station gets fixed length slot (length =
packet transmission time) in each round
unused slots go idle Not efficient
example: 6-station LAN, 1,3,4 have pkt, slots
2,5,6 idle
Dynamic TDMA
In dynamic TDMA, a scheduling algorithm dynamically
reserves a variable number of timeslots in each frame
to variable user data streams, based on the traffic
demand of each user data stream.
Negotiations (beforehand) to determine how to allocate
slots dynamically.
Modem
preamble
TDMDownlink
TDDTDMAFrame
DTDMAUplink
SALOHA
control
BurstfromAccessPoint>Mobiles
BurstfromUserA
ToAccessPoint
UserB
UserC
FDMA
Frequency bands
Spread Spectrum
Idea
spread signal over wider frequency band than
required
originally deigned to thwart jamming
Frequency Hopping
transmit over random sequence of frequencies
sender and receiver share
pseudorandom number generator
seed
1
0
1
0
LAN technologies
Ethernet
Token Ring
Wireless LAN
Ethernet Overview
History
developed by Xerox PARC in mid-1970s
roots in Aloha packet-radio network
standardized by Xerox, DEC, and Intel in 1978
similar to IEEE 802.3 standard
CSMA/CD
Evolution: Bus topology (90s) Star topology (now)
Most successful access network technology
Hub or switch
Advance
Ethernet Frame
Preamble: 8 bytes
7 bytes with pattern 10101010 followed by one byte with
pattern 10101011
used to synchronize receiver, sender clock rates
Addresses:6 bytes
if adapter receives frame with matching destination address,
or with broadcast address, it passes data in frame to net-layer
protocol, otherwise, adapter discards frame
Type: 2 bytes
indicates the higher layer protocol (mostly IP but others also
supported)
CRC: 4 bytes
Octets
Preamble
Dest
addr
Src
addr
Type
64-1518
72-1526
46-1500
Body
4
CRC
MAC Address
MAC Addresses
unique, 48-bit unicast address assigned to each adapter
example: 38:10:2b:e4:b1:02
broadcast: all 1s, ff:ff:ff:ff:ff:ff
multicast: multicast flag (the lowest bit of the 1st octet)= 1
01-00-5E-00-00-00 to 01-00-5E-7F-FF-FF for IP multicast
IP multicast group address mapped to the lower
order 23 bits of MAC address (not one-to-one
mapping)
Unique MAC address allocation administered by IEEE
manufacturer buys portion of MAC address space
the first three octets as vendor-specific
6
2
Src
Dest
Type
MAC
MAC
Data link header
Preamble
IEEE 802.3
Octets 8
Preamble
Dest
MAC
Src
MAC
Datalink Header
46-1500
Body
4
FCS
43-1497
Body
4
FCS
Length: the length of the data in the frame (excluding preamble, CRC, DLC
addresses, and the Length field itself)
Destination Service Access Point (DSAP): a pointer to a memory buffer in the
receiving station. It tells the receiving NIC in which buffer to put this
information. useful in situations where users are running multiple protocol
stacks, etc...
Source Service Access Point (SSAP)
Control: the type of LLC frame
Distinguish Ethertypes and Control field
Ethertypes value > 0x05DC (1500), Length <= 1500
Ethernet CSMA/CD
1. If sender senses channel idle, it starts to transmit
frame. If it senses channel busy, waits until
channel idle and then transmits (1-persistent
CSMA)
Jam Signal:
Goal: adapt retransmission
make sure all other
attempts to the estimated
transmitters are aware of
current # of active stations or
collision;
load
heavy load: random wait will be
32 bits
longer
Frame: 64 (preamble) +
32 (jamming sequence) = first collision: choose K from
{0,1}; delay is K512 bit (51.2
96 bits Runt Frame
s in 10 Mbps) transmission
times
after second collision: choose K
from {0,1,2,3}
after ten collisions, choose K
from {0,1,2,3,4,,1023}
Collisions
A
Worst case:
A sends at t, As frame
arrives B at t+d
B begins transmitting at t+d
and collides with As frame
B sends runt frame, the runt
frame arrives A at t+2d
To detect collision, A must
continue transmit until t+2d.
A must transmit for 2d.
Round-trip delay about 51.2
us for 2500m long Ethernet
with 4 repeater
Corresponds to 512 bits for
10 Mbps Ethernet
So min frame size 512 bits
Legacy Ethernet
10Base5
10Base2
Daisy chain
Up to 200m
Repeater
Terminator
Terminator
Transceiver
Adaptor
10 Base5 Ethernet
Gbit Ethernet
uses standard Ethernet frame format
allows for point-to-point links and shared
broadcast channels
in shared mode, CSMA/CD is used; short
distances between nodes required for
efficiency
uses hubs
Full-Duplex at 1 Gbps for point-to-point links
10 Gbps now
Ethernet Performance
Max throughput <1 as a function of span
~0.8
Thru
stable policy
(retx backoff)
Capacity Limit
Traffic
margin
Overload
region
unstable policy
(no backoff)
load lines
Normal operating
point
stable policy
(backoff too high)
Offered Traffic
Wireless LANs
802.11 a/b/g different Phy technologies
802.11 b/g: 20 MHz channel in 2.4 GHz, up
to 11 Mbps (802.11b), 54 Mbps (802.11g)
phy data rate
802.11a: 20 MHz channel in 5GHz, up to 54
Mbps phy data rate
802.11n:
130 Mbps phy data rate on 20 MHz channel
(2 x 2 MIMO)
300 Mbps phy data rate on 40 MHz channel
(channel bonding with 2 x 2 MIMO)
Todays Homework
Peterson & Davie, Chap 2, 4th ed
2.6
2.18
2.23
2.33
2.44
2.42
Download and review Ethernet and 802.11 MAC
specs, and study IEEE 802.11 Wireless LAN
Overview slides
Due 2/6
74