Link Layer Fundamentals NWEN302 Computer Network Design.

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.
1 Ethernet EECS 489 Computer Networks Z. Morley Mao Wednesday Feb 21, 2007 Acknowledgement: Some slides taken.
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 MAC Addresses and ARP r 32-bit IP address: m network-layer address m used to get datagram to destination IP subnet r MAC (or LAN or.
15 – Data link layer Chapter 5: The Data Link Layer Our goals: r understand principles behind data link layer services: m error detection, correction.
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.
Roadmap 1.1 What is the Internet? 1.2 Network edge 1.3 Network core 1.4 Network access and physical media 1.5 Internet structure and ISPs 1.6 Delay & loss.
Chapter 5 Link Layer slides are modified from J. Kurose & K. Ross CPE 400 / 600 Computer Communication Networks Lecture 20.
1 Interconnection ECS 152A. 2 Interconnecting with hubs r Backbone hub interconnects LAN segments r Extends max distance between nodes r But individual.
MAC Addresses and ARP 32-bit IP address: –network-layer address –used to get datagram to destination IP subnet MAC (or LAN or physical or Ethernet) address:
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…
16 – CSMA/CD - ARP Network Layer4-1. 5: DataLink Layer5-2 CSMA (Carrier Sense Multiple Access) CSMA: listen before transmit: If channel sensed idle: transmit.
IP Address 0 network host 10 network host 110 networkhost 1110 multicast address A B C D class to to
Introduction 1 Lecture 25 Link Layer (Ethernet, Switch) slides are modified from J. Kurose & K. Ross University of Nevada – Reno Computer Science & Engineering.
3-1 Last time □ Finished introduction and overview: ♦ Network access and physical media ♦ Internet structure and ISPs ♦ Delay & loss in packet-switched.
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,
Introduction1-1 Data Communications and Computer Networks Chapter 5 CS 3830 Lecture 26 Omar Meqdadi Department of Computer Science and Software Engineering.
Network LayerII-1 RSC Part II: Network Layer 4. IP in operation Redes y Servicios de Comunicaciones Universidad Carlos III de Madrid These slides are,
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.
5: DataLink Layer5-1 Chapter 5 Link Layer and LANs Part 4: Link Layer addressing Ethernet Computer Networking: A Top Down Approach 6 th edition Jim Kurose,
5: DataLink Layer5-1 Ethernet “dominant” wired LAN technology: r cheap $20 for 100Mbs! r first widely used LAN technology r Simpler, cheaper than token.
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.
Chapter 5 Link Layer Link Layer5-1 Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley Chapter5_2.
4: DataLink Layer1 Chapter 4: The Data Link Layer Our goals: r understand principles behind data link layer services: m error detection, correction m sharing.
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.
Chapter 5 Link Layer Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012 Link Layer LANs.
Chapter 5 Link Layer Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012 Link Layer5-1.
Chapter 5 Link Layer Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012 A note on the use of these.
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.
5: DataLink Layer5-1 CSMA (Carrier Sense Multiple Access) CSMA: listen before transmit: If channel sensed idle: transmit entire frame r If channel sensed.
CS 1652 Jack Lange University of Pittsburgh 1. 5: DataLink Layer5-2 MAC Addresses and ARP r 32-bit IP address: m network-layer address m used to get datagram.
EEC-484 Computer Networks Lecture 13 Wenbing Zhao 12/6/20151.
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: 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.
Chapter 5 Link Layer Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012 A note on the use of these.
Ch 5. The Link Layer and Local Area Networks Myungchul Kim
EEC-484/584 Computer Networks Lecture 13 Wenbing Zhao
EEC-484/584 Computer Networks Lecture 14 Wenbing Zhao
Net5: ARP 協定 授課教師:雲林科技大學 張慶龍 老師. IP Address/Physical Address Static Mapping  IP broadcast address maps to Ethernet broadcast address  IP Multicast Address.
Shashank Srivastava Motilal Nehru national Institute Of Information Technology, Allahabad Data Link Layer.
5: DataLink Layer5-1 Hubs Hubs are essentially physical-layer repeaters: m bits coming from one link go out all other links m at the same rate m no frame.
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 Link-layer switches. 5: DataLink Layer5-2 Hubs … physical-layer (“dumb”) repeaters: m bits coming in one link go out all other links.
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.
CSEN 404 Data Link Layer Amr El Mougy Lamia AlBadrawy.
4: DataLink Layer1 LAN technologies Data link layer so far: m services, error detection/correction, multiple access Next: LAN technologies m addressing.
CPSC 441: Link Layer1 Link Layer Addressing Slides originally from Carey Williamson Notes derived from “ Computer Networking: A Top Down Approach”, by.
CHAPTER 5. Data Link Layer5-2 Link Layer: Introduction Terminology: hosts and routers are nodes communication channels that connect adjacent nodes along.
CS 457 – Lecture 3 Link Layer Protocols Fall 2011.
Chapter 5 Link Layer Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012 A note on the use of these.
5-1 Last time □ Multiple access protocols ♦ Channel partitioning MAC protocols TDMA, FDMA ♦ Random access MAC protocols Slotted Aloha, Pure Aloha, CSMA,
Introduction to Networks
Link Layer 5.1 Introduction and services
Link Layer 5.1 Introduction and services
MAC Addresses and ARP 32-bit IP address:
University of Pittsburgh
ARP: Address Resolution Protocol
Mac Addressing, Ethernet, and Interconnections
Hubs Hubs are essentially physical-layer repeaters:
Introduction to Networks
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.
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
Presentation transcript:

Link Layer Fundamentals NWEN302 Computer Network Design

Topics to be covered Link layer services Link layer addressing and address resolution Ethernet Switches © Winston SeahNWEN302 Computer Network Design 1

Network data at different layers The generic term for a piece of information at any layer is referred to as a packet. Message – application layer data; stuff that comes from your application Segment – transport layer data, typically TCP/UDP segments Datagram – network layer data blocks moved by routers from source to destination Frame – block of data transferred between neighboring devices at the link layer bits – units of binary information “on the wire” © Winston SeahNWEN302 Computer Network Design 2 application transport network link physical

Link Layer: Introduction © Winston SeahNWEN302 Computer Network Design 3 Basic terminology: hosts and routers are nodes communication channels that connect adjacent nodes along communication path are links –wired links –wireless links layer-2 packet is a frame, encapsulates datagram data-link layer has responsibility of transferring datagram from one node to adjacent node over a link

Link layer: context datagram transferred by different link protocols over different links: –e.g., Ethernet on first link, frame relay on intermediate links, IEEE on last link each link protocol provides different services –e.g., may or may not provide reliable data transfer over the link © Winston SeahNWEN302 Computer Network Design 4

Link Layer Services Framing, link access: –Encapsulate datagram into frame, adding header, trailer –Arbitrates channel access if shared medium –“MAC” addresses used in frame headers to identify source and destination nodes  different from IP address! © Winston SeahNWEN302 Computer Network Design 5

Link Layer Services Reliable delivery between adjacent nodes –Seldom used on low bit-error link (fiber, some twisted pair) –Very often used on wireless links: high error rates Q (for the future): why both link-level and end-end reliability (e.g. TCP)? © Winston SeahNWEN302 Computer Network Design 6

Link Layer Services Flow control: –pacing between adjacent sending and receiving nodes –Another Q for the future  How does this compare against TCP flow control? Half-duplex and full-duplex –with half duplex, nodes at both ends of link can transmit, but not at same time NWEN302 Computer Network Design © Winston Seah7

Link Layer Services 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 NWEN302 Computer Network Design © Winston Seah8

Where is the link layer implemented? In each and every host Link layer implemented in “adaptor” (aka network interface card – NIC) –Ethernet card, PCMCI card, card –implements link, physical layer Connects to host’s system buses Combination of hardware, software, and firmware © Winston SeahNWEN302 Computer Network Design 9 controller physical transmission cpu memory host bus (e.g., PCI) network interface card / adaptor host schematic application transport network link physical

Adaptors Communicating © Winston SeahNWEN302 Computer Network Design 10 Receiving side: Error detection, reliable data transfer, flow control, etc extracts datagram, passes to upper layer at receiving side Sending side: encapsulates datagram in frame adds error checking bits, reliable data transfer, flow control, etc. controller sending host receiving host datagram frame

Error Detection © Winston SeahNWEN302 Computer Network Design 11 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 NWEN302 Computer Network Design Single Bit Parity: Detect single bit errors Two Dimensional Bit Parity: Detect and correct single bit errors © Winston Seah correctable single bit error

Sender: treat segment contents as sequence of 16-bit integers checksum: addition (1’s complement sum) of segment contents sender puts checksum value into UDP checksum field Internet checksum (more later) Receiver: compute checksum of received segment check if computed checksum equals checksum field value: –NO - error detected –YES - no error detected  But maybe errors still exist? © Winston SeahNWEN302 Computer Network Design 13 Goal: detect “errors” (e.g., flipped bits) in transmitted packet (note: used at transport layer only) v=JqEvNxAJtDk

Checksum: 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 – exactly divisible by G (modulo 2) –receiver knows G, divides by G. If non-zero remainder  error detected! –can detect all burst errors less than r + 1 bits widely used in practice (Ethernet, WiFi, ATM) © Winston SeahNWEN302 Computer Network Design 14

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, we get remainder R NWEN302 Computer Network Design R = remainder[ ] D.2rGD.2rG © Winston Seah15

Try at home examples G=1001, D=110010, r= ?? Given that with polynomial G(x)= x 5 + x 4 + x 3 + x 2 + x 0 and D = AF1867C (in hexadecimal) the r=0000 (in binary). Find the r, for D= AF1867D. © Winston SeahNWEN302 Computer Network Design 16

Topics to be covered Link layer services Link layer addressing and address resolution Ethernet Switches © Winston SeahNWEN302 Computer Network Design 17

MAC Addresses and ARP 32-bit IP address: –network-layer address –used to get datagram to destination IP subnet MAC / LAN / physical / Ethernet address: –function: send frame from one interface to another physically-connected interface (same network) –48 bit MAC address (for most LANs) “burned” in NIC ROM, and sometimes software configurable © Winston SeahNWEN302 Computer Network Design 18

LAN Addresses and ARP © Winston SeahNWEN302 Computer Network Design 19 Each adapter on the LAN has a unique LAN address Broadcast address = FF-FF-FF-FF-FF-FF = adapter 1A-2F-BB AD D7-FA-20-B0 0C-C4-11-6F-E F7-2B LAN (wired or wireless)

LAN Address (more) MAC address allocation administered by IEEE Manufacturer buys portion of MAC address space (to assure uniqueness) analogy: a)MAC address: like National Student Number (NZ) and Social Security Number (US) b)IP address: like postal address MAC flat address ➜ portability –can move LAN card from one LAN to another IP hierarchical address NOT portable –address depends on IP subnet to which node is attached © Winston SeahNWEN302 Computer Network Design 20

ARP: Address Resolution Protocol © Winston SeahNWEN302 Computer Network Design 21 Each IP node (host, router) on LAN has ARP table ARP table: IP/MAC address mappings for some LAN nodes –TTL (Time To Live): time after which address mapping will be forgotten (typically 20 min) Q: how to determine MAC addr of B knowing B’s IP addr? 1A-2F-BB AD D7-FA-20-B0 0C-C4-11-6F-E F7-2B LAN

ARP protocol: Same LAN Node A wants to send datagram to node B, and B’s MAC addr 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 nodes on LAN receive the ARP query B replies to A with its (B's) MAC address –frame sent to A’s MAC address (unicast) © Winston SeahNWEN302 Computer Network Design 22

ARP protocol: Same LAN Node A caches (saves) B’s 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 –“arp” command for displaying and modifying ARP table © Winston SeahNWEN302 Computer Network Design 23

ARP usage in Routing to another LAN © Winston SeahNWEN302 Computer Network Design 24 Objective: send datagram from A to B via R Assumption: A knows B’s IP address Router R maintains two ARP tables in, one for each IP (sub)network (LAN) R 1A-23-F9-CD-06-9B E6-E BB-4B CC-49-DE-D0-AB-7D A C-E8-FF B2-2F-54-1A-0F B BD-D2-C7-56-2A

ARP usage in Routing to another LAN 1. A creates IP datagram with source A, destination B and A sends IP datagram to next hop (router)  R 1. A uses ARP to get R’s MAC address  A creates link-layer frame with R's MAC address as destination, frame contains A-to-B IP datagram 3. A’s NIC sends frame 4. R’s NIC receives frame 5. R removes IP datagram from Ethernet frame, and sees that it is destined to B (in the same local subnet of its other NIC) 6. R uses ARP to get B’s MAC address  R creates frame containing A-to-B IP datagram sends to B © Winston SeahNWEN302 Computer Network Design 25

Topics to be covered Link layer services Link layer addressing and address resolution Ethernet Switches © Winston SeahNWEN302 Computer Network Design 26

Ethernet “dominant” wired LAN technology: cheap $20 for NIC first widely used LAN technology simpler, cheaper than token LANs and ATM kept up with speed race: 10 Mbps – 10 Gbps Metcalfe’s Ethernet sketch © Winston SeahNWEN302 Computer Network Design 27

Ethernet: physical topology bus: popular through mid 90s –all nodes in same collision domain (can collide with each other) star: prevails today –active switch in center –each “spoke” runs a (separate) Ethernet protocol (nodes do not collide with each other) bus: coaxial cable switch star © Winston SeahNWEN302 Computer Network Design 28

Ethernet frame structure sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame preamble: 7 bytes with pattern followed by one byte with pattern used to synchronize receiver, sender clock rates dest. address source address data (payload) CRC preamble type © Winston SeahNWEN302 Computer Network Design 29

Ethernet frame structure (more) addresses: 6 byte source, destination MAC addresses –if adapter receives frame with matching destination address, or with broadcast address (e.g. ARP packet), it passes data in frame to network layer protocol –otherwise, adapter discards frame type: indicates higher layer protocol (mostly IP but others possible, e.g., Novell IPX, AppleTalk) CRC: cyclic redundancy check at receiver –error detected: frame is dropped dest. address source address data (payload) CRC preamble type © Winston SeahNWEN302 Computer Network Design 30

Ethernet: unreliable, connectionless connectionless: no handshaking between sending and receiving NICs unreliable: receiving NIC doesnt send acks or nacks to sending NIC –data in dropped frames recovered only if initial sender uses higher layer rdt (e.g., TCP), otherwise dropped data lost Ethernet’s MAC protocol: unslotted CSMA/CD wth binary backoff © Winston SeahNWEN302 Computer Network Design 31

802.3 Ethernet standards: link & physical layers many different Ethernet standards –common MAC protocol and frame format –different speeds: 2 Mbps, 10 Mbps, 100 Mbps, 1Gbps, 10G bps –different physical layer media: fiber, cable application transport network link physical MAC protocol and frame format 100BASE-TX 100BASE-T4 100BASE-FX 100BASE-T2 100BASE-SX 100BASE-BX fiber physical layer copper (twister pair) physical layer © Winston SeahNWEN302 Computer Network Design 32

Topics to be covered Link layer services Link layer addressing and address resolution Ethernet Switches © Winston SeahNWEN302 Computer Network Design 33

Ethernet switch link-layer device: takes an active role –store, forward Ethernet frames –examine incoming frame’s MAC address, selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment, uses CSMA/CD to access segment transparent –hosts are unaware of presence of switches plug-and-play, self-learning –switches do not need to be configured © Winston SeahNWEN302 Computer Network Design 34

Switch: multiple simultaneous transmissions hosts have dedicated, direct connection to switch switches buffer packets Ethernet protocol used on each incoming link, but no collisions; full duplex –each link is its own collision domain switching: A-to-A’ and B-to-B’ can transmit simultaneously, without collisions switch with six interfaces (1,2,3,4,5,6) A A’A’ B B’B’C C’C’ © Winston SeahNWEN302 Computer Network Design 35

Switch forwarding table Q: how does switch know A’ reachable via interface 4, B’ reachable via interface 5? switch with six interfaces (1,2,3,4,5,6) A A’A’ B B’B’C C’C’ 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? © Winston SeahNWEN302 Computer Network Design 36

A A’A’ B B’B’C C’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 A A’ Source: A Dest: A’ Switch table (initially empty) MAC addr interface TTL A 1 60 © Winston SeahNWEN302 Computer Network Design 37

Switch: frame filtering/forwarding when frame received at switch 1. record incoming link, MAC address of sending host 2. index switch table using MAC destination address 3. if entry found for destination then { if destination on segment from which frame arrived then drop frame else forward frame on interface indicated by entry } else flood /* forward on all interfaces except arriving interface */ © Winston SeahNWEN302 Computer Network Design 38

A A’A’ B B’B’C C’C’ Self-learning, forwarding: example A A’ Source: A Dest: A’ MAC addr interface TTL switch table (initially empty) A 1 60 A A’ frame destination, A’, location unknown: flood A’ A destination A location known: A’A’ 4 60 selectively send on just one link © Winston SeahNWEN302 Computer Network Design 39

Interconnecting switches switches can be connected together Q: sending from A to G - how does S 1 know to forward frame destined to F via S 4 and S 3 ? A: self learning! (works exactly the same as in single-switch case!) A B S1S1 C D E F S2S2 S4S4 S3S3 H I G © Winston SeahNWEN302 Computer Network Design 40

Self-learning multi-switch example Suppose C sends frame to I, I responds to C  Q: show switch tables and packet forwarding in S 1, S 2, S 3, S 4 A B S1S1 C D E F S2S2 S4S4 S3S3 H I G © Winston SeahNWEN302 Computer Network Design 41

to external network router IP subnet mail server web server Institutional network © Winston SeahNWEN302 Computer Network Design 5-42

Switches vs. routers 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: compute tables using routing algorithms, IP addresses  switches: learn forwarding table using flooding, learning, MAC addresses application transport network link physical network link physical link physical switch datagram application transport network link physical frame datagram © Winston SeahNWEN302 Computer Network Design 43

Link Layer Fundamentals Link layer services (Sect 5.1 & 5.2) Link layer addressing and address resolution (Sect 5.4.1) Ethernet (Sect 5.4.2) Switches (Sect 5.4.3) © Winston SeahNWEN302 Computer Network Design 44