CSNETWK_07_LAN_Summary.pdf

Full Transcript

SUMMARY Local Area Networks LINK LAYER In the Link Layer, nodes (hosts and routers) are connected via physical wires, wireless links, or local area networks, with frames serving as Layer 2 packets encapsulating IP packets, facilitating packet transfer between physically adjacent nodes. IP...

SUMMARY Local Area Networks LINK LAYER In the Link Layer, nodes (hosts and routers) are connected via physical wires, wireless links, or local area networks, with frames serving as Layer 2 packets encapsulating IP packets, facilitating packet transfer between physically adjacent nodes. IP packets cross different links with varying link protocols in an end-to-end context, each using distinct services and characteristics. The Link Layer encapsulates Network Layer packets, adds its own header fields, and transmits frames to the Physical Layer for bit-level transmission over physical media. It controls node access via Multiple Access Protocol (MAC Protocol), introducing a 48-bit MAC addressing scheme for individual link use, distinct from IP addressing. Additionally, it ensures reliable delivery between adjacent nodes. Additional Link Layer services include flow control to match transmission speeds between sender and receiver, error detection and correction, and support for both half-duplex (one-way data transfer) and full-duplex (simultaneous two-way data transfer) communication. LINK LAYER The Link Layer includes hardware components such as network interface cards (NICs) attached to the host system bus, handling lower-level functions like demultiplexing and interrupts. This division marks where hardware implements lower Link and Physical Layer functions, while software manages upper Link Layer and higher protocol stack layers. On the sending side, the interface encapsulates the IP packet in a Link Layer frame, adding error checking, reliable data transfer, and flow control for Link Layer services, before passing the frame to the Physical Layer for transmission. On the receiving side, the Link Layer receives the frame from the Physical Layer, performs error checking and flow control, removes the IP-packet payload, and passes it up to the Network Layer. The Network Layer sends a datagram to the Link Layer for transmission. The sender adds header fields to create a frame with 'D' bits and computes/appends error detection and correction bits (EDC). The frame is then transmitted over a link, which can introduce bit errors. The receiver checks for corruption; if the frame passes, it extracts the datagram for the Network Layer. Error detection isn't perfect; protocols might miss rare errors.A larger EDC field improves detection and correction. LINK LAYER The simplest error detection is Parity Checking, where a single parity bit ensures the total number of bits (including the original 'D' bits and additional parity bit) is even. In 2-dimensional parity checks, bits are arranged in a grid, with the receiver checking both row and column parity to detect and locate bit errors for correction. MULTIPLE ACCESS PROTOCOLS There are two types of links: Point-to-point, operating between a single sender and receiver, and Broadcast, connecting multiple senders and receivers. Multiple Access Protocols fall into three categories: 1. Channel Partitioning Protocols: such as time-division multiplexing (TDM), frequency-division multiplexing (FDM), and code division multiple access (CDMA). 2. Random Access Protocols: including ALOHA, Carrier Sense Multiple Access (CSMA), and Ethernet CSMA. 3. Taking Turns Protocols: like polling and token-passing protocols. MULTIPLE ACCESS PROTOCOLS Channel Partitioning Protocols In TDMA, the channel access is divided into rounds and slots, with each node allocated one or more slots per round; unused slots remain idle. In FDMA, the frequency band is divided into sub-bands, with each node allocated one or more sub-bands; unassigned sub-bands or idle nodes with no assigned sub-band remain unused. Random Access Protocols Lack prior node coordination, allowing simultaneous transmissions and resulting in collisions. The pioneering ALOHA protocol introduced allowing collisions and using randomization for collision recovery. Slotted ALOHA is a protocol where time is divided into slots, and nodes can only transmit at the beginning of each slot. If two nodes transmit simultaneously, a collision occurs. Nodes retry transmission in subsequent slots with a certain probability until successful, improving efficiency compared to the original ALOHA protocol. Carrier Sense Multiple Access (CSMA) listens before transmitting: if the channel is free, it sends the entire frame; if busy, it waits. CSMA with Collision Detection (CSMA/CD) quickly stops colliding transmissions to reduce wasted channel time. Collisions can still happen due to delays and distances between nodes. Detecting collisions helps avoid transmitting damaged frames completely, improving protocol efficiency. MULTIPLE ACCESS PROTOCOLS Ethernet with CSMA/CD operates as follows: NIC receives datagram from Network Layer and encapsulates it into a frame. NIC performs carrier sensing: transmits immediately if the channel is clear, waits if busy. If the frame is sent without collision, the transmission is complete. If interference is detected during transmission, NIC stops and sends a jam signal. NIC then enters a backoff phase, increasing wait time after each collision. MULTIPLE ACCESS PROTOCOLS Taking Turns Protocols Combine collision-free allocation with efficient channel use. In Polling, a master node coordinates access by sending explicit polling messages to nodes with data to send. Each node uses the channel briefly, minimizing idle time but introducing control overhead and a single point of failure. Token Passing uses a ring topology where nodes pass a control token sequentially. The node holding the token transmits, then passes it to the next node. This method minimizes collisions but introduces token overhead, latency, and a single point of failure with the token. LOCAL AREA NETWORK An IP address is a 32-bit Layer 3 address for routing packets (e.g., 28.119.40.136). A MAC address, 48-bit and crucial for Ethernet, identifies devices (e.g., 1A-2F- BB-76-09-AD). No two adapters share the same MAC address; IEEE manages this by assigning chunks of address space. Unlike IP addresses, which have hierarchical structures (network and host parts) and change when hosts move networks, MAC addresses are flat and portable across LANs. Address Resolution Protocol (ARP) translates between IP and MAC addresses. Each device maintains an ARP table with IP-to-MAC mappings and TTL, typically expiring in 20 minutes. ETHERNET Ethernet is widely used in wired LANs because it was one of the first high- speed technologies, is simpler and cheaper than alternatives like FDDI and ATM, constantly improves data rates, and has become standardized hardware. Initially using a coaxial bus causing collisions, Ethernet maintained a bus topology until the mid-90s, functioning as a broadcast LAN where all nodes processed all frames. By the early 2000s, Ethernet shifted to a star topology with switches replacing hubs, preventing collisions and operating up to Layer 2, unlike routers which manage Layer 3. ETHERNET The Ethernet frame includes: An 8-byte Preamble with specific patterns to synchronize sender and receiver clocks. Destination Address: Contains the MAC address of the receiving device. Source Address: Contains the MAC address of the sending device. Frames are forwarded if they match the destination or broadcast MAC address; otherwise, they are discarded. Type field: Links protocols between layers. Data field: Carries the IP datagram. CRC field: Detects and discards frames with errors. Ethernet technologies offer connectionless service to the Network Layer, akin to IP's layer 3 datagram and UDP's layer 4 service. It provides unreliable transmission where frames undergo CRC checks upon reception without acknowledgments for successful frames or failures, simply discarding failed frames. The IEEE 802.3 Working Group develops Ethernet standards, defining physical media and operational characteristics, though numerous variations exist today. ETHERNET SWITCH Switches in Ethernet form a star topology and use store-and-forward packet switching to receive and forward Link Layer frames between outgoing links. They operate transparently to hosts and routers within the subnet, forwarding frames without prior knowledge. Switches are plug-and-play, self-learning devices that require no configuration, making them easy to install and use. In full-duplex Ethernet LANs using switches, collisions are eliminated as the switch manages transmissions to ensure only one frame is forwarded per interface at a time. The Switch Table stores entries for LAN hosts and routers, including MAC addresses, associated switch interfaces, and entry timestamps. Self-learning switches start with an empty table and populate it by recording which hosts are reachable through each interface. As frames arrive, the switch notes the sender's LAN segment. If all hosts send frames, each gets recorded. Entries expire if no frames are received from that address after a time.These switches can connect seamlessly. In small networks with a few hundred hosts and few LAN segments, switches manage traffic locally, boosting overall throughput without needing IP address configuration. Larger networks with thousands of hosts add routers to isolate traffic more effectively, manage broadcast issues, and optimize routes between hosts. SWITCHES VS ROUTERS Routers and switches both forward packets, but routers use Network Layer addresses while switches use MAC addresses. Routers operate at Layer 3 and maintain routing tables with routing algorithms. Routers use IP addresses to make decisions for inter-network communication, Switches operate at Layer 2, maintaining switch forwarding tables and implementing flooding and learning mechanisms. Switches use MAC addresses for intra-network communication.

Use Quizgecko on...
Browser
Browser