Understanding Network Fundamentals: From OSI Model to Routing Protocols

OSI Model and Network Fundamentals

OSI Layers and Their Functions

The Open Systems Interconnection (OSI) model is a conceptual framework that standardizes network communication. It consists of seven layers, each with specific functionalities:

  1. Physical Layer: Transmits raw bits over a physical medium. Handles encoding, signaling, physical media, data transmission, physical topologies, transmission modes, and switching mechanisms.
  2. Data Link Layer: Ensures reliable data frame transfer between nodes. Key functions include framing, addressing, error control, flow control, synchronization, and multi-access.
  3. Network Layer: Manages data packet delivery from source to destination using addressing and routing.
  4. Transport Layer: Guarantees complete message delivery from source to destination host. Provides service-point addressing, segmentation and reassembly, connection control, flow control, error control, multiplexing, and de-multiplexing.
  5. Session Layer: Establishes and manages communication sessions between users. Offers services like dialog control and synchronization.
  6. Presentation Layer: Ensures proper syntax and semantics of transmitted information. Handles translation, compression, and encryption.
  7. Application Layer: Facilitates communication between software applications and the network. Manages user interactions and data exchange. Key functions include user interface, security, file transfer, e-mail, database access, and addressing.

Transmission Impairment

Signals traveling through transmission media can experience impairments due to imperfections in the medium. Common causes include:

  • Attenuation: Signal strength weakens over distance.
  • Distortion: Signal shape changes, leading to data corruption.
  • Noise: Unwanted signals interfere with the desired signal. Types of noise include thermal, crosstalk, impulse, and intermodulation.

Channel Capacity

  • Noiseless Channel (Nyquist Bit Rate): Defines the theoretical maximum bit rate for a channel without noise. Bit Rate = 2 * Bandwidth * log2(L) bits/sec, where L is the number of signal levels.
  • Noisy Channel (Shannon Capacity): Determines the theoretical highest data rate for a noisy channel. Capacity (Maximum Data Rate) = Bandwidth * log2(1 + SNR) bits/sec, where SNR is the Signal-to-Noise Ratio. Decibels (dB) = 10 * log10(S/N)

Network Performance Metrics

  • Latency: Total time for data to travel from source to destination. Latency = Propagation Time + Transmission Time + Queuing Time + Processing Delay
  • Propagation Time: Time for a signal to travel through a medium. Propagation Time = Distance (m) / Propagation Speed (m/s)
  • Transmission Time: Time to push all bits of data onto the link. Transmission Time = Message Size / Bandwidth
  • Throughput: Amount of data transmitted per unit time. Throughput = Size of Transmitted Data (in bits) / Time Duration

Data Link Layer and Multiplexing

Multiplexing

Multiplexing combines multiple signals into one signal over a shared medium. Types include:

  • Analog Multiplexing:
    • Frequency Division Multiplexing (FDM)
    • Wavelength Division Multiplexing (WDM)
  • Digital Multiplexing:
    • Time Division Multiplexing (TDM):
      • Synchronous: All signals share the same sampling rate and clock input.
      • Asynchronous: Signals have different sampling rates and clock signals.

Switching

Switching forwards packets from one port to another based on destination address. Types include:

  • Circuit Switching: Establishes a dedicated route between sender and receiver before data transmission.
  • Message Switching: Sends the entire message as a unit, routed and stored at intermediate hubs.
  • Packet Switching: Divides the message into packets, each routed independently.

Data Link Layer Functionality

Key functions of the data link layer include:

  • Framing: Encapsulates data into frames for transmission.
  • Addressing: Provides MAC addresses for device identification.
  • Error Control: Detects and corrects transmission errors.
  • Flow Control: Manages data flow to prevent buffer overflow.
  • Synchronization: Ensures sender and receiver operate in sync.
  • Multi-Access: Handles multiple devices sharing the same medium.

Flow Control Techniques

  • Stop-and-Wait Flow Control: Sends one frame at a time, waiting for acknowledgment before sending the next.
  • Sliding Window Flow Control (Go-Back-N): Allows multiple frames to be sent without waiting for individual acknowledgments.

Error Control and Detection

  • Error Control Techniques:
    • Stop and Wait ARQ
    • Sliding Window ARQ (Go-Back-N ARQ, Selective Repeat ARQ)
  • Error Detection Techniques:
    • Parity Check
    • Checksum
    • Cyclic Redundancy Check (CRC)

Data Link Layer Protocols

  • High-level Data Link Control (HDLC): A bit-oriented protocol for point-to-point data transmission. Supports Normal Response Mode (NRM) and Asynchronous Balanced Mode (ABM). HDLC frames consist of six fields: Flag, Address, Control, Payload, and FCS.
  • Point-to-Point Protocol (PPP): Used to transmit multiprotocol data between two directly connected computers.

Channel Allocation and Multiple Access

Channel Allocation

Assigns communication channels to users or devices. Types include:

  • Static Channel Allocation: Each user receives a fixed portion of the frequency channel.
  • Dynamic Channel Allocation: Frequency bands are not permanently assigned, allowing for more flexible allocation.

Multiple Access Protocols

Enable multiple devices to share the same communication medium. Categories include:

  1. Random Access Protocols:
    • Aloha: Devices transmit whenever they have data, leading to potential collisions.
    • CSMA (Carrier Sense Multiple Access): Devices listen for an idle medium before transmitting, reducing collisions.
    • CSMA/CD (Carrier Sense Multiple Access with Collision Detection): Devices detect collisions during transmission and stop transmitting to minimize impact.
    • CSMA/CA (Carrier Sense Multiple Access with Collision Avoidance): Devices use virtual carrier sensing to avoid collisions in wireless networks.
  2. Controlled Protocols:
    • Reservation
    • Polling
    • Token Passing
  3. Channelization Protocols:
    • FDMA (Frequency Division Multiple Access)
    • TDMA (Time Division Multiple Access)
    • CDMA (Code Division Multiple Access)

VLANs and Network Addressing

VLAN (Virtual Local Area Network)

Logically segments a physical network into multiple independent networks, each with its own broadcast domain.

VLAN Trunk Configuration

Switch# configure terminal
Switch(config)# interface interface-id
Switch(config-if)# switchport mode trunk
Switch(config-if)# switchport trunk native vlan 610
Switch(config-if)# switchport trunk allowed vlan vlan-list
Switch(config-if)# end

IPv4 Header Format

The IPv4 header contains essential information for routing and delivering packets:

  • Version: Indicates the IP version (e.g., IPv4).
  • IHL: Internet Header Length, specifying the header size.
  • DSCP: Differentiated Services Code Point, used for Quality of Service (QoS).
  • ECN: Explicit Congestion Notification, signaling network congestion.
  • Total Length: Total size of the IP packet, including header and payload.
  • Identification: Unique identifier for fragmented packets.
  • Flags: Control fragmentation and reassembly.
  • Fragment Offset: Position of a fragment within the original packet.
  • Time to Live (TTL): Limits the packet’s lifespan in the network.
  • Protocol: Identifies the upper-layer protocol (e.g., TCP, UDP).
  • Header Checksum: Verifies header integrity.
  • Source Address: IP address of the sender.
  • Destination Address: IP address of the receiver.
  • Options: Additional information, such as security or routing options.

Static NAT Configuration

en
Router#Config t
Router config# int fa0/0 
Router config-if# ip nat inside, exit
Router config# int se2/0
Router config-if# ip nat outside, exit
Router config# ip nat inside source static 192.168.1.2(inside ip) 1.1.1.1 (public ip),  ip route 0.0.0.0 0.0.0.0 se2/0 , Exit
Show ip nat tra

IPv6 Header Format

:

Version (4-bits): It represents the version of Internet Protocol, i.e. 0110. Traffic Class (8-bits): These 8 bits are divided into two parts. The most significant 6 bits are used for Type of Service to let the Router Known what services should be provided to this packet. The least significant 2 bits are used for Explicit Congestion Notification (ECN). Flow Label (20-bits): This label is used to maintain the sequential flow of the packets belonging to a communication. The source labels the sequence to help the router identify that a particular packet belongs to a specific flow of information. This field helps avoid re-ordering of data packets. It is designed for streaming/real-time media. Payload Length (16-bits): This field is used to tell the routers how much information a particular packet contains in its payload. Payload is composed of Extension Headers and Upper Layer data. With 16 bits, up to 65535 bytes can be indicated; but if the Extension Headers contain Hop-by-Hop Extension Header, then the payload may exceed 65535 bytes and this field is set to 0. Next Header (8-bits): This field is used to indicate either the type of Extension Header, or if the Extension Header is not present then it indicates the Upper Layer PDU. The values for the type of Upper Layer PDU are same as IPv4’s. Hop Limit (8-bits): This field is used to stop packet to loop in the network infinitely. This is same as TTL in IPv4.The value of Hop Limit field is decremented by 1 as it passes a link (router/hop). When the field reaches 0 the packet is discarded.

PAT Configuration:
en
R1(config)#int fa0/0
R1(config-if)#ip nat inside
R1(config-if)#int se0/1
R1(config-if)#ip nat outside
R1(config)#access-list 1 permit 10.0.0.0(local network id) 0.255.255.255 (wildcard mask)
R1(config)#ip nat pool PAT (nat name) 1.1.1.1 1.1.1.1 (public ip range) netmask 255.0.0.0
R1(config)#ip nat inside source list 1 pool PAT overload
Router config# ip route 0.0.0.0 0.0.0.0 se2/0
Exit
Show ip nat tra


Functions of the transport layer: Service-point addressing, Segmentation and Reassembly, Connection Control, Flow control, Error Control, Multiplexing and De-multiplexing. Open loop congestion control Policies: Retransmission Policy, Window, Discarding, Acknowledgment, Admission. Closed loop congestion control Policies: Backpressure, Choke Packet Technique, Implicit Signaling, Explicit Signaling, Forward S, Backward S. 

Functions of application layer: User Interface, Security, File Transfer, E-mail, Database Access, Addressing

OSPF, or Open Shortest Path First, functions through routers exchanging data regarding the network’s topology via a link-state algorithm. Routers initially discover neighboring devices, establish connections, and start exchanging link-state advertisements, which detail information about the router, its connected links, and their statuses. This data is then compiled into a Link-State Database (LSDB) within each router. Using the LSDB, routers calculate the shortest paths to all destinations through the Shortest Path First (SPF) algorithm, resulting in routing tables being updated to reflect the optimal paths. Throughout this process, routers continuously exchange routing information by flooding LSAs, ensuring consistency within the network. OSPF’s dynamic nature allows for efficient routing and swift adaptation to network changes, facilitating robust network performance.

RIP (Routing Information Protocol) is an older routing protocol used in computer networks. It’s simple and easy to set up. RIP routers share information about network destinations and the number of hops to reach them. RIP uses hop count as its measure of distance. However, it has limitations like slower convergence and scalability issues compared to more modern protocols like OSPF.

Border Gateway Protocol (BGP): It helps manage how packets are routed on the internet via exchange of information between edge routers. It provides network stability for routers if one internet connection goes down while forwarding the packets, it can adapt another network connection quickly to send the packets.

Types of ARP: ARP, Reverse ARP (RARP), Inverse ARP, Proxy ARP,Gratuitous ARP

ICMP is a protocol used by network devices, like routers and hosts, to communicate various types of control messages. These messages include notifications of errors, network congestion, and other informational messages necessary for the proper functioning of IP networks.