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

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

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

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

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

Summary of MAC protocols

Chapter 5 Link Layer and LANs

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

Principles behind data link layer services

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

Medium Access Protocols

Principles behind data link layer services:

Principles behind data link layer services:

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

Principles behind data link layer services:

Chapter 5: Link layer

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

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

Chapter 5 Link Layer and LANs

CSC 4900 Computer Networks: The Link Layer

The Link Layer and LANs: Ethernet and Swiches

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

Chapter V: Link Layer

Computer Network Fundamentals Spring Week 3 MAC Layer Andreas Terzis

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

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

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

CC451 Computer Networks

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

CSC 4900 Computer Networks: Link Layer (2)

Chapter V: Link Layer

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

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

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

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

Data Link Layer: Multi Access Protocols

EE 122: Ethernet and

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

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

ECE 4450:427/527 - Computer Networks Spring 2017

Chapter 6 The Link Layer and LANs

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

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

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

Master Course Computer Networks IN2097

Link Layer and Ethernet

CSC 401 Data and Computer Communications Networks

Chapter 5: DataLink Layer

CS 3516: Advanced Computer Networks

Master Course Computer Networks IN2097

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

Link Layer and Ethernet

Chapter 5 Link Layer and LANs

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

Module 10 Data Link Layer CS655! 10-1!

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

Link Layer and LANs. Our Goals. Link Layer

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

Link layer: introduction

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

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

Chapter 5: The Data Link Layer

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

Multiple Access Links and Protocols

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

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 Data Link layer

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

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

CSC 8560 Computer Networks: Link Layer

Links. CS125 - mylinks 1 1/22/14

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

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

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

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

Chapter 5 Data Link Layer

Module 4 Data Link Layer CS655! 4-1!

Data Link Layer: Overview, operations

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

Computer Networks Medium Access Control. Mostafa Salehi Fall 2008

MULTIPLE ACCESS PROTOCOLS 2. 1

Chapter 5 Link Layer. Link Layer 5-1

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

The Link Layer II: Ethernet

Data Link Protocols. TCP/IP Suite and OSI Reference Model. The TCP/IP protocol stack does not define the lower layers of a complete protocol stack

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

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

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

Reminder: Datalink Functions Computer Networking. Datalink Architectures

Chapter 5 part 2 LINK LAYER. Computer Networks Timothy Roscoe Summer Networks & Operating Systems Computer Networks

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

Chapter 6 The Data Link layer

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

CSCI Computer Networks Fall 2016

Computer Networks Principles LAN - Ethernet

CSCD 330 Network Programming Spring 2017

Chapter 5 Data Link Layer

Redes de Computadores. Medium Access Control

Chapter 4 Network Layer

CSCI Computer Networks Spring 2017

Medium Access Control

Transcription:

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

Link Layer: setting the context two physically connected devices: host-router, router-router, host-host, host-switch unit of data: frame

Link Layer Functions Framing, link access: encapsulate datagram into frame, adding header, trailer physical addresses used in frame headers to identify source and destination Medium access control: implement channel access if shared medium Reliable delivery between two physically connected devices: errors caused by signal attenuation, noise Error Detection / Error Correction

Link Layer Implementation implemented in adapter e.g., PCMCIA card, Ethernet card typically includes: RAM, DSP chips, host bus interface, and link interface Hl Ht HnHt HnHt M M M M application transport network link physical data link protocol phys. link network link physical Hl HnHt frame M adapter card

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

Parity Checking Single Bit Parity: Detect single bit errors Two Dimensional Bit Parity: Detect and correct single bit errors 0 0

Checksumming: Cyclic Redundancy Check view data bits, D, as a binary number choose r+1 bit pattern (generator), 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 (ATM, HDCL) R = remainder[ ] D. 2r G

Multiple Access Links and Protocols Three types of links : point-to-point (single wire, e.g. PPP, SLIP) broadcast (shared wire or medium; e.g, Ethernet, Wifi, etc.) switched (e.g., switched Ethernet, ATM etc)

Random access single shared communication channel two or more simultaneous transmissions by nodes interference only one node can send successfully at a time multiple access protocol (Medium Access Control MAC): distributed algorithm that determines how stations share channel, i.e., determine when station can transmit communication about channel sharing must use channel itself! can be synchronous or asynchronous

MAC Protocols: a taxonomy Three broad classes: Channel Partitioning divide channel into smaller pieces (time slots, frequency) allocate piece to node for exclusive use Random Access Try to transmit when packets to send Collisions and re-transmissions Taking turns tightly coordinate shared access to avoid collisions Goal: efficient, fair, simple, decentralized

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 trasnmitting 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 and CSMA/CD

Slotted Aloha Time is divided into equal size slots (= pkt trans. time) Packets of fixed length Node with new arriving pkt: transmit at beginning of next slot If collision: retransmit pkt in future slots with probability p, until successful. Success (S), Collision (C), Empty (E) slots

Slotted Aloha efficiency What is max fraction slots successful? Suppose N stations have packets to send each transmits in slot with probability p prob. successful transmission S is: by single node: S= p (1-p) (N-1) by any of N nodes: S = N p (1-p) (N-1) choosing optimum p as n -> infinity... = 1/e =.37 as N -> infinity At best: channel use for useful transmissions 37% of time!

Pure (unslotted) ALOHA unslotted Aloha: simpler, no synchronization pkt needs transmission: send without awaiting for beginning of slot collision probability increases: pkt sent at t 0 collide with other pkts sent in [t 0-1, t 0 +1] S = 1/2e =.18 as N -> infinity

CSMA: Carrier Sense Multiple Access The functioning principle is to listen before transmit: if channel is idle: transmit entire pkt if channel is busy, defer transmission Persistent CSMA: retry immediately with probability p when channel becomes idle (may cause instability) Non-persistent CSMA: retry after random interval human analogy: don t interrupt others!

collisions can occur: propagation delay means two nodes may not year hear each other s transmission Collisions depend on the physical distance among nodes (the propagation delay) CSMA collisions spatial layout of nodes along ethernet

CSMA/CD (Collision Detection) CSMA/CD: carrier sensing, deferral as in CSMA collisions detected within short time (sensing when transmitting) 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

CSMA/CD collision detection

Physical Addresses Physical (or LAN or MAC) address: 48 bit string Hexadecimal representation (Example: 1A:23:5B:F8:00:69:C9) Unique (burned in the adapter ROM) MAC address allocation administered by IEEE Manufacturer buys portion of MAC address space (to assure uniqueness)

Physical Addresses Each adapter on LAN has unique LAN address

MAC Address vs IP address Analogy: - MAC address: like Social Security Number - 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 network to which one attaches

Layer 3 and Layer 2 addresses Starting at A, given IP datagram addressed to B: look up net. address of B, find B on same net. as A link layer send datagram to B inside link-layer frame frame source, dest address A B datagram source, dest address 223.1.1.1 223.1.1.2 223.1.2.1 223.1.1.4 223.1.2.9 223.1.1.3 223.1.3.1 223.1.3.27 223.1.2.2 223.1.3.2 E B s MAC addr A s MAC addr A s IP addr B s IP addr IP payload frame datagram

ARP: Address Resolution Protocol Question: how to determine MAC address of B given B s IP address? Each IP node (Host, Router) on LAN has ARP module, 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)

ARP protocol A knows B's IP address, wants to learn physical address of B A broadcast (FF:FF:FF:FF:FF:FF) ARP query pkt, containing B's IP address all machines on LAN receive ARP query B receives ARP packet, replies to A with its (B's) physical layer address A caches (saves) IP-to-physical address pairs until information becomes old (times out) soft state: information that times out (goes away) unless refreshed

Routing to another LAN Path from A (IP: 111.111.11.111) to B (IP: 222.222.222.222) A R B

Routing to another LAN 1) A creates IP packet with source A, destination B 2) After looking at its routing table, A uses ARP to get R s physical layer address for 111.111.111.110 3) A creates Ethernet frame with R's physical address as dest, Ethernet frame contains A-to-B IP datagram 4) A s data link layer sends Ethernet frame 5) R s data link layer receives Ethernet frame 6) R removes IP datagram from Ethernet frame, sees its destined to B 7) After looking at its routing table, R uses ARP to get B s physical layer address 8) R creates frame containing A-to-B IP datagram sends to B

Ethernet dominant LAN technology: Simpler, cheaper (cheap $20 for 100Mbs!) than other technologies Kept up with speed race: 10, 100, 1000 Mbps Metcalfe s Ethernet sketch

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

Ethernet Frame Structure Addresses: 6 bytes, frame is received by all adapters on a LAN and dropped if address does not match Type: indicates the higher layer protocol, mostly IP but others may be supported CRC: checked at receiver, if error is detected, the frame is simply dropped

Ethernet uses CSMA/CD A: sense channel, if idle then { transmit and monitor the channel; If detect another transmission then { abort and send jam signal; update # collisions; delay as required by exponential backoff algorithm; goto A } else {done with the frame; set collisions to zero} } else {wait until ongoing transmission is over and goto A}

Ethernet s CSMA/CD Jam Signal: make sure all other transmitters are aware of collision; Exponential Backoff: To adapt retransmission attempts to estimated current load heavy load: random wait will be longer first collision: choose K from {0,1}; delay is K x 512 bit transmission times after second collision: choose K from {0,1,2,3} after ten or more collisions, choose K from {0,1,2,3,4,,1023}

Ethernet efficiency Considering an high number of nodes with many frames to send, : E 1 1+5 d prop /d trasm E = time percentage of successful transmissions d prop = maximum propagation delay d trasm = transmission time for the MTU frame

Ethernet limitation The proper functioning of Ethernet is guaranteed if a node is able to detect a collision. A collision has to be detected while transmitting a frame Condition: d trasm 2 d prop Given the network topology (the maximum distance among two hosts), it is possible to compute the minimum length of a frame Given the minimum length of a frame, it is possible to compute the maximum distance among two hosts or

(old) Ethernet devices Hub Physical Layer device Repeater operating at bit levels: repeat received bits on one interface to all other interfaces Each connected LAN referred to as LAN segment Hubs do not isolate collision domains: node may collide with any node residing at any segment in LAN Bridge Link Layer device Operating on Ethernet frames, examining frame header and selectively forwarding frame based on its destination (MAC Forwarding table) Bridge isolates collision domains since it buffers frames When frame is to be forwarded, bridge uses CSMA/CD to transmit

Ethernet Switches Similar to bridge: MAC forwarding table Full duplex links: no collisions Typical topology: individual hosts, star-connected into switch Plug-and-play: no need to be configured

The MAC forwarding table A row (entry) for each ARP address of the LAN: <Node LAN Address, Switch Interface, Time Stamp> If no entry for a destination: acts as a hub! A switch learns which hosts can be reached through which interfaces (MAC Learning): when frame received, bridge learns location of sender: incoming interface records incoming interface in the MAC forwarding table MAC Address AA-AA-AA-AA-AA-AA Interface eth0 frame eth2 PC0 AA-AA-AA-AA-AA-AA eth0 eth1 PC3 CC-CC-CC-CC-CC-CC PC2 BB-BB-BB-BB-BB-BB