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

Similar documents
The Link Layer and LANs: Ethernet and Swiches

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

CS 3516: Advanced Computer Networks

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

CSC 4900 Computer Networks: Link Layer (2)

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

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

Principles behind data link layer services:

Link layer: introduction

Principles behind data link layer services

Principles behind data link layer services:

Principles behind data link layer services:

Summary of MAC protocols

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

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

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

Lecture 9 Ethernet and other Link Layer protocols

Chapter 6 The Link Layer and LANs

Chapter 5: The Data Link Layer. Chapter 5 Link Layer and LANs. Ethernet. Link Layer. Star topology. Ethernet Frame Structure.

Link layer, LANs: outline. Chapter 5-2 Link Layer. MAC addresses (more) MAC addresses

Medium Access Protocols

Chapter 5 Link Layer. Down Approach. Computer Networking: A Top. 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

Master Course Computer Networks IN2097

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

Chapter V: Link Layer

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

Chapter 5 Data Link Layer

CSCD 330 Network Programming Spring 2017

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

LINK LAYER AND LANS 1

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

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

Module 10 Data Link Layer CS655! 10-1!

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

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

Master Course Computer Networks IN2097

Chapter V: Link Layer

Chapter 5 Link Layer and LANs

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

Chapter 5 Data Link Layer

CSCD 330 Network Programming Winter 2016

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

Chapter 5 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

Module 4 Data Link Layer CS655! 4-1!

Chapter 5 Link Layer. Link Layer 5-1

Lecture 20: Link Layer

Chapter 5: The Data Link Layer

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

Chapter 6 The Data Link layer

Chapter 6 The Link Layer and LANs

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

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

Chapter 6 The Link Layer and LANs

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

Link Layer and Ethernet

Link Layer and Ethernet

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

Chapter 5: Link layer

ECE 4450:427/527 - Computer Networks Spring 2017

Chapter 5: DataLink Layer

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

CSCI Computer Networks Spring 2017

CSCI Computer Networks Fall 2016

Computer Network Fundamentals Spring Week 3 MAC Layer Andreas Terzis

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

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

Chapter 6 The Link Layer and LANs

Chapter 6 The Link Layer and LANs

Chapter 6 The Data Link layer

Chapter 6 The Link Layer and LANs

CSC 401 Data and Computer Communications Networks

Link Layer and LANs. Our Goals. Link Layer

Chapter 5 Link Layer and LANs

Chapter 6 The Link Layer and LANs

Computer Communication Networks Link

CS/ECE 438: Communication Networks Fall Link Layer

The Link Layer II: Ethernet

Announcements. CS 5565 Network Architecture and Protocols. Ethernet. Ethernet. Ethernet Model. Ideal Multiple Access Protocol

Topic 2a. Ch 6: The Link Layer and LANs. Computer Networking: A Top Down Approach

CC451 Computer Networks

Chapter 6 The Link Layer and LANs

Chapter 6 The Link Layer and LANs

Chapter 6 The Link Layer and LANs

CSC 8560 Computer Networks: Link Layer

Objectives. Hexadecimal Numbering and Addressing. Ethernet / IEEE LAN Technology. Ethernet

Architettura di Reti

COMP211 Chapter 6/7 Link Layer

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

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

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

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

Communication Networks

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

Chapter 5: Link layer

CS 457 Lecture 11 More IP Networking. Fall 2011

Transcription:

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

Ethernet Metcalfe s Ethernet sketch 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

Ethernet: unreliable, connectionless Connectionless: no handshaking between sending and receiving NICs Unreliable: receiving NIC doesn t send acks or nacks to sending NIC data in dropped frames recovered only if initial sender uses higher layer reliable delivery (e.g., TCP), otherwise dropped data lost Ethernet s MAC protocol: CSMA/CD with binary exponential backoff

802.3 Ethernet standards: link & physical layers Many different Ethernet standards Common MAC protocol and frame format Speeds: 2 Mbps, 10 Mbps, 100 Mbps, 1Gbps, 10Gbps Physical layer media: fiber, copper cable application transport network link physical 100BASE-TX 100BASE-T4 MAC protocol and frame format 100BASE-T2 100BASE-SX 100BASE-FX 100BASE-BX copper (twister pair) physical layer fiber physical layer

Ethernet frame structure Sender encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame type preamble dest. address source address data (payload) CRC preamble: 7 bytes with pattern 10101010 followed by one byte with pattern 10101011

Clock Synching Bits represented as voltages, either low or high We will read one bit per clock cycle

Clock Synching Bits represented as voltages, either low or high We will read one bit per clock cycle Ideal receiver: Sample signal at regular interval. For 1 Gbps Ethernet, ~1 nanosecond interval.

Clock Synching Bits represented as voltages, either low or high We will read one bit per clock cycle Problem: receiver clock may not agree with sender! Preamble let s receiver see several 0 -> 1 -> 0 -> transitions.

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 type preamble dest. address source address data (payload) CRC

A quick lab note You will NOT see the preamble in the frames you receive. (It also doesn t count as part of the 1500 byte MTU) There are header structs defined in sr_protocol.h. First task upon receiving a packet: Is this for me? Compare dest address of packet against address of interface that received it. Function already exists for this (ether_to_me) type preamble dest. address source address data (payload) CRC

MAC Addresses 32-bit IP address: network-layer address for interface used by network layer for end-to-end routing MAC (or LAN or physical or Ethernet) address: function: used locally to get a frame from one interface to another physically-connected interface (same sub-network) 48 bit MAC address (for most LANs) burned in NIC ROM, also (usually) software settable e.g.: 1A-2F-BB-76-09-AD hexadecimal (base 16) notation (each digit represents 4 bits)

MAC Addresses Each interface/adapter on LAN has unique MAC 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

MAC Addresses MAC address allocation administered by IEEE Manufacturer buys portion of MAC address space (to assure uniqueness) 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 address depends on IP subnet to which node is attached

ARP: Address Resolution Protocol Question: how to determine interface s MAC address, knowing its IP address? 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: each IP node (host, router) on LAN has 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 & LAN communication A wants to send datagram to B. A knows B s IP address. B s MAC address not in A s ARP table. A broadcasts ARP query packet, containing B's IP address dest Ethernet address = FF-FF-FF-FF-FF-FF all nodes on LAN receive ARP query, most ignore it B receives ARP packet, replies to A with its (B's) MAC address frame sent to A s MAC address (unicast) A caches IP-to-MAC address pair in its ARP table until timeout soft state: times out unless refreshed, can be reacquired

Addressing: routing to another LAN Walkthrough: send datagram from A to B via R focus on addressing at IP (datagram) and MAC layer (frame) assume A knows B s IP address (e.g., DNS lookup is done) Note: there s a router here, these are separate subnets A 111.111.111.111 74-29-9C-E8-FF-55 R 222.222.222.1 1A-23-F9-CD-06-9B B 222.222.222.222 49-BD-D2-C7-56-2A 111.111.111.112 CC-49-DE-D0-AB-7D 111.111.111.1 E6-E9-00-17-BB-4B 222.222.222.221 88-B2-2F-54-1A-0F

Addressing: routing to another LAN Walkthrough: send datagram from A to B via R Who do we address the datagram to (IP destination)? Who do we forward it to on the first hop? A 111.111.111.111 74-29-9C-E8-FF-55 R 222.222.222.1 1A-23-F9-CD-06-9B B 222.222.222.222 49-BD-D2-C7-56-2A 111.111.111.112 CC-49-DE-D0-AB-7D 111.111.111.1 E6-E9-00-17-BB-4B 222.222.222.221 88-B2-2F-54-1A-0F

How does A learn the IP address of R? A. ARP C. IP B. DHCP D. Routing protocol A 111.111.111.111 74-29-9C-E8-FF-55 111.111.111.112 CC-49-DE-D0-AB-7D R 111.111.111.1 E6-E9-00-17-BB-4B 222.222.222.1 1A-23-F9-CD-06-9B B 222.222.222.222 49-BD-D2-C7-56-2A 222.222.222.221 88-B2-2F-54-1A-0F

How does A learn the MAC address of R? A. ARP C. IP B. DHCP D. Routing protocol A 111.111.111.111 74-29-9C-E8-FF-55 111.111.111.112 CC-49-DE-D0-AB-7D R 111.111.111.1 E6-E9-00-17-BB-4B 222.222.222.1 1A-23-F9-CD-06-9B B 222.222.222.222 49-BD-D2-C7-56-2A 222.222.222.221 88-B2-2F-54-1A-0F

Addressing: routing to another LAN A creates IP datagram with IP source A, destination B A creates link-layer frame with R's MAC address as dest, frame contains A-to-B IP datagram IP Eth Phy 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 A 111.111.111.111 74-29-9C-E8-FF-55 R 222.222.222.1 1A-23-F9-CD-06-9B B 222.222.222.222 49-BD-D2-C7-56-2A 111.111.111.112 CC-49-DE-D0-AB-7D 111.111.111.1 E6-E9-00-17-BB-4B 222.222.222.221 88-B2-2F-54-1A-0F

Addressing: routing to another LAN frame sent from A to R frame received at R, datagram removed, passed up to IP MAC src: 74-29-9C-E8-FF-55 MAC dest: E6-E9-00-17-BB-4B IP src: 111.111.111.111 IP src: 111.111.111.111 IP dest: 222.222.222.222 IP dest: 222.222.222.222 IP Eth Phy A 111.111.111.111 74-29-9C-E8-FF-55 111.111.111.112 CC-49-DE-D0-AB-7D IP Eth Phy R 111.111.111.1 E6-E9-00-17-BB-4B 222.222.222.1 1A-23-F9-CD-06-9B B 222.222.222.222 49-BD-D2-C7-56-2A 222.222.222.221 88-B2-2F-54-1A-0F

Addressing: routing to another LAN R forwards datagram with IP source A, destination B R creates link-layer frame with B's MAC address as dest, frame contains A-to-B IP datagram What needs to happen before the router can transmit? A 111.111.111.111 74-29-9C-E8-FF-55 IP Eth Phy R 222.222.222.1 1A-23-F9-CD-06-9B 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 B 222.222.222.222 49-BD-D2-C7-56-2A 111.111.111.112 CC-49-DE-D0-AB-7D 111.111.111.1 E6-E9-00-17-BB-4B 222.222.222.221 88-B2-2F-54-1A-0F

Addressing: routing to another LAN R forwards datagram with IP source A, destination B R creates link-layer frame with B's MAC address as dest, frame contains A-to-B IP datagram A 111.111.111.111 74-29-9C-E8-FF-55 IP Eth Phy R 222.222.222.1 1A-23-F9-CD-06-9B 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 222.222.222.222 49-BD-D2-C7-56-2A 111.111.111.112 CC-49-DE-D0-AB-7D 111.111.111.1 E6-E9-00-17-BB-4B 222.222.222.221 88-B2-2F-54-1A-0F

Addressing: routing to another LAN R forwards datagram with IP source A, destination B R creates link-layer frame with B's MAC address as dest, 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 A 111.111.111.111 74-29-9C-E8-FF-55 R 222.222.222.1 1A-23-F9-CD-06-9B B 222.222.222.222 49-BD-D2-C7-56-2A 111.111.111.112 CC-49-DE-D0-AB-7D 111.111.111.1 E6-E9-00-17-BB-4B 222.222.222.221 88-B2-2F-54-1A-0F

Physical Topology: Bus Bus: popular through mid 90s all nodes in same collision domain (transmissions collide with each other) bus: coaxial cable

Physical Topology: Star Hub in the center: broadcasts all messages to all hosts retransmits on collisions often considered a physical layer device (like a bus wire) star Hub

Physical Topology: Star (Switched) Switch: prevails today each spoke runs a (separate) Ethernet protocol (nodes do not collide with each other) Full duplex: No collisions on spoke switch star

Institutional Network (Tree) To external network router mail server web server IP subnet

Ethernet switch link-layer device: takes an active role store, forward Ethernet frames examines incoming frame s MAC address, selectively forwards 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

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-D and B-to-E can transmit simultaneously, without collisions E F 6 5 D A 1 2 4 3 C switch with six interfaces (1,2,3,4,5,6) B

Switch forwarding table Q: how does switch know D reachable via interface 4, E reachable via interface 5? F A B A: each switch has a forwarding table, each entry: 6 5 1 2 4 3 (MAC address of host, interface to reach host, time stamp) E C looks like a router s forwarding table! D switch with six interfaces (1,2,3,4,5,6)

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

Suppose the switch receives a packet from A to G. (Assume it knows what interface both A and G are on.) It should A. Flood the packet A B. Throw the packet away F G B C. Send the packet out on interface 1 E 6 5 1 2 4 3 C D. Do something else D

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 { if destination on segment from which frame arrived drop frame else } forward frame on interface indicated by entry else flood /* forward on all interfaces except arriving interface */

Interconnecting switches Switches often connected to form trees. S 4 A B S 1 C S 2 D E F G S 3 H I

Sending from A to G - how does S 1 know to forward frame destined to G via S 4 and S 3? S 4 A B S 1 C S 2 D E F G S 3 H I A. A network administrator will need to configure this. B. S 1 will automatically learn the entire path. C. S 1 will learn to send packets to G on the interface that leads to S 4.

Eve wants to snoop and read all of the frames being sent to anyone on the LAN. She will NOT be able to do this on a A. Bus B. Hub C. Switch D. She can do this on all of these

Switches vs. routers both are store-and-forward: routers: network-layer devices (examine networklayer 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 datagram frame application transport network link physical switch application transport network link physical link physical network link physical frame frame datagram

Switches vs. routers both are store-and-forward: routers: network-layer Switches devices do (examine NOT run networklayer headers) a complex coordination protocol switches: like link-layer routing. 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 datagram frame application transport network link physical switch application transport network link physical link physical network link physical frame frame datagram

Summary LAN address: flat (vs. hierarchical IP) Many potential topologies: Bus: shared wire, star (hub) Switched: star, tree Switches learn who is connected, selectively forward toward destination