Chapter 6- Ethernet-VE2 2
Introduction to Networking
Course Code: CT043-3-1
Module: Ethernet (Frame)
Cisco Ethernet Switching
Understand the importance of Ethernet in networking and its basic operational structure.
Lesson Structure and Topics
Topics and Structure of the Lesson
Ethernet Frame: Explain the relationship between Ethernet sublayers and frame fields.
Ethernet MAC Address: Describe what an Ethernet MAC address is.
MAC Address Table: Explain how a switch builds its MAC address table and how it forwards frames.
Switch Speeds and Forwarding Methods: Describe methods of switching and port settings available on Layer 2 switch ports.
Key Terms to Master
Ethernet encapsulation
Data Link sublayers and MAC sublayers
Ethernet Frame Fields and MAC address
MAC address and Hexadecimal
Unicast, Multicast, and Broadcast MAC address
MAC address Table
Switching learning and Forwarding
Frame Forwarding and cut-through switching
Half and Full Duplex
Duplex and speed settings
Auto-MDIX
MAC and IP
Address Resolution Protocol (ARP)
ARP Broadcast and ARP Spoofing
OSI Model
Overview of the OSI Model Layers
Application: Data (Application Layer)
Presentation: Data Representation and Encryption
Session: Data Interhost Communication
Transport: Segments End-to-End Connections and Reliability
Network: Packets Path Determination and Logical Addressing (IP)
Data Link: Frames, MAC and LLC, Physical Addressing
Physical: Bits, Media, Signal, and Binary Transmission
Ethernet Frames
Ethernet Operations
Ethernet Layers: Operates in Data Link Layer and Physical Layer.
Standards: Defined in IEEE 802.2 and 802.3 standards.
Data Link Sublayers
Functionality of Ethernet Sublayers
LLC Sublayer (IEEE 802.2)
Identifies network layer protocols.
MAC Sublayer (IEEE 802.3, 802.11, 802.15)
Responsible for data encapsulation and media access control.
MAC Sublayer Functions
Data Encapsulation: Consists of Ethernet frame, Ethernet addressing (source & destination MAC addresses), and error detection (FCS - Frame Check Sequence).
Media Access: Different standards over media (copper and fiber) using full-duplex and half-duplex.
Wired LAN: Operates in full-duplex, eliminates the need for CSMA/CD.
Wireless LAN: Shared half-duplex medium using CSMA/CA.
Ethernet Frame Fields
Size Specifications: Minimum frame size is 64 bytes; maximum is 1518 bytes.
Frames less than 64 bytes discard as collision fragments.
Frames over 1500 bytes signify jumbo/baby giant frames.
Ethernet MAC Address
MAC Address Representation
Format: 48-bit value expressed in 12 hexadecimal digits.
Example: 00-B0-D0-63-C2-26.
Uses ARP to view current MAC address with IPCONFIG /ALL.
Unique MAC Addressing
All MAC addresses must be unique within the LAN; obtained using a vendor OUI code.
Types of MAC Addresses
Unicast MAC Address
Unique address for single device communication.
Broadcast MAC Address
Destination = FF:FF:FF:FF:FF:FF; received by all devices on LAN.
Multicast MAC Address
Received by a group of devices; starting MAC address format (IPv4: 01-00-5E; IPv6: 33-33).
MAC Address Table
Switch Fundamentals
Layer 2 switch uses MAC addresses for forwarding, not concerned with data payload.
MAC address table is initially empty when the switch is powered on.
Switch Learning and Forwarding
Examines Source MAC addresses to learn the network topologies and make forwarding decisions.
Updates timer entries in the MAC address table by default up to 5 minutes.
Filtering Frames
By populating its MAC address table, a switch can filter frames to appropriate ports.
Switch Speeds and Forwarding Methods
Frame Forwarding Methods
Store-and-Forward Switching: Entire frame received, CRC computed, and error-checked before forwarding.
Cut-Through Switching: Forwarding starts as soon as the destination MAC is read; no error-checking.
Variants: Fast-forward and Fragment-free switching.
Duplex and Speed Settings
Full-Duplex: Concurrent send/receive.
Half-Duplex: One sends at a time.
Duplex Mismatch: Common performance issue; should synchronize settings.
Auto-MDIX Feature
Automatically configures the switch port for the correct crossover straight-through cable type.
MAC and IP Interactions
Same Network Connections
Layer 2 MAC addresses deliver frames between NICs on the same network.
Remote Network Connections
Uses default gateway MAC address when IP address is outside local network; ARP maps IP to MAC correspondence.
ARP Overview
Functions of ARP
Resolves IPv4 addresses to MACs, maintaining an ARP table to facilitate communication.
ARP Table Management
Entries expire based on cache timers; can be manually cleared.
ARP Issues
Excessive broadcasts and spoofing attacks can affect network performance; mitigation techniques should be employed.
Summary
Key Focus Areas:
Operation of Ethernet and switches.
Importance of ARP in facilitating network communication.
Creating a Plinko game using JavaScript involves designing the game logic and visuals. Here's a simplified outline of how to approach this:
Steps to Create a Plinko Game:
Set Up the HTML Structure:
Create a canvas element in your HTML file where the game will be rendered.
<canvas id="plinkoCanvas" width="500" height="600"></canvas>Initialize the Game in JavaScript:
Set up variables for the canvas, context, and game elements such as pegs, balls, and slots.
const canvas = document.getElementById('plinkoCanvas'); const ctx = canvas.getContext('2d'); // Game variables const pegs = []; // To hold peg objects const balls = []; // To hold ball objects const slots = []; // To hold score slotsDefine Pegs and Slots:
Create functions to draw pegs and slots on the canvas. For example:
function drawPeg(x, y) { ctx.beginPath(); ctx.arc(x, y, 5, 0, Math.PI * 2); ctx.fillStyle = '#fff'; ctx.fill(); ctx.closePath(); }Implement the Drop Logic for Balls:
Create a function to manage the dropping of balls, which will simulate the falling motion and interaction with pegs. For example:
function dropBall() { let ball = { x: 250, y: 0, speed: 0 }; balls.push(ball); }Update and Draw the Game:
Use the
requestAnimationFrameto continuously update the canvas and redraw pegs, balls, and slots based on their current states.
function update() { ctx.clearRect(0, 0, canvas.width, canvas.height); // Draw pegs for (let peg of pegs) { drawPeg(peg.x, peg.y); } // Draw balls for (let ball of balls) { /* Update and draw ball */ } // Check for collisions with pegs and update ball positions requestAnimationFrame(update); }Handle Win/Loss Scenarios:
Determine where the ball lands in the slots and update scores accordingly.
User Interaction:
Implement a way for users to "launch" a ball (e.g., by clicking a button) which triggers the
dropBallfunction.
Additional Tips:
Use basic physics for ball movement (gravity, bouncing).
Customize styling, colors, and scoring system as per your design requirements.
Consider using libraries like p5.js for easier handling of graphics and physics.
This is a basic guideline to get you started. You can expand upon this with more features, such as sounds and animated effects.