Chapter 6: Link layer and LANs

Réussis tes devoirs et examens dès maintenant avec Quizwiz!

dynamic membership

ports can be dynamically assigned among VLANs

fast reroute

precompute backup routes in case of link failure

Two or more transmitting nodes means what in ALOHA

"collision"

Ethernet frame structure

** sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame [preamble][dest addr][type][source addr][data/payload][CRC]

Slotted ALOHA: efficiency

**Def: long-run fraction of successful slots (many nodes, all with many frames to send) **Cal: Suppose: N nodes with many frames to send, each transmits in slot with probability p prob that given node has success in a slot = p(1-p)N-1 prob that any node has a success = Np(1-p)N-1 max efficiency = 1/e = .37 at best: channel used for useful transmissions 37% of time!

load balancer

**application-layer routing 1. receives external client requests 2. directs workload within data center 3. returns results to external client (hiding data center internals from client) load balancer decides what is the the best path to take without overwhelming too many servers

how long is MAC address and where is it locate?

- 48 bit MAC address (for most LANs) burned in NIC ROM, also sometimes software settable - e.g: 1A-2F-BB-76-09-AD hexadecimal (based 16) notation (each "numeral" represents 4 bits)

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

preamble

- 7 bytes with pattern 10101010 followed by one byte with pattern 10101011 - used to synchronize receiver, sender clock rates

error correction:

- receiver identifies and corrects bit error(s) without resorting to retransmission

flexibility of MPLS

- MPLS forwarding decisions can differ from those of IP 1. use destination and source addresses to route flows to same destination differently (traffic engineering) 2. re-route flows quickly if link fails: pre-computed backup paths (useful for VoIP)

What are reliable delivery between adjacent nodes?

- TCP - seldom used on low bit-error link (fiber, some twisted pair) - wireless links: high error rates

Slotted ALOHA assumptions:

- all frames same size - time divided into equal size slots (time to transmit I frame) - nodes are synchronized - if 2 or more nodes transmit in slots, all nodes detect collision

trunk port

- carries frames between VLANS defined over multiple physical switches - frames forwarded within VLAN between switches can't be vanilla - 802.1 frames (must carry VLAN ID info) - 802.1q protocol adds/removed additional header fields for frames forwarded between trunk ports

random access

- channel not divided, allow collisions - "recover" from collisions

MAC protocols has 3 classes:

- channel partitioning - random access - "taking turns"

Why we need Cyclic redundancy check?

- choose r CRC bits, R, such that <D,R> exactly divisible by G (modulo 2) - receiver knows G, divides <D,R> by G. If non-zero remainder: error detected! - can detect all burst errors less than r+1 bits <------- d bits -------> <--- r bits ---> D: data bits to send | R: CRC bits [bit pattern] D * 2^r XOR R math formula *how to get R: if we divide D*2^r by G, want remainder R to satisfy: R=remainder((D*2^r)/G)

CSMA/ CD (collision detection)

- collisions detected within short time - colliding transmissions aborted, reducing channel wastage

Slotted ALOHA Cons

- collisions, wasting slots - idle slots - nodes may be able to detect collision in less than time to transmit packet - clock synchronization

how does token passing work?

- control token passed from one node to next sequentially - tokek message

channel partitioning

- divide channel into smaller "pieces" (time slots, frequency, code) - allocate piece to node for exclusive use

forwarding between VLANS

- done via routing (just as with separate switches) - in practice vendors sell combined switches plus routers

Why we need framing, link access?

- encapsulate datagram into frame, adding header, trailer - channel access if shared medium - "MAC" addresses used in frame headers to identify source, destination - different from IP address!

error detection:

- errors caused by signal attenuation, noise. - receiver detects presence of errors: - signals sender for retransmission or drops frame

Link layer services

- flow control - error detection - error correction - retransmission - half-duplex and full-duplex

traffic isolation:

- frames to/from ports 1-8 can only reach ports 1-8 - can also define VLAN based on MAC addresses of endpoints, rather than switch port

MAC (or LAN or physical or Ethernet) address:

- function: used "locally" to get frame from one interface to another physically-connected interface (some network, in IP-addressing sense)

What is MPLS for?

- high-speed IP forwarding using fixed length label (instead of IP address) 1. fast lookup using fixed length identifier (rather than shortest prefix matching) 2. borrowing ideas from Virtual Circuit (VC) approach 3. but IP datagram still keeps IP address! [image slides 6-76]

Switch: multiple simultaneous transmissions

- hosts have dedicated, directed connection to switch - switches buffer packets - Ethernet protocol used on each incoming link, but no collisions:; full duplex - each link is it own collision domain - switching: A-to-A' and B-to-B' can transmit simultaneously, without collisions

Random access MAC protocol specifies:

- how to detect collision - how to recover from collision (e.g. via delayed retransmission)

Slotted ALOHA operation: - when node obtains fresh frame, transmit in next slot

- if no collision: node can send new frame in next slot - if collision: node transmits frame in each subsequent slot with prob. p until success

Where is the link layer implemented?

- in each and every host - link layer implemented in "adaptor' NIC (Network Interface Card) or on a chip - Ethernet card, 802.11 card; Ethernet chipset - implements link, physical layer - attaches into host's system - combination of hardware, software, firmware

Ethernet switch

- link-layer device: takes an active role - transparent - plug-and-play, self-learning

What is polling:

- master node "invites" slave nodes to transmit in turn - typically used with "dumb" slave devices

What is Cyclic redundancy check?

- more powerful error-detection coding - view data bits, D, as a binary number - choose r+1 bit pattern (generator), G detects more errors but more complicated

32-bit IP address:

- network-layer address for interface - used for layer 3 (network layer) forwarding

concerns for polling

- polling overhead - latency - single point of failure (master)

[Ethernet] unreliable

- receiving NIC doesn't 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

Slotted ALOHA Pros

- single active node can continuously transmit at full rate of channel - highly decentralized: only slots in nodes need to be in sync - simple

Examples of random access MAC protocols:

- slotted ALOHA - ALOHA - CSMA, CSMA/CD, CSMA/ CA

concerns for token passing:

- token overhead - latency - single point of failure (token)

Random access protocols [ALOHA] - when node has packet to send

- transmit at full channel data rate R - no a priori coordination among nodes

When to use channel partitioning MAC protocols?

1. share channel efficiently and fairly at high load 2. inefficient at low load: delay in channel access, 1/N bandwidth allocated even if only 1 active node!

Ethernet

1. "dominant" wired LAN technology: 2. single chip, multiple speeds (e.g., Broadcom BCM5761) 3. first widely used LAN technology 4. simpler, cheap 5. kept up with speed race: 10 Mbps - 10 Gbps

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 } 4. else flood // forward on all interfaces except arriving interface

ARP protocol: same LAN

1. A wants to send datagram to B - B's MAC address not in A's ARP table. 2. A broadcasts ARP query packet, containing B's IP address - destination MAC address = FF-FF-FF-FF-FF-FF - all nodes on LAN receive ARP query 3. B receives ARP packet, replies to A with its (B's) MAC address - frame sent to A's MAC address (unicast) 4. A caches (saves) 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 5. ARP is "plug-and-play": - nodes create their ARP tables without intervention from net administrator

A day in the life: scenario: *****What happens when user type in google.com?

1. Connecting laptop needs to get its own IP address, addr of first-hop router, addr of DNS server. Use DHCP 2. DHCP request encapsulated in UDP, encapsulated in IP, encapsulated in Eth. To send frame to router, need MAC address of router interface: ARP [address resolution protocol] 3. ARP query broadcast, received by router, which replies with ARP reply giving MAC address of router interface 4. client now knows MAC address of first-hop router, so can now send frame containing DNS query 5. IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router 6. IP datagram forwarded from campus network into Comcast network, routed (table created by RIP, OSFP, IS-IS and/or BGP routing protocols) to DNS server 7. Demuxed to DNS server 8. DNS server replies to client with IP address of www.google.com To send HTTP request, client first opens TCP socket to web server; TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server Web server responds with TCP SYNACK (step 2 in 3-way handshake) TCP connection established! - HTTP request sent into TCP socket - IP datagram containing HTTP request to www.google.com - web server responds with HTTP reply (containing web page) - IP datagram containing HTTP reply routed back to client

DOCSIS: data over cable service interface spec

1. FDM over upstream, downstream frequency channels 2. TDM upstream: some slots assigned, some have contention - downstream MAP frame: assigns upstream slots - request for upstream slots (and data) transmitted random access - (binary backoff) in selected slots

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 binary (exponential) backoff: after mth collision, NIC chooses K at random from {0,1,2, ..., 2m-1}. NIC waits K·512 bit times, returns to Step 2 (longer backoff interval with more collisions)

Pure (unslotted) ALOHA

1. No synchronization 2. When frame first arrives transmit immediately 3. Collision probability increases: frame sent at t0 collides with other frames sent in [t0-1,t0+1]

TDMA: time division multiple access What is it for? [channel partitioning]

1. access to channel in "rounds" 2. each station gets fixed length slot (length = packet transmission time) in each round 3. unused slots go idle example: 6-station LAN, 1,3,4 have packets to send, slots 2,5,6 idle

star [switch]

1. active switch in center 2. each "spoke" runs a (separate) Ethernet protocol (nodes do not collide with each other)

Summary of MAC protocols

1. channel partitioning, by time, frequency or code - Time Division, Frequency Division 2. random access (dynamic), - ALOHA, S-ALOHA, CSMA, CSMA/CD - carrier sensing: easy in some technologies (wire), hard in others (wireless) - CSMA/CD used in Ethernet - CSMA/CA used in 802.11 3. taking turns - polling from central site, token passing - Bluetooth, FDDI, token ring

FDMA: frequency division multiple access What is it for? [channel partitioning]

1. channel spectrum divided into frequency bands 2. each station assigned fixed frequency band 3. unused transmission time in frequency bands go idle example: 6-station LAN, 1,3,4 have packet to send, frequency bands 2,5,6 idle

Internet checksum @ receiver:

1. compute checksum of received segment 2. check if computed checksum equals checksum field value: NO - error detected YES - no error detected. But maybe errors nonetheless?

What does Multiple access protocols do?

1. determine when node can transmit (distributed alg.) 2. communication about channel sharing must use channel itself! (no out-of-band channel for coordination!!)

When to use random access MAC protocols?

1. efficient at low load: single node can fully utilize channel 2. high load: collision overhead

Why we need those rich interconnection among switches, racks?

1. increased throughput between racks (multiple routing paths possible) 2. increased reliability via redundancy

MPLS capable routers

1. label-switched router 2. forward packets to outgoing interface based only on label value (don't inspect IP address) - MPLS forwarding table distinct from IP forwarding tables (longest prefix match on ip is much more efficient)

CSMA - Carrier Sense Multiple Access

1. listen before transmit: - if channel sensed idle: transmit entire frame - if channel sensed busy: defer transmission

MPLS signaling

1. modify OSPF, IS-IS link-state flooding protocols to carry info used by MPLS routing, e.g., link bandwidth, amount of "reserved" link bandwidth 2. entry MPLS router uses RSVP-TE signaling protocol to set up MPLS forwarding at downstream routers

Data center networks challenges

1. multiple applications, each serving massive numbers of clients 2. managing/balancing load, avoiding processing, networking, data bottlenecks

2 types of links:

1. point-to-point - PPP for dial-up access - point-to-point link between Ethernet switch, host 2. broadcast (shared wire or medium) - old-fashion Ethernet - upstream HFC - 802.11 wireless LAN ^ if one talks, everyone else listening not only the router

Why we need Multiple access protocols?

1. single shared broadcast channel 2. two or more simultaneous transmissions by nodes: 2.1 interference: - collision if node receives two or more signals at the same time

Ethernet switch (link-layer device)'s job is to:

1. store, forward Ethernet frames 2. 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

Internet checksum @ sender:

1. treat segment contents as sequence of 16-bit integers 2. checksum: addition (1's complement sum) of segment contents 3. sender puts checksum value into UDP checksum field

Given: broadcast channel of rate R bps, what is the ideal multiple access protocol?

1. when one node wants to transmit, it can send at rate R. (maximum bandwidth) 2. when M nodes want to transmit, each can send at average rate R/M 3. fully decentralized: *no special node to coordinate transmissions *no synchronization of clocks, slots 4. simple

Q: Why we require both link-level and end-end reliability for link layer?

A: End-to-end: not ALL network layers are particularly reliable, and only the end systems know how much reliability is really required. Also, if there is more than one lossy link, only the end systems know which packets really need retransmitted (or corrected for) and end-to-end reliability therefore minimises the extra work to compensate for loss. And finally, all means for not losing packets take time. If every hop on a long path goes for near-perfect reliability, the overall latency will be enormous. The end-to-end principle is what makes the internet practical.

Q: who does switch know A' reachable via interface 4, B' reachable via interface 5?

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: why do i have another additional checksum if we already have checksum on other layers?

A: most time data link layers implemented in hardware errors can happen before delivered to software

Q: sending from A to G - how does S1 know to forward frame destined to G via S4 and S3? [slides 6-66]

A: self learning! (works exactly the same as in single-switch case!)

Q: Where is arp table?

ARP can reside in many places, in local switches and routers, also in your laptops.

Q: How to determine interface's MAC address, knowing its IP address?

By 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)

where are CSMA/CD and CSMA/CA used?

CSMA/CD used in Ethernet CSMA/CA used in 802.11

CRC

Cyclic Redundancy Check at receiver used for error detected if any frame is dropped

What is the Error Detection in Link layer?

EDC = Error Detection and Correction bits (redundancy) D = Data protected by error checking, may include header fields

Application of Cyclic redundancy check

Ethernet, 802.11 WiFi, ATM

Who administered MAC address allocation?

IEEE

MPLS

Multiprotocol label switching 它通过对网络流量进行合理的控制,使流量均衡的分布在网络上,从而提高了网络的整体性能

Pure ALOHA efficiency

P(success by given node) = P(node transmits) . P(no other node transmits in [t0-1,t0] . P(no other node transmits in [t0-1,t0] = p . (1-p)N-1 . (1-p)N-1 = p . (1-p)2(N-1) ... choosing optimum p and then letting n = 1/(2e) = .18 <18% <37% pure ALOHA is even worse than slotted ALOHA>

type

indicates higher layer protocol (mostly IP but others possible, e.g., Novell IPX, AppleTalk)

MAC addr and IP addr are like

SIN number and postal address

Adaptors communicating How do sending and receiving side work?

Sending side: - encapsulates datagram in frame - adds error checking bits, rdt, flow control, etc. Receiving side: - looks for errors, rdt, flow control, etc. - extracts datagram, passes to upper layer at receiving side

IP routing

path to destination determined by destination address alone

CSMA/CD efficiency

Tprop = max prop delay between 2 nodes in LAN ttrans = time to transmit max-size frame efficiency=1/(1+5*(tprop/trans)) efficiency goes to 1 -as tprop goes to 0 -as ttrans goes to infinity better performance than ALOHA! and 1.simple 2.cheap 3.decentralized

Does each adapter on LAN have unique LAN address?

True

datagram transferred by different link protocols over different links

True; e.g., Ethernet on first link, frame relay on intermediate links, 802.11 on last link

each link protocol provides different services

True; e.g., may or may not provide rdt over link

VLANs

Virtual Local Area Network Switches supporting VLAN capabilities can be configured to define multiple virtual LANS over single physical LAN infrastructure

does the size of EDC field affect detection and correction?

Yes larger EDC field yields better detection and correction

Addressing: routing to another LAN [5 steps] Addressing: routing to another LAN [5 steps] EX. 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 - assume A knows IP address of first hop router, R(how?) - assume A knows R's MAC address (how?)

[1] A creates IP datagram with IP source A, destination B A creates link-layer frame with R's MAC address as destination address, frame contains A-to-B IP datagram [2] Frame sent from A to R [3] Frame received at R, datagram removed, passed up to IP [4] Frame sent from A to B Frame received at R, datagram removed, passed up to IP [5] R forwards datagram with IP source A, destination B R creates link-layer frame with B's MAC address as destination address Frame contains A-to-B IP datagram

MPLS forwarding tables

[slide image 6-81]

cable access network

a form of broadband Internet access which uses the same infrastructure as a cable television. * Internet frames, TV channels, control transmitted downstream at different frequencies * upstream Internet frames, TV control, transmitted upstream at different frequencies in time slots 1. multiple 40Mbps downstream (broadcast) channels - single CMTS transmits into channels 2.multiple 30 Mbps upstream channels - multiple access: all users contend for certain upstream channel time slots (others assigned)

Parity checking

adding extra 1 bit in packet for checking bit added to each character transmitted, the characters can then be verified for accuracy

Why is IP hierarchical address not portable?

address depends on IP subnet to which node is attached

ARP

address resolution protocol

bus [coaxial cable]

all nodes in same collision domain (can collide with each other)

Switches vs Routers - store-and-forward - forwarding tables

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 lag, IP address - switches: learn forwarding table using flooding, learning MAC address

MAC flat address ➜ portability

can move LAN card from one LAN to another

links

communication channel that connect adjacent nodes along communication path: links - wired links - wireless links - LANs

what does controller have to do after it receive the packet before it send to cpu?

controller receives packet, strips off iinkedlayer header then pass to CPU

switch will selectively send on just one link when check out the gif on m6 p65

destination A location known

Why we need Internet checksum?

detect "errors" (e.g., flipped bits) in transmitted packet (note: used at transport layer only)

single bit parity:

detect single bit errors <-----d data bits----><--parity bit--> ex. want even number of 1s in total: 1. if there are odd 1s then set parity bit to 1 2. if there are even 1s then set parity bit to 0 *****not the best protocol!!! 1.cannot do error correction 2.only can detect 1 bit error

two-dimensional bit parity:

difference from single bit parity? 0.can detect and correct single bit errors 1. adds much more overhead,more space for checking 2. it can detect multi bit errors 3.****but cannot correct multi bit errors if they are not unique cols/rows

CSMA collisions:

entire packet transmission time wasted - distance & propagation delay play role in determine collision probability

layer-2 packet:

frame (used to encapsulates datagram)

switch will flood when

frame destination, A', location unknown

goal of error detection in link layer

goal: take a datagram, add EDC bits then transmit over link that potentially produce errors, want to give it back to a receiver to run ALGO to detect error and correct them.

half-duplex and full-duplex

half duplex: nodes at both ends of link can transmit, but not at same time full duplex: d1 and d2 will be ale to transmit to each other at the same time

node

hosts + routers

Ethernet switch is transparent

hosts are unaware of presence of switches

why is collision detection easier in wired LANS but harder in wireless LANS?

it is easy for wired LANs to measure signal strengths, compare transmitted, received signals but difficult in wireless LANs, because received signal strength overwhelmed by local transmission strength, also longer propagation delay on wireless lans

what do we need to use hardware here?

it is hardcoded so it can run faster,devices deliver and forward packets so there are lot more packets at data linked layer than other layers, so need to speed up thus put logic in hardware.

How does manufacturer assure uniqueness in MAC address?

manufacturer buys portion of MAC address space if you know mac, you can identify the manufacturer

[Ethernet] connectionless:

no handshaking between sending and receiving NICs

"taking turns"

nodes take turns, but nodes with more to send can take longer turns

is error detection in link layer 100% reliable?

not 100% reliable! - protocol may miss some errors, but rarely [image missing - CH6 - 10]

what are on top of the racks in the data center?

on top of the racks there are swithces, switches responsible of deciding to deliver packets from the same rack or when those packets can go out

flow control:

pacing between adjacent sending and receiving nodes

MPLS routing

path to destination can be based on source and destination address

Q: show switch tables and packet forwarding in S1, S2, S3, S4 [slide image 6-67]

s4 get the packet, doesn't know what to do so broadcast to s123 s1 get the packet, doesn't know what to do then it will broadcast to abc

Q: how are entries created, maintained in switch table?

self-learning by switch: 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

Cyclic redundancy check example

slides example on CH6 - 16

port-based VLAN

switch port grouped by switch management sf) s.t. single physical switch operates as multiple virtual switches

Ethernet switch is plug-and-play, self-learning

switches do not need to be configured

why does the multiple access protocol for above need to be decentralized?

there will be a delay

Data center networks

thousands of hosts, often closely coupled, in close proximity e.g. Amazon

data-link layer has responsibility of

transferring datagram from one node to physically adjacent node over a link

CSMA collisions: What does propagation delay mean?

two nodes may not hear each other's transmission, collisions can still occur

Ethernet's MAC protocol:

unslotted CSMA/CD with binary backoff sidenote: if you send in data and see there is collision, then you have to exponential/binary back off and transmit packet later, those protocol prevents you from collision hardcode protocol on nic card


Ensembles d'études connexes

Analysis of Algorithms Final Review

View Set

Psych Ch. 13 Stress, Coping, and Health

View Set

Med-surg Ch. 73, Care of Transgender Patients

View Set

California Insirance Code and Ethics

View Set