transferring datagram from one node data-link layer has responsibility of to adjacent node over a link 5-1 TDTS06 Computer networks

Similar documents
The Link Layer and LANs. Chapter 6: Link layer and LANs

Chapter 5 Link Layer and LANs

CS 455/555 Intro to Networks and Communications. Link Layer

CMPE 150/L : Introduction to Computer Networks. Chen Qian Computer Engineering UCSC Baskin Engineering Lecture 16

CSC 4900 Computer Networks: The Link Layer

Chapter 5: Link layer

Lecture 6. Data Link Layer (cont d) Data Link Layer 1-1

Chapter 5 Link Layer. Computer Networking: A Top Down Approach. 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012

Chapter V: Link Layer

Lecture 8 Link Layer: functionality, error detection, media access algorithm

CSC 401 Data and Computer Communications Networks

Topics. Link Layer Services (more) Link Layer Services LECTURE 5 MULTIPLE ACCESS AND LOCAL AREA NETWORKS. flow control: error detection:

Chapter 5 Link Layer and LANs

CC451 Computer Networks

Master Course Computer Networks IN2097

Module 10 Data Link Layer CS655! 10-1!

ECE 4450:427/527 - Computer Networks Spring 2017

Lecture 6 The Data Link Layer. Antonio Cianfrani DIET Department Networking Group netlab.uniroma1.it

Chapter V: Link Layer

Master Course Computer Networks IN2097

Chapter 6 The Link Layer and LANs

Link Layer and LANs 안상현서울시립대학교컴퓨터 통계학과.

Adaptors Communicating. Link Layer: Introduction. Parity Checking. Error Detection. Multiple Access Links and Protocols

Data Link Layer: Multi Access Protocols

Link Layer and LANs. CMPS 4750/6750: Computer Networks

Lecture 5 The Data Link Layer. Antonio Cianfrani DIET Department Networking Group netlab.uniroma1.it

Link Layer: Introduction. Chapter 5 Link Layer & LANS. Link layer: context. Link Layer Services

Link Layer and LANs. Our Goals. Link Layer

Outline. Introduction to Networked Embedded Systems - Embedded systems Networked embedded systems Embedded Internet - Network properties

Adaptors Communicating. Link Layer: Introduction. Parity Checking. Error Detection. Multiple Access Links and Protocols

Computer Networks. Today. Principles of datalink layer services Multiple access links Adresavimas, ARP LANs Wireless LANs VU MIF CS 1/48 2/48

1-1. Switching Networks (Fall 2010) EE 586 Communication and. November 8, Lecture 30

Module 4 Data Link Layer CS655! 4-1!

Link Layer: Introduction. Chapter 5 Link Layer & LANS. Link layer: context. Link Layer Services

Broadcast Links, Addressing and Media Access Control. Link Layer B. Link and Physical Layers. MAC Addresses

Multiple Access Links and Protocols

Lecture 19. Principles behind data link layer services Framing Multiple access protocols

Chapter 5 Link Layer. Computer Networking: A Top Down Approach. 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012

Lecture 8 The Data Link Layer part I. Antonio Cianfrani DIET Department Networking Group netlab.uniroma1.it

Chapter 5 Link Layer. Computer Networking: A Top Down Approach. 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012

Chapter 6: Link layer and LANs. Link layer, LANs: outline. Link layer: introduction. Link layer: context. Link layer services (more)

CMPE 150: Introduction to Computer Networks

Chapter 5 Link Layer and LANs

CS 43: Computer Networks Media Access. Kevin Webb Swarthmore College November 30, 2017

CS 43: Computer Networks. 27: Media Access Contd. December 3, 2018

Link layer, LANs: outline. Chapter 5-1 Link Layer. Link layer: introduction. Link layer services

Link Layer: Introduction. Chapter 5 Link Layer & LANS. Link layer: context. Link Layer Services

CSC 8560 Computer Networks: Link Layer

Chapter 4 Network Layer

CSCI Computer Networks Spring 2017

CSCI Computer Networks Fall 2016

Chapter 5: DataLink Layer

Medium Access Control

Chapter 5 Link Layer. Computer Networking: A Top Down Approach. 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012

Data Link Layer: Overview, operations

Chapter 5 Link Layer. Link Layer 5-1

Chapter 5: The Data Link Layer

Links. CS125 - mylinks 1 1/22/14

Chapter 6 The Link Layer and LANs

Links Reading: Chapter 2. Goals of Todayʼs Lecture. Message, Segment, Packet, and Frame

CS 43: Computer Networks Switches and LANs. Kevin Webb Swarthmore College December 5, 2017

Computer Networks Medium Access Control. Mostafa Salehi Fall 2008

Chapter 6 The Link Layer and LANs

Chapter 6 The Link Layer and LANs

Chapter 4. DataLink Layer. Reference: Computer Networking: A Top Down Approach 4 th edition. Jim Kurose, Keith Ross Addison-Wesley, July 2007.

Chapter 6 The Link Layer and LANs

CSCD 330 Network Programming

Links. Error Detection. Link Layer. Multiple access protocols. Nodes Links Frame. Shared channel Problem: collisions How nodes share a channel

Principles behind data link layer services

Chapter 6 The Data Link layer

CSC 4900 Computer Networks: Link Layer (2)

Redes de Computadores. Medium Access Control

SC250 Computer Networking I. Link Layer. Prof. Matthias Grossglauser LCA/I&C.

Computer Network Fundamentals Spring Week 3 MAC Layer Andreas Terzis

Chapter 5: The Data Link Layer. Chapter 5 Link Layer and LANs. Ethernet. Link Layer. Star topology. Ethernet Frame Structure.

MULTIPLE ACCESS PROTOCOLS 2. 1

Chapter 5 Link Layer and LANs

The Link Layer and LANs: Ethernet and Swiches

Lecture 6 - Link layer. Lecture 5 Review. Link Layer. Introduction, Services. Notes. Notes. Notes. Notes. Networks and Security. Jacob Aae Mikkelsen

Chapter 5: Link layer

Chapter 6 The Link Layer and LANs

Physical Layer. Medium Access Links and Protocols. Point-to-Point protocols. Modems: Signaling. Modems Signaling. Srinidhi Varadarajan

Chapter 5 Data Link Layer

Summary of MAC protocols

Principles behind data link layer services:

Principles behind data link layer services:

CS 3516: Advanced Computer Networks

Chapter 6 The Link Layer and LANs

CSCD 330 Network Programming Fall 2012

Chapter 6 The Data Link layer

Chapter 5 Data Link Layer

Lecture 9 The Data Link Layer part II. Antonio Cianfrani DIET Department Networking Group netlab.uniroma1.it

CS 455/555 Intro to Networks and Communications. Link Layer Addressing, Ethernet, and a Day in the Life of a Web Request

Principles behind data link layer services:

CMPE 150/L : Introduction to Computer Networks. Chen Qian Computer Engineering UCSC Baskin Engineering Lecture 18

Review. Error Detection: CRC Multiple access protocols. LAN addresses and ARP Ethernet. Slotted ALOHA CSMA/CD

COMP211 Chapter 6/7 Link Layer

Link Layer and Ethernet

High Level View. EE 122: Ethernet and Random Access protocols. Medium Access Protocols

Medium Access Protocols

Transcription:

TDTS06 Computer networks Lecture 7: The link layer I Link Layer: Introduction Some terminology: hosts and routers are nodes communication channels that connect adjacent nodes along communication path are links wired links wireless links LANs layer-2 packet is a frame, encapsulates datagram Juha Takkinen, juhta@ida.liu.se IDA/ADIT, Linköpings universitet 2010-09-27 data-link layer has responsibility of transferring datagram from one node to adjacent node over a link Slides are modified from J.F Kurose and K.W. Ross 5-1 2010-09-27 TDTS06 Lecture 7: Link layer I 5-2 Link layer: context Link Layer Services framing, link access reliable delivery between adjacent nodes flow control error detection error correction half-duplex and full-duplex Q: why both link-level and end-end reliability? 2010-09-27 5-3 5-4 1

Where is the link layer implemented? Adaptors Communicating in each and every host link layer implemented in adaptor (aka network interface card NIC) Ethernet card, PCMCIA card, 802.11 card implements link, physical layer attaches into host s system buses combination of hardware, software, firmware application transport network link link physical cpu memory controller physical transmission host schematic host bus (e.g., PCI) network adapter card datagram datagram sending side: controller controller sending host receiving host encapsulates datagram in frame adds error checking bits, rdt, flow control, etc. receiving side looks for errors, rdt, flow control, etc extracts datagram, passes to upper layer at receiving side 5-5 2010-09-27 TDTS06 Lecture 7: Link layer I 5-6 frame datagram Error Detection Parity Checking EDC= Error Detection and Correction bits (redundancy) D = Data protected by error checking, may include header fields Single Bit Parity: Detect single bit errors Two Dimensional Bit Parity: Detect and correct single bit errors Error detection not 100% reliable! protocol may miss some errors, but rarely larger EDC field yields better detection and correction otherwise 0 0 5-7 5-8 2

Internet checksum (review) Goal: detect errors (e.g., flipped bits) in transmitted packet (note: used at transport layer only) Sender: treat segment as seq of 16-bit integers checksum: addition (1 s complement sum) of segment contents sender puts value into UDP checksum field Receiver: compute checksum of received segment check if computed checksum equals checksum field value: NO - error detected YES - no error detected. But maybe errors nonetheless? 1 1 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 1 1 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 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 wraparound sum checksum 1 1 0 1 1 1 0 1 1 1 0 1 1 1 0 1 1 1 1 0 1 1 1 0 1 1 1 0 1 1 1 1 0 0 1 0 1 0 0 0 1 0 0 0 1 0 0 0 0 1 1 D. 2 r R = remainder[ G ] 5-9 5-10 Checksumming: Cyclic Redundancy Check Common CRC polynomials (G) view data bits, D, as a binary number choose r+1 bit pattern (generator polynomial), G goal: choose r CRC bits, R, such that <D,R> exactly divisible by G (modulo 2) receiver knows G, divides <D,R> by G. If non-zero remainder: error detected! can detect all burst errors less than r+1 bits widely used in practice (802.11 WiFi, ATM) CRC-8-ATM: x 8 + x 2 + x + 1 CRC-10: x 10 + x 9 + x 5 + x 4 + x + 1 CRC-12: x 12 + x 11 + x 3 + x 2 + x + 1 (telecom systems) CRC-16-IBM: x 16 + x 15 + x 2 + 1 (xmodem, USB) CRC-16-CCITT: x 16 + x 12 + x 5 + 1 (X.25, V.41, PPP, Bluetooth) CRC-32-IEEE 802.3: x 32 + x 26 + x 23 + x 22 + x 16 + x 12 + + x 11 + x 10 + x 8 + x 7 + x 5 + x 4 + x 2 + x + 1 (Ethernet) 5-11 5-12 3

Link types Two types of links : point-to-point PPP for dial-up access point-to-point link between Ethernet switch and host broadcast (shared wire or medium) (our focus!) old-fashioned Ethernet upstream Hybrid Fibre Coax (HFC) 802.11 wireless LAN Shared medium single shared broadcast channel two or more simultaneous transmissions by nodes: interference collision if node receives two or more signals at the same time Medium Access Control (MAC) protocol distributed algorithm that determines how nodes share channel, i.e., determine when node can transmit communication about channel sharing must use channel itself! no out-of-band channel for coordination shared wire (e.g., cabled Ethernet) shared RF (e.g., 802.11 WiFi) shared RF (satellite) humans at a cocktail party (shared air, acoustical) 5-13 5-14 MAC Protocols: a taxonomy 1a. Channel Partitioning MAC protocols: TDMA Three broad classes: 1. Channel Partitioning divide channel into smaller pieces (time slots, frequency, code) allocate piece to node for exclusive use 2. Random Access channel not divided, allow collisions recover from collisions 3. Taking turns (Round Robin) nodes take turns, but nodes with more to send can take longer turns TDMA: time division multiple access access to channel in "rounds" each station gets fixed length slot (length = pkt trans time) in each round unused slots go idle example: 6-station LAN, 1, 3, 4 have pkt, slots 2, 5, 6 idle 6-slot frame 1 3 4 1 3 4 5-15 5-16 4

1b. Channel Partitioning MAC protocols: FDMA 2. Random Access Protocols FDMA: frequency division multiple access channel spectrum divided into frequency bands each station assigned fixed frequency band unused transmission time in frequency bands go idle example: 6-station LAN, 1, 3, 4 have pkt, frequency bands 2, 5, 6 idle 5-17 5-18 5 frequency bands FDM cable When node has packet to send transmit at full channel data rate R. no a priori coordination among nodes two or more transmitting nodes collision, random access MAC protocol specifies: how to detect collisions how to recover from collisions (e.g., via delayed retransmissions) Examples of random access MAC protocols: slotted ALOHA, ALOHA CSMA, CSMA/CD, CSMA/CA Example random access: Slotted ALOHA Slotted ALOHA Assumptions: all frames same size time divided into equal size slots (time to transmit 1 frame) nodes start to transmit only slot beginning nodes are synchronized if 2 or more nodes transmit in slot, all nodes detect collision Operation: when node obtains fresh frame, transmits in next slot if no collision: node can send new frame in next slot if collision: node retransmits frame in each subsequent slot with prob. p until success 5-19 Pros single active node can continuously transmit at full rate of channel highly decentralized: only slots in nodes need to be in sync simple Cons collisions, wasting slots idle slots nodes may be able to detect collision in less than time to transmit packet clock synchronization 5-20

Slotted Aloha efficiency Efficiency : long-run fraction of successful slots (many nodes, all with many frames to send) suppose: N nodes with many frames to send, each transmits in slot with probability p prob that given node has success in a slot = p(1-p) N-1 prob that any node has a success = Np(1-p) N-1 max efficiency: find p* that maximizes Np(1-p) N-1 for many nodes, take limit of Np*(1-p*) N-1 as N goes to infinity, gives: Max efficiency = 1/e =.37 At best: channel! used for useful transmissions 37 % of time! 5-21 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 even worse than slotted Aloha! 5-23 Pure (unslotted) ALOHA unslotted Aloha: simpler, no synchronization when frame first arrives transmit immediately collision probability increases: frame sent at t 0 collides with other frames sent in [t 0-1,t 0 +1] 5-22 CSMA (Carrier Sense Multiple Access) CSMA: listen before transmit: If channel sensed idle: transmit entire frame If channel sensed busy, defer transmission human analogy: don t interrupt others! 5-24 6

CSMA collisions CSMA/CD (Collision Detection) CSMA/CD: carrier sensing, deferral as in CSMA collisions detected within short time colliding transmissions aborted, reducing channel wastage collision detection: easy in wired LANs: measure signal strengths, compare transmitted, received signals difficult in wireless LANs: received signal strength overwhelmed by local transmission strength human analogy: the polite conversationalist 5-25 5-26 CSMA/CD collision detection Taking Turns MAC protocols Polling: master node invites slave nodes to transmit in turn typically used with dumb slave devices concerns: polling overhead latency slaves data data poll master single point of failure (master) 5-27 5-28 7

Taking Turns MAC protocols Summary of MAC protocols Token passing: control token passed from one node to next sequentially. token message concerns: token overhead latency single point of failure (token) (nothing to send) T T channel partitioning, by time, frequency or code Time Division, Frequency Division random access (dynamic), ALOHA, S-ALOHA, CSMA, CSMA/CD carrier sensing: easy in some technologies (wire), hard in others (wireless) CSMA/CD used in Ethernet (802.3) CSMA/CA used in WiFi (802.11) taking turns polling from central site, token passing Bluetooth (part of 802.15), FDDI, IBM Token Ring data 5-29 5-30 LAN Addresses ARP: Address Resolution Protocol Each adapter on LAN has unique LAN address 71-65-F7-2B-08-53 LAN (wired or wireless) 1A-2F-BB-76-09-AD 58-23-D7-FA-20-B0 Broadcast address = FF-FF-FF-FF-FF-FF = adapter Question: how to determine MAC address of B knowing B s IP address? 137.196.7.23 71-65-F7-2B-08-53 LAN 137.196.7.78 1A-2F-BB-76-09-AD 137.196.7.14 58-23-D7-FA-20-B0 Each IP node (host, router) on LAN has ARP table ARP 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) 0C-C4-11-6F-E3-98 137.196.7.88 0C-C4-11-6F-E3-98 5-31 5-32 8

ARP protocol: addressing same LAN ARP protocol: addressing another LAN A wants to send datagram to B, and B s MAC address not in A s ARP table. A broadcasts ARP query packet, containing B's IP address dest MAC address = FF- FF-FF-FF-FF-FF all machines on LAN receive ARP query B receives ARP packet, replies to A with its (B's) MAC address frame sent to A s 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 refreshed ARP is plug-and-play : nodes create their ARP tables without intervention from net administrator Send a frame to 222.222.222.220 directly from A? Does not work! MAC address not visible in 111 network. 74-29-9C-E8-FF-55 A 111.111.111.111 111.111.111.112 CC-49-DE-D0-AB-7D assume A knows B s IP address two ARP tables in router R, one for each IP network (LAN) R E6-E9-00-17-BB-4B 1A-23-F9-CD-06-9B 222.222.222.220 111.111.111.110 88-B2-2F-54-1A-0F 222.222.222.221 222.222.222.222 B 49-BD-D2-C7-56-2A This is a really important example make sure you understand! 5-33 5-34 Ethernet Star topology bus topology popular through mid 1990s all nodes in same collision domain (can collide with each other) today: star topology prevails active switch in center each spoke runs a (separate) Ethernet protocol (nodes do not collide with each other) switch Metcalfe s Ethernet sketch bus: coaxial cable star 5-35 5-36 9

Ethernet Frame Structure Ethernet CSMA/CD algorithm Remember: Give peas a chance 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 + wait IFG (interframe gap), then transmits 3. If NIC transmits entire frame without detecting another transmission, NIC is done with frame! 4. If NIC detects another transmission while transmitting, aborts and sends jam signal 46 bits 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 5-37 2010-09-27 TDTS06 Lecture 7: Link layer I 5-38 Ethernet s CSMA/CD (more) CSMA/CD efficiency 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 See/interact with Java applet on AWL Web site: highly recommended! Exponential Backoff: Goal: adapt retransmission attempts to estimated current load heavy load: random wait will be longer first collision: choose K from {0,1}; delay is K 512 bit transmission times after second collision: choose K from {0,1,2,3} after ten collisions, choose K from {0,1,2,3,4,,1023} T prop = max prop delay between 2 nodes in LAN t trans = time to transmit max-size frame efficiency efficiency goes to 1 as t prop goes to 0 as t trans goes to infinity better performance than ALOHA: and simple, cheap, decentralized! = 1 + 5 t 1 prop/t trans 5-39 5-40 10

CSMA/CD efficiency, cont d 5-41 Hubs physical-layer ( dumb ) repeaters: bits coming in one link go out all other links at same rate all nodes connected to hub can collide with one another no frame buffering no CSMA/CD at hub: host NICs detect collisions twisted pair hub 5-43 802.3 Ethernet Standards: Link & Physical Layers application transport network link physical 100BASE-TX 100BASE-T4 MAC protocol and frame format 100BASE-T2 100BASE-FX 100BASE-SX 100BASE-BX copper (twisted pair) physical layer fiber physical layer Supplement Year Description 802.3a 1985 10 BASE-2 thin Ethernet 802.3c 1985 10 Mbps repeater specification 802.3d 1987 Fiber Optic Inter Repeater Link 802.3i 1990 10 BASE-T twisted pair 802.3j 1993 10 BASE-F fiber optic 802.3u 1995 100 BASE-T Fast Ethernet and auto negotiation 802.3x 1997 Full duplex standard 802.3z 1998 1000 BASE-X Gigabit Ethernet SX, LX, CX 802.3ab 1999 1000 BASE-T Gigabit Ethernet over twisted pair 802.3ac 1998 Frame size extension to 1522 bytes for VLAN tag 2010-09-27 802.3ad 2000 Link TDTS06 aggregation Lecture 7: Link for layer parallel I links 5-42 Switch link-layer device: smarter than hubs, takes active role transparent plug-and-play, selflearning switching: A-to-A and B- to-b simultaneously, without collisions not possible with dumb hub C B 6 5 A 1 2 3 4 A B switch with six interfaces (1,2,3,4,5,6) C 5-44 11

Switch Table Q: how does switch know that A reachable via interface 4, B reachable via interface 5? A: each switch has a switch table, each entry: (MAC address of host, interface to reach host, time stamp) looks like a routing table! Q: how are entries created, maintained in switch table? something like a routing protocol? C B 6 5 A 1 2 3 4 A B switch with six interfaces (1,2,3,4,5,6) C Switch: self-learning switch learns which hosts can be reached through which interfaces when frame received, switch learns location of sender: incoming LAN segment records sender/location pair in switch table C B MAC addr interface TTL 6 A 1 60 5 A 1 2 3 4 A A A Source: A Dest: A B C Switch table (initially empty) 5-45 5-46 Self-learning, forwarding: example C A A A Source: A Dest: A B Interconnecting: Institutional network Switch frame destination unknown: flood destination A location known: selective send B A 6 A 5 1 2 3 A A 4 A C to external network router S 4 mail server web server IP subnet MAC addr interface TTL A 1 60 A 4 60 Switch table (initially empty) A S 1 S 2 S 3 F 5-47 2010-09-27 TDTS06 Lecture 7: Link layer I 5-48 12