CHAPTER 4 THE MEDIUM ACCESS CONTROL SUBLAYER ( 介质访问子层)

131
CHAPTER 4 THE MEDIUM ACCESS CONTROL SUBLAYER ( 介介介介介介 ) The channel allocation problem The channel allocation problem Multiple access protocols Multiple access protocols 802.3: Ethernet 802.3: Ethernet 802.11: Wireless LANs 802.11: Wireless LANs 802.15: Bluetooth 802.15: Bluetooth 802.16: Broadband wireless 802.16: Broadband wireless Data link layer switching Data link layer switching

description

CHAPTER 4 THE MEDIUM ACCESS CONTROL SUBLAYER ( 介质访问子层). The channel allocation problem Multiple access protocols 802.3: Ethernet 802.11: Wireless LANs 802.15: Bluetooth 802.16: Broadband wireless Data link layer switching. THE CHANNEL ALLOCATION PROBLEM. Two types of network: - PowerPoint PPT Presentation

Transcript of CHAPTER 4 THE MEDIUM ACCESS CONTROL SUBLAYER ( 介质访问子层)

CHAPTER 4 THE MEDIUM ACCESS CONTROL SUBLAYER( 介质访问子层 ) The channel allocation problemThe channel allocation problem Multiple access protocolsMultiple access protocols 802.3: Ethernet 802.3: Ethernet 802.11: Wireless LANs802.11: Wireless LANs 802.15: Bluetooth802.15: Bluetooth 802.16: Broadband wireless802.16: Broadband wireless Data link layer switchingData link layer switching

THE CHANNEL ALLOCATION PROBLEM Two types of network: Two types of network:

Those using point-to-point connection. Those using point-to-point connection. Those using broadcast channels.Those using broadcast channels.

In any broadcast network, the key issue is how to In any broadcast network, the key issue is how to determine who gets to use the channel when there is determine who gets to use the channel when there is competition for it. competition for it. Consider a telephone conference call. Consider a telephone conference call. Broadcast channels are sometimes referred to as Broadcast channels are sometimes referred to as

multiaccess channels or random access channels. multiaccess channels or random access channels. The protocols used to determine who goes next on a The protocols used to determine who goes next on a

multiaccess channel belong to a sublayer of the data link multiaccess channel belong to a sublayer of the data link layer called the MAC (Medium Access Control). The layer called the MAC (Medium Access Control). The MAC sublayer is the bottom part of the data link layer. MAC sublayer is the bottom part of the data link layer.

The Channel Allocation Problem: Introduction How to allocate a single broadcast channel among How to allocate a single broadcast channel among

competing users (competing users ( 信道分配问题信道分配问题 )) Static channel allocation in LANs and MANsStatic channel allocation in LANs and MANs

TDMTDMFDMFDM

Dynamic channel allocation in LANs and MANsDynamic channel allocation in LANs and MANsALOHAALOHACSMACSMACollision free protocolsCollision free protocolsLimited-contention protocolsLimited-contention protocols……

The Channel Allocation Problem: Static channel allocation in LANs and MANsThe traditional way of allocating a single channel among The traditional way of allocating a single channel among

multiple competing users is Frequency Division multiple competing users is Frequency Division Multiplexing (FDM, Multiplexing (FDM, 频分多路复用频分多路复用 ). ). When there is only a small and fixed number When there is only a small and fixed number

of users, each of which has a heavy of users, each of which has a heavy (buffered) load of traffic, FDM is a simple (buffered) load of traffic, FDM is a simple and efficient allocation. and efficient allocation.

When the number of senders is large and When the number of senders is large and continuously varying or the traffic is busty, continuously varying or the traffic is busty, FDM has some problems. FDM has some problems.

The Channel Allocation Problem: Static channel allocation in LANs and MANs Mathematical analysisMathematical analysis

Similar for other static channel allocation Similar for other static channel allocation methods such as TDMmethods such as TDM

The Channel Allocation Problem: Dynamic channel allocation in LANs and MANs

Five key assumptions for the channel allocation problemFive key assumptions for the channel allocation problem Station Model (Station Model ( 站模型站模型 ). The model consists of N ). The model consists of N

independent stations, each with a program or user that independent stations, each with a program or user that generates frames for transmission. generates frames for transmission.

Single channel assumptionSingle channel assumption ((单信道假设单信道假设)) . A single . A single channel is available for all communication. Collision channel is available for all communication. Collision assumption (assumption ( 冲突假设冲突假设 ).).

Time assumption (Time assumption ( 时间假设时间假设 ): ): ((a) Continuous Time.a) Continuous Time.(b) Slotted Time.(b) Slotted Time.

Carrier assumption (Carrier assumption ( 载波假设载波假设 ): ): (a) Carrier Sense.(a) Carrier Sense.(b) No Carrier Sense.(b) No Carrier Sense.

MULTIPLE ACCESS PROTOCOLS

ALOHAALOHA Carrier Sense Multiple Access With ContentionCarrier Sense Multiple Access With Contention Carrier Sense Multiple Access Without ContentionCarrier Sense Multiple Access Without Contention Carrier Sense Multiple Access With limited ContentionCarrier Sense Multiple Access With limited Contention Wavelength Division Multiple Access ProtocolsWavelength Division Multiple Access Protocols Wireless LAN ProtocolsWireless LAN Protocols

Multiple Access Protocols: ALOHA

Let users transmit whenever they have data to be sent. Let users transmit whenever they have data to be sent. There will be collisions and the colliding frames will be There will be collisions and the colliding frames will be

destroyed. destroyed. The sender just waits a random amount of time and The sender just waits a random amount of time and

sends it again if a frame is destroyed.sends it again if a frame is destroyed. Two types of ALOHA: Two types of ALOHA:

Pure ALOHAPure ALOHA Slotted ALOHA Slotted ALOHA

Multiple Access Protocols: ALOHA

In pure ALOHA, frames are transmitted at In pure ALOHA, frames are transmitted at completely arbitrary times.completely arbitrary times.

Multiple Access Protocols: ALOHA

Vulnerable period for the shaded frame.Vulnerable period for the shaded frame.

Multiple Access Protocols: ALOHA

Throughput versus offered traffic for ALOHA Throughput versus offered traffic for ALOHA systems.systems.

Multiple Access Protocols: Slotted ALOHA

In 1972, Roberts published a method for doubling the In 1972, Roberts published a method for doubling the capacity of an ALOHA system. capacity of an ALOHA system.

The vulnerable period is halved for Slotted ALOHAThe vulnerable period is halved for Slotted ALOHA. . Small increases in the channel load can drastically Small increases in the channel load can drastically

reduce its performance. reduce its performance. Note: Protocols that are perfectly valid fall into disuse Note: Protocols that are perfectly valid fall into disuse

for political reasons, but years later some clever person for political reasons, but years later some clever person realizes that a long-discarded protocol solves his current realizes that a long-discarded protocol solves his current problem. problem. Study many protocols that are in current use.Study many protocols that are in current use. Study a number of elegant protocols that are not Study a number of elegant protocols that are not

currently in widespread use, but might easily be used currently in widespread use, but might easily be used in future applications. in future applications.

Multiple Access Protocols: CSMA with Contention

With stations transmitting at will, without paying attention With stations transmitting at will, without paying attention to what the other stations are doing, there are bound to be to what the other stations are doing, there are bound to be many collisions. many collisions.

poor channel utilization. poor channel utilization. If stations can detect what other stations are doing and adapt If stations can detect what other stations are doing and adapt

their behavior accordingly, their behavior accordingly,

better channel utilization. better channel utilization. Protocols in which stations listen for a carrier and act Protocols in which stations listen for a carrier and act

accordingly are called carrier sense multiple access accordingly are called carrier sense multiple access protocols (CSMA Protocols, protocols (CSMA Protocols, 载波侦听多点接入协议载波侦听多点接入协议 ). ).

Multiple Access Protocols: CSMA with Contention

Persistent CSMA (Carrier Sense Multiple Access)Persistent CSMA (Carrier Sense Multiple Access)

Nonpersistent CSMANonpersistent CSMA

p-persistent CSMAp-persistent CSMA

CSMA with Collision DetectionCSMA with Collision Detection

Multiple Access Protocols: CSMA with Contention: Persistent CSMA

When a station has data to send, it first listens to the channel When a station has data to send, it first listens to the channel to see if anyone else is transmitting at that moment. to see if anyone else is transmitting at that moment. If the station detects an idle channel, it transmits a If the station detects an idle channel, it transmits a

frame.frame. If the channel is busy, the station waits until it If the channel is busy, the station waits until it

becomes idle.becomes idle. If a collision occurs (If a collision occurs (??), the station waits a random ), the station waits a random

amount of time and starts all over again. amount of time and starts all over again.

The protocol is called The protocol is called 1-persistent1-persistent because the station because the station transmits with a probability of 1 whenever it finds the transmits with a probability of 1 whenever it finds the channel idle.channel idle.

Multiple Access Protocols: CSMA with Contention: Persistent CSMA

DiscussionDiscussion The propagation delay has an important effect on the The propagation delay has an important effect on the

performance of the protocol performance of the protocol There is a small chance that just after a station begins There is a small chance that just after a station begins

sending, another station will become ready to send sending, another station will become ready to send and sense the channel. If the first station’s signal has and sense the channel. If the first station’s signal has not yet reached the second one, the latter will sense an not yet reached the second one, the latter will sense an idle channel and will also begin sending, resulting in a idle channel and will also begin sending, resulting in a collision. collision.

Even if the propagation delay is zero, there will still be Even if the propagation delay is zero, there will still be collisions. collisions.

Better than ALOHA Better than ALOHA

Multiple Access Protocols: CSMA with Contention: Non-persistent CSMA Before sending, a station senses the channel. Before sending, a station senses the channel.

If no one else is sending, the station begins doing so If no one else is sending, the station begins doing so itself. itself.

If the channel is already in use, the station If the channel is already in use, the station does notdoes not continually sense it for the purpose of seizing it continually sense it for the purpose of seizing it immediately upon detecting the end of the previous immediately upon detecting the end of the previous transmission. Instead, it waits a random period of transmission. Instead, it waits a random period of time and then repeats the algorithm. time and then repeats the algorithm.

DiscussionDiscussion better channel utilization than 1-persistent CSMA better channel utilization than 1-persistent CSMA longer delays than 1-persistent CSMAlonger delays than 1-persistent CSMA

Multiple Access Protocols: CSMA with Contention: p-persistent CSMA

When a station becomes ready to send, it senses the channel. When a station becomes ready to send, it senses the channel. If it is idle, it transmits with a probability If it is idle, it transmits with a probability pp. With a . With a

probability probability q=1-pq=1-p, it defers until the next slot. If that slot , it defers until the next slot. If that slot is also idle, it either transmits or defers again, with is also idle, it either transmits or defers again, with probabilities probabilities pp and and qq. .

This process is repeated until either the frame has been This process is repeated until either the frame has been transmitted or another station has begun transmitting. transmitted or another station has begun transmitting.

If the station initially senses the channel busy, it waits If the station initially senses the channel busy, it waits until the next slot and applies the above algorithm.until the next slot and applies the above algorithm.

Discussion Discussion Applied to slotted channels Applied to slotted channels better channel utilization than 1-persistent CSMA better channel utilization than 1-persistent CSMA

Multiple Access Protocols: CSMA with Contention: Comparison

Comparison of the channel utilization versus load Comparison of the channel utilization versus load for various random access protocols.for various random access protocols.

Multiple Access Protocols: CSMA with Contention: CSMA/CD

CSMA/CD (Carrier Sense Multiple Access with CSMA/CD (Carrier Sense Multiple Access with Collision Detection) is an improvement over CSMA. Collision Detection) is an improvement over CSMA. As soon as stations detect a collision, they stop their As soon as stations detect a collision, they stop their transmissions. transmissions.

CSMA/CD can be in one of three states: contention, CSMA/CD can be in one of three states: contention, transmission, or idle. transmission, or idle.

In the worst case a station cannot be sure that it has In the worst case a station cannot be sure that it has

seized the channel until it has transmitted for seized the channel until it has transmitted for 22ττ

without hearing a collision. Here without hearing a collision. Here ττ is the time for a is the time for a signal to propagate between the two farthest stations. signal to propagate between the two farthest stations.

Multiple Access Protocols: CSMA with Contention: CSMA/CD

CSMA/CD can be in one of three states: CSMA/CD can be in one of three states: contention, transmission, or idle.contention, transmission, or idle.

Multiple Access Protocols: CSMA without Contention: A Bit-Map Protocol Each contention period consists of exactly N slots.Each contention period consists of exactly N slots. In general, station In general, station jj may announce the fact that it has a may announce the fact that it has a

frame to send by inserting a frame to send by inserting a 11 bit into slot bit into slot jj.. After all After all NN slots have passed by, each station has slots have passed by, each station has

complete knowledge of which stations wish to transmit.complete knowledge of which stations wish to transmit. At that point, they begin transmitting in numerical At that point, they begin transmitting in numerical

order. order. Since everyone agrees on who goes next, there Since everyone agrees on who goes next, there will never by any collisionswill never by any collisions. .

After the last ready station has transmitted its frame, an After the last ready station has transmitted its frame, an event all stations can easily monitor, another event all stations can easily monitor, another NN bit bit contention period is begun. contention period is begun.

Multiple Access Protocols: CSMA without Contention: A Bit-Map Protocol

The basic bit-map protocol.The basic bit-map protocol.

Multiple Access Protocols: CSMA without Contention: A Bit-Map ProtocolPerformance analysis: Assume data frames consisting of d Performance analysis: Assume data frames consisting of d

time units where one time unit is one contention bit slot. time units where one time unit is one contention bit slot. At low load: The mean delay is At low load: The mean delay is NN slots. The overhead slots. The overhead

per frame is per frame is NN bits, and the amount of data is bits, and the amount of data is dd bits, bits, for an efficiency of for an efficiency of d/(N+d)d/(N+d). .

At high load: When all the stations have something to At high load: When all the stations have something to send all the time, the send all the time, the NN bit contention period is bit contention period is prorated over prorated over NN frames, yielding an overhead of only frames, yielding an overhead of only 11 bit per frame, or an efficiency of bit per frame, or an efficiency of d/(d+1)d/(d+1). The mean . The mean delay for a frame is equal to the sum of the time it delay for a frame is equal to the sum of the time it queues inside its station, plus an additional queues inside its station, plus an additional N(d+1)/2N(d+1)/2 once it gets to the head of its internal queue. once it gets to the head of its internal queue.

Multiple Access Protocols: CSMA without Contention: Binary Countdown

The binary countdown protocol. The binary countdown protocol.

A dash indicates silence.A dash indicates silence.

Multiple Access Protocols: CSMA with Limited-Contention Contention method Contention method

Under low load, the contention method (i.e., pure or Under low load, the contention method (i.e., pure or slotted ALOHA, CSMA) is preferable due to its low slotted ALOHA, CSMA) is preferable due to its low delay. delay.

Under high load, the contention method becomes Under high load, the contention method becomes increasingly less efficient. increasingly less efficient.

Collision-free method Collision-free method Under low load, the collision-free method has high Under low load, the collision-free method has high

delay. delay. Under high load, the collision-free method becomes Under high load, the collision-free method becomes

increasingly more efficient. increasingly more efficient. Limited-Contention ProtocolsLimited-Contention Protocols

Multiple Access Protocols: CSMA with Limited-Contention Adaptive Tree Walk ProtocolAdaptive Tree Walk Protocol

((适应数搜索协议) 适应数搜索协议) The tree for eight stations.The tree for eight stations.

Multiple Access Protocols: CSMA with Limited-Contention Adaptive Tree Walk ProtocolAdaptive Tree Walk Protocol

At what level in the tree should the search begin? At what level in the tree should the search begin? Clearly, the heavier the load, the farther down the Clearly, the heavier the load, the farther down the tree the search should begin. tree the search should begin.

Begin at Begin at i=log_2 qi=log_2 q where where qq is the estimate of the is the estimate of the number of ready stations. number of ready stations.

Numerous improvements to the basic algorithm have Numerous improvements to the basic algorithm have been discovered (Bersekas and Gallager, 1992) been discovered (Bersekas and Gallager, 1992)

Multiple Access Protocols: WDMA Protocols

WDMAWDMA (( Wavelength Division Multiple, Wavelength Division Multiple, 波分波分多路访问协议)多路访问协议) : : Divide the channel into subchannels using Divide the channel into subchannels using

WDM WDM Control channelControl channel Data channelData channel

Three servicesThree services Constant data rate connection-oriented trafficConstant data rate connection-oriented traffic Variable data rate connection-oriented trafficVariable data rate connection-oriented traffic Datagram traffic. Datagram traffic.

Multiple Access Protocols: Wavelength Division Multiple Access Protocols

Multiple Access Protocols: WDMA Protocols

Each station has two transmitters and two receivers, as Each station has two transmitters and two receivers, as follows: follows:

1.1. A fixed-wavelength receiver for listening to its own A fixed-wavelength receiver for listening to its own control channel. control channel.

2.2. A tunable transmitter for sending on other station's A tunable transmitter for sending on other station's control channel. control channel.

3.3. A fixed-wavelength transmitter for outputting data A fixed-wavelength transmitter for outputting data frames. frames.

4.4. A tunable receiver for selecting a data transmitter to A tunable receiver for selecting a data transmitter to listen to. listen to.

Multiple Access Protocols: WDMA Protocols

Consider how station A sets up a communication channel Consider how station A sets up a communication channel with station B for, say, file transfer. with station B for, say, file transfer. First, A tunes its data receiver to B's data channel and First, A tunes its data receiver to B's data channel and

waits for the status slot. waits for the status slot. Then, A picks one of the free control slots, say 4, and Then, A picks one of the free control slots, say 4, and

inserts its CONNECTION REQUEST message there. inserts its CONNECTION REQUEST message there. B sees the request and grants it and announces this in the B sees the request and grants it and announces this in the

status slot of the control channel. status slot of the control channel.

Multiple Access Protocols: WDMA Protocols

A sees the announcement, and has a connection. A sees the announcement, and has a connection. A now sends B a control message saying, for example, A now sends B a control message saying, for example,

“Please watch my next data output slot 3. There is a data “Please watch my next data output slot 3. There is a data frame for you in it.”frame for you in it.”

When B gets the control message, it tunes its receiver to When B gets the control message, it tunes its receiver to A’s output channel to read the data frame. A’s output channel to read the data frame.

Multiple Access Protocols: Wireless LAN Protocols Hidden station problem Hidden station problem ((AAB) : The problem of a B) : The problem of a

station not being able to detect a potential competitor station not being able to detect a potential competitor for the medium because the competitor is too far away. for the medium because the competitor is too far away.

Exposed station problem (BExposed station problem (BA)A)

The problem is that The problem is that before starting a transmission, a before starting a transmission, a station really wants to know whether or not there is station really wants to know whether or not there is activity around the receiver not the sender.activity around the receiver not the sender.

Multiple Access Protocols: Wireless LAN Protocols

The MACA (Multiple Access with Collision Avoidance) The MACA (Multiple Access with Collision Avoidance) protocol. protocol. (a) A sending an RTS to B.(a) A sending an RTS to B. (b) B responding with a CTS to A. (b) B responding with a CTS to A.

IEEE 802 The survivorsThe survivors

802.3 (For wired LAN)802.3 (For wired LAN) 802.11 (For wireless LAN)802.11 (For wireless LAN)

The potential onesThe potential ones 802.15 (Bluetooth)802.15 (Bluetooth) 802.16 (Wireless MAN)802.16 (Wireless MAN)

The inactive onesThe inactive ones 802.4802.4 802.5802.5 ……..

IEEE 802

IEEE 802: LLC LLCLLC

To hide the differences between the various kinds of To hide the differences between the various kinds of 802 networks.802 networks.

To provide a single format and interface to the To provide a single format and interface to the network layer.network layer.

IEEE 802: LLC How LLC worksHow LLC works

The network layer on the sending machine passes a The network layer on the sending machine passes a packet to LLC, using the LLC access primitives.packet to LLC, using the LLC access primitives.

The LLC sublayer adds an LLC header, containing The LLC sublayer adds an LLC header, containing sequence and acknowledgement numbers, and then sequence and acknowledgement numbers, and then passes the resulting structure into the payload field passes the resulting structure into the payload field of an 802 frame for transmission.of an 802 frame for transmission.

At the receiver, the reverse process takes place.At the receiver, the reverse process takes place. LLC provides three service options: LLC provides three service options:

unreliable datagram service, unreliable datagram service, acknowledged datagram service, acknowledged datagram service, reliable connection-oriented service. reliable connection-oriented service.

IEEE 802.3 (Ethernet) Ethernet CablingEthernet Cabling Manchester EncodingManchester Encoding The Ethernet MAC Sublayer ProtocolThe Ethernet MAC Sublayer Protocol The Binary Exponential Backoff AlgorithmThe Binary Exponential Backoff Algorithm Ethernet PerformanceEthernet Performance Switched EthernetSwitched Ethernet Fast EthernetFast Ethernet Gigabit EthernetGigabit Ethernet Retrospective on EthernetRetrospective on Ethernet

Ethernet: History The real beginning was the ALOHA system The real beginning was the ALOHA system

constructed to allow radio communication between constructed to allow radio communication between machines scattered over the Hawaiian Islands. machines scattered over the Hawaiian Islands.

Norman Abramson Norman Abramson Bob Metcalf Bob Metcalf 3Com3Com Xerox PARC built a 2.94 Mbps CSMA/CD system to Xerox PARC built a 2.94 Mbps CSMA/CD system to

connect over 100 personal workstations on a 1-km connect over 100 personal workstations on a 1-km cable. cable.

Xerox, DEC, and Intel drew up a standard for 10-Mbps Xerox, DEC, and Intel drew up a standard for 10-Mbps Ethernet. Ethernet.

802.3 standard describes a whole family of 1-persistent 802.3 standard describes a whole family of 1-persistent CSMA/CD system, running at speeds from 1 to 10-CSMA/CD system, running at speeds from 1 to 10-Mbps over various media. Mbps over various media.

Ethernet: Cabling

The most common kinds of Ethernet cabling.The most common kinds of Ethernet cabling.

Ethernet: Cabling

Three kinds of Ethernet cabling. Three kinds of Ethernet cabling.

(a) 10Base5, (b) 10Base2, (c) 10Base-T.(a) 10Base5, (b) 10Base2, (c) 10Base-T.

Ethernet: Cabling Thick EthernetThick Ethernet

TransceiverTransceiverTo transmit To transmit To receiveTo receive

Transceiver cableTransceiver cable2 pairs for data2 pairs for data2 pairs for control2 pairs for control1 pair for power supply1 pair for power supply

Interface board (controller)Interface board (controller)To frame To frame To checksumTo checksumTo flow controlTo flow control

Ethernet: Cabling

Cable topologies. Cable topologies.

(a) Linear, (b) Spine, (c) Tree, (d) Segmented.(a) Linear, (b) Spine, (c) Tree, (d) Segmented.

Ethernet: Encoding With 0 volts for a 0 bit, with 5 volts for a 1 bit.With 0 volts for a 0 bit, with 5 volts for a 1 bit.

Difficult to tell the difference between an idle sender Difficult to tell the difference between an idle sender (( 0 volts0 volts )) and a 0 bit (0 volts).and a 0 bit (0 volts).

If one station sends the bit string 0001000, others If one station sends the bit string 0001000, others might falsely interpret it as 1000000 or 01000000.might falsely interpret it as 1000000 or 01000000.

With –1 volts for a 0 bit, with 1 volts for a 1 bitWith –1 volts for a 0 bit, with 1 volts for a 1 bit A receiver may sample the signal at a slightly different A receiver may sample the signal at a slightly different

frequency than the sender used to generate itfrequency than the sender used to generate it can be out of synchronization.can be out of synchronization.

To unambiguously determine the start, end, or middle of To unambiguously determine the start, end, or middle of each bit without reference to an external clock.each bit without reference to an external clock. Manchester encodingManchester encoding Differential Manchester encodingDifferential Manchester encoding

Ethernet: EncodingManchester encoding (used by Ethernet)Manchester encoding (used by Ethernet)

0: low-high; 0: low-high; 1: high-low; 1: high-low;

Differential Manchester encoding (used by Token Ring).Differential Manchester encoding (used by Token Ring).

0: presence of transition; 1: absence of transition0: presence of transition; 1: absence of transition

Ethernet: MAC Sublayer Protocol

Frame formats. Frame formats.

(a)(a) DIX Ethernet, DIX Ethernet,

(b)(b) IEEE 802.3.IEEE 802.3.

Ethernet: MAC Sublayer Protocol Preamble: 8 bytes, containing the bit pattern 10101010, Preamble: 8 bytes, containing the bit pattern 10101010,

used for synchronizationused for synchronization Destination address and source address: 2 or 6 bytesDestination address and source address: 2 or 6 bytes

Unicast addressUnicast address Broadcast addressBroadcast address Multicast addressMulticast address

Type field or length fieldType field or length field Data: 1500 bytes (maximum), 46bytes (minimum)Data: 1500 bytes (maximum), 46bytes (minimum) Checksum: 32 bits, CRCChecksum: 32 bits, CRC

Ethernet: MAC Sublayer Protocol

Collision detection can take as long as 2 .

How long does it take to find out whether there is How long does it take to find out whether there is a collision or not?a collision or not?

Ethernet: MAC Sublayer Protocol All frames must take more than T (round-trip time) to send. All frames must take more than T (round-trip time) to send.

Too quick ( to miss the collision)Too quick ( to miss the collision) Longer than T to be sure of success. Longer than T to be sure of success.

(For a 10 Mbps LAN with a maximum length of 2500 (For a 10 Mbps LAN with a maximum length of 2500 meters and four repeaters, the T is about 50us)meters and four repeaters, the T is about 50us)

At 10 Mbps, At 10 Mbps, 1 bit takes 100ns1 bit takes 100ns500 bit 500 bit 50us 50us512 bit 512 bit 64B 64B

At 1GbpsAt 1Gbps1 bit takes 1ns1 bit takes 1ns50000 bit 50000 bit 50000ns 50000ns 50us 50us

Ethernet: The binary Exponential Backoff Algorithm Time is divided into discrete slots (51.2us).Time is divided into discrete slots (51.2us). After theAfter the 1st 1st collision, each station waits either 0 or 1 slot collision, each station waits either 0 or 1 slot

times before trying again. times before trying again. After the After the 2nd2nd collision, each station picks either 0,1,2,3 at collision, each station picks either 0,1,2,3 at

random and waits that number of slot times. random and waits that number of slot times. After After iith collisions, each station picks either 0, 1,2,…, th collisions, each station picks either 0, 1,2,…,

2^i-12^i-1 at random and waits that number of slot times. at random and waits that number of slot times. After 10 collisions, the randomization interval is frozen at After 10 collisions, the randomization interval is frozen at

a maximum of 1023 slots. a maximum of 1023 slots. After 16 collisions, the controller throws in the towel and After 16 collisions, the controller throws in the towel and

reports failure back to the computer.reports failure back to the computer. limited contention.limited contention.

Ethernet: Performance

Efficiency of Ethernet at 10 Mbps with 512-bit Efficiency of Ethernet at 10 Mbps with 512-bit slot times.slot times.

Ethernet: Switched Ethernet

A simple example of switched Ethernet.A simple example of switched Ethernet.

Ethernet: Switched Ethernet When a station wants to transmit an Ethernet When a station wants to transmit an Ethernet

frame, it outputs a standard frame to the switch. frame, it outputs a standard frame to the switch. If it is destined for one of the other stations If it is destined for one of the other stations

connected to the same card connected to the same card copying. copying. If not, If not, sent over the high-speed backplane to the sent over the high-speed backplane to the

destination station’s card.destination station’s card. What happens if two machines attached to the What happens if two machines attached to the

same plug-in card transmit frames at the same same plug-in card transmit frames at the same time?time? Collision domains.Collision domains. Buffering inputs.Buffering inputs.

Ethernet: Fast Ethernet

Two high speed Ethernet: FDDI and Fiber ChannelTwo high speed Ethernet: FDDI and Fiber Channel (Keep It Simple, Stupid)(Keep It Simple, Stupid)

IEEE 802 IEEE 802 IEEE 802.3u or Fast Ethernet (1992 ----1995)IEEE 802.3u or Fast Ethernet (1992 ----1995) IEEE 802.3z or gigabit Ethernet (1995 ----1998)IEEE 802.3z or gigabit Ethernet (1995 ----1998)

The original fast Ethernet cabling.The original fast Ethernet cabling.

Ethernet: Gigabit Ethernet

(a)(a) A two-station Ethernet. A two-station Ethernet.

(b)(b) A multistation Ethernet.A multistation Ethernet.

Ethernet: Gigabit Ethernet

Gigabit Ethernet cabling.Gigabit Ethernet cabling.

Ethernet: Comments Ethernet has been around for over 20 yearsEthernet has been around for over 20 years

Simple and flexibleSimple and flexible CheapCheap Easy to maintainEasy to maintain Ethernet works easily with TCP/IPEthernet works easily with TCP/IP

There are 3 LAN standards: There are 3 LAN standards: 802.3 (Ethernet), 802.3 (Ethernet), 802.4 (Token bus), 802.4 (Token bus), 802.5 (Token ring). 802.5 (Token ring).

They use roughly similar technology and get roughly They use roughly similar technology and get roughly similar performance. similar performance.

Ethernet: Comments802.3 (Ethernet): 802.3 (Ethernet): most widely used, simple, easy installation, low delay at low load. most widely used, simple, easy installation, low delay at low load. nondeterministic, no priorities, 64 byte minimum frame, collision nondeterministic, no priorities, 64 byte minimum frame, collision

problemproblem802.4 (802.4 (Token bus(Token bus( 令牌总线令牌总线 ) )) ) more deterministic, short minimum frames, priorities, real-time, more deterministic, short minimum frames, priorities, real-time,

multiple channels. multiple channels. a lot of analog engineering and including modems and wideband a lot of analog engineering and including modems and wideband

amplifiers, extremely complex protocol, substantial delay at low amplifiers, extremely complex protocol, substantial delay at low load, poorly suited for fiber optic implementations and a small load, poorly suited for fiber optic implementations and a small installed base of users. installed base of users.

802.5 (Token Ring(802.5 (Token Ring( 令牌环令牌环 ) )) ) Easy engineering, fully digital, priorities, excellent throughput and Easy engineering, fully digital, priorities, excellent throughput and

efficiency at high load. efficiency at high load. centralized monitor, delay at low load. centralized monitor, delay at low load. the winner is 802.3.the winner is 802.3.

IEEE 802.11 (WIRELESS LANS)

The 802.11 Protocol StackThe 802.11 Protocol Stack

The 802.11 Physical LayerThe 802.11 Physical Layer

The 802.11 MAC Sublayer ProtocolThe 802.11 MAC Sublayer Protocol

The 802.11 Frame StructureThe 802.11 Frame Structure

ServicesServices

The 802.11: Protocol Stack

Part of the 802.11 protocol stack.Part of the 802.11 protocol stack.

The 802.11: Physical Protocol

Infrared optionInfrared option

FHSS (Frequency Hopping Spread Spectrum)FHSS (Frequency Hopping Spread Spectrum) DSSS (Direct Sequence Spread Spectrum)DSSS (Direct Sequence Spread Spectrum)

OFDM (Orthogonal Frequency Division Multiplexing)OFDM (Orthogonal Frequency Division Multiplexing) HR-DSSS (High Rate Direct Sequence Spread HR-DSSS (High Rate Direct Sequence Spread

Spectrum)Spectrum)

The 802.11: Sublayer Protocol

((a) The hidden station problem.a) The hidden station problem.

(b) The exposed station problem.(b) The exposed station problem.

The 802.11: Sublayer Protocol

DCF (Distributed Coordination Function)DCF (Distributed Coordination Function) CSMA/CA (CSMA with Collision Avoidance)CSMA/CA (CSMA with Collision Avoidance)

PCF (Point Coordination Function)PCF (Point Coordination Function) The base station broadcasts a beacon frame The base station broadcasts a beacon frame

periodically. The base station can poll frames as wellperiodically. The base station can poll frames as well

DCF + PCFDCF + PCF

The 802.11: Sublayer Protocol: DCF

The use of virtual channel sensing using The use of virtual channel sensing using CSMA/CA.CSMA/CA.

The 802.11: Sublayer Protocol: DCF

A fragment burst.A fragment burst.

The 802.11: Sublayer Protocol: PCF PCF (Point Coordination Function)PCF (Point Coordination Function)

The base station broadcasts a beacon frame The base station broadcasts a beacon frame periodically. The beacon frame contains system periodically. The beacon frame contains system parameters, such as hopping sequences and dwell parameters, such as hopping sequences and dwell times (for FHSS), clock synchronization, etc. times (for FHSS), clock synchronization, etc.

The base station also invites new stations to sign up The base station also invites new stations to sign up for polling service. Once a station has signed up for for polling service. Once a station has signed up for polling service at a certain rate, it is effectively polling service at a certain rate, it is effectively guaranteed a certain fraction of the bandwidth, thus guaranteed a certain fraction of the bandwidth, thus making it possible to give quality-of-service making it possible to give quality-of-service guarantees. guarantees.

802.11 pays attention to the issue of power 802.11 pays attention to the issue of power management. management.

The 802.11: Sublayer Protocol: DCF +PCFSIFS: Short InterFrame SpacingSIFS: Short InterFrame SpacingPIFS: PCF InterFrame SpacingPIFS: PCF InterFrame SpacingDIFS: DCF InterFrame SpacingDIFS: DCF InterFrame SpacingEIFS: Extended InterFrame SpacingEIFS: Extended InterFrame Spacing

Interframe spacing in 802.11.Interframe spacing in 802.11.

The 802.11: Frame Structure The 802.11 standard defines three different classes of The 802.11 standard defines three different classes of

frames on the wire:frames on the wire: DataData Control Control ManagementManagement

The 802.11 data frameThe 802.11 data frame

The 802.11: Services Intracell Services

Authentication Deauthentication Privacy Data Delivery

Intercell Services Association Disassociation Reassociation Distribution Integration

THE 802.16 OR BROADBAND WIRELESS

Comparison of 802.11 and 802.16Comparison of 802.11 and 802.16 The 802.16 Protocol StackThe 802.16 Protocol Stack The 802.16 Physical LayerThe 802.16 Physical Layer The 802.16 MAC Sublayer ProtocolThe 802.16 MAC Sublayer Protocol The 802.16 Frame StructureThe 802.16 Frame Structure

The 802.16: Comparison 802.16 (Wireless MAN) vs 802.11 (Wireless LAN)802.16 (Wireless MAN) vs 802.11 (Wireless LAN)

802.16 provides services to fixed buildings (fixed 802.16 provides services to fixed buildings (fixed wireless), while 802.11 provides mobility service to wireless), while 802.11 provides mobility service to mobile users (mobile wireless)mobile users (mobile wireless)

802.16 can use full-duplex communication, while 802.16 can use full-duplex communication, while 802.11 avoids to keep the cost of the radios low.802.11 avoids to keep the cost of the radios low.

802.16 operates in the much higher 10-to-66 GHz 802.16 operates in the much higher 10-to-66 GHz frequency range while 802.11 uses the ISM band. frequency range while 802.11 uses the ISM band.

QOSQOS In short, 802.11 was designed to be mobile In short, 802.11 was designed to be mobile

Ethernet, whereas 802.16 was designed to be Ethernet, whereas 802.16 was designed to be wireless, but stationary, cable television. wireless, but stationary, cable television.

The 802.16: Protocol Stack

The 802.16: Physical Layer Broadband wireless needs a lot of spectrum. Broadband wireless needs a lot of spectrum.

(10-to 66GHz)(10-to 66GHz) 3 Modulation frequencies (in fact more)3 Modulation frequencies (in fact more)

For close-in subscribers, QAM-64 (6bits/baud)For close-in subscribers, QAM-64 (6bits/baud) For medium-distance subscribers, QAM-16 (with 2 For medium-distance subscribers, QAM-16 (with 2

bits/baud)bits/baud) For distance subscribers, QPSK is used (2 bits/baund)For distance subscribers, QPSK is used (2 bits/baund)

Downstream > UpstreamDownstream > Upstream To use Hamming codes to do forward error correction in To use Hamming codes to do forward error correction in

the physical layer. the physical layer.

The 802.16: Physical Layer

The 802.16 transmission environment.The 802.16 transmission environment.

The 802.16: Physical Layer

Frames and time slots for time division duplexing.Frames and time slots for time division duplexing.

The 802.16: MAC Sublayer Protocol SecuritySecurity

A subscriber connects to a base station, they perform A subscriber connects to a base station, they perform mutual authentication with RSA public-key mutual authentication with RSA public-key cryptography using X.509 certificates. cryptography using X.509 certificates.

The payloads themselves are encrypted using a The payloads themselves are encrypted using a symmetric-key system, either DES with cipher block symmetric-key system, either DES with cipher block chaining or triple DES with two keys. AES chaining or triple DES with two keys. AES (Rijndae1) is likely to be added soon. (Rijndae1) is likely to be added soon.

Integrity checking uses SHA-1. Integrity checking uses SHA-1.

The 802.16: MAC Sublayer Protocol Service ClassesService Classes

Constant bit rate serviceConstant bit rate service Real-time variable bit rate serviceReal-time variable bit rate service Non-real-time variable bit rate serviceNon-real-time variable bit rate service Best efforts serviceBest efforts service

The 802.16: Frame Structure

((a) A generic frame. (b) A bandwidth request a) A generic frame. (b) A bandwidth request frame.frame.

The 802.15 or BluetoothThe 802.15 or Bluetooth In 1994, the L.M. Ericsson company In 1994, the L.M. Ericsson company connecting its connecting its

mobile phones to other devices without cables. mobile phones to other devices without cables. Ericsson, IBM, Intel, Nokia, and Toshiba Ericsson, IBM, Intel, Nokia, and Toshiba SIG (Special Interested Group) SIG (Special Interested Group)

SIG SIG develop a wireless standard for interconnecting develop a wireless standard for interconnecting computing and communication devices and accessories computing and communication devices and accessories using short-range, low power, inexpensive wireless using short-range, low power, inexpensive wireless radiosradios

In 1999 In 1999 a 1500 page specification of V1.0. a 1500 page specification of V1.0. In 2002 In 2002 V1.1, (3 Com, Agere, Ericsson, IBM, V1.1, (3 Com, Agere, Ericsson, IBM,

Intel, Microsoft, Motorola, Nokia and Toshiba, and …).Intel, Microsoft, Motorola, Nokia and Toshiba, and …).

BluetoothBluetooth

Bluetooth ArchitectureBluetooth Architecture Bluetooth ApplicationsBluetooth Applications The Bluetooth Protocol StackThe Bluetooth Protocol Stack The Bluetooth Radio LayerThe Bluetooth Radio Layer The Bluetooth Baseband LayerThe Bluetooth Baseband Layer The Bluetooth L2CAP LayerThe Bluetooth L2CAP Layer The Bluetooth Frame StructureThe Bluetooth Frame Structure

The 802.15

IEEE WPAN (Wireless Personal Area Networks)IEEE WPAN (Wireless Personal Area Networks) 802.15 is based on Bluetooth802.15 is based on Bluetooth 802.15 covers the physical layer and data link layer802.15 covers the physical layer and data link layer 802.15 is open 802.15 is open In 2002, 802.15.1In 2002, 802.15.1

Bluetooth: Architecture Piconet: The basic unit of a Bluetooth systemPiconet: The basic unit of a Bluetooth system

A master nodeA master node Up to seven active slave nodes within a distance of Up to seven active slave nodes within a distance of

10 meters. 10 meters. Up to 255 parked notes in the net. In parked state, a Up to 255 parked notes in the net. In parked state, a

device cannot do anything except respond to an device cannot do anything except respond to an activation or beacon (activation or beacon ( 灯塔灯塔 )signal from the master.)signal from the master.

Scatternet: Multiple piconets can exist in the Scatternet: Multiple piconets can exist in the same (large) room and can even be connected same (large) room and can even be connected via a bridge node.via a bridge node.

Bluetooth: Architecture

Two piconets can be connected to form a Two piconets can be connected to form a scatternet.scatternet.

Bluetooth: Architecture

A piconet is a centralized TDM system, with the master A piconet is a centralized TDM system, with the master controlling the clock and determining which device controlling the clock and determining which device gets to communicate in which time slot. gets to communicate in which time slot. All communication is between the master and a All communication is between the master and a

slave; direct slave-slave communication is not slave; direct slave-slave communication is not possible.possible.

The reason for the master/slave design is to the The reason for the master/slave design is to the complete Bluetooth chips for under $5.complete Bluetooth chips for under $5.

Bluetooth: Application

The Bluetooth profiles/applicationsThe Bluetooth profiles/applications

Bluetooth: Application Generic access and service discovery are the basis. The Generic access and service discovery are the basis. The

rest profiles are optional.rest profiles are optional. Serial port and generic object exchangeSerial port and generic object exchange LAN access, dial-up networking, FAXLAN access, dial-up networking, FAX Cordless telephony, intercom, headsetCordless telephony, intercom, headset Object push, file transfer, synchronization. Object push, file transfer, synchronization. Why so many applications? Maybe Conway’s lawWhy so many applications? Maybe Conway’s law

The software structure mirrors the structure of The software structure mirrors the structure of the group that produced it.the group that produced it.

Bluetooth: Protocol Stack

The 802.15 version of The 802.15 version of

the Bluetooth protocol architecture.the Bluetooth protocol architecture.

Bluetooth: Protocol Stack The physical radio layer: The physical radio layer:

To deal with radio transmission and modulation.To deal with radio transmission and modulation. Many of the concerns here have to do with the goal of making the Many of the concerns here have to do with the goal of making the

system inexpensive so that it can become a mass market item. system inexpensive so that it can become a mass market item. The baseband layer: The baseband layer:

To deal with how the master controls time slots and how these To deal with how the master controls time slots and how these slots are grouped into frames. slots are grouped into frames.

Data link layerData link layer The link manager handles the establishment of logical channels The link manager handles the establishment of logical channels

between devices, including power management, authentication, between devices, including power management, authentication, and QOS. and QOS.

The logical link control adaptation protocol (L2CAP) shields the The logical link control adaptation protocol (L2CAP) shields the upper layers from the details of transmission. upper layers from the details of transmission.

Audio Audio controlcontrol

Bluetooth: Protocol Stack Middleware layerMiddleware layer

LLCLLC RFComm (Radio Frequency communication)RFComm (Radio Frequency communication) TelephonyTelephony Service discoveryService discovery

Application layerApplication layer HeadsetHeadset ……

Bluetooth: Radio Layer The radio layer moves the bits from master to slave, or The radio layer moves the bits from master to slave, or

vice versavice versa 2.4GHz ISM band2.4GHz ISM band The band is divided into 79 channels of 1MHz eachThe band is divided into 79 channels of 1MHz each To allocate the channels fairly, frequency hopping To allocate the channels fairly, frequency hopping

spread specturm is used with 1600hops/sec and a dwell spread specturm is used with 1600hops/sec and a dwell time of 625usec.time of 625usec.

The interference among 802.11 and 802.15The interference among 802.11 and 802.15

Bluetooth: Baseband Layer (MAC) To turn the raw bit stream into frames and defines some To turn the raw bit stream into frames and defines some

key formats. key formats. The frequency hopping timing. For a single 625 usec The frequency hopping timing. For a single 625 usec

time slot. time slot. 250-266 usec for becoming stable. 250-266 usec for becoming stable. 126 bits for an access code and the header. 126 bits for an access code and the header. 240 bits for data. 240 bits for data.

Two kinds of linkTwo kinds of link ACL(Asynchronous Connection-Less) ACL(Asynchronous Connection-Less) SCO(Synchronous Connection Oriented)SCO(Synchronous Connection Oriented)

Bluetooth: L2CAP Layer Three major functionsThree major functions

It accepts packets of up to 64KB from the upper It accepts packets of up to 64KB from the upper layers and breaks them into frames for transmission. layers and breaks them into frames for transmission. At the far end, the frames are reassembled into At the far end, the frames are reassembled into packets again.packets again.

It handles the multiplexing and demultiplexing of It handles the multiplexing and demultiplexing of multiple packet sources. multiple packet sources.

It handles the QOS requirements, both when links It handles the QOS requirements, both when links

are established and during normal operation.are established and during normal operation.

Bluetooth: Frame Structure

A A typicaltypical Bluetooth data frame. Bluetooth data frame.

DATA LINK LAYER SWITCHING Bridges from 802.x to 802.yBridges from 802.x to 802.y Local InternetworkingLocal Internetworking Spanning Tree BridgesSpanning Tree Bridges Source Routing BridgesSource Routing Bridges Remote BridgesRemote Bridges Virtual LANsVirtual LANs Hubs, Repeaters, Bridges, Switches, Routers, GatewaysHubs, Repeaters, Bridges, Switches, Routers, Gateways

Data Link Layer Switching: Introduction Why bridges are needed?Why bridges are needed?

Different organizations have different LANs. Different organizations have different LANs. Different locations have different LANs. Different locations have different LANs. Multiple LANs are used to accommodate the load. Multiple LANs are used to accommodate the load. Multiple LANS are used to extend the physical Multiple LANS are used to extend the physical

distance. distance. Different LANs are used to increase the reliability. Different LANs are used to increase the reliability. Different LANs are used to increase the security. Most Different LANs are used to increase the security. Most

LAN interfaces have a promiscuous mode, in which all LAN interfaces have a promiscuous mode, in which all frames are given to the computer, not those just frames are given to the computer, not those just addressed to it.addressed to it.

Data Link Layer Switching: Introduction

Multiple LANs connected by a backbone Multiple LANs connected by a backbone

to handle a total load higher than the capacity of to handle a total load higher than the capacity of

a single LAN.a single LAN.

Data Link Layer Switching: Bridges from 802.x to 802.y

Operation of a LAN bridge from 802.11 to 802.3.Operation of a LAN bridge from 802.11 to 802.3.

Data Link Layer Switching: Bridges from 802.x to 802.y Some common problems: Some common problems:

1.1. Different 802 LANs use different frame formats.Different 802 LANs use different frame formats.

2.2. Interconnected LANs do not necessarily run at the Interconnected LANs do not necessarily run at the same data rate. same data rate.

3.3. Different 802 LANs have different maximum frame Different 802 LANs have different maximum frame lengths. lengths.

4.4. Some supports encryption (802.11), some doesn’t Some supports encryption (802.11), some doesn’t (802.3)(802.3)

5.5. QOSQOS

Data Link Layer Switching: Bridges from 802.x to 802.y

The IEEE 802 frame formats. The IEEE 802 frame formats.

The drawing is not to scale.The drawing is not to scale.

Data Link Layer Switching: Local Internetworking

A configuration with four LANs and two bridges.A configuration with four LANs and two bridges.

Data Link Layer Switching: Local Internetworking The first 802 bridge is a transparent bridge or spanning The first 802 bridge is a transparent bridge or spanning

tree bridge(tree bridge( 生成树网桥生成树网桥 ). ). The bridge has a big (hash) table inside the bridge. The The bridge has a big (hash) table inside the bridge. The

table can list each possible destination and tell which table can list each possible destination and tell which output line (LAN) it belongs on. output line (LAN) it belongs on.

When a frame arrives, a bridge must decide whether to When a frame arrives, a bridge must decide whether to discard or forward it and if the latter, on which LAN to discard or forward it and if the latter, on which LAN to put the frame. put the frame.

Data Link Layer Switching: Local Internetworking The hash table for the bridgeThe hash table for the bridge

When the first bridges are first plugged in, all the When the first bridges are first plugged in, all the hash tables are empty. None of the bridges know hash tables are empty. None of the bridges know where any of the destinations are, so they use the where any of the destinations are, so they use the flooding algorithm. flooding algorithm.

As time goes on, the bridges learn where As time goes on, the bridges learn where destinations are. (destinations are. (backward learningbackward learning) )

Whenever a frame whose destination is already in Whenever a frame whose destination is already in the table arrives, its entry is updated with the current the table arrives, its entry is updated with the current time. time.

Periodically, a process in the bridge scans the hash Periodically, a process in the bridge scans the hash table and purges all entries more than a few minutes table and purges all entries more than a few minutes old.old.

Data Link Layer Switching: Local Internetworking The routing procedure for an incoming frame depends The routing procedure for an incoming frame depends

on the LAN it arrives and the LAN its destination is on. on the LAN it arrives and the LAN its destination is on. If destination and source LANs are the same, discard If destination and source LANs are the same, discard

the frame. the frame. If the destination and source LANs are different, If the destination and source LANs are different,

forward the frame. forward the frame. If the destination LAN is unknown, use flooding. If the destination LAN is unknown, use flooding.

Data Link Layer Switching: Transparent bridge

Two parallel transparent bridges.Two parallel transparent bridges.

Data Link Layer Switching: Transparent bridge

The problem if the topology contains loopsThe problem if the topology contains loops

The solution to this difficulty is for the bridges to The solution to this difficulty is for the bridges to communicate with each other and overlay the actual communicate with each other and overlay the actual topology with a spanning tree that reaches every LAN.topology with a spanning tree that reaches every LAN.

Data Link Layer Switching: Transparent bridge((a) Interconnected LANs. (b) A spanning tree covering a) Interconnected LANs. (b) A spanning tree covering

the LANs. The dotted lines are not part of the spanning the LANs. The dotted lines are not part of the spanning tree.tree.

Data Link Layer Switching: Transparent bridge How to build the spanning treeHow to build the spanning tree

The bridges have to choose one bridge to be the root The bridges have to choose one bridge to be the root of the tree. They make this choice by having each of the tree. They make this choice by having each one broadcast its serial number, installed by the one broadcast its serial number, installed by the manufacturer and guaranteed to be unique manufacturer and guaranteed to be unique worldwide. The bridge with the lowest serial number worldwide. The bridge with the lowest serial number becomes the root.becomes the root.

A tree of shortest paths from the root to every bridge A tree of shortest paths from the root to every bridge and LAN is constructed. This tree is the spanning and LAN is constructed. This tree is the spanning tree. tree.

If a bridge or LAN fails, a new one is computed. If a bridge or LAN fails, a new one is computed.

Data Link Layer Switching: Source routing bridges( 源路由选择网桥 ) Source routing assumes that the sender of each frame knows Source routing assumes that the sender of each frame knows

whether or not the destination is on its own LAN. whether or not the destination is on its own LAN. When sending a frame to a different LAN, the source When sending a frame to a different LAN, the source

machine sets the high-order bit of the source address to 1, to machine sets the high-order bit of the source address to 1, to mark it. mark it.

Furthermore, it includes in the frame header the exact path Furthermore, it includes in the frame header the exact path that the frame will follow.that the frame will follow.

A route is then a sequence of bridges, LAN, bridges, LAN, ... A route is then a sequence of bridges, LAN, bridges, LAN, ... numbers. numbers.

For source routing, every machine in the internetwork knows, or For source routing, every machine in the internetwork knows, or can find, the best path to every other machine. can find, the best path to every other machine.

Three implementationThree implementation Software; Software + hardware; HardwareSoftware; Software + hardware; Hardware

Data Link Layer Switching: Remote Bridges

Remote bridges can be usedRemote bridges can be used

to interconnect distant LANs.to interconnect distant LANs.

Data Link Layer Switching: Virtual LANs 10Base510Base510Base-T10Base-T

With 10BaseT technology, thick yellow cables With 10BaseT technology, thick yellow cables snaked through the cable ducts of many office snaked through the cable ducts of many office building. All the people in adjacent offices were put building. All the people in adjacent offices were put on the same LAN. on the same LAN. Geography trumped logic.Geography trumped logic.

With 10Base-T and Hubs, the network structure can With 10Base-T and Hubs, the network structure can reflect the organizational structure. reflect the organizational structure.

See the next slide for an exampleSee the next slide for an example

Data Link Layer Switching: Virtual LANs

A building with centralized wiring A building with centralized wiring

using hubs and a switch.using hubs and a switch.

Data Link Layer Switching: Virtual LANs Why to want multiple LANs with restricted scope? Why to want multiple LANs with restricted scope?

Security. (Promiscuous mode)Security. (Promiscuous mode) Load.Load. Broadcasting.Broadcasting.

How to dynamically move the user from one LAN to How to dynamically move the user from one LAN to another LAN?another LAN? Pulling out plugs and pushing them back in somewhere Pulling out plugs and pushing them back in somewhere

elseelse VLAN (Virtual LAN), IEEE 802.1Q standardVLAN (Virtual LAN), IEEE 802.1Q standard

Data Link Layer Switching: Virtual LANs

To setup a VLAN-based networkTo setup a VLAN-based network The network administrator decides how many VLANs The network administrator decides how many VLANs

there will be, which computers will be on which VLAN, there will be, which computers will be on which VLAN, and what the VLANs will be called. and what the VLANs will be called.

The VLANs are named by colors since it is then possible The VLANs are named by colors since it is then possible to print color diagrams showing the physical layout of to print color diagrams showing the physical layout of the machines. the machines.

To make the VLANs function correctly, configuration To make the VLANs function correctly, configuration tables have to set up in the bridges or switches. These tables have to set up in the bridges or switches. These tables tell which VLANs are accessible via which ports tables tell which VLANs are accessible via which ports (lines).(lines).

A port may be labeled with multiple VLAN colors. A port may be labeled with multiple VLAN colors.

Data Link Layer Switching: Virtual LANs

((a) Four physical LANs organized into two VLANs, gray a) Four physical LANs organized into two VLANs, gray and white, by two bridges. (b) The same 15 machines and white, by two bridges. (b) The same 15 machines organized into two VLANs by switches.organized into two VLANs by switches.

Data Link Layer Switching: Virtual LANs How do bridges and switches know what color an incoming How do bridges and switches know what color an incoming

frame is:frame is: Every port is assigned a VLAN color. Every port is assigned a VLAN color.

Not good.Not good. Every MAC address is assigned a VLAN color.Every MAC address is assigned a VLAN color.

Possible solutionPossible solution Every layer 3 protocol or IP address is assigned a VLAN Every layer 3 protocol or IP address is assigned a VLAN

color.color. Not elegant.Not elegant.

Data Link Layer Switching:The IEEE 802.1Q Standard

Transition from legacy Ethernet to VLAN-aware Transition from legacy Ethernet to VLAN-aware Ethernet. The shaded symbols are VLAN Ethernet. The shaded symbols are VLAN

aware. The empty ones are not.aware. The empty ones are not.

Data Link Layer Switching:The IEEE 802.1Q Standard

The 802.3 (legacy) and 802.1Q The 802.3 (legacy) and 802.1Q

Ethernet frame formats.Ethernet frame formats.

Data Link Layer Switching:Hubs, Repeaters, Bridges, Switches, Routers and Gateways

((a)a) Which device is in which layer. Which device is in which layer.

(b)(b) Frames, packets, and headers. Frames, packets, and headers.

Data Link Layer Switching:Hubs, Repeaters, Bridges, Switches, Routers and Gateways

Repeaters (Repeaters ( 中继器中继器 )) Repeaters are analog devices that connected to two Repeaters are analog devices that connected to two

cable segments. cable segments. A signal appearing on one of them is amplified and A signal appearing on one of them is amplified and

put out on the other. put out on the other. Repeaters don not understand packets, frames, or Repeaters don not understand packets, frames, or

headers. headers. They understand volts. They understand volts.

Data Link Layer Switching:Hubs, Repeaters, Bridges, Switches, Routers and Gateways

Hubs (Hubs ( 网络集线器网络集线器 )) A hub has a number of input lines that it joins A hub has a number of input lines that it joins

electrically. electrically. Frames arriving on any of the lines are sent out on Frames arriving on any of the lines are sent out on

all the others. all the others. If two frames arrive at the same time, they will If two frames arrive at the same time, they will

collide, just as on a coaxial cable. collide, just as on a coaxial cable. Hubs do not examine the 802 addresses or use them Hubs do not examine the 802 addresses or use them

in any way. in any way. They do not amplify the incoming signals.They do not amplify the incoming signals.

Data Link Layer Switching:Hubs, Repeaters, Bridges, Switches, Routers and Gateways

BridgesBridges (网桥)(网桥) A bridge connects two or more LANs. A bridge connects two or more LANs. When a frame arrives, software in the bridge extracts When a frame arrives, software in the bridge extracts

the destination address from the frame header and the destination address from the frame header and looks it up in a table to see where to send the frame. looks it up in a table to see where to send the frame.

A bridge may have line cards for different network A bridge may have line cards for different network types and different speeds. types and different speeds.

With a bridge, each line is its own collision domain, With a bridge, each line is its own collision domain,

in contrast to a hub.in contrast to a hub.

Data Link Layer Switching:Hubs, Repeaters, Bridges, Switches, Routers and Gateways

SwitchesSwitches ((交换机)交换机) Switches are similar to bridges in that both route on Switches are similar to bridges in that both route on

frame addresses. frame addresses. Each port is its own collision domain, switches Each port is its own collision domain, switches

never lose frames to collisions. never lose frames to collisions. If frames come in faster than they can be If frames come in faster than they can be

retransmitted, the switch may run out of buffer space retransmitted, the switch may run out of buffer space and have to start discarding frames. and have to start discarding frames.

Modern switches (Modern switches (cut-through switchcut-through switch) start ) start forwarding frames as soon as the destination header forwarding frames as soon as the destination header field has come in, but before the rest of the frame field has come in, but before the rest of the frame has arrived. has arrived.

Data Link Layer Switching:Hubs, Repeaters, Bridges, Switches, Routers and Gateways

((a) A hub. (b) A bridge. (c) a switch.a) A hub. (b) A bridge. (c) a switch.

Data Link Layer Switching:Hubs, Repeaters, Bridges, Switches, Routers and Gateways

RoutersRouters (路由)(路由) Routers use the packet header to choose an output Routers use the packet header to choose an output

line. line. Routing algorithm: RIP, OSPF, …Routing algorithm: RIP, OSPF, … QoSQoS

Data Link Layer Switching:Hubs, Repeaters, Bridges, Switches, Routers and Gateways

GatewaysGateways ((网关)网关) Transport gatewayTransport gateway

Transport gateways connects two computer that Transport gateways connects two computer that use different connection-oriented transport use different connection-oriented transport protocols. protocols.

For example, suppose a computer using the For example, suppose a computer using the connection-oriented TCP/IP protocol needs to talk connection-oriented TCP/IP protocol needs to talk to a computer using the connection-oriented ATM to a computer using the connection-oriented ATM transport protocol. The transport gateway can transport protocol. The transport gateway can copy the packets from one connection to the copy the packets from one connection to the other, reformatting them as need be.other, reformatting them as need be.

Data Link Layer Switching:Hubs, Repeaters, Bridges, Switches, Routers and Gateways

GatewaysGateways ((网关)网关) Application gateways Application gateways

Application gateways understand the format and Application gateways understand the format and contents of the data and translate messages from contents of the data and translate messages from one format to another. one format to another.

An email gateway could translate Internet An email gateway could translate Internet messages into SMS messages for mobile phones, messages into SMS messages for mobile phones, for examplefor example

SummaryChannel allocation methods and systems for a common channel.Channel allocation methods and systems for a common channel.

Homework

• 4.24.2 4.34.3 4.64.6• 4.104.10• 4.124.12• 4.174.17• 4.194.19• 4.21 4.21 • 4.224.22• 4.434.43