Presentation is loading. Please wait.

Presentation is loading. Please wait.

5: DataLink Layer5-1 Chapter 5b Link Layer and LANs (for reference only) Computer Networking: A Top Down Approach 5 th edition. Jim Kurose, Keith Ross.

Similar presentations


Presentation on theme: "5: DataLink Layer5-1 Chapter 5b Link Layer and LANs (for reference only) Computer Networking: A Top Down Approach 5 th edition. Jim Kurose, Keith Ross."— Presentation transcript:

1 5: DataLink Layer5-1 Chapter 5b Link Layer and LANs (for reference only) Computer Networking: A Top Down Approach 5 th edition. Jim Kurose, Keith Ross Addison-Wesley, April 2009.

2 5: DataLink Layer5-2 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 r 5.5 Ethernet r 5.6 Link-layer switches r 5.7 PPP r 5.8 Link virtualization: MPLS r 5.9 A day in the life of a web request

3 5: DataLink Layer5-3 Ethernet “dominant” wired LAN technology: r cheap $20 for NIC r first widely used LAN technology r simpler, cheaper than token LANs and ATM r kept up with speed race: 10 Mbps – 10 Gbps Metcalfe’s Ethernet sketch

4 5: DataLink Layer5-4 Star topology r bus topology popular through mid 90s m all nodes in same collision domain (can collide with each other) r today: star topology prevails m active switch in center m each “spoke” runs a (separate) Ethernet protocol (nodes do not collide with each other) switch bus: coaxial cable star

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

6 5: DataLink Layer5-6 Ethernet Frame Structure (more) r Addresses: 6 bytes m if adapter receives frame with matching destination address, or with broadcast address (eg ARP packet), it passes data in frame to network layer protocol m otherwise, adapter discards frame r Type: indicates higher layer protocol (mostly IP but others possible, e.g., Novell IPX, AppleTalk) r CRC: checked at receiver, if error is detected, frame is dropped

7 5: DataLink Layer5-7 Ethernet: Unreliable, connectionless r connectionless: No handshaking between sending and receiving NICs r unreliable: receiving NIC doesn’t send acks or nacks to sending NIC m stream of datagrams passed to network layer can have gaps (missing datagrams) m gaps will be filled if app is using TCP m otherwise, app will see gaps r Ethernet’s MAC protocol: unslotted CSMA/CD

8 5: DataLink Layer5-8 Ethernet 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: after mth collision, NIC chooses K at random from {0,1,2,…,2 m -1}. NIC waits K·512 bit times, returns to Step 2

9 5: DataLink Layer5-9 Ethernet’s CSMA/CD (more) Jam Signal: make sure all other transmitters are aware of collision; 48 bits Bit time:.1 microsec for 10 Mbps Ethernet ; for K=1023, wait time is about 50 msec Exponential Backoff: r Goal: adapt retransmission attempts to estimated current load m heavy load: random wait will be longer r first collision: choose K from {0,1}; delay is K· 512 bit transmission times r after second collision: choose K from {0,1,2,3}… r after ten collisions, choose K from {0,1,2,3,4,…,1023} See/interact with Java applet on AWL Web site: highly recommended !

10 5: DataLink Layer5-10 CSMA/CD efficiency r T prop = max prop delay between 2 nodes in LAN r t trans = time to transmit max-size frame r efficiency goes to 1 m as t prop goes to 0 m as t trans goes to infinity r better performance than ALOHA: and simple, cheap, decentralized !

11 5: DataLink Layer5-11 802.3 Ethernet Standards: Link & Physical Layers r many different Ethernet standards m common MAC protocol and frame format m different speeds: 2 Mbps, 10 Mbps, 100 Mbps, 1Gbps, 10G bps m 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

12 5: DataLink Layer5-12 Manchester encoding r used in 10BaseT r each bit has a transition r allows clocks in sending and receiving nodes to synchronize to each other m no need for a centralized, global clock among nodes! r Hey, this is physical-layer stuff!

13 5: DataLink Layer5-13 Link Layer r 5.1 Introduction and services r 5.2 Error detection and correction r 5.3 Multiple access protocols r 5.4 Link-layer Addressing r 5.5 Ethernet r 5.6 Link-layer switches, LANs, VLANs r 5.7 PPP r 5.8 Link virtualization: MPLS r 5.9 A day in the life of a web request

14 5: DataLink Layer5-14 Hubs … physical-layer (“dumb”) repeaters: m bits coming in one link go out all other links at same rate m all nodes connected to hub can collide with one another m no frame buffering m no CSMA/CD at hub: host NICs detect collisions twisted pair hub

15 5: DataLink Layer5-15 Switch r link-layer device: smarter than hubs, take active role m store, forward Ethernet frames m 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 r transparent m hosts are unaware of presence of switches r plug-and-play, self-learning m switches do not need to be configured

16 5: DataLink Layer5-16 Switch: allows multiple simultaneous transmissions r hosts have dedicated, direct connection to switch r switches buffer packets r Ethernet protocol used on each incoming link, but no collisions; full duplex m each link is its own collision domain r switching: A-to-A’ and B- to-B’ simultaneously, without collisions m not possible with dumb hub A A’ B B’ C C’ switch with six interfaces (1,2,3,4,5,6) 1 2 3 4 5 6

17 5: DataLink Layer5-17 Switch Table r Q: how does switch know that A’ reachable via interface 4, B’ reachable via interface 5? r A: each switch has a switch table, each entry: m (MAC address of host, interface to reach host, time stamp) r looks like a routing table! r Q: how are entries created, maintained in switch table? m something like a routing protocol? A A’ B B’ C C’ switch with six interfaces (1,2,3,4,5,6) 1 2 3 4 5 6

18 5: DataLink Layer5-18 Switch: self-learning r switch learns which hosts can be reached through which interfaces m when frame received, switch “learns” location of sender: incoming LAN segment m records sender/location pair in switch table A A’ B B’ C C’ 1 2 3 4 5 6 A A’ Source: A Dest: A’ MAC addr interface TTL Switch table (initially empty) A 1 60

19 5: DataLink Layer5-19 Switch: frame filtering/forwarding When frame received: 1. record link associated with sending host 2. index switch table using MAC dest address 3. if entry found for destination then { if dest on segment from which frame arrived then drop the frame else forward the frame on interface indicated } else flood forward on all but the interface on which the frame arrived

20 5: DataLink Layer5-20 Self-learning, forwarding: example A A’ B B’ C C’ 1 2 3 4 5 6 A A’ Source: A Dest: A’ MAC addr interface TTL Switch table (initially empty) A 1 60 A A’ r frame destination unknown: flood A’ A r destination A location known: A’ 4 60 selective send

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

22 5: DataLink Layer5-22 Self-learning multi-switch example Suppose C sends frame to I, I responds to C r 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 1 2

23 5: DataLink Layer5-23 Institutional network to external network router IP subnet mail server web server

24 5: DataLink Layer5-24 Switches vs. Routers r both store-and-forward devices m routers: network layer devices (examine network layer headers) m switches are link layer devices r routers maintain routing tables, implement routing algorithms r switches maintain switch tables, implement filtering, learning algorithms

25 5: DataLink Layer5-25 VLANs: motivation What happens if: r CS user moves office to EE, but wants connect to CS switch? r single broadcast domain: m all layer-2 broadcast traffic (ARP, DHCP) crosses entire LAN (security/privacy, efficiency issues) r each lowest level switch has only few ports in use Computer Science Electrical Engineering Computer Engineering What’s wrong with this picture?

26 5: DataLink Layer5-26 VLANs Port-based VLAN: switch ports grouped (by switch management software) so that single physical switch …… Switch(es) supporting VLAN capabilities can be configured to define multiple virtual LANS over single physical LAN infrastructure. Virtual Local Area Network 1 8 9 1610 2 7 … Electrical Engineering (VLAN ports 1-8) Computer Science (VLAN ports 9-15) 15 … Electrical Engineering (VLAN ports 1-8) … 1 8 2 7 9 1610 15 … Computer Science (VLAN ports 9-16) … operates as multiple virtual switches

27 5: DataLink Layer5-27 Port-based VLAN 1 8 9 1610 2 7 … Electrical Engineering (VLAN ports 1-8) Computer Science (VLAN ports 9-15) 15 … r traffic isolation: frames to/from ports 1-8 can only reach ports 1-8 m can also define VLAN based on MAC addresses of endpoints, rather than switch port r dynamic membership: ports can be dynamically assigned among VLANs router r forwarding between VLANS: done via routing (just as with separate switches) m in practice vendors sell combined switches plus routers

28 5: DataLink Layer5-28 VLANS spanning multiple switches r trunk port: carries frames between VLANS defined over multiple physical switches m frames forwarded within VLAN between switches can’t be vanilla 802.1 frames (must carry VLAN ID info) m 802.1q protocol adds/removed additional header fields for frames forwarded between trunk ports 1 8 9 10 2 7 … Electrical Engineering (VLAN ports 1-8) Computer Science (VLAN ports 9-15) 15 … 2 7 3 Ports 2,3,5 belong to EE VLAN Ports 4,6,7,8 belong to CS VLAN 5 46 8 16 1

29 5: DataLink Layer5-29 Type 2-byte Tag Protocol Identifier (value: 81-00) Tag Control Information (12 bit VLAN ID field, 3 bit priority field like IP TOS) Recomputed CRC 802.1Q VLAN frame format 802.1 frame 802.1Q frame

30 5: DataLink Layer5-30 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 r 5.5 Ethernet r 5.6 Link-layer switches r 5.7 PPP r 5.8 Link virtualization: MPLS r 5.9 A day in the life of a web request

31 5: DataLink Layer5-31 Point to Point Data Link Control r one sender, one receiver, one link: easier than broadcast link: m no Media Access Control m no need for explicit MAC addressing m e.g., dialup link, ISDN line r popular point-to-point DLC protocols: m PPP (point-to-point protocol) m HDLC: High level data link control (Data link used to be considered “high layer” in protocol stack!

32 5: DataLink Layer5-32 PPP Design Requirements [RFC 1557] r packet framing: encapsulation of network-layer datagram in data link frame m carry network layer data of any network layer protocol (not just IP) at same time m ability to demultiplex upwards r bit transparency: must carry any bit pattern in the data field r error detection (no correction) r connection liveness: detect, signal link failure to network layer r network layer address negotiation: endpoint can learn/configure each other’s network address

33 5: DataLink Layer5-33 PPP non-requirements r no error correction/recovery r no flow control r out of order delivery OK r no need to support multipoint links (e.g., polling) Error recovery, flow control, data re-ordering all relegated to higher layers!

34 5: DataLink Layer5-34 PPP Data Frame r Flag: delimiter (framing) r Address: does nothing (only one option) r Control: does nothing; in the future possible multiple control fields r Protocol: upper layer protocol to which frame delivered (eg, PPP-LCP, IP, IPCP, etc)

35 5: DataLink Layer5-35 PPP Data Frame r info: upper layer data being carried r check: cyclic redundancy check for error detection

36 5: DataLink Layer5-36 Byte Stuffing r “data transparency” requirement: data field must be allowed to include flag pattern m Q: is received data or flag? r Sender: adds (“stuffs”) extra byte after each data byte r Receiver: m two 01111110 bytes in a row: discard first byte, continue data reception m single 01111110: flag byte

37 5: DataLink Layer5-37 Byte Stuffing flag byte pattern in data to send flag byte pattern plus stuffed byte in transmitted data

38 5: DataLink Layer5-38 PPP Data Control Protocol Before exchanging network- layer data, data link peers must r configure PPP link (max. frame length, authentication) r learn/configure network layer information m for IP: carry IP Control Protocol (IPCP) msgs (protocol field: 8021) to configure/learn IP address

39 5: DataLink Layer5-39 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 r 5.5 Ethernet r 5.6 Link-layer switches r 5.7 PPP r 5.8 Link virtualization: MPLS r 5.9 A day in the life of a web request

40 5: DataLink Layer5-40 Virtualization of networks Virtualization of resources: powerful abstraction in systems engineering: r computing examples: virtual memory, virtual devices m Virtual machines: e.g., java m IBM VM os from 1960’s/70’s r layering of abstractions: don’t sweat the details of the lower layer, only deal with lower layers abstractly

41 5: DataLink Layer5-41 The Internet: virtualizing networks 1974: multiple unconnected nets m ARPAnet m data-over-cable networks m packet satellite network (Aloha) m packet radio network … differing in: m addressing conventions m packet formats m error recovery m routing ARPAnet satellite net "A Protocol for Packet Network Intercommunication", V. Cerf, R. Kahn, IEEE Transactions on Communications, May, 1974, pp. 637-648.

42 5: DataLink Layer5-42 The Internet: virtualizing networks ARPAnet satellite net gateway Internetwork layer (IP): r addressing: internetwork appears as single, uniform entity, despite underlying local network heterogeneity r network of networks Gateway: r “embed internetwork packets in local packet format or extract them” r route (at internetwork level) to next gateway

43 5: DataLink Layer5-43 Cerf & Kahn’s Internetwork Architecture What is virtualized? r two layers of addressing: internetwork and local network r new layer (IP) makes everything homogeneous at internetwork layer r underlying local network technology m cable m satellite m 56K telephone modem m today: ATM, MPLS … “invisible” at internetwork layer. Looks like a link layer technology to IP!

44 5: DataLink Layer5-44 ATM and MPLS r ATM, MPLS separate networks in their own right m different service models, addressing, routing from Internet r viewed by Internet as logical link connecting IP routers m just like dialup link is really part of separate network (telephone network) r ATM, MPLS: of technical interest in their own right

45 5: DataLink Layer5-45 Asynchronous Transfer Mode: ATM r 1990’s/00 standard for high-speed (155Mbps to 622 Mbps and higher) Broadband Integrated Service Digital Network architecture r Goal: integrated, end-end transport of carry voice, video, data m meeting timing/QoS requirements of voice, video (versus Internet best-effort model) m “next generation” telephony: technical roots in telephone world m packet-switching (fixed length packets, called “cells”) using virtual circuits

46 5: DataLink Layer5-46 Multiprotocol label switching (MPLS) r initial goal: speed up IP forwarding by using fixed length label (instead of IP address) to do forwarding m borrowing ideas from Virtual Circuit (VC) approach m but IP datagram still keeps IP address! PPP or Ethernet header IP header remainder of link-layer frame MPLS header label Exp S TTL 20 3 1 5

47 5: DataLink Layer5-47 MPLS capable routers r a.k.a. label-switched router r forwards packets to outgoing interface based only on label value (don’t inspect IP address) m MPLS forwarding table distinct from IP forwarding tables r signaling protocol needed to set up forwarding m RSVP-TE m forwarding possible along paths that IP alone would not allow (e.g., source-specific routing) !! m use MPLS for traffic engineering r must co-exist with IP-only routers

48 5: DataLink Layer5-48 R1 R2 D R3 R4 R5 0 1 0 0 A R6 in out out label label dest interface 6 - A 0 in out out label label dest interface 10 6 A 1 12 9 D 0 in out out label label dest interface 10 A 0 12 D 0 1 in out out label label dest interface 8 6 A 0 0 8 A 1 MPLS forwarding tables

49 5: DataLink Layer5-49 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 r 5.5 Ethernet r 5.6 Link-layer switches r 5.7 PPP r 5.8 Link virtualization: MPLS r 5.9 A day in the life of a web request

50 5: DataLink Layer5-50 Synthesis: a day in the life of a web request r journey down protocol stack complete! m application, transport, network, link r putting-it-all-together: synthesis! m goal: identify, review, understand protocols (at all layers) involved in seemingly simple scenario: requesting www page m scenario: student attaches laptop to campus network, requests/receives www.google.com

51 5: DataLink Layer5-51 A day in the life: scenario Comcast network 68.80.0.0/13 Google’s network 64.233.160.0/19 64.233.169.105 web server DNS server school network 68.80.2.0/24 browser web page

52 5: DataLink Layer5-52 A day in the life… connecting to the Internet r connecting laptop needs to get its own IP address, addr of first-hop router, addr of DNS server: use DHCP router (runs DHCP) DHCP UDP IP Eth Phy DHCP UDP IP Eth Phy DHCP r DHCP request encapsulated in UDP, encapsulated in IP, encapsulated in 802.1 Ethernet r Ethernet frame broadcast (dest: FFFFFFFFFFFF ) on LAN, received at router running DHCP server r Ethernet demux’ed to IP demux’ed, UDP demux’ed to DHCP

53 5: DataLink Layer5-53 A day in the life… connecting to the Internet r DHCP server formulates DHCP ACK containing client’s IP address, IP address of first-hop router for client, name & IP address of DNS server router (runs DHCP) DHCP UDP IP Eth Phy DHCP UDP IP Eth Phy DHCP r encapsulation at DHCP server, frame forwarded (switch learning) through LAN, demultiplexing at client Client now has IP address, knows name & addr of DNS server, IP address of its first-hop router r DHCP client receives DHCP ACK reply

54 5: DataLink Layer5-54 A day in the life… ARP (before DNS, before HTTP) r before sending HTTP request, need IP address of www.google.com: DNS DNS UDP IP Eth Phy DNS r DNS query created, encapsulated in UDP, encapsulated in IP, encasulated in Eth. In order to send frame to router, need MAC address of router interface: ARP r ARP query broadcast, received by router, which replies with ARP reply giving MAC address of router interface r client now knows MAC address of first hop router, so can now send frame containing DNS query ARP query Eth Phy ARP ARP reply

55 5: DataLink Layer5-55 A day in the life… using DNS DNS UDP IP Eth Phy DNS r IP datagram containing DNS query forwarded via LAN switch from client to 1 st hop router r IP datagram forwarded from campus network into comcast network, routed (tables created by RIP, OSPF, IS-IS and/or BGP routing protocols) to DNS server r demux’ed to DNS server r DNS server replies to client with IP address of www.google.com Comcast network 68.80.0.0/13 DNS server DNS UDP IP Eth Phy DNS

56 5: DataLink Layer5-56 A day in the life… TCP connection carrying HTTP HTTP TCP IP Eth Phy HTTP r to send HTTP request, client first opens TCP socket to web server r TCP SYN segment (step 1 in 3-way handshake) inter- domain routed to web server r TCP connection established! 64.233.169.105 web server SYN TCP IP Eth Phy SYN SYNACK r web server responds with TCP SYNACK (step 2 in 3- way handshake)

57 5: DataLink Layer5-57 A day in the life… HTTP request/reply HTTP TCP IP Eth Phy HTTP r HTTP request sent into TCP socket r IP datagram containing HTTP request routed to www.google.com r IP datgram containing HTTP reply routed back to client 64.233.169.105 web server HTTP TCP IP Eth Phy r web server responds with HTTP reply (containing web page) HTTP r web page finally (!!!) displayed

58 5: DataLink Layer5-58 Chapter 5: Summary r principles behind data link layer services: m error detection, correction m sharing a broadcast channel: multiple access m link layer addressing r instantiation and implementation of various link layer technologies m Ethernet m switched LANS, VLANs m PPP m virtualized networks as a link layer: MPLS r synthesis: a day in the life of a web request

59 5: DataLink Layer5-59 Chapter 5: let’s take a breath r journey down protocol stack complete (except PHY) r solid understanding of networking principles, practice r ….. could stop here …. but lots of interesting topics! m wireless m multimedia m security m network management


Download ppt "5: DataLink Layer5-1 Chapter 5b Link Layer and LANs (for reference only) Computer Networking: A Top Down Approach 5 th edition. Jim Kurose, Keith Ross."

Similar presentations


Ads by Google