Скачать презентацию Ethernet Carrier Sense Multiple Access with Collision Detection Скачать презентацию Ethernet Carrier Sense Multiple Access with Collision Detection

0a90193882773ecdb470e3fe7ab233dd.ppt

  • Количество слайдов: 94

Ethernet Carrier Sense Multiple Access with Collision Detection Giuseppe Bianchi Ethernet Carrier Sense Multiple Access with Collision Detection Giuseppe Bianchi

Ethernet. Ancestors è Late 1960: ALOHA network ð Norman Abramson, University of Hawaii ð Ethernet. Ancestors è Late 1960: ALOHA network ð Norman Abramson, University of Hawaii ð Application: radio network among islands Distributed, uncoordinated network! ð First random mechanism Giuseppe Bianchi access (Pure aloha / Slotted aloha)

Birth of. Ethernet èMay 22, 1973: Ethernet memo ðBob Metcalfe (Xerox Palo Alto Research Birth of. Ethernet èMay 22, 1973: Ethernet memo ðBob Metcalfe (Xerox Palo Alto Research Center) ðCarrier Sense Multiple Access with Collision Detection and expo backoff ð 3 mbps speed US Patent 4. 063. 220 “Multipoint Data Communication System with Collision Detection” end 1977 Giuseppe Bianchi

On the birth of. Ethernet è [quoting from Ethernet– The definitive guide”]: è In On the birth of. Ethernet è [quoting from Ethernet– The definitive guide”]: è In late 1972, Metcalfe and his Xerox PARC colleagues developed the first experimental Ethernet system to interconnect the Xerox Alto, a personal workstation with a graphical user interface. The experimental Ethernet was used to link Altos to one another, and to servers and laser printers. The signal clock for the experimental Ethernet interface was derived from the Alto's system clock, which resulted in a data transmission rate on the experimental Ethernet of 2. 94 Mbps. Metcalfe's first experimental network was called the Alto Aloha Network. In 1973 Metcalfe changed the name to "Ethernet, " to make it clear that the system could support any computer--not just Altos-and to point out that his new network mechanisms had evolved well beyond the Aloha system. He chose to base the name on the word "ether" as a way of describing an essential feature of the system: the physical medium (i. e. , a cable) carries bits to all stations, much the same way that the old "luminiferous ether" was once thought to propagate electromagnetic waves through space. Thus, Ethernet was born. Giuseppe Bianchi

Ethernet Standardization: from DIX to 802. 3 è 1980: DIX Ethernet Standard ð DIX Ethernet Standardization: from DIX to 802. 3 è 1980: DIX Ethernet Standard ð DIX = Digital-Intel-Xerox vendor consortium ð Interoperable products from the three founding companies è 1982: Xerox relinquish “Ethernet” trademark è 1985: IEEE 802. 3 ð Ethernet becomes an IEEE 802 standard Minor modifications vs DIX standard Path towards worldwide interoperability Thick-RG 213 ð Speed: 10 mbps ð Medium: Thick coaxial, 500 mt max cable (10 BASE 5) Thin coaxial, 185 mt max cable (10 BASE 2) Network extension via repeaters (up to a max limit) Thin-RG 58 Ethernet standard: the world’s FIRST open, multi-vendor standard! Quoting Metcalfe: “the invention of Ethernet as an open, non-proprietary, industry-standard local network was perhaps even more significant than the invention of Ethernet technology itself” Giuseppe Bianchi

A note on. Ethernetterminology speed Signal method medium EXAMPLE: 100 Base-T, 1000 Base-LX, … A note on. Ethernetterminology speed Signal method medium EXAMPLE: 100 Base-T, 1000 Base-LX, … è Speed ð 10, 1000, 10 G è Signal method ð Base, Broad = RF modulated on coax » only one case: 10 BROAD 36, now obsolete è Medium ð Old notation: 2, 5 = 200/500 mt (thin/thick coax) ð More recent notation: T, Tx, T 4, T 2, FX, X, CX, SX, LX Depends on which specific twisted pair category & fibre category; Different labels (e. g. T, TX, T 4, T 2) account for different encoding details Giuseppe Bianchi

Historical. Ethernettopology bus : è Multiple Access shared transmissionmedium ð thick / thin coaxial Historical. Ethernettopology bus : è Multiple Access shared transmissionmedium ð thick / thin coaxial cable A B C A Giuseppe Bianchi D B C E D ng! wro F E F

Ethernettransceiver(10 base-5) Giuseppe Bianchi Ethernettransceiver(10 base-5) Giuseppe Bianchi

Ethernettransceiver(10 Base-2) Giuseppe Bianchi Ethernettransceiver(10 Base-2) Giuseppe Bianchi

Breakthroughidea (1990) A B C D E Multi-Port Repeater (HUB) A B Giuseppe Bianchi Breakthroughidea (1990) A B C D E Multi-Port Repeater (HUB) A B Giuseppe Bianchi F Collapsed Backbone From Bus To Star topology C D E F

Twisted. Pair revolution è 1990: 802. 3 i ð 10 BASE-T twisted pair ð Twisted. Pair revolution è 1990: 802. 3 i ð 10 BASE-T twisted pair ð Invented by Syn. Optics è Alternatives Communications ð UTP (Unshielded) è Reuse structured cabling system ð FTP (Foiled) standards 1 shield for all the cable ð Overcomes management and ð STP (Shielded): installation problems from coaxial One shield per pair cabling ð Ethernet market takes-off!! Giuseppe Bianchi

Ethernet. RJ 45 connector Giuseppe Bianchi Ethernet. RJ 45 connector Giuseppe Bianchi

Signal transmission& receptionon twistedpair è Pair 3 used for transmission è Pair 2 used Signal transmission& receptionon twistedpair è Pair 3 used for transmission è Pair 2 used for reception è Pairs 1 & 4 unused ð In 10 Base-T & 100 Base-T(x) Ethernet ð Used in 1000 Base-T Giuseppe Bianchi

Straight & crossover è RJ 45 meant to connect. PC to Hub è What Straight & crossover è RJ 45 meant to connect. PC to Hub è What About PC to PC or Hub to Hub connection? Giuseppe Bianchi

Ethernet. Frame 64 -1518 bytes 14 bytes preamble Ethernet header 6 bytes 46 -1500 Ethernet. Frame 64 -1518 bytes 14 bytes preamble Ethernet header 6 bytes 46 -1500 bytes DATA 4 bytes FCS 2 bytes Destination address. Source address Type è Preamble : ð For bit-level and frame-level synchronization è Destination address: ð Who’s this frame for (who is the intended receiver) ð Hardware address (48 bits address of the network interface card) è Source address: ð Who’s this frame from (who is the transmitter) ð Hardware address (48 bits address of the network interface card) è Type: ð Which type of information is carried by the frame (which upper layer protocol) è Frame Check Sequence ð Verifies if the frame has been received properly (not corrupted) Giuseppe Bianchi

Transmissionof bits èIdea: ðsend data + clock in the same signal! è 10 mbps Transmissionof bits èIdea: ðsend data + clock in the same signal! è 10 mbps Manchesterencoding 1 0 1 1 0 0 When a frame is being transmitted, a signal level transition occurs every 0, 2 m Allows to detect when transmissions are NOT occurring on the channel (IDLE Giuseppe Bianchi

Preamble (10 mbps) è 8 bytes ð 7 bytes preamble 7 x (1010) square Preamble (10 mbps) è 8 bytes ð 7 bytes preamble 7 x (1010) square wave @ 5 MHz for clock recovery ðLast byte: SFD (Start Frame Delimiter) 1 x (10101011) signals the start of the frame SFD bit sequence 1 0 Manchester Encoding Giuseppe Bianchi 1 0 1 1

48 bit addresses è Typicallyreferredto as ð Interface address ð Hardware address ð MAC 48 bit addresses è Typicallyreferredto as ð Interface address ð Hardware address ð MAC address è First bit: ð 0 = physical address of an interface Unicast address ð 1 = group address è Second bit: ð 0 = globally administered address Assigned by the manifacturer ð 1 = locally administered address Can be configured through driver First 24 bits: OUI (Organization Unique Identifier) (unique for each vendor) Typically written in hex e. g. : F 0 -11 -00 -4 F-A 2 -1 C Each byte transmitted from LSB to MSB 0000. 1111. 1000. 0000. 1111. 0010. 0101. 1000. 0011 mcast addresses: start with 1 (first octet LSB!) Why destination first? Station who does not match dest may ignore rest of frame! Giuseppe Bianchi

Examples Individual unicast: xy-xx-xx-xx y multiple of 4 802. 3 & 802. 4: transmitted Examples Individual unicast: xy-xx-xx-xx y multiple of 4 802. 3 & 802. 4: transmitted from LSB to MSB 802. 5 & FDDI: transmitted from MSB to LSB Giuseppe Bianchi

Multiple Access: Ethernetvs Aloha èAloha: ðTransmit without listening Regardless of channel activity ðTransmit all Multiple Access: Ethernetvs Aloha èAloha: ðTransmit without listening Regardless of channel activity ðTransmit all the frame Giuseppe Bianchi èEthernet : ðListen before transmitting Transmit only if channel idle ðListen while transmitting, and stop transmission if collision is detected

Ethernetvs Aloha: listen before tx A ALOHA B A ETHERNET B Listen before transmit Ethernetvs Aloha: listen before tx A ALOHA B A ETHERNET B Listen before transmit Giuseppe Bianchi

Ethernetvs Aloha: collisionhandling A ALOHA B Collision lasts until the end of the transmitted Ethernetvs Aloha: collisionhandling A ALOHA B Collision lasts until the end of the transmitted frames; waste of channel capacity A ETHERNET B Detect collision; enforce collision with JAM sequence; end transm Giuseppe Bianchi

Carrier Sense Multiple Access 1. Listen before talking 1. NIC ready to transmit a Carrier Sense Multiple Access 1. Listen before talking 1. NIC ready to transmit a frame 3. Transmit frame IFS 2. Listen for at least Ethernet Notation = Inter Packet Gap an Inter Frame Spacing Notation = Inter Frame Spacing(IPG) 802. 3 (IFS) (channel must be Minimum: 96 bits (@ 10 Mbps = 9. 6 ms) idle meanwhile) Giuseppe Bianchi

Carrier Sense Multiple Access 2. If channel detectedbusy: defer 1. Frame ready 3. Busy Carrier Sense Multiple Access 2. If channel detectedbusy: defer 1. Frame ready 3. Busy Detect 4. Defer 5. Listen for ≥ IFS 2. Listen (similar defer situation if channel immediately busy) Giuseppe Bianchi

Collision. Detection 3. Listen while talking è If collision detected: ðContinue to transmit other Collision. Detection 3. Listen while talking è If collision detected: ðContinue to transmit other 32 bits of signal (Collision Enforcement Jam Signal) è Collision detection: media-dependent ðOn coax: Monitor average DC voltage When more than 1 station transmits, voltage gets greater than given threshold ðOn point-to-point fiber or twisted pair links: Collision detected by the simultaneous occurrence of activity on both transmit and receive paths Giuseppe Bianchi

Why collisionsoccur? distance d (m) prop delay d/200 ms IFS Start tx IFS Detect Why collisionsoccur? distance d (m) prop delay d/200 ms IFS Start tx IFS Detect coll. Jam seq. Start tx Detect collision Jam sequence Collision occurs if stations access the channel in instants of time which differ for less than their mutual propagation delay time Speed of EM signal in cable: ~200. 000 km/s 200 m/ms Giuseppe Bianchi

When a frame is “too short”… prop delay d/200 ms IFS Start tx IFS When a frame is “too short”… prop delay d/200 ms IFS Start tx IFS Can’t detect collision!! Thinks Tx was OK Start tx Collision! Detect collision time Transmitting Station Giuseppe Bianchi Destination station Interferer

Network diameter Stations placed at opposite network edg è Essential condition : ð a Network diameter Stations placed at opposite network edg è Essential condition : ð a station MUST be able to detect a collision è Shortest possible frame: ð 6+6+2+46+4 = 64 bytes = 64 = 512 bits (excl preamble) bytes 512 bits è Condition on network frame diameter: ð a collision MUST be detected on shortest possible frame ð Bound on maximum RTT=2 x prop must be lower than 512 bits tx time @ 10 Mbps: 512/10 [ms] > 2 d [m] / 200 [m/ms] d < 5120 [m @ 100 Mbps: 512/100 [ms] > 2 d [m] / 200 [m/ms] d < 512 [m NETWORK DIAMETER REDUCES AS SPEED INCREASES Giuseppe Bianchi

Network diameterin practice è Max RTTlower than 51, 2 ms ð 802. 3 standard Network diameterin practice è Max RTTlower than 51, 2 ms ð 802. 3 standard max RTT = 46, 38 ms è Max link length ð Thick coax up to 500 mt ð Fiber link betw. repeaters up to 2 km ð Transceiver cable up to 50 mt è Topological limits ð 5 -4 -3 rule: between any two nodes on the network, there can only be a maximum of five segments connected through four repeaters only three of the five segments may contain user connections. è Repeaters add delay! ð Must account for repeater delays MAX network diameter for 10 Base-5: 2800 m Min_TX_time > 2 x d/200 + N x Repeater_delay Giuseppe Bianchi

The need for random backoff IFS A IFS B è Retransmissionafter collisionmust occur at The need for random backoff IFS A IFS B è Retransmissionafter collisionmust occur at differentinstant of times ðOtherwise collision will repeat forever è Deterministic rule? ðHard, for a fully distributed mechanism è Idea: generate a random time after a collision ðDifferent stations will extract (sooner or later) different backoff times Giuseppe Bianchi

Rationalefor backoff “slots” Detect coll & Jam Max RTT delay: < 51, 2 ms Rationalefor backoff “slots” Detect coll & Jam Max RTT delay: < 51, 2 ms Retransmit immediately (neglect IFS for simplicity Schedule Retransm After random time T… … busy channel: defer! T greater or equal than 51, 2 us NO COLLISION with another STA that has immedi T greater or equal than N x 51, 2 us NO COLLISION with another STA that rtx-ed a Giuseppe Bianchi

Backoff slot-time Remaining frame bytes First 64 bytes (up to 1518 minus 64) è Backoff slot-time Remaining frame bytes First 64 bytes (up to 1518 minus 64) è Set to 512 bits ð As minimum frame size Collision possible Collision impossible ð As maximum RTT (Late Collision) è guarantees that 1) A station transmitting at the beginning of the previous backoff slot will be ALWAYS detected; 2) A station transmitting for more than 512 bytes will acquire for sure the channel o o No “late collision” possible If they occur misconfiguration or hardware failures è Ethernet Backoff rule: extract a DISCRETE value B, and schedule transmission at time B x 51, 2 us Giuseppe Bianchi

Ethernet(truncated ) Exponentialbackoff rules è Once a frame collides : ðEnd transmission with Jam Ethernet(truncated ) Exponentialbackoff rules è Once a frame collides : ðEnd transmission with Jam signal ðLet N be the retry index N=0 for a new frame; N=1 for first rtx; N=2 for second rtx, etc ðAbort transmission after N=16 unsuccessful retries ðLet K=min(10, N) ðExtract a random integer number R in the range: 0 ≤ R < 2 K Example: if K=6, extract R in (0, 31) Max range: when K=10 R in (0, 1023) ðSchedule retransmission at time: Backoff = R x 51, 2 us (10 mbps case) » Where 51, 2 us = tx time of 512 bits @ 10 Mbps » 100 Mbps Ethernet: slot-time = 5, 12 us ðRetransmit at given time only if channel idle (otherwise defer until channel becomes idle for an IFS) Giuseppe Bianchi

Ethernet (R)Evolution From multiple access to point-to-point collision-free networks Giuseppe Bianchi Ethernet (R)Evolution From multiple access to point-to-point collision-free networks Giuseppe Bianchi

Ethernet. Repeaters è Physicallayer device è 3 R functions ð Re-Shaping Restores the proper Ethernet. Repeaters è Physicallayer device è 3 R functions ð Re-Shaping Restores the proper signal waveform ð Re-Timing Restores the proper impulse duration (clock recovery) ð Re-Transmitting Retransmits signal on “other” port Regardless of who’s the signal intended for D C R B A sends frame to B C & D receive signal, too Giuseppe Bianchi A

Repeaters& collisions è Retransmitscollisions too , ðActually, regenerates (extending them to 96 bits) 010101… Repeaters& collisions è Retransmitscollisions too , ðActually, regenerates (extending them to 96 bits) 010101… jam sequences ðAnd generates collisions when signal is received simultaneously on both ends D C R B A A sends frame to B C sends frame to D Repeater generates collision (Jam signal) on both links Giuseppe Bianchi

Multi-portrepeater(hub) è Signal regenerated& retransmitted all repeaterports on exceptthe port from which the signal Multi-portrepeater(hub) è Signal regenerated& retransmitted all repeaterports on exceptthe port from which the signal has arrived R Giuseppe Bianchi

Multiportrepeaters star topology è Coax & transceivers no more necessary ! è 1990: emergence Multiportrepeaters star topology è Coax & transceivers no more necessary ! è 1990: emergence of 10 Base-T technology ð Transmission medium = twisted pair point-to-point link ð Hub distributes signal across all stations Giuseppe Bianchi

Hub-based star topologies : Why collisiondetection? How collisionis detected ? D A C B Hub-based star topologies : Why collisiondetection? How collisionis detected ? D A C B D A RX TX TX HUB RX A&B detect collision by listening on RX TX TX B Giuseppe Bianchi Signal-level collision occurs on C&D RX links RX C

Ethernetbridge è Data-link layer device è Signal retransmission takes into account destinationaddress D C Ethernetbridge è Data-link layer device è Signal retransmission takes into account destinationaddress D C B B A A sends frame to B; Bridge recognizes that station B is on the same side the signal has been received and DOES NOT retransmit D C B B A A sends frame to D; Bridge recognizes that station D is on the other side: r Giuseppe Bianchi

Multiportbridge Switch è HUB ð broadcasts signal on all links ð Logically behaves as Multiportbridge Switch è HUB ð broadcasts signal on all links ð Logically behaves as a bus ð Only one tx at a time A B è SWITCH ð Repeats signal on specifically addressed link ð Bridging function ð Many tx-rx pairs at a time More bw! A Giuseppe Bianchi B HUB C D E F SWITCH C D

Switches & collisions è A sends frame to C; è D sends frame to Switches & collisions è A sends frame to C; è D sends frame to E è No collision ð Simultaneous transmission occurs SWITCH A B C D E F è A sends frame to C; è E sends frame to C SWITCH è Switch understandthat two frames are destined to a same link è “Collision solved by ” buffering one frame & transmittingthe other Giuseppe Bianchi A B C D

Broadcast domain vs collisiondomain HUB Switch HUB Without Switching With switching Collision Domain LAN Broadcast domain vs collisiondomain HUB Switch HUB Without Switching With switching Collision Domain LAN Collision Domain Broadcast Domain Giuseppe Bianchi Collision Domain Switch Collision Domain Broadcast Domain

Full-duplexing è Switchedstar network: only possible collisionis on a same link ð When both Full-duplexing è Switchedstar network: only possible collisionis on a same link ð When both station and switch simultaneously start transmission è But rx and tx are carried out on different pairs collision isfictitious ð detected by the network interface card (activity sensed on Rx pair while NIC is transmitting) ð But it is not a real collision between the signals! it would be with a central hub; it is not with central switch è 1997: full duplex standard (802. 3 x) ð Simultaneously transmit and receive (2 x speed increase) ð In a switched star network collision is no more possible!! ð CSMA/CD no more necessary ð Network diameter no more a concern Arbitrary increase of the link speed is now possible! è è 1998 -1999: Gigabit Ethernet 2002 (july): 10 Giga. Ethernetin the metropolitan area (e. g. Fastweb, Telecom. IT) Future: 40 Giga-Ethernet, 160 Giga-Ethernet Giuseppe Bianchi

Buffering A B A A A B C D D C A D A Buffering A B A A A B C D D C A D A Giuseppe Bianchi X B C D

buffering A B A A A B C D D A D Giuseppe Bianchi buffering A B A A A B C D D A D Giuseppe Bianchi A X C B C D

buffering A A B C D D X A D Giuseppe Bianchi A B buffering A A B C D D X A D Giuseppe Bianchi A B C C D

buffering A B A A B C D D D Giuseppe Bianchi X A buffering A B A A B C D D D Giuseppe Bianchi X A B C C D

buffering A B A A B C D D D Giuseppe Bianchi X A buffering A B A A B C D D D Giuseppe Bianchi X A B C D C

Buffers è Solve outputport contention ð 1 packet transmitted ðOther stored in waiting line Buffers è Solve outputport contention ð 1 packet transmitted ðOther stored in waiting line è May have finite capacity ðMax number of stored bytes or packets ðIntroduce loss!! Packet arriving when buffer full gets lost è Introducelatency !! ðLatency is NOT deterministic, but statistical QUEUEING THEORY: we need a mathematical tool to quantita evaluate loss/delay introduced by networking devices …. and much more Giuseppe Bianchi

Bridge/Switch operation Preamble + SFD DEST lookup SRC LEN or type Data PAD FCS Bridge/Switch operation Preamble + SFD DEST lookup SRC LEN or type Data PAD FCS è Store & Forward: ð read frame (memorize into onboard buffer) ð Check CRC Discard frame if » CRC fails » too short (<64 bytes, “runt”) » too long (>1518 bytes, “giant”) ð Look up destination into forwarding (switching) table ð Forward packet to outgoing port è Cut-through ð Just read first few bytes (until destination address) ð Don’t do any check ð Look up forwarding table and select destination Giuseppe Bianchi ð forward frame while receiving it

Store & forward vs cut-through latency è 1518 bytes frame ðAssume full 8 bytes Store & forward vs cut-through latency è 1518 bytes frame ðAssume full 8 bytes preamble received S&F @ 10 mbps ≥ 1526*8/10 ms = 1222 ms C-T @ 10 mbps ≥ 14*8/10 ms = 11. 2 ms S&F @ 100 mbps ≥ 122 ms C-T @ 100 mbps ≥ 1. 1 ms ðNot a real problem at high rate Giuseppe Bianchi

S&F vs CT: Fragment-freemode è Compromisebetween cut-through andstore-and-forward ð Reads first 64 bytes includes S&F vs CT: Fragment-freemode è Compromisebetween cut-through andstore-and-forward ð Reads first 64 bytes includes the frame (+LLC) header ð Then starts send packet before the entire data field is read and the FCS is checked. è Advantages : ð Verify reliability of header information (addresses, frame type, LLC header information) ð Detects & discards runts & collisions Preamble + SFD DEST SRC Cut-through Giuseppe Bianchi LEN or type Data PAD Fragment-free FCS Store & Forward

Further issues with C-T èCut-through possible only if source and destinationports have same bit Further issues with C-T èCut-through possible only if source and destinationports have same bit rate ðSymmetric switching. èDifferentrates buffering necessary S&F only ðAsymmetric switching èAsymmetric switching typicalin client /server environments ðMore bandwidth dedicated to the server port to prevent a bottleneck Giuseppe Bianchi

Forwarding database è Mapping between MAC addresses and ports ð Ports: module/port-# Dest MAC Forwarding database è Mapping between MAC addresses and ports ð Ports: module/port-# Dest MAC Address Ports ----1/1 1/7 2/3 2/4 2/6 è Static entries: --------ð Configured by sysadmin 00 -00 -08 -11 -aa-01 ð Permanent database 00 -b 0 -8 d-13 -1 a-f 1 è Dinamic entries: a 8 -11 -06 -00 -0 b-b 4 08 -01 -00 -00 -a 7 -64 ð “Learned” ð Expire after ageing process 00 -ff-08 -10 -44 -01 reaches upper value E. g. 300 seconds configurable Giuseppe Bianchi Age --1 4 0 1 5

Address Learning /1 STA 1 00 -11 -22 -33 -44 -01 P 1 08 Address Learning /1 STA 1 00 -11 -22 -33 -44 -01 P 1 08 -55 -66 -77 -88 -02 P 1 08 -aa-bb-cc-dd-03 P 2 08 -01 -02 -f 1 -f 2 -04 P 3 STA 4 08 -01 -02 -f 1 -f 2 -04 STA 2 08 -55 -66 -77 -88 -02 P 2 èFrame arrives at port X ðHence it has come from LAN attached to port X Giuseppe Bianchi STA 3 08 -aa-bb-cc-dd-03 èSRC address used to update forwarding DB ðSRC MAC Port

Address Learning /2 STA 1 00 -11 -22 -33 -44 -01 P 1 STA Address Learning /2 STA 1 00 -11 -22 -33 -44 -01 P 1 STA 2 08 -55 -66 -77 -88 -02 00 -11 -22 -33 -44 -01 P 1 08 -55 -66 -77 -88 -02 P 1 08 -aa-bb-cc-dd-03 P 2 08 -01 -02 -f 1 -f 2 -04 P 3 08 -00 -0 f-cc-cc-a 2 P 1 5 7 0 6 0 P 3 STA 4 08 -01 -02 -f 1 -f 2 -04 P 2 08 -00 -0 f-cc-cc-a 2 èIncoming frame whose SRCaddr not in forwarding DB: ðCreate new entry ðAgeing-time=0 Giuseppe Bianchi STA 3 08 -aa-bb-cc-dd-03 èIncoming frame whose SRCaddr already in forwarding DB: ðRefresh ageing-time ðAgeint-time=0

Address Learning /3 STA 1 00 -11 -22 -33 -44 -01 P 1 STA Address Learning /3 STA 1 00 -11 -22 -33 -44 -01 P 1 STA 2 08 -55 -66 -77 -88 -02 00 -11 -22 -33 -44 -01 P 1 08 -55 -66 -77 -88 -02 P 1 08 -aa-bb-cc-dd-03 P 2 08 -01 -02 -f 1 -f 2 -04 P 3 08 -00 -0 f-cc-cc-a 2 P 1 08 -00 -0 f-cc-cc-a 2 P 2 5 7 4 6 2 0 P 3 STA 4 08 -01 -02 -f 1 -f 2 -04 P 2 08 -00 -0 f-cc-cc-a 2 STA 3 08 -aa-bb-cc-dd-03 Giuseppe Bianchi èIncoming frame whose SRCaddr already in forwarding DB but associated to different port: ðUpdate associated port ðRefresh ageing time

Frame forwarding è Very first operationperformedby the bridge/ switch upon frame reception ð Before Frame forwarding è Very first operationperformedby the bridge/ switch upon frame reception ð Before learning Preamble + SFD DEST SRC LEN or type Data PAD FCS 1. Frame OK? Port X ð CRC check ð Only for Store & Forward 2. Incomingport enabled (in forwardingstate)? ð Switch port may be disabled e. g. to isolate malfunctioning stations/LANs Port Y 3. If DEST is NOT in forwarding DB ð broadcast frame (flooding) forward frame to all ports EXCEPT incoming one 4. If DEST is in forwarding DB ð Check whether DEST port = incoming port If YES, discard packet (dest on same LAN of src) If NO, forwards packet to output port » Unless output port blocked Flooding occurs also for broadcast frames (obvious) and for multicast frames (unless more sophisticated Giuseppe Bianchi

Example / 1 start-up P 1 P 3 P 2 èInitialstate: forwarding. DB = Example / 1 start-up P 1 P 3 P 2 èInitialstate: forwarding. DB = empty Giuseppe Bianchi

Example / 2 STA 1 STA 2 STA 1 00 -11 -22 -33 -44 Example / 2 STA 1 STA 2 STA 1 00 -11 -22 -33 -44 -01 P 1 0 P 1 P 3 P 2 è STA 1 transmitsframe to STA 2 è Flooding occurs (STA 2 not registeredin DB) è Bridge learns STA 1=P 1 Giuseppe Bianchi

Example / 3 STA 2 STA 1 00 -11 -22 -33 -44 -01 STA Example / 3 STA 2 STA 1 00 -11 -22 -33 -44 -01 STA 2 00 -aa-bb-cc-dd-02 00 -11 -22 -33 -44 -01 P 1 2 00 -aa-bb-cc-dd-02 P 3 0 P 1 P 3 P 2 è STA 2 may respond ð depends on involved protocol/app rules (e. g. TCP handshake) è transmitsframe to STA 1 è Destinationselected è Bridge learns STA 2=P 3 Giuseppe Bianchi

Example / 4 STA 3 STA 1 00 -11 -22 -33 -44 -01 P Example / 4 STA 3 STA 1 00 -11 -22 -33 -44 -01 P 1 12 00 -aa-bb-cc-dd-02 P 3 10 08 -80 -f 0 -00 -ff-03 P 1 0 STA 2 00 -aa-bb-cc-dd-02 P 3 STA 3 08 -80 -f 0 -00 -ff-03 P 2 è STA 3 on LAN 1 transmitsto STA 1 è Frame arrives to STA 1 on LAN 1 ð But arrives also to Bridge è Bridge discards frame (STA 1 on same port of incomingframe) ð This operation is referred to as FILTERING FUNCTION è Bridge learns STA 3=P 1 Giuseppe Bianchi

Example / 5 STA 1 moves STA 1 STA 3 ; P 1 00 Example / 5 STA 1 moves STA 1 STA 3 ; P 1 00 -11 -22 -33 -44 -01 00 -aa-bb-cc-dd-02 08 -80 -f 0 -00 -ff-03 00 -11 -22 -33 -44 -01 P 3 P 1 P 2 13 11 1 0 STA 2 00 -aa-bb-cc-dd-02 P 3 STA 3 08 -80 -f 0 -00 -ff-03 P 2 STA 1 00 -11 -22 -33 -44 -01 è STA 1 moves on LAN 2 è Then transmits to STA 3 è Frame arrives to Bridge on P 2, and forwarded to P 1 ð According to forwarding DB information è Bridge learns that STA 1 moved ð Deletes previous entry with P 1 ð Adds new entry with P 2 Giuseppe Bianchi

Example / 6 STA 2 moves STA 1 STA 2 ; ? ? ? Example / 6 STA 2 moves STA 1 STA 2 ; ? ? ? STA 2 00 -aa-bb-cc-dd-02 P 1 00 -aa-bb-cc-dd-02 P 3 13 08 -80 -f 0 -00 -ff-03 P 1 3 00 -11 -22 -33 -44 -01 P 2 2 P 3 STA 3 08 -80 -f 0 -00 -ff-03 P 2 STA 1 00 -11 -22 -33 -44 -01 è STA 2 moves on LAN 1 è STA 1 transmitframe to STA 2 è Frame forwarded on old port P 3!! ð Bridge will learn only when STA 2 will transmit first frame ð OR when ageing time will expire and STA 2 P 3 entry will be removed from forwarding DB Giuseppe Bianchi

Why a stationshould move ? Fault-tolerantarchitectures ! P 1 P 2 Link 1 Link Why a stationshould move ? Fault-tolerantarchitectures ! P 1 P 2 Link 1 Link 2 As link 1 fails, server switches on link 2 server MOVES from original port P 2 to new po (need to reduce ageing time – but trade-off required: too short ageing time, too much bur (effective solution: i) periodically send “advertisement” frames ii) send frame after switch Giuseppe Bianchi

Wireless LANs (Wi-Fi) Just a very basic overview Giuseppe Bianchi Wireless LANs (Wi-Fi) Just a very basic overview Giuseppe Bianchi

WLAN history è Original goal: ð Deploy “wireless Ethernet” ð First generation proprietary solutions WLAN history è Original goal: ð Deploy “wireless Ethernet” ð First generation proprietary solutions (end ’ 80, begin ’ 90): Wave. LAN (AT&T) Home. RF (Proxim) ð Abandoned by major chip makers (e. g. Intel: dismissed Home. RF in april 2001) è IEEE 802. 11 Committee formed in 1990 ð Charter: specification of MAC and PHY for WLAN ð First standard: june 1997 1 and 2 Mbps operation ð Reference standard: september 1999 Multiple Physical Layers Two operative Industrial, Scientific & Medical (ISM) shared unlicensed band » 2. 4 GHz: Legacy; 802. 11 b/g » 5 GHz: 802. 11 a è 1999: Wireless Ethernet. Compatibility Alliance(WECA) certification ð Later on named Wi-Fi ð Boosted 802. 11 deployment!! Giuseppe Bianchi

WLAN data rates è Legacy 802. 11 Work started in 1990; standardized in 1997 WLAN data rates è Legacy 802. 11 Work started in 1990; standardized in 1997 1 mbps & 2 mbps è The 1999 revolution: PHY layer impressive achievements ð 802. 11 a: PHY for 5 GHz published in 1999 Products available since early 2002 ð 802. 11 b: higher rate PHY for 2. 4 GHz Published in 1999 Products available since 1999 Interoperability tested (wifi) è 2003: extend 802. 11 b ð 802. 11 g: OFDM for 2. 4 GHz Published in june 2003 Products available, though no extensive interoperability testing yet Backward compatibility with 802. 11 b Wi-Fi è Ongoing standardization effort: 802. 11 n Launched in september 2003 Minimum goal: 108 Mbps (but higher numbers considered) Giuseppe Bianchi Standard Transfer Method Freq. Band Data Rates Mbps 802. 11 legacy FHSS, DSSS, IR 2. 4 GHz, IR 1, 2 802. 11 b DSSS, HRDSSS 2. 4 GHz 1, 2, 5. 5, 11 "802. 11 b+" non-standard DSSS, HRDSSS, (PBCC) 2. 4 GHz 1, 2, 5. 5, 11, 22, 33, 44 802. 11 a OFDM 5. 2, 5. 5 GHz 6, 9, 12, 18, 24, 36, 48, 54 802. 11 g DSSS, HRDSSS, OFDM 2. 4 GHz 1, 2, 5. 5, 11; 6, 9, 12, 18, 24, 36, 48, 54

Why multiplerates? “Adaptive (? )coding modulation ” / Example 802. 11 a case : Why multiplerates? “Adaptive (? )coding modulation ” / Example 802. 11 a case : Giuseppe Bianchi

Wireless Medium Unreliability 11 Mbps 802. 11 b outdoor measurements - Roma 2 Campus Wireless Medium Unreliability 11 Mbps 802. 11 b outdoor measurements - Roma 2 Campus - roof nodes Giuseppe Bianchi

Must rely on explicit ACKs è Successful DATA transmission: ðONLY IF an ACK is Must rely on explicit ACKs è Successful DATA transmission: ðONLY IF an ACK is received è ACK transmission provided by MAC layer ðImmediate retransmission » Don’t get confused with higher layer rtx è DATA-ACK exchange: ðAlso called two-way handshake ðOr Basic Access Mechanism Giuseppe Bianchi SENDER RECEIVER DATA ACK

Must forget Collision Detection! è One single RF circuitry ð Either TX or RX… Must forget Collision Detection! è One single RF circuitry ð Either TX or RX… ð Half-duplex è Even if two simultaneous TX+RX: large difference (100+ d. B!) in TX/RX signal power ð Impossible to receive while transmitting On a same channel, of course tx STA rx è Collision detection at sender: meaningless in wireless! ð Ethernet = collision detection at sender ð Wireless = large difference in the interference power between sender & receiver! ð Collision OCCURS AT THE RECEIVER A B Giuseppe Bianchi A detects a very low interference (C is far) no “collision” C B detects a disructive interference (C is near) collision occurs

Carrier Sense Multiple Access è Station may transmit ONLY IF senses channel IDLE for Carrier Sense Multiple Access è Station may transmit ONLY IF senses channel IDLE for a DIFS time ð DIFS = Distributed Inter Frame Space è Key idea: ACK replied after a SIFS < DIFS ð SIFS = Short Inter Frame Space è Other stations will NOT be able to access the channel during the handshake ð Provides an atomic DATA-ACK transaction Packet arrival TX DIFS DATA SIFS ACK RX OTHER STA Packet arrival Giuseppe Bianchi DIFS Must measure a whole DIFS OK!

Grasping wi-fi (802. 11 b) numbers è DIFS = 50 ms ð Rationale: 1 Grasping wi-fi (802. 11 b) numbers è DIFS = 50 ms ð Rationale: 1 SIFS + 2 slottimes Slot time = 20 ms, more later è SIFS = 10 ms ð Rationale: RX_TX turnaround time The shortest possible! (28+payload) [bytes] x 8 / TX_rate [mbps] = ms DATA PHY MAC header 24 (30) 16 128 Preamble 48 SFD PLCP hdr 1 mbps DBPSK 192 ms Payload FCS è DATA frame: TX time = f(rate) è Impressive PHY overhead! 192 ms per every single frame è Total data frame time (1500 bytes) @1 Mbps: 192+12288= 12480 ms » PHY+MAC overhead = 3. 3% @11 Mbps: 192+ 1117. 1 = 1309. 1 ms ACK » PHY+MAC overhead = 16. % PHY ACK 14 192 ms 112 ms Giuseppe Bianchi Overhead increases for small frames! è ACK frame: TX at basic rate ð Typically 1 mbps but 2 mbps possible… ð ACK frame duration (1 mbps): 304 ms

And when an ACK is “hidden”? 1) Sender TX Receiver RX STA defers 3) And when an ACK is “hidden”? 1) Sender TX Receiver RX STA defers 3) SENDER RECEIVER STA 2) STA SENDER RECEIVER Receiver ACKs (after SIFS) STA cannot hear… STA tranmits And destroys ACK! STA BUSY DETECT (DATA) DIFS SIFS Giuseppe Bianchi STA TX! ACK

The Duration Field Frame Control Duration / ID Address 1 Address 2 6 6 The Duration Field Frame Control Duration / ID Address 1 Address 2 6 6 2 2 # microseconds 0 1 2 3 4 5 6 7 8 Address 3 6 0 9 10 11 12 13 14 15 Address 4 Data Frame check sequence 6 Sequence Control 0 -2312 4 2 When bit 15 = 1 NOT used as duration (used by power-saving frames to specify station ID) è Allows “Virtual Carrier Sensing” ð Other than physically sensing the channel, each station keeps a Network Allocation Vector (NAV) ð Continuously updates the NAV according to information read in the duration field of other frames DIFS DATA SIFS OTHER STA Giuseppe Bianchi Physical carrier sensing ACK Virtual carrier sensing NAV (data)

And when a terminalis “hidden”? STA RECEIVER SENDER … this can be “solved” by And when a terminalis “hidden”? STA RECEIVER SENDER … this can be “solved” by increasing the sensitiveness of the Carrier Sense… Quite stupid, though (LOTS of side effects – out of the goals of this lecture) … this can’s be “solved” by any means! è The Hidden Terminal Problem ð SENDER and STA cannot hear each other ð SENDER transmits to RECEIVER ð STA wants to send a frame RECEIVER Not necessarily to RECEIVER… ð STA senses the channel IDLE Carrier Sense failure SENDER STA Giuseppe Bianchi ð Collision occurs at RECEIVER è Destroys a possibly very long TX!!

The RTS/CTSsolution Packet arrival TX DIFS RTS DATA SIFS CTS SIFS RX others SIFS The RTS/CTSsolution Packet arrival TX DIFS RTS DATA SIFS CTS SIFS RX others SIFS ACK NAV (RTS) NAV (CTS) RX RTS da ta CTS TX CTS hidden (Update NAV) Giuseppe Bianchi RTS/CTS: carry the amount of time the channel will be BUSY. Other stations may update a Network Allocation Vector, and defer TX even if they sense the channel idle (Virtual Carrier Sensing)

Why backoff ? DIFS STA 1 DATA SIFS ACK DIFS STA 2 STA 3 Why backoff ? DIFS STA 1 DATA SIFS ACK DIFS STA 2 STA 3 Collision! RULE: when the channel is initially sensed BUSY, station defers transmission; THEN, when channel sensed IDLE again for a DIFS, defer transmission of a further random time (Collision Avoidance) Giuseppe Bianchi

Slotted. Backoff STA 2 DIFS w=7 Extract random number in range (0, W-1) Decrement Slotted. Backoff STA 2 DIFS w=7 Extract random number in range (0, W-1) Decrement every slot-time s w=5 STA 3 Note: slot times are not physically delimited on the channel! Rather, they are logically identified by every STA Slot-time values: 20 ms for DSSS (wi-fi) Accounts for: 1) RX_TX turnaround time 2) busy detect time 3) propagation delay Giuseppe Bianchi

Backoff freezing è When STA is in backoff stage: ðIt freezes the backoff counter Backoff freezing è When STA is in backoff stage: ðIt freezes the backoff counter as long as the channel is sensed BUSY ðIt restarts decrementing the backoff as the channel is sensed IDLE for a DIFS period STATION 1 DIFS DATA DIFS SIFS ACK STATION 2 DIFS SIFS ACK 6 5 Giuseppe Bianchi BUSY medium Frozen slot-time 4 DIFS 3 2 1

Why backoff between consecutivetx? è A listeningstationwould never find a slot-time after the DIFS Why backoff between consecutivetx? è A listeningstationwould never find a slot-time after the DIFS (necessaryto decrementthe backoff counter ) è Thus, it would remain stuck to the current backoff counter value forever !! S 1 DIFS DATA DIFS SIFS ACK S 2 BUSY medium DIFS 6 5 DIFS Frozen slot-time 4 Giuseppe Bianchi BUSY medium DIFS 3

Backoff rules è First backoff value: ðExtract a uniform random number in range (0, Backoff rules è First backoff value: ðExtract a uniform random number in range (0, CWmin) è If unsuccessful TX: ðExtract a uniform random number in range (0, 2×(CWmin+1)-1) è If unsuccessful TX: ðExtract a uniform random number in range (0, 22×(CWmin+1)-1) Exponential Backoff! è Etc up to 2 m×(CWmin+1)-1 For 802. 11 b: CWmin = 31 CWmax = 1023 (m=5) Giuseppe Bianchi

Further backoff rules è Truncatedexponentialbackoff ð After a number of attempts, transmission fails and Further backoff rules è Truncatedexponentialbackoff ð After a number of attempts, transmission fails and frame is dropped ð Backoff process for new frame restarts from CWmin ð Protects against cannel capture unlikely when stations are in visibility, but may occur in the case of hidden stations è Two retry limitssuggested : ð Short retry limit (4), apply to frames below a given threshold ð Long retry limit (7), apply to frames above given threshold ð (loose) rationale: short frames are most likely generated bu realk time stations Of course not true in general; e. g. what about 40 bytes TCP ACKs? Giuseppe Bianchi

DCF overhead Giuseppe Bianchi DCF overhead Giuseppe Bianchi

Example maximum achievable : throughputfor 802. 11 b backoff DATA SIFS DATA DIFS ACK Example maximum achievable : throughputfor 802. 11 b backoff DATA SIFS DATA DIFS ACK Cycle time è è Data Rate = 11 mbps; ACK rate = 1 mbps Payload = 1500 bytes è è Data Rate = 11 mbps; ACK rate = 1 mbps Payload = 576 bytes REPEAT RESULTS FOR RTS/CTS Not viable (way too much overhead) at high rates! Giuseppe Bianchi

DCF overhead(802. 11 b) Giuseppe Bianchi DCF overhead(802. 11 b) Giuseppe Bianchi

DCF overhead(802. 11 b) Giuseppe Bianchi DCF overhead(802. 11 b) Giuseppe Bianchi

Performance. Anomaly è Question 1: ð Assume that throughput measured for a single 11 Performance. Anomaly è Question 1: ð Assume that throughput measured for a single 11 mbps greedy station is approx 6 mbps. What is per-STA throughput when two 11 mbps greedy stations compete? è Answer 1: ð Approx 3 mbps (easy ) è Question 2: ð Assume that throughput measured for a single 2 mbps greedy station is approx 1. 7 mbps. What is per-STA throughput when two 2 mbps greedy stations compete? è Answer 2: ð Approx 0. 85 mbps (easy ) è Question 3: ð What is per-STA throughput when one 11 mbps greedy station compete with one 2 mbps greedy station? è Answer 3: ð. . . Giuseppe Bianchi

Understanding. Answers 1&2 (neclectcollision– indeed rare – just slightly reduce computed value) backoff Frozen Understanding. Answers 1&2 (neclectcollision– indeed rare – just slightly reduce computed value) backoff Frozen backoff STA 1 SIFS DIFS STA 2 ACK SIFS DIFS ACK Cycle time è è Data Rate = 11 mbps; ACK rate = 1 mbps Payload = 1500 bytes Giuseppe Bianchi è è Data Rate = 2 mbps; ACK rate = 1 mbps Payload = 1500 bytes

Emerging “problem ”: long-termfairness ! è If you have understoodthe previous example you easily Emerging “problem ”: long-termfairness ! è If you have understoodthe previous example you easily realize , that è 802. 11 provides. FAIR accessto stations èin terms of EQUAL NUMBER of transmissionopportunitiesin the long term ! èBut this is INDEPENDENT OF transmissionspeed! STA 2 STA 1 Giuseppe Bianchi

Computinganswer 3 Frozen backoff STA (2 mbps) SIFS DIFS ACK STA 11 SIFS DIFS Computinganswer 3 Frozen backoff STA (2 mbps) SIFS DIFS ACK STA 11 SIFS DIFS ACK Cycle time RESULT: SAME THROUGHPUT (in the long term)!! DRAMATIC CONSEQUENCE: throughput is limited by STA with slowest rate (lower that the maximum throughput achievable by the slow station)!! Giuseppe Bianchi

Performanceanomaly into action Why the network is soooo slow today? We’re so Close, we Performanceanomaly into action Why the network is soooo slow today? We’re so Close, we have a 54 mbps and “excellent” channel, and we get Less than 1 mbps … Hahahah!! Poor channel, Rate-fallbacked @ 1 mbps Giuseppe Bianchi