Lecture 11: Link Layer Slides derived from those available on the site of the book “Computer Networking”, by Kurose and Ross, PEARSON.

Slides:



Advertisements
Similar presentations
Review r Error Detection: CRC r Multiple access protocols m Slotted ALOHA m CSMA/CD r Homework 3 out r Project 3 out, link state only. Some slides are.
Advertisements

5: DataLink Layer5-1 Mac Addressing, Ethernet, and Interconnections.
5-1 Link Layer: Introduction Some terminology: r hosts and routers are nodes r communication channels that connect adjacent nodes along communication path.
5: DataLink Layer5-1 Data Link Layer r What is Data Link Layer? r Multiple access protocols r Ethernet.
Chapter 5 Link Layer slides are modified from J. Kurose & K. Ross CPE 400 / 600 Computer Communication Networks Lecture 20.
5-1 Data Link Layer r Today, we will study the data link layer… r This is the last layer in the network protocol stack we will study in this class…
5: DataLink Layer5-1 Link Layer – Error Detection/Correction and MAC.
Introduction 1 Lecture 25 Link Layer (Ethernet, Switch) slides are modified from J. Kurose & K. Ross University of Nevada – Reno Computer Science & Engineering.
Lecture 8 Modeling & Simulation of Communication Networks.
Introduction 1 Lecture 23 Link Layer (Error Detection/Correction) slides are modified from J. Kurose & K. Ross University of Nevada – Reno Computer Science.
5: DataLink Layer5-1 Chapter 5 Link Layer and LANs Part 1: Overview of the Data Link layer Computer Networking: A Top Down Approach 6 th edition Jim Kurose,
5: DataLink Layer5-1 LAN technologies Data link layer so far: m services, error detection/correction, multiple access Next: LAN technologies m addressing.
Introduction1-1 Data Communications and Computer Networks Chapter 5 CS 3830 Lecture 27 Omar Meqdadi Department of Computer Science and Software Engineering.
Link Layer 5-1 Link layer, LAN s: outline 5.1 introduction, services 5.2 error detection, correction 5.3 multiple access protocols 5.4 LANs  addressing,
1 John Magee 11 July 2013 CS 101 Lecture 11: How do you “visit” a web page, revisted Slides adapted from Kurose and Ross, Computer Networking 5/e Source.
Data Link Layer Moving Frames. Link Layer Protocols: ethernet, wireless, Token Ring and PPP Has node-to-node job of moving network layer.
5: DataLink Layer5-1 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.
Link Layer5-1 Synthesis: a day in the life of a web request  journey down protocol stack complete!  application, transport, network, link  putting-it-all-together:
Chapter 5 Link Layer Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012 Link Layer5-1.
5: DataLink Layer5-1 Chapter 5 Link Layer and LANs Computer Networking: A Top Down Approach Featuring the Internet, 3 rd edition. Jim Kurose, Keith Ross.
Chapter 5 Link Layer Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012 Link Layer introduction,
5: DataLink Layer5-1 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.
1 Week 5 Lecture 3 Data Link Layer. 2 Data Link Layer location application: supporting network applications –FTP, SMTP, STTP transport: host-host data.
5: DataLink Layer5-1 The Data Link Layer Chapter 5 Kurose and Ross Today 5.1 and 5.3.
Transport Layer 3-1 Chapter 5 Link Layer Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012  CPSC.
5: DataLink Layer5-1 Chapter 5: The Data Link Layer Our goals: r understand principles behind data link layer services: m error detection, correction m.
5: DataLink Layer5-1 Chapter 5 Link Layer and LANs Computer Networking: A Top Down Approach Featuring the Internet, 3 rd edition. Jim Kurose, Keith Ross.
5-1 Last time □ Multiple access protocols ♦ Channel partitioning MAC protocols TDMA, FDMA ♦ Random access MAC protocols Slotted Aloha, Pure Aloha, CSMA,
Chapter 5 Link Layer and LANs
EEC-484/584 Computer Networks
Introduction to Networks
Link Layer: Introduction
Link Layer 5.1 Introduction and services
Virtualization of networks
Link Layer 5.1 Introduction and services
A Typical Connection Scenario
Chapter 5 Link Layer and LANs
CS 280: Summary: A day in the life of a web request
Course Review 2015 Computer networks 赵振刚
MAC Addresses and ARP 32-bit IP address:
Computer Communication Networks
CS 1652 Jack Lange University of Pittsburgh
Chapter 5 Link Layer Computer Networking: A Top Down Approach 6th edition Jim Kurose, Keith Ross Addison-Wesley March 2012 Link Layer.
University of Pittsburgh
ARP: Address Resolution Protocol
Session 16 INST 346 Technologies, Infrastructure and Architecture
CS 457 – Lecture 6 Ethernet Spring 2012.
Data Link Issues Relates to Lab 2.
EEC-484/584 Computer Networks
Chapter 5 Link Layer Computer Networking: A Top Down Approach 6th edition Jim Kurose, Keith Ross Addison-Wesley March 2012 A note on the use of these.
Mac Addressing, Ethernet, and Interconnections
Chapter 5 Link Layer Computer Networking: A Top Down Approach 6th edition Jim Kurose, Keith Ross Addison-Wesley March 2012 A note on the use of these.
Chapter 5 Link Layer Computer Networking: A Top Down Approach 6th edition Jim Kurose, Keith Ross Addison-Wesley March 2012 A note on the use of these.
Introduction to Networks
Chapter 6 The Data Link layer
Data Link Issues Relates to Lab 2.
Link Layer and LANs Its not about how hard you hit... It's about how hard you can get hit and keep moving forward 5: DataLink Layer.
Link Layer and LANs Not everyone is meant to make a difference. But for me, the choice to lead an ordinary life is no longer an option 5: DataLink Layer.
Chapters 1~5 Overview Computer Networking: A Top Down Approach 6th edition Jim Kurose, Keith Ross Addison-Wesley Prof. Hong Liu for ECE369 Adapted from.
Chapter 5 Link Layer Computer Networking: A Top Down Approach 6th edition Jim Kurose, Keith Ross Addison-Wesley March 2012 Link Layer.
Link Layer 5.1 Introduction and services
Chapter 6 The Link Layer and LANs
Chapter 5 Link Layer Computer Networking: A Top Down Approach 6th edition Jim Kurose, Keith Ross Addison-Wesley March 2012 Link Layer.
Chapter 5 Link Layer Computer Networking: A Top Down Approach 6th edition Jim Kurose, Keith Ross Addison-Wesley March 2012 A note on the use of these.
Synthesis A day in the life of a web request
Link Layer: Multiple Access
LAN Addresses and ARP IP address: drives the packet to destination network LAN (or MAC or Physical) address: drives the packet to the destination node’s.
Data Link Layer: Overview; Error Detection
Link Layer 5.1 Introduction and services
Chapter 5 Link Layer Computer Networking: A Top Down Approach 6th edition Jim Kurose, Keith Ross Addison-Wesley March 2012 A note on the use of these.
Presentation transcript:

Lecture 11: Link Layer Slides derived from those available on the site of the book “Computer Networking”, by Kurose and Ross, PEARSON

A Layered Architecture application: network application protocol (messages) transport: process to process data transfer (segments) network: host to host data transfer (datagrams) link: across individual links data transfer (frames) physical: over the “wire” data transfer (bits) application transport network link physical

Terminology nodes: hosts, switches, routers global ISP nodes: hosts, switches, routers link: communication channel that connects adjacent nodes wired links wireless links frame: link-layer “packet”

Link-layer Overview global ISP Data transfer from one node to a physically adjacent node Different protocols over different links e.g., Ethernet, WiFi, frame relay Different services for each protocol e.g., over-the-link reliable data delivery

Transportation Analogy Trip from Princeton to Lausanne taxi: Princeton to JFK plane: JFK to Geneva train: Geneva to Lausanne Tourist = datagram Transport segment = link Transportation mode = link layer protocol Travel agent = routing algorithm

Hardware & Software Implementation Hardware: network adaptor (NIC) encapsulation, decapsulation link access, error detection Software: CPU addressing NIC interaction application transport network link physical cpu memory host bus (e.g., PCI) controller physical transmission network adapter

Outline Link-layer services Link-layer forwarding++ A to Z: retrieving a web page

Outline Link-layer services Link-layer forwarding++ A to Z: retrieving a web page

Link Layer Services Error detection Reliable data delivery Link access detect bit errors caused by signal attenuation, noise drop frames with bit errors Reliable data delivery error detection + correction/retransmission used for links with high-error rate (wireless) Link access how to share the same link with other nodes Flow control pacing between adjacent sending and receiving nodes

Error Detection & Correction otherwise 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

Error Detection & Correction (2) Single bit parity detect single bit errors Two-dimensional bit parity detect and correct single bit errors Cyclic Redundancy Check (CRC) more powerful error-detection than parity checking widely used in practice: Ethernet, WiFi

(shared air, acoustical) Media Access Control (MAC) Point-to-point links state-of-the-art Ethernet Broadcast links (shared medium) old-fashioned Ethernet, WiFi shared wire (e.g., cabled Ethernet) shared RF (e.g., 802.11 WiFi) shared RF (satellite) humans at a cocktail party (shared air, acoustical)

MAC Protocols Given The problem An ideal multiple access protocol single shared broadcast link of rate R The problem interference = two or more simultaneous transmissions collision = node receives two or more signals at the same time An ideal multiple access protocol when only one node wants to transmit, it can send at rate R when N nodes want to transmit, each can send at average rate R/N simple, fully decentralized

MAC Protocols Classification Channel partitioning channel divided into smaller “pieces” (time slots, frequency bands) allocate one piece to each node for exclusive use Random access channel not divided, allow collisions detect and recover from collisions Taking turns nodes take turns

Efficient at high load. Inefficient at low load. Channel Partitioning TDMA: time divided in equal frames and slots 1 3 4 6-slot frame FDMA: frequency spectrum divided into frequency bands frequency bands time FDM cable Efficient at high load. Inefficient at low load.

Efficient at low load. Inefficient at high load. Random Access 1 2 3 node 1 node 2 node 3 C S E if single node - transmit at full rate R bps if N nodes - transmit at well bellow ideal R/N bps each (collisions, empty slots) Efficient at low load. Inefficient at high load.

CSMA - Carrier Sense Multiple Access Sense the channel before transmitting if channel sensed idle, transmit if channel sensed busy, defer transmission

spatial layout of nodes CSMA Collisions spatial layout of nodes Collisions can still occur due to propagation delay Collision probability depends on propagation delay

CSMA/CD - Collision Detection Sense the channel before transmitting if channel sensed idle, transmit if channel sensed busy, defer transmission If a collision is detected abort transmission defer transmission

spatial layout of nodes CSMA/CD - Collision Detection spatial layout of nodes

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! 4. If NIC detects another transmission while transmitting, aborts and sends jam signal 5. After aborting, NIC enters exponential backoff: more collisions -> longer wait interval

Taking Turns (1) Polling: master “invites” slave to transmit Main concerns polling overhead single point of failure (master) data poll master data slaves

Taking Turns (2) Token passing: control token passed from one node to the next sequentially Main concerns token overhead single point of failure (token) T (nothing to send) T data

MAC Protocols Channel partitioning Random access Taking turns efficient at high load inefficient at low load Random access efficient at low load inefficient at high load (due to collisions) Taking turns look for best of both worlds single point of failure

Outline Link-layer services Link-layer forwarding++ A to Z: retrieving a web page

MAC Addresses Used to move frames between link-layer nodes one address per NIC Format: 48 bit address, flat usually shown in hexadecimal format 1A-2F-BB-76-09-AD 58-23-D7-FA-20-B0 0C-C4-11-6F-E3-98 71-65-F7-2B-08-53 LAN

Address Resolution Protocol (ARP) Question: - How to determine interface’s MAC address, knowing its IP address? 1A-2F-BB-76-09-AD 58-23-D7-FA-20-B0 0C-C4-11-6F-E3-98 71-65-F7-2B-08-53 LAN 137.196.7.23 137.196.7.78 137.196.7.14 137.196.7.88 Answer: - Source broadcasts request for destination’s MAC address - Stores response in local ARP table < IP address; MAC address; TTL>

Ethernet The dominant wired LAN technology First widely used LAN technology Simpler, cheaper than token LANs and ATM Kept up with speed race: 10 Mbps – 100 Gbps

Ethernet Services Connectionless Unreliable MAC protocol no handshaking between sending and receiving NICs Unreliable receiving NIC does not send ACKs or NACKs to sending NIC recover dropped frames only if sender uses higher layer “rdt” (TCP) MAC protocol CSMA/CD with exponential backoff

Ethernet Frame Structure Sending adapter encapsulates datagram in Ethernet frame preamble: 7 x 10101010 followed by 1 x 10101011 synchronize sender, receiver clock rates addresses: 48 bit source, source/destination MAC address receive frame only if destination matches or broadcast type: indicates higher layer protocol mostly IP, others possible CRC: cyclic redundancy check at receiver dest. address source data (payload) CRC preamble type

Ethernet Physical Topology bus: popular in the mid 90s all nodes in same collision domain (frames can collide) star: prevails today active switch in the middle - each “spoke” in a separate collision domain (no collisions) switch bus star

Link-layer Switch Forwards frames within LAN Self-learning determines output port based on destination MAC address similar to router forwarding process Self-learning forwarding table populated automatically no need for manual configuration or routing protocol

switch forwarding table Self-learning Source: A Dest: A’ A A’ B B’ C C’ 1 2 3 4 5 6 A A’ - frame destination A’, location unknown: flood - frame destination A, location known: selectively send on just one link A A’ A A’ A A’ A A’ A A’ A’ A MAC addr interface TTL A 1 60 switch forwarding table (initially empty) A’ 4 60

Self-learning (2) When a frame is received at the switch: 1. Record pair (source MAC address; incoming link) 2. Index forwarding table using destination MAC address 3. If entry found: - if destination on link from which frame arrived drop frame - else forward frame on link indicated by entry (else) If entry not found: - flood: forward on all links except the arriving interface

Self-learning: Interconnected Switches B S1 C Scenario: A wants to send frame to H - Question: how does S1 know to forward via S4 and S3? - Answer: self learning, exactly the same way

Switches vs. Routers Both are store-and-forward application transport network link physical Both are store-and-forward routers: network-layer devices (examine network-layer headers) switches: link-layer devices (examine link-layer headers) Both have forwarding tables routers: using routing switches: using self-learning datagram frame link physical frame switch network link physical datagram frame application transport network link physical

Forwarding to Another LAN Scenario: - A sends a datagram to B via router R - A knows IP address of B (how?) - A knows IP address of R (how?) - A knows MAC address of R (how?) R 1A-23-F9-CD-06-9B 222.222.222.220 111.111.111.110 E6-E9-00-17-BB-4B CC-49-DE-D0-AB-7D 111.111.111.112 111.111.111.111 74-29-9C-E8-FF-55 A 222.222.222.222 49-BD-D2-C7-56-2A 222.222.222.221 88-B2-2F-54-1A-0F B

Forwarding to Another LAN - create IP datagram with source IP-A, destination IP-B - create link-layer frame with source MAC-A, destination MAC-R, frame contains A-to-B IP datagram MAC src: 74-29-9C-E8-FF-55 MAC dest: E6-E9-00-17-BB-4B IP Eth Phy IP src: 111.111.111.111 IP dest: 222.222.222.222 R 1A-23-F9-CD-06-9B 222.222.222.220 111.111.111.110 E6-E9-00-17-BB-4B CC-49-DE-D0-AB-7D 111.111.111.112 111.111.111.111 74-29-9C-E8-FF-55 A 222.222.222.222 49-BD-D2-C7-56-2A 222.222.222.221 88-B2-2F-54-1A-0F B

Forwarding to Another LAN - send frame from A to R - receive frame at R, extract datagram, pass it up to IP layer MAC src: 74-29-9C-E8-FF-55 MAC dest: E6-E9-00-17-BB-4B IP src: 111.111.111.111 IP dest: 222.222.222.222 IP src: 111.111.111.111 IP dest: 222.222.222.222 IP Eth Phy IP Eth Phy R 1A-23-F9-CD-06-9B 222.222.222.220 111.111.111.110 E6-E9-00-17-BB-4B CC-49-DE-D0-AB-7D 111.111.111.112 111.111.111.111 74-29-9C-E8-FF-55 A 222.222.222.222 49-BD-D2-C7-56-2A 222.222.222.221 88-B2-2F-54-1A-0F B

Forwarding to Another LAN - forward datagram with source IP-A, destination IP-B - create link-layer frame with source MAC-R, destination MAC-B, frame contains A-to-B IP datagram MAC src: 1A-23-F9-CD-06-9B MAC dest: 49-BD-D2-C7-56-2A IP src: 111.111.111.111 IP dest: 222.222.222.222 IP Eth Phy R 1A-23-F9-CD-06-9B 222.222.222.220 111.111.111.110 E6-E9-00-17-BB-4B CC-49-DE-D0-AB-7D 111.111.111.112 111.111.111.111 74-29-9C-E8-FF-55 A 222.222.222.222 49-BD-D2-C7-56-2A 222.222.222.221 88-B2-2F-54-1A-0F B

Forwarding to Another LAN - send frame from R to B IP src: 111.111.111.111 IP dest: 222.222.222.222 MAC src: 1A-23-F9-CD-06-9B MAC dest: 49-BD-D2-C7-56-2A IP Eth Phy IP Eth Phy R 1A-23-F9-CD-06-9B 222.222.222.220 111.111.111.110 E6-E9-00-17-BB-4B CC-49-DE-D0-AB-7D 111.111.111.112 111.111.111.111 74-29-9C-E8-FF-55 A 222.222.222.222 49-BD-D2-C7-56-2A 222.222.222.221 88-B2-2F-54-1A-0F B

Forwarding to Another LAN - send frame from R to B - receive frame at B, extract datagram, pass it up to IP layer MAC src: 1A-23-F9-CD-06-9B MAC dest: 49-BD-D2-C7-56-2A IP src: 111.111.111.111 IP dest: 222.222.222.222 IP Eth Phy B A R 111.111.111.111 222.222.222.222 49-BD-D2-C7-56-2A 74-29-9C-E8-FF-55 222.222.222.220 1A-23-F9-CD-06-9B 111.111.111.110 E6-E9-00-17-BB-4B 111.111.111.112 222.222.222.221 CC-49-DE-D0-AB-7D 88-B2-2F-54-1A-0F

Outline Link-layer services Link-layer forwarding++ A to Z: retrieving a web page

Synthesis - A day in the life of a web request application transport network link physical scenario: - attach laptop to campus network - request/receive www.google.com page goal: - review the protocols involved at all layers

A day in the life… scenario browser DNS server Comcast network 68.80.0.0/13 school network 68.80.2.0/24 web page web server Google’s network 64.233.160.0/19 64.233.169.105

… connecting to the Internet (1) DHCP UDP IP Eth Phy DHCP DHCP Laptop uses DHCP to get: - IP address, subnet mask - IP address of first-hop router - IP address of DNS server router (runs DHCP) DHCP DHCP discovery message - encapsulated in UDP - encapsulated in IP - encapsulated in Ethernet DHCP DHCP UDP IP Eth Phy DHCP Ethernet frame broadcast on LAN - destination MAC: 0xffffffffffff - received by DHCP server (running on the router)

… connecting to the Internet (2) DHCP DHCP UDP IP Eth Phy router (runs DHCP) - DHCP server and laptop exchange -offer -request -acknowledgement DHCP UDP IP Eth Phy DHCP DHCP DHCP Laptop has IP address, knows IP address of the first-hop router and a DNS server

Laptop knows MAC address of the first-hop router … L2 learning DNS UDP IP Eth Phy DNS - Laptop uses DNS to get the IP address for www.google.com router (runs DHCP) ARP ARP query - DNS query -encapsulated in UDP -encapsulated in IP -encapsulated in.. ooops! - Laptop needs to get the MAC address of the first-hop router Eth Phy ARP ARP reply - ARP request broadcasted on LAN, received at first-hop router - Router sends ARP response back Laptop knows MAC address of the first-hop router

Laptop knows IP address of www.google.com … L3 learning DNS UDP IP Eth Phy DNS DNS server DNS UDP IP Eth Phy DNS router (runs DHCP) DNS DNS DNS DNS Comcast network 68.80.0.0/13 - DNS query (IP datagram) forwarded to first-hop router via switch - DNS query (IP datagram) forwarded to Comcast network, DNS server - DNS server sends DNS response back to laptop Laptop knows IP address of www.google.com

TCP connection established … TCP connection setup HTTP HTTP TCP IP Eth Phy router (runs DHCP) SYN SYNACK SYN - Web browser process opens TCP socket TCP IP Eth Phy - Sends SYN segment SYN SYNACK - Web server responds with SYNACK segment SYNACK web server 64.233.169.105 TCP connection established

Web page is finally displayed! … HTTP request/reply HTTP HTTP HTTP TCP IP Eth Phy router (runs DHCP) HTTP HTTP - Web browser sends HTTP request to web server HTTP TCP IP Eth Phy HTTP - Web server sends HTTP reply to web client (the web page) HTTP web server 64.233.169.105 Web page is finally displayed!