Title: Week 1 Introduction and Data Link Layer
1Week 1Introduction and Data Link Layer
2Layers
- OSI reference model
- Each layer communicates with its peer layer
through the use of a protocol - The communication between n and n-1 is known as
an interface
3Transmission
4Reception
5Layers
- Physical Layer
- The physical later is concerned with transmitting
raw bits over a communication channel. - The design issues have to do with making sure
that when one side sends a 1 bit, it is received
by the other side as a 1 bit, not as a 0 bit. - Typical questions here ar e how many volts should
be used to represent a 1 and how many for a 0,
how many microseconds a bit lasts, whether
transmission may proceed simultaneously in both
directions, how the initial connection is
established and how it is torn down when both
sides are finished, and how many pins the network
connector has and what each pin is used for. - The design issues here deal largely with
mechanical, electrical, and procedural
interfaces, and the physical transmission medium,
which lies below the physical layer. Physical
layer design can properly be considered to be
within the domain of the electrical engineer. - Examples RS232C, X.25, Ethernet
6Layers
- Data Link Layer
- Sometimes called the link layer transmits chunks
of information across a link. - It deals with problems as checksumming to detect
data corruption coordinating the use of shared
media as in LAN (Local Area Network) and
addressing (when multiple systems are reachable
as in a LAN) - It is common for different links to implement
different data link layers and for a node to
support several data link layer protocols, one
for each of the types of links to which the node
is attached. - Example HDLC, SDLC, X.25, Ethernet, ATM.
7Layers
- Network Layer
- The network layer enables any pair of systems to
communicate with each other. - A fully connected network is one in which every
pair of nodes has a direct link between its
nodes, but this kind of topology does not scale
beyond a few nodes - Network layer must find a path through a series
of connected nodes and nodes along the path
should forward packets in the appropriate
direction. - The network layer deals with problems such as
route calculation, packet assembly and reassembly
(when different links on the path have different
maximum packet sizes), and congestion control. - Examples IP, IPX, ATM.
8Layers
- Transport Layer
- This layer provides a reliable communications
stream between a pair of systems - It deals with errors that can be introduced by
the network layer, such as lost packets,
duplicated packets, packet reordering, and
fragmentation and reassembly - It is also nice if the transport layer reacts to
congestion in the network - Example TCP
9Layers
- Session Layer
- The session layer assumes that a reliable virtual
point-to-point connection has been made and
contains specs for the dialog between the two end
systems such as dialog discipline, data grouping,
and recovery of an interrupted session. Specs are
also included for initiating and concluding a
session. Many network specs contain little or no
session specs and leave these decisions to the
applications. - Presentation Layer
- Provides transformation of data to standardize
the application interface. Also provides some
network services such as encryption, compression,
and text re-formatting. - Application Layer
- This layer plays the same role as the
'application interface' in operating systems.
Provides network services to users (applications)
of the network in a distributed processing
environment examples transaction server, file
transfer protocol, network management, electronic
mail, and terminal access to remote applications.
10PDUs and SDUs
Application
Application
APDU
PSDU
Presentation
Presentation
PPDU
SSDU
Session
Session
TSDU
SPDU
Transport
Transport
NSDU
TPDU
Network
Network
NPDU
LSDU
Data Link
Data Link
LPDU
PhSDU
Physical
Physical
PhPDU
11Service Models
- Layer n-1 can provide either a connectionless
service or connection-oriented service - Communication consists of three phases in a
CO-service - Connection setup
- Data transfer
- Connnection release
- Associated with each of these phases are two
functions - Layer n initiates the function
- Layer n-1 informs layer n that some layer n
process in some other node is requesting a
connection
12Service Models
- Services can vary in their degree of reliability
- Datagram service (also known as best-effort)
accepts data but makes no guarantees as to
delivery in that data may be lost, duplicated,
delivered out of order, or mangled. - A reliable service guarantees the data will be
delivered in the order transmitted, without
corrupting, duplication or loss.
13Examples
- In the TCP/IP protocol suite, network layer is
connectionless, TCP offers reliable
connection-oriented service, UDPs datagram
service - ATM offers a connection-oriented, unreliable
service that can be viewed as a network layer.
For IP over ATM, ATM is viewed by IP as a a data
link layer - Its good to know about layering but it should
not be taken that seriously however it is a good
learning and communication tool.
14Internet protocol stack
- application supporting network applications
- ftp, smtp, http
- transport host-host data transfer
- tcp, udp
- network routing of datagrams from source to
destination - ip, routing protocols
- link data transfer between neighboring network
elements - ppp, ethernet
- physical bits on the wire
15TCP/IP Stack
16Layering logical communication
- Each layer
- Distributed entities implement layer functions
at each node - entities perform actions, exchange messages with
peers
17Layering logical communication
- E.g. transport
- take data from app
- add addressing, reliability check info to form
datagram - send datagram to peer
- wait for peer to ack receipt
transport
transport
18Protocol layering and data
- Each layer takes data from above
- adds header information to create new data unit
- passes new data unit to layer below
source
destination
message
segment
datagram
frame
19Internet structure network of networks
- roughly hierarchical
- national/international backbone providers (NBPs)
- e.g. BBN/GTE, Sprint, ATT, IBM, UUNet
- interconnect (peer) with each other privately, or
at public Network Access Point (NAPs) - regional ISPs
- connect into NBPs
- local ISP, company
- connect into regional ISPs
regional ISP
NBP B
NBP A
regional ISP
20Tiered Networks
- A Tier 1 Network is an IP network which connects
to the entire Internet solely via Settlement Free
Interconnection, commonly known as peering. - Tier 1 - A network that peers with every other
network to reach the Internet. - Tier 2 - A network that peers with some networks,
but still purchases IP transit to reach at least
some portion of the Internet. - Tier 3 - A network that solely purchases transit
from other networks to reach the Internet.
21Routing
- In commercial network routing between autonomous
systems, hot-potato routing is the practice of
passing traffic off to another AS as quickly as
possible, thus using their network for wide-area
transit. - Cold-potato routing is the opposite, where the
originating AS holds onto the packet until it is
as near to the destination as possible.
22Global Backbone Provider
23Important Properties of a Network
- Scope - A network architecture should solve as
general a problem as possible - Scalability - Would work well with very large
networks and be also efficient with small
networks - Robustness The network should continue to
operate even if nodes or links fail - Safety barriers A fault does not spread beyond a
safety barrier, for example a router confines a
broadcast storm to a single LAN - Self-stabilization After a failure, the network
will return to normal operation without human
intervention within a reasonable time, e.g.,
routing protocols - Fault detection
- Autoconfigurability
- Tweakability
- Migration
24How
- A new network "philosophy and architecture," is
replacing the vision of an Intelligent Network.
The vision is one in which the public
communications network would be engineered for
"always-on" use, not intermittence and scarcity.
It would be engineered for intelligence at the
end-user's device, not in the network. - And the network would be engineered simply to
"Deliver the Bits" not for fancy network routing
Fundamentally, it would be a Stupid Network. - In the Stupid Network, the data would tell the
network where it needs to go. (In contrast, in a
circuit network, the network tells the data where
to go.) In a Stupid Network, the data on it would
be the boss.
25Scope of this Course
- We will study how a packet finds its way from a
source to a destination - Role of Layer 2
- Ethernet, PPP, 802.11
- Role of Layer 3
- IP Addressing
- Routing
- OSPF, BGP
- Internet architecture
- We will also study emerging trends in IP networks
- IP QoS
- MPLS (Multiprotocol Label Switching)
- Traffic Engineering
- Multimedia networking
26The Data Link Layer
- Our goals
- understand principles behind data link layer
services - error detection, correction
- sharing a broadcast channel multiple access
- link layer addressing
- reliable data transfer, flow control
- instantiation and implementation of various link
layer technologies
27Link Layer
- 5.1 Introduction and services
- 5.2 Error detection and correction
- 5.3Multiple access protocols
- 5.4 Link-Layer Addressing
- 5.5 Ethernet
- 5.6 Hubs and switches
- 5.7 PPP
- 5.8 Link Virtualization ATM and MPLS
28Link Layer Introduction
- Some terminology
- hosts and routers are nodes
- communication channels that connect adjacent
nodes along communication path are links - wired links
- wireless links
- LANs
- layer-2 packet is a frame, encapsulates datagram
data-link layer has responsibility of
transferring datagram from one node to adjacent
node over a link
29Link layer context
- transportation analogy
- trip from Princeton to Lausanne
- limo Princeton to JFK
- plane JFK to Geneva
- train Geneva to Lausanne
- tourist datagram
- transport segment communication link
- transportation mode link layer protocol
- travel agent routing algorithm
- Datagram transferred by different link protocols
over different links - e.g., Ethernet on first link, frame relay on
intermediate links, 802.11 on last link - Each link protocol provides different services
- e.g., may or may not provide reliable data
transfer over link
30Link 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!
- Reliable delivery between adjacent nodes
- seldom used on low bit error link (fiber, some
twisted pair) - wireless links high error rates
- Q why both link-level and end-end reliability?
31Link Layer Services (more)
- Flow Control
- pacing between adjacent sending and receiving
nodes - Error Detection
- errors caused by signal attenuation, noise.
- receiver detects presence of errors
- signals sender for retransmission or drops frame
- Error Correction
- receiver identifies and corrects bit error(s)
without resorting to retransmission - Half-duplex and full-duplex
- with half duplex, nodes at both ends of link can
transmit, but not at same time
32Adaptors Communicating
datagram
rcving node
link layer protocol
sending node
adapter
adapter
- receiving side
- looks for errors, rdt, flow control, etc
- extracts datagram, passes to rcving node
- adapter is semi-autonomous
- link physical layers
- link layer implemented in adaptor (aka NIC)
- Ethernet card, PCMCI card, 802.11 card
- sending side
- encapsulates datagram in a frame
- adds error checking bits, rdt, flow control, etc.
33Link Layer
- 5.1 Introduction and services
- 5.2 Error detection and correction
- 5.3Multiple access protocols
- 5.4 Link-Layer Addressing
- 5.5 Ethernet
- 5.6 Hubs and switches
- 5.7 PPP
- 5.8 Link Virtualization ATM
34Error Detection
- EDC Error Detection and Correction bits
(redundancy) - D Data protected by error checking, may
include header fields - Error detection not 100 reliable!
- protocol may miss some errors, but rarely
- larger EDC field yields better detection and
correction
35Parity Checking
Two Dimensional Bit Parity Detect and correct
single bit errors
Single Bit Parity Detect single bit errors
0
0
36Checksumming Cyclic Redundancy Check
- view data bits, D, as a binary number
- choose r1 bit pattern (generator), G
- goal choose r CRC bits, R, such that
- ltD,Rgt exactly divisible by G (modulo 2)
- receiver knows G, divides ltD,Rgt by G. If
non-zero remainder error detected! - can detect all burst errors less than r1 bits
- widely used in practice (ATM, HDCL)
37CRC Example
- Want
- D.2r XOR R nG
- equivalently
- D.2r nG XOR R
- equivalently
- if we divide D.2r by G, want remainder R
D.2r G
R remainder
38Link Layer
- 5.1 Introduction and services
- 5.2 Error detection and correction
- 5.3Multiple access protocols
- 5.4 Link-Layer Addressing
- 5.5 Ethernet
- 5.6 Hubs and switches
- 5.7 PPP
- 5.8 Link Virtualization ATM
39Multiple Access Links and Protocols
- Two types of links
- point-to-point
- PPP for dial-up access
- point-to-point link between Ethernet switch and
host - broadcast (shared wire or medium)
- traditional Ethernet
- upstream HFC
- 802.11 wireless LAN
40Multiple 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! - no out-of-band channel for coordination
41Ideal Mulitple 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
42MAC 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
43Channel 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 - TDM (Time Division Multiplexing) channel divided
into N time slots, one per user inefficient with
low duty cycle users and at light load. - FDM (Frequency Division Multiplexing) frequency
subdivided.
44Channel Partitioning MAC protocols FDMA
- FDMA frequency division multiple access
- 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 - TDM (Time Division Multiplexing) channel divided
into N time slots, one per user inefficient with
low duty cycle users and at light load. - FDM (Frequency Division Multiplexing) frequency
subdivided.
time
frequency bands
45Random 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, CSMA/CD, CSMA/CA
46Slotted 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, all nodes
detect collision
- Operation
- when node obtains fresh frame, it transmits in
next slot - no collision, node can send new frame in next
slot - if collision, node retransmits frame in each
subsequent slot with prob. p until success
47Slotted ALOHA
- Pros
- single active node can continuously transmit at
full rate of channel - highly decentralized only slots in nodes need to
be in sync - simple
- Cons
- collisions, wasting slots
- idle slots
- nodes may be able to detect collision in less
than time to transmit packet - clock synchronization
48Slotted Aloha efficiency
- For max efficiency with N nodes, find p that
maximizes Np(1-p)N-1 - For many nodes, take limit of Np(1-p)N-1 as N
goes to infinity, gives 1/e .37
Efficiency is the long-run fraction of
successful slots when there are many nodes, each
with many frames to send
- Suppose N nodes with many frames to send, each
transmits in slot with probability p - prob that node 1 has success in a slot
p(1-p)N-1 - prob that any node has a success Np(1-p)N-1
-
At best channel used for useful transmissions
37 of time!
49CSMA (Carrier Sense Multiple Access)
- CSMA listen before transmit
- If channel sensed idle transmit entire frame
- If channel sensed busy, defer transmission
- Human analogy dont interrupt others!
50CSMA collisions
spatial layout of nodes
collisions can still occur propagation delay
means two nodes may not hear each others
transmission
collision entire packet transmission time wasted
note role of distance propagation delay in
determining collision probability
51CSMA/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 - human analogy the polite conversationalist
52CSMA/CD collision detection
53Taking 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!
54Taking Turns MAC protocols
- Token passing
- control token passed from one node to next
sequentially. - token message
- concerns
- token overhead
- latency
- single point of failure (token)
-
- Polling
- master node invites slave nodes to transmit in
turn - concerns
- polling overhead
- latency
- single point of failure (master)
55 Summary of MAC protocols
- What do you do with a shared media?
- Channel Partitioning, by time, frequency or code
- Time Division, Frequency Division
- Random partitioning (dynamic),
- ALOHA, S-ALOHA, CSMA, CSMA/CD
- carrier sensing easy in some technologies
(wire), hard in others (wireless) - CSMA/CD used in Ethernet
- CSMA/CA used in 802.11
- Taking Turns
- polling from a central site, token passing
56LAN technologies
- Data link layer so far
- services, error detection/correction, multiple
access - Next LAN technologies
- addressing
- Ethernet
- hubs, switches
- PPP
57Link Layer
- 5.1 Introduction and services
- 5.2 Error detection and correction
- 5.3Multiple access protocols
- 5.4 Link-Layer Addressing
- 5.5 Ethernet
- 5.6 Hubs and switches
- 5.7 PPP
- 5.8 Link Virtualization ATM
58MAC Addresses and ARP
- 32-bit IP address
- network-layer address
- used to get datagram to destination IP subnet
- MAC (or LAN or physical or Ethernet) address
- used to get datagram from one interface to
another physically-connected interface (same
network) - 48 bit MAC address (for most LANs) burned in the
adapter ROM
59LAN Addresses and ARP
Each adapter on LAN has unique LAN address
Broadcast address FF-FF-FF-FF-FF-FF
adapter
60LAN Address (more)
- MAC address allocation administered by IEEE
- manufacturer buys portion of MAC address space
(to assure uniqueness) - Analogy
- (a) MAC address like Social Security
Number - (b) IP address like postal address
- MAC flat address ? portability
- can move LAN card from one LAN to another
- IP hierarchical address NOT portable
- depends on IP subnet to which node is attached
61ARP Address Resolution Protocol
- Each IP node (Host, Router) on LAN has ARP table
- ARP Table IP/MAC address mappings for some LAN
nodes - lt IP address MAC address TTLgt
- TTL (Time To Live) time after which address
mapping will be forgotten (typically 20 min)
237.196.7.78
1A-2F-BB-76-09-AD
237.196.7.23
237.196.7.14
LAN
71-65-F7-2B-08-53
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
237.196.7.88
62ARP protocol Same LAN (network)
- A wants to send datagram to B, and Bs MAC
address not in As ARP table. - A broadcasts ARP query packet, containing B's IP
address - Dest MAC address FF-FF-FF-FF-FF-FF
- all machines on LAN receive ARP query
- B receives ARP packet, replies to A with its
(B's) MAC address - frame sent to As MAC address (unicast)
- A caches (saves) IP-to-MAC address pair in its
ARP table until information becomes old (times
out) - soft state information that times out (goes
away) unless refreshed - ARP is plug-and-play
- nodes create their ARP tables without
intervention from net administrator
63Routing to another LAN
- walkthrough send datagram from A to B via R
- assume A knows B IP
address - Two ARP tables in router R, one for each IP
network (LAN) - In routing table at source Host, find router
111.111.111.110 - In ARP table at source, find MAC address
E6-E9-00-17-BB-4B, etc
A
R
B
64- A creates datagram with source A, destination B
- A uses ARP to get Rs MAC address for
111.111.111.110 - A creates link-layer frame with R's MAC address
as dest, frame contains A-to-B IP datagram - As adapter sends frame
- Rs adapter receives frame
- R removes IP datagram from Ethernet frame, sees
its destined to B - R uses ARP to get Bs MAC address
- R creates frame containing A-to-B IP datagram
sends to B
A
R
B
65Link Layer
- 5.1 Introduction and services
- 5.2 Error detection and correction
- 5.3Multiple access protocols
- 5.4 Link-Layer Addressing
- 5.5 Ethernet
- 5.6 Hubs and switches
- 5.7 PPP
- 5.8 Link Virtualization ATM
66Ethernet
- dominant wired LAN technology
- cheap 20 for 100Mbs!
- first widely used LAN technology
- Simpler, cheaper than token LANs and ATM
- Kept up with speed race 10 Mbps 10 Gbps
Metcalfes Ethernet sketch
67Star topology
- Bus topology popular through mid 90s
- Now star topology prevails
- Connection choices hub or switch (more later)
hub or switch
68Ethernet Frame Structure
- Sending adapter encapsulates IP datagram (or
other network layer protocol packet) in Ethernet
frame - Preamble
- 7 bytes with pattern 10101010 followed by one
byte with pattern 10101011 - used to synchronize receiver, sender clock rates
69Ethernet Frame Structure (more)
- Addresses 6 bytes
- if adapter receives frame with matching
destination address, or with broadcast address
(eg ARP packet), it passes data in frame to
net-layer protocol - otherwise, adapter discards frame
- Type indicates the higher layer protocol (mostly
IP but others may be supported such as Novell IPX
and AppleTalk) - CRC checked at receiver, if error is detected,
the frame is simply dropped
70Unreliable, connectionless service
- Connectionless No handshaking between sending
and receiving adapter. - Unreliable receiving adapter doesnt send acks
or nacks to sending adapter - stream of datagrams passed to network layer can
have gaps - gaps will be filled if app is using TCP
- otherwise, app will see the gaps
71Ethernet uses CSMA/CD
- No slots
- adapter doesnt 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
72Ethernet CSMA/CD algorithm
- 1. Adaptor receives datagram from net layer
creates frame - 2. If adapter senses channel idle, it starts to
transmit frame. If it senses channel busy, waits
until channel idle and then transmits - 3. If adapter transmits entire frame without
detecting another transmission, the adapter is
done with frame !
- 4. If adapter detects another transmission while
transmitting, aborts and sends jam signal - 5. After aborting, adapter enters exponential
backoff after the mth collision, adapter chooses
a K at random from 0,1,2,,2m-1. Adapter waits
K?512 bit times and returns to Step 2 -
73Ethernets CSMA/CD (more)
- Jam Signal make sure all other transmitters are
aware of collision 48 bits - Bit time .1 microsec for 10 Mbps Ethernet for
K1023, wait time is about 50 msec -
- Exponential Backoff
- Goal adapt retransmission attempts to estimated
current load - heavy load random wait will be longer
- first collision choose K from 0,1 delay is K?
512 bit transmission times - after second collision choose K from 0,1,2,3
- after ten collisions, choose K from
0,1,2,3,4,,1023
74CSMA/CD efficiency
- Tprop max prop between 2 nodes in LAN
- ttrans time to transmit max-size frame
- Efficiency goes to 1 as tprop goes to 0
- Goes to 1 as ttrans goes to infinity
- Much better than ALOHA, but still decentralized,
simple, and cheap
75Link Layer
- 5.1 Introduction and services
- 5.2 Error detection and correction
- 5.3Multiple access protocols
- 5.4 Link-Layer Addressing
- 5.5 Ethernet
- 5.6 Interconnections Hubs and switches
- 5.7 PPP
- 5.8 Link Virtualization ATM
76Hubs
- Hubs are essentially physical-layer repeaters
- bits coming from one link go out all other links
- at the same rate
- no frame buffering
- no CSMA/CD at hub adapters detect collisions
- provides net management functionality
77Interconnecting with hubs
- Backbone hub interconnects LAN segments
- Extends max distance between nodes
- But individual segment collision domains become
one large collision domain - Cant interconnect 10BaseT 100BaseT
hub
hub
hub
hub
78Switch
- Link layer device
- stores and forwards Ethernet frames
- examines frame header and selectively forwards
frame based on MAC dest address - when frame is to be forwarded on segment, uses
CSMA/CD to access segment - transparent
- hosts are unaware of presence of switches
- plug-and-play, self-learning
- switches do not need to be configured
79Forwarding
1
3
2
- How do determine onto which LAN segment to
forward frame? - Looks like a routing problem...
80Self learning
- A switch has a switch table
- entry in switch table
- (MAC Address, Interface, Time Stamp)
- stale entries in table dropped (TTL can be 60
min) - switch learns which hosts can be reached through
which interfaces - when frame received, switch learns location of
sender incoming LAN segment - records sender/location pair in switch table
81Filtering/Forwarding
- When switch receives a frame
- index switch table using MAC dest address
- if entry found for destinationthen
- if dest on segment from which frame arrived
then drop the frame - else forward the frame on interface
indicated -
- else flood
-
forward on all but the interface on which the
frame arrived
82Switch example
- Suppose C sends frame to D
address
interface
switch
1
A B E G
1 1 2 3
3
2
hub
hub
hub
A
I
F
D
G
B
C
H
E
- Switch receives frame from from C
- notes in bridge table that C is on interface 1
- because D is not in table, switch forwards frame
into interfaces 2 and 3 - frame received by D
83Switch example
- Suppose D replies back with frame to C.
address
interface
switch
A B E G C
1 1 2 3 1
hub
hub
hub
A
I
F
D
G
B
C
H
E
- Switch receives frame from from D
- notes in bridge table that D is on interface 2
- because C is in table, switch forwards frame only
to interface 1 - frame received by C
84Switch traffic isolation
- switch installation breaks subnet into LAN
segments - switch filters packets
- same-LAN-segment frames not usually forwarded
onto other LAN segments - segments become separate collision domains
collision domain
collision domain
collision domain
85Switches dedicated access
- Switch with many interfaces
- Hosts have direct connection to switch
- No collisions full duplex
- Switching A-to-A and B-to-B simultaneously, no
collisions
A
C
B
switch
C
B
A
86More on Switches
- cut-through switching frame forwarded from input
to output port without first collecting entire
frame - slight reduction in latency
- combinations of shared/dedicated, 10/100/1000
Mbps interfaces
87Institutional network
mail server
to external network
web server
router
switch
IP subnet
hub
hub
hub
88How does the IP router different from an Ethernet
switch?
IP Router
Host C
PCs with Ethernet Network Interface Cards (NICs)
- An IP Router is a packet switch whose line
cards demutliplex out IP datagrams and forward
packets based on destination IP address and
routing table entries
89IP Router vs Ethernet Switch
90Difference between Ethernet switch and IP router
- Data plane - as packets arrive
- Ethernet switch
- Exact match of destination MAC address of
incoming packet with destination column entry in
routing table - If there is no match, flood packet to all ports
in the forwarding state - IP router
- Longest-prefix match - notion of subnet mask
- Default entry match
- If no default entry, drop packet
91Difference between Ethernet switch and IP router
- Data plane - as packets arrive
- Ethernet switch
- Does not change MAC header
- IP router
- Fields in the IP header are changed, such as TTL
92Difference between Ethernet switch and IP router
- Addressing
- Ethernet switch
- Flat 6-byte addressing
- Routing tables will be very large because of flat
addressing - IP router
- Hierarchical 4-byte (IPv4) and 16-byte (IPv6)
- Advantage address summarization used to decrease
the number of entries in the routing table
93Difference between Ethernet switch and IP router
- Routing protocol
- Ethernet switch
- Address learning
- Spanning tree algorithm - "default" ports
- IP router
- OSPF link-state protocol
- RIP, BGP distance-vector protocols
94Difference between Ethernet switch and IP router
- Ethernet switches
- Characteristics like flooding packets and flat
addressing makes these packet switches - Suitable for Local Area Networks (LANs)
- Hence, used within enterprises
- IP routers
- Characteristics like default entry and
hierarchical addressing (with subnet masks) makes
these packet switches - Suitable for Wide Area Networks (WANs)
95An important difference between Ethernet switch
and IP router
- Ethernet switches
- Plug-and-play
- MAC addresses are hardwired into interfaces (NICs
and switches' links) - IP routers
- Needs some administration
- Configure IP addresses of interfaces
- Default router setting
96"Routing protocol" in Ethernet switches(IEEE
802.1D)
- Address learning
- Spanning tree algorithm
- Two points to note
- The word "bridge" is used here since these
protocols are run on generic bridges (that
interconnect any two types of IEEE 802 LANs) - Current-day interest Ethernet switches run this
protocol - A network with a hub is shown as a single line.
Assume that multiple hosts are connected to each
hub
M. Veeraraghavan (originals by J. Liebeherr)
97Operation of transparent bridges
- Three aspects of bridge (switch) operation
- (1) Forwarding of Frames
- (2) Learning of Addresses
- (3) Spanning Tree Algorithm
- Bridges that run spanning-tree algorithm and have
address learning are essentially connectionless
packet switches because they perform packet
forwarding from one link to another based on
destination addresses carried in the headers of
incoming packets - use the term bridge and switch
interchangeably - use the term frame and packet
interchangeably - The term transparent refers to the fact that
the hosts are completely unaware of the presence
of bridges in the network - Introduction of a bridge does not require hosts
to be configured.
98Routing table (called filtering database in
Ethernet switches)
- Each bridge maintains a filtering database
(routing table) with entries - lt MAC address, portgt
- MAC address identifies host network interface
card (NIC) - port output port number of bridge
99Frame Forwarding
- Assume an Ethernet frame arrives on port x.
Search if MAC address of destination is listed
for ports A, B, or C in the filtering database.
Notfound ?
Found?
Forward frame on corresponding port if different
from the port on which the frame arrived and the
port state allows it
Flood the frame, i.e., send the frame on all
ports except port x if portstates allow it.
100Forwarding conditions
- Forward the frame if and only if
- The receiving port is in a forwarding state
- The transmitting port is in a forwarding state
- Either the filtering database indicates the port
number for the destination MAC address or no such
entry is present (in which case all ports are
eligible transmission ports) - Do not transmit on port on which frame was
received - The maximum service data unit size supported by
the LAN to which the transmitting port is
connected is not exceeded (e.g., 1500 bytes for
Ethernet)
101Address Learning
- In principle, the filtering database could be set
statically (static routing) - In the 802.1 bridge, the process is made
automatic with a simple heuristic - The source address field of a frame that arrives
on a port is used by the bridge to update its
filtering database, which indicates the port
through which each host is reachable.
Hub
Bridge 2
102Address Learning
- Algorithm
- For each frame received, the bridge stores the
source address field in the received frame header
into the filtering database together with the
port on which the frame was received. - All entries are deleted after some time (default
is 300 seconds).
103Example
- Consider the following packets ltSrcA, DestFgt,
ltSrcC, DestAgt, ltSrcE, DestCgt - What have the bridges learned?
104Forwarding frames and learning
Learning process writes Filtering database Frame
forwarding reads Filtering database
105Danger of Loops
- Consider the two LANs that are connected by two
bridges. - Assume host n is transmitting a frame F with
unknown destination. - What is happening?
- Bridges A and B flood the frame to LAN 2.
- Bridge B sees F on LAN 2 (with unknown
destination), and copies the frame back to LAN 1 - Bridge A does the same.
- The copying continues
- Wheres the problem? Whats the solution ?
106Spanning Trees
- IEEE 802.1 has an algorithm that builds and
maintains a spanning tree in a dynamic
environment. - Bridges exchange messages to configure the bridge
(Configuration Bridge Protocol Data Unit,
Configuration BPDUs) to build the tree.
107Concept - Bridge ID
- Each bridge has a unique identifier (8 bytes)
- Bridge ID ltpriority level MAC addressgt
- Priority level 2 bytes Note that a bridge has
several MAC addresses (one for each port), but
only one ID using the MAC address of the lowest
numbered bridge port (port 1) - Each port within a bridge has a unique identifier
(port ID).
001235
5124681f34
Bridge
2
3
1
Priority 0x1241
fe64961213
Example above Bridge ID 1241fe64961213
108Concept - Root bridge of a network
- Root Bridge The bridge with the lowest
identifier is the root of the spanning tree.
1
LAN A
Bridge 2 with ID 6455421561987
1
LAN B
2
1
Root bridge is bridge 3 since it has the smallest
ID
Bridge 1 with ID 4121121561987
109Concept - For each bridge
- Root Port Each bridge has a root port which
identifies the next hop from a bridge to the
root. - Root Path Cost For each bridge, the cost of the
min-cost path to the root - Example on previous slide What is the root port
and root path cost of bridge 1 - The root port is port 2 since it leads to the
root bridge (bridge 3) - The root path cost is 1 since bridge 1 is one hop
away from the root bridge (I.e., bridge 3). - Note We assume that cost of a path is the
number of hops.
110Concept - For each LAN
- Designated Bridge, Designated Port Single bridge
on a LAN that provides the minimal cost path to
the root for this LAN, and the port on this
minimal cost path - if two bridges have the same cost, select the
one with highest priority (lower bridge ID) - if the min-cost bridge has two or more ports
on the LAN, select the port with the lowest
identifier - Example for LAN A, the designated bridge is
bridge 3 since it is the root bridge itself port
1 is the designated port for LAN B, the
designated bridge is bridge 1 since this is
closer to the root bridge than bridge 2. The
designated port is port 1.
111Concept - Designated bridge/port
- Even though each LAN is the entity that has a
designated bridge/designated port, it is each
bridge that determines whether or not it is the
designated bridge for the LAN on each of its
ports. - Example Bridge 1 in the example determines
whether it is the designated bridge for LAN A (to
which its port 2 is connected) and for LAN B (to
which its port 1 is connected). - Answer in this case is that bridge 1 is the
designated bridge for LAN B, but it is not the
designated bridge for LAN A
112Steps of Spanning Tree Algorithm
- 1. Determine the root bridge of the whole network
- 2. For all other bridges determine root ports
- 3. For all bridges, determine which of the bridge
ports are designated ports for their
corresponding LANs - The spanning tree consists of all the root ports
and the designated ports. - These ports are all set to the forwarding
state, while all other ports are in a blocked
state.
113What we just did
- We just determined the spanning tree for a
network of LANs and bridges in a centralized
manner. - We knew the bridge IDs of all the bridges and
the port IDs of all the ports in all the bridges. - We determined the root bridge (the bridge with
the smallest ID.) - For each bridge, we determined the shortest path
to the root by counting hops and thus identified
the root port. - For each bridge, we determined which of its ports
are designated ports for each of its LANs - However, the network of bridges determines the
spanning tree in a distributed manner - each
with limited knowledge. - This is done using messages called BPDUs.
114How do the bridges determine the spanning tree?
- With the help of the BPDUs, bridges can
- Elect a single bridge as the root bridge.
- Each bridge can determine
- a root port, the port that gives the best path
to the root. - And the corresponding root path cost
- Each bridge determines whether it is a designated
bridge, for the LANs connected to each of its
ports. The designated bridge will forward packets
towards the root bridge. - Select ports to be included in the spanning tree.
- Root ports and designated ports
115Short form notation for BPDUs
- Each bridge sends out BPDUs that contain the
following information
116Ordering of Messages
- We can order BPDU messages with the following
ordering relation lt" - If (R1 lt R2)
- M1 lt M2
- elseif ((R1 R2) and (C1 lt C2))
- M1 lt M2
- elseif ((R1 R2) and (C1 C2) and (B1 lt B2))
- M1 lt M2
lt
M1
M2
ID R1
C1
ID B1
ID R2
C2
ID B2
117Determine the Root Bridge
- Initially, all bridges assume they are the root
bridge. - Each bridge B sends BPDUs of this form on its
LANs - Each bridge looks at the BPDUs received on all
its ports and its own transmitted BPDUs. - Root bridge is the smallest received root ID that
has been received so far (Whenever a smaller ID
arrives, the root is updated)
B
0
B
118Calculate the Root Path CostDetermine the Root
Port
- At this time A bridge B has a belief of who the
root is, say R. - Bridge B determines the Root Path Cost (Cost) as
follows - If B R Cost 0.
- If B ? R Cost Smallest Cost in any of BPDUs
that were received from R 1 - Bs root port is the port from which B received
the lowest cost path to R. - Knowing R and Cost, B can generate its BPDU (but
will not necessarily send it out)
R
Cost
B
119Determine if the bridge is the designated bridge
for any of the LANs connected to its ports
- At this time B has generated its BPDU
- B will send this BPDU on one of its ports, say
port x, only if its BPDU is lower (via relation
lt) than any BPDU that B received from port x. - In this case, B also assumes that it is the
designated bridge for the LAN to which the port
connects.
R
Cost
B
120Selecting the Ports for the Spanning Tree
- At this time Bridge B has calculated the root
bridge for the network, its root port, root path
cost, and whether it is the designated bridge for
each of its LANs. - Now B can decide which ports are in the spanning
tree - Bs root port is part of the spanning tree
- All ports for which B is the designated bridge
are part of the spanning tree. - Bs ports that are in the spanning tree will
forward packets (forwarding state) - Bs ports that are not in the spanning tree will
block packets (blocking state)
121Adapting to Changes
- Bridges continually exchange BPDUs according to
the rules we just discussed. - This allows the bridges to adapt to changes to
the topology. - Whenever a BPDU arrives on a port, say port x, B
bridge determines - Can B become the designated bridge for the LAN
that port x is attached to? - Can port x become the root port?
122Example 1
- Assume a Bridge with ID 18 has received the
following as the lowest messages on its 4 ports
Root is 12 85 1 86 Port 2 12.86.18 For
Ports 1,3, 4
- What is the root bridge?
- What is the Root Path Cost?
- What is the root port?
- What is 18s configuration BPDU?
- For which LAN (port), if any, is B the
designated bridge?
123Example 2
- Assume a Bridge with ID 92 is receiving the
following as the lowest messages on its five
ports
- What is the root bridge?
- What is the Root Path Cost?
- What is the root port ?
- What is 92s configuration BPDU?
- For which LAN (port), if any, is Bridge 92 the
designated bridge?
124Network Example (Practice)
- The attached network shows 5 LANs that are
interconnected by 5 bridges. - The IDs of the bridges are 1,2,3,4,5 and the
port IDs are as indicated in the figure. - The bridges run the spanning tree algorithm.
- Assume that the root cost path is the number of
hops. - Assume an initial state.
- Show which messages are exchanged until the tree
is built.
125Network Example (Practice Final Answer)
- R Root ports
- D Designated ports
- Show all the BPDUs
126Failures
- Root bridge periodically transmits configuration
messages with message age 0 - Bridges receiving these messages transmit them on
the their designated ports - If the root or any bridge on the spanning tree
fails then the configuration messages will time
out - At that point, the bridge will discard the
configuration message and recalculate the root,
root path cost, and root port.
127Example
The new root port is 3
The new root port is 5
128Example
The bridge 92 will assume itself to be the root
and will transmit 92.0.92 on all five ports until
it receives fresh configuration messages from any
of its roots regarding a better root.