Mada za sehemu hiiDemonstrate understanding of computer networksMada 7
- Demonstrate understanding of OSI and TCP/IP Reference models, transmission media, wireless transmission, the public switched telephone networks, mobile telephone system and Network protocols (HTTP, FTP, IP, PPP, etc)
- Develop understanding of Data link layer (Switched LANs: Link-Layer Addressing and ARP, Ethernet, Link-Layer Switches, VLANs)
- Create a network that make use of wireless or Ethernet technology
- Develop understanding of Network layer (design issues, routing algorithms, Congestion control algorithms, Internetworking, the network layer in the internet (IPv4 and IPv6), Quality of Service)
- Elaborate the transport layer (Transport service, elements of transport protocol, Simple Transport Protocol, Internet transport layer protocols: UDP and TCP)
- Describe the application layer (Domain name system, electronic mail, World Wide Web: architecture; dynamic web document and http)
- Apply network security principles, tools and protocols in computer networks
The data link layer (Layer 2 of the OSI model) provides node-to-node communication within a local area network, translating network layer addresses into hardware addresses and managing frame transmission between directly connected devices. In switched LANs, this layer uses MAC addresses, the Address Resolution Protocol (ARP), Ethernet standards, and Layer 2 switches to create efficient, segmented networks that can be further organized using Virtual LANs (VLANs).
The data link layer enhances the Physical layer's raw bit transmission service by adding reliability features. It performs error notification through acknowledgment mechanisms (ACK/NAK), manages network topology, and implements flow control to prevent buffer overflow at receiving devices. With a functional data link layer protocol, higher layers can assume error-free transmission over the link.
The data link layer consists of two sub-layers that work together to enable communication:
Media Access Control (MAC) Sub-layer determines how packets are placed on the transmission media. In contention-based networks, all devices share the same bandwidth on a "first come, first served" basis. The MAC sub-layer defines physical addressing (MAC addresses), handles line discipline, error notification (though not correction), ordered delivery of frames, and may provide optional flow control.
Logical Link Control (LLC) Sub-layer identifies Network layer protocols and encapsulates them. An LLC header provides instructions to the data link layer regarding how to handle a packet once received. For example, the LLC header may indicate that the packet is destined for the IP protocol at the Network layer. The LLC sub-layer can also offer flow control and sequencing of control bits.
MAC Addresses
Every device on a local area network has a unique MAC (Media Access Control) address, which is used for communication within the same network. This MAC address is a 48-bit identifier usually represented in hexadecimal format. For example: 00:1A:2B:3C:4D:5E.
The MAC address is burned into the network interface card (NIC) during manufacturing and stays with the device throughout its lifetime. When devices communicate on the same local network, they use MAC addresses to identify each other at the data link layer.
Address Resolution Protocol (ARP)
ARP (Address Resolution Protocol) maps a known IP address to an unknown MAC address. When a device wants to communicate with another device on the same network, it uses ARP to find the MAC address associated with the target IP address.
The ARP process works as follows:
- Device A (source) wants to send data to Device B (destination) but knows only Device B's IP address
- Device A broadcasts an ARP request packet on the network asking: "Who has IP address x.x.x.x?"
- All devices on the network receive this request, but only the device with the matching IP address responds
- Device B sends an ARP reply containing its MAC address
- Device A now has both the IP address and MAC address, and can send the data
This mapping is stored in the device's ARP cache for future use.
Ethernet is the dominant technology for wired LANs, defining wiring and signaling standards for the Physical layer and frame formats and protocols for the Data Link layer. Ethernet uses CSMA/CD (Carrier Sense Multiple Access with Collision Detection) to manage access to the shared medium.
Ethernet Frame Structure
An Ethernet frame contains several fields that enable delivery to the correct destination:
- Preamble: 7 bytes for synchronization
- Destination MAC Address: 6 bytes (the receiver's hardware address)
- Source MAC Address: 6 bytes (the sender's hardware address)
- EtherType/Length: 2 bytes (indicates which protocol is encapsulated)
- Payload: 46-1500 bytes (the actual data being transmitted)
- Frame Check Sequence (FCS): 4 bytes (for error detection using CRC)
Ethernet Standards
Ethernet has evolved through several speed standards:
- 10BASE-T (10 Mbps) - Traditional Ethernet
- Fast Ethernet (100 Mbps) - 100BASE-TX
- Gigabit Ethernet (1 Gbps) - 1000BASE-T
- 10 Gigabit Ethernet (10 Gbps) - 10GBASE-T
Link-layer switches (also called Ethernet switches) operate at Layer 2 of the OSI model. They receive incoming frames on one port and forward them to the appropriate output port based on the destination MAC address.
How Switches Work
Switches use MAC address tables to make forwarding decisions. These tables map each MAC address to the corresponding switch port. The switch builds this table dynamically by learning the source addresses of incoming frames.
Switching mechanism:
- When a frame arrives, the switch examines the destination MAC address
- If the destination is in the MAC address table, the frame is forwarded only to the associated port
- If the destination is unknown, the frame is flooded to all ports except the one it arrived on
- The switch learns the source MAC address and associates it with the incoming port
Benefits of Layer 2 Switching
- Reduced collisions: Unlike hubs that broadcast to all ports, switches create separate collision domains for each port
- Full-duplex communication: Devices can send and receive data simultaneously, effectively doubling bandwidth
- Improved network performance: Frames are forwarded only to their intended destination
Layer 2 vs Layer 3 Switching
- Layer 2 switching forwards Ethernet frames based on MAC addresses only
- Layer 3 switching (also called multilayer switching) can also perform routing functions, handling IP addresses and enabling inter-VLAN communication
VLANs allow network administrators to segment a physical network into multiple logical networks. Devices on different VLANs cannot directly communicate without a router or Layer 3 switch.
Configuring VLANs
VLANs are configured on network switches. Each port on a switch can be assigned to a specific VLAN. VLAN tagging using the IEEE 802.1Q standard adds a VLAN identifier to Ethernet frames to indicate VLAN membership.
Benefits of VLANs
- Enhanced security: Network administrators can isolate sensitive traffic and restrict access between groups
- Simplified network management: Makes it easier to expand, relocate, or reorganize network devices without physical changes
- Flexibility: Administrators can configure VLANs in a centralized environment, even for devices in different geographical locations
- Improved performance: Reduces broadcast traffic and improves overall network efficiency by limiting broadcast domains
Disadvantages of VLANs
- Virus propagation risk: A single infected system can potentially spread a virus throughout the entire logical network
- Equipment limitations: Very large networks may require additional routers to manage increased workload
- Latency: While better than WANs, VLANs are generally less efficient in latency control compared to a single physical LAN
Worked Example: School Network with VLANs
Scenario: Mtakuja Secondary School has four departments: Administration, Science, Commerce, and Humanities. The network administrator wants to separate traffic for security and performance.
Solution using VLANs:
| Department | VLAN ID | Network Address | Example IP Range |
|---|---|---|---|
| Administration | 10 | 192.168.10.0/24 | 192.168.10.1 - 192.168.10.254 |
| Science | 20 | 192.168.20.0/24 | 192.168.20.1 - 192.168.20.254 |
| Commerce | 30 | 192.168.30.0/24 | 192.168.30.1 - 192.168.30.254 |
| Humanities | 40 | 192.168.40.0/24 | 192.168.40.1 - 192.168.40.254 |
How it works:
- Each department gets its own logical network (VLAN)
- Sales computers in VLAN 30 cannot directly communicate with Science computers in VLAN 20 without a router
- Broadcast traffic from Science stays within VLAN 20, reducing network congestion for other departments
- If the Science lab computers get infected with a virus, it cannot spread to the Commerce department directly
Inter-VLAN communication: To allow communication between VLANs (e.g., Science teacher needs to access Humanities results server), a Layer 3 switch or router is required. The router would have subinterfaces configured, for example:
- Router subinterface GigabitEthernet0/0.10 for VLAN 10 (gateway: 192.168.10.1)
- Router subinterface GigabitEthernet0/0.20 for VLAN 20 (gateway: 192.168.20.1)
In Tanzania, data link layer concepts are applied when setting up networks in schools, offices, and businesses. For example, when installing a network at a local market in Dar es Salaam, a shop owner might use a Layer 2 switch to connect their point-of-sale (POS) terminals, security cameras, and inventory computers. Using VLANs, they can separate the POS traffic (VLAN 1) from the security cameras (VLAN 2) for better performance and security, ensuring that heavy video traffic from cameras does not slow down transaction processing at the cash register.
Swali
Which of the following is a primary function of the Data link layer in the OSI model?
Ingia ili kuwasilisha jibu lako na lihesabiwe katika umahiri wako.
Ingia ili kufanya mazoeziMwalimu
Umekwama? Niulize chochote kuhusu mada hii.
Ingia ili kumuuliza Mwalimu wa AI wa Sonza kuhusu swali hili.
Ingia ili kuuliza