Presentation is loading. Please wait.

Presentation is loading. Please wait.

5: DataLink Layer5-1 Chapter 5 Link Layer and LANs Computer Networking: A Top Down Approach 4 th edition. Jim Kurose, Keith Ross Addison-Wesley, July 2007.

Similar presentations

Presentation on theme: "5: DataLink Layer5-1 Chapter 5 Link Layer and LANs Computer Networking: A Top Down Approach 4 th edition. Jim Kurose, Keith Ross Addison-Wesley, July 2007."— Presentation transcript:

1 5: DataLink Layer5-1 Chapter 5 Link Layer and LANs Computer Networking: A Top Down Approach 4 th edition. Jim Kurose, Keith Ross Addison-Wesley, July Computer Networking: A Top Down Approach 5 th edition. Jim Kurose, Keith Ross Addison-Wesley, April 2009.

2 5: DataLink Layer5-2 Chapter 5: The Data Link Layer Our goals: r understand principles behind data link layer services: m error detection, correction m sharing a broadcast channel: multiple access m link layer addressing m reliable data transfer, flow control: done! r instantiation and implementation of various link layer technologies

3 5: DataLink Layer5-3 Link Layer r 5.1 Introduction and services r 5.2 Error detection and correction r 5.3Multiple access protocols r 5.4 Link-layer Addressing r 5.5 Ethernet r 5.6 Link-layer switches r 5.7 PPP r 5.8 Link virtualization: ATM, MPLS

4 5: DataLink Layer5-4 Link Layer: Introduction Some terminology: r hosts and routers are nodes r communication channels that connect adjacent nodes along communication path are links m wired links m wireless links m LANs r layer-2 packet is a frame, encapsulates datagram data-link layer has responsibility of transferring datagram from one node to adjacent node over a link

5 5: DataLink Layer5-5 Link layer: context r datagram transferred by different link protocols over different links: m e.g., Ethernet on first link, frame relay on intermediate links, on last link r each link protocol provides different services m e.g., may or may not provide rdt over link

6 5: DataLink Layer5-6 Link Layer Services r framing, link access: m encapsulate datagram into frame, adding header, trailer m channel access if shared medium m “MAC” addresses used in frame headers to identify source, dest different from IP address! r reliable delivery between adjacent nodes m we learned how to do this already (chapter 3)! m seldom used on low bit-error link (fiber, some twisted pair) m wireless links: high error rates Q: why both link-level and end-end reliability?

7 5: DataLink Layer5-7 Link Layer Services (more) r flow control: m pacing between adjacent sending and receiving nodes r error detection: m errors caused by signal attenuation, noise. m receiver detects presence of errors: signals sender for retransmission or drops frame r error correction: m receiver identifies and corrects bit error(s) without resorting to retransmission r half-duplex and full-duplex m with half duplex, nodes at both ends of link can transmit, but not at same time

8 5: DataLink Layer5-8 Where is the link layer implemented? r in each and every host r link layer implemented in “adaptor” (aka network interface card NIC) m Ethernet card, PCMCI card, card m implements link, physical layer r attaches into host’s system buses r combination of hardware, software, firmware controller physical transmission cpu memory host bus (e.g., PCI) network adapter card host schematic application transport network link physical

9 5: DataLink Layer5-9 Adaptors Communicating r sending side: m encapsulates datagram in frame m adds error checking bits, reliable data transfer (rdt), flow control, etc. r receiving side m looks for errors, rdt, flow control, etc m extracts datagram, passes to upper layer at receiving side controller sending host receiving host datagram frame

10 5: DataLink Layer5-10 Link Layer r 5.1 Introduction and services r 5.2 Error detection and correction r 5.3Multiple access protocols r 5.4 Link-layer Addressing r 5.5 Ethernet r 5.6 Link-layer switches r 5.7 PPP r 5.8 Link Virtualization: ATM. MPLS

11 5: DataLink Layer5-11 Error Detection EDC= Error Detection and Correction bits (redundancy) D = Data protected by error checking, may include header fields Error detection not 100% reliable! protocol may miss some errors, but rarely larger EDC field yields better detection and correction otherwise

12 5: DataLink Layer5-12 Parity Checking Single Bit Parity: Detect single bit errors Two Dimensional Bit Parity: Detect and correct single bit errors 0 0 Odd parity scheme Parity bit value is chosen such that number of 1’s send is odd. Ex. 9 1’s in the data, so the parity bit is ‘0’. (even parity)

13 5: DataLink Layer5-13 Internet checksum (review) Sender: r treat segment contents as sequence of 16-bit integers r checksum: addition (1’s complement sum) of segment contents r sender puts checksum value into UDP checksum field Receiver: r compute checksum of received segment r check if computed checksum equals checksum field value: m NO - error detected m YES - no error detected. But maybe errors nonetheless? Goal: detect “errors” (e.g., flipped bits) in transmitted packet (note: used at transport layer only)

14 5: DataLink Layer5-14 Checksumming: Cyclic Redundancy Check r view data bits, D, as a binary number r choose r+1 bit pattern (generator), G r goal: choose r CRC bits, R, such that m exactly divisible by G (modulo 2) m receiver knows G, divides by G. If non-zero remainder: error detected! m can detect all burst errors less than r+1 bits r widely used in practice ( WiFi, ATM)

15 5: DataLink Layer5-15 CRC Example Want: D. 2 r XOR R = nG equivalently: D. 2 r = nG XOR R equivalently: if we divide D. 2 r by G, want remainder R R = remainder[ ] D.2rGD.2rG

16 5: DataLink Layer5-16 Link Layer r 5.1 Introduction and services r 5.2 Error detection and correction r 5.3Multiple access protocols r 5.4 Link-layer Addressing r 5.5 Ethernet r 5.6 Link-layer switches r 5.7 PPP r 5.8 Link Virtualization: ATM, MPLS

17 5: DataLink Layer5-17 Multiple Access Links and Protocols Two types of “links”: r point-to-point m PPP for dial-up access m point-to-point link between Ethernet switch and host r broadcast (shared wire or medium) m old-fashioned Ethernet m upstream HFC (hybrid fiber-coaxial cable) m wireless LAN shared wire (e.g., cabled Ethernet) shared RF (e.g., WiFi) shared RF (satellite) humans at a cocktail party (shared air, acoustical)

18 5: DataLink Layer5-18 Multiple Access protocols r single shared broadcast channel r two or more simultaneous transmissions by nodes: interference m collision if node receives two or more signals at the same time multiple access protocol r distributed algorithm that determines how nodes share channel, i.e., determine when node can transmit r communication about channel sharing must use channel itself! m no out-of-band channel for coordination

19 5: DataLink Layer5-19 Ideal Multiple Access Protocol Broadcast channel of rate R bps 1. when one node wants to transmit, it can send at rate R. 2. when M nodes want to transmit, each can send at average rate R/M 3. fully decentralized: m no special node to coordinate transmissions m no synchronization of clocks, slots 4. simple

20 5: DataLink Layer5-20 MAC Protocols: a taxonomy Three broad classes: r Channel Partitioning m divide channel into smaller “pieces” (time slots, frequency, code) m allocate piece to node for exclusive use r Random Access m channel not divided, allow collisions m “recover” from collisions r “Taking turns” m nodes take turns, but nodes with more to send can take longer turns

21 5: DataLink Layer5-21 Channel Partitioning MAC protocols: TDMA TDMA: time division multiple access r access to channel in "rounds" r each station gets fixed length slot (length = pkt trans time) in each round r unused slots go idle r example: 6-station LAN, 1,3,4 have pkt, slots 2,5,6 idle slot frame

22 5: DataLink Layer5-22 Channel Partitioning MAC protocols: FDMA FDMA: frequency division multiple access r channel spectrum divided into frequency bands r each station assigned fixed frequency band r unused transmission time in frequency bands go idle r example: 6-station LAN, 1,3,4 have pkt, frequency bands 2,5,6 idle frequency bands time FDM cable

23 5: DataLink Layer5-23 Random Access Protocols r When node has packet to send m transmit at full channel data rate R. m no a priori coordination among nodes  two or more transmitting nodes ➜ “collision”, r random access MAC protocol specifies: m how to detect collisions (e.g., no Ack, or bad reception) m how to recover from collisions (e.g., via delayed retransmissions) r Examples of random access MAC protocols: m ALOHA m slotted ALOHA m CSMA: Carrier Sense Multiple Access, m CSMA/CD (Ethernet): CSMA with collision detection m CSMA/CA (WiFi ): CSMA with collision avoidance

24 5: DataLink Layer5-24 Random MAC (Medium Access Control) Techniques r ALOHA (‘70) [packet radio network] m A station sends whenever it has a packet/frame m Listens for round-trip-time delay for Ack m If no Ack then re-send packet/frame after random delay too short  more collisions too long  under utilization m No carrier sense is used m If two stations transmit about the same time frames collide m Utilization of ALOHA is low ~18%

25 5: DataLink Layer5-25 Pure (unslotted) ALOHA r unslotted Aloha: simple, no synchronization r when frame first arrives m transmit immediately r collision probability increases: m frame sent at t 0 collides with other frames sent in [t 0 -1,t 0 +1]

26 5: DataLink Layer5-26 Pure Aloha efficiency P(success by given node) = P(node transmits). P(no other node transmits in [t 0 -1,t 0 ]. P(no other node transmits in [t 0,t 0 +1] = p. (1-p) N-1. (1-p) N-1 = p. (1-p) 2(N-1) … choosing optimum p and then letting n -> infty... = 1/(2e) =.18 Very bad, can we do better?

27 5: DataLink Layer5-27 Slotted ALOHA Assumptions: r all frames same size r time divided into equal size slots (time to transmit 1 frame) r nodes start to transmit only slot beginning r nodes are synchronized r if 2 or more nodes transmit in slot, all nodes detect collision Operation: r when node obtains fresh frame, transmits in next slot m if no collision: node can send new frame in next slot m if collision: node retransmits frame in each subsequent slot with prob. p until success

28 5: DataLink Layer5-28 Slotted ALOHA Pros r single active node can continuously transmit at full rate of channel r highly decentralized: only slots in nodes need to be in sync r simple Cons r collisions, wasting slots r idle slots r nodes may be able to detect collision in less than time to transmit packet r clock synchronization

29 5: DataLink Layer5-29 Slotted Aloha efficiency r suppose: N nodes with many frames to send, each transmits in slot with probability p r prob that given node has success in a slot = p(1-p) N-1 r prob that any node has a success = Np(1-p) N-1 r max efficiency: find p* that maximizes Np(1-p) N-1 r for many nodes, take limit of Np*(1-p*) N-1 as N goes to infinity, gives: Max efficiency = 1/e =.37 Efficiency : long-run fraction of successful slots (many nodes, all with many frames to send) At best: channel used for useful transmissions 37% of time! !

30 5: DataLink Layer5-30 CSMA (Carrier Sense Multiple Access) CSMA: listen before transmit: If channel sensed idle: transmit entire frame r If channel sensed busy, defer transmission

31 5: DataLink Layer5-31 CSMA collisions collisions can still occur: propagation delay means two nodes may not hear each other’s transmission collision: entire packet transmission time wasted spatial layout of nodes note: role of distance & propagation delay in determining collision probability

32 5: DataLink Layer5-32 CSMA/CD (Collision Detection) CSMA/CD: carrier sensing, deferral as in CSMA m collisions detected within short time m colliding transmissions aborted, reducing channel wastage r collision detection: m easy in wired LANs: measure signal strengths, compare transmitted, received signals m difficult in wireless LANs: received signal strength overwhelmed by local transmission strength (use CSMA/CA: we’ll get back to that in Ch 6) r human analogy: the polite conversationalist

33 5: DataLink Layer5-33 CSMA/CD collision detection CSMA CSMA/CD

34 5: DataLink Layer5-34 Shared meduim bus

35 5: DataLink Layer5-35 More on CSMA/CD and Ethernet - uses broadcast and filtration: all stations on the bus receive the frame, but only the station with the appropriate data link D-L (MAC) destination address picks up the frame. For multicast, filteration may be done at the D-L layer or at the network layer (with more overhead)

36 5: DataLink Layer5-36 Analyzing CSMA/CD - Utilization or ‘efficiency’ is fraction of the time used for useful/successful data transmission Av. Time wasted ~ 5 Prop Collision Success TRANS

37 5: DataLink Layer u=TRANS/(TRANS+wasted)=TRANS/(TRA NS+5PROP)=1/(1+5a), where a=PROP/TRANS - if a is small, stations learn about collisions and u increases - if a is large, then u decreases

38 5: DataLink Layer5-38

39 5: DataLink Layer5-39 Collision detection in Wireless r Need special equipment to detect collision at receiver r We care about the collision at the reciever m 1. no-collision detected at sender but collision detected at receiver m 2. collision at sender but no collision at receiver r Neighborhood of sender and receiver are not the same (it’s not a shared wire, but define relatively (locally) to a node [hidden terminal problem] r … more later

40 5: DataLink Layer5-40 “Taking Turns” MAC protocols channel partitioning MAC protocols: m share channel efficiently and fairly at high load m inefficient at low load: delay in channel access, 1/N bandwidth allocated even if only 1 active node! Random access MAC protocols m efficient at low load: single node can fully utilize channel m high load: collision overhead “taking turns” protocols look for best of both worlds!

41 5: DataLink Layer5-41 “Taking Turns” MAC protocols Polling: r master node “invites” slave nodes to transmit in turn r typically used with “dumb” slave devices r concerns: m polling overhead m latency m single point of failure (master) master slaves poll data

42 5: DataLink Layer5-42 “Taking Turns” MAC protocols Token passing: r control token passed from one node to next sequentially. r token message r concerns: m token overhead m latency m single point of failure (token) T data (nothing to send) T

43 5: DataLink Layer5-43 Release after reception: utilization analysis - u=useful time/total time(useful+wasted) - u=T1+T2+…+TN/[T1+T2+..+TN+(N+1)PROP] - a=PROP/TRANS=PROP/E(Tn), where E(Tn) is the expected (average) transmission of a node Prop 1  2 Prop N  1 Prop token

44 5: DataLink Layer5-44 r u=  Ti/(  Ti+(N+1)PROP) ~1/(1+PROP/E(Tn)), where E(Tn)=  Ti/N r u=1/(1+a) for token ring r [compared to Ethernet u=1/(1+5a)]

45 5: DataLink Layer5-45

46 5: DataLink Layer5-46 r As the number of stations increases, less time for token passing, and u increases r for release after transmission u=1/(1+a/N), where N is the number of stations

47 5: DataLink Layer5-47 Summary of MAC protocols r channel partitioning, by time, frequency or code m Time Division, Frequency Division r random access (dynamic), m ALOHA, S-ALOHA, CSMA, CSMA/CD m carrier sensing: easy in some technologies (wire), hard in others (wireless) m CSMA/CD used in Ethernet m CSMA/CA used in r taking turns m polling from central site, token passing m Bluetooth, FDDI, IBM Token Ring

48 5: DataLink Layer5-48 LAN technologies Data link layer so far: m services, error detection/correction, multiple access Next: LAN technologies m Ethernet m addressing m switches m PPP

49 5: DataLink Layer5-49 Link Layer r 5.1 Introduction and services r 5.2 Error detection and correction r 5.3Multiple access protocols r 5.4 Link-Layer Addressing r 5.5 Ethernet r 5.6 Link-layer switches r 5.7 PPP r 5.8 Link Virtualization: ATM and MPLS

50 5: DataLink Layer5-50 Ethernet “dominant” wired LAN technology: r cheap $20 for NIC r first widely used LAN technology r simpler, cheaper than token LANs and ATM r kept up with speed race: 10 Mbps – 10 Gbps Metcalfe’s Ethernet sketch

51 5: DataLink Layer5-51 Star topology r bus topology popular through mid 90s m all nodes in same collision domain (can collide with each other) r today: star topology prevails m active switch in center m each “spoke” runs a (separate) Ethernet protocol (nodes do not collide with each other) switch bus: coaxial cable star

52 5: DataLink Layer5-52 Ethernet Frame Structure Sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame Preamble: r 7 bytes with pattern followed by one byte with pattern r used to synchronize receiver, sender clock rates

53 5: DataLink Layer5-53 Ethernet Frame Structure (more) r Addresses: 6 bytes m if adapter receives frame with matching destination address, or with broadcast address (eg ARP packet), it passes data in frame to network layer protocol m otherwise, adapter discards frame r Type: indicates higher layer protocol (mostly IP but others possible, e.g., Novell IPX, AppleTalk) r CRC: checked at receiver, if error is detected, frame is dropped

54 5: DataLink Layer5-54 Ethernet: Unreliable, connectionless r connectionless: No handshaking between sending and receiving NICs r unreliable: receiving NIC doesn’t send acks or nacks to sending NIC m stream of datagrams passed to network layer can have gaps (missing datagrams) m gaps will be filled if app is using TCP m otherwise, app will see gaps r Ethernet’s MAC protocol: unslotted CSMA/CD

55 5: DataLink Layer5-55 Ethernet CSMA/CD algorithm 1. NIC receives datagram from network layer, creates frame 2. If NIC senses channel idle, starts frame transmission. If NIC senses channel busy, waits until channel idle, then transmits. 3. If NIC transmits entire frame without detecting another transmission, NIC is done with frame !

56 5: DataLink Layer If NIC detects another transmission while transmitting, aborts and sends jam signal 5. After aborting, NIC enters exponential backoff: after mth collision, NIC chooses K at random from {0,1,2,…,2 m -1}. NIC waits K·512 bit times, returns to Step 2 (channel sensing) Ethernet CSMA/CD algorithm (contd.)

57 5: DataLink Layer5-57 Ethernet’s 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: r Goal: adapt retransmission attempts to estimated current load m heavy load: random wait will be longer r first collision: choose K from {0,1}; delay is K· 512 bit transmission times r after second collision: choose K from {0,1,2,3}… r after ten collisions, choose K from {0,1,2,3,4,…,1023} See/interact with Java applet on AWL Web site: highly recommended !

58 5: DataLink Layer5-58 CSMA/CD efficiency r T prop = max prop delay between 2 nodes in LAN r t trans = time to transmit max-size frame r efficiency increases (goes to 1) as m t prop decreases (goes to 0) m t trans increases (goes to infinity) [what if we increase bandwidth from 10Mbps to 100Mbps?] r better performance than ALOHA: and simple, cheap, decentralized !

59 5: DataLink Layer Ethernet Standards: Link & Physical Layers r many different Ethernet standards m common MAC protocol and frame format m different speeds: 2 Mbps, 10 Mbps, 100 Mbps, 1Gbps, 10G bps m different physical layer media: fiber, cable r Switched Ethernet: use frame bursting to increase utilization. Still CSMA/CD compatible application transport network link physical MAC protocol and frame format 100BASE-TX 100BASE-T4 100BASE-FX 100BASE-T2 100BASE-SX 100BASE-BX fiber physical layer copper (twister pair) physical layer

60 5: DataLink Layer5-60 Shared meduim bus

61 5: DataLink Layer5-61 Shared medium hub

62 5: DataLink Layer5-62 Switching hub

63 5: DataLink Layer5-63

64 5: DataLink Layer5-64

65 5: DataLink Layer5-65 Link Layer r 5.1 Introduction and services r 5.2 Error detection and correction r 5.3Multiple access protocols r 5.4 Link-Layer Addressing r 5.5 Ethernet r 5.6 Link-layer switches r 5.7 PPP r 5.8 Link Virtualization: ATM, MPLS

66 5: DataLink Layer5-66 MAC Addresses and ARP r 32-bit IP address: m network-layer address m used to get datagram to destination IP subnet r MAC (or Ethernet) address: m function: get frame from one interface to another physically-connected interface (same network) m 48 bit MAC address (for most LANs) burned in NIC ROM, also sometimes software settable

67 5: DataLink Layer5-67 LAN Addresses and ARP Each adapter on LAN has unique LAN address Broadcast address = FF-FF-FF-FF-FF-FF = adapter 1A-2F-BB AD D7-FA-20-B0 0C-C4-11-6F-E F7-2B LAN (wired or wireless)

68 5: DataLink Layer5-68 LAN Address (more) r MAC address allocation administered by IEEE r manufacturer buys portion of MAC address space (to assure uniqueness) r analogy: (a) MAC address: like Social Security Number (b) IP address: like postal address  MAC flat address ➜ portability m can move LAN card from one LAN to another r IP hierarchical address NOT portable m address depends on IP subnet to which node is attached

69 5: DataLink Layer5-69 ARP: Address Resolution Protocol r Each IP node (host, router) on LAN has ARP table r ARP table: IP/MAC address mappings for some LAN nodes m TTL (Time To Live): time after which address mapping will be forgotten (typically 20 min) Question: how to determine MAC address of B knowing B’s IP address? 1A-2F-BB AD D7-FA-20-B0 0C-C4-11-6F-E F7-2B LAN

70 5: DataLink Layer5-70 ARP protocol: Same LAN (network) r A wants to send datagram to B, and B’s MAC address not in A’s ARP table. r A broadcasts ARP query packet, containing B's IP address m dest MAC address = FF- FF-FF-FF-FF-FF m all machines on LAN receive ARP query r B receives ARP packet, replies to A with its (B's) MAC address m frame sent to A’s MAC address (unicast) r A caches (saves) IP-to- MAC address pair in its ARP table until information becomes old (times out) m soft state: information that times out (goes away) unless refreshed r ARP is “plug-and-play”: m nodes create their ARP tables without intervention from net administrator

71 5: DataLink Layer5-71 DHCP: Dynamic Host Configuration Protocol Goal: allow host to dynamically obtain its IP address from network server when joining network m support for mobile users joining network m host holds address only while connected and “on” (allowing address reuse) m renew address already in use r DHCP overview: m 1. host broadcasts “DHCP discover” msg m 2. DHCP server responds with “DHCP offer” msg m 3. host requests IP address: “DHCP request” msg m 4. DHCP server sends address: “DHCP ack” msg

72 5: DataLink Layer5-72 DHCP client-server scenario A B E DHCP server arriving DHCP client needs address in this ( /24) network

73 5: DataLink Layer5-73 DHCP client-server scenario DHCP server: arriving client time DHCP discover src : , 68 dest.: ,67 yiaddr: transaction ID: 654 DHCP offer src: , 67 dest: , 68 yiaddrr: transaction ID: 654 Lifetime: 3600 secs DHCP request src: , 68 dest:: , 67 yiaddrr: transaction ID: 655 Lifetime: 3600 secs DHCP ACK src: , 67 dest: , 68 yiaddrr: transaction ID: 655 Lifetime: 3600 secs

74 5: DataLink Layer5-74 Addressing: routing to another LAN R 1A-23-F9-CD-06-9B E6-E BB-4B CC-49-DE-D0-AB-7D A C-E8-FF B2-2F-54-1A-0F B BD-D2-C7-56-2A walkthrough: send datagram from A to B via R assume A knows B’s IP address r two ARP tables in router R, one for each IP network (LAN)

75 5: DataLink Layer5-75 r A creates IP datagram with source A, destination B r A uses ARP to get R’s MAC address for r A creates link-layer frame with R's MAC address as dest, frame contains A-to-B IP datagram r A’s NIC sends frame r R’s NIC receives frame r R removes IP datagram from Ethernet frame, sees its destined to B r R uses ARP to get B’s MAC address r R creates frame containing A-to-B IP datagram sends to B R 1A-23-F9-CD-06-9B E6-E BB-4B CC-49-DE-D0-AB-7D A C-E8-FF B2-2F-54-1A-0F B BD-D2-C7-56-2A

76 5: DataLink Layer5-76 Link Layer r 5.1 Introduction and services r 5.2 Error detection and correction r 5.3 Multiple access protocols r 5.4 Link-layer Addressing r 5.5 Ethernet r 5.6 Link-layer switches r 5.7 PPP r 5.8 Link Virtualization: ATM, MPLS

77 5: DataLink Layer5-77 Hubs … physical-layer (“dumb”) repeaters: m bits coming in one link go out all other links at same rate m all nodes connected to hub can collide with one another m no frame buffering m no CSMA/CD at hub: host NICs detect collisions twisted pair hub

78 5: DataLink Layer5-78 Switch r link-layer device: smarter than hubs, take active role m store, forward Ethernet frames m examine incoming frame’s MAC address, selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment, uses CSMA/CD to access segment r transparent m hosts are unaware of presence of switches r plug-and-play, self-learning m switches do not need to be configured

79 5: DataLink Layer5-79 Switch: allows multiple simultaneous transmissions r hosts have dedicated, direct connection to switch r switches buffer packets r Ethernet protocol used on each incoming link, but no collisions; full duplex m each link is its own collision domain r switching: A-to-A’ and B- to-B’ simultaneously, without collisions m not possible with dumb hub A A’ B B’ C C’ switch with six interfaces (1,2,3,4,5,6)

80 5: DataLink Layer5-80 Switch Table r Q: how does switch know that A’ reachable via interface 4, B’ reachable via interface 5? r A: each switch has a switch table, each entry: m (MAC address of host, interface to reach host, time stamp) r looks like a routing table! r Q: how are entries created, maintained in switch table? m something like a routing protocol? A A’ B B’ C C’ switch with six interfaces (1,2,3,4,5,6)

81 5: DataLink Layer5-81 Self-learning, forwarding: example A A’ B B’ C C’ A A’ Source: A Dest: A’ MAC addr interface TTL Switch table (initially empty) A 1 60 A A’ r frame destination unknown: flood A’ A r destination A location known: A’ 4 60 selective send

82 5: DataLink Layer5-82 Interconnecting switches r switches can be connected together A B r Q: sending from A to F - how does S 1 know to forward frame destined to F via S 4 and S 3 ? r A: self learning! (works exactly the same as in single-switch case!) S1S1 C D E F S2S2 S4S4 S3S3 H I G

83 5: DataLink Layer5-83 Example Institutional network to external network router IP subnet mail server web server

84 5: DataLink Layer5-84 Switches vs. Routers r both store-and-forward devices m routers: network layer devices (examine network layer headers) m switches are link layer devices r routers maintain routing tables, implement routing algorithms r switches maintain switch tables, implement filtering, learning algorithms

85 5: DataLink Layer5-85 Summary comparison

86 5: DataLink Layer5-86 Link Layer r 5.1 Introduction and services r 5.2 Error detection and correction r 5.3Multiple access protocols r 5.4 Link-Layer Addressing r 5.5 Ethernet r 5.6 Hubs and switches r 5.7 PPP r 5.8 Link Virtualization: ATM and MPLS

87 5: DataLink Layer5-87 Cerf & Kahn’s Internetwork Architecture What is virtualized? r two layers of addressing: internetwork and local network r new layer (IP) makes everything homogeneous at internetwork layer r underlying local network technology m cable m satellite m 56K telephone modem m today: ATM, MPLS … “invisible” at internetwork layer. Looks like a link layer technology to IP!

88 5: DataLink Layer5-88 ATM and MPLS r ATM, MPLS separate networks in their own right m different service models, addressing, routing from Internet r viewed by Internet as logical link connecting IP routers m just like dialup link is really part of separate network (telephone network) r ATM, MPLS: of technical interest in their own right

89 5: DataLink Layer5-89 Asynchronous Transfer Mode: ATM r 1990’s/00 standard for high-speed (155Mbps to 622 Mbps and higher) Broadband Integrated Service Digital Network architecture r Goal: integrated, end-end transport of carry voice, video, data m meeting timing/QoS requirements of voice, video (versus Internet best-effort model) m “next generation” telephony: technical roots in telephone world m packet-switching (fixed length packets, called “cells”) using virtual circuits

90 5: DataLink Layer5-90 Circuit switching vs. Packet switching vs. Virtual circuit r Circuit switching m Example: Telephone network - constant bit rate - limits heterogeneity - uses TDM => wastes bandwidth - routing is done at call setup - failures need tear down and re-establishment - all data follow the same path - processing at each node is minimum

91 5: DataLink Layer5-91 Packet switching r Example: Internet, IP - store & forward - accommodates heterogeneity and data rate conversion - statistical multiplexing => higher efficiency - routing information is added - overhead with respect to processing and bandwidth

92 5: DataLink Layer dynamic routing - more robust to failures - may introduce jitter if packets follow different paths - store & forward introduce queuing delays - can provide priorities and differentiated services Packet switching (contd.)

93 5: DataLink Layer5-93 Virtual circuit r Example: ATM - routing at call set-up, prior to data transfer - path is not dedicated, still uses store & forward, statistical multiplexing - no routing decision per packet - packets follow same path

94 5: DataLink Layer5-94 ATM architecture r adaptation layer: only at edge of ATM network m data segmentation/reassembly m roughly analagous to Internet transport layer r ATM layer: “network” layer m cell switching, routing r physical layer physical ATM AAL physical ATM AAL physical ATM physical ATM end system switch

95 5: DataLink Layer5-95 ATM: network or link layer? Vision: end-to-end transport: “ATM from desktop to desktop” m ATM is a network technology Reality: used to connect IP backbone routers m “IP over ATM” m ATM as switched link layer, connecting IP routers ATM network IP network

96 5: DataLink Layer5-96 ATM Adaptation Layer (AAL) r ATM Adaptation Layer (AAL): “adapts” upper layers (IP or native ATM applications) to ATM layer below r AAL present only in end systems, not in switches r AAL layer segment (header/trailer fields, data) fragmented across multiple ATM cells m analogy: TCP segment in many IP packets physical ATM AAL physical ATM AAL physical ATM physical ATM end system switch

97 5: DataLink Layer5-97 ATM Adaptation Layer (AAL) [more] Different versions of AAL layers, depending on ATM service class: r AAL1: for CBR (Constant Bit Rate) services, e.g. circuit emulation r AAL2: for VBR (Variable Bit Rate) services, e.g., MPEG video r AAL5: for data (eg, IP datagrams) AAL PDU ATM cell User data

98 5: DataLink Layer5-98 ATM Layer Service: transport cells across ATM network r analogous to IP network layer r very different services than IP network layer Network Architecture Internet ATM Service Model best effort CBR VBR ABR UBR Bandwidth none constant rate guaranteed rate guaranteed minimum none Loss no yes no Order no yes Timing no yes no Congestion feedback no (inferred via loss) no congestion no congestion yes no Guarantees ? (studied earlier)

99 5: DataLink Layer5-99 ATM Layer: Virtual Circuits r VC transport: cells carried on VC from source to dest m call setup, teardown for each call before data can flow m each packet carries VC identifier (not destination ID) m every switch on source-dest path maintain “state” for each passing connection m link,switch resources (bandwidth, buffers) may be allocated to VC: to get circuit-like perf. r Permanent VCs (PVCs) m long lasting connections m typically: “permanent” route between to IP routers r Switched VCs (SVC): m dynamically set up on per-call basis

100 5: DataLink Layer5-100 ATM VCs r Advantages of ATM VC approach: m QoS performance guarantee for connection mapped to VC (bandwidth, delay, delay jitter) r Drawbacks of ATM VC approach: m Inefficient support of datagram traffic  one PVC between each source/dest pair) does not scale ( n.(n-1) connections needed) m SVC introduces call setup latency, processing overhead for short lived connections r VCI: VC Identifier, used for routing/switching m Has local significance (unlike IP addresses) m Identifies a segment of a path for a flow (or bundle of flows, called virtual path VP), to simplify switching m May change from one link to another

101 5: DataLink Layer5-101 ATM Layer: ATM cell r 5-byte ATM cell header r 48-byte payload m Why?: small payload -> short cell-creation delay for digitized voice m halfway between 32 and 64 (compromise!) Cell header Cell format (5 bytes) (53 bytes)

102 5: DataLink Layer5-102 ATM cell header r VCI: virtual channel ID m will change from link to link through the network r PT: Payload type (e.g. RM cell versus data cell) r CLP: Cell Loss Priority bit m CLP = 1 implies low priority cell, can be discarded if congestion r HEC: Header Error Checksum m cyclic redundancy check

103 5: DataLink Layer5-103 IP-Over-ATM Classic IP only r 3 “networks” (e.g., LAN segments) r MAC (802.3) and IP addresses IP over ATM r replace “network” (e.g., LAN segment) with ATM network r ATM addresses, IP addresses ATM network Ethernet LANs Ethernet LANs

104 5: DataLink Layer5-104 IP-Over-ATM AAL ATM phy Eth IP ATM phy ATM phy app transport IP AAL ATM phy app transport IP Eth phy Border Router/switch

105 5: DataLink Layer5-105 Datagram Journey in IP-over-ATM Network r at Source Host: m IP layer maps between IP, ATM dest address (using ARP) m passes datagram to AAL5 m AAL5 encapsulates data, segments cells, passes to ATM layer r ATM network: moves cell along VC to destination r at Destination Host: m AAL5 reassembles cells into original datagram m if CRC OK, datagram is passed to IP

106 5: DataLink Layer5-106 IP-Over-ATM Issues: r IP datagrams into ATM AAL5 PDUs r from IP addresses to ATM addresses m just like IP addresses to Ethernet MAC addresses! ATM network Ethernet LANs

107 5: DataLink Layer5-107 Multiprotocol label switching (MPLS) [to cover with network (IP) layer] r initial goal: speed up IP forwarding by using fixed length label (instead of IP address) to do forwarding m borrowing ideas from Virtual Circuit (VC) approach m but IP datagram still keeps IP address! PPP or Ethernet header IP header remainder of link-layer frame MPLS header label Exp S TTL

108 5: DataLink Layer5-108 MPLS capable routers r a.k.a. label-switched router r forward packets to outgoing interface based only on label value (do not inspect IP address) m MPLS forwarding table distinct from IP forwarding tables r signaling protocol needed to set up forwarding m RSVP-TE m forwarding possible along paths that IP alone would not allow (e.g., source-specific routing) !! m use MPLS for traffic engineering r must co-exist with IP-only routers

109 5: DataLink Layer5-109 R1 R2 D R3 R4 R A R6 in out out label label dest interface 6 - A 0 in out out label label dest interface 10 6 A D 0 in out out label label dest interface 10 A 0 12 D 0 1 in out out label label dest interface 8 6 A A 1 MPLS forwarding tables

110 5: DataLink Layer5-110 Chapter 5: Summary r principles behind data link layer services: m error detection, correction m sharing a broadcast channel: multiple access m link layer addressing r instantiation and implementation of various link layer technologies m Ethernet m switched LANS m PPP m virtualized networks as a link layer: ATM, MPLS

111 5: DataLink Layer5-111 Chapter 5: let’s take a breath r journey down protocol stack complete (except routing, PHY) r solid understanding of networking principles, practice r ….. could stop here …. but lots of interesting topics! m Wireless mobile networks … among others!

Download ppt "5: DataLink Layer5-1 Chapter 5 Link Layer and LANs Computer Networking: A Top Down Approach 4 th edition. Jim Kurose, Keith Ross Addison-Wesley, July 2007."

Similar presentations

Ads by Google