You are on page 1of 39

CS 6390 Advanced Computer Networks

Packet Switching

Packet Switching
3.1 Switching and Forwarding 3.2 Bridges and LAN Switches 3.3 Cell Switching (ATM)

Bridges and LAN Switches


LANs have physical limitations (e.g., 2500m) Connect two or more LANs with a bridge
accept and forward strategy level 2 connection (does not add packet header)
A B C Port 1 Bridge Port 2 X Y Z

An Ethernet switch is a multi port bridge

Transparent Bridges
How to efficiently forward frames Three principal approaches can be found:
Fixed Routing Source Routing Spanning Tree Routing (IEEE 802.1d)

The last one is in use in LANs


Bridges that execute the spanning tree algorithm are called transparent bridges

Transparent Bridges
Overall design goal: Complete transparency Plug-and-play: Self-configuring without hardware or software changes Bridges should not impact operation of existing LANs Three parts to transparent bridges: (1) Forwarding of Frames (2) Learning of Addresses (3) Spanning Tree Algorithm

(1) Frame Forwarding


Each bridge maintains a forwarding database with entries
< MAC address, port, age>
MAC address: port: age: host or group address port number of bridge aging time of entry

with interpretation:
a machine with MAC address lies in direction of the port number from the bridge. The entry is age time units old.

(1) Frame Forwarding


Assume a MAC frame arrives on port x.
Is MAC address of destination in forwarding database for ports A, B, or C ?
Port A Port B Port x

Bridge 2
Port C

Found?

Not found ? Flood the frame,

Forward the frame on the appropriate port

i.e., send the frame on all ports except port x.

(2) Address Learning (Learning Bridges)


Routing tables entries are set automatically with a simple heuristic:
The source field of a frame that arrives on a port tells which hosts are reachable from this port.

Src=x, Dest=y

Port 1 x is at Port 3 y is at Port 4 Port 2 Port 3

Port 4 Port 5 Port 6

Src=x, Dest=x Src=y, Dest=y

Src=x, Dest=y

Src=x, Dest=y

Src=x, Dest=x Src=y, Dest=y

Src=x, Dest=y

Algorithm: For each frame received, the bridge stores the source field in the forwarding database together with the port where the frame was received. All entries are deleted after some time (default is 15 seconds).
Port 1 x is at Port 3 y is at Port 4 Port 2
Src=y, Dest=x

(2) Address Learning (Learning Bridges)

Port 4 Port 5 Port 6

Src=y, Dest=x

Port 3

Example
Consider the following packets: (Src=A, Dest=F), (Src=C, Dest=A), (Src=E, Dest=C) What have the bridges learned?
Bridge 1
Port1 Port2 Port1

Bridge 2
Port2

LAN 1
A B

LAN 2
C D E

LAN 3
F

Danger of Loops
Consider the two LANs that are connected by two bridges. LAN 2 Assume host n is transmitting a frame F with unknown destination. What is happening? F F Bridges A and B flood the frame Bridge B Bridge A to LAN 2. F F Bridge B sees F on LAN 2 (with unknown destination), and copies LAN 1 the frame back to LAN 1 Bridge A does the same. F The copying continues Wheres the problem? Whats the host n solution ?

Spanning Trees / Transparent Bridges


A solution is to prevent loops in the topology IEEE 802.1d has an algorithm that organizes the bridges as spanning tree in a dynamic environment
Algorithm by Radia Perlman Note: Trees dont have loops

LAN 2
d

Bridge 3 Bridge 1

Bridge 4

LAN 5
Bridge 5

Bridges that run 802.1d are called transparent bridges Bridges exchange messages to configure the bridge (Configuration Bridge Protocol Data Unit, Configuration BPDUs) to build the tree.

LAN 1
Bridge 2

LAN 3

LAN 4

Algorhyme
I think that I shall never see A graph more lovely than a tree. A tree whose crucial property Is loop-free connectivity. A tree that must be sure to span So packets can reach every LAN. First, the root must be selected. By ID, it is elected. Least-cost paths from root are traced. In the tree, these paths are placed. A mesh is made by folks like me, Then bridges find a spanning tree. - Radia Perlman

Configuration messages (ConfM)

What do the ConfM do?


With the help of the ConfM, bridges can: Elect a single bridge as the root bridge. Calculate the distance of the shortest path to the root bridge Each LAN can determine a designated bridge, which is the bridge closest to the root. The designated bridge will forward packets towards the root bridge. Each bridge can determine a root port, the port that gives the best path to the root. Select ports to be included in the spanning tree.

Concepts
Each bridge has a unique identifier: Bridge ID
Bridge ID = { Priority : 2 bytes; Bridge MAC address: 6 bytes }
Priority is configured Bridge MAC address is lowest MAC addresses of all ports

Each port within a bridge has a unique identifier (port ID). Root Bridge: The bridge with the lowest identifier is the root of the spanning tree. Root Port: Each bridge has a root port which identifies the next hop from a bridge to the root.

Concepts
Root Path Cost: For each bridge, the cost of the mincost path to the root.
Assume it is measured in #hops to the root

Designated Bridge, Designated Port: Single bridge on a LAN that provides the minimal cost path to the root for this LAN: - if two bridges have the same cost, select the one with the lowest identifier - if the min-cost bridge has two or more ports on the LAN, select the port with the lowest identifier
Note: We assume that cost of a path is the number of hops.

Steps of Spanning Tree Algorithm


Each bridge is sending out ConfMs that contain the following information: root ID cost bridge ID port ID

root bridge (what the sender thinks it is) root path cost for sending bridge Identifies sending bridge Identifies the sending port

The transmission of ConfMs results in the distributed computation of a spanning tree The convergence of the algorithm is very quick

Ordering of Messages
We define an ordering of ConfM messages ID R1 C1 ID B1 ID P1 M1 ID R2 C2 ID B2 ID P2 M2

We say M1 advertises a better path than M2 (M1<<M2) if (R1 < R2), Or (R1 == R2) and (C1 < C2), Or (R1 == R2) and (C1 == C2) and (B1 < B2), Or (R1 == R2) and (C1 == C2) and (B1 == B2) and (P1 < P2)

Initializing the Spanning Tree Protocol


Initially, all bridges assume they are the root bridge. Each bridge B sends ConfMs of this form on its LANs from each port P: B 0 B P

Each bridge looks at the ConfMs received on all its ports and its own transmitted ConfMs. Root bridge is the smallest received root ID that has been received so far (Whenever a smaller ID arrives, the root is updated)

Operations of Spanning Tree Protocol


Each bridge B looks on all its ports for ConfMs that are better than its own ConfMs Suppose a bridge with ConfM: M1 receives a better ConfM: M2

R1 C1 B1 P1

R2 C2 B2 P2

Then it will update the ConfM to:

R2 C2+1 B1 P1
However, the new ConfM is not necessarily sent out On each bridge, the port where the best ConfM (via relation <<) was received is the root port of the bridge.

When to send a ConfM


Say, B has generated a ConfM for each port x

Cost

x
Port x

B will send this ConfM on port x only if its ConfM is better (via relation <<) than any ConfM that B received from port x.

Bridge B
Port A Port B Port C

In this case, B also assumes that it is the designated bridge for the LAN to which the port connects And port x is the designated port of that LAN

Selecting the Ports for the Spanning Tree


Each bridge makes a local decision which of its ports are part of the spanning tree Now B can decide which ports are in the spanning tree:
Bs root port is part of the spanning tree All designated ports are part of the spanning tree All other ports are not 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 not forward packets (=blocking state)

Broadcast and Multicast


Forward all broadcast/multicast frames
current practice

Alternative (will discuss later in IP Multicast lecture)


Learn when you have group members downstream Accomplished by having each member of group G send a frame to bridge multicast address with G in source field

Limitations of Bridges
Do not scale
spanning tree algorithm does not scale broadcast does not scale

Do not accommodate heterogeneity


Are used to connect LANs that use Ethernet, 802.5
Both use 48 bits for source addresses ATM cannot be supported (different addressing scheme)

Caution: beware of transparency


End hosts are not aware of bridges

Packet Switching
3.1 Switching and Forwarding 3.2 Bridges and LAN Switches 3.3 Cell Switching (ATM)

Asynchronous Transfer Mode


Asynchronous packet-oriented low-layer networking technology based on fast packetswitching of small fixed size packets
Packets are called cells 5-byte header + 48-byte payload

Connection-oriented packet-switched network Provides a single transport mechanism for integrated services traffic
Data, voice, video, images, graphics, All statistically multiplexed at ATM layer

Used in both WAN and LAN settings Signaling (connection setup) Protocol: Q.2931 Specified by ATM forum

Asynchronous Transfer Mode


No global timing relation between slots (i.e., cells) of different users, i.e., asynchronous Compared to synchronous systems (those using slots)
Better for bursty traffic asynchronous Statistical multiplexing gain - better network utilization Simple and fast hardware switching due to small fixed size

Point-to-point technology
End-to-end connection is needed using a signaling protocol

Supports bandwidth reservation for QoS guarantees

ATM Cells
53 byte fixed cells 5 bytes header & 48 byte data
Fixed-length easier to switch in hardware
simpler enables parallelism

No optimal length
if small: high header-to-data overhead if large: low utilization for small messages

Small improves queue behavior


finer-grained pre-emption point for scheduling link
maximum packet = 4KB link speed = 100Mbps transmission time = 4096 x 8/100 = 327.68us high priority packet may sit in the queue 327.68us in contrast, 53 x 8/100 = 4.24us for ATM

Near cut-through behavior Small improves latency (for voice)

ATM Layering
Three layers
ATM adaptation layer (AAL) ATM layer (53 byte cells at network layer) ATM physical layer

User data

AAL PDU

ATM cell

44 bytes

ATM Layers

Functions of ATM (Sub)Layers

ATM Network Layer (ATM Layer)


The ATM layer handles the functions of the network layer:
Moving cells from source to destination in order. Routing algorithms within ATM switches, global addressing.

Connection-oriented without acknowledgments. The basic element is the unidirectional virtual circuit or channel with fixed-size cells. Two possible interfaces:
UNI (User-Network Interface): Boundary between an ATM network and host. NNI (Network-Network Interface): Between two ATM switches (or routers).

ATM Layer Headers

ATM layer header at User-Network Interface UNI User-

HEC:

ATM layer header at Network-Network Interface NNI Network-

ATM Connection Setup/Release

ATM Adaptation Layer: Segmentation and Reassembly


ATM Adaptation Layer (AAL)
Various AAL layers (1 to 5) for different types of applications i.e. voice, video, packet data. AAL 5 is an alternative standard for packet data

AAL

AAL

ATM ATM

AAL5
Format
< 64 KB Data 0 47 bytes Pad 16 Reserved 16 Len 32 CRC-32

pad so trailer always falls at end of ATM cell Length: size of PDU (data only) CRC-32 (detects missing or mis-ordered cells) User data User data

AAL5 PDU

User data

pad trailer

ATM cell

48 bytes

48 bytes

48 bytes

ATM: network or link layer?


Vision: end-to-end transport: ATM from desktop to desktop ATM is a network technology Reality: used to connect IP backbone routers IP over ATM ATM as switched link layer, connecting IP routers

Datagram Journey in IP-over-ATM Network


at Source Host:
IP layer maps between IP, ATM dest address (using ARP) passes datagram to AAL5 AAL5 encapsulates data, segments cells, passes to ATM layer

ATM network: moves cell along VC to destination at Destination Host: AAL5 reassembles cells into original datagram if CRC OK, datagram is passed to IP

You might also like