Lecture 20: Link Layer

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

Chapter 6 The Link Layer and LANs

Link layer: introduction

Principles behind data link layer services:

CS 3516: Advanced Computer Networks

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

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

Lecture 16: Network Layer Overview, Internet Protocol

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

Principles behind data link layer services

Principles behind data link layer services:

Principles behind data link layer services:

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

Lecture 2: Internet Structure

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

Lecture 19: Network Layer Routing in the Internet

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

The Link Layer and LANs: Ethernet and Swiches

Lecture 17: Network Layer Addressing, Control Plane, and Routing

CC451 Computer Networks

ECE 4450:427/527 - Computer Networks Spring 2017

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

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

CSCD 330 Network Programming Spring 2017

Chapter 6 The Link Layer and LANs

Lecture 9 Ethernet and other Link Layer protocols

Module 10 Data Link Layer CS655! 10-1!

Review. Some slides are in courtesy of J. Kurose and K. Ross

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

Lecture 13: Transport Layer Flow and Congestion Control

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

LINK LAYER AND LANS 1

Lecture 9: Transpor Layer Overview and UDP

Chapter 5 Link Layer and LANs

ECPE / COMP 177 Fall Some slides from Kurose and Ross, Computer Networking, 5 th Edition

Chapter V: Link Layer

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

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

Master Course Computer Networks IN2097

Communication Networks ( ) / Fall 2013 The Blavatnik School of Computer Science, Tel-Aviv University. Allon Wagner

ECPE / COMP 177 Fall Some slides from Kurose and Ross, Computer Networking, 5 th Edition

CSC 401 Data and Computer Communications Networks

CSCI Computer Networks Fall 2016

INTRODUCTION, SERVICES. Data-link layer has responsibility of transferring datagram from one node to physically adjacent node over a link

Chapter 5 Link Layer and LANs

CSCI Computer Networks Spring 2017

CSC 4900 Computer Networks: Link Layer (2)

Summary of MAC protocols

CSCD 330 Network Programming Winter 2016

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

Chapter 6 The Link Layer and LANs

Chapter 5 Link Layer and LANs

Module 4 Data Link Layer CS655! 4-1!

Chapter 6 The Link Layer and LANs

Chapter 5 Link Layer. Link Layer 5-1

CS 457 Lecture 11 More IP Networking. Fall 2011

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

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

Computer Networks LECTURE 10 ICMP, SNMP, Inside a Router, Link Layer Protocols. Assignments INTERNET CONTROL MESSAGE PROTOCOL

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

CSC 4900 Computer Networks: The Link Layer

Communication Networks ( ) / Spring 2011 The Blavatnik School of Computer Science, Tel-Aviv University. Allon Wagner

COMP211 Chapter 6/7 Link Layer

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

Chapter V: Link Layer

CSC 401 Data and Computer Communications Networks

Chapter 5 Data Link Layer

EC441 Fall 2018 Introduction to Computer Networking Chapter4: Network Layer Data Plane

1-1. Switching Networks (Fall 2010) EE 586 Communication and. October 25, Lecture 24

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

CSCD 330 Network Programming Winter Lecture 17b Link Layer Protocols Who is this? Reading: Chapter 5

Last time. Network layer. Introduction. Virtual circuit vs. datagram details. IP: the Internet Protocol. forwarding vs. routing

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

Chapter 6 The Link Layer and LANs

CS118 Discussion 1A, Week 9. Zengwen Yuan Dodd Hall 78, Friday 10:00 11:50 a.m.

Master Course Computer Networks IN2097

Link Layer and Ethernet

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

Link Layer and Ethernet

internet technologies and standards

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. Computer Networking: A Top Down Approach. 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012

Medium Access Protocols

Lecture 12: Transport Layer TCP again

Chapter 4 Network Layer: The Data Plane

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

Data Link Layer Overview

Quiz. Segment structure and fields Flow control (rwnd) Timeout interval. Phases transition ssthresh setting Cwnd setting

Data Link Layer Overview

COMP211 Chapter 4 Network Layer: The Data Plane

Data Link Layer: Multi Access Protocols

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

Data Link Layer Overview

Chapter 4: network layer. Network service model. Two key network-layer functions. Network layer. Input port functions. Router architecture overview

Hubs. twisted pair. hub. 5: DataLink Layer 5-1

Chapter 6 The Link Layer and LANs

Agenda L2 versus L3 Switching IP Protocol, IP Addressing IP Forwarding ARP and ICMP IP Routing First Hop Redundancy

Transcription:

Lecture 20: Link Layer COMP 332, Spring 2018 Victoria Manfredi Acknowledgements: materials adapted from Computer Networking: A Top Down Approach 7 th edition: 1996-2016, J.F Kurose and K.W. Ross, All Rights Reserved as well as from slides by Abraham Matta at Boston University, and some material from Computer Networks by Tannenbaum and Wetherall.

1. Announcements hw7 written due today 11:59, hw7 programming due next Wed.11:59p homework 8 out (no programming) socket.inet_aton, socket.ntoa_inet() what s a virtual machine? 2. Network programming bit-wise operations in python 3. Link layer overview MAC addresses Address Resolution Protocol (ARP) switches vumanfredi@wesleyan.edu 2

NETWORK PROGRAMMING vumanfredi@wesleyan.edu 3

x << y x >> y returns x with bits shifted to left by y places new bits on right-hand-side are zeros same as multiplying x by 2 y returns x with bits shifted to right by y places same as dividing x by 2 y x & y does a bitwise and ~ x each bit of output is 1 if corresponding bit of x AND of y is 1, otherwise 0 returns complement of x number you get by switching each 1 for 0 and each 0 for 1 E.g., use to pack ip_version and ip header length into 8 bits https://wiki.python.org/moin/bitwiseoperators https://www.tutorialspoint.com/python3/bitwise_operators_example.htm 4

Link Layer vumanfredi@wesleyan.edu 5

Protocols HTTP, DNS, DHCP, TLS, Service provided Support network applications Host 1 Application Messages Application Layer 5 protocol Host 2 Application TCP, UDP, QUIC, Deliver msgs to app endpoints, flow control, reliability Transport Segment/Datagram Transport Layer 4 protocol Transport IP, routing protocols (BGP, OSPF, RIP, ) Ethernet, 802.11, Ethernet phy, 802.11 phy, Route segments from source to destination host (indirect) Move pkt over link from one host to next host (direct) Move individual bits in frame from one host to next Network Link Physical Packet Layer Network 3 protocol Frame Layer Link protocol 2 protocol Bit Physical Layer 1 protocol Network Link Physical Physical Bits on medium wire vumanfredi@wesleyan.edu 6

Divide packet up into frames, transfer frame across link Link: communication channel that connects adjacent nodes wired vs. wireless local area network (LAN): frames broadcast to every device on LAN Institutional link to ISP (Internet) Institutional router Ethernet switch Institutional mail, web servers Different link media have different characteristics, so will use different protocols with different services to transfer frame 7

Framing encapsulate packet into frame add header, trailer to detect start and end of frame Link access channel access if shared media like wireless link How to share? Time/freq division, random access, MAC addresses used in frame headers to identify src, dst different from IP address, only used within network Reliable delivery between 2 end hosts of link like in transport layer low-bit error links rarely use: fiber, some twisted pair high bit error: wireless link Q: why both link-level and end-end reliability? What if error on last hop to dst? 8

Flow control pacing between adjacent sending and receiving nodes Error detection errors caused by signal attenuation, noise, interference, receiver detects presence of errors, e.g., via checksum signals sender for retransmission or drops frame Error correction receiver identifies and corrects bit error(s) don t necessarily need to retransmit: instead use coding Half-duplex vs. full-duplex half duplex nodes at both ends of link can transmit, but not at same time e.g., wireless link vumanfredi@wesleyan.edu 9

In network interface card (NIC) or on chip Ethernet card 802.11 card Ethernet chipset implements link layer physical layer: e.g., transmit radio wave Some link layer processes run in software Some link layer processes run in hardware application transport network link link physical cpu controller physical transmission memory host bus (e.g., PCI) Attaches into system buses on host s system network adapter card vumanfredi@wesleyan.edu 10

Sender encapsulates pkt in frame adds error checking bits, rdt, flow control, Receiver looks for errors, rdt, flow control, extracts pkt, passes to upper layer at receiving side packet controller packet controller frame packet vumanfredi@wesleyan.edu 11

Link Layer vumanfredi@wesleyan.edu 12

Aka hardware, Ethernet, LAN, or physical address 32-bit IP address software address: network-layer address for interface used for layer 3 (network layer) forwarding 48-bit MAC address hardware address: link-layer address for interface used for layer 2 (link layer) forwarding to get frame from one interface to another physically-connected interface burned in NIC read only memory, also sometimes software settable e.g., 1A-2F-BB-76-09-AD vumanfredi@wesleyan.edu 13

IP address: like postal address hierarchical address: not portable changes with location address depends on IP subnet to which node is attached MAC address: like SSN # flat address: portable does not change with location can move LAN card from one LAN to another LANs designed for arbitrary network layer protocol not just IP Don t want to pass frame up to network layer for ever frame faster, even if on same LAN to not go up to network layer vumanfredi@wesleyan.edu 14

vumanfredi@wesleyan.edu 15

Each adapter on LAN has unique LAN address 1A-2F-BB-76-09-AD 71-65-F7-2B-08-53 LAN (wired or wireless) 58-23-D7-FA-20-B0 adapter 0C-C4-11-6F-E3-98 vumanfredi@wesleyan.edu 16

Link Layer vumanfredi@wesleyan.edu 17

Link layer protocol that translates between MAC and IP addr 137.196.7.23 71-65-F7-2B-08-53 137.196.7.88 LAN 137.196.7.78 1A-2F-BB-76-09-AD 137.196.7.14 58-23-D7-FA-20-B0 0C-C4-11-6F-E3-98 ARP table every IP device on LAN has table <IP addr; MAC addr; TTL> TTL (Time To Live) time after which addr mapping forgotten typically 20 min vumanfredi@wesleyan.edu 18

vumanfredi@wesleyan.edu 19

A wants to send pkt to B but B s MAC addr not in A s ARP table 1. A broadcasts ARP query containing B's IP addr destination MAC addr FF-FF-FF-FF-FF-FF all nodes on LAN receive query 2. B receives ARP query replies to A with its MAC addr frame sent to A s MAC addr 3. A caches IP,MAC addr pair until TTL expires B A IP Eth Phy 111.111.111.111 AA-AA-AA-AA-AA-AA MAC src: AA-AA-AA-AA-AA-AA MAC dest: BB-BB-BB-BB-BB-BB IP src: 111.111.111.111 IP dest: 222.222.222.222 222.222.222.220 DD-DD-DD-DD-DD-DD 111.111.111.112 111.111.111.110 vumanfredi@wesleyan.edu BB-BB-BB-BB-BB-BB CC-CC-CC-CC-CC-CC 20

Work through example on board vumanfredi@wesleyan.edu 21

Send pkt from A to B via gateway router C assume A knows B s IP addr, C s IP addr, C s MAC addr IP Eth Phy MAC src: AA-AA-AA-AA-AA-AA MAC dest: CC-CC-CC-CC-CC-CC IP src: 111.111.111.111 IP dest: 222.222.222.222 A 111.111.111.111 AA-AA-AA-AA-AA-AA C 222.222.222.220 DD-DD-DD-DD-DD-DD B 222.222.222.222 BB-BB-BB-BB-BB-BB 111.111.111.112 FF-EE-DD-CC-BB-AA 111.111.111.110 222.222.222.221 CC-CC-CC-CC-CC-CC AA-BB-CC-DD-DD-FF vumanfredi@wesleyan.edu 22

Send pkt from A to B via gateway router C assume A knows B s IP addr, C s IP addr, C s MAC addr R IP Eth Phy MAC src: DD-DD-DD-DD-DD-DD MAC dest: BB-BB-BB-BB-BB-BB IP src: 111.111.111.111 IP dest: 222.222.222.222 A 111.111.111.111 AA-AA-AA-AA-AA-AA C 222.222.222.220 DD-DD-DD-DD-DD-DD B 222.222.222.222 BB-BB-BB-BB-BB-BB 111.111.111.112 FF-EE-DD-CC-BB-AA 111.111.111.110 222.222.222.221 CC-CC-CC-CC-CC-CC AA-BB-CC-DD-DD-FF vumanfredi@wesleyan.edu 23

Send pkt from A to B via gateway router C assume A knows B s IP addr, C s IP addr, C s MAC addr R IP Eth Phy MAC src: DD-DD-DD-DD-DD-DD MAC dest: BB-BB-BB-BB-BB-BB IP src: 111.111.111.111 IP dest: 222.222.222.222 IP Eth Phy A 111.111.111.111 AA-AA-AA-AA-AA-AA C 222.222.222.220 DD-DD-DD-DD-DD-DD B 222.222.222.222 BB-BB-BB-BB-BB-BB 111.111.111.112 FF-EE-DD-CC-BB-AA 111.111.111.110 222.222.222.221 CC-CC-CC-CC-CC-CC AA-BB-CC-DD-DD-FF vumanfredi@wesleyan.edu 24

Link Layer vumanfredi@wesleyan.edu 25

Ethernet: dominant wired link layer protocol Link-layer device store and forward Ethernet frames examine incoming frame s MAC address selectively forward frame to one-or-more outgoing links Transparent hosts are unaware of presence of switches Plug-and-play, self-learning Aside switches do not need to be configured you ll see Ethernet listed as link layer protocol when you use wireless is because of a quirk of wireshark, which we won t get into vumanfredi@wesleyan.edu 26

Both are store-and-forward routers data plane only examines network-layer headers control plane (BGP) may look at app layer switches examine link-layer headers Both have forwarding tables routers compute tables using routing algorithms, IP addr switches learn forwarding table using flooding, MAC addr packet frame application transport network link physical switch application transport network link physical link physical network link physical frame packet frame vumanfredi@wesleyan.edu 27