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

Similar documents
Chapter 5: Link layer

Data Link Layer: Multi Access Protocols

Chapter 5 Link Layer and LANs

CSC 4900 Computer Networks: The Link Layer

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

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

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

CC451 Computer Networks

ECE 4450:427/527 - Computer Networks Spring 2017

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

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

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

Chapter 6 The Link Layer and LANs

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

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

CSC 401 Data and Computer Communications Networks

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

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

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

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

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

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

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

CMPE 150: Introduction to Computer Networks

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

Chapter 5 Link Layer and LANs

Master Course Computer Networks IN2097

Principles behind data link layer services:

Chapter 5 Link Layer and LANs

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

Chapter V: Link Layer

Data Link Layer. Our goals: understand principles behind data link layer services: instantiation and implementation of various link layer technologies

MULTIPLE ACCESS PROTOCOLS 2. 1

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

Principles behind data link layer services

Links. CS125 - mylinks 1 1/22/14

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

Master Course Computer Networks IN2097

Multiple Access Links and Protocols

Principles behind data link layer services:

Principles behind data link layer services:

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

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

Chapter 4 Network Layer

Computer Network Fundamentals Spring Week 3 MAC Layer Andreas Terzis

Chapter V: Link Layer

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

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

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

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

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

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

Chapter 5: DataLink Layer

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

Link layer: introduction

CSC 8560 Computer Networks: Link Layer

Module 10 Data Link Layer CS655! 10-1!

Data Link Layer: Overview, operations

CSCI Computer Networks Spring 2017

CSCI Computer Networks Fall 2016

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

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

Summary of MAC protocols

Link Layer and LANs. Our Goals. Link Layer

Message, Segment, Packet, and Frame Link-layer services Encoding, framing, error detection, transmission control Error correction and flow control

Computer Networks Medium Access Control. Mostafa Salehi Fall 2008

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

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

CSEN 503 Introduction to Communication Networks. Mervat AbuElkheir Hana Medhat Ayman Dayf. **Slides are attributed to J. F. Kurose

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

Module 4 Data Link Layer CS655! 4-1!

Medium Access Control

Chapter 6 The Link Layer and LANs

Chapter 5 Link Layer and LANs

Goals of Today s Lecture. Adaptors Communicating

Chapter 4 roadmap. CS555, Spring /14/2005. WMU-CS, Dr. Gupta 1. Multicast Routing: Problem Statement. Approaches for building mcast trees

Chapter 5 Link Layer. Link Layer 5-1

CSCD 330 Network Programming

Chapter 6 The Link Layer and LANs

Redes de Computadores. Medium Access Control

CCM 4300 Lecture 5 Computer Networks, Wireless and Mobile Communications. Dr Shahedur Rahman. Room: T115

CS 3516: Computer Networks

Chapter 6 The Link Layer and LANs

Chapter 6 The Link Layer and LANs

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

Chapter 5: Link layer

CSE 461: Multiple Access. Homework: Chapter 2, problems 1, 8, 12, 18, 23, 24, 35, 43, 46, and 58

Medium Access Protocols

Chapter 5: The Data Link Layer

Chapter 6 The Link Layer and LANs

Link Layer and Ethernet

COMP 3331/9331: Computer Networks and Applications. Data Link layer. Link layer, LANs: outline. Data Link Layer

CSCD 330 Network Programming Fall 2012

Links Reading: Chapter 2

COMP211 Chapter 6/7 Link Layer

Link Layer and Ethernet

Chapter 6 The Link Layer and LANs

Chapter 5: The Data Link Layer

CSC 4900 Computer Networks: Link Layer (2)

Transcription:

SC250 Computer Networking I Link Layer Prof. Matthias Grossglauser LCA/I&C http://lcawww.epfl.ch 1

Objectives Understand principles behind data link layer services: sharing a broadcast channel: multiple access control (MAC) link layer addressing reliable data transfer, flow control: principles already seen in the transport layer interaction between network and link layer Instantiation and implementation of various link layer technologies Ethernet 2

Link Layer Introduction and Services 3

Link Layer: Introduction hosts and routers are nodes (bridges and switches too) communication channels that connect adjacent nodes along communication path are links wired links wireless links LANs 2-PDU is a frame, encapsulates datagram lin k data- link layer h as respon sibility of tran sferrin g datagram from on e n ode to adjacen t n ode over a lin k 4

Link Layer: Context Datagram transferred by different link protocols over different links: Transportation analogy trip from Princeton to Lausanne e.g., Ethernet on first link, frame relay on intermediate links, 802.11 on last link Each link protocol provides different services e.g., may or may not provide reliable transfer over link limo: Princeton to JFK plane: JFK to Geneva train: Geneva to Lausanne tourist = datagram transport segment = communication link transportation mode = link layer protocol travel agent = routing algorithm 5

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

Link Layer Services (more) Flow Control: pacing between adjacent sending and receiving nodes Error Detection: errors caused by signal attenuation, noise receiver detects presence of errors: signals sender for retransmission or drops frame Error Correction: receiver identifies and corrects bit error(s) without resorting to retransmission Half-duplex and full-duplex with half duplex, nodes at both ends of link can transmit, but not at same time 7

Adaptors Communicating sending node dat agram f ram e lin k layer p rot ocol rcving node adap t er adap t er link layer implemented in adaptor (aka NIC) Ethernet card, PCMCI card, 802.11 card Sending side: encapsulates datagram in a frame Receiving side looks for errors, rdt, flow control, etc extracts datagram, passes to rcving node adapter is semiautonomous adds error checking bits, rdt, flow control, etc. link & physical layers 8

Link Layer Multiple Access Protocols 9

Multiple Access Links and Protocols 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) traditional Ethernet upstream HFC 802.11 wireless LAN 10

Multiple Access Protocols Single shared communication channel Two or more simultaneous transmissions by nodes: interference only one node can send successfully at a time Multiple access protocol: distributed algorithm that determines how stations share channel, i.e., determine when station can transmit communication about channel sharing must use channel itself! what to look for in multiple access protocols: synchronous or asynchronous information needed about other stations robustness (e.g., to channel errors) performance 11

Ideal Mulitple 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: no special node to coordinate transmissions no synchronization of clocks, slots 4. Simple 12

MAC Protocols: Three Broad Classes Channel Partitioning divide channel into smaller pieces (time slots, frequency, code) allocate piece to node for exclusive use Random Access channel not divided, allow collisions recover from collisions Taking turns tightly coordinate shared access to avoid collisions 13

Channel Partitioning MAC Protocols: TDMA 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 TDM (Time Division Multiplexing): channel divided into N time slots, one per user 14

Channel Partitioning MAC Protocols: FDMA 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 FDM (Frequency Division Multiplexing): frequency subdivided. frequ en cy b an ds tim e 15

Channel Partitioning (CDMA) CDMA (Code Division Multiple Access) unique code assigned to each user; i.e., code set partitioning used mostly in wireless broadcast channels (cellular, satellite, etc) all users share same frequency, but each user has own chipping sequence (i.e., code) to encode data encoded signal = (original data) X (chipping sequence) decoding: inner-product of encoded signal and chipping sequence allows multiple users to coexist and transmit simultaneously with minimal interference (if codes are orthogonal ) 16

CDMA Encode/Decode 17

CDMA: Two-Sender Interference 18

Random Access Protocols 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 19

Slotted ALOHA Assumptions Operation all frames same size time is divided into equal size slots, time to transmit 1 frame nodes start to transmit frames only at beginning of slots nodes are synchronized if 2 or more nodes transmit in slot, all nodes detect collision when node obtains fresh frame, it transmits in next slot no collision, node can send new frame in next slot if collision, node retransmits frame in each subsequent slot with prob. p until success 20

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

Slotted Aloha Efficiency Efficiency is the lon g- run fract ion of successful slots wh en t h ere s man y n odes, each with man y frames to sen d Suppose N nodes with many frames to send, each transmits in slot with probability p prob that 1st node has success in a slot = p(1-p) N-1 prob that any node has a success = Np(1-p) N-1 For max efficiency with N nodes, 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 1/e =.37 At best: ch an n el used for useful tran smission s 37% of t ime! 22

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] 23

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! 24

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! 25

CSMA Collisions sp at ial layout of n odes collision s can st ill occur: propagation delay mean s two n odes may n ot h ear each ot h er s tran smission collision : en tire packet tran smission time wast ed n ote: role of distan ce & propagation delay in determin in g collision probabilit y 26

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: receiver shut off while transmitting Human analogy: the polite conversationalist 27

CSMA/CD Collision Detection 28

Taking Turns MAC Protocols Channel partitioning MAC protocols: share channel efficiently and fairly at high load inefficient at low load: delay in channel access, 1/N bandwidth allocated even if only 1 active node! Random access MAC protocols efficient at low load: single node can fully utilize channel high load: collision overhead Taking turns protocols look for best of both worlds! 29

Taking Turns MAC Protocols Polling: Token passing: master node invites slave nodes to transmit in turn concerns: polling overhead latency single point of failure (master) control token passed from one node to next sequentially. token message concerns: token overhead latency single point of failure (token) 30

Summary of MAC Protocols What do you do with a shared media? Channel Partitioning, by time, frequency or code Time Division, Code Division, Frequency Division Random partitioning (dynamic), ALOHA, S-ALOHA, CSMA, CSMA/CD carrier sensing: easy in some technologies (wire), hard in others (wireless) CSMA/CD used in Ethernet Taking Turns polling from a central site, token passing 31

Link Layer Local Area Network (LAN) Technologies 32

LAN Technologies Data link layer so far: services, multiple access Next: LAN technologies addressing interaction between network and link layers ethernet standard 33

LAN Addresses and ARP 32-bit IP address: network-layer address used 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 34

LAN Addresses and ARP Each adap t er on LAN h as u n iqu e LAN address 35

LAN Address (more) MAC address allocation administered by IEEE Manufacturer buys portion of MAC address space (to assure uniqueness) Analogy: (a) MAC address: like Social Security Number (unique ID for each person; Switzerland: AVS) (b) IP address: like postal address MAC flat address => portability can move LAN card from one LAN to another IP hierarchical address NOT portable depends on IP network to which node is attached 36

Recall Earlier Routing Discussion Starting at A, given IP datagram addressed to B: look up net address of B, find B on same net as A link layer sends datagram to B inside link-layer frame A B 223.1.1.1 223.1.2.1 223.1.1.2 223.1.1.4 223.1.2.9 223.1.1.3 223.1.2.2 223.1.3.27 223.1.3.1 223.1.3.2 E f ram e sou rce, dest address dat agram sou rce, dest address B s MAC addr A s MAC addr A s IP addr B s IP addr IP p ayload fram e dat agram 37

ARP: Address Resolution Protocol Question : h ow to det ermin e MAC address of B kn owin g B s IP address? 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) 38

ARP Protocol A wants to send datagram to B, and A knows B s IP address. Suppose B s MAC address is not in A s 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 address 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 frame sent to A s MAC address (unicast) 39

Routing to Another LAN Walkthrough: send datagram from A to B via R, assuming A knows B's IP address A In routing table at source Host, find router 111.111.111.110 R B Two ARP tables in router R, one for each IP network (LAN) In ARP table at source, find MAC address E6-E9-00-17-BB-4B, etc 40

A creates datagram with source A, destination B A uses ARP to get R s MAC address for 111.111.111.110 A creates link-layer frame with R's MAC address as dest, frame contains A-to-B IP datagram A s data link layer sends frame R s data link layer receives frame R removes IP datagram from Ethernet frame, sees its destined to B R uses ARP to get B s physical layer address R creates frame containing A-to-B IP datagram sends to B A R B 41