Link Layer

अब Quizwiz के साथ अपने होमवर्क और परीक्षाओं को एस करें!

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

ARP (Address resolution protocol) maps IP addresses to MAC addresses for some LAN nodes.

What MAC protocols use channel partitioning?

• TDMA (Time division multiple access) • FDMA (Frequency division multiple access) • CDMA (Code division multiple access)

Slotted ALOHA efficiency

Probability that any node has a success = Np(1-p)^N-1 • N = number of nodes with many frames to send • p = probability that given node has success in a slot At best: channel is used for useful transmissions 37% of the time

Describe the process of communication over LAN using ARP.

1) A wants to send datagram to B. A's ARP table does not have B's MAC. 2) A broadcasts an ARP query packet containing B's IP address, with dest MAC: FF-FF-FF-FF. All nodes in LAN receive the ARP query. 3) B receives the ARP packet and sends its MAC to address to A's MAC address. 4) A caches the IP-MAC mapping for B in its ARP table until the TTL expires. Each node creates its ARP table without intervention from net admin.

How does frame filtering/forwarding work in a switch?

1) Record incoming link, MAC address of the sender. 2) index switch table using dest MAC address. 3) Dest found: If destination on segment from which the frame arrived, drop frame. Else forward frame to interface on entry. Dest not found: Flood all interfaces. Send packet to all interfaces except arriving interface.

Slotted ALOHA Assumptions

Assumptions: • All frames are the same size • Time is divided into equal size slots (time to transmit 1 frame) • nodes start to transmit only at slot beginning • nodes are synchronized • if 2 or more nodes transmit in slot, ALL nodes detect collision

Ethernet: physical topology

Bus (popular through mid 90's): • All nodes in same collision domain (can collide with each other) Star (prevails today): • Active switch at the centre • Each spoke (tip) runs a separate Ethernet protocol (nodes do no collide with each other)

Channel partitioning vs Random access vs Taking turns

Channel partitioning: • Shares channel efficiently and fairly at high load • inefficient ad low load: delay in channel acces, 1/N bandwidth allocated even if only 1 active node. Random access: • Efficient at low load: single node can fully utilize channel (transmit at full rate of channel) • high load: collision overhead Taking turns • Tries to encompass the best of both worlds

MPLS vs IP paths

IP: • Path to destination determined by destination address alone MPLS: • Path to destination determined by src and dest addresses. • Fast reroute using precomputed backup paths in case of link failiure

LAN

Each adapter (interface) on a LAN has a unique LAN (MAC) address

How do switches know which MAC addresses are reachable via certain interfaces?

Each switch has a switch table, each entry: • MAC address of host • Interface to reach host • Timestamp • Very similar to routing table

Ethernet

Ethernet is the dominant wired LAN technology: • Cheap $20 NIC • First widely used LAN tech • Simpler cheaper than token LANs and ATM • Keeps us with speed race" 10 Mbps - 10 Gbps

Full-duplex

Full-duplex means data can be transmitted both ways simultaneously i.e telephone conversation

Half-duplex

Half-duplex means data can be transmitted both ways but no simultaneously i.e walkie talkie

Describe the process of communication over different LANs.

If A wants to send datagram to B in another LAN: 1) A creates IP datagram with IP src A and dest B. 2) A creates link layer frame with R's MAC as dest, containing the A-B IP datagram. 3) Frame is sent from A to R. 4) Frame recieved at R, datagram removed, passed up to IP. 5) R forwards datagram with IP src A and dest B. 6) R creates link layer frame with B's MAC as dest (MAC queried using ARP if unknown, R's routing table used to figure out where the pkt needs to be sent), containing the A-B IP datagram. 7) R sends frame through the LAN of B and pkt eventually received at B.

VLAN motivation

If a user wants to change physical location but still wants to connect to the same LAN. A single broadcast domain means all layer-2 traffic (ARP, DHCP of unknown destination MAC addresses) must cross the entire LAN. This provides security/ privacy and efficiency issues.

Ethernet switch

Link layer device (takes an active role) • Store and 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 (communication link), uses CSMA/CD to access segment. Transparent • Hosts are unaware of presence of switches (switches don't have IP's or MAC addresses) Plug-and-play, self-learning • Switches do not need to be configured

CSMA (Carrier sense multiple access)

Listen before transmit: • If channel is sensed idle, transmit entire frame • If channel is sensed busy, defer transmission Human analogy: • If someones talking let them finish before speaking • If someone starts talking at the same time as you, then stop and try again later

How do data center networks work?

Load balance: application-layer routing • recieves external client requests • directs workload within data center • returns result to external client (hide data center internals)

MPLS (Multi-protocol label switching)

MPLS allows high speed IP forwarding using fixed length label (instead of IP address) • Fast lookup using fixed length identifier rather than shortest prefix matching • Ideas from VC (Virtual circuits) • IP datagrams still maintain their IP addresses

Pros and Cons of Slotted ALOHA

Pros: • Single active node can continuously transmit at rate R (full rate of channel) • Highly decentralized (Partially decentralized) as only slots in nodes require to be synchronized • Simple Cons: • Collisions, waste slots • Idle slots • Nodes can detect collisions in less than the time required to transmit a packet • clock synchronization

What do MPLS capable routers do?

Provide speed: • Forwarding IP packets to outgoing interfaces based on label value (do not inspect IP address) which saves time on complex routing algorithms Provide flexibility: • Using src and dest addresses, route flow to the same address differently. • Quick re-routing incase of link failiure (pre-computed backup paths - useful for VoIP).

Adaptors communicating

Sender: • Encapsulates datagram in frame • Adds error checking bits, rdt, flow control, etc Receiver: • Looks for errors, rdt, flow control etc • Extracts datagram, passes to upper layer at the receiving side

Parity checking

Single bit parity: • Either even or odd • Parity bit (either 0 or 1) is added to data to make number of 1's even (even parity) or odd (odd parity) Two-dimensional bit parity: • Same concept as single bit but in two dimensions • Can identify and correct single bit errors

Switches Vs Routers

Store-and-forward: • Routers: Network layer devices (examine network layer headers). • Switches: Link layer devices (examine link layer headers) Forwarding tables: • Routers: Compute forwarding tables using routing algorithms, IP addresses. • Switches: Learn forwarding table with the use of MAC addresses, learning, flooding.

How does self-learning work?

Switch learns which hosts are reachable by which interfaces. - When a frame is received, the switch learns the location of sender: Incoming LAN segment. - records sender/location pair in its switch table.

How does VLAN work?

Switches supporting VLAN capabilities can be configured to define multiple virtual LANs across one physical LAN infrastructure. Switch ports grouped so that single physical switch operates as multiple virtual switches.

Why is both link layer and end-to-end reliability necessary?

The link layer only provides reliable data transfer between adjacent nodes. (Data sent over a link will be received at the other end of the link with no errors). It does not detect errors within the network layer such as packets lost due to looping and equipment failure, or guarantee the order in which data is recieved by the ultimate destination.

Port-based VLAN

Traffic Isolation (security): • Ports defined within a range can only reach other ports within that range. Dynamic membership: • Ports can be dynamically assigned among VLANs Forwarding between VLANS: • Even though ports from differnt VLANs are physically on the same switch forwarding across 2 VLANS is done through routing (requires a router).

VLANS spanning multiple switches

Trunk ports carry frames between VLANs defined over multiple physical switches. • Frames forwarded within VLAN between switches can't be vanilla 802.1(type of frame encapsulaing IP datagram) because they must carry VLAN ID info. • 802.1q protocol adds/removed additional header fields for frames forwarded between trunk ports.

Slotted ALOHA Operation

When a node obtains a fresh frame, it transmits it in the next frame. • If no collision is detected, the node can send new frame in the next slot • If collision is detected, the node retransmits the frame in each subsequent slot with probability. p until success. (e.g. p = 0.7 means 70% chance to transmit next slot and 30% chance not to)

Collision

When a node receives two or more signals at the same time. Example: • ////////// = signal 1 • \\\\\\\\\\ = signal 2 • \\/\/\/////\\\\/\/ = signal 1 & signal 2 collision

Ethernet CSMA/CD algorithm

• 1- NIC receives datagram from network layer • 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. (Ideal situation) • 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 choses K at random from {0,1,...,(2^m) - 1} NIC waits K * 512 bit times, returns to step 2. (longer back off interval with more collisions)

Ideal MAP (multiple access protocol) properties

• 1- When only one node wants to transmit, it can send at rate R • 2- When M nodes want to transmit, each can send at average rate R/M • 3- Fully decentralized: • no special node to co-ordinate transmissions • no synchronization of clocks, slots • 4- Simple

What different fields does the 802.1Q frame contain?

• 2 byte Tag Protocol Identifier (81-00) • Tag Control Identifier (12 bit VLAN ID, 3 bit priority field) • Recomputed CRC

Taking turns - Token passing

• A control token passed from one node to next sequentially • Only the node with possession of the token may transmit data (there is a limit to how many frames can be transmitted) Concerns: • Token overhead • Latency • Single point of failure with token (If the node with the token becomes out of service all other nodes are waiting for the token forever)

Multiple access protocol

• A distributed algorithm that determines how nodes share channel (determines who can transmit) • Communication about who can transmit must use the channel itself (no out-of-band/ external channel for co-ordination)

What MAP's are random access protocols?

• Slotted ALOHA • ALOHA CSMA, CSMA/CD, CSMA/CA

Taking turns - Polling

• A master node polls slave nodes to transmit in turn • Typically used with "dumb" slave devices (not end hosts such as our computers) Concerns: • Polling overhead (larger amount of slave nodes increases overhead) • Latency • Single point of failure at master node

MAC (media access control) addresses

• AKA Lan or Physical or Ethernet) addresses • Used locally to get frame from one interface to another physically-connected interface (same network, in IP addressing sense) • 48-bit MAC addresses are burned in NIC ROM, also sometimes software controllable

TDMA (Time division multiple access)

• Access to channel in "rounds" (time slots) • Each station (node) gets a fixed length slot in each round, where length = packet transmission time • Unused slots go idle (wasted channel space)

Types of MAC protocols

• Channel partitioning - Divide channel into smaller pieces (time slots, frequency, code) and allocate a piece to node for exclusive use. • Random access - No division, allow collisions to occur and recover from them. • Taking turns - Nodes take turns at transmitting, but nodes with more to send can take longer turns.

FDMA (Frequency division multiple access)

• Channel spectrum is divided into frequency bands • Each station (node) gets assigned a fixed frequency band meaning no collisions • Unused transmission time in frequency band goes idle (wasted frequency band)

CSMA collisions

• Collisions can still occur in CSMA due to propagation delay. Propagation delay means that two nodes may not sense each other's transmissions. (Signal from one node has delay to travel to other node. Therefore the other node may think no one is trying to talk.) • Collision in CSMA means the entire packet transmission time is wasted.

CSMA/CD

• Collisions detected within short time • Colliding transmissions are aborted , reducing channel wastage • Collision detection is easy in wired LAN's but more difficult in wireless LAN's

Ethernet: unreliable and connectionless

• Connectionless: no handshaking between sending and receiving NIC's • Unreliable: receiving NIC does not send acks nor nacks to sending NIC (the data in dropped frames are only recovered if the initial sender uses higher layer rdt such as TCP) • Ethernet's MAC protocol: unslotted CMSA/CD with binary backoff

CDMA (Code division multiple access)

• Each station (node) is assigned a particular code to encode their data • This allows for simultaneous transfer of data from multiple nodes

Link layer services

• Framing (encapsulation), link access (MAP's) • Reliable delivery between adjacent nodes • Flow control • Error detection • Error correction • Half-duplex and Full-duplex

Switch: multiple simultaneous transmissions

• Hosts have dedicated, direct connection to switch • Switches buffer (store) packets (frames) • Ethernet protocol used on each incoming link, but no collisions (Full-duplex, each link is its own collision domain)

What is the purpose of rich interconnection among switches and racks?

• Increased throughput between racks (multiple routing paths possible) • Increased reliability via redundancy

How do you get a MAC address

• MAC address allocation is administered by IEEE • Manufacturers buy portions of MAC address space (to assure uniqueness) Analogy: • MAC = social security number • IP = postal address

MAC address vs IP address

• MAC addresses are flat addresses and are portable (You can move a LAN card from one LAN to another) • IP addresses are hierarchal addresses and are not portable (Addresses depend on IP subnet to which node is attached)

How does MPLS signalling work?

• Modify OSPF, IS-IS link state flooding protocol to carry info used by MPLS routing. • Entry MPLS router uses RSVP-TE signalling protocol to set up MPLS fowarding at downstream routers.

Cyclic redundancy check (CRC)

• More powerful error-detection than Checksum and Parity checking • Treat data bits, D, as a binary number • Choose r + 1 bit pattern G (generator known to sender and receiver) • Select r CRC bits, R such that ((D*2^r) XOR R)/G gives no remainder. If there is a non-zero remainder error is detected. • Can detect all burst errors less than r + 1 bits

What are the challenges of data center networks?

• Multiple applications, each serving massice amount of clients. • Managing/balancing load, avoiding processing, networking, data bottlenecks.

Where is the link layer implemented?

• NIC aka network interface card • The NIC attaches into host's system busses • Is a combination of hardware and firmware • Implemented in all hosts and routers

What are the error detection methods?

• Parity checking • Checksum • Cyclic redundancy checking

What are the two types of links in the Link Layer?

• Point-to-point • Broadcast (Shared wire or medium)

Ethernet FRAME structure

• Preamble: 7 bytes with the pattern 10101010 followed by one byte with the pattern 10101011. Used to synchronize receiver and sender clocks. • Addresses: 6 bytes src, dest MAC addresses. If adapter receives frame with matching dest address, or is a broadcast address (eg ARP) then the datagram is passed to the network layer protocol. • Type: Indicates higher layer protocol (usually IP). • CRC: cyclic redundancy check at receiver (frame dropped if error)

How are entries created and maintained in the switch table?

• Self-learning • TTL

Internet checksum

• Sender treads content as 16-bit integers • Checksum = 1's compliment of sum of 16-bit integers • Receiver computes checksum from data and checks it with checksum value received • Errors can still occur even with checksum i.e. checksum value sent over is corrupted or bits to be added both flipped

Pure (un-slotted) ALOHA

• Simpler than slotted ALOHA, no synchronization • When first frame arrives transmit immediately • Has higher probability for collisions Probability that any node has success = p*(1-p)^2(N-1) At best: channel is used for useful transmissions 18% of the time. (worse than slotted ALOHA due to increased collisions)

CSMA/CD efficiency

• Tprop = max prop delay between 2 nodes in LAN • Ttrans = time to transmit max-size frame Efficiency = 1 / (1 + 5(Tprop/Ttrans)) • Efficiency goes to 1 as Tprop approaches 0 and as Ttrans approaches infinity • Better than ALOHA, simple and cheap as well as being decentralized.

Random access protocols

• When a node has a packet to transmit, it transmit at full channel data rate R. There is no a priori co ordination amongst nodes • Let collisions happen (2 or more transmitting nodes) RAP's specify: • How to detect collisions • How to recover from collisions (e.g delayed re transmissions)


संबंधित स्टडी सेट्स

Professional Knowledge: Elementary

View Set

US Soccer Grassroots Recertification

View Set

Benda dan perubahanya2318191_IAIN PEKALONGAN

View Set

Intro to Ethics - Normative Ethical Theories

View Set

Social Psychology - Integration Quiz Unit 3

View Set

Topic 3 Test: Challenges in the Late 1800s

View Set