# Building Ethernet Lans ### Ethernet Operations Ethernet = set of standards that define rules for Frame Format and controlling communication **Components**: ![](https://i.imgur.com/WMXnTh1.jpg) *Ethernet shared bus*: Ethernet that used to connect multiple computers by the same wire. If one computer transmits data, all other devices on the network receives it. *Network segment:* A group of network devices that compete with each other for access to the wire *Network Interface Controller (NIC)/Card*: computer hardware installer in a computer/printer so that it can be connected to a network. Ex: Ethernet cabling/wireless connection Ethernet operates at Layer 1 and 2 **How do devices know when it's their turn to send data** Access to the physical wire or segment is controlled by MAC protocol. Ethernet uses Carrier Sense Multiple Access with Collision Detection (CSMA/CD) as its MAC protocol (regulates the "conversation"). *Half-duplex communication*: CSMA/CD protocol allows a network device to either transmit data or receive data, but not both simultaneously #Collision occurs, send jam signals, both devices stop transmitting, wait, and attempt to transmitting again when wire is idle **How do devices know which data is for them** When a device needs to send data, NIC encapsulates it into an Ethernet frame. NIC adds 8-byte sequence (preamble and start delimiter) to denote start of new frame. Preamble and start delimiter are not consider part of Ethernet frame ![](https://i.imgur.com/HBIbtbZ.jpg) ![](https://i.imgur.com/O9q8aqu.jpg) **How do devices know which data is for them** *PROM chip*: Programmable Read Only Memory. Unique address burned onto NIC by manufacturer. *Destination Layer 2 Address*: MAC address of the device that'll receive the frame. *Source Layer 2 Address*: MAC address of the device that is sending the frame. *Type*: Identifies which Layer 3 Protocol is being transported in the Ethernet frame. Ex: IP, Appletalk, IPX, etc. *Data*: Contains the original data created by an application as well as the headers that have been added by each layer during the encapsulation process. *Checksum*: Includes a cyclic redundancy check (CRC), which is a method of checking for errors in data that has been transmitted on a communications link. *MAC address*: 48-bit (6-byte) address that uniquely identifies a device’s NIC and expressed in hexadecimal Displayed by colons or dashes ![](https://i.imgur.com/PWXSfUE.jpg) Every device on network receives frame, but it compares destination address with its own address to determine if it’s for them. If MAC addresses match, device checks if CRC Checksums match and determines upper layer protocol. Then its trips off the Ethernet frame and forward the data to the appropriate upper layer protocol. - Individual/unicast address: unique to one recipient address. Ex: 0019.D16E.9282 - Broadcast destination MAC address: send the same data to every device on the network. Alaways begin with 01. Ex:0100.5e7f.fffa - Group/multicast address (flooding): send the same data to a group of devices on the same network. Ex:ffff.ffff.ffff ### Early Ethernet Network Devices *Repeater*: Physical laver device used to connects physical cable segments together. Extends the length of Ethernet physical cable and isolates failing cables. Adds time to transmission. **5-4-3 Rule**: ensures repeaters don’t violate transmission time limitations. ![](https://i.imgur.com/iO6TXLT.jpg) Populated/user cable segments: contains end-user devices. Unpopulated/link cable segments: connect repeaters together. No end-user devices. **Cabling**: - Coaxial cabling: used with Ethernet in early 1980s. - Twisted Pair Cabling: since introduction of IEEE 10BASE-T standard. ![](https://i.imgur.com/4n5t60G.jpg) *Hub*: Replaced repeater with central hub in star configuration. - Each devices uses its own twisted cable to connect to a port on a hub - Unlike shared bus configuration with repeater, which are susceptible to failure if one device/wire causes problems. - Just a junction - CSMA-CD. - Collisions still occur within hub. ![](https://i.imgur.com/aIIXfIb.jpg) *Bridge*: Decreases collision probability by breaking up large network into smaller collision domain. This process called network segmentation and operates at Layer 2 (regulate traffic flow using MAC Addresses). ![](https://i.imgur.com/byDEN7d.jpg) 3 basic functions of Ethernet bridges: * Forwarding frames * Learning MAC addresses * Controlling traffic *MAC Address Table*: Bridge adds new frame addresses to table (only Source address) with its port. Drops frames if it already appears on table & on the same port to reduce network traffic. Selectively forwards frames if the address already appears on table, but port is different. ![](https://i.imgur.com/oV0nmHJ.jpg) ![](https://i.imgur.com/kdvhRTc.jpg) If the bridge has multiple paths, a loop will be formed and there will be repeated sending of frames and chaos in the MAC Address table. ### Today's Network Devices ![](https://i.imgur.com/wfvPYbI.jpg) **Network Bandwidth** - Data transfer rate/bit rate - Bits of data per second (bps or bits/s) - Maximum capacity of a network connection **Network Throughput** Actual amount of data that can be sent over a network in a given period of time (Actual capacity). If many people use the network, network throughput slows down. ![](https://i.imgur.com/e5CkaAl.jpg) ![](https://i.imgur.com/KWtxyXF.jpg) Fiber optic cable > Phone line ![](https://i.imgur.com/1BRIF6D.jpg) ![](https://i.imgur.com/EYyyCzv.jpg) ![](https://i.imgur.com/fgZHWLX.jpg) The difference between a bridge and a switch is that a bridge commonly has 2 or 4 ports, whereas a switch can have a few ports or hundreds of ports, with each port dedicated to a single end-user device -> each collision domain has only two devices (end-user device and switch) -> **Full-Duplex data transmission** ![](https://i.imgur.com/JsmPVT9.jpg) ![](https://i.imgur.com/jW8dzBX.jpg) *Vlan*: Group of PCs, servers, other network devices that may be connected to the same switch as other devices but behave as if they're connected to the same smaller LAN or completely separate switch. No broadcast from another VLAN. ![](https://i.imgur.com/bKLuk7r.jpg) ![](https://i.imgur.com/bOHfTCD.jpg) Limitations of switches: - Susceptible to network loops (Spanning-Tree Protocols) - Might not improve performance with multicats and broadcast traffic - Might not be able to interconnect geographically dispersed networks Routers (Layer 3) can avoid this issues ### Wireless LANs WLAN Architectures types: 1. Autonomous Fat Access Point (Fat AP), 802.11, home network 2. Centralized Switched WLAN System, Thin Access Points (Thin APs) are managed by the access point controller, enterprise, most secure Access Point Controller provide: - Security and access control - VLAN management and manipulation - User roaming between access points - Quality of service 3. Distributed Wireless Mesh System, used to create a dynamic network in environments for cabling would be impossible, US military #### 802.11 Group of Standards - Responsible for standards at Layer 1 and a part of Layer 2 (MAC sub-layer) - *1997* - IEEE 802.11 standard *1999* - Wi-Fi brand adopted - Indoors 100 m, outdoors 500 m ##### LAYER 1 ![](https://i.imgur.com/bjp7QWn.jpg) FHSS: Frequency-hopping spread spectrum modulation DHSS: Direct sequence spread spectrum modulation. Used to control interference OFDM: Orthogonal frequency-division multiplexing. Able to cope with sever channel condition ##### LAYER 2 Turns to use the wireless channel Comparing wireless Ethernet and wired Ethernet: **Wireless** - Uses Carrier Sense Multiple Access/Collision Avoidance (CSMA/CA) - Collisions cannot be detected, so positive acknowledgements are required ![](https://i.imgur.com/tijkh2w.jpg) **Wired** - Uses CSMA/CD - Relies on detecting collisions when they take place ![](https://i.imgur.com/YOCdPYC.jpg) **CSMA/CA** Network multiple access method in which carrier sensing is used, but nodes attempt to avoid collisions by beginning transmission only after the channel is sensed to be "idle". Collision detection of the alternative CSMA/CD is not possible due to wireless transmitters desensing their receivers during packet transmission. 802.11 Standard at this layer: - CSMA/CA - Vitual collision detection - Async data transfers - Security (access control, authentication, and encryption) - Roaming between access points - Power saving - Quality of service ![](https://i.imgur.com/KxBDgP8.jpg) *Preamble*: to determine the beginning of the new frame *Greenfield preamble*: environment that has no legacy devices, increase throughput Mix environment: send both *Frame control* - Type and subtype frame - From or going to the distribution system - If the frame is a fragment of a larger frame, whether there are more fragments *Duration* - Specifies a time interval, other clients that read this signal should not transmit data - Ensuring optimum use of the channel and for avoiding contention. *Destination Layer 2 Address*: Wireless client or the wireless access point the frame is destined to. *Source Layer 2 Address*: Specifies the Layer 2 or MAC address of the device that is sending the frame. *Third Address*: Original source MAC address or the ultimate destination MAC address of this particular frame. *Sequence Control*: Contains sequence and fragment numbers to help the receiving device reassemble frames and fragmented frames in the intended order. *Fourth Address*: "wireless distribution system" where data is actually being repeated between the access points. Common types of 802.11 frames (Frame Control field): - Data: Regular data being transmitted, Certain types of special messages intended for the access point - Control: Request to send (RTS), clear to send (CTS), acknowledgement - Management: Beacons sent by access points to advertise the wireless network, Probes sent by a client looking for a particular wireless network **Finding Access Point** Passive scanning 1. Client find access point to connecting/searching for particular network 2. Access point on the specify network will respond if it's available for connections. If there's more than 1, client choose the one with the stronger signal 3. Access point give the association ID 4. Client and access point are associated and can send data **Handling Collisions** - CSMA/CA method - Virtual collision detection method (RTS/CTS with specific duration). Used for frames that are larger than a certain threshold **Frame control settings** *RTS Threshold*: Size of frame above which the RTS/CTS mechanism must be used *Retry counters*: * Short: Frames smaller than RTS threshold * Long: Frames larger than RTS threshold *Fragmentation threshold*: Size of packet should be split into fragments *Fragment lifetime*: Fragments are discarded when this expires