Computer Networks

Embed Size (px)

DESCRIPTION

Computer Networks. Lecture 6: Data Link Layer June 2009. Local Area Networks Ethernet, Wireless, PPP, ATM. 3 Generations of Ethernet. Traditional Ethernet. 1976, Xerox’s Palo Alto Research Center (PARC) Connection-less: no flow/error control Use 1-persistent CSMA/CD MAC sublayer - PowerPoint PPT Presentation

Citation preview

  • Computer NetworksLecture 6: Data Link Layer

    June 2009Local Area NetworksEthernet, Wireless,PPP, ATM

  • 3 Generations of Ethernet

  • Traditional Ethernet1976, Xeroxs Palo Alto Research Center (PARC)Connection-less: no flow/error controlUse 1-persistent CSMA/CDMAC sublayerPhysical layerPhysical layer implementationBridged EthernetSwitched EthernetFull duplex Ethernet

  • OutlineLAN addresses and ARPEthernetHubs, bridges, and switchesWireless links and LANs PPPATM

  • LAN technologiesData link layer so far:services, error detection/correction, multiple access Next: LAN technologiesaddressingEthernethubs, bridges, switches802.11PPPATM

  • LAN Addresses32-bit IP address: network-layer addressused to get datagram to destination IP network (recall IP network definition)LAN (or MAC or physical or Ethernet) address: used to get datagram from one interface to another physically-connected interface (same network)48 bit MAC address (for most LANs) burned in the adapter ROM

  • LAN AddressesEach adapter on LAN has unique LAN address

  • LAN Address (more)MAC address allocation administered by IEEEA manufacturer (Dlink, 3Com, Cisco) buys portion of MAC address space (to assure uniqueness)First 24 bits : identifies manufacturerLast 24 bits: with one manufacturer

  • LAN Address (more) MAC flat address => portability can move LAN card from one LAN to anotherIP hierarchical address NOT portable depends on IP network to which node is attachedAnalogy: (a) MAC address: like Mobile phone Number (b) IP address: like postal addressProblemMAC IP address

  • Recall earlier routing discussionStarting at A, given IP datagram addressed to B:look up net. address of B, find B on same net. as Alink layer send datagram to B inside link-layer frame Bs MACaddrAs MACaddrAs IPaddrBs IPaddrIP payloaddatagramframeframe source,dest addressdatagram source,dest address

  • ARP: Address Resolution ProtocolEach IP node (Host, Router) on LAN has ARP tableARP Table: IP/MAC address mappings for some LAN nodes < IP address; MAC address; TTL> TTL (Time To Live): time after which address mapping will be forgotten (typically 20 min)

  • ARP protocolA wants to send datagram to B, and A knows Bs IP address.Suppose Bs MAC address is not in As ARP table.A broadcasts ARP query packet, containing B's IP address all machines on LAN receive ARP query B receives ARP packet, replies to A with its (B's) MAC addressframe sent to As MAC address (unicast)

    A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) soft state: information that times out (goes away) unless refreshedARP is plug-and-play:nodes create their ARP tables without intervention from net administrator

    Broadcast addr: FF-FF-FF-FF-FF-FF

  • OutlineLAN addresses and ARPEthernetHubs, bridges, and switchesWireless links and LANs PPPATM

  • Ethernetdominant LAN technology: cheap $20 for 100Mbs!first widely used LAN technologySimpler, cheaper than token LANs and ATMKept up with speed race: 10, 100, 1000 Mbps

    Metcalfes Ethernetsketch

  • Ethernet Frame Structure (more)Type: indicates the higher layer protocol, mostly IP but others may be supported such as Novell IPX and AppleTalk)CRC: checked at receiver, if error is detected, the frame is simply dropped

  • 802.3 MAC FramePreamble: alert the receiver to the coming frame and enable it to synchronize its input timingStart-frame delimiter (SFD): 10101011Length PDU (protocol data unit): length of data (if < 1518) or type of PDU packet (if > 1536)CRC: CRC-32

  • Frame SizeMinimum length is set to ensure that a frame is sent before collision is detected (if any)Why maximum length = 1500 bytes? (only historical)If upper-level packet size > 1518 => bit padding

  • Addresses

  • Unreliable, connectionless serviceConnectionless: No handshaking between sending and receiving adapter. Unreliable: receiving adapter doesnt send acks or nacks to sending adapterstream of datagrams passed to network layer can have gapsgaps will be filled if app is using TCPotherwise, app will see the gaps

  • Ethernet uses CSMA/CDNo slotsadapter doesnt transmit if it senses that some other adapter is transmitting, that is, carrier sensetransmitting adapter aborts when it senses that another adapter is transmitting, that is, collision detectionBefore attempting a retransmission, adapter waits a random time, that is, random access

  • Ethernet CSMA/CD algorithm1. Adaptor gets datagram from and creates frame2. If adapter senses channel idle, it starts to transmit frame. If it senses channel busy, waits until channel idle and then transmits3. If adapter transmits entire frame without detecting another transmission, the adapter is done with frame !4. If adapter detects another transmission while transmitting, aborts and sends jam signal5. After aborting, adapter enters exponential backoff: after the nth collision, adapter chooses a K at random from {0,1,2,,2m-1}. Adapter waits K*512 bit times and returns to Step 2 m = min(n,10)

  • Ethernets CSMA/CD (more)Jam Signal: make sure all other transmitters are aware of collision; 48 bits;Bit time: .1 microsec for 10 Mbps Ethernet ; for K=1023, wait time is about 50 msec

    Exponential Backoff: Goal: adapt retransmission attempts to estimated current loadheavy load: random wait will be longerfirst collision: choose K from {0,1}; delay is K x 512 bit transmission timesafter second collision: choose K from {0,1,2,3}after ten collisions, choose K from {0,1,2,3,4,,1023}

  • CSMA/CD efficiencyTprop = max prop between 2 nodes in LANttrans = time to transmit max-size frame

    Efficiency goes to 1 as tprop goes to 0Goes to 1 as ttrans goes to infinityMuch better than ALOHA, but still decentralized, simple, and cheap

  • Physical LayerEncode/decode dataMedium-independentFor external receiver, MDI can be a tap or a tee connectorFor internal receiver, MDI can be a jack

  • Physical Layer Signaling (PLS)For 10Mbps, bandwidth of 20Mbaud is needed

  • Attachment Unit Interface (AUI)AUI: medium independentIf MAU is changed, PLS is not

  • MAU (Transceiver)MAU: create appropriate signal for each mediumTransmitter, receiver, detect collision

  • Implementation of Traditional Ethernet

  • Traditional Ethernet: Implementation10Base-5 (thicknet)10Base-2 (cheapernet)10Base-T10Base-FL(fiber-link)

  • Ethernet Technologies: 10Base210: 10Mbps; 2: under 200 meters max cable lengththin coaxial cable in a bus topology

    repeaters used to connect up to multiple segmentsrepeater repeats bits it hears on one interface to its other interfaces: physical layer device only!has become a legacy technology

  • 10BaseT and 100BaseT10/100 Mbps rate; latter called fast ethernetT stands for Twisted PairNodes connect to a hub: star topology; 100 m max distance between nodes and hub

    Hubs are essentially physical-layer repeaters:bits coming in one link go out all other linksno frame bufferingno CSMA/CD at hub: adapters detect collisionsprovides net management functionality

  • Manchester encodingUsed in 10BaseT, 10Base2Each bit has a transitionAllows clocks in sending and receiving nodes to synchronize to each otherno need for a centralized, global clock among nodes!

  • Gbit Ethernetuse standard Ethernet frame formatallows for point-to-point links and shared broadcast channelsin shared mode, CSMA/CD is used; short distances between nodes to be efficientuses hubs, called here Buffered DistributorsFull-Duplex at 1 Gbps for point-to-point links10 Gbps now !

  • OutlineLAN addresses and ARPEthernetHubs, bridges, and switchesWireless links and LANs PPPATM

  • Bridged EthernetCollision separation + Bandwidth increase

  • Switched EthernetOnly station and switch share the bandwidth => 5Mbps each

  • Full-duplex Switched Ethernet10Base-2, 10Base-5: half-duplex10Base-T: full duplexMAC control is added to provide flow/error controlDo we need CSMA/CD?

  • Interconnecting LAN segmentsHubsBridgesSwitchesRemark: switches are essentially multi-port bridges.What we say about bridges also holds for switches!

  • Interconnecting with hubsBackbone hub interconnects LAN segmentsExtends max distance between nodesBut individual segment collision domains become one large collision domainif a node in CS and a node EE transmit at same time: collisionCant interconnect 10BaseT & 100BaseT

  • BridgesLink layer devicestores and forwards Ethernet framesexamines frame header and selectively forwards frame based on MAC dest addresswhen frame is to be forwarded on segment, uses CSMA/CD to access segmenttransparenthosts are unaware of presence of bridgesplug-and-play, self-learningbridges do not need to be configured

  • Bridges: traffic isolationBridge installation breaks LAN into LAN segmentsbridges filter frames: same-LAN-segment frames not usually forwarded onto other LAN segmentssegments become separate collision domainsLAN (IP network)

  • Forwarding How do determine to which LAN segment to forward frame? Looks like a routing problem...

  • Self learningA bridge has a bridge tableentry in bridge table: (Node LAN Address, Bridge Interface, Time Stamp)stale entries in table dropped (TTL can be 60 min) bridges learn which hosts can be reached through which interfaceswhen frame received, bridge learns location of sender: incoming LAN segmentrecords sender/location pair in bridge table

  • BridgesA bridge has a table used in filtering decisions

  • Filtering/ForwardingWhen bridge receives a frame: index bridge table using MAC dest addressif entry found for destination then{ if dest on segment from which frame arrived then drop the frame else forward the frame on interface indicated } else flood forward on all but the interface on which the frame arrived

  • Bridge exampleSuppose C sends frame to D and D replies back with frame to C.

    Bridge receives frame from Cnotes in bridge table that C is on interface 1because D is not in table, bridge sends frame into interfaces 2 and 3frame received by D

  • Bridge Learning: exampleD generates frame for C, sends bridge receives frame notes in bridge table that D is on interface 2 bridge knows C is on interface 1, so selectively forwards frame to interface 1

  • Interconnection without backboneNot recommended for two reasons:- single point of failure at Computer Science hub- all traffic between EE and SE must path over CS segment

  • Backbone configuration Recommended !

  • Loop ProblemTo increase reliability, add more bridges between 2 LANs

    Solution: ?????

  • Bridges Spanning Treefor increased reliability, desirable to have redundant, alternative paths from source to destwith multiple paths, cycles result - bridges may multiply and forward frame foreversolution: organize bridges in a spanning tree by disabling subset of interfaces

  • Some bridge featuresIsolates collision domains resulting in higher total max throughputlimitless number of nodes and geographical coverageCan connect different Ethernet types Transparent (plug-and-play): no configuration necessary

  • Bridges vs. Routersboth store-and-forward devicesrouters: network layer devices (examine network layer headers)bridges are link layer devicesrouters maintain routing tables, implement routing algorithmsbridges maintain bridge tables, implement filtering, learning and spanning tree algorithms

  • Routers vs. BridgesBridges + and - + Bridge operation is simpler requiring less packet processing+ Bridge tables are self learning - All traffic confined to spanning tree, even when alternative bandwidth is available- Bridges do not offer protection from broadcast storms

  • Routers vs. BridgesRouters + and -+ arbitrary topologies can be supported, cycling is limited by TTL counters (and good routing protocols)+ provide protection against broadcast storms- require IP address configuration (not plug and play)- require higher packet processing

    bridges do well in small (few hundred hosts) while routers used in large networks (thousands of hosts)

  • Backbone NetworksBus backbone Star (or switched, or collapsed) backbone

  • Remote BridgesA point-to-point link acts as a LAN in a remote backbone connected by remote bridges

  • Virtual LANsIn many companies, organizational changes occur all the timeLAN membership of an employee is changed if he moves to another department. What if his office remains the same? => Need re-cabling He remains in the same department but changes office => need re-cablingVirtual LAN: a good way for logical re-wiring networks in softwareNeed use specially-designed VLAN-aware switches

  • (a) Four physical LANs organized into two VLANs by two bridges. (b) The same 15 machines organized into two VLANs by switchesVLAN: Example

  • VLAN: How to Distinguish VLANsEach bridge/switch has a configuration table3 methodsEvery port is assigned a VLAN colorAll machines to this port must belong to the same VLANEvery MAC addr is assigned a VLAN colorNot good for notebooks that can be docked anywhereEvery layer-3 protocol or IP addr is assigned a VLAN colorVLAN information is embedded in the the frameFundamental problem: non-independence of the layers

  • Communication between SwitchesTable maintenanceStation VLAN membership must be known to all switchesFrame taggingWhen a frame travels between switches, an extra header is added to the MAC frame to define the destination VLAN.This tag is used by receiving switches to know the VLAN to receive the frameTime-division multiplexingIf the num. of VLANs is n, use TDM to have n channels in each connection (trunk)

  • IEEE 802.1QShould not read payload => add new headerStandard for the format of frame taggingChallengesNeed we throw out hundreds of million existing Ethernet cards?If not, who generates the new fields?What happens to frames that are already of maximum size?Raise limit to 1522 bytes (rather than 1518)

  • Transition from Legacy to 802.1Q

  • Ethernet SwitchesEssentially a multi-interface bridgelayer 2 (frame) forwarding, filtering using LAN addressesSwitching: A-to-A and B-to-B simultaneously, no collisionslarge number of interfacesoften: individual hosts, star-connected into switchEthernet, but no collisions!

  • Ethernet Switchescut-through switching: frame forwarded from input to output port without awaiting for assembly of entire frameVs. store and forwardslight reduction in latencycombinations of shared/dedicated, 10/100/1000 Mbps interfaces

  • Not an atypical LAN (IP network)DedicatedShared

  • Summary comparison

    hubs

    bridges

    routers

    switches

    traffic

    isolation

    no

    yes

    yes

    yes

    plug & play

    yes

    yes

    no

    yes

    optimal

    routing

    no

    no

    yes

    no

    cut

    through

    yes

    no

    no

    yes

  • OutlineLAN addresses and ARPEthernetHubs, bridges, and switchesWireless links and LANs PPPATM

  • IEEE 802.11 Wireless LAN802.11b2.4-5 GHz unlicensed radio spectrumup to 11 Mbpsdirect sequence spread spectrum (DSSS) in physical layerall hosts use same chipping codewidely deployed, using base stations

    802.11a 5-6 GHz rangeup to 54 Mbps802.11g 2.4-5 GHz rangeup to 54 MbpsAll use CSMA/CA for multiple accessAll have base-station and ad-hoc network versions

  • Base station approachWireless host communicates with a base stationbase station = access point (AP)Basic Service Set (BSS) (a.k.a. cell) contains:wireless hostsaccess point (AP): base stationBSSs combined to form distribution system (DS)

  • Ad Hoc Network approachNo AP (i.e., base station)wireless hosts communicate with each otherto get packet from wireless host A to B may need to route through wireless hosts X,Y,ZApplications:laptop meeting in conference room, carinterconnection of personal devicesbattlefield IETF (Internet Engineering Task Force) MANET www.ietf.org (Mobile Ad hoc Networks) working group

  • IEEE 802.11: multiple accessCollision if 2 or more nodes transmit at same timeCSMA makes sense:get all the bandwidth if youre the only one transmittingshouldnt cause a collision if you sense another transmissionCollision detection doesnt work: hidden terminal problem

  • IEEE 802.11 MAC Protocol: CSMA/CA802.11 CSMA: sender- if sense channel idle for DISF sec. then transmit entire frame (no collision detection)-if sense channel busy then binary backoff802.11 CSMA receiver- if received OK return ACK after SIFS (ACK is needed due to hidden terminal problem)

  • Collision avoidance mechanismsProblem: two nodes, hidden from each other, transmit complete frames to base stationwasted bandwidth for long duration !Solution: small reservation packetsnodes track reservation interval with internal network allocation vector (NAV)

  • Collision Avoidance: RTS-CTS exchangesender transmits short RTS (request to send) packet: indicates duration of transmissionreceiver replies with short CTS (clear to send) packetnotifying (possibly hidden) nodeshidden nodes will not transmit for specified duration: NAV

  • Collision Avoidance: RTS-CTS exchangeRTS and CTS short:collisions less likely, of shorter durationend result similar to collision detectionIEEE 802.11 allows:CSMACSMA/CA: reservations polling from AP

  • A word about BluetoothLow-power, small radius, wireless networking technology10-100 metersomnidirectionalnot line-of-sight infraredInterconnects gadgets2.4-2.5 GHz unlicensed radio bandup to 721 kbps

    Interference from wireless LANs, digital cordless phones, microwave ovens:frequency hopping helpsMAC protocol supports:error correctionARQEach node has a 12-bit address

  • OutlineLAN addresses and ARPEthernetHubs, bridges, and switchesWireless links and LANs PPPATM

  • Point to Point Data Link Controlone sender, one receiver, one link: easier than broadcast link:no Media Access Controlno need for explicit MAC addressinge.g., dialup link, ISDN linepopular point-to-point DLC protocols:PPP (point-to-point protocol)HDLC: High level data link control (Data link used to be considered high layer in protocol stack!Objective: Detailed study on a (simple) protocol - PPP

  • PPP Design Requirements [RFC 1557]packet framing: encapsulation of network-layer datagram in data link frame carry network layer data of any network layer protocol (not just IP) at same timeability to demultiplex upwardsbit transparency: must carry any bit pattern in the data fielderror detection (no correction)connection liveness: detect, signal link failure to network layernetwork layer address negotiation: endpoint can learn/configure each others network address

  • PPP non-requirementsno error correction/recoveryno flow controlout of order delivery OK no need to support multipoint links (e.g., polling)

    Error recovery, flow control, data re-ordering all relegated to higher layers!

  • PPP Data FrameFlag: delimiter (framing)Address: does nothing (only one option)Control: does nothing; in the future possible multiple control fieldsProtocol: upper layer protocol to which frame delivered (eg, PPP-LCP, IP, IPCP, etc)

  • PPP Data Frameinfo: upper layer data being carriedcheck: cyclic redundancy check for error detection

  • Byte Stuffing data transparency requirement: data field must be allowed to include flag pattern Q: is received data or flag?

    Sender: adds stuffs -- extra < 01111110> after each < 01111110> data byteReceiver: two 01111110 bytes: discard first byte, continue data receptionsingle 01111110: flag byte

  • Byte Stuffingflag bytepatternin datato sendflag byte pattern plusstuffed byte in transmitted data

  • PPP Data Control ProtocolBefore exchanging network-layer data, data link peers mustconfigure PPP link (max. frame length, authentication)learn/configure network layer informationfor IP: carry IP Control Protocol (IPCP) msgs (protocol field: 8021) to configure/learn IP address

  • OutlineLAN addresses and ARPEthernetHubs, bridges, and switchesWireless links and LANs PPPATM

  • Asynchronous Transfer Mode: ATM1990s/00 standard for high-speed (155Mbps to 622 Mbps and higher) Broadband Integrated Service Digital Network architectureGoal: integrated, end-end transport of carry voice, video, datameeting timing/QoS requirements of voice, video (versus Internet best-effort model)next generation telephony: technical roots in telephone worldpacket-switching (fixed length packets, called cells) using virtual circuits

  • ATM architecture adaptation layer: only at edge of ATM networkdata segmentation/reassemblyroughly analogous to Internet transport layerATM layer: network layercell switching, routingphysical layer

  • ATM: network or link layer?Vision: end-to-end transport: ATM from desktop to desktopATM is a network technologyReality: used to connect IP backbone routers IP over ATMATM as switched link layer, connecting IP routers

  • ATM Layer: Virtual CircuitsVC transport: cells carried on VC from source to destcall setup, teardown for each call before data can floweach packet carries VC identifier (not destination ID)every switch on source-dest path maintain state for each passing connectionlink,switch resources (bandwidth, buffers) may be allocated to VC: to get circuit-like perf.Permanent VCs (PVCs)long lasting connectionstypically: permanent route between to IP routersSwitched VCs (SVC):dynamically set up on per-call basis

  • ATM VCsAdvantages of ATM VC approach:QoS performance guarantee for connection mapped to VC (bandwidth, delay, delay jitter)Drawbacks of ATM VC approach:Inefficient support of datagram trafficone PVC between each source/dest pair) does not scale (N*2 connections needed) SVC introduces call setup latency, processing overhead for short lived connections

  • ATM Layer: ATM cell5-byte ATM cell header48-byte payloadWhy?: small payload -> short cell-creation delay for digitized voicehalfway between 32 and 64 (compromise!)

    Cell headerCell format

  • ATM cell headerVCI: virtual channel IDwill change from link to link thru netPT: Payload type (e.g. RM cell versus data cell) CLP: Cell Loss Priority bitCLP = 1 implies low priority cell, can be discarded if congestionHEC: Header Error Checksumcyclic redundancy check

  • ATM Physical Layer (more)Two pieces (sublayers) of physical layer:Transmission Convergence Sublayer (TCS): adapts ATM layer above to PMD sublayer belowPhysical Medium Dependent: depends on physical medium being used

    TCS Functions:Header checksum generation: 8 bits CRC Cell delineationWith unstructured PMD sublayer, transmission of idle cells when no data cells to send

  • IP-Over-ATMClassic IP only 3 networks (e.g., LAN segments)MAC (802.3) and IP addressesIP over ATM replace network (e.g., LAN segment) with ATM networkATM addresses, IP addressesATMnetworkEthernetLANsEthernetLANs

  • IP-Over-ATMIssues:IP datagrams into ATM cellsfrom IP addresses to ATM addressesjust like IP addresses to MAC addresses!ATMnetworkEthernetLANs

  • Datagram Journey in IP-over-ATM Network at Source Host:IP layer maps between IP, ATM dest address (using ARP)passes datagram to AAL5 (ATM Adaptation Layer 5)AAL5 encapsulates data, segments cells, passes to ATM layer ATM network: moves cell along VC to destinationat Destination Host:AAL5 reassembles cells into original datagramif CRC OK, datagram is passed to IP

  • Summaryprinciples behind data link layer services:error detection, correctionsharing a broadcast channel: multiple accesslink layer addressing, ARPlink layer technologies: Ethernet, hubs, bridges, switches,IEEE 802.11 LANs, PPP, ATMjourney down the protocol stack now OVER!future stops: multimedia, security, network management

    **