Chapter 5 Link Layer and LANs
- !!"#
$%&% !! " #$ &#'!& & '##! "! !&(" '&&&! "! # $)(*+,-,. //0122/ *#+,,##.!..
Computer Networking: A Top Down Approach 5th edition. Jim Kurose, Keith Ross Addison!Wesley, April 2009.
Chapter 5 Link Layer and LANs - - PowerPoint PPT Presentation
Chapter 5 Link Layer and LANs
$%&% !! " #$ &#'!& & '##! "! !&(" '&&&! "! # $)(*+,-,. //0122/ *#+,,##.!..
Computer Networking: A Top Down Approach 5th edition. Jim Kurose, Keith Ross Addison!Wesley, April 2009.
error detection, correction sharing a broadcast channel: multiple access
link layer addressing reliable data transfer, flow control: done!
hosts and routers are communication channels that
wired links wireless links
wireless links LANs
layer!2 packet is a
e.g., Ethernet on first link,
trip from Princeton to
limo: Princeton to JFK plane: JFK to Geneva train: Geneva to Lausanne
e.g., may or may not
encapsulate datagram into frame, adding header, trailer channel access if shared medium “MAC” addresses used in frame headers to identify
we learned how to do this already (chapter 3)! seldom used on low bit!error link (fiber, some twisted
wireless links: high error rates
pacing between adjacent sending and receiving nodes
errors caused by signal attenuation, noise.
receiver detects presence of errors:
receiver identifies and corrects bit error(s) without
with half duplex, nodes at both ends of link can transmit,
Ethernet card, PCMCI
implements link, physical
encapsulates datagram in
adds error checking bits,
looks for errors, rdt, flow
extracts datagram, passes
treat segment contents
compute checksum of
checksum: addition (1’s
sender puts checksum
check if computed checksum
NO ! error detected YES ! no error detected.
view data bits, D, as a binary number choose r+1 bit pattern (generator), G goal: choose r CRC bits, R, such that
receiver knows G, divides <D,R> by G. If non!zero remainder:
error detected! can detect all burst errors less than r+1 bits
can detect all burst errors less than r+1 bits
widely used in practice (Ethernet, 802.11 WiFi, ATM)
PPP for dial!up access point!to!point link between Ethernet switch and host
upstream HFC 802.11 wireless LAN
shared wire (e.g., cabled Ethernet) shared RF (e.g., 802.11 WiFi) shared RF (satellite) humans at a cocktail party (shared air, acoustical)
collision if node receives two or more signals at the same time
no out!of!band channel for coordination
no special node to coordinate transmissions no synchronization of clocks, slots
divide channel into smaller “pieces” (time slots,
allocate piece to node for exclusive use
channel not divided, allow collisions “recover” from collisions
nodes take turns, but nodes with more to send can take
frame
frequency bands FDM cable
transmit at full channel data rate R. no a priori coordination among nodes
how to detect collisions how to recover from collisions (e.g., via delayed
slotted ALOHA ALOHA CSMA, CSMA/CD, CSMA/CA
if no collision: node can
if collision: node
transmit immediately
frame sent at t0 collides with other frames sent in [t0!1,t0+1]
… choosing optimum p and then letting n !> infty ... = 1/(2e) = .18
spatial layout of nodes
collisions detected within short time colliding transmissions aborted, reducing channel
easy in wired LANs: measure signal strengths,
difficult in wireless LANs: received signal strength
share channel efficiently and fairly at high load inefficient at low load: delay in channel access,
efficient at low load: single node can fully
high load: collision overhead
master
poll data
polling overhead latency single point of
master slaves
data
T (nothing to send)
token overhead latency single point of failure
data to send) T
Time Division, Frequency Division
ALOHA, S!ALOHA, CSMA, CSMA/CD carrier sensing: easy in some technologies (wire), hard in
carrier sensing: easy in some technologies (wire), hard in
CSMA/CD used in Ethernet CSMA/CA used in 802.11
polling from central site, token passing Bluetooth, FDDI, IBM Token Ring
network!layer address used to get datagram to destination IP subnet
function: get frame from one interface to another
48 bit MAC address (for most LANs)
Broadcast address = FF!FF!FF!FF!FF!FF
1A!2F!BB!76!09!AD
= adapter
58!23!D7!FA!20!B0 0C!C4!11!6F!E3!98 71!65!F7!2B!08!53
LAN (wired or wireless)
can move LAN card from one LAN to another
address depends on IP subnet to which node is attached
1A!2F!BB!76!09!AD 137.196.7.78
< IP address; MAC address; TTL>
TTL (Time To Live): time
1A!2F!BB!76!09!AD 58!23!D7!FA!20!B0 0C!C4!11!6F!E3!98 71!65!F7!2B!08!53
LAN
137.196.7.23 137.196.7.14 137.196.7.88
A wants to send datagram
A broadcasts ARP query
dest MAC address = FF!
A caches (saves) IP!to!
soft state: information
dest MAC address = FF!
all machines on LAN
B receives ARP packet,
frame sent to A’s MAC
address (unicast)
nodes create their ARP
13+/720/8 909/2258848 ###
541//796++ 111#111#111#11 66811+42+
111#111#111#112 ###2 774/9285 ###1
111#111#111#111 4/817501
A creates IP datagram with source A, destination B A uses ARP to get R’s MAC address for 111.111.111.110 A creates link!layer frame with R's MAC address as dest,
A’s NIC sends frame R’s NIC receives frame R removes IP datagram from Ethernet frame, sees its
R uses ARP to get B’s MAC address
This is a really important example – make sure you understand!
R creates frame containing A!to!B IP datagram sends to B
13+/720/8 111#111#111#112 ###2 909/2258848 774/9285 ###1 ###
541//796++ 111#111#111#11 66811+42+
111#111#111#111 4/817501
Metcalfe’s Ethernet sketch
all nodes in same collision domain (can collide with each
active switch in center each “spoke” runs a (separate) Ethernet protocol (nodes
switch
bus: coaxial cable star
if adapter receives frame with matching destination
stream of datagrams passed to network layer can have gaps
stream of datagrams passed to network layer can have gaps
gaps will be filled if app is using TCP
Goal: adapt retransmission
heavy load: random wait
first collision: choose K from
after second collision: choose
after ten collisions, choose K
as tprop goes to 0 as ttrans goes to infinity
common MAC protocol and frame format different speeds: 2 Mbps, 10 Mbps, 100 Mbps,
different physical layer media: fiber, cable
228;9$4 228;9+< 228;9$1 228;9;< 228;98<
fiber physical layer copper (twister pair) physical layer
no need for a centralized, global clock among nodes!
bits coming in one link go out all other links at
all nodes connected to hub can collide with one
no frame buffering
no CSMA/CD at hub: host NICs detect
twisted pair hub
store, forward Ethernet frames examine incoming frame’s MAC address,
hosts are unaware of presence of switches
switches do not need to be configured
A B C’ 1 2 3 4 5 6
each link is its own collision
not possible with dumb hub
A’ B’ C switch with six interfaces (1,2,3,4,5,6) 4 5
A B C’ 1 2 3 4 5 6
(MAC address of host, interface
something like a routing
A’ B’ C switch with six interfaces (1,2,3,4,5,6) 4 5
when frame received,
A B C’ 1 2 3 4 5 6 A A’
Source: A Dest: A’
records sender/location
A’ B’ C 4 5 MAC addr interface TTL Switch table (initially empty) A 1 60
A B C’ 1 2 3 4 5 6 A A’
Source: A Dest: A’
A A’ A A’ A A’ A A’ A A’
A’ B’ C 4 5 MAC addr interface TTL Switch table (initially empty) A 1 60 A’ A
A’ 4 60
A B S1 C D F S2 S4 S3 I
B
C D E H I G
A B S1 C D F S2 S4 S3 I 1 2
B C D E H I G
to external network router mail server web server
routers: network layer devices (examine network layer
switches are link layer devices
no Media Access Control no need for explicit MAC addressing e.g., dialup link, ISDN line
e.g., dialup link, ISDN line
PPP (point!to!point protocol) HDLC: High level data link control (Data link
carry network layer data of any network layer
ability to demultiplex upwards
Q: is received <01111110> data or flag?
two 01111110 bytes in a row: discard first byte,
single 01111110: flag byte
flag byte pattern in data to send
flag byte pattern plus stuffed byte in transmitted data
for IP: carry IP Control
Virtual machines: e.g., java
Virtual machines: e.g., java IBM VM os from 1960’s/70’s
ARPAnet data!over!cable networks packet satellite network (Aloha)
addressing conventions packet formats error recovery routing
packet radio network
=% % >&' =! ?#7!.#,!'999$ 7 ! :!/54!#035046#
Internetwork layer (IP):
addressing: internetwork
appears as single, uniform entity, despite underlying local network heterogeneity
network of networks
Gateway:
“embed internetwork packets in
local packet format or extract them”
route (at internetwork level) to
next gateway
cable satellite 56K telephone modem today: ATM, MPLS
different service models, addressing, routing
just like dialup link is really part of separate
meeting timing/QoS requirements of voice, video
“next generation” telephony: technical roots in
packet!switching (fixed length packets, called
physical ATM AAL physical ATM AAL physical ATM physical ATM end system end system switch switch
data segmentation/reassembly roughly analagous to Internet transport layer
cell switching, routing
end system end system switch switch
ATM is a network
“IP over ATM” ATM as switched
analogy: TCP segment in many IP packets physical ATM AAL physical ATM AAL physical ATM physical ATM end system end system switch switch
AAL1: for CBR (Constant Bit Rate) services, e.g. circuit emulation AAL2: for VBR (Variable Bit Rate) services, e.g., MPEG video AAL5: for data (eg, IP datagrams)
AAL PDU ATM cell User data
call setup, teardown for each call before data can flow each packet carries VC identifier (not destination ID) every switch on source!dest path maintain “state” for each
link,switch resources (bandwidth, buffers) may be allocated to
link,switch resources (bandwidth, buffers) may be allocated to
long lasting connections typically: “permanent” route between to IP routers
dynamically set up on per!call basis
QoS performance guarantee for connection
Inefficient support of datagram traffic
Inefficient support of datagram traffic
SVC introduces call setup latency, processing
Why?: small payload !> short cell!creation delay
halfway between 32 and 64 (compromise!)
will change from link to link thru net
CLP = 1 implies low priority cell, can be
CLP = 1 implies low priority cell, can be
cyclic redundancy check
Header '4 generation: 8 bits CRC Cell With “unstructured” PMD sublayer, transmission
bit synchronization;
bandwidth partitions (TDM); several speeds: OC3 = 155.52 Mbps; OC12 = 622.08
ATM
ATM network Ethernet LANs Ethernet LANs
IP layer maps between IP, ATM dest address (using ARP) passes datagram to AAL5 AAL5 encapsulates data, segments cells, passes to ATM layer
AAL5 reassembles cells into original datagram if CRC OK, datagram is passed to IP
ATM network
just like IP
Ethernet LANs
borrowing ideas from Virtual Circuit (VC) approach but IP datagram still keeps IP address!
but IP datagram still keeps IP address!
%%%9
12 3
MPLS forwarding table distinct from IP forwarding
RSVP!TE forwarding possible along paths that IP alone would
use MPLS for traffic engineering
1/2
12 6
. .1
.4 .
2
2
2
error detection, correction sharing a broadcast channel: multiple access link layer addressing
Ethernet switched LANS PPP virtualized networks as a link layer: ATM, MPLS
wireless multimedia security network management