[Day 3] 4. Data Link and Network Layer
The Data Link Layer and Network Layer work closely to ensure data is transmitted effectively over a network.
-
Data Link Layer (Layer 2): Responsible for framing and addressing (MAC addresses). It ensures error-free transmission between devices on the same local network segment. When data is sent over a network, it is encapsulated into frames, which include MAC addresses and error detection (via CRC).
-
Network Layer (Layer 3): Responsible for logical addressing (IP addresses) and routing packets across networks. It ensures data can traverse different networks and reach its final destination using IP addresses. The Network Layer encapsulates data into packets.
-
How they work together:
- When a packet is generated at the Network Layer, it is passed to the Data Link Layer, where it is encapsulated in a frame. The frame contains MAC addresses for devices on the same local network.
- The Data Link Layer handles local delivery on the same network, while the Network Layer ensures the data can move across different networks by adding IP addresses.
- At each router hop, the Network Layer handles routing based on IP addresses, and the Data Link Layer re-frames the packet with the new MAC addresses as it moves through different physical networks.
-
Data Link - MAC, frames, switches
-
Network - IP, Packets, Routers
Transport layer functionality includes, Windowing or sliding window protocol It provides the error correction It is Connection oriented communication It also got the sequencing, meaning it tracks the label of of the packets it is receiving Flow control, a resource can be asked by many machines, so this occupation of resources is handle by machine (having the resource) using stop bit and ready to go bit, meaning if the resource is demanded while the machine is busy, simply machine will send a stop bit that tell to hold on and when the machine gets free, it sends the ready to go bit.
Routers and Network Configuration
-
Router Interfaces:
- LAN Side (e0): Ethernet interface connected to the internal (local) network.
- WAN Side (s0): Serial interface connected to the external network (such as the internet). Additional interfaces are labeled e1, s1, etc.
-
Ping (Packet InterNet Groper):
- A command used to test network connectivity by sending ICMP (Internet Control Message Protocol) echo request packets to a destination and receiving an echo reply.
-
Default Gateway:
- The IP address of a router that a device uses to send data outside its local network. If a machine wants to communicate with devices on a different network, it must send the data to the default gateway (router).
-
Routing Table:
- A router's internal database that stores information about how to forward packets to different networks. It helps routers determine the best path for data to reach its destination.
-
Cyclic Redundancy Check (CRC):
- CRC is recalculated every time a frame is de-encapsulated and re-encapsulated when passing through routers. It is used for error detection at the Data Link Layer.
-
Routing Protocols:
- Routers use routing protocols to exchange information and build their own routing tables. These protocols allow routers to discover the best routes to forward packets.
Key Components of the OSI Layers
-
Data Link Layer (Layer 2):
- Focuses on MAC addresses and the physical transmission of frames.
- Devices: Switches.
- Protocols: Error detection (e.g., CRC).
-
Network Layer (Layer 3):
- Focuses on IP addresses and routing packets across networks.
- Devices: Routers.
- Protocols: IP, routing protocols (RIP, OSPF, BGP, EIGRP).
Network Layer Concepts
-
Routed Protocols:
- These are protocols that can be routed by routers. The most common example is IP (Internet Protocol).
-
Routing Protocols:
- Protocols used by routers to discover networks and exchange routing information:
- RIP (Routing Information Protocol): A distance-vector routing protocol that uses hop count as a metric.
- OSPF (Open Shortest Path First): A link-state routing protocol that uses the Dijkstra algorithm to determine the shortest path.
- BGP (Border Gateway Protocol): The main protocol used to exchange routing information between autonomous systems (used primarily on the internet).
- EIGRP (Enhanced Interior Gateway Routing Protocol): A Cisco proprietary routing protocol that combines features of both distance-vector and link-state protocols.
- Protocols used by routers to discover networks and exchange routing information:
Read Next
[Day 3] 5. Transport Layer
### Primary Functions: - **Reliability**: Ensures data is transmitted accurately. - **Windowing (Sliding Window Protocol)**: Controls the flow...
[Day 4] 1. Transport Layer
- The **Transport Layer** in the OSI model ensures **reliability** of data transmission and is composed of mechanisms like **flow control** and **erro...