COMP3331 - Link Layer and LANs

Pataasin ang iyong marka sa homework at exams ngayon gamit ang Quizwiz!

3 - What is a multiple access protocol?

- Distributed algorithm that determines how nodes share channel (determine when node can transmit) - NOTE: communication about channel sharing must also use the channel itself

2a - How does the Simple Parity scheme work in terms of the receiver?

- For each block of size d, count the number of 1's and compare with following parity bit - Detects, but does not correct bits

2a - How does the Simple Parity scheme work?

- For every d bits add a parity bit - 1 if the number of 1's is odd - 0 if the number of 1's is even

3a - Describe FDMA

- Frequency Division multiple access - channel spectrum divided into frequency bands - each station assigned fixed frequency band - unused transmission time in frequency bands go idle

4 - How do switches handle multiple simultaneous transmissions?

- Hosts have direct connection to switch - switches buffer packets - full duplex - Ethernet protocol used one each incoming link, but no collisions - Thus, A-to-A' and B-to-B' can transmit simultaneously without collisions - If A and B both want to talk to A', the switch buffers packets

1 - Describe error detection in terms of sender and receiver.

- IP layer sends to NAT layer - NAT Layer adds error detection code - When received, if error, drop or send ACK - If no error, passes to IP layer and IP decides to pass off to next layer or to application layer depending on IP address.

3 - Where is the link layer implemented?

- In each host, link layer implemented in "adaptor", or a NIC network interface card - Connects to host system's CPU - Combination of hardware, software, firmare

3b - What is Carrier Sense Multiple Access (CSMA)?

- Listen before transmit - If channel sensed idle, transmit entire frame - If channel sensed busy, defer transmission - Does not eliminate all collisions

4 - Here is the specific framing in Ethernet

- MAC addresses are physical addresses in your laptop, phone, etc. - Length of payload - Min/Max payload - Fade Control Sequence for error detection - Inter Frame Gap, don't inject any signals during the 12 Byte Gap (all 0's)

1 - What are the main differences between MAC and IP address

- MAC hardcoded, IP configured or learned dynamically - MAC has a flat 48-bit namespace while IP is hierarchical - MAC is portable and can move from device to device but IP can't - MAC used to get a packet between interfaces within same IP subnet, IP is used to get a packet to destination IP address

3c - How do "Taking turns" MAC protocols work?

- Master node invites slave nodes to transmit in turn - If slave has nothing to transmit, passes control token to next node - The overhead is polling, where master must ask slaves to submit

3b - What is the efficiency of Slotted Aloha?

- Probability that given node has a success p(1-p)^N-1 - Probability that any node has a success Np(1-p)^N-1

3b - What are the pros/cons of Slotted Aloha?

- Pros: single active node can continuously transmit at full rate of channel. Highly decentralized. Simple - Cons: Collisions, wasted slots, idle slots, nodes may be able to detect collision in less than time to transmit packet, clock synchronization

3 - Describe how two adaptors communicate

- Sender encapsulates datagram into frame and adds error checking bits, flow control, etc. - Receiver looks for errors, flow control, rdt, etc. Then extracts datagram and passes to network layer

2c - What do the sender and receiver do in regard to CRC?

- Sender extend D data bits with R zeros, divide by generator G, keep remainder and ignore quotient, adjust R check bits by the remainder - Receiver: divide and check for zero remainder NOTE: G is a common parameter chosen by sender and receiver.

4 - How is framing conducted in ethernet?

- Start of frame recognized by 1. preamble: 10101010 2. Start of frame delimiter (DF) 10101011 - End of Frame is an absence of transition

3a - Describe TDMA

- Time Division multiple access - access to channel in rounds, each station gets fixed length slot in each round - unused slots go idle

3c - What are some concerns with Taking Turns protocols?

- Token polling overhead - Latency - single point of failure, if token is corrupted, does not work

3 - Does ethernet use a bus or a star?

- Typically a star, or active switch in the center that allows each spoke to run a separate Ethernet protocol. No sharing, so no CSMA/CD necessary - Buses could also be used with CSMA/CD

1 - What is the MAC address.

- Used locally to get frame from one interface to another physically connected interface (same network) - 48bit MAC Address (for most LANS) burned in NIC ROM, also sometime software settable

4 - How does switch know A' reachable via interface 4, B' reachable via interface 5?

- Uses a switch table (like a routing table) - Switch table created by broadcasting

3b - What is a Random Access Protocol?

- When node has packet to send, transmit at full channel data rate R - 2+ transmitting nodes results in collision - RAP specifies how to detect and recover from collision

2b - What is Forward Error Correction?

- With two dimensional parity, we can even correct single-bit errors. - Just find column and row with error

Describe the tradeoff with network wire lengths

- You want greater length so that more can be connected - Longer connections mean that fewer nodes can detect collisions, so need a greater minimum packet size

3 - What are the classes of MAC protocols?

- a channel partitioning: divide channel into smaller pieces (time, frequency, code) - b random access: channel not divided, allow collisions, but recover from them - c taking turns: nodes take turns, but nodes with more to send can take longer turns

2b - What are the advantages/disadvantages of Two-Dimensional Parity?

- adv: allows to detect 1, 2, 3-bit (and some 4-bit) errors, so error detection capability is stronger. 2-bit errors are when two bits are flipped - dis: Larger overhead

2 - What is ARP cache poisoning?

- denial of service: Hacker replies back to an ARP query for a router NIC with a fake MAC address - Man in the middle: Hacker can insert his/her machine along the path between victim machine and gateway router NOTE: Attacks hard to launch as hacker needs physical access to the network

2a - What is framing?

- encapsulate datagram into frame, adding header, trailer (error correction) - channel access if shared medium such as WiFi - "MAC" medium access control address used in frame header to identify source/dest

2f - half-duplex and full-duplex

- half-duplex: nodes at both ends of link can transmit, but not at the same time. EX: WiFi - full-duplex: Both at the same time. EX: Ethernet

4 - What does an Ethernet switch do?

- link-layer, not routing layer, device - stores and forwards Ethernet frames - examines incoming frame's MAC address, selectively forward frame to one-or-more outgoing links when frame is to be forwarded - Transparent: Hosts are unaware of presence of switches - Plug-and-play, so they are self-learning and do not need to be configured.

3b - What are restrictions on collision detection?

- minimum frame size and maximum distance, which ethernet uses - because if packet small, sender will send packet before detects collision

1 - What are nodes, links, frames?

- nodes: hosts and routers - links: communication channels that connect adjacent nodes, such as wired or wireless links or LANs - frame: layer-2 packet datagram

3 - What are the two types of "links"?

- point-to-point: dial-up, Ethernet - broadcast (shared wire or medium): wireless LAN, old-fashioned Ethernet

2c - What is the Cyclic Redundancy Check algorithm in terms of the following example?

- r is 3, which is chosen - Append 000 to D because r is 3 - Because r = 3, G = 3+1. G is common parameter chosen by sender/receiver - Divide D by G in binary - R is the remainder - Now append D with R as opposed to 000 - Receiver will then divide <D,R> by G and get remainder 0 if no errors.

2a - Describe reliable delivery between adjacent nodes

- seldom used on low bit-error link. (fiber) - used with wireless links: high error rates

2a - What is the cost of Simple Parity?

1 bit every d bits

MULTIPLE ACCESS PROTOCOLS

1. Channel Partitioning 2. Random Access 3. Taking Turns

3b - Describe how the Ethernet CSMA/CD algorithm works.

1. NIC receives datagram from network layer, creates frame 2. If NIC senses channel idle, starts frame transmission, If senses busy, waits until channel idle 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

3 - What do we want to achieve with a multiple access protocol?

1. When 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, so no special node to coordinate or synchronization of clocks required 4. simple

4 - How does a switch "learn"?

1. record incoming link, MAC address of sending host 2. create entry in switch table 3. If entry found for destination forward frame on interface indicated or drop frame if destination on segment from which just arrived. If entry not found, forward on all interfaces except arriving interface

3b - What is the efficiency of Unslotted Aloha?

18% is the max efficiency - NOTE: you must use (1-p) twice in order to account for the different time slots

3b - What is the max LAN network length in order to detect collisions?

5120m - (min frame size * propagation speed)/2* bandwidth - 2* bandwidth because Host 1 starts to send frame, right before it reaches Host 2, Host 2 sends frame, and it takes the signal going from Host 2 to Host 1 now in order to reduce the delay. - NOTE: the link speed dramatically impacts the max LAN length. Thus, max size for Ethernet cable so CSMA/CD works

3b - What is the Ethernet minimum data size?

64 Bytes, so NAT layer will pad payload if too small

3b - What is the max efficiency of Slotted Aloha?

As N goes to infinity and we optimize p, max efficiency = I/e = .37 37%

4 - What is framing?

Delimits the start and end of the frame so that we can identify a frame in the physical layer, which talks in terms of bits

What is an error burst?

First and last symbols are incorrect, and some of interior may be

3 - What is a collision?

If node receives two or more signals at the same time.

2b - Why is there link-level and end-end reliability?

It drops the packets sooner.

3 - What layers (application, transport, network, link, physical) does the adaptor use?

Link and physical

4 - Is an Ethernet switch link or network layer?

Link layer, so it won't look at the IP address.

4 - Describe Manchester Encoded Signals

Must go up or down in the middle of the cycle to specify 0 or 1

3b - What is Unslotted Aloha?

No slots, so no synchronization - When frame arrives at IP layer, transmits immediately - Collision probability increases, because can collide in the same or different time slots

3 - Is Ethernet reliable?

No, receiving NIC does not send acks or nacks to sending NIC. data in dropped frames recovered only if initial sender uses higher layer rdt (TCP), otherwise dropped data lost

2c - What flow control is used?

Pacing between sending and receiving nodes so receiving devices not overwhelmed.

2d - Error detection

Receiver detects presence of errors and signals sender for retransmission or drops frame

2e - Error correction

Receiver identifies and corrects bit errors without resorting to retransmission.

2c - Describe the Cyclic Redundancy Check (CRC) algorithm in terms of sender and receiver.

SENDER - Extend D data bits with R zeros (r is chosen) - Divide by generator G (chosen, r+1 bits) - Keep remainder, ignore quotient - Adjust R check bits by the remainder RECEIVER - Divide and check for zero remainder

4 - What are some security issues with switches?

Switch poisoning where attacker fills up switch table with bogus entries by sending large # of frames with bogus source MAC addresses

4 - Describe the difference between routers and switches.

The key difference is that switches are link layer devices while routers are network layer devices

3b - Why might delays still occur?

There is a propagation delay - Entire packet transmission time wasted

3 - What MAC protocol does Ethernet use?

Unslotted CSMA/CD with binary backoff - When you have a collision, you need to back off, the more collisions, the longer you need to back off.

2b - What is Two-Dimensional Parity?

We count in two dimensions - Note: parity bit and parity byte

4 - What if there are multiple switches?

Works exactly the same.

3 - Is Ethernet connectionless?

Yes, no handshaking between sending and receiving NICs

2 - What services does the link layer provide?

a. Framing, link access b. Reliable delivery between adjacent nodes c. Flow control d. Error detection e. Error correction f. half-duplex and full-duplex

2c - What is the length of error bursts that CRC can detect?

all burst errors less than r+1 bits. NOTE: errors often occur in bursts

3b - Why enforce a minimum packet size?

because if packet small, sender will send packet before detects collision

2b - What is the overhead calculation?

(total - data) / total - total = data + overhead bits

2 - Describe the ARP protocol in the same LAN in terms of A sending B a datagram but B's MAC address not in A's ARP table.

- A broadcasts ARP query packet, containing B's IP address - B receives ARP packet, replies to A with its MAC address - A saves IP-to-MAC address pair in its ARP table until TTL NOTE: nodes do not have administrator to create MAC tables

2 - Describe the ARP protocol in different LANs in terms of A sending B a datagram but B's MAC address not in A's ARP table.

- A knows B's IP address through DNS - A knows IP address of first hop router through DNS - A knows MAC Address of first hop router through its routing table. R can then figure out how to reach destination through ARP

1 - What bits are added for error detection?

- Add check bits to the message bits to let some errors be detected and some be corrected - Goal is to structure code to detect many errors with few check bits and modest computation

3b - Describe exponential backoff.

- After mth collision, NIC chooses K at random from {0, 1, 2, ..., 2^(m-1)} - NIC waits K*512 bit times (bit times depends on bandwidth of cable) and then returns to step 2 NOTE: longer backoff interval with more collisions.

3b - How does CSMA/CD (detect collisions)?

- After send packet, sense channels - If collision detected, abort transmission immediately to reduce the channel usage - Difficult in wireless LANs because signal weak, so doesn't use CSMA/CD

1 - Describe components of the MAC address

- Allocated by IEEE - 24: organization - 24: card made by that particular manufacturer - hard coded

3b - Describe Slotted Aloha

- Assumes all frames same size, divide time into equal size slots, nodes start to transmit only slot beginning, all nodes detect collision if 2+ nodes transmit - When node obtains frame, transmits in next slot - If no collision, node can send new frame in next slot - if collision, node retransmits frame in each subsequent slot with probability p until success (p determines if transmit or not)

4 - What are the similarities between routers and switches?

- Both store-and-forward examining headers - Both have forwarding tables. Routers compute tables using routing algorithms, switches learn forwarding table using flooding, learning, MAC addresses NOTE: router cost would be too high for routers to flood.

2 - What is the Address Resolution Protocol (ARP)?

- Determines how we determine the interface's MAC address given its IP address - Each IP node has an ARP table with IP/MAC address mappings for some LAN nodes and TTL time after which address mapping will be forgotten


Kaugnay na mga set ng pag-aaral

Human Growth & Development Final Study Guide

View Set

Ch 7: Energy Balance and Weight Control - unfinished

View Set

Igneous Rocks - GEOL 1114 - Physical Geology

View Set

Combo with "Unit 1.1 Pyschology's History and Approaches" and 21 others

View Set

Texas statues and rules common to all lines

View Set

Chapter 12: Schizophrenia and Schizophrenia Spectrum Disorders

View Set